bpmn-js 18.31.1 → 18.33.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v18.31.1
2
+ * bpmn-js - bpmn-modeler v18.33.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: 2026-10-21
11
+ * Date: 2026-11-16
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -2130,6 +2130,8 @@
2130
2130
  // - can't reliably auto-annotate constructor; we'll match the
2131
2131
  // first constructor(...) pattern found which may be the one
2132
2132
  // of a nested class, too.
2133
+ //
2134
+ // - can't parse default values containing "," or ")"
2133
2135
 
2134
2136
  const CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
2135
2137
  const FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
@@ -2157,7 +2159,11 @@
2157
2159
 
2158
2160
  return args && args.split(',').map(arg => {
2159
2161
  const argMatch = arg.match(FN_ARG);
2160
- return (argMatch && argMatch[1] || arg).trim();
2162
+ const [ argName, defaultValue ] = arg.replace(FN_ARG, '').split('=');
2163
+ const name = (argMatch && argMatch[1] || argName).trim();
2164
+
2165
+ // arguments with default values are optional, i.e. `a.b = 1` => `a.b?`
2166
+ return defaultValue !== undefined && !name.endsWith('?') ? name + '?' : name;
2161
2167
  }) || [];
2162
2168
  }
2163
2169
 
@@ -2179,13 +2185,13 @@
2179
2185
 
2180
2186
  const parent = _parent || /** @type InjectorContext */ ({
2181
2187
  get: function(name, strict) {
2182
- currentlyResolving.push(name);
2183
-
2184
2188
  if (strict === false) {
2185
- return null;
2186
- } else {
2187
- throw error(`No provider for "${ name }"!`);
2189
+ return undefined;
2188
2190
  }
2191
+
2192
+ currentlyResolving.push(name);
2193
+
2194
+ throw error(`No provider for "${ name }"!`);
2189
2195
  }
2190
2196
  });
2191
2197
 
@@ -2205,18 +2211,34 @@
2205
2211
  * Return a named service.
2206
2212
  *
2207
2213
  * @param {string} name
2208
- * @param {boolean} [strict=true] if false, resolve missing services to null
2214
+ * @param {boolean} [strict=true] if false, resolve missing services to undefined
2209
2215
  *
2210
2216
  * @return {any}
2211
2217
  */
