bpmn-js 17.2.2 → 17.4.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 +223 -103
- package/dist/bpmn-modeler.production.min.js +5 -5
- package/dist/bpmn-navigated-viewer.development.js +2 -2
- package/dist/bpmn-navigated-viewer.production.min.js +1 -1
- package/dist/bpmn-viewer.development.js +2 -2
- package/dist/bpmn-viewer.production.min.js +1 -1
- package/lib/features/auto-place/BpmnAutoPlaceUtil.d.ts +3 -3
- package/lib/features/auto-place/BpmnAutoPlaceUtil.js +86 -34
- package/lib/features/modeling/BpmnLayouter.js +113 -54
- package/lib/features/modeling/util/ModelingUtil.d.ts +9 -0
- package/lib/features/modeling/util/ModelingUtil.js +23 -0
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-modeler v17.
|
|
2
|
+
* bpmn-js - bpmn-modeler v17.4.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-04-
|
|
11
|
+
* Date: 2024-04-26
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -27000,7 +27000,7 @@
|
|
|
27000
27000
|
|
|
27001
27001
|
var scale = isDefined(config && config.scale) ? config.scale : {
|
|
27002
27002
|
min: 1,
|
|
27003
|
-
max: 1
|
|
27003
|
+
max: 1
|
|
27004
27004
|
};
|
|
27005
27005
|
|
|
27006
27006
|
this._overlaysConfig = {
|
|
@@ -27994,7 +27994,8 @@
|
|
|
27994
27994
|
function getPopupStyle(props) {
|
|
27995
27995
|
return {
|
|
27996
27996
|
transform: `scale(${props.scale})`,
|
|
27997
|
-
width: `${props.width}px
|
|
27997
|
+
width: `${props.width}px`,
|
|
27998
|
+
'transform-origin': 'top left'
|
|
27998
27999
|
};
|
|
27999
28000
|
}
|
|
28000
28001
|
|
|
@@ -28057,7 +28058,7 @@
|
|
|
28057
28058
|
|
|
28058
28059
|
var scale = isDefined(config && config.scale) ? config.scale : {
|
|
28059
28060
|
min: 1,
|
|
28060
|
-
max: 1
|
|
28061
|
+
max: 1
|
|
28061
28062
|
};
|
|
28062
28063
|
|
|
28063
28064
|
this._config = {
|
|
@@ -29474,6 +29475,27 @@
|
|
|
29474
29475
|
return null;
|
|
29475
29476
|
}
|
|
29476
29477
|
|
|
29478
|
+
/**
|
|
29479
|
+
* Determines if the local modeling direction is vertical or horizontal.
|
|
29480
|
+
*
|
|
29481
|
+
* @param {Element} element
|
|
29482
|
+
*
|
|
29483
|
+
* @return {boolean} false for vertical pools, lanes and their children. true otherwise
|
|
29484
|
+
*/
|
|
29485
|
+
function isDirectionHorizontal(element) {
|
|
29486
|
+
|
|
29487
|
+
var types = [ 'bpmn:Participant', 'bpmn:Lane' ];
|
|
29488
|
+
|
|
29489
|
+
var parent = getParent(element, types);
|
|
29490
|
+
if (parent) {
|
|
29491
|
+
return isHorizontal$3(parent);
|
|
29492
|
+
} else if (isAny(element, types)) {
|
|
29493
|
+
return isHorizontal$3(element);
|
|
29494
|
+
}
|
|
29495
|
+
|
|
29496
|
+
return true;
|
|
29497
|
+
}
|
|
29498
|
+
|
|
29477
29499
|
/**
|
|
29478
29500
|
* @typedef {import('../../model/Types').Shape} Shape
|
|
29479
29501
|
*
|
|
@@ -29506,7 +29528,7 @@
|
|
|
29506
29528
|
}
|
|
29507
29529
|
|
|
29508
29530
|
/**
|
|
29509
|
-
* Get the position for given new flow node. Try placing the flow node right of
|
|
29531
|
+
* Get the position for given new flow node. Try placing the flow node right/bottom of
|
|
29510
29532
|
* the source.
|
|
29511
29533
|
*
|
|
29512
29534
|
* @param {Shape} source
|
|
@@ -29519,34 +29541,60 @@
|
|
|
29519
29541
|
var sourceTrbl = asTRBL(source);
|
|
29520
29542
|
var sourceMid = getMid(source);
|
|
29521
29543
|
|
|
29522
|
-
var
|
|
29544
|
+
var placeHorizontally = isDirectionHorizontal(source);
|
|
29545
|
+
|
|
29546
|
+
var placement = placeHorizontally ? {
|
|
29547
|
+
directionHint: 'e',
|
|
29548
|
+
minDistance: 80,
|
|
29549
|
+
baseOrientation: 'left',
|
|
29550
|
+
boundaryOrientation: 'top',
|
|
29551
|
+
start: 'top',
|
|
29552
|
+
end: 'bottom'
|
|
29553
|
+
} : {
|
|
29554
|
+
directionHint: 's',
|
|
29555
|
+
minDistance: 90,
|
|
29556
|
+
baseOrientation: 'top',
|
|
29557
|
+
boundaryOrientation: 'left',
|
|
29558
|
+
start: 'left',
|
|
29559
|
+
end: 'right'
|
|
29560
|
+
};
|
|
29561
|
+
|
|
29562
|
+
var connectedDistance = getConnectedDistance(source, {
|
|
29523
29563
|
filter: function(connection) {
|
|
29524
29564
|
return is$1(connection, 'bpmn:SequenceFlow');
|
|
29525
|
-
}
|
|
29565
|
+
},
|
|
29566
|
+
direction: placement.directionHint
|
|
29526
29567
|
});
|
|
29527
29568
|
|
|
29528
29569
|
var margin = 30,
|
|
29529
|
-
minDistance =
|
|
29530
|
-
orientation =
|
|
29570
|
+
minDistance = placement.minDistance,
|
|
29571
|
+
orientation = placement.baseOrientation;
|
|
29531
29572
|
|
|
29532
29573
|
if (is$1(source, 'bpmn:BoundaryEvent')) {
|
|
29533
29574
|
orientation = getOrientation(source, source.host, -25);
|
|
29534
29575
|
|
|
29535
|
-
if (orientation.indexOf(
|
|
29576
|
+
if (orientation.indexOf(placement.boundaryOrientation) !== -1) {
|
|
29536
29577
|
margin *= -1;
|
|
29537
29578
|
}
|
|
29538
29579
|
}
|
|
29539
29580
|
|
|
29540
|
-
var position = {
|
|
29541
|
-
x: sourceTrbl.right +
|
|
29542
|
-
y: sourceMid.y +
|
|
29581
|
+
var position = placeHorizontally ? {
|
|
29582
|
+
x: sourceTrbl.right + connectedDistance + element.width / 2,
|
|
29583
|
+
y: sourceMid.y + getDistance$2(orientation, minDistance, placement)
|
|
29584
|
+
} : {
|
|
29585
|
+
x: sourceMid.x + getDistance$2(orientation, minDistance, placement),
|
|
29586
|
+
y: sourceTrbl.bottom + connectedDistance + element.height / 2
|
|
29543
29587
|
};
|
|
29544
29588
|
|
|
29545
|
-
var
|
|
29546
|
-
|
|
29547
|
-
|
|
29548
|
-
|
|
29549
|
-
|
|
29589
|
+
var nextPosition = {
|
|
29590
|
+
margin: margin,
|
|
29591
|
+
minDistance: minDistance
|
|
29592
|
+
};
|
|
29593
|
+
|
|
29594
|
+
var nextPositionDirection = placeHorizontally ? {
|
|
29595
|
+
y: nextPosition
|
|
29596
|
+
} : {
|
|
29597
|
+
x: nextPosition
|
|
29550
29598
|
};
|
|
29551
29599
|
|
|
29552
29600
|
return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
|
|
@@ -29555,13 +29603,14 @@
|
|
|
29555
29603
|
/**
|
|
29556
29604
|
* @param {DirectionTRBL} orientation
|
|
29557
29605
|
* @param {number} minDistance
|
|
29606
|
+
* @param {{ start: DirectionTRBL, end: DirectionTRBL }} placement
|
|
29558
29607
|
*
|
|
29559
29608
|
* @return {number}
|
|
29560
29609
|
*/
|
|
29561
|
-
function
|
|
29562
|
-
if (orientation.includes(
|
|
29610
|
+
function getDistance$2(orientation, minDistance, placement) {
|
|
29611
|
+
if (orientation.includes(placement.start)) {
|
|
29563
29612
|
return -1 * minDistance;
|
|
29564
|
-
} else if (orientation.includes(
|
|
29613
|
+
} else if (orientation.includes(placement.end)) {
|
|
29565
29614
|
return minDistance;
|
|
29566
29615
|
} else {
|
|
29567
29616
|
return 0;
|
|
@@ -29571,7 +29620,7 @@
|
|
|
29571
29620
|
|
|
29572
29621
|
/**
|
|
29573
29622
|
* Get the position for given text annotation. Try placing the text annotation
|
|
29574
|
-
* top-right of the source.
|
|
29623
|
+
* top-right of the source (bottom-right in vertical layouts).
|
|
29575
29624
|
*
|
|
29576
29625
|
* @param {Shape} source
|
|
29577
29626
|
* @param {Shape} element
|
|
@@ -29582,22 +29631,35 @@
|
|
|
29582
29631
|
|
|
29583
29632
|
var sourceTrbl = asTRBL(source);
|
|
29584
29633
|
|
|
29585
|
-
var
|
|
29634
|
+
var placeHorizontally = isDirectionHorizontal(source);
|
|
29635
|
+
|
|
29636
|
+
var position = placeHorizontally ? {
|
|
29586
29637
|
x: sourceTrbl.right + element.width / 2,
|
|
29587
29638
|
y: sourceTrbl.top - 50 - element.height / 2
|
|
29639
|
+
} : {
|
|
29640
|
+
x: sourceTrbl.right + 50 + element.width / 2,
|
|
29641
|
+
y: sourceTrbl.bottom + element.height / 2
|
|
29588
29642
|
};
|
|
29589
29643
|
|
|
29590
29644
|
if (isConnection(source)) {
|
|
29591
29645
|
position = getMid(source);
|
|
29592
|
-
|
|
29593
|
-
|
|
29646
|
+
if (placeHorizontally) {
|
|
29647
|
+
position.x += 100;
|
|
29648
|
+
position.y -= 50;
|
|
29649
|
+
} else {
|
|
29650
|
+
position.x += 100;
|
|
29651
|
+
position.y += 50;
|
|
29652
|
+
}
|
|
29594
29653
|
}
|
|
29595
29654
|
|
|
29596
|
-
var
|
|
29597
|
-
|
|
29598
|
-
|
|
29599
|
-
|
|
29600
|
-
|
|
29655
|
+
var nextPosition = {
|
|
29656
|
+
margin: placeHorizontally ? -30 : 30,
|
|
29657
|
+
minDistance: 20
|
|
29658
|
+
};
|
|
29659
|
+
var nextPositionDirection = placeHorizontally ? {
|
|
29660
|
+
y: nextPosition
|
|
29661
|
+
} : {
|
|
29662
|
+
x: nextPosition
|
|
29601
29663
|
};
|
|
29602
29664
|
|
|
29603
29665
|
return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
|
|
@@ -29606,7 +29668,7 @@
|
|
|
29606
29668
|
|
|
29607
29669
|
/**
|
|
29608
29670
|
* Get the position for given new data element. Try placing the data element
|
|
29609
|
-
* bottom-right of the source.
|
|
29671
|
+
* bottom-right of the source (bottom-left in vertical layouts).
|
|
29610
29672
|
*
|
|
29611
29673
|
* @param {Shape} source
|
|
29612
29674
|
* @param {Shape} element
|
|
@@ -29617,16 +29679,24 @@
|
|
|
29617
29679
|
|
|
29618
29680
|
var sourceTrbl = asTRBL(source);
|
|
29619
29681
|
|
|
29620
|
-
var
|
|
29682
|
+
var placeHorizontally = isDirectionHorizontal(source);
|
|
29683
|
+
|
|
29684
|
+
var position = placeHorizontally ? {
|
|
29621
29685
|
x: sourceTrbl.right - 10 + element.width / 2,
|
|
29622
29686
|
y: sourceTrbl.bottom + 40 + element.width / 2
|
|
29687
|
+
} : {
|
|
29688
|
+
x: sourceTrbl.left - 40 - element.width / 2,
|
|
29689
|
+
y: sourceTrbl.bottom - 10 + element.height / 2
|
|
29623
29690
|
};
|
|
29624
29691
|
|
|
29625
|
-
var
|
|
29626
|
-
|
|
29627
|
-
|
|
29628
|
-
|
|
29629
|
-
|
|
29692
|
+
var nextPosition = {
|
|
29693
|
+
margin: 30,
|
|
29694
|
+
minDistance: 30
|
|
29695
|
+
};
|
|
29696
|
+
var nextPositionDirection = placeHorizontally ? {
|
|
29697
|
+
x: nextPosition
|
|
29698
|
+
} : {
|
|
29699
|
+
y: nextPosition
|
|
29630
29700
|
};
|
|
29631
29701
|
|
|
29632
29702
|
return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
|
|
@@ -44576,7 +44646,6 @@
|
|
|
44576
44646
|
};
|
|
44577
44647
|
|
|
44578
44648
|
/**
|
|
44579
|
-
* @typedef {import('../dragging/Dragging').default} Dragging
|
|
44580
44649
|
* @typedef {import('../../core/EventBus').default} EventBus
|
|
44581
44650
|
*
|
|
44582
44651
|
* @typedef {import('../../core/EventBus').Event} Event
|
|
@@ -44589,24 +44658,21 @@
|
|
|
44589
44658
|
* it takes care of making sure that the correct active state is set.
|
|
44590
44659
|
*
|
|
44591
44660
|
* @param {EventBus} eventBus
|
|
44592
|
-
* @param {Dragging} dragging
|
|
44593
44661
|
*/
|
|
44594
|
-
function ToolManager(eventBus
|
|
44662
|
+
function ToolManager(eventBus) {
|
|
44595
44663
|
this._eventBus = eventBus;
|
|
44596
|
-
this._dragging = dragging;
|
|
44597
44664
|
|
|
44598
44665
|
this._tools = [];
|
|
44599
44666
|
this._active = null;
|
|
44600
44667
|
}
|
|
44601
44668
|
|
|
44602
|
-
ToolManager.$inject = [ 'eventBus'
|
|
44669
|
+
ToolManager.$inject = [ 'eventBus' ];
|
|
44603
44670
|
|
|
44604
44671
|
/**
|
|
44605
44672
|
* Register a tool.
|
|
44606
44673
|
*
|
|
44607
44674
|
* @param {string} name
|
|
44608
44675
|
* @param { {
|
|
44609
|
-
* dragging: string;
|
|
44610
44676
|
* tool: string;
|
|
44611
44677
|
* } } events
|
|
44612
44678
|
*/
|
|
@@ -44618,7 +44684,6 @@
|
|
|
44618
44684
|
}
|
|
44619
44685
|
|
|
44620
44686
|
tools.push(name);
|
|
44621
|
-
|
|
44622
44687
|
this.bindEvents(name, events);
|
|
44623
44688
|
};
|
|
44624
44689
|
|
|
@@ -44641,8 +44706,7 @@
|
|
|
44641
44706
|
};
|
|
44642
44707
|
|
|
44643
44708
|
ToolManager.prototype.bindEvents = function(name, events) {
|
|
44644
|
-
var eventBus = this._eventBus
|
|
44645
|
-
dragging = this._dragging;
|
|
44709
|
+
var eventBus = this._eventBus;
|
|
44646
44710
|
|
|
44647
44711
|
var eventsToRegister = [];
|
|
44648
44712
|
|
|
@@ -44653,7 +44717,6 @@
|
|
|
44653
44717
|
if (!context.reactivate && this.isActive(name)) {
|
|
44654
44718
|
this.setActive(null);
|
|
44655
44719
|
|
|
44656
|
-
dragging.cancel();
|
|
44657
44720
|
return;
|
|
44658
44721
|
}
|
|
44659
44722
|
|
|
@@ -53510,6 +53573,51 @@
|
|
|
53510
53573
|
var ATTACH_ORIENTATION_PADDING = -10,
|
|
53511
53574
|
BOUNDARY_TO_HOST_THRESHOLD$1 = 40;
|
|
53512
53575
|
|
|
53576
|
+
// layout all connection between flow elements h:h, except for
|
|
53577
|
+
// (1) outgoing of boundary events -> layout based on attach orientation and target orientation
|
|
53578
|
+
// (2) incoming/outgoing of gateways -> v:h for outgoing, h:v for incoming
|
|
53579
|
+
// (3) loops connect sides clockwise
|
|
53580
|
+
var PREFERRED_LAYOUTS_HORIZONTAL = {
|
|
53581
|
+
default: [ 'h:h' ],
|
|
53582
|
+
fromGateway: [ 'v:h' ],
|
|
53583
|
+
toGateway: [ 'h:v' ],
|
|
53584
|
+
loop: {
|
|
53585
|
+
fromTop: [ 't:r' ],
|
|
53586
|
+
fromRight: [ 'r:b' ],
|
|
53587
|
+
fromLeft: [ 'l:t' ],
|
|
53588
|
+
fromBottom: [ 'b:l' ]
|
|
53589
|
+
},
|
|
53590
|
+
boundaryLoop: {
|
|
53591
|
+
alternateHorizontalSide: 'b',
|
|
53592
|
+
alternateVerticalSide: 'l',
|
|
53593
|
+
default: 'v'
|
|
53594
|
+
},
|
|
53595
|
+
messageFlow: [ 'straight', 'v:v' ],
|
|
53596
|
+
subProcess: [ 'straight', 'h:h' ],
|
|
53597
|
+
isHorizontal: true
|
|
53598
|
+
};
|
|
53599
|
+
|
|
53600
|
+
// for vertical layouts, switch h and v and loop counter-clockwise
|
|
53601
|
+
var PREFERRED_LAYOUTS_VERTICAL = {
|
|
53602
|
+
default: [ 'v:v' ],
|
|
53603
|
+
fromGateway: [ 'h:v' ],
|
|
53604
|
+
toGateway: [ 'v:h' ],
|
|
53605
|
+
loop: {
|
|
53606
|
+
fromTop: [ 't:l' ],
|
|
53607
|
+
fromRight: [ 'r:t' ],
|
|
53608
|
+
fromLeft: [ 'l:b' ],
|
|
53609
|
+
fromBottom: [ 'b:r' ]
|
|
53610
|
+
},
|
|
53611
|
+
boundaryLoop: {
|
|
53612
|
+
alternateHorizontalSide: 't',
|
|
53613
|
+
alternateVerticalSide: 'r',
|
|
53614
|
+
default: 'h'
|
|
53615
|
+
},
|
|
53616
|
+
messageFlow: [ 'straight', 'h:h' ],
|
|
53617
|
+
subProcess: [ 'straight', 'v:v' ],
|
|
53618
|
+
isHorizontal: false
|
|
53619
|
+
};
|
|
53620
|
+
|
|
53513
53621
|
var oppositeOrientationMapping = {
|
|
53514
53622
|
'top': 'bottom',
|
|
53515
53623
|
'top-right': 'bottom-left',
|
|
@@ -53562,9 +53670,6 @@
|
|
|
53562
53670
|
connectionEnd = getConnectionDocking(waypoints && waypoints[ waypoints.length - 1 ], target);
|
|
53563
53671
|
}
|
|
53564
53672
|
|
|
53565
|
-
// TODO(nikku): support vertical modeling
|
|
53566
|
-
// and invert preferredLayouts accordingly
|
|
53567
|
-
|
|
53568
53673
|
if (is$1(connection, 'bpmn:Association') ||
|
|
53569
53674
|
is$1(connection, 'bpmn:DataAssociation')) {
|
|
53570
53675
|
|
|
@@ -53573,35 +53678,36 @@
|
|
|
53573
53678
|
}
|
|
53574
53679
|
}
|
|
53575
53680
|
|
|
53681
|
+
var layout = isDirectionHorizontal(source) ? PREFERRED_LAYOUTS_HORIZONTAL : PREFERRED_LAYOUTS_VERTICAL;
|
|
53682
|
+
|
|
53576
53683
|
if (is$1(connection, 'bpmn:MessageFlow')) {
|
|
53577
|
-
manhattanOptions = getMessageFlowManhattanOptions(source, target);
|
|
53684
|
+
manhattanOptions = getMessageFlowManhattanOptions(source, target, layout);
|
|
53578
53685
|
} else if (is$1(connection, 'bpmn:SequenceFlow') || isCompensationAssociation(source, target)) {
|
|
53579
53686
|
|
|
53580
|
-
// layout all connection between flow elements h:h, except for
|
|
53581
|
-
// (1) outgoing of boundary events -> layout based on attach orientation and target orientation
|
|
53582
|
-
// (2) incoming/outgoing of gateways -> v:h for outgoing, h:v for incoming
|
|
53583
|
-
// (3) loops
|
|
53584
53687
|
if (source === target) {
|
|
53585
53688
|
manhattanOptions = {
|
|
53586
|
-
preferredLayouts: getLoopPreferredLayout(source, connection)
|
|
53689
|
+
preferredLayouts: getLoopPreferredLayout(source, connection, layout)
|
|
53587
53690
|
};
|
|
53588
53691
|
} else if (is$1(source, 'bpmn:BoundaryEvent')) {
|
|
53589
53692
|
manhattanOptions = {
|
|
53590
|
-
preferredLayouts: getBoundaryEventPreferredLayouts(source, target, connectionEnd)
|
|
53693
|
+
preferredLayouts: getBoundaryEventPreferredLayouts(source, target, connectionEnd, layout)
|
|
53591
53694
|
};
|
|
53592
53695
|
} else if (isExpandedSubProcess$1(source) || isExpandedSubProcess$1(target)) {
|
|
53593
|
-
manhattanOptions =
|
|
53696
|
+
manhattanOptions = {
|
|
53697
|
+
preferredLayouts: layout.subProcess,
|
|
53698
|
+
preserveDocking: getSubProcessPreserveDocking(source)
|
|
53699
|
+
};
|
|
53594
53700
|
} else if (is$1(source, 'bpmn:Gateway')) {
|
|
53595
53701
|
manhattanOptions = {
|
|
53596
|
-
preferredLayouts:
|
|
53702
|
+
preferredLayouts: layout.fromGateway
|
|
53597
53703
|
};
|
|
53598
53704
|
} else if (is$1(target, 'bpmn:Gateway')) {
|
|
53599
53705
|
manhattanOptions = {
|
|
53600
|
-
preferredLayouts:
|
|
53706
|
+
preferredLayouts: layout.toGateway
|
|
53601
53707
|
};
|
|
53602
53708
|
} else {
|
|
53603
53709
|
manhattanOptions = {
|
|
53604
|
-
preferredLayouts:
|
|
53710
|
+
preferredLayouts: layout.default
|
|
53605
53711
|
};
|
|
53606
53712
|
}
|
|
53607
53713
|
}
|
|
@@ -53631,9 +53737,9 @@
|
|
|
53631
53737
|
return getOrientation(getMid(attachedElement), hostElement, ATTACH_ORIENTATION_PADDING);
|
|
53632
53738
|
}
|
|
53633
53739
|
|
|
53634
|
-
function getMessageFlowManhattanOptions(source, target) {
|
|
53740
|
+
function getMessageFlowManhattanOptions(source, target, layout) {
|
|
53635
53741
|
return {
|
|
53636
|
-
preferredLayouts:
|
|
53742
|
+
preferredLayouts: layout.messageFlow,
|
|
53637
53743
|
preserveDocking: getMessageFlowPreserveDocking(source, target)
|
|
53638
53744
|
};
|
|
53639
53745
|
}
|
|
@@ -53670,13 +53776,6 @@
|
|
|
53670
53776
|
return null;
|
|
53671
53777
|
}
|
|
53672
53778
|
|
|
53673
|
-
function getSubProcessManhattanOptions(source) {
|
|
53674
|
-
return {
|
|
53675
|
-
preferredLayouts: [ 'straight', 'h:h' ],
|
|
53676
|
-
preserveDocking: getSubProcessPreserveDocking(source)
|
|
53677
|
-
};
|
|
53678
|
-
}
|
|
53679
|
-
|
|
53680
53779
|
function getSubProcessPreserveDocking(source) {
|
|
53681
53780
|
return isExpandedSubProcess$1(source) ? 'target' : 'source';
|
|
53682
53781
|
}
|
|
@@ -53739,23 +53838,23 @@
|
|
|
53739
53838
|
return orientation === 'right' || orientation === 'left';
|
|
53740
53839
|
}
|
|
53741
53840
|
|
|
53742
|
-
function getLoopPreferredLayout(source, connection) {
|
|
53841
|
+
function getLoopPreferredLayout(source, connection, layout) {
|
|
53743
53842
|
var waypoints = connection.waypoints;
|
|
53744
53843
|
|
|
53745
53844
|
var orientation = waypoints && waypoints.length && getOrientation(waypoints[0], source);
|
|
53746
53845
|
|
|
53747
53846
|
if (orientation === 'top') {
|
|
53748
|
-
return
|
|
53847
|
+
return layout.loop.fromTop;
|
|
53749
53848
|
} else if (orientation === 'right') {
|
|
53750
|
-
return
|
|
53849
|
+
return layout.loop.fromRight;
|
|
53751
53850
|
} else if (orientation === 'left') {
|
|
53752
|
-
return
|
|
53851
|
+
return layout.loop.fromLeft;
|
|
53753
53852
|
}
|
|
53754
53853
|
|
|
53755
|
-
return
|
|
53854
|
+
return layout.loop.fromBottom;
|
|
53756
53855
|
}
|
|
53757
53856
|
|
|
53758
|
-
function getBoundaryEventPreferredLayouts(source, target, end) {
|
|
53857
|
+
function getBoundaryEventPreferredLayouts(source, target, end, layout) {
|
|
53759
53858
|
var sourceMid = getMid(source),
|
|
53760
53859
|
targetMid = getMid(target),
|
|
53761
53860
|
attachOrientation = getAttachOrientation(source),
|
|
@@ -53772,31 +53871,31 @@
|
|
|
53772
53871
|
});
|
|
53773
53872
|
|
|
53774
53873
|
if (isLoop) {
|
|
53775
|
-
return getBoundaryEventLoopLayout(attachOrientation, attachedToSide, source, target, end);
|
|
53874
|
+
return getBoundaryEventLoopLayout(attachOrientation, attachedToSide, source, target, end, layout);
|
|
53776
53875
|
}
|
|
53777
53876
|
|
|
53778
53877
|
// source layout
|
|
53779
|
-
sourceLayout = getBoundaryEventSourceLayout(attachOrientation, targetOrientation, attachedToSide);
|
|
53878
|
+
sourceLayout = getBoundaryEventSourceLayout(attachOrientation, targetOrientation, attachedToSide, layout.isHorizontal);
|
|
53780
53879
|
|
|
53781
53880
|
// target layout
|
|
53782
|
-
targetLayout = getBoundaryEventTargetLayout(attachOrientation, targetOrientation, attachedToSide);
|
|
53881
|
+
targetLayout = getBoundaryEventTargetLayout(attachOrientation, targetOrientation, attachedToSide, layout.isHorizontal);
|
|
53783
53882
|
|
|
53784
53883
|
return [ sourceLayout + ':' + targetLayout ];
|
|
53785
53884
|
}
|
|
53786
53885
|
|
|
53787
|
-
function getBoundaryEventLoopLayout(attachOrientation, attachedToSide, source, target, end) {
|
|
53788
|
-
var orientation = attachedToSide ? attachOrientation : getVerticalOrientation(attachOrientation),
|
|
53886
|
+
function getBoundaryEventLoopLayout(attachOrientation, attachedToSide, source, target, end, layout) {
|
|
53887
|
+
var orientation = attachedToSide ? attachOrientation : layout.isHorizontal ? getVerticalOrientation(attachOrientation) : getHorizontalOrientation(attachOrientation),
|
|
53789
53888
|
sourceLayout = orientationDirectionMapping[ orientation ],
|
|
53790
53889
|
targetLayout;
|
|
53791
53890
|
|
|
53792
53891
|
if (attachedToSide) {
|
|
53793
53892
|
if (isHorizontalOrientation(attachOrientation)) {
|
|
53794
|
-
targetLayout = shouldConnectToSameSide('y', source, target, end) ? 'h' :
|
|
53893
|
+
targetLayout = shouldConnectToSameSide('y', source, target, end) ? 'h' : layout.boundaryLoop.alternateHorizontalSide;
|
|
53795
53894
|
} else {
|
|
53796
|
-
targetLayout = shouldConnectToSameSide('x', source, target, end) ? 'v' :
|
|
53895
|
+
targetLayout = shouldConnectToSameSide('x', source, target, end) ? 'v' : layout.boundaryLoop.alternateVerticalSide;
|
|
53797
53896
|
}
|
|
53798
53897
|
} else {
|
|
53799
|
-
targetLayout =
|
|
53898
|
+
targetLayout = layout.boundaryLoop.default;
|
|
53800
53899
|
}
|
|
53801
53900
|
|
|
53802
53901
|
return [ sourceLayout + ':' + targetLayout ];
|
|
@@ -53819,7 +53918,7 @@
|
|
|
53819
53918
|
return Math.abs(a[ axis ] - b[ axis ]) < threshold;
|
|
53820
53919
|
}
|
|
53821
53920
|
|
|
53822
|
-
function getBoundaryEventSourceLayout(attachOrientation, targetOrientation, attachedToSide) {
|
|
53921
|
+
function getBoundaryEventSourceLayout(attachOrientation, targetOrientation, attachedToSide, isHorizontal) {
|
|
53823
53922
|
|
|
53824
53923
|
// attached to either top, right, bottom or left side
|
|
53825
53924
|
if (attachedToSide) {
|
|
@@ -53828,20 +53927,36 @@
|
|
|
53828
53927
|
|
|
53829
53928
|
// attached to either top-right, top-left, bottom-right or bottom-left corner
|
|
53830
53929
|
|
|
53831
|
-
|
|
53832
|
-
|
|
53833
|
-
|
|
53834
|
-
|
|
53835
|
-
|
|
53836
|
-
)
|
|
53837
|
-
|
|
53930
|
+
var verticalAttachOrientation = getVerticalOrientation(attachOrientation),
|
|
53931
|
+
horizontalAttachOrientation = getHorizontalOrientation(attachOrientation),
|
|
53932
|
+
verticalTargetOrientation = getVerticalOrientation(targetOrientation),
|
|
53933
|
+
horizontalTargetOrientation = getHorizontalOrientation(targetOrientation);
|
|
53934
|
+
|
|
53935
|
+
if (isHorizontal) {
|
|
53936
|
+
|
|
53937
|
+
// same vertical or opposite horizontal orientation
|
|
53938
|
+
if (
|
|
53939
|
+
isSame(verticalAttachOrientation, verticalTargetOrientation) ||
|
|
53940
|
+
isOppositeOrientation(horizontalAttachOrientation, horizontalTargetOrientation)
|
|
53941
|
+
) {
|
|
53942
|
+
return orientationDirectionMapping[ verticalAttachOrientation ];
|
|
53943
|
+
}
|
|
53944
|
+
} else {
|
|
53945
|
+
|
|
53946
|
+
// same horizontal or opposite vertical orientation
|
|
53947
|
+
if (
|
|
53948
|
+
isSame(horizontalAttachOrientation, horizontalTargetOrientation) ||
|
|
53949
|
+
isOppositeOrientation(verticalAttachOrientation, verticalTargetOrientation)
|
|
53950
|
+
) {
|
|
53951
|
+
return orientationDirectionMapping[ horizontalAttachOrientation ];
|
|
53952
|
+
}
|
|
53838
53953
|
}
|
|
53839
53954
|
|
|
53840
53955
|
// fallback
|
|
53841
|
-
return orientationDirectionMapping[
|
|
53956
|
+
return orientationDirectionMapping[ isHorizontal ? horizontalAttachOrientation : verticalAttachOrientation ];
|
|
53842
53957
|
}
|
|
53843
53958
|
|
|
53844
|
-
function getBoundaryEventTargetLayout(attachOrientation, targetOrientation, attachedToSide) {
|
|
53959
|
+
function getBoundaryEventTargetLayout(attachOrientation, targetOrientation, attachedToSide, isHorizontal) {
|
|
53845
53960
|
|
|
53846
53961
|
// attached to either top, right, bottom or left side
|
|
53847
53962
|
if (attachedToSide) {
|
|
@@ -53877,15 +53992,20 @@
|
|
|
53877
53992
|
}
|
|
53878
53993
|
|
|
53879
53994
|
// attached to either top-right, top-left, bottom-right or bottom-left corner
|
|
53995
|
+
// and orientation is same on the counter-axis
|
|
53880
53996
|
|
|
53881
|
-
|
|
53882
|
-
|
|
53883
|
-
|
|
53884
|
-
|
|
53885
|
-
|
|
53886
|
-
|
|
53997
|
+
if (isHorizontal) {
|
|
53998
|
+
if (isSame(getVerticalOrientation(attachOrientation), getVerticalOrientation(targetOrientation))) {
|
|
53999
|
+
return 'h';
|
|
54000
|
+
} else {
|
|
54001
|
+
return 'v';
|
|
54002
|
+
}
|
|
53887
54003
|
} else {
|
|
53888
|
-
|
|
54004
|
+
if (isSame(getHorizontalOrientation(attachOrientation), getHorizontalOrientation(targetOrientation))) {
|
|
54005
|
+
return 'v';
|
|
54006
|
+
} else {
|
|
54007
|
+
return 'h';
|
|
54008
|
+
}
|
|
53889
54009
|
}
|
|
53890
54010
|
}
|
|
53891
54011
|
|
|
@@ -61296,7 +61416,7 @@
|
|
|
61296
61416
|
if (target) {
|
|
61297
61417
|
if (canExecute === 'attach') {
|
|
61298
61418
|
setMarker(target, MARKER_ATTACH);
|
|
61299
|
-
} else if (context.canExecute &&
|
|
61419
|
+
} else if (context.canExecute && parent && target.id !== parent.id) {
|
|
61300
61420
|
setMarker(target, MARKER_NEW_PARENT);
|
|
61301
61421
|
} else {
|
|
61302
61422
|
setMarker(target, context.canExecute ? MARKER_OK$1 : MARKER_NOT_OK$1);
|