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
|
+
};
|
|
4822
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
|
+
}
|
|
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 || []);
|
|
@@ -21181,7 +21257,7 @@
|
|
|
21181
21257
|
};
|
|
21182
21258
|
|
|
21183
21259
|
|
|
21184
|
-
Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
|
|
21260
|
+
Outline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];
|
|
21185
21261
|
|
|
21186
21262
|
var OutlineModule = {
|
|
21187
21263
|
__init__: [ 'outline' ],
|
|
@@ -22211,7 +22287,7 @@
|
|
|
22211
22287
|
];
|
|
22212
22288
|
|
|
22213
22289
|
var ChangeSupportModule = {
|
|
22214
|
-
__init__: [ 'changeSupport'],
|
|
22290
|
+
__init__: [ 'changeSupport' ],
|
|
22215
22291
|
changeSupport: [ 'type', ChangeSupport ]
|
|
22216
22292
|
};
|
|
22217
22293
|
|
|
@@ -22383,7 +22459,7 @@
|
|
|
22383
22459
|
|
|
22384
22460
|
inherits_browser(RootElementsBehavior, CommandInterceptor);
|
|
22385
22461
|
|
|
22386
|
-
RootElementsBehavior.$inject = [ 'canvas', 'injector'];
|
|
22462
|
+
RootElementsBehavior.$inject = [ 'canvas', 'injector' ];
|
|
22387
22463
|
|
|
22388
22464
|
var RootElementsModule = {
|
|
22389
22465
|
__init__: [ 'rootElementsBehavior' ],
|
|
@@ -23488,7 +23564,7 @@
|
|
|
23488
23564
|
var KEYCODE_Y = 89;
|
|
23489
23565
|
var KEYCODE_Z = 90;
|
|
23490
23566
|
|
|
23491
|
-
var KEYS_COPY = ['c', 'C', KEYCODE_C ];
|
|
23567
|
+
var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
|
|
23492
23568
|
var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
|
|
23493
23569
|
var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
|
|
23494
23570
|
var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
|
|
@@ -23644,7 +23720,7 @@
|
|
|
23644
23720
|
|
|
23645
23721
|
var event = context.keyEvent;
|
|
23646
23722
|
|
|
23647
|
-
if (isKey(['Backspace', 'Delete', 'Del' ], event)) {
|
|
23723
|
+
if (isKey([ 'Backspace', 'Delete', 'Del' ], event)) {
|
|
23648
23724
|
editorActions.trigger('removeSelection');
|
|
23649
23725
|
|
|
23650
23726
|
return true;
|
|
@@ -29390,11 +29466,11 @@
|
|
|
29390
29466
|
y = center.y;
|
|
29391
29467
|
|
|
29392
29468
|
return [
|
|
29393
|
-
['M', x, y],
|
|
29394
|
-
['m', 0, -r],
|
|
29395
|
-
['a', r, r, 0, 1, 1, 0, 2 * r],
|
|
29396
|
-
['a', r, r, 0, 1, 1, 0, -2 * r],
|
|
29397
|
-
['z']
|
|
29469
|
+
[ 'M', x, y ],
|
|
29470
|
+
[ 'm', 0, -r ],
|
|
29471
|
+
[ 'a', r, r, 0, 1, 1, 0, 2 * r ],
|
|
29472
|
+
[ 'a', r, r, 0, 1, 1, 0, -2 * r ],
|
|
29473
|
+
[ 'z' ]
|
|
29398
29474
|
];
|
|
29399
29475
|
}
|
|
29400
29476
|
|
|
@@ -30970,7 +31046,7 @@
|
|
|
30970
31046
|
return parent.children || [];
|
|
30971
31047
|
}
|
|
30972
31048
|
|
|
30973
|
-
var abs$2= Math.abs,
|
|
31049
|
+
var abs$2 = Math.abs,
|
|
30974
31050
|
round$5 = Math.round;
|
|
30975
31051
|
|
|
30976
31052
|
var TOLERANCE = 10;
|
|
@@ -40861,7 +40937,8 @@
|
|
|
40861
40937
|
'canvas.viewbox.changing',
|
|
40862
40938
|
'drag.init',
|
|
40863
40939
|
'element.mousedown',
|
|
40864
|
-
'popupMenu.open'
|
|
40940
|
+
'popupMenu.open',
|
|
40941
|
+
'root.set'
|
|
40865
40942
|
], function(event) {
|
|
40866
40943
|
|
|
40867
40944
|
if (directEditing.isActive()) {
|
|
@@ -48988,7 +49065,7 @@
|
|
|
48988
49065
|
}
|
|
48989
49066
|
|
|
48990
49067
|
var LabelSupportModule = {
|
|
48991
|
-
__init__: [ 'labelSupport'],
|
|
49068
|
+
__init__: [ 'labelSupport' ],
|
|
48992
49069
|
labelSupport: [ 'type', LabelSupport ]
|
|
48993
49070
|
};
|
|
48994
49071
|
|
|
@@ -49176,7 +49253,7 @@
|
|
|
49176
49253
|
saveClear(oldShape.attachers, function(attacher) {
|
|
49177
49254
|
var allowed = rules.allowed('elements.move', {
|
|
49178
49255
|
target: newShape,
|
|
49179
|
-
shapes: [attacher]
|
|
49256
|
+
shapes: [ attacher ]
|
|
49180
49257
|
});
|
|
49181
49258
|
|
|
49182
49259
|
if (allowed === 'attach') {
|
|
@@ -50310,7 +50387,7 @@
|
|
|
50310
50387
|
}
|
|
50311
50388
|
|
|
50312
50389
|
var SpaceToolModule = {
|
|
50313
|
-
__init__: ['spaceToolPreview'],
|
|
50390
|
+
__init__: [ 'spaceToolPreview' ],
|
|
50314
50391
|
__depends__: [
|
|
50315
50392
|
DraggingModule,
|
|
50316
50393
|
RulesModule,
|
|
@@ -50318,8 +50395,8 @@
|
|
|
50318
50395
|
PreviewSupportModule,
|
|
50319
50396
|
MouseModule
|
|
50320
50397
|
],
|
|
50321
|
-
spaceTool: ['type', SpaceTool ],
|
|
50322
|
-
spaceToolPreview: ['type', SpaceToolPreview ]
|
|
50398
|
+
spaceTool: [ 'type', SpaceTool ],
|
|
50399
|
+
spaceToolPreview: [ 'type', SpaceToolPreview ]
|
|
50323
50400
|
};
|
|
50324
50401
|
|
|
50325
50402
|
function BpmnFactory(moddle) {
|
|
@@ -52439,7 +52516,7 @@
|
|
|
52439
52516
|
newParentIndex = context.newParentIndex,
|
|
52440
52517
|
oldParent = shape.parent;
|
|
52441
52518
|
|
|
52442
|
-
context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height']);
|
|
52519
|
+
context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height' ]);
|
|
52443
52520
|
|
|
52444
52521
|
// save old parent in context
|
|
52445
52522
|
context.oldParent = oldParent;
|
|
@@ -53085,7 +53162,7 @@
|
|
|
53085
53162
|
// recursively hide/show children
|
|
53086
53163
|
var result = setHiddenRecursive(children, shape.collapsed);
|
|
53087
53164
|
|
|
53088
|
-
return [shape].concat(result);
|
|
53165
|
+
return [ shape ].concat(result);
|
|
53089
53166
|
};
|
|
53090
53167
|
|
|
53091
53168
|
|
|
@@ -53102,7 +53179,7 @@
|
|
|
53102
53179
|
// retoggle state
|
|
53103
53180
|
shape.collapsed = !shape.collapsed;
|
|
53104
53181
|
|
|
53105
|
-
return [shape].concat(result);
|
|
53182
|
+
return [ shape ].concat(result);
|
|
53106
53183
|
};
|
|
53107
53184
|
|
|
53108
53185
|
|
|
@@ -59703,8 +59780,8 @@
|
|
|
59703
59780
|
var h = box.height + offset * 2;
|
|
59704
59781
|
|
|
59705
59782
|
var styles = [
|
|
59706
|
-
'width: '+ w +'px',
|
|
59707
|
-
'height: '+ h + 'px'
|
|
59783
|
+
'width: ' + w + 'px',
|
|
59784
|
+
'height: ' + h + 'px'
|
|
59708
59785
|
].join('; ');
|
|
59709
59786
|
|
|
59710
59787
|
return {
|