xref: /plugin/bpmnio/build/vendor-entrypoints/bpmn-viewer.js (revision c88bd154bd573c8ceefeb9b009eba97536aec54c)
1import Viewer from 'bpmn-js/lib/Viewer';
2import lintModule from 'bpmn-js-bpmnlint';
3import { config, resolver } from '../generated/bpmnlintrc.packed.js';
4
5const root = globalThis;
6root.BpmnJS = Viewer;
7root.BpmnJS.Viewer = Viewer;
8
9// Linter integration. bpmn-js-bpmnlint runs in a plain Viewer: every service it
10// needs (canvas, overlays, elementRegistry, eventBus, translate, bpmnjs) ships
11// with the Viewer, and its editor-action helper resolves editorActions
12// optionally. The render script passes lintModule + lintConfig into the
13// constructor; we expose them here so it can opt diagrams in or out.
14const lintConfig = { config, resolver };
15
16root.BpmnLintModule = lintModule;
17root.BpmnLintConfig = lintConfig;
18Viewer.lintModule = lintModule;
19Viewer.lintConfig = lintConfig;
20
21export default Viewer;
22