camunda-bpmn-js 2.0.2 → 2.1.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/base-modeler.development.js +14001 -10194
- package/dist/base-modeler.production.min.js +41 -38
- package/dist/base-navigated-viewer.development.js +161 -121
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +155 -119
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +45602 -38158
- package/dist/camunda-cloud-modeler.production.min.js +35 -32
- package/dist/camunda-cloud-navigated-viewer.development.js +191 -141
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +185 -139
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +35553 -30664
- package/dist/camunda-platform-modeler.production.min.js +35 -32
- package/dist/camunda-platform-navigated-viewer.development.js +161 -121
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +155 -119
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/lib/base/Modeler.js +13 -8
- package/lib/camunda-cloud/Modeler.js +9 -7
- package/lib/camunda-platform/Modeler.js +6 -3
- package/package.json +17 -15
- package/lib/camunda-cloud/features/create-append-anything/ElementTemplatesAppendProvider.js +0 -162
- package/lib/camunda-cloud/features/create-append-anything/ElementTemplatesCreateProvider.js +0 -114
- package/lib/camunda-cloud/features/create-append-anything/index.js +0 -11
- package/lib/camunda-cloud/features/replace/ElementTemplatesReplaceProvider.js +0 -118
- package/lib/camunda-cloud/features/replace/index.js +0 -6
- package/lib/shared/features/replace/UnlinkTemplateReplaceProvider.js +0 -178
- package/lib/shared/features/replace/index.js +0 -8
- package/lib/shared/features/replace/util/ReplaceOptionsUtil.js +0 -7
|
@@ -11038,7 +11038,11 @@
|
|
|
11038
11038
|
}
|
|
11039
11039
|
};
|
|
11040
11040
|
|
|
11041
|
-
var
|
|
11041
|
+
var objectRefsExports = {};
|
|
11042
|
+
var objectRefs = {
|
|
11043
|
+
get exports(){ return objectRefsExports; },
|
|
11044
|
+
set exports(v){ objectRefsExports = v; },
|
|
11045
|
+
};
|
|
11042
11046
|
|
|
11043
11047
|
var collection = {};
|
|
11044
11048
|
|
|
@@ -11358,7 +11362,7 @@
|
|
|
11358
11362
|
module.exports.Collection = collection;
|
|
11359
11363
|
} (objectRefs));
|
|
11360
11364
|
|
|
11361
|
-
var Refs = /*@__PURE__*/getDefaultExportFromCjs(
|
|
11365
|
+
var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
|
|
11362
11366
|
|
|
11363
11367
|
var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
|
|
11364
11368
|
labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
|
|
@@ -21072,7 +21076,20 @@
|
|
|
21072
21076
|
|
|
21073
21077
|
|
|
21074
21078
|
/**
|
|
21075
|
-
* @typedef {
|
|
21079
|
+
* @typedef {import('didi').ModuleDeclaration} ModuleDeclaration
|
|
21080
|
+
*
|
|
21081
|
+
* @typedef {import('./BaseViewer').BaseModelerOptions} BaseModelerOptions
|
|
21082
|
+
* @typedef {import('./BaseViewer').ModdleElement} ModdleElement
|
|
21083
|
+
* @typedef {import('./BaseViewer').ImportXMLResult} ImportXMLResult
|
|
21084
|
+
* @typedef {import('./BaseViewer').ImportXMLError} ImportXMLError
|
|
21085
|
+
* @typedef {import('./BaseViewer').ImportDefinitionsResult} ImportDefinitionsResult
|
|
21086
|
+
* @typedef {import('./BaseViewer').ImportDefinitionsError} ImportDefinitionsError
|
|
21087
|
+
* @typedef {import('./BaseViewer').ModdleElement} ModdleElement
|
|
21088
|
+
* @typedef {import('./BaseViewer').ModdleElementsById} ModdleElementsById
|
|
21089
|
+
* @typedef {import('./BaseViewer').OpenResult} OpenResult
|
|
21090
|
+
* @typedef {import('./BaseViewer').OpenError} OpenError
|
|
21091
|
+
* @typedef {import('./BaseViewer').SaveXMLOptions} SaveXMLOptions
|
|
21092
|
+
* @typedef {import('./BaseViewer').SaveXMLResult} SaveXMLResult
|
|
21076
21093
|
*/
|
|
21077
21094
|
|
|
21078
21095
|
/**
|
|
@@ -21081,20 +21098,20 @@
|
|
|
21081
21098
|
* Have a look at {@link Viewer}, {@link NavigatedViewer} or {@link Modeler} for
|
|
21082
21099
|
* bundles that include actual features.
|
|
21083
21100
|
*
|
|
21084
|
-
* @param {
|
|
21085
|
-
* @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.
|
|
21086
|
-
* @param {string|number} [options.width] the width of the viewer
|
|
21087
|
-
* @param {string|number} [options.height] the height of the viewer
|
|
21088
|
-
* @param {Object} [options.moddleExtensions] extension packages to provide
|
|
21089
|
-
* @param {Module[]} [options.modules] a list of modules to override the default modules
|
|
21090
|
-
* @param {Module[]} [options.additionalModules] a list of modules to use with the default modules
|
|
21101
|
+
* @param {BaseModelerOptions} [options] The options to configure the viewer.
|
|
21091
21102
|
*/
|
|
21092
21103
|
function BaseViewer(options) {
|
|
21093
21104
|
|
|
21105
|
+
/**
|
|
21106
|
+
* @type {BaseModelerOptions}
|
|
21107
|
+
*/
|
|
21094
21108
|
options = assign$1({}, DEFAULT_OPTIONS, options);
|
|
21095
21109
|
|
|
21096
21110
|
this._moddle = this._createModdle(options);
|
|
21097
21111
|
|
|
21112
|
+
/**
|
|
21113
|
+
* @type {HTMLElement}
|
|
21114
|
+
*/
|
|
21098
21115
|
this._container = this._createContainer(options);
|
|
21099
21116
|
|
|
21100
21117
|
/* <project-logo> */
|
|
@@ -21108,22 +21125,6 @@
|
|
|
21108
21125
|
|
|
21109
21126
|
e(BaseViewer, Diagram);
|
|
21110
21127
|
|
|
21111
|
-
/**
|
|
21112
|
-
* The importXML result.
|
|
21113
|
-
*
|
|
21114
|
-
* @typedef {Object} ImportXMLResult
|
|
21115
|
-
*
|
|
21116
|
-
* @property {Array<string>} warnings
|
|
21117
|
-
*/
|
|
21118
|
-
|
|
21119
|
-
/**
|
|
21120
|
-
* The importXML error.
|
|
21121
|
-
*
|
|
21122
|
-
* @typedef {Error} ImportXMLError
|
|
21123
|
-
*
|
|
21124
|
-
* @property {Array<string>} warnings
|
|
21125
|
-
*/
|
|
21126
|
-
|
|
21127
21128
|
/**
|
|
21128
21129
|
* Parse and render a BPMN 2.0 diagram.
|
|
21129
21130
|
*
|
|
@@ -21134,7 +21135,7 @@
|
|
|
21134
21135
|
*
|
|
21135
21136
|
* During import the viewer will fire life-cycle events:
|
|
21136
21137
|
*
|
|
21137
|
-
* * import.parse.start (about to read model from
|
|
21138
|
+
* * import.parse.start (about to read model from XML)
|
|
21138
21139
|
* * import.parse.complete (model read; may have worked or not)
|
|
21139
21140
|
* * import.render.start (graphical import start)
|
|
21140
21141
|
* * import.render.complete (graphical import finished)
|
|
@@ -21142,10 +21143,18 @@
|
|
|
21142
21143
|
*
|
|
21143
21144
|
* You can use these events to hook into the life-cycle.
|
|
21144
21145
|
*
|
|
21145
|
-
* @
|
|
21146
|
-
*
|
|
21146
|
+
* @throws {ImportXMLError} An error thrown during the import of the XML.
|
|
21147
|
+
*
|
|
21148
|
+
* @fires BaseViewer#ImportParseStart
|
|
21149
|
+
* @fires BaseViewer#ImportParseComplete
|
|
21150
|
+
* @fires Importer#ImportRenderStart
|
|
21151
|
+
* @fires Importer#ImportRenderComplete
|
|
21152
|
+
* @fires BaseViewer#ImportDone
|
|
21147
21153
|
*
|
|
21148
|
-
*
|
|
21154
|
+
* @param {string} xml The BPMN 2.0 XML to be imported.
|
|
21155
|
+
* @param {ModdleElement|string} [bpmnDiagram] The optional diagram or Id of the BPMN diagram to open.
|
|
21156
|
+
*
|
|
21157
|
+
* @return {Promise<ImportXMLResult>} A promise resolving with warnings that were produced during the import.
|
|
21149
21158
|
*/
|
|
21150
21159
|
BaseViewer.prototype.importXML = wrapForCompatibility(async function importXML(xml, bpmnDiagram) {
|
|
21151
21160
|
|
|
@@ -21181,6 +21190,14 @@
|
|
|
21181
21190
|
|
|
21182
21191
|
// hook in pre-parse listeners +
|
|
21183
21192
|
// allow xml manipulation
|
|
21193
|
+
|
|
21194
|
+
/**
|
|
21195
|
+
* A `import.parse.start` event.
|
|
21196
|
+
*
|
|
21197
|
+
* @event BaseViewer#ImportParseStart
|
|
21198
|
+
* @type {Object}
|
|
21199
|
+
* @property {string} xml The XML that is to be parsed.
|
|
21200
|
+
*/
|
|
21184
21201
|
xml = this._emit('import.parse.start', { xml: xml }) || xml;
|
|
21185
21202
|
|
|
21186
21203
|
let parseResult;
|
|
@@ -21203,6 +21220,18 @@
|
|
|
21203
21220
|
|
|
21204
21221
|
// hook in post parse listeners +
|
|
21205
21222
|
// allow definitions manipulation
|
|
21223
|
+
|
|
21224
|
+
/**
|
|
21225
|
+
* A `import.parse.complete` event.
|
|
21226
|
+
*
|
|
21227
|
+
* @event BaseViewer#ImportParseComplete
|
|
21228
|
+
* @type {Object}
|
|
21229
|
+
* @property {Error|null} error An error thrown when parsing the XML.
|
|
21230
|
+
* @property {ModdleElement} definitions The definitions model element.
|
|
21231
|
+
* @property {ModdleElementsById} elementsById The model elements by ID.
|
|
21232
|
+
* @property {ModdleElement[]} references The referenced model elements.
|
|
21233
|
+
* @property {string[]} warnings The warnings produced when parsing the XML.
|
|
21234
|
+
*/
|
|
21206
21235
|
definitions = this._emit('import.parse.complete', ParseCompleteEvent({
|
|
21207
21236
|
error: null,
|
|
21208
21237
|
definitions: definitions,
|
|
@@ -21215,6 +21244,14 @@
|
|
|
21215
21244
|
|
|
21216
21245
|
aggregatedWarnings = aggregatedWarnings.concat(importResult.warnings);
|
|
21217
21246
|
|
|
21247
|
+
/**
|
|
21248
|
+
* A `import.parse.complete` event.
|
|
21249
|
+
*
|
|
21250
|
+
* @event BaseViewer#ImportDone
|
|
21251
|
+
* @type {Object}
|
|
21252
|
+
* @property {ImportXMLError|null} error An error thrown during import.
|
|
21253
|
+
* @property {string[]} warnings The warnings.
|
|
21254
|
+
*/
|
|
21218
21255
|
this._emit('import.done', { error: null, warnings: aggregatedWarnings });
|
|
21219
21256
|
|
|
21220
21257
|
return { warnings: aggregatedWarnings };
|
|
@@ -21231,21 +21268,6 @@
|
|
|
21231
21268
|
}
|
|
21232
21269
|
});
|
|
21233
21270
|
|
|
21234
|
-
/**
|
|
21235
|
-
* The importDefinitions result.
|
|
21236
|
-
*
|
|
21237
|
-
* @typedef {Object} ImportDefinitionsResult
|
|
21238
|
-
*
|
|
21239
|
-
* @property {Array<string>} warnings
|
|
21240
|
-
*/
|
|
21241
|
-
|
|
21242
|
-
/**
|
|
21243
|
-
* The importDefinitions error.
|
|
21244
|
-
*
|
|
21245
|
-
* @typedef {Error} ImportDefinitionsError
|
|
21246
|
-
*
|
|
21247
|
-
* @property {Array<string>} warnings
|
|
21248
|
-
*/
|
|
21249
21271
|
|
|
21250
21272
|
/**
|
|
21251
21273
|
* Import parsed definitions and render a BPMN 2.0 diagram.
|
|
@@ -21262,10 +21284,12 @@
|
|
|
21262
21284
|
*
|
|
21263
21285
|
* You can use these events to hook into the life-cycle.
|
|
21264
21286
|
*
|
|
21265
|
-
* @
|
|
21266
|
-
*
|
|
21287
|
+
* @throws {ImportDefinitionsError} An error thrown during the import of the definitions.
|
|
21288
|
+
*
|
|
21289
|
+
* @param {ModdleElement} definitions The definitions.
|
|
21290
|
+
* @param {ModdleElement|string} [bpmnDiagram] The optional diagram or ID of the BPMN diagram to open.
|
|
21267
21291
|
*
|
|
21268
|
-
*
|
|
21292
|
+
* @return {Promise<ImportDefinitionsResult>} A promise resolving with warnings that were produced during the import.
|
|
21269
21293
|
*/
|
|
21270
21294
|
BaseViewer.prototype.importDefinitions = wrapForCompatibility(async function importDefinitions(definitions, bpmnDiagram) {
|
|
21271
21295
|
this._setDefinitions(definitions);
|
|
@@ -21274,21 +21298,6 @@
|
|
|
21274
21298
|
return { warnings: result.warnings };
|
|
21275
21299
|
});
|
|
21276
21300
|
|
|
21277
|
-
/**
|
|
21278
|
-
* The open result.
|
|
21279
|
-
*
|
|
21280
|
-
* @typedef {Object} OpenResult
|
|
21281
|
-
*
|
|
21282
|
-
* @property {Array<string>} warnings
|
|
21283
|
-
*/
|
|
21284
|
-
|
|
21285
|
-
/**
|
|
21286
|
-
* The open error.
|
|
21287
|
-
*
|
|
21288
|
-
* @typedef {Error} OpenError
|
|
21289
|
-
*
|
|
21290
|
-
* @property {Array<string>} warnings
|
|
21291
|
-
*/
|
|
21292
21301
|
|
|
21293
21302
|
/**
|
|
21294
21303
|
* Open diagram of previously imported XML.
|
|
@@ -21305,9 +21314,11 @@
|
|
|
21305
21314
|
*
|
|
21306
21315
|
* You can use these events to hook into the life-cycle.
|
|
21307
21316
|
*
|
|
21308
|
-
* @
|
|
21317
|
+
* @throws {OpenError} An error thrown during opening.
|
|
21309
21318
|
*
|
|
21310
|
-
*
|
|
21319
|
+
* @param {ModdleElement|string} bpmnDiagramOrId The diagram or Id of the BPMN diagram to open.
|
|
21320
|
+
*
|
|
21321
|
+
* @return {Promise<OpenResult>} A promise resolving with warnings that were produced during opening.
|
|
21311
21322
|
*/
|
|
21312
21323
|
BaseViewer.prototype.open = wrapForCompatibility(async function open(bpmnDiagramOrId) {
|
|
21313
21324
|
|
|
@@ -21348,14 +21359,6 @@
|
|
|
21348
21359
|
return { warnings };
|
|
21349
21360
|
});
|
|
21350
21361
|
|
|
21351
|
-
/**
|
|
21352
|
-
* The saveXML result.
|
|
21353
|
-
*
|
|
21354
|
-
* @typedef {Object} SaveXMLResult
|
|
21355
|
-
*
|
|
21356
|
-
* @property {string} xml
|
|
21357
|
-
*/
|
|
21358
|
-
|
|
21359
21362
|
/**
|
|
21360
21363
|
* Export the currently displayed BPMN 2.0 diagram as
|
|
21361
21364
|
* a BPMN 2.0 XML document.
|
|
@@ -21370,11 +21373,14 @@
|
|
|
21370
21373
|
*
|
|
21371
21374
|
* You can use these events to hook into the life-cycle.
|
|
21372
21375
|
*
|
|
21373
|
-
* @
|
|
21374
|
-
*
|
|
21375
|
-
* @
|
|
21376
|
+
* @throws {Error} An error thrown during export.
|
|
21377
|
+
*
|
|
21378
|
+
* @fires BaseViewer#SaveXMLStart
|
|
21379
|
+
* @fires BaseViewer#SaveXMLDone
|
|
21376
21380
|
*
|
|
21377
|
-
*
|
|
21381
|
+
* @param {SaveXMLOptions} [options] The options.
|
|
21382
|
+
*
|
|
21383
|
+
* @return {Promise<SaveXMLResult>} A promise resolving with the XML.
|
|
21378
21384
|
*/
|
|
21379
21385
|
BaseViewer.prototype.saveXML = wrapForCompatibility(async function saveXML(options) {
|
|
21380
21386
|
|
|
@@ -21389,6 +21395,14 @@
|
|
|
21389
21395
|
}
|
|
21390
21396
|
|
|
21391
21397
|
// allow to fiddle around with definitions
|
|
21398
|
+
|
|
21399
|
+
/**
|
|
21400
|
+
* A `saveXML.start` event.
|
|
21401
|
+
*
|
|
21402
|
+
* @event BaseViewer#SaveXMLStart
|
|
21403
|
+
* @type {Object}
|
|
21404
|
+
* @property {ModdleElement} definitions The definitions model element.
|
|
21405
|
+
*/
|
|
21392
21406
|
definitions = this._emit('saveXML.start', {
|
|
21393
21407
|
definitions
|
|
21394
21408
|
}) || definitions;
|
|
@@ -21405,6 +21419,14 @@
|
|
|
21405
21419
|
|
|
21406
21420
|
const result = error ? { error } : { xml };
|
|
21407
21421
|
|
|
21422
|
+
/**
|
|
21423
|
+
* A `saveXML.done` event.
|
|
21424
|
+
*
|
|
21425
|
+
* @event BaseViewer#SaveXMLDone
|
|
21426
|
+
* @type {Object}
|
|
21427
|
+
* @property {Error} [error] An error thrown when saving the XML.
|
|
21428
|
+
* @property {string} [xml] The saved XML.
|
|
21429
|
+
*/
|
|
21408
21430
|
this._emit('saveXML.done', result);
|
|
21409
21431
|
|
|
21410
21432
|
if (error) {
|
|
@@ -21414,13 +21436,6 @@
|
|
|
21414
21436
|
return result;
|
|
21415
21437
|
});
|
|
21416
21438
|
|
|
21417
|
-
/**
|
|
21418
|
-
* The saveSVG result.
|
|
21419
|
-
*
|
|
21420
|
-
* @typedef {Object} SaveSVGResult
|
|
21421
|
-
*
|
|
21422
|
-
* @property {string} svg
|
|
21423
|
-
*/
|
|
21424
21439
|
|
|
21425
21440
|
/**
|
|
21426
21441
|
* Export the currently displayed BPMN 2.0 diagram as
|
|
@@ -21435,11 +21450,13 @@
|
|
|
21435
21450
|
*
|
|
21436
21451
|
* You can use these events to hook into the life-cycle.
|
|
21437
21452
|
*
|
|
21438
|
-
* @
|
|
21453
|
+
* @throws {Error} An error thrown during export.
|
|
21439
21454
|
*
|
|
21440
|
-
*
|
|
21455
|
+
* @fires BaseViewer#SaveSVGDone
|
|
21456
|
+
*
|
|
21457
|
+
* @return {Promise<SaveSVGResult>} A promise resolving with the SVG.
|
|
21441
21458
|
*/
|
|
21442
|
-
BaseViewer.prototype.saveSVG = wrapForCompatibility(async function saveSVG(
|
|
21459
|
+
BaseViewer.prototype.saveSVG = wrapForCompatibility(async function saveSVG() {
|
|
21443
21460
|
this._emit('saveSVG.start');
|
|
21444
21461
|
|
|
21445
21462
|
let svg, err;
|
|
@@ -21468,6 +21485,14 @@
|
|
|
21468
21485
|
err = e;
|
|
21469
21486
|
}
|
|
21470
21487
|
|
|
21488
|
+
/**
|
|
21489
|
+
* A `saveSVG.done` event.
|
|
21490
|
+
*
|
|
21491
|
+
* @event BaseViewer#SaveSVGDone
|
|
21492
|
+
* @type {Object}
|
|
21493
|
+
* @property {Error} [error] An error thrown when saving the SVG.
|
|
21494
|
+
* @property {string} [svg] The saved SVG.
|
|
21495
|
+
*/
|
|
21471
21496
|
this._emit('saveSVG.done', {
|
|
21472
21497
|
error: err,
|
|
21473
21498
|
svg: svg
|
|
@@ -21519,21 +21544,17 @@
|
|
|
21519
21544
|
/**
|
|
21520
21545
|
* Return modules to instantiate with.
|
|
21521
21546
|
*
|
|
21522
|
-
* @
|
|
21523
|
-
*
|
|
21524
|
-
* @return {Module[]}
|
|
21547
|
+
* @return {ModuleDeclaration[]} The modules.
|
|
21525
21548
|
*/
|
|
21526
|
-
BaseViewer.prototype.getModules = function(
|
|
21549
|
+
BaseViewer.prototype.getModules = function() {
|
|
21527
21550
|
return this._modules;
|
|
21528
21551
|
};
|
|
21529
21552
|
|
|
21530
21553
|
/**
|
|
21531
21554
|
* Remove all drawn elements from the viewer.
|
|
21532
21555
|
*
|
|
21533
|
-
* After calling this method the viewer can still
|
|
21534
|
-
*
|
|
21535
|
-
*
|
|
21536
|
-
* @method BaseViewer#clear
|
|
21556
|
+
* After calling this method the viewer can still be reused for opening another
|
|
21557
|
+
* diagram.
|
|
21537
21558
|
*/
|
|
21538
21559
|
BaseViewer.prototype.clear = function() {
|
|
21539
21560
|
if (!this.getDefinitions()) {
|
|
@@ -21547,8 +21568,8 @@
|
|
|
21547
21568
|
};
|
|
21548
21569
|
|
|
21549
21570
|
/**
|
|
21550
|
-
* Destroy the viewer instance and remove all its
|
|
21551
|
-
*
|
|
21571
|
+
* Destroy the viewer instance and remove all its remainders from the document
|
|
21572
|
+
* tree.
|
|
21552
21573
|
*/
|
|
21553
21574
|
BaseViewer.prototype.destroy = function() {
|
|
21554
21575
|
|
|
@@ -21560,29 +21581,34 @@
|
|
|
21560
21581
|
};
|
|
21561
21582
|
|
|
21562
21583
|
/**
|
|
21563
|
-
* Register an event listener
|
|
21584
|
+
* Register an event listener.
|
|
21564
21585
|
*
|
|
21565
|
-
* Remove
|
|
21586
|
+
* Remove an event listener via {@link BaseViewer#off}.
|
|
21566
21587
|
*
|
|
21567
|
-
* @param {string} event
|
|
21568
|
-
* @param {number} [priority]
|
|
21569
|
-
* @param {
|
|
21570
|
-
* @param {
|
|
21588
|
+
* @param {string|string[]} events The event(s) to listen to.
|
|
21589
|
+
* @param {number} [priority] The priority with which to listen.
|
|
21590
|
+
* @param {EventCallback} callback The callback.
|
|
21591
|
+
* @param {*} [that] Value of `this` the callback will be called with.
|
|
21571
21592
|
*/
|
|
21572
|
-
BaseViewer.prototype.on = function(
|
|
21573
|
-
return this.get('eventBus').on(
|
|
21593
|
+
BaseViewer.prototype.on = function(events, priority, callback, that) {
|
|
21594
|
+
return this.get('eventBus').on(events, priority, callback, that);
|
|
21574
21595
|
};
|
|
21575
21596
|
|
|
21576
21597
|
/**
|
|
21577
|
-
*
|
|
21598
|
+
* Remove an event listener.
|
|
21578
21599
|
*
|
|
21579
|
-
* @param {string} event
|
|
21580
|
-
* @param {Function} callback
|
|
21600
|
+
* @param {string|string[]} events The event(s).
|
|
21601
|
+
* @param {Function} [callback] The callback.
|
|
21581
21602
|
*/
|
|
21582
|
-
BaseViewer.prototype.off = function(
|
|
21583
|
-
this.get('eventBus').off(
|
|
21603
|
+
BaseViewer.prototype.off = function(events, callback) {
|
|
21604
|
+
this.get('eventBus').off(events, callback);
|
|
21584
21605
|
};
|
|
21585
21606
|
|
|
21607
|
+
/**
|
|
21608
|
+
* Attach the viewer to an HTML element.
|
|
21609
|
+
*
|
|
21610
|
+
* @param {HTMLElement} parentNode The parent node to attach to.
|
|
21611
|
+
*/
|
|
21586
21612
|
BaseViewer.prototype.attachTo = function(parentNode) {
|
|
21587
21613
|
|
|
21588
21614
|
if (!parentNode) {
|
|
@@ -21609,10 +21635,20 @@
|
|
|
21609
21635
|
this.get('canvas').resized();
|
|
21610
21636
|
};
|
|
21611
21637
|
|
|
21638
|
+
/**
|
|
21639
|
+
* Get the definitions model element.
|
|
21640
|
+
*
|
|
21641
|
+
* @returns {ModdleElement} The definitions model element.
|
|
21642
|
+
*/
|
|
21612
21643
|
BaseViewer.prototype.getDefinitions = function() {
|
|
21613
21644
|
return this._definitions;
|
|
21614
21645
|
};
|
|
21615
21646
|
|
|
21647
|
+
/**
|
|
21648
|
+
* Detach the viewer.
|
|
21649
|
+
*
|
|
21650
|
+
* @fires BaseViewer#DetachEvent
|
|
21651
|
+
*/
|
|
21616
21652
|
BaseViewer.prototype.detach = function() {
|
|
21617
21653
|
|
|
21618
21654
|
const container = this._container,
|
|
@@ -21622,6 +21658,12 @@
|
|
|
21622
21658
|
return;
|
|
21623
21659
|
}
|
|
21624
21660
|
|
|
21661
|
+
/**
|
|
21662
|
+
* A `detach` event.
|
|
21663
|
+
*
|
|
21664
|
+
* @event BaseViewer#DetachEvent
|
|
21665
|
+
* @type {Object}
|
|
21666
|
+
*/
|
|
21625
21667
|
this._emit('detach', {});
|
|
21626
21668
|
|
|
21627
21669
|
parentNode.removeChild(container);
|
|
@@ -21659,7 +21701,7 @@
|
|
|
21659
21701
|
* @param {string} type
|
|
21660
21702
|
* @param {Object} event
|
|
21661
21703
|
*
|
|
21662
|
-
* @return {Object}
|
|
21704
|
+
* @return {Object} The return value after calling all event listeners.
|
|
21663
21705
|
*/
|
|
21664
21706
|
BaseViewer.prototype._emit = function(type, event) {
|
|
21665
21707
|
return this.get('eventBus').fire(type, event);
|
|
@@ -21785,7 +21827,7 @@
|
|
|
21785
21827
|
/* </project-logo> */
|
|
21786
21828
|
|
|
21787
21829
|
/**
|
|
21788
|
-
* @typedef { import('
|
|
21830
|
+
* @typedef { import('./BaseViewer').BaseViewerOptions } BaseViewerOptions
|
|
21789
21831
|
*/
|
|
21790
21832
|
|
|
21791
21833
|
/**
|
|
@@ -21827,13 +21869,7 @@
|
|
|
21827
21869
|
* bpmnViewer.importXML(...);
|
|
21828
21870
|
* ```
|
|
21829
21871
|
*
|
|
21830
|
-
* @param {
|
|
21831
|
-
* @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.
|
|
21832
|
-
* @param {string|number} [options.width] the width of the viewer
|
|
21833
|
-
* @param {string|number} [options.height] the height of the viewer
|
|
21834
|
-
* @param {Object} [options.moddleExtensions] extension packages to provide
|
|
21835
|
-
* @param {Module[]} [options.modules] a list of modules to override the default modules
|
|
21836
|
-
* @param {Module[]} [options.additionalModules] a list of modules to use with the default modules
|
|
21872
|
+
* @param {BaseViewerOptions} [options] The options to configure the viewer.
|
|
21837
21873
|
*/
|
|
21838
21874
|
function Viewer(options) {
|
|
21839
21875
|
BaseViewer.call(this, options);
|
|
@@ -22844,9 +22880,13 @@
|
|
|
22844
22880
|
};
|
|
22845
22881
|
|
|
22846
22882
|
/**
|
|
22847
|
-
*
|
|
22883
|
+
* @typedef { import('./BaseViewer').BaseViewerOptions } BaseViewerOptions
|
|
22884
|
+
*/
|
|
22885
|
+
|
|
22886
|
+
/**
|
|
22887
|
+
* A viewer with mouse and keyboard navigation features.
|
|
22848
22888
|
*
|
|
22849
|
-
* @param {
|
|
22889
|
+
* @param {BaseViewerOptions} [options]
|
|
22850
22890
|
*/
|
|
22851
22891
|
function NavigatedViewer$1(options) {
|
|
22852
22892
|
Viewer.call(this, options);
|