camunda-bpmn-js 2.6.0 → 2.7.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/base-modeler.development.js +112 -39
- package/dist/base-modeler.production.min.js +5 -7
- package/dist/camunda-cloud-modeler.development.js +192 -136
- package/dist/camunda-cloud-modeler.production.min.js +6 -8
- package/dist/camunda-cloud-navigated-viewer.development.js +5 -4
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +5 -4
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +129 -57
- package/dist/camunda-platform-modeler.production.min.js +6 -8
- package/package.json +8 -8
|
@@ -18092,7 +18092,7 @@
|
|
|
18092
18092
|
*
|
|
18093
18093
|
* @return {boolean}
|
|
18094
18094
|
*/
|
|
18095
|
-
function isInterrupting$
|
|
18095
|
+
function isInterrupting$2(element) {
|
|
18096
18096
|
return element && getBusinessObject$2(element).isInterrupting !== false;
|
|
18097
18097
|
}
|
|
18098
18098
|
|
|
@@ -30033,9 +30033,8 @@
|
|
|
30033
30033
|
<span
|
|
30034
30034
|
class=${ clsx('djs-popup-entry-name', entry.className) }
|
|
30035
30035
|
>
|
|
30036
|
-
${
|
|
30037
|
-
|
|
30038
|
-
` : null }
|
|
30036
|
+
${(entry.imageUrl && m$3`<img class="djs-popup-entry-icon" src=${ entry.imageUrl } alt="" />`) ||
|
|
30037
|
+
(entry.imageHtml && m$3`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${ { __html: entry.imageHtml } } />`)}
|
|
30039
30038
|
|
|
30040
30039
|
${ entry.label ? m$3`
|
|
30041
30040
|
<span class="djs-popup-label">
|
|
@@ -31056,13 +31055,41 @@
|
|
|
31056
31055
|
* and then replace respective icons with the optimized data URIs in `./dist`.
|
|
31057
31056
|
*/
|
|
31058
31057
|
var icons$1 = {
|
|
31059
|
-
align:
|
|
31060
|
-
|
|
31061
|
-
|
|
31062
|
-
|
|
31063
|
-
|
|
31064
|
-
|
|
31065
|
-
|
|
31058
|
+
align: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
|
|
31059
|
+
<line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31060
|
+
<rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31061
|
+
<rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31062
|
+
</svg>`,
|
|
31063
|
+
bottom: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
31064
|
+
<line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31065
|
+
<rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31066
|
+
<rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31067
|
+
</svg>`,
|
|
31068
|
+
center: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
31069
|
+
<line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31070
|
+
<rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31071
|
+
<rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31072
|
+
</svg>`,
|
|
31073
|
+
left: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
31074
|
+
<line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31075
|
+
<rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31076
|
+
<rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31077
|
+
</svg>`,
|
|
31078
|
+
right: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
31079
|
+
<line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31080
|
+
<rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31081
|
+
<rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31082
|
+
</svg>`,
|
|
31083
|
+
top: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
31084
|
+
<line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31085
|
+
<rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31086
|
+
<rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31087
|
+
</svg>`,
|
|
31088
|
+
middle: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
31089
|
+
<line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
|
|
31090
|
+
<rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
31091
|
+
<rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
31092
|
+
</svg>`
|
|
31066
31093
|
};
|
|
31067
31094
|
|
|
31068
31095
|
var ICONS$1 = icons$1;
|
|
@@ -31133,7 +31160,7 @@
|
|
|
31133
31160
|
'align-elements': {
|
|
31134
31161
|
group: 'align-elements',
|
|
31135
31162
|
title: self._translate('Align elements'),
|
|
31136
|
-
|
|
31163
|
+
html: `<div class="entry">${ICONS$1['align']}</div>`,
|
|
31137
31164
|
action: {
|
|
31138
31165
|
click: function(event, target) {
|
|
31139
31166
|
var position = self._getMenuPosition(target);
|
|
@@ -31250,7 +31277,7 @@
|
|
|
31250
31277
|
group: 'align',
|
|
31251
31278
|
title: translate('Align elements ' + alignment),
|
|
31252
31279
|
className: 'bjs-align-elements-menu-entry',
|
|
31253
|
-
|
|
31280
|
+
imageHtml: ICONS$1[ alignment ],
|
|
31254
31281
|
action: function() {
|
|
31255
31282
|
alignElements.trigger(target, alignment);
|
|
31256
31283
|
popupMenu.close();
|
|
@@ -41905,8 +41932,16 @@
|
|
|
41905
41932
|
* and then replace respective icons with the optimized data URIs in `./dist`.
|
|
41906
41933
|
*/
|
|
41907
41934
|
var icons = {
|
|
41908
|
-
horizontal:
|
|
41909
|
-
|
|
41935
|
+
horizontal: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
41936
|
+
<polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
|
|
41937
|
+
<rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
41938
|
+
<rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
41939
|
+
</svg>`,
|
|
41940
|
+
vertical: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
41941
|
+
<polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
|
|
41942
|
+
<rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
41943
|
+
<rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
|
|
41944
|
+
</svg>`
|
|
41910
41945
|
};
|
|
41911
41946
|
|
|
41912
41947
|
var ICONS = icons;
|
|
@@ -41980,7 +42015,7 @@
|
|
|
41980
42015
|
group: 'distribute',
|
|
41981
42016
|
title: translate('Distribute elements horizontally'),
|
|
41982
42017
|
className: 'bjs-align-elements-menu-entry',
|
|
41983
|
-
|
|
42018
|
+
imageHtml: ICONS['horizontal'],
|
|
41984
42019
|
action: function(event, entry) {
|
|
41985
42020
|
distributeElements.trigger(elements, 'horizontal');
|
|
41986
42021
|
popupMenu.close();
|
|
@@ -41989,7 +42024,7 @@
|
|
|
41989
42024
|
'distribute-elements-vertical': {
|
|
41990
42025
|
group: 'distribute',
|
|
41991
42026
|
title: translate('Distribute elements vertically'),
|
|
41992
|
-
|
|
42027
|
+
imageHtml: ICONS['vertical'],
|
|
41993
42028
|
action: function(event, entry) {
|
|
41994
42029
|
distributeElements.trigger(elements, 'vertical');
|
|
41995
42030
|
popupMenu.close();
|
|
@@ -51823,7 +51858,7 @@
|
|
|
51823
51858
|
|
|
51824
51859
|
// replace a non-interrupting start event by a blank interrupting start event
|
|
51825
51860
|
// when the target is not an event sub process
|
|
51826
|
-
if (!isInterrupting$
|
|
51861
|
+
if (!isInterrupting$2(element)) {
|
|
51827
51862
|
canExecute.replacements.push({
|
|
51828
51863
|
oldElementId: element.id,
|
|
51829
51864
|
newElementType: 'bpmn:StartEvent'
|
|
@@ -101142,7 +101177,7 @@
|
|
|
101142
101177
|
type = `${getEventDefinitionPrefix(eventDefinition)}${type}`;
|
|
101143
101178
|
|
|
101144
101179
|
// (1.1) interrupting / non interrupting
|
|
101145
|
-
if (is$6(element, 'bpmn:StartEvent') && !isInterrupting$
|
|
101180
|
+
if (is$6(element, 'bpmn:StartEvent') && !isInterrupting$2(element) || is$6(element, 'bpmn:BoundaryEvent') && !isCancelActivity(element)) {
|
|
101146
101181
|
type = `${type}NonInterrupting`;
|
|
101147
101182
|
}
|
|
101148
101183
|
return type;
|
|
@@ -107304,6 +107339,50 @@
|
|
|
107304
107339
|
return getExtensionElementsList$2(businessObject, 'zeebe:TaskSchedule')[0];
|
|
107305
107340
|
}
|
|
107306
107341
|
|
|
107342
|
+
/**
|
|
107343
|
+
* Check whether a given timer expression type is supported for a given element.
|
|
107344
|
+
*
|
|
107345
|
+
* @param {string} type
|
|
107346
|
+
* @param {Element|ModdleElement} element
|
|
107347
|
+
*
|
|
107348
|
+
* @return {boolean}
|
|
107349
|
+
*/
|
|
107350
|
+
function isTimerExpressionTypeSupported$1(type, element) {
|
|
107351
|
+
const businessObject = getBusinessObject$2(element);
|
|
107352
|
+
switch (type) {
|
|
107353
|
+
case 'timeDate':
|
|
107354
|
+
return isAny$1(element, ['bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:StartEvent']);
|
|
107355
|
+
case 'timeCycle':
|
|
107356
|
+
if (is$6(element, 'bpmn:StartEvent') && !hasParentEventSubProcess$1(businessObject) || !isInterrupting$1(businessObject)) {
|
|
107357
|
+
return true;
|
|
107358
|
+
}
|
|
107359
|
+
if (is$6(element, 'bpmn:BoundaryEvent') && !isInterrupting$1(businessObject)) {
|
|
107360
|
+
return true;
|
|
107361
|
+
}
|
|
107362
|
+
return false;
|
|
107363
|
+
case 'timeDuration':
|
|
107364
|
+
if (isAny$1(element, ['bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent'])) {
|
|
107365
|
+
return true;
|
|
107366
|
+
}
|
|
107367
|
+
if (is$6(element, 'bpmn:StartEvent') && hasParentEventSubProcess$1(businessObject)) {
|
|
107368
|
+
return true;
|
|
107369
|
+
}
|
|
107370
|
+
return false;
|
|
107371
|
+
default:
|
|
107372
|
+
return false;
|
|
107373
|
+
}
|
|
107374
|
+
}
|
|
107375
|
+
function isInterrupting$1(businessObject) {
|
|
107376
|
+
if (is$6(businessObject, 'bpmn:BoundaryEvent')) {
|
|
107377
|
+
return businessObject.get('cancelActivity') !== false;
|
|
107378
|
+
}
|
|
107379
|
+
return businessObject.get('isInterrupting') !== false;
|
|
107380
|
+
}
|
|
107381
|
+
function hasParentEventSubProcess$1(businessObject) {
|
|
107382
|
+
const parent = businessObject.$parent;
|
|
107383
|
+
return parent && is$6(parent, 'bpmn:SubProcess') && parent.get('triggeredByEvent');
|
|
107384
|
+
}
|
|
107385
|
+
|
|
107307
107386
|
function TimerProps$1(props) {
|
|
107308
107387
|
const {
|
|
107309
107388
|
element,
|
|
@@ -107319,22 +107398,18 @@
|
|
|
107319
107398
|
return [];
|
|
107320
107399
|
}
|
|
107321
107400
|
const timerOptions = getTimerOptions(element, translate);
|
|
107322
|
-
const singleOption = timerOptions.length === 1;
|
|
107323
107401
|
const entries = [];
|
|
107324
|
-
|
|
107325
|
-
|
|
107326
|
-
|
|
107327
|
-
|
|
107328
|
-
|
|
107329
|
-
|
|
107330
|
-
|
|
107331
|
-
}
|
|
107332
|
-
if (timerEventDefinitionType || singleOption) {
|
|
107402
|
+
entries.push({
|
|
107403
|
+
id: 'timerEventDefinitionType',
|
|
107404
|
+
component: TimerEventDefinitionType$1,
|
|
107405
|
+
isEdited: isEdited$3,
|
|
107406
|
+
options: timerOptions
|
|
107407
|
+
});
|
|
107408
|
+
if (timerEventDefinitionType) {
|
|
107333
107409
|
entries.push({
|
|
107334
107410
|
id: 'timerEventDefinitionValue',
|
|
107335
107411
|
component: TimerEventDefinitionValue$1,
|
|
107336
107412
|
isEdited: isEdited$5,
|
|
107337
|
-
label: singleOption ? timerOptions[0].label : undefined,
|
|
107338
107413
|
timerEventDefinitionType: timerEventDefinitionType || timerOptions[0].value
|
|
107339
107414
|
});
|
|
107340
107415
|
}
|
|
@@ -107342,19 +107417,19 @@
|
|
|
107342
107417
|
}
|
|
107343
107418
|
function getTimerOptions(element, translate) {
|
|
107344
107419
|
const options = [];
|
|
107345
|
-
if (
|
|
107420
|
+
if (isTimerExpressionTypeSupported$1('timeDate', element)) {
|
|
107346
107421
|
options.push({
|
|
107347
107422
|
value: 'timeDate',
|
|
107348
107423
|
label: translate('Date')
|
|
107349
107424
|
});
|
|
107350
107425
|
}
|
|
107351
|
-
if (
|
|
107426
|
+
if (isTimerExpressionTypeSupported$1('timeDuration', element)) {
|
|
107352
107427
|
options.push({
|
|
107353
107428
|
value: 'timeDuration',
|
|
107354
107429
|
label: translate('Duration')
|
|
107355
107430
|
});
|
|
107356
107431
|
}
|
|
107357
|
-
if (
|
|
107432
|
+
if (isTimerExpressionTypeSupported$1('timeCycle', element)) {
|
|
107358
107433
|
options.push({
|
|
107359
107434
|
value: 'timeCycle',
|
|
107360
107435
|
label: translate('Cycle')
|
|
@@ -107450,10 +107525,6 @@
|
|
|
107450
107525
|
const businessObject = getBusinessObject$2(element),
|
|
107451
107526
|
timerEventDefinition = getTimerEventDefinition$1(businessObject),
|
|
107452
107527
|
timerEventFormalExpression = timerEventDefinition.get(timerEventDefinitionType);
|
|
107453
|
-
|
|
107454
|
-
// TODO(@barmac): remove with next major release
|
|
107455
|
-
// support `timerEventDefinitionDurationValue` for backwards compatibility
|
|
107456
|
-
const legacyId = getLegacyId(element);
|
|
107457
107528
|
const getValue = () => {
|
|
107458
107529
|
return timerEventFormalExpression && timerEventFormalExpression.get('body');
|
|
107459
107530
|
};
|
|
@@ -107480,7 +107551,7 @@
|
|
|
107480
107551
|
};
|
|
107481
107552
|
return FeelEntryWithVariableContext({
|
|
107482
107553
|
element,
|
|
107483
|
-
id:
|
|
107554
|
+
id: 'timerEventDefinitionValue',
|
|
107484
107555
|
label: label || translate('Value'),
|
|
107485
107556
|
feel: 'optional',
|
|
107486
107557
|
getValue,
|
|
@@ -107492,43 +107563,6 @@
|
|
|
107492
107563
|
|
|
107493
107564
|
// helper //////////////////////////
|
|
107494
107565
|
|
|
107495
|
-
/**
|
|
107496
|
-
* isTimerDefinitionTypeSupported - Checks whether a given timerDefinitionType
|
|
107497
|
-
* is supported for a given element
|
|
107498
|
-
*
|
|
107499
|
-
* @param {string} timerDefinitionType
|
|
107500
|
-
* @param {ModdleElement} element
|
|
107501
|
-
*
|
|
107502
|
-
* @return {boolean}
|
|
107503
|
-
*/
|
|
107504
|
-
function isTimerDefinitionTypeSupported(timerDefinitionType, element) {
|
|
107505
|
-
const businessObject = getBusinessObject$2(element);
|
|
107506
|
-
switch (timerDefinitionType) {
|
|
107507
|
-
case 'timeDate':
|
|
107508
|
-
if (is$6(element, 'bpmn:StartEvent')) {
|
|
107509
|
-
return true;
|
|
107510
|
-
}
|
|
107511
|
-
return false;
|
|
107512
|
-
case 'timeCycle':
|
|
107513
|
-
if (is$6(element, 'bpmn:StartEvent') && !isInterruptingStartEvent(businessObject)) {
|
|
107514
|
-
return true;
|
|
107515
|
-
}
|
|
107516
|
-
if (is$6(element, 'bpmn:BoundaryEvent') && !businessObject.cancelActivity) {
|
|
107517
|
-
return true;
|
|
107518
|
-
}
|
|
107519
|
-
return false;
|
|
107520
|
-
case 'timeDuration':
|
|
107521
|
-
if (is$6(element, 'bpmn:IntermediateCatchEvent')) {
|
|
107522
|
-
return true;
|
|
107523
|
-
}
|
|
107524
|
-
if (is$6(element, 'bpmn:BoundaryEvent')) {
|
|
107525
|
-
return true;
|
|
107526
|
-
}
|
|
107527
|
-
return false;
|
|
107528
|
-
default:
|
|
107529
|
-
return undefined;
|
|
107530
|
-
}
|
|
107531
|
-
}
|
|
107532
107566
|
function createTimerFormalExpression(bpmnFactory, eventDefinition) {
|
|
107533
107567
|
const formalExpression = bpmnFactory.create('bpmn:FormalExpression', {
|
|
107534
107568
|
body: undefined
|
|
@@ -107614,22 +107648,6 @@
|
|
|
107614
107648
|
});
|
|
107615
107649
|
}
|
|
107616
107650
|
}
|
|
107617
|
-
function isInterruptingStartEvent(bo) {
|
|
107618
|
-
return isInEventSubProcess$2(bo) && bo.get('isInterrupting') !== false;
|
|
107619
|
-
}
|
|
107620
|
-
function isInEventSubProcess$2(bo) {
|
|
107621
|
-
const parent = bo.$parent;
|
|
107622
|
-
return is$6(parent, 'bpmn:SubProcess') && parent.triggeredByEvent;
|
|
107623
|
-
}
|
|
107624
|
-
function getLegacyId(event) {
|
|
107625
|
-
if (is$6(event, 'bpmn:IntermediateCatchEvent') || isInterruptingBoundaryEvent(event)) {
|
|
107626
|
-
return 'timerEventDefinitionDurationValue';
|
|
107627
|
-
}
|
|
107628
|
-
}
|
|
107629
|
-
function isInterruptingBoundaryEvent(event) {
|
|
107630
|
-
const bo = getBusinessObject$2(event);
|
|
107631
|
-
return is$6(bo, 'bpmn:BoundaryEvent') && bo.get('cancelActivity') !== false;
|
|
107632
|
-
}
|
|
107633
107651
|
|
|
107634
107652
|
function ExtensionProperty(props) {
|
|
107635
107653
|
const {
|
|
@@ -109138,17 +109156,62 @@
|
|
|
109138
109156
|
return getPropertyValue$1(element, property);
|
|
109139
109157
|
}
|
|
109140
109158
|
|
|
109159
|
+
function removeRootElement(rootElement, injector) {
|
|
109160
|
+
const modeling = injector.get('modeling'),
|
|
109161
|
+
canvas = injector.get('canvas'),
|
|
109162
|
+
bpmnjs = injector.get('bpmnjs');
|
|
109163
|
+
const element = canvas.getRootElement(),
|
|
109164
|
+
definitions = bpmnjs.getDefinitions(),
|
|
109165
|
+
rootElements = definitions.get('rootElements');
|
|
109166
|
+
const newRootElements = rootElements.filter(e => e !== rootElement);
|
|
109167
|
+
|
|
109168
|
+
// short-circuit to prevent unnecessary updates
|
|
109169
|
+
if (newRootElements.length === rootElements.length) {
|
|
109170
|
+
return;
|
|
109171
|
+
}
|
|
109172
|
+
modeling.updateModdleProperties(element, definitions, {
|
|
109173
|
+
rootElements: newRootElements
|
|
109174
|
+
});
|
|
109175
|
+
}
|
|
109176
|
+
|
|
109177
|
+
/**
|
|
109178
|
+
* Remove message from element and the diagram.
|
|
109179
|
+
*
|
|
109180
|
+
* @param {import('bpmn-js/lib/model/Types').Element} element
|
|
109181
|
+
* @param {import('didi').Injector} injector
|
|
109182
|
+
*/
|
|
109183
|
+
function removeMessage(element, injector) {
|
|
109184
|
+
const modeling = injector.get('modeling');
|
|
109185
|
+
const bo = getReferringElement(element);
|
|
109186
|
+
const message = findMessage(bo);
|
|
109187
|
+
if (!message) {
|
|
109188
|
+
return;
|
|
109189
|
+
}
|
|
109190
|
+
modeling.updateModdleProperties(element, bo, {
|
|
109191
|
+
messageRef: undefined
|
|
109192
|
+
});
|
|
109193
|
+
removeRootElement(message, injector);
|
|
109194
|
+
}
|
|
109195
|
+
function getReferringElement(element) {
|
|
109196
|
+
const bo = getBusinessObject$2(element);
|
|
109197
|
+
if (is$6(bo, 'bpmn:Event')) {
|
|
109198
|
+
return bo.get('eventDefinitions')[0];
|
|
109199
|
+
}
|
|
109200
|
+
return bo;
|
|
109201
|
+
}
|
|
109202
|
+
|
|
109141
109203
|
/**
|
|
109142
109204
|
* Checks the conditions of an element template and sets/resets the
|
|
109143
109205
|
* corresponding properties on the element.
|
|
109144
109206
|
*/
|
|
109145
109207
|
class ElementTemplatesConditionChecker extends CommandInterceptor$1 {
|
|
109146
|
-
constructor(eventBus, elementTemplates, commandStack, bpmnFactory) {
|
|
109208
|
+
constructor(eventBus, elementTemplates, commandStack, bpmnFactory, injector) {
|
|
109147
109209
|
super(eventBus);
|
|
109148
109210
|
this._eventBus = eventBus;
|
|
109149
109211
|
this._elementTemplates = elementTemplates;
|
|
109150
109212
|
this._commandStack = commandStack;
|
|
109151
109213
|
this._bpmnFactory = bpmnFactory;
|
|
109214
|
+
this._injector = injector;
|
|
109152
109215
|
this.preExecute(['element.updateProperties', 'element.updateModdleProperties'], this._saveConditionalState, true, this);
|
|
109153
109216
|
this.postExecute(['element.updateProperties', 'element.updateModdleProperties', 'propertiesPanel.zeebe.changeTemplate'], this._applyConditions, true, this);
|
|
109154
109217
|
}
|
|
@@ -109174,11 +109237,17 @@
|
|
|
109174
109237
|
const newTemplate = applyConditions(element, template);
|
|
109175
109238
|
const propertiesToAdd = getMissingProperties(oldTemplate, newTemplate);
|
|
109176
109239
|
const propertiesToRemove = getPropertiesToRemove(newTemplate, oldTemplate);
|
|
109240
|
+
this._updateReferencedElement(element, oldTemplate, newTemplate);
|
|
109177
109241
|
propertiesToAdd.forEach(property => setPropertyValue(this._bpmnFactory, this._commandStack, element, property, property.value));
|
|
109178
109242
|
propertiesToRemove.forEach(property => unsetProperty(this._commandStack, element, property));
|
|
109179
109243
|
}
|
|
109244
|
+
_updateReferencedElement(element, oldTemplate, newTemplate) {
|
|
109245
|
+
if (hasMessageProperties(oldTemplate) && !hasMessageProperties(newTemplate)) {
|
|
109246
|
+
removeMessage(element, this._injector);
|
|
109247
|
+
}
|
|
109248
|
+
}
|
|
109180
109249
|
}
|
|
109181
|
-
ElementTemplatesConditionChecker.$inject = ['eventBus', 'elementTemplates', 'commandStack', 'bpmnFactory'];
|
|
109250
|
+
ElementTemplatesConditionChecker.$inject = ['eventBus', 'elementTemplates', 'commandStack', 'bpmnFactory', 'injector'];
|
|
109182
109251
|
|
|
109183
109252
|
// helpers
|
|
109184
109253
|
|
|
@@ -109212,6 +109281,9 @@
|
|
|
109212
109281
|
function equals(a, b) {
|
|
109213
109282
|
return JSON.stringify(a, normalizeReplacer$1) === JSON.stringify(b, normalizeReplacer$1);
|
|
109214
109283
|
}
|
|
109284
|
+
function hasMessageProperties(template) {
|
|
109285
|
+
return template.properties.some(p => MESSAGE_BINDING_TYPES.includes(p.binding.type));
|
|
109286
|
+
}
|
|
109215
109287
|
|
|
109216
109288
|
/**
|
|
109217
109289
|
* The BPMN 2.0 extension attribute name under
|
|
@@ -112712,13 +112784,12 @@
|
|
|
112712
112784
|
* Handles referenced elements.
|
|
112713
112785
|
*/
|
|
112714
112786
|
class ReferencedElementBehavior extends CommandInterceptor$1 {
|
|
112715
|
-
constructor(eventBus, elementTemplates, modeling,
|
|
112787
|
+
constructor(eventBus, elementTemplates, modeling, injector, moddleCopy, bpmnFactory) {
|
|
112716
112788
|
super(eventBus);
|
|
112717
112789
|
this._eventBus = eventBus;
|
|
112718
112790
|
this._elementTemplates = elementTemplates;
|
|
112719
112791
|
this._modeling = modeling;
|
|
112720
|
-
this.
|
|
112721
|
-
this._bpmnjs = bpmnjs;
|
|
112792
|
+
this._injector = injector;
|
|
112722
112793
|
this.postExecuted(['element.updateProperties', 'element.updateModdleProperties'], this._handlePropertiesUpdate, true, this);
|
|
112723
112794
|
this.postExecuted('shape.replace', this._handleReplacement, true, this);
|
|
112724
112795
|
this.postExecuted('shape.delete', this._handleRemoval, true, this);
|
|
@@ -112781,7 +112852,7 @@
|
|
|
112781
112852
|
return;
|
|
112782
112853
|
}
|
|
112783
112854
|
if (!canHaveReferencedElement(newShape) || !newTemplate) {
|
|
112784
|
-
this.
|
|
112855
|
+
removeRootElement(message, this._injector);
|
|
112785
112856
|
return;
|
|
112786
112857
|
}
|
|
112787
112858
|
this._addMessage(newShape, message);
|
|
@@ -112802,17 +112873,9 @@
|
|
|
112802
112873
|
const bo = getBusinessObject$2(shape);
|
|
112803
112874
|
const message = findMessage(bo);
|
|
112804
112875
|
if (message && getTemplateId$1(message)) {
|
|
112805
|
-
this.
|
|
112876
|
+
removeRootElement(message, this._injector);
|
|
112806
112877
|
}
|
|
112807
112878
|
}
|
|
112808
|
-
_removeRootElement(rootElement) {
|
|
112809
|
-
const element = this._canvas.getRootElement();
|
|
112810
|
-
const definitions = this._bpmnjs.getDefinitions();
|
|
112811
|
-
const rootElements = definitions.get('rootElements');
|
|
112812
|
-
this._modeling.updateModdleProperties(element, definitions, {
|
|
112813
|
-
rootElements: rootElements.filter(e => e !== rootElement)
|
|
112814
|
-
});
|
|
112815
|
-
}
|
|
112816
112879
|
_addMessage(element, message) {
|
|
112817
112880
|
const bo = getReferringElement(element);
|
|
112818
112881
|
this._modeling.updateModdleProperties(element, bo, {
|
|
@@ -112820,17 +112883,10 @@
|
|
|
112820
112883
|
});
|
|
112821
112884
|
}
|
|
112822
112885
|
}
|
|
112823
|
-
ReferencedElementBehavior.$inject = ['eventBus', 'elementTemplates', 'modeling', '
|
|
112886
|
+
ReferencedElementBehavior.$inject = ['eventBus', 'elementTemplates', 'modeling', 'injector', 'moddleCopy', 'bpmnFactory'];
|
|
112824
112887
|
function canHaveReferencedElement(element) {
|
|
112825
112888
|
return isAny$1(element, ['bpmn:ReceiveTask', 'bpmn:SendTask', 'bpmn:Event']);
|
|
112826
112889
|
}
|
|
112827
|
-
function getReferringElement(element) {
|
|
112828
|
-
const bo = getBusinessObject$2(element);
|
|
112829
|
-
if (is$6(bo, 'bpmn:Event')) {
|
|
112830
|
-
return bo.get('eventDefinitions')[0];
|
|
112831
|
-
}
|
|
112832
|
-
return bo;
|
|
112833
|
-
}
|
|
112834
112890
|
function isLabel$1(element) {
|
|
112835
112891
|
return element.type === 'label';
|
|
112836
112892
|
}
|
|
@@ -117071,9 +117127,9 @@
|
|
|
117071
117127
|
]
|
|
117072
117128
|
};
|
|
117073
117129
|
|
|
117074
|
-
const colorImageSvg =
|
|
117075
|
-
|
|
117076
|
-
|
|
117130
|
+
const colorImageSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor">
|
|
117131
|
+
<path d="m12.5 5.5.3-.4 3.6-3.6c.5-.5 1.3-.5 1.7 0l1 1c.5.4.5 1.2 0 1.7l-3.6 3.6-.4.2v.2c0 1.4.6 2 1 2.7v.6l-1.7 1.6c-.2.2-.4.2-.6 0L7.3 6.6a.4.4 0 0 1 0-.6l.3-.3.5-.5.8-.8c.2-.2.4-.1.6 0 .9.5 1.5 1.1 3 1.1zm-9.9 6 4.2-4.2 6.3 6.3-4.2 4.2c-.3.3-.9.3-1.2 0l-.8-.8-.9-.8-2.3-2.9" />
|
|
117132
|
+
</svg>`;
|
|
117077
117133
|
|
|
117078
117134
|
|
|
117079
117135
|
function ColorContextPadProvider(contextPad, popupMenu, canvas, translate) {
|
|
@@ -117117,7 +117173,7 @@
|
|
|
117117
117173
|
group: 'edit',
|
|
117118
117174
|
className: 'bpmn-icon-color',
|
|
117119
117175
|
title: translate('Set Color'),
|
|
117120
|
-
|
|
117176
|
+
html: `<div class="entry">${colorImageSvg}</div>`,
|
|
117121
117177
|
action: {
|
|
117122
117178
|
click: (event, element) => {
|
|
117123
117179
|
|
|
@@ -117190,12 +117246,14 @@
|
|
|
117190
117246
|
} ];
|
|
117191
117247
|
|
|
117192
117248
|
|
|
117193
|
-
function ColorPopupProvider(config, popupMenu, modeling, translate) {
|
|
117249
|
+
function ColorPopupProvider(config, bpmnRendererConfig, popupMenu, modeling, translate) {
|
|
117194
117250
|
this._popupMenu = popupMenu;
|
|
117195
117251
|
this._modeling = modeling;
|
|
117196
117252
|
this._translate = translate;
|
|
117197
117253
|
|
|
117198
117254
|
this._colors = config && config.colors || COLORS;
|
|
117255
|
+
this._defaultFillColor = bpmnRendererConfig && bpmnRendererConfig.defaultFillColor || 'white';
|
|
117256
|
+
this._defaultStrokeColor = bpmnRendererConfig && bpmnRendererConfig.defaultStrokeColor || 'rgb(34, 36, 42)';
|
|
117199
117257
|
|
|
117200
117258
|
this._popupMenu.registerProvider('color-picker', this);
|
|
117201
117259
|
}
|
|
@@ -117203,6 +117261,7 @@
|
|
|
117203
117261
|
|
|
117204
117262
|
ColorPopupProvider.$inject = [
|
|
117205
117263
|
'config.colorPicker',
|
|
117264
|
+
'config.bpmnRenderer',
|
|
117206
117265
|
'popupMenu',
|
|
117207
117266
|
'modeling',
|
|
117208
117267
|
'translate'
|
|
@@ -117214,14 +117273,14 @@
|
|
|
117214
117273
|
|
|
117215
117274
|
var colorIcon = domify$1(`
|
|
117216
117275
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="100%">
|
|
117217
|
-
<rect rx="2" x="1" y="1" width="22" height="22" fill="var(--fill-color)" stroke="var(--stroke-color)"></rect>
|
|
117276
|
+
<rect rx="2" x="1" y="1" width="22" height="22" fill="var(--fill-color)" stroke="var(--stroke-color)" style="stroke-width:2"></rect>
|
|
117218
117277
|
</svg>
|
|
117219
117278
|
`);
|
|
117220
117279
|
|
|
117221
117280
|
var entries = this._colors.map(function(color) {
|
|
117222
117281
|
|
|
117223
|
-
colorIcon.style.setProperty('--fill-color', color.fill ||
|
|
117224
|
-
colorIcon.style.setProperty('--stroke-color', color.stroke ||
|
|
117282
|
+
colorIcon.style.setProperty('--fill-color', color.fill || self._defaultFillColor);
|
|
117283
|
+
colorIcon.style.setProperty('--stroke-color', color.stroke || self._defaultStrokeColor);
|
|
117225
117284
|
|
|
117226
117285
|
return {
|
|
117227
117286
|
title: self._translate(color.label),
|
|
@@ -117489,11 +117548,12 @@
|
|
|
117489
117548
|
|
|
117490
117549
|
var renderer = this._bpmnRenderer.handlers[
|
|
117491
117550
|
[
|
|
117492
|
-
'bpmn:Task',
|
|
117493
|
-
'bpmn:StartEvent',
|
|
117494
|
-
'bpmn:IntermediateEvent',
|
|
117495
117551
|
'bpmn:BoundaryEvent',
|
|
117496
|
-
'bpmn:EndEvent'
|
|
117552
|
+
'bpmn:EndEvent',
|
|
117553
|
+
'bpmn:IntermediateCatchEvent',
|
|
117554
|
+
'bpmn:IntermediateThrowEvent',
|
|
117555
|
+
'bpmn:StartEvent',
|
|
117556
|
+
'bpmn:Task'
|
|
117497
117557
|
].find(t => is$6(element, t))
|
|
117498
117558
|
];
|
|
117499
117559
|
|
|
@@ -119033,16 +119093,12 @@
|
|
|
119033
119093
|
return true;
|
|
119034
119094
|
};
|
|
119035
119095
|
|
|
119036
|
-
|
|
119037
|
-
|
|
119038
|
-
|
|
119039
|
-
|
|
119040
|
-
|
|
119041
|
-
|
|
119042
|
-
</svg>`;
|
|
119043
|
-
const createIcon = `<svg width="46" height="46" viewBox="-2 -2 9.82 9.82" xmlns="http://www.w3.org/2000/svg">
|
|
119044
|
-
<path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
|
|
119045
|
-
</svg>`;
|
|
119096
|
+
const appendIcon = `<svg width="22" height="22" viewBox="0 0 5.82 5.82" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
|
119097
|
+
<path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
|
|
119098
|
+
</svg>`;
|
|
119099
|
+
const createIcon = `<svg width="46" height="46" viewBox="-2 -2 9.82 9.82" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
|
119100
|
+
<path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
|
|
119101
|
+
</svg>`;
|
|
119046
119102
|
|
|
119047
119103
|
/**
|
|
119048
119104
|
* A provider for append context pad button
|