camunda-bpmn-js 3.2.0 → 3.3.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.
Files changed (36) hide show
  1. package/dist/assets/bpmn-font/css/bpmn.css +1 -0
  2. package/dist/assets/bpmn-js.css +1 -0
  3. package/dist/base-modeler.development.js +476 -585
  4. package/dist/base-modeler.production.min.js +31 -31
  5. package/dist/base-navigated-viewer.development.js +12 -139
  6. package/dist/base-navigated-viewer.production.min.js +1 -1
  7. package/dist/base-viewer.development.js +12 -139
  8. package/dist/base-viewer.production.min.js +1 -1
  9. package/dist/camunda-cloud-modeler.development.js +476 -585
  10. package/dist/camunda-cloud-modeler.production.min.js +32 -32
  11. package/dist/camunda-cloud-navigated-viewer.development.js +12 -139
  12. package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
  13. package/dist/camunda-cloud-viewer.development.js +12 -139
  14. package/dist/camunda-cloud-viewer.production.min.js +1 -1
  15. package/dist/camunda-platform-modeler.development.js +476 -585
  16. package/dist/camunda-platform-modeler.production.min.js +31 -31
  17. package/dist/camunda-platform-navigated-viewer.development.js +12 -139
  18. package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
  19. package/dist/camunda-platform-viewer.development.js +12 -139
  20. package/dist/camunda-platform-viewer.production.min.js +1 -1
  21. package/lib/base/Modeler.d.ts +15 -15
  22. package/lib/base/NavigatedViewer.d.ts +2 -2
  23. package/lib/base/Viewer.d.ts +2 -2
  24. package/lib/camunda-cloud/ElementTemplatesValidator.d.ts +1 -1
  25. package/lib/camunda-cloud/Modeler.d.ts +3 -3
  26. package/lib/camunda-cloud/NavigatedViewer.d.ts +3 -3
  27. package/lib/camunda-cloud/Viewer.d.ts +3 -3
  28. package/lib/camunda-cloud/features/rules/BpmnRules.d.ts +32 -32
  29. package/lib/camunda-cloud/features/rules/index.d.ts +6 -6
  30. package/lib/camunda-cloud/util/commonModules.d.ts +9 -9
  31. package/lib/camunda-platform/Modeler.d.ts +3 -3
  32. package/lib/camunda-platform/NavigatedViewer.d.ts +5 -5
  33. package/lib/camunda-platform/Viewer.d.ts +5 -5
  34. package/lib/camunda-platform/util/commonModules.d.ts +9 -9
  35. package/lib/util/ExtensionElementsUtil.d.ts +24 -24
  36. package/package.json +3 -3
@@ -2651,15 +2651,14 @@
2651
2651
  *
2652
2652
  * @param {Seed} seed
2653
2653
  */
2654
-
2655
2654
  function Ids(seed) {
2656
2655
  if (!(this instanceof Ids)) {
2657
2656
  return new Ids(seed);
2658
2657
  }
2659
-
2660
2658
  seed = seed || [128, 36, 1];
2661
2659
  this._seed = seed.length ? hat_1.rack(seed[0], seed[1], seed[2]) : seed;
2662
2660
  }
2661
+
2663
2662
  /**
2664
2663
  * Generate a next id.
2665
2664
  *
@@ -2667,10 +2666,10 @@
2667
2666
  *
2668
2667
  * @return {String} id
2669
2668
  */
2670
-
2671
2669
  Ids.prototype.next = function (element) {
2672
2670
  return this._seed(element || true);
2673
2671
  };
2672
+
2674
2673
  /**
2675
2674
  * Generate a next id with a given prefix.
2676
2675
  *
@@ -2678,61 +2677,54 @@
2678
2677
  *
2679
2678
  * @return {String} id
2680
2679
  */
2681
-
2682
-
2683
2680
  Ids.prototype.nextPrefixed = function (prefix, element) {
2684
2681
  var id;
2685
-
2686
2682
  do {
2687
2683
  id = prefix + this.next(true);
2688
- } while (this.assigned(id)); // claim {prefix}{random}
2689
-
2684
+ } while (this.assigned(id));
2690
2685
 
