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/util/LabelUtil.js
CHANGED
|
@@ -4,6 +4,13 @@ import {
|
|
|
4
4
|
|
|
5
5
|
import { is } from './ModelUtil';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('diagram-js/lib/util/Types').Point} Point
|
|
9
|
+
* @typedef {import('diagram-js/lib/util/Types').Rect} Rect
|
|
10
|
+
*
|
|
11
|
+
* @typedef {import('../model/Types').Element} Element
|
|
12
|
+
* @typedef {import('../model/Types').ModdleElement} ModdleElement
|
|
13
|
+
*/
|
|
7
14
|
|
|
8
15
|
export var DEFAULT_LABEL_SIZE = {
|
|
9
16
|
width: 90,
|
|
@@ -14,10 +21,11 @@ export var FLOW_LABEL_INDENT = 15;
|
|
|
14
21
|
|
|
15
22
|
|
|
16
23
|
/**
|
|
17
|
-
*
|
|
24
|
+
* Return true if the given semantic has an external label.
|
|
25
|
+
*
|
|
26
|
+
* @param {Element} semantic
|
|
18
27
|
*
|
|
19
|
-
* @
|
|
20
|
-
* @return {boolean} true if has label
|
|
28
|
+
* @return {boolean}
|
|
21
29
|
*/
|
|
22
30
|
export function isLabelExternal(semantic) {
|
|
23
31
|
return is(semantic, 'bpmn:Event') ||
|
|
@@ -32,20 +40,22 @@ export function isLabelExternal(semantic) {
|
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
/**
|
|
35
|
-
*
|
|
43
|
+
* Return true if the given element has an external label.
|
|
36
44
|
*
|
|
37
|
-
* @param {
|
|
38
|
-
*
|
|
45
|
+
* @param {Element} element
|
|
46
|
+
*
|
|
47
|
+
* @return {boolean}
|
|
39
48
|
*/
|
|
40
49
|
export function hasExternalLabel(element) {
|
|
41
50
|
return isLabel(element.label);
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
/**
|
|
45
|
-
* Get the position
|
|
54
|
+
* Get the position of a sequence flow label.
|
|
55
|
+
*
|
|
56
|
+
* @param {Point[]} waypoints
|
|
46
57
|
*
|
|
47
|
-
* @
|
|
48
|
-
* @return {Point} the label position
|
|
58
|
+
* @return {Point}
|
|
49
59
|
*/
|
|
50
60
|
export function getFlowLabelPosition(waypoints) {
|
|
51
61
|
|
|
@@ -75,10 +85,11 @@ export function getFlowLabelPosition(waypoints) {
|
|
|
75
85
|
|
|
76
86
|
|
|
77
87
|
/**
|
|
78
|
-
* Get the middle of a number of waypoints
|
|
88
|
+
* Get the middle of a number of waypoints.
|
|
79
89
|
*
|
|
80
|
-
* @param {
|
|
81
|
-
*
|
|
90
|
+
* @param {Point[]} waypoints
|
|
91
|
+
*
|
|
92
|
+
* @return {Point}
|
|
82
93
|
*/
|
|
83
94
|
export function getWaypointsMid(waypoints) {
|
|
84
95
|
|
|
@@ -93,7 +104,13 @@ export function getWaypointsMid(waypoints) {
|
|
|
93
104
|
};
|
|
94
105
|
}
|
|
95
106
|
|
|
96
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Get the middle of the external label of an element.
|
|
109
|
+
*
|
|
110
|
+
* @param {Element} element
|
|
111
|
+
*
|
|
112
|
+
* @return {Point}
|
|
113
|
+
*/
|
|
97
114
|
export function getExternalLabelMid(element) {
|
|
98
115
|
|
|
99
116
|
if (element.waypoints) {
|
|
@@ -113,11 +130,13 @@ export function getExternalLabelMid(element) {
|
|
|
113
130
|
|
|
114
131
|
|
|
115
132
|
/**
|
|
116
|
-
*
|
|
133
|
+
* Return the bounds of an elements label, parsed from the elements DI or
|
|
117
134
|
* generated from its bounds.
|
|
118
135
|
*
|
|
119
|
-
* @param {
|
|
120
|
-
* @param {
|
|
136
|
+
* @param {ModdleElement} di
|
|
137
|
+
* @param {Element} element
|
|
138
|
+
*
|
|
139
|
+
* @return {Rect}
|
|
121
140
|
*/
|
|
122
141
|
export function getExternalLabelBounds(di, element) {
|
|
123
142
|
|
|
@@ -151,6 +170,11 @@ export function getExternalLabelBounds(di, element) {
|
|
|
151
170
|
}, size);
|
|
152
171
|
}
|
|
153
172
|
|
|
173
|
+
/**
|
|
174
|
+
* @param {Element} element
|
|
175
|
+
*
|
|
176
|
+
* @return {boolean}
|
|
177
|
+
*/
|
|
154
178
|
export function isLabel(element) {
|
|
155
179
|
return element && !!element.labelTarget;
|
|
156
180
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Is an element of the given BPMN type?
|
|
3
|
+
*
|
|
4
|
+
* @param element
|
|
5
|
+
* @param type
|
|
6
|
+
*
|
|
7
|
+
* @return
|
|
8
|
+
*/
|
|
9
|
+
export function is(element: Element | ModdleElement, type: string): boolean;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Return true if element has any of the given types.
|
|
13
|
+
*
|
|
14
|
+
* @param element
|
|
15
|
+
* @param types
|
|
16
|
+
*
|
|
17
|
+
* @return
|
|
18
|
+
*/
|
|
19
|
+
export function isAny(element: Element | ModdleElement, types: string[]): boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Return the business object for a given element.
|
|
23
|
+
*
|
|
24
|
+
* @param element
|
|
25
|
+
*
|
|
26
|
+
* @return
|
|
27
|
+
*/
|
|
28
|
+
export function getBusinessObject(element: Element | ModdleElement): ModdleElement;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Return the di object for a given element.
|
|
32
|
+
*
|
|
33
|
+
* @param element
|
|
34
|
+
*
|
|
35
|
+
* @return
|
|
36
|
+
*/
|
|
37
|
+
export function getDi(element: Element): ModdleElement;
|
|
38
|
+
|
|
39
|
+
type Element = import('../model/Types').Element;
|
|
40
|
+
type ModdleElement = import('../model/Types').ModdleElement;
|
package/lib/util/ModelUtil.js
CHANGED
|
@@ -2,11 +2,15 @@ import {
|
|
|
2
2
|
some
|
|
3
3
|
} from 'min-dash';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @typedef { import('../model/Types').Element } Element
|
|
7
|
+
* @typedef { import('../model/Types').ModdleElement } ModdleElement
|
|
8
|
+
*/
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Is an element of the given BPMN type?
|
|
8
12
|
*
|
|
9
|
-
* @param {
|
|
13
|
+
* @param {Element|ModdleElement} element
|
|
10
14
|
* @param {string} type
|
|
11
15
|
*
|
|
12
16
|
* @return {boolean}
|
|
@@ -21,8 +25,8 @@ export function is(element, type) {
|
|
|
21
25
|
/**
|
|
22
26
|
* Return true if element has any of the given types.
|
|
23
27
|
*
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {
|
|
28
|
+
* @param {Element|ModdleElement} element
|
|
29
|
+
* @param {string[]} types
|
|
26
30
|
*
|
|
27
31
|
* @return {boolean}
|
|
28
32
|
*/
|
|
@@ -35,7 +39,7 @@ export function isAny(element, types) {
|
|
|
35
39
|
/**
|
|
36
40
|
* Return the business object for a given element.
|
|
37
41
|
*
|
|
38
|
-
* @param
|
|
42
|
+
* @param {Element|ModdleElement} element
|
|
39
43
|
*
|
|
40
44
|
* @return {ModdleElement}
|
|
41
45
|
*/
|
|
@@ -46,7 +50,7 @@ export function getBusinessObject(element) {
|
|
|
46
50
|
/**
|
|
47
51
|
* Return the di object for a given element.
|
|
48
52
|
*
|
|
49
|
-
* @param
|
|
53
|
+
* @param {Element} element
|
|
50
54
|
*
|
|
51
55
|
* @return {ModdleElement}
|
|
52
56
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmn-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "A bpmn 2.0 toolkit and web modeler",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"!lib/**/*.spec.ts"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"all": "run-s lint test
|
|
16
|
+
"all": "run-s lint test generate-types distro test:distro",
|
|
17
17
|
"lint": "eslint .",
|
|
18
18
|
"format": "run-s format:markdown 'lint -- --fix'",
|
|
19
19
|
"format:markdown": "remark . -qo",
|
|
@@ -24,10 +24,13 @@
|
|
|
24
24
|
"test": "karma start test/config/karma.unit.js",
|
|
25
25
|
"distro": "node tasks/build-distro.js",
|
|
26
26
|
"collect-translations": "cross-env COLLECT_TRANSLATIONS=1 npm test",
|
|
27
|
+
"generate-types": "run-s generate-types:*",
|
|
28
|
+
"generate-types:generate": "del-cli \"lib/**/*.d.ts\" && npx bio-dts -r lib",
|
|
29
|
+
"generate-types:test": "tsc --noEmit --noImplicitAny",
|
|
27
30
|
"test:distro": "node tasks/test-distro.js",
|
|
28
|
-
"test:types": "tsc",
|
|
29
31
|
"postversion": "run-s distro test:distro",
|
|
30
|
-
"prepare": "run-s distro"
|
|
32
|
+
"prepare": "run-s distro",
|
|
33
|
+
"prepublishOnly": "run-s generate-types"
|
|
31
34
|
},
|
|
32
35
|
"repository": {
|
|
33
36
|
"type": "git",
|
|
@@ -72,6 +75,7 @@
|
|
|
72
75
|
"cpx": "^1.5.0",
|
|
73
76
|
"cross-env": "^7.0.3",
|
|
74
77
|
"del": "^6.0.0",
|
|
78
|
+
"del-cli": "^5.0.0",
|
|
75
79
|
"eslint": "^8.22.0",
|
|
76
80
|
"eslint-plugin-bpmn-io": "^1.0.0",
|
|
77
81
|
"eslint-plugin-import": "^2.26.0",
|
|
@@ -98,12 +102,13 @@
|
|
|
98
102
|
"rollup-plugin-license": "^3.0.0",
|
|
99
103
|
"sinon": "^15.0.0",
|
|
100
104
|
"sinon-chai": "^3.7.0",
|
|
105
|
+
"ts-expect": "^1.3.0",
|
|
101
106
|
"typescript": "^5.0.0",
|
|
102
107
|
"webpack": "^5.74.0"
|
|
103
108
|
},
|
|
104
109
|
"dependencies": {
|
|
105
110
|
"bpmn-moddle": "^8.0.0",
|
|
106
|
-
"diagram-js": "^
|
|
111
|
+
"diagram-js": "^12.0.0",
|
|
107
112
|
"diagram-js-direct-editing": "^2.0.0",
|
|
108
113
|
"ids": "^1.0.0",
|
|
109
114
|
"inherits-browser": "^0.1.0",
|
|
@@ -56,7 +56,7 @@ export default function(chai, utils) {
|
|
|
56
56
|
*
|
|
57
57
|
* expect(connection).to.have.diWaypoints([ { x: 100, y: 100 }, { x: 0, y: 0 } ]);
|
|
58
58
|
*
|
|
59
|
-
* @param {Connection|
|
|
59
|
+
* @param {Connection|Point[]} exp
|
|
60
60
|
*/
|
|
61
61
|
Assertion.addMethod('diWaypoints', function(exp) {
|
|
62
62
|
var obj = this._obj;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
data:image/svg+xml,data%3Aimage%2Fsvg%2Bxml%2C%253Csvg%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%2520width%253D%252222%2522%2520height%253D%252222%2522%2520viewBox%253D%25220%25200%25205.82%25205.82%2522%253E%253Cpath%2520d%253D%2522M1.3%25203.4c.3%25200%2520.5-.2.5-.5s-.2-.4-.5-.4c-.2%25200-.4.1-.4.4%25200%2520.3.2.5.4.5zm1.7%25200c.2%25200%2520.4-.2.4-.5s-.2-.4-.4-.4c-.3%25200-.5.1-.5.4%25200%2520.3.2.5.5.5zm1.6%25200c.2%25200%2520.4-.2.4-.5s-.2-.4-.4-.4c-.3%25200-.5.1-.5.4%25200%2520.3.2.5.5.5z%2522%252F%253E%253C%252Fsvg%253E
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
data:image/svg+xml,data%3Aimage%2Fsvg%2Bxml%2C%253Csvg%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%2520viewBox%253D%25220%25200%25202048%25202048%2522%253E%253Cpath%2520d%253D%2522M2013.823%2520158.247%2520995.866%2520525.177l143.206%2520181.698L34.177%25201595.041l136.637%2520158.712%25201104.89-888.123%2520140.894%2520182.578Z%2522%252F%253E%253C%252Fsvg%253E
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
data:image/svg+xml,data%3Aimage%2Fsvg%2Bxml%2C%253Csvg%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%2520viewBox%253D%25220%25200%25202048%25202048%2522%253E%253Cpath%2520d%253D%2522M2013.823%2520158.247%2520995.866%2520525.177l143.206%2520181.698L34.177%25201595.041l136.637%2520158.712%25201104.89-888.123%2520140.894%2520182.578Z%2522%252F%253E%253C%252Fsvg%253E
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
data:image/svg+xml,data%3Aimage%2Fsvg%2Bxml%2C%253Csvg%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%2520width%253D%252246%2522%2520height%253D%252246%2522%2520viewBox%253D%2522-2%2520-2%25209.82%25209.82%2522%253E%253Cpath%2520d%253D%2522M1.3%25203.4c.3%25200%2520.5-.2.5-.5s-.2-.4-.5-.4c-.2%25200-.4.1-.4.4%25200%2520.3.2.5.4.5zm1.7%25200c.2%25200%2520.4-.2.4-.5s-.2-.4-.4-.4c-.3%25200-.5.1-.5.4%25200%2520.3.2.5.5.5zm1.6%25200c.2%25200%2520.4-.2.4-.5s-.2-.4-.4-.4c-.3%25200-.5.1-.5.4%25200%2520.3.2.5.5.5z%2522%252F%253E%253C%252Fsvg%253E
|