camunda-bpmn-js 3.1.2 → 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 (38) 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/assets/element-templates.css +18 -1
  4. package/dist/base-modeler.development.js +484 -588
  5. package/dist/base-modeler.production.min.js +31 -31
  6. package/dist/base-navigated-viewer.development.js +20 -142
  7. package/dist/base-navigated-viewer.production.min.js +1 -1
  8. package/dist/base-viewer.development.js +20 -142
  9. package/dist/base-viewer.production.min.js +1 -1
  10. package/dist/camunda-cloud-modeler.development.js +66038 -46951
  11. package/dist/camunda-cloud-modeler.production.min.js +40 -40
  12. package/dist/camunda-cloud-navigated-viewer.development.js +31 -142
  13. package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
  14. package/dist/camunda-cloud-viewer.development.js +31 -142
  15. package/dist/camunda-cloud-viewer.production.min.js +1 -1
  16. package/dist/camunda-platform-modeler.development.js +574 -600
  17. package/dist/camunda-platform-modeler.production.min.js +31 -31
  18. package/dist/camunda-platform-navigated-viewer.development.js +20 -142
  19. package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
  20. package/dist/camunda-platform-viewer.development.js +20 -142
  21. package/dist/camunda-platform-viewer.production.min.js +1 -1
  22. package/lib/base/Modeler.d.ts +15 -15
  23. package/lib/base/NavigatedViewer.d.ts +2 -2
  24. package/lib/base/Viewer.d.ts +2 -2
  25. package/lib/camunda-cloud/ElementTemplatesValidator.d.ts +1 -1
  26. package/lib/camunda-cloud/Modeler.d.ts +3 -3
  27. package/lib/camunda-cloud/Modeler.js +3 -1
  28. package/lib/camunda-cloud/NavigatedViewer.d.ts +3 -3
  29. package/lib/camunda-cloud/Viewer.d.ts +3 -3
  30. package/lib/camunda-cloud/features/rules/BpmnRules.d.ts +32 -32
  31. package/lib/camunda-cloud/features/rules/index.d.ts +6 -6
  32. package/lib/camunda-cloud/util/commonModules.d.ts +9 -9
  33. package/lib/camunda-platform/Modeler.d.ts +3 -3
  34. package/lib/camunda-platform/NavigatedViewer.d.ts +5 -5
  35. package/lib/camunda-platform/Viewer.d.ts +5 -5
  36. package/lib/camunda-platform/util/commonModules.d.ts +9 -9
  37. package/lib/util/ExtensionElementsUtil.d.ts +24 -24
  38. package/package.json +9 -7
@@ -2662,15 +2662,14 @@
2662
2662
  *
2663
2663
  * @param {Seed} seed
2664
2664
  */
2665
-
2666
2665
  function Ids(seed) {
2667
2666
  if (!(this instanceof Ids)) {
2668
2667
  return new Ids(seed);
2669
2668
  }
2670
-
2671
2669
  seed = seed || [128, 36, 1];
2672
2670
  this._seed = seed.length ? hat_1.rack(seed[0], seed[1], seed[2]) : seed;
2673
2671
  }
2672
+
2674
2673
  /**
2675
2674
  * Generate a next id.
2676
2675
  *
@@ -2678,10 +2677,10 @@
2678
2677
  *
2679
2678
  * @return {String} id
2680
2679
  */
2681
-
2682
2680
  Ids.prototype.next = function (element) {
2683
2681
  return this._seed(element || true);
2684
2682
  };
2683
+
2685
2684
  /**
2686
2685
  * Generate a next id with a given prefix.
2687
2686
  *
@@ -2689,61 +2688,54 @@
2689
2688
  *
2690
2689
  * @return {String} id
2691
2690
  */
2692
-
2693
-
2694
2691
  Ids.prototype.nextPrefixed = function (prefix, element) {
2695
2692
  var id;
2696
-
2697
2693
  do {
2698
2694
  id = prefix + this.next(true);
2699
- } while (this.assigned(id)); // claim {prefix}{random}
2700
-
2695
+ } while (this.assigned(id));
2701
2696
 
2702
- this.claim(id, element); // return
2697
+ // claim {prefix}{random}
2698
+ this.claim(id, element);
2703
2699
 
2700
+ // return
2704
2701
  return id;
2705
2702
  };
2703
+
2706
2704
  /**
2707
2705
  * Manually claim an existing id.
2708
2706
  *
2709
2707
  * @param {String} id
2710
2708
  * @param {String} [element] element the id is claimed by
2711
2709
  */
