From 7a3b92c09434c2df91476b324fc49a1f5f9597ef Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Mon, 2 Apr 2018 11:13:39 +0200 Subject: [PATCH] chore(project): migrate to diagram-js@0.31 --- package-lock.json | 44 +++++++++++++++++++++++++++++------------ package.json | 2 +- test/util/MockEvents.js | 28 +++++++++++--------------- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9f6a68d..90a5ce40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1852,24 +1852,42 @@ "dev": true }, "diagram-js": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-0.30.0.tgz", - "integrity": "sha512-JpWHv6Cb3QxmOzVod3uG7KJfGfIjmqlVkHgbA5xubII7Nj2wHat3SjVFT8ty1mWn+ZWYUAFoYnrgvsbFRDu1LA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-0.31.0.tgz", + "integrity": "sha512-oUaU6mfQBcTh9tApI03I6n+9JRNLJkI6qinH0aBob8oHfrdB+s6haMIE6Q2lrN49tgiLAYa7lBFIjShYwmMy+g==", "requires": { - "didi": "3.0.0", + "didi": "3.2.0", "hammerjs": "2.0.8", "inherits": "2.0.3", - "min-dash": "2.3.0", - "min-dom": "2.0.1", + "min-dash": "2.4.0", + "min-dom": "2.2.0", "object-refs": "0.1.1", "path-intersection": "1.0.2", - "tiny-svg": "1.0.2" + "tiny-svg": "1.1.0" }, "dependencies": { + "min-dash": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/min-dash/-/min-dash-2.4.0.tgz", + "integrity": "sha512-jmMFOBAd/TJP8IdSzLh7rmNqZEOufp8u10AYMCAQJ+MK1xnHAHQi6aF0DoyOU3oJwIRKKpMKO9nPx4dSf27Wng==" + }, + "min-dom": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/min-dom/-/min-dom-2.2.0.tgz", + "integrity": "sha512-kasYrY7+swALVEl/KLWlxNvtdImd2akUbBHuD0Q/7bLcmEQ2MxUVAv/x8yNYwFTp6w6bZkhx03TBv+41gzxmkg==", + "requires": { + "closest": "0.0.1", + "component-event": "0.1.4", + "delegate-events": "1.1.1", + "domify": "1.4.0", + "indexof": "0.0.1", + "matches-selector": "1.2.0" + } + }, "tiny-svg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-1.0.2.tgz", - "integrity": "sha512-ot7zogQRbMcTJELZiLr6Lo19St4WMoAduFuYHquo8x3LR20OU50Ip2L37fD7y23xaIVOyFcrr1pgJJKRBJUpnQ==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-1.1.0.tgz", + "integrity": "sha512-4Qnoua0updWaa5HBmPUohDzKgXmsu9Cl+l/o0R1fZBvuywKPaC6I1PUBwLC8iV+EaQkXJObTL+QkPBDDelnZIg==" } } }, @@ -1883,9 +1901,9 @@ } }, "didi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/didi/-/didi-3.0.0.tgz", - "integrity": "sha512-fDnQmmSpLBxeJtM0zn/qZ5Ti3etuBvVye2/fGI38VkcdWPpH2pDxwk8cVusXZIyhLhihHNo/Kcx1oNbcqV5pkA==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/didi/-/didi-3.2.0.tgz", + "integrity": "sha512-D59Ql6JPQITwjObDhqb20SL1QE6rs6VfBh+G+Oxh4Wfuz20mmfL1mfC80nIEgS08iyPifbCs1W6A3yYZJSBLkw==" }, "diff": { "version": "3.3.1", diff --git a/package.json b/package.json index 163689c5..c61e840f 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "dependencies": { "bpmn-font": "^0.8.0", "bpmn-moddle": "^3.0.2", - "diagram-js": "^0.30.0", + "diagram-js": "^0.31.0", "diagram-js-direct-editing": "^0.23.0", "ids": "^0.2.0", "inherits": "^2.0.1", diff --git a/test/util/MockEvents.js b/test/util/MockEvents.js index 5ada6233..cc35e462 100644 --- a/test/util/MockEvents.js +++ b/test/util/MockEvents.js @@ -2,8 +2,6 @@ var assign = require('min-dash').assign; -var EventBus = require('diagram-js/lib/core/EventBus'); - var TestHelper = require('../TestHelper'); @@ -39,21 +37,19 @@ module.exports.createCanvasEvent = createCanvasEvent; function createEvent(target, position, data) { - data = assign({ - target: target, - x: position.x, - y: position.y, - clientX: position.x, - clientY: position.y, - offsetX: position.x, - offsetY: position.y - }, data || {}); + return TestHelper.getBpmnJS().invoke(function(eventBus) { + data = assign({ + target: target, + x: position.x, + y: position.y, + clientX: position.x, + clientY: position.y, + offsetX: position.x, + offsetY: position.y + }, data || {}); - var event = new EventBus.Event(); - - event.init(data); - - return event; + return eventBus.createEvent(data); + }); } module.exports.createEvent = createEvent;