bpmn-js 13.0.3 → 13.0.5

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 v13.0.3
2
+ * bpmn-js - bpmn-modeler v13.0.5
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-04-24
11
+ * Date: 2023-05-09
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -2704,7 +2704,7 @@
2704
2704
  */
2705
2705
 
2706
2706
  /**
2707
- * @param {Component[]} elements
2707
+ * @param {Component[] | Component[][]} elements
2708
2708
  *
2709
2709
  * @return {string}
2710
2710
  */
@@ -2741,6 +2741,11 @@
2741
2741
  return [ 'C', p1.x, p1.y, p2.x, p2.y, p3.x, p3.y ];
2742
2742
  }
2743
2743
 
2744
+ /**
2745
+ * @param {Point[]} waypoints
2746
+ * @param {number} [cornerRadius]
2747
+ * @return {Component[][]}
2748
+ */
2744
2749
  function drawPath(waypoints, cornerRadius) {
2745
2750
  const pointCount = waypoints.length;
2746
2751
 
@@ -2804,7 +2809,7 @@
2804
2809
 
2805
2810
  /**
2806
2811
  * @param {Point[]} points
2807
- * @param {any} [attrs]
2812
+ * @param {number|Object} [attrs]
2808
2813
  * @param {number} [radius]
2809
2814
  *
2810
2815
  * @return {SVGElement}
@@ -2847,10 +2852,19 @@
2847
2852
  }
2848
2853
 
2849
2854
  /**
2850
- * @typedef {import('../../model/Types').Element} Element
2851
- * @typedef {import('../../model/Types').Shape} Shape
2855
+ * @typedef {import('../model/Types').Connection} Connection
2856
+ * @typedef {import('../model/Types').Element} Element
2857
+ * @typedef {import('../model/Types').Shape} Shape
2852
2858
  *
2853
2859
  * @typedef {import('../../type/Types').Rect} Rect
2860
+ *
2861
+ * @typedef { {
2862
+ * allShapes: Record<string, Shape>,
2863
+ * allConnections: Record<string, Connection>,
2864
+ * topLevel: Record<string, Element>,
2865
+ * enclosedConnections: Record<string, Connection>,
2866
+ * enclosedElements: Record<string, Element>
2867
+ * } } Closure
2854
2868
  */
2855
2869
 
2856
2870
  /**
@@ -2893,14 +2907,14 @@
2893
2907
  * element was added.
2894
2908
  *
2895
2909
  * @param {Object[]} elements
2896
- * @param {Object} e
2897
- * @param {boolean} unique
2910
+ * @param {Object} element
2911
+ * @param {boolean} [unique]
2898
2912
  */
2899
- function add$1(elements, e, unique) {
2900
- var canAdd = !unique || elements.indexOf(e) === -1;
2913
+ function add$1(elements, element, unique) {
2914
+ var canAdd = !unique || elements.indexOf(element) === -1;
2901
2915
 
2902
2916
  if (canAdd) {
2903
- elements.push(e);
2917
+ elements.push(element);
2904
2918
  }
2905
2919
 
2906
2920
  return canAdd;
@@ -2913,8 +2927,8 @@
2913
2927
  *
2914
2928
  * Recurse into all elements that are returned by `fn`.
2915
2929
  *
2916
- * @param {Object|Object[]} elements
2917
- * @param {Function} fn iterator function called with (element, index, recursionDepth)
2930
+ * @param {Element|Element[]} elements
2931
+ * @param {(element: Element, index: number, depth: number) => Element[] | boolean | undefined} fn
2918
2932
  * @param {number} [depth] maximum recursion depth
2919
2933
  */
2920
2934
  function eachElement(elements, fn, depth) {
@@ -2971,7 +2985,7 @@
2971
2985
  * Return self + ALL children for a number of elements
2972
2986
  *
2973
2987
  * @param {Element[]} elements to query
2974
- * @param {boolean} allowDuplicates to allow duplicates in the result set
2988
+ * @param {boolean} [allowDuplicates] to allow duplicates in the result set
2975
2989
  *
2976
2990
  * @return {Element[]} the collected elements
2977
2991
  */
@@ -2986,9 +3000,9 @@
2986
3000
  *
2987
3001
  * @param {Element[]} elements
2988
3002
  * @param {boolean} [isTopLevel=true]
2989
- * @param {Object} [closure]
3003
+ * @param {Closure} [closure]
2990
3004
  *
2991
- * @return {Object} newClosure
3005
+ * @return {Closure} newClosure
2992
3006
  */
2993
3007
  function getClosure(elements, isTopLevel, closure) {
2994
3008
 
@@ -3167,7 +3181,13 @@
3167
3181
  return filteredElements;
3168
3182
  }
3169
3183
 
3170
-
3184
+ /**
3185
+ * Get the element's type
3186
+ *
3187
+ * @param {Element} element
3188
+ *
3189
+ * @return {'connection' | 'shape' | 'root'}
3190
+ */
3171
3191
  function getType(element) {
3172
3192
 
3173
3193
  if ('waypoints' in element) {
@@ -3181,8 +3201,12 @@
3181
3201
  return 'root';
3182
3202
  }
3183
3203
 
3204
+ /**
3205
+ * @param {Element} element
3206
+ *
3207
+ * @return {boolean}
3208
+ */
3184
3209
  function isFrameElement$1(element) {
3185
-
3186
3210
  return !!(element && element.isFrame);
3187
3211
  }
3188
3212
 
@@ -3325,13 +3349,14 @@
3325
3349
  var self = this;
3326
3350
 
3327
3351
  /**
3328
- * Builds a style definition from a className, a list of traits and an object of additional attributes.
3352
+ * Builds a style definition from a className, a list of traits and an object
3353
+ * of additional attributes.
3329
3354
  *
3330
3355
  * @param {string} className
3331
- * @param {string[]} traits
3332
- * @param {Object} additionalAttrs
3356
+ * @param {string[]} [traits]
3357
+ * @param {Object} [additionalAttrs]
3333
3358
  *
3334
- * @return {Object} the style defintion
3359
+ * @return {Object} the style definition
3335
3360
  */
3336
3361
  this.cls = function(className, traits, additionalAttrs) {
3337
3362
  var attrs = this.style(traits, additionalAttrs);
@@ -3340,12 +3365,13 @@
3340
3365
  };
3341
3366
 
3342
3367
  /**
3343
- * Builds a style definition from a list of traits and an object of additional attributes.
3368
+ * Builds a style definition from a list of traits and an object of additional
3369
+ * attributes.
3344
3370
  *
3345
- * @param {string[]} traits
3371
+ * @param {string[]} [traits]
3346
3372
  * @param {Object} additionalAttrs
3347
3373
  *
3348
- * @return {Object} the style defintion
3374
+ * @return {Object} the style definition
3349
3375
  */
3350
3376
  this.style = function(traits, additionalAttrs) {
3351
3377
 
@@ -3361,6 +3387,17 @@
3361
3387
  return additionalAttrs ? assign$1(attrs, additionalAttrs) : attrs;
3362
3388
  };
3363
3389
 
3390
+
3391
+ /**
3392
+ * Computes a style definition from a list of traits and an object of
3393
+ * additional attributes, with custom style definition object.
3394
+ *
3395
+ * @param {Object} custom
3396
+ * @param {string[]} [traits]
3397
+ * @param {Object} defaultStyles
3398
+ *
3399
+ * @return {Object} the style definition
3400
+ */
3364
3401
  this.computeStyle = function(custom, traits, defaultStyles) {
3365
3402
  if (!isArray$3(traits)) {
3366
3403
  defaultStyles = traits;
@@ -3409,7 +3446,7 @@
3409
3446
  *
3410
3447
  * @param {Array<Object>} collection
3411
3448
  * @param {Object} element
3412
- * @param {number} idx
3449
+ * @param {number} [idx]
3413
3450
  */
3414
3451
  function add(collection, element, idx) {
3415
3452
 
@@ -4533,6 +4570,28 @@
4533
4570
 
4534
4571
  var intersectPaths = intersect;
4535
4572
 
4573
+ /**
4574
+ * Checks whether a value is an instance of Connection.
4575
+ *
4576
+ * @param {any} value
4577
+ *
4578
+ * @return {boolean}
4579
+ */
4580
+ function isConnection$4(value) {
4581
+ return isObject(value) && has$1(value, 'waypoints');
4582
+ }
4583
+
4584
+ /**
4585
+ * Checks whether a value is an instance of Label.
4586
+ *
4587
+ * @param {any} value
4588
+ *
4589
+ * @return {boolean}
4590
+ */
4591
+ function isLabel$1(value) {
4592
+ return isObject(value) && has$1(value, 'labelTarget');
4593
+ }
4594
+
4536
4595
  /**
4537
4596
  * @typedef {import('../core/Types').ElementLike} Element
4538
4597
  * @typedef {import('../core/Types').ConnectionLike} Connection
@@ -4543,6 +4602,11 @@
4543
4602
  * @typedef {import('../util/Types').RectTRBL} RectTRBL
4544
4603
  */
4545
4604
 
4605
+ /**
4606
+ * @param {Rect} bounds
4607
+ *
4608
+ * @returns {Rect}
4609
+ */
4546
4610
  function roundBounds(bounds) {
4547
4611
  return {
4548
4612
  x: Math.round(bounds.x),
@@ -4552,7 +4616,11 @@
4552
4616
  };
4553
4617
  }
4554
4618
 
4555
-
4619
+ /**
4620
+ * @param {Point} point
4621
+ *
4622
+ * @returns {Point}
4623
+ */
4556
4624
  function roundPoint(point) {
4557
4625
 
4558
4626
  return {
@@ -4678,7 +4746,7 @@
4678
4746
  * @return {Point}
4679
4747
  */
4680
4748
  function getMid(element) {
4681
- if (isConnection$f(element)) {
4749
+ if (isConnection$4(element)) {
4682
4750
  return getConnectionMid(element);
4683
4751
  }
4684
4752
 
@@ -4818,10 +4886,6 @@
4818
4886
  return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
4819
4887
  }
4820
4888
 
4821
- function isConnection$f(element) {
4822
- return !!element.waypoints;
4823
- }
4824
-
4825
4889
  /**
4826
4890
  * @typedef {import('./Types').ConnectionLike} ConnectionLike
4827
4891
  * @typedef {import('./Types').RootLike} RootLike
@@ -5386,11 +5450,13 @@
5386
5450
  *
5387
5451
  * @example
5388
5452
  *
5453
+ * ```javascript
5389
5454
  * canvas.addMarker('foo', 'some-marker');
5390
5455
  *
5391
5456
  * const fooGfx = canvas.getGraphics('foo');
5392
5457
  *
5393
5458
  * fooGfx; // <g class="... some-marker"> ... </g>
5459
+ * ```
5394
5460
  *
5395
5461
  * @param {ShapeLike|ConnectionLike|string} element The element or its ID.
5396
5462
  * @param {string} marker The marker.
@@ -5796,7 +5862,7 @@
5796
5862
  *
5797
5863
  * @memberOf Canvas
5798
5864
  *
5799
- * @event ShapeRemoved
5865
+ * @event ShapeRemovedEvent
5800
5866
  * @type {Object}
5801
5867
  * @property {ShapeLike} element The shape.
5802
5868
  * @property {SVGElement} gfx The graphical element.
@@ -5833,7 +5899,7 @@
5833
5899
  *
5834
5900
  * @memberOf Canvas
5835
5901
  *
5836
- * @event connection.removed
5902
+ * @event ConnectionRemovedEvent
5837
5903
  * @type {Object}
5838
5904
  * @property {ConnectionLike} element The connection.
5839
5905
  * @property {SVGElement} gfx The graphical element.
@@ -5892,6 +5958,7 @@
5892
5958
  *
5893
5959
  * @example
5894
5960
  *
5961
+ * ```javascript
5895
5962
  * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
5896
5963
  *
5897
5964
  * // sets the visible area of the diagram to (100|100) -> (600|100)
@@ -5919,6 +5986,7 @@
5919
5986
  * width: zoomedAndScrolledViewbox.outer.width,
5920
5987
  * height: zoomedAndScrolledViewbox.outer.height
5921
5988
  * });
5989
+ * ```
5922
5990
  *
5923
5991
  * @param {Rect} [box] The viewbox to be set.
5924
5992
  *
@@ -6426,9 +6494,11 @@
6426
6494
  *
6427
6495
  * @example
6428
6496
  *
6497
+ * ```javascript
6429
6498
  * elementRegistry.get('SomeElementId_1');
6430
6499
  *
6431
6500
  * elementRegistry.get(gfx);
6501
+ * ```
6432
6502
  *
6433
6503
  * @param {string|SVGElement} filter The elements ID or graphical representation.
6434
6504
  *
@@ -6522,11 +6592,13 @@
6522
6592
  *
6523
6593
  * @example
6524
6594
  *
6595
+ * ```javascript
6525
6596
  * elementRegistry.getGraphics('SomeElementId_1');
6526
6597
  *
6527
6598
  * elementRegistry.getGraphics(rootElement); // <g ...>
6528
6599
  *
6529
6600
  * elementRegistry.getGraphics(rootElement, true); // <svg ...>
6601
+ * ```
6530
6602
  *
6531
6603
  * @param {ElementLike|string} filter The element or its ID.
6532
6604
  * @param {boolean} [secondary=false] Whether to return the secondary graphical representation.
@@ -7106,7 +7178,7 @@
7106
7178
  *
7107
7179
  * @example
7108
7180
  *
7109
- * ```
7181
+ * ```javascript
7110
7182
  * import * as Model from 'diagram-js/lib/model';
7111
7183
  *
7112
7184
  * const root = Model.create('root', {
@@ -7122,6 +7194,7 @@
7122
7194
  *
7123
7195
  * @return {Root}
7124
7196
  */
7197
+
7125
7198
  /**
7126
7199
  * Creates a connection.
7127
7200
  *
@@ -7129,7 +7202,7 @@
7129
7202
  *
7130
7203
  * @example
7131
7204
  *
7132
- * ```
7205
+ * ```javascript
7133
7206
  * import * as Model from 'diagram-js/lib/model';
7134
7207
  *
7135
7208
  * const connection = Model.create('connection', {
@@ -7145,6 +7218,7 @@
7145
7218
  *
7146
7219
  * @return {Connection}
7147
7220
  */
7221
+
7148
7222
  /**
7149
7223
  * Creates a shape.
7150
7224
  *
@@ -7152,7 +7226,7 @@
7152
7226
  *
7153
7227
  * @example
7154
7228
  *
7155
- * ```
7229
+ * ```javascript
7156
7230
  * import * as Model from 'diagram-js/lib/model';
7157
7231
  *
7158
7232
  * const shape = Model.create('shape', {
@@ -7168,12 +7242,13 @@
7168
7242
  *
7169
7243
  * @return {Shape}
7170
7244
  */
7245
+
7171
7246
  /**
7172
7247
  * Creates a label.
7173
7248
  *
7174
7249
  * @example
7175
7250
  *
7176
- * ```
7251
+ * ```javascript
7177
7252
  * import * as Model from 'diagram-js/lib/model';
7178
7253
  *
7179
7254
  * const label = Model.create('label', {
@@ -7186,7 +7261,8 @@
7186
7261
  * ```
7187
7262
  *
7188
7263
  * @param {'label'} type
7189
- * @param {any} [attrs]
7264
+ * @param {Object} [attrs]
7265
+ *
7190
7266
  * @return {Label}
7191
7267
  */
7192
7268
  function create(type, attrs) {
@@ -7201,6 +7277,7 @@
7201
7277
  * Checks whether an object is a model instance.
7202
7278
  *
7203
7279
  * @param {any} obj
7280
+ *
7204
7281
  * @return {boolean}
7205
7282
  */
7206
7283
  function isModelElement(obj) {
@@ -7494,7 +7571,6 @@
7494
7571
  });
7495
7572
  };
7496
7573
 
7497
-
7498
7574
  /**
7499
7575
  * Register an event listener that is called only once.
7500
7576
  *
@@ -7765,7 +7841,7 @@
7765
7841
  * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]
7766
7842
  *
7767
7843
  * @param {string} event
7768
- * @param {EventBusListener} listener
7844
+ * @param {EventBusListener} newListener
7769
7845
  */
7770
7846
  EventBus.prototype._addListener = function(event, newListener) {
7771
7847
 
@@ -7920,8 +7996,8 @@
7920
7996
  * @param {SVGElement} gfx
7921
7997
  * @param {number} x
7922
7998
  * @param {number} y
7923
- * @param {number} angle
7924
- * @param {number} amount
7999
+ * @param {number} [angle]
8000
+ * @param {number} [amount]
7925
8001
  */
7926
8002
  function transform(gfx, x, y, angle, amount) {
7927
8003
  var translate = createTransform();
@@ -8408,9 +8484,11 @@
8408
8484
  *
8409
8485
  * @example
8410
8486
  *
8487
+ * ```javascript
8411
8488
  * eventBus.on('diagram.init', function() {
8412
8489
  * eventBus.fire('my-custom-event', { foo: 'BAR' });
8413
8490
  * });
8491
+ * ```
8414
8492
  *
8415
8493
  * @type {Object}
8416
8494
  */
@@ -17901,7 +17979,7 @@
17901
17979
  * @return {boolean}
17902
17980
  */
17903
17981
  function hasExternalLabel(element) {
17904
- return isLabel$5(element.label);
17982
+ return isLabel(element.label);
17905
17983
  }
17906
17984
 
17907
17985
  /**
@@ -18029,15 +18107,15 @@
18029
18107
  *
18030
18108
  * @return {boolean}
18031
18109
  */
18032
- function isLabel$5(element) {
18110
+ function isLabel(element) {
18033
18111
  return element && !!element.labelTarget;
18034
18112
  }
18035
18113
 
18036
-
18037
18114
  /**
18038
- * @typedef { import('../model').DiagramElement } DiagramElement
18115
+ * @param {ModdleElement} semantic
18116
+ *
18117
+ * @returns {string}
18039
18118
  */
18040
-
18041
18119
  function getLabelAttr(semantic) {
18042
18120
  if (
18043
18121
  is$1(semantic, 'bpmn:FlowElement') ||
@@ -18060,6 +18138,11 @@
18060
18138
  }
18061
18139
  }
18062
18140
 
18141
+ /**
18142
+ * @param {ModdleElement} semantic
18143
+ *
18144
+ * @returns {string}
18145
+ */
18063
18146
  function getCategoryValue(semantic) {
18064
18147
  var categoryValueRef = semantic['categoryValueRef'];
18065
18148
 
@@ -18072,9 +18155,9 @@
18072
18155
  }
18073
18156
 
18074
18157
  /**
18075
- * @param {DiagramElement} element
18158
+ * @param {Element} element
18076
18159
  *
18077
- * @return {string} label
18160
+ * @return {string}
18078
18161
  */
18079
18162
  function getLabel(element) {
18080
18163
  var semantic = element.businessObject,
@@ -18093,10 +18176,10 @@
18093
18176
 
18094
18177
 
18095
18178
  /**
18096
- * @param {DiagramElement} element
18179
+ * @param {Element} element
18097
18180
  * @param {string} text
18098
18181
  *
18099
- * @return {DiagramElement} element
18182
+ * @return {Element}
18100
18183
  */
18101
18184
  function setLabel(element, text) {
18102
18185
  var semantic = element.businessObject,
@@ -18161,7 +18244,7 @@
18161
18244
  // color access //////////////////////
18162
18245
 
18163
18246
  /**
18164
- * @param {DiagramElement} element
18247
+ * @param {Element} element
18165
18248
  * @param {string} [defaultColor]
18166
18249
  *
18167
18250
  * @return {string}
@@ -18173,7 +18256,7 @@
18173
18256
  }
18174
18257
 
18175
18258
  /**
18176
- * @param {DiagramElement} element
18259
+ * @param {Element} element
18177
18260
  * @param {string} [defaultColor]
18178
18261
  *
18179
18262
  * @return {string}
@@ -18185,9 +18268,9 @@
18185
18268
  }
18186
18269
 
18187
18270
  /**
18188
- * @param {DiagramElement} element
18189
- * @param {string} defaultColor
18190
- * @param {string} defaultStrokeColor
18271
+ * @param {Element} element
18272
+ * @param {string} [defaultColor]
18273
+ * @param {string} [defaultStrokeColor]
18191
18274
  *
18192
18275
  * @return {string}
18193
18276
  */
@@ -18318,7 +18401,7 @@
18318
18401
  */
18319
18402
 
18320
18403
  /**
18321
- * @typedef { import('../model').DiagramElement } DiagramElement
18404
+ * @typedef { import('../model/Types').Element } Element
18322
18405
  */
18323
18406
 
18324
18407
  /**
@@ -20159,7 +20242,7 @@
20159
20242
 
20160
20243
 
20161
20244
  /**
20162
- * @param {DiagramElement} element
20245
+ * @param {Element} element
20163
20246
  *
20164
20247
  * @return {boolean}
20165
20248
  */
@@ -20171,7 +20254,7 @@
20171
20254
  * Draw shape into parentGfx.
20172
20255
  *
20173
20256
  * @param {SVGElement} parentGfx
20174
- * @param {DiagramElement} element
20257
+ * @param {Element} element
20175
20258
  *
20176
20259
  * @return {SVGElement} mainGfx
20177
20260
  */
@@ -20187,7 +20270,7 @@
20187
20270
  * Draw connection into parentGfx.
20188
20271
  *
20189
20272
  * @param {SVGElement} parentGfx
20190
- * @param {DiagramElement} element
20273
+ * @param {Element} element
20191
20274
  *
20192
20275
  * @return {SVGElement} mainGfx
20193
20276
  */
@@ -20202,7 +20285,7 @@
20202
20285
  /**
20203
20286
  * Get shape path.
20204
20287
  *
20205
- * @param {DiagramElement} element
20288
+ * @param {Element} element
20206
20289
  *
20207
20290
  * @return {string} path
20208
20291
  */
@@ -20244,7 +20327,7 @@
20244
20327
  *
20245
20328
  * @typedef { Partial<{
20246
20329
  * align: AlignmentConfig;
20247
- * style: Record<string, any>;
20330
+ * style: Record<string, number | string>;
20248
20331
  * padding: PaddingConfig;
20249
20332
  * }> } BaseTextConfig
20250
20333
  *
@@ -20351,6 +20434,8 @@
20351
20434
  * Alters the lines passed.
20352
20435
  *
20353
20436
  * @param {string[]} lines
20437
+ * @param {number} maxWidth
20438
+ * @param {SVGTextElement} fakeText
20354
20439
  *
20355
20440
  * @return {LineDescriptor} the line descriptor
20356
20441
  */
@@ -21683,6 +21768,10 @@
21683
21768
  ]
21684
21769
  };
21685
21770
 
21771
+ /**
21772
+ * @typedef {import('../util/Types').Point} Point
21773
+ */
21774
+
21686
21775
  function __stopPropagation(event) {
21687
21776
  if (!event || typeof event.stopPropagation !== 'function') {
21688
21777
  return;
@@ -21691,18 +21780,28 @@
21691
21780
  event.stopPropagation();
21692
21781
  }
21693
21782
 
21694
-
21783
+ /**
21784
+ * @param {import('../core/EventBus').Event} event
21785
+ *
21786
+ * @return {Event}
21787
+ */
21695
21788
  function getOriginal$1(event) {
21696
21789
  return event.originalEvent || event.srcEvent;
21697
21790
  }
21698
21791
 
21699
-
21700
- function stopPropagation$1(event, immediate) {
21792
+ /**
21793
+ * @param {Event|import('../core/EventBus').Event} event
21794
+ */
21795
+ function stopPropagation$1(event) {
21701
21796
  __stopPropagation(event);
21702
21797
  __stopPropagation(getOriginal$1(event));
21703
21798
  }
21704
21799
 
21705
-
21800
+ /**
21801
+ * @param {Event} event
21802
+ *
21803
+ * @return {Point|null}
21804
+ */
21706
21805
  function toPoint(event) {
21707
21806
 
21708
21807
  if (event.pointers && event.pointers.length) {
@@ -21723,22 +21822,43 @@
21723
21822
  return (/mac/i).test(navigator.platform);
21724
21823
  }
21725
21824
 
21825
+ /**
21826
+ * @param {MouseEvent} event
21827
+ * @param {string} button
21828
+ *
21829
+ * @return {boolean}
21830
+ */
21726
21831
  function isButton(event, button) {
21727
21832
  return (getOriginal$1(event) || event).button === button;
21728
21833
  }
21729
21834
 
21835
+ /**
21836
+ * @param {MouseEvent} event
21837
+ *
21838
+ * @return {boolean}
21839
+ */
21730
21840
  function isPrimaryButton(event) {
21731
21841
 
21732
21842
  // button === 0 -> left áka primary mouse button
21733
21843
  return isButton(event, 0);
21734
21844
  }
21735
21845
 
21846
+ /**
21847
+ * @param {MouseEvent} event
21848
+ *
21849
+ * @return {boolean}
21850
+ */
21736
21851
  function isAuxiliaryButton(event) {
21737
21852
 
21738
21853
  // button === 1 -> auxiliary áka wheel button
21739
21854
  return isButton(event, 1);
21740
21855
  }
21741
21856
 
21857
+ /**
21858
+ * @param {MouseEvent} event
21859
+ *
21860
+ * @return {boolean}
21861
+ */
21742
21862
  function hasPrimaryModifier(event) {
21743
21863
  var originalEvent = getOriginal$1(event) || event;
21744
21864
 
@@ -21754,7 +21874,11 @@
21754
21874
  }
21755
21875
  }
21756
21876
 
21757
-
21877
+ /**
21878
+ * @param {MouseEvent} event
21879
+ *
21880
+ * @return {boolean}
21881
+ */
21758
21882
  function hasSecondaryModifier(event) {
21759
21883
  var originalEvent = getOriginal$1(event) || event;
21760
21884
 
@@ -22773,7 +22897,7 @@
22773
22897
  *
22774
22898
  * The ids can be customized via a given prefix and contain a random value to avoid collisions.
22775
22899
  *
22776
- * @param {string} prefix a prefix to prepend to generated ids (for better readability)
22900
+ * @param {string} [prefix] a prefix to prepend to generated ids (for better readability)
22777
22901
  */
22778
22902
  function IdGenerator(prefix) {
22779
22903
 
@@ -23881,6 +24005,7 @@
23881
24005
 
23882
24006
  /**
23883
24007
  * @param {string} str
24008
+ *
23884
24009
  * @return {string}
23885
24010
  */
23886
24011
  function escapeCSS(str) {
@@ -23895,6 +24020,11 @@
23895
24020
  '\'': '&#39;'
23896
24021
  };
23897
24022
 
24023
+ /**
24024
+ * @param {string} str
24025
+ *
24026
+ * @return {string}
24027
+ */
23898
24028
  function escapeHTML(str) {
23899
24029
  str = '' + str;
23900
24030
 
@@ -24775,6 +24905,7 @@
24775
24905
 
24776
24906
  /**
24777
24907
  * @param {KeyboardEvent} event
24908
+ * @return {boolean}
24778
24909
  */
24779
24910
  function isCmd(event) {
24780
24911
 
@@ -24792,6 +24923,7 @@
24792
24923
  *
24793
24924
  * @param {string|string[]} keys
24794
24925
  * @param {KeyboardEvent} event
24926
+ * @return {boolean}
24795
24927
  */
24796
24928
  function isKey(keys, event) {
24797
24929
  keys = isArray$3(keys) ? keys : [ keys ];
@@ -24806,18 +24938,30 @@
24806
24938
  return event.shiftKey;
24807
24939
  }
24808
24940
 
24941
+ /**
24942
+ * @param {KeyboardEvent} event
24943
+ */
24809
24944
  function isCopy(event) {
24810
24945
  return isCmd(event) && isKey(KEYS_COPY, event);
24811
24946
  }
24812
24947
 
24948
+ /**
24949
+ * @param {KeyboardEvent} event
24950
+ */
24813
24951
  function isPaste(event) {
24814
24952
  return isCmd(event) && isKey(KEYS_PASTE, event);
24815
24953
  }
24816
24954
 
24955
+ /**
24956
+ * @param {KeyboardEvent} event
24957
+ */
24817
24958
  function isUndo(event) {
24818
24959
  return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);
24819
24960
  }
24820
24961
 
24962
+ /**
24963
+ * @param {KeyboardEvent} event
24964
+ */
24821
24965
  function isRedo(event) {
24822
24966
  return isCmd(event) && (
24823
24967
  isKey(KEYS_REDO, event) || (
@@ -24828,6 +24972,8 @@
24828
24972
 
24829
24973
  /**
24830
24974
  * @typedef {import('../../core/EventBus').default} EventBus
24975
+ *
24976
+ * @typedef {({ keyEvent: KeyboardEvent }) => any} Listener
24831
24977
  */
24832
24978
 
24833
24979
  var KEYDOWN_EVENT = 'keyboard.keydown',
@@ -24859,6 +25005,7 @@
24859
25005
  * `keyboard.bindTo` configuration option.
24860
25006
  *
24861
25007
  * @param {Object} config
25008
+ * @param {EventTarget} [config.bindTo]
24862
25009
  * @param {EventBus} eventBus
24863
25010
  */
24864
25011
  function Keyboard(config, eventBus) {
@@ -24950,6 +25097,11 @@
24950
25097
  return modifierContainer.getAttribute(HANDLE_MODIFIER_ATTRIBUTE).split(',');
24951
25098
  };
24952
25099
 
25100
+ /**
25101
+ * Bind keyboard events to the given DOM node.
25102
+ *
25103
+ * @param {EventTarget} node
25104
+ */
24953
25105
  Keyboard.prototype.bind = function(node) {
24954
25106
 
24955
25107
  // make sure that the keyboard is only bound once to the DOM
@@ -24964,6 +25116,9 @@
24964
25116
  this._fire('bind');
24965
25117
  };
24966
25118
 
25119
+ /**
25120
+ * @return {EventTarget}
25121
+ */
24967
25122
  Keyboard.prototype.getBinding = function() {
24968
25123
  return this._node;
24969
25124
  };
@@ -24982,6 +25137,9 @@
24982
25137
  this._node = null;
24983
25138
  };
24984
25139
 
25140
+ /**
25141
+ * @param {string} event
25142
+ */
24985
25143
  Keyboard.prototype._fire = function(event) {
24986
25144
  this._eventBus.fire('keyboard.' + event, { node: this._node });
24987
25145
  };
@@ -24992,8 +25150,8 @@
24992
25150
  * provided, the default value of 1000 is used.
24993
25151
  *
24994
25152
  * @param {number} [priority]
24995
- * @param {Function} listener
24996
- * @param {string} type
25153
+ * @param {Listener} listener
25154
+ * @param {string} [type='keyboard.keydown']
24997
25155
  */
24998
25156
  Keyboard.prototype.addListener = function(priority, listener, type) {
24999
25157
  if (isFunction(priority)) {
@@ -25005,6 +25163,12 @@
25005
25163
  this._eventBus.on(type || KEYDOWN_EVENT, priority, listener);
25006
25164
  };
25007
25165
 
25166
+ /**
25167
+ * Remove a listener function.
25168
+ *
25169
+ * @param {Listener} listener
25170
+ * @param {string} [type='keyboard.keydown']
25171
+ */
25008
25172
  Keyboard.prototype.removeListener = function(listener, type) {
25009
25173
  this._eventBus.off(type || KEYDOWN_EVENT, listener);
25010
25174
  };
@@ -25277,15 +25441,21 @@
25277
25441
  }
25278
25442
  }
25279
25443
 
25280
- this.moveCanvas = function(opts) {
25444
+ /**
25445
+ * @param {{
25446
+ * direction: 'up' | 'down' | 'left' | 'right';
25447
+ * speed: number;
25448
+ * }} options
25449
+ */
25450
+ this.moveCanvas = function(options) {
25281
25451
 
25282
25452
  var dx = 0,
25283
25453
  dy = 0,
25284
- speed = opts.speed;
25454
+ speed = options.speed;
25285
25455
 
25286
25456
  var actualSpeed = speed / Math.min(Math.sqrt(canvas.viewbox().scale), 1);
25287
25457
 
25288
- switch (opts.direction) {
25458
+ switch (options.direction) {
25289
25459
  case 'left': // Left
25290
25460
  dx = actualSpeed;
25291
25461
  break;
@@ -25328,7 +25498,9 @@
25328
25498
 
25329
25499
  var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
25330
25500
 
25331
-
25501
+ /**
25502
+ * @param {string} mode
25503
+ */
25332
25504
  function set(mode) {
25333
25505
  var classes = classes$1(document.body);
25334
25506
 
@@ -25343,12 +25515,19 @@
25343
25515
  set(null);
25344
25516
  }
25345
25517
 
25518
+ /**
25519
+ * @typedef {import('../core/EventBus').EventBus} EventBus
25520
+ */
25521
+
25346
25522
  var TRAP_PRIORITY = 5000;
25347
25523
 
25348
25524
  /**
25349
25525
  * Installs a click trap that prevents a ghost click following a dragging operation.
25350
25526
  *
25351
- * @return {Function} a function to immediately remove the installed trap.
25527
+ * @param {EventBus} eventBus
25528
+ * @param {string} [eventName='element.click']
25529
+ *
25530
+ * @return {() => void} a function to immediately remove the installed trap.
25352
25531
  */
25353
25532
  function install(eventBus, eventName) {
25354
25533
 
@@ -25365,6 +25544,15 @@
25365
25544
  };
25366
25545
  }
25367
25546
 
25547
+ /**
25548
+ * @typedef {import('../util/Types').Point} Point
25549
+ * @typedef {import('../util/Types').Rect} Rect
25550
+ */
25551
+
25552
+ /**
25553
+ * @param {Rect} bounds
25554
+ * @return {Point}
25555
+ */
25368
25556
  function center(bounds) {
25369
25557
  return {
25370
25558
  x: bounds.x + (bounds.width / 2),
@@ -25373,6 +25561,11 @@
25373
25561
  }
25374
25562
 
25375
25563
 
25564
+ /**
25565
+ * @param {Point} a
25566
+ * @param {Point} b
25567
+ * @return {Point}
25568
+ */
25376
25569
  function delta(a, b) {
25377
25570
  return {
25378
25571
  x: a.x - b.x,
@@ -25521,6 +25714,7 @@
25521
25714
  * @param {Object} range
25522
25715
  * @param {number} range.min
25523
25716
  * @param {number} range.max
25717
+ * @param {number} steps
25524
25718
  */
25525
25719
  function getStepSize(range, steps) {
25526
25720
 
@@ -25532,6 +25726,12 @@
25532
25726
  return absoluteLinearRange / steps;
25533
25727
  }
25534
25728
 
25729
+ /**
25730
+ * @param {Object} range
25731
+ * @param {number} range.min
25732
+ * @param {number} range.max
25733
+ * @param {number} scale
25734
+ */
25535
25735
  function cap(range, scale) {
25536
25736
  return Math.max(range.min, Math.min(range.max, scale));
25537
25737
  }
@@ -29588,16 +29788,20 @@
29588
29788
 
29589
29789
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
29590
29790
 
29791
+ /**
29792
+ * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry
29793
+ */
29794
+
29591
29795
  /**
29592
29796
  * Component that renders a popup menu entry.
29593
29797
  *
29594
29798
  * @param {Object} props
29595
29799
  * @param {string} props.key
29596
- * @param {Object} props.entry
29800
+ * @param {PopupMenuEntry} props.entry
29597
29801
  * @param {boolean} props.selected
29598
- * @param {Function} props.onMouseEnter
29599
- * @param {Function} props.onMouseLeave
29600
- * @param {Function} props.onAction
29802
+ * @param {(event: MouseEvent) => void} props.onMouseEnter
29803
+ * @param {(event: MouseEvent) => void} props.onMouseLeave
29804
+ * @param {(event: MouseEvent, entry?: PopupMenuEntry, action?: string) => void} props.onAction
29601
29805
  */
29602
29806
  function PopupMenuItem(props) {
29603
29807
  const {
@@ -29661,15 +29865,17 @@
29661
29865
  `;
29662
29866
  }
29663
29867
 
29868
+ /**
29869
+ * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry
29870
+ */
29871
+
29664
29872
  /**
29665
29873
  * Component that renders a popup menu entry list.
29666
29874
  *
29667
29875
  * @param {Object} props
29668
- * @param {Array} props.entries
29669
- * @param {Object} props.selectedEntry
29670
- * @param {Function} props.setSelectedEntry
29671
- * @param {Function} props.onAction
29672
- * @param {Object} props.resultsRef
29876
+ * @param {PopupMenuEntry[]} props.entries
29877
+ * @param {PopupMenuEntry} props.selectedEntry
29878
+ * @param {(entry: PopupMenuEntry | null) => void} props.setSelectedEntry
29673
29879
  */
29674
29880
  function PopupMenuList(props) {
29675
29881
  const {
@@ -29763,15 +29969,22 @@
29763
29969
  }
29764
29970
  }
29765
29971
 
29972
+ /**
29973
+ * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry
29974
+ * @typedef {import('./PopupMenuProvider').PopupMenuHeaderEntry} PopupMenuHeaderEntry
29975
+ *
29976
+ * @typedef {import('../../util/Types').Point} Point
29977
+ */
29978
+
29766
29979
  /**
29767
29980
  * A component that renders the popup menus.
29768
29981
  *
29769
29982
  * @param {Object} props
29770
- * @param {function} props.onClose
29771
- * @param {function} props.position
29983
+ * @param {() => void} props.onClose
29984
+ * @param {(element: HTMLElement) => Point} props.position
29772
29985
  * @param {string} props.className
29773
- * @param {Array} props.entries
29774
- * @param {Array} props.headerEntries
29986
+ * @param {PopupMenuEntry[]} props.entries
29987
+ * @param {PopupMenuHeaderEntry[]} props.headerEntries
29775
29988
  * @param {number} props.scale
29776
29989
  * @param {string} [props.title]
29777
29990
  * @param {boolean} [props.search]
@@ -30585,7 +30798,7 @@
30585
30798
  let element = closest(event.delegateTarget || event.target, '.entry', true);
30586
30799
  let entryId = attr$1(element, DATA_REF);
30587
30800
 
30588
- entry = this._getEntry(entryId);
30801
+ entry = { id: entryId, ...this._getEntry(entryId) };
30589
30802
  }
30590
30803
 
30591
30804
  const handler = entry.action;
@@ -30988,6 +31201,8 @@
30988
31201
  };
30989
31202
 
30990
31203
  /**
31204
+ * @typedef {import('../../model/Types').Connection} Connection
31205
+ * @typedef {import('../../model/Types').Element} Element
30991
31206
  * @typedef {import('../../model/Types').Shape} Shape
30992
31207
  *
30993
31208
  * @typedef {import('../../util/Types').Point} Point
@@ -31007,7 +31222,7 @@
31007
31222
  * @param {Shape} source
31008
31223
  * @param {Shape} element
31009
31224
  * @param {Point} position
31010
- * @param {Function} getNextPosition
31225
+ * @param {(element: Element, position: Point, connectedAtPosition: Element) => Element} getNextPosition
31011
31226
  *
31012
31227
  * @return {Point}
31013
31228
  */
@@ -31028,7 +31243,7 @@
31028
31243
  * @param {Object} [nextPositionDirection.x]
31029
31244
  * @param {Object} [nextPositionDirection.y]
31030
31245
  *
31031
- * @return {Function}
31246
+ * @return {(element: Element, previousPosition: Point, connectedAtPosition: Element) => Point}
31032
31247
  */
31033
31248
  function generateGetNextPosition(nextPositionDirection) {
31034
31249
  return function(element, previousPosition, connectedAtPosition) {
@@ -31104,8 +31319,8 @@
31104
31319
  * @param {Object} [hints]
31105
31320
  * @param {number} [hints.defaultDistance]
31106
31321
  * @param {string} [hints.direction]
31107
- * @param {Function} [hints.filter]
31108
- * @param {Function} [hints.getWeight]
31322
+ * @param {(connection: Connection) => boolean} [hints.filter]
31323
+ * @param {(connection: Connection) => number} [hints.getWeight]
31109
31324
  * @param {number} [hints.maxDistance]
31110
31325
  * @param {string} [hints.reference]
31111
31326
  *
@@ -31556,7 +31771,7 @@
31556
31771
  y: sourceTrbl.top - 50 - element.height / 2
31557
31772
  };
31558
31773
 
31559
- if (isConnection$e(source)) {
31774
+ if (isConnection$3(source)) {
31560
31775
  position = getMid(source);
31561
31776
  position.x += 100;
31562
31777
  position.y -= 50;
@@ -31601,7 +31816,7 @@
31601
31816
  return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
31602
31817
  }
31603
31818
 
31604
- function isConnection$e(element) {
31819
+ function isConnection$3(element) {
31605
31820
  return !!element.waypoints;
31606
31821
  }
31607
31822
 
@@ -32042,7 +32257,7 @@
32042
32257
 
32043
32258
  forEach$1(elements, function(element) {
32044
32259
 
32045
- if (is$1(element, 'bpmn:Lane') || isLabel$5(element)) {
32260
+ if (is$1(element, 'bpmn:Lane') || isLabel(element)) {
32046
32261
  canResize = false;
32047
32262
  return;
32048
32263
  }
@@ -32309,6 +32524,7 @@
32309
32524
  *
32310
32525
  * @example
32311
32526
  *
32527
+ * ```javascript
32312
32528
  * function MyDragComponent(eventBus, dragging) {
32313
32529
  *
32314
32530
  * eventBus.on('mydrag.start', function(event) {
@@ -32336,6 +32552,7 @@
32336
32552
  * });
32337
32553
  * });
32338
32554
  * }
32555
+ * ```
32339
32556
  *
32340
32557
  * @param {EventBus} eventBus
32341
32558
  * @param {Canvas} canvas
@@ -32645,7 +32862,7 @@
32645
32862
  * relative to it.
32646
32863
  *
32647
32864
  * @param {MouseEvent|TouchEvent} [event]
32648
- * @param {Point} [localPosition] actual diagram local position this drag operation should start at
32865
+ * @param {Point} [relativeTo] actual diagram local position this drag operation should start at
32649
32866
  * @param {string} prefix
32650
32867
  * @param {Object} [options]
32651
32868
  */
@@ -33011,6 +33228,12 @@
33011
33228
 
33012
33229
  /**
33013
33230
  * @typedef {import('../util/Types').Point} Point
33231
+ *
33232
+ * @typedef { {
33233
+ * bendpoint?: boolean;
33234
+ * index: number;
33235
+ * point: Point;
33236
+ * } } Intersection
33014
33237
  */
33015
33238
 
33016
33239
  var round$9 = Math.round,
@@ -33043,6 +33266,12 @@
33043
33266
 
33044
33267
  var INTERSECTION_THRESHOLD$1 = 10;
33045
33268
 
33269
+ /**
33270
+ * @param {Point[]} waypoints
33271
+ * @param {Point} reference
33272
+ *
33273
+ * @return {Intersection|null}
33274
+ */
33046
33275
  function getBendpointIntersection(waypoints, reference) {
33047
33276
 
33048
33277
  var i, w;
@@ -33061,6 +33290,12 @@
33061
33290
  return null;
33062
33291
  }
33063
33292
 
33293
+ /**
33294
+ * @param {Point[]} waypoints
33295
+ * @param {Point} reference
33296
+ *
33297
+ * @return {Intersection|null}
33298
+ */
33064
33299
  function getPathIntersection(waypoints, reference) {
33065
33300
 
33066
33301
  var intersections = intersectPaths(circlePath(reference, INTERSECTION_THRESHOLD$1), linePath(waypoints));
@@ -33115,7 +33350,7 @@
33115
33350
  * @param {Point[]} waypoints
33116
33351
  * @param {Point} reference
33117
33352
  *
33118
- * @return {Object} intersection data (segment, point)
33353
+ * @return {Intersection|null}
33119
33354
  */
33120
33355
  function getApproxIntersection(waypoints, reference) {
33121
33356
  return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
@@ -35036,7 +35271,7 @@
35036
35271
  hoverMid = hover && getSnapPoint(hover, event);
35037
35272
 
35038
35273
  // only snap on connections, elements can have multiple connect endpoints
35039
- if (!isConnection$d(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35274
+ if (!isConnection$4(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35040
35275
  return;
35041
35276
  }
35042
35277
 
@@ -35088,13 +35323,6 @@
35088
35323
 
35089
35324
  BendpointSnapping.$inject = [ 'eventBus' ];
35090
35325
 
35091
-
35092
- // helpers //////////////////////
35093
-
35094
- function isConnection$d(element) {
35095
- return element && !!element.waypoints;
35096
- }
35097
-
35098
35326
  /**
35099
35327
  * @type { import('didi').ModuleDeclaration }
35100
35328
  */
@@ -36621,11 +36849,11 @@
36621
36849
  elements = filter(elements, function(element) {
36622
36850
  var labelTarget = element.labelTarget;
36623
36851
 
36624
- return !element.parent && !(isLabel$4(element) && elements.indexOf(labelTarget) !== -1);
36852
+ return !element.parent && !(isLabel$1(element) && elements.indexOf(labelTarget) !== -1);
36625
36853
  });
36626
36854
 
36627
36855
  var shape = find(elements, function(element) {
36628
- return !isConnection$c(element);
36856
+ return !isConnection$4(element);
36629
36857
  });
36630
36858
 
36631
36859
  var attach = false,
@@ -36780,7 +37008,7 @@
36780
37008
 
36781
37009
  // update shape
36782
37010
  shape = find(elements, function(element) {
36783
- return !isConnection$c(element);
37011
+ return !isConnection$4(element);
36784
37012
  });
36785
37013
  }
36786
37014
 
@@ -36821,7 +37049,7 @@
36821
37049
  }
36822
37050
 
36823
37051
  var shape = find(elements, function(element) {
36824
- return !isConnection$c(element);
37052
+ return !isConnection$4(element);
36825
37053
  });
36826
37054
 
36827
37055
  if (!shape) {
@@ -36855,7 +37083,7 @@
36855
37083
 
36856
37084
  // center elements around cursor
36857
37085
  forEach$1(elements, function(element) {
36858
- if (isConnection$c(element)) {
37086
+ if (isConnection$4(element)) {
36859
37087
  element.waypoints = map$1(element.waypoints, function(waypoint) {
36860
37088
  return {
36861
37089
  x: waypoint.x - bbox.x - bbox.width / 2,
@@ -36917,16 +37145,8 @@
36917
37145
  }
36918
37146
  }
36919
37147
 
36920
- function isConnection$c(element) {
36921
- return !!element.waypoints;
36922
- }
36923
-
36924
37148
  function isSingleShape(elements) {
36925
- return elements && elements.length === 1 && !isConnection$c(elements[0]);
36926
- }
36927
-
36928
- function isLabel$4(element) {
36929
- return !!element.labelTarget;
37149
+ return elements && elements.length === 1 && !isConnection$4(elements[ 0 ]);
36930
37150
  }
36931
37151
 
36932
37152
  /**
@@ -37259,7 +37479,7 @@
37259
37479
  }
37260
37480
 
37261
37481
  // connections (priority = 3)
37262
- if (isConnection$b(element)) {
37482
+ if (isConnection$4(element)) {
37263
37483
  descriptor.priority = 3;
37264
37484
 
37265
37485
  descriptor.source = element.source.id;
@@ -37269,7 +37489,7 @@
37269
37489
  }
37270
37490
 
37271
37491
  // labels (priority = 4)
37272
- if (isLabel$3(element)) {
37492
+ if (isLabel$1(element)) {
37273
37493
  descriptor.priority = 4;
37274
37494
 
37275
37495
  descriptor.labelTarget = element.labelTarget.id;
@@ -37402,7 +37622,7 @@
37402
37622
 
37403
37623
  // center elements around cursor
37404
37624
  forEach$1(elements, function(element) {
37405
- if (isConnection$b(element)) {
37625
+ if (isConnection$4(element)) {
37406
37626
  element.waypoints = map$1(element.waypoints, function(waypoint) {
37407
37627
  return {
37408
37628
  x: waypoint.x - bbox.x - bbox.width / 2,
@@ -37455,7 +37675,7 @@
37455
37675
 
37456
37676
  var element;
37457
37677
 
37458
- if (isConnection$b(attrs)) {
37678
+ if (isConnection$4(attrs)) {
37459
37679
  attrs.source = cache[ descriptor.source ];
37460
37680
  attrs.target = cache[ descriptor.target ];
37461
37681
 
@@ -37466,7 +37686,7 @@
37466
37686
  return;
37467
37687
  }
37468
37688
 
37469
- if (isLabel$3(attrs)) {
37689
+ if (isLabel$1(attrs)) {
37470
37690
  attrs.labelTarget = cache[ attrs.labelTarget ];
37471
37691
 
37472
37692
  element = cache[ descriptor.id ] = self.createLabel(attrs);
@@ -37521,7 +37741,7 @@
37521
37741
  source,
37522
37742
  target;
37523
37743
 
37524
- if (isConnection$b(element)) {
37744
+ if (isConnection$4(element)) {
37525
37745
  source = find(elements, matchPattern({ id: element.source.id }));
37526
37746
  target = find(elements, matchPattern({ id: element.target.id }));
37527
37747
 
@@ -37530,7 +37750,7 @@
37530
37750
  }
37531
37751
  }
37532
37752
 
37533
- if (isLabel$3(element)) {
37753
+ if (isLabel$1(element)) {
37534
37754
  labelTarget = find(elements, matchPattern({ id: element.labelTarget.id }));
37535
37755
 
37536
37756
  if (!labelTarget) {
@@ -37545,6 +37765,8 @@
37545
37765
  * Create a tree-like structure from elements.
37546
37766
  *
37547
37767
  * @example
37768
+ *
37769
+ * ```javascript
37548
37770
  * tree: {
37549
37771
  * 0: [
37550
37772
  * { id: 'Shape_1', priority: 1, ... },
@@ -37557,6 +37779,7 @@
37557
37779
  * ...
37558
37780
  * ]
37559
37781
  * };
37782
+ * ```
37560
37783
  *
37561
37784
  * @param {Element[]} elements
37562
37785
  *
@@ -37620,7 +37843,7 @@
37620
37843
  eachElement(parents, function(element, _index, depth) {
37621
37844
 
37622
37845
  // do NOT add external labels directly
37623
- if (isLabel$3(element)) {
37846
+ if (isLabel$1(element)) {
37624
37847
  return;
37625
37848
  }
37626
37849
 
@@ -37718,14 +37941,6 @@
37718
37941
  return !!element.host;
37719
37942
  }
37720
37943
 
37721
- function isConnection$b(element) {
37722
- return !!element.waypoints;
37723
- }
37724
-
37725
- function isLabel$3(element) {
37726
- return !!element.labelTarget;
37727
- }
37728
-
37729
37944
  function copyWaypoints$1(element) {
37730
37945
  return map$1(element.waypoints, function(waypoint) {
37731
37946
 
@@ -37809,7 +38024,7 @@
37809
38024
 
37810
38025
  // do not copy business object + di for labels;
37811
38026
  // will be pulled from the referenced label target
37812
- if (isLabel$5(element)) {
38027
+ if (isLabel(element)) {
37813
38028
  return descriptor;
37814
38029
  }
37815
38030
 
@@ -37877,7 +38092,7 @@
37877
38092
  di = descriptor.di;
37878
38093
 
37879
38094
  // wire existing di + businessObject for external label
37880
- if (isLabel$5(descriptor)) {
38095
+ if (isLabel(descriptor)) {
37881
38096
  descriptor.businessObject = getBusinessObject(cache[ descriptor.labelTarget ]);
37882
38097
  descriptor.di = getDi(cache[ descriptor.labelTarget ]);
37883
38098
 
@@ -41208,18 +41423,24 @@
41208
41423
  };
41209
41424
 
41210
41425
  /**
41211
- * @typedef {Object} Range
41212
- * @property {number} min
41213
- * @property {number} max
41214
- */
41215
-
41216
- /**
41426
+ * @typedef {import('../../model/Types').Element} Element
41427
+ *
41217
41428
  * @typedef {import('../../util/Types').Axis} Axis
41218
41429
  * @typedef {import('../../util/Types').Dimension} Dimension
41219
41430
  * @typedef {import('../../util/Types').Rect} Rect
41220
41431
  *
41221
41432
  * @typedef {import('../modeling/Modeling').default} Modeling
41222
41433
  * @typedef {import('../rules/Rules').default} Rules
41434
+ *
41435
+ * @typedef { {
41436
+ * min: number;
41437
+ * max: number;
41438
+ * } } Range
41439
+ *
41440
+ * @typedef { {
41441
+ * elements: Element[];
41442
+ * range: Range;
41443
+ * } } Group
41223
41444
  */
41224
41445
 
41225
41446
  var AXIS_DIMENSIONS = {
@@ -41259,7 +41480,7 @@
41259
41480
  * Registers filter functions that allow external parties to filter
41260
41481
  * out certain elements.
41261
41482
  *
41262
- * @param {Function} filterFn
41483
+ * @param {(distributableElements: Element[], axis: Axis, dimension: Dimension) => Element[]} filterFn
41263
41484
  */
41264
41485
  DistributeElements$1.prototype.registerFilter = function(filterFn) {
41265
41486
  if (typeof filterFn !== 'function') {
@@ -41272,7 +41493,7 @@
41272
41493
  /**
41273
41494
  * Distributes the elements with a given orientation
41274
41495
  *
41275
- * @param {Array} elements
41496
+ * @param {Element[]} elements
41276
41497
  * @param {string} orientation
41277
41498
  */
41278
41499
  DistributeElements$1.prototype.trigger = function(elements, orientation) {
@@ -41304,9 +41525,9 @@
41304
41525
  /**
41305
41526
  * Filters the elements with provided filters by external parties
41306
41527
  *
41307
- * @param {Array[Elements]} elements
41528
+ * @param {Element[]} elements
41308
41529
  *
41309
- * @return {Array[Elements]}
41530
+ * @return {Element[]}
41310
41531
  */
41311
41532
  DistributeElements$1.prototype._filterElements = function(elements) {
41312
41533
  var filters = this._filters,
@@ -41331,19 +41552,19 @@
41331
41552
  * together that share the same range.
41332
41553
  *
41333
41554
  * @example
41334
- * var distributableElements = [
41335
- * {
41336
- * range: {
41337
- * min: 100,
41338
- * max: 200
41339
- * },
41340
- * elements: [ { id: 'shape1', .. }]
41341
- * }
41342
- * ]
41343
41555
  *
41344
- * @param {Array} elements
41556
+ * ```javascript
41557
+ * const groups = [
41558
+ * {
41559
+ * range: { min: 100, max: 200 },
41560
+ * elements: [ { id: 'shape1', ... } ]
41561
+ * }
41562
+ * ]
41563
+ * ```
41345
41564
  *
41346
- * @return {Array[Objects]}
41565
+ * @param {Element[]} elements
41566
+ *
41567
+ * @return {Group[]}
41347
41568
  */
41348
41569
  DistributeElements$1.prototype._createGroups = function(elements) {
41349
41570
  var rangeGroups = [],
@@ -41378,9 +41599,9 @@
41378
41599
 
41379
41600
 
41380
41601
  /**
41381
- * Maps a direction to the according axis and dimension
41602
+ * Maps a direction to the according axis and dimension.
41382
41603
  *
41383
- * @param {string} direction 'horizontal' or 'vertical'
41604
+ * @param {'horizontal' | 'vertical'} direction 'horizontal' or 'vertical'
41384
41605
  */
41385
41606
  DistributeElements$1.prototype._setOrientation = function(direction) {
41386
41607
  var orientation = AXIS_DIMENSIONS[direction];
@@ -41391,10 +41612,10 @@
41391
41612
 
41392
41613
 
41393
41614
  /**
41394
- * Checks if the two ranges intercept each other
41615
+ * Checks if the two ranges intercept each other.
41395
41616
  *
41396
- * @param {Object} rangeA {min, max}
41397
- * @param {Object} rangeB {min, max}
41617
+ * @param {Range} rangeA
41618
+ * @param {Range} rangeB
41398
41619
  *
41399
41620
  * @return {boolean}
41400
41621
  */
@@ -41407,9 +41628,7 @@
41407
41628
  /**
41408
41629
  * Returns the min and max values for an element
41409
41630
  *
41410
- * @param {Rect} element
41411
- * @param {Axis} axis
41412
- * @param {Dimension} dimension
41631
+ * @param {Element} element
41413
41632
  *
41414
41633
  * @return {Range}
41415
41634
  */
@@ -41773,7 +41992,8 @@
41773
41992
  * The key of the object will be the name of the action.
41774
41993
  *
41775
41994
  * @example
41776
- * ´´´
41995
+ *
41996
+ * ```javascript
41777
41997
  * var actions = {
41778
41998
  * spaceTool: function() {
41779
41999
  * spaceTool.activateSelection();
@@ -41786,7 +42006,7 @@
41786
42006
  * editorActions.register(actions);
41787
42007
  *
41788
42008
  * editorActions.isRegistered('spaceTool'); // true
41789
- * ´´´
42009
+ * ```
41790
42010
  *
41791
42011
  * @param {Object} actions
41792
42012
  */
@@ -43953,7 +44173,7 @@
43953
44173
  ResizeHandles.prototype.addResizer = function(element) {
43954
44174
  var self = this;
43955
44175
 
43956
- if (isConnection$a(element) || !this._resize.canResize({ shape: element })) {
44176
+ if (isConnection$4(element) || !this._resize.canResize({ shape: element })) {
43957
44177
  return;
43958
44178
  }
43959
44179
 
@@ -44005,10 +44225,6 @@
44005
44225
  return offset;
44006
44226
  }
44007
44227
 
44008
- function isConnection$a(element) {
44009
- return !!element.waypoints;
44010
- }
44011
-
44012
44228
  /**
44013
44229
  * @type { import('didi').ModuleDeclaration }
44014
44230
  */
@@ -44368,7 +44584,7 @@
44368
44584
  // external label not yet created
44369
44585
  if (isLabelExternal(target)
44370
44586
  && !hasExternalLabel(target)
44371
- && !isLabel$5(target)) {
44587
+ && !isLabel(target)) {
44372
44588
 
44373
44589
  var externalLabelMid = getExternalLabelMid(element);
44374
44590
 
@@ -45045,7 +45261,7 @@
45045
45261
  }
45046
45262
 
45047
45263
  function shouldReplace$1(shape, host) {
45048
- return !isLabel$5(shape) &&
45264
+ return !isLabel(shape) &&
45049
45265
  isAny(shape, [ 'bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent' ]) && !!host;
45050
45266
  }
45051
45267
 
@@ -45222,8 +45438,8 @@
45222
45438
  // ignore connections, groups and labels
45223
45439
  var children = rootElement.children.filter(function(element) {
45224
45440
  return !is$1(element, 'bpmn:Group') &&
45225
- !isLabel$5(element) &&
45226
- !isConnection$9(element);
45441
+ !isLabel(element) &&
45442
+ !isConnection$2(element);
45227
45443
  });
45228
45444
 
45229
45445
  // ensure for available children to calculate bounds
@@ -45394,7 +45610,7 @@
45394
45610
  };
45395
45611
  }
45396
45612
 
45397
- function isConnection$9(element) {
45613
+ function isConnection$2(element) {
45398
45614
  return !!element.waypoints;
45399
45615
  }
45400
45616
 
@@ -46002,7 +46218,7 @@
46002
46218
  }
46003
46219
 
46004
46220
  function shouldReplace(shape, host) {
46005
- return !isLabel$5(shape) && is$1(shape, 'bpmn:BoundaryEvent') && !host;
46221
+ return !isLabel(shape) && is$1(shape, 'bpmn:BoundaryEvent') && !host;
46006
46222
  }
46007
46223
 
46008
46224
  function includes$6(array, item) {
@@ -47709,7 +47925,7 @@
47709
47925
 
47710
47926
  var element = context.shape || context.connection;
47711
47927
 
47712
- if (isLabel$5(element) || !isLabelExternal(element)) {
47928
+ if (isLabel(element) || !isLabelExternal(element)) {
47713
47929
  return;
47714
47930
  }
47715
47931
 
@@ -50248,7 +50464,7 @@
50248
50464
  shape = context.shape,
50249
50465
  shapeBo = shape.businessObject;
50250
50466
 
50251
- if (isLabel$5(shape)) {
50467
+ if (isLabel(shape)) {
50252
50468
  return;
50253
50469
  }
50254
50470
 
@@ -50697,12 +50913,12 @@
50697
50913
  position = context.position,
50698
50914
  target = context.target;
50699
50915
 
50700
- if (isConnection$8(target) && !canInsert(elements, target)) {
50916
+ if (isConnection$1(target) && !canInsert(elements, target)) {
50701
50917
  return false;
50702
50918
  }
50703
50919
 
50704
50920
  return every(elements, function(element) {
50705
- if (isConnection$8(element)) {
50921
+ if (isConnection$1(element)) {
50706
50922
  return canConnect(element.source, element.target, element);
50707
50923
  }
50708
50924
 
@@ -50811,7 +51027,7 @@
50811
51027
  * @return {boolean}
50812
51028
  */
50813
51029
  function nonExistingOrLabel(element) {
50814
- return !element || isLabel$5(element);
51030
+ return !element || isLabel(element);
50815
51031
  }
50816
51032
 
50817
51033
  function isSame$1(a, b) {
@@ -51050,7 +51266,7 @@
51050
51266
  *
51051
51267
  * @return {boolean}
51052
51268
  */
51053
- function isConnection$8(element) {
51269
+ function isConnection$1(element) {
51054
51270
  return element.waypoints;
51055
51271
  }
51056
51272
 
@@ -51144,7 +51360,7 @@
51144
51360
  function canDrop(element, target) {
51145
51361
 
51146
51362
  // can move labels and groups everywhere
51147
- if (isLabel$5(element) || isGroup(element)) {
51363
+ if (isLabel(element) || isGroup(element)) {
51148
51364
  return true;
51149
51365
  }
51150
51366
 
@@ -51234,7 +51450,7 @@
51234
51450
  * @return {boolean}
51235
51451
  */
51236
51452
  function isBoundaryEvent(element) {
51237
- return !isLabel$5(element) && is$1(element, 'bpmn:BoundaryEvent');
51453
+ return !isLabel(element) && is$1(element, 'bpmn:BoundaryEvent');
51238
51454
  }
51239
51455
 
51240
51456
  /**
@@ -51343,7 +51559,7 @@
51343
51559
  var element = elements[0];
51344
51560
 
51345
51561
  // do not attach labels
51346
- if (isLabel$5(element)) {
51562
+ if (isLabel(element)) {
51347
51563
  return false;
51348
51564
  }
51349
51565
 
@@ -51515,7 +51731,7 @@
51515
51731
  return false;
51516
51732
  }
51517
51733
 
51518
- if (isLabel$5(shape) || isGroup(shape)) {
51734
+ if (isLabel(shape) || isGroup(shape)) {
51519
51735
  return true;
51520
51736
  }
51521
51737
 
@@ -51696,7 +51912,7 @@
51696
51912
  // return true if shape can be inserted into connection parent
51697
51913
  return (
51698
51914
  isAny(connection, [ 'bpmn:SequenceFlow', 'bpmn:MessageFlow' ]) &&
51699
- !isLabel$5(connection) &&
51915
+ !isLabel(connection) &&
51700
51916
  is$1(shape, 'bpmn:FlowNode') &&
51701
51917
  !is$1(shape, 'bpmn:BoundaryEvent') &&
51702
51918
  canDrop(shape, connection.parent));
@@ -51719,7 +51935,7 @@
51719
51935
  * @return {boolean}
51720
51936
  */
51721
51937
  function canCopy(elements, element) {
51722
- if (isLabel$5(element)) {
51938
+ if (isLabel(element)) {
51723
51939
  return true;
51724
51940
  }
51725
51941
 
@@ -52627,12 +52843,12 @@
52627
52843
  }
52628
52844
 
52629
52845
  forEach$1(elements, function(element) {
52630
- if (!element.parent || isLabel$2(element)) {
52846
+ if (!element.parent || isLabel$1(element)) {
52631
52847
  return;
52632
52848
  }
52633
52849
 
52634
52850
  // handle connections separately
52635
- if (isConnection$7(element)) {
52851
+ if (isConnection$4(element)) {
52636
52852
  connections.push(element);
52637
52853
 
52638
52854
  return;
@@ -52803,15 +53019,15 @@
52803
53019
 
52804
53020
  // find children that are not moving or resizing
52805
53021
  var nonMovingResizingChildren = filter(children, function(child) {
52806
- return !isConnection$7(child) &&
52807
- !isLabel$2(child) &&
53022
+ return !isConnection$4(child) &&
53023
+ !isLabel$1(child) &&
52808
53024
  !includes$3(movingShapes, child) &&
52809
53025
  !includes$3(resizingShapes, child);
52810
53026
  });
52811
53027
 
52812
53028
  // find children that are moving
52813
53029
  var movingChildren = filter(children, function(child) {
52814
- return !isConnection$7(child) && !isLabel$2(child) && includes$3(movingShapes, child);
53030
+ return !isConnection$4(child) && !isLabel$1(child) && includes$3(movingShapes, child);
52815
53031
  });
52816
53032
 
52817
53033
  var minOrMax,
@@ -52945,14 +53161,6 @@
52945
53161
  return !!element.host;
52946
53162
  }
52947
53163
 
52948
- function isConnection$7(element) {
52949
- return !!element.waypoints;
52950
- }
52951
-
52952
- function isLabel$2(element) {
52953
- return !!element.labelTarget;
52954
- }
52955
-
52956
53164
  var MARKER_DRAGGING$1 = 'djs-dragging',
52957
53165
  MARKER_RESIZING = 'djs-resizing';
52958
53166
 
@@ -53111,7 +53319,7 @@
53111
53319
  });
53112
53320
  });
53113
53321
 
53114
- return isConnection$6(element)
53322
+ return isConnection$4(element)
53115
53323
  && (sourceIsMoving || sourceIsResizing)
53116
53324
  && (targetIsMoving || targetIsResizing);
53117
53325
  });
@@ -53241,16 +53449,6 @@
53241
53449
  'previewSupport'
53242
53450
  ];
53243
53451
 
53244
-
53245
- // helpers //////////////////////
53246
-
53247
- /**
53248
- * Checks if an element is a connection.
53249
- */
53250
- function isConnection$6(element) {
53251
- return element.waypoints;
53252
- }
53253
-
53254
53452
  /**
53255
53453
  * @type { import('didi').ModuleDeclaration }
53256
53454
  */
@@ -54120,7 +54318,7 @@
54120
54318
  /**
54121
54319
  * Remove tooltip with given ID.
54122
54320
  *
54123
- * @param {string} id
54321
+ * @param {string | Tooltip} id
54124
54322
  */
54125
54323
  Tooltips.prototype.remove = function(id) {
54126
54324
 
@@ -54270,7 +54468,7 @@
54270
54468
  * at a time.
54271
54469
  *
54272
54470
  * @param {Object[]} [collection]
54273
- * @param {Function} removeFn
54471
+ * @param {(element: Object) => void} removeFn
54274
54472
  *
54275
54473
  * @return {Object[]} the cleared collection
54276
54474
  */
@@ -55290,7 +55488,7 @@
55290
55488
  BpmnUpdater.prototype.updateParent = function(element, oldParent) {
55291
55489
 
55292
55490
  // do not update BPMN 2.0 label parent
55293
- if (isLabel$5(element)) {
55491
+ if (isLabel(element)) {
55294
55492
  return;
55295
55493
  }
55296
55494
 
@@ -55355,7 +55553,7 @@
55355
55553
  });
55356
55554
  }
55357
55555
 
55358
- var target = isLabel$5(shape) ? this._getLabel(di) : di;
55556
+ var target = isLabel(shape) ? this._getLabel(di) : di;
55359
55557
 
55360
55558
  var bounds = target.bounds;
55361
55559
 
@@ -56416,7 +56614,7 @@
56416
56614
 
56417
56615
  // center elements around position
56418
56616
  forEach$1(elements, function(element) {
56419
- if (isConnection$5(element)) {
56617
+ if (isConnection$4(element)) {
56420
56618
  element.waypoints = map$1(element.waypoints, function(waypoint) {
56421
56619
  return {
56422
56620
  x: round$3(waypoint.x - bbox.x - bbox.width / 2 + position.x),
@@ -56436,7 +56634,7 @@
56436
56634
  var cache = {};
56437
56635
 
56438
56636
  forEach$1(elements, function(element) {
56439
- if (isConnection$5(element)) {
56637
+ if (isConnection$4(element)) {
56440
56638
  cache[ element.id ] = isNumber(parentIndex) ?
56441
56639
  modeling.createConnection(
56442
56640
  cache[ element.source.id ],
@@ -56463,6 +56661,10 @@
56463
56661
  createShapeHints.autoResize = false;
56464
56662
  }
56465
56663
 
56664
+ if (isLabel$1(element)) {
56665
+ createShapeHints = omit(createShapeHints, [ 'attach' ]);
56666
+ }
56667
+
56466
56668
  cache[ element.id ] = isNumber(parentIndex) ?
56467
56669
  modeling.createShape(
56468
56670
  element,
@@ -56480,13 +56682,7 @@
56480
56682
  });
56481
56683
 
56482
56684
  context.elements = values(cache);
56483
- };
56484
-
56485
- // helpers //////////
56486
-
56487
- function isConnection$5(element) {
56488
- return !!element.waypoints;
56489
- }
56685
+ };
56490
56686
 
56491
56687
  /**
56492
56688
  * @typedef {import('../../../model/Types').Element} Element
@@ -56857,10 +57053,6 @@
56857
57053
  return shape;
56858
57054
  };
56859
57055
 
56860
- function isConnection$4(element) {
56861
- return element.waypoints;
56862
- }
56863
-
56864
57056
  /**
56865
57057
  * @typedef {import('../Modeling').default} Modeling
56866
57058
  */
@@ -57131,23 +57323,56 @@
57131
57323
  return connection;
57132
57324
  };
57133
57325
 
57326
+ /**
57327
+ * @typedef {import('../../../../model/Types').Connection} Connection
57328
+ * @typedef {import('../../../../model/Types').Element} Element
57329
+ * @typedef {import('../../../../model/Types').Shape} Shape
57330
+ */
57331
+
57134
57332
  function MoveClosure() {
57135
57333
 
57334
+ /**
57335
+ * @type {Record<string, Shape>}
57336
+ */
57136
57337
  this.allShapes = {};
57338
+
57339
+ /**
57340
+ * @type {Record<string, Connection>}
57341
+ */
57137
57342
  this.allConnections = {};
57138
57343
 
57344
+ /**
57345
+ * @type {Record<string, Element>}
57346
+ */
57139
57347
  this.enclosedElements = {};
57348
+
57349
+ /**
57350
+ * @type {Record<string, Connection>}
57351
+ */
57140
57352
  this.enclosedConnections = {};
57141
57353
 
57354
+ /**
57355
+ * @type {Record<string, Element>}
57356
+ */
57142
57357
  this.topLevel = {};
57143
57358
  }
57144
57359
 
57145
-
57360
+ /**
57361
+ * @param {Element} element
57362
+ * @param {boolean} [isTopLevel]
57363
+ *
57364
+ * @return {MoveClosure}
57365
+ */
57146
57366
  MoveClosure.prototype.add = function(element, isTopLevel) {
57147
57367
  return this.addAll([ element ], isTopLevel);
57148
57368
  };
57149
57369
 
57150
-
57370
+ /**
57371
+ * @param {Element[]} elements
57372
+ * @param {boolean} [isTopLevel]
57373
+ *
57374
+ * @return {MoveClosure}
57375
+ */
57151
57376
  MoveClosure.prototype.addAll = function(elements, isTopLevel) {
57152
57377
 
57153
57378
  var newClosure = getClosure(elements, !!isTopLevel, this);
@@ -59958,13 +60183,13 @@
59958
60183
  }
59959
60184
 
59960
60185
  forEach$1(elements, function(element) {
59961
- var assignedDi = isConnection$3(element) ? pick(di, [ 'border-color' ]) : di,
60186
+ var assignedDi = isConnection(element) ? pick(di, [ 'border-color' ]) : di,
59962
60187
  elementDi = getDi(element);
59963
60188
 
59964
60189
  // TODO @barmac: remove once we drop bpmn.io properties
59965
60190
  ensureLegacySupport(assignedDi);
59966
60191
 
59967
- if (isLabel$5(element)) {
60192
+ if (isLabel(element)) {
59968
60193
 
59969
60194
  // set label colors as bpmndi:BPMNLabel#color
59970
60195
  self._commandStack.execute('element.updateModdleProperties', {
@@ -60024,7 +60249,7 @@
60024
60249
  return /^#[0-9a-fA-F]{6}$/.test(context.fillStyle) ? context.fillStyle : null;
60025
60250
  }
60026
60251
 
60027
- function isConnection$3(element) {
60252
+ function isConnection(element) {
60028
60253
  return !!element.waypoints;
60029
60254
  }
60030
60255
 
@@ -60090,7 +60315,7 @@
60090
60315
  businessObject = element.businessObject,
60091
60316
  newLabel = ctx.newLabel;
60092
60317
 
60093
- if (!isLabel$5(element)
60318
+ if (!isLabel(element)
60094
60319
  && isLabelExternal(element)
60095
60320
  && !hasExternalLabel(element)
60096
60321
  && !isEmptyText(newLabel)) {
@@ -60130,11 +60355,11 @@
60130
60355
  hints = ctx.hints || {};
60131
60356
 
60132
60357
  // ignore internal labels for elements except text annotations
60133
- if (!isLabel$5(label) && !is$1(label, 'bpmn:TextAnnotation')) {
60358
+ if (!isLabel(label) && !is$1(label, 'bpmn:TextAnnotation')) {
60134
60359
  return;
60135
60360
  }
60136
60361
 
60137
- if (isLabel$5(label) && isEmptyText(newLabel)) {
60362
+ if (isLabel(label) && isEmptyText(newLabel)) {
60138
60363
 
60139
60364
  if (hints.removeShape !== false) {
60140
60365
  modeling.removeShape(label, { unsetLabel: false });
@@ -60781,7 +61006,6 @@
60781
61006
  * @param {Rect} target target rectangle
60782
61007
  * @param {Point} [start] source docking
60783
61008
  * @param {Point} [end] target docking
60784
- *
60785
61009
  * @param {Object} [hints]
60786
61010
  * @param {string} [hints.preserveDocking=source] preserve docking on selected side
60787
61011
  * @param {string[]} [hints.preferredLayouts]
@@ -60904,6 +61128,7 @@
60904
61128
  * @param {Point} start
60905
61129
  * @param {Point} end
60906
61130
  * @param {Object} [hints]
61131
+ * @param {string} [hints.preserveDocking]
60907
61132
  *
60908
61133
  * @return {Point[]|null} The waypoints or null if layout isn't possible.
60909
61134
  */
@@ -61119,12 +61344,13 @@
61119
61344
  *
61120
61345
  * @example
61121
61346
  *
61347
+ * ```javascript
61122
61348
  * getDirections('top'); // -> 'v:v'
61123
61349
  * getDirections('intersect'); // -> 't:t'
61124
61350
  *
61125
61351
  * getDirections('top-right', 'v:h'); // -> 'v:h'
61126
61352
  * getDirections('top-right', 'h:h'); // -> 'h:h'
61127
- *
61353
+ * ```
61128
61354
  *
61129
61355
  * @param {string} orientation
61130
61356
  * @param {string} defaultLayout
@@ -61955,7 +62181,7 @@
61955
62181
  * Start move.
61956
62182
  *
61957
62183
  * @param {MouseEvent|TouchEvent} event
61958
- * @param {Shape} shape
62184
+ * @param {Shape} element
61959
62185
  * @param {boolean} [activate]
61960
62186
  * @param {Object} [context]
61961
62187
  */
@@ -62242,7 +62468,7 @@
62242
62468
 
62243
62469
  var filteredElements = filter(elements, function(element) {
62244
62470
 
62245
- if (!isConnection$2(element)) {
62471
+ if (!isConnection$4(element)) {
62246
62472
  return true;
62247
62473
  } else {
62248
62474
 
@@ -62260,13 +62486,6 @@
62260
62486
  return size(groupBy(elements, function(e) { return e.parent && e.parent.id; })) !== 1;
62261
62487
  }
62262
62488
 
62263
- /**
62264
- * Checks if an element is a connection.
62265
- */
62266
- function isConnection$2(element) {
62267
- return element.waypoints;
62268
- }
62269
-
62270
62489
  /**
62271
62490
  * @type { import('didi').ModuleDeclaration }
62272
62491
  */
@@ -64356,7 +64575,7 @@
64356
64575
  }
64357
64576
 
64358
64577
  // handle connections
64359
- if (isConnection$1(snapTarget)) {
64578
+ if (isConnection$4(snapTarget)) {
64360
64579
 
64361
64580
  // ignore single segment connections
64362
64581
  if (snapTarget.waypoints.length < 3) {
@@ -64397,16 +64616,8 @@
64397
64616
 
64398
64617
  // helpers //////////
64399
64618
 
64400
- function isConnection$1(element) {
64401
- return !!element.waypoints;
64402
- }
64403
-
64404
64619
  function isHidden$1(element) {
64405
64620
  return !!element.hidden;
64406
- }
64407
-
64408
- function isLabel$1(element) {
64409
- return !!element.labelTarget;
64410
64621
  }
64411
64622
 
64412
64623
  /**
@@ -64779,9 +64990,9 @@
64779
64990
  ResizeSnapping.prototype.getSnapTargets = function(shape, target) {
64780
64991
  return getChildren(target).filter(function(child) {
64781
64992
  return !isAttached(child, shape)
64782
- && !isConnection(child)
64993
+ && !isConnection$4(child)
64783
64994
  && !isHidden(child)
64784
- && !isLabel(child);
64995
+ && !isLabel$1(child);
64785
64996
  });
64786
64997
  };
64787
64998
 
@@ -64815,18 +65026,10 @@
64815
65026
  return element.host === host;
64816
65027
  }
64817
65028
 
64818
- function isConnection(element) {
64819
- return !!element.waypoints;
64820
- }
64821
-
64822
65029
  function isHidden(element) {
64823
65030
  return !!element.hidden;
64824
65031
  }
64825
65032
 
64826
- function isLabel(element) {
64827
- return !!element.labelTarget;
64828
- }
64829
-
64830
65033
  function isHorizontal(direction) {
64831
65034
  return direction === 'n' || direction === 's';
64832
65035
  }