-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathModeler.js
66 lines (54 loc) · 1.51 KB
/
Modeler.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import inherits from 'inherits-browser';
import BpmnModeler from 'bpmn-js/lib/Modeler';
import minimapModule from 'diagram-js-minimap';
import gridModule from 'diagram-js-grid';
import diagramOriginModule from 'diagram-js-origin';
import alignToOriginModule from '@bpmn-io/align-to-origin';
import executableFixModule from 'bpmn-js-executable-fix';
import {
BpmnPropertiesPanelModule as propertiesPanelModule,
BpmnPropertiesProviderModule as bpmnPropertiesProviderModule
} from 'bpmn-js-properties-panel';
/**
* @typedef {import('bpmn-js/lib/BaseViewer').BaseViewerOptions} BaseViewerOptions
*
* @typedef {import('didi').ModuleDeclaration} ModuleDeclaration
*/
/**
*
* @param {BaseViewerOptions} options
*/
export default function Modeler(options = {}) {
BpmnModeler.call(this, options);
}
inherits(Modeler, BpmnModeler);
/**
* @param { {
* disableAdjustOrigin?: boolean;
* disableGrid?: boolean;
* } } [options]
*
* @returns {ModuleDeclaration[]}
*/
Modeler.prototype.getModules = function(options = {}) {
const modules = BpmnModeler.prototype.getModules.call(this, options);
return [
...modules,
options.disableAdjustOrigin
? diagramOriginModule
: alignToOriginModule,
options.disableGrid
? {}
: gridModule
];
};
Modeler.prototype._extensionModules = [
minimapModule,
executableFixModule,
propertiesPanelModule,
bpmnPropertiesProviderModule
];
Modeler.prototype._modules = [].concat(
BpmnModeler.prototype._modules,
Modeler.prototype._extensionModules
);