New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diagram-js

Package Overview
Dependencies
Maintainers
4
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diagram-js - npm Package Compare versions

Comparing version 0.22.4 to 0.22.5

.npmignore

0

lib/command/CommandHandler.js

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

13

lib/command/CommandStack.js

@@ -125,3 +125,8 @@ 'use strict';

eventBus.on([ 'diagram.destroy', 'diagram.clear' ], this.clear, this);
eventBus.on([
'diagram.destroy',
'diagram.clear'
], function() {
this.clear(false);
}, this);
}

@@ -200,7 +205,9 @@

*/
CommandStack.prototype.clear = function() {
CommandStack.prototype.clear = function(emit) {
this._stack.length = 0;
this._stackIdx = -1;
this._fire('changed');
if (emit !== false) {
this._fire('changed');
}
};

@@ -207,0 +214,0 @@

module.exports = {
commandStack: [ 'type', require('./CommandStack') ]
};

@@ -159,6 +159,2 @@ 'use strict';

// fire this in order for certain components to check
// if they need to be adjusted due the canvas size
this.resized();
}, this);

@@ -165,0 +161,0 @@

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ var RuleProvider = require('../rules/RuleProvider');

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -71,2 +71,5 @@ 'use strict';

}
// we've handled the event
return true;
}

@@ -235,3 +238,3 @@

activateBendpointMove(originalEvent, element, waypoints);
return activateBendpointMove(originalEvent, element, waypoints);
});

@@ -238,0 +241,0 @@

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

module.exports = {
clipboard: [ 'type', require('./Clipboard') ]
};

@@ -93,2 +93,3 @@ 'use strict';

context.target = null;
context.canExecute = false;
});

@@ -95,0 +96,0 @@

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -11,4 +11,4 @@ 'use strict';

Event = require('../../util/Event'),
ClickTrap = require('../../util/ClickTrap'),
Cursor = require('../../util/Cursor');
Cursor = require('../../util/Cursor'),
ClickTrap = require('../../util/ClickTrap');

@@ -20,10 +20,12 @@ var EventBusEvent = require('../../core/EventBus').Event;

function suppressEvent(event) {
if (event instanceof MouseEvent) {
Event.stopEvent(event, true);
} else {
Event.preventDefault(event);
}
function stopPropagation(event) {
Event.stopPropagation(event);
}
function isTouchEvent(event) {
// check for TouchEvent being available first
// (i.e. not available on desktop Firefox)
return typeof TouchEvent !== 'undefined' && event instanceof TouchEvent;
}
function getLength(point) {

@@ -209,3 +211,3 @@ return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));

suppressEvent(event);
stopPropagation(event);

@@ -238,3 +240,3 @@ if (context.active) {

// because we just ended a drag operation
suppressEvent(event);
stopPropagation(event);
}

@@ -284,3 +286,6 @@

if (context.active) {
untrap = ClickTrap.install();
untrap = ClickTrap.install(eventBus);
// remove trap after minimal delay
setTimeout(untrap, 400);

@@ -432,3 +437,3 @@ }

suppressEvent(event);
stopPropagation(event);
} else {

@@ -460,4 +465,3 @@ originalEvent = null;

// fixes TouchEvent not being available on desktop Firefox
if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
if (isTouchEvent(originalEvent)) {
domEvent.bind(document, 'touchstart', trapTouch, true);

@@ -464,0 +468,0 @@ domEvent.bind(document, 'touchcancel', cancel, true);

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -130,3 +130,4 @@ 'use strict';

event.stopPropagation();
// we've handled the event
return true;
}

@@ -133,0 +134,0 @@ });

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -98,5 +98,2 @@ 'use strict';

if (!canExecute) {
// suppress move operation
event.stopPropagation();
return false;

@@ -167,3 +164,3 @@ }

start(originalEvent, event.element);
return start(originalEvent, event.element);
});

@@ -189,2 +186,5 @@

});
// we've handled the event
return true;
}

@@ -191,0 +191,0 @@

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -29,8 +29,15 @@ 'use strict';