2691
- this.claim(id, element); // return
2686
+ // claim {prefix}{random}
2687
+ this.claim(id, element);
2692
2688
 
2689
+ // return
2693
2690
  return id;
2694
2691
  };
2692
+
2695
2693
  /**
2696
2694
  * Manually claim an existing id.
2697
2695
  *
2698
2696
  * @param {String} id
2699
2697
  * @param {String} [element] element the id is claimed by
2700
2698
  */
2701
-
2702
-
2703
2699
  Ids.prototype.claim = function (id, element) {
2704
2700
  this._seed.set(id, element || true);
2705
2701
  };
2702
+
2706
2703
  /**
2707
2704
  * Returns true if the given id has already been assigned.
2708
2705
  *
2709
2706
  * @param {String} id
2710
2707
  * @return {Boolean}
2711
2708
  */
2712
-
2713
-
2714
2709
  Ids.prototype.assigned = function (id) {
2715
2710
  return this._seed.get(id) || false;
2716
2711
  };
2712
+
2717
2713
  /**
2718
2714
  * Unclaim an id.
2719
2715
  *
2720
2716
  * @param {String} id the id to unclaim
2721
2717
  */
2722
-
2723
-
2724
2718
  Ids.prototype.unclaim = function (id) {
2725
2719
  delete this._seed.hats[id];
2726
2720
  };
2721
+
2727
2722
  /**
2728
2723
  * Clear all claimed ids.
2729
2724
  */
2730
-
2731
-
2732
2725
  Ids.prototype.clear = function () {
2733
2726
  var hats = this._seed.hats,
2734
- id;
2735
-
2727
+ id;
2736
2728
  for (id in hats) {
2737
2729
  this.unclaim(id);
2738
2730
  }
@@ -21186,62 +21178,6 @@
21186
21178
  * @typedef {import('../model/Types').ModdleElement} ModdleElement
21187
21179
  */
21188
21180
 
21189
- // TODO(nikku): remove with future bpmn-js version
21190
-
21191
- /**
21192
- * Wraps APIs to check:
21193
- *
21194
- * 1) If a callback is passed -> Warn users about callback deprecation.
21195
- * 2) If Promise class is implemented in current environment.
21196
- *
21197
- * @private
21198
- *
21199
- * @param {Function} api
21200
- *
21201
- * @return {Function}
21202
- */
21203
- function wrapForCompatibility(api) {
21204
-
21205
- return function() {
21206
-
21207
- if (!window.Promise) {
21208
- throw new Error('Promises is not supported in this environment. Please polyfill Promise.');
21209
- }
21210
-
21211
- var argLen = arguments.length;
21212
- if (argLen >= 1 && isFunction(arguments[argLen - 1])) {
21213
-
21214
- var callback = arguments[argLen - 1];
21215
-
21216
- console.warn(new Error(
21217
- 'Passing callbacks to ' + api.name + ' is deprecated and will be removed in a future major release. ' +
21218
- 'Please switch to promises: https://bpmn.io/l/moving-to-promises.html'
21219
- ));
21220
-
21221
- var argsWithoutCallback = Array.prototype.slice.call(arguments, 0, -1);
21222
-
21223
- api.apply(this, argsWithoutCallback).then(function(result) {
21224
-
21225
- var firstKey = Object.keys(result)[0];
21226
-
21227
- // The APIs we are wrapping all resolve a single item depending on the API.
21228
- // For instance, importXML resolves { warnings } and saveXML returns { xml }.
21229
- // That's why we can call the callback with the first item of result.
21230
- return callback(null, result[firstKey]);
21231
-
21232
- // Passing a second paramter instead of catch because we don't want to
21233
- // catch errors thrown by callback().
21234
- }, function(err) {
21235
-
21236
- return callback(err, err.warnings);
21237
- });
21238
- } else {
21239
-
21240
- return api.apply(this, arguments);
21241
- }
21242
- };
21243
- }
21244
-
21245
21181
 
21246
21182
  // TODO(nikku): remove with future bpmn-js version
21247
21183
 
@@ -22183,28 +22119,7 @@
22183
22119
  const self = this;
22184
22120
 
22185
22121
  function ParseCompleteEvent(data) {
22186
-
22187
- const event = self.get('eventBus').createEvent(data);
22188
-
22189
- // TODO(nikku): remove with future bpmn-js version
22190
- Object.defineProperty(event, 'context', {
22191
- enumerable: true,
22192
- get: function() {
22193
-
22194
- console.warn(new Error(
22195
- 'import.parse.complete <context> is deprecated ' +
22196
- 'and will be removed in future library versions'
22197
- ));
22198
-
22199
- return {
22200
- warnings: data.warnings,
22201
- references: data.references,
22202
- elementsById: data.elementsById
22203
- };
22204
- }
22205
- });
22206
-
22207
- return event;
22122
+ return self.get('eventBus').createEvent(data);
22208
22123
  }
22209
22124
 
22210
22125
  let aggregatedWarnings = [];
@@ -22282,8 +22197,6 @@
22282
22197
  }
