bpmn-js 17.8.3 → 17.9.1

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v17.8.3
2
+ * bpmn-js - bpmn-modeler v17.9.1
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2024-06-25
11
+ * Date: 2024-07-04
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -27037,7 +27037,7 @@
27037
27037
  var targets = isArray$3(target) ? target : [ target ];
27038
27038
 
27039
27039
  var targetsChanged = targets.filter(function(element) {
27040
- return includes$8(elements, element);
27040
+ return includes$7(elements, element);
27041
27041
  });
27042
27042
 
27043
27043
  if (targetsChanged.length) {
@@ -27429,7 +27429,7 @@
27429
27429
  return (
27430
27430
  target.length === currentTarget.length &&
27431
27431
  every(target, function(element) {
27432
- return includes$8(currentTarget, element);
27432
+ return includes$7(currentTarget, element);
27433
27433
  })
27434
27434
  );
27435
27435
  } else {
@@ -27624,7 +27624,7 @@
27624
27624
  *
27625
27625
  * @return {boolean}
27626
27626
  */
27627
- function includes$8(array, item) {
27627
+ function includes$7(array, item) {
27628
27628
  return array.indexOf(item) !== -1;
27629
27629
  }
27630
27630
 
@@ -27793,7 +27793,6 @@
27793
27793
  onMouseEnter=${ onMouseEnter }
27794
27794
  onMouseLeave=${ onMouseLeave }
27795
27795
  onDragStart=${ (event) => onAction(event, entry, 'dragstart') }
27796
- aria-role="button"
27797
27796
  draggable=${ true }
27798
27797
  >
27799
27798
  <div class="djs-popup-entry-content">
@@ -36404,7 +36403,7 @@
36404
36403
  shapes.forEach(function(shape, index) {
36405
36404
  var host = shape.host;
36406
36405
 
36407
- if (shouldReplace(shape, includes$7(shapes, host) ? host : newHost)) {
36406
+ if (shouldReplace(shape, includes$6(shapes, host) ? host : newHost)) {
36408
36407
  shapes[ index ] = self._replaceShape(shape);
36409
36408
  }
36410
36409
  });
@@ -36450,7 +36449,7 @@
36450
36449
  return !isLabel(shape) && is$1(shape, 'bpmn:BoundaryEvent') && !host;
36451
36450
  }
36452
36451
 
36453
- function includes$7(array, item) {
36452
+ function includes$6(array, item) {
36454
36453
  return array.indexOf(item) !== -1;
36455
36454
  }
36456
36455
 
@@ -42354,7 +42353,7 @@
42354
42353
  *
42355
42354
  * @return {boolean}
42356
42355
  */
42357
- function includes$6(elements, element) {
42356
+ function includes$5(elements, element) {
42358
42357
  return (elements && element) && elements.indexOf(element) !== -1;
42359
42358
  }
42360
42359
 
@@ -42369,7 +42368,7 @@
42369
42368
  return true;
42370
42369
  }
42371
42370
 
42372
- if (is$1(element, 'bpmn:Lane') && !includes$6(elements, element.parent)) {
42371
+ if (is$1(element, 'bpmn:Lane') && !includes$5(elements, element.parent)) {
42373
42372
  return false;
42374
42373
  }
42375
42374
 
@@ -45049,12 +45048,12 @@
45049
45048
  var source = connection.source,
45050
45049
  target = connection.target;
45051
45050
 
45052
- if (includes$5(movingShapes, source) ||
45053
- includes$5(movingShapes, target) ||
45054
- includes$5(resizingShapes, source) ||
45055
- includes$5(resizingShapes, target)) {
45051
+ if (includes$4(movingShapes, source) ||
45052
+ includes$4(movingShapes, target) ||
45053
+ includes$4(resizingShapes, source) ||
45054
+ includes$4(resizingShapes, target)) {
45056
45055
 
45057
- if (!includes$5(waypointsUpdatingConnections, connection)) {
45056
+ if (!includes$4(waypointsUpdatingConnections, connection)) {
45058
45057
  waypointsUpdatingConnections.push(connection);
45059
45058
  }
45060
45059
  }
@@ -45064,7 +45063,7 @@
45064
45063
  return waypointsUpdatingConnections;
45065
45064
  }
45066
45065
 
45067
- function includes$5(array, item) {
45066
+ function includes$4(array, item) {
45068
45067
  return array.indexOf(item) !== -1;
45069
45068
  }
45070
45069
 
@@ -45468,7 +45467,7 @@
45468
45467
  forEach$1(attachers, function(attacher) {
45469
45468
  var host = attacher.host;
45470
45469
 
45471
- if (includes$4(allShapes, host)) {
45470
+ if (includes$3(allShapes, host)) {
45472
45471
  moveShape(attacher);
45473
45472
  }
45474
45473
  });
@@ -45481,8 +45480,8 @@
45481
45480
  target = connection.target,
45482
45481
  label = connection.label;
45483
45482
 
45484
- if (includes$4(allShapes, source)
45485
- && includes$4(allShapes, target)
45483
+ if (includes$3(allShapes, source)
45484
+ && includes$3(allShapes, target)
45486
45485
  && label) {
45487
45486
  moveShape(label);
45488
45487
  }
@@ -45587,13 +45586,13 @@
45587
45586
  var nonMovingResizingChildren = filter(children, function(child) {
45588
45587
  return !isConnection(child) &&
45589
45588
  !isLabel(child) &&
45590
- !includes$4(movingShapes, child) &&
45591
- !includes$4(resizingShapes, child);
45589
+ !includes$3(movingShapes, child) &&
45590
+ !includes$3(resizingShapes, child);
45592
45591
  });
45593
45592
 
45594
45593
  // find children that are moving
45595
45594
  var movingChildren = filter(children, function(child) {
45596
- return !isConnection(child) && !isLabel(child) && includes$4(movingShapes, child);
45595
+ return !isConnection(child) && !isLabel(child) && includes$3(movingShapes, child);
45597
45596
  });
45598
45597
 
45599
45598
  var minOrMax,
@@ -45644,7 +45643,7 @@
45644
45643
 
45645
45644
  if (attachers && attachers.length) {
45646
45645
  attachers.forEach(function(attacher) {
45647
- if (includes$4(movingShapes, attacher)) {
45646
+ if (includes$3(movingShapes, attacher)) {
45648
45647
  movingAttachers.push(attacher);
45649
45648
  } else {
45650
45649
  nonMovingAttachers.push(attacher);
@@ -45719,7 +45718,7 @@
45719
45718
  return spaceToolConstraints;
45720
45719
  }
45721
45720
 
45722
- function includes$4(array, item) {
45721
+ function includes$3(array, item) {
45723
45722
  return array.indexOf(item) !== -1;
45724
45723
  }
45725
45724
 
@@ -46990,7 +46989,7 @@
46990
46989
  attachers = filter(shapes, function(shape) {
46991
46990
  var host = shape.host;
46992
46991
 
46993
- return isAttacher(shape) && !includes$3(shapes, host);
46992
+ return isAttacher(shape) && !includes$2(shapes, host);
46994
46993
  });
46995
46994
  }
46996
46995
 
@@ -47186,7 +47185,7 @@
47186
47185
  return !!shape.host;
47187
47186
  }
47188
47187
 
47189
- function includes$3(array, item) {
47188
+ function includes$2(array, item) {
47190
47189
  return array.indexOf(item) !== -1;
47191
47190
  }
47192
47191
 
@@ -50279,7 +50278,7 @@
50279
50278
  axis = getAxisFromDirection(direction),
50280
50279
  layoutHints = {};
50281
50280
 
50282
- if (includes$2(affectedShapes, source) && includes$2(affectedShapes, target)) {
50281
+ if (includes$1(affectedShapes, source) && includes$1(affectedShapes, target)) {
50283
50282
 
50284
50283
  // move waypoints
50285
50284
  waypoints = map$1(waypoints, function(waypoint) {
@@ -50301,18 +50300,18 @@
50301
50300
  self._modeling.updateWaypoints(connection, waypoints, {
50302
50301
  labelBehavior: false
50303
50302
  });
50304
- } else if (includes$2(affectedShapes, source) || includes$2(affectedShapes, target)) {
50303
+ } else if (includes$1(affectedShapes, source) || includes$1(affectedShapes, target)) {
50305
50304
 
50306
50305
  // re-layout connection with moved start/end
50307
- if (includes$2(movingShapes, source)) {
50306
+ if (includes$1(movingShapes, source)) {
50308
50307
  layoutHints.connectionStart = getMovedSourceAnchor(connection, source, delta);
50309
- } else if (includes$2(movingShapes, target)) {
50308
+ } else if (includes$1(movingShapes, target)) {
50310
50309
  layoutHints.connectionEnd = getMovedTargetAnchor(connection, target, delta);
50311
- } else if (includes$2(resizingShapes, source)) {
50310
+ } else if (includes$1(resizingShapes, source)) {
50312
50311
  layoutHints.connectionStart = getResizedSourceAnchor(
50313
50312
  connection, source, oldBounds[source.id]
50314
50313
  );
50315
- } else if (includes$2(resizingShapes, target)) {
50314
+ } else if (includes$1(resizingShapes, target)) {
50316
50315
  layoutHints.connectionEnd = getResizedTargetAnchor(
50317
50316
  connection, target, oldBounds[target.id]
50318
50317
  );
@@ -50366,7 +50365,7 @@
50366
50365
  }
50367
50366
  }
50368
50367
 
50369
- function includes$2(array, item) {
50368
+ function includes$1(array, item) {
50370
50369
  return array.indexOf(item) !== -1;
50371
50370
  }
50372
50371
 
@@ -56866,9 +56865,7 @@
56866
56865
  });
56867
56866
 
56868
56867
  if (isArray$3(baseAllowed)) {
56869
- return every(baseAllowed, function(element) {
56870
- return includes$1(baseAllowed, element);
56871
- });
56868
+ return every(elements, el => baseAllowed.includes(el));
56872
56869
  }
56873
56870
 
56874
56871
  return baseAllowed;
@@ -56886,7 +56883,6 @@
56886
56883
  connect = this._connect,
56887
56884
  create = this._create,
56888
56885
  popupMenu = this._popupMenu,
56889
- rules = this._rules,
56890
56886
  autoPlace = this._autoPlace,
56891
56887
  translate = this._translate,
56892
56888
  appendPreview = this._appendPreview;
@@ -56894,6 +56890,10 @@
56894
56890
  var actions = {};
56895
56891
 
56896
56892
  if (element.type === 'label') {
56893
+ if (this._isDeleteAllowed([ element ])) {
56894
+ assign$1(actions, deleteAction());
56895
+ }
56896
+
56897
56897
  return actions;
56898
56898
  }
56899
56899
 
@@ -56907,6 +56907,19 @@
56907
56907
  modeling.removeElements([ element ]);
56908
56908
  }
56909
56909
 
56910
+ function deleteAction() {
56911
+ return {
56912
+ 'delete': {
56913
+ group: 'edit',
56914
+ className: 'bpmn-icon-trash',
56915
+ title: translate('Delete'),
56916
+ action: {
56917
+ click: removeElement
56918
+ }
56919
+ }
56920
+ };
56921
+ }
56922
+
56910
56923
  function getReplaceMenuPosition(element) {
56911
56924
 
56912
56925
  var Y_OFFSET = 5;
@@ -57231,26 +57244,8 @@
57231
57244
  });
57232
57245
  }
57233
57246
 
57234
- // delete element entry, only show if allowed by rules
57235
- var deleteAllowed = rules.allowed('elements.delete', { elements: [ element ] });
57236
-
57237
- if (isArray$3(deleteAllowed)) {
57238
-
57239
- // was the element returned as a deletion candidate?
57240
- deleteAllowed = deleteAllowed[0] === element;
57241
- }
57242
-
57243
- if (deleteAllowed) {
57244
- assign$1(actions, {
57245
- 'delete': {
57246
- group: 'edit',
57247
- className: 'bpmn-icon-trash',
57248
- title: translate('Delete'),
57249
- action: {
57250
- click: removeElement
57251
- }
57252
- }
57253
- });
57247
+ if (this._isDeleteAllowed([ element ])) {
57248
+ assign$1(actions, deleteAction());
57254
57249
  }
57255
57250
 
57256
57251
  return actions;
@@ -57281,10 +57276,6 @@
57281
57276
  return isType && isDefinition;
57282
57277
  }
57283
57278
 
57284
- function includes$1(array, item) {
57285
- return array.indexOf(item) !== -1;
57286
- }
57287
-
57288
57279
  var ContextPadModule = {
57289
57280
  __depends__: [
57290
57281
  AppendPreviewModule,