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.
@@ -4785,6 +4785,28 @@
4785
4785
 
4786
4786
  var intersectPaths = /*@__PURE__*/getDefaultExportFromCjs(intersect);
4787
4787
 
4788
+ /**
4789
+ * Checks whether a value is an instance of Connection.
4790
+ *
4791
+ * @param {any} value
4792
+ *
4793
+ * @return {boolean}
4794
+ */
4795
+ function isConnection$1(value) {
4796
+ return isObject(value) && has$1(value, 'waypoints');
4797
+ }
4798
+
4799
+ /**
4800
+ * Checks whether a value is an instance of Label.
4801
+ *
4802
+ * @param {any} value
4803
+ *
4804
+ * @return {boolean}
4805
+ */
4806
+ function isLabel$1(value) {
4807
+ return isObject(value) && has$1(value, 'labelTarget');
4808
+ }
4809
+
4788
4810
  /**
4789
4811
  * @typedef {import('../core/Types').ElementLike} Element
4790
4812
  * @typedef {import('../core/Types').ConnectionLike} Connection
@@ -4939,7 +4961,7 @@
4939
4961
  * @return {Point}
4940
4962
  */
4941
4963
  function getMid(element) {
4942
- if (isConnection$g(element)) {
4964
+ if (isConnection$1(element)) {
4943
4965
  return getConnectionMid(element);
4944
4966
  }
4945
4967
 
@@ -5079,10 +5101,6 @@
5079
5101
  return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
5080
5102
  }
5081
5103
 
5082
- function isConnection$g(element) {
5083
- return !!element.waypoints;
5084
- }
5085
-
5086
5104
  /**
5087
5105
  * @typedef {import('./Types').ConnectionLike} ConnectionLike
5088
5106
  * @typedef {import('./Types').RootLike} RootLike
@@ -7386,6 +7404,7 @@
7386
7404
  *
7387
7405
  * @return {Root}
7388
7406
  */
7407
+
7389
7408
  /**
7390
7409
  * Creates a connection.
7391
7410
  *
@@ -7409,6 +7428,7 @@
7409
7428
  *
7410
7429
  * @return {Connection}
7411
7430
  */
7431
+
7412
7432
  /**
7413
7433
  * Creates a shape.
7414
7434
  *
@@ -7432,6 +7452,7 @@
7432
7452
  *
7433
7453
  * @return {Shape}
7434
7454
  */
7455
+
7435
7456
  /**
7436
7457
  * Creates a label.
7437
7458
  *
@@ -7451,6 +7472,7 @@
7451
7472
  *
7452
7473
  * @param {'label'} type
7453
7474
  * @param {Object} [attrs]
7475
+ *
7454
7476
  * @return {Label}
7455
7477
  */
7456
7478
  function create(type, attrs) {
@@ -7465,6 +7487,7 @@
7465
7487
  * Checks whether an object is a model instance.
7466
7488
  *
7467
7489
  * @param {any} obj
7490
+ *
7468
7491
  * @return {boolean}
7469
7492
  */
7470
7493
  function isModelElement(obj) {
@@ -18166,7 +18189,7 @@
18166
18189
  * @return {boolean}
18167
18190
  */
18168
18191
  function hasExternalLabel(element) {
18169
- return isLabel$6(element.label);
18192
+ return isLabel$1(element.label);
18170
18193
  }
18171
18194
 
18172
18195
  /**
@@ -18290,19 +18313,10 @@
18290
18313
  }
18291
18314
 
18292
18315
  /**
18293
- * @param {Element} element
18316
+ * @param {ModdleElement} semantic
18294
18317
  *
18295
- * @return {boolean}
18296
- */
18297
- function isLabel$6(element) {
18298
- return element && !!element.labelTarget;
18299
- }
18300
-
18301
-
18302
- /**
18303
- * @typedef { import('../model').DiagramElement } DiagramElement
18318
+ * @returns {string}
18304
18319
  */
18305
-
18306
18320
  function getLabelAttr(semantic) {
18307
18321
  if (
18308
18322
  is$5(semantic, 'bpmn:FlowElement') ||
@@ -18325,6 +18339,11 @@
18325
18339
  }
18326
18340
  }
18327
18341
 
18342
+ /**
18343
+ * @param {ModdleElement} semantic
18344
+ *
18345
+ * @returns {string}
18346
+ */
18328
18347
  function getCategoryValue(semantic) {
18329
18348
  var categoryValueRef = semantic['categoryValueRef'];
18330
18349
 
@@ -18337,9 +18356,9 @@
18337
18356
  }
18338
18357
 
18339
18358
  /**
18340
- * @param {DiagramElement} element
18359
+ * @param {Element} element
18341
18360
  *
18342
- * @return {string} label
18361
+ * @return {string}
18343
18362
  */
18344
18363
  function getLabel(element) {
18345
18364
  var semantic = element.businessObject,
@@ -18358,10 +18377,10 @@
18358
18377
 
18359
18378
 
18360
18379
  /**
18361
- * @param {DiagramElement} element
18380
+ * @param {Element} element
18362
18381
  * @param {string} text
18363
18382
  *
18364
- * @return {DiagramElement} element
18383
+ * @return {Element}
18365
18384
  */
18366
18385
  function setLabel(element, text) {
18367
18386
  var semantic = element.businessObject,
@@ -18583,7 +18602,7 @@
18583
18602
  */
18584
18603
 
18585
18604
  /**
18586
- * @typedef { import('../model').DiagramElement } DiagramElement
18605
+ * @typedef { import('../model/Types').Element } Element
18587
18606
  */
18588
18607
 
18589
18608
  /**
@@ -18949,8 +18968,8 @@
18949
18968
  }
18950
18969
 
18951
18970
  function as(type) {
18952
- return function(parentGfx, element) {
18953
- return renderer(type)(parentGfx, element);
18971
+ return function(parentGfx, element, options) {
18972
+ return renderer(type)(parentGfx, element, options);
18954
18973
  };
18955
18974
  }
18956
18975
 
@@ -19089,7 +19108,7 @@
19089
19108
 
19090
19109
  return drawCircle(parentGfx, element.width, element.height, attrs);
19091
19110
  },
19092
- 'bpmn:StartEvent': function(parentGfx, element) {
19111
+ 'bpmn:StartEvent': function(parentGfx, element, options) {
19093
19112
  var attrs = {
19094
19113
  fill: getFillColor(element, defaultFillColor),
19095
19114
  stroke: getStrokeColor$1(element, defaultStrokeColor)
@@ -19107,7 +19126,9 @@
19107
19126
 
19108
19127
  var circle = renderer('bpmn:Event')(parentGfx, element, attrs);
19109
19128
 
19110
- renderEventContent(element, parentGfx);
19129
+ if (!options || options.renderIcon !== false) {
19130
+ renderEventContent(element, parentGfx);
19131
+ }
19111
19132
 
19112
19133
  return circle;
19113
19134
  },
@@ -19360,14 +19381,16 @@
19360
19381
  stroke: getStrokeColor$1(event, defaultStrokeColor)
19361
19382
  });
19362
19383
  },
19363
- 'bpmn:EndEvent': function(parentGfx, element) {
19384
+ 'bpmn:EndEvent': function(parentGfx, element, options) {
19364
19385
  var circle = renderer('bpmn:Event')(parentGfx, element, {
19365
19386
  strokeWidth: 4,
19366
19387
  fill: getFillColor(element, defaultFillColor),
19367
19388
  stroke: getStrokeColor$1(element, defaultStrokeColor)
19368
19389
  });
19369
19390
 
19370
- renderEventContent(element, parentGfx);
19391
+ if (!options || options.renderIcon !== false) {
19392
+ renderEventContent(element, parentGfx);
19393
+ }
19371
19394
 
19372
19395
  return circle;
19373
19396
  },
@@ -19380,7 +19403,7 @@
19380
19403
 
19381
19404
  return circle;
19382
19405
  },
19383
- 'bpmn:IntermediateEvent': function(parentGfx, element) {
19406
+ 'bpmn:IntermediateEvent': function(parentGfx, element, options) {
19384
19407
  var outer = renderer('bpmn:Event')(parentGfx, element, {
19385
19408
  strokeWidth: 1.5,
19386
19409
  fill: getFillColor(element, defaultFillColor),
@@ -19394,7 +19417,9 @@
19394
19417
  stroke: getStrokeColor$1(element, defaultStrokeColor)
19395
19418
  });
19396
19419
 
19397
- renderEventContent(element, parentGfx);
19420
+ if (!options || options.renderIcon !== false) {
19421
+ renderEventContent(element, parentGfx);
19422
+ }
19398
19423
 
19399
19424
  return outer;
19400
19425
  },
@@ -20112,7 +20137,7 @@
20112
20137
 
20113
20138
  return elementStore;
20114
20139
  },
20115
- 'bpmn:BoundaryEvent': function(parentGfx, element) {
20140
+ 'bpmn:BoundaryEvent': function(parentGfx, element, options) {
20116
20141
 
20117
20142
  var semantic = getBusinessObject$1(element),
20118
20143
  cancel = semantic.cancelActivity;
@@ -20143,7 +20168,9 @@
20143
20168
 
20144
20169
  /* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, innerAttrs);
20145
20170
 
20146
- renderEventContent(element, parentGfx);
20171
+ if (!options || options.renderIcon !== false) {
20172
+ renderEventContent(element, parentGfx);
20173
+ }
20147
20174
 
20148
20175
  return outer;
20149
20176
  },
@@ -20424,7 +20451,7 @@
20424
20451
 
20425
20452
 
20426
20453
  /**
20427
- * @param {DiagramElement} element
20454
+ * @param {Element} element
20428
20455
  *
20429
20456
  * @return {boolean}
20430
20457
  */
@@ -20436,7 +20463,7 @@
20436
20463
  * Draw shape into parentGfx.
20437
20464
  *
20438
20465
  * @param {SVGElement} parentGfx
20439
- * @param {DiagramElement} element
20466
+ * @param {Element} element
20440
20467
  *
20441
20468
  * @return {SVGElement} mainGfx
20442
20469
  */
@@ -20452,7 +20479,7 @@
20452
20479
  * Draw connection into parentGfx.
20453
20480
  *
20454
20481
  * @param {SVGElement} parentGfx
20455
- * @param {DiagramElement} element
20482
+ * @param {Element} element
20456
20483
  *
20457
20484
  * @return {SVGElement} mainGfx
20458
20485
  */
@@ -20467,7 +20494,7 @@
20467
20494
  /**
20468
20495
  * Get shape path.
20469
20496
  *
20470
- * @param {DiagramElement} element
20497
+ * @param {Element} element
20471
20498
  *
20472
20499
  * @return {string} path
20473
20500
  */
@@ -30977,7 +31004,7 @@
30977
31004
  let element = closest(event.delegateTarget || event.target, '.entry', true);
30978
31005
  let entryId = attr$1(element, DATA_REF);
30979
31006
 
30980
- entry = this._getEntry(entryId);
31007
+ entry = { id: entryId, ...this._getEntry(entryId) };
30981
31008
  }
30982
31009
 
30983
31010
  const handler = entry.action;
@@ -31950,7 +31977,7 @@
31950
31977
  y: sourceTrbl.top - 50 - element.height / 2
31951
31978
  };
31952
31979
 
31953
- if (isConnection$f(source)) {
31980
+ if (isConnection$1(source)) {
31954
31981
  position = getMid(source);
31955
31982
  position.x += 100;
31956
31983
  position.y -= 50;
@@ -31995,10 +32022,6 @@
31995
32022
  return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
31996
32023
  }
31997
32024
 
31998
- function isConnection$f(element) {
31999
- return !!element.waypoints;
32000
- }
32001
-
32002
32025
  /**
32003
32026
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
32004
32027
  */
@@ -32436,7 +32459,7 @@
32436
32459
 
32437
32460
  forEach$1(elements, function(element) {
32438
32461
 
32439
- if (is$5(element, 'bpmn:Lane') || isLabel$6(element)) {
32462
+ if (is$5(element, 'bpmn:Lane') || isLabel$1(element)) {
32440
32463
  canResize = false;
32441
32464
  return;
32442
32465
  }
@@ -35450,7 +35473,7 @@
35450
35473
  hoverMid = hover && getSnapPoint(hover, event);
35451
35474
 
35452
35475
  // only snap on connections, elements can have multiple connect endpoints
35453
- if (!isConnection$e(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35476
+ if (!isConnection$1(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35454
35477
  return;
35455
35478
  }
35456
35479
 
@@ -35502,13 +35525,6 @@
35502
35525
 
35503
35526
  BendpointSnapping.$inject = [ 'eventBus' ];
35504
35527
 
35505
-
35506
- // helpers //////////////////////
35507
-
35508
- function isConnection$e(element) {
35509
- return element && !!element.waypoints;
35510
- }
35511
-
35512
35528
  /**
35513
35529
  * @type { import('didi').ModuleDeclaration }
35514
35530
  */
@@ -37035,11 +37051,11 @@
37035
37051
  elements = filter(elements, function(element) {
37036
37052
  var labelTarget = element.labelTarget;
37037
37053
 
37038
- return !element.parent && !(isLabel$5(element) && elements.indexOf(labelTarget) !== -1);
37054
+ return !element.parent && !(isLabel$1(element) && elements.indexOf(labelTarget) !== -1);
37039
37055
  });
37040
37056
 
37041
37057
  var shape = find$1(elements, function(element) {
37042
- return !isConnection$d(element);
37058
+ return !isConnection$1(element);
37043
37059
  });
37044
37060
 
37045
37061
  var attach = false,
@@ -37194,7 +37210,7 @@
37194
37210
 
37195
37211
  // update shape
37196
37212
  shape = find$1(elements, function(element) {
37197
- return !isConnection$d(element);
37213
+ return !isConnection$1(element);
37198
37214
  });
37199
37215
  }
37200
37216
 
@@ -37235,7 +37251,7 @@
37235
37251
  }
37236
37252
 
37237
37253
  var shape = find$1(elements, function(element) {
37238
- return !isConnection$d(element);
37254
+ return !isConnection$1(element);
37239
37255
  });
37240
37256
 
37241
37257
  if (!shape) {
@@ -37269,7 +37285,7 @@
37269
37285
 
37270
37286
  // center elements around cursor
37271
37287
  forEach$1(elements, function(element) {
37272
- if (isConnection$d(element)) {
37288
+ if (isConnection$1(element)) {
37273
37289
  element.waypoints = map$2(element.waypoints, function(waypoint) {
37274
37290
  return {
37275
37291
  x: waypoint.x - bbox.x - bbox.width / 2,
@@ -37331,16 +37347,8 @@
37331
37347
  }
37332
37348
  }
37333
37349
 
37334
- function isConnection$d(element) {
37335
- return !!element.waypoints;
37336
- }
37337
-
37338
37350
  function isSingleShape(elements) {
37339
- return elements && elements.length === 1 && !isConnection$d(elements[0]);
37340
- }
37341
-
37342
- function isLabel$5(element) {
37343
- return !!element.labelTarget;
37351
+ return elements && elements.length === 1 && !isConnection$1(elements[ 0 ]);
37344
37352
  }
37345
37353
 
37346
37354
  /**
@@ -37673,7 +37681,7 @@
37673
37681
  }
37674
37682
 
37675
37683
  // connections (priority = 3)
37676
- if (isConnection$c(element)) {
37684
+ if (isConnection$1(element)) {
37677
37685
  descriptor.priority = 3;
37678
37686
 
37679
37687
  descriptor.source = element.source.id;
@@ -37683,7 +37691,7 @@
37683
37691
  }
37684
37692
 
37685
37693
  // labels (priority = 4)
37686
- if (isLabel$4(element)) {
37694
+ if (isLabel$1(element)) {
37687
37695
  descriptor.priority = 4;
37688
37696
 
37689
37697
  descriptor.labelTarget = element.labelTarget.id;
@@ -37816,7 +37824,7 @@
37816
37824
 
37817
37825
  // center elements around cursor
37818
37826
  forEach$1(elements, function(element) {
37819
- if (isConnection$c(element)) {
37827
+ if (isConnection$1(element)) {
37820
37828
  element.waypoints = map$2(element.waypoints, function(waypoint) {
37821
37829
  return {
37822
37830
  x: waypoint.x - bbox.x - bbox.width / 2,
@@ -37869,7 +37877,7 @@
37869
37877
 
37870
37878
  var element;
37871
37879
 
37872
- if (isConnection$c(attrs)) {
37880
+ if (isConnection$1(attrs)) {
37873
37881
  attrs.source = cache[ descriptor.source ];
37874
37882
  attrs.target = cache[ descriptor.target ];
37875
37883
 
@@ -37880,7 +37888,7 @@
37880
37888
  return;
37881
37889
  }
37882
37890
 
37883
- if (isLabel$4(attrs)) {
37891
+ if (isLabel$1(attrs)) {
37884
37892
  attrs.labelTarget = cache[ attrs.labelTarget ];
37885
37893
 
37886
37894
  element = cache[ descriptor.id ] = self.createLabel(attrs);
@@ -37935,7 +37943,7 @@
37935
37943
  source,
37936
37944
  target;
37937
37945
 
37938
- if (isConnection$c(element)) {
37946
+ if (isConnection$1(element)) {
37939
37947
  source = find$1(elements, matchPattern({ id: element.source.id }));
37940
37948
  target = find$1(elements, matchPattern({ id: element.target.id }));
37941
37949
 
@@ -37944,7 +37952,7 @@
37944
37952
  }
37945
37953
  }
37946
37954
 
37947
- if (isLabel$4(element)) {
37955
+ if (isLabel$1(element)) {
37948
37956
  labelTarget = find$1(elements, matchPattern({ id: element.labelTarget.id }));
37949
37957
 
37950
37958
  if (!labelTarget) {
@@ -38037,7 +38045,7 @@
38037
38045
  eachElement$2(parents, function(element, _index, depth) {
38038
38046
 
38039
38047
  // do NOT add external labels directly
38040
- if (isLabel$4(element)) {
38048
+ if (isLabel$1(element)) {
38041
38049
  return;
38042
38050
  }
38043
38051
 
@@ -38135,14 +38143,6 @@
38135
38143
  return !!element.host;
38136
38144
  }
38137
38145
 
38138
- function isConnection$c(element) {
38139
- return !!element.waypoints;
38140
- }
38141
-
38142
- function isLabel$4(element) {
38143
- return !!element.labelTarget;
38144
- }
38145
-
38146
38146
  function copyWaypoints$1(element) {
38147
38147
  return map$2(element.waypoints, function(waypoint) {
38148
38148
 
@@ -38226,7 +38226,7 @@
38226
38226
 
38227
38227
  // do not copy business object + di for labels;
38228
38228
  // will be pulled from the referenced label target
38229
- if (isLabel$6(element)) {
38229
+ if (isLabel$1(element)) {
38230
38230
  return descriptor;
38231
38231
  }
38232
38232
 
@@ -38294,7 +38294,7 @@
38294
38294
  di = descriptor.di;
38295
38295
 
38296
38296
  // wire existing di + businessObject for external label
38297
- if (isLabel$6(descriptor)) {
38297
+ if (isLabel$1(descriptor)) {
38298
38298
  descriptor.businessObject = getBusinessObject$1(cache[ descriptor.labelTarget ]);
38299
38299
  descriptor.di = getDi(cache[ descriptor.labelTarget ]);
38300
38300
 
@@ -44375,7 +44375,7 @@
44375
44375
  ResizeHandles.prototype.addResizer = function(element) {
44376
44376
  var self = this;
44377
44377
 
44378
- if (isConnection$b(element) || !this._resize.canResize({ shape: element })) {
44378
+ if (isConnection$1(element) || !this._resize.canResize({ shape: element })) {
44379
44379
  return;
44380
44380
  }
44381
44381
 
@@ -44427,10 +44427,6 @@
44427
44427
  return offset;
44428
44428
  }
44429
44429
 
44430
- function isConnection$b(element) {
44431
- return !!element.waypoints;
44432
- }
44433
-
44434
44430
  /**
44435
44431
  * @type { import('didi').ModuleDeclaration }
44436
44432
  */
@@ -44790,7 +44786,7 @@
44790
44786
  // external label not yet created
44791
44787
  if (isLabelExternal(target)
44792
44788
  && !hasExternalLabel(target)
44793
- && !isLabel$6(target)) {
44789
+ && !isLabel$1(target)) {
44794
44790
 
44795
44791
  var externalLabelMid = getExternalLabelMid(element);
44796
44792
 
@@ -45467,7 +45463,7 @@
45467
45463
  }
45468
45464
 
45469
45465
  function shouldReplace$1(shape, host) {
45470
- return !isLabel$6(shape) &&
45466
+ return !isLabel$1(shape) &&
45471
45467
  isAny(shape, [ 'bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent' ]) && !!host;
45472
45468
  }
45473
45469
 
@@ -45644,8 +45640,8 @@
45644
45640
  // ignore connections, groups and labels
45645
45641
  var children = rootElement.children.filter(function(element) {
45646
45642
  return !is$5(element, 'bpmn:Group') &&
45647
- !isLabel$6(element) &&
45648
- !isConnection$a(element);
45643
+ !isLabel$1(element) &&
45644
+ !isConnection$1(element);
45649
45645
  });
45650
45646
 
45651
45647
  // ensure for available children to calculate bounds
@@ -45816,10 +45812,6 @@
45816
45812
  };
45817
45813
  }
45818
45814
 
45819
- function isConnection$a(element) {
45820
- return !!element.waypoints;
45821
- }
45822
-
45823
45815
  function findParticipant(elements) {
45824
45816
  return find$1(elements, function(element) {
45825
45817
  return is$5(element, 'bpmn:Participant');
@@ -46424,7 +46416,7 @@
46424
46416
  }
46425
46417
 
46426
46418
  function shouldReplace(shape, host) {
46427
- return !isLabel$6(shape) && is$5(shape, 'bpmn:BoundaryEvent') && !host;
46419
+ return !isLabel$1(shape) && is$5(shape, 'bpmn:BoundaryEvent') && !host;
46428
46420
  }
46429
46421
 
46430
46422
  function includes$6(array, item) {
@@ -48131,7 +48123,7 @@
48131
48123
 
48132
48124
  var element = context.shape || context.connection;
48133
48125
 
48134
- if (isLabel$6(element) || !isLabelExternal(element)) {
48126
+ if (isLabel$1(element) || !isLabelExternal(element)) {
48135
48127
  return;
48136
48128
  }
48137
48129
 
@@ -50670,7 +50662,7 @@
50670
50662
  shape = context.shape,
50671
50663
  shapeBo = shape.businessObject;
50672
50664
 
50673
- if (isLabel$6(shape)) {
50665
+ if (isLabel$1(shape)) {
50674
50666
  return;
50675
50667
  }
50676
50668
 
@@ -51119,12 +51111,12 @@
51119
51111
  position = context.position,
51120
51112
  target = context.target;
51121
51113
 
51122
- if (isConnection$9(target) && !canInsert(elements, target)) {
51114
+ if (isConnection$1(target) && !canInsert(elements, target)) {
51123
51115
  return false;
51124
51116
  }
51125
51117
 
51126
51118
  return every(elements, function(element) {
51127
- if (isConnection$9(element)) {
51119
+ if (isConnection$1(element)) {
51128
51120
  return canConnect(element.source, element.target, element);
51129
51121
  }
51130
51122
 
@@ -51233,7 +51225,7 @@
51233
51225
  * @return {boolean}
51234
51226
  */
51235
51227
  function nonExistingOrLabel(element) {
51236
- return !element || isLabel$6(element);
51228
+ return !element || isLabel$1(element);
51237
51229
  }
51238
51230
 
51239
51231
  function isSame$1(a, b) {
@@ -51467,15 +51459,6 @@
51467
51459
  );
51468
51460
  }
51469
51461
 
51470
- /**
51471
- * @param {Element} element
51472
- *
51473
- * @return {boolean}
51474
- */
51475
- function isConnection$9(element) {
51476
- return element.waypoints;
51477
- }
51478
-
51479
51462
  /**
51480
51463
  * @param {Element} element
51481
51464
  *
@@ -51566,7 +51549,7 @@
51566
51549
  function canDrop(element, target) {
51567
51550
 
51568
51551
  // can move labels and groups everywhere
51569
- if (isLabel$6(element) || isGroup(element)) {
51552
+ if (isLabel$1(element) || isGroup(element)) {
51570
51553
  return true;
51571
51554
  }
51572
51555
 
@@ -51656,7 +51639,7 @@
51656
51639
  * @return {boolean}
51657
51640
  */
51658
51641
  function isBoundaryEvent(element) {
51659
- return !isLabel$6(element) && is$5(element, 'bpmn:BoundaryEvent');
51642
+ return !isLabel$1(element) && is$5(element, 'bpmn:BoundaryEvent');
51660
51643
  }
51661
51644
 
51662
51645
  /**
@@ -51765,7 +51748,7 @@
51765
51748
  var element = elements[0];
51766
51749
 
51767
51750
  // do not attach labels
51768
- if (isLabel$6(element)) {
51751
+ if (isLabel$1(element)) {
51769
51752
  return false;
51770
51753
  }
51771
51754
 
@@ -51937,7 +51920,7 @@
51937
51920
  return false;
51938
51921
  }
51939
51922
 
51940
- if (isLabel$6(shape) || isGroup(shape)) {
51923
+ if (isLabel$1(shape) || isGroup(shape)) {
51941
51924
  return true;
51942
51925
  }
51943
51926
 
@@ -52118,7 +52101,7 @@
52118
52101
  // return true if shape can be inserted into connection parent
52119
52102
  return (
52120
52103
  isAny(connection, [ 'bpmn:SequenceFlow', 'bpmn:MessageFlow' ]) &&
52121
- !isLabel$6(connection) &&
52104
+ !isLabel$1(connection) &&
52122
52105
  is$5(shape, 'bpmn:FlowNode') &&
52123
52106
  !is$5(shape, 'bpmn:BoundaryEvent') &&
52124
52107
  canDrop(shape, connection.parent));
@@ -52141,7 +52124,7 @@
52141
52124
  * @return {boolean}
52142
52125
  */
52143
52126
  function canCopy(elements, element) {
52144
- if (isLabel$6(element)) {
52127
+ if (isLabel$1(element)) {
52145
52128
  return true;
52146
52129
  }
52147
52130
 
@@ -53049,12 +53032,12 @@
53049
53032
  }
53050
53033
 
53051
53034
  forEach$1(elements, function(element) {
53052
- if (!element.parent || isLabel$3(element)) {
53035
+ if (!element.parent || isLabel$1(element)) {
53053
53036
  return;
53054
53037
  }
53055
53038
 
53056
53039
  // handle connections separately
53057
- if (isConnection$8(element)) {
53040
+ if (isConnection$1(element)) {
53058
53041
  connections.push(element);
53059
53042
 
53060
53043
  return;
@@ -53225,15 +53208,15 @@
53225
53208
 
53226
53209
  // find children that are not moving or resizing
53227
53210
  var nonMovingResizingChildren = filter(children, function(child) {
53228
- return !isConnection$8(child) &&
53229
- !isLabel$3(child) &&
53211
+ return !isConnection$1(child) &&
53212
+ !isLabel$1(child) &&
53230
53213
  !includes$3(movingShapes, child) &&
53231
53214
  !includes$3(resizingShapes, child);
53232
53215
  });
53233
53216
 
53234
53217
  // find children that are moving
53235
53218
  var movingChildren = filter(children, function(child) {
53236
- return !isConnection$8(child) && !isLabel$3(child) && includes$3(movingShapes, child);
53219
+ return !isConnection$1(child) && !isLabel$1(child) && includes$3(movingShapes, child);
53237
53220
  });
53238
53221
 
53239
53222
  var minOrMax,
@@ -53367,14 +53350,6 @@
53367
53350
  return !!element.host;
53368
53351
  }
53369
53352
 
53370
- function isConnection$8(element) {
53371
- return !!element.waypoints;
53372
- }
53373
-
53374
- function isLabel$3(element) {
53375
- return !!element.labelTarget;
53376
- }
53377
-
53378
53353
  var MARKER_DRAGGING$1 = 'djs-dragging',
53379
53354
  MARKER_RESIZING = 'djs-resizing';
53380
53355
 
@@ -53533,7 +53508,7 @@
53533
53508
  });
53534
53509
  });
53535
53510
 
53536
- return isConnection$7(element)
53511
+ return isConnection$1(element)
53537
53512
  && (sourceIsMoving || sourceIsResizing)
53538
53513
  && (targetIsMoving || targetIsResizing);
53539
53514
  });
@@ -53663,16 +53638,6 @@
53663
53638
  'previewSupport'
53664
53639
  ];
53665
53640
 
53666
-
53667
- // helpers //////////////////////
53668
-
53669
- /**
53670
- * Checks if an element is a connection.
53671
- */
53672
- function isConnection$7(element) {
53673
- return element.waypoints;
53674
- }
53675
-
53676
53641
  /**
53677
53642
  * @type { import('didi').ModuleDeclaration }
53678
53643
  */
@@ -55712,7 +55677,7 @@
55712
55677
  BpmnUpdater.prototype.updateParent = function(element, oldParent) {
55713
55678
 
55714
55679
  // do not update BPMN 2.0 label parent
55715
- if (isLabel$6(element)) {
55680
+ if (isLabel$1(element)) {
55716
55681
  return;
55717
55682
  }
55718
55683
 
@@ -55777,7 +55742,7 @@
55777
55742
  });
55778
55743
  }
55779
55744
 
55780
- var target = isLabel$6(shape) ? this._getLabel(di) : di;
55745
+ var target = isLabel$1(shape) ? this._getLabel(di) : di;
55781
55746
 
55782
55747
  var bounds = target.bounds;
55783
55748
 
@@ -56838,7 +56803,7 @@
56838
56803
 
56839
56804
  // center elements around position
56840
56805
  forEach$1(elements, function(element) {
56841
- if (isConnection$6(element)) {
56806
+ if (isConnection$1(element)) {
56842
56807
  element.waypoints = map$2(element.waypoints, function(waypoint) {
56843
56808
  return {
56844
56809
  x: round$3(waypoint.x - bbox.x - bbox.width / 2 + position.x),
@@ -56858,7 +56823,7 @@
56858
56823
  var cache = {};
56859
56824
 
56860
56825
  forEach$1(elements, function(element) {
56861
- if (isConnection$6(element)) {
56826
+ if (isConnection$1(element)) {
56862
56827
  cache[ element.id ] = isNumber(parentIndex) ?
56863
56828
  modeling.createConnection(
56864
56829
  cache[ element.source.id ],
@@ -56885,6 +56850,10 @@
56885
56850
  createShapeHints.autoResize = false;
56886
56851
  }
56887
56852
 
56853
+ if (isLabel$1(element)) {
56854
+ createShapeHints = omit(createShapeHints, [ 'attach' ]);
56855
+ }
56856
+
56888
56857
  cache[ element.id ] = isNumber(parentIndex) ?
56889
56858
  modeling.createShape(
56890
56859
  element,
@@ -56902,13 +56871,7 @@
56902
56871
  });
56903
56872
 
56904
56873
  context.elements = values(cache);
56905
- };
56906
-
56907
- // helpers //////////
56908
-
56909
- function isConnection$6(element) {
56910
- return !!element.waypoints;
56911
- }
56874
+ };
56912
56875
 
56913
56876
  /**
56914
56877
  * @typedef {import('../../../model/Types').Element} Element
@@ -57231,7 +57194,7 @@
57231
57194
 
57232
57195
  // remove child shapes and connections
57233
57196
  saveClear(shape.children, function(child) {
57234
- if (isConnection$5(child)) {
57197
+ if (isConnection$1(child)) {
57235
57198
  modeling.removeConnection(child, { nested: true });
57236
57199
  } else {
57237
57200
  modeling.removeShape(child, { nested: true });
@@ -57279,10 +57242,6 @@
57279
57242
  return shape;
57280
57243
  };
57281
57244
 
57282
- function isConnection$5(element) {
57283
- return element.waypoints;
57284
- }
57285
-
57286
57245
  /**
57287
57246
  * @typedef {import('../Modeling').default} Modeling
57288
57247
  */
@@ -60413,13 +60372,13 @@
60413
60372
  }
60414
60373
 
60415
60374
  forEach$1(elements, function(element) {
60416
- var assignedDi = isConnection$4(element) ? pick(di, [ 'border-color' ]) : di,
60375
+ var assignedDi = isConnection$1(element) ? pick(di, [ 'border-color' ]) : di,
60417
60376
  elementDi = getDi(element);
60418
60377
 
60419
60378
  // TODO @barmac: remove once we drop bpmn.io properties
60420
60379
  ensureLegacySupport(assignedDi);
60421
60380
 
60422
- if (isLabel$6(element)) {
60381
+ if (isLabel$1(element)) {
60423
60382
 
60424
60383
  // set label colors as bpmndi:BPMNLabel#color
60425
60384
  self._commandStack.execute('element.updateModdleProperties', {
@@ -60479,10 +60438,6 @@
60479
60438
  return /^#[0-9a-fA-F]{6}$/.test(context.fillStyle) ? context.fillStyle : null;
60480
60439
  }
60481
60440
 
60482
- function isConnection$4(element) {
60483
- return !!element.waypoints;
60484
- }
60485
-
60486
60441
  /**
60487
60442
  * Add legacy properties if required.
60488
60443
  *
@@ -60545,7 +60500,7 @@
60545
60500
  businessObject = element.businessObject,
60546
60501
  newLabel = ctx.newLabel;
60547
60502
 
60548
- if (!isLabel$6(element)
60503
+ if (!isLabel$1(element)
60549
60504
  && isLabelExternal(element)
60550
60505
  && !hasExternalLabel(element)
60551
60506
  && !isEmptyText(newLabel)) {
@@ -60585,11 +60540,11 @@
60585
60540
  hints = ctx.hints || {};
60586
60541
 
60587
60542
  // ignore internal labels for elements except text annotations
60588
- if (!isLabel$6(label) && !is$5(label, 'bpmn:TextAnnotation')) {
60543
+ if (!isLabel$1(label) && !is$5(label, 'bpmn:TextAnnotation')) {
60589
60544
  return;
60590
60545
  }
60591
60546
 
60592
- if (isLabel$6(label) && isEmptyText(newLabel)) {
60547
+ if (isLabel$1(label) && isEmptyText(newLabel)) {
60593
60548
 
60594
60549
  if (hints.removeShape !== false) {
60595
60550
  modeling.removeShape(label, { unsetLabel: false });
@@ -62698,7 +62653,7 @@
62698
62653
 
62699
62654
  var filteredElements = filter(elements, function(element) {
62700
62655
 
62701
- if (!isConnection$3(element)) {
62656
+ if (!isConnection$1(element)) {
62702
62657
  return true;
62703
62658
  } else {
62704
62659
 
@@ -62716,13 +62671,6 @@
62716
62671
  return size(groupBy(elements, function(e) { return e.parent && e.parent.id; })) !== 1;
62717
62672
  }
62718
62673
 
62719
- /**
62720
- * Checks if an element is a connection.
62721
- */
62722
- function isConnection$3(element) {
62723
- return element.waypoints;
62724
- }
62725
-
62726
62674
  /**
62727
62675
  * @type { import('didi').ModuleDeclaration }
62728
62676
  */
@@ -64779,7 +64727,7 @@
64779
64727
  });
64780
64728
 
64781
64729
  // snap labels to mid only
64782
- if (isLabel$2(shape)) {
64730
+ if (isLabel$1(shape)) {
64783
64731
  return snapContext;
64784
64732
  }
64785
64733
 
@@ -64802,9 +64750,9 @@
64802
64750
  forEach$1(snapTargets, function(snapTarget) {
64803
64751
 
64804
64752
  // handle labels
64805
- if (isLabel$2(snapTarget)) {
64753
+ if (isLabel$1(snapTarget)) {
64806
64754
 
64807
- if (isLabel$2(shape)) {
64755
+ if (isLabel$1(shape)) {
64808
64756
  snapPoints.add('mid', mid$2(snapTarget));
64809
64757
  }
64810
64758
 
@@ -64812,7 +64760,7 @@
64812
64760
  }
64813
64761
 
64814
64762
  // handle connections
64815
- if (isConnection$2(snapTarget)) {
64763
+ if (isConnection$1(snapTarget)) {
64816
64764
 
64817
64765
  // ignore single segment connections
64818
64766
  if (snapTarget.waypoints.length < 3) {
@@ -64853,16 +64801,8 @@
64853
64801
 
64854
64802
  // helpers //////////
64855
64803
 
64856
- function isConnection$2(element) {
64857
- return !!element.waypoints;
64858
- }
64859
-
64860
64804
  function isHidden$1(element) {
64861
64805
  return !!element.hidden;
64862
- }
64863
-
64864
- function isLabel$2(element) {
64865
- return !!element.labelTarget;
64866
64806
  }
64867
64807
 
64868
64808
  /**
@@ -65271,18 +65211,10 @@
65271
65211
  return element.host === host;
65272
65212
  }
65273
65213
 
65274
- function isConnection$1(element) {
65275
- return !!element.waypoints;
65276
- }
65277
-
65278
65214
  function isHidden(element) {
65279
65215
  return !!element.hidden;
65280
65216
  }
65281
65217
 
65282
- function isLabel$1(element) {
65283
- return !!element.labelTarget;
65284
- }
65285
-
65286
65218
  function isHorizontal(direction) {
65287
65219
  return direction === 'n' || direction === 's';
65288
65220
  }
@@ -99872,7 +99804,7 @@
99872
99804
  eventBus.fire('propertiesPanel.layoutChanged', {
99873
99805
  layout: newLayout
99874
99806
  });
99875
- }, [eventBus, layoutConfig]);
99807
+ }, [eventBus]);
99876
99808
 
99877
99809
  // React to external layout changes
99878
99810
  y(() => {
@@ -100199,17 +100131,17 @@
100199
100131
  function getLinkEventDefinition(element) {
100200
100132
  return getEventDefinition$1(element, 'bpmn:LinkEventDefinition');
100201
100133
  }
100202
- function getSignalEventDefinition(element) {
100134
+ function getSignalEventDefinition$1(element) {
100203
100135
  return getEventDefinition$1(element, 'bpmn:SignalEventDefinition');
100204
100136
  }
100205
100137
  function isLinkSupported(element) {
100206
100138
  return isAny(element, ['bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent']) && !!getLinkEventDefinition(element);
100207
100139
  }
100208
- function isSignalSupported(element) {
100209
- return is$5(element, 'bpmn:Event') && !!getSignalEventDefinition(element);
100140
+ function isSignalSupported$1(element) {
100141
+ return is$5(element, 'bpmn:Event') && !!getSignalEventDefinition$1(element);
100210
100142
  }
100211
- function getSignal(element) {
100212
- const signalEventDefinition = getSignalEventDefinition(element);
100143
+ function getSignal$1(element) {
100144
+ const signalEventDefinition = getSignalEventDefinition$1(element);
100213
100145
  return signalEventDefinition && signalEventDefinition.get('signalRef');
100214
100146
  }
100215
100147
  function getEscalationEventDefinition(element) {
@@ -101762,24 +101694,24 @@
101762
101694
  return is$5(element, 'bpmn:Participant') && element.businessObject.get('processRef');
101763
101695
  }
101764
101696
 
101765
- const EMPTY_OPTION$3 = '';
101766
- const CREATE_NEW_OPTION$2 = 'create-new';
101767
-
101768
101697
  /**
101769
101698
  * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
101770
101699
  */
101771
101700
 
101701
+ const EMPTY_OPTION$3 = '';
101702
+ const CREATE_NEW_OPTION$2 = 'create-new';
101703
+
101772
101704
  /**
101773
- * @returns {Array<Entry>} entries
101705
+ * @returns {Entry[]}
101774
101706
  */
101775
- function SignalProps(props) {
101707
+ function SignalProps$1(props) {
101776
101708
  const {
101777
101709
  element
101778
101710
  } = props;
101779
- if (!isSignalSupported(element)) {
101711
+ if (!isSignalSupported$1(element)) {
101780
101712
  return [];
101781
101713
  }
101782
- const signal = getSignal(element);
101714
+ const signal = getSignal$1(element);
101783
101715
  let entries = [{
101784
101716
  id: 'signalRef',
101785
101717
  component: SignalRef,
@@ -101788,7 +101720,7 @@
101788
101720
  if (signal) {
101789
101721
  entries = [...entries, {
101790
101722
  id: 'signalName',
101791
- component: SignalName,
101723
+ component: SignalName$1,
101792
101724
  isEdited: isEdited$1
101793
101725
  }];
101794
101726
  }
@@ -101801,9 +101733,9 @@
101801
101733
  const bpmnFactory = useService('bpmnFactory');
101802
101734
  const commandStack = useService('commandStack');
101803
101735
  const translate = useService('translate');
101804
- const signalEventDefinition = getSignalEventDefinition(element);
101736
+ const signalEventDefinition = getSignalEventDefinition$1(element);
101805
101737
  const getValue = () => {
101806
- const signal = getSignal(element);
101738
+ const signal = getSignal$1(element);
101807
101739
  if (signal) {
101808
101740
  return signal.get('id');
101809
101741
  }
@@ -101877,14 +101809,14 @@
101877
101809
  getOptions
101878
101810
  });
101879
101811
  }
101880
- function SignalName(props) {
101812
+ function SignalName$1(props) {
101881
101813
  const {
101882
101814
  element
101883
101815
  } = props;
101884
101816
  const commandStack = useService('commandStack');
101885
101817
  const translate = useService('translate');
101886
101818
  const debounce = useService('debounceInput');
101887
- const signal = getSignal(element);
101819
+ const signal = getSignal$1(element);
101888
101820
  const getValue = () => {
101889
101821
  return signal.get('name');
101890
101822
  };
@@ -102262,7 +102194,7 @@
102262
102194
  id: 'signal',
102263
102195
  label: translate('Signal'),
102264
102196
  component: Group,
102265
- entries: [...SignalProps({
102197
+ entries: [...SignalProps$1({
102266
102198
  element
102267
102199
  })]
102268
102200
  };
@@ -103338,7 +103270,11 @@
103338
103270
  }
103339
103271
 
103340
103272
  function unlinkTemplate$1(element, injector) {
103341
- const modeling = injector.get('modeling');
103273
+ const modeling = injector.get('modeling'),
103274
+ eventBus = injector.get('eventBus');
103275
+ eventBus.fire('elementTemplates.unlink', {
103276
+ element
103277
+ });
103342
103278
  modeling.updateProperties(element, {
103343
103279
  'camunda:modelerTemplate': null,
103344
103280
  'camunda:modelerTemplateVersion': null
@@ -103346,7 +103282,11 @@
103346
103282
  }
103347
103283
 
103348
103284
  function unlinkTemplate(element, injector) {
103349
- const modeling = injector.get('modeling');
103285
+ const modeling = injector.get('modeling'),
103286
+ eventBus = injector.get('eventBus');
103287
+ eventBus.fire('elementTemplates.unlink', {
103288
+ element
103289
+ });
103350
103290
 
103351
103291
  // remove template attributes
103352
103292
  modeling.updateProperties(element, {
@@ -103731,7 +103671,7 @@
103731
103671
  }
103732
103672
 
103733
103673
  /**
103734
- * Remove referenced element when template is unlinked.
103674
+ * Unlink referenced element when template is unlinked.
103735
103675
  */
103736
103676
  _handlePropertiesUpdate(context) {
103737
103677
  const {
@@ -103747,11 +103687,9 @@
103747
103687
  const bo = getBusinessObject$1(element);
103748
103688
  const message = findMessage(bo);
103749
103689
  if (message && getTemplateId$1(message)) {
103750
- const messageEventDefinition = bo.eventDefinitions[0];
103751
- this._modeling.updateModdleProperties(element, messageEventDefinition, {
103752
- 'messageRef': undefined
103690
+ this._modeling.updateModdleProperties(element, message, {
103691
+ [TEMPLATE_ID_ATTR$1]: null
103753
103692
  });
103754
- this._removeRootElement(message);
103755
103693
  }
103756
103694
  }
103757
103695