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.
Files changed (289) hide show
  1. package/dist/bpmn-modeler.development.js +5172 -2047
  2. package/dist/bpmn-modeler.production.min.js +35 -35
  3. package/dist/bpmn-navigated-viewer.development.js +1547 -589
  4. package/dist/bpmn-navigated-viewer.production.min.js +5 -5
  5. package/dist/bpmn-viewer.development.js +1525 -584
  6. package/dist/bpmn-viewer.production.min.js +5 -5
  7. package/lib/BaseModeler.d.ts +12 -5
  8. package/lib/BaseModeler.js +4 -5
  9. package/lib/BaseViewer.d.ts +160 -366
  10. package/lib/BaseViewer.js +136 -57
  11. package/lib/Modeler.d.ts +76 -15
  12. package/lib/Modeler.js +6 -4
  13. package/lib/NavigatedViewer.d.ts +8 -3
  14. package/lib/Viewer.d.ts +44 -3
  15. package/lib/core/index.d.ts +10 -0
  16. package/lib/draw/BpmnRenderUtil.d.ts +76 -0
  17. package/lib/draw/BpmnRenderUtil.js +73 -21
  18. package/lib/draw/BpmnRenderer.d.ts +124 -0
  19. package/lib/draw/BpmnRenderer.js +51 -0
  20. package/lib/draw/PathMap.d.ts +330 -0
  21. package/lib/draw/PathMap.js +9 -2
  22. package/lib/draw/TextRenderer.d.ts +74 -0
  23. package/lib/draw/TextRenderer.js +32 -11
  24. package/lib/draw/index.d.ts +10 -0
  25. package/lib/features/align-elements/AlignElementsContextPadProvider.d.ts +32 -0
  26. package/lib/features/align-elements/AlignElementsContextPadProvider.js +28 -5
  27. package/lib/features/align-elements/AlignElementsIcons.d.ts +10 -0
  28. package/lib/features/align-elements/AlignElementsMenuProvider.d.ts +32 -0
  29. package/lib/features/align-elements/AlignElementsMenuProvider.js +38 -10
  30. package/lib/features/align-elements/BpmnAlignElements.d.ts +9 -0
  31. package/lib/features/align-elements/BpmnAlignElements.js +7 -1
  32. package/lib/features/align-elements/index.d.ts +11 -0
  33. package/lib/features/auto-place/BpmnAutoPlace.d.ts +13 -0
  34. package/lib/features/auto-place/BpmnAutoPlace.js +3 -0
  35. package/lib/features/auto-place/BpmnAutoPlaceUtil.d.ts +47 -0
  36. package/lib/features/auto-place/BpmnAutoPlaceUtil.js +39 -11
  37. package/lib/features/auto-place/index.d.ts +7 -0
  38. package/lib/features/auto-resize/BpmnAutoResize.d.ts +25 -0
  39. package/lib/features/auto-resize/BpmnAutoResize.js +15 -7
  40. package/lib/features/auto-resize/BpmnAutoResizeProvider.d.ts +26 -0
  41. package/lib/features/auto-resize/BpmnAutoResizeProvider.js +16 -4
  42. package/lib/features/auto-resize/index.d.ts +8 -0
  43. package/lib/features/context-pad/ContextPadProvider.d.ts +60 -0
  44. package/lib/features/context-pad/ContextPadProvider.js +64 -9
  45. package/lib/features/context-pad/index.d.ts +7 -0
  46. package/lib/features/copy-paste/BpmnCopyPaste.d.ts +17 -0
  47. package/lib/features/copy-paste/BpmnCopyPaste.js +15 -7
  48. package/lib/features/copy-paste/ModdleCopy.d.ts +45 -0
  49. package/lib/features/copy-paste/ModdleCopy.js +17 -45
  50. package/lib/features/copy-paste/index.d.ts +9 -0
  51. package/lib/features/di-ordering/BpmnDiOrdering.d.ts +11 -0
  52. package/lib/features/di-ordering/BpmnDiOrdering.js +8 -0
  53. package/lib/features/di-ordering/index.d.ts +6 -0
  54. package/lib/features/distribute-elements/BpmnDistributeElements.d.ts +10 -0
  55. package/lib/features/distribute-elements/BpmnDistributeElements.js +9 -4
  56. package/lib/features/distribute-elements/DistributeElementsIcons.d.ts +5 -0
  57. package/lib/features/distribute-elements/DistributeElementsMenuProvider.d.ts +32 -0
  58. package/lib/features/distribute-elements/DistributeElementsMenuProvider.js +27 -4
  59. package/lib/features/distribute-elements/index.d.ts +9 -0
  60. package/lib/features/drilldown/DrilldownBreadcrumbs.d.ts +19 -0
  61. package/lib/features/drilldown/DrilldownBreadcrumbs.js +34 -24
  62. package/lib/features/drilldown/DrilldownCentering.d.ts +17 -0
  63. package/lib/features/drilldown/DrilldownCentering.js +7 -2
  64. package/lib/features/drilldown/DrilldownOverlayBehavior.d.ts +18 -0
  65. package/lib/features/drilldown/DrilldownOverlayBehavior.js +70 -40
  66. package/lib/features/drilldown/SubprocessCompatibility.d.ts +21 -0
  67. package/lib/features/drilldown/SubprocessCompatibility.js +80 -30
  68. package/lib/features/drilldown/index.d.ts +13 -0
  69. package/lib/features/editor-actions/BpmnEditorActions.d.ts +13 -0
  70. package/lib/features/editor-actions/BpmnEditorActions.js +4 -0
  71. package/lib/features/editor-actions/index.d.ts +6 -0
  72. package/lib/features/grid-snapping/BpmnGridSnapping.d.ts +9 -0
  73. package/lib/features/grid-snapping/BpmnGridSnapping.js +7 -0
  74. package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.d.ts +12 -0
  75. package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.js +16 -1
  76. package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.d.ts +27 -0
  77. package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js +20 -8
  78. package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.d.ts +13 -0
  79. package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.js +11 -1
  80. package/lib/features/grid-snapping/behavior/index.d.ts +10 -0
  81. package/lib/features/grid-snapping/index.d.ts +11 -0
  82. package/lib/features/interaction-events/BpmnInteractionEvents.d.ts +18 -0
  83. package/lib/features/interaction-events/BpmnInteractionEvents.js +34 -9
  84. package/lib/features/interaction-events/index.d.ts +6 -0
  85. package/lib/features/keyboard/BpmnKeyboardBindings.d.ts +15 -0
  86. package/lib/features/keyboard/BpmnKeyboardBindings.js +5 -0
  87. package/lib/features/keyboard/index.d.ts +7 -0
  88. package/lib/features/label-editing/LabelEditingPreview.d.ts +13 -0
  89. package/lib/features/label-editing/LabelEditingPreview.js +13 -6
  90. package/lib/features/label-editing/LabelEditingProvider.d.ts +62 -0
  91. package/lib/features/label-editing/LabelEditingProvider.js +48 -11
  92. package/lib/features/label-editing/LabelUtil.d.ts +14 -0
  93. package/lib/features/label-editing/LabelUtil.js +16 -1
  94. package/lib/features/label-editing/cmd/UpdateLabelHandler.d.ts +22 -0
  95. package/lib/features/label-editing/cmd/UpdateLabelHandler.js +14 -3
  96. package/lib/features/label-editing/index.d.ts +9 -0
  97. package/lib/features/modeling/BpmnFactory.d.ts +67 -0
  98. package/lib/features/modeling/BpmnFactory.js +57 -8
  99. package/lib/features/modeling/BpmnLayouter.d.ts +26 -0
  100. package/lib/features/modeling/BpmnLayouter.js +25 -2
  101. package/lib/features/modeling/BpmnUpdater.d.ts +92 -0
  102. package/lib/features/modeling/BpmnUpdater.js +90 -29
  103. package/lib/features/modeling/ElementFactory.d.ts +116 -0
  104. package/lib/features/modeling/ElementFactory.js +114 -17
  105. package/lib/features/modeling/ElementFactory.test.ts +133 -0
  106. package/lib/features/modeling/Modeling.d.ts +150 -0
  107. package/lib/features/modeling/Modeling.js +124 -19
  108. package/lib/features/modeling/Modeling.test.ts +148 -0
  109. package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.d.ts +20 -0
  110. package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js +16 -6
  111. package/lib/features/modeling/behavior/AppendBehavior.d.ts +6 -0
  112. package/lib/features/modeling/behavior/AppendBehavior.js +6 -5
  113. package/lib/features/modeling/behavior/AssociationBehavior.d.ts +11 -0
  114. package/lib/features/modeling/behavior/AssociationBehavior.js +9 -1
  115. package/lib/features/modeling/behavior/AttachEventBehavior.d.ts +15 -0
  116. package/lib/features/modeling/behavior/AttachEventBehavior.js +11 -3
  117. package/lib/features/modeling/behavior/BoundaryEventBehavior.d.ts +15 -0
  118. package/lib/features/modeling/behavior/BoundaryEventBehavior.js +8 -1
  119. package/lib/features/modeling/behavior/CreateBehavior.d.ts +9 -0
  120. package/lib/features/modeling/behavior/CreateBehavior.js +6 -0
  121. package/lib/features/modeling/behavior/CreateDataObjectBehavior.d.ts +15 -0
  122. package/lib/features/modeling/behavior/CreateDataObjectBehavior.js +10 -4
  123. package/lib/features/modeling/behavior/CreateParticipantBehavior.d.ts +19 -0
  124. package/lib/features/modeling/behavior/CreateParticipantBehavior.js +10 -0
  125. package/lib/features/modeling/behavior/DataInputAssociationBehavior.d.ts +21 -0
  126. package/lib/features/modeling/behavior/DataInputAssociationBehavior.js +5 -0
  127. package/lib/features/modeling/behavior/DataStoreBehavior.d.ts +19 -0
  128. package/lib/features/modeling/behavior/DataStoreBehavior.js +12 -1
  129. package/lib/features/modeling/behavior/DeleteLaneBehavior.d.ts +15 -0
  130. package/lib/features/modeling/behavior/DeleteLaneBehavior.js +9 -3
  131. package/lib/features/modeling/behavior/DetachEventBehavior.d.ts +15 -0
  132. package/lib/features/modeling/behavior/DetachEventBehavior.js +11 -3
  133. package/lib/features/modeling/behavior/DropOnFlowBehavior.d.ts +13 -0
  134. package/lib/features/modeling/behavior/DropOnFlowBehavior.js +11 -1
  135. package/lib/features/modeling/behavior/EventBasedGatewayBehavior.d.ts +11 -0
  136. package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +9 -0
  137. package/lib/features/modeling/behavior/FixHoverBehavior.d.ts +17 -0
  138. package/lib/features/modeling/behavior/FixHoverBehavior.js +6 -0
  139. package/lib/features/modeling/behavior/GroupBehavior.d.ts +26 -0
  140. package/lib/features/modeling/behavior/GroupBehavior.js +35 -13
  141. package/lib/features/modeling/behavior/ImportDockingFix.d.ts +13 -0
  142. package/lib/features/modeling/behavior/ImportDockingFix.js +3 -0
  143. package/lib/features/modeling/behavior/IsHorizontalFix.d.ts +10 -0
  144. package/lib/features/modeling/behavior/IsHorizontalFix.js +4 -0
  145. package/lib/features/modeling/behavior/LabelBehavior.d.ts +56 -0
  146. package/lib/features/modeling/behavior/LabelBehavior.js +22 -10
  147. package/lib/features/modeling/behavior/LayoutConnectionBehavior.d.ts +16 -0
  148. package/lib/features/modeling/behavior/LayoutConnectionBehavior.js +6 -2
  149. package/lib/features/modeling/behavior/MessageFlowBehavior.d.ts +15 -0
  150. package/lib/features/modeling/behavior/MessageFlowBehavior.js +8 -0
  151. package/lib/features/modeling/behavior/ModelingFeedback.d.ts +13 -0
  152. package/lib/features/modeling/behavior/ModelingFeedback.js +11 -0
  153. package/lib/features/modeling/behavior/RemoveElementBehavior.d.ts +13 -0
  154. package/lib/features/modeling/behavior/RemoveElementBehavior.js +11 -1
  155. package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.d.ts +16 -0
  156. package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +8 -0
  157. package/lib/features/modeling/behavior/RemoveParticipantBehavior.d.ts +15 -0
  158. package/lib/features/modeling/behavior/RemoveParticipantBehavior.js +8 -1
  159. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.d.ts +15 -0
  160. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +13 -1
  161. package/lib/features/modeling/behavior/ReplaceElementBehaviour.d.ts +23 -0
  162. package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +19 -4
  163. package/lib/features/modeling/behavior/ResizeBehavior.d.ts +57 -0
  164. package/lib/features/modeling/behavior/ResizeBehavior.js +35 -0
  165. package/lib/features/modeling/behavior/ResizeLaneBehavior.d.ts +16 -0
  166. package/lib/features/modeling/behavior/ResizeLaneBehavior.js +10 -3
  167. package/lib/features/modeling/behavior/RootElementReferenceBehavior.d.ts +25 -0
  168. package/lib/features/modeling/behavior/RootElementReferenceBehavior.js +19 -0
  169. package/lib/features/modeling/behavior/SpaceToolBehavior.d.ts +10 -0
  170. package/lib/features/modeling/behavior/SpaceToolBehavior.js +14 -4
  171. package/lib/features/modeling/behavior/SubProcessPlaneBehavior.d.ts +28 -0
  172. package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +45 -23
  173. package/lib/features/modeling/behavior/SubProcessStartEventBehavior.d.ts +15 -0
  174. package/lib/features/modeling/behavior/SubProcessStartEventBehavior.js +6 -0
  175. package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.d.ts +14 -0
  176. package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +14 -1
  177. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.d.ts +13 -0
  178. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +11 -3
  179. package/lib/features/modeling/behavior/UnclaimIdBehavior.d.ts +19 -0
  180. package/lib/features/modeling/behavior/UnclaimIdBehavior.js +7 -0
  181. package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.d.ts +16 -0
  182. package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +6 -3
  183. package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +17 -0
  184. package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +13 -10
  185. package/lib/features/modeling/behavior/index.d.ts +2 -0
  186. package/lib/features/modeling/behavior/index.js +3 -0
  187. package/lib/features/modeling/behavior/util/CategoryUtil.d.ts +49 -0
  188. package/lib/features/modeling/behavior/util/CategoryUtil.js +10 -6
  189. package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.d.ts +19 -0
  190. package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.js +11 -5
  191. package/lib/features/modeling/behavior/util/GeometricUtil.d.ts +1 -0
  192. package/lib/features/modeling/behavior/util/LabelLayoutUtil.d.ts +32 -0
  193. package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +27 -18
  194. package/lib/features/modeling/behavior/util/LayoutUtil.d.ts +48 -0
  195. package/lib/features/modeling/behavior/util/LayoutUtil.js +35 -6
  196. package/lib/features/modeling/behavior/util/LineAttachmentUtil.d.ts +37 -0
  197. package/lib/features/modeling/behavior/util/LineAttachmentUtil.js +17 -5
  198. package/lib/features/modeling/behavior/util/LineIntersect.d.ts +13 -0
  199. package/lib/features/modeling/behavior/util/LineIntersect.js +4 -0
  200. package/lib/features/modeling/behavior/util/ResizeUtil.d.ts +1 -0
  201. package/lib/features/modeling/cmd/AddLaneHandler.d.ts +22 -0
  202. package/lib/features/modeling/cmd/AddLaneHandler.js +8 -0
  203. package/lib/features/modeling/cmd/IdClaimHandler.d.ts +22 -0
  204. package/lib/features/modeling/cmd/IdClaimHandler.js +15 -0
  205. package/lib/features/modeling/cmd/ResizeLaneHandler.d.ts +39 -0
  206. package/lib/features/modeling/cmd/ResizeLaneHandler.js +17 -4
  207. package/lib/features/modeling/cmd/SetColorHandler.d.ts +18 -0
  208. package/lib/features/modeling/cmd/SetColorHandler.js +25 -12
  209. package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +22 -0
  210. package/lib/features/modeling/cmd/SplitLaneHandler.js +9 -0
  211. package/lib/features/modeling/cmd/UpdateCanvasRootHandler.d.ts +20 -0
  212. package/lib/features/modeling/cmd/UpdateCanvasRootHandler.js +16 -1
  213. package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts +21 -0
  214. package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.js +29 -4
  215. package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.d.ts +20 -0
  216. package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.js +17 -3
  217. package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +60 -0
  218. package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +38 -14
  219. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.d.ts +18 -0
  220. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.js +15 -0
  221. package/lib/features/modeling/index.d.ts +27 -0
  222. package/lib/features/modeling/util/LaneUtil.d.ts +46 -0
  223. package/lib/features/modeling/util/LaneUtil.js +22 -13
  224. package/lib/features/modeling/util/ModelingUtil.d.ts +12 -0
  225. package/lib/features/modeling/util/ModelingUtil.js +10 -4
  226. package/lib/features/ordering/BpmnOrderingProvider.d.ts +21 -0
  227. package/lib/features/ordering/BpmnOrderingProvider.js +9 -3
  228. package/lib/features/ordering/index.d.ts +7 -0
  229. package/lib/features/palette/PaletteProvider.d.ts +34 -0
  230. package/lib/features/palette/PaletteProvider.js +26 -2
  231. package/lib/features/palette/index.d.ts +9 -0
  232. package/lib/features/popup-menu/ReplaceMenuProvider.d.ts +50 -0
  233. package/lib/features/popup-menu/ReplaceMenuProvider.js +226 -202
  234. package/lib/features/popup-menu/index.d.ts +11 -0
  235. package/lib/features/popup-menu/util/TypeUtil.d.ts +12 -0
  236. package/lib/features/popup-menu/util/TypeUtil.js +4 -1
  237. package/lib/features/replace/BpmnReplace.d.ts +47 -0
  238. package/lib/features/replace/BpmnReplace.js +81 -29
  239. package/lib/features/replace/ReplaceOptions.d.ts +70 -0
  240. package/lib/features/replace/ReplaceOptions.js +58 -0
  241. package/lib/features/replace/index.d.ts +9 -0
  242. package/lib/features/replace-preview/BpmnReplacePreview.d.ts +17 -0
  243. package/lib/features/replace-preview/BpmnReplacePreview.js +15 -1
  244. package/lib/features/replace-preview/index.d.ts +7 -0
  245. package/lib/features/rules/BpmnRules.d.ts +171 -0
  246. package/lib/features/rules/BpmnRules.js +295 -46
  247. package/lib/features/rules/index.d.ts +7 -0
  248. package/lib/features/search/BpmnSearchProvider.d.ts +29 -0
  249. package/lib/features/search/BpmnSearchProvider.js +30 -22
  250. package/lib/features/search/index.d.ts +7 -0
  251. package/lib/features/snapping/BpmnConnectSnapping.d.ts +17 -0
  252. package/lib/features/snapping/BpmnConnectSnapping.js +51 -3
  253. package/lib/features/snapping/BpmnCreateMoveSnapping.d.ts +41 -0
  254. package/lib/features/snapping/BpmnCreateMoveSnapping.js +47 -1
  255. package/lib/features/snapping/BpmnSnappingUtil.d.ts +11 -0
  256. package/lib/features/snapping/BpmnSnappingUtil.js +12 -0
  257. package/lib/features/snapping/index.d.ts +9 -0
  258. package/lib/features/space-tool/BpmnSpaceTool.d.ts +21 -0
  259. package/lib/features/space-tool/BpmnSpaceTool.js +20 -1
  260. package/lib/features/space-tool/index.d.ts +6 -0
  261. package/lib/import/BpmnImporter.d.ts +49 -0
  262. package/lib/import/BpmnImporter.js +37 -10
  263. package/lib/import/BpmnTreeWalker.d.ts +22 -0
  264. package/lib/import/BpmnTreeWalker.js +25 -22
  265. package/lib/import/Importer.d.ts +25 -0
  266. package/lib/import/Importer.js +15 -21
  267. package/lib/import/Util.d.ts +1 -0
  268. package/lib/import/index.d.ts +6 -0
  269. package/lib/model/Types.d.ts +24 -0
  270. package/lib/model/Types.ts +40 -0
  271. package/lib/util/CompatibilityUtil.d.ts +22 -0
  272. package/lib/util/CompatibilityUtil.js +13 -0
  273. package/lib/util/DiUtil.d.ts +53 -0
  274. package/lib/util/DiUtil.js +47 -13
  275. package/lib/util/DrilldownUtil.d.ts +39 -0
  276. package/lib/util/DrilldownUtil.js +12 -8
  277. package/lib/util/LabelUtil.d.ts +73 -0
  278. package/lib/util/LabelUtil.js +40 -16
  279. package/lib/util/ModelUtil.d.ts +40 -0
  280. package/lib/util/ModelUtil.js +9 -5
  281. package/lib/util/PoweredByUtil.d.ts +8 -0
  282. package/lib/util/Types.js +5 -0
  283. package/lib/util/Types.ts +4 -0
  284. package/package.json +10 -5
  285. package/test/matchers/ConnectionMatchers.js +1 -1
  286. package/lib/icons/dist/append.svg +0 -1
  287. package/lib/icons/dist/connect-context-pad.svg +0 -1
  288. package/lib/icons/dist/connect-palette.svg +0 -1
  289. package/lib/icons/dist/create.svg +0 -1
