bpmn-js 16.0.0 → 16.1.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-navigated-viewer v16.0.0
2
+ * bpmn-js - bpmn-navigated-viewer v16.1.0
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2023-12-11
11
+ * Date: 2023-12-14
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -6176,10 +6176,6 @@
6176
6176
  translate: [ 'value', translate ]
6177
6177
  };
6178
6178
 
6179
- function getDefaultExportFromCjs (x) {
6180
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6181
- }
6182
-
6183
6179
  /**
6184
6180
  * @param {Point} point
6185
6181
  *
@@ -12359,32 +12355,17 @@
12359
12355
  }
12360
12356
  };
12361
12357
 
12362
- var objectRefs = {exports: {}};
12363
-
12364
- var collection = {};
12365
-
12366
- /**
12367
- * An empty collection stub. Use {@link RefsCollection.extend} to extend a
12368
- * collection with ref semantics.
12369
- *
12370
- * @class RefsCollection
12371
- */
12372
-
12373
12358
  /**
12374
12359
  * Extends a collection with {@link Refs} aware methods
12375
12360
  *
12376
- * @memberof RefsCollection
12377
- * @static
12378
- *
12379
- * @param {Array<Object>} collection
12380
- * @param {Refs} refs instance
12381
- * @param {Object} property represented by the collection
12382
- * @param {Object} target object the collection is attached to
12361
+ * @param {Array<Object>} collection
12362
+ * @param {Refs} refs instance
12363
+ * @param {Object} property represented by the collection
12364
+ * @param {Object} target object the collection is attached to
12383
12365
  *
12384
12366
  * @return {RefsCollection<Object>} the extended array
12385
12367
  */
