camunda-bpmn-js 2.4.0 → 2.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/assets/properties-panel.css +40 -12
- package/dist/base-modeler.development.js +158 -220
- package/dist/base-modeler.production.min.js +31 -31
- package/dist/base-navigated-viewer.development.js +48 -24
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +48 -24
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +707 -379
- package/dist/camunda-cloud-modeler.production.min.js +32 -32
- package/dist/camunda-cloud-navigated-viewer.development.js +118 -92
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +118 -92
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +543 -305
- package/dist/camunda-platform-modeler.production.min.js +31 -31
- package/dist/camunda-platform-navigated-viewer.development.js +48 -24
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +48 -24
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/lib/camunda-cloud/util/commonModules.js +1 -1
- package/package.json +7 -8
|
@@ -722,6 +722,28 @@
|
|
|
722
722
|
return element && !!getBusinessObject(element).triggeredByEvent;
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
+
/**
|
|
726
|
+
* Checks whether a value is an instance of Connection.
|
|
727
|
+
*
|
|
728
|
+
* @param {any} value
|
|
729
|
+
*
|
|
730
|
+
* @return {boolean}
|
|
731
|
+
*/
|
|
732
|
+
function isConnection(value) {
|
|
733
|
+
return isObject(value) && has$1(value, 'waypoints');
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Checks whether a value is an instance of Label.
|
|
738
|
+
*
|
|
739
|
+
* @param {any} value
|
|
740
|
+
*
|
|
741
|
+
* @return {boolean}
|
|
742
|
+
*/
|
|
743
|
+
function isLabel(value) {
|
|
744
|
+
return isObject(value) && has$1(value, 'labelTarget');
|
|
745
|
+
}
|
|
746
|
+
|
|
725
747
|
/**
|
|
726
748
|
* @typedef {import('diagram-js/lib/util/Types').Point} Point
|
|
727
749
|
* @typedef {import('diagram-js/lib/util/Types').Rect} Rect
|
|
@@ -878,19 +900,10 @@
|
|
|
878
900
|
}
|
|
879
901
|
|
|
880
902
|
/**
|
|
881
|
-
* @param {
|
|
903
|
+
* @param {ModdleElement} semantic
|
|
882
904
|
*
|
|
883
|
-
* @
|
|
905
|
+
* @returns {string}
|
|
884
906
|
*/
|
|
885
|
-
function isLabel(element) {
|
|
886
|
-
return element && !!element.labelTarget;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* @typedef { import('../model').DiagramElement } DiagramElement
|
|
892
|
-
*/
|
|
893
|
-
|
|
894
907
|
function getLabelAttr(semantic) {
|
|
895
908
|
if (
|
|
896
909
|
is$1(semantic, 'bpmn:FlowElement') ||
|
|
@@ -913,6 +926,11 @@
|
|
|
913
926
|
}
|
|
914
927
|
}
|
|
915
928
|
|
|
929
|
+
/**
|
|
930
|
+
* @param {ModdleElement} semantic
|
|
931
|
+
*
|
|
932
|
+
* @returns {string}
|
|
933
|
+
*/
|
|
916
934
|
function getCategoryValue(semantic) {
|
|
917
935
|
var categoryValueRef = semantic['categoryValueRef'];
|
|
918
936
|
|
|
@@ -925,9 +943,9 @@
|
|
|
925
943
|
}
|
|
926
944
|
|
|
927
945
|
/**
|
|
928
|
-
* @param {
|
|
946
|
+
* @param {Element} element
|
|
929
947
|
*
|
|
930
|
-
* @return {string}
|
|
948
|
+
* @return {string}
|
|
931
949
|
*/
|
|
932
950
|
function getLabel(element) {
|
|
933
951
|
var semantic = element.businessObject,
|
|
@@ -2750,7 +2768,7 @@
|
|
|
2750
2768
|
*/
|
|
2751
2769
|
|
|
2752
2770
|
/**
|
|
2753
|
-
* @typedef { import('../model').
|
|
2771
|
+
* @typedef { import('../model/Types').Element } Element
|
|
2754
2772
|
*/
|
|
2755
2773
|
|
|
2756
2774
|
/**
|
|
@@ -3116,8 +3134,8 @@
|
|
|
3116
3134
|
}
|
|
3117
3135
|
|
|
3118
3136
|
function as(type) {
|
|
3119
|
-
return function(parentGfx, element) {
|
|
3120
|
-
return renderer(type)(parentGfx, element);
|
|
3137
|
+
return function(parentGfx, element, options) {
|
|
3138
|
+
return renderer(type)(parentGfx, element, options);
|
|
3121
3139
|
};
|
|
3122
3140
|
}
|
|
3123
3141
|
|
|
@@ -3256,7 +3274,7 @@
|
|
|
3256
3274
|
|
|
3257
3275
|
return drawCircle(parentGfx, element.width, element.height, attrs);
|
|
3258
3276
|
},
|
|
3259
|
-
'bpmn:StartEvent': function(parentGfx, element) {
|
|
3277
|
+
'bpmn:StartEvent': function(parentGfx, element, options) {
|
|
3260
3278
|
var attrs = {
|
|
3261
3279
|
fill: getFillColor(element, defaultFillColor),
|
|
3262
3280
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3274,7 +3292,9 @@
|
|
|
3274
3292
|
|
|
3275
3293
|
var circle = renderer('bpmn:Event')(parentGfx, element, attrs);
|
|
3276
3294
|
|
|
3277
|
-
|
|
3295
|
+
if (!options || options.renderIcon !== false) {
|
|
3296
|
+
renderEventContent(element, parentGfx);
|
|
3297
|
+
}
|
|
3278
3298
|
|
|
3279
3299
|
return circle;
|
|
3280
3300
|
},
|
|
@@ -3527,14 +3547,16 @@
|
|
|
3527
3547
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3528
3548
|
});
|
|
3529
3549
|
},
|
|
3530
|
-
'bpmn:EndEvent': function(parentGfx, element) {
|
|
3550
|
+
'bpmn:EndEvent': function(parentGfx, element, options) {
|
|
3531
3551
|
var circle = renderer('bpmn:Event')(parentGfx, element, {
|
|
3532
3552
|
strokeWidth: 4,
|
|
3533
3553
|
fill: getFillColor(element, defaultFillColor),
|
|
3534
3554
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3535
3555
|
});
|
|
3536
3556
|
|
|
3537
|
-
|
|
3557
|
+
if (!options || options.renderIcon !== false) {
|
|
3558
|
+
renderEventContent(element, parentGfx);
|
|
3559
|
+
}
|
|
3538
3560
|
|
|
3539
3561
|
return circle;
|
|
3540
3562
|
},
|
|
@@ -3547,7 +3569,7 @@
|
|
|
3547
3569
|
|
|
3548
3570
|
return circle;
|
|
3549
3571
|
},
|
|
3550
|
-
'bpmn:IntermediateEvent': function(parentGfx, element) {
|
|
3572
|
+
'bpmn:IntermediateEvent': function(parentGfx, element, options) {
|
|
3551
3573
|
var outer = renderer('bpmn:Event')(parentGfx, element, {
|
|
3552
3574
|
strokeWidth: 1.5,
|
|
3553
3575
|
fill: getFillColor(element, defaultFillColor),
|
|
@@ -3561,7 +3583,9 @@
|
|
|
3561
3583
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3562
3584
|
});
|
|
3563
3585
|
|
|
3564
|
-
|
|
3586
|
+
if (!options || options.renderIcon !== false) {
|
|
3587
|
+
renderEventContent(element, parentGfx);
|
|
3588
|
+
}
|
|
3565
3589
|
|
|
3566
3590
|
return outer;
|
|
3567
3591
|
},
|
|
@@ -4279,7 +4303,7 @@
|
|
|
4279
4303
|
|
|
4280
4304
|
return elementStore;
|
|
4281
4305
|
},
|
|
4282
|
-
'bpmn:BoundaryEvent': function(parentGfx, element) {
|
|
4306
|
+
'bpmn:BoundaryEvent': function(parentGfx, element, options) {
|
|
4283
4307
|
|
|
4284
4308
|
var semantic = getBusinessObject(element),
|
|
4285
4309
|
cancel = semantic.cancelActivity;
|
|
@@ -4310,7 +4334,9 @@
|
|
|
4310
4334
|
|
|
4311
4335
|
/* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, innerAttrs);
|
|
4312
4336
|
|
|
4313
|
-
|
|
4337
|
+
if (!options || options.renderIcon !== false) {
|
|
4338
|
+
renderEventContent(element, parentGfx);
|
|
4339
|
+
}
|
|
4314
4340
|
|
|
4315
4341
|
return outer;
|
|
4316
4342
|
},
|
|
@@ -4591,7 +4617,7 @@
|
|
|
4591
4617
|
|
|
4592
4618
|
|
|
4593
4619
|
/**
|
|
4594
|
-
* @param {
|
|
4620
|
+
* @param {Element} element
|
|
4595
4621
|
*
|
|
4596
4622
|
* @return {boolean}
|
|
4597
4623
|
*/
|
|
@@ -4603,7 +4629,7 @@
|
|
|
4603
4629
|
* Draw shape into parentGfx.
|
|
4604
4630
|
*
|
|
4605
4631
|
* @param {SVGElement} parentGfx
|
|
4606
|
-
* @param {
|
|
4632
|
+
* @param {Element} element
|
|
4607
4633
|
*
|
|
4608
4634
|
* @return {SVGElement} mainGfx
|
|
4609
4635
|
*/
|
|
@@ -4619,7 +4645,7 @@
|
|
|
4619
4645
|
* Draw connection into parentGfx.
|
|
4620
4646
|
*
|
|
4621
4647
|
* @param {SVGElement} parentGfx
|
|
4622
|
-
* @param {
|
|
4648
|
+
* @param {Element} element
|
|
4623
4649
|
*
|
|
4624
4650
|
* @return {SVGElement} mainGfx
|
|
4625
4651
|
*/
|
|
@@ -4634,7 +4660,7 @@
|
|
|
4634
4660
|
/**
|
|
4635
4661
|
* Get shape path.
|
|
4636
4662
|
*
|
|
4637
|
-
* @param {
|
|
4663
|
+
* @param {Element} element
|
|
4638
4664
|
*
|
|
4639
4665
|
* @return {string} path
|
|
4640
4666
|
*/
|
|
@@ -5898,10 +5924,6 @@
|
|
|
5898
5924
|
return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
|
|
5899
5925
|
}
|
|
5900
5926
|
|
|
5901
|
-
function isConnection(element) {
|
|
5902
|
-
return !!element.waypoints;
|
|
5903
|
-
}
|
|
5904
|
-
|
|
5905
5927
|
function elementToString(e) {
|
|
5906
5928
|
if (!e) {
|
|
5907
5929
|
return '<null>';
|
|
@@ -12382,6 +12404,7 @@
|
|
|
12382
12404
|
*
|
|
12383
12405
|
* @return {Root}
|
|
12384
12406
|
*/
|
|
12407
|
+
|
|
12385
12408
|
/**
|
|
12386
12409
|
* Creates a connection.
|
|
12387
12410
|
*
|
|
@@ -12405,6 +12428,7 @@
|
|
|
12405
12428
|
*
|
|
12406
12429
|
* @return {Connection}
|
|
12407
12430
|
*/
|
|
12431
|
+
|
|
12408
12432
|
/**
|
|
12409
12433
|
* Creates a shape.
|
|
12410
12434
|
*
|
|
@@ -12428,6 +12452,7 @@
|
|
|
12428
12452
|
*
|
|
12429
12453
|
* @return {Shape}
|
|
12430
12454
|
*/
|
|
12455
|
+
|
|
12431
12456
|
/**
|
|
12432
12457
|
* Creates a label.
|
|
12433
12458
|
*
|
|
@@ -12447,6 +12472,7 @@
|
|
|
12447
12472
|
*
|
|
12448
12473
|
* @param {'label'} type
|
|
12449
12474
|
* @param {Object} [attrs]
|
|
12475
|
+
*
|
|
12450
12476
|
* @return {Label}
|
|
12451
12477
|
*/
|
|
12452
12478
|
function create(type, attrs) {
|
|
@@ -16653,7 +16679,7 @@
|
|
|
16653
16679
|
}
|
|
16654
16680
|
}
|
|
16655
16681
|
|
|
16656
|
-
function inherits
|
|
16682
|
+
function inherits(ctor, superCtor) {
|
|
16657
16683
|
ctor.super_ = superCtor;
|
|
16658
16684
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
16659
16685
|
constructor: {
|
|
@@ -16819,7 +16845,7 @@
|
|
|
16819
16845
|
this.tagName = tagName;
|
|
16820
16846
|
}
|
|
16821
16847
|
|
|
16822
|
-
inherits
|
|
16848
|
+
inherits(ValueSerializer, BodySerializer);
|
|
16823
16849
|
|
|
16824
16850
|
ValueSerializer.prototype.serializeTo = function(writer) {
|
|
16825
16851
|
|
|
@@ -17312,7 +17338,7 @@
|
|
|
17312
17338
|
ElementSerializer.call(this, parent, propertyDescriptor);
|
|
17313
17339
|
}
|
|
17314
17340
|
|
|
17315
|
-
inherits
|
|
17341
|
+
inherits(TypeSerializer, ElementSerializer);
|
|
17316
17342
|
|
|
17317
17343
|
TypeSerializer.prototype.parseNsAttributes = function(element) {
|
|
17318
17344
|
|
|
@@ -22901,100 +22927,100 @@
|
|
|
22901
22927
|
// default moddle extensions the viewer is composed of
|
|
22902
22928
|
Viewer$1.prototype._moddleExtensions = {};
|
|
22903
22929
|
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
|
|
22914
|
-
enumerable: false,
|
|
22915
|
-
writable: true,
|
|
22916
|
-
configurable: true
|
|
22917
|
-
}
|
|
22918
|
-
});
|
|
22919
|
-
}
|
|
22920
|
-
};
|
|
22921
|
-
} else {
|
|
22922
|
-
// old school shim for old browsers
|
|
22923
|
-
inherits_browser.exports = function inherits(ctor, superCtor) {
|
|
22924
|
-
if (superCtor) {
|
|
22925
|
-
ctor.super_ = superCtor;
|
|
22926
|
-
var TempCtor = function () {};
|
|
22927
|
-
TempCtor.prototype = superCtor.prototype;
|
|
22928
|
-
ctor.prototype = new TempCtor();
|
|
22929
|
-
ctor.prototype.constructor = ctor;
|
|
22930
|
-
}
|
|
22931
|
-
};
|
|
22932
|
-
}
|
|
22933
|
-
|
|
22934
|
-
var inherits_browserExports = inherits_browser.exports;
|
|
22935
|
-
var inherits = /*@__PURE__*/getDefaultExportFromCjs(inherits_browserExports);
|
|
22930
|
+
/**
|
|
22931
|
+
* Get icon defined on a moddle element.
|
|
22932
|
+
*
|
|
22933
|
+
* @param { ModdleElement } element
|
|
22934
|
+
* @param { string } iconProperty
|
|
22935
|
+
*
|
|
22936
|
+
* @return { string }
|
|
22937
|
+
*/
|
|
22938
|
+
function getModelerTemplateIcon(element, iconProperty) {
|
|
22939
|
+
iconProperty = iconProperty || 'zeebe:modelerTemplateIcon';
|
|
22936
22940
|
|
|
22937
|
-
|
|
22938
|
-
var modelerTemplateIcon = getBusinessObject(element).get('zeebe:modelerTemplateIcon');
|
|
22939
|
-
return modelerTemplateIcon;
|
|
22941
|
+
return getBusinessObject(element).get(iconProperty);
|
|
22940
22942
|
}
|
|
22941
22943
|
|
|
22942
22944
|
var HIGH_PRIORITY = 1250;
|
|
22943
22945
|
|
|
22944
22946
|
|
|
22945
|
-
function
|
|
22947
|
+
function ElementTemplateIconRenderer(
|
|
22948
|
+
config,
|
|
22946
22949
|
bpmnRenderer,
|
|
22947
|
-
eventBus
|
|
22948
|
-
|
|
22950
|
+
eventBus) {
|
|
22951
|
+
|
|
22949
22952
|
this._bpmnRenderer = bpmnRenderer;
|
|
22950
22953
|
|
|
22954
|
+
this._iconProperty = config && config.iconProperty;
|
|
22955
|
+
|
|
22951
22956
|
BaseRenderer.call(this, eventBus, HIGH_PRIORITY);
|
|
22952
22957
|
}
|
|
22953
22958
|
|
|
22954
|
-
|
|
22959
|
+
e(ElementTemplateIconRenderer, BaseRenderer);
|
|
22955
22960
|
|
|
22956
|
-
|
|
22961
|
+
ElementTemplateIconRenderer.prototype.canRender = function(element) {
|
|
22957
22962
|
|
|
22958
22963
|
if (isLabel(element)) {
|
|
22959
22964
|
return false;
|
|
22960
22965
|
}
|
|
22961
22966
|
|
|
22962
|
-
return (
|
|
22963
|
-
|
|
22964
|
-
!!getModelerTemplateIcon(element)
|
|
22967
|
+
return !!(
|
|
22968
|
+
isAny(element, [ 'bpmn:Task', 'bpmn:Event' ]) && this._getIcon(element)
|
|
22965
22969
|
);
|
|
22966
22970
|
};
|
|
22967
22971
|
|
|
22968
|
-
|
|
22972
|
+
ElementTemplateIconRenderer.prototype._getIcon = function(element) {
|
|
22973
|
+
return getModelerTemplateIcon(element, this._iconProperty);
|
|
22974
|
+
};
|
|
22975
|
+
|
|
22976
|
+
ElementTemplateIconRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
22969
22977
|
|
|
22970
|
-
var renderer = this._bpmnRenderer.handlers[
|
|
22978
|
+
var renderer = this._bpmnRenderer.handlers[
|
|
22979
|
+
[
|
|
22980
|
+
'bpmn:Task',
|
|
22981
|
+
'bpmn:StartEvent',
|
|
22982
|
+
'bpmn:IntermediateEvent',
|
|
22983
|
+
'bpmn:BoundaryEvent',
|
|
22984
|
+
'bpmn:EndEvent'
|
|
22985
|
+
].find(t => is$1(element, t))
|
|
22986
|
+
];
|
|
22987
|
+
|
|
22988
|
+
var gfx = renderer(parentGfx, element, { renderIcon: false });
|
|
22971
22989
|
|
|
22972
|
-
var
|
|
22990
|
+
var icon = this._getIcon(element);
|
|
22973
22991
|
|
|
22974
|
-
var
|
|
22992
|
+
var size = 18;
|
|
22975
22993
|
|
|
22976
|
-
var
|
|
22977
|
-
attr$1(icon, {
|
|
22978
|
-
href: modelerTemplateIcon,
|
|
22994
|
+
var padding = is$1(element, 'bpmn:Task') ? {
|
|
22979
22995
|
x: 5,
|
|
22980
|
-
y: 5
|
|
22981
|
-
|
|
22982
|
-
|
|
22996
|
+
y: 5
|
|
22997
|
+
} : {
|
|
22998
|
+
x: (element.width - size) / 2,
|
|
22999
|
+
y: (element.height - size) / 2
|
|
23000
|
+
};
|
|
23001
|
+
|
|
23002
|
+
var img = create$1('image');
|
|
23003
|
+
attr$1(img, {
|
|
23004
|
+
href: icon,
|
|
23005
|
+
width: size,
|
|
23006
|
+
height: size,
|
|
23007
|
+
...padding
|
|
22983
23008
|
});
|
|
22984
23009
|
|
|
22985
|
-
append(parentGfx,
|
|
23010
|
+
append(parentGfx, img);
|
|
22986
23011
|
|
|
22987
23012
|
return gfx;
|
|
22988
23013
|
};
|
|
22989
23014
|
|
|
22990
|
-
|
|
23015
|
+
ElementTemplateIconRenderer.$inject = [
|
|
23016
|
+
'config.elementTemplateIconRenderer',
|
|
22991
23017
|
'bpmnRenderer',
|
|
22992
23018
|
'eventBus'
|
|
22993
23019
|
];
|
|
22994
23020
|
|
|
22995
23021
|
var iconRendererModule = {
|
|
22996
|
-
__init__: [ '
|
|
22997
|
-
|
|
23022
|
+
__init__: [ 'elementTemplateIconRenderer' ],
|
|
23023
|
+
elementTemplateIconRenderer: [ 'type', ElementTemplateIconRenderer ]
|
|
22998
23024
|
};
|
|
22999
23025
|
|
|
23000
23026
|
var name = "zeebe";
|