feat: introduce plugins infrastructure and add OverlaysPlugin
#62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This infrastructure is a first try to propose extension points with plugins. It is subject to change in the future.
The
OverlaysPlugin
demonstrates how to create and use a plugin. It provides a method to show or hide overlays. They stay in the DOM contrarily to theBpmnElementsRegistry.removeOverlays
method that actually removes overlays from the model.Hiding overlays supports BPMN navigation which means that the overlays stay hidden while panning and zooming.
Demo
OverlaysPlugin
Build of the 'addons' lib: generate sourceMap to easily debug the demo.
Notes
closes #8
The idea of having a method to hide/show overlays comes from process-analytics/bpmn-visualization-js#1217: mxGraph stores overlays in a dedicated HTML element, so it is easy to hide it.
The BPMN navigation doesn't remove the style applied externally from mxGraph (to hide the overlays) as shown in the video below 👇🏿. It is currently not activated in the demo because when doing a panning to the bottom of the page, the container height increases. This probably occurs because the height is not detected as a 'fixed' value. This will enable later (#63).
demo_OverlaysPlugin_support_navigation.mp4