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$2(value) {
4796
+ return isObject$1(value) && has$2(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$2(value) {
4807
+ return isObject$1(value) && has$2(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$h(element)) {
4964
+ if (isConnection$2(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$h(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$7(element.label);
18192
+ return isLabel$2(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$7(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$6(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$2(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
  */
@@ -24007,7 +24034,7 @@
24007
24034
  * @param {boolean} [unwrap] whether the event should be unwrapped
24008
24035
  * @param {any} [that]
24009
24036
  */
24010
- CommandInterceptor$1.prototype.canExecute = createHook('canExecute');
24037
+ CommandInterceptor$1.prototype.canExecute = createHook$1('canExecute');
24011
24038
 
24012
24039
  /**
24013
24040
  * Add a <preExecute> phase of command interceptor.
@@ -24018,7 +24045,7 @@
24018
24045
  * @param {boolean} [unwrap] whether the event should be unwrapped
24019
24046
  * @param {any} [that]
24020
24047
  */
24021
- CommandInterceptor$1.prototype.preExecute = createHook('preExecute');
24048
+ CommandInterceptor$1.prototype.preExecute = createHook$1('preExecute');
24022
24049
 
24023
24050
  /**
24024
24051
  * Add a <preExecuted> phase of command interceptor.
@@ -24029,7 +24056,7 @@
24029
24056
  * @param {boolean} [unwrap] whether the event should be unwrapped
24030
24057
  * @param {any} [that]
24031
24058
  */
24032
- CommandInterceptor$1.prototype.preExecuted = createHook('preExecuted');
24059
+ CommandInterceptor$1.prototype.preExecuted = createHook$1('preExecuted');
24033
24060
 
24034
24061
  /**
24035
24062
  * Add a <execute> phase of command interceptor.
@@ -24040,7 +24067,7 @@
24040
24067
  * @param {boolean} [unwrap] whether the event should be unwrapped
24041
24068
  * @param {any} [that]
24042
24069
  */
24043
- CommandInterceptor$1.prototype.execute = createHook('execute');
24070
+ CommandInterceptor$1.prototype.execute = createHook$1('execute');
24044
24071
 
24045
24072
  /**
24046
24073
  * Add a <executed> phase of command interceptor.
@@ -24051,7 +24078,7 @@
24051
24078
  * @param {boolean} [unwrap] whether the event should be unwrapped
24052
24079
  * @param {any} [that]
24053
24080
  */
24054
- CommandInterceptor$1.prototype.executed = createHook('executed');
24081
+ CommandInterceptor$1.prototype.executed = createHook$1('executed');
24055
24082
 
24056
24083
  /**
24057
24084
  * Add a <postExecute> phase of command interceptor.
@@ -24062,7 +24089,7 @@
24062
24089
  * @param {boolean} [unwrap] whether the event should be unwrapped
24063
24090
  * @param {any} [that]
24064
24091
  */
24065
- CommandInterceptor$1.prototype.postExecute = createHook('postExecute');
24092
+ CommandInterceptor$1.prototype.postExecute = createHook$1('postExecute');
24066
24093
 
24067
24094
  /**
24068
24095
  * Add a <postExecuted> phase of command interceptor.
@@ -24073,7 +24100,7 @@
24073
24100
  * @param {boolean} [unwrap] whether the event should be unwrapped
24074
24101
  * @param {any} [that]
24075
24102
  */
24076
- CommandInterceptor$1.prototype.postExecuted = createHook('postExecuted');
24103
+ CommandInterceptor$1.prototype.postExecuted = createHook$1('postExecuted');
24077
24104
 
24078
24105
  /**
24079
24106
  * Add a <revert> phase of command interceptor.
@@ -24084,7 +24111,7 @@
24084
24111
  * @param {boolean} [unwrap] whether the event should be unwrapped
24085
24112
  * @param {any} [that]
24086
24113
  */
24087
- CommandInterceptor$1.prototype.revert = createHook('revert');
24114
+ CommandInterceptor$1.prototype.revert = createHook$1('revert');
24088
24115
 
24089
24116
  /**
24090
24117
  * Add a <reverted> phase of command interceptor.
@@ -24095,7 +24122,7 @@
24095
24122
  * @param {boolean} [unwrap] whether the event should be unwrapped
24096
24123
  * @param {any} [that]
24097
24124
  */
24098
- CommandInterceptor$1.prototype.reverted = createHook('reverted');
24125
+ CommandInterceptor$1.prototype.reverted = createHook$1('reverted');
24099
24126
 
24100
24127
  /*
24101
24128
  * Add prototype methods for each phase of command execution (e.g. execute,
@@ -24110,7 +24137,7 @@
24110
24137
  * unwrap?: boolean
24111
24138
  * ) => any }
24112
24139
  */
24113
- function createHook(hook) {
24140
+ function createHook$1(hook) {
24114
24141
 
24115
24142
  /**
24116
24143
  * @this {CommandInterceptor}
@@ -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$g(source)) {
31980
+ if (isConnection$2(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$g(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$2(elements, function(element) {
32438
32461
 
32439
- if (is$6(element, 'bpmn:Lane') || isLabel$7(element)) {
32462
+ if (is$6(element, 'bpmn:Lane') || isLabel$2(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$f(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35476
+ if (!isConnection$2(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$f(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$6(element) && elements.indexOf(labelTarget) !== -1);
37054
+ return !element.parent && !(isLabel$2(element) && elements.indexOf(labelTarget) !== -1);
37039
37055
  });
37040
37056
 
37041
37057
  var shape = find$2(elements, function(element) {
37042
- return !isConnection$e(element);
37058
+ return !isConnection$2(element);
37043
37059
  });
37044
37060
 
37045
37061
  var attach = false,
@@ -37194,7 +37210,7 @@
37194
37210
 
37195
37211
  // update shape
37196
37212
  shape = find$2(elements, function(element) {
37197
- return !isConnection$e(element);
37213
+ return !isConnection$2(element);
37198
37214
  });
37199
37215
  }
37200
37216
 
@@ -37235,7 +37251,7 @@
37235
37251
  }
37236
37252
 
37237
37253
  var shape = find$2(elements, function(element) {
37238
- return !isConnection$e(element);
37254
+ return !isConnection$2(element);
37239
37255
  });
37240
37256
 
37241
37257
  if (!shape) {
@@ -37269,7 +37285,7 @@
37269
37285
 
37270
37286
  // center elements around cursor
37271
37287
  forEach$2(elements, function(element) {
37272
- if (isConnection$e(element)) {
37288
+ if (isConnection$2(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$e(element) {
37335
- return !!element.waypoints;
37336
- }
37337
-
37338
37350
  function isSingleShape(elements) {
37339
- return elements && elements.length === 1 && !isConnection$e(elements[0]);
37340
- }
37341
-
37342
- function isLabel$6(element) {
37343
- return !!element.labelTarget;
37351
+ return elements && elements.length === 1 && !isConnection$2(elements[ 0 ]);
37344
37352
  }
37345
37353
 
37346
37354
  /**
@@ -37673,7 +37681,7 @@
37673
37681
  }
37674
37682
 
37675
37683
  // connections (priority = 3)
37676
- if (isConnection$d(element)) {
37684
+ if (isConnection$2(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$5(element)) {
37694
+ if (isLabel$2(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$2(elements, function(element) {
37819
- if (isConnection$d(element)) {
37827
+ if (isConnection$2(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$d(attrs)) {
37880
+ if (isConnection$2(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$5(attrs)) {
37891
+ if (isLabel$2(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$d(element)) {
37946
+ if (isConnection$2(element)) {
37939
37947
  source = find$2(elements, matchPattern({ id: element.source.id }));
37940
37948
  target = find$2(elements, matchPattern({ id: element.target.id }));
37941
37949
 
@@ -37944,7 +37952,7 @@
37944
37952
  }
37945
37953
  }
37946
37954
 
37947
- if (isLabel$5(element)) {
37955
+ if (isLabel$2(element)) {
37948
37956
  labelTarget = find$2(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$5(element)) {
38048
+ if (isLabel$2(element)) {
38041
38049
  return;
38042
38050
  }
38043
38051
 
@@ -38135,14 +38143,6 @@
38135
38143
  return !!element.host;
38136
38144
  }
38137
38145
 
38138
- function isConnection$d(element) {
38139
- return !!element.waypoints;
38140
- }
38141
-
38142
- function isLabel$5(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$7(element)) {
38229
+ if (isLabel$2(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$7(descriptor)) {
38297
+ if (isLabel$2(descriptor)) {
38298
38298
  descriptor.businessObject = getBusinessObject$2(cache[ descriptor.labelTarget ]);
38299
38299
  descriptor.di = getDi$1(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$c(element) || !this._resize.canResize({ shape: element })) {
44378
+ if (isConnection$2(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$c(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$7(target)) {
44789
+ && !isLabel$2(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$7(shape) &&
45466
+ return !isLabel$2(shape) &&
45471
45467
  isAny$1(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$6(element, 'bpmn:Group') &&
45647
- !isLabel$7(element) &&
45648
- !isConnection$b(element);
45643
+ !isLabel$2(element) &&
45644
+ !isConnection$2(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$b(element) {
45820
- return !!element.waypoints;
45821
- }
45822
-
45823
45815
  function findParticipant(elements) {
45824
45816
  return find$2(elements, function(element) {
45825
45817
  return is$6(element, 'bpmn:Participant');
@@ -46424,7 +46416,7 @@
46424
46416
  }
46425
46417
 
46426
46418
  function shouldReplace(shape, host) {
46427
- return !isLabel$7(shape) && is$6(shape, 'bpmn:BoundaryEvent') && !host;
46419
+ return !isLabel$2(shape) && is$6(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$7(element) || !isLabelExternal(element)) {
48126
+ if (isLabel$2(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$7(shape)) {
50665
+ if (isLabel$2(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$a(target) && !canInsert(elements, target)) {
51114
+ if (isConnection$2(target) && !canInsert(elements, target)) {
51123
51115
  return false;
51124
51116
  }
51125
51117
 
51126
51118
  return every(elements, function(element) {
51127
- if (isConnection$a(element)) {
51119
+ if (isConnection$2(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$7(element);
51228
+ return !element || isLabel$2(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$a(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$7(element) || isGroup(element)) {
51552
+ if (isLabel$2(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$7(element) && is$6(element, 'bpmn:BoundaryEvent');
51642
+ return !isLabel$2(element) && is$6(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$7(element)) {
51751
+ if (isLabel$2(element)) {
51769
51752
  return false;
51770
51753
  }
51771
51754
 
@@ -51937,7 +51920,7 @@
51937
51920
  return false;
51938
51921
  }
51939
51922
 
51940
- if (isLabel$7(shape) || isGroup(shape)) {
51923
+ if (isLabel$2(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$1(connection, [ 'bpmn:SequenceFlow', 'bpmn:MessageFlow' ]) &&
52121
- !isLabel$7(connection) &&
52104
+ !isLabel$2(connection) &&
52122
52105
  is$6(shape, 'bpmn:FlowNode') &&
52123
52106
  !is$6(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$7(element)) {
52127
+ if (isLabel$2(element)) {
52145
52128
  return true;
52146
52129
  }
52147
52130
 
@@ -53049,12 +53032,12 @@
53049
53032
  }
53050
53033
 
53051
53034
  forEach$2(elements, function(element) {
53052
- if (!element.parent || isLabel$4(element)) {
53035
+ if (!element.parent || isLabel$2(element)) {
53053
53036
  return;
53054
53037
  }
53055
53038
 
53056
53039
  // handle connections separately
53057
- if (isConnection$9(element)) {
53040
+ if (isConnection$2(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$9(child) &&
53229
- !isLabel$4(child) &&
53211
+ return !isConnection$2(child) &&
53212
+ !isLabel$2(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$9(child) && !isLabel$4(child) && includes$3(movingShapes, child);
53219
+ return !isConnection$2(child) && !isLabel$2(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$9(element) {
53371
- return !!element.waypoints;
53372
- }
53373
-
53374
- function isLabel$4(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$8(element)
53511
+ return isConnection$2(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$8(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$7(element)) {
55680
+ if (isLabel$2(element)) {
55716
55681
  return;
55717
55682
  }
55718
55683
 
@@ -55777,7 +55742,7 @@
55777
55742
  });
55778
55743
  }
55779
55744
 
55780
- var target = isLabel$7(shape) ? this._getLabel(di) : di;
55745
+ var target = isLabel$2(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$2(elements, function(element) {
56841
- if (isConnection$7(element)) {
56806
+ if (isConnection$2(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$2(elements, function(element) {
56861
- if (isConnection$7(element)) {
56826
+ if (isConnection$2(element)) {
56862
56827
  cache[ element.id ] = isNumber$1(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$2(element)) {
56854
+ createShapeHints = omit(createShapeHints, [ 'attach' ]);
56855
+ }
56856
+
56888
56857
  cache[ element.id ] = isNumber$1(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$7(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$6(child)) {
57197
+ if (isConnection$2(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$6(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$2(elements, function(element) {
60416
- var assignedDi = isConnection$5(element) ? pick(di, [ 'border-color' ]) : di,
60375
+ var assignedDi = isConnection$2(element) ? pick(di, [ 'border-color' ]) : di,
60417
60376
  elementDi = getDi$1(element);
60418
60377
 
60419
60378
  // TODO @barmac: remove once we drop bpmn.io properties
60420
60379
  ensureLegacySupport(assignedDi);
60421
60380
 
60422
- if (isLabel$7(element)) {
60381
+ if (isLabel$2(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$5(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$7(element)
60503
+ if (!isLabel$2(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$7(label) && !is$6(label, 'bpmn:TextAnnotation')) {
60543
+ if (!isLabel$2(label) && !is$6(label, 'bpmn:TextAnnotation')) {
60589
60544
  return;
60590
60545
  }
60591
60546
 
60592
- if (isLabel$7(label) && isEmptyText(newLabel)) {
60547
+ if (isLabel$2(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$4(element)) {
62656
+ if (!isConnection$2(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$4(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$3(shape)) {
64730
+ if (isLabel$2(shape)) {
64783
64731
  return snapContext;
64784
64732
  }
64785
64733
 
@@ -64802,9 +64750,9 @@
64802
64750
  forEach$2(snapTargets, function(snapTarget) {
64803
64751
 
64804
64752
  // handle labels
64805
- if (isLabel$3(snapTarget)) {
64753
+ if (isLabel$2(snapTarget)) {
64806
64754
 
64807
- if (isLabel$3(shape)) {
64755
+ if (isLabel$2(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$3(snapTarget)) {
64763
+ if (isConnection$2(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$3(element) {
64857
- return !!element.waypoints;
64858
- }
64859
-
64860
64804
  function isHidden$1(element) {
64861
64805
  return !!element.hidden;
64862
- }
64863
-
64864
- function isLabel$3(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$2(element) {
65275
- return !!element.waypoints;
65276
- }
65277
-
65278
65214
  function isHidden(element) {
65279
65215
  return !!element.hidden;
65280
65216
  }
65281
65217
 
65282
- function isLabel$2(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$2=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$2&&e$2(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.
@@ -95532,6 +95464,18 @@
95532
95464
  * @param {setSticky} setSticky
95533
95465
  */
95534
95466
  function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {
95467
+ const [scrollContainer, setScrollContainer] = l$1(query$1(scrollContainerSelector));
95468
+ const updateScrollContainer = A$1(() => {
95469
+ const newScrollContainer = query$1(scrollContainerSelector);
95470
+ if (newScrollContainer !== scrollContainer) {
95471
+ setScrollContainer(newScrollContainer);
95472
+ }
95473
+ }, [scrollContainerSelector, scrollContainer]);
95474
+ y(() => {
95475
+ updateScrollContainer();
95476
+ }, [updateScrollContainer]);
95477
+ useEvent('propertiesPanel.attach', updateScrollContainer);
95478
+ useEvent('propertiesPanel.detach', updateScrollContainer);
95535
95479
  y(() => {
95536
95480
  const Observer = IntersectionObserver;
95537
95481
 
@@ -95539,37 +95483,36 @@
95539
95483
  if (!Observer) {
95540
95484
  return;
95541
95485
  }
95542
- let observer;
95543
- if (ref.current) {
95544
- const scrollContainer = query$1(scrollContainerSelector);
95545
- observer = new Observer(entries => {
95546
- // The ScrollContainer is unmounted, do not update sticky state
95547
- if (scrollContainer.scrollHeight === 0) {
95548
- return;
95486
+
95487
+ // TODO(@barmac): test this
95488
+ if (!ref.current || !scrollContainer) {
95489
+ return;
95490
+ }
95491
+ const observer = new Observer(entries => {
95492
+ // scroll container is unmounted, do not update sticky state
95493
+ if (scrollContainer.scrollHeight === 0) {
95494
+ return;
95495
+ }
95496
+ entries.forEach(entry => {
95497
+ if (entry.intersectionRatio < 1) {
95498
+ setSticky(true);
95499
+ } else if (entry.intersectionRatio === 1) {
95500
+ setSticky(false);
95549
95501
  }
95550
- entries.forEach(entry => {
95551
- if (entry.intersectionRatio < 1) {
95552
- setSticky(true);
95553
- } else if (entry.intersectionRatio === 1) {
95554
- setSticky(false);
95555
- }
95556
- });
95557
- }, {
95558
- root: scrollContainer,
95559
- rootMargin: '0px 0px 999999% 0px',
95560
- // Use bottom margin to avoid stickyness when scrolling out to bottom
95561
- threshold: [1]
95562
95502
  });
95563
- observer.observe(ref.current);
95564
- }
95503
+ }, {
95504
+ root: scrollContainer,
95505
+ rootMargin: '0px 0px 999999% 0px',
95506
+ // Use bottom margin to avoid stickyness when scrolling out to bottom
95507
+ threshold: [1]
95508
+ });
95509
+ observer.observe(ref.current);
95565
95510
 
95566
95511
  // Unobserve if unmounted
95567
95512
  return () => {
95568
- if (ref.current && observer) {
95569
- observer.unobserve(ref.current);
95570
- }
95513
+ observer.unobserve(ref.current);
95571
95514
  };
95572
- }, [ref, scrollContainerSelector, setSticky]);
95515
+ }, [ref.current, scrollContainer, setSticky]);
95573
95516
  }
95574
95517
 
95575
95518
  /**
@@ -95704,9 +95647,7 @@
95704
95647
  });
95705
95648
  }
95706
95649
 
95707
- const DEFAULT_LAYOUT = {
95708
- open: true
95709
- };
95650
+ const DEFAULT_LAYOUT = {};
95710
95651
  const DEFAULT_DESCRIPTION = {};
95711
95652
 
95712
95653
  /**
@@ -95870,7 +95811,7 @@
95870
95811
  children: o$1(EventContext.Provider, {
95871
95812
  value: eventContext,
95872
95813
  children: o$1("div", {
95873
- class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
95814
+ class: "bio-properties-panel",
95874
95815
  children: [o$1(Header, {
95875
95816
  element: element,
95876
95817
  headerProvider: headerProvider
@@ -96626,6 +96567,188 @@
96626
96567
  })
96627
96568
  });
96628
96569
  });
96570
+
96571
+ function ToggleSwitch(props) {
96572
+ const {
96573
+ id,
96574
+ label,
96575
+ onInput,
96576
+ value,
96577
+ switcherLabel,
96578
+ inline,
96579
+ onFocus,
96580
+ onBlur,
96581
+ inputRef
96582
+ } = props;
96583
+ const [localValue, setLocalValue] = l$1(value);
96584
+ const handleInputCallback = async () => {
96585
+ onInput(!value);
96586
+ };
96587
+ const handleInput = e => {
96588
+ handleInputCallback();
96589
+ setLocalValue(e.target.value);
96590
+ };
96591
+ y(() => {
96592
+ if (value === localValue) {
96593
+ return;
96594
+ }
96595
+ setLocalValue(value);
96596
+ }, [value]);
96597
+ return o$1("div", {
96598
+ class: classnames('bio-properties-panel-toggle-switch', {
96599
+ inline
96600
+ }),
96601
+ children: [o$1("label", {
96602
+ class: "bio-properties-panel-label",
96603
+ for: prefixId$6(id),
96604
+ children: label
96605
+ }), o$1("div", {
96606
+ class: "bio-properties-panel-field-wrapper",
96607
+ children: [o$1("label", {
96608
+ class: "bio-properties-panel-toggle-switch__switcher",
96609
+ children: [o$1("input", {
96610
+ ref: inputRef,
96611
+ id: prefixId$6(id),
96612
+ class: "bio-properties-panel-input",
96613
+ type: "checkbox",
96614
+ onFocus: onFocus,
96615
+ onBlur: onBlur,
96616
+ name: id,
96617
+ onInput: handleInput,
96618
+ checked: !!localValue
96619
+ }), o$1("span", {
96620
+ class: "bio-properties-panel-toggle-switch__slider"
96621
+ })]
96622
+ }), switcherLabel && o$1("p", {
96623
+ class: "bio-properties-panel-toggle-switch__label",
96624
+ children: switcherLabel
96625
+ })]
96626
+ })]
96627
+ });
96628
+ }
96629
+
96630
+ /**
96631
+ * @param {Object} props
96632
+ * @param {Object} props.element
96633
+ * @param {String} props.id
96634
+ * @param {String} props.description
96635
+ * @param {String} props.label
96636
+ * @param {String} props.switcherLabel
96637
+ * @param {Boolean} props.inline
96638
+ * @param {Function} props.getValue
96639
+ * @param {Function} props.setValue
96640
+ * @param {Function} props.onFocus
96641
+ * @param {Function} props.onBlur
96642
+ */
96643
+ function ToggleSwitchEntry(props) {
96644
+ const {
96645
+ element,
96646
+ id,
96647
+ description,
96648
+ label,
96649
+ switcherLabel,
96650
+ inline,
96651
+ getValue,
96652
+ setValue,
96653
+ onFocus,
96654
+ onBlur
96655
+ } = props;
96656
+ const value = getValue(element);
96657
+ return o$1("div", {
96658
+ class: "bio-properties-panel-entry bio-properties-panel-toggle-switch-entry",
96659
+ "data-entry-id": id,
96660
+ children: [o$1(ToggleSwitch, {
96661
+ id: id,
96662
+ label: label,
96663
+ value: value,
96664
+ onInput: setValue,
96665
+ onFocus: onFocus,
96666
+ onBlur: onBlur,
96667
+ switcherLabel: switcherLabel,
96668
+ inline: inline
96669
+ }), o$1(Description$2, {
96670
+ forId: id,
96671
+ element: element,
96672
+ value: description
96673
+ })]
96674
+ });
96675
+ }
96676
+
96677
+ // helpers /////////////////
96678
+
96679
+ function prefixId$6(id) {
96680
+ return `bio-properties-panel-${id}`;
96681
+ }
96682
+
96683
+ function NumberField(props) {
96684
+ const {
96685
+ debounce,
96686
+ disabled,
96687
+ displayLabel = true,
96688
+ id,
96689
+ inputRef,
96690
+ label,
96691
+ max,
96692
+ min,
96693
+ onInput,
96694
+ step,
96695
+ value = '',
96696
+ onFocus,
96697
+ onBlur
96698
+ } = props;
96699
+ const [localValue, setLocalValue] = l$1(value);
96700
+ const handleInputCallback = d(() => {
96701
+ return debounce(event => {
96702
+ const {
96703
+ validity,
96704
+ value
96705
+ } = event.target;
96706
+ if (validity.valid) {
96707
+ onInput(value ? parseFloat(value) : undefined);
96708
+ }
96709
+ });
96710
+ }, [onInput, debounce]);
96711
+ const handleInput = e => {
96712
+ handleInputCallback(e);
96713
+ setLocalValue(e.target.value);
96714
+ };
96715
+ y(() => {
96716
+ if (value === localValue) {
96717
+ return;
96718
+ }
96719
+ setLocalValue(value);
96720
+ }, [value]);
96721
+ return o$1("div", {
96722
+ class: "bio-properties-panel-numberfield",
96723
+ children: [displayLabel && o$1("label", {
96724
+ for: prefixId$5(id),
96725
+ class: "bio-properties-panel-label",
96726
+ children: label
96727
+ }), o$1("input", {
96728
+ id: prefixId$5(id),
96729
+ ref: inputRef,
96730
+ type: "number",
96731
+ name: id,
96732
+ spellCheck: "false",
96733
+ autoComplete: "off",
96734
+ disabled: disabled,
96735
+ class: "bio-properties-panel-input",
96736
+ max: max,
96737
+ min: min,
96738
+ onInput: handleInput,
96739
+ onFocus: onFocus,
96740
+ onBlur: onBlur,
96741
+ step: step,
96742
+ value: localValue
96743
+ })]
96744
+ });
96745
+ }
96746
+
96747
+ // helpers /////////////////
96748
+
96749
+ function prefixId$5(id) {
96750
+ return `bio-properties-panel-${id}`;
96751
+ }
96629
96752
  x((props, ref) => {
96630
96753
  const {
96631
96754
  id,
@@ -96655,7 +96778,7 @@
96655
96778
  }
96656
96779
  };
96657
96780
  return o$1("input", {
96658
- id: prefixId$6(id),
96781
+ id: prefixId$4(id),
96659
96782
  type: "text",
96660
96783
  ref: inputRef,
96661
96784
  name: id,
@@ -96669,6 +96792,53 @@
96669
96792
  value: value || ''
96670
96793
  });
96671
96794
  });
96795
+ x((props, ref) => {
96796
+ const {
96797
+ id,
96798
+ debounce,
96799
+ disabled,
96800
+ onInput,
96801
+ value,
96802
+ min,
96803
+ max,
96804
+ step,
96805
+ onFocus,
96806
+ onBlur
96807
+ } = props;
96808
+ const inputRef = s();
96809
+
96810
+ // To be consistent with the FEEL editor, set focus at start of input
96811
+ // this ensures clean editing experience when switching with the keyboard
96812
+ ref.current = {
96813
+ focus: position => {
96814
+ const input = inputRef.current;
96815
+ if (!input) {
96816
+ return;
96817
+ }
96818
+ input.focus();
96819
+ if (typeof position === 'number' && position !== Infinity) {
96820
+ if (position > value.length) {
96821
+ position = value.length;
96822
+ }
96823
+ input.setSelectionRange(position, position);
96824
+ }
96825
+ }
96826
+ };
96827
+ return o$1(NumberField, {
96828
+ id: id,
96829
+ debounce: debounce,
96830
+ disabled: disabled,
96831
+ displayLabel: false,
96832
+ inputRef: inputRef,
96833
+ max: max,
96834
+ min: min,
96835
+ onInput: onInput,
96836
+ step: step,
96837
+ value: value,
96838
+ onFocus: onFocus,
96839
+ onBlur: onBlur
96840
+ });
96841
+ });
96672
96842
  x((props, ref) => {
96673
96843
  const {
96674
96844
  id,
@@ -96693,7 +96863,7 @@
96693
96863
  }
96694
96864
  };
96695
96865
  return o$1("textarea", {
96696
- id: prefixId$6(id),
96866
+ id: prefixId$4(id),
96697
96867
  type: "text",
96698
96868
  ref: inputRef,
96699
96869
  name: id,
@@ -96708,10 +96878,82 @@
96708
96878
  "data-gramm": "false"
96709
96879
  });
96710
96880
  });
96881
+ x((props, ref) => {
96882
+ const {
96883
+ id,
96884
+ onInput,
96885
+ value,
96886
+ onFocus,
96887
+ onBlur,
96888
+ switcherLabel
96889
+ } = props;
96890
+ const inputRef = s();
96891
+
96892
+ // To be consistent with the FEEL editor, set focus at start of input
96893
+ // this ensures clean editing experience when switching with the keyboard
96894
+ ref.current = {
96895
+ focus: () => {
96896
+ const input = inputRef.current;
96897
+ if (!input) {
96898
+ return;
96899
+ }
96900
+ input.focus();
96901
+ }
96902
+ };
96903
+ return o$1(ToggleSwitch, {
96904
+ id: id,
96905
+ value: value,
96906
+ inputRef: inputRef,
96907
+ onInput: onInput,
96908
+ onFocus: onFocus,
96909
+ onBlur: onBlur,
96910
+ switcherLabel: switcherLabel
96911
+ });
96912
+ });
96913
+ x((props, ref) => {
96914
+ const {
96915
+ id,
96916
+ disabled,
96917
+ onInput,
96918
+ value,
96919
+ onFocus,
96920
+ onBlur
96921
+ } = props;
96922
+ const inputRef = s();
96923
+ const handleChange = ({
96924
+ target
96925
+ }) => {
96926
+ onInput(target.checked);
96927
+ };
96928
+
96929
+ // To be consistent with the FEEL editor, set focus at start of input
96930
+ // this ensures clean editing experience when switching with the keyboard
96931
+ ref.current = {
96932
+ focus: () => {
96933
+ const input = inputRef.current;
96934
+ if (!input) {
96935
+ return;
96936
+ }
96937
+ input.focus();
96938
+ }
96939
+ };
96940
+ return o$1("input", {
96941
+ ref: inputRef,
96942
+ id: prefixId$4(id),
96943
+ name: id,
96944
+ onFocus: onFocus,
96945
+ onBlur: onBlur,
96946
+ type: "checkbox",
96947
+ class: "bio-properties-panel-input",
96948
+ onChange: handleChange,
96949
+ checked: value,
96950
+ disabled: disabled
96951
+ });
96952
+ });
96711
96953
 
96712
96954
  // helpers /////////////////
96713
96955
 
96714
- function prefixId$6(id) {
96956
+ function prefixId$4(id) {
96715
96957
  return `bio-properties-panel-${id}`;
96716
96958
  }
96717
96959
 
@@ -96929,12 +97171,12 @@
96929
97171
  return o$1("div", {
96930
97172
  class: "bio-properties-panel-select",
96931
97173
  children: [o$1("label", {
96932
- for: prefixId$4(id),
97174
+ for: prefixId$3(id),
96933
97175
  class: "bio-properties-panel-label",
96934
97176
  children: label
96935
97177
  }), o$1("select", {
96936
97178
  ref: ref,
96937
- id: prefixId$4(id),
97179
+ id: prefixId$3(id),
96938
97180
  name: id,
96939
97181
  class: "bio-properties-panel-input",
96940
97182
  onInput: handleChange,
@@ -97041,13 +97283,13 @@
97041
97283
  })]
97042
97284
  });
97043
97285
  }
97044
- function isEdited$4(node) {
97286
+ function isEdited$3(node) {
97045
97287
  return node && !!node.value;
97046
97288
  }
97047
97289
 
97048
97290
  // helpers /////////////////
97049
97291
 
97050
- function prefixId$4(id) {
97292
+ function prefixId$3(id) {
97051
97293
  return `bio-properties-panel-${id}`;
97052
97294
  }
97053
97295
 
@@ -97082,7 +97324,7 @@
97082
97324
  return o$1("div", {
97083
97325
  class: "bio-properties-panel-simple",
97084
97326
  children: o$1("input", {
97085
- id: prefixId$3(id),
97327
+ id: prefixId$2(id),
97086
97328
  type: "text",
97087
97329
  name: id,
97088
97330
  spellCheck: "false",
@@ -97100,7 +97342,7 @@
97100
97342
 
97101
97343
  // helpers /////////////////
97102
97344
 
97103
- function prefixId$3(id) {
97345
+ function prefixId$2(id) {
97104
97346
  return `bio-properties-panel-${id}`;
97105
97347
  }
97106
97348
 
@@ -97149,12 +97391,12 @@
97149
97391
  return o$1("div", {
97150
97392
  class: "bio-properties-panel-textarea",
97151
97393
  children: [o$1("label", {
97152
- for: prefixId$2(id),
97394
+ for: prefixId$1(id),
97153
97395
  class: "bio-properties-panel-label",
97154
97396
  children: label
97155
97397
  }), o$1("textarea", {
97156
97398
  ref: ref,
97157
- id: prefixId$2(id),
97399
+ id: prefixId$1(id),
97158
97400
  name: id,
97159
97401
  spellCheck: "false",
97160
97402
  class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : '', autoResize ? 'auto-resize' : ''),
@@ -97254,13 +97496,13 @@
97254
97496
  })]
97255
97497
  });
97256
97498
  }
97257
- function isEdited$2(node) {
97499
+ function isEdited$1(node) {
97258
97500
  return node && !!node.value;
97259
97501
  }
97260
97502
 
97261
97503
  // helpers /////////////////
97262
97504
 
97263
- function prefixId$2(id) {
97505
+ function prefixId$1(id) {
97264
97506
  return `bio-properties-panel-${id}`;
97265
97507
  }
97266
97508
 
@@ -97295,12 +97537,12 @@
97295
97537
  return o$1("div", {
97296
97538
  class: "bio-properties-panel-textfield",
97297
97539
  children: [o$1("label", {
97298
- for: prefixId$1(id),
97540
+ for: prefixId$8(id),
97299
97541
  class: "bio-properties-panel-label",
97300
97542
  children: label
97301
97543
  }), o$1("input", {
97302
97544
  ref: ref,
97303
- id: prefixId$1(id),
97545
+ id: prefixId$8(id),
97304
97546
  type: "text",
97305
97547
  name: id,
97306
97548
  spellCheck: "false",
@@ -97392,117 +97634,13 @@
97392
97634
  })]
97393
97635
  });
97394
97636
  }
97395
- function isEdited$1(node) {
97637
+ function isEdited(node) {
97396
97638
  return node && !!node.value;
97397
97639
  }
97398
97640
 
97399
97641
  // helpers /////////////////
97400
97642
 
97401
- function prefixId$1(id) {
97402
- return `bio-properties-panel-${id}`;
97403
- }
97404
-
97405
- function ToggleSwitch(props) {
97406
- const {
97407
- id,
97408
- label,
97409
- onInput,
97410
- value,
97411
- switcherLabel,
97412
- onFocus,
97413
- onBlur
97414
- } = props;
97415
- const [localValue, setLocalValue] = l$1(value);
97416
- const handleInputCallback = async () => {
97417
- onInput(!value);
97418
- };
97419
- const handleInput = e => {
97420
- handleInputCallback();
97421
- setLocalValue(e.target.value);
97422
- };
97423
- y(() => {
97424
- if (value === localValue) {
97425
- return;
97426
- }
97427
- setLocalValue(value);
97428
- }, [value]);
97429
- return o$1("div", {
97430
- class: "bio-properties-panel-toggle-switch",
97431
- children: [o$1("label", {
97432
- class: "bio-properties-panel-label",
97433
- for: prefixId$5(id),
97434
- children: label
97435
- }), o$1("div", {
97436
- class: "bio-properties-panel-field-wrapper",
97437
- children: [o$1("label", {
97438
- class: "bio-properties-panel-toggle-switch__switcher",
97439
- children: [o$1("input", {
97440
- id: prefixId$5(id),
97441
- class: "bio-properties-panel-input",
97442
- type: "checkbox",
97443
- onFocus: onFocus,
97444
- onBlur: onBlur,
97445
- name: id,
97446
- onInput: handleInput,
97447
- checked: !!localValue
97448
- }), o$1("span", {
97449
- class: "bio-properties-panel-toggle-switch__slider"
97450
- })]
97451
- }), o$1("p", {
97452
- class: "bio-properties-panel-toggle-switch__label",
97453
- children: switcherLabel
97454
- })]
97455
- })]
97456
- });
97457
- }
97458
-
97459
- /**
97460
- * @param {Object} props
97461
- * @param {Object} props.element
97462
- * @param {String} props.id
97463
- * @param {String} props.description
97464
- * @param {String} props.label
97465
- * @param {String} props.switcherLabel
97466
- * @param {Function} props.getValue
97467
- * @param {Function} props.setValue
97468
- * @param {Function} props.onFocus
97469
- * @param {Function} props.onBlur
97470
- */
97471
- function ToggleSwitchEntry(props) {
97472
- const {
97473
- element,
97474
- id,
97475
- description,
97476
- label,
97477
- switcherLabel,
97478
- getValue,
97479
- setValue,
97480
- onFocus,
97481
- onBlur
97482
- } = props;
97483
- const value = getValue(element);
97484
- return o$1("div", {
97485
- class: "bio-properties-panel-entry bio-properties-panel-toggle-switch-entry",
97486
- "data-entry-id": id,
97487
- children: [o$1(ToggleSwitch, {
97488
- id: id,
97489
- label: label,
97490
- value: value,
97491
- onInput: setValue,
97492
- onFocus: onFocus,
97493
- onBlur: onBlur,
97494
- switcherLabel: switcherLabel
97495
- }), o$1(Description$2, {
97496
- forId: id,
97497
- element: element,
97498
- value: description
97499
- })]
97500
- });
97501
- }
97502
-
97503
- // helpers /////////////////
97504
-
97505
- function prefixId$5(id) {
97643
+ function prefixId$8(id) {
97506
97644
  return `bio-properties-panel-${id}`;
97507
97645
  }
97508
97646
 
@@ -101273,7 +101411,7 @@
101273
101411
  eventBus.fire('propertiesPanel.layoutChanged', {
101274
101412
  layout: newLayout
101275
101413
  });
101276
- }, [eventBus, layoutConfig]);
101414
+ }, [eventBus]);
101277
101415
 
101278
101416
  // React to external layout changes
101279
101417
  y(() => {
@@ -101603,17 +101741,17 @@
101603
101741
  function getLinkEventDefinition(element) {
101604
101742
  return getEventDefinition$1(element, 'bpmn:LinkEventDefinition');
101605
101743
  }
101606
- function getSignalEventDefinition(element) {
101744
+ function getSignalEventDefinition$1(element) {
101607
101745
  return getEventDefinition$1(element, 'bpmn:SignalEventDefinition');
101608
101746
  }
101609
101747
  function isLinkSupported(element) {
101610
101748
  return isAny$1(element, ['bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent']) && !!getLinkEventDefinition(element);
101611
101749
  }
101612
- function isSignalSupported(element) {
101613
- return is$6(element, 'bpmn:Event') && !!getSignalEventDefinition(element);
101750
+ function isSignalSupported$1(element) {
101751
+ return is$6(element, 'bpmn:Event') && !!getSignalEventDefinition$1(element);
101614
101752
  }
101615
- function getSignal(element) {
101616
- const signalEventDefinition = getSignalEventDefinition(element);
101753
+ function getSignal$1(element) {
101754
+ const signalEventDefinition = getSignalEventDefinition$1(element);
101617
101755
  return signalEventDefinition && signalEventDefinition.get('signalRef');
101618
101756
  }
101619
101757
  function getEscalationEventDefinition(element) {
@@ -101658,7 +101796,7 @@
101658
101796
  }, {
101659
101797
  id: 'activityRef',
101660
101798
  component: ActivityRef,
101661
- isEdited: isEdited$4
101799
+ isEdited: isEdited$3
101662
101800
  }];
101663
101801
  }
101664
101802
  function WaitForCompletion(props) {
@@ -101852,13 +101990,13 @@
101852
101990
  const entries = [{
101853
101991
  id: 'documentation',
101854
101992
  component: ElementDocumentationProperty,
101855
- isEdited: isEdited$2
101993
+ isEdited: isEdited$1
101856
101994
  }];
101857
101995
  if (hasProcessRef$2(element)) {
101858
101996
  entries.push({
101859
101997
  id: 'processDocumentation',
101860
101998
  component: ProcessDocumentationProperty,
101861
- isEdited: isEdited$2
101999
+ isEdited: isEdited$1
101862
102000
  });
101863
102001
  }
101864
102002
  return entries;
@@ -102040,17 +102178,17 @@
102040
102178
  let entries = [{
102041
102179
  id: 'errorRef',
102042
102180
  component: ErrorRef$1,
102043
- isEdited: isEdited$4
102181
+ isEdited: isEdited$3
102044
102182
  }];
102045
102183
  if (error) {
102046
102184
  entries = [...entries, {
102047
102185
  id: 'errorName',
102048
102186
  component: ErrorName$1,
102049
- isEdited: isEdited$1
102187
+ isEdited: isEdited
102050
102188
  }, {
102051
102189
  id: 'errorCode',
102052
102190
  component: ErrorCode$2,
102053
- isEdited: isEdited$1
102191
+ isEdited: isEdited
102054
102192
  }];
102055
102193
  }
102056
102194
  return entries;
@@ -102221,17 +102359,17 @@
102221
102359
  let entries = [{
102222
102360
  id: 'escalationRef',
102223
102361
  component: EscalationRef,
102224
- isEdited: isEdited$4
102362
+ isEdited: isEdited$3
102225
102363
  }];
102226
102364
  if (escalation) {
102227
102365
  entries = [...entries, {
102228
102366
  id: 'escalationName',
102229
102367
  component: EscalationName,
102230
- isEdited: isEdited$1
102368
+ isEdited: isEdited
102231
102369
  }, {
102232
102370
  id: 'escalationCode',
102233
102371
  component: EscalationCode$1,
102234
- isEdited: isEdited$1
102372
+ isEdited: isEdited
102235
102373
  }];
102236
102374
  }
102237
102375
  return entries;
@@ -102503,7 +102641,7 @@
102503
102641
  return [{
102504
102642
  id: 'id',
102505
102643
  component: Id$3,
102506
- isEdited: isEdited$1
102644
+ isEdited: isEdited
102507
102645
  }];
102508
102646
  }
102509
102647
  function Id$3(props) {
@@ -102553,7 +102691,7 @@
102553
102691
  return [{
102554
102692
  id: 'linkName',
102555
102693
  component: LinkName,
102556
- isEdited: isEdited$1
102694
+ isEdited: isEdited
102557
102695
  }];
102558
102696
  }
102559
102697
  function LinkName(props) {
@@ -102607,13 +102745,13 @@
102607
102745
  let entries = [{
102608
102746
  id: 'messageRef',
102609
102747
  component: MessageRef$1,
102610
- isEdited: isEdited$4
102748
+ isEdited: isEdited$3
102611
102749
  }];
102612
102750
  if (message) {
102613
102751
  entries = [...entries, {
102614
102752
  id: 'messageName',
102615
102753
  component: MessageName$1,
102616
- isEdited: isEdited$1
102754
+ isEdited: isEdited
102617
102755
  }];
102618
102756
  }
102619
102757
  return entries;
@@ -102754,11 +102892,11 @@
102754
102892
  const entries = [{
102755
102893
  id: 'loopCardinality',
102756
102894
  component: LoopCardinality,
102757
- isEdited: isEdited$1
102895
+ isEdited: isEdited
102758
102896
  }, {
102759
102897
  id: 'completionCondition',
102760
102898
  component: CompletionCondition$1,
102761
- isEdited: isEdited$1
102899
+ isEdited: isEdited
102762
102900
  }];
102763
102901
  return entries;
102764
102902
  }
@@ -102981,7 +103119,7 @@
102981
103119
  return [{
102982
103120
  id: 'name',
102983
103121
  component: Name$3,
102984
- isEdited: isEdited$2
103122
+ isEdited: isEdited$1
102985
103123
  }];
102986
103124
  }
102987
103125
  function Name$3(props) {
@@ -103090,11 +103228,11 @@
103090
103228
  return [{
103091
103229
  id: 'processId',
103092
103230
  component: ProcessId,
103093
- isEdited: isEdited$1
103231
+ isEdited: isEdited
103094
103232
  }, {
103095
103233
  id: 'processName',
103096
103234
  component: ProcessName,
103097
- isEdited: isEdited$1
103235
+ isEdited: isEdited
103098
103236
  }];
103099
103237
  }
103100
103238
  function ProcessName(props) {
@@ -103166,34 +103304,34 @@
103166
103304
  return is$6(element, 'bpmn:Participant') && element.businessObject.get('processRef');
103167
103305
  }
103168
103306
 
103169
- const EMPTY_OPTION$3 = '';
103170
- const CREATE_NEW_OPTION$2 = 'create-new';
103171
-
103172
103307
  /**
103173
103308
  * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
103174
103309
  */
103175
103310
 
103311
+ const EMPTY_OPTION$3 = '';
103312
+ const CREATE_NEW_OPTION$2 = 'create-new';
103313
+
103176
103314
  /**
103177
- * @returns {Array<Entry>} entries
103315
+ * @returns {Entry[]}
103178
103316
  */
103179
- function SignalProps(props) {
103317
+ function SignalProps$1(props) {
103180
103318
  const {
103181
103319
  element
103182
103320
  } = props;
103183
- if (!isSignalSupported(element)) {
103321
+ if (!isSignalSupported$1(element)) {
103184
103322
  return [];
103185
103323
  }
103186
- const signal = getSignal(element);
103324
+ const signal = getSignal$1(element);
103187
103325
  let entries = [{
103188
103326
  id: 'signalRef',
103189
103327
  component: SignalRef,
103190
- isEdited: isEdited$4
103328
+ isEdited: isEdited$3
103191
103329
  }];
103192
103330
  if (signal) {
103193
103331
  entries = [...entries, {
103194
103332
  id: 'signalName',
103195
- component: SignalName,
103196
- isEdited: isEdited$1
103333
+ component: SignalName$1,
103334
+ isEdited: isEdited
103197
103335
  }];
103198
103336
  }
103199
103337
  return entries;
@@ -103205,9 +103343,9 @@
103205
103343
  const bpmnFactory = useService('bpmnFactory');
103206
103344
  const commandStack = useService('commandStack');
103207
103345
  const translate = useService('translate');
103208
- const signalEventDefinition = getSignalEventDefinition(element);
103346
+ const signalEventDefinition = getSignalEventDefinition$1(element);
103209
103347
  const getValue = () => {
103210
- const signal = getSignal(element);
103348
+ const signal = getSignal$1(element);
103211
103349
  if (signal) {
103212
103350
  return signal.get('id');
103213
103351
  }
@@ -103281,14 +103419,14 @@
103281
103419
  getOptions
103282
103420
  });
103283
103421
  }
103284
- function SignalName(props) {
103422
+ function SignalName$1(props) {
103285
103423
  const {
103286
103424
  element
103287
103425
  } = props;
103288
103426
  const commandStack = useService('commandStack');
103289
103427
  const translate = useService('translate');
103290
103428
  const debounce = useService('debounceInput');
103291
- const signal = getSignal(element);
103429
+ const signal = getSignal$1(element);
103292
103430
  const getValue = () => {
103293
103431
  return signal.get('name');
103294
103432
  };
@@ -103380,7 +103518,7 @@
103380
103518
  entries.push({
103381
103519
  id: getId$1(idPrefix, 'timerEventDefinitionType'),
103382
103520
  component: TimerEventDefinitionType$2,
103383
- isEdited: isEdited$4,
103521
+ isEdited: isEdited$3,
103384
103522
  timerEventDefinition,
103385
103523
  timerEventDefinitionType
103386
103524
  });
@@ -103388,7 +103526,7 @@
103388
103526
  entries.push({
103389
103527
  id: getId$1(idPrefix, 'timerEventDefinitionValue'),
103390
103528
  component: TimerEventDefinitionValue$2,
103391
- isEdited: isEdited$1,
103529
+ isEdited: isEdited,
103392
103530
  timerEventDefinition,
103393
103531
  timerEventDefinitionType
103394
103532
  });
@@ -103666,7 +103804,7 @@
103666
103804
  id: 'signal',
103667
103805
  label: translate('Signal'),
103668
103806
  component: Group,
103669
- entries: [...SignalProps({
103807
+ entries: [...SignalProps$1({
103670
103808
  element
103671
103809
  })]
103672
103810
  };
@@ -104273,7 +104411,7 @@
104273
104411
  return [{
104274
104412
  id: 'businessKey',
104275
104413
  component: BusinessKey$1,
104276
- isEdited: isEdited$4
104414
+ isEdited: isEdited$3
104277
104415
  }];
104278
104416
  }
104279
104417
  function BusinessKey$1(props) {
@@ -104341,28 +104479,28 @@
104341
104479
  const entries = [{
104342
104480
  id: 'calledElement',
104343
104481
  component: CalledElement,
104344
- isEdited: isEdited$1
104482
+ isEdited: isEdited
104345
104483
  }, {
104346
104484
  id: 'calledElementBinding',
104347
104485
  component: CalledElementBinding,
104348
- isEdited: isEdited$4
104486
+ isEdited: isEdited$3
104349
104487
  }, {
104350
104488
  id: 'calledElementTenantId',
104351
104489
  component: CalledElementTenantId,
104352
- isEdited: isEdited$1
104490
+ isEdited: isEdited
104353
104491
  }];
104354
104492
  const binding = getBusinessObject$2(element).get('camunda:calledElementBinding');
104355
104493
  if (binding === 'version') {
104356
104494
  entries.splice(-1, 0, {
104357
104495
  id: 'calledElementVersion',
104358
104496
  component: CalledElementVersion,
104359
- isEdited: isEdited$1
104497
+ isEdited: isEdited
104360
104498
  });
104361
104499
  } else if (binding === 'versionTag') {
104362
104500
  entries.splice(-1, 0, {
104363
104501
  id: 'calledElementVersionTag',
104364
104502
  component: CalledElementVersionTag,
104365
- isEdited: isEdited$1
104503
+ isEdited: isEdited
104366
104504
  });
104367
104505
  }
104368
104506
  return entries;
@@ -104509,21 +104647,21 @@
104509
104647
  const entries = [{
104510
104648
  id: 'calledElementCaseRef',
104511
104649
  component: CaseRef,
104512
- isEdited: isEdited$1
104650
+ isEdited: isEdited
104513
104651
  }, {
104514
104652
  id: 'calledElementCaseBinding',
104515
104653
  component: CaseBinding,
104516
- isEdited: isEdited$4
104654
+ isEdited: isEdited$3
104517
104655
  }, {
104518
104656
  id: 'calledElementCaseTenantId',
104519
104657
  component: CaseTenantId,
104520
- isEdited: isEdited$1
104658
+ isEdited: isEdited
104521
104659
  }];
104522
104660
  if (getBusinessObject$2(element).get('camunda:caseBinding') === 'version') {
104523
104661
  entries.splice(-1, 0, {
104524
104662
  id: 'calledElementCaseVersion',
104525
104663
  component: CaseVersion,
104526
- isEdited: isEdited$1
104664
+ isEdited: isEdited
104527
104665
  });
104528
104666
  }
104529
104667
  return entries;
@@ -104642,20 +104780,20 @@
104642
104780
  const entries = [{
104643
104781
  id: 'calledElementDelegateVariableMappingType',
104644
104782
  component: DelegateVariableMappingType,
104645
- isEdited: isEdited$4
104783
+ isEdited: isEdited$3
104646
104784
  }];
104647
104785
  const type = getDelegateVariableMappingType(element);
104648
104786
  if (type === 'class') {
104649
104787
  entries.push({
104650
104788
  id: 'calledElementVariableMappingClass',
104651
104789
  component: VariableMappingClass,
104652
- isEdited: isEdited$1
104790
+ isEdited: isEdited
104653
104791
  });
104654
104792
  } else if (type === 'delegateExpression') {
104655
104793
  entries.push({
104656
104794
  id: 'calledElementVariableMappingDelegateExpression',
104657
104795
  component: VariableMappingDelegateExpression,
104658
- isEdited: isEdited$1
104796
+ isEdited: isEdited
104659
104797
  });
104660
104798
  }
104661
104799
  return entries;
@@ -104780,7 +104918,7 @@
104780
104918
  entries.push({
104781
104919
  id: 'calledElementType',
104782
104920
  component: CalledElementType,
104783
- isEdited: isEdited$4
104921
+ isEdited: isEdited$3
104784
104922
  });
104785
104923
  const calledElementType = getCalledElementType(element);
104786
104924
  if (calledElementType === 'bpmn') {
@@ -104872,7 +105010,7 @@
104872
105010
  entries.push({
104873
105011
  id: 'calledElementBusinessKeyExpression',
104874
105012
  component: BusinessKeyExpression,
104875
- isEdited: isEdited$1
105013
+ isEdited: isEdited
104876
105014
  });
104877
105015
  }
104878
105016
  return entries;
@@ -105002,11 +105140,11 @@
105002
105140
  return [{
105003
105141
  id: 'candidateStarterGroups',
105004
105142
  component: CandidateStarterGroups,
105005
- isEdited: isEdited$1
105143
+ isEdited: isEdited
105006
105144
  }, {
105007
105145
  id: 'candidateStarterUsers',
105008
105146
  component: CandidateStarterUsers,
105009
- isEdited: isEdited$1
105147
+ isEdited: isEdited
105010
105148
  }];
105011
105149
  }
105012
105150
  function CandidateStarterGroups(props) {
@@ -105099,7 +105237,7 @@
105099
105237
  entries.push({
105100
105238
  id: 'conditionType',
105101
105239
  component: ConditionType,
105102
- isEdited: isEdited$4
105240
+ isEdited: isEdited$3
105103
105241
  });
105104
105242
  const conditionType = getConditionType(element);
105105
105243
  if (conditionType === 'script') {
@@ -105110,7 +105248,7 @@
105110
105248
  entries.push({
105111
105249
  id: 'conditionExpression',
105112
105250
  component: ConditionExpression,
105113
- isEdited: isEdited$1
105251
+ isEdited: isEdited
105114
105252
  });
105115
105253
  }
105116
105254
  return entries;
@@ -105195,14 +105333,14 @@
105195
105333
  entries.push({
105196
105334
  id: 'conditionScriptLanguage',
105197
105335
  component: Language,
105198
- isEdited: isEdited$1
105336
+ isEdited: isEdited
105199
105337
  });
105200
105338
 
105201
105339
  // (2) type
105202
105340
  entries.push({
105203
105341
  id: 'conditionScriptType',
105204
105342
  component: ScriptType,
105205
- isEdited: isEdited$4
105343
+ isEdited: isEdited$3
105206
105344
  });
105207
105345
 
105208
105346
  // (3) script
@@ -105210,14 +105348,14 @@
105210
105348
  entries.push({
105211
105349
  id: 'conditionScriptValue',
105212
105350
  component: Script$1,
105213
- isEdited: isEdited$2
105351
+ isEdited: isEdited$1
105214
105352
  });
105215
105353
  } else if (scriptType === 'resource') {
105216
105354
  // (4) resource
105217
105355
  entries.push({
105218
105356
  id: 'conditionScriptResource',
105219
105357
  component: Resource$1,
105220
- isEdited: isEdited$1
105358
+ isEdited: isEdited
105221
105359
  });
105222
105360
  }
105223
105361
  return entries;
@@ -105355,13 +105493,13 @@
105355
105493
  entries.push({
105356
105494
  id: 'conditionVariableName',
105357
105495
  component: VariableName,
105358
- isEdited: isEdited$1
105496
+ isEdited: isEdited
105359
105497
  });
105360
- if (!is$6(element, 'bpmn:StartEvent')) {
105498
+ if (!is$6(element, 'bpmn:StartEvent') || isInEventSubProcess$1(element)) {
105361
105499
  entries.push({
105362
105500
  id: 'conditionVariableEvents',
105363
105501
  component: VariableEvents,
105364
- isEdited: isEdited$1
105502
+ isEdited: isEdited
105365
105503
  });
105366
105504
  }
105367
105505
  return entries;
@@ -105490,6 +105628,11 @@
105490
105628
  function createFormalExpression(parent, attributes, bpmnFactory) {
105491
105629
  return createElement('bpmn:FormalExpression', attributes, is$6(parent, 'bpmn:SequenceFlow') ? getBusinessObject$2(parent) : getConditionalEventDefinition(parent), bpmnFactory);
105492
105630
  }
105631
+ function isInEventSubProcess$1(element) {
105632
+ const bo = getBusinessObject$2(element),
105633
+ parent = bo.$parent;
105634
+ return is$6(parent, 'bpmn:SubProcess') && parent.triggeredByEvent;
105635
+ }
105493
105636
 
105494
105637
  /**
105495
105638
  * Cf. https://docs.camunda.org/manual/latest/user-guide/process-engine/scripting/
@@ -105508,7 +105651,7 @@
105508
105651
  entries.push({
105509
105652
  id: idPrefix + 'scriptFormat',
105510
105653
  component: Format,
105511
- isEdited: isEdited$1,
105654
+ isEdited: isEdited,
105512
105655
  idPrefix,
105513
105656
  script
105514
105657
  });
@@ -105517,7 +105660,7 @@
105517
105660
  entries.push({
105518
105661
  id: idPrefix + 'scriptType',
105519
105662
  component: Type$3,
105520
- isEdited: isEdited$4,
105663
+ isEdited: isEdited$3,
105521
105664
  idPrefix,
105522
105665
  script
105523
105666
  });
@@ -105527,7 +105670,7 @@
105527
105670
  entries.push({
105528
105671
  id: idPrefix + 'scriptValue',
105529
105672
  component: Script,
105530
- isEdited: isEdited$2,
105673
+ isEdited: isEdited$1,
105531
105674
  idPrefix,
105532
105675
  script
105533
105676
  });
@@ -105538,7 +105681,7 @@
105538
105681
  entries.push({
105539
105682
  id: idPrefix + 'scriptResource',
105540
105683
  component: Resource,
105541
- isEdited: isEdited$1,
105684
+ isEdited: isEdited,
105542
105685
  idPrefix,
105543
105686
  script
105544
105687
  });
@@ -106162,13 +106305,13 @@
106162
106305
  let entries = [{
106163
106306
  id: idPrefix + '-name',
106164
106307
  component: Name$2,
106165
- isEdited: isEdited$1,
106308
+ isEdited: isEdited,
106166
106309
  idPrefix,
106167
106310
  parameter
106168
106311
  }, {
106169
106312
  id: idPrefix + '-type',
106170
106313
  component: Type$2,
106171
- isEdited: isEdited$4,
106314
+ isEdited: isEdited$3,
106172
106315
  idPrefix,
106173
106316
  parameter
106174
106317
  }];
@@ -106178,7 +106321,7 @@
106178
106321
  entries.push({
106179
106322
  id: idPrefix + '-stringOrExpression',
106180
106323
  component: StringOrExpression,
106181
- isEdited: isEdited$2,
106324
+ isEdited: isEdited$1,
106182
106325
  idPrefix,
106183
106326
  parameter
106184
106327
  });
@@ -106664,7 +106807,7 @@
106664
106807
  entries.splice(idx, 0, {
106665
106808
  id: 'errorMessage',
106666
106809
  component: ErrorMessage$1,
106667
- isEdited: isEdited$1
106810
+ isEdited: isEdited
106668
106811
  });
106669
106812
  }
106670
106813
  if (!canHaveErrorVariables(element)) {
@@ -106675,11 +106818,11 @@
106675
106818
  entries.push({
106676
106819
  id: 'errorCodeVariable',
106677
106820
  component: ErrorCodeVariable,
106678
- isEdited: isEdited$1
106821
+ isEdited: isEdited
106679
106822
  }, {
106680
106823
  id: 'errorMessageVariable',
106681
106824
  component: ErrorMessageVariable,
106682
- isEdited: isEdited$1
106825
+ isEdited: isEdited
106683
106826
  });
106684
106827
  return entries;
106685
106828
  }
@@ -106793,7 +106936,7 @@
106793
106936
  let entries = [{
106794
106937
  id: idPrefix + '-errorRef',
106795
106938
  component: ErrorRef,
106796
- isEdited: isEdited$4,
106939
+ isEdited: isEdited$3,
106797
106940
  errorEventDefinition,
106798
106941
  idPrefix
106799
106942
  }];
@@ -106802,21 +106945,21 @@
106802
106945
  entries = [...entries, {
106803
106946
  id: idPrefix + '-errorName',
106804
106947
  component: ErrorName,
106805
- isEdited: isEdited$1,
106948
+ isEdited: isEdited,
106806
106949
  error,
106807
106950
  errorEventDefinition,
106808
106951
  idPrefix
106809
106952
  }, {
106810
106953
  id: idPrefix + '-errorCode',
106811
106954
  component: ErrorCode,
106812
- isEdited: isEdited$1,
106955
+ isEdited: isEdited,
106813
106956
  error,
106814
106957
  errorEventDefinition,
106815
106958
  idPrefix
106816
106959
  }, {
106817
106960
  id: idPrefix + '-errorMessage',
106818
106961
  component: ErrorMessage,
106819
- isEdited: isEdited$1,
106962
+ isEdited: isEdited,
106820
106963
  error,
106821
106964
  errorEventDefinition,
106822
106965
  idPrefix
@@ -107136,7 +107279,7 @@
107136
107279
  entries.push({
107137
107280
  id: 'escalationCodeVariable',
107138
107281
  component: EscalationCodeVariable,
107139
- isEdited: isEdited$1
107282
+ isEdited: isEdited
107140
107283
  });
107141
107284
  return entries;
107142
107285
  }
@@ -107188,7 +107331,7 @@
107188
107331
  return [{
107189
107332
  id: 'externalTaskPriority',
107190
107333
  component: ExternalTaskPriority,
107191
- isEdited: isEdited$1
107334
+ isEdited: isEdited
107192
107335
  }];
107193
107336
  }
107194
107337
  function ExternalTaskPriority(props) {
@@ -108330,7 +108473,7 @@
108330
108473
  return [{
108331
108474
  id: 'formType',
108332
108475
  component: FormType,
108333
- isEdited: isEdited$4
108476
+ isEdited: isEdited$3
108334
108477
  }];
108335
108478
  }
108336
108479
  function FormType(props) {
@@ -108508,23 +108651,23 @@
108508
108651
  entries.push({
108509
108652
  id: 'formKey',
108510
108653
  component: FormKey,
108511
- isEdited: isEdited$1
108654
+ isEdited: isEdited
108512
108655
  });
108513
108656
  } else if (formType === 'formRef') {
108514
108657
  entries.push({
108515
108658
  id: 'formRef',
108516
108659
  component: FormRef,
108517
- isEdited: isEdited$1
108660
+ isEdited: isEdited
108518
108661
  }, {
108519
108662
  id: 'formRefBinding',
108520
108663
  component: Binding$1,
108521
- isEdited: isEdited$4
108664
+ isEdited: isEdited$3
108522
108665
  });
108523
108666
  if (bindingType === 'version') {
108524
108667
  entries.push({
108525
108668
  id: 'formRefVersion',
108526
108669
  component: Version$1,
108527
- isEdited: isEdited$1
108670
+ isEdited: isEdited
108528
108671
  });
108529
108672
  }
108530
108673
  }
@@ -108656,7 +108799,7 @@
108656
108799
  return [{
108657
108800
  id: 'historyTimeToLive',
108658
108801
  component: HistoryTimeToLive,
108659
- isEdited: isEdited$1
108802
+ isEdited: isEdited
108660
108803
  }];
108661
108804
  }
108662
108805
  function HistoryTimeToLive(props) {
@@ -108710,14 +108853,14 @@
108710
108853
  entries.push({
108711
108854
  id: 'decisionRef',
108712
108855
  component: DecisionRef,
108713
- isEdited: isEdited$1
108856
+ isEdited: isEdited
108714
108857
  });
108715
108858
 
108716
108859
  // (2) binding
108717
108860
  entries.push({
108718
108861
  id: 'decisionRefBinding',
108719
108862
  component: Binding,
108720
- isEdited: isEdited$4
108863
+ isEdited: isEdited$3
108721
108864
  });
108722
108865
 
108723
108866
  // (3) version
@@ -108725,7 +108868,7 @@
108725
108868
  entries.push({
108726
108869
  id: 'decisionRefVersion',
108727
108870
  component: Version,
108728
- isEdited: isEdited$1
108871
+ isEdited: isEdited
108729
108872
  });
108730
108873
  }
108731
108874
 
@@ -108734,7 +108877,7 @@
108734
108877
  entries.push({
108735
108878
  id: 'decisionRefVersionTag',
108736
108879
  component: VersionTag$1,
108737
- isEdited: isEdited$1
108880
+ isEdited: isEdited
108738
108881
  });
108739
108882
  }
108740
108883
 
@@ -108742,14 +108885,14 @@
108742
108885
  entries.push({
108743
108886
  id: 'decisionRefTenantId',
108744
108887
  component: TenantId,
108745
- isEdited: isEdited$1
108888
+ isEdited: isEdited
108746
108889
  });
108747
108890
 
108748
108891
  // (6) resultVariable
108749
108892
  entries.push({
108750
108893
  id: 'decisionRefResultVariable',
108751
108894
  component: ResultVariable$2,
108752
- isEdited: isEdited$1
108895
+ isEdited: isEdited
108753
108896
  });
108754
108897
 
108755
108898
  // (7) mapDecisionResult
@@ -108757,7 +108900,7 @@
108757
108900
  entries.push({
108758
108901
  id: 'mapDecisionResult',
108759
108902
  component: MapDecisionResult,
108760
- isEdited: isEdited$4
108903
+ isEdited: isEdited$3
108761
108904
  });
108762
108905
  }
108763
108906
  return entries;
@@ -109049,7 +109192,7 @@
109049
109192
  return [{
109050
109193
  id: 'implementationType',
109051
109194
  component: ImplementationType,
109052
- isEdited: isEdited$4
109195
+ isEdited: isEdited$3
109053
109196
  }];
109054
109197
  }
109055
109198
  function ImplementationType(props) {
@@ -109249,23 +109392,23 @@
109249
109392
  entries.push({
109250
109393
  id: 'javaClass',
109251
109394
  component: JavaClass,
109252
- isEdited: isEdited$1
109395
+ isEdited: isEdited
109253
109396
  });
109254
109397
  } else if (implementationType === 'expression') {
109255
109398
  entries.push({
109256
109399
  id: 'expression',
109257
109400
  component: Expression$1,
109258
- isEdited: isEdited$1
109401
+ isEdited: isEdited
109259
109402
  }, {
109260
109403
  id: 'expressionResultVariable',
109261
109404
  component: ResultVariable$1,
109262
- isEdited: isEdited$1
109405
+ isEdited: isEdited
109263
109406
  });
109264
109407
  } else if (implementationType === 'delegateExpression') {
109265
109408
  entries.push({
109266
109409
  id: 'delegateExpression',
109267
109410
  component: DelegateExpression,
109268
- isEdited: isEdited$1
109411
+ isEdited: isEdited
109269
109412
  });
109270
109413
  } else if (implementationType === 'dmn') {
109271
109414
  entries.push(...DmnImplementationProps({
@@ -109275,13 +109418,13 @@
109275
109418
  entries.push({
109276
109419
  id: 'externalTopic',
109277
109420
  component: Topic,
109278
- isEdited: isEdited$1
109421
+ isEdited: isEdited
109279
109422
  });
109280
109423
  } else if (implementationType === 'connector') {
109281
109424
  entries.push({
109282
109425
  id: 'connectorId',
109283
109426
  component: ConnectorId,
109284
- isEdited: isEdited$1
109427
+ isEdited: isEdited
109285
109428
  });
109286
109429
  }
109287
109430
  return entries;
@@ -109485,7 +109628,7 @@
109485
109628
  return [{
109486
109629
  id: 'initiator',
109487
109630
  component: Initiator,
109488
- isEdited: isEdited$1
109631
+ isEdited: isEdited
109489
109632
  }];
109490
109633
  }
109491
109634
  function Initiator(props) {
@@ -109566,14 +109709,14 @@
109566
109709
  }
109567
109710
  };
109568
109711
  function addInMapping() {
109569
- const businessObject = getSignalEventDefinition(element) || getBusinessObject$2(element);
109712
+ const businessObject = getSignalEventDefinition$1(element) || getBusinessObject$2(element);
109570
109713
  const mapping = createElement('camunda:In', {
109571
109714
  variables: 'all'
109572
109715
  }, null, bpmnFactory);
109573
109716
  addExtensionElements(element, businessObject, mapping, bpmnFactory, commandStack);
109574
109717
  }
109575
109718
  function removeInMapping() {
109576
- const businessObject = getSignalEventDefinition(element) || getBusinessObject$2(element);
109719
+ const businessObject = getSignalEventDefinition$1(element) || getBusinessObject$2(element);
109577
109720
  const mappings = findRelevantInMappings(element);
109578
109721
  removeExtensionElements$1(element, businessObject, mappings, commandStack);
109579
109722
  }
@@ -109615,7 +109758,7 @@
109615
109758
  // helper //////////////////////////
109616
109759
 
109617
109760
  function areInMappingsSupported$1(element) {
109618
- const signalEventDefinition = getSignalEventDefinition(element);
109761
+ const signalEventDefinition = getSignalEventDefinition$1(element);
109619
109762
  if (signalEventDefinition) {
109620
109763
  return isAny$1(element, ['bpmn:IntermediateThrowEvent', 'bpmn:EndEvent']);
109621
109764
  }
@@ -109623,7 +109766,7 @@
109623
109766
  }
109624
109767
  function getInMappings$1(element) {
109625
109768
  const businessObject = getBusinessObject$2(element);
109626
- const signalEventDefinition = getSignalEventDefinition(businessObject);
109769
+ const signalEventDefinition = getSignalEventDefinition$1(businessObject);
109627
109770
  return getExtensionElementsList$1(signalEventDefinition || businessObject, 'camunda:In');
109628
109771
  }
109629
109772
  function findRelevantInMappings(element) {
@@ -109914,7 +110057,7 @@
109914
110057
  }) {
109915
110058
  return function (event) {
109916
110059
  event.stopPropagation();
109917
- const businessObject = getSignalEventDefinition(element) || getBusinessObject$2(element);
110060
+ const businessObject = getSignalEventDefinition$1(element) || getBusinessObject$2(element);
109918
110061
  removeExtensionElements$1(element, businessObject, mapping, commandStack);
109919
110062
  };
109920
110063
  }
@@ -109925,7 +110068,7 @@
109925
110068
  }) {
109926
110069
  return function (event) {
109927
110070
  event.stopPropagation();
109928
- const businessObject = getSignalEventDefinition(element) || getBusinessObject$2(element);
110071
+ const businessObject = getSignalEventDefinition$1(element) || getBusinessObject$2(element);
109929
110072
  const newMapping = createElement('camunda:In', {
109930
110073
  source: '' // source is the default type
109931
110074
  }, null, bpmnFactory);
@@ -109937,7 +110080,7 @@
109937
110080
 
109938
110081
  function getInMappings(element) {
109939
110082
  const businessObject = getBusinessObject$2(element);
109940
- const signalEventDefinition = getSignalEventDefinition(businessObject);
110083
+ const signalEventDefinition = getSignalEventDefinition$1(businessObject);
109941
110084
  const mappings = getExtensionElementsList$1(signalEventDefinition || businessObject, 'camunda:In');
109942
110085
 
109943
110086
  // only retrieve relevant mappings here, others are handled in other groups
@@ -109948,7 +110091,7 @@
109948
110091
  });
109949
110092
  }
109950
110093
  function areInMappingsSupported(element) {
109951
- const signalEventDefinition = getSignalEventDefinition(element);
110094
+ const signalEventDefinition = getSignalEventDefinition$1(element);
109952
110095
  if (signalEventDefinition) {
109953
110096
  return isAny$1(element, ['bpmn:IntermediateThrowEvent', 'bpmn:EndEvent']);
109954
110097
  }
@@ -110029,7 +110172,7 @@
110029
110172
  entries.push({
110030
110173
  id: 'retryTimeCycle',
110031
110174
  component: RetryTimeCycle,
110032
- isEdited: isEdited$1
110175
+ isEdited: isEdited
110033
110176
  });
110034
110177
  }
110035
110178
 
@@ -110041,7 +110184,7 @@
110041
110184
  entries.push({
110042
110185
  id: 'jobPriority',
110043
110186
  component: JobPriority,
110044
- isEdited: isEdited$1
110187
+ isEdited: isEdited
110045
110188
  });
110046
110189
  }
110047
110190
  return entries;
@@ -110208,11 +110351,11 @@
110208
110351
  entries.push({
110209
110352
  id: 'collection',
110210
110353
  component: Collection,
110211
- isEdited: isEdited$1
110354
+ isEdited: isEdited
110212
110355
  }, {
110213
110356
  id: 'elementVariable',
110214
110357
  component: ElementVariable,
110215
- isEdited: isEdited$1
110358
+ isEdited: isEdited
110216
110359
  }, {
110217
110360
  id: 'multiInstanceAsynchronousBefore',
110218
110361
  component: MultiInstanceAsynchronousBefore,
@@ -110230,7 +110373,7 @@
110230
110373
  }, {
110231
110374
  id: 'multiInstanceRetryTimeCycle',
110232
110375
  component: MultiInstanceRetryTimeCycle,
110233
- isEdited: isEdited$1
110376
+ isEdited: isEdited
110234
110377
  });
110235
110378
  }
110236
110379
  return entries;
@@ -110859,7 +111002,7 @@
110859
111002
  entries.push({
110860
111003
  id: getId(idPrefix, 'timerEventDefinitionType'),
110861
111004
  component: TimerEventDefinitionType,
110862
- isEdited: isEdited$4,
111005
+ isEdited: isEdited$3,
110863
111006
  timerEventDefinition,
110864
111007
  timerEventDefinitionType
110865
111008
  });
@@ -110867,7 +111010,7 @@
110867
111010
  entries.push({
110868
111011
  id: getId(idPrefix, 'timerEventDefinitionValue'),
110869
111012
  component: TimerEventDefinitionValue,
110870
- isEdited: isEdited$1,
111013
+ isEdited: isEdited,
110871
111014
  timerEventDefinition,
110872
111015
  timerEventDefinitionType
110873
111016
  });
@@ -111340,7 +111483,7 @@
111340
111483
  id: id,
111341
111484
  label: translate('Listener ID'),
111342
111485
  debounce,
111343
- isEdited: isEdited$1,
111486
+ isEdited: isEdited,
111344
111487
  setValue: value => {
111345
111488
  commandStack.execute('element.updateModdleProperties', {
111346
111489
  element,
@@ -111800,7 +111943,7 @@
111800
111943
  entries.push({
111801
111944
  id: 'scriptResultVariable',
111802
111945
  component: ResultVariable,
111803
- isEdited: isEdited$1
111946
+ isEdited: isEdited
111804
111947
  });
111805
111948
  return entries;
111806
111949
  }
@@ -111898,27 +112041,27 @@
111898
112041
  return [{
111899
112042
  id: 'assignee',
111900
112043
  component: Assignee,
111901
- isEdited: isEdited$1
112044
+ isEdited: isEdited
111902
112045
  }, {
111903
112046
  id: 'candidateGroups',
111904
112047
  component: CandidateGroups,
111905
- isEdited: isEdited$1
112048
+ isEdited: isEdited
111906
112049
  }, {
111907
112050
  id: 'candidateUsers',
111908
112051
  component: CandidateUsers,
111909
- isEdited: isEdited$1
112052
+ isEdited: isEdited
111910
112053
  }, {
111911
112054
  id: 'dueDate',
111912
112055
  component: DueDate,
111913
- isEdited: isEdited$1
112056
+ isEdited: isEdited
111914
112057
  }, {
111915
112058
  id: 'followUpDate',
111916
112059
  component: FollowUpDate,
111917
- isEdited: isEdited$1
112060
+ isEdited: isEdited
111918
112061
  }, {
111919
112062
  id: 'priority',
111920
112063
  component: Priority,
111921
- isEdited: isEdited$1
112064
+ isEdited: isEdited
111922
112065
  }];
111923
112066
  }
111924
112067
  function Assignee(props) {
@@ -112109,7 +112252,7 @@
112109
112252
  return [{
112110
112253
  id: 'versionTag',
112111
112254
  component: VersionTag,
112112
- isEdited: isEdited$1
112255
+ isEdited: isEdited
112113
112256
  }];
112114
112257
  }
112115
112258
  function VersionTag(props) {
@@ -114542,7 +114685,11 @@
114542
114685
  ElementTemplatesLoader.$inject = ['config.elementTemplates', 'eventBus', 'elementTemplates', 'moddle'];
114543
114686
 
114544
114687
  function unlinkTemplate$1(element, injector) {
114545
- const modeling = injector.get('modeling');
114688
+ const modeling = injector.get('modeling'),
114689
+ eventBus = injector.get('eventBus');
114690
+ eventBus.fire('elementTemplates.unlink', {
114691
+ element
114692
+ });
114546
114693
  modeling.updateProperties(element, {
114547
114694
  'camunda:modelerTemplate': null,
114548
114695
  'camunda:modelerTemplateVersion': null
@@ -114550,7 +114697,11 @@
114550
114697
  }
114551
114698
  function removeTemplate(element, injector) {
114552
114699
  const replace = injector.get('replace'),
114553
- selection = injector.get('selection');
114700
+ selection = injector.get('selection'),
114701
+ eventBus = injector.get('eventBus');
114702
+ eventBus.fire('elementTemplates.remove', {
114703
+ element
114704
+ });
114554
114705
  const businessObject = getBusinessObject$2(element);
114555
114706
  const type = businessObject.$type,
114556
114707
  eventDefinitionType = getEventDefinitionType(businessObject);
@@ -114563,7 +114714,12 @@
114563
114714
  selection.select(newElement);
114564
114715
  }
114565
114716
  function updateTemplate$1(element, newTemplate, injector) {
114566
- const elementTemplates = injector.get('elementTemplates');
114717
+ const elementTemplates = injector.get('elementTemplates'),
114718
+ eventBus = injector.get('eventBus');
114719
+ eventBus.fire('elementTemplates.update', {
114720
+ element,
114721
+ newTemplate
114722
+ });
114567
114723
  return elementTemplates.applyTemplate(element, newTemplate);
114568
114724
  }
114569
114725
  function getVersionOrDateFromTemplate(template) {
@@ -114637,7 +114793,11 @@
114637
114793
  }
114638
114794
 
114639
114795
  function unlinkTemplate(element, injector) {
114640
- const modeling = injector.get('modeling');
114796
+ const modeling = injector.get('modeling'),
114797
+ eventBus = injector.get('eventBus');
114798
+ eventBus.fire('elementTemplates.unlink', {
114799
+ element
114800
+ });
114641
114801
 
114642
114802
  // remove template attributes
114643
114803
  modeling.updateProperties(element, {
@@ -115518,7 +115678,7 @@
115518
115678
  }
115519
115679
 
115520
115680
  /**
115521
- * Remove referenced element when template is unlinked.
115681
+ * Unlink referenced element when template is unlinked.
115522
115682
  */
115523
115683
  _handlePropertiesUpdate(context) {
115524
115684
  const {
@@ -115534,11 +115694,9 @@
115534
115694
  const bo = getBusinessObject$2(element);
115535
115695
  const message = findMessage(bo);
115536
115696
  if (message && getTemplateId$1(message)) {
115537
- const messageEventDefinition = bo.eventDefinitions[0];
115538
- this._modeling.updateModdleProperties(element, messageEventDefinition, {
115539
- 'messageRef': undefined
115697
+ this._modeling.updateModdleProperties(element, message, {
115698
+ [TEMPLATE_ID_ATTR$1]: null
115540
115699
  });
115541
- this._removeRootElement(message);
115542
115700
  }
115543
115701
  }
115544
115702
 
@@ -116311,7 +116469,7 @@
116311
116469
  }
116312
116470
 
116313
116471
  // get extension elements of either signal event definition or call activity
116314
- const extensionElements = this._getOrCreateExtensionElements(getSignalEventDefinition(element) || element);
116472
+ const extensionElements = this._getOrCreateExtensionElements(getSignalEventDefinition$1(element) || element);
116315
116473
  const oldInsAndOuts = findExtensions(extensionElements, ['camunda:In', 'camunda:Out']);
116316
116474
  newProperties.forEach(newProperty => {
116317
116475
  const oldProperty = findOldProperty(oldTemplate, newProperty),
@@ -117236,7 +117394,7 @@
117236
117394
  return {
117237
117395
  id,
117238
117396
  component: DropdownProperty,
117239
- isEdited: isEdited$4,
117397
+ isEdited: isEdited$3,
117240
117398
  property,
117241
117399
  scope
117242
117400
  };
@@ -117245,7 +117403,7 @@
117245
117403
  return {
117246
117404
  id,
117247
117405
  component: StringProperty,
117248
- isEdited: isEdited$1,
117406
+ isEdited: isEdited,
117249
117407
  property,
117250
117408
  scope
117251
117409
  };
@@ -117254,7 +117412,7 @@
117254
117412
  return {
117255
117413
  id,
117256
117414
  component: TextAreaProperty,
117257
- isEdited: isEdited$2,
117415
+ isEdited: isEdited$1,
117258
117416
  property,
117259
117417
  scope
117260
117418
  };
@@ -121511,9 +121669,11 @@
121511
121669
  /**
121512
121670
  * Flatten array, one level deep.
121513
121671
  *
121514
- * @param {Array<?>} arr
121672
+ * @template T
121515
121673
  *
121516
- * @return {Array<?>}
121674
+ * @param {T[][]} arr
121675
+ *
121676
+ * @return {T[]}
121517
121677
  */
121518
121678
 
121519
121679
  const nativeToString = Object.prototype.toString;
@@ -121535,6 +121695,11 @@
121535
121695
  return nativeToString.call(obj) === '[object Number]';
121536
121696
  }
121537
121697
 
121698
+ /**
121699
+ * @param {any} obj
121700
+ *
121701
+ * @return {boolean}
121702
+ */
121538
121703
  function isFunction(obj) {
121539
121704
  const tag = nativeToString.call(obj);
121540
121705
 
@@ -121559,22 +121724,74 @@
121559
121724
  return nativeHasOwnProperty.call(target, key);
121560
121725
  }
121561
121726
 
121727
+ /**
121728
+ * @template T
121729
+ * @typedef { (
121730
+ * ((e: T) => boolean) |
121731
+ * ((e: T, idx: number) => boolean) |
121732
+ * ((e: T, key: string) => boolean) |
121733
+ * string |
121734
+ * number
121735
+ * ) } Matcher
121736
+ */
121737
+
121738
+ /**
121739
+ * @template T
121740
+ * @template U
121741
+ *
121742
+ * @typedef { (
121743
+ * ((e: T) => U) | string | number
121744
+ * ) } Extractor
121745
+ */
121746
+
121747
+
121748
+ /**
121749
+ * @template T
121750
+ * @typedef { (val: T, key: any) => boolean } MatchFn
121751
+ */
121752
+
121753
+ /**
121754
+ * @template T
121755
+ * @typedef { T[] } ArrayCollection
121756
+ */
121757
+
121758
+ /**
121759
+ * @template T
121760
+ * @typedef { { [key: string]: T } } StringKeyValueCollection
121761
+ */
121762
+
121763
+ /**
121764
+ * @template T
121765
+ * @typedef { { [key: number]: T } } NumberKeyValueCollection
121766
+ */
121767
+
121768
+ /**
121769
+ * @template T
121770
+ * @typedef { StringKeyValueCollection<T> | NumberKeyValueCollection<T> } KeyValueCollection
121771
+ */
121772
+
121773
+ /**
121774
+ * @template T
121775
+ * @typedef { KeyValueCollection<T> | ArrayCollection<T> } Collection
121776
+ */
121777
+
121562
121778
  /**
121563
121779
  * Find element in collection.
121564
121780
  *
121565
- * @param {Array|Object} collection
121566
- * @param {Function|Object} matcher
121781
+ * @template T
121782
+ * @param {Collection<T>} collection
121783
+ * @param {Matcher<T>} matcher
121567
121784
  *
121568
121785
  * @return {Object}
121569
121786
  */
121570
121787
  function find(collection, matcher) {
121571
121788
 
121572
- matcher = toMatcher(matcher);
121789
+ const matchFn = toMatcher(matcher);
121573
121790
 
121574
121791
  let match;
121575
121792
 
121576
121793
  forEach(collection, function(val, key) {
121577
- if (matcher(val, key)) {
121794
+ if (matchFn(val, key)) {
121578
121795
  match = val;
121579
121796
 
121580
121797
  return false;
@@ -121590,10 +121807,11 @@
121590
121807
  * Iterate over collection; returning something
121591
121808
  * (non-undefined) will stop iteration.
121592
121809
  *
121593
- * @param {Array|Object} collection
121594
- * @param {Function} iterator
121810
+ * @template T
121811
+ * @param {Collection<T>} collection
121812
+ * @param { ((item: T, idx: number) => (boolean|void)) | ((item: T, key: string) => (boolean|void)) } iterator
121595
121813
  *
121596
- * @return {Object} return result that stopped the iteration
121814
+ * @return {T} return result that stopped the iteration
121597
121815
  */
121598
121816
  function forEach(collection, iterator) {
121599
121817
 
@@ -121636,6 +121854,12 @@
121636
121854
  }
121637
121855
 
121638
121856
 
121857
+ /**
121858
+ * @template T
121859
+ * @param {Matcher<T>} matcher
121860
+ *
121861
+ * @return {MatchFn<T>}
121862
+ */
121639
121863
  function toMatcher(matcher) {
121640
121864
  return isFunction(matcher) ? matcher : (e) => {
121641
121865
  return e === matcher;
@@ -122467,8 +122691,12 @@
122467
122691
  * To change the icons, modify the SVGs in `./resources`, execute `npx svgo -f resources --datauri enc -o dist`,
122468
122692
  * and then replace respective icons with the optimized data URIs in `./dist`.
122469
122693
  */
122470
- const appendIcon = 'data:image/svg+xml,%3Csvg%20width%3D%2222%22%20height%3D%2222%22%20viewBox%3D%220%200%205.82%205.82%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M1.3%203.4c.3%200%20.5-.2.5-.5s-.2-.4-.5-.4c-.2%200-.4.1-.4.4%200%20.3.2.5.4.5zM3%203.4c.2%200%20.4-.2.4-.5s-.2-.4-.4-.4c-.3%200-.5.1-.5.4%200%20.3.2.5.5.5zM4.6%203.4c.2%200%20.4-.2.4-.5s-.2-.4-.4-.4c-.3%200-.5.1-.5.4%200%20.3.2.5.5.5z%22%2F%3E%0A%3C%2Fsvg%3E';
122471
- const createIcon = 'data:image/svg+xml,%3Csvg%20width%3D%2246%22%20height%3D%2246%22%20viewBox%3D%22-2%20-2%209.82%209.82%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M1.3%203.4c.3%200%20.5-.2.5-.5s-.2-.4-.5-.4c-.2%200-.4.1-.4.4%200%20.3.2.5.4.5zM3%203.4c.2%200%20.4-.2.4-.5s-.2-.4-.4-.4c-.3%200-.5.1-.5.4%200%20.3.2.5.5.5zM4.6%203.4c.2%200%20.4-.2.4-.5s-.2-.4-.4-.4c-.3%200-.5.1-.5.4%200%20.3.2.5.5.5z%22%2F%3E%0A%3C%2Fsvg%3E';
122694
+ const appendIcon = `<svg width="22" height="22" viewBox="0 0 5.82 5.82" xmlns="http://www.w3.org/2000/svg">
122695
+ <path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
122696
+ </svg>`;
122697
+ const createIcon = `<svg width="46" height="46" viewBox="-2 -2 9.82 9.82" xmlns="http://www.w3.org/2000/svg">
122698
+ <path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
122699
+ </svg>`;
122472
122700
 
122473
122701
  /**
122474
122702
  * A provider for append context pad button
@@ -122514,7 +122742,7 @@
122514
122742
  return {
122515
122743
  'append': {
122516
122744
  group: 'model',
122517
- imageUrl: appendIcon,
122745
+ html: `<div class="entry">${appendIcon}</div>`,
122518
122746
  title: translate('Append element'),
122519
122747
  action: {
122520
122748
  click: function(event, element) {
@@ -122560,10 +122788,15 @@
122560
122788
 
122561
122789
  function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}
122562
122790
 
122791
+ /**
122792
+ * @typedef { import('../model/Types').Element } Element
122793
+ * @typedef { import('../model/Types').ModdleElement } ModdleElement
122794
+ */
122795
+
122563
122796
  /**
122564
122797
  * Is an element of the given BPMN type?
122565
122798
  *
122566
- * @param {djs.model.Base|ModdleElement} element
122799
+ * @param {Element|ModdleElement} element
122567
122800
  * @param {string} type
122568
122801
  *
122569
122802
  * @return {boolean}
@@ -122578,8 +122811,8 @@
122578
122811
  /**
122579
122812
  * Return true if element has any of the given types.
122580
122813
  *
122581
- * @param {djs.model.Base} element
122582
- * @param {Array<string>} types
122814
+ * @param {Element|ModdleElement} element
122815
+ * @param {string[]} types
122583
122816
  *
122584
122817
  * @return {boolean}
122585
122818
  */
@@ -122592,7 +122825,7 @@
122592
122825
  /**
122593
122826
  * Return the business object for a given element.
122594
122827
  *
122595
- * @param {djs.model.Base|ModdleElement} element
122828
+ * @param {Element|ModdleElement} element
122596
122829
  *
122597
122830
  * @return {ModdleElement}
122598
122831
  */
@@ -122603,7 +122836,7 @@
122603
122836
  /**
122604
122837
  * Return the di object for a given element.
122605
122838
  *
122606
- * @param {djs.model.Base} element
122839
+ * @param {Element} element
122607
122840
  *
122608
122841
  * @return {ModdleElement}
122609
122842
  */
@@ -122611,14 +122844,25 @@
122611
122844
  return element && element.di;
122612
122845
  }
122613
122846
 
122614
- function isLabel(element) {
122615
- return element && !!element.labelTarget;
122847
+ /**
122848
+ * Checks whether a value is an instance of Label.
122849
+ *
122850
+ * @param {any} value
122851
+ *
122852
+ * @return {boolean}
122853
+ */
122854
+ function isLabel(value) {
122855
+ return isObject(value) && has(value, 'labelTarget');
122616
122856
  }
122617
122857
 
122618
122858
  /**
122859
+ * @typedef {import('../core/Types').ElementLike} ElementLike
122619
122860
  * @typedef {import('../core/EventBus').default} EventBus
122620
- * @typedef {import(./CommandInterceptor).HandlerFunction} HandlerFunction
122621
- * @typedef {import(./CommandInterceptor).ComposeHandlerFunction} ComposeHandlerFunction
122861
+ * @typedef {import('./CommandStack').CommandContext} CommandContext
122862
+ *
122863
+ * @typedef {string|string[]} Events
122864
+ * @typedef { (context: CommandContext) => ElementLike[] | void } HandlerFunction
122865
+ * @typedef { (context: CommandContext) => void } ComposeHandlerFunction
122622
122866
  */
122623
122867
 
122624
122868
  var DEFAULT_PRIORITY = 1000;
@@ -122630,10 +122874,9 @@
122630
122874
  * @class
122631
122875
  * @constructor
122632
122876
  *
122633
- * @param {EventBus} eventBus
122634
- *
122635
122877
  * @example
122636
122878
  *
122879
+ * ```javascript
122637
122880
  * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
122638
122881
  *
122639
122882
  * class CommandLogger extends CommandInterceptor {
@@ -122644,6 +122887,9 @@
122644
122887
  * console.log('commandStack.shape-create.preExecute', event);
122645
122888
  * });
122646
122889
  * }
122890
+ * ```
122891
+ *
122892
+ * @param {EventBus} eventBus
122647
122893
  */
122648
122894
  function CommandInterceptor(eventBus) {
122649
122895
 
@@ -122661,16 +122907,17 @@
122661
122907
  };
122662
122908
  }
122663
122909
 
122910
+
122664
122911
  /**
122665
- * Intercept a command during one of the phases.
122666
- *
122667
- * @param {string|string[]} [events] One or more commands to intercept.
122668
- * @param {string} [hook] Phase during which to intercept command.
122669
- * @param {number} [priority] Priority with which command will be intercepted.
122670
- * @param {ComposeHandlerFunction|HandlerFunction} handlerFn Callback.
122671
- * @param {boolean} [unwrap] Whether the event should be unwrapped.
122672
- * @param {*} [that] `this` value the callback will be called with.
122673
- */
122912
+ * Intercept a command during one of the phases.
122913
+ *
122914
+ * @param {Events} [events] command(s) to intercept
122915
+ * @param {string} [hook] phase to intercept
122916
+ * @param {number} [priority]
122917
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
122918
+ * @param {boolean} [unwrap] whether the event should be unwrapped
122919
+ * @param {any} [that]
122920
+ */
122674
122921
  CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
122675
122922
 
122676
122923
  if (isFunction(hook) || isNumber(hook)) {
@@ -122712,35 +122959,130 @@
122712
122959
  });
122713
122960
  };
122714
122961
 
122962
+ /**
122963
+ * Add a <canExecute> phase of command interceptor.
122964
+ *
122965
+ * @param {Events} [events] command(s) to intercept
122966
+ * @param {number} [priority]
122967
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
122968
+ * @param {boolean} [unwrap] whether the event should be unwrapped
122969
+ * @param {any} [that]
122970
+ */
122971
+ CommandInterceptor.prototype.canExecute = createHook('canExecute');
122715
122972
 
122716
- var hooks = [
122717
- 'canExecute',
122718
- 'preExecute',
122719
- 'preExecuted',
122720
- 'execute',
122721
- 'executed',
122722
- 'postExecute',
122723
- 'postExecuted',
122724
- 'revert',
122725
- 'reverted'
122726
- ];
122973
+ /**
122974
+ * Add a <preExecute> phase of command interceptor.
122975
+ *
122976
+ * @param {Events} [events] command(s) to intercept
122977
+ * @param {number} [priority]
122978
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
122979
+ * @param {boolean} [unwrap] whether the event should be unwrapped
122980
+ * @param {any} [that]
122981
+ */
122982
+ CommandInterceptor.prototype.preExecute = createHook('preExecute');
122983
+
122984
+ /**
122985
+ * Add a <preExecuted> phase of command interceptor.
122986
+ *
122987
+ * @param {Events} [events] command(s) to intercept
122988
+ * @param {number} [priority]
122989
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
122990
+ * @param {boolean} [unwrap] whether the event should be unwrapped
122991
+ * @param {any} [that]
122992
+ */
122993
+ CommandInterceptor.prototype.preExecuted = createHook('preExecuted');
122994
+
122995
+ /**
122996
+ * Add a <execute> phase of command interceptor.
122997
+ *
122998
+ * @param {Events} [events] command(s) to intercept
122999
+ * @param {number} [priority]
123000
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123001
+ * @param {boolean} [unwrap] whether the event should be unwrapped
123002
+ * @param {any} [that]
123003
+ */
123004
+ CommandInterceptor.prototype.execute = createHook('execute');
123005
+
123006
+ /**
123007
+ * Add a <executed> phase of command interceptor.
123008
+ *
123009
+ * @param {Events} [events] command(s) to intercept
123010
+ * @param {number} [priority]
123011
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123012
+ * @param {boolean} [unwrap] whether the event should be unwrapped
123013
+ * @param {any} [that]
123014
+ */
123015
+ CommandInterceptor.prototype.executed = createHook('executed');
123016
+
123017
+ /**
123018
+ * Add a <postExecute> phase of command interceptor.
123019
+ *
123020
+ * @param {Events} [events] command(s) to intercept
123021
+ * @param {number} [priority]
123022
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123023
+ * @param {boolean} [unwrap] whether the event should be unwrapped
123024
+ * @param {any} [that]
123025
+ */
123026
+ CommandInterceptor.prototype.postExecute = createHook('postExecute');
123027
+
123028
+ /**
123029
+ * Add a <postExecuted> phase of command interceptor.
123030
+ *
123031
+ * @param {Events} [events] command(s) to intercept
123032
+ * @param {number} [priority]
123033
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123034
+ * @param {boolean} [unwrap] whether the event should be unwrapped
123035
+ * @param {any} [that]
123036
+ */
123037
+ CommandInterceptor.prototype.postExecuted = createHook('postExecuted');
123038
+
123039
+ /**
123040
+ * Add a <revert> phase of command interceptor.
123041
+ *
123042
+ * @param {Events} [events] command(s) to intercept
123043
+ * @param {number} [priority]
123044
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123045
+ * @param {boolean} [unwrap] whether the event should be unwrapped
123046
+ * @param {any} [that]
123047
+ */
123048
+ CommandInterceptor.prototype.revert = createHook('revert');
123049
+
123050
+ /**
123051
+ * Add a <reverted> phase of command interceptor.
123052
+ *
123053
+ * @param {Events} [events] command(s) to intercept
123054
+ * @param {number} [priority]
123055
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123056
+ * @param {boolean} [unwrap] whether the event should be unwrapped
123057
+ * @param {any} [that]
123058
+ */
123059
+ CommandInterceptor.prototype.reverted = createHook('reverted');
122727
123060
 
122728
123061
  /*
122729
123062
  * Add prototype methods for each phase of command execution (e.g. execute,
122730
123063
  * revert).
123064
+ *
123065
+ * @param {string} hook
123066
+ *
123067
+ * @return { (
123068
+ * events?: Events,
123069
+ * priority?: number,
123070
+ * handlerFn: ComposeHandlerFunction|HandlerFunction,
123071
+ * unwrap?: boolean
123072
+ * ) => any }
122731
123073
  */
122732
- forEach(hooks, function(hook) {
123074
+ function createHook(hook) {
122733
123075
 
122734
123076
  /**
122735
- * Add prototype method for a specific phase of command execution.
123077
+ * @this {CommandInterceptor}
122736
123078
  *
122737
- * @param {string|string[]} [events] One or more commands to intercept.
122738
- * @param {number} [priority] Priority with which command will be intercepted.
122739
- * @param {ComposeHandlerFunction|HandlerFunction} handlerFn Callback.
122740
- * @param {boolean} [unwrap] Whether the event should be unwrapped.
122741
- * @param {*} [that] `this` value the callback will be called with.
123079
+ * @param {Events} [events]
123080
+ * @param {number} [priority]
123081
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
123082
+ * @param {boolean} [unwrap]
123083
+ * @param {any} [that]
122742
123084
  */
122743
- CommandInterceptor.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
123085
+ const hookFn = function(events, priority, handlerFn, unwrap, that) {
122744
123086
 
122745
123087
  if (isFunction(events) || isNumber(events)) {
122746
123088
  that = unwrap;
@@ -122752,7 +123094,9 @@
122752
123094
 
122753
123095
  this.on(events, hook, priority, handlerFn, unwrap, that);
122754
123096
  };
122755
- });
123097
+
123098
+ return hookFn;
123099
+ }
122756
123100
 
122757
123101
  /**
122758
123102
  * @typedef {import('../../core/EventBus').default} EventBus
@@ -122764,6 +123108,8 @@
122764
123108
  * Extensions should implement the init method to actually add their custom
122765
123109
  * modeling checks. Checks may be added via the #addRule(action, fn) method.
122766
123110
  *
123111
+ * @class
123112
+ *
122767
123113
  * @param {EventBus} eventBus
122768
123114
  */
122769
123115
  function RuleProvider(eventBus) {
@@ -122781,15 +123127,16 @@
122781
123127
  * Adds a modeling rule for the given action, implemented through
122782
123128
  * a callback function.
122783
123129
  *
122784
- * The function will receive the modeling specific action context
123130
+ * The callback receives a modeling specific action context
122785
123131
  * to perform its check. It must return `false` to disallow the
122786
- * action from happening or `true` to allow the action.
122787
- *
122788
- * A rule provider may pass over the evaluation to lower priority
122789
- * rules by returning return nothing (or <code>undefined</code>).
123132
+ * action from happening or `true` to allow the action. Usually returing
123133
+ * `null` denotes that a particular interaction shall be ignored.
123134
+ * By returning nothing or `undefined` you pass evaluation to lower
123135
+ * priority rules.
122790
123136
  *
122791
123137
  * @example
122792
123138
  *
123139
+ * ```javascript
122793
123140
  * ResizableRules.prototype.init = function() {
122794
123141
  *
122795
123142
  * \/**
@@ -122816,10 +123163,11 @@
122816
123163
  * }
122817
123164
  * });
122818
123165
  * };
123166
+ * ```
122819
123167
  *
122820
- * @param {string|Array<string>} actions the identifier for the modeling action to check
123168
+ * @param {string|string[]} actions the identifier for the modeling action to check
122821
123169
  * @param {number} [priority] the priority at which this rule is being applied
122822
- * @param {Function} fn the callback function that performs the actual check
123170
+ * @param {(any) => any} fn the callback function that performs the actual check
122823
123171
  */
122824
123172
  RuleProvider.prototype.addRule = function(actions, priority, fn) {
122825
123173
 
@@ -123112,7 +123460,7 @@
123112
123460
  return {
123113
123461
  'create': {
123114
123462
  group: 'create',
123115
- imageUrl: createIcon,
123463
+ html: `<div class="entry"> ${createIcon}</div>`,
123116
123464
  title: translate('Create element'),
123117
123465
  action: {
123118
123466
  click: function(event) {
@@ -123215,6 +123563,7 @@
123215
123563
 
123216
123564
  /**
123217
123565
  * @param {KeyboardEvent} event
123566
+ * @return {boolean}
123218
123567
  */
123219
123568
  function isCmd(event) {
123220
123569
 
@@ -123230,8 +123579,9 @@
123230
123579
  /**
123231
123580
  * Checks if key pressed is one of provided keys.
123232
123581
  *
123233
- * @param {string|Array<string>} keys
123582
+ * @param {string|string[]} keys
123234
123583
  * @param {KeyboardEvent} event
123584
+ * @return {boolean}
123235
123585
  */
123236
123586
  function isKey(keys, event) {
123237
123587
  keys = isArray(keys) ? keys : [ keys ];
@@ -123246,18 +123596,30 @@
123246
123596
  return event.shiftKey;
123247
123597
  }
123248
123598
 
123599
+ /**
123600
+ * @param {KeyboardEvent} event
123601
+ */
123249
123602
  function isCopy(event) {
123250
123603
  return isCmd(event) && isKey(KEYS_COPY, event);
123251
123604
  }
123252
123605
 
123606
+ /**
123607
+ * @param {KeyboardEvent} event
123608
+ */
123253
123609
  function isPaste(event) {
123254
123610
  return isCmd(event) && isKey(KEYS_PASTE, event);
123255
123611
  }
123256
123612
 
123613
+ /**
123614
+ * @param {KeyboardEvent} event
123615
+ */
123257
123616
  function isUndo(event) {
123258
123617
  return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);
123259
123618
  }
123260
123619
 
123620
+ /**
123621
+ * @param {KeyboardEvent} event
123622
+ */
123261
123623
  function isRedo(event) {
123262
123624
  return isCmd(event) && (
123263
123625
  isKey(KEYS_REDO, event) || (
@@ -123533,6 +123895,17 @@
123533
123895
  ],
123534
123896
  };
123535
123897
 
123898
+ /**
123899
+ * @typedef {import('../model/Types').Element} Element
123900
+ * @typedef {import('../model/Types').ModdleElement} ModdleElement
123901
+ */
123902
+
123903
+ /**
123904
+ * @param {Element} element
123905
+ * @param {ModdleElement} [di]
123906
+ *
123907
+ * @return {boolean}
123908
+ */
123536
123909
  function isExpanded(element, di) {
123537
123910
 
123538
123911
  if (is(element, 'bpmn:CallActivity')) {
@@ -123556,14 +123929,21 @@
123556
123929
  return true;
123557
123930
  }
123558
123931
 
123932
+ /**
123933
+ * @typedef {import('../../../model/Types').Element} Element
123934
+ * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').PopupMenuTarget} PopupMenuTarget
123935
+ *
123936
+ * @typedef {(entry: PopupMenuTarget) => boolean} DifferentTypeValidator
123937
+ */
123938
+
123559
123939
  /**
123560
123940
  * Returns true, if an element is from a different type
123561
123941
  * than a target definition. Takes into account the type,
123562
123942
  * event definition type and triggeredByEvent property.
123563
123943
  *
123564
- * @param {djs.model.Base} element
123944
+ * @param {Element} element
123565
123945
  *
123566
- * @return {boolean}
123946
+ * @return {DifferentTypeValidator}
123567
123947
  */
123568
123948
  function isDifferentType(element) {
123569
123949
 
@@ -123594,6 +123974,28 @@
123594
123974
  };
123595
123975
  }
123596
123976
 
123977
+ /**
123978
+ * @typedef { () => string } LabelGetter
123979
+ *
123980
+ * @typedef { {
123981
+ * label: string | LabelGetter;
123982
+ * actionName: string;
123983
+ * className: string;
123984
+ * target?: {
123985
+ * type: string;
123986
+ * isExpanded?: boolean;
123987
+ * isInterrupting?: boolean;
123988
+ * triggeredByEvent?: boolean;
123989
+ * cancelActivity?: boolean;
123990
+ * eventDefinitionType?: string;
123991
+ * eventDefinitionAttrs?: Record<string, any>
123992
+ * };
123993
+ * } } ReplaceOption
123994
+ */
123995
+
123996
+ /**
123997
+ * @type {ReplaceOption[]}
123998
+ */
123597
123999
  var START_EVENT = [
123598
124000
  {
123599
124001
  label: 'Start Event',
@@ -123657,6 +124059,9 @@
123657
124059
  }
123658
124060
  ];
123659
124061
 
124062
+ /**
124063
+ * @type {ReplaceOption[]}
124064
+ */
123660
124065
  var START_EVENT_SUB_PROCESS = [
123661
124066
  {
123662
124067
  label: 'Start Event',
@@ -123684,6 +124089,9 @@
123684
124089
  }
123685
124090
  ];
123686
124091
 
124092
+ /**
124093
+ * @type {ReplaceOption[]}
124094
+ */
123687
124095
  var INTERMEDIATE_EVENT = [
123688
124096
  {
123689
124097
  label: 'Start Event',
@@ -123807,6 +124215,9 @@
123807
124215
  }
123808
124216
  ];
123809
124217
 
124218
+ /**
124219
+ * @type {ReplaceOption[]}
124220
+ */
123810
124221
  var END_EVENT = [
123811
124222
  {
123812
124223
  label: 'Start Event',
@@ -123897,6 +124308,9 @@
123897
124308
  }
123898
124309
  ];
123899
124310
 
124311
+ /**
124312
+ * @type {ReplaceOption[]}
124313
+ */
123900
124314
  var GATEWAY = [
123901
124315
  {
123902
124316
  label: 'Exclusive Gateway',
@@ -123966,6 +124380,9 @@
123966
124380
  // }
123967
124381
  ];
123968
124382
 
124383
+ /**
124384
+ * @type {ReplaceOption[]}
124385
+ */
123969
124386
  var SUBPROCESS_EXPANDED = [
123970
124387
  {
123971
124388
  label: 'Transaction',
@@ -123997,6 +124414,9 @@
123997
124414
  }
123998
124415
  ];
123999
124416
 
124417
+ /**
124418
+ * @type {ReplaceOption[]}
124419
+ */
124000
124420
  var TRANSACTION = [
124001
124421
  {
124002
124422
  label: 'Transaction',
@@ -124028,8 +124448,14 @@
124028
124448
  }
124029
124449
  ];
124030
124450
 
124451
+ /**
124452
+ * @type {ReplaceOption[]}
124453
+ */
124031
124454
  var EVENT_SUB_PROCESS = TRANSACTION;
124032
124455
 
124456
+ /**
124457
+ * @type {ReplaceOption[]}
124458
+ */
124033
124459
  var TASK = [
124034
124460
  {
124035
124461
  label: 'Task',
@@ -124123,6 +124549,9 @@
124123
124549
  }
124124
124550
  ];
124125
124551
 
124552
+ /**
124553
+ * @type {ReplaceOption[]}
124554
+ */
124126
124555
  var DATA_OBJECT_REFERENCE = [
124127
124556
  {
124128
124557
  label: 'Data Store Reference',
@@ -124134,6 +124563,9 @@
124134
124563
  }
124135
124564
  ];
124136
124565
 
124566
+ /**
124567
+ * @type {ReplaceOption[]}
124568
+ */
124137
124569
  var DATA_STORE_REFERENCE = [
124138
124570
  {
124139
124571
  label: 'Data Object Reference',
@@ -124145,6 +124577,9 @@
124145
124577
  }
124146
124578
  ];
124147
124579
 
124580
+ /**
124581
+ * @type {ReplaceOption[]}
124582
+ */
124148
124583
  var BOUNDARY_EVENT = [
124149
124584
  {
124150
124585
  label: 'Message Boundary Event',
@@ -124270,6 +124705,9 @@
124270
124705
  }
124271
124706
  ];
124272
124707
 
124708
+ /**
124709
+ * @type {ReplaceOption[]}
124710
+ */
124273
124711
  var EVENT_SUB_PROCESS_START_EVENT = [
124274
124712
  {
124275
124713
  label: 'Message Start Event',
@@ -124386,6 +124824,9 @@
124386
124824
  }
124387
124825
  ];
124388
124826
 
124827
+ /**
124828
+ * @type {ReplaceOption[]}
124829
+ */
124389
124830
  var SEQUENCE_FLOW = [
124390
124831
  {
124391
124832
  label: 'Sequence Flow',
@@ -124404,6 +124845,9 @@
124404
124845
  }
124405
124846
  ];
124406
124847
 
124848
+ /**
124849
+ * @type {ReplaceOption[]}
124850
+ */
124407
124851
  var PARTICIPANT = [
124408
124852
  {
124409
124853
  label: 'Expanded Pool',