function createTouchRecognizer(node) {
function stopEvent(event) {
function stopEvent(event) {
Event.stopEvent(event, true);
event.preventDefault();
event.stopPropagation();
if (typeof event.stopImmediatePropagation === 'function') {
event.stopImmediatePropagation();
}
}
function createTouchRecognizer(node) {
function stopMouse(event) {

@@ -209,3 +216,3 @@

Event.stopEvent(e, true);
stopEvent(e);
}

@@ -212,0 +219,0 @@

@@ -0,0 +0,0 @@ 'use strict';

module.exports = {
i18n: [ 'type', require('./I18N') ]
};
module.exports = {
translate: [ 'value', require('./translate') ]
};

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -15,3 +15,2 @@ 'use strict';

var THRESHOLD = 15;

@@ -22,6 +21,4 @@

var container = canvas._container,
context;
var context;
function handleMove(event) {

@@ -36,5 +33,3 @@

// prevent mouse click in this
// interaction sequence
ClickTrap.install();
ClickTrap.install(eventBus);

@@ -90,5 +85,14 @@ Cursor.set('grab');

domEvent.bind(document, 'mouseup', handleEnd);
// we've handled the event
return true;
}
domEvent.bind(container, 'mousedown', handleStart);
// listen for move on element mouse down;
// allow others to hook into the event before us though
// (dragging / element moving will do this)
eventBus.on('element.mousedown', 500, function(e) {
return handleStart(e.originalEvent);
});
}

@@ -95,0 +99,0 @@

module.exports = {
__depends__: [ require('../../features/touch') ]
};

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

'use strict';
var domEvent = require('min-dom/lib/event'),
stopEvent = require('./Event').stopEvent;
var TRAP_PRIORITY = 5000;
function trap(event) {
stopEvent(event);
toggle(false);
}
function toggle(active) {
domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
}
/**

@@ -21,8 +10,14 @@ * Installs a click trap that prevents a ghost click following a dragging operation.

*/
function install() {
function install(eventBus, eventName) {
toggle(true);
eventName = eventName || 'element.click';
function trap() {
return false;
}
eventBus.once(eventName, TRAP_PRIORITY, trap);
return function() {
toggle(false);
eventBus.off(eventName, trap);
};

@@ -29,0 +24,0 @@ }

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

'use strict';
function __preventDefault(event) {
return event && event.preventDefault();
}
function __stopPropagation(event, immediate) {
if (!event) {
function __stopPropagation(event) {
if (!event || typeof event.stopPropagation !== 'function') {
return;
}
if (event.stopPropagation) {
event.stopPropagation();
}
if (immediate && event.stopImmediatePropagation) {
event.stopImmediatePropagation();
}
event.stopPropagation();
}

@@ -29,18 +19,2 @@

function stopEvent(event, immediate) {
stopPropagation(event, immediate);
preventDefault(event);
}
module.exports.stopEvent = stopEvent;
function preventDefault(event) {
__preventDefault(event);
__preventDefault(getOriginal(event));
}
module.exports.preventDefault = preventDefault;
function stopPropagation(event, immediate) {

@@ -47,0 +21,0 @@ __stopPropagation(event, immediate);

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

{
"name": "diagram-js",
"version": "0.22.4",
"version": "0.22.5",
"description": "A modeling framework for the web",
"scripts": {
"all": "grunt",
"dev": "grunt auto-test",
"test": "grunt test"
"all": "run-s lint test",
"lint": "eslint .",
"dev": "npm test -- --auto-watch --no-single-run",
"test": "karma start"
},

@@ -28,7 +29,2 @@ "repository": {

"eslint-plugin-mocha": "^3.0.0",
"grunt": "~0.4.4",
"grunt-cli": "^0.1.13",
"grunt-eslint": "^18.1.0",
"grunt-karma": "^0.12.0",
"grunt-release": "^0.7.0",
"jquery": "^2.1.0",

@@ -46,10 +42,9 @@ "jsondiffpatch": "^0.1.26",

"karma-spec-reporter": "0.0.31",
"load-grunt-tasks": "^0.3.0",
"mocha": "^4.0.1",
"mocha-test-container-support": "~0.1.0",
"npm-run-all": "^4.1.2",
"phantomjs-prebuilt": "^2.1.12",
"puppeteer": "^0.12.0",
"sinon": "^4.0.1",
"sinon-chai": "^2.14.0",
"puppeteer": "^0.12.0",
"time-grunt": "^0.3.0",
"watchify": "^3.7.0"

@@ -56,0 +51,0 @@ },

@@ -0,0 +0,0 @@ # diagram-js

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -765,3 +765,3 @@ 'use strict';

function verifyClearOn(eventName) {
function verifyReset(eventName) {

@@ -776,3 +776,3 @@ return function(eventBus, commandStack) {

eventBus.on('commandStack.changed', changedSpy);
eventBus.on('commandStack.reset', changedSpy);

@@ -786,9 +786,9 @@ // when

expect(changedSpy).to.have.been.called;
expect(changedSpy).not.to.have.been.called;
};
}
it('should clear on diagram.destroy', inject(verifyClearOn('diagram.destroy')));
it('should clear on diagram.destroy', inject(verifyReset('diagram.destroy')));
it('should clear on diagram.clear', inject(verifyClearOn('diagram.clear')));
it('should clear on diagram.clear', inject(verifyReset('diagram.clear')));

@@ -795,0 +795,0 @@ });

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -101,2 +101,17 @@ 'use strict';

it('should not connect with null target', inject(function(connect, rules, dragging) {
// when
connect.start(canvasEvent({ x: 0, y: 0 }), shape1);
dragging.move(canvasEvent({ x: 40, y: 30 }));
dragging.hover(canvasEvent({ x: 40, y: 30 }, { element: shape2 }));
dragging.out(canvasEvent({ x: 40, y: 30 }));
dragging.end();
// then
expect(shape1.outgoing.length).to.equal(0);
expect(shape2.incoming.length).to.equal(0);
}));
it('should connect with start position', inject(function(connect, dragging, modeling) {

@@ -103,0 +118,0 @@

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -69,3 +69,3 @@ 'use strict';

it('should cancel original event on init', inject(function(dragging) {
it('should stop original event propagation on init', inject(function(dragging) {

@@ -79,3 +79,3 @@ // given

// then
expect(event.defaultPrevented).to.be.true;
expect(event.cancelBubble).to.be.true;
}));

@@ -82,0 +82,0 @@

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

module.exports = {
translate: [ 'value', require('./custom-translate') ]
};

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -42,5 +42,2 @@ 'use strict';

// unwrap snapsvg gfx
target = target.node || target;
data = assign({

@@ -47,0 +44,0 @@ target: target,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc