camunda-bpmn-js 1.5.0 → 2.0.1
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.
|
@@ -41744,7 +41744,7 @@
|
|
|
41744
41744
|
return element.waypoints;
|
|
41745
41745
|
}
|
|
41746
41746
|
|
|
41747
|
-
var
|
|
41747
|
+
var CreateAppendAnythingModule = {
|
|
41748
41748
|
__depends__: [
|
|
41749
41749
|
PaletteModule$1,
|
|
41750
41750
|
PopupMenuModule$1,
|
|
@@ -64241,7 +64241,7 @@
|
|
|
64241
64241
|
ContextPadModule,
|
|
64242
64242
|
CopyPasteModule,
|
|
64243
64243
|
CreateModule,
|
|
64244
|
-
|
|
64244
|
+
CreateAppendAnythingModule,
|
|
64245
64245
|
DistributeElementsModule,
|
|
64246
64246
|
EditorActionsModule,
|
|
64247
64247
|
GridSnappingModule,
|
|
@@ -65328,7 +65328,7 @@
|
|
|
65328
65328
|
};
|
|
65329
65329
|
}
|
|
65330
65330
|
|
|
65331
|
-
var index$
|
|
65331
|
+
var index$5 = {
|
|
65332
65332
|
__init__: [ 'minimap' ],
|
|
65333
65333
|
minimap: [ 'type', Minimap ]
|
|
65334
65334
|
};
|
|
@@ -90495,7 +90495,7 @@
|
|
|
90495
90495
|
}
|
|
90496
90496
|
debounceInput.$inject = ['config.debounceInput'];
|
|
90497
90497
|
|
|
90498
|
-
var index = {
|
|
90498
|
+
var index$4 = {
|
|
90499
90499
|
debounceInput: ['factory', debounceInput]
|
|
90500
90500
|
};
|
|
90501
90501
|
|
|
@@ -94424,7 +94424,7 @@
|
|
|
94424
94424
|
};
|
|
94425
94425
|
|
|
94426
94426
|
var index$3 = {
|
|
94427
|
-
__depends__: [Commands, index],
|
|
94427
|
+
__depends__: [Commands, index$4],
|
|
94428
94428
|
__init__: ['propertiesPanel'],
|
|
94429
94429
|
propertiesPanel: ['type', BpmnPropertiesPanelRenderer]
|
|
94430
94430
|
};
|
|
@@ -104832,7 +104832,7 @@
|
|
|
104832
104832
|
};
|
|
104833
104833
|
|
|
104834
104834
|
Modeler$1.prototype._extensionModules = [
|
|
104835
|
-
index$
|
|
104835
|
+
index$5,
|
|
104836
104836
|
ExecutableFixModule,
|
|
104837
104837
|
index$3,
|
|
104838
104838
|
index$2
|
|
@@ -109544,13 +109544,13 @@
|
|
|
109544
109544
|
*/
|
|
109545
109545
|
ElementTemplatesReplaceProvider.prototype._getMatchingTemplates = function(element) {
|
|
109546
109546
|
return this._elementTemplates.getLatest().filter(template => {
|
|
109547
|
-
return isAny(element, template.appliesTo) && !isTemplateApplied(element, template);
|
|
109547
|
+
return isAny(element, template.appliesTo) && !isTemplateApplied$1(element, template);
|
|
109548
109548
|
});
|
|
109549
109549
|
};
|
|
109550
109550
|
|
|
109551
109551
|
|
|
109552
109552
|
// helpers ////////////
|
|
109553
|
-
function isTemplateApplied(element, template) {
|
|
109553
|
+
function isTemplateApplied$1(element, template) {
|
|
109554
109554
|
const businessObject = getBusinessObject$2(element);
|
|
109555
109555
|
|
|
109556
109556
|
if (businessObject) {
|
|
@@ -110215,6 +110215,195 @@
|
|
|
110215
110215
|
elementTemplatesCreateProvider: [ 'type', ElementTemplatesCreateProvider ]
|
|
110216
110216
|
};
|
|
110217
110217
|
|
|
110218
|
+
/**
|
|
110219
|
+
* An element template chooser that hooks into
|
|
110220
|
+
* properties panel fired "choose template" events.
|
|
110221
|
+
*
|
|
110222
|
+
* @param {Object} config
|
|
110223
|
+
* @param {EventBus} eventBus
|
|
110224
|
+
* @param {ElementTemplates} elementTemplates
|
|
110225
|
+
* @param {Translate} translate
|
|
110226
|
+
* @param {PopupMenu} popupMenu
|
|
110227
|
+
*/
|
|
110228
|
+
function ElementTemplateChooser(
|
|
110229
|
+
config,
|
|
110230
|
+
eventBus,
|
|
110231
|
+
elementTemplates,
|
|
110232
|
+
translate,
|
|
110233
|
+
popupMenu) {
|
|
110234
|
+
|
|
110235
|
+
this._eventBus = eventBus;
|
|
110236
|
+
this._elementTemplates = elementTemplates;
|
|
110237
|
+
this._translate = translate;
|
|
110238
|
+
this._popupMenu = popupMenu;
|
|
110239
|
+
|
|
110240
|
+
const enableChooser = !config || config.elementTemplateChooser !== false;
|
|
110241
|
+
|
|
110242
|
+
enableChooser && eventBus.on('elementTemplates.select', (event) => {
|
|
110243
|
+
|
|
110244
|
+
const { element } = event;
|
|
110245
|
+
|
|
110246
|
+
this.open(element).then(template => {
|
|
110247
|
+
elementTemplates.applyTemplate(element, template);
|
|
110248
|
+
}).catch(err => {
|
|
110249
|
+
if (err !== 'user-canceled') {
|
|
110250
|
+
console.error('elementTemplate.select :: error', err);
|
|
110251
|
+
}
|
|
110252
|
+
});
|
|
110253
|
+
});
|
|
110254
|
+
}
|
|
110255
|
+
|
|
110256
|
+
ElementTemplateChooser.$inject = [
|
|
110257
|
+
'config.connectorsExtension',
|
|
110258
|
+
'eventBus',
|
|
110259
|
+
'elementTemplates',
|
|
110260
|
+
'translate',
|
|
110261
|
+
'popupMenu'
|
|
110262
|
+
];
|
|
110263
|
+
|
|
110264
|
+
ElementTemplateChooser.prototype.open = function(element) {
|
|
110265
|
+
|
|
110266
|
+
const popupMenu = this._popupMenu;
|
|
110267
|
+
const translate = this._translate;
|
|
110268
|
+
const eventBus = this._eventBus;
|
|
110269
|
+
|
|
110270
|
+
return new Promise((resolve, reject) => {
|
|
110271
|
+
|
|
110272
|
+
const handleClosed = () => reject('user-canceled');
|
|
110273
|
+
|
|
110274
|
+
eventBus.once('popupMenu.close', handleClosed);
|
|
110275
|
+
|
|
110276
|
+
eventBus.once('elementTemplateChooser.chosen', event => {
|
|
110277
|
+
|
|
110278
|
+
const { template } = event;
|
|
110279
|
+
|
|
110280
|
+
eventBus.off('popupMenu.close', handleClosed);
|
|
110281
|
+
|
|
110282
|
+
resolve(template);
|
|
110283
|
+
});
|
|
110284
|
+
|
|
110285
|
+
popupMenu.open(element, 'element-template-chooser', { x: 0, y: 0 }, {
|
|
110286
|
+
title: translate('Choose element template'),
|
|
110287
|
+
search: true,
|
|
110288
|
+
width: 350
|
|
110289
|
+
});
|
|
110290
|
+
});
|
|
110291
|
+
|
|
110292
|
+
};
|
|
110293
|
+
|
|
110294
|
+
/**
|
|
110295
|
+
* A entry provider for the <element-template-chooser> popup menu.
|
|
110296
|
+
*/
|
|
110297
|
+
function ElementTemplateChooserEntryProvider(popupMenu, eventBus, translate, elementTemplates) {
|
|
110298
|
+
|
|
110299
|
+
this._popupMenu = popupMenu;
|
|
110300
|
+
this._eventBus = eventBus;
|
|
110301
|
+
this._translate = translate;
|
|
110302
|
+
this._elementTemplates = elementTemplates;
|
|
110303
|
+
|
|
110304
|
+
this.register();
|
|
110305
|
+
}
|
|
110306
|
+
|
|
110307
|
+
ElementTemplateChooserEntryProvider.$inject = [
|
|
110308
|
+
'popupMenu',
|
|
110309
|
+
'eventBus',
|
|
110310
|
+
'translate',
|
|
110311
|
+
'elementTemplates'
|
|
110312
|
+
];
|
|
110313
|
+
|
|
110314
|
+
/**
|
|
110315
|
+
* Register replace menu provider in the popup menu
|
|
110316
|
+
*/
|
|
110317
|
+
ElementTemplateChooserEntryProvider.prototype.register = function() {
|
|
110318
|
+
this._popupMenu.registerProvider('element-template-chooser', this);
|
|
110319
|
+
};
|
|
110320
|
+
|
|
110321
|
+
/**
|
|
110322
|
+
* Adds the element templates to the replace menu.
|
|
110323
|
+
* @param {djs.model.Base} element
|
|
110324
|
+
*
|
|
110325
|
+
* @returns {Object}
|
|
110326
|
+
*/
|
|
110327
|
+
ElementTemplateChooserEntryProvider.prototype.getPopupMenuEntries = function(element) {
|
|
110328
|
+
|
|
110329
|
+
// convert to object
|
|
110330
|
+
return this.getTemplateEntries(element).reduce((entries, [ key, value ]) => {
|
|
110331
|
+
entries[key] = value;
|
|
110332
|
+
|
|
110333
|
+
return entries;
|
|
110334
|
+
}, {});
|
|
110335
|
+
|
|
110336
|
+
};
|
|
110337
|
+
|
|
110338
|
+
/**
|
|
110339
|
+
* Get all element templates that can be used to replace the given element.
|
|
110340
|
+
*
|
|
110341
|
+
* @param {djs.model.Base} element
|
|
110342
|
+
*
|
|
110343
|
+
* @return {Array<Object>} a list of element templates as menu entries
|
|
110344
|
+
*/
|
|
110345
|
+
ElementTemplateChooserEntryProvider.prototype.getTemplateEntries = function(element) {
|
|
110346
|
+
|
|
110347
|
+
const eventBus = this._eventBus;
|
|
110348
|
+
const translate = this._translate;
|
|
110349
|
+
|
|
110350
|
+
return this._getMatchingTemplates(element).map(template => {
|
|
110351
|
+
|
|
110352
|
+
const {
|
|
110353
|
+
icon = {},
|
|
110354
|
+
category
|
|
110355
|
+
} = template;
|
|
110356
|
+
|
|
110357
|
+
const entryId = `apply-template-${ template.id }`;
|
|
110358
|
+
|
|
110359
|
+
return [ entryId, {
|
|
110360
|
+
label: template.name && translate(template.name),
|
|
110361
|
+
description: template.description && translate(template.description),
|
|
110362
|
+
documentationRef: template.documentationRef,
|
|
110363
|
+
imageUrl: icon.contents,
|
|
110364
|
+
group: category && { ...category, name: translate(category.name) },
|
|
110365
|
+
action: () => {
|
|
110366
|
+
eventBus.fire('elementTemplateChooser.chosen', { element, template });
|
|
110367
|
+
}
|
|
110368
|
+
} ];
|
|
110369
|
+
});
|
|
110370
|
+
};
|
|
110371
|
+
|
|
110372
|
+
/**
|
|
110373
|
+
* Returns the templates that can the element can be replaced with.
|
|
110374
|
+
*
|
|
110375
|
+
* @param {djs.model.Base} element
|
|
110376
|
+
*
|
|
110377
|
+
* @return {Array<ElementTemplate>}
|
|
110378
|
+
*/
|
|
110379
|
+
ElementTemplateChooserEntryProvider.prototype._getMatchingTemplates = function(element) {
|
|
110380
|
+
return this._elementTemplates.getLatest().filter(template => {
|
|
110381
|
+
return isAny(element, template.appliesTo) && !isTemplateApplied(element, template);
|
|
110382
|
+
});
|
|
110383
|
+
};
|
|
110384
|
+
|
|
110385
|
+
|
|
110386
|
+
// helpers ////////////
|
|
110387
|
+
|
|
110388
|
+
function isTemplateApplied(element, template) {
|
|
110389
|
+
const businessObject = getBusinessObject$2(element);
|
|
110390
|
+
|
|
110391
|
+
if (businessObject) {
|
|
110392
|
+
return businessObject.get('modelerTemplate') === template.id;
|
|
110393
|
+
}
|
|
110394
|
+
|
|
110395
|
+
return false;
|
|
110396
|
+
}
|
|
110397
|
+
|
|
110398
|
+
var index = {
|
|
110399
|
+
__init__: [
|
|
110400
|
+
'elementTemplateChooser',
|
|
110401
|
+
'elementTemplateChooserEntryProvider'
|
|
110402
|
+
],
|
|
110403
|
+
elementTemplateChooser: [ 'type', ElementTemplateChooser ],
|
|
110404
|
+
elementTemplateChooserEntryProvider: [ 'type', ElementTemplateChooserEntryProvider ]
|
|
110405
|
+
};
|
|
110406
|
+
|
|
110218
110407
|
var inherits_browser = {exports: {}};
|
|
110219
110408
|
|
|
110220
110409
|
if (typeof Object.create === 'function') {
|
|
@@ -110772,21 +110961,21 @@
|
|
|
110772
110961
|
propertiesPanel: {
|
|
110773
110962
|
description: DescriptionProvider,
|
|
110774
110963
|
...options.propertiesPanel
|
|
110775
|
-
}
|
|
110964
|
+
},
|
|
110776
110965
|
};
|
|
110777
110966
|
|
|
110778
|
-
this.
|
|
110967
|
+
this._addElementTemplateChooserModule(options);
|
|
110779
110968
|
|
|
110780
110969
|
Modeler$1.call(this, options);
|
|
110781
110970
|
}
|
|
110782
110971
|
|
|
110783
110972
|
e$6(Modeler, Modeler$1);
|
|
110784
110973
|
|
|
110785
|
-
Modeler.prototype.
|
|
110786
|
-
const {
|
|
110974
|
+
Modeler.prototype._addElementTemplateChooserModule = function(options) {
|
|
110975
|
+
const { elementTemplateChooser } = options;
|
|
110787
110976
|
|
|
110788
|
-
if (
|
|
110789
|
-
this._modules =
|
|
110977
|
+
if (elementTemplateChooser !== false) {
|
|
110978
|
+
this._modules = [ ...this._modules, index ];
|
|
110790
110979
|
}
|
|
110791
110980
|
};
|
|
110792
110981
|
|