bpmn-js 3.4.0 → 3.5.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.
package/lib/Viewer.js CHANGED
@@ -212,9 +212,7 @@ Viewer.prototype.importXML = function(xml, bpmnDiagram, done) {
212
212
  return done(err, parseWarnings);
213
213
  }
214
214
 
215
- self._setDefinitions(definitions);
216
-
217
- self.open(bpmnDiagram, function(err, importWarnings) {
215
+ self.importDefinitions(definitions, bpmnDiagram, function(err, importWarnings) {
218
216
  var allWarnings = [].concat(parseWarnings, importWarnings || []);
219
217
 
220
218
  self._emit('import.done', { error: err, warnings: allWarnings });
@@ -224,6 +222,40 @@ Viewer.prototype.importXML = function(xml, bpmnDiagram, done) {
224
222
  });
225
223
  };
226
224
 
225
+ /**
226
+ * Import parsed definitions and render a BPMN 2.0 diagram.
227
+ *
228
+ * Once finished the viewer reports back the result to the
229
+ * provided callback function with (err, warnings).
230
+ *
231
+ * ## Life-Cycle Events
232
+ *
233
+ * During import the viewer will fire life-cycle events:
234
+ *
235
+ * * import.render.start (graphical import start)
236
+ * * import.render.complete (graphical import finished)
237
+ *
238
+ * You can use these events to hook into the life-cycle.
239
+ *
240
+ * @param {ModdleElement<Definitions>} definitions parsed BPMN 2.0 definitions
241
+ * @param {ModdleElement<BPMNDiagram>|String} [bpmnDiagram] BPMN diagram or id of diagram to render (if not provided, the first one will be rendered)
242
+ * @param {Function} [done] invoked with (err, warnings=[])
243
+ */
244
+ Viewer.prototype.importDefinitions = function(definitions, bpmnDiagram, done) {
245
+
246
+ if (isFunction(bpmnDiagram)) {
247
+ done = bpmnDiagram;
248
+ bpmnDiagram = null;
249
+ }
250
+
251
+ // done is optional
252
+ done = done || function() {};
253
+
254
+ this._setDefinitions(definitions);
255
+
256
+ return this.open(bpmnDiagram, done);
257
+ };
258
+
227
259
  /**
228
260
  * Open diagram of previously imported XML.
229
261
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmn-js",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "A bpmn 2.0 toolkit and web modeler",
5
5
  "scripts": {
6
6
  "all": "run-s lint test distro test:distro",
@@ -43,12 +43,12 @@
43
43
  "chai-match": "^1.1.1",
44
44
  "cpx": "^1.5.0",
45
45
  "del": "^3.0.0",
46
- "eslint": "^5.7.0",
47
- "eslint-plugin-bpmn-io": "^0.6.0",
48
- "eslint-plugin-import": "^2.14.0",
46
+ "eslint": "^5.16.0",
47
+ "eslint-plugin-bpmn-io": "^0.6.1",
48
+ "eslint-plugin-import": "^2.17.2",
49
49
  "execa": "^1.0.0",
50
50
  "istanbul-instrumenter-loader": "^3.0.1",
51
- "karma": "^3.1.1",
51
+ "karma": "^3.1.4",
52
52
  "karma-chrome-launcher": "^2.1.1",
53
53
  "karma-coverage": "^1.1.2",
54
54
  "karma-env-preprocessor": "^0.1.1",
@@ -67,25 +67,25 @@
67
67
  "puppeteer": "^1.14.0",
68
68
  "raw-loader": "^0.5.1",
69
69
  "rollup": "^0.66.6",
70
- "rollup-plugin-commonjs": "^9.1.0",
70
+ "rollup-plugin-commonjs": "^9.3.4",
71
71
  "rollup-plugin-json": "^3.1.0",
72
72
  "rollup-plugin-license": "^0.8.1",
73
73
  "rollup-plugin-node-resolve": "^3.3.0",
74
- "rollup-plugin-replace": "^2.0.0",
75
- "rollup-plugin-uglify": "^6.0.0",
76
- "sinon": "^7.1.0",
74
+ "rollup-plugin-replace": "^2.2.0",
75
+ "rollup-plugin-uglify": "^6.0.2",
76
+ "sinon": "^7.3.2",
77
77
  "sinon-chai": "^3.2.0",
78
- "webpack": "^4.16.0"
78
+ "webpack": "^4.30.0"
79
79
  },
80
80
  "dependencies": {
81
81
  "bpmn-font": "^0.8.0",
82
- "bpmn-moddle": "^5.1.5",
82
+ "bpmn-moddle": "^5.1.6",
83
83
  "css.escape": "^1.5.1",
84
- "diagram-js": "^3.3.0",
85
- "diagram-js-direct-editing": "^1.4.2",
84
+ "diagram-js": "^3.3.1",
85
+ "diagram-js-direct-editing": "^1.4.3",
86
86
  "ids": "^0.2.0",
87
87
  "inherits": "^2.0.1",
88
- "min-dash": "^3.2.0",
88
+ "min-dash": "^3.4.0",
89
89
  "min-dom": "^3.0.0",
90
90
  "object-refs": "^0.3.0",
91
91
  "tiny-svg": "^2.2.1"
@@ -1 +0,0 @@
1
- 0000000000000000000000000000000000000000 674d207366f520bd7299dad9e255652e21905673 Nico Rehwaldt <nico.rehwaldt@camunda.com> 1556181137 +0200 update by push
@@ -1 +0,0 @@
1
- 674d207366f520bd7299dad9e255652e21905673