bpmn-js 11.3.0 → 11.4.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.
Files changed (25) hide show
  1. package/dist/bpmn-modeler.development.js +87 -61
  2. package/dist/bpmn-modeler.production.min.js +3 -3
  3. package/dist/bpmn-navigated-viewer.development.js +22 -6
  4. package/dist/bpmn-navigated-viewer.production.min.js +2 -2
  5. package/dist/bpmn-viewer.development.js +22 -6
  6. package/dist/bpmn-viewer.production.min.js +2 -2
  7. package/lib/draw/BpmnRenderer.js +20 -4
  8. package/lib/features/align-elements/dist/align-bottom-tool.svg +1 -0
  9. package/lib/features/align-elements/dist/align-horizontal-center-tool.svg +1 -0
  10. package/lib/features/align-elements/dist/align-left-tool.svg +1 -0
  11. package/lib/features/align-elements/dist/align-right-tool.svg +1 -0
  12. package/lib/features/align-elements/dist/align-tool.svg +1 -0
  13. package/lib/features/align-elements/dist/align-top-tool.svg +1 -0
  14. package/lib/features/align-elements/dist/align-vertical-center-tool.svg +1 -0
  15. package/lib/features/create-append-anything/AppendContextPadProvider.js +3 -3
  16. package/lib/features/create-append-anything/AppendMenuProvider.js +15 -5
  17. package/lib/features/create-append-anything/CreateAppendEditorActions.js +11 -4
  18. package/lib/features/create-append-anything/CreateAppendKeyboardBindings.js +1 -8
  19. package/lib/features/create-append-anything/CreatePaletteProvider.js +7 -11
  20. package/lib/features/label-editing/LabelEditingProvider.js +1 -1
  21. package/lib/{icons → features/palette}/dist/create.svg +0 -0
  22. package/package.json +1 -1
  23. package/lib/icons/dist/append.svg +0 -1
  24. package/lib/icons/dist/connect-context-pad.svg +0 -1
  25. package/lib/icons/dist/connect-palette.svg +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v11.3.0
2
+ * bpmn-js - bpmn-modeler v11.4.0
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: 2023-02-07
11
+ * Date: 2023-02-16
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -17463,7 +17463,11 @@
17463
17463
  ...shapeStyle({
17464
17464
  fill: fill,
17465
17465
  stroke: stroke,
17466
- strokeWidth: 1
17466
+ strokeWidth: 1,
17467
+
17468
+ // fix for safari / chrome / firefox bug not correctly
17469
+ // resetting stroke dash array
17470
+ strokeDasharray: [ 10000, 1 ]
17467
17471
  })
17468
17472
  });
17469
17473
 
@@ -17479,7 +17483,11 @@
17479
17483
  ...shapeStyle({
17480
17484
  fill: fill,
17481
17485
  stroke: stroke,
17482
- strokeWidth: 1
17486
+ strokeWidth: 1,
17487
+
17488
+ // fix for safari / chrome / firefox bug not correctly
17489
+ // resetting stroke dash array
17490
+ strokeDasharray: [ 10000, 1 ]
17483
17491
  })
17484
17492
  });
17485
17493
 
@@ -17495,7 +17503,11 @@
17495
17503
  ...lineStyle({
17496
17504
  fill: 'none',
17497
17505
  stroke: stroke,
17498
- strokeWidth: 1.5
17506
+ strokeWidth: 1.5,
17507
+
17508
+ // fix for safari / chrome / firefox bug not correctly
17509
+ // resetting stroke dash array
17510
+ strokeDasharray: [ 10000, 1 ]
17499
17511
  })
17500
17512
  });
17501
17513
 
@@ -17512,7 +17524,11 @@
17512
17524
  ...lineStyle({
17513
17525
  fill: 'none',
17514
17526
  stroke: stroke,
17515
- strokeWidth: 1.5
17527
+ strokeWidth: 1.5,
17528
+
17529
+ // fix for safari / chrome / firefox bug not correctly
17530
+ // resetting stroke dash array
17531
+ strokeDasharray: [ 10000, 1 ]
17516
17532
  })
17517
17533
  });
17518
17534
 
@@ -20760,7 +20776,7 @@
20760
20776
  return isPrimaryButton(event) || isAuxiliaryButton(event);
20761
20777
  }
20762
20778
 
20763
- var LOW_PRIORITY$q = 500;
20779
+ var LOW_PRIORITY$r = 500;
20764
20780
 
