bpmn-js 12.1.0 → 13.0.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/bpmn-modeler.development.js +5172 -2047
- package/dist/bpmn-modeler.production.min.js +35 -35
- package/dist/bpmn-navigated-viewer.development.js +1547 -589
- package/dist/bpmn-navigated-viewer.production.min.js +5 -5
- package/dist/bpmn-viewer.development.js +1525 -584
- package/dist/bpmn-viewer.production.min.js +5 -5
- package/lib/BaseModeler.d.ts +12 -5
- package/lib/BaseModeler.js +4 -5
- package/lib/BaseViewer.d.ts +160 -366
- package/lib/BaseViewer.js +136 -57
- package/lib/Modeler.d.ts +76 -15
- package/lib/Modeler.js +6 -4
- package/lib/NavigatedViewer.d.ts +8 -3
- package/lib/Viewer.d.ts +44 -3
- package/lib/core/index.d.ts +10 -0
- package/lib/draw/BpmnRenderUtil.d.ts +76 -0
- package/lib/draw/BpmnRenderUtil.js +73 -21
- package/lib/draw/BpmnRenderer.d.ts +124 -0
- package/lib/draw/BpmnRenderer.js +51 -0
- package/lib/draw/PathMap.d.ts +330 -0
- package/lib/draw/PathMap.js +9 -2
- package/lib/draw/TextRenderer.d.ts +74 -0
- package/lib/draw/TextRenderer.js +32 -11
- package/lib/draw/index.d.ts +10 -0
- package/lib/features/align-elements/AlignElementsContextPadProvider.d.ts +32 -0
- package/lib/features/align-elements/AlignElementsContextPadProvider.js +28 -5
- package/lib/features/align-elements/AlignElementsIcons.d.ts +10 -0
- package/lib/features/align-elements/AlignElementsMenuProvider.d.ts +32 -0
- package/lib/features/align-elements/AlignElementsMenuProvider.js +38 -10
- package/lib/features/align-elements/BpmnAlignElements.d.ts +9 -0
- package/lib/features/align-elements/BpmnAlignElements.js +7 -1
- package/lib/features/align-elements/index.d.ts +11 -0
- package/lib/features/auto-place/BpmnAutoPlace.d.ts +13 -0
- package/lib/features/auto-place/BpmnAutoPlace.js +3 -0
- package/lib/features/auto-place/BpmnAutoPlaceUtil.d.ts +47 -0
- package/lib/features/auto-place/BpmnAutoPlaceUtil.js +39 -11
- package/lib/features/auto-place/index.d.ts +7 -0
- package/lib/features/auto-resize/BpmnAutoResize.d.ts +25 -0
- package/lib/features/auto-resize/BpmnAutoResize.js +15 -7
- package/lib/features/auto-resize/BpmnAutoResizeProvider.d.ts +26 -0
- package/lib/features/auto-resize/BpmnAutoResizeProvider.js +16 -4
- package/lib/features/auto-resize/index.d.ts +8 -0
- package/lib/features/context-pad/ContextPadProvider.d.ts +60 -0
- package/lib/features/context-pad/ContextPadProvider.js +64 -9
- package/lib/features/context-pad/index.d.ts +7 -0
- package/lib/features/copy-paste/BpmnCopyPaste.d.ts +17 -0
- package/lib/features/copy-paste/BpmnCopyPaste.js +15 -7
- package/lib/features/copy-paste/ModdleCopy.d.ts +45 -0
- package/lib/features/copy-paste/ModdleCopy.js +17 -45
- package/lib/features/copy-paste/index.d.ts +9 -0
- package/lib/features/di-ordering/BpmnDiOrdering.d.ts +11 -0
- package/lib/features/di-ordering/BpmnDiOrdering.js +8 -0
- package/lib/features/di-ordering/index.d.ts +6 -0
- package/lib/features/distribute-elements/BpmnDistributeElements.d.ts +10 -0
- package/lib/features/distribute-elements/BpmnDistributeElements.js +9 -4
- package/lib/features/distribute-elements/DistributeElementsIcons.d.ts +5 -0
- package/lib/features/distribute-elements/DistributeElementsMenuProvider.d.ts +32 -0
- package/lib/features/distribute-elements/DistributeElementsMenuProvider.js +27 -4
- package/lib/features/distribute-elements/index.d.ts +9 -0
- package/lib/features/drilldown/DrilldownBreadcrumbs.d.ts +19 -0
- package/lib/features/drilldown/DrilldownBreadcrumbs.js +34 -24
- package/lib/features/drilldown/DrilldownCentering.d.ts +17 -0
- package/lib/features/drilldown/DrilldownCentering.js +7 -2
- package/lib/features/drilldown/DrilldownOverlayBehavior.d.ts +18 -0
- package/lib/features/drilldown/DrilldownOverlayBehavior.js +70 -40
- package/lib/features/drilldown/SubprocessCompatibility.d.ts +21 -0
- package/lib/features/drilldown/SubprocessCompatibility.js +80 -30
- package/lib/features/drilldown/index.d.ts +13 -0
- package/lib/features/editor-actions/BpmnEditorActions.d.ts +13 -0
- package/lib/features/editor-actions/BpmnEditorActions.js +4 -0
- package/lib/features/editor-actions/index.d.ts +6 -0
- package/lib/features/grid-snapping/BpmnGridSnapping.d.ts +9 -0
- package/lib/features/grid-snapping/BpmnGridSnapping.js +7 -0
- package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.d.ts +12 -0
- package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.js +16 -1
- package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.d.ts +27 -0
- package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js +20 -8
- package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.d.ts +13 -0
- package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.js +11 -1
- package/lib/features/grid-snapping/behavior/index.d.ts +10 -0
- package/lib/features/grid-snapping/index.d.ts +11 -0
- package/lib/features/interaction-events/BpmnInteractionEvents.d.ts +18 -0
- package/lib/features/interaction-events/BpmnInteractionEvents.js +34 -9
- package/lib/features/interaction-events/index.d.ts +6 -0
- package/lib/features/keyboard/BpmnKeyboardBindings.d.ts +15 -0
- package/lib/features/keyboard/BpmnKeyboardBindings.js +5 -0
- package/lib/features/keyboard/index.d.ts +7 -0
- package/lib/features/label-editing/LabelEditingPreview.d.ts +13 -0
- package/lib/features/label-editing/LabelEditingPreview.js +13 -6
- package/lib/features/label-editing/LabelEditingProvider.d.ts +62 -0
- package/lib/features/label-editing/LabelEditingProvider.js +48 -11
- package/lib/features/label-editing/LabelUtil.d.ts +14 -0
- package/lib/features/label-editing/LabelUtil.js +16 -1
- package/lib/features/label-editing/cmd/UpdateLabelHandler.d.ts +22 -0
- package/lib/features/label-editing/cmd/UpdateLabelHandler.js +14 -3
- package/lib/features/label-editing/index.d.ts +9 -0
- package/lib/features/modeling/BpmnFactory.d.ts +67 -0
- package/lib/features/modeling/BpmnFactory.js +57 -8
- package/lib/features/modeling/BpmnLayouter.d.ts +26 -0
- package/lib/features/modeling/BpmnLayouter.js +25 -2
- package/lib/features/modeling/BpmnUpdater.d.ts +92 -0
- package/lib/features/modeling/BpmnUpdater.js +90 -29
- package/lib/features/modeling/ElementFactory.d.ts +116 -0
- package/lib/features/modeling/ElementFactory.js +114 -17
- package/lib/features/modeling/ElementFactory.test.ts +133 -0
- package/lib/features/modeling/Modeling.d.ts +150 -0
- package/lib/features/modeling/Modeling.js +124 -19
- package/lib/features/modeling/Modeling.test.ts +148 -0
- package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.d.ts +20 -0
- package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js +16 -6
- package/lib/features/modeling/behavior/AppendBehavior.d.ts +6 -0
- package/lib/features/modeling/behavior/AppendBehavior.js +6 -5
- package/lib/features/modeling/behavior/AssociationBehavior.d.ts +11 -0
- package/lib/features/modeling/behavior/AssociationBehavior.js +9 -1
- package/lib/features/modeling/behavior/AttachEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/AttachEventBehavior.js +11 -3
- package/lib/features/modeling/behavior/BoundaryEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/BoundaryEventBehavior.js +8 -1
- package/lib/features/modeling/behavior/CreateBehavior.d.ts +9 -0
- package/lib/features/modeling/behavior/CreateBehavior.js +6 -0
- package/lib/features/modeling/behavior/CreateDataObjectBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/CreateDataObjectBehavior.js +10 -4
- package/lib/features/modeling/behavior/CreateParticipantBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/CreateParticipantBehavior.js +10 -0
- package/lib/features/modeling/behavior/DataInputAssociationBehavior.d.ts +21 -0
- package/lib/features/modeling/behavior/DataInputAssociationBehavior.js +5 -0
- package/lib/features/modeling/behavior/DataStoreBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/DataStoreBehavior.js +12 -1
- package/lib/features/modeling/behavior/DeleteLaneBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/DeleteLaneBehavior.js +9 -3
- package/lib/features/modeling/behavior/DetachEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/DetachEventBehavior.js +11 -3
- package/lib/features/modeling/behavior/DropOnFlowBehavior.d.ts +13 -0
- package/lib/features/modeling/behavior/DropOnFlowBehavior.js +11 -1
- package/lib/features/modeling/behavior/EventBasedGatewayBehavior.d.ts +11 -0
- package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +9 -0
- package/lib/features/modeling/behavior/FixHoverBehavior.d.ts +17 -0
- package/lib/features/modeling/behavior/FixHoverBehavior.js +6 -0
- package/lib/features/modeling/behavior/GroupBehavior.d.ts +26 -0
- package/lib/features/modeling/behavior/GroupBehavior.js +35 -13
- package/lib/features/modeling/behavior/ImportDockingFix.d.ts +13 -0
- package/lib/features/modeling/behavior/ImportDockingFix.js +3 -0
- package/lib/features/modeling/behavior/IsHorizontalFix.d.ts +10 -0
- package/lib/features/modeling/behavior/IsHorizontalFix.js +4 -0
- package/lib/features/modeling/behavior/LabelBehavior.d.ts +56 -0
- package/lib/features/modeling/behavior/LabelBehavior.js +22 -10
- package/lib/features/modeling/behavior/LayoutConnectionBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/LayoutConnectionBehavior.js +6 -2
- package/lib/features/modeling/behavior/MessageFlowBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/MessageFlowBehavior.js +8 -0
- package/lib/features/modeling/behavior/ModelingFeedback.d.ts +13 -0
- package/lib/features/modeling/behavior/ModelingFeedback.js +11 -0
- package/lib/features/modeling/behavior/RemoveElementBehavior.d.ts +13 -0
- package/lib/features/modeling/behavior/RemoveElementBehavior.js +11 -1
- package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +8 -0
- package/lib/features/modeling/behavior/RemoveParticipantBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/RemoveParticipantBehavior.js +8 -1
- package/lib/features/modeling/behavior/ReplaceConnectionBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +13 -1
- package/lib/features/modeling/behavior/ReplaceElementBehaviour.d.ts +23 -0
- package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +19 -4
- package/lib/features/modeling/behavior/ResizeBehavior.d.ts +57 -0
- package/lib/features/modeling/behavior/ResizeBehavior.js +35 -0
- package/lib/features/modeling/behavior/ResizeLaneBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/ResizeLaneBehavior.js +10 -3
- package/lib/features/modeling/behavior/RootElementReferenceBehavior.d.ts +25 -0
- package/lib/features/modeling/behavior/RootElementReferenceBehavior.js +19 -0
- package/lib/features/modeling/behavior/SpaceToolBehavior.d.ts +10 -0
- package/lib/features/modeling/behavior/SpaceToolBehavior.js +14 -4
- package/lib/features/modeling/behavior/SubProcessPlaneBehavior.d.ts +28 -0
- package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +45 -23
- package/lib/features/modeling/behavior/SubProcessStartEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/SubProcessStartEventBehavior.js +6 -0
- package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.d.ts +14 -0
- package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +14 -1
- package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.d.ts +13 -0
- package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +11 -3
- package/lib/features/modeling/behavior/UnclaimIdBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/UnclaimIdBehavior.js +7 -0
- package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +6 -3
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +17 -0
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +13 -10
- package/lib/features/modeling/behavior/index.d.ts +2 -0
- package/lib/features/modeling/behavior/index.js +3 -0
- package/lib/features/modeling/behavior/util/CategoryUtil.d.ts +49 -0
- package/lib/features/modeling/behavior/util/CategoryUtil.js +10 -6
- package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.d.ts +19 -0
- package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.js +11 -5
- package/lib/features/modeling/behavior/util/GeometricUtil.d.ts +1 -0
- package/lib/features/modeling/behavior/util/LabelLayoutUtil.d.ts +32 -0
- package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +27 -18
- package/lib/features/modeling/behavior/util/LayoutUtil.d.ts +48 -0
- package/lib/features/modeling/behavior/util/LayoutUtil.js +35 -6
- package/lib/features/modeling/behavior/util/LineAttachmentUtil.d.ts +37 -0
- package/lib/features/modeling/behavior/util/LineAttachmentUtil.js +17 -5
- package/lib/features/modeling/behavior/util/LineIntersect.d.ts +13 -0
- package/lib/features/modeling/behavior/util/LineIntersect.js +4 -0
- package/lib/features/modeling/behavior/util/ResizeUtil.d.ts +1 -0
- package/lib/features/modeling/cmd/AddLaneHandler.d.ts +22 -0
- package/lib/features/modeling/cmd/AddLaneHandler.js +8 -0
- package/lib/features/modeling/cmd/IdClaimHandler.d.ts +22 -0
- package/lib/features/modeling/cmd/IdClaimHandler.js +15 -0
- package/lib/features/modeling/cmd/ResizeLaneHandler.d.ts +39 -0
- package/lib/features/modeling/cmd/ResizeLaneHandler.js +17 -4
- package/lib/features/modeling/cmd/SetColorHandler.d.ts +18 -0
- package/lib/features/modeling/cmd/SetColorHandler.js +25 -12
- package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +22 -0
- package/lib/features/modeling/cmd/SplitLaneHandler.js +9 -0
- package/lib/features/modeling/cmd/UpdateCanvasRootHandler.d.ts +20 -0
- package/lib/features/modeling/cmd/UpdateCanvasRootHandler.js +16 -1
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts +21 -0
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.js +29 -4
- package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.d.ts +20 -0
- package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.js +17 -3
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +60 -0
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +38 -14
- package/lib/features/modeling/cmd/UpdateSemanticParentHandler.d.ts +18 -0
- package/lib/features/modeling/cmd/UpdateSemanticParentHandler.js +15 -0
- package/lib/features/modeling/index.d.ts +27 -0
- package/lib/features/modeling/util/LaneUtil.d.ts +46 -0
- package/lib/features/modeling/util/LaneUtil.js +22 -13
- package/lib/features/modeling/util/ModelingUtil.d.ts +12 -0
- package/lib/features/modeling/util/ModelingUtil.js +10 -4
- package/lib/features/ordering/BpmnOrderingProvider.d.ts +21 -0
- package/lib/features/ordering/BpmnOrderingProvider.js +9 -3
- package/lib/features/ordering/index.d.ts +7 -0
- package/lib/features/palette/PaletteProvider.d.ts +34 -0
- package/lib/features/palette/PaletteProvider.js +26 -2
- package/lib/features/palette/index.d.ts +9 -0
- package/lib/features/popup-menu/ReplaceMenuProvider.d.ts +50 -0
- package/lib/features/popup-menu/ReplaceMenuProvider.js +226 -202
- package/lib/features/popup-menu/index.d.ts +11 -0
- package/lib/features/popup-menu/util/TypeUtil.d.ts +12 -0
- package/lib/features/popup-menu/util/TypeUtil.js +4 -1
- package/lib/features/replace/BpmnReplace.d.ts +47 -0
- package/lib/features/replace/BpmnReplace.js +81 -29
- package/lib/features/replace/ReplaceOptions.d.ts +70 -0
- package/lib/features/replace/ReplaceOptions.js +58 -0
- package/lib/features/replace/index.d.ts +9 -0
- package/lib/features/replace-preview/BpmnReplacePreview.d.ts +17 -0
- package/lib/features/replace-preview/BpmnReplacePreview.js +15 -1
- package/lib/features/replace-preview/index.d.ts +7 -0
- package/lib/features/rules/BpmnRules.d.ts +171 -0
- package/lib/features/rules/BpmnRules.js +295 -46
- package/lib/features/rules/index.d.ts +7 -0
- package/lib/features/search/BpmnSearchProvider.d.ts +29 -0
- package/lib/features/search/BpmnSearchProvider.js +30 -22
- package/lib/features/search/index.d.ts +7 -0
- package/lib/features/snapping/BpmnConnectSnapping.d.ts +17 -0
- package/lib/features/snapping/BpmnConnectSnapping.js +51 -3
- package/lib/features/snapping/BpmnCreateMoveSnapping.d.ts +41 -0
- package/lib/features/snapping/BpmnCreateMoveSnapping.js +47 -1
- package/lib/features/snapping/BpmnSnappingUtil.d.ts +11 -0
- package/lib/features/snapping/BpmnSnappingUtil.js +12 -0
- package/lib/features/snapping/index.d.ts +9 -0
- package/lib/features/space-tool/BpmnSpaceTool.d.ts +21 -0
- package/lib/features/space-tool/BpmnSpaceTool.js +20 -1
- package/lib/features/space-tool/index.d.ts +6 -0
- package/lib/import/BpmnImporter.d.ts +49 -0
- package/lib/import/BpmnImporter.js +37 -10
- package/lib/import/BpmnTreeWalker.d.ts +22 -0
- package/lib/import/BpmnTreeWalker.js +25 -22
- package/lib/import/Importer.d.ts +25 -0
- package/lib/import/Importer.js +15 -21
- package/lib/import/Util.d.ts +1 -0
- package/lib/import/index.d.ts +6 -0
- package/lib/model/Types.d.ts +24 -0
- package/lib/model/Types.ts +40 -0
- package/lib/util/CompatibilityUtil.d.ts +22 -0
- package/lib/util/CompatibilityUtil.js +13 -0
- package/lib/util/DiUtil.d.ts +53 -0
- package/lib/util/DiUtil.js +47 -13
- package/lib/util/DrilldownUtil.d.ts +39 -0
- package/lib/util/DrilldownUtil.js +12 -8
- package/lib/util/LabelUtil.d.ts +73 -0
- package/lib/util/LabelUtil.js +40 -16
- package/lib/util/ModelUtil.d.ts +40 -0
- package/lib/util/ModelUtil.js +9 -5
- package/lib/util/PoweredByUtil.d.ts +8 -0
- package/lib/util/Types.js +5 -0
- package/lib/util/Types.ts +4 -0
- package/package.json +10 -5
- package/test/matchers/ConnectionMatchers.js +1 -1
- package/lib/icons/dist/append.svg +0 -1
- package/lib/icons/dist/connect-context-pad.svg +0 -1
- package/lib/icons/dist/connect-palette.svg +0 -1
- package/lib/icons/dist/create.svg +0 -1
package/lib/BaseModeler.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A base modeler for BPMN 2.0 diagrams.
|
|
3
|
+
*
|
|
4
|
+
* See {@link Modeler} for a fully-featured modeler.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export default class BaseModeler extends BaseViewer {}
|
|
8
|
+
|
|
9
|
+
type BaseViewerOptions = import('./BaseViewer').BaseViewerOptions;
|
|
10
|
+
type ModdleElementsById = import('./BaseViewer').ModdleElementsById;
|
|
11
|
+
type ModdleElement = import('./model/Types').ModdleElement;
|
|
12
|
+
import BaseViewer from './BaseViewer';
|
package/lib/BaseModeler.js
CHANGED
|
@@ -6,11 +6,10 @@ import BaseViewer from './BaseViewer';
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @typedef {import('./BaseViewer').
|
|
10
|
-
* @typedef {import('./BaseViewer').ModdleElement} ModdleElement
|
|
9
|
+
* @typedef {import('./BaseViewer').BaseViewerOptions} BaseViewerOptions
|
|
11
10
|
* @typedef {import('./BaseViewer').ModdleElementsById} ModdleElementsById
|
|
12
11
|
*
|
|
13
|
-
* @typedef {import('
|
|
12
|
+
* @typedef {import('./model/Types').ModdleElement} ModdleElement
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -18,7 +17,7 @@ import BaseViewer from './BaseViewer';
|
|
|
18
17
|
*
|
|
19
18
|
* See {@link Modeler} for a fully-featured modeler.
|
|
20
19
|
*
|
|
21
|
-
* @param {
|
|
20
|
+
* @param {BaseViewerOptions} [options] The options to configure the modeler.
|
|
22
21
|
*/
|
|
23
22
|
export default function BaseModeler(options) {
|
|
24
23
|
BaseViewer.call(this, options);
|
|
@@ -41,7 +40,7 @@ inherits(BaseModeler, BaseViewer);
|
|
|
41
40
|
/**
|
|
42
41
|
* Create a moddle instance, attaching IDs to it.
|
|
43
42
|
*
|
|
44
|
-
* @param {
|
|
43
|
+
* @param {BaseViewerOptions} options
|
|
45
44
|
*
|
|
46
45
|
* @return {Moddle}
|
|
47
46
|
*/
|
package/lib/BaseViewer.d.ts
CHANGED
|
@@ -1,366 +1,160 @@
|
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
*
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
* An error thrown when saving the SVG.
|
|
162
|
-
*/
|
|
163
|
-
error?: Error;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* The saved SVG.
|
|
167
|
-
*/
|
|
168
|
-
svg: string;
|
|
169
|
-
} & Event;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export default class BaseViewer extends Diagram {
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* The constructor.
|
|
176
|
-
*
|
|
177
|
-
* @param options The options to configure the viewer.
|
|
178
|
-
*/
|
|
179
|
-
constructor(options?: BaseViewerOptions);
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Parse and render a BPMN 2.0 diagram.
|
|
183
|
-
*
|
|
184
|
-
* Once finished the viewer reports back the result to the
|
|
185
|
-
* provided callback function with (err, warnings).
|
|
186
|
-
*
|
|
187
|
-
* ## Life-Cycle Events
|
|
188
|
-
*
|
|
189
|
-
* During import the viewer will fire life-cycle events:
|
|
190
|
-
*
|
|
191
|
-
* * import.parse.start (about to read model from XML)
|
|
192
|
-
* * import.parse.complete (model read; may have worked or not)
|
|
193
|
-
* * import.render.start (graphical import start)
|
|
194
|
-
* * import.render.complete (graphical import finished)
|
|
195
|
-
* * import.done (everything done)
|
|
196
|
-
*
|
|
197
|
-
* You can use these events to hook into the life-cycle.
|
|
198
|
-
*
|
|
199
|
-
* @throws An error thrown during the import of the XML.
|
|
200
|
-
*
|
|
201
|
-
* @param xml The BPMN 2.0 XML to be imported.
|
|
202
|
-
* @param bpmnDiagram The optional diagram or Id of the BPMN diagram to open.
|
|
203
|
-
*
|
|
204
|
-
* @return A promise resolving with warnings that were produced during the import.
|
|
205
|
-
*/
|
|
206
|
-
importXML(xml: string, bpmnDiagram?: ModdleElement | string): Promise<ImportXMLResult>;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Import parsed definitions and render a BPMN 2.0 diagram.
|
|
210
|
-
*
|
|
211
|
-
* Once finished the viewer reports back the result to the
|
|
212
|
-
* provided callback function with (err, warnings).
|
|
213
|
-
*
|
|
214
|
-
* ## Life-Cycle Events
|
|
215
|
-
*
|
|
216
|
-
* During import the viewer will fire life-cycle events:
|
|
217
|
-
*
|
|
218
|
-
* * import.render.start (graphical import start)
|
|
219
|
-
* * import.render.complete (graphical import finished)
|
|
220
|
-
*
|
|
221
|
-
* You can use these events to hook into the life-cycle.
|
|
222
|
-
*
|
|
223
|
-
* @throws An error thrown during the import of the definitions.
|
|
224
|
-
*
|
|
225
|
-
* @param definitions The definitions.
|
|
226
|
-
* @param bpmnDiagram The optional diagram or ID of the BPMN diagram to open.
|
|
227
|
-
*
|
|
228
|
-
* @return A promise resolving with warnings that were produced during the import.
|
|
229
|
-
*/
|
|
230
|
-
importDefinitions(definitions: ModdleElement, bpmnDiagram?: ModdleElement | string): Promise<ImportDefinitionsResult>;
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Open diagram of previously imported XML.
|
|
234
|
-
*
|
|
235
|
-
* Once finished the viewer reports back the result to the
|
|
236
|
-
* provided callback function with (err, warnings).
|
|
237
|
-
*
|
|
238
|
-
* ## Life-Cycle Events
|
|
239
|
-
*
|
|
240
|
-
* During switch the viewer will fire life-cycle events:
|
|
241
|
-
*
|
|
242
|
-
* * import.render.start (graphical import start)
|
|
243
|
-
* * import.render.complete (graphical import finished)
|
|
244
|
-
*
|
|
245
|
-
* You can use these events to hook into the life-cycle.
|
|
246
|
-
*
|
|
247
|
-
* @throws An error thrown during opening.
|
|
248
|
-
*
|
|
249
|
-
* @param bpmnDiagramOrId The diagram or Id of the BPMN diagram to open.
|
|
250
|
-
*
|
|
251
|
-
* @return A promise resolving with warnings that were produced during opening.
|
|
252
|
-
*/
|
|
253
|
-
open(bpmnDiagramOrId: ModdleElement | string): Promise<OpenResult>;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Export the currently displayed BPMN 2.0 diagram as
|
|
257
|
-
* a BPMN 2.0 XML document.
|
|
258
|
-
*
|
|
259
|
-
* ## Life-Cycle Events
|
|
260
|
-
*
|
|
261
|
-
* During XML saving the viewer will fire life-cycle events:
|
|
262
|
-
*
|
|
263
|
-
* * saveXML.start (before serialization)
|
|
264
|
-
* * saveXML.serialized (after xml generation)
|
|
265
|
-
* * saveXML.done (everything done)
|
|
266
|
-
*
|
|
267
|
-
* You can use these events to hook into the life-cycle.
|
|
268
|
-
*
|
|
269
|
-
* @throws An error thrown during export.
|
|
270
|
-
*
|
|
271
|
-
* @param options The options.
|
|
272
|
-
*
|
|
273
|
-
* @return A promise resolving with the XML.
|
|
274
|
-
*/
|
|
275
|
-
saveXML(options?: SaveXMLOptions): Promise<SaveXMLResult>;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Export the currently displayed BPMN 2.0 diagram as
|
|
279
|
-
* an SVG image.
|
|
280
|
-
*
|
|
281
|
-
* ## Life-Cycle Events
|
|
282
|
-
*
|
|
283
|
-
* During SVG saving the viewer will fire life-cycle events:
|
|
284
|
-
*
|
|
285
|
-
* * saveSVG.start (before serialization)
|
|
286
|
-
* * saveSVG.done (everything done)
|
|
287
|
-
*
|
|
288
|
-
* You can use these events to hook into the life-cycle.
|
|
289
|
-
*
|
|
290
|
-
* @throws An error thrown during export.
|
|
291
|
-
*
|
|
292
|
-
* @return A promise resolving with the SVG.
|
|
293
|
-
*/
|
|
294
|
-
saveSVG(): Promise<SaveSVGResult>;
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Return modules to instantiate with.
|
|
298
|
-
*
|
|
299
|
-
* @return The modules.
|
|
300
|
-
*/
|
|
301
|
-
getModules(): ModuleDeclaration[];
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Remove all drawn elements from the viewer.
|
|
305
|
-
*
|
|
306
|
-
* After calling this method the viewer can still be reused for opening another
|
|
307
|
-
* diagram.
|
|
308
|
-
*/
|
|
309
|
-
clear(): void;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Destroy the viewer instance and remove all its remainders from the document
|
|
313
|
-
* tree.
|
|
314
|
-
*/
|
|
315
|
-
destroy(): void;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Register an event listener.
|
|
319
|
-
*
|
|
320
|
-
* Remove a previously added listener via {@link BaseViewer#off}.
|
|
321
|
-
*
|
|
322
|
-
* @param events The event(s) to listen to.
|
|
323
|
-
* @param callback The callback.
|
|
324
|
-
* @param that Value of `this` the callback will be called with.
|
|
325
|
-
*/
|
|
326
|
-
on<T extends Event>(events: string | string[], callback: EventCallback<T>, that?: any): void;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Register an event listener.
|
|
330
|
-
*
|
|
331
|
-
* Remove a previously added listener via {@link BaseViewer#off}.
|
|
332
|
-
*
|
|
333
|
-
* @param events The event(s) to listen to.
|
|
334
|
-
* @param priority The priority with which to listen.
|
|
335
|
-
* @param callback The callback.
|
|
336
|
-
* @param that Value of `this` the callback will be called with.
|
|
337
|
-
*/
|
|
338
|
-
on<T extends Event>(events: string | string[], priority: number, callback: EventCallback<T>, that?: any): void;
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Remove an event listener.
|
|
342
|
-
*
|
|
343
|
-
* @param events The event(s).
|
|
344
|
-
* @param callback The callback.
|
|
345
|
-
*/
|
|
346
|
-
off(events: string | string[], callback?: EventCallback<any>): void;
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Attach the viewer to an HTML element.
|
|
350
|
-
*
|
|
351
|
-
* @param parentNode The parent node to attach to.
|
|
352
|
-
*/
|
|
353
|
-
attachTo(parentNode: HTMLElement): void;
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Get the definitions model element.
|
|
357
|
-
*
|
|
358
|
-
* @returns The definitions model element.
|
|
359
|
-
*/
|
|
360
|
-
getDefinitions(): ModdleElement | undefined;
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Detach the viewer.
|
|
364
|
-
*/
|
|
365
|
-
detach(): void;
|
|
366
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* A base viewer for BPMN 2.0 diagrams.
|
|
3
|
+
*
|
|
4
|
+
* Have a look at {@link Viewer}, {@link NavigatedViewer} or {@link Modeler} for
|
|
5
|
+
* bundles that include actual features.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export default class BaseViewer extends Diagram {
|
|
9
|
+
/**
|
|
10
|
+
* @param options The options to configure the viewer.
|
|
11
|
+
*/
|
|
12
|
+
constructor(options?: BaseViewerOptions);
|
|
13
|
+
|
|
14
|
+
importXML: (xml: string, bpmnDiagram?: ModdleElement | string) => Promise<ImportXMLResult>;
|
|
15
|
+
importDefinitions: (definitions: ModdleElement, bpmnDiagram?: ModdleElement | string) => Promise<ImportDefinitionsResult>;
|
|
16
|
+
open: (bpmnDiagramOrId: ModdleElement | string) => Promise<OpenResult>;
|
|
17
|
+
saveXML: (options?: SaveXMLOptions) => Promise<SaveXMLResult>;
|
|
18
|
+
saveSVG: () => Promise<SaveSVGResult>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Return modules to instantiate with.
|
|
22
|
+
*
|
|
23
|
+
* @return The modules.
|
|
24
|
+
*/
|
|
25
|
+
getModules(): ModuleDeclaration[];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Register an event listener.
|
|
29
|
+
*
|
|
30
|
+
* Remove an event listener via {@link BaseViewer#off}.
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* @param events The event(s) to listen to.
|
|
34
|
+
* @param callback The callback.
|
|
35
|
+
* @param that Value of `this` the callback will be called with.
|
|
36
|
+
*/
|
|
37
|
+
on<T>(events: string | string[], callback: EventBusEventCallback<T>, that?: any): any;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Register an event listener.
|
|
41
|
+
*
|
|
42
|
+
* Remove an event listener via {@link BaseViewer#off}.
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* @param events The event(s) to listen to.
|
|
46
|
+
* @param priority The priority with which to listen.
|
|
47
|
+
* @param callback The callback.
|
|
48
|
+
* @param that Value of `this` the callback will be called with.
|
|
49
|
+
*/
|
|
50
|
+
on<T>(
|
|
51
|
+
events: string | string[],
|
|
52
|
+
priority: number,
|
|
53
|
+
callback: EventBusEventCallback<T>,
|
|
54
|
+
that?: any
|
|
55
|
+
): any;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Remove an event listener.
|
|
59
|
+
*
|
|
60
|
+
* @param events The event(s).
|
|
61
|
+
* @param callback The callback.
|
|
62
|
+
*/
|
|
63
|
+
off(events: string | string[], callback?: Function): void;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Attach the viewer to an HTML element.
|
|
67
|
+
*
|
|
68
|
+
* @param parentNode The parent node to attach to.
|
|
69
|
+
*/
|
|
70
|
+
attachTo(parentNode: HTMLElement): void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get the definitions model element.
|
|
74
|
+
*
|
|
75
|
+
* @return The definitions model element.
|
|
76
|
+
*/
|
|
77
|
+
getDefinitions(): ModdleElement;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Detach the viewer.
|
|
81
|
+
*
|
|
82
|
+
* @fires BaseViewer#DetachEvent
|
|
83
|
+
*/
|
|
84
|
+
detach(): void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type EventBusEventCallback<T> = import('diagram-js/lib/core/EventBus').EventBusEventCallback<T>;
|
|
88
|
+
type ModuleDeclaration = import('didi').ModuleDeclaration;
|
|
89
|
+
type Moddle = import('./model/Types').Moddle;
|
|
90
|
+
type ModdleElement = import('./model/Types').ModdleElement;
|
|
91
|
+
type ModdleExtension = import('./model/Types').ModdleExtension;
|
|
92
|
+
|
|
93
|
+
export type BaseViewerOptions = {
|
|
94
|
+
width?: number | string;
|
|
95
|
+
height?: number | string;
|
|
96
|
+
position?: string;
|
|
97
|
+
container?: string | HTMLElement;
|
|
98
|
+
moddleExtensions?: ModdleExtensions;
|
|
99
|
+
additionalModules?: ModuleDeclaration[];
|
|
100
|
+
} & Record<string, any>;
|
|
101
|
+
|
|
102
|
+
export type ModdleElementsById = Record<string, ModdleElement>;
|
|
103
|
+
|
|
104
|
+
export type ModdleExtensions = {
|
|
105
|
+
[key: string]: import("./model/Types").ModdleExtension;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type ImportXMLResult = {
|
|
109
|
+
warnings: string[];
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type ImportXMLError = ImportXMLResult & Error;
|
|
113
|
+
export type ImportDefinitionsResult = ImportXMLResult;
|
|
114
|
+
export type ImportDefinitionsError = ImportXMLError;
|
|
115
|
+
export type OpenResult = ImportXMLResult;
|
|
116
|
+
export type OpenError = ImportXMLError;
|
|
117
|
+
|
|
118
|
+
export type SaveXMLOptions = {
|
|
119
|
+
format?: boolean;
|
|
120
|
+
preamble?: boolean;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export type SaveXMLResult = {
|
|
124
|
+
xml?: string;
|
|
125
|
+
error?: Error;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export type SaveSVGResult = {
|
|
129
|
+
svg: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type ImportParseStartEvent = {
|
|
133
|
+
xml: string;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export type ImportParseCompleteEvent = {
|
|
137
|
+
error?: ImportXMLError;
|
|
138
|
+
definitions?: ModdleElement;
|
|
139
|
+
elementsById?: ModdleElementsById;
|
|
140
|
+
references?: ModdleElement[];
|
|
141
|
+
warnings: string[];
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type ImportDoneEvent = {
|
|
145
|
+
error?: ImportXMLError;
|
|
146
|
+
warnings: string[];
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export type SaveXMLStartEvent = {
|
|
150
|
+
definitions: ModdleElement;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type SaveXMLDoneEvent = SaveXMLResult;
|
|
154
|
+
|
|
155
|
+
export type SaveSVGDoneEvent = {
|
|
156
|
+
error?: Error;
|
|
157
|
+
svg: string;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
import Diagram from 'diagram-js';
|