22283
22198
  };
22284
22199
 
22285
- BaseViewer.prototype.importXML = wrapForCompatibility(BaseViewer.prototype.importXML);
22286
-
22287
22200
 
22288
22201
  /**
22289
22202
  * Import parsed definitions and render a BPMN 2.0 diagram.
@@ -22314,8 +22227,6 @@
22314
22227
  return { warnings: result.warnings };
22315
22228
  };
22316
22229
 
22317
- BaseViewer.prototype.importDefinitions = wrapForCompatibility(BaseViewer.prototype.importDefinitions);
22318
-
22319
22230
 
22320
22231
  /**
22321
22232
  * Open diagram of previously imported XML.
@@ -22377,8 +22288,6 @@
22377
22288
  return { warnings };
22378
22289
  };
22379
22290
 
22380
- BaseViewer.prototype.open = wrapForCompatibility(BaseViewer.prototype.open);
22381
-
22382
22291
  /**
22383
22292
  * Export the currently displayed BPMN 2.0 diagram as
22384
22293
  * a BPMN 2.0 XML document.
@@ -22453,8 +22362,6 @@
22453
22362
  return result;
22454
22363
  };
22455
22364
 
22456
- BaseViewer.prototype.saveXML = wrapForCompatibility(BaseViewer.prototype.saveXML);
22457
-
22458
22365
 
22459
22366
  /**
22460
22367
  * Export the currently displayed BPMN 2.0 diagram as
@@ -22522,40 +22429,6 @@
22522
22429
  return { svg };
22523
22430
  };
22524
22431
 
22525
- BaseViewer.prototype.saveSVG = wrapForCompatibility(BaseViewer.prototype.saveSVG);
22526
-
22527
- /**
22528
- * Get a named diagram service.
22529
- *
22530
- * @example
22531
- *
22532
- * const elementRegistry = viewer.get('elementRegistry');
22533
- * const startEventShape = elementRegistry.get('StartEvent_1');
22534
- *
22535
- * @param {string} name
22536
- *
22537
- * @return {Object} diagram service instance
22538
- *
22539
- * @method BaseViewer#get
22540
- */
22541
-
22542
- /**
22543
- * Invoke a function in the context of this viewer.
22544
- *
22545
- * @example
22546
- *
22547
- * viewer.invoke(function(elementRegistry) {
22548
- * const startEventShape = elementRegistry.get('StartEvent_1');
22549
- * });
22550
- *
22551
- * @param {Function} fn to be invoked
22552
- *
22553
- * @return {Object} the functions return value
22554
- *
22555
- * @method BaseViewer#invoke
22556
- */
22557
-
22558
-
22559
22432
  BaseViewer.prototype._setDefinitions = function(definitions) {
22560
22433
  this._definitions = definitions;
22561
22434
  };