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/BaseViewer.js
CHANGED
|
@@ -35,22 +35,89 @@ import {
|
|
|
35
35
|
wrapForCompatibility
|
|
36
36
|
} from './util/CompatibilityUtil';
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @template T
|
|
40
|
+
*
|
|
41
|
+
* @typedef {import('diagram-js/lib/core/EventBus').EventBusEventCallback<T>} EventBusEventCallback
|
|
42
|
+
*/
|
|
38
43
|
|
|
39
44
|
/**
|
|
40
45
|
* @typedef {import('didi').ModuleDeclaration} ModuleDeclaration
|
|
41
46
|
*
|
|
42
|
-
* @typedef {import('./
|
|
43
|
-
* @typedef {import('./
|
|
44
|
-
* @typedef {import('./
|
|
45
|
-
*
|
|
46
|
-
* @typedef {
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
47
|
+
* @typedef {import('./model/Types').Moddle} Moddle
|
|
48
|
+
* @typedef {import('./model/Types').ModdleElement} ModdleElement
|
|
49
|
+
* @typedef {import('./model/Types').ModdleExtension} ModdleExtension
|
|
50
|
+
*
|
|
51
|
+
* @typedef { {
|
|
52
|
+
* width?: number|string;
|
|
53
|
+
* height?: number|string;
|
|
54
|
+
* position?: string;
|
|
55
|
+
* container?: string|HTMLElement;
|
|
56
|
+
* moddleExtensions?: ModdleExtensions;
|
|
57
|
+
* additionalModules?: ModuleDeclaration[];
|
|
58
|
+
* } & Record<string, any> } BaseViewerOptions
|
|
59
|
+
*
|
|
60
|
+
* @typedef {Record<string, ModdleElement>} ModdleElementsById
|
|
61
|
+
*
|
|
62
|
+
* @typedef { {
|
|
63
|
+
* [key: string]: ModdleExtension;
|
|
64
|
+
* } } ModdleExtensions
|
|
65
|
+
*
|
|
66
|
+
* @typedef { {
|
|
67
|
+
* warnings: string[];
|
|
68
|
+
* } } ImportXMLResult
|
|
69
|
+
*
|
|
70
|
+
* @typedef {ImportXMLResult & Error} ImportXMLError
|
|
71
|
+
*
|
|
72
|
+
* @typedef {ImportXMLResult} ImportDefinitionsResult
|
|
73
|
+
*
|
|
74
|
+
* @typedef {ImportXMLError} ImportDefinitionsError
|
|
75
|
+
*
|
|
76
|
+
* @typedef {ImportXMLResult} OpenResult
|
|
77
|
+
*
|
|
78
|
+
* @typedef {ImportXMLError} OpenError
|
|
79
|
+
*
|
|
80
|
+
* @typedef { {
|
|
81
|
+
* format?: boolean;
|
|
82
|
+
* preamble?: boolean;
|
|
83
|
+
* } } SaveXMLOptions
|
|
84
|
+
*
|
|
85
|
+
* @typedef { {
|
|
86
|
+
* xml?: string;
|
|
87
|
+
* error?: Error;
|
|
88
|
+
* } } SaveXMLResult
|
|
89
|
+
*
|
|
90
|
+
* @typedef { {
|
|
91
|
+
* svg: string;
|
|
92
|
+
* } } SaveSVGResult
|
|
93
|
+
*
|
|
94
|
+
* @typedef { {
|
|
95
|
+
* xml: string;
|
|
96
|
+
* } } ImportParseStartEvent
|
|
97
|
+
*
|
|
98
|
+
* @typedef { {
|
|
99
|
+
* error?: ImportXMLError;
|
|
100
|
+
* definitions?: ModdleElement;
|
|
101
|
+
* elementsById?: ModdleElementsById;
|
|
102
|
+
* references?: ModdleElement[];
|
|
103
|
+
* warnings: string[];
|
|
104
|
+
* } } ImportParseCompleteEvent
|
|
105
|
+
*
|
|
106
|
+
* @typedef { {
|
|
107
|
+
* error?: ImportXMLError;
|
|
108
|
+
* warnings: string[];
|
|
109
|
+
* } } ImportDoneEvent
|
|
110
|
+
*
|
|
111
|
+
* @typedef { {
|
|
112
|
+
* definitions: ModdleElement;
|
|
113
|
+
* } } SaveXMLStartEvent
|
|
114
|
+
*
|
|
115
|
+
* @typedef {SaveXMLResult} SaveXMLDoneEvent
|
|
116
|
+
*
|
|
117
|
+
* @typedef { {
|
|
118
|
+
* error?: Error;
|
|
119
|
+
* svg: string;
|
|
120
|
+
* } } SaveSVGDoneEvent
|
|
54
121
|
*/
|
|
55
122
|
|
|
56
123
|
/**
|
|
@@ -59,15 +126,18 @@ import {
|
|
|
59
126
|
* Have a look at {@link Viewer}, {@link NavigatedViewer} or {@link Modeler} for
|
|
60
127
|
* bundles that include actual features.
|
|
61
128
|
*
|
|
62
|
-
* @param {
|
|
129
|
+
* @param {BaseViewerOptions} [options] The options to configure the viewer.
|
|
63
130
|
*/
|
|
64
131
|
export default function BaseViewer(options) {
|
|
65
132
|
|
|
66
133
|
/**
|
|
67
|
-
* @type {
|
|
134
|
+
* @type {BaseViewerOptions}
|
|
68
135
|
*/
|
|
69
136
|
options = assign({}, DEFAULT_OPTIONS, options);
|
|
70
137
|
|
|
138
|
+
/**
|
|
139
|
+
* @type {Moddle}
|
|
140
|
+
*/
|
|
71
141
|
this._moddle = this._createModdle(options);
|
|
72
142
|
|
|
73
143
|
/**
|
|
@@ -106,18 +176,18 @@ inherits(BaseViewer, Diagram);
|
|
|
106
176
|
*
|
|
107
177
|
* @throws {ImportXMLError} An error thrown during the import of the XML.
|
|
108
178
|
*
|
|
109
|
-
* @fires BaseViewer#
|
|
110
|
-
* @fires BaseViewer#
|
|
111
|
-
* @fires Importer#
|
|
112
|
-
* @fires Importer#
|
|
113
|
-
* @fires BaseViewer#
|
|
179
|
+
* @fires BaseViewer#ImportParseStartEvent
|
|
180
|
+
* @fires BaseViewer#ImportParseCompleteEvent
|
|
181
|
+
* @fires Importer#ImportRenderStartEvent
|
|
182
|
+
* @fires Importer#ImportRenderCompleteEvent
|
|
183
|
+
* @fires BaseViewer#ImportDoneEvent
|
|
114
184
|
*
|
|
115
185
|
* @param {string} xml The BPMN 2.0 XML to be imported.
|
|
116
186
|
* @param {ModdleElement|string} [bpmnDiagram] The optional diagram or Id of the BPMN diagram to open.
|
|
117
187
|
*
|
|
118
188
|
* @return {Promise<ImportXMLResult>} A promise resolving with warnings that were produced during the import.
|
|
119
189
|
*/
|
|
120
|
-
BaseViewer.prototype.importXML =
|
|
190
|
+
BaseViewer.prototype.importXML = async function importXML(xml, bpmnDiagram) {
|
|
121
191
|
|
|
122
192
|
const self = this;
|
|
123
193
|
|
|
@@ -155,9 +225,8 @@ BaseViewer.prototype.importXML = wrapForCompatibility(async function importXML(x
|
|
|
155
225
|
/**
|
|
156
226
|
* A `import.parse.start` event.
|
|
157
227
|
*
|
|
158
|
-
* @event BaseViewer#
|
|
159
|
-
* @type {
|
|
160
|
-
* @property {string} xml The XML that is to be parsed.
|
|
228
|
+
* @event BaseViewer#ImportParseStartEvent
|
|
229
|
+
* @type {ImportParseStartEvent}
|
|
161
230
|
*/
|
|
162
231
|
xml = this._emit('import.parse.start', { xml: xml }) || xml;
|
|
163
232
|
|
|
@@ -185,13 +254,8 @@ BaseViewer.prototype.importXML = wrapForCompatibility(async function importXML(x
|
|
|
185
254
|
/**
|
|
186
255
|
* A `import.parse.complete` event.
|
|
187
256
|
*
|
|
188
|
-
* @event BaseViewer#
|
|
189
|
-
* @type {
|
|
190
|
-
* @property {Error|null} error An error thrown when parsing the XML.
|
|
191
|
-
* @property {ModdleElement} definitions The definitions model element.
|
|
192
|
-
* @property {ModdleElementsById} elementsById The model elements by ID.
|
|
193
|
-
* @property {ModdleElement[]} references The referenced model elements.
|
|
194
|
-
* @property {string[]} warnings The warnings produced when parsing the XML.
|
|
257
|
+
* @event BaseViewer#ImportParseCompleteEvent
|
|
258
|
+
* @type {ImportParseCompleteEvent}
|
|
195
259
|
*/
|
|
196
260
|
definitions = this._emit('import.parse.complete', ParseCompleteEvent({
|
|
197
261
|
error: null,
|
|
@@ -208,10 +272,8 @@ BaseViewer.prototype.importXML = wrapForCompatibility(async function importXML(x
|
|
|
208
272
|
/**
|
|
209
273
|
* A `import.parse.complete` event.
|
|
210
274
|
*
|
|
211
|
-
* @event BaseViewer#
|
|
212
|
-
* @type {
|
|
213
|
-
* @property {ImportXMLError|null} error An error thrown during import.
|
|
214
|
-
* @property {string[]} warnings The warnings.
|
|
275
|
+
* @event BaseViewer#ImportDoneEvent
|
|
276
|
+
* @type {ImportDoneEvent}
|
|
215
277
|
*/
|
|
216
278
|
this._emit('import.done', { error: null, warnings: aggregatedWarnings });
|
|
217
279
|
|
|
@@ -227,7 +289,9 @@ BaseViewer.prototype.importXML = wrapForCompatibility(async function importXML(x
|
|
|
227
289
|
|
|
228
290
|
throw error;
|
|
229
291
|
}
|
|
230
|
-
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
BaseViewer.prototype.importXML = wrapForCompatibility(BaseViewer.prototype.importXML);
|
|
231
295
|
|
|
232
296
|
|
|
233
297
|
/**
|
|
@@ -252,12 +316,14 @@ BaseViewer.prototype.importXML = wrapForCompatibility(async function importXML(x
|
|
|
252
316
|
*
|
|
253
317
|
* @return {Promise<ImportDefinitionsResult>} A promise resolving with warnings that were produced during the import.
|
|
254
318
|
*/
|
|
255
|
-
BaseViewer.prototype.importDefinitions =
|
|
319
|
+
BaseViewer.prototype.importDefinitions = async function importDefinitions(definitions, bpmnDiagram) {
|
|
256
320
|
this._setDefinitions(definitions);
|
|
257
321
|
const result = await this.open(bpmnDiagram);
|
|
258
322
|
|
|
259
323
|
return { warnings: result.warnings };
|
|
260
|
-
}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
BaseViewer.prototype.importDefinitions = wrapForCompatibility(BaseViewer.prototype.importDefinitions);
|
|
261
327
|
|
|
262
328
|
|
|
263
329
|
/**
|
|
@@ -281,7 +347,7 @@ BaseViewer.prototype.importDefinitions = wrapForCompatibility(async function imp
|
|
|
281
347
|
*
|
|
282
348
|
* @return {Promise<OpenResult>} A promise resolving with warnings that were produced during opening.
|
|
283
349
|
*/
|
|
284
|
-
BaseViewer.prototype.open =
|
|
350
|
+
BaseViewer.prototype.open = async function open(bpmnDiagramOrId) {
|
|
285
351
|
|
|
286
352
|
const definitions = this._definitions;
|
|
287
353
|
let bpmnDiagram = bpmnDiagramOrId;
|
|
@@ -318,7 +384,9 @@ BaseViewer.prototype.open = wrapForCompatibility(async function open(bpmnDiagram
|
|
|
318
384
|
const { warnings } = await importBpmnDiagram(this, definitions, bpmnDiagram);
|
|
319
385
|
|
|
320
386
|
return { warnings };
|
|
321
|
-
}
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
BaseViewer.prototype.open = wrapForCompatibility(BaseViewer.prototype.open);
|
|
322
390
|
|
|
323
391
|
/**
|
|
324
392
|
* Export the currently displayed BPMN 2.0 diagram as
|
|
@@ -343,7 +411,7 @@ BaseViewer.prototype.open = wrapForCompatibility(async function open(bpmnDiagram
|
|
|
343
411
|
*
|
|
344
412
|
* @return {Promise<SaveXMLResult>} A promise resolving with the XML.
|
|
345
413
|
*/
|
|
346
|
-
BaseViewer.prototype.saveXML =
|
|
414
|
+
BaseViewer.prototype.saveXML = async function saveXML(options) {
|
|
347
415
|
|
|
348
416
|
options = options || {};
|
|
349
417
|
|
|
@@ -360,9 +428,8 @@ BaseViewer.prototype.saveXML = wrapForCompatibility(async function saveXML(optio
|
|
|
360
428
|
/**
|
|
361
429
|
* A `saveXML.start` event.
|
|
362
430
|
*
|
|
363
|
-
* @event BaseViewer#
|
|
364
|
-
* @type {
|
|
365
|
-
* @property {ModdleElement} definitions The definitions model element.
|
|
431
|
+
* @event BaseViewer#SaveXMLStartEvent
|
|
432
|
+
* @type {SaveXMLStartEvent}
|
|
366
433
|
*/
|
|
367
434
|
definitions = this._emit('saveXML.start', {
|
|
368
435
|
definitions
|
|
@@ -383,10 +450,8 @@ BaseViewer.prototype.saveXML = wrapForCompatibility(async function saveXML(optio
|
|
|
383
450
|
/**
|
|
384
451
|
* A `saveXML.done` event.
|
|
385
452
|
*
|
|
386
|
-
* @event BaseViewer#
|
|
387
|
-
* @type {
|
|
388
|
-
* @property {Error} [error] An error thrown when saving the XML.
|
|
389
|
-
* @property {string} [xml] The saved XML.
|
|
453
|
+
* @event BaseViewer#SaveXMLDoneEvent
|
|
454
|
+
* @type {SaveXMLDoneEvent}
|
|
390
455
|
*/
|
|
391
456
|
this._emit('saveXML.done', result);
|
|
392
457
|
|
|
@@ -395,7 +460,9 @@ BaseViewer.prototype.saveXML = wrapForCompatibility(async function saveXML(optio
|
|
|
395
460
|
}
|
|
396
461
|
|
|
397
462
|
return result;
|
|
398
|
-
}
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
BaseViewer.prototype.saveXML = wrapForCompatibility(BaseViewer.prototype.saveXML);
|
|
399
466
|
|
|
400
467
|
|
|
401
468
|
/**
|
|
@@ -417,7 +484,7 @@ BaseViewer.prototype.saveXML = wrapForCompatibility(async function saveXML(optio
|
|
|
417
484
|
*
|
|
418
485
|
* @return {Promise<SaveSVGResult>} A promise resolving with the SVG.
|
|
419
486
|
*/
|
|
420
|
-
BaseViewer.prototype.saveSVG =
|
|
487
|
+
BaseViewer.prototype.saveSVG = async function saveSVG() {
|
|
421
488
|
this._emit('saveSVG.start');
|
|
422
489
|
|
|
423
490
|
let svg, err;
|
|
@@ -449,10 +516,8 @@ BaseViewer.prototype.saveSVG = wrapForCompatibility(async function saveSVG() {
|
|
|
449
516
|
/**
|
|
450
517
|
* A `saveSVG.done` event.
|
|
451
518
|
*
|
|
452
|
-
* @event BaseViewer#
|
|
453
|
-
* @type {
|
|
454
|
-
* @property {Error} [error] An error thrown when saving the SVG.
|
|
455
|
-
* @property {string} [svg] The saved SVG.
|
|
519
|
+
* @event BaseViewer#SaveSVGDoneEvent
|
|
520
|
+
* @type {SaveSVGDoneEvent}
|
|
456
521
|
*/
|
|
457
522
|
this._emit('saveSVG.done', {
|
|
458
523
|
error: err,
|
|
@@ -464,7 +529,9 @@ BaseViewer.prototype.saveSVG = wrapForCompatibility(async function saveSVG() {
|
|
|
464
529
|
}
|
|
465
530
|
|
|
466
531
|
return { svg };
|
|
467
|
-
}
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
BaseViewer.prototype.saveSVG = wrapForCompatibility(BaseViewer.prototype.saveSVG);
|
|
468
535
|
|
|
469
536
|
/**
|
|
470
537
|
* Get a named diagram service.
|
|
@@ -546,10 +613,12 @@ BaseViewer.prototype.destroy = function() {
|
|
|
546
613
|
*
|
|
547
614
|
* Remove an event listener via {@link BaseViewer#off}.
|
|
548
615
|
*
|
|
616
|
+
* @template T
|
|
617
|
+
*
|
|
549
618
|
* @param {string|string[]} events The event(s) to listen to.
|
|
550
619
|
* @param {number} [priority] The priority with which to listen.
|
|
551
|
-
* @param {
|
|
552
|
-
* @param {
|
|
620
|
+
* @param {EventBusEventCallback<T>} callback The callback.
|
|
621
|
+
* @param {any} [that] Value of `this` the callback will be called with.
|
|
553
622
|
*/
|
|
554
623
|
BaseViewer.prototype.on = function(events, priority, callback, that) {
|
|
555
624
|
return this.get('eventBus').on(events, priority, callback, that);
|
|
@@ -599,7 +668,7 @@ BaseViewer.prototype.attachTo = function(parentNode) {
|
|
|
599
668
|
/**
|
|
600
669
|
* Get the definitions model element.
|
|
601
670
|
*
|
|
602
|
-
* @
|
|
671
|
+
* @return {ModdleElement} The definitions model element.
|
|
603
672
|
*/
|
|
604
673
|
BaseViewer.prototype.getDefinitions = function() {
|
|
605
674
|
return this._definitions;
|
|
@@ -668,6 +737,11 @@ BaseViewer.prototype._emit = function(type, event) {
|
|
|
668
737
|
return this.get('eventBus').fire(type, event);
|
|
669
738
|
};
|
|
670
739
|
|
|
740
|
+
/**
|
|
741
|
+
* @param {BaseViewerOptions} options
|
|
742
|
+
*
|
|
743
|
+
* @return {HTMLElement}
|
|
744
|
+
*/
|
|
671
745
|
BaseViewer.prototype._createContainer = function(options) {
|
|
672
746
|
|
|
673
747
|
const container = domify('<div class="bjs-container"></div>');
|
|
@@ -681,6 +755,11 @@ BaseViewer.prototype._createContainer = function(options) {
|
|
|
681
755
|
return container;
|
|
682
756
|
};
|
|
683
757
|
|
|
758
|
+
/**
|
|
759
|
+
* @param {BaseViewerOptions} options
|
|
760
|
+
*
|
|
761
|
+
* @return {Moddle}
|
|
762
|
+
*/
|
|
684
763
|
BaseViewer.prototype._createModdle = function(options) {
|
|
685
764
|
const moddleOptions = assign({}, this._moddleExtensions, options.moddleExtensions);
|
|
686
765
|
|
package/lib/Modeler.d.ts
CHANGED
|
@@ -1,15 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A modeler for BPMN 2.0 diagrams.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* ## Extending the Modeler
|
|
6
|
+
*
|
|
7
|
+
* In order to extend the viewer pass extension modules to bootstrap via the
|
|
8
|
+
* `additionalModules` option. An extension module is an object that exposes
|
|
9
|
+
* named services.
|
|
10
|
+
*
|
|
11
|
+
* The following example depicts the integration of a simple
|
|
12
|
+
* logging component that integrates with interaction events:
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* ```javascript
|
|
16
|
+
*
|
|
17
|
+
* // logging component
|
|
18
|
+
* function InteractionLogger(eventBus) {
|
|
19
|
+
* eventBus.on('element.hover', function(event) {
|
|
20
|
+
* console.log()
|
|
21
|
+
* })
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* InteractionLogger.$inject = [ 'eventBus' ]; // minification save
|
|
25
|
+
*
|
|
26
|
+
* // extension module
|
|
27
|
+
* var extensionModule = {
|
|
28
|
+
* __init__: [ 'interactionLogger' ],
|
|
29
|
+
* interactionLogger: [ 'type', InteractionLogger ]
|
|
30
|
+
* };
|
|
31
|
+
*
|
|
32
|
+
* // extend the viewer
|
|
33
|
+
* var bpmnModeler = new Modeler({ additionalModules: [ extensionModule ] });
|
|
34
|
+
* bpmnModeler.importXML(...);
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* ## Customizing / Replacing Components
|
|
39
|
+
*
|
|
40
|
+
* You can replace individual diagram components by redefining them in override modules.
|
|
41
|
+
* This works for all components, including those defined in the core.
|
|
42
|
+
*
|
|
43
|
+
* Pass in override modules via the `options.additionalModules` flag like this:
|
|
44
|
+
*
|
|
45
|
+
* ```javascript
|
|
46
|
+
* function CustomContextPadProvider(contextPad) {
|
|
47
|
+
*
|
|
48
|
+
* contextPad.registerProvider(this);
|
|
49
|
+
*
|
|
50
|
+
* this.getContextPadEntries = function(element) {
|
|
51
|
+
* // no entries, effectively disable the context pad
|
|
52
|
+
* return {};
|
|
53
|
+
* };
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* CustomContextPadProvider.$inject = [ 'contextPad' ];
|
|
57
|
+
*
|
|
58
|
+
* var overrideModule = {
|
|
59
|
+
* contextPadProvider: [ 'type', CustomContextPadProvider ]
|
|
60
|
+
* };
|
|
61
|
+
*
|
|
62
|
+
* var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]});
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
export default class Modeler extends BaseModeler {
|
|
67
|
+
static Viewer: typeof Viewer;
|
|
68
|
+
static NavigatedViewer: typeof NavigatedViewer;
|
|
69
|
+
createDiagram: () => Promise<ImportXMLResult>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type BaseViewerOptions = import('./BaseViewer').BaseViewerOptions;
|
|
73
|
+
type ImportXMLResult = import('./BaseViewer').ImportXMLResult;
|
|
74
|
+
import BaseModeler from './BaseModeler';
|
|
75
|
+
import Viewer from './Viewer';
|
|
76
|
+
import NavigatedViewer from './NavigatedViewer';
|
package/lib/Modeler.js
CHANGED
|
@@ -61,7 +61,7 @@ var initialDiagram =
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* @typedef {import('./BaseViewer').
|
|
64
|
+
* @typedef {import('./BaseViewer').BaseViewerOptions} BaseViewerOptions
|
|
65
65
|
* @typedef {import('./BaseViewer').ImportXMLResult} ImportXMLResult
|
|
66
66
|
*/
|
|
67
67
|
|
|
@@ -129,7 +129,7 @@ var initialDiagram =
|
|
|
129
129
|
* var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]});
|
|
130
130
|
* ```
|
|
131
131
|
*
|
|
132
|
-
* @param {
|
|
132
|
+
* @param {BaseViewerOptions} [options] The options to configure the modeler.
|
|
133
133
|
*/
|
|
134
134
|
export default function Modeler(options) {
|
|
135
135
|
BaseModeler.call(this, options);
|
|
@@ -148,9 +148,11 @@ Modeler.NavigatedViewer = NavigatedViewer;
|
|
|
148
148
|
*
|
|
149
149
|
* @return {Promise<ImportXMLResult>} A promise resolving with warnings that were produced during the import.
|
|
150
150
|
*/
|
|
151
|
-
Modeler.prototype.createDiagram =
|
|
151
|
+
Modeler.prototype.createDiagram = function createDiagram() {
|
|
152
152
|
return this.importXML(initialDiagram);
|
|
153
|
-
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
Modeler.prototype.createDiagram = wrapForCompatibility(Modeler.prototype.createDiagram);
|
|
154
156
|
|
|
155
157
|
|
|
156
158
|
Modeler.prototype._interactionModules = [
|
package/lib/NavigatedViewer.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A viewer with mouse and keyboard navigation features.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export default class NavigatedViewer extends Viewer {}
|
|
6
|
+
|
|
7
|
+
type BaseViewerOptions = import('./BaseViewer').BaseViewerOptions;
|
|
8
|
+
import Viewer from './Viewer';
|
package/lib/Viewer.d.ts
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A viewer for BPMN 2.0 diagrams.
|
|
3
|
+
*
|
|
4
|
+
* Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include
|
|
5
|
+
* additional features.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* ## Extending the Viewer
|
|
9
|
+
*
|
|
10
|
+
* In order to extend the viewer pass extension modules to bootstrap via the
|
|
11
|
+
* `additionalModules` option. An extension module is an object that exposes
|
|
12
|
+
* named services.
|
|
13
|
+
*
|
|
14
|
+
* The following example depicts the integration of a simple
|
|
15
|
+
* logging component that integrates with interaction events:
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* ```javascript
|
|
19
|
+
*
|
|
20
|
+
* // logging component
|
|
21
|
+
* function InteractionLogger(eventBus) {
|
|
22
|
+
* eventBus.on('element.hover', function(event) {
|
|
23
|
+
* console.log()
|
|
24
|
+
* })
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* InteractionLogger.$inject = [ 'eventBus' ]; // minification save
|
|
28
|
+
*
|
|
29
|
+
* // extension module
|
|
30
|
+
* var extensionModule = {
|
|
31
|
+
* __init__: [ 'interactionLogger' ],
|
|
32
|
+
* interactionLogger: [ 'type', InteractionLogger ]
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* // extend the viewer
|
|
36
|
+
* var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });
|
|
37
|
+
* bpmnViewer.importXML(...);
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export default class Viewer extends BaseViewer {}
|
|
42
|
+
|
|
43
|
+
type BaseViewerOptions = import('./BaseViewer').BaseViewerOptions;
|
|
44
|
+
import BaseViewer from './BaseViewer';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
const __depends__: ({
|
|
3
|
+
bpmnRenderer: (string | typeof import("../draw/BpmnRenderer").default)[];
|
|
4
|
+
textRenderer: (string | typeof import("../draw/TextRenderer").default)[];
|
|
5
|
+
pathMap: (string | typeof import("../draw/PathMap").default)[];
|
|
6
|
+
} | {
|
|
7
|
+
bpmnImporter: (string | typeof import("../import/BpmnImporter").default)[];
|
|
8
|
+
})[];
|
|
9
|
+
}
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if eventDefinition of the given element matches with semantic type.
|
|
3
|
+
*
|
|
4
|
+
* @param event
|
|
5
|
+
* @param eventDefinitionType
|
|
6
|
+
*
|
|
7
|
+
* @return
|
|
8
|
+
*/
|
|
9
|
+
export function isTypedEvent(event: any, eventDefinitionType: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if element is a throw event.
|
|
12
|
+
*
|
|
13
|
+
* @param event
|
|
14
|
+
*
|
|
15
|
+
* @return
|
|
16
|
+
*/
|
|
17
|
+
export function isThrowEvent(event: any): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Check if element is a throw event.
|
|
20
|
+
*
|
|
21
|
+
* @param element
|
|
22
|
+
*
|
|
23
|
+
* @return
|
|
24
|
+
*/
|
|
25
|
+
export function isCollection(element: any): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @param element
|
|
28
|
+
* @param defaultColor
|
|
29
|
+
*
|
|
30
|
+
* @return
|
|
31
|
+
*/
|
|
32
|
+
export function getFillColor(element: any, defaultColor: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* @param element
|
|
35
|
+
* @param defaultColor
|
|
36
|
+
*
|
|
37
|
+
* @return
|
|
38
|
+
*/
|
|
39
|
+
export function getStrokeColor(element: any, defaultColor: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* @param element
|
|
42
|
+
* @param defaultColor
|
|
43
|
+
* @param defaultStrokeColor
|
|
44
|
+
*
|
|
45
|
+
* @return
|
|
46
|
+
*/
|
|
47
|
+
export function getLabelColor(element: any, defaultColor: string, defaultStrokeColor: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* @param shape
|
|
50
|
+
*
|
|
51
|
+
* @return path
|
|
52
|
+
*/
|
|
53
|
+
export function getCirclePath(shape: any): string;
|
|
54
|
+
/**
|
|
55
|
+
* @param shape
|
|
56
|
+
*
|
|
57
|
+
* @return path
|
|
58
|
+
*/
|
|
59
|
+
export function getRoundRectPath(shape: any): string;
|
|
60
|
+
/**
|
|
61
|
+
* @param shape
|
|
62
|
+
*
|
|
63
|
+
* @return path
|
|
64
|
+
*/
|
|
65
|
+
export function getDiamondPath(shape: any): string;
|
|
66
|
+
/**
|
|
67
|
+
* @param shape
|
|
68
|
+
*
|
|
69
|
+
* @return path
|
|
70
|
+
*/
|
|
71
|
+
export function getRectPath(shape: any): string;
|
|
72
|
+
export const black: string;
|
|
73
|
+
export type ModdleElement = any;
|
|
74
|
+
export type DiagramElement = any;
|
|
75
|
+
export type ShapeLike = any;
|
|
76
|
+
export { getDi, getBusinessObject as getSemantic } from "../util/ModelUtil";
|