bpmn-js 17.9.0 → 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.9.0
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-28
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
 
@@ -36403,7 +36403,7 @@
36403
36403
  shapes.forEach(function(shape, index) {
36404
36404
  var host = shape.host;
36405
36405
 
36406
- if (shouldReplace(shape, includes$7(shapes, host) ? host : newHost)) {
36406
+ if (shouldReplace(shape, includes$6(shapes, host) ? host : newHost)) {
36407
36407
  shapes[ index ] = self._replaceShape(shape);
36408
36408
  }
36409
36409
  });
@@ -36449,7 +36449,7 @@
36449
36449
  return !isLabel(shape) && is$1(shape, 'bpmn:BoundaryEvent') && !host;
36450
36450
  }
36451
36451
 
36452
- function includes$7(array, item) {
36452
+ function includes$6(array, item) {
36453
36453
  return array.indexOf(item) !== -1;
36454
36454
  }
36455
36455
 
@@ -42353,7 +42353,7 @@
42353
42353
  *
42354
42354
  * @return {boolean}
42355
42355
  */
42356
- function includes$6(elements, element) {
42356
+ function includes$5(elements, element) {
42357
42357
  return (elements && element) && elements.indexOf(element) !== -1;
42358
42358
  }
42359
42359
 
@@ -42368,7 +42368,7 @@
42368
42368
  return true;
42369
42369
  }
42370
42370
 
42371
- if (is$1(element, 'bpmn:Lane') && !includes$6(elements, element.parent)) {
42371
+ if (is$1(element, 'bpmn:Lane') && !includes$5(elements, element.parent)) {
42372
42372
  return false;
42373
42373
  }
42374
42374
 
@@ -45048,12 +45048,12 @@
45048
45048
  var source = connection.source,
45049
45049
  target = connection.target;
45050
45050
 
45051
- if (includes$5(movingShapes, source) ||
45052
- includes$5(movingShapes, target) ||
45053
- includes$5(resizingShapes, source) ||
45054
- 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)) {
45055
45055
 
45056
- if (!includes$5(waypointsUpdatingConnections, connection)) {
45056
+ if (!includes$4(waypointsUpdatingConnections, connection)) {
45057
45057
  waypointsUpdatingConnections.push(connection);
45058
45058
  }
45059
45059
  }
@@ -45063,7 +45063,7 @@
45063
45063
  return waypointsUpdatingConnections;
45064
45064
  }
45065
45065
 
45066
- function includes$5(array, item) {
45066
+ function includes$4(array, item) {
45067
45067
  return array.indexOf(item) !== -1;
45068
45068
  }
45069
45069
 
@@ -45467,7 +45467,7 @@
45467
45467
  forEach$1(attachers, function(attacher) {
45468
45468
  var host = attacher.host;
45469
45469
 
45470
- if (includes$4(allShapes, host)) {
45470
+ if (includes$3(allShapes, host)) {
45471
45471
  moveShape(attacher);
45472
45472
  }
45473
45473
  });
@@ -45480,8 +45480,8 @@
45480
45480
  target = connection.target,
45481
45481
  label = connection.label;
45482
45482
 
45483
- if (includes$4(allShapes, source)
45484
- && includes$4(allShapes, target)
45483
+ if (includes$3(allShapes, source)
45484
+ && includes$3(allShapes, target)
45485
45485
  && label) {
45486
45486
  moveShape(label);
45487
45487
  }
@@ -45586,13 +45586,13 @@
45586
45586
  var nonMovingResizingChildren = filter(children, function(child) {
45587
45587
  return !isConnection(child) &&
45588
45588
  !isLabel(child) &&
45589
- !includes$4(movingShapes, child) &&
45590
- !includes$4(resizingShapes, child);
45589
+ !includes$3(movingShapes, child) &&
45590
+ !includes$3(resizingShapes, child);
45591
45591
  });
45592
45592
 
45593
45593
  // find children that are moving
45594
45594
  var movingChildren = filter(children, function(child) {
45595
- return !isConnection(child) && !isLabel(child) && includes$4(movingShapes, child);
45595
+ return !isConnection(child) && !isLabel(child) && includes$3(movingShapes, child);
45596
45596
  });
45597
45597
 
45598
45598
  var minOrMax,
@@ -45643,7 +45643,7 @@
45643
45643
 
45644
45644
  if (attachers && attachers.length) {
45645
45645
  attachers.forEach(function(attacher) {
45646
- if (includes$4(movingShapes, attacher)) {
45646
+ if (includes$3(movingShapes, attacher)) {
45647
45647
  movingAttachers.push(attacher);
45648
45648
  } else {
45649
45649
  nonMovingAttachers.push(attacher);
@@ -45718,7 +45718,7 @@
45718
45718
  return spaceToolConstraints;
45719
45719
  }
45720
45720
 
45721
- function includes$4(array, item) {
45721
+ function includes$3(array, item) {
45722
45722
  return array.indexOf(item) !== -1;
45723
45723
  }
45724
45724
 
@@ -46989,7 +46989,7 @@
46989
46989
  attachers = filter(shapes, function(shape) {
46990
46990
  var host = shape.host;
46991
46991
 
46992
- return isAttacher(shape) && !includes$3(shapes, host);
46992
+ return isAttacher(shape) && !includes$2(shapes, host);
46993
46993
  });
46994
46994
  }
46995
46995
 
@@ -47185,7 +47185,7 @@
47185
47185
  return !!shape.host;
47186
47186
  }
47187
47187
 
47188
- function includes$3(array, item) {
47188
+ function includes$2(array, item) {
47189
47189
  return array.indexOf(item) !== -1;
47190
47190
  }
47191
47191
 
@@ -50278,7 +50278,7 @@
50278
50278
  axis = getAxisFromDirection(direction),
50279
50279
  layoutHints = {};
50280
50280
 
50281
- if (includes$2(affectedShapes, source) && includes$2(affectedShapes, target)) {
50281
+ if (includes$1(affectedShapes, source) && includes$1(affectedShapes, target)) {
50282
50282
 
50283
50283
  // move waypoints
50284
50284
  waypoints = map$1(waypoints, function(waypoint) {
@@ -50300,18 +50300,18 @@
50300
50300
  self._modeling.updateWaypoints(connection, waypoints, {
50301
50301
  labelBehavior: false
50302
50302
  });
50303
- } else if (includes$2(affectedShapes, source) || includes$2(affectedShapes, target)) {
50303
+ } else if (includes$1(affectedShapes, source) || includes$1(affectedShapes, target)) {
50304
50304
 
50305
50305
  // re-layout connection with moved start/end
50306
- if (includes$2(movingShapes, source)) {
50306
+ if (includes$1(movingShapes, source)) {
50307
50307
  layoutHints.connectionStart = getMovedSourceAnchor(connection, source, delta);
50308
- } else if (includes$2(movingShapes, target)) {
50308
+ } else if (includes$1(movingShapes, target)) {
50309
50309
  layoutHints.connectionEnd = getMovedTargetAnchor(connection, target, delta);
50310
- } else if (includes$2(resizingShapes, source)) {
50310
+ } else if (includes$1(resizingShapes, source)) {
50311
50311
  layoutHints.connectionStart = getResizedSourceAnchor(
50312
50312
  connection, source, oldBounds[source.id]
50313
50313
  );
50314
- } else if (includes$2(resizingShapes, target)) {
50314
+ } else if (includes$1(resizingShapes, target)) {
50315
50315
  layoutHints.connectionEnd = getResizedTargetAnchor(
50316
50316
  connection, target, oldBounds[target.id]
50317
50317
  );
@@ -50365,7 +50365,7 @@
50365
50365
  }
50366
50366
  }
50367
50367
 
50368
- function includes$2(array, item) {
50368
+ function includes$1(array, item) {
50369
50369
  return array.indexOf(item) !== -1;
50370
50370
  }
50371
50371
 
@@ -56865,9 +56865,7 @@
56865
56865
  });
56866
56866
 
56867
56867
  if (isArray$3(baseAllowed)) {
56868
- return every(baseAllowed, function(element) {
56869
- return includes$1(baseAllowed, element);
56870
- });
56868
+ return every(elements, el => baseAllowed.includes(el));
56871
56869
  }
56872
56870
 
56873
56871
  return baseAllowed;
@@ -56885,7 +56883,6 @@
56885
56883
  connect = this._connect,
56886
56884
  create = this._create,
56887
56885
  popupMenu = this._popupMenu,
56888
- rules = this._rules,
56889
56886
  autoPlace = this._autoPlace,
56890
56887
  translate = this._translate,
56891
56888
  appendPreview = this._appendPreview;
@@ -56893,6 +56890,10 @@
56893
56890
  var actions = {};
56894
56891
 
56895
56892
  if (element.type === 'label') {
56893
+ if (this._isDeleteAllowed([ element ])) {
56894
+ assign$1(actions, deleteAction());
56895
+ }
56896
+
56896
56897
  return actions;
56897
56898
  }
56898
56899
 
@@ -56906,6 +56907,19 @@
56906
56907
  modeling.removeElements([ element ]);
56907
56908
  }
56908
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
+
56909
56923
  function getReplaceMenuPosition(element) {
56910
56924
 
56911
56925
  var Y_OFFSET = 5;
@@ -57230,26 +57244,8 @@
57230
57244
  });
57231
57245
  }
57232
57246
 
57233
- // delete element entry, only show if allowed by rules
57234
- var deleteAllowed = rules.allowed('elements.delete', { elements: [ element ] });
57235
-
57236
- if (isArray$3(deleteAllowed)) {
57237
-
57238
- // was the element returned as a deletion candidate?
57239
- deleteAllowed = deleteAllowed[0] === element;
57240
- }
57241
-
57242
- if (deleteAllowed) {
57243
- assign$1(actions, {
57244
- 'delete': {
57245
- group: 'edit',
57246
- className: 'bpmn-icon-trash',
57247
- title: translate('Delete'),
57248
- action: {
57249
- click: removeElement
57250
- }
57251
- }
57252
- });
57247
+ if (this._isDeleteAllowed([ element ])) {
57248
+ assign$1(actions, deleteAction());
57253
57249
  }
57254
57250
 
57255
57251
  return actions;
@@ -57280,10 +57276,6 @@
57280
57276
  return isType && isDefinition;
57281
57277
  }
57282
57278
 
57283
- function includes$1(array, item) {
57284
- return array.indexOf(item) !== -1;
57285
- }
57286
-
57287
57279
  var ContextPadModule = {
57288
57280
  __depends__: [
57289
57281
  AppendPreviewModule,