camunda-bpmn-js 0.11.1 → 0.11.5
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 +23 -0
- package/dist/base-modeler.development.js +383 -104
- package/dist/base-modeler.production.min.js +3 -3
- package/dist/camunda-cloud-modeler.development.js +383 -104
- package/dist/camunda-cloud-modeler.production.min.js +3 -3
- package/dist/camunda-platform-modeler.development.js +404 -107
- package/dist/camunda-platform-modeler.production.min.js +3 -3
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +8 -1
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +12 -0
- package/package.json +5 -5
|
@@ -4512,6 +4512,14 @@
|
|
|
4512
4512
|
return isNumber(number) ? number + 'px' : number;
|
|
4513
4513
|
}
|
|
4514
4514
|
|
|
4515
|
+
function findRoot(element) {
|
|
4516
|
+
while (element.parent) {
|
|
4517
|
+
element = element.parent;
|
|
4518
|
+
}
|
|
4519
|
+
|
|
4520
|
+
return element;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4515
4523
|
/**
|
|
4516
4524
|
* Creates a HTML container element for a SVG element with
|
|
4517
4525
|
* the given configuration
|
|
@@ -4557,6 +4565,7 @@
|
|
|
4557
4565
|
}
|
|
4558
4566
|
|
|
4559
4567
|
var BASE_LAYER = 'base';
|
|
4568
|
+
var HIDDEN_MARKER = 'djs-element-hidden';
|
|
4560
4569
|
|
|
4561
4570
|
|
|
4562
4571
|
var REQUIRED_MODEL_ATTRS = {
|
|
@@ -4593,23 +4602,23 @@
|
|
|
4593
4602
|
'elementRegistry'
|
|
4594
4603
|
];
|
|
4595
4604
|
|
|
4605
|
+
/**
|
|
4606
|
+
* Creates a <svg> element that is wrapped into a <div>.
|
|
4607
|
+
* This way we are always able to correctly figure out the size of the svg element
|
|
4608
|
+
* by querying the parent node.
|
|
4609
|
+
|
|
4610
|
+
* (It is not possible to get the size of a svg element cross browser @ 2014-04-01)
|
|
4596
4611
|
|
|
4612
|
+
* <div class="djs-container" style="width: {desired-width}, height: {desired-height}">
|
|
4613
|
+
* <svg width="100%" height="100%">
|
|
4614
|
+
* ...
|
|
4615
|
+
* </svg>
|
|
4616
|
+
* </div>
|
|
4617
|
+
*/
|
|
4597
4618
|
Canvas.prototype._init = function(config) {
|
|
4598
4619
|
|
|
4599
4620
|
var eventBus = this._eventBus;
|
|
4600
4621
|
|
|
4601
|
-
// Creates a <svg> element that is wrapped into a <div>.
|
|
4602
|
-
// This way we are always able to correctly figure out the size of the svg element
|
|
4603
|
-
// by querying the parent node.
|
|
4604
|
-
//
|
|
4605
|
-
// (It is not possible to get the size of a svg element cross browser @ 2014-04-01)
|
|
4606
|
-
//
|
|
4607
|
-
// <div class="djs-container" style="width: {desired-width}, height: {desired-height}">
|
|
4608
|
-
// <svg width="100%" height="100%">
|
|
4609
|
-
// ...
|
|
4610
|
-
// </svg>
|
|
4611
|
-
// </div>
|
|
4612
|
-
|
|
4613
4622
|
// html container
|
|
4614
4623
|
var container = this._container = createContainer(config);
|
|
4615
4624
|
|
|
@@ -4621,6 +4630,7 @@
|
|
|
4621
4630
|
var viewport = this._viewport = createGroup(svg, 'viewport');
|
|
4622
4631
|
|
|
4623
4632
|
this._layers = {};
|
|
4633
|
+
this._planes = {};
|
|
4624
4634
|
|
|
4625
4635
|
// debounce canvas.viewbox.changed events
|
|
4626
4636
|
// for smoother diagram interaction
|
|
@@ -4679,7 +4689,8 @@
|
|
|
4679
4689
|
delete this._svg;
|
|
4680
4690
|
delete this._container;
|
|
4681
4691
|
delete this._layers;
|
|
4682
|
-
delete this.
|
|
4692
|
+
delete this._planes;
|
|
4693
|
+
delete this._activePlane;
|
|
4683
4694
|
delete this._viewport;
|
|
4684
4695
|
};
|
|
4685
4696
|
|
|
@@ -4694,12 +4705,16 @@
|
|
|
4694
4705
|
var type = getType(element);
|
|
4695
4706
|
|
|
4696
4707
|
if (type === 'root') {
|
|
4697
|
-
self.
|
|
4708
|
+
self.setRootElementForPlane(null, self.findPlane(element), true);
|
|
4698
4709
|
} else {
|
|
4699
4710
|
self._removeElement(element, type);
|
|
4700
4711
|
}
|
|
4701
4712
|
});
|
|
4702
4713
|
|
|
4714
|
+
// remove all planes
|
|
4715
|
+
this._activePlane = null;
|
|
4716
|
+
this._planes = {};
|
|
4717
|
+
|
|
4703
4718
|
// force recomputation of view box
|
|
4704
4719
|
delete this._cachedViewbox;
|
|
4705
4720
|
};
|
|
@@ -4711,7 +4726,7 @@
|
|
|
4711
4726
|
* @returns {SVGElement}
|
|
4712
4727
|
*/
|
|
4713
4728
|
Canvas.prototype.getDefaultLayer = function() {
|
|
4714
|
-
return this.getLayer(BASE_LAYER
|
|
4729
|
+
return this.getLayer(BASE_LAYER);
|
|
4715
4730
|
};
|
|
4716
4731
|
|
|
4717
4732
|
/**
|
|
@@ -4779,6 +4794,142 @@
|
|
|
4779
4794
|
|
|
4780
4795
|
};
|
|
4781
4796
|
|
|
4797
|
+
/**
|
|
4798
|
+
* Returns a plane that is used to draw elements on it.
|
|
4799
|
+
*
|
|
4800
|
+
* @param {string} name
|
|
4801
|
+
*
|
|
4802
|
+
* @return {Object} plane descriptor with { layer, rootElement, name }
|
|
4803
|
+
*/
|
|
4804
|
+
Canvas.prototype.getPlane = function(name) {
|
|
4805
|
+
if (!name) {
|
|
4806
|
+
throw new Error('must specify a name');
|
|
4807
|
+
}
|
|
4808
|
+
|
|
4809
|
+
var plane = this._planes[name];
|
|
4810
|
+
|
|
4811
|
+
return plane;
|
|
4812
|
+
};
|
|
4813
|
+
|
|
4814
|
+
/**
|
|
4815
|
+
* Creates a plane that is used to draw elements on it. If no
|
|
4816
|
+
* root element is provided, an implicit root will be used.
|
|
4817
|
+
*
|
|
4818
|
+
* @param {string} name
|
|
4819
|
+
* @param {Object|djs.model.Root} [rootElement] optional root element
|
|
4820
|
+
*
|
|
4821
|
+
* @return {Object} plane descriptor with { layer, rootElement, name }
|
|
4822
|
+
*/
|
|
4823
|
+
Canvas.prototype.createPlane = function(name, rootElement) {
|
|
4824
|
+
if (!name) {
|
|
4825
|
+
throw new Error('must specify a name');
|
|
4826
|
+
}
|
|
4827
|
+
|
|
4828
|
+
if (this._planes[name]) {
|
|
4829
|
+
throw new Error('plane ' + name + ' already exists');
|
|
4830
|
+
}
|
|
4831
|
+
|
|
4832
|
+
if (!rootElement) {
|
|
4833
|
+
rootElement = {
|
|
4834
|
+
id: '__implicitroot' + name,
|
|
4835
|
+
children: [],
|
|
4836
|
+
isImplicit: true
|
|
4837
|
+
};
|
|
4838
|
+
}
|
|
4839
|
+
|
|
4840
|
+
var svgLayer = this.getLayer(name);
|
|
4841
|
+
classes$1(svgLayer).add(HIDDEN_MARKER);
|
|
4842
|
+
|
|
4843
|
+
var plane = this._planes[name] = {
|
|
4844
|
+
layer: svgLayer,
|
|
4845
|
+
name: name,
|
|
4846
|
+
rootElement: null
|
|
4847
|
+
};
|
|
4848
|
+
|
|
4849
|
+
this.setRootElementForPlane(rootElement, plane);
|
|
4850
|
+
|
|
4851
|
+
return plane;
|
|
4852
|
+
};
|
|
4853
|
+
|
|
4854
|
+
/**
|
|
4855
|
+
* Sets the active plane and hides the previously active plane.
|
|
4856
|
+
*
|
|
4857
|
+
* @param {string|Object} plane
|
|
4858
|
+
*
|
|
4859
|
+
* @return {Object} plane descriptor with { layer, rootElement, name }
|
|
4860
|
+
*/
|
|
4861
|
+
Canvas.prototype.setActivePlane = function(plane) {
|
|
4862
|
+
if (!plane) {
|
|
4863
|
+
throw new Error('must specify a plane');
|
|
4864
|
+
}
|
|
4865
|
+
|
|
4866
|
+
if (typeof plane === 'string') {
|
|
4867
|
+
plane = this.getPlane(plane);
|
|
4868
|
+
}
|
|
4869
|
+
|
|
4870
|
+
// hide previous Plane
|
|
4871
|
+
if (this._activePlane) {
|
|
4872
|
+
classes$1(this._activePlane.layer).add(HIDDEN_MARKER);
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4875
|
+
this._activePlane = plane;
|
|
4876
|
+
|
|
4877
|
+
// show current Plane
|
|
4878
|
+
classes$1(plane.layer).remove(HIDDEN_MARKER);
|
|
4879
|
+
|
|
4880
|
+
if (plane.rootElement) {
|
|
4881
|
+
this._elementRegistry.updateGraphics(plane.rootElement, this._svg, true);
|
|
4882
|
+
}
|
|
4883
|
+
|
|
4884
|
+
this._eventBus.fire('plane.set', { plane: plane });
|
|
4885
|
+
|
|
4886
|
+
return plane;
|
|
4887
|
+
};
|
|
4888
|
+
|
|
4889
|
+
/**
|
|
4890
|
+
* Returns the currently active layer
|
|
4891
|
+
*
|
|
4892
|
+
* @returns {SVGElement}
|
|
4893
|
+
*/
|
|
4894
|
+
|
|
4895
|
+
Canvas.prototype.getActiveLayer = function() {
|
|
4896
|
+
return this.getActivePlane().layer;
|
|
4897
|
+
};
|
|
4898
|
+
|
|
4899
|
+
/**
|
|
4900
|
+
* Returns the currently active plane.
|
|
4901
|
+
*
|
|
4902
|
+
* @return {Object} plane descriptor with { layer, rootElement, name }
|
|
4903
|
+
*/
|
|
4904
|
+
Canvas.prototype.getActivePlane = function() {
|
|
4905
|
+
var plane = this._activePlane;
|
|
4906
|
+
if (!plane) {
|
|
4907
|
+
plane = this.createPlane(BASE_LAYER);
|
|
4908
|
+
this.setActivePlane(BASE_LAYER);
|
|
4909
|
+
}
|
|
4910
|
+
|
|
4911
|
+
return plane;
|
|
4912
|
+
};
|
|
4913
|
+
|
|
4914
|
+
/**
|
|
4915
|
+
* Returns the plane which contains the given element.
|
|
4916
|
+
*
|
|
4917
|
+
* @param {string|djs.model.Base} element
|
|
4918
|
+
*
|
|
4919
|
+
* @return {Object} plane descriptor with { layer, rootElement, name }
|
|
4920
|
+
*/
|
|
4921
|
+
Canvas.prototype.findPlane = function(element) {
|
|
4922
|
+
if (typeof element === 'string') {
|
|
4923
|
+
element = this._elementRegistry.get(element);
|
|
4924
|
+
}
|
|
4925
|
+
|
|
4926
|
+
var root = findRoot(element);
|
|
4927
|
+
|
|
4928
|
+
return find(this._planes, function(plane) {
|
|
4929
|
+
return plane.rootElement === root;
|
|
4930
|
+
});
|
|
4931
|
+
};
|
|
4932
|
+
|
|
4782
4933
|
/**
|
|
4783
4934
|
* Returns the html element that encloses the
|
|
4784
4935
|
* drawing canvas.
|
|
@@ -4900,11 +5051,9 @@
|
|
|
4900
5051
|
};
|
|
4901
5052
|
|
|
4902
5053
|
Canvas.prototype.getRootElement = function() {
|
|
4903
|
-
|
|
4904
|
-
this.setRootElement({ id: '__implicitroot', children: [] });
|
|
4905
|
-
}
|
|
5054
|
+
var plane = this.getActivePlane();
|
|
4906
5055
|
|
|
4907
|
-
return
|
|
5056
|
+
return plane.rootElement;
|
|
4908
5057
|
};
|
|
4909
5058
|
|
|
4910
5059
|
|
|
@@ -4921,12 +5070,41 @@
|
|
|
4921
5070
|
* @return {Object|djs.model.Root} new root element
|
|
4922
5071
|
*/
|
|
4923
5072
|
Canvas.prototype.setRootElement = function(element, override) {
|
|
5073
|
+
var activePlane = this._activePlane;
|
|
5074
|
+
|
|
5075
|
+
if (activePlane) {
|
|
5076
|
+
return this.setRootElementForPlane(element, activePlane, override);
|
|
5077
|
+
} else {
|
|
5078
|
+
var basePlane = this.createPlane(BASE_LAYER, element);
|
|
5079
|
+
|
|
5080
|
+
this.setActivePlane(basePlane);
|
|
5081
|
+
|
|
5082
|
+
return basePlane.rootElement;
|
|
5083
|
+
}
|
|
5084
|
+
};
|
|
5085
|
+
|
|
5086
|
+
|
|
5087
|
+
/**
|
|
5088
|
+
* Sets a given element as the new root element for the canvas
|
|
5089
|
+
* and returns the new root element.
|
|
5090
|
+
*
|
|
5091
|
+
* @param {Object|djs.model.Root} element
|
|
5092
|
+
* @param {Object|djs.model.Root} plane
|
|
5093
|
+
* @param {boolean} [override] whether to override the current root element, if any
|
|
5094
|
+
*
|
|
5095
|
+
* @return {Object|djs.model.Root} new root element
|
|
5096
|
+
*/
|
|
5097
|
+
Canvas.prototype.setRootElementForPlane = function(element, plane, override) {
|
|
5098
|
+
|
|
5099
|
+
if (typeof plane === 'string') {
|
|
5100
|
+
plane = this.getPlane(plane);
|
|
5101
|
+
}
|
|
4924
5102
|
|
|
4925
5103
|
if (element) {
|
|
4926
5104
|
this._ensureValid('root', element);
|
|
4927
5105
|
}
|
|
4928
5106
|
|
|
4929
|
-
var currentRoot =
|
|
5107
|
+
var currentRoot = plane.rootElement,
|
|
4930
5108
|
elementRegistry = this._elementRegistry,
|
|
4931
5109
|
eventBus = this._eventBus;
|
|
4932
5110
|
|
|
@@ -4943,23 +5121,26 @@
|
|
|
4943
5121
|
}
|
|
4944
5122
|
|
|
4945
5123
|
if (element) {
|
|
4946
|
-
var gfx =
|
|
5124
|
+
var gfx = plane.layer;
|
|
4947
5125
|
|
|
4948
5126
|
// resemble element add event sequence
|
|
4949
5127
|
eventBus.fire('root.add', { element: element });
|
|
4950
5128
|
|
|
4951
|
-
elementRegistry.add(element, gfx
|
|
5129
|
+
elementRegistry.add(element, gfx);
|
|
4952
5130
|
|
|
4953
5131
|
eventBus.fire('root.added', { element: element, gfx: gfx });
|
|
5132
|
+
|
|
5133
|
+
// associate SVG with root element when active
|
|
5134
|
+
if (plane === this._activePlane) {
|
|
5135
|
+
this._elementRegistry.updateGraphics(element, this._svg, true);
|
|
5136
|
+
}
|
|
4954
5137
|
}
|
|
4955
5138
|
|
|
4956
|
-
|
|
5139
|
+
plane.rootElement = element;
|
|
4957
5140
|
|
|
4958
5141
|
return element;
|
|
4959
5142
|
};
|
|
4960
5143
|
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
5144
|
// add functionality //////////////////////
|
|
4964
5145
|
|
|
4965
5146
|
Canvas.prototype._ensureValid = function(type, element) {
|
|
@@ -5345,6 +5526,13 @@
|
|
|
5345
5526
|
*/
|
|
5346
5527
|
Canvas.prototype.scrollToElement = function(element, padding) {
|
|
5347
5528
|
var defaultPadding = 100;
|
|
5529
|
+
|
|
5530
|
+
// switch to correct Plane
|
|
5531
|
+
var targetPlane = this.findPlane(element);
|
|
5532
|
+
if (targetPlane !== this._activePlane) {
|
|
5533
|
+
this.setActivePlane(targetPlane);
|
|
5534
|
+
}
|
|
5535
|
+
|
|
5348
5536
|
if (!padding) {
|
|
5349
5537
|
padding = {};
|
|
5350
5538
|
}
|
|
@@ -5365,7 +5553,7 @@
|
|
|
5365
5553
|
zoom = this.zoom(),
|
|
5366
5554
|
dx, dy;
|
|
5367
5555
|
|
|
5368
|
-
//
|
|
5556
|
+
// shrink viewboxBounds with padding
|
|
5369
5557
|
viewboxBounds.y += padding.top / zoom;
|
|
5370
5558
|
viewboxBounds.x += padding.left / zoom;
|
|
5371
5559
|
viewboxBounds.width -= (padding.right + padding.left) / zoom;
|
|
@@ -5687,6 +5875,29 @@
|
|
|
5687
5875
|
this.add(element, gfx, secondaryGfx);
|
|
5688
5876
|
};
|
|
5689
5877
|
|
|
5878
|
+
/**
|
|
5879
|
+
* Update the graphics of an element
|
|
5880
|
+
*
|
|
5881
|
+
* @param {djs.model.Base} element
|
|
5882
|
+
* @param {SVGElement} gfx
|
|
5883
|
+
* @param {boolean} [secondary=false] whether to update the secondary connected element
|
|
5884
|
+
*/
|
|
5885
|
+
ElementRegistry.prototype.updateGraphics = function(filter, gfx, secondary) {
|
|
5886
|
+
var id = filter.id || filter;
|
|
5887
|
+
|
|
5888
|
+
var container = this._elements[id];
|
|
5889
|
+
|
|
5890
|
+
if (secondary) {
|
|
5891
|
+
container.secondaryGfx = gfx;
|
|
5892
|
+
} else {
|
|
5893
|
+
container.gfx = gfx;
|
|
5894
|
+
}
|
|
5895
|
+
|
|
5896
|
+
attr$1(gfx, ELEMENT_ID, id);
|
|
5897
|
+
|
|
5898
|
+
return gfx;
|
|
5899
|
+
};
|
|
5900
|
+
|
|
5690
5901
|
/**
|
|
5691
5902
|
* Return the model element for a given id or graphics.
|
|
5692
5903
|
*
|
|
@@ -6792,12 +7003,11 @@
|
|
|
6792
7003
|
if (returnValue === false) {
|
|
6793
7004
|
event.preventDefault();
|
|
6794
7005
|
}
|
|
6795
|
-
} catch (
|
|
6796
|
-
if (!this.handleError(
|
|
6797
|
-
console.error('unhandled error in event listener');
|
|
6798
|
-
console.error(e.stack);
|
|
7006
|
+
} catch (error) {
|
|
7007
|
+
if (!this.handleError(error)) {
|
|
7008
|
+
console.error('unhandled error in event listener', error);
|
|
6799
7009
|
|
|
6800
|
-
throw
|
|
7010
|
+
throw error;
|
|
6801
7011
|
}
|
|
6802
7012
|
}
|
|
6803
7013
|
|
|
@@ -19511,8 +19721,8 @@
|
|
|
19511
19721
|
|
|
19512
19722
|
// helpers //////////////////////
|
|
19513
19723
|
|
|
19514
|
-
// copied from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
|
|
19515
|
-
var tokenRegex = /\{([^}]+)\}/g,
|
|
19724
|
+
// copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
|
|
19725
|
+
var tokenRegex = /\{([^{}]+)\}/g,
|
|
19516
19726
|
objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx or ["xxxxx"] to run over object properties
|
|
19517
19727
|
|
|
19518
19728
|
function replacer(all, key, obj) {
|
|
@@ -20741,9 +20951,10 @@
|
|
|
20741
20951
|
*
|
|
20742
20952
|
* @param {EventBus} eventBus the event bus
|
|
20743
20953
|
*/
|
|
20744
|
-
function Selection(eventBus) {
|
|
20954
|
+
function Selection(eventBus, canvas) {
|
|
20745
20955
|
|
|
20746
20956
|
this._eventBus = eventBus;
|
|
20957
|
+
this._canvas = canvas;
|
|
20747
20958
|
|
|
20748
20959
|
this._selectedElements = [];
|
|
20749
20960
|
|
|
@@ -20754,12 +20965,12 @@
|
|
|
20754
20965
|
self.deselect(element);
|
|
20755
20966
|
});
|
|
20756
20967
|
|
|
20757
|
-
eventBus.on([ 'diagram.clear' ], function(e) {
|
|
20968
|
+
eventBus.on([ 'diagram.clear', 'plane.set' ], function(e) {
|
|
20758
20969
|
self.select(null);
|
|
20759
20970
|
});
|
|
20760
20971
|
}
|
|
20761
20972
|
|
|
20762
|
-
Selection.$inject = [ 'eventBus' ];
|
|
20973
|
+
Selection.$inject = [ 'eventBus', 'canvas' ];
|
|
20763
20974
|
|
|
20764
20975
|
|
|
20765
20976
|
Selection.prototype.deselect = function(element) {
|
|
@@ -20805,6 +21016,14 @@
|
|
|
20805
21016
|
elements = elements ? [ elements ] : [];
|
|
20806
21017
|
}
|
|
20807
21018
|
|
|
21019
|
+
var canvas = this._canvas;
|
|
21020
|
+
|
|
21021
|
+
elements = elements.filter(function(element) {
|
|
21022
|
+
var plane = canvas.findPlane(element);
|
|
21023
|
+
|
|
21024
|
+
return plane === canvas.getActivePlane();
|
|
21025
|
+
});
|
|
21026
|
+
|
|
20808
21027
|
// selection may be cleared by passing an empty array or null
|
|
20809
21028
|
// to the method
|
|
20810
21029
|
if (add) {
|
|
@@ -21473,6 +21692,13 @@
|
|
|
21473
21692
|
classes(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
21474
21693
|
}
|
|
21475
21694
|
|
|
21695
|
+
var plane = this._canvas.findPlane(element);
|
|
21696
|
+
var activePlane = this._canvas.getActivePlane();
|
|
21697
|
+
overlay.plane = plane;
|
|
21698
|
+
if (plane !== activePlane) {
|
|
21699
|
+
setVisible(htmlContainer, false);
|
|
21700
|
+
}
|
|
21701
|
+
|
|
21476
21702
|
overlay.htmlContainer = htmlContainer;
|
|
21477
21703
|
|
|
21478
21704
|
overlayContainer.overlays.push(overlay);
|
|
@@ -21626,6 +21852,12 @@
|
|
|
21626
21852
|
});
|
|
21627
21853
|
|
|
21628
21854
|
|
|
21855
|
+
eventBus.on('plane.set', function(e) {
|
|
21856
|
+
forEach(self._overlays, function(el) {
|
|
21857
|
+
setVisible(el.htmlContainer, el.plane === e.plane);
|
|
21858
|
+
});
|
|
21859
|
+
});
|
|
21860
|
+
|
|
21629
21861
|
// clear overlays with diagram
|
|
21630
21862
|
|
|
21631
21863
|
eventBus.on('diagram.clear', this.clear, this);
|
|
@@ -21775,8 +22007,9 @@
|
|
|
21775
22007
|
var KEYDOWN_EVENT = 'keyboard.keydown',
|
|
21776
22008
|
KEYUP_EVENT = 'keyboard.keyup';
|
|
21777
22009
|
|
|
21778
|
-
var
|
|
22010
|
+
var HANDLE_MODIFIER_ATTRIBUTE = 'input-handle-modified-keys';
|
|
21779
22011
|
|
|
22012
|
+
var DEFAULT_PRIORITY$1 = 1000;
|
|
21780
22013
|
|
|
21781
22014
|
/**
|
|
21782
22015
|
* A keyboard abstraction that may be activated and
|
|
@@ -21847,10 +22080,9 @@
|
|
|
21847
22080
|
};
|
|
21848
22081
|
|
|
21849
22082
|
Keyboard.prototype._keyHandler = function(event, type) {
|
|
21850
|
-
var
|
|
21851
|
-
eventBusResult;
|
|
22083
|
+
var eventBusResult;
|
|
21852
22084
|
|
|
21853
|
-
if (
|
|
22085
|
+
if (this._isEventIgnored(event)) {
|
|
21854
22086
|
return;
|
|
21855
22087
|
}
|
|
21856
22088
|
|
|
@@ -21865,6 +22097,29 @@
|
|
|
21865
22097
|
}
|
|
21866
22098
|
};
|
|
21867
22099
|
|
|
22100
|
+
Keyboard.prototype._isEventIgnored = function(event) {
|
|
22101
|
+
return isInput(event.target) && this._isModifiedKeyIgnored(event);
|
|
22102
|
+
};
|
|
22103
|
+
|
|
22104
|
+
Keyboard.prototype._isModifiedKeyIgnored = function(event) {
|
|
22105
|
+
if (!isCmd(event)) {
|
|
22106
|
+
return true;
|
|
22107
|
+
}
|
|
22108
|
+
|
|
22109
|
+
var allowedModifiers = this._getAllowedModifiers(event.target);
|
|
22110
|
+
return !allowedModifiers.includes(event.key);
|
|
22111
|
+
};
|
|
22112
|
+
|
|
22113
|
+
Keyboard.prototype._getAllowedModifiers = function(element) {
|
|
22114
|
+
var modifierContainer = closest(element, '[' + HANDLE_MODIFIER_ATTRIBUTE + ']', true);
|
|
22115
|
+
|
|
22116
|
+
if (!modifierContainer || (this._node && !this._node.contains(modifierContainer))) {
|
|
22117
|
+
return [];
|
|
22118
|
+
}
|
|
22119
|
+
|
|
22120
|
+
return modifierContainer.getAttribute(HANDLE_MODIFIER_ATTRIBUTE).split(',');
|
|
22121
|
+
};
|
|
22122
|
+
|
|
21868
22123
|
Keyboard.prototype.bind = function(node) {
|
|
21869
22124
|
|
|
21870
22125
|
// make sure that the keyboard is only bound once to the DOM
|
|
@@ -25857,7 +26112,7 @@
|
|
|
25857
26112
|
/**
|
|
25858
26113
|
* Executes the alignment of a selection of elements
|
|
25859
26114
|
*
|
|
25860
|
-
* @param {Array} elements
|
|
26115
|
+
* @param {Array} elements
|
|
25861
26116
|
* @param {string} type left|right|center|top|bottom|middle
|
|
25862
26117
|
*/
|
|
25863
26118
|
AlignElements.prototype.trigger = function(elements, type) {
|
|
@@ -30355,7 +30610,7 @@
|
|
|
30355
30610
|
|
|
30356
30611
|
classes$1(gfx).add(MARKER_CONNECTION_PREVIEW);
|
|
30357
30612
|
|
|
30358
|
-
append(this._canvas.
|
|
30613
|
+
append(this._canvas.getActiveLayer(), gfx);
|
|
30359
30614
|
|
|
30360
30615
|
return gfx;
|
|
30361
30616
|
};
|
|
@@ -32072,13 +32327,13 @@
|
|
|
32072
32327
|
dragGroup = context.dragGroup = createDragGroup(elements);
|
|
32073
32328
|
}
|
|
32074
32329
|
|
|
32075
|
-
var
|
|
32330
|
+
var activeLayer;
|
|
32076
32331
|
|
|
32077
32332
|
if (hover) {
|
|
32078
32333
|
if (!dragGroup.parentNode) {
|
|
32079
|
-
|
|
32334
|
+
activeLayer = canvas.getActiveLayer();
|
|
32080
32335
|
|
|
32081
|
-
append(
|
|
32336
|
+
append(activeLayer, dragGroup);
|
|
32082
32337
|
}
|
|
32083
32338
|
|
|
32084
32339
|
translate(dragGroup, event.x, event.y);
|
|
@@ -33754,11 +34009,16 @@
|
|
|
33754
34009
|
|
|
33755
34010
|
var propertyDescriptor = this._moddle.getPropertyDescriptor(parent, propertyName);
|
|
33756
34011
|
|
|
33757
|
-
// do NOT copy
|
|
33758
|
-
if (propertyDescriptor.
|
|
34012
|
+
// do NOT copy references
|
|
34013
|
+
if (propertyDescriptor.isReference) {
|
|
33759
34014
|
return;
|
|
33760
34015
|
}
|
|
33761
34016
|
|
|
34017
|
+
// copy id
|
|
34018
|
+
if (propertyDescriptor.isId) {
|
|
34019
|
+
return this._copyId(property, parent);
|
|
34020
|
+
}
|
|
34021
|
+
|
|
33762
34022
|
// copy arrays
|
|
33763
34023
|
if (isArray(property)) {
|
|
33764
34024
|
return reduce(property, function(childProperties, childProperty) {
|
|
@@ -33797,6 +34057,18 @@
|
|
|
33797
34057
|
return property;
|
|
33798
34058
|
};
|
|
33799
34059
|
|
|
34060
|
+
ModdleCopy.prototype._copyId = function(id, element) {
|
|
34061
|
+
|
|
34062
|
+
// disallow if already taken
|
|
34063
|
+
if (this._moddle.ids.assigned(id)) {
|
|
34064
|
+
return;
|
|
34065
|
+
} else {
|
|
34066
|
+
|
|
34067
|
+
this._moddle.ids.claim(id, element);
|
|
34068
|
+
return id;
|
|
34069
|
+
}
|
|
34070
|
+
};
|
|
34071
|
+
|
|
33800
34072
|
// helpers //////////
|
|
33801
34073
|
|
|
33802
34074
|
function getPropertyNames(descriptor, keepDefaultProperties) {
|
|
@@ -36546,8 +36818,8 @@
|
|
|
36546
36818
|
/**
|
|
36547
36819
|
* Distributes the elements with a given orientation
|
|
36548
36820
|
*
|
|
36549
|
-
* @param {Array} elements
|
|
36550
|
-
* @param {string} orientation
|
|
36821
|
+
* @param {Array} elements
|
|
36822
|
+
* @param {string} orientation
|
|
36551
36823
|
*/
|
|
36552
36824
|
DistributeElements.prototype.trigger = function(elements, orientation) {
|
|
36553
36825
|
var modeling = this._modeling;
|
|
@@ -36681,11 +36953,11 @@
|
|
|
36681
36953
|
/**
|
|
36682
36954
|
* Returns the min and max values for an element
|
|
36683
36955
|
*
|
|
36684
|
-
* @param {
|
|
36685
|
-
* @param {
|
|
36686
|
-
* @param {
|
|
36956
|
+
* @param {Bounds} element
|
|
36957
|
+
* @param {string} axis
|
|
36958
|
+
* @param {string} dimension
|
|
36687
36959
|
*
|
|
36688
|
-
* @return {
|
|
36960
|
+
* @return {{ min: number, max: number }}
|
|
36689
36961
|
*/
|
|
36690
36962
|
DistributeElements.prototype._findRange = function(element) {
|
|
36691
36963
|
var axis = element[this._axis],
|
|
@@ -38787,7 +39059,7 @@
|
|
|
38787
39059
|
frame = context.frame;
|
|
38788
39060
|
|
|
38789
39061
|
if (!frame) {
|
|
38790
|
-
frame = context.frame = previewSupport.addFrame(shape, canvas.
|
|
39062
|
+
frame = context.frame = previewSupport.addFrame(shape, canvas.getActiveLayer());
|
|
38791
39063
|
|
|
38792
39064
|
canvas.addMarker(shape, MARKER_RESIZING);
|
|
38793
39065
|
}
|
|
@@ -43398,6 +43670,49 @@
|
|
|
43398
43670
|
'selection'
|
|
43399
43671
|
];
|
|
43400
43672
|
|
|
43673
|
+
var HIGH_PRIORITY$b = 1500;
|
|
43674
|
+
|
|
43675
|
+
var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };
|
|
43676
|
+
|
|
43677
|
+
var PARTICIPANT_MIN_DIMENSIONS = { width: 300, height: 150 };
|
|
43678
|
+
|
|
43679
|
+
var SUB_PROCESS_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
43680
|
+
|
|
43681
|
+
var TEXT_ANNOTATION_MIN_DIMENSIONS = { width: 50, height: 30 };
|
|
43682
|
+
|
|
43683
|
+
/**
|
|
43684
|
+
* Set minimum bounds/resize constraints on resize.
|
|
43685
|
+
*
|
|
43686
|
+
* @param {EventBus} eventBus
|
|
43687
|
+
*/
|
|
43688
|
+
function ResizeBehavior$1(eventBus) {
|
|
43689
|
+
eventBus.on('resize.start', HIGH_PRIORITY$b, function(event) {
|
|
43690
|
+
var context = event.context,
|
|
43691
|
+
shape = context.shape,
|
|
43692
|
+
direction = context.direction,
|
|
43693
|
+
balanced = context.balanced;
|
|
43694
|
+
|
|
43695
|
+
if (is$1(shape, 'bpmn:Lane') || is$1(shape, 'bpmn:Participant')) {
|
|
43696
|
+
context.resizeConstraints = getParticipantResizeConstraints(shape, direction, balanced);
|
|
43697
|
+
}
|
|
43698
|
+
|
|
43699
|
+
if (is$1(shape, 'bpmn:Participant')) {
|
|
43700
|
+
context.minDimensions = PARTICIPANT_MIN_DIMENSIONS;
|
|
43701
|
+
}
|
|
43702
|
+
|
|
43703
|
+
if (is$1(shape, 'bpmn:SubProcess') && isExpanded(shape)) {
|
|
43704
|
+
context.minDimensions = SUB_PROCESS_MIN_DIMENSIONS;
|
|
43705
|
+
}
|
|
43706
|
+
|
|
43707
|
+
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
43708
|
+
context.minDimensions = TEXT_ANNOTATION_MIN_DIMENSIONS;
|
|
43709
|
+
}
|
|
43710
|
+
});
|
|
43711
|
+
}
|
|
43712
|
+
|
|
43713
|
+
ResizeBehavior$1.$inject = [ 'eventBus' ];
|
|
43714
|
+
|
|
43715
|
+
|
|
43401
43716
|
var abs$5 = Math.abs,
|
|
43402
43717
|
min$3 = Math.min,
|
|
43403
43718
|
max$4 = Math.max;
|
|
@@ -43425,7 +43740,6 @@
|
|
|
43425
43740
|
LANE_TOP_PADDING = 20,
|
|
43426
43741
|
LANE_BOTTOM_PADDING = 20;
|
|
43427
43742
|
|
|
43428
|
-
|
|
43429
43743
|
function getParticipantResizeConstraints(laneShape, resizeDirection, balanced) {
|
|
43430
43744
|
var lanesRoot = getLanesRoot(laneShape);
|
|
43431
43745
|
|
|
@@ -43518,49 +43832,6 @@
|
|
|
43518
43832
|
};
|
|
43519
43833
|
}
|
|
43520
43834
|
|
|
43521
|
-
var HIGH_PRIORITY$b = 1500;
|
|
43522
|
-
|
|
43523
|
-
var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };
|
|
43524
|
-
|
|
43525
|
-
var PARTICIPANT_MIN_DIMENSIONS = { width: 300, height: 150 };
|
|
43526
|
-
|
|
43527
|
-
var SUB_PROCESS_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
43528
|
-
|
|
43529
|
-
var TEXT_ANNOTATION_MIN_DIMENSIONS = { width: 50, height: 30 };
|
|
43530
|
-
|
|
43531
|
-
|
|
43532
|
-
/**
|
|
43533
|
-
* Set minimum bounds/resize constraints on resize.
|
|
43534
|
-
*
|
|
43535
|
-
* @param {EventBus} eventBus
|
|
43536
|
-
*/
|
|
43537
|
-
function ResizeBehavior$1(eventBus) {
|
|
43538
|
-
eventBus.on('resize.start', HIGH_PRIORITY$b, function(event) {
|
|
43539
|
-
var context = event.context,
|
|
43540
|
-
shape = context.shape,
|
|
43541
|
-
direction = context.direction,
|
|
43542
|
-
balanced = context.balanced;
|
|
43543
|
-
|
|
43544
|
-
if (is$1(shape, 'bpmn:Lane') || is$1(shape, 'bpmn:Participant')) {
|
|
43545
|
-
context.resizeConstraints = getParticipantResizeConstraints(shape, direction, balanced);
|
|
43546
|
-
}
|
|
43547
|
-
|
|
43548
|
-
if (is$1(shape, 'bpmn:Participant')) {
|
|
43549
|
-
context.minDimensions = PARTICIPANT_MIN_DIMENSIONS;
|
|
43550
|
-
}
|
|
43551
|
-
|
|
43552
|
-
if (is$1(shape, 'bpmn:SubProcess') && isExpanded(shape)) {
|
|
43553
|
-
context.minDimensions = SUB_PROCESS_MIN_DIMENSIONS;
|
|
43554
|
-
}
|
|
43555
|
-
|
|
43556
|
-
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
43557
|
-
context.minDimensions = TEXT_ANNOTATION_MIN_DIMENSIONS;
|
|
43558
|
-
}
|
|
43559
|
-
});
|
|
43560
|
-
}
|
|
43561
|
-
|
|
43562
|
-
ResizeBehavior$1.$inject = [ 'eventBus' ];
|
|
43563
|
-
|
|
43564
43835
|
var SLIGHTLY_HIGHER_PRIORITY = 1001;
|
|
43565
43836
|
|
|
43566
43837
|
|
|
@@ -47737,7 +48008,7 @@
|
|
|
47737
48008
|
var dragGroup = create('g');
|
|
47738
48009
|
attr$1(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
|
|
47739
48010
|
|
|
47740
|
-
append(canvas.
|
|
48011
|
+
append(canvas.getActiveLayer(), dragGroup);
|
|
47741
48012
|
|
|
47742
48013
|
// shapes
|
|
47743
48014
|
addPreviewGfx(movingShapes, dragGroup);
|
|
@@ -47799,7 +48070,7 @@
|
|
|
47799
48070
|
var frameGroup = create('g');
|
|
47800
48071
|
attr$1(frameGroup, styles.cls('djs-frame-group', [ 'no-events' ]));
|
|
47801
48072
|
|
|
47802
|
-
append(canvas.
|
|
48073
|
+
append(canvas.getActiveLayer(), frameGroup);
|
|
47803
48074
|
|
|
47804
48075
|
var frames = [];
|
|
47805
48076
|
|
|
@@ -54176,9 +54447,9 @@
|
|
|
54176
54447
|
|
|
54177
54448
|
attr$1(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
|
|
54178
54449
|
|
|
54179
|
-
var
|
|
54450
|
+
var activeLayer = canvas.getActiveLayer();
|
|
54180
54451
|
|
|
54181
|
-
append(
|
|
54452
|
+
append(activeLayer, dragGroup);
|
|
54182
54453
|
|
|
54183
54454
|
context.dragGroup = dragGroup;
|
|
54184
54455
|
}
|
|
@@ -54801,7 +55072,7 @@
|
|
|
54801
55072
|
var visuals = {
|
|
54802
55073
|
|
|
54803
55074
|
create: function(context) {
|
|
54804
|
-
var container = canvas.
|
|
55075
|
+
var container = canvas.getActiveLayer(),
|
|
54805
55076
|
frame;
|
|
54806
55077
|
|
|
54807
55078
|
frame = context.frame = create('rect');
|
|
@@ -65692,6 +65963,14 @@
|
|
|
65692
65963
|
priority = DEFAULT_PRIORITY$6;
|
|
65693
65964
|
}
|
|
65694
65965
|
|
|
65966
|
+
if (typeof provider.getTabs !== 'function') {
|
|
65967
|
+
console.error(
|
|
65968
|
+
'Properties provider does not impement #getTabs(element) API'
|
|
65969
|
+
);
|
|
65970
|
+
|
|
65971
|
+
return;
|
|
65972
|
+
}
|
|
65973
|
+
|
|
65695
65974
|
this._eventBus.on('propertiesPanel.getProviders', priority, function(event) {
|
|
65696
65975
|
event.providers.push(provider);
|
|
65697
65976
|
});
|
|
@@ -65803,7 +66082,7 @@
|
|
|
65803
66082
|
self.detach();
|
|
65804
66083
|
});
|
|
65805
66084
|
|
|
65806
|
-
this._container = domify$2('<div class="bpp-properties-panel"></div>');
|
|
66085
|
+
this._container = domify$2('<div class="bpp-properties-panel" input-handle-modified-keys="z,y"></div>');
|
|
65807
66086
|
|
|
65808
66087
|
this._bindListeners(this._container);
|
|
65809
66088
|
|
|
@@ -72095,13 +72374,20 @@
|
|
|
72095
72374
|
'properties-panel.update-businessobject-list'
|
|
72096
72375
|
], function(context) {
|
|
72097
72376
|
const {
|
|
72098
|
-
element
|
|
72377
|
+
element,
|
|
72378
|
+
oldProperties,
|
|
72379
|
+
propertyName
|
|
72099
72380
|
} = context;
|
|
72100
72381
|
|
|
72101
72382
|
const businessObject = getBusinessObject(element);
|
|
72102
72383
|
const inputOutput = getInputOutput(businessObject);
|
|
72103
72384
|
const extensionElements = businessObject.get('extensionElements');
|
|
72104
72385
|
|
|
72386
|
+
// do not apply if inputOutput got recently added
|
|
72387
|
+
if (!oldProperties && propertyName === 'values') {
|
|
72388
|
+
return;
|
|
72389
|
+
}
|
|
72390
|
+
|
|
72105
72391
|
// remove camunda:inputOutput if there are no input/output parameters anymore
|
|
72106
72392
|
if (inputOutput && isEmpty$1(inputOutput)) {
|
|
72107
72393
|
const filtered = extensionElements.values.filter(function(element) {
|
|
@@ -72216,6 +72502,12 @@
|
|
|
72216
72502
|
], function(context) {
|
|
72217
72503
|
const { properties } = context;
|
|
72218
72504
|
|
|
72505
|
+
const businessObject = (
|
|
72506
|
+
context.moddleElement ||
|
|
72507
|
+
context.businessObject ||
|
|
72508
|
+
context.element.businessObject
|
|
72509
|
+
);
|
|
72510
|
+
|
|
72219
72511
|
if ('camunda:formKey' in properties) {
|
|
72220
72512
|
Object.assign(properties, {
|
|
72221
72513
|
'camunda:formRef': undefined,
|
|
@@ -72233,6 +72525,12 @@
|
|
|
72233
72525
|
'camunda:formRefVersion': undefined
|
|
72234
72526
|
});
|
|
72235
72527
|
}
|
|
72528
|
+
|
|
72529
|
+
if (!('camunda:formRefBinding' in properties) && isUndefined(businessObject.get('camunda:formRefBinding'))) {
|
|
72530
|
+
Object.assign(properties, {
|
|
72531
|
+
'camunda:formRefBinding': 'latest'
|
|
72532
|
+
});
|
|
72533
|
+
}
|
|
72236
72534
|
}
|
|
72237
72535
|
|
|
72238
72536
|
if ('camunda:formRefBinding' in properties && properties[ 'camunda:formRefBinding' ] !== 'version') {
|
|
@@ -88671,8 +88969,7 @@
|
|
|
88671
88969
|
{
|
|
88672
88970
|
name: "formRefBinding",
|
|
88673
88971
|
isAttr: true,
|
|
88674
|
-
type: "String"
|
|
88675
|
-
"default": "latest"
|
|
88972
|
+
type: "String"
|
|
88676
88973
|
},
|
|
88677
88974
|
{
|
|
88678
88975
|
name: "formRefVersion",
|