20765
20781
 
20766
20782
  /**
@@ -20955,7 +20971,7 @@
20955
20971
  eventBus.on([
20956
20972
  'shape.changed',
20957
20973
  'connection.changed'
20958
- ], LOW_PRIORITY$q, function(event) {
20974
+ ], LOW_PRIORITY$r, function(event) {
20959
20975
 
20960
20976
  var element = event.element,
20961
20977
  gfx = event.gfx;
@@ -20963,7 +20979,7 @@
20963
20979
  eventBus.fire('interactionEvents.updateHit', { element: element, gfx: gfx });
20964
20980
  });
20965
20981
 
20966
- eventBus.on('interactionEvents.createHit', LOW_PRIORITY$q, function(event) {
20982
+ eventBus.on('interactionEvents.createHit', LOW_PRIORITY$r, function(event) {
20967
20983
  var element = event.element,
20968
20984
  gfx = event.gfx;
20969
20985
 
@@ -21240,7 +21256,7 @@
21240
21256
  interactionEvents: [ 'type', InteractionEvents ]
21241
21257
  };
21242
21258
 
21243
- var LOW_PRIORITY$p = 500;
21259
+ var LOW_PRIORITY$q = 500;
21244
21260
 
21245
21261
 
21246
21262
  /**
@@ -21279,7 +21295,7 @@
21279
21295
 
21280
21296
  // A low priortity is necessary, because outlines of labels have to be updated
21281
21297
  // after the label bounds have been updated in the renderer.
21282
- eventBus.on([ 'shape.added', 'shape.changed' ], LOW_PRIORITY$p, function(event) {
21298
+ eventBus.on([ 'shape.added', 'shape.changed' ], LOW_PRIORITY$q, function(event) {
21283
21299
  var element = event.element,
21284
21300
  gfx = event.gfx;
21285
21301
 
@@ -21725,7 +21741,7 @@
21725
21741
  // document wide unique overlay ids
21726
21742
  var ids$1 = new IdGenerator('ov');
21727
21743
 
21728
- var LOW_PRIORITY$o = 500;
21744
+ var LOW_PRIORITY$p = 500;
21729
21745
 
21730
21746
 
21731
21747
  /**
@@ -22297,7 +22313,7 @@
22297
22313
 
22298
22314
  // move integration
22299
22315
 
22300
- eventBus.on('element.changed', LOW_PRIORITY$o, function(e) {
22316
+ eventBus.on('element.changed', LOW_PRIORITY$p, function(e) {
22301
22317
  var element = e.element;
22302
22318
 
22303
22319
  var container = self._getOverlayContainer(element, true);
@@ -23257,7 +23273,7 @@
23257
23273
  return true;
23258
23274
  }
23259
23275
 
23260
- var LOW_PRIORITY$n = 250;
23276
+ var LOW_PRIORITY$o = 250;
23261
23277
  var ARROW_DOWN_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>';
23262
23278
 
23263
23279
  var EMPTY_MARKER = 'bjs-drilldown-empty';
@@ -23274,7 +23290,7 @@
23274
23290
 
23275
23291
  var self = this;
23276
23292
 
23277
- this.executed('shape.toggleCollapse', LOW_PRIORITY$n, function(context) {
23293
+ this.executed('shape.toggleCollapse', LOW_PRIORITY$o, function(context) {
23278
23294
  var shape = context.shape;
23279
23295
 
23280
23296
  // Add overlay to the collapsed shape
@@ -23286,7 +23302,7 @@
23286
23302
  }, true);
23287
23303
 
23288
23304
 
23289
- this.reverted('shape.toggleCollapse', LOW_PRIORITY$n, function(context) {
23305
+ this.reverted('shape.toggleCollapse', LOW_PRIORITY$o, function(context) {
23290
23306
  var shape = context.shape;
23291
23307
 
23292
23308
  // Add overlay to the collapsed shape
@@ -23298,7 +23314,7 @@
23298
23314
  }, true);
23299
23315
 
23300
23316
 
23301
- this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$n,
23317
+ this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$o,
23302
23318
  function(context) {
23303
23319
  var oldParent = context.oldParent,
23304
23320
  newParent = context.newParent || context.parent,
@@ -23315,7 +23331,7 @@
23315
23331
  }, true);
23316
23332
 
23317
23333
 
23318
- this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$n,
23334
+ this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$o,
23319
23335
  function(context) {
23320
23336
  var oldParent = context.oldParent,
23321
23337
  newParent = context.newParent || context.parent,
@@ -23768,7 +23784,7 @@
23768
23784
  return target && (matches(target, 'input, textarea') || target.contentEditable === 'true');
23769
23785
  }
23770
23786
 
23771
- var LOW_PRIORITY$m = 500;
23787
+ var LOW_PRIORITY$n = 500;
23772
23788
 
23773
23789
 
23774
23790
  /**
@@ -23784,7 +23800,7 @@
23784
23800
 
23785
23801
  var self = this;
23786
23802
 
23787
- eventBus.on('editorActions.init', LOW_PRIORITY$m, function(event) {
23803
+ eventBus.on('editorActions.init', LOW_PRIORITY$n, function(event) {
23788
23804
 
23789
23805
  var editorActions = event.editorActions;
23790
23806
 
@@ -29265,14 +29281,14 @@
29265
29281
 
29266
29282
  var ICONS$1 = icons$1;
29267
29283
 
29268
- var LOW_PRIORITY$l = 900;
29284
+ var LOW_PRIORITY$m = 900;
29269
29285
 
29270
29286
  /**
29271
29287
  * A provider for align elements context pad button
29272
29288
  */
