bpmn-js 17.3.0 → 17.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/dist/bpmn-modeler.development.js +103 -154
- package/dist/bpmn-modeler.production.min.js +10 -10
- package/dist/bpmn-navigated-viewer.development.js +52 -81
- package/dist/bpmn-navigated-viewer.production.min.js +4 -4
- package/dist/bpmn-viewer.development.js +52 -81
- package/dist/bpmn-viewer.production.min.js +4 -4
- package/lib/features/label-editing/LabelEditingProvider.js +21 -1
- package/lib/features/modeling/BpmnUpdater.d.ts +1 -3
- package/lib/features/modeling/BpmnUpdater.js +4 -17
- package/lib/features/modeling/ElementFactory.d.ts +1 -3
- package/lib/features/modeling/ElementFactory.js +5 -10
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +1 -3
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +4 -7
- package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +1 -3
- package/lib/features/modeling/cmd/SplitLaneHandler.js +4 -9
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +1 -3
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +3 -8
- package/lib/features/ordering/BpmnOrderingProvider.d.ts +1 -3
- package/lib/features/ordering/BpmnOrderingProvider.js +2 -4
- package/lib/features/ordering/index.d.ts +0 -1
- package/lib/features/ordering/index.js +0 -5
- package/lib/import/BpmnImporter.d.ts +1 -3
- package/lib/import/BpmnImporter.js +17 -29
- package/lib/import/BpmnTreeWalker.d.ts +1 -3
- package/lib/import/BpmnTreeWalker.js +32 -47
- package/lib/import/Importer.js +2 -4
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-navigated-viewer v17.
|
|
2
|
+
* bpmn-js - bpmn-navigated-viewer v17.5.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date: 2024-04-
|
|
11
|
+
* Date: 2024-04-26
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -6398,7 +6398,6 @@
|
|
|
6398
6398
|
* @typedef {import('diagram-js/lib/core/Canvas').default} Canvas
|
|
6399
6399
|
* @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
|
|
6400
6400
|
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
6401
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
6402
6401
|
*
|
|
6403
6402
|
* @typedef {import('../features/modeling/ElementFactory').default} ElementFactory
|
|
6404
6403
|
* @typedef {import('../draw/TextRenderer').default} TextRenderer
|
|
@@ -6440,12 +6439,10 @@
|
|
|
6440
6439
|
});
|
|
6441
6440
|
}
|
|
6442
6441
|
|
|
6443
|
-
function notYetDrawn(
|
|
6444
|
-
return new Error(
|
|
6445
|
-
element
|
|
6446
|
-
|
|
6447
|
-
property: property
|
|
6448
|
-
}));
|
|
6442
|
+
function notYetDrawn(semantic, refSemantic, property) {
|
|
6443
|
+
return new Error(
|
|
6444
|
+
`element ${ elementToString(refSemantic) } referenced by ${ elementToString(semantic) }#${ property } not yet drawn`
|
|
6445
|
+
);
|
|
6449
6446
|
}
|
|
6450
6447
|
|
|
6451
6448
|
|
|
@@ -6456,18 +6453,16 @@
|
|
|
6456
6453
|
* @param {Canvas} canvas
|
|
6457
6454
|
* @param {ElementFactory} elementFactory
|
|
6458
6455
|
* @param {ElementRegistry} elementRegistry
|
|
6459
|
-
* @param {Function} translate
|
|
6460
6456
|
* @param {TextRenderer} textRenderer
|
|
6461
6457
|
*/
|
|
6462
6458
|
function BpmnImporter(
|
|
6463
6459
|
eventBus, canvas, elementFactory,
|
|
6464
|
-
elementRegistry,
|
|
6460
|
+
elementRegistry, textRenderer) {
|
|
6465
6461
|
|
|
6466
6462
|
this._eventBus = eventBus;
|
|
6467
6463
|
this._canvas = canvas;
|
|
6468
6464
|
this._elementFactory = elementFactory;
|
|
6469
6465
|
this._elementRegistry = elementRegistry;
|
|
6470
|
-
this._translate = translate;
|
|
6471
6466
|
this._textRenderer = textRenderer;
|
|
6472
6467
|
}
|
|
6473
6468
|
|
|
@@ -6476,7 +6471,6 @@
|
|
|
6476
6471
|
'canvas',
|
|
6477
6472
|
'elementFactory',
|
|
6478
6473
|
'elementRegistry',
|
|
6479
|
-
'translate',
|
|
6480
6474
|
'textRenderer'
|
|
6481
6475
|
];
|
|
6482
6476
|
|
|
@@ -6493,7 +6487,6 @@
|
|
|
6493
6487
|
*/
|
|
6494
6488
|
BpmnImporter.prototype.add = function(semantic, di, parentElement) {
|
|
6495
6489
|
var element,
|
|
6496
|
-
translate = this._translate,
|
|
6497
6490
|
hidden;
|
|
6498
6491
|
|
|
6499
6492
|
var parentIndex;
|
|
@@ -6579,10 +6572,9 @@
|
|
|
6579
6572
|
|
|
6580
6573
|
this._canvas.addConnection(element, parentElement, parentIndex);
|
|
6581
6574
|
} else {
|
|
6582
|
-
throw new Error(
|
|
6583
|
-
di
|
|
6584
|
-
|
|
6585
|
-
}));
|
|
6575
|
+
throw new Error(
|
|
6576
|
+
`unknown di ${ elementToString(di) } for element ${ elementToString(semantic) }`
|
|
6577
|
+
);
|
|
6586
6578
|
}
|
|
6587
6579
|
|
|
6588
6580
|
// (optional) LABEL
|
|
@@ -6590,7 +6582,6 @@
|
|
|
6590
6582
|
this.addLabel(semantic, di, element);
|
|
6591
6583
|
}
|
|
6592
6584
|
|
|
6593
|
-
|
|
6594
6585
|
this._eventBus.fire('bpmnElement.added', { element: element });
|
|
6595
6586
|
|
|
6596
6587
|
return element;
|
|
@@ -6604,20 +6595,19 @@
|
|
|
6604
6595
|
* @param {Shape} boundaryElement
|
|
6605
6596
|
*/
|
|
6606
6597
|
BpmnImporter.prototype._attachBoundary = function(boundarySemantic, boundaryElement) {
|
|
6607
|
-
var translate = this._translate;
|
|
6608
6598
|
var hostSemantic = boundarySemantic.attachedToRef;
|
|
6609
6599
|
|
|
6610
6600
|
if (!hostSemantic) {
|
|
6611
|
-
throw new Error(
|
|
6612
|
-
|
|
6613
|
-
|
|
6601
|
+
throw new Error(
|
|
6602
|
+
`missing ${ elementToString(boundarySemantic) }#attachedToRef`
|
|
6603
|
+
);
|
|
6614
6604
|
}
|
|
6615
6605
|
|
|
6616
6606
|
var host = this._elementRegistry.get(hostSemantic.id),
|
|
6617
6607
|
attachers = host && host.attachers;
|
|
6618
6608
|
|
|
6619
6609
|
if (!host) {
|
|
6620
|
-
throw notYetDrawn(
|
|
6610
|
+
throw notYetDrawn(boundarySemantic, hostSemantic, 'attachedToRef');
|
|
6621
6611
|
}
|
|
6622
6612
|
|
|
6623
6613
|
// wire element.host <> host.attachers
|
|
@@ -6683,8 +6673,7 @@
|
|
|
6683
6673
|
|
|
6684
6674
|
var element,
|
|
6685
6675
|
refSemantic,
|
|
6686
|
-
type = semantic.$type
|
|
6687
|
-
translate = this._translate;
|
|
6676
|
+
type = semantic.$type;
|
|
6688
6677
|
|
|
6689
6678
|
refSemantic = semantic[side + 'Ref'];
|
|
6690
6679
|
|
|
@@ -6707,12 +6696,11 @@
|
|
|
6707
6696
|
}
|
|
6708
6697
|
|
|
6709
6698
|
if (refSemantic) {
|
|
6710
|
-
throw notYetDrawn(
|
|
6699
|
+
throw notYetDrawn(semantic, refSemantic, side + 'Ref');
|
|
6711
6700
|
} else {
|
|
6712
|
-
throw new Error(
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
}));
|
|
6701
|
+
throw new Error(
|
|
6702
|
+
`${ elementToString(semantic) }#${ side } Ref not specified`
|
|
6703
|
+
);
|
|
6716
6704
|
}
|
|
6717
6705
|
};
|
|
6718
6706
|
|
|
@@ -22097,8 +22085,6 @@
|
|
|
22097
22085
|
}
|
|
22098
22086
|
|
|
22099
22087
|
/**
|
|
22100
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
22101
|
-
*
|
|
22102
22088
|
* @typedef {import('../model/Types').ModdleElement} ModdleElement
|
|
22103
22089
|
*/
|
|
22104
22090
|
|
|
@@ -22131,9 +22117,8 @@
|
|
|
22131
22117
|
|
|
22132
22118
|
/**
|
|
22133
22119
|
* @param {Record<'element' | 'root' | 'error', Function>} handler
|
|
22134
|
-
* @param {Translate} translate
|
|
22135
22120
|
*/
|
|
22136
|
-
function BpmnTreeWalker(handler
|
|
22121
|
+
function BpmnTreeWalker(handler) {
|
|
22137
22122
|
|
|
22138
22123
|
// list of containers already walked
|
|
22139
22124
|
var handledElements = {};
|
|
@@ -22167,7 +22152,7 @@
|
|
|
22167
22152
|
// avoid multiple rendering of elements
|
|
22168
22153
|
if (gfx) {
|
|
22169
22154
|
throw new Error(
|
|
22170
|
-
|
|
22155
|
+
'already rendered ${ elementToString(element) }'
|
|
22171
22156
|
);
|
|
22172
22157
|
}
|
|
22173
22158
|
|
|
@@ -22187,11 +22172,10 @@
|
|
|
22187
22172
|
handled(element);
|
|
22188
22173
|
|
|
22189
22174
|
return gfx;
|
|
22190
|
-
} catch (
|
|
22191
|
-
logError(
|
|
22175
|
+
} catch (error) {
|
|
22176
|
+
logError(error.message, { element, error });
|
|
22192
22177
|
|
|
22193
|
-
console.error(
|
|
22194
|
-
console.error(e);
|
|
22178
|
+
console.error(`failed to import ${ elementToString(element) }`, error);
|
|
22195
22179
|
}
|
|
22196
22180
|
}
|
|
22197
22181
|
|
|
@@ -22207,9 +22191,7 @@
|
|
|
22207
22191
|
if (bpmnElement) {
|
|
22208
22192
|
if (diMap[bpmnElement.id]) {
|
|
22209
22193
|
logError(
|
|
22210
|
-
|
|
22211
|
-
element: elementToString(bpmnElement)
|
|
22212
|
-
}),
|
|
22194
|
+
`multiple DI elements defined for ${ elementToString(bpmnElement) }`,
|
|
22213
22195
|
{ element: bpmnElement }
|
|
22214
22196
|
);
|
|
22215
22197
|
} else {
|
|
@@ -22219,9 +22201,7 @@
|
|
|
22219
22201
|
}
|
|
22220
22202
|
} else {
|
|
22221
22203
|
logError(
|
|
22222
|
-
|
|
22223
|
-
element: elementToString(di)
|
|
22224
|
-
}),
|
|
22204
|
+
`no bpmnElement referenced in ${ elementToString(di) }`,
|
|
22225
22205
|
{ element: di }
|
|
22226
22206
|
);
|
|
22227
22207
|
}
|
|
@@ -22259,7 +22239,7 @@
|
|
|
22259
22239
|
var diagrams = definitions.diagrams;
|
|
22260
22240
|
|
|
22261
22241
|
if (diagram && diagrams.indexOf(diagram) === -1) {
|
|
22262
|
-
throw new Error(
|
|
22242
|
+
throw new Error('diagram not part of <bpmn:Definitions />');
|
|
22263
22243
|
}
|
|
22264
22244
|
|
|
22265
22245
|
if (!diagram && diagrams && diagrams.length) {
|
|
@@ -22268,7 +22248,7 @@
|
|
|
22268
22248
|
|
|
22269
22249
|
// no diagram -> nothing to import
|
|
22270
22250
|
if (!diagram) {
|
|
22271
|
-
throw new Error(
|
|
22251
|
+
throw new Error('no diagram to display');
|
|
22272
22252
|
}
|
|
22273
22253
|
|
|
22274
22254
|
// load DI from selected diagram only
|
|
@@ -22279,10 +22259,9 @@
|
|
|
22279
22259
|
var plane = diagram.plane;
|
|
22280
22260
|
|
|
22281
22261
|
if (!plane) {
|
|
22282
|
-
throw new Error(
|
|
22283
|
-
|
|
22284
|
-
|
|
22285
|
-
));
|
|
22262
|
+
throw new Error(
|
|
22263
|
+
`no plane for ${ elementToString(diagram) }`
|
|
22264
|
+
);
|
|
22286
22265
|
}
|
|
22287
22266
|
|
|
22288
22267
|
var rootElement = plane.bpmnElement;
|
|
@@ -22293,14 +22272,11 @@
|
|
|
22293
22272
|
rootElement = findDisplayCandidate(definitions);
|
|
22294
22273
|
|
|
22295
22274
|
if (!rootElement) {
|
|
22296
|
-
throw new Error(
|
|
22275
|
+
throw new Error('no process or collaboration to display');
|
|
22297
22276
|
} else {
|
|
22298
22277
|
|
|
22299
22278
|
logError(
|
|
22300
|
-
|
|
22301
|
-
plane: elementToString(plane),
|
|
22302
|
-
rootElement: elementToString(rootElement)
|
|
22303
|
-
})
|
|
22279
|
+
`correcting missing bpmnElement on ${ elementToString(plane) } to ${ elementToString(rootElement) }`
|
|
22304
22280
|
);
|
|
22305
22281
|
|
|
22306
22282
|
// correct DI on the fly
|
|
@@ -22321,10 +22297,7 @@
|
|
|
22321
22297
|
handleUnhandledProcesses(definitions.rootElements, ctx);
|
|
22322
22298
|
} else {
|
|
22323
22299
|
throw new Error(
|
|
22324
|
-
|
|
22325
|
-
plane: elementToString(plane),
|
|
22326
|
-
rootElement: elementToString(rootElement)
|
|
22327
|
-
})
|
|
22300
|
+
`unsupported bpmnElement for ${ elementToString(plane) }: ${ elementToString(rootElement) }`
|
|
22328
22301
|
);
|
|
22329
22302
|
}
|
|
22330
22303
|
|
|
@@ -22486,28 +22459,28 @@
|
|
|
22486
22459
|
}
|
|
22487
22460
|
|
|
22488
22461
|
function handleFlowElements(flowElements, context) {
|
|
22489
|
-
forEach$1(flowElements, function(
|
|
22490
|
-
if (is(
|
|
22462
|
+
forEach$1(flowElements, function(flowElement) {
|
|
22463
|
+
if (is(flowElement, 'bpmn:SequenceFlow')) {
|
|
22491
22464
|
deferred.push(function() {
|
|
22492
|
-
handleSequenceFlow(
|
|
22465
|
+
handleSequenceFlow(flowElement, context);
|
|
22493
22466
|
});
|
|
22494
|
-
} else if (is(
|
|
22467
|
+
} else if (is(flowElement, 'bpmn:BoundaryEvent')) {
|
|
22495
22468
|
deferred.unshift(function() {
|
|
22496
|
-
handleFlowNode(
|
|
22469
|
+
handleFlowNode(flowElement, context);
|
|
22497
22470
|
});
|
|
22498
|
-
} else if (is(
|
|
22499
|
-
handleFlowNode(
|
|
22500
|
-
} else if (is(
|
|
22501
|
-
handleDataElement(
|
|
22502
|
-
} else if (is(
|
|
22503
|
-
handleDataElement(
|
|
22471
|
+
} else if (is(flowElement, 'bpmn:FlowNode')) {
|
|
22472
|
+
handleFlowNode(flowElement, context);
|
|
22473
|
+
} else if (is(flowElement, 'bpmn:DataObject')) ; else if (is(flowElement, 'bpmn:DataStoreReference')) {
|
|
22474
|
+
handleDataElement(flowElement, context);
|
|
22475
|
+
} else if (is(flowElement, 'bpmn:DataObjectReference')) {
|
|
22476
|
+
handleDataElement(flowElement, context);
|
|
22504
22477
|
} else {
|
|
22505
22478
|
logError(
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22479
|
+
`unrecognized flowElement ${ elementToString(flowElement) } in context ${ elementToString(context && context.businessObject) }`,
|
|
22480
|
+
{
|
|
22481
|
+
element: flowElement,
|
|
22482
|
+
context
|
|
22483
|
+
}
|
|
22511
22484
|
);
|
|
22512
22485
|
}
|
|
22513
22486
|
});
|
|
@@ -22574,7 +22547,6 @@
|
|
|
22574
22547
|
|
|
22575
22548
|
var importer,
|
|
22576
22549
|
eventBus,
|
|
22577
|
-
translate,
|
|
22578
22550
|
canvas;
|
|
22579
22551
|
|
|
22580
22552
|
var error,
|
|
@@ -22604,7 +22576,7 @@
|
|
|
22604
22576
|
}
|
|
22605
22577
|
};
|
|
22606
22578
|
|
|
22607
|
-
var walker = new BpmnTreeWalker(visitor
|
|
22579
|
+
var walker = new BpmnTreeWalker(visitor);
|
|
22608
22580
|
|
|
22609
22581
|
|
|
22610
22582
|
bpmnDiagram = bpmnDiagram || (definitions.diagrams && definitions.diagrams[0]);
|
|
@@ -22612,7 +22584,7 @@
|
|
|
22612
22584
|
var diagramsToImport = getDiagramsToImport(definitions, bpmnDiagram);
|
|
22613
22585
|
|
|
22614
22586
|
if (!diagramsToImport) {
|
|
22615
|
-
throw new Error(
|
|
22587
|
+
throw new Error('no diagram to display');
|
|
22616
22588
|
}
|
|
22617
22589
|
|
|
22618
22590
|
// traverse BPMN 2.0 document model,
|
|
@@ -22635,7 +22607,6 @@
|
|
|
22635
22607
|
try {
|
|
22636
22608
|
importer = diagram.get('bpmnImporter');
|
|
22637
22609
|
eventBus = diagram.get('eventBus');
|
|
22638
|
-
translate = diagram.get('translate');
|
|
22639
22610
|
canvas = diagram.get('canvas');
|
|
22640
22611
|
|
|
22641
22612
|
eventBus.fire('import.render.start', { definitions: definitions });
|