camunda-bpmn-js 0.13.0-alpha.3 → 0.13.0-alpha.4
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 +6 -0
- package/dist/base-modeler.development.js +122 -45
- package/dist/base-modeler.production.min.js +2 -2
- package/dist/camunda-cloud-modeler.development.js +122 -45
- package/dist/camunda-cloud-modeler.production.min.js +2 -2
- package/dist/camunda-platform-modeler.development.js +122 -45
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/package.json +11 -6
|
@@ -2571,7 +2571,7 @@
|
|
|
2571
2571
|
}
|
|
2572
2572
|
});
|
|
2573
2573
|
|
|
2574
|
-
eventBus.on([ 'render.getShapePath', 'render.getConnectionPath'], renderPriority, function(evt, element) {
|
|
2574
|
+
eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
|
|
2575
2575
|
if (self.canRender(element)) {
|
|
2576
2576
|
if (evt.type === 'render.getShapePath') {
|
|
2577
2577
|
return self.getShapePath(element);
|
|
@@ -2883,7 +2883,7 @@
|
|
|
2883
2883
|
|
|
2884
2884
|
stopRecursion = !!stopRecursion;
|
|
2885
2885
|
if (!isArray(elements)) {
|
|
2886
|
-
elements = [elements];
|
|
2886
|
+
elements = [ elements ];
|
|
2887
2887
|
}
|
|
2888
2888
|
|
|
2889
2889
|
var minX,
|
|
@@ -3063,11 +3063,11 @@
|
|
|
3063
3063
|
height = shape.height;
|
|
3064
3064
|
|
|
3065
3065
|
var shapePath = [
|
|
3066
|
-
['M', x, y],
|
|
3067
|
-
['l', width, 0],
|
|
3068
|
-
['l', 0, height],
|
|
3069
|
-
['l', -width, 0],
|
|
3070
|
-
['z']
|
|
3066
|
+
[ 'M', x, y ],
|
|
3067
|
+
[ 'l', width, 0 ],
|
|
3068
|
+
[ 'l', 0, height ],
|
|
3069
|
+
[ 'l', -width, 0 ],
|
|
3070
|
+
[ 'z' ]
|
|
3071
3071
|
];
|
|
3072
3072
|
|
|
3073
3073
|
return componentsToPath(shapePath);
|
|
@@ -4793,6 +4793,25 @@
|
|
|
4793
4793
|
return layer.group;
|
|
4794
4794
|
};
|
|
4795
4795
|
|
|
4796
|
+
/**
|
|
4797
|
+
* For a given index, return the number of layers that have a higher index and
|
|
4798
|
+
* are visible.
|
|
4799
|
+
*
|
|
4800
|
+
* This is used to determine the node a layer should be inserted at.
|
|
4801
|
+
*
|
|
4802
|
+
* @param {Number} index
|
|
4803
|
+
* @returns {Number}
|
|
4804
|
+
*/
|
|
4805
|
+
Canvas.prototype._getChildIndex = function(index) {
|
|
4806
|
+
return reduce(this._layers, function(childIndex, layer) {
|
|
4807
|
+
if (layer.visible && index >= layer.index) {
|
|
4808
|
+
childIndex++;
|
|
4809
|
+
}
|
|
4810
|
+
|
|
4811
|
+
return childIndex;
|
|
4812
|
+
}, 0);
|
|
4813
|
+
};
|
|
4814
|
+
|
|
4796
4815
|
/**
|
|
4797
4816
|
* Creates a given layer and returns it.
|
|
4798
4817
|
*
|
|
@@ -4807,19 +4826,80 @@
|
|
|
4807
4826
|
index = UTILITY_LAYER_INDEX;
|
|
4808
4827
|
}
|
|
4809
4828
|
|
|
4810
|
-
var childIndex =
|
|
4811
|
-
if (index >= layer.index) {
|
|
4812
|
-
childIndex++;
|
|
4813
|
-
}
|
|
4814
|
-
|
|
4815
|
-
return childIndex;
|
|
4816
|
-
}, 0);
|
|
4829
|
+
var childIndex = this._getChildIndex(index);
|
|
4817
4830
|
|
|
4818
4831
|
return {
|
|
4819
4832
|
group: createGroup(this._viewport, 'layer-' + name, childIndex),
|
|
4820
|
-
index: index
|
|
4833
|
+
index: index,
|
|
4834
|
+
visible: true
|
|
4821
4835
|
};
|
|
4836
|
+
};
|
|
4837
|
+
|
|
4838
|
+
|
|
4839
|
+
/**
|
|
4840
|
+
* Shows a given layer.
|
|
4841
|
+
*
|
|
4842
|
+
* @param {String} layer
|
|
4843
|
+
* @returns {SVGElement}
|
|
4844
|
+
*/
|
|
4845
|
+
Canvas.prototype.showLayer = function(name) {
|
|
4846
|
+
|
|
4847
|
+
if (!name) {
|
|
4848
|
+
throw new Error('must specify a name');
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
var layer = this._layers[name];
|
|
4852
|
+
|
|
4853
|
+
if (!layer) {
|
|
4854
|
+
throw new Error('layer <' + name + '> does not exist');
|
|
4855
|
+
}
|
|
4856
|
+
|
|
4857
|
+
var viewport = this._viewport;
|
|
4858
|
+
var group = layer.group;
|
|
4859
|
+
var index = layer.index;
|
|
4860
|
+
|
|
4861
|
+
if (layer.visible) {
|
|
4862
|
+
return group;
|
|
4863
|
+
}
|
|
4822
4864
|
|
|
4865
|
+
var childIndex = this._getChildIndex(index);
|
|
4866
|
+
|
|
4867
|
+
viewport.insertBefore(group, viewport.childNodes[childIndex] || null);
|
|
4868
|
+
|
|
4869
|
+
layer.visible = true;
|
|
4870
|
+
|
|
4871
|
+
return group;
|
|
4872
|
+
};
|
|
4873
|
+
|
|
4874
|
+
/**
|
|
4875
|
+
* Hides a given layer.
|
|
4876
|
+
*
|
|
4877
|
+
* @param {String} layer
|
|
4878
|
+
* @returns {SVGElement}
|
|
4879
|
+
*/
|
|
4880
|
+
Canvas.prototype.hideLayer = function(name) {
|
|
4881
|
+
|
|
4882
|
+
if (!name) {
|
|
4883
|
+
throw new Error('must specify a name');
|
|
4884
|
+
}
|
|
4885
|
+
|
|
4886
|
+
var layer = this._layers[name];
|
|
4887
|
+
|
|
4888
|
+
if (!layer) {
|
|
4889
|
+
throw new Error('layer <' + name + '> does not exist');
|
|
4890
|
+
}
|
|
4891
|
+
|
|
4892
|
+
var group = layer.group;
|
|
4893
|
+
|
|
4894
|
+
if (!layer.visible) {
|
|
4895
|
+
return group;
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
remove$1(group);
|
|
4899
|
+
|
|
4900
|
+
layer.visible = false;
|
|
4901
|
+
|
|
4902
|
+
return group;
|
|
4823
4903
|
};
|
|
4824
4904
|
|
|
4825
4905
|
|
|
@@ -5062,7 +5142,7 @@
|
|
|
5062
5142
|
|
|
5063
5143
|
var layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
|
|
5064
5144
|
|
|
5065
|
-
|
|
5145
|
+
this.hideLayer(layerName);
|
|
5066
5146
|
|
|
5067
5147
|
this._addRoot(rootElement, layer);
|
|
5068
5148
|
|
|
@@ -5181,17 +5261,13 @@
|
|
|
5181
5261
|
|
|
5182
5262
|
var currentRoot = this._rootElement;
|
|
5183
5263
|
|
|
5184
|
-
var currentLayer;
|
|
5185
|
-
|
|
5186
5264
|
if (currentRoot) {
|
|
5187
5265
|
|
|
5188
5266
|
// un-associate previous root element <svg>
|
|
5189
5267
|
this._elementRegistry.updateGraphics(currentRoot, null, true);
|
|
5190
5268
|
|
|
5191
5269
|
// hide previous layer
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
attr$1(currentLayer, 'display', 'none');
|
|
5270
|
+
this.hideLayer(currentRoot.layer);
|
|
5195
5271
|
}
|
|
5196
5272
|
|
|
5197
5273
|
if (rootElement) {
|
|
@@ -5204,7 +5280,7 @@
|
|
|
5204
5280
|
this._elementRegistry.updateGraphics(rootElement, this._svg, true);
|
|
5205
5281
|
|
|
5206
5282
|
// show root layer
|
|
5207
|
-
|
|
5283
|
+
this.showLayer(rootElement.layer);
|
|
5208
5284
|
}
|
|
5209
5285
|
|
|
5210
5286
|
this._rootElement = rootElement;
|
|
@@ -7600,7 +7676,7 @@
|
|
|
7600
7676
|
options = options || {};
|
|
7601
7677
|
|
|
7602
7678
|
var configModule = {
|
|
7603
|
-
'config': ['value', options]
|
|
7679
|
+
'config': [ 'value', options ]
|
|
7604
7680
|
};
|
|
7605
7681
|
|
|
7606
7682
|
var modules = [ configModule, CoreModule ].concat(options.modules || []);
|
|
@@ -21173,7 +21249,7 @@
|
|
|
21173
21249
|
};
|
|
21174
21250
|
|
|
21175
21251
|
|
|
21176
|
-
Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
|
|
21252
|
+
Outline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];
|
|
21177
21253
|
|
|
21178
21254
|
var OutlineModule = {
|
|
21179
21255
|
__init__: [ 'outline' ],
|
|
@@ -22203,7 +22279,7 @@
|
|
|
22203
22279
|
];
|
|
22204
22280
|
|
|
22205
22281
|
var ChangeSupportModule = {
|
|
22206
|
-
__init__: [ 'changeSupport'],
|
|
22282
|
+
__init__: [ 'changeSupport' ],
|
|
22207
22283
|
changeSupport: [ 'type', ChangeSupport ]
|
|
22208
22284
|
};
|
|
22209
22285
|
|
|
@@ -22375,7 +22451,7 @@
|
|
|
22375
22451
|
|
|
22376
22452
|
inherits_browser(RootElementsBehavior, CommandInterceptor);
|
|
22377
22453
|
|
|
22378
|
-
RootElementsBehavior.$inject = [ 'canvas', 'injector'];
|
|
22454
|
+
RootElementsBehavior.$inject = [ 'canvas', 'injector' ];
|
|
22379
22455
|
|
|
22380
22456
|
var RootElementsModule = {
|
|
22381
22457
|
__init__: [ 'rootElementsBehavior' ],
|
|
@@ -23480,7 +23556,7 @@
|
|
|
23480
23556
|
var KEYCODE_Y = 89;
|
|
23481
23557
|
var KEYCODE_Z = 90;
|
|
23482
23558
|
|
|
23483
|
-
var KEYS_COPY = ['c', 'C', KEYCODE_C ];
|
|
23559
|
+
var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
|
|
23484
23560
|
var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
|
|
23485
23561
|
var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
|
|
23486
23562
|
var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
|
|
@@ -23636,7 +23712,7 @@
|
|
|
23636
23712
|
|
|
23637
23713
|
var event = context.keyEvent;
|
|
23638
23714
|
|
|
23639
|
-
if (isKey(['Backspace', 'Delete', 'Del' ], event)) {
|
|
23715
|
+
if (isKey([ 'Backspace', 'Delete', 'Del' ], event)) {
|
|
23640
23716
|
editorActions.trigger('removeSelection');
|
|
23641
23717
|
|
|
23642
23718
|
return true;
|
|
@@ -29382,11 +29458,11 @@
|
|
|
29382
29458
|
y = center.y;
|
|
29383
29459
|
|
|
29384
29460
|
return [
|
|
29385
|
-
['M', x, y],
|
|
29386
|
-
['m', 0, -r],
|
|
29387
|
-
['a', r, r, 0, 1, 1, 0, 2 * r],
|
|
29388
|
-
['a', r, r, 0, 1, 1, 0, -2 * r],
|
|
29389
|
-
['z']
|
|
29461
|
+
[ 'M', x, y ],
|
|
29462
|
+
[ 'm', 0, -r ],
|
|
29463
|
+
[ 'a', r, r, 0, 1, 1, 0, 2 * r ],
|
|
29464
|
+
[ 'a', r, r, 0, 1, 1, 0, -2 * r ],
|
|
29465
|
+
[ 'z' ]
|
|
29390
29466
|
];
|
|
29391
29467
|
}
|
|
29392
29468
|
|
|
@@ -30962,7 +31038,7 @@
|
|
|
30962
31038
|
return parent.children || [];
|
|
30963
31039
|
}
|
|
30964
31040
|
|
|
30965
|
-
var abs$2= Math.abs,
|
|
31041
|
+
var abs$2 = Math.abs,
|
|
30966
31042
|
round$5 = Math.round;
|
|
30967
31043
|
|
|
30968
31044
|
var TOLERANCE = 10;
|
|
@@ -40853,7 +40929,8 @@
|
|
|
40853
40929
|
'canvas.viewbox.changing',
|
|
40854
40930
|
'drag.init',
|
|
40855
40931
|
'element.mousedown',
|
|
40856
|
-
'popupMenu.open'
|
|
40932
|
+
'popupMenu.open',
|
|
40933
|
+
'root.set'
|
|
40857
40934
|
], function(event) {
|
|
40858
40935
|
|
|
40859
40936
|
if (directEditing.isActive()) {
|
|
@@ -48980,7 +49057,7 @@
|
|
|
48980
49057
|
}
|
|
48981
49058
|
|
|
48982
49059
|
var LabelSupportModule = {
|
|
48983
|
-
__init__: [ 'labelSupport'],
|
|
49060
|
+
__init__: [ 'labelSupport' ],
|
|
48984
49061
|
labelSupport: [ 'type', LabelSupport ]
|
|
48985
49062
|
};
|
|
48986
49063
|
|
|
@@ -49168,7 +49245,7 @@
|
|
|
49168
49245
|
saveClear(oldShape.attachers, function(attacher) {
|
|
49169
49246
|
var allowed = rules.allowed('elements.move', {
|
|
49170
49247
|
target: newShape,
|
|
49171
|
-
shapes: [attacher]
|
|
49248
|
+
shapes: [ attacher ]
|
|
49172
49249
|
});
|
|
49173
49250
|
|
|
49174
49251
|
if (allowed === 'attach') {
|
|
@@ -50302,7 +50379,7 @@
|
|
|
50302
50379
|
}
|
|
50303
50380
|
|
|
50304
50381
|
var SpaceToolModule = {
|
|
50305
|
-
__init__: ['spaceToolPreview'],
|
|
50382
|
+
__init__: [ 'spaceToolPreview' ],
|
|
50306
50383
|
__depends__: [
|
|
50307
50384
|
DraggingModule,
|
|
50308
50385
|
RulesModule,
|
|
@@ -50310,8 +50387,8 @@
|
|
|
50310
50387
|
PreviewSupportModule,
|
|
50311
50388
|
MouseModule
|
|
50312
50389
|
],
|
|
50313
|
-
spaceTool: ['type', SpaceTool ],
|
|
50314
|
-
spaceToolPreview: ['type', SpaceToolPreview ]
|
|
50390
|
+
spaceTool: [ 'type', SpaceTool ],
|
|
50391
|
+
spaceToolPreview: [ 'type', SpaceToolPreview ]
|
|
50315
50392
|
};
|
|
50316
50393
|
|
|
50317
50394
|
function BpmnFactory(moddle) {
|
|
@@ -52431,7 +52508,7 @@
|
|
|
52431
52508
|
newParentIndex = context.newParentIndex,
|
|
52432
52509
|
oldParent = shape.parent;
|
|
52433
52510
|
|
|
52434
|
-
context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height']);
|
|
52511
|
+
context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height' ]);
|
|
52435
52512
|
|
|
52436
52513
|
// save old parent in context
|
|
52437
52514
|
context.oldParent = oldParent;
|
|
@@ -53077,7 +53154,7 @@
|
|
|
53077
53154
|
// recursively hide/show children
|
|
53078
53155
|
var result = setHiddenRecursive(children, shape.collapsed);
|
|
53079
53156
|
|
|
53080
|
-
return [shape].concat(result);
|
|
53157
|
+
return [ shape ].concat(result);
|
|
53081
53158
|
};
|
|
53082
53159
|
|
|
53083
53160
|
|
|
@@ -53094,7 +53171,7 @@
|
|
|
53094
53171
|
// retoggle state
|
|
53095
53172
|
shape.collapsed = !shape.collapsed;
|
|
53096
53173
|
|
|
53097
|
-
return [shape].concat(result);
|
|
53174
|
+
return [ shape ].concat(result);
|
|
53098
53175
|
};
|
|
53099
53176
|
|
|
53100
53177
|
|
|
@@ -59695,8 +59772,8 @@
|
|
|
59695
59772
|
var h = box.height + offset * 2;
|
|
59696
59773
|
|
|
59697
59774
|
var styles = [
|
|
59698
|
-
'width: '+ w +'px',
|
|
59699
|
-
'height: '+ h + 'px'
|
|
59775
|
+
'width: ' + w + 'px',
|
|
59776
|
+
'height: ' + h + 'px'
|
|
59700
59777
|
].join('; ');
|
|
59701
59778
|
|
|
59702
59779
|
return {
|