29273
29289
  function AlignElementsContextPadProvider(contextPad, popupMenu, translate, canvas) {
29274
29290
 
29275
- contextPad.registerProvider(LOW_PRIORITY$l, this);
29291
+ contextPad.registerProvider(LOW_PRIORITY$m, this);
29276
29292
 
29277
29293
  this._contextPad = contextPad;
29278
29294
  this._popupMenu = popupMenu;
@@ -29826,7 +29842,7 @@
29826
29842
  return true;
29827
29843
  }
29828
29844
 
29829
- var LOW_PRIORITY$k = 100;
29845
+ var LOW_PRIORITY$l = 100;
29830
29846
 
29831
29847
 
29832
29848
  /**
@@ -29838,7 +29854,7 @@
29838
29854
  */
29839
29855
  function AutoPlace$1(eventBus, modeling, canvas) {
29840
29856
 
29841
- eventBus.on('autoPlace', LOW_PRIORITY$k, function(context) {
29857
+ eventBus.on('autoPlace', LOW_PRIORITY$l, function(context) {
29842
29858
  var shape = context.shape,
29843
29859
  source = context.source;
29844
29860
 
@@ -33550,7 +33566,7 @@
33550
33566
  }
33551
33567
 
33552
33568
  var HIGH_PRIORITY$h = 1100,
33553
- LOW_PRIORITY$j = 900;
33569
+ LOW_PRIORITY$k = 900;
33554
33570
 
33555
33571
  var MARKER_OK$3 = 'connect-ok',
33556
33572
  MARKER_NOT_OK$3 = 'connect-not-ok';
@@ -33594,7 +33610,7 @@
33594
33610
  });
33595
33611
  });
33596
33612
 
