camunda-bpmn-js 4.12.0 → 4.13.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.
@@ -82,9 +82,9 @@
82
82
  *
83
83
  * @param {Seed} seed
84
84
  */
85
- function Ids(seed) {
86
- if (!(this instanceof Ids)) {
87
- return new Ids(seed);
85
+ function Ids$1(seed) {
86
+ if (!(this instanceof Ids$1)) {
87
+ return new Ids$1(seed);
88
88
  }
89
89
  seed = seed || [128, 36, 1];
90
90
  this._seed = seed.length ? hat_1.rack(seed[0], seed[1], seed[2]) : seed;
@@ -97,7 +97,7 @@
97
97
  *
98
98
  * @return {String} id
99
99
  */
100
- Ids.prototype.next = function (element) {
100
+ Ids$1.prototype.next = function (element) {
101
101
  return this._seed(element || true);
102
102
  };
103
103
 
@@ -108,7 +108,7 @@
108
108
  *
109
109
  * @return {String} id
110
110
  */
111
- Ids.prototype.nextPrefixed = function (prefix, element) {
111
+ Ids$1.prototype.nextPrefixed = function (prefix, element) {
112
112
  var id;
113
113
  do {
114
114
  id = prefix + this.next(true);
@@ -127,7 +127,7 @@
127
127
  * @param {String} id
128
128
  * @param {String} [element] element the id is claimed by
129
129
  */
130
- Ids.prototype.claim = function (id, element) {
130
+ Ids$1.prototype.claim = function (id, element) {
131
131
  this._seed.set(id, element || true);
132
132
  };
133
133
 
@@ -137,7 +137,7 @@
137
137
  * @param {String} id
138
138
  * @return {Boolean}
139
139
  */
140
- Ids.prototype.assigned = function (id) {
140
+ Ids$1.prototype.assigned = function (id) {
141
141
  return this._seed.get(id) || false;
142
142
  };
143
143
 
@@ -146,14 +146,14 @@
146
146
  *
147
147
  * @param {String} id the id to unclaim
148
148
  */
149
- Ids.prototype.unclaim = function (id) {
149
+ Ids$1.prototype.unclaim = function (id) {
150
150
  delete this._seed.hats[id];
151
151
  };
152
152
 
153
153
  /**
154
154
  * Clear all claimed ids.
155
155
  */
156
- Ids.prototype.clear = function () {
156
+ Ids$1.prototype.clear = function () {
157
157
  var hats = this._seed.hats,
158
158
  id;
159
159
  for (id in hats) {
@@ -5449,6 +5449,8 @@
5449
5449
  element = this._elementRegistry.get(element);
5450
5450
  }
5451
5451
 
5452
+ element.markers = element.markers || new Set();
5453
+
5452
5454
  // we need to access all
5453
5455
  container = this._elementRegistry._elements[element.id];
5454
5456
 
@@ -5461,8 +5463,10 @@
5461
5463
 
5462
5464
  // invoke either addClass or removeClass based on mode
5463
5465
  if (add) {
5466
+ element.markers.add(marker);
5464
5467
  classes(gfx).add(marker);
5465
5468
  } else {
5469
+ element.markers.delete(marker);
5466
5470
  classes(gfx).remove(marker);
5467
5471
  }
5468
5472
  }
@@ -5530,9 +5534,11 @@
5530
5534
  element = this._elementRegistry.get(element);
5531
5535
  }
5532
5536
 
5533
- const gfx = this.getGraphics(element);
5537
+ if (!element.markers) {
5538
+ return false;
5539
+ }
5534
5540
 
5535
- return classes(gfx).has(marker);
5541
+ return element.markers.has(marker);
5536
5542
  };
5537
5543
 
5538
5544
  /**
@@ -17890,7 +17896,7 @@
17890
17896
 
17891
17897
  // attach ids to moddle to be able to track and validated ids in the BPMN 2.0
17892
17898
  // XML document tree
17893
- moddle.ids = new Ids([ 32, 36, 1 ]);
17899
+ moddle.ids = new Ids$1([ 32, 36, 1 ]);
17894
17900
 
17895
17901
  return moddle;
17896
17902
  };
@@ -18508,7 +18514,7 @@
18508
18514
  return has$2(overrides, 'height') ? overrides.height : bounds.height;
18509
18515
  }
18510
18516
 
18511
- var markerIds = new Ids();
18517
+ var markerIds = new Ids$1();
18512
18518
 
18513
18519
  var ELEMENT_LABEL_DISTANCE$1 = 10,
18514
18520
  INNER_OUTER_DIST = 3,
@@ -23963,6 +23969,7 @@
23963
23969
  * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
23964
23970
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
23965
23971
  * @typedef {import('diagram-js/lib/features/overlays/Overlays').default} Overlays
23972
+ * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
23966
23973
  *
23967
23974
  * @typedef {import('../../model/Types').Element} Element
23968
23975
  * @typedef {import('../../model/Types').Parent} Parent
@@ -23979,9 +23986,10 @@
23979
23986
  * @param {EventBus} eventBus
23980
23987
  * @param {ElementRegistry} elementRegistry
23981
23988
  * @param {Overlays} overlays
23989
+ * @param {Translate} translate
23982
23990
  */
23983
23991
  function DrilldownOverlayBehavior(
23984
- canvas, eventBus, elementRegistry, overlays
23992
+ canvas, eventBus, elementRegistry, overlays, translate
23985
23993
  ) {
23986
23994
  CommandInterceptor.call(this, eventBus);
23987
23995
 
@@ -23989,6 +23997,7 @@
23989
23997
  this._eventBus = eventBus;
23990
23998
  this._elementRegistry = elementRegistry;
23991
23999
  this._overlays = overlays;
24000
+ this._translate = translate;
23992
24001
 
23993
24002
  var self = this;
23994
24003
 
@@ -24122,7 +24131,8 @@
24122
24131
  */
24123
24132
  DrilldownOverlayBehavior.prototype._addOverlay = function(element) {
24124
24133
  var canvas = this._canvas,
24125
- overlays = this._overlays;
24134
+ overlays = this._overlays,
24135
+ bo = getBusinessObject$1(element);
24126
24136
 
24127
24137
  var existingOverlays = overlays.get({ element: element, type: 'drilldown' });
24128
24138
 
@@ -24130,7 +24140,10 @@
24130
24140
  this._removeOverlay(element);
24131
24141
  }
24132
24142
 
24133
- var button = domify$1('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
24143
+ var button = domify$1('<button type="button" class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>'),
24144
+ elementName = bo.get('name') || bo.get('id'),
24145
+ title = this._translate('Open {element}', { element: elementName });
24146
+ button.setAttribute('title', title);
24134
24147
 
24135
24148
  button.addEventListener('click', function() {
24136
24149
  canvas.setRootElement(canvas.findRoot(getPlaneIdFromShape(element)));
@@ -24160,7 +24173,8 @@
24160
24173
  'canvas',
24161
24174
  'eventBus',
24162
24175
  'elementRegistry',
24163
- 'overlays'
24176
+ 'overlays',
24177
+ 'translate'
24164
24178
  ];
24165
24179
 
24166
24180
  var DrilldownModdule = {
@@ -26955,6 +26969,133 @@
26955
26969
  alignElements: [ 'type', AlignElements$1 ]
26956
26970
  };
26957
26971
 
26972
+ const Ids = new IdGenerator();
26973
+
26974
+
26975
+ /**
26976
+ * @typedef { {
26977
+ * promise: Promise<unknown>,
26978
+ * executionId: number
26979
+ * } } ScheduledTask
26980
+ */
26981
+
26982
+ /**
26983
+ * A utility that allows you to schedule async tasks.
26984
+ *
26985
+ * @class
26986
+ * @constructor
26987
+ *
26988
+ * @param { import('../core/EventBus').default } eventBus
26989
+ */
26990
+ function Scheduler(eventBus) {
26991
+
26992
+ /**
26993
+ * @type { Record<string, ScheduledTask> }
26994
+ */
26995
+ this._scheduled = {};
26996
+
26997
+ eventBus.on('diagram.destroy', () => {
26998
+ Object.keys(this._scheduled).forEach(id => {
26999
+ this.cancel(id);
27000
+ });
27001
+ });
27002
+ }
27003
+
27004
+ Scheduler.$inject = [ 'eventBus' ];
27005
+
27006
+ /**
27007
+ * Schedule execution of a task in the next tick.
27008
+ *
27009
+ * Call with an id to ensure only the latest call will be executed.
27010
+ *
27011
+ * @template T
27012
+
27013
+ * @param {(...args: any[]) => T} taskFn function to be executed
27014
+ * @param {string} [id] identifying the task to ensure uniqueness
27015
+ *
27016
+ * @return Promise<T> result of the executed task
27017
+ */
27018
+ Scheduler.prototype.schedule = function(taskFn, id = Ids.next()) {
27019
+
27020
+ this.cancel(id);
27021
+
27022
+ const newScheduled = this._schedule(taskFn, id);
27023
+
27024
+ this._scheduled[id] = newScheduled;
27025
+
27026
+ return newScheduled.promise;
27027
+ };
27028
+
27029
+ Scheduler.prototype._schedule = function(taskFn, id) {
27030
+
27031
+ const {
27032
+ promise,
27033
+ resolve,
27034
+ reject
27035
+ } = defer();
27036
+
27037
+ const executionId = requestAnimationFrame(() => {
27038
+ try {
27039
+ resolve(taskFn());
27040
+ } catch (error) {
27041
+ reject(error);
27042
+ }
27043
+ });
27044
+
27045
+ return {
27046
+ executionId,
27047
+ promise
27048
+ };
27049
+ };
27050
+
27051
+ /**
27052
+ * Cancel a previously scheduled task.
27053
+ *
27054
+ * @param {string} id
27055
+ */
27056
+ Scheduler.prototype.cancel = function(id) {
27057
+
27058
+ const scheduled = this._scheduled[id];
27059
+
27060
+ if (scheduled) {
27061
+ this._cancel(scheduled);
27062
+
27063
+ this._scheduled[id] = null;
27064
+ }
27065
+ };
27066
+
27067
+ Scheduler.prototype._cancel = function(scheduled) {
27068
+ cancelAnimationFrame(scheduled.executionId);
27069
+ };
27070
+
27071
+ /**
27072
+ * @return { {
27073
+ * promise: Promise,
27074
+ * resolve: Function,
27075
+ * reject: Function
27076
+ * } }
27077
+ */
27078
+ function defer() {
27079
+
27080
+ let resolve;
27081
+ let reject;
27082
+
27083
+ const promise = new Promise((_resolve, _reject) => {
27084
+ resolve = _resolve;
27085
+ reject = _reject;
27086
+ });
27087
+
27088
+ return {
27089
+ promise,
27090
+ resolve,
27091
+ reject
27092
+ };
27093
+ }
27094
+
27095
+ var SchedulerModule = {
27096
+ scheduler: [ 'type', Scheduler ]
27097
+ };
27098
+
26958
27099
  var MARKER_HIDDEN$1 = 'djs-element-hidden';
26959
27100
 
26960
27101
  /**
@@ -26966,6 +27107,7 @@
26966
27107
  * @typedef {import('../../core/Canvas').default} Canvas
26967
27108
  * @typedef {import('../../core/ElementRegistry').default} ElementRegistry
26968
27109
  * @typedef {import('../../core/EventBus').default} EventBus
27110
+ * @typedef {import('../../scheduler/Scheduler').default} Scheduler
26969
27111
  *
26970
27112
  * @typedef {import('./ContextPadProvider').default} ContextPadProvider
26971
27113
  * @typedef {import('./ContextPadProvider').ContextPadEntries} ContextPadEntries
@@ -26991,12 +27133,14 @@
26991
27133
  * @param {Canvas} canvas
26992
27134
  * @param {ElementRegistry} elementRegistry
26993
27135
  * @param {EventBus} eventBus
27136
+ * @param {Scheduler} scheduler
26994
27137
  */
26995
- function ContextPad(canvas, elementRegistry, eventBus) {
27138
+ function ContextPad(canvas, elementRegistry, eventBus, scheduler) {
26996
27139
 
26997
27140
  this._canvas = canvas;
26998
27141
  this._elementRegistry = elementRegistry;
26999
27142
  this._eventBus = eventBus;
27143
+ this._scheduler = scheduler;
27000
27144
 
27001
27145
  this._current = null;
27002
27146
 
@@ -27006,7 +27150,8 @@
27006
27150
  ContextPad.$inject = [
27007
27151
  'canvas',
27008
27152
  'elementRegistry',
27009
- 'eventBus'
27153
+ 'eventBus',
27154
+ 'scheduler'
27010
27155
  ];
27011
27156
 
27012
27157
 
@@ -27041,12 +27186,12 @@
27041
27186
  return;
27042
27187
  }
27043
27188
 
27044
- var { target } = current;
27189
+ var target = current.target;
27045
27190
 
27046
27191
  var targets = isArray$4(target) ? target : [ target ];
27047
27192
 
27048
27193
  var targetsChanged = targets.filter(function(element) {
27049
- return includes$8(elements, element);
27194
+ return elements.includes(element);
27050
27195
  });
27051
27196
 
27052
27197
  if (targetsChanged.length) {
@@ -27067,11 +27212,25 @@
27067
27212
  }
27068
27213
  });
27069
27214
 
27070
- this._eventBus.on('canvas.viewbox.changed', () => {
27071
- this._updatePosition();
27215
+ this._eventBus.on('canvas.viewbox.changed', function() {
27216
+ self._updatePosition();
27072
27217
  });
27073
27218
 
27074
27219
  this._eventBus.on('element.marker.update', function(event) {
27220
+ if (!self.isOpen()) {
27221
+ return;
27222
+ }
27223
+
27224
+ var element = event.element;
27225
+
27226
+ var current = self._current;
27227
+
27228
+ var targets = isArray$4(current.target) ? current.target : [ current.target ];
27229
+
27230
+ if (!targets.includes(element)) {
27231
+ return;
27232
+ }
27233
+
27075
27234
  self._updateVisibility();
27076
27235
  });
27077
27236
 
@@ -27079,7 +27238,7 @@
27079
27238
  };
27080
27239
 
27081
27240
  ContextPad.prototype._createContainer = function() {
27082
- const container = domify$1('<div class="djs-context-pad-parent"></div>');
27241
+ var container = domify$1('<div class="djs-context-pad-parent"></div>');
27083
27242
 
27084
27243
  this._canvas.getContainer().appendChild(container);
27085
27244
 
@@ -27163,6 +27322,7 @@
27163
27322
  * @param {boolean} [autoActivate=false]
27164
27323
  */
27165
27324
  ContextPad.prototype.trigger = function(action, event, autoActivate) {
27325
+ var self = this;
27166
27326
 
27167
27327
  var entry,
27168
27328
  originalEvent,
@@ -27176,8 +27336,8 @@
27176
27336
  originalEvent = event.originalEvent || event;
27177
27337
 
27178
27338
  if (action === 'mouseover') {
27179
- this._timeout = setTimeout(() => {
27180
- this._mouseout = this.triggerEntry(entry, 'hover', originalEvent, autoActivate);
27339
+ this._timeout = setTimeout(function() {
27340
+ self._mouseout = self.triggerEntry(entry, 'hover', originalEvent, autoActivate);
27181
27341
  }, HOVER_DELAY);
27182
27342
 
27183
27343
  return;
@@ -27438,7 +27598,7 @@
27438
27598
  return (
27439
27599
  target.length === currentTarget.length &&
27440
27600
  every$1(target, function(element) {
27441
- return includes$8(currentTarget, element);
27601
+ return currentTarget.includes(element);
27442
27602
  })
27443
27603
  );
27444
27604
  } else {
@@ -27498,12 +27658,12 @@
27498
27658
  */
27499
27659
  ContextPad.prototype._getPosition = function(target) {
27500
27660
  if (!isArray$4(target) && isConnection$1(target)) {
27501
- const viewbox = this._canvas.viewbox();
27661
+ var viewbox = this._canvas.viewbox();
27502
27662
 
27503
- const lastWaypoint = getLastWaypoint(target);
27663
+ var lastWaypoint = getLastWaypoint(target);
27504
27664
 
27505
- const x = lastWaypoint.x * viewbox.scale - viewbox.x * viewbox.scale,
27506
- y = lastWaypoint.y * viewbox.scale - viewbox.y * viewbox.scale;
27665
+ var x = lastWaypoint.x * viewbox.scale - viewbox.x * viewbox.scale,
27666
+ y = lastWaypoint.y * viewbox.scale - viewbox.y * viewbox.scale;
27507
27667
 
27508
27668
  return {
27509
27669
  left: x + CONTEXT_PAD_MARGIN * this._canvas.zoom(),
@@ -27557,25 +27717,30 @@
27557
27717
  * using the `djs-element-hidden` or `djs-label-hidden` markers.
27558
27718
  */
27559
27719
  ContextPad.prototype._updateVisibility = function() {
27560
- if (!this.isOpen()) {
27561
- return;
27562
- }
27563
27720
 
27564
- var self = this;
27721
+ const updateFn = () => {
27722
+ if (!this.isOpen()) {
27723
+ return;
27724
+ }
27565
27725
 
27566
- var target = this._current.target;
27726
+ var self = this;
27567
27727
 
27568
- var targets = isArray$4(target) ? target : [ target ];
27728
+ var target = this._current.target;
27569
27729
 
27570
- var isHidden = targets.some(function(target) {
27571
- return self._canvas.hasMarker(target, MARKER_HIDDEN$1);
27572
- });
27730
+ var targets = isArray$4(target) ? target : [ target ];
27573
27731
 
27574
- if (isHidden) {
27575
- self.hide();
27576
- } else {
27577
- self.show();
27578
- }
27732
+ var isHidden = targets.some(function(target) {
27733
+ return self._canvas.hasMarker(target, MARKER_HIDDEN$1);
27734
+ });
27735
+
27736
+ if (isHidden) {
27737
+ self.hide();
27738
+ } else {
27739
+ self.show();
27740
+ }
27741
+ };
27742
+
27743
+ this._scheduler.schedule(updateFn, 'ContextPad#_updateVisibility');
27579
27744
  };
27580
27745
 
27581
27746
  /**
@@ -27586,13 +27751,15 @@
27586
27751
  * @returns {Rect & RectTRBL}
27587
27752
  */
27588
27753
  ContextPad.prototype._getTargetBounds = function(target) {
27754
+ var self = this;
27755
+
27589
27756
  var elements = isArray$4(target) ? target : [ target ];
27590
27757
 
27591
- var elementsGfx = elements.map((element) => {
27592
- return this._canvas.getGraphics(element);
27758
+ var elementsGfx = elements.map(function(element) {
27759
+ return self._canvas.getGraphics(element);
27593
27760
  });
27594
27761
 
27595
- return elementsGfx.reduce((bounds, elementGfx) => {
27762
+ return elementsGfx.reduce(function(bounds, elementGfx) {
27596
27763
  const elementBounds = elementGfx.getBoundingClientRect();
27597
27764
 
27598
27765
  bounds.top = Math.min(bounds.top, elementBounds.top);
@@ -27627,16 +27794,6 @@
27627
27794
  });
27628
27795
  }
27629
27796
 
27630
- /**
27631
- * @param {any[]} array
27632
- * @param {any} item
27633
- *
27634
- * @return {boolean}
27635
- */
27636
- function includes$8(array, item) {
27637
- return array.indexOf(item) !== -1;
27638
- }
27639
-
27640
27797
  function getLastWaypoint(connection) {
27641
27798
  return connection.waypoints[connection.waypoints.length - 1];
27642
27799
  }
@@ -27663,6 +27820,7 @@
27663
27820
  var ContextPadModule$1 = {
27664
27821
  __depends__: [
27665
27822
  InteractionEventsModule$1,
27823
+ SchedulerModule,
27666
27824
  OverlaysModule
27667
27825
  ],
27668
27826
  contextPad: [ 'type', ContextPad ]
@@ -27802,7 +27960,6 @@
27802
27960
  onMouseEnter=${ onMouseEnter }
27803
27961
  onMouseLeave=${ onMouseLeave }
27804
27962
  onDragStart=${ (event) => onAction(event, entry, 'dragstart') }
27805
- aria-role="button"
27806
27963
  draggable=${ true }
27807
27964
  >
27808
27965
  <div class="djs-popup-entry-content">
@@ -36413,7 +36570,7 @@
36413
36570
  shapes.forEach(function(shape, index) {
36414
36571
  var host = shape.host;
36415
36572
 
36416
- if (shouldReplace(shape, includes$7(shapes, host) ? host : newHost)) {
36573
+ if (shouldReplace(shape, includes$6(shapes, host) ? host : newHost)) {
36417
36574
  shapes[ index ] = self._replaceShape(shape);
36418
36575
  }
36419
36576
  });
@@ -36459,7 +36616,7 @@
36459
36616
  return !isLabel(shape) && is$5(shape, 'bpmn:BoundaryEvent') && !host;
36460
36617
  }
36461
36618
 
36462
- function includes$7(array, item) {
36619
+ function includes$6(array, item) {
36463
36620
  return array.indexOf(item) !== -1;
36464
36621
  }
36465
36622
 
@@ -42363,7 +42520,7 @@
42363
42520
  *
42364
42521
  * @return {boolean}
42365
42522
  */
42366
- function includes$6(elements, element) {
42523
+ function includes$5(elements, element) {
42367
42524
  return (elements && element) && elements.indexOf(element) !== -1;
42368
42525
  }
42369
42526
 
@@ -42378,7 +42535,7 @@
42378
42535
  return true;
42379
42536
  }
42380
42537
 
42381
- if (is$5(element, 'bpmn:Lane') && !includes$6(elements, element.parent)) {
42538
+ if (is$5(element, 'bpmn:Lane') && !includes$5(elements, element.parent)) {
42382
42539
  return false;
42383
42540
  }
42384
42541
 
@@ -45058,12 +45215,12 @@
45058
45215
  var source = connection.source,
45059
45216
  target = connection.target;
45060
45217
 
45061
- if (includes$5(movingShapes, source) ||
45062
- includes$5(movingShapes, target) ||
45063
- includes$5(resizingShapes, source) ||
45064
- includes$5(resizingShapes, target)) {
45218
+ if (includes$4(movingShapes, source) ||
45219
+ includes$4(movingShapes, target) ||
45220
+ includes$4(resizingShapes, source) ||
45221
+ includes$4(resizingShapes, target)) {
45065
45222
 
45066
- if (!includes$5(waypointsUpdatingConnections, connection)) {
45223
+ if (!includes$4(waypointsUpdatingConnections, connection)) {
45067
45224
  waypointsUpdatingConnections.push(connection);
45068
45225
  }
45069
45226
  }
@@ -45073,7 +45230,7 @@
45073
45230
  return waypointsUpdatingConnections;
45074
45231
  }
45075
45232
 
45076
- function includes$5(array, item) {
45233
+ function includes$4(array, item) {
45077
45234
  return array.indexOf(item) !== -1;
45078
45235
  }
45079
45236
 
@@ -45477,7 +45634,7 @@
45477
45634
  forEach$2(attachers, function(attacher) {
45478
45635
  var host = attacher.host;
45479
45636
 
45480
- if (includes$4(allShapes, host)) {
45637
+ if (includes$3(allShapes, host)) {
45481
45638
  moveShape(attacher);
45482
45639
  }
45483
45640
  });
@@ -45490,8 +45647,8 @@
45490
45647
  target = connection.target,
45491
45648
  label = connection.label;
45492
45649
 
45493
- if (includes$4(allShapes, source)
45494
- && includes$4(allShapes, target)
45650
+ if (includes$3(allShapes, source)
45651
+ && includes$3(allShapes, target)
45495
45652
  && label) {
45496
45653
  moveShape(label);
45497
45654
  }
@@ -45596,13 +45753,13 @@
45596
45753
  var nonMovingResizingChildren = filter$1(children, function(child) {
45597
45754
  return !isConnection$1(child) &&
45598
45755
  !isLabel(child) &&
45599
- !includes$4(movingShapes, child) &&
45600
- !includes$4(resizingShapes, child);
45756
+ !includes$3(movingShapes, child) &&
45757
+ !includes$3(resizingShapes, child);
45601
45758
  });
45602
45759
 
45603
45760
  // find children that are moving
45604
45761
  var movingChildren = filter$1(children, function(child) {
45605
- return !isConnection$1(child) && !isLabel(child) && includes$4(movingShapes, child);
45762
+ return !isConnection$1(child) && !isLabel(child) && includes$3(movingShapes, child);
45606
45763
  });
45607
45764
 
45608
45765
  var minOrMax,
@@ -45653,7 +45810,7 @@
45653
45810
 
45654
45811
  if (attachers && attachers.length) {
45655
45812
  attachers.forEach(function(attacher) {
45656
- if (includes$4(movingShapes, attacher)) {
45813
+ if (includes$3(movingShapes, attacher)) {
45657
45814
  movingAttachers.push(attacher);
45658
45815
  } else {
45659
45816
  nonMovingAttachers.push(attacher);
@@ -45728,7 +45885,7 @@
45728
45885
  return spaceToolConstraints;
45729
45886
  }
45730
45887
 
45731
- function includes$4(array, item) {
45888
+ function includes$3(array, item) {
45732
45889
  return array.indexOf(item) !== -1;
45733
45890
  }
45734
45891
 
@@ -46999,7 +47156,7 @@
46999
47156
  attachers = filter$1(shapes, function(shape) {
47000
47157
  var host = shape.host;
47001
47158
 
47002
- return isAttacher(shape) && !includes$3(shapes, host);
47159
+ return isAttacher(shape) && !includes$2(shapes, host);
47003
47160
  });
47004
47161
  }
47005
47162
 
@@ -47195,7 +47352,7 @@
47195
47352
  return !!shape.host;
47196
47353
  }
47197
47354
 
47198
- function includes$3(array, item) {
47355
+ function includes$2(array, item) {
47199
47356
  return array.indexOf(item) !== -1;
47200
47357
  }
47201
47358
 
@@ -50288,7 +50445,7 @@
50288
50445
  axis = getAxisFromDirection(direction),
50289
50446
  layoutHints = {};
50290
50447
 
50291
- if (includes$2(affectedShapes, source) && includes$2(affectedShapes, target)) {
50448
+ if (includes$1(affectedShapes, source) && includes$1(affectedShapes, target)) {
50292
50449
 
50293
50450
  // move waypoints
50294
50451
  waypoints = map$3(waypoints, function(waypoint) {
@@ -50310,18 +50467,18 @@
50310
50467
  self._modeling.updateWaypoints(connection, waypoints, {
50311
50468
  labelBehavior: false
50312
50469
  });
50313
- } else if (includes$2(affectedShapes, source) || includes$2(affectedShapes, target)) {
50470
+ } else if (includes$1(affectedShapes, source) || includes$1(affectedShapes, target)) {
50314
50471
 
50315
50472
  // re-layout connection with moved start/end
50316
- if (includes$2(movingShapes, source)) {
50473
+ if (includes$1(movingShapes, source)) {
50317
50474
  layoutHints.connectionStart = getMovedSourceAnchor(connection, source, delta);
50318
- } else if (includes$2(movingShapes, target)) {
50475
+ } else if (includes$1(movingShapes, target)) {
50319
50476
  layoutHints.connectionEnd = getMovedTargetAnchor(connection, target, delta);
50320
- } else if (includes$2(resizingShapes, source)) {
50477
+ } else if (includes$1(resizingShapes, source)) {
50321
50478
  layoutHints.connectionStart = getResizedSourceAnchor(
50322
50479
  connection, source, oldBounds[source.id]
50323
50480
  );
50324
- } else if (includes$2(resizingShapes, target)) {
50481
+ } else if (includes$1(resizingShapes, target)) {
50325
50482
  layoutHints.connectionEnd = getResizedTargetAnchor(
50326
50483
  connection, target, oldBounds[target.id]
50327
50484
  );
@@ -50375,7 +50532,7 @@
50375
50532
  }
50376
50533
  }
50377
50534
 
50378
- function includes$2(array, item) {
50535
+ function includes$1(array, item) {
50379
50536
  return array.indexOf(item) !== -1;
50380
50537
  }
50381
50538
 
@@ -56875,9 +57032,7 @@
56875
57032
  });
56876
57033
 
56877
57034
  if (isArray$4(baseAllowed)) {
56878
- return every$1(baseAllowed, function(element) {
56879
- return includes$1(baseAllowed, element);
56880
- });
57035
+ return every$1(elements, el => baseAllowed.includes(el));
56881
57036
  }
56882
57037
 
56883
57038
  return baseAllowed;
@@ -56895,7 +57050,6 @@
56895
57050
  connect = this._connect,
56896
57051
  create = this._create,
56897
57052
  popupMenu = this._popupMenu,
56898
- rules = this._rules,
56899
57053
  autoPlace = this._autoPlace,
56900
57054
  translate = this._translate,
56901
57055
  appendPreview = this._appendPreview;
@@ -56903,6 +57057,10 @@
56903
57057
  var actions = {};
56904
57058
 
56905
57059
  if (element.type === 'label') {
57060
+ if (this._isDeleteAllowed([ element ])) {
57061
+ assign$2(actions, deleteAction());
57062
+ }
57063
+
56906
57064
  return actions;
56907
57065
  }
56908
57066
 
@@ -56916,6 +57074,19 @@
56916
57074
  modeling.removeElements([ element ]);
56917
57075
  }
56918
57076
 
57077
+ function deleteAction() {
57078
+ return {
57079
+ 'delete': {
57080
+ group: 'edit',
57081
+ className: 'bpmn-icon-trash',
57082
+ title: translate('Delete'),
57083
+ action: {
57084
+ click: removeElement
57085
+ }
57086
+ }
57087
+ };
57088
+ }
57089
+
56919
57090
  function getReplaceMenuPosition(element) {
56920
57091
 
56921
57092
  var Y_OFFSET = 5;
@@ -57240,26 +57411,8 @@
57240
57411
  });
57241
57412
  }
57242
57413
 
57243
- // delete element entry, only show if allowed by rules
57244
- var deleteAllowed = rules.allowed('elements.delete', { elements: [ element ] });
57245
-
57246
- if (isArray$4(deleteAllowed)) {
57247
-
57248
- // was the element returned as a deletion candidate?
57249
- deleteAllowed = deleteAllowed[0] === element;
57250
- }
57251
-
57252
- if (deleteAllowed) {
57253
- assign$2(actions, {
57254
- 'delete': {
57255
- group: 'edit',
57256
- className: 'bpmn-icon-trash',
57257
- title: translate('Delete'),
57258
- action: {
57259
- click: removeElement
57260
- }
57261
- }
57262
- });
57414
+ if (this._isDeleteAllowed([ element ])) {
57415
+ assign$2(actions, deleteAction());
57263
57416
  }
57264
57417
 
57265
57418
  return actions;
@@ -57290,10 +57443,6 @@
57290
57443
  return isType && isDefinition;
57291
57444
  }
57292
57445
 
57293
- function includes$1(array, item) {
57294
- return array.indexOf(item) !== -1;
57295
- }
57296
-
57297
57446
  var ContextPadModule = {
57298
57447
  __depends__: [
57299
57448
  AppendPreviewModule,
@@ -98351,6 +98500,24 @@
98351
98500
  return T$1((...args) => callbackRef.current(...args), []);
98352
98501
  }
98353
98502
 
98503
+ function useElementVisible(element) {
98504
+ const [visible, setVisible] = h(!!element && !!element.clientHeight);
98505
+ y(() => {
98506
+ if (!element) return;
98507
+ const resizeObserver = new ResizeObserver(([entry]) => {
98508
+ requestAnimationFrame(() => {
98509
+ const newVisible = !!entry.contentRect.height;
98510
+ if (newVisible !== visible) {
98511
+ setVisible(newVisible);
98512
+ }
98513
+ });
98514
+ });
98515
+ resizeObserver.observe(element);
98516
+ return () => resizeObserver.disconnect();
98517
+ }, [element, visible]);
98518
+ return visible;
98519
+ }
98520
+
98354
98521
  function Group(props) {
98355
98522
  const {
98356
98523
  element,
@@ -100213,6 +100380,7 @@
100213
100380
  } = props;
100214
100381
  const [localValue, setLocalValue] = h(value);
100215
100382
  const ref = useShowEntryEvent(id);
100383
+ const visible = useElementVisible(ref.current);
100216
100384
  const handleInputCallback = F$1(() => {
100217
100385
  return debounce(target => onInput(target.value.length ? target.value : undefined));
100218
100386
  }, [onInput, debounce]);
@@ -100224,6 +100392,9 @@
100224
100392
  y(() => {
100225
100393
  autoResize && resizeToContents(ref.current);
100226
100394
  }, []);
100395
+ y(() => {
100396
+ visible && autoResize && resizeToContents(ref.current);
100397
+ }, [visible]);
100227
100398
  p(() => {
100228
100399
  if (value === localValue) {
100229
100400
  return;
@@ -105195,7 +105366,7 @@
105195
105366
  * generate a semantic id with given prefix
105196
105367
  */
105197
105368
  function nextId(prefix) {
105198
- const ids = new Ids([32, 32, 1]);
105369
+ const ids = new Ids$1([32, 32, 1]);
105199
105370
  return ids.nextPrefixed(prefix);
105200
105371
  }
105201
105372
  function getRoot(businessObject) {