2212
2218
  function get(name, strict) {
2219
+ const optionalIdx = name.lastIndexOf('?');
2220
+
2221
+ // optional chaining, i.e. `a.b?.c`
2222
+ if (optionalIdx !== -1) {
2223
+ const pivot = get(name.slice(0, optionalIdx), false);
2224
+ const path = name.slice(optionalIdx + 2);
2225
+
2226
+ if (path && pivot == null) {
2227
+ return undefined;
2228
+ }
2229
+
2230
+ return path ? path.split('.').reduce((pivot, key) => pivot[key], pivot) : pivot;
2231
+ }
2232
+
2213
2233
  if (!providers[name] && name.includes('.')) {
2214
2234
 
2215
2235
  const parts = name.split('.');
2216
- let pivot = get(/** @type { string } */ (parts.shift()));
2236
+ let pivot = get(/** @type { string } */ (parts.shift()), strict);
2217
2237
 
2218
2238
  while (parts.length) {
2219
- pivot = pivot[/** @type { string } */ (parts.shift())];
2239
+ const key = /** @type { string } */ (parts.shift());
2240
+
2241
+ pivot = strict === false ? pivot?.[key] : pivot[key];
2220
2242
  }
2221
2243
 
2222
2244
  return pivot;
@@ -2261,11 +2283,9 @@
2261
2283
  */
2262
2284
  const inject = fn.$inject || parseAnnotations(fn);
2263
2285
  const dependencies = inject.map(dep => {
2264
- if (hasOwnProp(locals, dep)) {
2265
- return locals[dep];
2266
- } else {
2267
- return get(dep);
2268
- }
2286
+ const local = dep.replace(/\?$/, '');
2287
+
2288
+ return hasOwnProp(locals, local) ? locals[local] : get(dep);
2269
2289
  });
2270
2290
 
2271
2291
  return {
@@ -2977,16 +2997,14 @@
2977
2997
 
2978
2998
  function handleElement(element) {
2979
2999
 
2980
- enclosedElements[element.id] = element;
2981
-
2982
3000
  if (element.waypoints) {
2983
3001
 
2984
3002
  // remember connection
2985
- enclosedConnections[element.id] = allConnections[element.id] = element;
3003
+ allConnections[element.id] = element;
2986
3004
  } else {
2987
3005
 
2988
3006
  // remember shape
2989
- allShapes[element.id] = element;
3007
+ enclosedElements[element.id] = allShapes[element.id] = element;
2990
3008
 
2991
3009
  // remember all connections
2992
3010
  forEach(element.incoming, handleConnection);
@@ -8592,7 +8610,7 @@
8592
8610
  * @template T
8593
8611
  *
8594
8612
  * @param {string} name The name of the service to get.
8595
- * @param {true} strict If false, resolve missing services to null.
8613
+ * @param {true} strict If true, throw if the service is missing.
8596
8614
  *
8597
8615
  * @return {T}
8598
8616
  */
@@ -8604,9 +8622,9 @@
8604
8622
  * @template T
8605
8623
  *
8606
8624
  * @param {string} name The name of the service to get.
8607
- * @param {boolean} strict If false, resolve missing services to null.
8625
+ * @param {boolean} strict If false, resolve missing services to undefined.
8608
8626
  *
8609
- * @return {T|null}
8627
+ * @return {T|undefined}
8610
8628
  */
8611
8629
  /**
8612
8630
  * Resolves a diagram service.
@@ -20274,7 +20292,7 @@
20274
20292
 
20275
20293
  if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {
20276
20294
  if (semantic.get('parallelMultiple')) {
20277
- return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
20295
+ return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, nodeElement, attrs);
20278
20296
  }
20279
20297
  else {
20280
20298
  return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
@@ -20286,11 +20304,11 @@
20286
20304
  }
20287
20305
 
20288
20306
  if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {
20289
- return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
20307
+ return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, nodeElement, attrs);
20290
20308
  }
20291
20309
 
20292
20310
  if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {
20293
- return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
20311
+ return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, nodeElement, attrs);
20294
20312
  }
20295
20313
 
20296
20314
  if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {
@@ -20318,7 +20336,7 @@
20318
20336
  }
20319
20337
 
20320
20338
  if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {
20321
- return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
20339
+ return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, nodeElement, attrs);
20322
20340
  }
20323
20341
 
20324
20342
  return null;
@@ -22108,7 +22126,7 @@
22108
22126
 
22109
22127
  // strip trailing whitespace so measurement matches the browser's
22110
22128
  // native rendering used by direct editing
22111
- var measurable = emptyLine ? 'dummy' : text.replace(/\s+$/, '');
22129
+ var measurable = emptyLine ? 'dummy' : text.trimEnd();
22112
22130
  var metrics = ctx.measureText(measurable);
22113
22131
 
22114
22132
  return {
@@ -23473,7 +23491,7 @@
23473
23491
  // document wide unique overlay ids
23474
23492
  var ids$2 = new IdGenerator('ov');
23475
23493
 
23476
- var LOW_PRIORITY$s = 500;
23494
+ var LOW_PRIORITY$t = 500;
23477
23495
 
23478
23496
  /**
23479
23497
  * @typedef {import('../../core/Canvas.js').default} Canvas
@@ -24103,7 +24121,7 @@
24103
24121
 
24104
24122
  // move integration
24105
24123
 
24106
- eventBus.on('element.changed', LOW_PRIORITY$s, function(e) {
24124
+ eventBus.on('element.changed', LOW_PRIORITY$t, function(e) {
24107
24125
  var element = e.element;
24108
24126
 
24109
24127
  var container = self._getOverlayContainer(element, true);
@@ -25209,7 +25227,7 @@
25209
25227
  * @typedef {import('../../model/Types').Shape} Shape
25210
25228
  */
25211
25229
 
25212
- var LOW_PRIORITY$r = 250;
25230
+ var LOW_PRIORITY$s = 250;
25213
25231
  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>';
25214
25232
 
25215
25233
  var EMPTY_MARKER = 'bjs-drilldown-empty';
@@ -25234,7 +25252,7 @@
25234
25252
 
25235
25253
  var self = this;
25236
25254
 
25237
- this.executed('shape.toggleCollapse', LOW_PRIORITY$r, function(context) {
25255
+ this.executed('shape.toggleCollapse', LOW_PRIORITY$s, function(context) {
25238
25256
  var shape = context.shape;
25239
25257
 
25240
25258
  // Add overlay to the collapsed shape
@@ -25246,7 +25264,7 @@
25246
25264
  }, true);
25247
25265
 
25248
25266
 
25249
- this.reverted('shape.toggleCollapse', LOW_PRIORITY$r, function(context) {
25267
+ this.reverted('shape.toggleCollapse', LOW_PRIORITY$s, function(context) {
25250
25268
  var shape = context.shape;
25251
25269
 
25252
25270
  // Add overlay to the collapsed shape
@@ -25258,7 +25276,7 @@
25258
25276
  }, true);
25259
25277
 
25260
25278
 
25261
- this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$r,
25279
+ this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$s,
25262
25280
  function(context) {
25263
25281
  var oldParent = context.oldParent,
25264
25282
  newParent = context.newParent || context.parent,
@@ -25275,7 +25293,7 @@
25275
25293
  }, true);
25276
25294
 
25277
25295
 
25278
- this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$r,
25296
+ this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$s,
25279
25297
  function(context) {
25280
25298
  var oldParent = context.oldParent,
25281
25299
  newParent = context.newParent || context.parent,
@@ -25552,7 +25570,7 @@
25552
25570
  return isPrimaryButton(event) || isAuxiliaryButton(event);
25553
25571
  }
25554
25572
 
25555
- var LOW_PRIORITY$q = 500;
25573
+ var LOW_PRIORITY$r = 500;
25556
25574
 
25557
25575
 
25558
25576
  /**
@@ -25749,7 +25767,7 @@
25749
25767
  eventBus.on([
25750
25768
  'shape.changed',
25751
25769
  'connection.changed'
25752
- ], LOW_PRIORITY$q, function(event) {
25770
+ ], LOW_PRIORITY$r, function(event) {
25753
25771
 
25754
25772
  var element = event.element,
25755
25773
  gfx = event.gfx;
@@ -25757,7 +25775,7 @@
25757
25775
  eventBus.fire('interactionEvents.updateHit', { element: element, gfx: gfx });
25758
25776
  });
25759
25777
 
25760
- eventBus.on('interactionEvents.createHit', LOW_PRIORITY$q, function(event) {
25778
+ eventBus.on('interactionEvents.createHit', LOW_PRIORITY$r, function(event) {
25761
25779
  var element = event.element,
25762
25780
  gfx = event.gfx;
25763
25781
 
@@ -26864,7 +26882,7 @@
26864
26882
  Keyboard.prototype.isShift = isShift;
26865
26883
  Keyboard.prototype.isKey = isKey;
26866
26884
 
26867
- var LOW_PRIORITY$p = 500;
26885
+ var LOW_PRIORITY$q = 500;
26868
26886
 
26869
26887
 
26870
26888
  /**
@@ -26880,7 +26898,7 @@
26880
26898
 
26881
26899
  var self = this;
26882
26900
 
26883
- eventBus.on('editorActions.init', LOW_PRIORITY$p, function(event) {
26901
+ eventBus.on('editorActions.init', LOW_PRIORITY$q, function(event) {
26884
26902
 
26885
26903
  var editorActions = event.editorActions;
26886
26904
 
@@ -27285,12 +27303,17 @@
27285
27303
  /**
27286
27304
  * Move the canvas via mouse.
27287
27305
  *
27306
+ * @param {Object} [config]
27307
+ * @param {boolean} [config.enabled=true] Default enabled state.
27288
27308
  * @param {EventBus} eventBus
27289
27309
  * @param {Canvas} canvas
27290
27310
  */
27291
- function MoveCanvas(eventBus, canvas) {
27311
+ function MoveCanvas(config, eventBus, canvas) {
27312
+
27313
+ config = config || {};
27292
27314
 
27293
27315
  var context;
27316
+ var enabled = config.enabled !== false;
27294
27317
 
27295
27318
  function handleMousedown(event) {
27296
27319
  return handleStart(event.originalEvent);
@@ -27325,7 +27348,7 @@
27325
27348
  context.dragging = true;
27326
27349
 
27327
27350
  if (button === 0) {
27328
- install(eventBus);
27351
+ context.untrap = install(eventBus);
27329
27352
  }
27330
27353
 
27331
27354
  set('grab');
@@ -27337,12 +27360,12 @@
27337
27360
 
27338
27361
  delta$1 = delta(position, lastPosition);
27339
27362
 
27363
+ context.last = position;
27364
+
27340
27365
  canvas.scroll({
27341
27366
  dx: delta$1.x,
27342
27367
  dy: delta$1.y
27343
27368
  });
27344
-
27345
- context.last = position;
27346
27369
  }
27347
27370
 
27348
27371
  // prevent select
@@ -27354,6 +27377,10 @@
27354
27377
  event.unbind(document, 'mousemove', handleMove);
27355
27378
  event.unbind(document, 'mouseup', handleEnd);
27356
27379
 
27380
+ if (!event$1 && context.untrap) {
27381
+ context.untrap();
27382
+ }
27383
+
27357
27384
  context = null;
27358
27385
 
27359
27386
  unset();
@@ -27361,6 +27388,10 @@
27361
27388
 
27362
27389
  function handleStart(event$1) {
27363
27390
 
27391
+ if (!enabled) {
27392
+ return;
27393
+ }
27394
+
27364
27395
  // event is already handled by '.djs-draggable'
27365
27396
  if (closest(event$1.target, '.djs-draggable')) {
27366
27397
  return;
@@ -27389,10 +27420,33 @@
27389
27420
  return !!context;
27390
27421
  };
27391
27422
 
27423
+ /**
27424
+ * Enable or disable canvas movement.
27425
+ *
27426
+ * Disabling movement cancels an ongoing drag.
27427
+ *
27428
+ * @param {boolean} [newEnabled] New enabled state; toggle if omitted.
27429
+ * @return {boolean} The new enabled state.
27430
+ */
27431
+ this.toggle = function(newEnabled) {
27432
+ if (typeof newEnabled === 'undefined') {
27433
+ newEnabled = !enabled;
27434
+ }
27435
+
27436
+ enabled = newEnabled;
27437
+
27438
+ if (!enabled && context) {
27439
+ handleEnd();
27440
+ }
27441
+
27442
+ return enabled;
27443
+ };
27444
+
27392
27445
  }
27393
27446
 
27394
27447
 
27395
27448
  MoveCanvas.$inject = [
27449
+ 'config.moveCanvas',
27396
27450
  'eventBus',
27397
27451
  'canvas'
27398
27452
  ];
@@ -27476,6 +27530,9 @@
27476
27530
  * Mouse wheel zooming / scrolling may be disabled using
27477
27531
  * the {@link toggle(enabled)} method.
27478
27532
  *
27533
+ * Elements marked `.djs-scrollable` and their descendants own wheel events,
27534
+ * including modified wheel events, even at scroll boundaries.
27535
+ *
27479
27536
  * @param {Object} [config]
27480
27537
  * @param {boolean} [config.enabled=true] default enabled state
27481
27538
  * @param {number} [config.scale=.75] scroll sensivity
@@ -27496,16 +27553,7 @@
27496
27553
  this._totalDelta = 0;
27497
27554
  this._scale = config.scale || DEFAULT_SCALE;
27498
27555
 
27499
- var self = this;
27500
-
27501
- eventBus.on('canvas.mouseover', function() {
27502
- self._init(config.enabled !== false);
27503
- });
27504
-
27505
- eventBus.on('canvas.mouseout', function() {
27506
- self._init(false);
27507
- });
27508
-
27556
+ this.toggle(config.enabled !== false);
27509
27557
  }
27510
27558
 
27511
27559
  ZoomScroll.$inject = [
@@ -27551,7 +27599,7 @@
27551
27599
 
27552
27600
  ZoomScroll.prototype._handleWheel = function handleWheel(event) {
27553
27601
 
27554
- if (!this._enabled) {
27602
+ if (!this._enabled || closest(event.target, '.djs-scrollable', true)) {
27555
27603
  return;
27556
27604
  }
27557
27605
 
@@ -27681,11 +27729,6 @@
27681
27729
  return newEnabled;
27682
27730
  };
27683
27731
 
27684
-
27685
- ZoomScroll.prototype._init = function(newEnabled) {
27686
- this.toggle(newEnabled);
27687
- };
27688
-
27689
27732
  /**
27690
27733
  * @type { import('didi').ModuleDeclaration }
27691
27734
  */
@@ -31218,7 +31261,7 @@
31218
31261
  * @typedef {import('diagram-js/lib/features/context-pad/ContextPadProvider').default<Element>} ContextPadProvider
31219
31262
  */
31220
31263
 
31221
- var LOW_PRIORITY$o = 900;
31264
+ var LOW_PRIORITY$p = 900;
31222
31265
 
31223
31266
  /**
31224
31267
  * A provider for the `Align elements` context pad entry.
@@ -31232,7 +31275,7 @@
31232
31275
  */
31233
31276
  function AlignElementsContextPadProvider(contextPad, popupMenu, translate, canvas) {
31234
31277
 
31235
- contextPad.registerProvider(LOW_PRIORITY$o, this);
31278
+ contextPad.registerProvider(LOW_PRIORITY$p, this);
31236
31279
 
31237
31280
  this._contextPad = contextPad;
31238
31281
  this._popupMenu = popupMenu;
@@ -31862,7 +31905,7 @@
31862
31905
  * @typedef {import('../modeling/Modeling.js').default} Modeling
31863
31906
  */
31864
31907
 
31865
- var LOW_PRIORITY$n = 100;
31908
+ var LOW_PRIORITY$o = 100;
31866
31909
 
31867
31910
 
31868
31911
  /**
@@ -31875,7 +31918,7 @@
31875
31918
  */
31876
31919
  function AutoPlace$1(eventBus, modeling, canvas) {
31877
31920
 
31878
- eventBus.on('autoPlace', LOW_PRIORITY$n, function(context) {
31921
+ eventBus.on('autoPlace', LOW_PRIORITY$o, function(context) {
31879
31922
  var shape = context.shape,
31880
31923
  source = context.source;
31881
31924
 
@@ -32914,6 +32957,9 @@
32914
32957
 
32915
32958
  var DRAG_ACTIVE_CLS = 'djs-drag-active';
32916
32959
 
32960
+ // run after default listeners, i.e. only if the error is not handled
32961
+ var LOW_PRIORITY$n = 500;
32962
+
32917
32963
 
32918
32964
  function preventDefault$1(event) {
32919
32965
  event.preventDefault();
@@ -33171,6 +33217,12 @@
33171
33217
  }
33172
33218
 
33173
33219
 
33220
+ // cancel on unhandled errors, to not report them on every move
33221
+
33222
+ function cancelOnError() {
33223
+ cancel();
33224
+ }
33225
+
33174
33226
  // cancel active drag operation if the user presses
33175
33227
  // the ESC key on the keyboard
33176
33228
 
@@ -33246,11 +33298,17 @@
33246
33298
 
33247
33299
  var wasActive = context.active;
33248
33300
 
33249
- if (wasActive) {
33250
- fire('cancel');
33251
- }
33301
+ // detach, so that errors thrown by cancel listeners
33302
+ // do not re-enter
33303
+ eventBus.off('error', cancelOnError);
33252
33304
 
33253
- previousContext = cleanup(restore);
33305
+ try {
33306
+ if (wasActive) {
33307
+ fire('cancel');
33308
+ }
33309
+ } finally {
33310
+ previousContext = cleanup(restore);
33311
+ }
33254
33312
 
33255
33313
  if (wasActive) {
33256
33314
 
@@ -33261,11 +33319,25 @@
33261
33319
  }
33262
33320
 
33263
33321
  function cleanup(restore) {
33322
+ var previousContext;
33323
+
33324
+ // detach before firing, so that a failing cleanup listener
33325
+ // does not re-enter cancel via cancelOnError
33326
+ eventBus.off('error', cancelOnError);
33327
+
33328
+ try {
33329
+ fire('cleanup');
33330
+ } finally {
33331
+ previousContext = finishCleanup(restore);
33332
+ }
33333
+
33334
+ return previousContext;
33335
+ }
33336
+
33337
+ function finishCleanup(restore) {
33264
33338
  var previousContext,
33265
33339
  endDrag;
33266
33340
 
33267
- fire('cleanup');
33268
-
33269
33341
  // reset cursor
33270
33342
  unset();
33271
33343
 
@@ -33300,14 +33372,13 @@
33300
33372
  // restore selection, unless it has changed
33301
33373
  var previousSelection = context.payload.previousSelection;
33302
33374
 
33375
+ previousContext = context;
33376
+ context = null;
33377
+
33303
33378
  if (restore !== false && previousSelection && !selection.get().length) {
33304
33379
  restoreSelection(previousSelection);
33305
33380
  }
33306
33381
 
33307
- previousContext = context;
33308
-
33309
- context = null;
33310
-
33311
33382
  return previousContext;
33312
33383
  }
33313
33384
 
@@ -33383,6 +33454,8 @@
33383
33454
  isTouch: isTouch
33384
33455
  }, options);
33385
33456
 
33457
+ eventBus.once('error', LOW_PRIORITY$n, cancelOnError);
33458
+
33386
33459
  // skip dom registration if trigger
33387
33460
  // is set to manual (during testing)
33388
33461
  if (!options.manual) {
@@ -40969,6 +41042,26 @@
40969
41042
  return getLabelAdjustment(label, newWaypoints, oldWaypoints, hints);
40970
41043
  }
40971
41044
 
41045
+ // connection labels follow their connection if only one end moves
41046
+ this.preExecute('elements.move', function(event) {
41047
+ var context = event.context,
41048
+ movedShapes = getClosure(context.shapes).allShapes;
41049
+
41050
+ function isMoved(shape) {
41051
+ return !!(movedShapes[shape.id] || (shape.host && movedShapes[shape.host.id]));
41052
+ }
41053
+
41054
+ context.shapes = context.shapes.filter(function(shape) {
41055
+ var connection = shape.labelTarget;
41056
+
41057
+ return !(
41058
+ connection &&
41059
+ connection.waypoints &&
41060
+ isMoved(connection.source) !== isMoved(connection.target)
41061
+ );
41062
+ });
41063
+ });
41064
+
40972
41065
  this.postExecute([
40973
41066
  'connection.layout',
40974
41067
  'connection.updateWaypoints'