camunda-bpmn-js 2.4.0 → 2.6.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
  }
@@ -67812,6 +67744,10 @@
67812
67744
 
67813
67745
  var t$1,u,r,o$2=0,i$2=[],c=n$1.__b,f=n$1.__r,e$1=n$1.diffed,a$1=n$1.__c,v=n$1.unmount;function m(t,r){n$1.__h&&n$1.__h(u,t,o$2||r),o$2=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function l$1(n){return o$2=1,p$1(w$1,n)}function p$1(n,r,o){var i=m(t$1++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$1(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=m(t$1++,3);!n$1.__s&&k$1(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function h(r,o){var i=m(t$1++,4);!n$1.__s&&k$1(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function s(n){return o$2=5,d(function(){return {current:n}},[])}function _(n,t,u){o$2=6,h(function(){"function"==typeof n?n(t()):n&&(n.current=t());},null==u?u:u.concat(n));}function d(n,u){var r=m(t$1++,7);return k$1(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$1(n,t){return o$2=8,d(function(){return n},t)}function F$1(n){var r=u.context[n.__c],o=m(t$1++,9);return o.__c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function T$1(t,u){n$1.useDebugValue&&n$1.useDebugValue(u?u(t):t);}function x$1(){i$2.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g$1),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],n$1.__e(u,t.__v);}}),i$2=[];}n$1.__b=function(n){u=null,c&&c(n);},n$1.__r=function(n){f&&f(n),t$1=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g$1),r.__h.forEach(j$1),r.__h=[]);},n$1.diffed=function(t){e$1&&e$1(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i$2.push(o)&&r===n$1.requestAnimationFrame||((r=n$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1)),u=void 0;},n$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$1),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],n$1.__e(r,t.__v);}}),a$1&&a$1(t,u);},n$1.unmount=function(t){v&&v(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g$1);}catch(t){n$1.__e(t,u.__v);}};var b="function"==typeof requestAnimationFrame;function g$1(n){var t=u;"function"==typeof n.__c&&n.__c(),u=t;}function j$1(n){var t=u;n.__c=n.__(),u=t;}function k$1(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$1(n,t){return "function"==typeof t?t(n):t}
67814
67746
 
67747
+ function C$1(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S(this.props,n)}function r(t){return this.shouldComponentUpdate=e,a$2(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new p$2).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=n$1.__b;n$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x(n){function t(t,e){var r=C$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var N=function(n,t){return null==n?null:w$2(w$2(n).map(t))},k={map:N,forEach:N,count:function(n){return n?w$2(n).length:0},only:function(n){var t=w$2(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:w$2},A=n$1.__e;n$1.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A(n,t,e);};var O=n$1.unmount;function L(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return a$2(e,u)}return u.displayName="Lazy",u.__f=!0,u}function F(){this.u=null,this.o=null;}n$1.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O&&O(n);},(L.prototype=new p$2).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L.prototype.componentWillUnmount=function(){this.t=[];},L.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C$1({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a$2(y$1,null,n.fallback);return u&&(u.__h=null),[a$2(y$1,null,t.__e?null:n.children),u]};var M=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function T(n){return this.getChildContext=function(){return n.context},n.children}function j(n){var t=this,e=n.i;t.componentWillUnmount=function(){N$1(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),N$1(a$2(T,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function I(n,t){return a$2(j,{__v:n,i:t})}(F.prototype=new p$2).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M(t,n,r)):u();};e?e(o):o();}},F.prototype.render=function(n){this.u=null,this.o=new Map;var t=w$2(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F.prototype.componentDidUpdate=F.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function z(n,t,e){return null==t.__k&&(t.textContent=""),N$1(n,t),"function"==typeof e&&e(),n?n.__c:null}function B(n,t,e){return O$1(n,t),"function"==typeof e&&e(),n?n.__c:null}p$2.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p$2.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H=n$1.event;function Z(){}function Y(){return this.cancelBubble}function $(){return this.defaultPrevented}n$1.event=function(n){return H&&(n=H(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$,n.nativeEvent=n};var q,G={configurable:!0,get:function(){return this.class}},J=n$1.vnode;n$1.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w$2(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w$2(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n$1.__r;n$1.__r=function(n){K&&K(n),q=n.__c;};var Q={ReactCurrentDispatcher:{current:{readContext:function(n){return q.__n[n.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()};function fn(n){return a$2.bind(null,n)}function cn(n){return !!n&&n.$$typeof===W}function an(n){return cn(n)?S$1.apply(null,arguments):n}function sn(n){return !!n.__k&&(N$1(null,n),!0)}function hn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)};var React = {useState:l$1,useReducer:p$1,useEffect:y,useLayoutEffect:h,useRef:s,useImperativeHandle:_,useMemo:d,useCallback:A$1,useContext:F$1,useDebugValue:T$1,version:"16.8.0",Children:k,render:z,hydrate:B,unmountComponentAtNode:sn,createPortal:I,createElement:a$2,createContext:q$1,createFactory:fn,cloneElement:an,createRef:h$1,Fragment:y$1,isValidElement:cn,findDOMNode:hn,Component:p$2,PureComponent:E,memo:g,forwardRef:x,unstable_batchedUpdates:pn,StrictMode:y$1,Suspense:L,SuspenseList:F,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Q};
67748
+
67749
+ function o$1(_,o,e,n,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++n$1.__v,__source:n,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return n$1.vnode&&n$1.vnode(a),a}
67750
+
67815
67751
  var classnames$1 = {exports: {}};
67816
67752
 
67817
67753
  /*!
@@ -67873,10 +67809,6 @@
67873
67809
  var classnamesExports = classnames$1.exports;
67874
67810
  var classnames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
67875
67811
 
67876
- function C$1(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S(this.props,n)}function r(t){return this.shouldComponentUpdate=e,a$2(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new p$2).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=n$1.__b;n$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x(n){function t(t,e){var r=C$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var N=function(n,t){return null==n?null:w$2(w$2(n).map(t))},k={map:N,forEach:N,count:function(n){return n?w$2(n).length:0},only:function(n){var t=w$2(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:w$2},A=n$1.__e;n$1.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A(n,t,e);};var O=n$1.unmount;function L(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return a$2(e,u)}return u.displayName="Lazy",u.__f=!0,u}function F(){this.u=null,this.o=null;}n$1.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O&&O(n);},(L.prototype=new p$2).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L.prototype.componentWillUnmount=function(){this.t=[];},L.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C$1({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a$2(y$1,null,n.fallback);return u&&(u.__h=null),[a$2(y$1,null,t.__e?null:n.children),u]};var M=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function T(n){return this.getChildContext=function(){return n.context},n.children}function j(n){var t=this,e=n.i;t.componentWillUnmount=function(){N$1(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),N$1(a$2(T,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function I(n,t){return a$2(j,{__v:n,i:t})}(F.prototype=new p$2).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M(t,n,r)):u();};e?e(o):o();}},F.prototype.render=function(n){this.u=null,this.o=new Map;var t=w$2(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F.prototype.componentDidUpdate=F.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function z(n,t,e){return null==t.__k&&(t.textContent=""),N$1(n,t),"function"==typeof e&&e(),n?n.__c:null}function B(n,t,e){return O$1(n,t),"function"==typeof e&&e(),n?n.__c:null}p$2.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p$2.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H=n$1.event;function Z(){}function Y(){return this.cancelBubble}function $(){return this.defaultPrevented}n$1.event=function(n){return H&&(n=H(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$,n.nativeEvent=n};var q,G={configurable:!0,get:function(){return this.class}},J=n$1.vnode;n$1.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w$2(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w$2(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n$1.__r;n$1.__r=function(n){K&&K(n),q=n.__c;};var Q={ReactCurrentDispatcher:{current:{readContext:function(n){return q.__n[n.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()};function fn(n){return a$2.bind(null,n)}function cn(n){return !!n&&n.$$typeof===W}function an(n){return cn(n)?S$1.apply(null,arguments):n}function sn(n){return !!n.__k&&(N$1(null,n),!0)}function hn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)};var React = {useState:l$1,useReducer:p$1,useEffect:y,useLayoutEffect:h,useRef:s,useImperativeHandle:_,useMemo:d,useCallback:A$1,useContext:F$1,useDebugValue:T$1,version:"16.8.0",Children:k,render:z,hydrate:B,unmountComponentAtNode:sn,createPortal:I,createElement:a$2,createContext:q$1,createFactory:fn,cloneElement:an,createRef:h$1,Fragment:y$1,isValidElement:cn,findDOMNode:hn,Component:p$2,PureComponent:E,memo:g,forwardRef:x,unstable_batchedUpdates:pn,StrictMode:y$1,Suspense:L,SuspenseList:F,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Q};
67877
-
67878
- function o$1(_,o,e,n,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++n$1.__v,__source:n,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return n$1.vnode&&n$1.vnode(a),a}
67879
-
67880
67812
  // FIXME profile adding a per-Tree TreeNode cache, validating it by
67881
67813
  // parent pointer
67882
67814
  /// The default maximum length of a `TreeBuffer` node.
@@ -95470,6 +95402,18 @@
95470
95402
  * @param {setSticky} setSticky
95471
95403
  */
95472
95404
  function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {
95405
+ const [scrollContainer, setScrollContainer] = l$1(query(scrollContainerSelector));
95406
+ const updateScrollContainer = A$1(() => {
95407
+ const newScrollContainer = query(scrollContainerSelector);
95408
+ if (newScrollContainer !== scrollContainer) {
95409
+ setScrollContainer(newScrollContainer);
95410
+ }
95411
+ }, [scrollContainerSelector, scrollContainer]);
95412
+ y(() => {
95413
+ updateScrollContainer();
95414
+ }, [updateScrollContainer]);
95415
+ useEvent('propertiesPanel.attach', updateScrollContainer);
95416
+ useEvent('propertiesPanel.detach', updateScrollContainer);
95473
95417
  y(() => {
95474
95418
  const Observer = IntersectionObserver;
95475
95419
 
@@ -95477,37 +95421,36 @@
95477
95421
  if (!Observer) {
95478
95422
  return;
95479
95423
  }
95480
- let observer;
95481
- if (ref.current) {
95482
- const scrollContainer = query(scrollContainerSelector);
95483
- observer = new Observer(entries => {
95484
- // The ScrollContainer is unmounted, do not update sticky state
95485
- if (scrollContainer.scrollHeight === 0) {
95486
- return;
95424
+
95425
+ // TODO(@barmac): test this
95426
+ if (!ref.current || !scrollContainer) {
95427
+ return;
95428
+ }
95429
+ const observer = new Observer(entries => {
95430
+ // scroll container is unmounted, do not update sticky state
95431
+ if (scrollContainer.scrollHeight === 0) {
95432
+ return;
95433
+ }
95434
+ entries.forEach(entry => {
95435
+ if (entry.intersectionRatio < 1) {
95436
+ setSticky(true);
95437
+ } else if (entry.intersectionRatio === 1) {
95438
+ setSticky(false);
95487
95439
  }
95488
- entries.forEach(entry => {
95489
- if (entry.intersectionRatio < 1) {
95490
- setSticky(true);
95491
- } else if (entry.intersectionRatio === 1) {
95492
- setSticky(false);
95493
- }
95494
- });
95495
- }, {
95496
- root: scrollContainer,
95497
- rootMargin: '0px 0px 999999% 0px',
95498
- // Use bottom margin to avoid stickyness when scrolling out to bottom
95499
- threshold: [1]
95500
95440
  });
95501
- observer.observe(ref.current);
95502
- }
95441
+ }, {
95442
+ root: scrollContainer,
95443
+ rootMargin: '0px 0px 999999% 0px',
95444
+ // Use bottom margin to avoid stickyness when scrolling out to bottom
95445
+ threshold: [1]
95446
+ });
95447
+ observer.observe(ref.current);
95503
95448
 
95504
95449
  // Unobserve if unmounted
95505
95450
  return () => {
95506
- if (ref.current && observer) {
95507
- observer.unobserve(ref.current);
95508
- }
95451
+ observer.unobserve(ref.current);
95509
95452
  };
95510
- }, [ref, scrollContainerSelector, setSticky]);
95453
+ }, [ref.current, scrollContainer, setSticky]);
95511
95454
  }
95512
95455
 
95513
95456
  /**
@@ -95642,9 +95585,7 @@
95642
95585
  });
95643
95586
  }
95644
95587
 
95645
- const DEFAULT_LAYOUT = {
95646
- open: true
95647
- };
95588
+ const DEFAULT_LAYOUT = {};
95648
95589
  const DEFAULT_DESCRIPTION = {};
95649
95590
 
95650
95591
  /**
@@ -95808,7 +95749,7 @@
95808
95749
  children: o$1(EventContext.Provider, {
95809
95750
  value: eventContext,
95810
95751
  children: o$1("div", {
95811
- class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
95752
+ class: "bio-properties-panel",
95812
95753
  children: [o$1(Header, {
95813
95754
  element: element,
95814
95755
  headerProvider: headerProvider
@@ -96173,6 +96114,141 @@
96173
96114
  })
96174
96115
  });
96175
96116
  });
96117
+
96118
+ function ToggleSwitch(props) {
96119
+ const {
96120
+ id,
96121
+ label,
96122
+ onInput,
96123
+ value,
96124
+ switcherLabel,
96125
+ inline,
96126
+ onFocus,
96127
+ onBlur,
96128
+ inputRef
96129
+ } = props;
96130
+ const [localValue, setLocalValue] = l$1(value);
96131
+ const handleInputCallback = async () => {
96132
+ onInput(!value);
96133
+ };
96134
+ const handleInput = e => {
96135
+ handleInputCallback();
96136
+ setLocalValue(e.target.value);
96137
+ };
96138
+ y(() => {
96139
+ if (value === localValue) {
96140
+ return;
96141
+ }
96142
+ setLocalValue(value);
96143
+ }, [value]);
96144
+ return o$1("div", {
96145
+ class: classnames('bio-properties-panel-toggle-switch', {
96146
+ inline
96147
+ }),
96148
+ children: [o$1("label", {
96149
+ class: "bio-properties-panel-label",
96150
+ for: prefixId$6(id),
96151
+ children: label
96152
+ }), o$1("div", {
96153
+ class: "bio-properties-panel-field-wrapper",
96154
+ children: [o$1("label", {
96155
+ class: "bio-properties-panel-toggle-switch__switcher",
96156
+ children: [o$1("input", {
96157
+ ref: inputRef,
96158
+ id: prefixId$6(id),
96159
+ class: "bio-properties-panel-input",
96160
+ type: "checkbox",
96161
+ onFocus: onFocus,
96162
+ onBlur: onBlur,
96163
+ name: id,
96164
+ onInput: handleInput,
96165
+ checked: !!localValue
96166
+ }), o$1("span", {
96167
+ class: "bio-properties-panel-toggle-switch__slider"
96168
+ })]
96169
+ }), switcherLabel && o$1("p", {
96170
+ class: "bio-properties-panel-toggle-switch__label",
96171
+ children: switcherLabel
96172
+ })]
96173
+ })]
96174
+ });
96175
+ }
96176
+
96177
+ // helpers /////////////////
96178
+
96179
+ function prefixId$6(id) {
96180
+ return `bio-properties-panel-${id}`;
96181
+ }
96182
+
96183
+ function NumberField(props) {
96184
+ const {
96185
+ debounce,
96186
+ disabled,
96187
+ displayLabel = true,
96188
+ id,
96189
+ inputRef,
96190
+ label,
96191
+ max,
96192
+ min,
96193
+ onInput,
96194
+ step,
96195
+ value = '',
96196
+ onFocus,
96197
+ onBlur
96198
+ } = props;
96199
+ const [localValue, setLocalValue] = l$1(value);
96200
+ const handleInputCallback = d(() => {
96201
+ return debounce(event => {
96202
+ const {
96203
+ validity,
96204
+ value
96205
+ } = event.target;
96206
+ if (validity.valid) {
96207
+ onInput(value ? parseFloat(value) : undefined);
96208
+ }
96209
+ });
96210
+ }, [onInput, debounce]);
96211
+ const handleInput = e => {
96212
+ handleInputCallback(e);
96213
+ setLocalValue(e.target.value);
96214
+ };
96215
+ y(() => {
96216
+ if (value === localValue) {
96217
+ return;
96218
+ }
96219
+ setLocalValue(value);
96220
+ }, [value]);
96221
+ return o$1("div", {
96222
+ class: "bio-properties-panel-numberfield",
96223
+ children: [displayLabel && o$1("label", {
96224
+ for: prefixId$5(id),
96225
+ class: "bio-properties-panel-label",
96226
+ children: label
96227
+ }), o$1("input", {
96228
+ id: prefixId$5(id),
96229
+ ref: inputRef,
96230
+ type: "number",
96231
+ name: id,
96232
+ spellCheck: "false",
96233
+ autoComplete: "off",
96234
+ disabled: disabled,
96235
+ class: "bio-properties-panel-input",
96236
+ max: max,
96237
+ min: min,
96238
+ onInput: handleInput,
96239
+ onFocus: onFocus,
96240
+ onBlur: onBlur,
96241
+ step: step,
96242
+ value: localValue
96243
+ })]
96244
+ });
96245
+ }
96246
+
96247
+ // helpers /////////////////
96248
+
96249
+ function prefixId$5(id) {
96250
+ return `bio-properties-panel-${id}`;
96251
+ }
96176
96252
  x((props, ref) => {
96177
96253
  const {
96178
96254
  id,
@@ -96202,7 +96278,7 @@
96202
96278
  }
96203
96279
  };
96204
96280
  return o$1("input", {
96205
- id: prefixId$6(id),
96281
+ id: prefixId$4(id),
96206
96282
  type: "text",
96207
96283
  ref: inputRef,
96208
96284
  name: id,
@@ -96216,6 +96292,53 @@
96216
96292
  value: value || ''
96217
96293
  });
96218
96294
  });
96295
+ x((props, ref) => {
96296
+ const {
96297
+ id,
96298
+ debounce,
96299
+ disabled,
96300
+ onInput,
96301
+ value,
96302
+ min,
96303
+ max,
96304
+ step,
96305
+ onFocus,
96306
+ onBlur
96307
+ } = props;
96308
+ const inputRef = s();
96309
+
96310
+ // To be consistent with the FEEL editor, set focus at start of input
96311
+ // this ensures clean editing experience when switching with the keyboard
96312
+ ref.current = {
96313
+ focus: position => {
96314
+ const input = inputRef.current;
96315
+ if (!input) {
96316
+ return;
96317
+ }
96318
+ input.focus();
96319
+ if (typeof position === 'number' && position !== Infinity) {
96320
+ if (position > value.length) {
96321
+ position = value.length;
96322
+ }
96323
+ input.setSelectionRange(position, position);
96324
+ }
96325
+ }
96326
+ };
96327
+ return o$1(NumberField, {
96328
+ id: id,
96329
+ debounce: debounce,
96330
+ disabled: disabled,
96331
+ displayLabel: false,
96332
+ inputRef: inputRef,
96333
+ max: max,
96334
+ min: min,
96335
+ onInput: onInput,
96336
+ step: step,
96337
+ value: value,
96338
+ onFocus: onFocus,
96339
+ onBlur: onBlur
96340
+ });
96341
+ });
96219
96342
  x((props, ref) => {
96220
96343
  const {
96221
96344
  id,
@@ -96240,7 +96363,7 @@
96240
96363
  }
96241
96364
  };
96242
96365
  return o$1("textarea", {
96243
- id: prefixId$6(id),
96366
+ id: prefixId$4(id),
96244
96367
  type: "text",
96245
96368
  ref: inputRef,
96246
96369
  name: id,
@@ -96255,10 +96378,82 @@
96255
96378
  "data-gramm": "false"
96256
96379
  });
96257
96380
  });
96381
+ x((props, ref) => {
96382
+ const {
96383
+ id,
96384
+ onInput,
96385
+ value,
96386
+ onFocus,
96387
+ onBlur,
96388
+ switcherLabel
96389
+ } = props;
96390
+ const inputRef = s();
96391
+
96392
+ // To be consistent with the FEEL editor, set focus at start of input
96393
+ // this ensures clean editing experience when switching with the keyboard
96394
+ ref.current = {
96395
+ focus: () => {
96396
+ const input = inputRef.current;
96397
+ if (!input) {
96398
+ return;
96399
+ }
96400
+ input.focus();
96401
+ }
96402
+ };
96403
+ return o$1(ToggleSwitch, {
96404
+ id: id,
96405
+ value: value,
96406
+ inputRef: inputRef,
96407
+ onInput: onInput,
96408
+ onFocus: onFocus,
96409
+ onBlur: onBlur,
96410
+ switcherLabel: switcherLabel
96411
+ });
96412
+ });
96413
+ x((props, ref) => {
96414
+ const {
96415
+ id,
96416
+ disabled,
96417
+ onInput,
96418
+ value,
96419
+ onFocus,
96420
+ onBlur
96421
+ } = props;
96422
+ const inputRef = s();
96423
+ const handleChange = ({
96424
+ target
96425
+ }) => {
96426
+ onInput(target.checked);
96427
+ };
96428
+
96429
+ // To be consistent with the FEEL editor, set focus at start of input
96430
+ // this ensures clean editing experience when switching with the keyboard
96431
+ ref.current = {
96432
+ focus: () => {
96433
+ const input = inputRef.current;
96434
+ if (!input) {
96435
+ return;
96436
+ }
96437
+ input.focus();
96438
+ }
96439
+ };
96440
+ return o$1("input", {
96441
+ ref: inputRef,
96442
+ id: prefixId$4(id),
96443
+ name: id,
96444
+ onFocus: onFocus,
96445
+ onBlur: onBlur,
96446
+ type: "checkbox",
96447
+ class: "bio-properties-panel-input",
96448
+ onChange: handleChange,
96449
+ checked: value,
96450
+ disabled: disabled
96451
+ });
96452
+ });
96258
96453
 
96259
96454
  // helpers /////////////////
96260
96455
 
96261
- function prefixId$6(id) {
96456
+ function prefixId$4(id) {
96262
96457
  return `bio-properties-panel-${id}`;
96263
96458
  }
96264
96459
 
@@ -96293,12 +96488,12 @@
96293
96488
  return o$1("div", {
96294
96489
  class: "bio-properties-panel-select",
96295
96490
  children: [o$1("label", {
96296
- for: prefixId$4(id),
96491
+ for: prefixId$3(id),
96297
96492
  class: "bio-properties-panel-label",
96298
96493
  children: label
96299
96494
  }), o$1("select", {
96300
96495
  ref: ref,
96301
- id: prefixId$4(id),
96496
+ id: prefixId$3(id),
96302
96497
  name: id,
96303
96498
  class: "bio-properties-panel-input",
96304
96499
  onInput: handleChange,
@@ -96405,13 +96600,13 @@
96405
96600
  })]
96406
96601
  });
96407
96602
  }
96408
- function isEdited$4(node) {
96603
+ function isEdited$3(node) {
96409
96604
  return node && !!node.value;
96410
96605
  }
96411
96606
 
96412
96607
  // helpers /////////////////
96413
96608
 
96414
- function prefixId$4(id) {
96609
+ function prefixId$3(id) {
96415
96610
  return `bio-properties-panel-${id}`;
96416
96611
  }
96417
96612
 
@@ -96460,12 +96655,12 @@
96460
96655
  return o$1("div", {
96461
96656
  class: "bio-properties-panel-textarea",
96462
96657
  children: [o$1("label", {
96463
- for: prefixId$2(id),
96658
+ for: prefixId$1(id),
96464
96659
  class: "bio-properties-panel-label",
96465
96660
  children: label
96466
96661
  }), o$1("textarea", {
96467
96662
  ref: ref,
96468
- id: prefixId$2(id),
96663
+ id: prefixId$1(id),
96469
96664
  name: id,
96470
96665
  spellCheck: "false",
96471
96666
  class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : '', autoResize ? 'auto-resize' : ''),
@@ -96565,13 +96760,13 @@
96565
96760
  })]
96566
96761
  });
96567
96762
  }
96568
- function isEdited$2(node) {
96763
+ function isEdited$1(node) {
96569
96764
  return node && !!node.value;
96570
96765
  }
96571
96766
 
96572
96767
  // helpers /////////////////
96573
96768
 
96574
- function prefixId$2(id) {
96769
+ function prefixId$1(id) {
96575
96770
  return `bio-properties-panel-${id}`;
96576
96771
  }
96577
96772
 
@@ -96606,12 +96801,12 @@
96606
96801
  return o$1("div", {
96607
96802
  class: "bio-properties-panel-textfield",
96608
96803
  children: [o$1("label", {
96609
- for: prefixId$1(id),
96804
+ for: prefixId(id),
96610
96805
  class: "bio-properties-panel-label",
96611
96806
  children: label
96612
96807
  }), o$1("input", {
96613
96808
  ref: ref,
96614
- id: prefixId$1(id),
96809
+ id: prefixId(id),
96615
96810
  type: "text",
96616
96811
  name: id,
96617
96812
  spellCheck: "false",
@@ -96703,13 +96898,13 @@
96703
96898
  })]
96704
96899
  });
96705
96900
  }
96706
- function isEdited$1(node) {
96901
+ function isEdited(node) {
96707
96902
  return node && !!node.value;
96708
96903
  }
96709
96904
 
96710
96905
  // helpers /////////////////
96711
96906
 
96712
- function prefixId$1(id) {
96907
+ function prefixId(id) {
96713
96908
  return `bio-properties-panel-${id}`;
96714
96909
  }
96715
96910
 
@@ -99872,7 +100067,7 @@
99872
100067
  eventBus.fire('propertiesPanel.layoutChanged', {
99873
100068
  layout: newLayout
99874
100069
  });
99875
- }, [eventBus, layoutConfig]);
100070
+ }, [eventBus]);
99876
100071
 
99877
100072
  // React to external layout changes
99878
100073
  y(() => {
@@ -100199,17 +100394,17 @@
100199
100394
  function getLinkEventDefinition(element) {
100200
100395
  return getEventDefinition$1(element, 'bpmn:LinkEventDefinition');
100201
100396
  }
100202
- function getSignalEventDefinition(element) {
100397
+ function getSignalEventDefinition$1(element) {
100203
100398
  return getEventDefinition$1(element, 'bpmn:SignalEventDefinition');
100204
100399
  }
100205
100400
  function isLinkSupported(element) {
100206
100401
  return isAny(element, ['bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent']) && !!getLinkEventDefinition(element);
100207
100402
  }
100208
- function isSignalSupported(element) {
100209
- return is$5(element, 'bpmn:Event') && !!getSignalEventDefinition(element);
100403
+ function isSignalSupported$1(element) {
100404
+ return is$5(element, 'bpmn:Event') && !!getSignalEventDefinition$1(element);
100210
100405
  }
100211
- function getSignal(element) {
100212
- const signalEventDefinition = getSignalEventDefinition(element);
100406
+ function getSignal$1(element) {
100407
+ const signalEventDefinition = getSignalEventDefinition$1(element);
100213
100408
  return signalEventDefinition && signalEventDefinition.get('signalRef');
100214
100409
  }
100215
100410
  function getEscalationEventDefinition(element) {
@@ -100254,7 +100449,7 @@
100254
100449
  }, {
100255
100450
  id: 'activityRef',
100256
100451
  component: ActivityRef,
100257
- isEdited: isEdited$4
100452
+ isEdited: isEdited$3
100258
100453
  }];
100259
100454
  }
100260
100455
  function WaitForCompletion(props) {
@@ -100448,13 +100643,13 @@
100448
100643
  const entries = [{
100449
100644
  id: 'documentation',
100450
100645
  component: ElementDocumentationProperty,
100451
- isEdited: isEdited$2
100646
+ isEdited: isEdited$1
100452
100647
  }];
100453
100648
  if (hasProcessRef$2(element)) {
100454
100649
  entries.push({
100455
100650
  id: 'processDocumentation',
100456
100651
  component: ProcessDocumentationProperty,
100457
- isEdited: isEdited$2
100652
+ isEdited: isEdited$1
100458
100653
  });
100459
100654
  }
100460
100655
  return entries;
@@ -100636,17 +100831,17 @@
100636
100831
  let entries = [{
100637
100832
  id: 'errorRef',
100638
100833
  component: ErrorRef$1,
100639
- isEdited: isEdited$4
100834
+ isEdited: isEdited$3
100640
100835
  }];
100641
100836
  if (error) {
100642
100837
  entries = [...entries, {
100643
100838
  id: 'errorName',
100644
100839
  component: ErrorName$1,
100645
- isEdited: isEdited$1
100840
+ isEdited: isEdited
100646
100841
  }, {
100647
100842
  id: 'errorCode',
100648
100843
  component: ErrorCode$2,
100649
- isEdited: isEdited$1
100844
+ isEdited: isEdited
100650
100845
  }];
100651
100846
  }
100652
100847
  return entries;
@@ -100817,17 +101012,17 @@
100817
101012
  let entries = [{
100818
101013
  id: 'escalationRef',
100819
101014
  component: EscalationRef,
100820
- isEdited: isEdited$4
101015
+ isEdited: isEdited$3
100821
101016
  }];
100822
101017
  if (escalation) {
100823
101018
  entries = [...entries, {
100824
101019
  id: 'escalationName',
100825
101020
  component: EscalationName,
100826
- isEdited: isEdited$1
101021
+ isEdited: isEdited
100827
101022
  }, {
100828
101023
  id: 'escalationCode',
100829
101024
  component: EscalationCode$1,
100830
- isEdited: isEdited$1
101025
+ isEdited: isEdited
100831
101026
  }];
100832
101027
  }
100833
101028
  return entries;
@@ -101099,7 +101294,7 @@
101099
101294
  return [{
101100
101295
  id: 'id',
101101
101296
  component: Id$3,
101102
- isEdited: isEdited$1
101297
+ isEdited: isEdited
101103
101298
  }];
101104
101299
  }
101105
101300
  function Id$3(props) {
@@ -101149,7 +101344,7 @@
101149
101344
  return [{
101150
101345
  id: 'linkName',
101151
101346
  component: LinkName,
101152
- isEdited: isEdited$1
101347
+ isEdited: isEdited
101153
101348
  }];
101154
101349
  }
101155
101350
  function LinkName(props) {
@@ -101203,13 +101398,13 @@
101203
101398
  let entries = [{
101204
101399
  id: 'messageRef',
101205
101400
  component: MessageRef$1,
101206
- isEdited: isEdited$4
101401
+ isEdited: isEdited$3
101207
101402
  }];
101208
101403
  if (message) {
101209
101404
  entries = [...entries, {
101210
101405
  id: 'messageName',
101211
101406
  component: MessageName$1,
101212
- isEdited: isEdited$1
101407
+ isEdited: isEdited
101213
101408
  }];
101214
101409
  }
101215
101410
  return entries;
@@ -101350,11 +101545,11 @@
101350
101545
  const entries = [{
101351
101546
  id: 'loopCardinality',
101352
101547
  component: LoopCardinality,
101353
- isEdited: isEdited$1
101548
+ isEdited: isEdited
101354
101549
  }, {
101355
101550
  id: 'completionCondition',
101356
101551
  component: CompletionCondition$1,
101357
- isEdited: isEdited$1
101552
+ isEdited: isEdited
101358
101553
  }];
101359
101554
  return entries;
101360
101555
  }
@@ -101577,7 +101772,7 @@
101577
101772
  return [{
101578
101773
  id: 'name',
101579
101774
  component: Name$3,
101580
- isEdited: isEdited$2
101775
+ isEdited: isEdited$1
101581
101776
  }];
101582
101777
  }
101583
101778
  function Name$3(props) {
@@ -101686,11 +101881,11 @@
101686
101881
  return [{
101687
101882
  id: 'processId',
101688
101883
  component: ProcessId,
101689
- isEdited: isEdited$1
101884
+ isEdited: isEdited
101690
101885
  }, {
101691
101886
  id: 'processName',
101692
101887
  component: ProcessName,
101693
- isEdited: isEdited$1
101888
+ isEdited: isEdited
101694
101889
  }];
101695
101890
  }
101696
101891
  function ProcessName(props) {
@@ -101762,34 +101957,34 @@
101762
101957
  return is$5(element, 'bpmn:Participant') && element.businessObject.get('processRef');
101763
101958
  }
101764
101959
 
101765
- const EMPTY_OPTION$3 = '';
101766
- const CREATE_NEW_OPTION$2 = 'create-new';
101767
-
101768
101960
  /**
101769
101961
  * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
101770
101962
  */
101771
101963
 
101964
+ const EMPTY_OPTION$3 = '';
101965
+ const CREATE_NEW_OPTION$2 = 'create-new';
101966
+
101772
101967
  /**
101773
- * @returns {Array<Entry>} entries
101968
+ * @returns {Entry[]}
101774
101969
  */
101775
- function SignalProps(props) {
101970
+ function SignalProps$1(props) {
101776
101971
  const {
101777
101972
  element
101778
101973
  } = props;
101779
- if (!isSignalSupported(element)) {
101974
+ if (!isSignalSupported$1(element)) {
101780
101975
  return [];
101781
101976
  }
101782
- const signal = getSignal(element);
101977
+ const signal = getSignal$1(element);
101783
101978
  let entries = [{
101784
101979
  id: 'signalRef',
101785
101980
  component: SignalRef,
101786
- isEdited: isEdited$4
101981
+ isEdited: isEdited$3
101787
101982
  }];
101788
101983
  if (signal) {
101789
101984
  entries = [...entries, {
101790
101985
  id: 'signalName',
101791
- component: SignalName,
101792
- isEdited: isEdited$1
101986
+ component: SignalName$1,
101987
+ isEdited: isEdited
101793
101988
  }];
101794
101989
  }
101795
101990
  return entries;
@@ -101801,9 +101996,9 @@
101801
101996
  const bpmnFactory = useService('bpmnFactory');
101802
101997
  const commandStack = useService('commandStack');
101803
101998
  const translate = useService('translate');
101804
- const signalEventDefinition = getSignalEventDefinition(element);
101999
+ const signalEventDefinition = getSignalEventDefinition$1(element);
101805
102000
  const getValue = () => {
101806
- const signal = getSignal(element);
102001
+ const signal = getSignal$1(element);
101807
102002
  if (signal) {
101808
102003
  return signal.get('id');
101809
102004
  }
@@ -101877,14 +102072,14 @@
101877
102072
  getOptions
101878
102073
  });
101879
102074
  }
101880
- function SignalName(props) {
102075
+ function SignalName$1(props) {
101881
102076
  const {
101882
102077
  element
101883
102078
  } = props;
101884
102079
  const commandStack = useService('commandStack');
101885
102080
  const translate = useService('translate');
101886
102081
  const debounce = useService('debounceInput');
101887
- const signal = getSignal(element);
102082
+ const signal = getSignal$1(element);
101888
102083
  const getValue = () => {
101889
102084
  return signal.get('name');
101890
102085
  };
@@ -101976,7 +102171,7 @@
101976
102171
  entries.push({
101977
102172
  id: getId$1(idPrefix, 'timerEventDefinitionType'),
101978
102173
  component: TimerEventDefinitionType$2,
101979
- isEdited: isEdited$4,
102174
+ isEdited: isEdited$3,
101980
102175
  timerEventDefinition,
101981
102176
  timerEventDefinitionType
101982
102177
  });
@@ -101984,7 +102179,7 @@
101984
102179
  entries.push({
101985
102180
  id: getId$1(idPrefix, 'timerEventDefinitionValue'),
101986
102181
  component: TimerEventDefinitionValue$2,
101987
- isEdited: isEdited$1,
102182
+ isEdited: isEdited,
101988
102183
  timerEventDefinition,
101989
102184
  timerEventDefinitionType
101990
102185
  });
@@ -102262,7 +102457,7 @@
102262
102457
  id: 'signal',
102263
102458
  label: translate('Signal'),
102264
102459
  component: Group,
102265
- entries: [...SignalProps({
102460
+ entries: [...SignalProps$1({
102266
102461
  element
102267
102462
  })]
102268
102463
  };
@@ -103338,7 +103533,11 @@
103338
103533
  }
103339
103534
 
103340
103535
  function unlinkTemplate$1(element, injector) {
103341
- const modeling = injector.get('modeling');
103536
+ const modeling = injector.get('modeling'),
103537
+ eventBus = injector.get('eventBus');
103538
+ eventBus.fire('elementTemplates.unlink', {
103539
+ element
103540
+ });
103342
103541
  modeling.updateProperties(element, {
103343
103542
  'camunda:modelerTemplate': null,
103344
103543
  'camunda:modelerTemplateVersion': null
@@ -103346,7 +103545,11 @@
103346
103545
  }
103347
103546
 
103348
103547
  function unlinkTemplate(element, injector) {
103349
- const modeling = injector.get('modeling');
103548
+ const modeling = injector.get('modeling'),
103549
+ eventBus = injector.get('eventBus');
103550
+ eventBus.fire('elementTemplates.unlink', {
103551
+ element
103552
+ });
103350
103553
 
103351
103554
  // remove template attributes
103352
103555
  modeling.updateProperties(element, {
@@ -103731,7 +103934,7 @@
103731
103934
  }
103732
103935
 
103733
103936
  /**
103734
- * Remove referenced element when template is unlinked.
103937
+ * Unlink referenced element when template is unlinked.
103735
103938
  */
103736
103939
  _handlePropertiesUpdate(context) {
103737
103940
  const {
@@ -103747,11 +103950,9 @@
103747
103950
  const bo = getBusinessObject$1(element);
103748
103951
  const message = findMessage(bo);
103749
103952
  if (message && getTemplateId$1(message)) {
103750
- const messageEventDefinition = bo.eventDefinitions[0];
103751
- this._modeling.updateModdleProperties(element, messageEventDefinition, {
103752
- 'messageRef': undefined
103953
+ this._modeling.updateModdleProperties(element, message, {
103954
+ [TEMPLATE_ID_ATTR$1]: null
103753
103955
  });
103754
- this._removeRootElement(message);
103755
103956
  }
103756
103957
  }
103757
103958