bpmn-js 9.1.0 → 9.2.2

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 (74) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/assets/diagram-js.css +47 -35
  3. package/dist/bpmn-modeler.development.js +56707 -56636
  4. package/dist/bpmn-modeler.production.min.js +28 -28
  5. package/dist/bpmn-navigated-viewer.development.js +21591 -21939
  6. package/dist/bpmn-navigated-viewer.production.min.js +20 -20
  7. package/dist/bpmn-viewer.development.js +20785 -21133
  8. package/dist/bpmn-viewer.production.min.js +20 -20
  9. package/lib/BaseModeler.js +1 -1
  10. package/lib/BaseViewer.js +1 -1
  11. package/lib/Modeler.js +1 -1
  12. package/lib/NavigatedViewer.js +1 -1
  13. package/lib/Viewer.js +1 -1
  14. package/lib/draw/BpmnRenderUtil.js +3 -1
  15. package/lib/draw/BpmnRenderer.js +11 -9
  16. package/lib/features/auto-place/BpmnAutoPlaceUtil.js +10 -0
  17. package/lib/features/auto-resize/BpmnAutoResize.js +1 -1
  18. package/lib/features/auto-resize/BpmnAutoResizeProvider.js +1 -1
  19. package/lib/features/context-pad/ContextPadProvider.js +57 -3
  20. package/lib/features/copy-paste/ModdleCopy.js +0 -2
  21. package/lib/features/drilldown/DrilldownOverlayBehavior.js +1 -1
  22. package/lib/features/editor-actions/BpmnEditorActions.js +1 -1
  23. package/lib/features/grid-snapping/behavior/LayoutConnectionBehavior.js +1 -1
  24. package/lib/features/keyboard/BpmnKeyboardBindings.js +1 -1
  25. package/lib/features/label-editing/LabelEditingProvider.js +12 -0
  26. package/lib/features/modeling/BpmnLayouter.js +1 -1
  27. package/lib/features/modeling/BpmnUpdater.js +1 -1
  28. package/lib/features/modeling/ElementFactory.js +1 -1
  29. package/lib/features/modeling/Modeling.js +1 -1
  30. package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js +1 -1
  31. package/lib/features/modeling/behavior/AppendBehavior.js +1 -1
  32. package/lib/features/modeling/behavior/AssociationBehavior.js +1 -1
  33. package/lib/features/modeling/behavior/AttachEventBehavior.js +1 -1
  34. package/lib/features/modeling/behavior/BoundaryEventBehavior.js +1 -1
  35. package/lib/features/modeling/behavior/CreateBehavior.js +1 -1
  36. package/lib/features/modeling/behavior/CreateDataObjectBehavior.js +1 -1
  37. package/lib/features/modeling/behavior/CreateParticipantBehavior.js +1 -1
  38. package/lib/features/modeling/behavior/DataInputAssociationBehavior.js +1 -1
  39. package/lib/features/modeling/behavior/DataStoreBehavior.js +1 -1
  40. package/lib/features/modeling/behavior/DeleteLaneBehavior.js +1 -1
  41. package/lib/features/modeling/behavior/DetachEventBehavior.js +1 -1
  42. package/lib/features/modeling/behavior/DropOnFlowBehavior.js +1 -1
  43. package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +1 -1
  44. package/lib/features/modeling/behavior/GroupBehavior.js +1 -1
  45. package/lib/features/modeling/behavior/IsHorizontalFix.js +1 -1
  46. package/lib/features/modeling/behavior/LabelBehavior.js +1 -1
  47. package/lib/features/modeling/behavior/LayoutConnectionBehavior.js +117 -0
  48. package/lib/features/modeling/behavior/MessageFlowBehavior.js +1 -1
  49. package/lib/features/modeling/behavior/RemoveElementBehavior.js +1 -1
  50. package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +1 -1
  51. package/lib/features/modeling/behavior/RemoveParticipantBehavior.js +1 -1
  52. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +1 -1
  53. package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +1 -1
  54. package/lib/features/modeling/behavior/RootElementReferenceBehavior.js +1 -1
  55. package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +1 -1
  56. package/lib/features/modeling/behavior/SubProcessStartEventBehavior.js +1 -1
  57. package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +1 -1
  58. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +1 -1
  59. package/lib/features/modeling/behavior/UnclaimIdBehavior.js +1 -1
  60. package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +1 -1
  61. package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +1 -1
  62. package/lib/features/modeling/behavior/index.js +3 -0
  63. package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.js +16 -0
  64. package/lib/features/modeling/behavior/util/GeometricUtil.js +1 -121
  65. package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +3 -192
  66. package/lib/features/modeling/behavior/util/LayoutUtil.js +230 -0
  67. package/lib/features/modeling/cmd/SetColorHandler.js +6 -2
  68. package/lib/features/ordering/BpmnOrderingProvider.js +1 -1
  69. package/lib/features/popup-menu/ReplaceMenuProvider.js +7 -6
  70. package/lib/features/replace-preview/BpmnReplacePreview.js +1 -1
  71. package/lib/features/rules/BpmnRules.js +1 -6
  72. package/lib/features/snapping/BpmnCreateMoveSnapping.js +1 -1
  73. package/package.json +4 -4
  74. package/test/util/custom-rules/CustomRules.js +1 -1
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import Ids from 'ids';
4
4
 
