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

bpmn-js

Package Overview
Dependencies
Maintainers
8
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-js - npm Package Compare versions

Comparing version 17.4.0 to 17.5.0

22

lib/features/label-editing/LabelEditingProvider.js

@@ -205,3 +205,10 @@ import {

var options = {};
var style = context.style || {};
// Remove background and border
assign(style, {
backgroundColor: null,
border: null
});
// tasks

@@ -227,2 +234,8 @@ if (

});
// keep background and border for external labels
assign(style, {
backgroundColor: '#ffffff',
border: '1px solid #ccc'
});
}

@@ -236,6 +249,13 @@

});
// keep background and border for text annotations
assign(style, {
backgroundColor: '#ffffff',
border: '1px solid #ccc'
});
}
assign(context, {
options: options
options: options,
style: style
});

@@ -242,0 +262,0 @@

4

lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts

@@ -9,5 +9,4 @@ /**

* @param modeling
* @param translate
*/
constructor(eventBus: EventBus, modeling: Modeling, translate: Translate);
constructor(eventBus: EventBus, modeling: Modeling);
}

@@ -17,3 +16,2 @@

type Modeling = import('../Modeling').default;
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

@@ -12,3 +12,2 @@ import inherits from 'inherits-browser';

* @typedef {import('../Modeling').default} Modeling
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
*/

@@ -25,5 +24,4 @@

