bpmn-js 9.2.0 → 9.3.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 +15 -2
- package/dist/assets/bpmn-js.css +33 -4
- package/dist/bpmn-modeler.development.js +5522 -5188
- package/dist/bpmn-modeler.production.min.js +7 -7
- package/dist/bpmn-navigated-viewer.development.js +2 -2
- package/dist/bpmn-navigated-viewer.production.min.js +1 -1
- package/dist/bpmn-viewer.development.js +2 -2
- package/dist/bpmn-viewer.production.min.js +1 -1
- package/lib/Modeler.js +1 -1
- package/lib/features/.DS_Store +0 -0
- package/lib/features/align-elements/.DS_Store +0 -0
- package/lib/features/align-elements/AlignElementsContextPadProvider.js +87 -0
- package/lib/features/align-elements/AlignElementsIcons.js +15 -0
- package/lib/features/align-elements/AlignElementsMenuProvider.js +72 -0
- package/lib/features/align-elements/BpmnAlignElements.js +39 -0
- package/lib/features/align-elements/index.js +23 -0
- package/lib/features/align-elements/resources/align-bottom-tool.svg +5 -0
- package/lib/features/align-elements/resources/align-horizontal-center-tool.svg +5 -0
- package/lib/features/align-elements/resources/align-left-tool.svg +5 -0
- package/lib/features/align-elements/resources/align-right-tool.svg +5 -0
- package/lib/features/align-elements/resources/align-tool.svg +5 -0
- package/lib/features/align-elements/resources/align-top-tool.svg +5 -0
- package/lib/features/align-elements/resources/align-vertical-center-tool.svg +5 -0
- package/lib/features/distribute-elements/.DS_Store +0 -0
- package/lib/features/distribute-elements/BpmnDistributeElements.js +27 -7
- package/lib/features/distribute-elements/DistributeElementsIcons.js +10 -0
- package/lib/features/distribute-elements/DistributeElementsMenuProvider.js +69 -0
- package/lib/features/distribute-elements/dist/distribute-horizontally-tool.svg +1 -0
- package/lib/features/distribute-elements/dist/distribute-vertically-tool.svg +1 -0
- package/lib/features/distribute-elements/index.js +9 -2
- package/lib/features/distribute-elements/resources/distribute-horizontally-tool.svg +5 -0
- package/lib/features/distribute-elements/resources/distribute-vertically-tool.svg +5 -0
- package/lib/features/label-editing/LabelEditingProvider.js +3 -1
- package/lib/features/popup-menu/ReplaceMenuProvider.js +7 -6
- package/package.json +2 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import ICONS from './AlignElementsIcons';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
assign,
|
|
5
|
+
forEach,
|
|
6
|
+
} from 'min-dash';
|
|
7
|
+
|
|
8
|
+
var ALIGNMENT_OPTIONS = [
|
|
9
|
+
'left',
|
|
10
|
+
'center',
|
|
11
|
+
'right',
|
|
12
|
+
'top',
|
|
13
|
+
'middle',
|
|
14
|
+
'bottom'
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A provider for align elements popup menu.
|
|
19
|
+
*/
|
|
20
|
+
export default function AlignElementsMenuProvider(popupMenu, alignElements, translate, rules) {
|
|
21
|
+
|
|
22
|
+
this._alignElements = alignElements;
|
|
23
|
+
this._translate = translate;
|
|
24
|
+
this._popupMenu = popupMenu;
|
|
25
|
+
this._rules = rules;
|
|
26
|
+
|
|
27
|
+
popupMenu.registerProvider('align-elements', this);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
AlignElementsMenuProvider.$inject = [
|
|
31
|
+
'popupMenu',
|
|
32
|
+
'alignElements',
|
|
33
|
+
'translate',
|
|
34
|
+
'rules'
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
AlignElementsMenuProvider.prototype.getPopupMenuEntries = function(elements) {
|
|
38
|
+
var entries = {};
|
|
39
|
+
|
|
40
|
+
if (this._isAllowed(elements)) {
|
|
41
|
+
assign(entries, this._getEntries(elements));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return entries;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
AlignElementsMenuProvider.prototype._isAllowed = function(elements) {
|
|
48
|
+
return this._rules.allowed('elements.align', { elements: elements });
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
AlignElementsMenuProvider.prototype._getEntries = function(elements) {
|
|
52
|
+
var alignElements = this._alignElements,
|
|
53
|
+
translate = this._translate,
|
|
54
|
+
popupMenu = this._popupMenu;
|
|
55
|
+
|
|
56
|
+
var entries = {};
|
|
57
|
+
|
|
58
|
+
forEach(ALIGNMENT_OPTIONS, function(alignment) {
|
|
59
|
+
entries[ 'align-elements-' + alignment ] = {
|
|
60
|
+
group: 'align',
|
|
61
|
+
title: translate('Align elements ' + alignment),
|
|
62
|
+
className: 'bjs-align-elements-menu-entry',
|
|
63
|
+
imageUrl: ICONS[alignment],
|
|
64
|
+
action: function(event, entry) {
|
|
65
|
+
alignElements.trigger(elements, alignment);
|
|
66
|
+
popupMenu.close();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return entries;
|
|
72
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import inherits from 'inherits-browser';
|
|
2
|
+
|
|
3
|
+
import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider';
|
|
4
|
+
import { getParents } from 'diagram-js/lib/util/Elements';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
filter
|
|
8
|
+
} from 'min-dash';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Rule provider for alignment of BPMN elements.
|
|
12
|
+
*/
|
|
13
|
+
export default function BpmnAlignElements(eventBus) {
|
|
14
|
+
RuleProvider.call(this, eventBus);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
BpmnAlignElements.$inject = [ 'eventBus' ];
|
|
18
|
+
|
|
19
|
+
inherits(BpmnAlignElements, RuleProvider);
|
|
20
|
+
|
|
21
|
+
BpmnAlignElements.prototype.init = function() {
|
|
22
|
+
this.addRule('elements.align', function(context) {
|
|
23
|
+
var elements = context.elements;
|
|
24
|
+
|
|
25
|
+
// filter out elements which cannot be aligned
|
|
26
|
+
var filteredElements = filter(elements, function(element) {
|
|
27
|
+
return !(element.waypoints || element.host || element.labelTarget);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// filter out elements which are children of any of the selected elements
|
|
31
|
+
filteredElements = getParents(filteredElements);
|
|
32
|
+
|
|
33
|
+
if (filteredElements.length < 2) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return filteredElements;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import AlignElementsModule from 'diagram-js/lib/features/align-elements';
|
|
2
|
+
import ContextPadModule from 'diagram-js/lib/features/context-pad';
|
|
3
|
+
import PopupMenuModule from 'diagram-js/lib/features/popup-menu';
|
|
4
|
+
|
|
5
|
+
import AlignElementsContextPadProvider from './AlignElementsContextPadProvider';
|
|
6
|
+
import AlignElementsMenuProvider from './AlignElementsMenuProvider';
|
|
7
|
+
import BpmnAlignElements from './BpmnAlignElements';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
__depends__: [
|
|
11
|
+
AlignElementsModule,
|
|
12
|
+
ContextPadModule,
|
|
13
|
+
PopupMenuModule
|
|
14
|
+
],
|
|
15
|
+
__init__: [
|
|
16
|
+
'alignElementsContextPadProvider',
|
|
17
|
+
'alignElementsMenuProvider',
|
|
18
|
+
'bpmnAlignElements'
|
|
19
|
+
],
|
|
20
|
+
alignElementsContextPadProvider: [ 'type', AlignElementsContextPadProvider ],
|
|
21
|
+
alignElementsMenuProvider: [ 'type', AlignElementsMenuProvider ],
|
|
22
|
+
bpmnAlignElements: [ 'type', BpmnAlignElements]
|
|
23
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
|
|
2
|
+
<line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
3
|
+
<rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
Binary file
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import inherits from 'inherits-browser';
|
|
2
|
+
|
|
3
|
+
import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider';
|
|
4
|
+
import { getParents } from 'diagram-js/lib/util/Elements';
|
|
5
|
+
|
|
1
6
|
import {
|
|
2
7
|
filter
|
|
3
8
|
} from 'min-dash';
|
|
@@ -11,10 +16,19 @@ import {
|
|
|
11
16
|
* Registers element exclude filters for elements that
|
|
12
17
|
* currently do not support distribution.
|
|
13
18
|
*/
|
|
14
|
-
export default function BpmnDistributeElements(distributeElements) {
|
|
19
|
+
export default function BpmnDistributeElements(distributeElements, eventBus, rules) {
|
|
20
|
+
RuleProvider.call(this, eventBus);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
BpmnDistributeElements.$inject = [ 'distributeElements', 'eventBus', 'rules' ];
|
|
24
|
+
|
|
25
|
+
inherits(BpmnDistributeElements, RuleProvider);
|
|
26
|
+
|
|
27
|
+
BpmnDistributeElements.prototype.init = function() {
|
|
28
|
+
this.addRule('elements.distribute', function(context) {
|
|
29
|
+
var elements = context.elements;
|
|
15
30
|
|
|
16
|
-
|
|
17
|
-
return filter(elements, function(element) {
|
|
31
|
+
elements = filter(elements, function(element) {
|
|
18
32
|
var cannotDistribute = isAny(element, [
|
|
19
33
|
'bpmn:Association',
|
|
20
34
|
'bpmn:BoundaryEvent',
|
|
@@ -22,14 +36,20 @@ export default function BpmnDistributeElements(distributeElements) {
|
|
|
22
36
|
'bpmn:DataOutputAssociation',
|
|
23
37
|
'bpmn:Lane',
|
|
24
38
|
'bpmn:MessageFlow',
|
|
25
|
-
'bpmn:Participant',
|
|
26
39
|
'bpmn:SequenceFlow',
|
|
27
40
|
'bpmn:TextAnnotation'
|
|
28
41
|
]);
|
|
29
42
|
|
|
30
43
|
return !(element.labelTarget || cannotDistribute);
|
|
31
44
|
});
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
45
|
|
|
35
|
-
|
|
46
|
+
// filter out elements which are children of any of the selected elements
|
|
47
|
+
elements = getParents(elements);
|
|
48
|
+
|
|
49
|
+
if (elements.length < 3) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return elements;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* To change the icons, modify the SVGs in `./resources`, execute `npx svgo -f resources --datauri enc -o dist`,
|
|
3
|
+
* and then replace respective icons with the optimized data URIs in `./dist`.
|
|
4
|
+
*/
|
|
5
|
+
var icons = {
|
|
6
|
+
horizontal: 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linejoin%3Around%22%20d%3D%22M450%20400V150h900v250%22%2F%3E%3Crect%20x%3D%22150%22%20y%3D%22450%22%20width%3D%22600%22%20height%3D%221200%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%221050%22%20y%3D%22450%22%20width%3D%22600%22%20height%3D%22800%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E',
|
|
7
|
+
vertical: 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linejoin%3Around%22%20d%3D%22M400%201350H150V450h250%22%2F%3E%3Crect%20x%3D%22450%22%20y%3D%22150%22%20width%3D%221200%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22450%22%20y%3D%221050%22%20width%3D%22800%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default icons;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import ICONS from './DistributeElementsIcons';
|
|
2
|
+
|
|
3
|
+
import { assign } from 'min-dash';
|
|
4
|
+
|
|
5
|
+
var LOW_PRIORITY = 900;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A provider for distribute elements popup menu.
|
|
9
|
+
*/
|
|
10
|
+
export default function DistributeElementsMenuProvider(
|
|
11
|
+
popupMenu, distributeElements, translate, rules) {
|
|
12
|
+
this._distributeElements = distributeElements;
|
|
13
|
+
this._translate = translate;
|
|
14
|
+
this._popupMenu = popupMenu;
|
|
15
|
+
this._rules = rules;
|
|
16
|
+
|
|
17
|
+
popupMenu.registerProvider('align-elements', LOW_PRIORITY, this);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
DistributeElementsMenuProvider.$inject = [
|
|
21
|
+
'popupMenu',
|
|
22
|
+
'distributeElements',
|
|
23
|
+
'translate',
|
|
24
|
+
'rules'
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
DistributeElementsMenuProvider.prototype.getPopupMenuEntries = function(elements) {
|
|
28
|
+
var entries = {};
|
|
29
|
+
|
|
30
|
+
if (this._isAllowed(elements)) {
|
|
31
|
+
assign(entries, this._getEntries(elements));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return entries;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
DistributeElementsMenuProvider.prototype._isAllowed = function(elements) {
|
|
38
|
+
return this._rules.allowed('elements.distribute', { elements: elements });
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
DistributeElementsMenuProvider.prototype._getEntries = function(elements) {
|
|
42
|
+
var distributeElements = this._distributeElements,
|
|
43
|
+
translate = this._translate,
|
|
44
|
+
popupMenu = this._popupMenu;
|
|
45
|
+
|
|
46
|
+
var entries = {
|
|
47
|
+
'distribute-elements-horizontal': {
|
|
48
|
+
group: 'distribute',
|
|
49
|
+
title: translate('Distribute elements horizontally'),
|
|
50
|
+
className: 'bjs-align-elements-menu-entry',
|
|
51
|
+
imageUrl: ICONS['horizontal'],
|
|
52
|
+
action: function(event, entry) {
|
|
53
|
+
distributeElements.trigger(elements, 'horizontal');
|
|
54
|
+
popupMenu.close();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
'distribute-elements-vertical': {
|
|
58
|
+
group: 'distribute',
|
|
59
|
+
title: translate('Distribute elements vertically'),
|
|
60
|
+
imageUrl: ICONS['vertical'],
|
|
61
|
+
action: function(event, entry) {
|
|
62
|
+
distributeElements.trigger(elements, 'vertical');
|
|
63
|
+
popupMenu.close();
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return entries;
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linejoin%3Around%22%20d%3D%22M450%20400V150h900v250%22%2F%3E%3Crect%20x%3D%22150%22%20y%3D%22450%22%20width%3D%22600%22%20height%3D%221200%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%221050%22%20y%3D%22450%22%20width%3D%22600%22%20height%3D%22800%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201800%201800%22%3E%3Cpath%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bstroke-linejoin%3Around%22%20d%3D%22M400%201350H150V450h250%22%2F%3E%3Crect%20x%3D%22450%22%20y%3D%22150%22%20width%3D%221200%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3Anone%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%22%2F%3E%3Crect%20x%3D%22450%22%20y%3D%221050%22%20width%3D%22800%22%20height%3D%22600%22%20rx%3D%221%22%20style%3D%22fill%3AcurrentColor%3Bstroke%3AcurrentColor%3Bstroke-width%3A100%3Bopacity%3A.5%22%2F%3E%3C%2Fsvg%3E
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import DistributeElementsModule from 'diagram-js/lib/features/distribute-elements';
|
|
2
|
+
import PopupMenuModule from 'diagram-js/lib/features/popup-menu';
|
|
2
3
|
|
|
3
4
|
import BpmnDistributeElements from './BpmnDistributeElements';
|
|
5
|
+
import DistributeElementsMenuProvider from './DistributeElementsMenuProvider';
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
export default {
|
|
7
9
|
__depends__: [
|
|
10
|
+
PopupMenuModule,
|
|
8
11
|
DistributeElementsModule
|
|
9
12
|
],
|
|
10
|
-
__init__: [
|
|
11
|
-
|
|
13
|
+
__init__: [
|
|
14
|
+
'bpmnDistributeElements',
|
|
15
|
+
'distributeElementsMenuProvider'
|
|
16
|
+
],
|
|
17
|
+
bpmnDistributeElements: [ 'type', BpmnDistributeElements ],
|
|
18
|
+
distributeElementsMenuProvider: [ 'type', DistributeElementsMenuProvider ]
|
|
12
19
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
|
|
3
|
+
<rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
2
|
+
<polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
|
|
3
|
+
<rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
4
|
+
<rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
5
|
+
</svg>
|
|
@@ -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,
|
|
@@ -61,7 +63,7 @@ export default function LabelEditingProvider(
|
|
|
61
63
|
eventBus.on([
|
|
62
64
|
'shape.remove',
|
|
63
65
|
'connection.remove'
|
|
64
|
-
], function(event) {
|
|
66
|
+
], HIGH_PRIORITY, function(event) {
|
|
65
67
|
|
|
66
68
|
if (directEditing.isActive(event.element)) {
|
|
67
69
|
directEditing.cancel();
|
|
@@ -427,18 +427,19 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
|
|
|
427
427
|
var translate = this._translate;
|
|
428
428
|
|
|
429
429
|
function toggleLoopEntry(event, entry) {
|
|
430
|
-
var
|
|
430
|
+
var newLoopCharacteristics = getBusinessObject(element).loopCharacteristics;
|
|
431
431
|
|
|
432
432
|
if (entry.active) {
|
|
433
|
-
|
|
433
|
+
newLoopCharacteristics = undefined;
|
|
434
434
|
} else {
|
|
435
|
-
if (isUndefined(entry.options.isSequential) || !
|
|
436
|
-
|
|
435
|
+
if (isUndefined(entry.options.isSequential) || !newLoopCharacteristics
|
|
436
|
+
|| !is(newLoopCharacteristics, entry.options.loopCharacteristics)) {
|
|
437
|
+
newLoopCharacteristics = self._moddle.create(entry.options.loopCharacteristics);
|
|
437
438
|
}
|
|
438
439
|
|
|
439
|
-
|
|
440
|
+
newLoopCharacteristics.isSequential = entry.options.isSequential;
|
|
440
441
|
}
|
|
441
|
-
self._modeling.updateProperties(element, { loopCharacteristics:
|
|
442
|
+
self._modeling.updateProperties(element, { loopCharacteristics: newLoopCharacteristics });
|
|
442
443
|
}
|
|
443
444
|
|
|
444
445
|
var businessObject = getBusinessObject(element),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmn-js",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"description": "A bpmn 2.0 toolkit and web modeler",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"bpmn-moddle": "^7.1.2",
|
|
102
102
|
"css.escape": "^1.5.1",
|
|
103
|
-
"diagram-js": "^8.
|
|
103
|
+
"diagram-js": "^8.7.0",
|
|
104
104
|
"diagram-js-direct-editing": "^1.7.0",
|
|
105
105
|
"ids": "^1.0.0",
|
|
106
106
|
"inherits-browser": "0.0.1",
|