@@ -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
- * Returns true if the given semantic has an external label
24
+ * Return true if the given semantic has an external label.
25
+ *
26
+ * @param {Element} semantic
18
27
  *
19
- * @param {BpmnElement} semantic
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
- * Returns true if the given element has an external label
43
+ * Return true if the given element has an external label.
36
44
  *
37
- * @param {djs.model.shape} element
38
- * @return {boolean} true if has label
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 for sequence flow labels
54
+ * Get the position of a sequence flow label.
55
+ *
56
+ * @param {Point[]} waypoints
46
57
  *
47
- * @param {Array<Point>} waypoints
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 {Array<Point>} waypoints
81
- * @return {Point} the mid point
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
- * Returns the bounds of an elements label, parsed from the elements DI or
133
+ * Return the bounds of an elements label, parsed from the elements DI or
117
134
  * generated from its bounds.
118
135
  *
119
- * @param {BpmndDi} di
120
- * @param {djs.model.Base} element
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;
@@ -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 {djs.model.Base|ModdleElement} element
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 {djs.model.Base} element
25
- * @param {Array<string>} types
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 {djs.model.Base|ModdleElement} element
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 {djs.model.Base} element
53
+ * @param {Element} element
50
54
  *
51
55
  * @return {ModdleElement}
52
56
  */
@@ -0,0 +1,8 @@
1
+ export function open(): void;
2
+ export const BPMNIO_IMG: string;
3
+ export namespace LOGO_STYLES {
4
+ const verticalAlign: string;
5
+ }
6
+ export namespace LINK_STYLES {
7
+ const color: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @typedef {Object} Colors
3
+ * @property {string} [fill]
4
+ * @property {string} [stroke]
5
+ */
@@ -0,0 +1,4 @@
1
+ export type Colors = {
2
+ fill?: string;
3
+ stroke?: string;
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmn-js",
3
- "version": "12.1.0",
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 test:types distro test:distro",
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": "^11.12.0",
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|Array<Point>} exp
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