bpmn-js 9.0.0-subprocesses.0 → 9.0.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 +73 -1
- package/dist/assets/bpmn-js.css +113 -0
- package/dist/assets/diagram-js.css +82 -78
- package/dist/bpmn-modeler.development.js +3402 -2196
- package/dist/bpmn-modeler.production.min.js +9 -8
- package/dist/bpmn-navigated-viewer.development.js +21207 -20345
- package/dist/bpmn-navigated-viewer.production.min.js +22 -20
- package/dist/bpmn-viewer.development.js +20401 -19562
- package/dist/bpmn-viewer.production.min.js +22 -20
- package/lib/BaseViewer.js +1 -1
- package/lib/Modeler.js +1 -4
- package/lib/Viewer.js +2 -2
- package/lib/draw/BpmnRenderer.js +8 -7
- package/lib/draw/PathMap.js +2 -2
- package/lib/features/auto-resize/BpmnAutoResizeProvider.js +9 -6
- package/lib/features/copy-paste/BpmnCopyPaste.js +1 -0
- package/lib/features/copy-paste/ModdleCopy.js +19 -2
- package/lib/features/di-ordering/BpmnDiOrdering.js +15 -11
- package/lib/features/drilldown/DrilldownBreadcrumbs.js +122 -0
- package/lib/features/drilldown/DrilldownCentering.js +118 -0
- package/lib/features/drilldown/DrilldownOverlayBehavior.js +181 -0
- package/lib/features/drilldown/SubprocessCompatibility.js +196 -0
- package/lib/features/drilldown/index.js +17 -0
- package/lib/features/label-editing/LabelEditingProvider.js +1 -1
- package/lib/features/label-editing/cmd/UpdateLabelHandler.js +29 -2
- package/lib/features/modeling/BpmnFactory.js +12 -8
- package/lib/features/modeling/BpmnUpdater.js +43 -6
- package/lib/features/modeling/ElementFactory.js +31 -13
- package/lib/features/modeling/behavior/CreateParticipantBehavior.js +59 -84
- package/lib/features/modeling/behavior/DropOnFlowBehavior.js +2 -2
- package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +34 -0
- package/lib/features/modeling/behavior/ResizeBehavior.js +129 -3
- package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +557 -0
- package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +74 -0
- package/lib/features/modeling/behavior/UnclaimIdBehavior.js +3 -1
- package/lib/features/modeling/behavior/index.js +27 -18
- package/lib/features/modeling/behavior/util/ResizeUtil.js +1 -132
- package/lib/features/modeling/cmd/SetColorHandler.js +23 -6
- package/lib/features/modeling/cmd/UpdateCanvasRootHandler.js +4 -2
- package/lib/features/modeling/util/ModelingUtil.js +2 -20
- package/lib/features/ordering/BpmnOrderingProvider.js +3 -3
- package/lib/features/palette/PaletteProvider.js +1 -1
- package/lib/features/popup-menu/ReplaceMenuProvider.js +1 -1
- package/lib/features/replace/BpmnReplace.js +38 -16
- package/lib/import/BpmnImporter.js +19 -13
- package/lib/import/BpmnTreeWalker.js +2 -2
- package/lib/import/Importer.js +134 -14
- package/lib/util/DiUtil.js +1 -0
- package/lib/util/DrilldownUtil.js +66 -0
- package/lib/util/ModelUtil.js +19 -0
- package/package.json +2 -2
- package/test/util/MockEvents.js +10 -2
- package/lib/features/collapsed-subprocesses/DeleteBehaviour.js +0 -65
- package/lib/features/collapsed-subprocesses/ToggleCollapseBehaviour.js +0 -133
- package/lib/features/collapsed-subprocesses/diagramFactory.js +0 -56
- package/lib/features/collapsed-subprocesses/index.js +0 -12
- package/lib/features/collapsed-subprocesses-navigation/CollapsedSubprocessNavigation.js +0 -198
- package/lib/features/collapsed-subprocesses-navigation/index.js +0 -7
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
2
|
-
|
|
3
|
-
import { assign } from 'min-dash';
|
|
4
|
-
import { domify } from 'min-dom';
|
|
5
|
-
import { getBusinessObject, is } from '../../util/ModelUtil';
|
|
6
|
-
|
|
7
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
8
|
-
import { selfAndAllChildren } from 'diagram-js/lib/util/Elements';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var ARROW_DOWN_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>';
|
|
12
|
-
|
|
13
|
-
export default function CollapsedProcesses(injector, eventBus, elementRegistry, overlays, canvas) {
|
|
14
|
-
var breadcrumbs = domify('<ul class="breadcrumbs" style="display: none; position: absolute; top: 10px; left: 100px;"></ul>');
|
|
15
|
-
|
|
16
|
-
injector.invoke(CommandInterceptor, this);
|
|
17
|
-
|
|
18
|
-
assign(breadcrumbs.style, {
|
|
19
|
-
fontFamily: 'Arial, sans-serif'
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
var container = canvas.getContainer();
|
|
23
|
-
|
|
24
|
-
container.appendChild(breadcrumbs);
|
|
25
|
-
|
|
26
|
-
eventBus.on('plane.set', function(event) {
|
|
27
|
-
var plane = event.plane;
|
|
28
|
-
|
|
29
|
-
updateBreadcrumbs(plane);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const updateBreadcrumbs = function(plane) {
|
|
33
|
-
var parents = getParentChain(plane.rootElement);
|
|
34
|
-
|
|
35
|
-
var path = parents.flatMap(function(el, idx, array) {
|
|
36
|
-
|
|
37
|
-
var separator = domify('<span>»</span>');
|
|
38
|
-
|
|
39
|
-
assign(separator.style, {
|
|
40
|
-
padding: '8px'
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var html = domify(`<li><a>${el.name || el.id}</a></li>`);
|
|
44
|
-
|
|
45
|
-
assign(html.style, {
|
|
46
|
-
display: 'inline',
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
html.addEventListener('click', () => {
|
|
50
|
-
if (elementRegistry.get(el.id + '_layer')) {
|
|
51
|
-
canvas.setActivePlane(el.id);
|
|
52
|
-
} else {
|
|
53
|
-
var plane = canvas.findPlane(el.id);
|
|
54
|
-
canvas.setActivePlane(plane);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
if (idx + 1 < array.length) {
|
|
59
|
-
assign(html.style, {
|
|
60
|
-
color: '#4d90ff',
|
|
61
|
-
cursor: 'pointer'
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (idx !== 0) {
|
|
66
|
-
return [separator, html];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return [html];
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
breadcrumbs.innerHTML = '';
|
|
73
|
-
breadcrumbs.style.display = path.length > 1 ? '' : 'none';
|
|
74
|
-
breadcrumbs.append(...path);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var overlayMap = {};
|
|
78
|
-
|
|
79
|
-
var createOverlay = function(element) {
|
|
80
|
-
if (overlayMap[element.id]) {
|
|
81
|
-
|
|
82
|
-
// New overlay, remove old one
|
|
83
|
-
removeOverlay(element);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let html = domify(`<button>${ARROW_DOWN_SVG}</button>`);
|
|
87
|
-
|
|
88
|
-
assign(html.style, {
|
|
89
|
-
padding: '0px',
|
|
90
|
-
marginLeft: '-20px',
|
|
91
|
-
fontSize: '0',
|
|
92
|
-
border: 'none',
|
|
93
|
-
borderRadius: '2px',
|
|
94
|
-
fill: 'white',
|
|
95
|
-
outline: 'none',
|
|
96
|
-
cursor: 'pointer',
|
|
97
|
-
backgroundColor: '#4d90ff',
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
html.addEventListener('click', () => {
|
|
101
|
-
canvas.setActivePlane(element.id);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
overlayMap[element.id] = overlays.add(element, {
|
|
106
|
-
position: {
|
|
107
|
-
bottom: -7,
|
|
108
|
-
right: -8
|
|
109
|
-
},
|
|
110
|
-
html
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var removeOverlay = function(element) {
|
|
115
|
-
if (overlayMap[element.id]) {
|
|
116
|
-
overlays.remove(overlayMap[element.id]);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
var removeOverlays = function(elements) {
|
|
121
|
-
elements.forEach(removeOverlay);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
var addOverlays = (elements) => {
|
|
125
|
-
elements.forEach(element => {
|
|
126
|
-
if (element.type === 'bpmn:SubProcess' && element.collapsed) {
|
|
127
|
-
createOverlay(element);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
eventBus.on('import.done', function() {
|
|
133
|
-
addOverlays(elementRegistry.getAll());
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
this.executed([ 'shape.toggleCollapse' ], function(event) {
|
|
137
|
-
var shape = event.context.shape;
|
|
138
|
-
|
|
139
|
-
if (!is(shape, 'bpmn:SubProcess')) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (shape.collapsed) {
|
|
144
|
-
|
|
145
|
-
// Collapse
|
|
146
|
-
removeOverlays(selfAndAllChildren(shape));
|
|
147
|
-
createOverlay(shape);
|
|
148
|
-
|
|
149
|
-
var plane = elementRegistry.get(shape.id + '_layer');
|
|
150
|
-
addOverlays(selfAndAllChildren(plane));
|
|
151
|
-
} else {
|
|
152
|
-
|
|
153
|
-
// Expand
|
|
154
|
-
addOverlays(selfAndAllChildren(shape));
|
|
155
|
-
removeOverlay(shape);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
this.reverted([ 'shape.toggleCollapse' ], function(event) {
|
|
160
|
-
var shape = event.context.shape;
|
|
161
|
-
|
|
162
|
-
if (!is(shape, 'bpmn:SubProcess')) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (shape.collapsed) {
|
|
167
|
-
removeOverlays(selfAndAllChildren(shape));
|
|
168
|
-
createOverlay(shape);
|
|
169
|
-
|
|
170
|
-
var plane = elementRegistry.get(shape.id + '_layer');
|
|
171
|
-
addOverlays(selfAndAllChildren(plane));
|
|
172
|
-
} else {
|
|
173
|
-
addOverlays(selfAndAllChildren(shape));
|
|
174
|
-
removeOverlay(shape);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
inherits(CollapsedProcesses, CommandInterceptor);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
CollapsedProcesses.$inject = [ 'injector', 'eventBus', 'elementRegistry', 'overlays', 'canvas' ];
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
var getParentChain = function(child) {
|
|
187
|
-
var bo = getBusinessObject(child);
|
|
188
|
-
|
|
189
|
-
var parents = [];
|
|
190
|
-
|
|
191
|
-
for (var element = bo; element; element = element.$parent) {
|
|
192
|
-
if (is(element, 'bpmn:SubProcess') || is(element, 'bpmn:Process')) {
|
|
193
|
-
parents.push(element);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return parents.reverse();
|
|
198
|
-
};
|