Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diagram-js

Package Overview
Dependencies
Maintainers
8
Versions
287
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 14.5.0 to 14.5.1

4

lib/features/context-pad/ContextPad.d.ts

@@ -11,5 +11,6 @@ /**

* @param canvas
* @param elementRegistry
* @param eventBus
*/
constructor(canvas: Canvas, eventBus: EventBus);
constructor(canvas: Canvas, elementRegistry: ElementRegistry, eventBus: EventBus);

@@ -119,2 +120,3 @@ /**

type Canvas = import('../../core/Canvas').default;
type ElementRegistry = import('../../core/ElementRegistry').default;
type EventBus = import('../../core/EventBus').default;

@@ -121,0 +123,0 @@ type ContextPadProvider = import('./ContextPadProvider').default;

@@ -5,4 +5,3 @@ import {

isArray,
isFunction,
some
isFunction
} from 'min-dash';

@@ -33,2 +32,3 @@

* @typedef {import('../../core/Canvas').default} Canvas
* @typedef {import('../../core/ElementRegistry').default} ElementRegistry
* @typedef {import('../../core/EventBus').default} EventBus

@@ -58,7 +58,9 @@ *

* @param {Canvas} canvas
* @param {ElementRegistry} elementRegistry
* @param {EventBus} eventBus
*/
export default function ContextPad(canvas, eventBus) {
export default function ContextPad(canvas, elementRegistry, eventBus) {
this._canvas = canvas;
this._elementRegistry = elementRegistry;
this._eventBus = eventBus;

@@ -73,2 +75,3 @@

'canvas',
'elementRegistry',
'eventBus'

@@ -109,14 +112,25 @@ ];

var currentTarget = current.target;
var { target } = current;
var currentChanged = some(
isArray(currentTarget) ? currentTarget : [ currentTarget ],
function(element) {
return includes(elements, element);
var targets = isArray(target) ? target : [ target ];
var targetsChanged = targets.filter(function(element) {
return includes(elements, element);
});
if (targetsChanged.length) {
// (1) close
self.close();
var targetsNew = targets.filter(function(element) {
return self._elementRegistry.get(element.id);
});
if (targetsNew.length) {
// (2) re-open with new targets being all previous targets that still
// exist
self._updateAndOpen(targetsNew.length > 1 ? targetsNew : targetsNew[ 0 ]);
}
);
// re-open if elements in current selection changed
if (currentChanged) {
self.open(currentTarget, true);
}

@@ -123,0 +137,0 @@ });

{
"name": "diagram-js",
"version": "14.5.0",
"version": "14.5.1",
"description": "A toolbox for displaying and modifying diagrams on the web",

@@ -5,0 +5,0 @@ "main": "lib/Diagram.js",

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