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) {
|
|
@@ -30350,7 +30605,7 @@
|
|
|
30350
30605
|
|
|
30351
30606
|
classes$1(gfx).add(MARKER_CONNECTION_PREVIEW);
|
|
30352
30607
|
|
|
30353
|
-
append(this._canvas.
|
|
30608
|
+
append(this._canvas.getActiveLayer(), gfx);
|
|
30354
30609
|
|
|
30355
30610
|
return gfx;
|
|
30356
30611
|
};
|
|
@@ -32067,13 +32322,13 @@
|
|
|
32067
32322
|
dragGroup = context.dragGroup = createDragGroup(elements);
|
|
32068
32323
|
}
|
|
32069
32324
|
|
|
32070
|
-
var
|
|
32325
|
+
var activeLayer;
|
|
32071
32326
|
|
|
32072
32327
|
if (hover) {
|
|
32073
32328
|
if (!dragGroup.parentNode) {
|
|
32074
|
-
|
|
32329
|
+
activeLayer = canvas.getActiveLayer();
|
|
32075
32330
|
|
|
32076
|
-
append(
|
|
32331
|
+
append(activeLayer, dragGroup);
|
|
32077
32332
|
}
|
|
32078
32333
|
|
|
32079
32334
|
translate(dragGroup, event.x, event.y);
|
|
@@ -33749,11 +34004,16 @@
|
|
|
33749
34004
|
|
|
33750
34005
|
var propertyDescriptor = this._moddle.getPropertyDescriptor(parent, propertyName);
|
|
33751
34006
|
|
|
33752
|
-
// do NOT copy
|
|
33753
|
-
if (propertyDescriptor.
|
|
34007
|
+
// do NOT copy references
|
|
34008
|
+
if (propertyDescriptor.isReference) {
|
|
33754
34009
|
return;
|
|
33755
34010
|
}
|
|
33756
34011
|
|
|
34012
|
+
// copy id
|
|
34013
|
+
if (propertyDescriptor.isId) {
|
|
34014
|
+
return this._copyId(property, parent);
|
|
34015
|
+
}
|
|
34016
|
+
|
|
33757
34017
|
// copy arrays
|
|
33758
34018
|
if (isArray(property)) {
|
|
33759
34019
|
return reduce(property, function(childProperties, childProperty) {
|
|
@@ -33792,6 +34052,18 @@
|
|
|
33792
34052
|
return property;
|
|
33793
34053
|
};
|
|
33794
34054
|
|
|
34055
|
+
ModdleCopy.prototype._copyId = function(id, element) {
|
|
34056
|
+
|
|
34057
|
+
// disallow if already taken
|
|
34058
|
+
if (this._moddle.ids.assigned(id)) {
|
|
34059
|
+
return;
|
|
34060
|
+
} else {
|
|
34061
|
+
|
|
34062
|
+
this._moddle.ids.claim(id, element);
|
|
34063
|
+
return id;
|
|
34064
|
+
}
|
|
34065
|
+
};
|
|
34066
|
+
|
|
33795
34067
|
// helpers //////////
|
|
33796
34068
|
|
|
33797
34069
|
function getPropertyNames(descriptor, keepDefaultProperties) {
|
|
@@ -36541,8 +36813,8 @@
|
|
|
36541
36813
|
/**
|
|
36542
36814
|
* Distributes the elements with a given orientation
|
|
36543
36815
|
*
|
|
36544
|
-
* @param {Array} elements
|
|
36545
|
-
* @param {string} orientation
|
|
36816
|
+
* @param {Array} elements
|
|
36817
|
+
* @param {string} orientation
|
|
36546
36818
|
*/
|
|
36547
36819
|
DistributeElements.prototype.trigger = function(elements, orientation) {
|
|
36548
36820
|
var modeling = this._modeling;
|
|
@@ -36676,11 +36948,11 @@
|
|
|
36676
36948
|
/**
|
|
36677
36949
|
* Returns the min and max values for an element
|
|
36678
36950
|
*
|
|
36679
|
-
* @param {
|
|
36680
|
-
* @param {
|
|
36681
|
-
* @param {
|
|
36951
|
+
* @param {Bounds} element
|
|
36952
|
+
* @param {string} axis
|
|
36953
|
+
* @param {string} dimension
|
|
36682
36954
|
*
|
|
36683
|
-
* @return {
|
|
36955
|
+
* @return {{ min: number, max: number }}
|
|
36684
36956
|
*/
|
|
36685
36957
|
DistributeElements.prototype._findRange = function(element) {
|
|
36686
36958
|
var axis = element[this._axis],
|
|
@@ -38782,7 +39054,7 @@
|
|
|
38782
39054
|
frame = context.frame;
|
|
38783
39055
|
|
|
38784
39056
|
if (!frame) {
|
|
38785
|
-
frame = context.frame = previewSupport.addFrame(shape, canvas.
|
|
39057
|
+
frame = context.frame = previewSupport.addFrame(shape, canvas.getActiveLayer());
|
|
38786
39058
|
|
|
38787
39059
|
canvas.addMarker(shape, MARKER_RESIZING);
|
|
38788
39060
|
}
|
|
@@ -43393,6 +43665,49 @@
|
|
|
43393
43665
|
'selection'
|
|
43394
43666
|
];
|
|
43395
43667
|
|
|
43668
|
+
var HIGH_PRIORITY$b = 1500;
|
|
43669
|
+
|
|
43670
|
+
var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };
|
|
43671
|
+
|
|
43672
|
+
var PARTICIPANT_MIN_DIMENSIONS = { width: 300, height: 150 };
|
|
43673
|
+
|
|
43674
|
+
var SUB_PROCESS_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
43675
|
+
|
|
43676
|
+
var TEXT_ANNOTATION_MIN_DIMENSIONS = { width: 50, height: 30 };
|
|
43677
|
+
|
|
43678
|
+
/**
|
|
43679
|
+
* Set minimum bounds/resize constraints on resize.
|
|
43680
|
+
*
|
|
43681
|
+
* @param {EventBus} eventBus
|
|
43682
|
+
*/
|
|
43683
|
+
function ResizeBehavior$1(eventBus) {
|
|
43684
|
+
eventBus.on('resize.start', HIGH_PRIORITY$b, function(event) {
|
|
43685
|
+
var context = event.context,
|
|
43686
|
+
shape = context.shape,
|
|
43687
|
+
direction = context.direction,
|
|
43688
|
+
balanced = context.balanced;
|
|
43689
|
+
|
|
43690
|
+
if (is$1(shape, 'bpmn:Lane') || is$1(shape, 'bpmn:Participant')) {
|
|
43691
|
+
context.resizeConstraints = getParticipantResizeConstraints(shape, direction, balanced);
|
|
43692
|
+
}
|
|
43693
|
+
|
|
43694
|
+
if (is$1(shape, 'bpmn:Participant')) {
|
|
43695
|
+
context.minDimensions = PARTICIPANT_MIN_DIMENSIONS;
|
|
43696
|
+
}
|
|
43697
|
+
|
|
43698
|
+
if (is$1(shape, 'bpmn:SubProcess') && isExpanded(shape)) {
|
|
43699
|
+
context.minDimensions = SUB_PROCESS_MIN_DIMENSIONS;
|
|
43700
|
+
}
|
|
43701
|
+
|
|
43702
|
+
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
43703
|
+
context.minDimensions = TEXT_ANNOTATION_MIN_DIMENSIONS;
|
|
43704
|
+
}
|
|
43705
|
+
});
|
|
43706
|
+
}
|
|
43707
|
+
|
|
43708
|
+
ResizeBehavior$1.$inject = [ 'eventBus' ];
|
|
43709
|
+
|
|
43710
|
+
|
|
43396
43711
|
var abs$5 = Math.abs,
|
|
43397
43712
|
min$3 = Math.min,
|
|
43398
43713
|
max$4 = Math.max;
|
|
@@ -43420,7 +43735,6 @@
|
|
|
43420
43735
|
LANE_TOP_PADDING = 20,
|
|
43421
43736
|
LANE_BOTTOM_PADDING = 20;
|
|
43422
43737
|
|
|
43423
|
-
|
|
43424
43738
|
function getParticipantResizeConstraints(laneShape, resizeDirection, balanced) {
|
|
43425
43739
|
var lanesRoot = getLanesRoot(laneShape);
|
|
43426
43740
|
|
|
@@ -43513,49 +43827,6 @@
|
|
|
43513
43827
|
};
|
|
43514
43828
|
}
|
|
43515
43829
|
|
|
43516
|
-
var HIGH_PRIORITY$b = 1500;
|
|
43517
|
-
|
|
43518
|
-
var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };
|
|
43519
|
-
|
|
43520
|
-
var PARTICIPANT_MIN_DIMENSIONS = { width: 300, height: 150 };
|
|
43521
|
-
|
|
43522
|
-
var SUB_PROCESS_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
43523
|
-
|
|
43524
|
-
var TEXT_ANNOTATION_MIN_DIMENSIONS = { width: 50, height: 30 };
|
|
43525
|
-
|
|
43526
|
-
|
|
43527
|
-
/**
|
|
43528
|
-
* Set minimum bounds/resize constraints on resize.
|
|
43529
|
-
*
|
|
43530
|
-
* @param {EventBus} eventBus
|
|
43531
|
-
*/
|
|
43532
|
-
function ResizeBehavior$1(eventBus) {
|
|
43533
|
-
eventBus.on('resize.start', HIGH_PRIORITY$b, function(event) {
|
|
43534
|
-
var context = event.context,
|
|
43535
|
-
shape = context.shape,
|
|
43536
|
-
direction = context.direction,
|
|
43537
|
-
balanced = context.balanced;
|
|
43538
|
-
|
|
43539
|
-
if (is$1(shape, 'bpmn:Lane') || is$1(shape, 'bpmn:Participant')) {
|
|
43540
|
-
context.resizeConstraints = getParticipantResizeConstraints(shape, direction, balanced);
|
|
43541
|
-
}
|
|
43542
|
-
|
|
43543
|
-
if (is$1(shape, 'bpmn:Participant')) {
|
|
43544
|
-
context.minDimensions = PARTICIPANT_MIN_DIMENSIONS;
|
|
43545
|
-
}
|
|
43546
|
-
|
|
43547
|
-
if (is$1(shape, 'bpmn:SubProcess') && isExpanded(shape)) {
|
|
43548
|
-
context.minDimensions = SUB_PROCESS_MIN_DIMENSIONS;
|
|
43549
|
-
}
|
|
43550
|
-
|
|
43551
|
-
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
43552
|
-
context.minDimensions = TEXT_ANNOTATION_MIN_DIMENSIONS;
|
|
43553
|
-
}
|
|
43554
|
-
});
|
|
43555
|
-
}
|
|
43556
|
-
|
|
43557
|
-
ResizeBehavior$1.$inject = [ 'eventBus' ];
|
|
43558
|
-
|
|
43559
43830
|
var SLIGHTLY_HIGHER_PRIORITY = 1001;
|
|
43560
43831
|
|
|
43561
43832
|
|
|
@@ -47732,7 +48003,7 @@
|
|
|
47732
48003
|
var dragGroup = create('g');
|
|
47733
48004
|
attr$1(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
|
|
47734
48005
|
|
|
47735
|
-
append(canvas.
|
|
48006
|
+
append(canvas.getActiveLayer(), dragGroup);
|
|
47736
48007
|
|
|
47737
48008
|
// shapes
|
|
47738
48009
|
addPreviewGfx(movingShapes, dragGroup);
|
|
@@ -47794,7 +48065,7 @@
|
|
|
47794
48065
|
var frameGroup = create('g');
|
|
47795
48066
|
attr$1(frameGroup, styles.cls('djs-frame-group', [ 'no-events' ]));
|
|
47796
48067
|
|
|
47797
|
-
append(canvas.
|
|
48068
|
+
append(canvas.getActiveLayer(), frameGroup);
|
|
47798
48069
|
|
|
47799
48070
|
var frames = [];
|
|
47800
48071
|
|
|
@@ -54171,9 +54442,9 @@
|
|
|
54171
54442
|
|
|
54172
54443
|
attr$1(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
|
|
54173
54444
|
|
|
54174
|
-
var
|
|
54445
|
+
var activeLayer = canvas.getActiveLayer();
|
|
54175
54446
|
|
|
54176
|
-
append(
|
|
54447
|
+
append(activeLayer, dragGroup);
|
|
54177
54448
|
|
|
54178
54449
|
context.dragGroup = dragGroup;
|
|
54179
54450
|
}
|
|
@@ -54796,7 +55067,7 @@
|
|
|
54796
55067
|
var visuals = {
|
|
54797
55068
|
|
|
54798
55069
|
create: function(context) {
|
|
54799
|
-
var container = canvas.
|
|
55070
|
+
var container = canvas.getActiveLayer(),
|
|
54800
55071
|
frame;
|
|
54801
55072
|
|
|
54802
55073
|
frame = context.frame = create('rect');
|
|
@@ -65687,6 +65958,14 @@
|
|
|
65687
65958
|
priority = DEFAULT_PRIORITY$6;
|
|
65688
65959
|
}
|
|
65689
65960
|
|
|
65961
|
+
if (typeof provider.getTabs !== 'function') {
|
|
65962
|
+
console.error(
|
|
65963
|
+
'Properties provider does not impement #getTabs(element) API'
|
|
65964
|
+
);
|
|
65965
|
+
|
|
65966
|
+
return;
|
|
65967
|
+
}
|
|
65968
|
+
|
|
65690
65969
|
this._eventBus.on('propertiesPanel.getProviders', priority, function(event) {
|
|
65691
65970
|
event.providers.push(provider);
|
|
65692
65971
|
});
|
|
@@ -65798,7 +66077,7 @@
|
|
|
65798
66077
|
self.detach();
|
|
65799
66078
|
});
|
|
65800
66079
|
|
|
65801
|
-
this._container = domify$2('<div class="bpp-properties-panel"></div>');
|
|
66080
|
+
this._container = domify$2('<div class="bpp-properties-panel" input-handle-modified-keys="z,y"></div>');
|
|
65802
66081
|
|
|
65803
66082
|
this._bindListeners(this._container);
|
|
65804
66083
|
|