33597
- eventBus.on('connect.hover', LOW_PRIORITY$j, function(event) {
33613
+ eventBus.on('connect.hover', LOW_PRIORITY$k, function(event) {
33598
33614
  var context = event.context,
33599
33615
  hover = event.hover,
33600
33616
  canExecute = context.canExecute;
@@ -35152,7 +35168,7 @@
35152
35168
  return !!element.labelTarget;
35153
35169
  }
35154
35170
 
35155
- var LOW_PRIORITY$i = 750;
35171
+ var LOW_PRIORITY$j = 750;
35156
35172
 
35157
35173
 
35158
35174
  function CreatePreview(
@@ -35197,7 +35213,7 @@
35197
35213
  return dragGroup;
35198
35214
  }
35199
35215
 
35200
- eventBus.on('create.move', LOW_PRIORITY$i, function(event) {
35216
+ eventBus.on('create.move', LOW_PRIORITY$j, function(event) {
35201
35217
 
35202
35218
  var hover = event.hover,
35203
35219
  context = event.context,
@@ -35979,7 +35995,7 @@
35979
35995
  });
35980
35996
  }
35981
35997
 
35982
- var LOW_PRIORITY$h = 750;
35998
+ var LOW_PRIORITY$i = 750;
35983
35999
 
35984
36000
 
35985
36001
  function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
@@ -35990,7 +36006,7 @@
35990
36006
  return moddleCopy.copyElement(bo, targetBo, null, clone);
35991
36007
  }
35992
36008
 
35993
- eventBus.on('copyPaste.copyElement', LOW_PRIORITY$h, function(context) {
36009
+ eventBus.on('copyPaste.copyElement', LOW_PRIORITY$i, function(context) {
35994
36010
  var descriptor = context.descriptor,
35995
36011
  element = context.element,
35996
36012
  businessObject = getBusinessObject(element);
@@ -36087,7 +36103,7 @@
36087
36103
 
36088
36104
  // copy + paste processRef with participant
36089
36105
 
36090
- eventBus.on('copyPaste.copyElement', LOW_PRIORITY$h, function(context) {
36106
+ eventBus.on('copyPaste.copyElement', LOW_PRIORITY$i, function(context) {
36091
36107
  var descriptor = context.descriptor,
36092
36108
  element = context.element;
36093
36109
 
@@ -36113,7 +36129,7 @@
36113
36129
 
36114
36130
  // resolve references
36115
36131
 
36116
- eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$h, function(context) {
36132
+ eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$i, function(context) {
36117
36133
  var cache = context.cache,
36118
36134
  descriptor = context.descriptor;
36119
36135
 
@@ -40373,12 +40389,13 @@
40373
40389
  * A palette provider for the create elements menu.
40374
40390
  */
40375
40391
  function CreatePaletteProvider(palette, translate, popupMenu, canvas, mouse) {
40392
+
40376
40393
  this._translate = translate;
40377
40394
  this._popupMenu = popupMenu;
40378
40395
  this._canvas = canvas;
40379
40396
  this._mouse = mouse;
40380
40397
 
40381
- palette.registerProvider(this);
40398
+ palette.registerProvider(800,this);
40382
40399
  }
40383
40400
 
40384
40401
  CreatePaletteProvider.$inject = [
@@ -40391,8 +40408,7 @@
40391
40408
 
40392
40409
 
40393
40410
  CreatePaletteProvider.prototype.getPaletteEntries = function(element) {
40394
- const actions = {},
40395
- translate = this._translate,
40411
+ const translate = this._translate,
40396
40412
  popupMenu = this._popupMenu,
40397
40413
  canvas = this._canvas,
40398
40414
  mouse = this._mouse;
@@ -40415,7 +40431,7 @@
40415
40431
  };
40416
40432
  };
40417
40433
 
40418
- assign$1(actions, {
40434
+ return {
40419
40435
  'create': {
40420
40436
  group: 'create',
40421
40437
  imageUrl: createIcon,
@@ -40433,10 +40449,8 @@
40433
40449
  });
40434
40450
  }
40435
40451
  }
40436
- },
40437
- });
40438
-
40439
- return actions;
40452
+ }
40453
+ };
40440
40454
  };
40441
40455
 
40442
40456
  /**
@@ -40464,16 +40478,23 @@
40464
40478
  var selection = this._injector.get('selection', false);
40465
40479
  var contextPad = this._injector.get('contextPad', false);
40466
40480
  var palette = this._injector.get('palette', false);
40481
+ var popupMenu = this._injector.get('popupMenu', false);
40467
40482
 
40468
40483
  const actions = {};
40469
40484
 
40470
40485
  // append
40471
- if (selection && contextPad) {
40486
+ if (selection && contextPad && palette && popupMenu && palette) {
40472
40487
  assign$1(actions, {
40473
40488
  'appendElement': function(event) {
40474
- contextPad.triggerEntry('append', 'click', event);
40475
- } }
40476
- );
40489
+ const selected = selection && selection.get();
40490
+
40491
+ if (selected.length == 1 && !popupMenu.isEmpty(selected[0], 'bpmn-append')) {
40492
+ contextPad.triggerEntry('append', 'click', event);
40493
+ } else {
40494
+ palette.triggerEntry('create', 'click', event);
40495
+ }
40496
+ }
40497
+ });
40477
40498
  }
40478
40499
 
40479
40500
  // create
@@ -40499,7 +40520,6 @@
40499
40520
  this._injector = injector;
40500
40521
  this._keyboard = this._injector.get('keyboard', false);
40501
40522
  this._editorActions = this._injector.get('editorActions', false);
40502
- this._selection = this._injector.get('selection', false);
40503
40523
 
40504
40524
  if (this._keyboard) {
40505
40525
  this._injector.invoke(KeyboardBindings, this);
@@ -40523,7 +40543,6 @@
40523
40543
 
40524
40544
  var keyboard = this._keyboard;
40525
40545
  var editorActions = this._editorActions;
40526
- var selection = this._selection;
40527
40546
 
40528
40547
  // inherit default bindings
40529
40548
  KeyboardBindings.prototype.registerBindings.call(this, keyboard, editorActions);
@@ -40554,12 +40573,7 @@
40554
40573
 
40555
40574
  if (keyboard && keyboard.isKey([ 'a', 'A' ], event)) {
40556
40575
 
40557
- if (selection && selection.get().length == 1) {
40558
- editorActions && editorActions.trigger('appendElement', event);
40559
- } else {
40560
- editorActions && editorActions.trigger('createElement', event);
40561
- }
40562
-
40576
+ editorActions && editorActions.trigger('appendElement', event);
40563
40577
  return true;
40564
40578
  }
40565
40579
  });
@@ -40591,7 +40605,8 @@
40591
40605
  create,
40592
40606
  autoPlace,
40593
40607
  rules,
40594
- mouse
40608
+ mouse,
40609
+ translate
40595
40610
  ) {
40596
40611
  this._elementFactory = elementFactory;
40597
40612
  this._popupMenu = popupMenu;
@@ -40600,6 +40615,7 @@
40600
40615
  this._rules = rules;
40601
40616
  this._create = create;
40602
40617
  this._mouse = mouse;
40618
+ this._translate = translate;
40603
40619
 
40604
40620
  this.register();
40605
40621
  }
@@ -40610,7 +40626,8 @@
40610
40626
  'create',
40611
40627
  'autoPlace',
40612
40628
  'rules',
40613
- 'mouse'
40629
+ 'mouse',
40630
+ 'translate'
40614
40631
  ];
40615
40632
 
40616
40633
  /**
@@ -40629,6 +40646,8 @@
40629
40646
  */
40630
40647
  AppendMenuProvider.prototype.getPopupMenuEntries = function(element) {
40631
40648
  const rules = this._rules;
40649
+ const translate = this._translate;
40650
+
40632
40651
  const entries = {};
40633
40652
 
40634
40653
  if (!rules.allowed('shape.append', { element: element })) {
@@ -40652,10 +40671,13 @@
40652
40671
  } = option;
40653
40672
 
40654
40673
  entries[`append-${actionName}`] = {
40655
- label,
40674
+ label: label && translate(label),
40656
40675
  className,
40657
40676
  description,
40658
- group,
40677
+ group: group && {
40678
+ ...group,
40679
+ name: translate(group.name)
40680
+ },
40659
40681
  search,
40660
40682
  rank,
40661
40683
  action: this._createEntryAction(element, target)
@@ -40723,7 +40745,9 @@
40723
40745
  event = mouse.getLastMoveEvent();
40724
40746
  }
40725
40747
 
40726
- return create.start(event, newElement);
40748
+ return create.start(event, newElement, {
40749
+ source: element
40750
+ });
40727
40751
  };
40728
40752
 
40729
40753
  return {
@@ -40757,16 +40781,18 @@
40757
40781
  return true;
40758
40782
  };
40759
40783
 
40784
+ var LOW_PRIORITY$h = 900;
40785
+
40760
40786
  /**
40761
40787
  * A provider for align elements context pad button
40762
40788
  */
40763
40789
  function AppendContextPadProvider(contextPad, popupMenu, translate, canvas) {
40790
+ contextPad.registerProvider(LOW_PRIORITY$h, this);
40791
+
40764
40792
  this._contextPad = contextPad;
40765
40793
  this._popupMenu = popupMenu;
40766
40794
  this._translate = translate;
40767
40795
  this._canvas = canvas;
40768
-
40769
- contextPad.registerProvider(this);
40770
40796
  }
40771
40797
 
40772
40798
  AppendContextPadProvider.$inject = [
@@ -40783,7 +40809,7 @@
40783
40809
 
40784
40810
  if (!popupMenu.isEmpty(element, 'bpmn-append')) {
40785
40811
 
40786
- // Replace menu entry
40812
+ // append menu entry
40787
40813
  return {
40788
40814
  'append': {
40789
40815
  group: 'model',
@@ -43615,7 +43641,7 @@
43615
43641
 
43616
43642
  function activateDirectEdit(element, force) {
43617
43643
  if (force ||
43618
- isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation' ]) ||
43644
+ isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation', 'bpmn:Participant' ]) ||
43619
43645
  isCollapsedSubProcess(element)) {
43620
43646
 
43621
43647
  directEditing.activate(element);