bpmn-js 16.4.0 → 17.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/dist/assets/diagram-js.css +1 -10
- package/dist/bpmn-modeler.development.js +198 -3114
- package/dist/bpmn-modeler.production.min.js +48 -52
- package/dist/bpmn-navigated-viewer.development.js +5 -25
- package/dist/bpmn-navigated-viewer.production.min.js +5 -5
- package/dist/bpmn-viewer.development.js +5 -29
- package/dist/bpmn-viewer.production.min.js +5 -5
- package/lib/Modeler.js +0 -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/behavior/DataInputAssociationBehavior.js +1 -1
- 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 +4 -4
package/lib/Modeler.js
CHANGED
|
@@ -7,7 +7,6 @@ import NavigatedViewer from './NavigatedViewer';
|
|
|
7
7
|
|
|
8
8
|
import KeyboardMoveModule from 'diagram-js/lib/navigation/keyboard-move';
|
|
9
9
|
import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
|
|
10
|
-
import TouchModule from 'diagram-js/lib/navigation/touch';
|
|
11
10
|
import ZoomScrollModule from 'diagram-js/lib/navigation/zoomscroll';
|
|
12
11
|
|
|
13
12
|
import AlignElementsModule from './features/align-elements';
|
|
@@ -156,7 +155,6 @@ Modeler.prototype._interactionModules = [
|
|
|
156
155
|
// non-modeling components
|
|
157
156
|
KeyboardMoveModule,
|
|
158
157
|
MoveCanvasModule,
|
|
159
|
-
TouchModule,
|
|
160
158
|
ZoomScrollModule
|
|
161
159
|
];
|
|
162
160
|
|
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
|
}
|
|
@@ -145,7 +145,7 @@ inherits(DataInputAssociationBehavior, CommandInterceptor);
|
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* Only call the given function when the event
|
|
148
|
-
*
|
|
148
|
+
* changes a bpmn:DataInputAssociation.
|
|
149
149
|
*
|
|
150
150
|
* @param {Function} fn
|
|
151
151
|
* @return {Function}
|
|
@@ -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": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"description": "A bpmn 2.0 toolkit and web modeler",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -97,8 +97,8 @@
|
|
|
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-
|
|
101
|
-
"puppeteer": "^
|
|
100
|
+
"npm-run-all2": "^6.0.0",
|
|
101
|
+
"puppeteer": "^22.0.0",
|
|
102
102
|
"remark-cli": "^12.0.0",
|
|
103
103
|
"remark-preset-bpmn-io": "^0.2.1",
|
|
104
104
|
"rollup": "^3.19.1",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
113
|
"bpmn-moddle": "^8.1.0",
|
|
114
|
-
"diagram-js": "^
|
|
114
|
+
"diagram-js": "^14.0.0",
|
|
115
115
|
"diagram-js-direct-editing": "^2.1.1",
|
|
116
116
|
"ids": "^1.0.5",
|
|
117
117
|
"inherits-browser": "^0.1.0",
|