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
|
@@ -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();
|
|
@@ -103457,17 +103492,62 @@
|
|
|
103457
103492
|
return getPropertyValue$1(element, property);
|
|
103458
103493
|
}
|
|
103459
103494
|
|
|
103495
|
+
function removeRootElement(rootElement, injector) {
|
|
103496
|
+
const modeling = injector.get('modeling'),
|
|
103497
|
+
canvas = injector.get('canvas'),
|
|
103498
|
+
bpmnjs = injector.get('bpmnjs');
|
|
103499
|
+
const element = canvas.getRootElement(),
|
|
103500
|
+
definitions = bpmnjs.getDefinitions(),
|
|
103501
|
+
rootElements = definitions.get('rootElements');
|
|
103502
|
+
const newRootElements = rootElements.filter(e => e !== rootElement);
|
|
103503
|
+
|
|
103504
|
+
// short-circuit to prevent unnecessary updates
|
|
103505
|
+
if (newRootElements.length === rootElements.length) {
|
|
103506
|
+
return;
|
|
103507
|
+
}
|
|
103508
|
+
modeling.updateModdleProperties(element, definitions, {
|
|
103509
|
+
rootElements: newRootElements
|
|
103510
|
+
});
|
|
103511
|
+
}
|
|
103512
|
+
|
|
103513
|
+
/**
|
|
103514
|
+
* Remove message from element and the diagram.
|
|
103515
|
+
*
|
|
103516
|
+
* @param {import('bpmn-js/lib/model/Types').Element} element
|
|
103517
|
+
* @param {import('didi').Injector} injector
|
|
103518
|
+
*/
|
|
103519
|
+
function removeMessage(element, injector) {
|
|
103520
|
+
const modeling = injector.get('modeling');
|
|
103521
|
+
const bo = getReferringElement(element);
|
|
103522
|
+
const message = findMessage(bo);
|
|
103523
|
+
if (!message) {
|
|
103524
|
+
return;
|
|
103525
|
+
}
|
|
103526
|
+
modeling.updateModdleProperties(element, bo, {
|
|
103527
|
+
messageRef: undefined
|
|
103528
|
+
});
|
|
103529
|
+
removeRootElement(message, injector);
|
|
103530
|
+
}
|
|
103531
|
+
function getReferringElement(element) {
|
|
103532
|
+
const bo = getBusinessObject$1(element);
|
|
103533
|
+
if (is$5(bo, 'bpmn:Event')) {
|
|
103534
|
+
return bo.get('eventDefinitions')[0];
|
|
103535
|
+
}
|
|
103536
|
+
return bo;
|
|
103537
|
+
}
|
|
103538
|
+
|
|
103460
103539
|
/**
|
|
103461
103540
|
* Checks the conditions of an element template and sets/resets the
|
|
103462
103541
|
* corresponding properties on the element.
|
|
103463
103542
|
*/
|
|
103464
103543
|
class ElementTemplatesConditionChecker extends CommandInterceptor {
|
|
103465
|
-
constructor(eventBus, elementTemplates, commandStack, bpmnFactory) {
|
|
103544
|
+
constructor(eventBus, elementTemplates, commandStack, bpmnFactory, injector) {
|
|
103466
103545
|
super(eventBus);
|
|
103467
103546
|
this._eventBus = eventBus;
|
|
103468
103547
|
this._elementTemplates = elementTemplates;
|
|
103469
103548
|
this._commandStack = commandStack;
|
|
103470
103549
|
this._bpmnFactory = bpmnFactory;
|
|
103550
|
+
this._injector = injector;
|
|
103471
103551
|
this.preExecute(['element.updateProperties', 'element.updateModdleProperties'], this._saveConditionalState, true, this);
|
|
103472
103552
|
this.postExecute(['element.updateProperties', 'element.updateModdleProperties', 'propertiesPanel.zeebe.changeTemplate'], this._applyConditions, true, this);
|
|
103473
103553
|
}
|
|
@@ -103493,11 +103573,17 @@
|
|
|
103493
103573
|
const newTemplate = applyConditions(element, template);
|
|
103494
103574
|
const propertiesToAdd = getMissingProperties(oldTemplate, newTemplate);
|
|
103495
103575
|
const propertiesToRemove = getPropertiesToRemove(newTemplate, oldTemplate);
|
|
103576
|
+
this._updateReferencedElement(element, oldTemplate, newTemplate);
|
|
103496
103577
|
propertiesToAdd.forEach(property => setPropertyValue(this._bpmnFactory, this._commandStack, element, property, property.value));
|
|
103497
103578
|
propertiesToRemove.forEach(property => unsetProperty(this._commandStack, element, property));
|
|
103498
103579
|
}
|
|
103580
|
+
_updateReferencedElement(element, oldTemplate, newTemplate) {
|
|
103581
|
+
if (hasMessageProperties(oldTemplate) && !hasMessageProperties(newTemplate)) {
|
|
103582
|
+
removeMessage(element, this._injector);
|
|
103583
|
+
}
|
|
103584
|
+
}
|
|
103499
103585
|
}
|
|
103500
|
-
ElementTemplatesConditionChecker.$inject = ['eventBus', 'elementTemplates', 'commandStack', 'bpmnFactory'];
|
|
103586
|
+
ElementTemplatesConditionChecker.$inject = ['eventBus', 'elementTemplates', 'commandStack', 'bpmnFactory', 'injector'];
|
|
103501
103587
|
|
|
103502
103588
|
// helpers
|
|
103503
103589
|
|
|
@@ -103531,6 +103617,9 @@
|
|
|
103531
103617
|
function equals(a, b) {
|
|
103532
103618
|
return JSON.stringify(a, normalizeReplacer$1) === JSON.stringify(b, normalizeReplacer$1);
|
|
103533
103619
|
}
|
|
103620
|
+
function hasMessageProperties(template) {
|
|
103621
|
+
return template.properties.some(p => MESSAGE_BINDING_TYPES.includes(p.binding.type));
|
|
103622
|
+
}
|
|
103534
103623
|
|
|
103535
103624
|
function unlinkTemplate$1(element, injector) {
|
|
103536
103625
|
const modeling = injector.get('modeling'),
|
|
@@ -103907,13 +103996,12 @@
|
|
|
103907
103996
|
* Handles referenced elements.
|
|
103908
103997
|
*/
|
|
103909
103998
|
class ReferencedElementBehavior extends CommandInterceptor {
|
|
103910
|
-
constructor(eventBus, elementTemplates, modeling,
|
|
103999
|
+
constructor(eventBus, elementTemplates, modeling, injector, moddleCopy, bpmnFactory) {
|
|
103911
104000
|
super(eventBus);
|
|
103912
104001
|
this._eventBus = eventBus;
|
|
103913
104002
|
this._elementTemplates = elementTemplates;
|
|
103914
104003
|
this._modeling = modeling;
|
|
103915
|
-
this.
|
|
103916
|
-
this._bpmnjs = bpmnjs;
|
|
104004
|
+
this._injector = injector;
|
|
103917
104005
|
this.postExecuted(['element.updateProperties', 'element.updateModdleProperties'], this._handlePropertiesUpdate, true, this);
|
|
103918
104006
|
this.postExecuted('shape.replace', this._handleReplacement, true, this);
|
|
103919
104007
|
this.postExecuted('shape.delete', this._handleRemoval, true, this);
|
|
@@ -103976,7 +104064,7 @@
|
|
|
103976
104064
|
return;
|
|
103977
104065
|
}
|
|
103978
104066
|
if (!canHaveReferencedElement(newShape) || !newTemplate) {
|
|
103979
|
-
this.
|
|
104067
|
+
removeRootElement(message, this._injector);
|
|
103980
104068
|
return;
|
|
103981
104069
|
}
|
|
103982
104070
|
this._addMessage(newShape, message);
|
|
@@ -103997,17 +104085,9 @@
|
|
|
103997
104085
|
const bo = getBusinessObject$1(shape);
|
|
103998
104086
|
const message = findMessage(bo);
|
|
103999
104087
|
if (message && getTemplateId$1(message)) {
|
|
104000
|
-
this.
|
|
104088
|
+
removeRootElement(message, this._injector);
|
|
104001
104089
|
}
|
|
104002
104090
|
}
|
|
104003
|
-
_removeRootElement(rootElement) {
|
|
104004
|
-
const element = this._canvas.getRootElement();
|
|
104005
|
-
const definitions = this._bpmnjs.getDefinitions();
|
|
104006
|
-
const rootElements = definitions.get('rootElements');
|
|
104007
|
-
this._modeling.updateModdleProperties(element, definitions, {
|
|
104008
|
-
rootElements: rootElements.filter(e => e !== rootElement)
|
|
104009
|
-
});
|
|
104010
|
-
}
|
|
104011
104091
|
_addMessage(element, message) {
|
|
104012
104092
|
const bo = getReferringElement(element);
|
|
104013
104093
|
this._modeling.updateModdleProperties(element, bo, {
|
|
@@ -104015,17 +104095,10 @@
|
|
|
104015
104095
|
});
|
|
104016
104096
|
}
|
|
104017
104097
|
}
|
|
104018
|
-
ReferencedElementBehavior.$inject = ['eventBus', 'elementTemplates', 'modeling', '
|
|
104098
|
+
ReferencedElementBehavior.$inject = ['eventBus', 'elementTemplates', 'modeling', 'injector', 'moddleCopy', 'bpmnFactory'];
|
|
104019
104099
|
function canHaveReferencedElement(element) {
|
|
104020
104100
|
return isAny(element, ['bpmn:ReceiveTask', 'bpmn:SendTask', 'bpmn:Event']);
|
|
104021
104101
|
}
|
|
104022
|
-
function getReferringElement(element) {
|
|
104023
|
-
const bo = getBusinessObject$1(element);
|
|
104024
|
-
if (is$5(bo, 'bpmn:Event')) {
|
|
104025
|
-
return bo.get('eventDefinitions')[0];
|
|
104026
|
-
}
|
|
104027
|
-
return bo;
|
|
104028
|
-
}
|
|
104029
104102
|
function isLabel(element) {
|
|
104030
104103
|
return element.type === 'label';
|
|
104031
104104
|
}
|