2712
-
2713
-
2714
2710
  Ids.prototype.claim = function (id, element) {
2715
2711
  this._seed.set(id, element || true);
2716
2712
  };
2713
+
2717
2714
  /**
2718
2715
  * Returns true if the given id has already been assigned.
2719
2716
  *
2720
2717
  * @param {String} id
2721
2718
  * @return {Boolean}
2722
2719
  */
2723
-
2724
-
2725
2720
  Ids.prototype.assigned = function (id) {
2726
2721
  return this._seed.get(id) || false;
2727
2722
  };
2723
+
2728
2724
  /**
2729
2725
  * Unclaim an id.
2730
2726
  *
2731
2727
  * @param {String} id the id to unclaim
2732
2728
  */
2733
-
2734
-
2735
2729
  Ids.prototype.unclaim = function (id) {
2736
2730
  delete this._seed.hats[id];
2737
2731
  };
2732
+
2738
2733
  /**
2739
2734
  * Clear all claimed ids.
2740
2735
  */
2741
-
2742
-
2743
2736
  Ids.prototype.clear = function () {
2744
2737
  var hats = this._seed.hats,
2745
- id;
2746
-
2738
+ id;
2747
2739
  for (id in hats) {
2748
2740
  this.unclaim(id);
2749
2741
  }
@@ -10312,9 +10304,9 @@
10312
10304
 
10313
10305
  const viewport = this._viewport = createGroup(svg, 'viewport');
10314
10306
 
10315
- // debounce canvas.viewbox.changed events
10316
- // for smoother diagram interaction
10317
- if (config.deferUpdate !== false) {
10307
+ // debounce canvas.viewbox.changed events when deferUpdate is set
10308
+ // to help with potential performance issues
10309
+ if (config.deferUpdate) {
10318
10310
  this._viewboxChanged = debounce(bind$2(this._viewboxChanged, this), 300);
10319
10311
  }
10320
10312
 
@@ -11338,6 +11330,11 @@
11338
11330
  this.setRootElement(rootElement);
11339
11331
  }
11340
11332
 
11333
+ // element is rootElement, do not change viewport
11334
+ if (rootElement === element) {
11335
+ return;
11336
+ }
11337
+
11341
11338
  if (!padding) {
11342
11339
  padding = {};
11343
11340
  }
@@ -21213,62 +21210,6 @@
21213
21210
  * @typedef {import('../model/Types').ModdleElement} ModdleElement
21214
21211
  */
21215
21212
 
21216
- // TODO(nikku): remove with future bpmn-js version
21217
-
21218
- /**
21219
- * Wraps APIs to check:
21220
- *
21221
- * 1) If a callback is passed -> Warn users about callback deprecation.
21222
- * 2) If Promise class is implemented in current environment.
21223
- *
21224
- * @private
21225
- *
21226
- * @param {Function} api
21227
- *
21228
- * @return {Function}
21229
- */
21230
- function wrapForCompatibility(api) {
21231
-
21232
- return function() {
21233
-
21234
- if (!window.Promise) {
21235
- throw new Error('Promises is not supported in this environment. Please polyfill Promise.');
21236
- }
21237
-
21238
- var argLen = arguments.length;
21239
- if (argLen >= 1 && isFunction(arguments[argLen - 1])) {
21240
-
21241
- var callback = arguments[argLen - 1];
21242
-
21243
- console.warn(new Error(
21244
- 'Passing callbacks to ' + api.name + ' is deprecated and will be removed in a future major release. ' +
21245
- 'Please switch to promises: https://bpmn.io/l/moving-to-promises.html'
21246
- ));
21247
-
21248
- var argsWithoutCallback = Array.prototype.slice.call(arguments, 0, -1);
21249
-
21250
- api.apply(this, argsWithoutCallback).then(function(result) {
21251
-
21252
- var firstKey = Object.keys(result)[0];
21253
-
21254
- // The APIs we are wrapping all resolve a single item depending on the API.
21255
- // For instance, importXML resolves { warnings } and saveXML returns { xml }.
21256
- // That's why we can call the callback with the first item of result.
21257
- return callback(null, result[firstKey]);
21258
-
21259
- // Passing a second paramter instead of catch because we don't want to
21260
- // catch errors thrown by callback().
21261
- }, function(err) {
21262
-
21263
- return callback(err, err.warnings);
21264
- });
21265
- } else {
21266
-
21267
- return api.apply(this, arguments);
21268
- }
21269
- };
21270
- }
21271
-
21272
21213
 
21273
21214
  // TODO(nikku): remove with future bpmn-js version
21274
21215
 
@@ -22210,28 +22151,7 @@
22210
22151
  const self = this;
22211
22152
 
22212
22153
  function ParseCompleteEvent(data) {
22213
-
22214
- const event = self.get('eventBus').createEvent(data);
22215
-
22216
- // TODO(nikku): remove with future bpmn-js version
22217
- Object.defineProperty(event, 'context', {
22218
- enumerable: true,
22219
- get: function() {
22220
-
22221
- console.warn(new Error(
22222
- 'import.parse.complete <context> is deprecated ' +
22223
- 'and will be removed in future library versions'
22224
- ));
22225
-
22226
- return {
22227
- warnings: data.warnings,
22228
- references: data.references,
22229
- elementsById: data.elementsById
22230
- };
22231
- }
22232
- });
22233
-
22234
- return event;
22154
+ return self.get('eventBus').createEvent(data);
22235
22155
  }
22236
22156
 
22237
22157
  let aggregatedWarnings = [];
@@ -22309,8 +22229,6 @@
22309
22229
  }
