bpmn-js 16.4.0 → 16.5.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/dist/bpmn-modeler.development.js +97 -15
- package/dist/bpmn-modeler.production.min.js +3 -3
- package/dist/bpmn-navigated-viewer.development.js +3 -3
- package/dist/bpmn-navigated-viewer.production.min.js +2 -2
- package/dist/bpmn-viewer.development.js +3 -3
- package/dist/bpmn-viewer.production.min.js +2 -2
- package/lib/draw/BpmnRenderer.js +1 -1
- package/lib/features/context-pad/ContextPadProvider.js +1 -2
- package/lib/features/modeling/ElementFactory.js +4 -0
- package/lib/features/modeling/cmd/AddLaneHandler.js +93 -10
- package/lib/model/Types.d.ts +1 -0
- package/lib/model/Types.ts +1 -0
- package/package.json +2 -2
package/lib/draw/BpmnRenderer.js
CHANGED
|
@@ -720,7 +720,7 @@ export default function BpmnRenderer(
|
|
|
720
720
|
});
|
|
721
721
|
|
|
722
722
|
return drawPath(parentGfx, pathData, {
|
|
723
|
-
fill:
|
|
723
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
724
724
|
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
725
725
|
strokeWidth: 1
|
|
726
726
|
});
|
|
@@ -420,8 +420,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|
|
420
420
|
'append.gateway': appendAction(
|
|
421
421
|
'bpmn:ExclusiveGateway',
|
|
422
422
|
'bpmn-icon-gateway-none',
|
|
423
|
-
translate('Append gateway')
|
|
424
|
-
{ isMarkerVisible: true }
|
|
423
|
+
translate('Append gateway')
|
|
425
424
|
),
|
|
426
425
|
'append.append-task': appendAction(
|
|
427
426
|
'bpmn:Task',
|
|
@@ -207,6 +207,10 @@ ElementFactory.prototype.createElement = function(elementType, attrs) {
|
|
|
207
207
|
attrs = applyAttribute(di, attrs, 'isExpanded');
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
if (isAny(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ])) {
|
|
211
|
+
attrs = applyAttribute(di, attrs, 'isHorizontal');
|
|
212
|
+
}
|
|
213
|
+
|
|
210
214
|
if (is(businessObject, 'bpmn:SubProcess')) {
|
|
211
215
|
attrs.collapsed = !isExpanded(businessObject, di);
|
|
212
216
|
}
|
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
LANE_INDENTATION
|
|
13
13
|
} from '../util/LaneUtil';
|
|
14
14
|
|
|
15
|
+
import {
|
|
16
|
+
isHorizontal
|
|
17
|
+
} from '../../../util/DiUtil';
|
|
18
|
+
|
|
15
19
|
/**
|
|
16
20
|
* @typedef {import('diagram-js/lib/command/CommandHandler').default} CommandHandler
|
|
17
21
|
*
|
|
@@ -54,14 +58,47 @@ AddLaneHandler.prototype.preExecute = function(context) {
|
|
|
54
58
|
|
|
55
59
|
var existingChildLanes = getChildLanes(laneParent);
|
|
56
60
|
|
|
61
|
+
var isHorizontalLane = isHorizontal(shape);
|
|
62
|
+
|
|
63
|
+
// never mix up horizontal/vertical lanes
|
|
64
|
+
if (isHorizontalLane) {
|
|
65
|
+
if (location === 'left') {
|
|
66
|
+
location = 'top';
|
|
67
|
+
} else
|
|
68
|
+
if (location === 'right') {
|
|
69
|
+
location = 'bottom';
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
if (location === 'top') {
|
|
73
|
+
location = 'left';
|
|
74
|
+
} else
|
|
75
|
+
if (location === 'bottom') {
|
|
76
|
+
location = 'right';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
57
80
|
// (0) add a lane if we currently got none and are adding to root
|
|
58
81
|
if (!existingChildLanes.length) {
|
|
59
|
-
|
|
82
|
+
var siblingPosition = isHorizontalLane ? {
|
|
60
83
|
x: shape.x + LANE_INDENTATION,
|
|
61
84
|
y: shape.y,
|
|
62
85
|
width: shape.width - LANE_INDENTATION,
|
|
63
86
|
height: shape.height
|
|
64
|
-
}
|
|
87
|
+
} : {
|
|
88
|
+
x: shape.x,
|
|
89
|
+
y: shape.y + LANE_INDENTATION,
|
|
90
|
+
width: shape.width,
|
|
91
|
+
height: shape.height - LANE_INDENTATION
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
modeling.createShape(
|
|
95
|
+
{
|
|
96
|
+
type: 'bpmn:Lane',
|
|
97
|
+
isHorizontal: isHorizontalLane
|
|
98
|
+
},
|
|
99
|
+
siblingPosition,
|
|
100
|
+
laneParent
|
|
101
|
+
);
|
|
65
102
|
}
|
|
66
103
|
|
|
67
104
|
// (1) collect affected elements to create necessary space
|
|
@@ -84,26 +121,72 @@ AddLaneHandler.prototype.preExecute = function(context) {
|
|
|
84
121
|
});
|
|
85
122
|
});
|
|
86
123
|
|
|
87
|
-
var offset
|
|
88
|
-
lanePosition
|
|
89
|
-
spacePos
|
|
90
|
-
direction
|
|
124
|
+
var offset,
|
|
125
|
+
lanePosition,
|
|
126
|
+
spacePos,
|
|
127
|
+
direction,
|
|
128
|
+
axis;
|
|
129
|
+
|
|
130
|
+
if (location === 'top') {
|
|
131
|
+
offset = -120;
|
|
132
|
+
lanePosition = shape.y;
|
|
133
|
+
spacePos = lanePosition + 10;
|
|
134
|
+
direction = 'n';
|
|
135
|
+
axis = 'y';
|
|
136
|
+
} else
|
|
137
|
+
if (location === 'left') {
|
|
138
|
+
offset = -120;
|
|
139
|
+
lanePosition = shape.x;
|
|
140
|
+
spacePos = lanePosition + 10;
|
|
141
|
+
direction = 'w';
|
|
142
|
+
axis = 'x';
|
|
143
|
+
} else
|
|
144
|
+
if (location === 'bottom') {
|
|
145
|
+
offset = 120;
|
|
146
|
+
lanePosition = shape.y + shape.height;
|
|
147
|
+
spacePos = lanePosition - 10;
|
|
148
|
+
direction = 's';
|
|
149
|
+
axis = 'y';
|
|
150
|
+
} else
|
|
151
|
+
if (location === 'right') {
|
|
152
|
+
offset = 120;
|
|
153
|
+
lanePosition = shape.x + shape.width;
|
|
154
|
+
spacePos = lanePosition - 10;
|
|
155
|
+
direction = 'e';
|
|
156
|
+
axis = 'x';
|
|
157
|
+
}
|
|
91
158
|
|
|
92
|
-
var adjustments = spaceTool.calculateAdjustments(allAffected,
|
|
159
|
+
var adjustments = spaceTool.calculateAdjustments(allAffected, axis, offset, spacePos);
|
|
160
|
+
|
|
161
|
+
var delta = isHorizontalLane ? { x: 0, y: offset } : { x: offset, y: 0 };
|
|
93
162
|
|
|
94
163
|
spaceTool.makeSpace(
|
|
95
164
|
adjustments.movingShapes,
|
|
96
165
|
adjustments.resizingShapes,
|
|
97
|
-
|
|
166
|
+
delta,
|
|
98
167
|
direction,
|
|
99
168
|
spacePos
|
|
100
169
|
);
|
|
101
170
|
|
|
102
171
|
// (2) create new lane at open space
|
|
103
|
-
|
|
172
|
+
var newLanePosition = isHorizontalLane ? {
|
|
104
173
|
x: shape.x + (isRoot ? LANE_INDENTATION : 0),
|
|
105
174
|
y: lanePosition - (location === 'top' ? 120 : 0),
|
|
106
175
|
width: shape.width - (isRoot ? LANE_INDENTATION : 0),
|
|
107
176
|
height: 120
|
|
108
|
-
}
|
|
177
|
+
} : {
|
|
178
|
+
x: lanePosition - (location === 'left' ? 120 : 0),
|
|
179
|
+
y: shape.y + (isRoot ? LANE_INDENTATION : 0),
|
|
180
|
+
width: 120,
|
|
181
|
+
height: shape.height - (isRoot ? LANE_INDENTATION : 0)
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
context.newLane = modeling.createShape(
|
|
185
|
+
{
|
|
186
|
+
type: 'bpmn:Lane',
|
|
187
|
+
isHorizontal: isHorizontalLane
|
|
188
|
+
},
|
|
189
|
+
newLanePosition,
|
|
190
|
+
laneParent
|
|
191
|
+
);
|
|
109
192
|
};
|
package/lib/model/Types.d.ts
CHANGED
package/lib/model/Types.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmn-js",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.5.0",
|
|
4
4
|
"description": "A bpmn 2.0 toolkit and web modeler",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"karma-webpack": "^5.0.0",
|
|
98
98
|
"mocha": "^10.1.0",
|
|
99
99
|
"mocha-test-container-support": "0.2.0",
|
|
100
|
-
"npm-run-
|
|
100
|
+
"npm-run-all2": "^5.0.0",
|
|
101
101
|
"puppeteer": "^21.3.8",
|
|
102
102
|
"remark-cli": "^12.0.0",
|
|
103
103
|
"remark-preset-bpmn-io": "^0.2.1",
|