bpmn-js 16.3.2 → 16.5.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/bpmn-modeler.development.js +686 -378
- package/dist/bpmn-modeler.production.min.js +26 -26
- package/dist/bpmn-navigated-viewer.development.js +3 -3
- package/dist/bpmn-navigated-viewer.production.min.js +2 -2
- package/dist/bpmn-viewer.development.js +3 -3
- package/dist/bpmn-viewer.production.min.js +2 -2
- package/lib/draw/BpmnRenderer.js +1 -1
- package/lib/features/context-pad/ContextPadProvider.js +7 -13
- package/lib/features/modeling/BpmnUpdater.js +3 -1
- package/lib/features/modeling/ElementFactory.js +14 -1
- package/lib/features/modeling/behavior/DeleteLaneBehavior.js +52 -7
- package/lib/features/modeling/behavior/FixHoverBehavior.js +2 -4
- package/lib/features/modeling/behavior/ResizeBehavior.d.ts +10 -0
- package/lib/features/modeling/behavior/ResizeBehavior.js +262 -210
- package/lib/features/modeling/behavior/SpaceToolBehavior.js +207 -139
- package/lib/features/modeling/behavior/TextAnnotationBehavior.d.ts +6 -0
- package/lib/features/modeling/behavior/TextAnnotationBehavior.js +43 -0
- package/lib/features/modeling/behavior/index.js +3 -0
- package/lib/features/modeling/cmd/AddLaneHandler.js +93 -10
- package/lib/features/modeling/util/LaneUtil.js +30 -4
- package/lib/features/ordering/BpmnOrderingProvider.js +9 -2
- package/lib/features/palette/PaletteProvider.js +2 -9
- package/lib/features/replace/BpmnReplace.js +4 -0
- package/lib/features/rules/BpmnRules.js +2 -2
- package/lib/features/space-tool/BpmnSpaceTool.js +8 -3
- package/lib/model/Types.d.ts +1 -0
- package/lib/model/Types.ts +1 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-modeler v16.
|
|
2
|
+
* bpmn-js - bpmn-modeler v16.5.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date: 2024-01-
|
|
11
|
+
* Date: 2024-01-30
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -17839,7 +17839,7 @@
|
|
|
17839
17839
|
*
|
|
17840
17840
|
* @return {boolean}
|
|
17841
17841
|
*/
|
|
17842
|
-
function isHorizontal$
|
|
17842
|
+
function isHorizontal$3(element) {
|
|
17843
17843
|
|
|
17844
17844
|
if (!is$1(element, 'bpmn:Participant') && !is$1(element, 'bpmn:Lane')) {
|
|
17845
17845
|
return undefined;
|
|
@@ -19048,7 +19048,7 @@
|
|
|
19048
19048
|
});
|
|
19049
19049
|
|
|
19050
19050
|
return drawPath(parentGfx, pathData, {
|
|
19051
|
-
fill:
|
|
19051
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
19052
19052
|
stroke: getStrokeColor$1(event, defaultStrokeColor, attrs.stroke),
|
|
19053
19053
|
strokeWidth: 1
|
|
19054
19054
|
});
|
|
@@ -19392,7 +19392,7 @@
|
|
|
19392
19392
|
}
|
|
19393
19393
|
|
|
19394
19394
|
function renderLaneLabel(parentGfx, text, element, attrs = {}) {
|
|
19395
|
-
var isHorizontalLane = isHorizontal$
|
|
19395
|
+
var isHorizontalLane = isHorizontal$3(element);
|
|
19396
19396
|
|
|
19397
19397
|
var textBox = renderLabel(parentGfx, text, {
|
|
19398
19398
|
box: {
|
|
@@ -20126,7 +20126,7 @@
|
|
|
20126
20126
|
var participant = renderLane(parentGfx, element, attrs);
|
|
20127
20127
|
|
|
20128
20128
|
var expandedParticipant = isExpanded(element);
|
|
20129
|
-
var horizontalParticipant = isHorizontal$
|
|
20129
|
+
var horizontalParticipant = isHorizontal$3(element);
|
|
20130
20130
|
|
|
20131
20131
|
var semantic = getBusinessObject(element),
|
|
20132
20132
|
name = semantic.get('name');
|
|
@@ -38550,16 +38550,18 @@
|
|
|
38550
38550
|
trblResize = getTRBLResize(shape, newBounds),
|
|
38551
38551
|
resizeNeeded = [];
|
|
38552
38552
|
|
|
38553
|
+
var isHorizontalLane = isHorizontal$3(shape);
|
|
38554
|
+
|
|
38553
38555
|
allLanes.forEach(function(other) {
|
|
38554
38556
|
|
|
38555
38557
|
if (other === shape) {
|
|
38556
38558
|
return;
|
|
38557
38559
|
}
|
|
38558
38560
|
|
|
38559
|
-
var topResize = 0,
|
|
38560
|
-
rightResize = trblResize.right,
|
|
38561
|
-
bottomResize = 0,
|
|
38562
|
-
leftResize = trblResize.left;
|
|
38561
|
+
var topResize = isHorizontalLane ? 0 : trblResize.top,
|
|
38562
|
+
rightResize = isHorizontalLane ? trblResize.right : 0,
|
|
38563
|
+
bottomResize = isHorizontalLane ? 0 : trblResize.bottom,
|
|
38564
|
+
leftResize = isHorizontalLane ? trblResize.left : 0;
|
|
38563
38565
|
|
|
38564
38566
|
var otherTrbl = asTRBL(other);
|
|
38565
38567
|
|
|
@@ -38573,6 +38575,16 @@
|
|
|
38573
38575
|
}
|
|
38574
38576
|
}
|
|
38575
38577
|
|
|
38578
|
+
if (trblResize.left) {
|
|
38579
|
+
if (abs$4(otherTrbl.right - shapeTrbl.left) < 10) {
|
|
38580
|
+
rightResize = shapeNewTrbl.left - otherTrbl.right;
|
|
38581
|
+
}
|
|
38582
|
+
|
|
38583
|
+
if (abs$4(otherTrbl.left - shapeTrbl.left) < 5) {
|
|
38584
|
+
leftResize = shapeNewTrbl.left - otherTrbl.left;
|
|
38585
|
+
}
|
|
38586
|
+
}
|
|
38587
|
+
|
|
38576
38588
|
if (trblResize.bottom) {
|
|
38577
38589
|
if (abs$4(otherTrbl.top - shapeTrbl.bottom) < 10) {
|
|
38578
38590
|
topResize = shapeNewTrbl.bottom - otherTrbl.top;
|
|
@@ -38583,6 +38595,16 @@
|
|
|
38583
38595
|
}
|
|
38584
38596
|
}
|
|
38585
38597
|
|
|
38598
|
+
if (trblResize.right) {
|
|
38599
|
+
if (abs$4(otherTrbl.left - shapeTrbl.right) < 10) {
|
|
38600
|
+
leftResize = shapeNewTrbl.right - otherTrbl.left;
|
|
38601
|
+
}
|
|
38602
|
+
|
|
38603
|
+
if (abs$4(otherTrbl.right - shapeTrbl.right) < 5) {
|
|
38604
|
+
rightResize = shapeNewTrbl.right - otherTrbl.right;
|
|
38605
|
+
}
|
|
38606
|
+
}
|
|
38607
|
+
|
|
38586
38608
|
if (topResize || rightResize || bottomResize || leftResize) {
|
|
38587
38609
|
|
|
38588
38610
|
resizeNeeded.push({
|
|
@@ -38621,18 +38643,29 @@
|
|
|
38621
38643
|
|
|
38622
38644
|
|
|
38623
38645
|
function compensateLaneDelete(shape, oldParent) {
|
|
38646
|
+
var isHorizontalLane = isHorizontal$3(shape);
|
|
38624
38647
|
|
|
38625
38648
|
var siblings = getChildLanes(oldParent);
|
|
38626
38649
|
|
|
38627
38650
|
var topAffected = [];
|
|
38628
38651
|
var bottomAffected = [];
|
|
38652
|
+
var leftAffected = [];
|
|
38653
|
+
var rightAffected = [];
|
|
38629
38654
|
|
|
38630
38655
|
eachElement(siblings, function(element) {
|
|
38631
38656
|
|
|
38632
|
-
if (
|
|
38633
|
-
|
|
38657
|
+
if (isHorizontalLane) {
|
|
38658
|
+
if (element.y > shape.y) {
|
|
38659
|
+
bottomAffected.push(element);
|
|
38660
|
+
} else {
|
|
38661
|
+
topAffected.push(element);
|
|
38662
|
+
}
|
|
38634
38663
|
} else {
|
|
38635
|
-
|
|
38664
|
+
if (element.x > shape.x) {
|
|
38665
|
+
rightAffected.push(element);
|
|
38666
|
+
} else {
|
|
38667
|
+
leftAffected.push(element);
|
|
38668
|
+
}
|
|
38636
38669
|
}
|
|
38637
38670
|
|
|
38638
38671
|
return element.children;
|
|
@@ -38644,14 +38677,24 @@
|
|
|
38644
38677
|
|
|
38645
38678
|
var offset;
|
|
38646
38679
|
|
|
38647
|
-
if (
|
|
38648
|
-
|
|
38680
|
+
if (isHorizontalLane) {
|
|
38681
|
+
if (bottomAffected.length && topAffected.length) {
|
|
38682
|
+
offset = shape.height / 2;
|
|
38683
|
+
} else {
|
|
38684
|
+
offset = shape.height;
|
|
38685
|
+
}
|
|
38649
38686
|
} else {
|
|
38650
|
-
|
|
38687
|
+
if (rightAffected.length && leftAffected.length) {
|
|
38688
|
+
offset = shape.width / 2;
|
|
38689
|
+
} else {
|
|
38690
|
+
offset = shape.width;
|
|
38691
|
+
}
|
|
38651
38692
|
}
|
|
38652
38693
|
|
|
38653
38694
|
var topAdjustments,
|
|
38654
|
-
bottomAdjustments
|
|
38695
|
+
bottomAdjustments,
|
|
38696
|
+
leftAdjustments,
|
|
38697
|
+
rightAdjustments;
|
|
38655
38698
|
|
|
38656
38699
|
if (topAffected.length) {
|
|
38657
38700
|
topAdjustments = spaceTool.calculateAdjustments(
|
|
@@ -38672,6 +38715,26 @@
|
|
|
38672
38715
|
bottomAdjustments.resizingShapes,
|
|
38673
38716
|
{ x: 0, y: -offset }, 'n');
|
|
38674
38717
|
}
|
|
38718
|
+
|
|
38719
|
+
if (leftAffected.length) {
|
|
38720
|
+
leftAdjustments = spaceTool.calculateAdjustments(
|
|
38721
|
+
leftAffected, 'x', offset, shape.x - 10);
|
|
38722
|
+
|
|
38723
|
+
spaceTool.makeSpace(
|
|
38724
|
+
leftAdjustments.movingShapes,
|
|
38725
|
+
leftAdjustments.resizingShapes,
|
|
38726
|
+
{ x: offset, y: 0 }, 'e');
|
|
38727
|
+
}
|
|
38728
|
+
|
|
38729
|
+
if (rightAffected.length) {
|
|
38730
|
+
rightAdjustments = spaceTool.calculateAdjustments(
|
|
38731
|
+
rightAffected, 'x', -offset, shape.x + shape.width + 10);
|
|
38732
|
+
|
|
38733
|
+
spaceTool.makeSpace(
|
|
38734
|
+
rightAdjustments.movingShapes,
|
|
38735
|
+
rightAdjustments.resizingShapes,
|
|
38736
|
+
{ x: -offset, y: 0 }, 'w');
|
|
38737
|
+
}
|
|
38675
38738
|
}
|
|
38676
38739
|
|
|
38677
38740
|
|
|
@@ -39152,7 +39215,7 @@
|
|
|
39152
39215
|
|
|
39153
39216
|
// ensure bpmn:Group and label elements are dropped
|
|
39154
39217
|
// always onto the root
|
|
39155
|
-
if (hover !== rootElement && (shape.labelTarget ||
|
|
39218
|
+
if (hover !== rootElement && (shape.labelTarget || isAny(shape, [ 'bpmn:Group', 'bpmn:TextAnnotation' ]))) {
|
|
39156
39219
|
event.hover = rootElement;
|
|
39157
39220
|
event.hoverGfx = elementRegistry.getGraphics(event.hover);
|
|
39158
39221
|
}
|
|
@@ -41650,203 +41713,252 @@
|
|
|
41650
41713
|
'selection'
|
|
41651
41714
|
];
|
|
41652
41715
|
|
|
41653
|
-
var HIGH_PRIORITY$e = 1500;
|
|
41654
|
-
|
|
41655
|
-
/**
|
|
41656
|
-
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
41657
|
-
*
|
|
41658
|
-
* @typedef {import('../../../model/Types').Shape} Shape
|
|
41659
|
-
*
|
|
41660
|
-
* @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions
|
|
41661
|
-
* @typedef {import('diagram-js/lib/util/Types').Direction} Direction
|
|
41662
|
-
* @typedef {import('diagram-js/lib/util/Types').RectTRBL} RectTRBL
|
|
41663
|
-
*/
|
|
41664
|
-
|
|
41665
|
-
/**
|
|
41666
|
-
* @type {Dimensions}
|
|
41667
|
-
*/
|
|
41668
|
-
var GROUP_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
41669
|
-
|
|
41670
|
-
/**
|
|
41671
|
-
* @type {Dimensions}
|
|
41672
|
-
*/
|
|
41673
|
-
var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };
|
|
41674
|
-
|
|
41675
|
-
/**
|
|
41676
|
-
* @type {Dimensions}
|
|
41677
|
-
*/
|
|
41678
|
-
var
|
|
41679
|
-
|
|
41680
|
-
/**
|
|
41681
|
-
* @type {Dimensions}
|
|
41682
|
-
*/
|
|
41683
|
-
var
|
|
41684
|
-
|
|
41685
|
-
/**
|
|
41686
|
-
* @type {Dimensions}
|
|
41687
|
-
*/
|
|
41688
|
-
var
|
|
41689
|
-
|
|
41690
|
-
/**
|
|
41691
|
-
*
|
|
41692
|
-
|
|
41693
|
-
|
|
41694
|
-
|
|
41695
|
-
|
|
41696
|
-
|
|
41697
|
-
|
|
41698
|
-
|
|
41699
|
-
|
|
41700
|
-
|
|
41701
|
-
|
|
41702
|
-
|
|
41703
|
-
|
|
41704
|
-
|
|
41705
|
-
|
|
41706
|
-
|
|
41707
|
-
|
|
41708
|
-
|
|
41709
|
-
|
|
41710
|
-
|
|
41711
|
-
|
|
41712
|
-
|
|
41713
|
-
|
|
41714
|
-
|
|
41715
|
-
|
|
41716
|
-
|
|
41717
|
-
|
|
41718
|
-
|
|
41719
|
-
|
|
41720
|
-
|
|
41721
|
-
|
|
41722
|
-
|
|
41723
|
-
|
|
41724
|
-
|
|
41725
|
-
|
|
41726
|
-
|
|
41727
|
-
|
|
41728
|
-
|
|
41729
|
-
|
|
41730
|
-
|
|
41731
|
-
|
|
41732
|
-
|
|
41733
|
-
|
|
41734
|
-
|
|
41735
|
-
|
|
41736
|
-
|
|
41737
|
-
|
|
41738
|
-
|
|
41739
|
-
|
|
41740
|
-
|
|
41741
|
-
|
|
41742
|
-
|
|
41743
|
-
|
|
41744
|
-
|
|
41745
|
-
|
|
41746
|
-
|
|
41747
|
-
|
|
41748
|
-
|
|
41749
|
-
|
|
41750
|
-
|
|
41751
|
-
|
|
41752
|
-
|
|
41753
|
-
|
|
41754
|
-
|
|
41755
|
-
* @
|
|
41756
|
-
*
|
|
41757
|
-
*
|
|
41758
|
-
*
|
|
41759
|
-
|
|
41760
|
-
|
|
41761
|
-
|
|
41762
|
-
|
|
41763
|
-
|
|
41764
|
-
|
|
41765
|
-
|
|
41766
|
-
|
|
41767
|
-
var
|
|
41768
|
-
|
|
41769
|
-
|
|
41770
|
-
|
|
41771
|
-
|
|
41772
|
-
|
|
41773
|
-
|
|
41774
|
-
|
|
41775
|
-
|
|
41776
|
-
|
|
41777
|
-
|
|
41778
|
-
|
|
41779
|
-
|
|
41780
|
-
|
|
41781
|
-
|
|
41782
|
-
|
|
41783
|
-
|
|
41784
|
-
|
|
41785
|
-
|
|
41786
|
-
|
|
41787
|
-
|
|
41788
|
-
|
|
41789
|
-
|
|
41790
|
-
|
|
41791
|
-
|
|
41792
|
-
|
|
41793
|
-
|
|
41794
|
-
|
|
41795
|
-
|
|
41796
|
-
|
|
41797
|
-
|
|
41798
|
-
|
|
41799
|
-
|
|
41800
|
-
|
|
41801
|
-
|
|
41802
|
-
|
|
41803
|
-
|
|
41804
|
-
|
|
41805
|
-
|
|
41806
|
-
|
|
41807
|
-
|
|
41808
|
-
|
|
41809
|
-
|
|
41810
|
-
|
|
41811
|
-
|
|
41812
|
-
|
|
41813
|
-
|
|
41814
|
-
|
|
41815
|
-
|
|
41816
|
-
|
|
41817
|
-
|
|
41818
|
-
|
|
41819
|
-
|
|
41820
|
-
|
|
41821
|
-
|
|
41822
|
-
|
|
41823
|
-
|
|
41824
|
-
|
|
41825
|
-
|
|
41826
|
-
|
|
41827
|
-
|
|
41828
|
-
|
|
41829
|
-
|
|
41830
|
-
|
|
41831
|
-
|
|
41832
|
-
|
|
41833
|
-
|
|
41834
|
-
|
|
41835
|
-
|
|
41836
|
-
|
|
41837
|
-
|
|
41838
|
-
|
|
41839
|
-
|
|
41840
|
-
|
|
41841
|
-
|
|
41842
|
-
|
|
41843
|
-
|
|
41844
|
-
|
|
41845
|
-
|
|
41846
|
-
|
|
41847
|
-
|
|
41848
|
-
|
|
41849
|
-
|
|
41716
|
+
var HIGH_PRIORITY$e = 1500;
|
|
41717
|
+
|
|
41718
|
+
/**
|
|
41719
|
+
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
41720
|
+
*
|
|
41721
|
+
* @typedef {import('../../../model/Types').Shape} Shape
|
|
41722
|
+
*
|
|
41723
|
+
* @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions
|
|
41724
|
+
* @typedef {import('diagram-js/lib/util/Types').Direction} Direction
|
|
41725
|
+
* @typedef {import('diagram-js/lib/util/Types').RectTRBL} RectTRBL
|
|
41726
|
+
*/
|
|
41727
|
+
|
|
41728
|
+
/**
|
|
41729
|
+
* @type {Dimensions}
|
|
41730
|
+
*/
|
|
41731
|
+
var GROUP_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
41732
|
+
|
|
41733
|
+
/**
|
|
41734
|
+
* @type {Dimensions}
|
|
41735
|
+
*/
|
|
41736
|
+
var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };
|
|
41737
|
+
|
|
41738
|
+
/**
|
|
41739
|
+
* @type {Dimensions}
|
|
41740
|
+
*/
|
|
41741
|
+
var VERTICAL_LANE_MIN_DIMENSIONS = { width: 60, height: 300 };
|
|
41742
|
+
|
|
41743
|
+
/**
|
|
41744
|
+
* @type {Dimensions}
|
|
41745
|
+
*/
|
|
41746
|
+
var PARTICIPANT_MIN_DIMENSIONS = { width: 300, height: 150 };
|
|
41747
|
+
|
|
41748
|
+
/**
|
|
41749
|
+
* @type {Dimensions}
|
|
41750
|
+
*/
|
|
41751
|
+
var VERTICAL_PARTICIPANT_MIN_DIMENSIONS = { width: 150, height: 300 };
|
|
41752
|
+
|
|
41753
|
+
/**
|
|
41754
|
+
* @type {Dimensions}
|
|
41755
|
+
*/
|
|
41756
|
+
var SUB_PROCESS_MIN_DIMENSIONS = { width: 140, height: 120 };
|
|
41757
|
+
|
|
41758
|
+
/**
|
|
41759
|
+
* @type {Dimensions}
|
|
41760
|
+
*/
|
|
41761
|
+
var TEXT_ANNOTATION_MIN_DIMENSIONS = { width: 50, height: 30 };
|
|
41762
|
+
|
|
41763
|
+
/**
|
|
41764
|
+
* Set minimum bounds/resize constraints on resize.
|
|
41765
|
+
*
|
|
41766
|
+
* @param {EventBus} eventBus
|
|
41767
|
+
*/
|
|
41768
|
+
function ResizeBehavior$1(eventBus) {
|
|
41769
|
+
eventBus.on('resize.start', HIGH_PRIORITY$e, function(event) {
|
|
41770
|
+
var context = event.context,
|
|
41771
|
+
shape = context.shape,
|
|
41772
|
+
direction = context.direction,
|
|
41773
|
+
balanced = context.balanced;
|
|
41774
|
+
|
|
41775
|
+
if (is$1(shape, 'bpmn:Lane') || is$1(shape, 'bpmn:Participant')) {
|
|
41776
|
+
context.resizeConstraints = getParticipantResizeConstraints(shape, direction, balanced);
|
|
41777
|
+
}
|
|
41778
|
+
|
|
41779
|
+
if (is$1(shape, 'bpmn:SubProcess') && isExpanded(shape)) {
|
|
41780
|
+
context.minDimensions = SUB_PROCESS_MIN_DIMENSIONS;
|
|
41781
|
+
}
|
|
41782
|
+
|
|
41783
|
+
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
41784
|
+
context.minDimensions = TEXT_ANNOTATION_MIN_DIMENSIONS;
|
|
41785
|
+
}
|
|
41786
|
+
});
|
|
41787
|
+
}
|
|
41788
|
+
|
|
41789
|
+
ResizeBehavior$1.$inject = [ 'eventBus' ];
|
|
41790
|
+
|
|
41791
|
+
|
|
41792
|
+
var abs$2 = Math.abs,
|
|
41793
|
+
min$1 = Math.min,
|
|
41794
|
+
max$3 = Math.max;
|
|
41795
|
+
|
|
41796
|
+
|
|
41797
|
+
function addToTrbl(trbl, attr, value, choice) {
|
|
41798
|
+
var current = trbl[attr];
|
|
41799
|
+
|
|
41800
|
+
// make sure to set the value if it does not exist
|
|
41801
|
+
// or apply the correct value by comparing against
|
|
41802
|
+
// choice(value, currentValue)
|
|
41803
|
+
trbl[attr] = current === undefined ? value : choice(value, current);
|
|
41804
|
+
}
|
|
41805
|
+
|
|
41806
|
+
function addMin(trbl, attr, value) {
|
|
41807
|
+
return addToTrbl(trbl, attr, value, min$1);
|
|
41808
|
+
}
|
|
41809
|
+
|
|
41810
|
+
function addMax(trbl, attr, value) {
|
|
41811
|
+
return addToTrbl(trbl, attr, value, max$3);
|
|
41812
|
+
}
|
|
41813
|
+
|
|
41814
|
+
var LANE_PADDING = { top: 20, left: 50, right: 20, bottom: 20 },
|
|
41815
|
+
VERTICAL_LANE_PADDING = { top: 50, left: 20, right: 20, bottom: 20 };
|
|
41816
|
+
|
|
41817
|
+
/**
|
|
41818
|
+
* @param {Shape} laneShape
|
|
41819
|
+
* @param {Direction} resizeDirection
|
|
41820
|
+
* @param {boolean} [balanced=false]
|
|
41821
|
+
*
|
|
41822
|
+
* @return { {
|
|
41823
|
+
* min: RectTRBL;
|
|
41824
|
+
* max: RectTRBL;
|
|
41825
|
+
* } }
|
|
41826
|
+
*/
|
|
41827
|
+
function getParticipantResizeConstraints(laneShape, resizeDirection, balanced) {
|
|
41828
|
+
var lanesRoot = getLanesRoot(laneShape);
|
|
41829
|
+
|
|
41830
|
+
var isFirst = true,
|
|
41831
|
+
isLast = true;
|
|
41832
|
+
|
|
41833
|
+
var allLanes = collectLanes(lanesRoot, [ lanesRoot ]);
|
|
41834
|
+
|
|
41835
|
+
var laneTrbl = asTRBL(laneShape);
|
|
41836
|
+
|
|
41837
|
+
var maxTrbl = {},
|
|
41838
|
+
minTrbl = {};
|
|
41839
|
+
|
|
41840
|
+
var isHorizontalLane = isHorizontal$3(laneShape);
|
|
41841
|
+
|
|
41842
|
+
var minDimensions = isHorizontalLane ? LANE_MIN_DIMENSIONS : VERTICAL_LANE_MIN_DIMENSIONS;
|
|
41843
|
+
|
|
41844
|
+
if (/n/.test(resizeDirection)) {
|
|
41845
|
+
minTrbl.top = laneTrbl.bottom - minDimensions.height;
|
|
41846
|
+
} else
|
|
41847
|
+
if (/e/.test(resizeDirection)) {
|
|
41848
|
+
minTrbl.right = laneTrbl.left + minDimensions.width;
|
|
41849
|
+
} else
|
|
41850
|
+
if (/s/.test(resizeDirection)) {
|
|
41851
|
+
minTrbl.bottom = laneTrbl.top + minDimensions.height;
|
|
41852
|
+
} else
|
|
41853
|
+
if (/w/.test(resizeDirection)) {
|
|
41854
|
+
minTrbl.left = laneTrbl.right - minDimensions.width;
|
|
41855
|
+
}
|
|
41856
|
+
|
|
41857
|
+
// min/max size based on related lanes
|
|
41858
|
+
allLanes.forEach(function(other) {
|
|
41859
|
+
|
|
41860
|
+
var otherTrbl = asTRBL(other);
|
|
41861
|
+
|
|
41862
|
+
if (/n/.test(resizeDirection)) {
|
|
41863
|
+
if (isHorizontalLane && otherTrbl.top < (laneTrbl.top - 10)) {
|
|
41864
|
+
isFirst = false;
|
|
41865
|
+
}
|
|
41866
|
+
|
|
41867
|
+
// max top size (based on next element)
|
|
41868
|
+
if (balanced && abs$2(laneTrbl.top - otherTrbl.bottom) < 10) {
|
|
41869
|
+
addMax(maxTrbl, 'top', otherTrbl.top + minDimensions.height);
|
|
41870
|
+
}
|
|
41871
|
+
|
|
41872
|
+
// min top size (based on self or nested element)
|
|
41873
|
+
if (abs$2(laneTrbl.top - otherTrbl.top) < 5) {
|
|
41874
|
+
addMin(minTrbl, 'top', otherTrbl.bottom - minDimensions.height);
|
|
41875
|
+
}
|
|
41876
|
+
}
|
|
41877
|
+
|
|
41878
|
+
if (/e/.test(resizeDirection)) {
|
|
41879
|
+
|
|
41880
|
+
if (!isHorizontalLane && otherTrbl.right > (laneTrbl.right + 10)) {
|
|
41881
|
+
isLast = false;
|
|
41882
|
+
}
|
|
41883
|
+
|
|
41884
|
+
// max right size (based on previous element)
|
|
41885
|
+
if (balanced && abs$2(laneTrbl.right - otherTrbl.left) < 10) {
|
|
41886
|
+
addMin(maxTrbl, 'right', otherTrbl.right - minDimensions.width);
|
|
41887
|
+
}
|
|
41888
|
+
|
|
41889
|
+
// min right size (based on self or nested element)
|
|
41890
|
+
if (abs$2(laneTrbl.right - otherTrbl.right) < 5) {
|
|
41891
|
+
addMax(minTrbl, 'right', otherTrbl.left + minDimensions.width);
|
|
41892
|
+
}
|
|
41893
|
+
}
|
|
41894
|
+
|
|
41895
|
+
if (/s/.test(resizeDirection)) {
|
|
41896
|
+
|
|
41897
|
+
if (isHorizontalLane && otherTrbl.bottom > (laneTrbl.bottom + 10)) {
|
|
41898
|
+
isLast = false;
|
|
41899
|
+
}
|
|
41900
|
+
|
|
41901
|
+
// max bottom size (based on previous element)
|
|
41902
|
+
if (balanced && abs$2(laneTrbl.bottom - otherTrbl.top) < 10) {
|
|
41903
|
+
addMin(maxTrbl, 'bottom', otherTrbl.bottom - minDimensions.height);
|
|
41904
|
+
}
|
|
41905
|
+
|
|
41906
|
+
// min bottom size (based on self or nested element)
|
|
41907
|
+
if (abs$2(laneTrbl.bottom - otherTrbl.bottom) < 5) {
|
|
41908
|
+
addMax(minTrbl, 'bottom', otherTrbl.top + minDimensions.height);
|
|
41909
|
+
}
|
|
41910
|
+
}
|
|
41911
|
+
|
|
41912
|
+
if (/w/.test(resizeDirection)) {
|
|
41913
|
+
|
|
41914
|
+
if (!isHorizontalLane && otherTrbl.left < (laneTrbl.left - 10)) {
|
|
41915
|
+
isFirst = false;
|
|
41916
|
+
}
|
|
41917
|
+
|
|
41918
|
+
// max left size (based on next element)
|
|
41919
|
+
if (balanced && abs$2(laneTrbl.left - otherTrbl.right) < 10) {
|
|
41920
|
+
addMax(maxTrbl, 'left', otherTrbl.left + minDimensions.width);
|
|
41921
|
+
}
|
|
41922
|
+
|
|
41923
|
+
// min left size (based on self or nested element)
|
|
41924
|
+
if (abs$2(laneTrbl.left - otherTrbl.left) < 5) {
|
|
41925
|
+
addMin(minTrbl, 'left', otherTrbl.right - minDimensions.width);
|
|
41926
|
+
}
|
|
41927
|
+
}
|
|
41928
|
+
});
|
|
41929
|
+
|
|
41930
|
+
// max top/bottom/left/right size based on flow nodes
|
|
41931
|
+
var flowElements = lanesRoot.children.filter(function(s) {
|
|
41932
|
+
return !s.hidden && !s.waypoints && (is$1(s, 'bpmn:FlowElement') || is$1(s, 'bpmn:Artifact'));
|
|
41933
|
+
});
|
|
41934
|
+
|
|
41935
|
+
var padding = isHorizontalLane ? LANE_PADDING : VERTICAL_LANE_PADDING;
|
|
41936
|
+
|
|
41937
|
+
flowElements.forEach(function(flowElement) {
|
|
41938
|
+
|
|
41939
|
+
var flowElementTrbl = asTRBL(flowElement);
|
|
41940
|
+
|
|
41941
|
+
if (isFirst && /n/.test(resizeDirection)) {
|
|
41942
|
+
addMin(minTrbl, 'top', flowElementTrbl.top - padding.top);
|
|
41943
|
+
}
|
|
41944
|
+
|
|
41945
|
+
if (isLast && /e/.test(resizeDirection)) {
|
|
41946
|
+
addMax(minTrbl, 'right', flowElementTrbl.right + padding.right);
|
|
41947
|
+
}
|
|
41948
|
+
|
|
41949
|
+
if (isLast && /s/.test(resizeDirection)) {
|
|
41950
|
+
addMax(minTrbl, 'bottom', flowElementTrbl.bottom + padding.bottom);
|
|
41951
|
+
}
|
|
41952
|
+
|
|
41953
|
+
if (isFirst && /w/.test(resizeDirection)) {
|
|
41954
|
+
addMin(minTrbl, 'left', flowElementTrbl.left - padding.left);
|
|
41955
|
+
}
|
|
41956
|
+
});
|
|
41957
|
+
|
|
41958
|
+
return {
|
|
41959
|
+
min: minTrbl,
|
|
41960
|
+
max: maxTrbl
|
|
41961
|
+
};
|
|
41850
41962
|
}
|
|
41851
41963
|
|
|
41852
41964
|
/**
|
|
@@ -42097,128 +42209,191 @@
|
|
|
42097
42209
|
});
|
|
42098
42210
|
}
|
|
42099
42211
|
|
|
42100
|
-
/**
|
|
42101
|
-
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
42102
|
-
*
|
|
42103
|
-
* @typedef {import('../../../model/Types').Shape} Shape
|
|
42104
|
-
*/
|
|
42105
|
-
|
|
42106
|
-
var max$2 = Math.max;
|
|
42107
|
-
|
|
42108
|
-
/**
|
|
42109
|
-
* @param {EventBus} eventBus
|
|
42110
|
-
*/
|
|
42111
|
-
function SpaceToolBehavior$1(eventBus) {
|
|
42112
|
-
eventBus.on('spaceTool.getMinDimensions', function(context) {
|
|
42113
|
-
var shapes = context.shapes,
|
|
42114
|
-
axis = context.axis,
|
|
42115
|
-
start = context.start,
|
|
42116
|
-
minDimensions = {};
|
|
42117
|
-
|
|
42118
|
-
forEach$1(shapes, function(shape) {
|
|
42119
|
-
var id = shape.id;
|
|
42120
|
-
|
|
42121
|
-
if (is$1(shape, 'bpmn:Participant')) {
|
|
42122
|
-
|
|
42123
|
-
|
|
42124
|
-
|
|
42125
|
-
|
|
42126
|
-
|
|
42127
|
-
|
|
42128
|
-
|
|
42129
|
-
|
|
42130
|
-
|
|
42131
|
-
|
|
42132
|
-
|
|
42133
|
-
|
|
42134
|
-
|
|
42135
|
-
|
|
42136
|
-
|
|
42137
|
-
|
|
42138
|
-
|
|
42139
|
-
|
|
42140
|
-
|
|
42141
|
-
|
|
42142
|
-
|
|
42143
|
-
|
|
42144
|
-
|
|
42145
|
-
|
|
42146
|
-
|
|
42147
|
-
|
|
42148
|
-
|
|
42149
|
-
|
|
42150
|
-
|
|
42151
|
-
|
|
42152
|
-
|
|
42153
|
-
|
|
42154
|
-
|
|
42155
|
-
|
|
42156
|
-
|
|
42157
|
-
|
|
42158
|
-
|
|
42159
|
-
|
|
42160
|
-
*
|
|
42161
|
-
*
|
|
42162
|
-
|
|
42163
|
-
|
|
42164
|
-
|
|
42165
|
-
|
|
42166
|
-
|
|
42167
|
-
|
|
42168
|
-
|
|
42169
|
-
|
|
42170
|
-
|
|
42171
|
-
|
|
42172
|
-
|
|
42173
|
-
|
|
42174
|
-
|
|
42175
|
-
|
|
42176
|
-
|
|
42177
|
-
|
|
42178
|
-
|
|
42179
|
-
|
|
42180
|
-
|
|
42181
|
-
|
|
42182
|
-
|
|
42183
|
-
|
|
42184
|
-
|
|
42185
|
-
|
|
42186
|
-
|
|
42187
|
-
|
|
42188
|
-
|
|
42189
|
-
|
|
42190
|
-
|
|
42191
|
-
|
|
42192
|
-
|
|
42193
|
-
|
|
42194
|
-
|
|
42195
|
-
|
|
42196
|
-
|
|
42197
|
-
|
|
42198
|
-
*
|
|
42199
|
-
*
|
|
42200
|
-
*
|
|
42201
|
-
* @
|
|
42202
|
-
|
|
42203
|
-
|
|
42204
|
-
|
|
42205
|
-
|
|
42206
|
-
|
|
42207
|
-
|
|
42208
|
-
|
|
42209
|
-
|
|
42210
|
-
|
|
42211
|
-
|
|
42212
|
-
|
|
42213
|
-
|
|
42214
|
-
|
|
42215
|
-
|
|
42216
|
-
|
|
42217
|
-
|
|
42218
|
-
|
|
42219
|
-
|
|
42220
|
-
|
|
42221
|
-
|
|
42212
|
+
/**
|
|
42213
|
+
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
42214
|
+
*
|
|
42215
|
+
* @typedef {import('../../../model/Types').Shape} Shape
|
|
42216
|
+
*/
|
|
42217
|
+
|
|
42218
|
+
var max$2 = Math.max;
|
|
42219
|
+
|
|
42220
|
+
/**
|
|
42221
|
+
* @param {EventBus} eventBus
|
|
42222
|
+
*/
|
|
42223
|
+
function SpaceToolBehavior$1(eventBus) {
|
|
42224
|
+
eventBus.on('spaceTool.getMinDimensions', function(context) {
|
|
42225
|
+
var shapes = context.shapes,
|
|
42226
|
+
axis = context.axis,
|
|
42227
|
+
start = context.start,
|
|
42228
|
+
minDimensions = {};
|
|
42229
|
+
|
|
42230
|
+
forEach$1(shapes, function(shape) {
|
|
42231
|
+
var id = shape.id;
|
|
42232
|
+
|
|
42233
|
+
if (is$1(shape, 'bpmn:Participant')) {
|
|
42234
|
+
minDimensions[ id ] = getParticipantMinDimensions(shape, axis, start);
|
|
42235
|
+
}
|
|
42236
|
+
|
|
42237
|
+
if (is$1(shape, 'bpmn:Lane')) {
|
|
42238
|
+
minDimensions[ id ] = isHorizontal$3(shape) ? LANE_MIN_DIMENSIONS : VERTICAL_LANE_MIN_DIMENSIONS;
|
|
42239
|
+
}
|
|
42240
|
+
|
|
42241
|
+
if (is$1(shape, 'bpmn:SubProcess') && isExpanded(shape)) {
|
|
42242
|
+
minDimensions[ id ] = SUB_PROCESS_MIN_DIMENSIONS;
|
|
42243
|
+
}
|
|
42244
|
+
|
|
42245
|
+
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
42246
|
+
minDimensions[ id ] = TEXT_ANNOTATION_MIN_DIMENSIONS;
|
|
42247
|
+
}
|
|
42248
|
+
|
|
42249
|
+
if (is$1(shape, 'bpmn:Group')) {
|
|
42250
|
+
minDimensions[ id ] = GROUP_MIN_DIMENSIONS;
|
|
42251
|
+
}
|
|
42252
|
+
});
|
|
42253
|
+
|
|
42254
|
+
return minDimensions;
|
|
42255
|
+
});
|
|
42256
|
+
}
|
|
42257
|
+
|
|
42258
|
+
SpaceToolBehavior$1.$inject = [ 'eventBus' ];
|
|
42259
|
+
|
|
42260
|
+
|
|
42261
|
+
// helpers //////////
|
|
42262
|
+
function isHorizontalAxis(axis) {
|
|
42263
|
+
return axis === 'x';
|
|
42264
|
+
}
|
|
42265
|
+
|
|
42266
|
+
/**
|
|
42267
|
+
* Get minimum dimensions for participant taking lanes into account.
|
|
42268
|
+
*
|
|
42269
|
+
* @param {Shape} participant
|
|
42270
|
+
* @param {Axis} axis
|
|
42271
|
+
* @param {number} start
|
|
42272
|
+
*
|
|
42273
|
+
* @return {number}
|
|
42274
|
+
*/
|
|
42275
|
+
function getParticipantMinDimensions(participant, axis, start) {
|
|
42276
|
+
var isHorizontalLane = isHorizontal$3(participant);
|
|
42277
|
+
|
|
42278
|
+
if (!hasChildLanes(participant)) {
|
|
42279
|
+
return isHorizontalLane ? PARTICIPANT_MIN_DIMENSIONS : VERTICAL_PARTICIPANT_MIN_DIMENSIONS;
|
|
42280
|
+
}
|
|
42281
|
+
|
|
42282
|
+
var isHorizontalResize = isHorizontalAxis(axis);
|
|
42283
|
+
var minDimensions = {};
|
|
42284
|
+
|
|
42285
|
+
if (isHorizontalResize) {
|
|
42286
|
+
if (isHorizontalLane) {
|
|
42287
|
+
minDimensions = PARTICIPANT_MIN_DIMENSIONS;
|
|
42288
|
+
} else {
|
|
42289
|
+
minDimensions = {
|
|
42290
|
+
width: getParticipantMinWidth(participant, start, isHorizontalResize),
|
|
42291
|
+
height: VERTICAL_PARTICIPANT_MIN_DIMENSIONS.height
|
|
42292
|
+
};
|
|
42293
|
+
}
|
|
42294
|
+
|
|
42295
|
+
} else {
|
|
42296
|
+
if (isHorizontalLane) {
|
|
42297
|
+
minDimensions = {
|
|
42298
|
+
width: PARTICIPANT_MIN_DIMENSIONS.width,
|
|
42299
|
+
height: getParticipantMinHeight(participant, start, isHorizontalResize)
|
|
42300
|
+
};
|
|
42301
|
+
} else {
|
|
42302
|
+
minDimensions = VERTICAL_PARTICIPANT_MIN_DIMENSIONS;
|
|
42303
|
+
}
|
|
42304
|
+
}
|
|
42305
|
+
|
|
42306
|
+
return minDimensions;
|
|
42307
|
+
}
|
|
42308
|
+
|
|
42309
|
+
/**
|
|
42310
|
+
* Get minimum height for participant taking lanes into account.
|
|
42311
|
+
*
|
|
42312
|
+
* @param {Shape} participant
|
|
42313
|
+
* @param {number} start
|
|
42314
|
+
* @param {boolean} isHorizontalResize
|
|
42315
|
+
*
|
|
42316
|
+
* @return {number}
|
|
42317
|
+
*/
|
|
42318
|
+
function getParticipantMinHeight(participant, start, isHorizontalResize) {
|
|
42319
|
+
var lanesMinHeight;
|
|
42320
|
+
lanesMinHeight = getLanesMinHeight(participant, start, isHorizontalResize);
|
|
42321
|
+
return max$2(PARTICIPANT_MIN_DIMENSIONS.height, lanesMinHeight);
|
|
42322
|
+
}
|
|
42323
|
+
|
|
42324
|
+
/**
|
|
42325
|
+
* Get minimum width for participant taking lanes into account.
|
|
42326
|
+
*
|
|
42327
|
+
* @param {Shape} participant
|
|
42328
|
+
* @param {number} start
|
|
42329
|
+
* @param {boolean} isHorizontalResize
|
|
42330
|
+
*
|
|
42331
|
+
* @return {number}
|
|
42332
|
+
*/
|
|
42333
|
+
function getParticipantMinWidth(participant, start, isHorizontalResize) {
|
|
42334
|
+
var lanesMinWidth;
|
|
42335
|
+
lanesMinWidth = getLanesMinWidth(participant, start, isHorizontalResize);
|
|
42336
|
+
return max$2(VERTICAL_PARTICIPANT_MIN_DIMENSIONS.width, lanesMinWidth);
|
|
42337
|
+
}
|
|
42338
|
+
|
|
42339
|
+
function hasChildLanes(element) {
|
|
42340
|
+
return !!getChildLanes(element).length;
|
|
42341
|
+
}
|
|
42342
|
+
|
|
42343
|
+
function getLanesMinHeight(participant, resizeStart, isHorizontalResize) {
|
|
42344
|
+
var lanes = getChildLanes(participant),
|
|
42345
|
+
resizedLane;
|
|
42346
|
+
|
|
42347
|
+
// find the nested lane which is currently resized
|
|
42348
|
+
resizedLane = findResizedLane(lanes, resizeStart, isHorizontalResize);
|
|
42349
|
+
|
|
42350
|
+
// resized lane cannot shrink below the minimum height
|
|
42351
|
+
// but remaining lanes' dimensions are kept intact
|
|
42352
|
+
return participant.height - resizedLane.height + LANE_MIN_DIMENSIONS.height;
|
|
42353
|
+
}
|
|
42354
|
+
|
|
42355
|
+
function getLanesMinWidth(participant, resizeStart, isHorizontalResize) {
|
|
42356
|
+
var lanes = getChildLanes(participant),
|
|
42357
|
+
resizedLane;
|
|
42358
|
+
|
|
42359
|
+
// find the nested lane which is currently resized
|
|
42360
|
+
resizedLane = findResizedLane(lanes, resizeStart, isHorizontalResize);
|
|
42361
|
+
|
|
42362
|
+
// resized lane cannot shrink below the minimum width
|
|
42363
|
+
// but remaining lanes' dimensions are kept intact
|
|
42364
|
+
return participant.width - resizedLane.width + VERTICAL_LANE_MIN_DIMENSIONS.width;
|
|
42365
|
+
}
|
|
42366
|
+
|
|
42367
|
+
/**
|
|
42368
|
+
* Find nested lane which is currently resized.
|
|
42369
|
+
*
|
|
42370
|
+
* @param {Shape[]} lanes
|
|
42371
|
+
* @param {number} resizeStart
|
|
42372
|
+
* @param {boolean} isHorizontalResize
|
|
42373
|
+
*
|
|
42374
|
+
* @return {Shape}
|
|
42375
|
+
*/
|
|
42376
|
+
function findResizedLane(lanes, resizeStart, isHorizontalResize) {
|
|
42377
|
+
var i, lane, childLanes;
|
|
42378
|
+
|
|
42379
|
+
for (i = 0; i < lanes.length; i++) {
|
|
42380
|
+
lane = lanes[i];
|
|
42381
|
+
|
|
42382
|
+
// resizing current lane or a lane nested
|
|
42383
|
+
if (!isHorizontalResize && resizeStart >= lane.y && resizeStart <= lane.y + lane.height ||
|
|
42384
|
+
isHorizontalResize && resizeStart >= lane.x && resizeStart <= lane.x + lane.width) {
|
|
42385
|
+
|
|
42386
|
+
childLanes = getChildLanes(lane);
|
|
42387
|
+
|
|
42388
|
+
// a nested lane is resized
|
|
42389
|
+
if (childLanes.length) {
|
|
42390
|
+
return findResizedLane(childLanes, resizeStart, isHorizontalResize);
|
|
42391
|
+
}
|
|
42392
|
+
|
|
42393
|
+
// current lane is the resized one
|
|
42394
|
+
return lane;
|
|
42395
|
+
}
|
|
42396
|
+
}
|
|
42222
42397
|
}
|
|
42223
42398
|
|
|
42224
42399
|
/**
|
|
@@ -42837,6 +43012,44 @@
|
|
|
42837
43012
|
};
|
|
42838
43013
|
}
|
|
42839
43014
|
|
|
43015
|
+
/**
|
|
43016
|
+
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
43017
|
+
*/
|
|
43018
|
+
|
|
43019
|
+
function TextAnnotationBehavior(eventBus) {
|
|
43020
|
+
|
|
43021
|
+
CommandInterceptor.call(this, eventBus);
|
|
43022
|
+
|
|
43023
|
+
// On Append, TextAnnotations will be created on the Root.
|
|
43024
|
+
// The default for connections will create the connection in the parent of
|
|
43025
|
+
// the source element, so we overwrite the parent here.
|
|
43026
|
+
this.preExecute('connection.create', function(context) {
|
|
43027
|
+
const { target } = context;
|
|
43028
|
+
|
|
43029
|
+
if (!is$1(target, 'bpmn:TextAnnotation')) {
|
|
43030
|
+
return;
|
|
43031
|
+
}
|
|
43032
|
+
|
|
43033
|
+
context.parent = target.parent;
|
|
43034
|
+
}, true);
|
|
43035
|
+
|
|
43036
|
+
this.preExecute([ 'shape.create', 'shape.resize', 'elements.move' ], function(context) {
|
|
43037
|
+
const shapes = context.shapes || [ context.shape ];
|
|
43038
|
+
|
|
43039
|
+
if (shapes.length === 1 && is$1(shapes[0], 'bpmn:TextAnnotation')) {
|
|
43040
|
+
context.hints = context.hints || {};
|
|
43041
|
+
|
|
43042
|
+
context.hints.autoResize = false;
|
|
43043
|
+
}
|
|
43044
|
+
}, true);
|
|
43045
|
+
}
|
|
43046
|
+
|
|
43047
|
+
e$2(TextAnnotationBehavior, CommandInterceptor);
|
|
43048
|
+
|
|
43049
|
+
TextAnnotationBehavior.$inject = [
|
|
43050
|
+
'eventBus'
|
|
43051
|
+
];
|
|
43052
|
+
|
|
42840
43053
|
/**
|
|
42841
43054
|
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
42842
43055
|
* @typedef {import('../Modeling').default} Modeling
|
|
@@ -43357,6 +43570,7 @@
|
|
|
43357
43570
|
'spaceToolBehavior',
|
|
43358
43571
|
'subProcessPlaneBehavior',
|
|
43359
43572
|
'subProcessStartEventBehavior',
|
|
43573
|
+
'textAnnotationBehavior',
|
|
43360
43574
|
'toggleCollapseConnectionBehaviour',
|
|
43361
43575
|
'toggleElementCollapseBehaviour',
|
|
43362
43576
|
'unclaimIdBehavior',
|
|
@@ -43397,6 +43611,7 @@
|
|
|
43397
43611
|
spaceToolBehavior: [ 'type', SpaceToolBehavior$1 ],
|
|
43398
43612
|
subProcessPlaneBehavior: [ 'type', SubProcessPlaneBehavior ],
|
|
43399
43613
|
subProcessStartEventBehavior: [ 'type', SubProcessStartEventBehavior ],
|
|
43614
|
+
textAnnotationBehavior: [ 'type', TextAnnotationBehavior ],
|
|
43400
43615
|
toggleCollapseConnectionBehaviour: [ 'type', ToggleCollapseConnectionBehaviour ],
|
|
43401
43616
|
toggleElementCollapseBehaviour : [ 'type', ToggleElementCollapseBehaviour ],
|
|
43402
43617
|
unclaimIdBehavior: [ 'type', UnclaimIdBehavior ],
|
|
@@ -44373,11 +44588,11 @@
|
|
|
44373
44588
|
}
|
|
44374
44589
|
|
|
44375
44590
|
if (is$1(shape, 'bpmn:Lane')) {
|
|
44376
|
-
return
|
|
44591
|
+
return true;
|
|
44377
44592
|
}
|
|
44378
44593
|
|
|
44379
44594
|
if (is$1(shape, 'bpmn:Participant')) {
|
|
44380
|
-
return
|
|
44595
|
+
return true;
|
|
44381
44596
|
}
|
|
44382
44597
|
|
|
44383
44598
|
if (isTextAnnotation(shape)) {
|
|
@@ -44774,6 +44989,12 @@
|
|
|
44774
44989
|
]
|
|
44775
44990
|
}
|
|
44776
44991
|
},
|
|
44992
|
+
{
|
|
44993
|
+
type: 'bpmn:TextAnnotation',
|
|
44994
|
+
order: {
|
|
44995
|
+
level: 9
|
|
44996
|
+
}
|
|
44997
|
+
},
|
|
44777
44998
|
{
|
|
44778
44999
|
type: 'bpmn:MessageFlow', order: {
|
|
44779
45000
|
level: 9,
|
|
@@ -44856,8 +45077,8 @@
|
|
|
44856
45077
|
|
|
44857
45078
|
this.getOrdering = function(element, newParent) {
|
|
44858
45079
|
|
|
44859
|
-
// render labels always on top
|
|
44860
|
-
if (element.labelTarget) {
|
|
45080
|
+
// render labels and text annotations always on top
|
|
45081
|
+
if (element.labelTarget || is$1(element, 'bpmn:TextAnnotation')) {
|
|
44861
45082
|
return {
|
|
44862
45083
|
parent: canvas.findRoot(newParent) || canvas.getRootElement(),
|
|
44863
45084
|
index: -1
|
|
@@ -46811,6 +47032,10 @@
|
|
|
46811
47032
|
|
|
46812
47033
|
newElement.di = {};
|
|
46813
47034
|
|
|
47035
|
+
if (type === 'bpmn:ExclusiveGateway') {
|
|
47036
|
+
newElement.di.isMarkerVisible = true;
|
|
47037
|
+
}
|
|
47038
|
+
|
|
46814
47039
|
// colors will be set to DI
|
|
46815
47040
|
copyProperties(element.di, newElement.di, [
|
|
46816
47041
|
'fill',
|
|
@@ -48253,15 +48478,18 @@
|
|
|
48253
48478
|
// do not resize:
|
|
48254
48479
|
//
|
|
48255
48480
|
// * text annotations (horizontally/vertically)
|
|
48256
|
-
// * empty pools (vertically)
|
|
48481
|
+
// * empty horizontal pools (vertically)
|
|
48482
|
+
// * empty vertical pools (horizontally)
|
|
48257
48483
|
adjustments.resizingShapes = adjustments.resizingShapes.filter(function(shape) {
|
|
48258
48484
|
|
|
48259
48485
|
if (is$1(shape, 'bpmn:TextAnnotation')) {
|
|
48260
48486
|
return false;
|
|
48261
48487
|
}
|
|
48262
48488
|
|
|
48263
|
-
if (
|
|
48264
|
-
|
|
48489
|
+
if (isCollapsedPool$1(shape)) {
|
|
48490
|
+
if (axis === 'y' && isHorizontal$3(shape) || axis === 'x' && !isHorizontal$3(shape)) {
|
|
48491
|
+
return false;
|
|
48492
|
+
}
|
|
48265
48493
|
}
|
|
48266
48494
|
|
|
48267
48495
|
return true;
|
|
@@ -49826,7 +50054,7 @@
|
|
|
49826
50054
|
const di = getDi(element),
|
|
49827
50055
|
diLabel = di && di.get('label');
|
|
49828
50056
|
|
|
49829
|
-
if (isLabelExternal(element)) {
|
|
50057
|
+
if (isLabelExternal(element) || isPlane(element)) {
|
|
49830
50058
|
return;
|
|
49831
50059
|
}
|
|
49832
50060
|
|
|
@@ -50545,12 +50773,24 @@
|
|
|
50545
50773
|
attrs = applyAttribute(di, attrs, 'isExpanded');
|
|
50546
50774
|
}
|
|
50547
50775
|
|
|
50776
|
+
if (isAny(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ])) {
|
|
50777
|
+
attrs = applyAttribute(di, attrs, 'isHorizontal');
|
|
50778
|
+
}
|
|
50779
|
+
|
|
50548
50780
|
if (is$1(businessObject, 'bpmn:SubProcess')) {
|
|
50549
50781
|
attrs.collapsed = !isExpanded(businessObject, di);
|
|
50550
50782
|
}
|
|
50551
50783
|
|
|
50552
50784
|
if (is$1(businessObject, 'bpmn:ExclusiveGateway')) {
|
|
50553
|
-
|
|
50785
|
+
if (has$1(attrs, 'isMarkerVisible')) {
|
|
50786
|
+
if (attrs.isMarkerVisible === undefined) {
|
|
50787
|
+
di.isMarkerVisible = false;
|
|
50788
|
+
} else {
|
|
50789
|
+
attrs = applyAttribute(di, attrs, 'isMarkerVisible');
|
|
50790
|
+
}
|
|
50791
|
+
} else {
|
|
50792
|
+
di.isMarkerVisible = true;
|
|
50793
|
+
}
|
|
50554
50794
|
}
|
|
50555
50795
|
|
|
50556
50796
|
if (isDefined(attrs.triggeredByEvent)) {
|
|
@@ -53978,14 +54218,47 @@
|
|
|
53978
54218
|
|
|
53979
54219
|
var existingChildLanes = getChildLanes(laneParent);
|
|
53980
54220
|
|
|
54221
|
+
var isHorizontalLane = isHorizontal$3(shape);
|
|
54222
|
+
|
|
54223
|
+
// never mix up horizontal/vertical lanes
|
|
54224
|
+
if (isHorizontalLane) {
|
|
54225
|
+
if (location === 'left') {
|
|
54226
|
+
location = 'top';
|
|
54227
|
+
} else
|
|
54228
|
+
if (location === 'right') {
|
|
54229
|
+
location = 'bottom';
|
|
54230
|
+
}
|
|
54231
|
+
} else {
|
|
54232
|
+
if (location === 'top') {
|
|
54233
|
+
location = 'left';
|
|
54234
|
+
} else
|
|
54235
|
+
if (location === 'bottom') {
|
|
54236
|
+
location = 'right';
|
|
54237
|
+
}
|
|
54238
|
+
}
|
|
54239
|
+
|
|
53981
54240
|
// (0) add a lane if we currently got none and are adding to root
|
|
53982
54241
|
if (!existingChildLanes.length) {
|
|
53983
|
-
|
|
54242
|
+
var siblingPosition = isHorizontalLane ? {
|
|
53984
54243
|
x: shape.x + LANE_INDENTATION,
|
|
53985
54244
|
y: shape.y,
|
|
53986
54245
|
width: shape.width - LANE_INDENTATION,
|
|
53987
54246
|
height: shape.height
|
|
53988
|
-
}
|
|
54247
|
+
} : {
|
|
54248
|
+
x: shape.x,
|
|
54249
|
+
y: shape.y + LANE_INDENTATION,
|
|
54250
|
+
width: shape.width,
|
|
54251
|
+
height: shape.height - LANE_INDENTATION
|
|
54252
|
+
};
|
|
54253
|
+
|
|
54254
|
+
modeling.createShape(
|
|
54255
|
+
{
|
|
54256
|
+
type: 'bpmn:Lane',
|
|
54257
|
+
isHorizontal: isHorizontalLane
|
|
54258
|
+
},
|
|
54259
|
+
siblingPosition,
|
|
54260
|
+
laneParent
|
|
54261
|
+
);
|
|
53989
54262
|
}
|
|
53990
54263
|
|
|
53991
54264
|
// (1) collect affected elements to create necessary space
|
|
@@ -54008,28 +54281,74 @@
|
|
|
54008
54281
|
});
|
|
54009
54282
|
});
|
|
54010
54283
|
|
|
54011
|
-
var offset
|
|
54012
|
-
lanePosition
|
|
54013
|
-
spacePos
|
|
54014
|
-
direction
|
|
54284
|
+
var offset,
|
|
54285
|
+
lanePosition,
|
|
54286
|
+
spacePos,
|
|
54287
|
+
direction,
|
|
54288
|
+
axis;
|
|
54015
54289
|
|
|
54016
|
-
|
|
54290
|
+
if (location === 'top') {
|
|
54291
|
+
offset = -120;
|
|
54292
|
+
lanePosition = shape.y;
|
|
54293
|
+
spacePos = lanePosition + 10;
|
|
54294
|
+
direction = 'n';
|
|
54295
|
+
axis = 'y';
|
|
54296
|
+
} else
|
|
54297
|
+
if (location === 'left') {
|
|
54298
|
+
offset = -120;
|
|
54299
|
+
lanePosition = shape.x;
|
|
54300
|
+
spacePos = lanePosition + 10;
|
|
54301
|
+
direction = 'w';
|
|
54302
|
+
axis = 'x';
|
|
54303
|
+
} else
|
|
54304
|
+
if (location === 'bottom') {
|
|
54305
|
+
offset = 120;
|
|
54306
|
+
lanePosition = shape.y + shape.height;
|
|
54307
|
+
spacePos = lanePosition - 10;
|
|
54308
|
+
direction = 's';
|
|
54309
|
+
axis = 'y';
|
|
54310
|
+
} else
|
|
54311
|
+
if (location === 'right') {
|
|
54312
|
+
offset = 120;
|
|
54313
|
+
lanePosition = shape.x + shape.width;
|
|
54314
|
+
spacePos = lanePosition - 10;
|
|
54315
|
+
direction = 'e';
|
|
54316
|
+
axis = 'x';
|
|
54317
|
+
}
|
|
54318
|
+
|
|
54319
|
+
var adjustments = spaceTool.calculateAdjustments(allAffected, axis, offset, spacePos);
|
|
54320
|
+
|
|
54321
|
+
var delta = isHorizontalLane ? { x: 0, y: offset } : { x: offset, y: 0 };
|
|
54017
54322
|
|
|
54018
54323
|
spaceTool.makeSpace(
|
|
54019
54324
|
adjustments.movingShapes,
|
|
54020
54325
|
adjustments.resizingShapes,
|
|
54021
|
-
|
|
54326
|
+
delta,
|
|
54022
54327
|
direction,
|
|
54023
54328
|
spacePos
|
|
54024
54329
|
);
|
|
54025
54330
|
|
|
54026
54331
|
// (2) create new lane at open space
|
|
54027
|
-
|
|
54332
|
+
var newLanePosition = isHorizontalLane ? {
|
|
54028
54333
|
x: shape.x + (isRoot ? LANE_INDENTATION : 0),
|
|
54029
54334
|
y: lanePosition - (location === 'top' ? 120 : 0),
|
|
54030
54335
|
width: shape.width - (isRoot ? LANE_INDENTATION : 0),
|
|
54031
54336
|
height: 120
|
|
54032
|
-
}
|
|
54337
|
+
} : {
|
|
54338
|
+
x: lanePosition - (location === 'left' ? 120 : 0),
|
|
54339
|
+
y: shape.y + (isRoot ? LANE_INDENTATION : 0),
|
|
54340
|
+
width: 120,
|
|
54341
|
+
height: shape.height - (isRoot ? LANE_INDENTATION : 0)
|
|
54342
|
+
};
|
|
54343
|
+
|
|
54344
|
+
context.newLane = modeling.createShape(
|
|
54345
|
+
{
|
|
54346
|
+
type: 'bpmn:Lane',
|
|
54347
|
+
isHorizontal: isHorizontalLane
|
|
54348
|
+
},
|
|
54349
|
+
newLanePosition,
|
|
54350
|
+
laneParent
|
|
54351
|
+
);
|
|
54033
54352
|
};
|
|
54034
54353
|
|
|
54035
54354
|
/**
|
|
@@ -58895,7 +59214,7 @@
|
|
|
58895
59214
|
'delete': {
|
|
58896
59215
|
group: 'edit',
|
|
58897
59216
|
className: 'bpmn-icon-trash',
|
|
58898
|
-
title: this._translate('
|
|
59217
|
+
title: this._translate('Delete'),
|
|
58899
59218
|
action: {
|
|
58900
59219
|
click: function(event, elements) {
|
|
58901
59220
|
modeling.removeElements(elements.slice());
|
|
@@ -59196,7 +59515,7 @@
|
|
|
59196
59515
|
'replace': {
|
|
59197
59516
|
group: 'edit',
|
|
59198
59517
|
className: 'bpmn-icon-screw-wrench',
|
|
59199
|
-
title: translate('Change
|
|
59518
|
+
title: translate('Change element'),
|
|
59200
59519
|
action: {
|
|
59201
59520
|
click: function(event, element) {
|
|
59202
59521
|
|
|
@@ -59220,7 +59539,7 @@
|
|
|
59220
59539
|
'append.text-annotation': appendAction(
|
|
59221
59540
|
'bpmn:TextAnnotation',
|
|
59222
59541
|
'bpmn-icon-text-annotation',
|
|
59223
|
-
translate('
|
|
59542
|
+
translate('Add text annotation')
|
|
59224
59543
|
)
|
|
59225
59544
|
});
|
|
59226
59545
|
}
|
|
@@ -59237,19 +59556,13 @@
|
|
|
59237
59556
|
'append.text-annotation': appendAction(
|
|
59238
59557
|
'bpmn:TextAnnotation',
|
|
59239
59558
|
'bpmn-icon-text-annotation',
|
|
59240
|
-
translate('
|
|
59559
|
+
translate('Add text annotation')
|
|
59241
59560
|
),
|
|
59242
59561
|
|
|
59243
59562
|
'connect': {
|
|
59244
59563
|
group: 'connect',
|
|
59245
59564
|
className: 'bpmn-icon-connection-multi',
|
|
59246
|
-
title: translate(
|
|
59247
|
-
'Connect using ' +
|
|
59248
|
-
(businessObject.isForCompensation
|
|
59249
|
-
? ''
|
|
59250
|
-
: 'sequence/message flow or ') +
|
|
59251
|
-
'association'
|
|
59252
|
-
),
|
|
59565
|
+
title: translate('Connect to other element'),
|
|
59253
59566
|
action: {
|
|
59254
59567
|
click: startConnect,
|
|
59255
59568
|
dragstart: startConnect,
|
|
@@ -59291,7 +59604,7 @@
|
|
|
59291
59604
|
'append.text-annotation': appendAction(
|
|
59292
59605
|
'bpmn:TextAnnotation',
|
|
59293
59606
|
'bpmn-icon-text-annotation',
|
|
59294
|
-
translate('
|
|
59607
|
+
translate('Add text annotation')
|
|
59295
59608
|
)
|
|
59296
59609
|
});
|
|
59297
59610
|
}
|
|
@@ -59310,7 +59623,7 @@
|
|
|
59310
59623
|
'delete': {
|
|
59311
59624
|
group: 'edit',
|
|
59312
59625
|
className: 'bpmn-icon-trash',
|
|
59313
|
-
title: translate('
|
|
59626
|
+
title: translate('Delete'),
|
|
59314
59627
|
action: {
|
|
59315
59628
|
click: removeElement
|
|
59316
59629
|
}
|
|
@@ -62451,7 +62764,7 @@
|
|
|
62451
62764
|
|
|
62452
62765
|
// adjust for expanded pools AND lanes
|
|
62453
62766
|
if (is$1(element, 'bpmn:Lane') || isExpandedPool(element)) {
|
|
62454
|
-
var isHorizontalLane = isHorizontal$
|
|
62767
|
+
var isHorizontalLane = isHorizontal$3(element);
|
|
62455
62768
|
|
|
62456
62769
|
var laneBounds = isHorizontalLane ? {
|
|
62457
62770
|
width: bbox.height,
|
|
@@ -62479,7 +62792,7 @@
|
|
|
62479
62792
|
|
|
62480
62793
|
// internal labels for collapsed participants
|
|
62481
62794
|
if (isCollapsedPool(element)) {
|
|
62482
|
-
var isHorizontalPool = isHorizontal$
|
|
62795
|
+
var isHorizontalPool = isHorizontal$3(element);
|
|
62483
62796
|
|
|
62484
62797
|
var poolBounds = isHorizontalPool ? {
|
|
62485
62798
|
width: bbox.width,
|
|
@@ -65151,12 +65464,6 @@
|
|
|
65151
65464
|
|
|
65152
65465
|
function createListener(event) {
|
|
65153
65466
|
var shape = elementFactory.createShape(assign$1({ type: type }, options));
|
|
65154
|
-
|
|
65155
|
-
if (options) {
|
|
65156
|
-
var di = getDi(shape);
|
|
65157
|
-
di.isExpanded = options.isExpanded;
|
|
65158
|
-
}
|
|
65159
|
-
|
|
65160
65467
|
create.start(event, shape);
|
|
65161
65468
|
}
|
|
65162
65469
|
|
|
@@ -65256,7 +65563,8 @@
|
|
|
65256
65563
|
),
|
|
65257
65564
|
'create.exclusive-gateway': createAction(
|
|
65258
65565
|
'bpmn:ExclusiveGateway', 'gateway', 'bpmn-icon-gateway-none',
|
|
65259
|
-
translate('Create gateway')
|
|
65566
|
+
translate('Create gateway'),
|
|
65567
|
+
{ isMarkerVisible: true }
|
|
65260
65568
|
),
|
|
65261
65569
|
'create.task': createAction(
|
|
65262
65570
|
'bpmn:Task', 'activity', 'bpmn-icon-task',
|