22310
22230
  };
22311
22231
 
22312
- BaseViewer.prototype.importXML = wrapForCompatibility(BaseViewer.prototype.importXML);
22313
-
22314
22232
 
22315
22233
  /**
22316
22234
  * Import parsed definitions and render a BPMN 2.0 diagram.
@@ -22341,8 +22259,6 @@
22341
22259
  return { warnings: result.warnings };
22342
22260
  };
22343
22261
 
22344
- BaseViewer.prototype.importDefinitions = wrapForCompatibility(BaseViewer.prototype.importDefinitions);
22345
-
22346
22262
 
22347
22263
  /**
22348
22264
  * Open diagram of previously imported XML.
@@ -22404,8 +22320,6 @@
22404
22320
  return { warnings };
22405
22321
  };
22406
22322
 
22407
- BaseViewer.prototype.open = wrapForCompatibility(BaseViewer.prototype.open);
22408
-
22409
22323
  /**
22410
22324
  * Export the currently displayed BPMN 2.0 diagram as
22411
22325
  * a BPMN 2.0 XML document.
@@ -22480,8 +22394,6 @@
22480
22394
  return result;
22481
22395
  };
22482
22396
 
22483
- BaseViewer.prototype.saveXML = wrapForCompatibility(BaseViewer.prototype.saveXML);
22484
-
22485
22397
 
22486
22398
  /**
22487
22399
  * Export the currently displayed BPMN 2.0 diagram as
@@ -22549,40 +22461,6 @@
22549
22461
  return { svg };
22550
22462
  };
22551
22463
 
22552
- BaseViewer.prototype.saveSVG = wrapForCompatibility(BaseViewer.prototype.saveSVG);
22553
-
22554
- /**
22555
- * Get a named diagram service.
22556
- *
22557
- * @example
22558
- *
22559
- * const elementRegistry = viewer.get('elementRegistry');
22560
- * const startEventShape = elementRegistry.get('StartEvent_1');
22561
- *
22562
- * @param {string} name
22563
- *
22564
- * @return {Object} diagram service instance
22565
- *
22566
- * @method BaseViewer#get
22567
- */
22568
-
22569
- /**
22570
- * Invoke a function in the context of this viewer.
22571
- *
22572
- * @example
22573
- *
22574
- * viewer.invoke(function(elementRegistry) {
22575
- * const startEventShape = elementRegistry.get('StartEvent_1');
22576
- * });
22577
- *
22578
- * @param {Function} fn to be invoked
22579
- *
22580
- * @return {Object} the functions return value
22581
- *
22582
- * @method BaseViewer#invoke
22583
- */
22584
-
22585
-
22586
22464
  BaseViewer.prototype._setDefinitions = function(definitions) {
22587
22465
  this._definitions = definitions;
22588
22466
  };
@@ -24387,6 +24265,12 @@
24387
24265
  name: "propagateAllChildVariables",
24388
24266
  isAttr: true,
24389
24267
  type: "Boolean"
24268
+ },
24269
+ {
24270
+ name: "propagateAllParentVariables",
24271
+ isAttr: true,
24272
+ type: "Boolean",
24273
+ "default": true
24390
24274
  }
24391
24275
  ]
24392
24276
  },
@@ -24428,6 +24312,11 @@
24428
24312
  name: "formKey",
24429
24313
  type: "String",
24430
24314
  isAttr: true
24315
+ },
24316
+ {
24317
+ name: "formId",
24318
+ type: "String",
24319
+ isAttr: true
24431
24320
  }
24432
24321
  ]
24433
24322
  },