package/lib/BaseViewer.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  import Diagram from 'diagram-js';
26
26
  import BpmnModdle from 'bpmn-moddle';
27
27
 
28
- import inherits from 'inherits';
28
+ import inherits from 'inherits-browser';
29
29
 
30
30
  import {
31
31
  importBpmnDiagram
package/lib/Modeler.js CHANGED
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import BaseModeler from './BaseModeler';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import Viewer from './Viewer';
4
4
 
package/lib/Viewer.js CHANGED
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CoreModule from './core';
4
4
  import TranslateModule from 'diagram-js/lib/i18n/translate';
@@ -14,6 +14,8 @@ import {
14
14
  // re-export getDi for compatibility
15
15
  export { getDi };
16
16
 
17
+ export var black = 'hsl(225, 10%, 15%)';
18
+
17
19
  // element utils //////////////////////
18
20
 
19
21
  /**
@@ -64,7 +66,7 @@ export function getFillColor(element, defaultColor) {
64
66
  export function getStrokeColor(element, defaultColor) {
65
67
  var di = getDi(element);
66
68
 
67
- return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || 'black';
69
+ return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
68
70
  }
69
71
 
70
72
  export function getLabelColor(element, defaultColor, defaultStrokeColor) {
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import {
4
4
  isObject,
@@ -57,6 +57,8 @@ import {
57
57
 
58
58
  import Ids from 'ids';
59
59
 
60
+ import { black } from './BpmnRenderUtil';
61
+
60
62
  var RENDERER_IDS = new Ids();
61
63
 
62
64
  var TASK_BORDER_RADIUS = 10;
@@ -85,7 +87,7 @@ export default function BpmnRenderer(
85
87
 
86
88
  function addMarker(id, options) {
87
89
  var attrs = assign({
88
- fill: 'black',
90
+ fill: black,
89
91
  strokeWidth: 1,
90
92
  strokeLinecap: 'round',
91
93
  strokeDasharray: 'none'
@@ -264,7 +266,7 @@ export default function BpmnRenderer(
264
266
  offset = offset || 0;
265
267
 
266
268
  attrs = computeStyle(attrs, {
267
- stroke: 'black',
269
+ stroke: black,
268
270
  strokeWidth: 2,
269
271
  fill: 'white'
270
272
  });
@@ -299,7 +301,7 @@ export default function BpmnRenderer(
299
301
  offset = offset || 0;
300
302
 
301
303
  attrs = computeStyle(attrs, {
302
- stroke: 'black',
304
+ stroke: black,
303
305
  strokeWidth: 2,
304
306
  fill: 'white'
305
307
  });
@@ -332,7 +334,7 @@ export default function BpmnRenderer(
332
334
  }).join(' ');
333
335
 
334
336
  attrs = computeStyle(attrs, {
335
- stroke: 'black',
337
+ stroke: black,
336
338
  strokeWidth: 2,
337
339
  fill: 'white'
338
340
  });
@@ -350,7 +352,7 @@ export default function BpmnRenderer(
350
352
 
351
353
  function drawLine(parentGfx, waypoints, attrs) {
352
354
  attrs = computeStyle(attrs, [ 'no-fill' ], {
353
- stroke: 'black',
355
+ stroke: black,
354
356
  strokeWidth: 2,
355
357
  fill: 'none'
356
358
  });
@@ -366,7 +368,7 @@ export default function BpmnRenderer(
366
368
 
367
369
  attrs = computeStyle(attrs, [ 'no-fill' ], {
368
370
  strokeWidth: 2,
369
- stroke: 'black'
371
+ stroke: black
370
372
  });
371
373
 
372
374
  var path = svgCreate('path');
@@ -1471,7 +1473,7 @@ export default function BpmnRenderer(
1471
1473
 
1472
1474
  if (di.messageVisibleKind === 'initiating') {
1473
1475
  messageAttrs.fill = 'white';
1474
- messageAttrs.stroke = 'black';
1476
+ messageAttrs.stroke = black;
1475
1477
  } else {
1476
1478
  messageAttrs.fill = '#888';
1477
1479
  messageAttrs.stroke = 'white';
@@ -1546,7 +1548,7 @@ export default function BpmnRenderer(
1546
1548
 
1547
1549
  /* output arrow path */ drawPath(parentGfx, arrowPathData, {
1548
1550
  strokeWidth: 1,
1549
- fill: 'black'
1551
+ fill: black
1550
1552
  });
1551
1553
 
1552
1554
  return elementObject;
@@ -104,6 +104,12 @@ export function getTextAnnotationPosition(source, element) {
104
104
  y: sourceTrbl.top - 50 - element.height / 2
105
105
  };
106
106
 
107
+ if (isConnection(source)) {
108
+ position = getMid(source);
109
+ position.x += 100;
110
+ position.y -= 50;
111
+ }
112
+
107
113
  var nextPositionDirection = {
108
114
  y: {
109
115
  margin: -30,
@@ -135,4 +141,8 @@ export function getDataElementPosition(source, element) {
135
141
  };
136
142
 
137
143
  return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
144
+ }
145
+
146
+ function isConnection(element) {
147
+ return !!element.waypoints;
138
148
  }
@@ -1,6 +1,6 @@
1
1
  import AutoResize from 'diagram-js/lib/features/auto-resize/AutoResize';
2
2
 
3
- import inherits from 'inherits';
3
+ import inherits from 'inherits-browser';
4
4
 
5
5
  import { is } from '../../util/ModelUtil';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { is } from '../../util/ModelUtil';
2
2
 
3
- import inherits from 'inherits';
3
+ import inherits from 'inherits-browser';
4
4
 
5
5
  import { forEach } from 'min-dash';
6
6
 
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  assign,
3
3
  forEach,
4
- isArray
4
+ isArray,
5
+ every
5
6
  } from 'min-dash';
6
7
 
7
8
  import {
@@ -86,9 +87,49 @@ ContextPadProvider.$inject = [
86
87
  'translate'
87
88
  ];
88
89
 
90
+ ContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) {
91
+ var modeling = this._modeling;
89
92
 
90
- ContextPadProvider.prototype.getContextPadEntries = function(element) {
93
+ var actions = {};
94
+
95
+ if (this._isDeleteAllowed(elements)) {
96
+ assign(actions, {
97
+ 'delete': {
98
+ group: 'edit',
99
+ className: 'bpmn-icon-trash',
100
+ title: this._translate('Remove'),
101
+ action: {
102
+ click: function(event, elements) {
103
+ modeling.removeElements(elements.slice());
104
+ }
105
+ }
106
+ }
107
+ });
108
+ }
91
109
 
110
+ return actions;
111
+ };
112
+
113
+ /**
114
+ * @param {djs.model.Base[]} elements
115
+ * @return {boolean}
116
+ */
117
+ ContextPadProvider.prototype._isDeleteAllowed = function(elements) {
118
+
119
+ var baseAllowed = this._rules.allowed('elements.delete', {
120
+ elements: elements
121
+ });
122
+
123
+ if (isArray(baseAllowed)) {
124
+ return every(baseAllowed, function(element) {
125
+ return includes(baseAllowed, element);
126
+ });
127
+ }
128
+
129
+ return baseAllowed;
130
+ };
131
+
132
+ ContextPadProvider.prototype.getContextPadEntries = function(element) {
92
133
  var contextPad = this._contextPad,
93
134
  modeling = this._modeling,
94
135
 
@@ -113,7 +154,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
113
154
  connect.start(event, element);
114
155
  }
115
156
 
116
- function removeElement(e) {
157
+ function removeElement(e, element) {
117
158
  modeling.removeElements([ element ]);
118
159
  }
119
160
 
@@ -362,6 +403,15 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
362
403
  });
363
404
  }
364
405
 
406
+ if (is(businessObject, 'bpmn:SequenceFlow')) {
407
+ assign(actions, {
408
+ 'append.text-annotation': appendAction(
409
+ 'bpmn:TextAnnotation',
410
+ 'bpmn-icon-text-annotation'
411
+ )
412
+ });
413
+ }
414
+
365
415
  if (
366
416
  isAny(businessObject, [
367
417
  'bpmn:FlowNode',
@@ -470,3 +520,7 @@ function isEventType(eventBo, type, definition) {
470
520
 
471
521
  return isType && isDefinition;
472
522
  }
523
+
524
+ function includes(array, item) {
525
+ return array.indexOf(item) !== -1;
526
+ }
@@ -234,8 +234,6 @@ ModdleCopy.prototype.copyProperty = function(property, parent, propertyName) {
234
234
 
235
235
  // copying might NOT be allowed
236
236
  if (copiedProperty) {
237
- copiedProperty.$parent = parent;
238
-
239
237
  return childProperties.concat(copiedProperty);
240
238
  }
241
239
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
  import { is } from '../../util/ModelUtil';
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import EditorActions from 'diagram-js/lib/features/editor-actions/EditorActions';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import KeyboardBindings from 'diagram-js/lib/features/keyboard/KeyboardBindings';
4
4
 
@@ -25,6 +25,8 @@ import {
25
25
  isLabel
26
26
  } from '../../util/LabelUtil';
27
27
 
28
+ var HIGH_PRIORITY = 2000;
29
+
28
30
 
29
31
  export default function LabelEditingProvider(
30
32
  eventBus, bpmnFactory, canvas, directEditing,
@@ -58,6 +60,16 @@ export default function LabelEditingProvider(
58
60
  }
59
61
  });
60
62
 
63
+ eventBus.on([
64
+ 'shape.remove',
65
+ 'connection.remove'
66
+ ], HIGH_PRIORITY, function(event) {
67
+
68
+ if (directEditing.isActive(event.element)) {
69
+ directEditing.cancel();
70
+ }
71
+ });
72
+
61
73
  // cancel on command stack changes
62
74
  eventBus.on([ 'commandStack.changed' ], function(e) {
63
75
  if (directEditing.isActive()) {
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import {
4
4
  assign
@@ -3,7 +3,7 @@ import {
3
3
  forEach
4
4
  } from 'min-dash';
5
5
 
6
- import inherits from 'inherits';
6
+ import inherits from 'inherits-browser';
7
7
 
8
8
  import {
9
9
  remove as collectionRemove,
@@ -4,7 +4,7 @@ import {
4
4
  isObject
5
5
  } from 'min-dash';
6
6
 
7
- import inherits from 'inherits';
7
+ import inherits from 'inherits-browser';
8
8
 
9
9
  import {
10
10
  getBusinessObject,
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import BaseModeling from 'diagram-js/lib/features/modeling/Modeling';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import {
4
4
  getOrientation,
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import { is } from '../../../util/ModelUtil';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import { is } from '../../../util/ModelUtil';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import { is } from '../../../util/ModelUtil';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import {
4
4
  assign,
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -2,7 +2,7 @@ import {
2
2
  assign
3
3
  } from 'min-dash';
4
4
 
5
- import inherits from 'inherits';
5
+ import inherits from 'inherits-browser';
6
6
 
7
7
  import {
8
8
  is,
@@ -0,0 +1,117 @@
1
+ import {
2
+ assign
3
+ } from 'min-dash';
4
+
5
+ import inherits from 'inherits-browser';
6
+
7
+ import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
8
+
9
+ import { getConnectionAdjustment as getConnectionAnchorPoint } from './util/ConnectionLayoutUtil';
10
+
11
+ /**
12
+ * A component that makes sure that Associations connected to Connections
13
+ * are updated together with the Connection.
14
+ *
15
+ * @param {EventBus} eventBus
16
+ * @param {Modeling} modeling
17
+ */
18
+ export default function LayoutConnectionBehavior(
19
+ eventBus, modeling) {
20
+
21
+ CommandInterceptor.call(this, eventBus);
22
+
23
+ function getnewAnchorPoint(event, point) {
24
+
25
+ var context = event.context,
26
+ connection = context.connection,
27
+ hints = assign({}, context.hints),
28
+ newWaypoints = context.newWaypoints || connection.waypoints,
29
+ oldWaypoints = context.oldWaypoints;
30
+
31
+
32
+ if (typeof hints.startChanged === 'undefined') {
33
+ hints.startChanged = !!hints.connectionStart;
34
+ }
35
+
36
+ if (typeof hints.endChanged === 'undefined') {
37
+ hints.endChanged = !!hints.connectionEnd;
38
+ }
39
+
40
+ return getConnectionAnchorPoint(point, newWaypoints, oldWaypoints, hints);
41
+ }
42
+
43
+ this.postExecute([
44
+ 'connection.layout',
45
+ 'connection.updateWaypoints'
46
+ ], function(event) {
47
+ var context = event.context;
48
+
49
+ var connection = context.connection,
50
+ outgoing = connection.outgoing,
51
+ incoming = connection.incoming;
52
+
53
+ incoming.forEach(function(connection) {
54
+ var endPoint = connection.waypoints[connection.waypoints.length - 1];
55
+ var newEndpoint = getnewAnchorPoint(event, endPoint);
56
+
57
+ var newWaypoints = [].concat(connection.waypoints.slice(0, -1), [ newEndpoint ]);
58
+
59
+ modeling.updateWaypoints(connection, newWaypoints);
60
+ });
61
+
62
+ outgoing.forEach(function(connection) {
63
+ var startpoint = connection.waypoints[0];
64
+ var newStartpoint = getnewAnchorPoint(event, startpoint);
65
+
66
+ var newWaypoints = [].concat([ newStartpoint ], connection.waypoints.slice(1));
67
+
68
+ modeling.updateWaypoints(connection, newWaypoints);
69
+ });
70
+
71
+ });
72
+
73
+
74
+ this.postExecute([
75
+ 'connection.move'
76
+ ], function(event) {
77
+ var context = event.context;
78
+
79
+ var connection = context.connection,
80
+ outgoing = connection.outgoing,
81
+ incoming = connection.incoming,
82
+ delta = context.delta;
83
+
84
+ incoming.forEach(function(connection) {
85
+ var endPoint = connection.waypoints[connection.waypoints.length - 1];
86
+ var newEndpoint = {
87
+ x: endPoint.x + delta.x,
88
+ y: endPoint.y + delta.y
89
+ };
90
+
91
+ var newWaypoints = [].concat(connection.waypoints.slice(0, -1), [ newEndpoint ]);
92
+
93
+ modeling.updateWaypoints(connection, newWaypoints);
94
+ });
95
+
96
+ outgoing.forEach(function(connection) {
97
+ var startpoint = connection.waypoints[0];
98
+ var newStartpoint = {
99
+ x: startpoint.x + delta.x,
100
+ y: startpoint.y + delta.y
101
+ };
102
+
103
+ var newWaypoints = [].concat([ newStartpoint ], connection.waypoints.slice(1));
104
+
105
+ modeling.updateWaypoints(connection, newWaypoints);
106
+ });
107
+
108
+ });
109
+
110
+ }
111
+
112
+ inherits(LayoutConnectionBehavior, CommandInterceptor);
113
+
114
+ LayoutConnectionBehavior.$inject = [
115
+ 'eventBus',
116
+ 'modeling'
117
+ ];
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import { is } from '../../../util/ModelUtil';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
4
4
 
@@ -4,7 +4,7 @@ import {
4
4
  matchPattern
5
5
  } from 'min-dash';
6
6
 
7
- import inherits from 'inherits';
7
+ import inherits from 'inherits-browser';
8
8
 
9
9
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
10
10
 
@@ -1,4 +1,4 @@
1
- import inherits from 'inherits';
1
+ import inherits from 'inherits-browser';
2
2
 
3
3
  import { forEach } from 'min-dash';
4
4