12386
12368
  function extend(collection, refs, property, target) {
12387
-
12388
12369
  var inverseProperty = property.inverse;
12389
12370
 
12390
12371
  /**
@@ -12395,7 +12376,7 @@
12395
12376
  * @param {Object} element the element to remove
12396
12377
  */
12397
12378
  Object.defineProperty(collection, 'remove', {
12398
- value: function(element) {
12379
+ value: function (element) {
12399
12380
  var idx = this.indexOf(element);
12400
12381
  if (idx !== -1) {
12401
12382
  this.splice(idx, 1);
@@ -12403,7 +12384,6 @@
12403
12384
  // unset inverse
12404
12385
  refs.unset(element, inverseProperty, target);
12405
12386
  }
12406
-
12407
12387
  return element;
12408
12388
  }
12409
12389
  });
@@ -12416,7 +12396,7 @@
12416
12396
  * @param {Object} element the element to check for
12417
12397
  */
12418
12398
  Object.defineProperty(collection, 'contains', {
12419
- value: function(element) {
12399
+ value: function (element) {
12420
12400
  return this.indexOf(element) !== -1;
12421
12401
  }
12422
12402
  });
@@ -12431,12 +12411,9 @@
12431
12411
  * (possibly moving other elements around)
12432
12412
  */
12433
12413
  Object.defineProperty(collection, 'add', {
12434
- value: function(element, idx) {
12435
-
12414
+ value: function (element, idx) {
12436
12415
  var currentIdx = this.indexOf(element);
12437
-
12438
12416
  if (typeof idx === 'undefined') {
12439
-
12440
12417
  if (currentIdx !== -1) {
12441
12418
  // element already in collection (!)
12442
12419
  return;
@@ -12448,14 +12425,12 @@
12448
12425
 
12449
12426
  // handle already in collection
12450
12427
  if (currentIdx !== -1) {
12451
-
12452
12428
  // remove element from currentIdx
12453
12429
  this.splice(currentIdx, 1);
12454
12430
  }
12455
12431
 
12456
12432
  // add element at idx
12457
12433
  this.splice(idx, 0, element);
12458
-
12459
12434
  if (currentIdx === -1) {
12460
12435
  // set inverse, unless element was
12461
12436
  // in collection already
@@ -12469,69 +12444,53 @@
12469
12444
  Object.defineProperty(collection, '__refs_collection', {
12470
12445
  value: true
12471
12446
  });
12472
-
12473
12447
  return collection;
12474
12448
  }
12475
12449
 
12476
-
12450
+ /**
12451
+ * Checks if a given collection is extended
12452
+ *
12453
+ * @param {Array<Object>} collection
12454
+ *
12455
+ * @return {boolean}
12456
+ */
12477
12457
  function isExtended(collection) {
12478
12458
  return collection.__refs_collection === true;
12479
12459
  }
12480
12460
 
12481
- collection.extend = extend;
12482
-
12483
- collection.isExtended = isExtended;
12484
-
12485
- var Collection = collection;
12486
-
12487
12461
  function hasOwnProperty$1(e, property) {
12488
12462
  return Object.prototype.hasOwnProperty.call(e, property.name || property);
12489
12463
  }
12490
-
12491
12464
  function defineCollectionProperty(ref, property, target) {
12492
-
12493
- var collection = Collection.extend(target[property.name] || [], ref, property, target);
12494
-
12465
+ var collection = extend(target[property.name] || [], ref, property, target);
12495
12466
  Object.defineProperty(target, property.name, {
12496
12467
  enumerable: property.enumerable,
12497
12468
  value: collection
12498
12469
  });
12499
-
12500
12470
  if (collection.length) {
12501
-
12502
- collection.forEach(function(o) {
12471
+ collection.forEach(function (o) {
12503
12472
  ref.set(o, property.inverse, target);
12504
12473
  });
12505
12474
  }
12506
12475
  }
12507
-
12508
-
12509
12476
  function defineProperty$1(ref, property, target) {
12510
-
12511
12477
  var inverseProperty = property.inverse;
12512
-
12513
12478
  var _value = target[property.name];
12514
-
12515
12479
  Object.defineProperty(target, property.name, {
12516
12480
  configurable: property.configurable,
12517
12481
  enumerable: property.enumerable,
12518
-
12519
- get: function() {
12482
+ get: function () {
12520
12483
  return _value;
12521
12484
  },
12522
-
12523
- set: function(value) {
12524
-
12485
+ set: function (value) {
12525
12486
  // return if we already performed all changes
12526
12487
  if (value === _value) {
12527
12488
  return;
12528
12489
  }
12529
-
12530
12490
  var old = _value;
12531
12491
 
12532
12492
  // temporary set null
12533
12493
  _value = null;
12534
-
12535
12494
  if (old) {
12536
12495
  ref.unset(old, inverseProperty, target);
12537
12496
  }
@@ -12543,7 +12502,6 @@
12543
12502
  ref.set(_value, inverseProperty, target);
12544
12503
  }
12545
12504
  });
12546
-
12547
12505
  }
12548
12506
 
12549
12507
  /**
@@ -12589,16 +12547,14 @@
12589
12547
  *
12590
12548
  * wheels[0].car // undefined
12591
12549
  */
12592
- function Refs$1(a, b) {
12593
-
12594
- if (!(this instanceof Refs$1)) {
12595
- return new Refs$1(a, b);
12550
+ function Refs(a, b) {
12551
+ if (!(this instanceof Refs)) {
12552
+ return new Refs(a, b);
12596
12553
  }
12597
12554
 
12598
12555
  // link
12599
12556
  a.inverse = b;
12600
12557
  b.inverse = a;
12601
-
12602
12558
  this.props = {};
12603
12559
  this.props[a.name] = a;
12604
12560
  this.props[b.name] = b;
@@ -12613,43 +12569,34 @@
12613
12569
  * @param {Object} target
12614
12570
  * @param {String} property
12615
12571
  */
12616
- Refs$1.prototype.bind = function(target, property) {
12572
+ Refs.prototype.bind = function (target, property) {
12617
12573
  if (typeof property === 'string') {
12618
12574
  if (!this.props[property]) {
12619
12575
  throw new Error('no property <' + property + '> in ref');
12620
12576
  }
12621
12577
  property = this.props[property];
12622
12578
  }
12623
-
12624
12579
  if (property.collection) {
12625
12580
  defineCollectionProperty(this, property, target);
12626
12581
  } else {
12627
12582
  defineProperty$1(this, property, target);
12628
12583
  }
12629
12584
  };
12630
-
12631
- Refs$1.prototype.ensureRefsCollection = function(target, property) {
12632
-
12585
+ Refs.prototype.ensureRefsCollection = function (target, property) {
12633
12586
  var collection = target[property.name];
12634
-
12635
- if (!Collection.isExtended(collection)) {
12587
+ if (!isExtended(collection)) {
12636
12588
  defineCollectionProperty(this, property, target);
12637
12589
  }
12638
-
12639
12590
  return collection;
12640
12591
  };
12641
-
12642
- Refs$1.prototype.ensureBound = function(target, property) {
12592
+ Refs.prototype.ensureBound = function (target, property) {
12643
12593
  if (!hasOwnProperty$1(target, property)) {
12644
12594
  this.bind(target, property);
12645
12595
  }
12646
12596
  };
12647
-
12648
- Refs$1.prototype.unset = function(target, property, value) {
12649
-
12597
+ Refs.prototype.unset = function (target, property, value) {
12650
12598
  if (target) {
12651
12599
  this.ensureBound(target, property);
12652
-
12653
12600
  if (property.collection) {
12654
12601
  this.ensureRefsCollection(target, property).remove(value);
12655
12602
  } else {
@@ -12657,12 +12604,9 @@
12657
12604
  }
12658
12605
  }
12659
12606
  };
12660
-
12661
- Refs$1.prototype.set = function(target, property, value) {
12662
-
12607
+ Refs.prototype.set = function (target, property, value) {
12663
12608
  if (target) {
12664
12609
  this.ensureBound(target, property);
12665
-
12666
12610
  if (property.collection) {
12667
12611
  this.ensureRefsCollection(target, property).add(value);
12668
12612
  } else {
@@ -12671,15 +12615,6 @@
12671
12615
  }
12672
12616
  };
12673
12617
 
12674
- var refs = Refs$1;
12675
-
12676
- objectRefs.exports = refs;
12677
-
12678
- objectRefs.exports.Collection = collection;
12679
-
12680
- var objectRefsExports = objectRefs.exports;
12681
- var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
12682
-
12683
12618
  var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
12684
12619
  labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
12685
12620
  attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),