* @param {Modeling} modeling
* @param {Translate} translate
*/
export default function UpdateFlowNodeRefsBehavior(eventBus, modeling, translate) {
export default function UpdateFlowNodeRefsBehavior(eventBus, modeling) {

@@ -51,3 +49,3 @@ CommandInterceptor.call(this, eventBus);

if (!context) {
throw new Error(translate('out of bounds release'));
throw new Error('out of bounds release');
}

@@ -61,3 +59,3 @@

if (!context) {
throw new Error(translate('out of bounds release'));
throw new Error('out of bounds release');
}

@@ -134,4 +132,3 @@

'eventBus',
'modeling' ,
'translate'
'modeling'
];

@@ -138,0 +135,0 @@

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

* @param connectionDocking
* @param translate
*/
constructor(eventBus: EventBus, bpmnFactory: BpmnFactory, connectionDocking: CroppingConnectionDocking, translate: Translate);
constructor(eventBus: EventBus, bpmnFactory: BpmnFactory, connectionDocking: CroppingConnectionDocking);

@@ -87,3 +86,2 @@ /**

type CroppingConnectionDocking = import('diagram-js/lib/layout/CroppingConnectionDocking').default;
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
type Connection = import('../../model/Types').Connection;

@@ -90,0 +88,0 @@ type Element = import('../../model/Types').Element;

@@ -37,3 +37,2 @@ import {

* @typedef {import('diagram-js/lib/layout/CroppingConnectionDocking').default} CroppingConnectionDocking
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
*

@@ -54,3 +53,2 @@ * @typedef {import('../../model/Types').Connection} Connection

* @param {CroppingConnectionDocking} connectionDocking
* @param {Translate} translate
*/

@@ -60,4 +58,3 @@ export default function BpmnUpdater(

bpmnFactory,
connectionDocking,
translate
connectionDocking
) {

@@ -68,3 +65,2 @@

this._bpmnFactory = bpmnFactory;
this._translate = translate;

@@ -74,3 +70,2 @@ var self = this;

// connection cropping //////////////////////

@@ -330,4 +325,3 @@

'bpmnFactory',
'connectionDocking',
'translate'
'connectionDocking'
];

@@ -571,4 +565,3 @@

var containment,
translate = this._translate;
var containment;

@@ -678,9 +671,3 @@ if (businessObject.$parent === newParent) {

if (!containment) {
throw new Error(translate(
'no parent for {element} in {parent}',
{
element: businessObject.id,
parent: newParent.id
}
));
throw new Error(`no parent for <${ businessObject.id }> in <${ newParent.id }>`);
}

@@ -687,0 +674,0 @@

@@ -13,5 +13,4 @@ /**

* @param modeling
* @param translate
*/
constructor(modeling: Modeling, translate: Translate);
constructor(modeling: Modeling);

@@ -23,2 +22,1 @@ preExecute(context: any): void;

type Modeling = import('../Modeling').default;
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;

@@ -14,3 +14,2 @@ import {

* @typedef {import('../Modeling').default} Modeling
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
*/

@@ -25,12 +24,9 @@

* @param {Modeling} modeling
* @param {Translate} translate
*/
export default function SplitLaneHandler(modeling, translate) {
export default function SplitLaneHandler(modeling) {
this._modeling = modeling;
this._translate = translate;
}
SplitLaneHandler.$inject = [
'modeling',
'translate'
'modeling'
];

@@ -41,4 +37,3 @@

var modeling = this._modeling,
translate = this._translate;
var modeling = this._modeling;

@@ -52,3 +47,3 @@ var shape = context.shape,

if (existingLanesCount > newLanesCount) {
throw new Error(translate('more than {count} child lanes', { count: newLanesCount }));
throw new Error(`more than <${newLanesCount}> child lanes`);
}

@@ -55,0 +50,0 @@

@@ -19,7 +19,6 @@ /**

* @param moddle
* @param translate
* @param modeling
* @param textRenderer
*/
constructor(elementRegistry: ElementRegistry, moddle: Moddle, translate: Translate, modeling: Modeling, textRenderer: TextRenderer);
constructor(elementRegistry: ElementRegistry, moddle: Moddle, modeling: Modeling, textRenderer: TextRenderer);

@@ -58,5 +57,4 @@ /**

type Moddle = import('../../../model/Types').Moddle;
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
type Modeling = import('../Modeling').default;
type TextRenderer = import('../../../draw/TextRenderer').default;
type Element = import('../../../model/Types').Element;

@@ -19,3 +19,2 @@ import {

* @typedef {import('../../../model/Types').Moddle} Moddle
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
* @typedef {import('../Modeling').default} Modeling

@@ -49,3 +48,2 @@ * @typedef {import('../../../draw/TextRenderer').default} TextRenderer

* @param {Moddle} moddle
* @param {Translate} translate
* @param {Modeling} modeling

@@ -55,3 +53,3 @@ * @param {TextRenderer} textRenderer

export default function UpdatePropertiesHandler(
elementRegistry, moddle, translate,
elementRegistry, moddle,
modeling, textRenderer) {

@@ -61,3 +59,2 @@

this._moddle = moddle;
this._translate = translate;
this._modeling = modeling;

@@ -70,3 +67,2 @@ this._textRenderer = textRenderer;

'moddle',
'translate',
'modeling',

@@ -92,7 +88,6 @@ 'textRenderer'

var element = context.element,
changed = [ element ],
translate = this._translate;
changed = [ element ];
if (!element) {
throw new Error(translate('element required'));
throw new Error('element required');
}

@@ -99,0 +94,0 @@

@@ -14,5 +14,4 @@ /**

* @param moddle
* @param translate
*/
constructor(bpmnFactory: BpmnFactory, moddle: Moddle, translate: Translate);
constructor(bpmnFactory: BpmnFactory, moddle: Moddle);

@@ -109,3 +108,2 @@ /**

export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
type Dimensions = import('diagram-js/lib/util/Types').Dimensions;

@@ -112,0 +110,0 @@ type BpmnFactory = import('./BpmnFactory').default;

@@ -37,4 +37,2 @@ import {

/**
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
*
* @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions

@@ -66,5 +64,4 @@ *

* @param {Moddle} moddle
* @param {Translate} translate
*/
export default function ElementFactory(bpmnFactory, moddle, translate) {
export default function ElementFactory(bpmnFactory, moddle) {
BaseElementFactory.call(this);

@@ -74,3 +71,2 @@

this._moddle = moddle;
this._translate = translate;
}

@@ -82,4 +78,3 @@

'bpmnFactory',
'moddle',
'translate'
'moddle'
];

@@ -162,7 +157,7 @@

ElementFactory.prototype.createElement = function(elementType, attrs) {
var size,
translate = this._translate;
attrs = assign({}, attrs || {});
var size;
var businessObject = attrs.businessObject,

@@ -173,3 +168,3 @@ di = attrs.di;

if (!attrs.type) {
throw new Error(translate('no shape type specified'));
throw new Error('no shape type specified');
}

@@ -176,0 +171,0 @@

@@ -9,5 +9,4 @@ /**

* @param canvas
* @param translate
*/
constructor(eventBus: EventBus, canvas: Canvas, translate: any);
constructor(eventBus: EventBus, canvas: Canvas);
getOrdering: (element: any, newParent: any) => {

@@ -21,3 +20,2 @@ index: number;

type EventBus = import('diagram-js/lib/core/EventBus').default;
export type Translate = any;
import OrderingProvider from 'diagram-js/lib/features/ordering/OrderingProvider';

@@ -18,3 +18,2 @@ import inherits from 'inherits-browser';

* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
* @typedef {import('diagram-js/i18n/translate/translate').default} Translate
*/

@@ -27,5 +26,4 @@

* @param {Canvas} canvas
* @param {Translate} translate
*/
export default function BpmnOrderingProvider(eventBus, canvas, translate) {
export default function BpmnOrderingProvider(eventBus, canvas) {

@@ -194,4 +192,4 @@ OrderingProvider.call(this, eventBus);

BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas', 'translate' ];
BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas' ];
inherits(BpmnOrderingProvider, OrderingProvider);
declare namespace _default {
const __depends__: import("didi").ModuleDeclaration[];
const __init__: string[];

@@ -4,0 +3,0 @@ const bpmnOrderingProvider: (string | typeof BpmnOrderingProvider)[];

@@ -1,11 +0,6 @@

import translate from 'diagram-js/lib/i18n/translate';
import BpmnOrderingProvider from './BpmnOrderingProvider';
export default {
__depends__: [
translate
],
__init__: [ 'bpmnOrderingProvider' ],
bpmnOrderingProvider: [ 'type', BpmnOrderingProvider ]
};

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

* @param elementRegistry
* @param translate
* @param textRenderer
*/
constructor(eventBus: EventBus, canvas: Canvas, elementFactory: ElementFactory, elementRegistry: ElementRegistry, translate: Function, textRenderer: TextRenderer);
constructor(eventBus: EventBus, canvas: Canvas, elementFactory: ElementFactory, elementRegistry: ElementRegistry, textRenderer: TextRenderer);

@@ -46,3 +45,2 @@ /**

type EventBus = import('diagram-js/lib/core/EventBus').default;
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
type ElementFactory = import('../features/modeling/ElementFactory').default;

@@ -49,0 +47,0 @@ type TextRenderer = import('../draw/TextRenderer').default;

@@ -29,3 +29,2 @@ import {

* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
*

@@ -72,8 +71,6 @@ * @typedef {import('../features/modeling/ElementFactory').default} ElementFactory

function notYetDrawn(translate, semantic, refSemantic, property) {
return new Error(translate('element {element} referenced by {referenced}#{property} not yet drawn', {
element: elementToString(refSemantic),
referenced: elementToString(semantic),
property: property
}));
function notYetDrawn(semantic, refSemantic, property) {
return new Error(
`element ${ elementToString(refSemantic) } referenced by ${ elementToString(semantic) }#${ property } not yet drawn`
);
}

@@ -89,3 +86,2 @@

* @param {ElementRegistry} elementRegistry
* @param {Function} translate
* @param {TextRenderer} textRenderer

@@ -95,3 +91,3 @@ */

eventBus, canvas, elementFactory,
elementRegistry, translate, textRenderer) {
elementRegistry, textRenderer) {

@@ -102,3 +98,2 @@ this._eventBus = eventBus;

this._elementRegistry = elementRegistry;
this._translate = translate;
this._textRenderer = textRenderer;

@@ -112,3 +107,2 @@ }

'elementRegistry',
'translate',
'textRenderer'

@@ -130,3 +124,2 @@ ];

var element,
translate = this._translate,
hidden;

@@ -217,6 +210,5 @@

} else {
throw new Error(translate('unknown di {di} for element {semantic}', {
di: elementToString(di),
semantic: elementToString(semantic)
}));
throw new Error(
`unknown di ${ elementToString(di) } for element ${ elementToString(semantic) }`
);
}

@@ -229,3 +221,2 @@

this._eventBus.fire('bpmnElement.added', { element: element });

@@ -244,9 +235,8 @@

BpmnImporter.prototype._attachBoundary = function(boundarySemantic, boundaryElement) {
var translate = this._translate;
var hostSemantic = boundarySemantic.attachedToRef;
if (!hostSemantic) {
throw new Error(translate('missing {semantic}#attachedToRef', {
semantic: elementToString(boundarySemantic)
}));
throw new Error(
`missing ${ elementToString(boundarySemantic) }#attachedToRef`
);
}

@@ -258,3 +248,3 @@

if (!host) {
throw notYetDrawn(translate, boundarySemantic, hostSemantic, 'attachedToRef');
throw notYetDrawn(boundarySemantic, hostSemantic, 'attachedToRef');
}

@@ -325,4 +315,3 @@

refSemantic,
type = semantic.$type,
translate = this._translate;
type = semantic.$type;

@@ -350,8 +339,7 @@ refSemantic = semantic[side + 'Ref'];

if (refSemantic) {
throw notYetDrawn(translate, semantic, refSemantic, side + 'Ref');
throw notYetDrawn(semantic, refSemantic, side + 'Ref');
} else {
throw new Error(translate('{semantic}#{side} Ref not specified', {
semantic: elementToString(semantic),
side: side
}));
throw new Error(
`${ elementToString(semantic) }#${ side } Ref not specified`
);
}

@@ -358,0 +346,0 @@ };

export default class BpmnTreeWalker {
/**
* @param handler
* @param translate
*/
constructor(handler: Record<'element' | 'root' | 'error', Function>, translate: Translate);
constructor(handler: Record<'element' | 'root' | 'error', Function>);
registerDi: (di: any) => void;

@@ -21,3 +20,2 @@ /**

export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
type ModdleElement = import('../model/Types').ModdleElement;

@@ -16,4 +16,2 @@ import {

/**
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
*
* @typedef {import('../model/Types').ModdleElement} ModdleElement

@@ -51,5 +49,4 @@ */

* @param {Record<'element' | 'root' | 'error', Function>} handler
* @param {Translate} translate
*/
export default function BpmnTreeWalker(handler, translate) {
export default function BpmnTreeWalker(handler) {

@@ -88,3 +85,3 @@ // list of containers already walked

throw new Error(
translate('already rendered {element}', { element: elementToString(element) })
'already rendered ${ elementToString(element) }'
);

@@ -109,7 +106,6 @@ }

return gfx;
} catch (e) {
logError(e.message, { element: element, error: e });
} catch (error) {
logError(error.message, { element, error });
console.error(translate('failed to import {element}', { element: elementToString(element) }));
console.error(e);
console.error(`failed to import ${ elementToString(element) }`, error);
}

@@ -130,5 +126,3 @@ }

logError(
translate('multiple DI elements defined for {element}', {
element: elementToString(bpmnElement)
}),
`multiple DI elements defined for ${ elementToString(bpmnElement) }`,
{ element: bpmnElement }

@@ -143,5 +137,3 @@ );

logError(
translate('no bpmnElement referenced in {element}', {
element: elementToString(di)
}),
`no bpmnElement referenced in ${ elementToString(di) }`,
{ element: di }

@@ -184,3 +176,3 @@ );

if (diagram && diagrams.indexOf(diagram) === -1) {
throw new Error(translate('diagram not part of bpmn:Definitions'));
throw new Error('diagram not part of <bpmn:Definitions />');
}

@@ -194,3 +186,3 @@

if (!diagram) {
throw new Error(translate('no diagram to display'));
throw new Error('no diagram to display');
}

@@ -206,6 +198,5 @@

if (!plane) {
throw new Error(translate(
'no plane for {element}',
{ element: elementToString(diagram) }
));
throw new Error(
`no plane for ${ elementToString(diagram) }`
);
}

@@ -221,10 +212,7 @@

if (!rootElement) {
throw new Error(translate('no process or collaboration to display'));
throw new Error('no process or collaboration to display');
} else {
logError(
translate('correcting missing bpmnElement on {plane} to {rootElement}', {
plane: elementToString(plane),
rootElement: elementToString(rootElement)
})
`correcting missing bpmnElement on ${ elementToString(plane) } to ${ elementToString(rootElement) }`
);

@@ -250,6 +238,3 @@

throw new Error(
translate('unsupported bpmnElement for {plane}: {rootElement}', {
plane: elementToString(plane),
rootElement: elementToString(rootElement)
})
`unsupported bpmnElement for ${ elementToString(plane) }: ${ elementToString(rootElement) }`
);

@@ -416,27 +401,27 @@ }

function handleFlowElements(flowElements, context) {
forEach(flowElements, function(e) {
if (is(e, 'bpmn:SequenceFlow')) {
forEach(flowElements, function(flowElement) {
if (is(flowElement, 'bpmn:SequenceFlow')) {
deferred.push(function() {
handleSequenceFlow(e, context);
handleSequenceFlow(flowElement, context);
});
} else if (is(e, 'bpmn:BoundaryEvent')) {
} else if (is(flowElement, 'bpmn:BoundaryEvent')) {
deferred.unshift(function() {
handleFlowNode(e, context);
handleFlowNode(flowElement, context);
});
} else if (is(e, 'bpmn:FlowNode')) {
handleFlowNode(e, context);
} else if (is(e, 'bpmn:DataObject')) {
} else if (is(flowElement, 'bpmn:FlowNode')) {
handleFlowNode(flowElement, context);
} else if (is(flowElement, 'bpmn:DataObject')) {
// SKIP (assume correct referencing via DataObjectReference)
} else if (is(e, 'bpmn:DataStoreReference')) {
handleDataElement(e, context);
} else if (is(e, 'bpmn:DataObjectReference')) {
handleDataElement(e, context);
} else if (is(flowElement, 'bpmn:DataStoreReference')) {
handleDataElement(flowElement, context);
} else if (is(flowElement, 'bpmn:DataObjectReference')) {
handleDataElement(flowElement, context);
} else {
logError(
translate('unrecognized flowElement {element} in context {context}', {
element: elementToString(e),
context: (context ? elementToString(context.businessObject) : 'null')
}),
{ element: e, context: context }
`unrecognized flowElement ${ elementToString(flowElement) } in context ${ elementToString(context && context.businessObject) }`,
{
element: flowElement,
context
}
);

@@ -443,0 +428,0 @@ }

@@ -38,3 +38,2 @@ import {

eventBus,
translate,
canvas;

@@ -69,3 +68,3 @@

var walker = new BpmnTreeWalker(visitor, translate);
var walker = new BpmnTreeWalker(visitor);

@@ -78,3 +77,3 @@

if (!diagramsToImport) {
throw new Error(translate('no diagram to display'));
throw new Error('no diagram to display');
}

@@ -102,3 +101,2 @@

eventBus = diagram.get('eventBus');
translate = diagram.get('translate');
canvas = diagram.get('canvas');

@@ -105,0 +103,0 @@

{
"name": "bpmn-js",
"version": "17.4.0",
"version": "17.5.0",
"description": "A bpmn 2.0 toolkit and web modeler",

@@ -116,3 +116,3 @@ "main": "index.js",

"diagram-js": "^14.4.1",
"diagram-js-direct-editing": "^2.1.2",
"diagram-js-direct-editing": "^3.0.1",
"ids": "^1.0.5",

@@ -119,0 +119,0 @@ "inherits-browser": "^0.1.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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