camunda-bpmn-js 1.3.1 → 1.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.
@@ -17671,7 +17671,11 @@
17671
17671
  ...shapeStyle({
17672
17672
  fill: fill,
17673
17673
  stroke: stroke,
17674
- strokeWidth: 1
17674
+ strokeWidth: 1,
17675
+
17676
+ // fix for safari / chrome / firefox bug not correctly
17677
+ // resetting stroke dash array
17678
+ strokeDasharray: [ 10000, 1 ]
17675
17679
  })
17676
17680
  });
17677
17681
 
@@ -17687,7 +17691,11 @@
17687
17691
  ...shapeStyle({
17688
17692
  fill: fill,
17689
17693
  stroke: stroke,
17690
- strokeWidth: 1
17694
+ strokeWidth: 1,
17695
+
17696
+ // fix for safari / chrome / firefox bug not correctly
17697
+ // resetting stroke dash array
17698
+ strokeDasharray: [ 10000, 1 ]
17691
17699
  })
17692
17700
  });
17693
17701
 
@@ -17703,7 +17711,11 @@
17703
17711
  ...lineStyle({
17704
17712
  fill: 'none',
17705
17713
  stroke: stroke,
17706
- strokeWidth: 1.5
17714
+ strokeWidth: 1.5,
17715
+
17716
+ // fix for safari / chrome / firefox bug not correctly
17717
+ // resetting stroke dash array
17718
+ strokeDasharray: [ 10000, 1 ]
17707
17719
  })
17708
17720
  });
17709
17721
 
@@ -17720,7 +17732,11 @@
17720
17732
  ...lineStyle({
17721
17733
  fill: 'none',
17722
17734
  stroke: stroke,
17723
- strokeWidth: 1.5
17735
+ strokeWidth: 1.5,
17736
+
17737
+ // fix for safari / chrome / firefox bug not correctly
17738
+ // resetting stroke dash array
17739
+ strokeDasharray: [ 10000, 1 ]
17724
17740
  })
17725
17741
  });
17726
17742
 
@@ -40670,16 +40686,23 @@
40670
40686
  var selection = this._injector.get('selection', false);
40671
40687
  var contextPad = this._injector.get('contextPad', false);
40672
40688
  var palette = this._injector.get('palette', false);
40689
+ var popupMenu = this._injector.get('popupMenu', false);
40673
40690
 
40674
40691
  const actions = {};
40675
40692
 
40676
40693
  // append
40677
- if (selection && contextPad) {
40694
+ if (selection && contextPad && palette && popupMenu && palette) {
40678
40695
  assign$1(actions, {
40679
40696
  'appendElement': function(event) {
40680
- contextPad.triggerEntry('append', 'click', event);
40681
- } }
40682
- );
40697
+ const selected = selection && selection.get();
40698
+
40699
+ if (selected.length == 1 && !popupMenu.isEmpty(selected[0], 'bpmn-append')) {
40700
+ contextPad.triggerEntry('append', 'click', event);
40701
+ } else {
40702
+ palette.triggerEntry('create', 'click', event);
40703
+ }
40704
+ }
40705
+ });
40683
40706
  }
40684
40707
 
40685
40708
  // create
@@ -40705,7 +40728,6 @@
40705
40728
  this._injector = injector;
40706
40729
  this._keyboard = this._injector.get('keyboard', false);
40707
40730
  this._editorActions = this._injector.get('editorActions', false);
40708
- this._selection = this._injector.get('selection', false);
40709
40731
 
40710
40732
  if (this._keyboard) {
40711
40733
  this._injector.invoke(KeyboardBindings, this);
@@ -40729,7 +40751,6 @@
40729
40751
 
40730
40752
  var keyboard = this._keyboard;
40731
40753
  var editorActions = this._editorActions;
40732
- var selection = this._selection;
40733
40754
 
40734
40755
  // inherit default bindings
40735
40756
  KeyboardBindings.prototype.registerBindings.call(this, keyboard, editorActions);
@@ -40760,12 +40781,7 @@
40760
40781
 
40761
40782
  if (keyboard && keyboard.isKey([ 'a', 'A' ], event)) {
40762
40783
 
40763
- if (selection && selection.get().length == 1) {
40764
- editorActions && editorActions.trigger('appendElement', event);
40765
- } else {
40766
- editorActions && editorActions.trigger('createElement', event);
40767
- }
40768
-
40784
+ editorActions && editorActions.trigger('appendElement', event);
40769
40785
  return true;
40770
40786
  }
40771
40787
  });
@@ -40797,7 +40813,8 @@
40797
40813
  create,
40798
40814
  autoPlace,
40799
40815
  rules,
40800
- mouse
40816
+ mouse,
40817
+ translate
40801
40818
  ) {
40802
40819
  this._elementFactory = elementFactory;
40803
40820
  this._popupMenu = popupMenu;
@@ -40806,6 +40823,7 @@
40806
40823
  this._rules = rules;
40807
40824
  this._create = create;
40808
40825
  this._mouse = mouse;
40826
+ this._translate = translate;
40809
40827
 
40810
40828
  this.register();
40811
40829
  }
@@ -40816,7 +40834,8 @@
40816
40834
  'create',
40817
40835
  'autoPlace',
40818
40836
  'rules',
40819
- 'mouse'
40837
+ 'mouse',
40838
+ 'translate'
40820
40839
  ];
40821
40840
 
40822
40841
  /**
@@ -40835,6 +40854,8 @@
40835
40854
  */
40836
40855
  AppendMenuProvider.prototype.getPopupMenuEntries = function(element) {
40837
40856
  const rules = this._rules;
40857
+ const translate = this._translate;
40858
+
40838
40859
  const entries = {};
40839
40860
 
40840
40861
  if (!rules.allowed('shape.append', { element: element })) {
@@ -40858,10 +40879,13 @@
40858
40879
  } = option;
40859
40880
 
40860
40881
  entries[`append-${actionName}`] = {
40861
- label,
40882
+ label: label && translate(label),
40862
40883
  className,
40863
40884
  description,
40864
- group,
40885
+ group: group && {
40886
+ ...group,
40887
+ name: translate(group.name)
40888
+ },
40865
40889
  search,
40866
40890
  rank,
40867
40891
  action: this._createEntryAction(element, target)
@@ -40929,7 +40953,9 @@
40929
40953
  event = mouse.getLastMoveEvent();
40930
40954
  }
40931
40955
 
40932
- return create.start(event, newElement);
40956
+ return create.start(event, newElement, {
40957
+ source: element
40958
+ });
40933
40959
  };
40934
40960
 
40935
40961
  return {
@@ -43823,7 +43849,7 @@
43823
43849
 
43824
43850
  function activateDirectEdit(element, force) {
43825
43851
  if (force ||
43826
- isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation' ]) ||
43852
+ isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation', 'bpmn:Participant' ]) ||
43827
43853
  isCollapsedSubProcess(element)) {
43828
43854
 
43829
43855
  directEditing.activate(element);