bpmn-js 13.0.4 → 13.0.5

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 (171) hide show
  1. package/dist/bpmn-modeler.development.js +114 -160
  2. package/dist/bpmn-modeler.production.min.js +34 -34
  3. package/dist/bpmn-navigated-viewer.development.js +32 -16
  4. package/dist/bpmn-navigated-viewer.production.min.js +2 -2
  5. package/dist/bpmn-viewer.development.js +32 -16
  6. package/dist/bpmn-viewer.production.min.js +2 -2
  7. package/lib/BaseModeler.d.ts +12 -12
  8. package/lib/BaseViewer.d.ts +160 -160
  9. package/lib/Modeler.d.ts +76 -76
  10. package/lib/NavigatedViewer.d.ts +8 -8
  11. package/lib/Viewer.d.ts +44 -44
  12. package/lib/core/index.d.ts +10 -10
  13. package/lib/draw/BpmnRenderUtil.d.ts +77 -77
  14. package/lib/draw/BpmnRenderer.d.ts +126 -124
  15. package/lib/draw/BpmnRenderer.js +5 -5
  16. package/lib/draw/PathMap.d.ts +330 -330
  17. package/lib/draw/TextRenderer.d.ts +74 -74
  18. package/lib/draw/index.d.ts +10 -10
  19. package/lib/features/align-elements/AlignElementsContextPadProvider.d.ts +32 -32
  20. package/lib/features/align-elements/AlignElementsIcons.d.ts +10 -10
  21. package/lib/features/align-elements/AlignElementsMenuProvider.d.ts +32 -32
  22. package/lib/features/align-elements/BpmnAlignElements.d.ts +9 -9
  23. package/lib/features/align-elements/dist/align-bottom-tool.svg +1 -0
  24. package/lib/features/align-elements/dist/align-horizontal-center-tool.svg +1 -0
  25. package/lib/features/align-elements/dist/align-left-tool.svg +1 -0
  26. package/lib/features/align-elements/dist/align-right-tool.svg +1 -0
  27. package/lib/features/align-elements/dist/align-tool.svg +1 -0
  28. package/lib/features/align-elements/dist/align-top-tool.svg +1 -0
  29. package/lib/features/align-elements/dist/align-vertical-center-tool.svg +1 -0
  30. package/lib/features/align-elements/index.d.ts +11 -11
  31. package/lib/features/auto-place/BpmnAutoPlace.d.ts +13 -13
  32. package/lib/features/auto-place/BpmnAutoPlaceUtil.d.ts +47 -47
  33. package/lib/features/auto-place/index.d.ts +7 -7
  34. package/lib/features/auto-resize/BpmnAutoResize.d.ts +25 -25
  35. package/lib/features/auto-resize/BpmnAutoResizeProvider.d.ts +26 -26
  36. package/lib/features/auto-resize/index.d.ts +8 -8
  37. package/lib/features/context-pad/ContextPadProvider.d.ts +60 -60
  38. package/lib/features/context-pad/index.d.ts +7 -7
  39. package/lib/features/copy-paste/BpmnCopyPaste.d.ts +17 -17
  40. package/lib/features/copy-paste/ModdleCopy.d.ts +45 -45
  41. package/lib/features/copy-paste/index.d.ts +9 -9
  42. package/lib/features/di-ordering/BpmnDiOrdering.d.ts +11 -11
  43. package/lib/features/di-ordering/index.d.ts +6 -6
  44. package/lib/features/distribute-elements/BpmnDistributeElements.d.ts +10 -10
  45. package/lib/features/distribute-elements/DistributeElementsIcons.d.ts +5 -5
  46. package/lib/features/distribute-elements/DistributeElementsMenuProvider.d.ts +32 -32
  47. package/lib/features/distribute-elements/index.d.ts +9 -9
  48. package/lib/features/drilldown/DrilldownBreadcrumbs.d.ts +19 -19
  49. package/lib/features/drilldown/DrilldownCentering.d.ts +17 -17
  50. package/lib/features/drilldown/DrilldownOverlayBehavior.d.ts +18 -18
  51. package/lib/features/drilldown/SubprocessCompatibility.d.ts +21 -21
  52. package/lib/features/drilldown/index.d.ts +13 -13
  53. package/lib/features/editor-actions/BpmnEditorActions.d.ts +13 -13
  54. package/lib/features/editor-actions/index.d.ts +6 -6
  55. package/lib/features/grid-snapping/BpmnGridSnapping.d.ts +9 -9
  56. package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.d.ts +12 -12
  57. package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.d.ts +27 -27
  58. package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.d.ts +13 -13
  59. package/lib/features/grid-snapping/behavior/index.d.ts +10 -10
  60. package/lib/features/grid-snapping/index.d.ts +11 -11
  61. package/lib/features/interaction-events/BpmnInteractionEvents.d.ts +18 -18
  62. package/lib/features/interaction-events/index.d.ts +6 -6
  63. package/lib/features/keyboard/BpmnKeyboardBindings.d.ts +15 -15
  64. package/lib/features/keyboard/index.d.ts +7 -7
  65. package/lib/features/label-editing/LabelEditingPreview.d.ts +13 -13
  66. package/lib/features/label-editing/LabelEditingProvider.d.ts +62 -62
  67. package/lib/features/label-editing/LabelUtil.d.ts +1 -1
  68. package/lib/features/label-editing/cmd/UpdateLabelHandler.d.ts +22 -22
  69. package/lib/features/label-editing/index.d.ts +9 -9
  70. package/lib/features/modeling/BpmnFactory.d.ts +73 -73
  71. package/lib/features/modeling/BpmnLayouter.d.ts +26 -26
  72. package/lib/features/modeling/BpmnUpdater.d.ts +92 -92
  73. package/lib/features/modeling/ElementFactory.d.ts +119 -119
  74. package/lib/features/modeling/Modeling.d.ts +150 -150
  75. package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.d.ts +20 -20
  76. package/lib/features/modeling/behavior/AppendBehavior.d.ts +6 -6
  77. package/lib/features/modeling/behavior/AssociationBehavior.d.ts +11 -11
  78. package/lib/features/modeling/behavior/AttachEventBehavior.d.ts +15 -15
  79. package/lib/features/modeling/behavior/BoundaryEventBehavior.d.ts +15 -15
  80. package/lib/features/modeling/behavior/CreateBehavior.d.ts +9 -9
  81. package/lib/features/modeling/behavior/CreateDataObjectBehavior.d.ts +15 -15
  82. package/lib/features/modeling/behavior/CreateParticipantBehavior.d.ts +19 -19
  83. package/lib/features/modeling/behavior/DataInputAssociationBehavior.d.ts +21 -21
  84. package/lib/features/modeling/behavior/DataStoreBehavior.d.ts +19 -19
  85. package/lib/features/modeling/behavior/DeleteLaneBehavior.d.ts +15 -15
  86. package/lib/features/modeling/behavior/DetachEventBehavior.d.ts +15 -15
  87. package/lib/features/modeling/behavior/DropOnFlowBehavior.d.ts +13 -13
  88. package/lib/features/modeling/behavior/EventBasedGatewayBehavior.d.ts +11 -11
  89. package/lib/features/modeling/behavior/FixHoverBehavior.d.ts +17 -17
  90. package/lib/features/modeling/behavior/GroupBehavior.d.ts +26 -26
  91. package/lib/features/modeling/behavior/ImportDockingFix.d.ts +13 -13
  92. package/lib/features/modeling/behavior/IsHorizontalFix.d.ts +10 -10
  93. package/lib/features/modeling/behavior/LabelBehavior.d.ts +56 -56
  94. package/lib/features/modeling/behavior/LayoutConnectionBehavior.d.ts +16 -16
  95. package/lib/features/modeling/behavior/MessageFlowBehavior.d.ts +15 -15
  96. package/lib/features/modeling/behavior/ModelingFeedback.d.ts +13 -13
  97. package/lib/features/modeling/behavior/RemoveElementBehavior.d.ts +13 -13
  98. package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.d.ts +16 -16
  99. package/lib/features/modeling/behavior/RemoveParticipantBehavior.d.ts +15 -15
  100. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.d.ts +15 -15
  101. package/lib/features/modeling/behavior/ReplaceElementBehaviour.d.ts +23 -23
  102. package/lib/features/modeling/behavior/ResizeBehavior.d.ts +57 -57
  103. package/lib/features/modeling/behavior/ResizeLaneBehavior.d.ts +16 -16
  104. package/lib/features/modeling/behavior/RootElementReferenceBehavior.d.ts +25 -25
  105. package/lib/features/modeling/behavior/SpaceToolBehavior.d.ts +10 -10
  106. package/lib/features/modeling/behavior/SubProcessPlaneBehavior.d.ts +28 -28
  107. package/lib/features/modeling/behavior/SubProcessStartEventBehavior.d.ts +15 -15
  108. package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.d.ts +14 -14
  109. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.d.ts +13 -13
  110. package/lib/features/modeling/behavior/UnclaimIdBehavior.d.ts +19 -19
  111. package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.d.ts +16 -16
  112. package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +17 -17
  113. package/lib/features/modeling/behavior/index.d.ts +2 -2
  114. package/lib/features/modeling/behavior/util/CategoryUtil.d.ts +49 -49
  115. package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.d.ts +19 -19
  116. package/lib/features/modeling/behavior/util/GeometricUtil.d.ts +1 -1
  117. package/lib/features/modeling/behavior/util/LabelLayoutUtil.d.ts +32 -32
  118. package/lib/features/modeling/behavior/util/LayoutUtil.d.ts +48 -48
  119. package/lib/features/modeling/behavior/util/LineAttachmentUtil.d.ts +37 -37
  120. package/lib/features/modeling/behavior/util/LineIntersect.d.ts +13 -13
  121. package/lib/features/modeling/behavior/util/ResizeUtil.d.ts +1 -1
  122. package/lib/features/modeling/cmd/AddLaneHandler.d.ts +22 -22
  123. package/lib/features/modeling/cmd/IdClaimHandler.d.ts +22 -22
  124. package/lib/features/modeling/cmd/ResizeLaneHandler.d.ts +39 -39
  125. package/lib/features/modeling/cmd/SetColorHandler.d.ts +18 -18
  126. package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +22 -22
  127. package/lib/features/modeling/cmd/UpdateCanvasRootHandler.d.ts +20 -20
  128. package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts +21 -21
  129. package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.d.ts +20 -20
  130. package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +60 -60
  131. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.d.ts +18 -18
  132. package/lib/features/modeling/index.d.ts +27 -27
  133. package/lib/features/modeling/util/LaneUtil.d.ts +46 -46
  134. package/lib/features/modeling/util/ModelingUtil.d.ts +12 -12
  135. package/lib/features/ordering/BpmnOrderingProvider.d.ts +21 -21
  136. package/lib/features/ordering/index.d.ts +7 -7
  137. package/lib/features/palette/PaletteProvider.d.ts +34 -34
  138. package/lib/features/palette/dist/create.svg +1 -0
  139. package/lib/features/palette/index.d.ts +9 -9
  140. package/lib/features/popup-menu/ReplaceMenuProvider.d.ts +50 -50
  141. package/lib/features/popup-menu/index.d.ts +11 -11
  142. package/lib/features/popup-menu/util/TypeUtil.d.ts +14 -14
  143. package/lib/features/replace/BpmnReplace.d.ts +47 -47
  144. package/lib/features/replace/ReplaceOptions.d.ts +75 -75
  145. package/lib/features/replace/index.d.ts +9 -9
  146. package/lib/features/replace-preview/BpmnReplacePreview.d.ts +17 -17
  147. package/lib/features/replace-preview/index.d.ts +7 -7
  148. package/lib/features/rules/BpmnRules.d.ts +172 -172
  149. package/lib/features/rules/index.d.ts +7 -7
  150. package/lib/features/search/BpmnSearchProvider.d.ts +29 -29
  151. package/lib/features/search/index.d.ts +7 -7
  152. package/lib/features/snapping/BpmnConnectSnapping.d.ts +17 -17
  153. package/lib/features/snapping/BpmnCreateMoveSnapping.d.ts +41 -41
  154. package/lib/features/snapping/BpmnSnappingUtil.d.ts +11 -11
  155. package/lib/features/snapping/index.d.ts +9 -9
  156. package/lib/features/space-tool/BpmnSpaceTool.d.ts +21 -21
  157. package/lib/features/space-tool/index.d.ts +6 -6
  158. package/lib/import/BpmnImporter.d.ts +53 -53
  159. package/lib/import/BpmnTreeWalker.d.ts +22 -22
  160. package/lib/import/Importer.d.ts +25 -25
  161. package/lib/import/Util.d.ts +1 -1
  162. package/lib/import/index.d.ts +6 -6
  163. package/lib/model/Types.d.ts +24 -24
  164. package/lib/util/CompatibilityUtil.d.ts +22 -22
  165. package/lib/util/DiUtil.d.ts +53 -53
  166. package/lib/util/DrilldownUtil.d.ts +39 -39
  167. package/lib/util/LabelUtil.d.ts +88 -89
  168. package/lib/util/LabelUtil.js +12 -7
  169. package/lib/util/ModelUtil.d.ts +40 -40
  170. package/lib/util/PoweredByUtil.d.ts +8 -8
  171. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v13.0.4
2
+ * bpmn-js - bpmn-modeler v13.0.5
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2023-04-24
11
+ * Date: 2023-05-09
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -4570,6 +4570,28 @@
4570
4570
 
4571
4571
  var intersectPaths = intersect;
4572
4572
 
4573
+ /**
4574
+ * Checks whether a value is an instance of Connection.
4575
+ *
4576
+ * @param {any} value
4577
+ *
4578
+ * @return {boolean}
4579
+ */
4580
+ function isConnection$4(value) {
4581
+ return isObject(value) && has$1(value, 'waypoints');
4582
+ }
4583
+
4584
+ /**
4585
+ * Checks whether a value is an instance of Label.
4586
+ *
4587
+ * @param {any} value
4588
+ *
4589
+ * @return {boolean}
4590
+ */
4591
+ function isLabel$1(value) {
4592
+ return isObject(value) && has$1(value, 'labelTarget');
4593
+ }
4594
+
4573
4595
  /**
4574
4596
  * @typedef {import('../core/Types').ElementLike} Element
4575
4597
  * @typedef {import('../core/Types').ConnectionLike} Connection
@@ -4724,7 +4746,7 @@
4724
4746
  * @return {Point}
4725
4747
  */
4726
4748
  function getMid(element) {
4727
- if (isConnection$f(element)) {
4749
+ if (isConnection$4(element)) {
4728
4750
  return getConnectionMid(element);
4729
4751
  }
4730
4752
 
@@ -4864,10 +4886,6 @@
4864
4886
  return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
4865
4887
  }
4866
4888
 
4867
- function isConnection$f(element) {
4868
- return !!element.waypoints;
4869
- }
4870
-
4871
4889
  /**
4872
4890
  * @typedef {import('./Types').ConnectionLike} ConnectionLike
4873
4891
  * @typedef {import('./Types').RootLike} RootLike
@@ -7176,6 +7194,7 @@
7176
7194
  *
7177
7195
  * @return {Root}
7178
7196
  */
7197
+
7179
7198
  /**
7180
7199
  * Creates a connection.
7181
7200
  *
@@ -7199,6 +7218,7 @@
7199
7218
  *
7200
7219
  * @return {Connection}
7201
7220
  */
7221
+
7202
7222
  /**
7203
7223
  * Creates a shape.
7204
7224
  *
@@ -7222,6 +7242,7 @@
7222
7242
  *
7223
7243
  * @return {Shape}
7224
7244
  */
7245
+
7225
7246
  /**
7226
7247
  * Creates a label.
7227
7248
  *
@@ -7241,6 +7262,7 @@
7241
7262
  *
7242
7263
  * @param {'label'} type
7243
7264
  * @param {Object} [attrs]
7265
+ *
7244
7266
  * @return {Label}
7245
7267
  */
7246
7268
  function create(type, attrs) {
@@ -7255,6 +7277,7 @@
7255
7277
  * Checks whether an object is a model instance.
7256
7278
  *
7257
7279
  * @param {any} obj
7280
+ *
7258
7281
  * @return {boolean}
7259
7282
  */
7260
7283
  function isModelElement(obj) {
@@ -17956,7 +17979,7 @@
17956
17979
  * @return {boolean}
17957
17980
  */
17958
17981
  function hasExternalLabel(element) {
17959
- return isLabel$5(element.label);
17982
+ return isLabel(element.label);
17960
17983
  }
17961
17984
 
17962
17985
  /**
@@ -18084,15 +18107,15 @@
18084
18107
  *
18085
18108
  * @return {boolean}
18086
18109
  */
18087
- function isLabel$5(element) {
18110
+ function isLabel(element) {
18088
18111
  return element && !!element.labelTarget;
18089
18112
  }
18090
18113
 
18091
-
18092
18114
  /**
18093
- * @typedef { import('../model').DiagramElement } DiagramElement
18115
+ * @param {ModdleElement} semantic
18116
+ *
18117
+ * @returns {string}
18094
18118
  */
18095
-
18096
18119
  function getLabelAttr(semantic) {
18097
18120
  if (
18098
18121
  is$1(semantic, 'bpmn:FlowElement') ||
@@ -18115,6 +18138,11 @@
18115
18138
  }
18116
18139
  }
18117
18140
 
18141
+ /**
18142
+ * @param {ModdleElement} semantic
18143
+ *
18144
+ * @returns {string}
18145
+ */
18118
18146
  function getCategoryValue(semantic) {
18119
18147
  var categoryValueRef = semantic['categoryValueRef'];
18120
18148
 
@@ -18127,9 +18155,9 @@
18127
18155
  }
18128
18156
 
18129
18157
  /**
18130
- * @param {DiagramElement} element
18158
+ * @param {Element} element
18131
18159
  *
18132
- * @return {string} label
18160
+ * @return {string}
18133
18161
  */
18134
18162
  function getLabel(element) {
18135
18163
  var semantic = element.businessObject,
@@ -18148,10 +18176,10 @@
18148
18176
 
18149
18177
 
18150
18178
  /**
18151
- * @param {DiagramElement} element
18179
+ * @param {Element} element
18152
18180
  * @param {string} text
18153
18181
  *
18154
- * @return {DiagramElement} element
18182
+ * @return {Element}
18155
18183
  */
18156
18184
  function setLabel(element, text) {
18157
18185
  var semantic = element.businessObject,
@@ -18373,7 +18401,7 @@
18373
18401
  */
18374
18402
 
18375
18403
  /**
18376
- * @typedef { import('../model').DiagramElement } DiagramElement
18404
+ * @typedef { import('../model/Types').Element } Element
18377
18405
  */
18378
18406
 
18379
18407
  /**
@@ -20214,7 +20242,7 @@
20214
20242
 
20215
20243
 
20216
20244
  /**
20217
- * @param {DiagramElement} element
20245
+ * @param {Element} element
20218
20246
  *
20219
20247
  * @return {boolean}
20220
20248
  */
@@ -20226,7 +20254,7 @@
20226
20254
  * Draw shape into parentGfx.
20227
20255
  *
20228
20256
  * @param {SVGElement} parentGfx
20229
- * @param {DiagramElement} element
20257
+ * @param {Element} element
20230
20258
  *
20231
20259
  * @return {SVGElement} mainGfx
20232
20260
  */
@@ -20242,7 +20270,7 @@
20242
20270
  * Draw connection into parentGfx.
20243
20271
  *
20244
20272
  * @param {SVGElement} parentGfx
20245
- * @param {DiagramElement} element
20273
+ * @param {Element} element
20246
20274
  *
20247
20275
  * @return {SVGElement} mainGfx
20248
20276
  */
@@ -20257,7 +20285,7 @@
20257
20285
  /**
20258
20286
  * Get shape path.
20259
20287
  *
20260
- * @param {DiagramElement} element
20288
+ * @param {Element} element
20261
20289
  *
20262
20290
  * @return {string} path
20263
20291
  */
@@ -30770,7 +30798,7 @@
30770
30798
  let element = closest(event.delegateTarget || event.target, '.entry', true);
30771
30799
  let entryId = attr$1(element, DATA_REF);
30772
30800
 
30773
- entry = this._getEntry(entryId);
30801
+ entry = { id: entryId, ...this._getEntry(entryId) };
30774
30802
  }
30775
30803
 
30776
30804
  const handler = entry.action;
@@ -31743,7 +31771,7 @@
31743
31771
  y: sourceTrbl.top - 50 - element.height / 2
31744
31772
  };
31745
31773
 
31746
- if (isConnection$e(source)) {
31774
+ if (isConnection$3(source)) {
31747
31775
  position = getMid(source);
31748
31776
  position.x += 100;
31749
31777
  position.y -= 50;
@@ -31788,7 +31816,7 @@
31788
31816
  return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
31789
31817
  }
31790
31818
 
31791
- function isConnection$e(element) {
31819
+ function isConnection$3(element) {
31792
31820
  return !!element.waypoints;
31793
31821
  }
31794
31822
 
@@ -32229,7 +32257,7 @@
32229
32257
 
32230
32258
  forEach$1(elements, function(element) {
32231
32259
 
32232
- if (is$1(element, 'bpmn:Lane') || isLabel$5(element)) {
32260
+ if (is$1(element, 'bpmn:Lane') || isLabel(element)) {
32233
32261
  canResize = false;
32234
32262
  return;
32235
32263
  }
@@ -35243,7 +35271,7 @@
35243
35271
  hoverMid = hover && getSnapPoint(hover, event);
35244
35272
 
35245
35273
  // only snap on connections, elements can have multiple connect endpoints
35246
- if (!isConnection$d(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35274
+ if (!isConnection$4(hover) || !hoverMid || !hoverMid.x || !hoverMid.y) {
35247
35275
  return;
35248
35276
  }
35249
35277
 
@@ -35295,13 +35323,6 @@
35295
35323
 
35296
35324
  BendpointSnapping.$inject = [ 'eventBus' ];
35297
35325
 
35298
-
35299
- // helpers //////////////////////
35300
-
35301
- function isConnection$d(element) {
35302
- return element && !!element.waypoints;
35303
- }
35304
-
35305
35326
  /**
35306
35327
  * @type { import('didi').ModuleDeclaration }
35307
35328
  */
@@ -36828,11 +36849,11 @@
36828
36849
  elements = filter(elements, function(element) {
36829
36850
  var labelTarget = element.labelTarget;
36830
36851
 
36831
- return !element.parent && !(isLabel$4(element) && elements.indexOf(labelTarget) !== -1);
36852
+ return !element.parent && !(isLabel$1(element) && elements.indexOf(labelTarget) !== -1);
36832
36853
  });
36833
36854
 
36834
36855
  var shape = find(elements, function(element) {
36835
- return !isConnection$c(element);
36856
+ return !isConnection$4(element);
36836
36857
  });
36837
36858
 
36838
36859
  var attach = false,
@@ -36987,7 +37008,7 @@
36987
37008
 
36988
37009
  // update shape
36989
37010
  shape = find(elements, function(element) {
36990
- return !isConnection$c(element);
37011
+ return !isConnection$4(element);
36991
37012
  });
36992
37013
  }
36993
37014
 
@@ -37028,7 +37049,7 @@
37028
37049
  }
37029
37050
 
37030
37051
  var shape = find(elements, function(element) {
37031
- return !isConnection$c(element);
37052
+ return !isConnection$4(element);
37032
37053
  });
37033
37054
 
37034
37055
  if (!shape) {
@@ -37062,7 +37083,7 @@
37062
37083
 
37063
37084
  // center elements around cursor
37064
37085
  forEach$1(elements, function(element) {
37065
- if (isConnection$c(element)) {
37086
+ if (isConnection$4(element)) {
37066
37087
  element.waypoints = map$1(element.waypoints, function(waypoint) {
37067
37088
  return {
37068
37089
  x: waypoint.x - bbox.x - bbox.width / 2,
@@ -37124,16 +37145,8 @@
37124
37145
  }
37125
37146
  }
37126
37147
 
37127
- function isConnection$c(element) {
37128
- return !!element.waypoints;
37129
- }
37130
-
37131
37148
  function isSingleShape(elements) {
37132
- return elements && elements.length === 1 && !isConnection$c(elements[0]);
37133
- }
37134
-
37135
- function isLabel$4(element) {
37136
- return !!element.labelTarget;
37149
+ return elements && elements.length === 1 && !isConnection$4(elements[ 0 ]);
37137
37150
  }
37138
37151
 
37139
37152
  /**
@@ -37466,7 +37479,7 @@
37466
37479
  }
37467
37480
 
37468
37481
  // connections (priority = 3)
37469
- if (isConnection$b(element)) {
37482
+ if (isConnection$4(element)) {
37470
37483
  descriptor.priority = 3;
37471
37484
 
37472
37485
  descriptor.source = element.source.id;
@@ -37476,7 +37489,7 @@
37476
37489
  }
37477
37490
 
37478
37491
  // labels (priority = 4)
37479
- if (isLabel$3(element)) {
37492
+ if (isLabel$1(element)) {
37480
37493
  descriptor.priority = 4;
37481
37494
 
37482
37495
  descriptor.labelTarget = element.labelTarget.id;
@@ -37609,7 +37622,7 @@
37609
37622
 
37610
37623
  // center elements around cursor
37611
37624
  forEach$1(elements, function(element) {
37612
- if (isConnection$b(element)) {
37625
+ if (isConnection$4(element)) {
37613
37626
  element.waypoints = map$1(element.waypoints, function(waypoint) {
37614
37627
  return {
37615
37628
  x: waypoint.x - bbox.x - bbox.width / 2,
@@ -37662,7 +37675,7 @@
37662
37675
 
37663
37676
  var element;
37664
37677
 
37665
- if (isConnection$b(attrs)) {
37678
+ if (isConnection$4(attrs)) {
37666
37679
  attrs.source = cache[ descriptor.source ];
37667
37680
  attrs.target = cache[ descriptor.target ];
37668
37681
 
@@ -37673,7 +37686,7 @@
37673
37686
  return;
37674
37687
  }
37675
37688
 
37676
- if (isLabel$3(attrs)) {
37689
+ if (isLabel$1(attrs)) {
37677
37690
  attrs.labelTarget = cache[ attrs.labelTarget ];
37678
37691
 
37679
37692
  element = cache[ descriptor.id ] = self.createLabel(attrs);
@@ -37728,7 +37741,7 @@
37728
37741
  source,
37729
37742
  target;
37730
37743
 
37731
- if (isConnection$b(element)) {
37744
+ if (isConnection$4(element)) {
37732
37745
  source = find(elements, matchPattern({ id: element.source.id }));
37733
37746
  target = find(elements, matchPattern({ id: element.target.id }));
37734
37747
 
@@ -37737,7 +37750,7 @@
37737
37750
  }
37738
37751
  }
37739
37752
 
37740
- if (isLabel$3(element)) {
37753
+ if (isLabel$1(element)) {
37741
37754
  labelTarget = find(elements, matchPattern({ id: element.labelTarget.id }));
37742
37755
 
37743
37756
  if (!labelTarget) {
@@ -37830,7 +37843,7 @@
37830
37843
  eachElement(parents, function(element, _index, depth) {
37831
37844
 
37832
37845
  // do NOT add external labels directly
37833
- if (isLabel$3(element)) {
37846
+ if (isLabel$1(element)) {
37834
37847
  return;
37835
37848
  }
37836
37849
 
@@ -37928,14 +37941,6 @@
37928
37941
  return !!element.host;
37929
37942
  }
37930
37943
 
37931
- function isConnection$b(element) {
37932
- return !!element.waypoints;
37933
- }
37934
-
37935
- function isLabel$3(element) {
37936
- return !!element.labelTarget;
37937
- }
37938
-
37939
37944
  function copyWaypoints$1(element) {
37940
37945
  return map$1(element.waypoints, function(waypoint) {
37941
37946
 
@@ -38019,7 +38024,7 @@
38019
38024
 
38020
38025
  // do not copy business object + di for labels;
38021
38026
  // will be pulled from the referenced label target
38022
- if (isLabel$5(element)) {
38027
+ if (isLabel(element)) {
38023
38028
  return descriptor;
38024
38029
  }
38025
38030
 
@@ -38087,7 +38092,7 @@
38087
38092
  di = descriptor.di;
38088
38093
 
38089
38094
  // wire existing di + businessObject for external label
38090
- if (isLabel$5(descriptor)) {
38095
+ if (isLabel(descriptor)) {
38091
38096
  descriptor.businessObject = getBusinessObject(cache[ descriptor.labelTarget ]);
38092
38097
  descriptor.di = getDi(cache[ descriptor.labelTarget ]);
38093
38098
 
@@ -44168,7 +44173,7 @@
44168
44173
  ResizeHandles.prototype.addResizer = function(element) {
44169
44174
  var self = this;
44170
44175
 
44171
- if (isConnection$a(element) || !this._resize.canResize({ shape: element })) {
44176
+ if (isConnection$4(element) || !this._resize.canResize({ shape: element })) {
44172
44177
  return;
44173
44178
  }
44174
44179
 
@@ -44220,10 +44225,6 @@
44220
44225
  return offset;
44221
44226
  }
44222
44227
 
44223
- function isConnection$a(element) {
44224
- return !!element.waypoints;
44225
- }
44226
-
44227
44228
  /**
44228
44229
  * @type { import('didi').ModuleDeclaration }
44229
44230
  */
@@ -44583,7 +44584,7 @@
44583
44584
  // external label not yet created
44584
44585
  if (isLabelExternal(target)
44585
44586
  && !hasExternalLabel(target)
44586
- && !isLabel$5(target)) {
44587
+ && !isLabel(target)) {
44587
44588
 
44588
44589
  var externalLabelMid = getExternalLabelMid(element);
44589
44590
 
@@ -45260,7 +45261,7 @@
45260
45261
  }
45261
45262
 
45262
45263
  function shouldReplace$1(shape, host) {
45263
- return !isLabel$5(shape) &&
45264
+ return !isLabel(shape) &&
45264
45265
  isAny(shape, [ 'bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent' ]) && !!host;
45265
45266
  }
45266
45267
 
@@ -45437,8 +45438,8 @@
45437
45438
  // ignore connections, groups and labels
45438
45439
  var children = rootElement.children.filter(function(element) {
45439
45440
  return !is$1(element, 'bpmn:Group') &&
45440
- !isLabel$5(element) &&
45441
- !isConnection$9(element);
45441
+ !isLabel(element) &&
45442
+ !isConnection$2(element);
45442
45443
  });
45443
45444
 
45444
45445
  // ensure for available children to calculate bounds
@@ -45609,7 +45610,7 @@
45609
45610
  };
45610
45611
  }
45611
45612
 
45612
- function isConnection$9(element) {
45613
+ function isConnection$2(element) {
45613
45614
  return !!element.waypoints;
45614
45615
  }
45615
45616
 
@@ -46217,7 +46218,7 @@
46217
46218
  }
46218
46219
 
46219
46220
  function shouldReplace(shape, host) {
46220
- return !isLabel$5(shape) && is$1(shape, 'bpmn:BoundaryEvent') && !host;
46221
+ return !isLabel(shape) && is$1(shape, 'bpmn:BoundaryEvent') && !host;
46221
46222
  }
46222
46223
 
46223
46224
  function includes$6(array, item) {
@@ -47924,7 +47925,7 @@
47924
47925
 
47925
47926
  var element = context.shape || context.connection;
47926
47927
 
47927
- if (isLabel$5(element) || !isLabelExternal(element)) {
47928
+ if (isLabel(element) || !isLabelExternal(element)) {
47928
47929
  return;
47929
47930
  }
47930
47931
 
@@ -50463,7 +50464,7 @@
50463
50464
  shape = context.shape,
50464
50465
  shapeBo = shape.businessObject;
50465
50466
 
50466
- if (isLabel$5(shape)) {
50467
+ if (isLabel(shape)) {
50467
50468
  return;
50468
50469
  }
50469
50470
 
@@ -50912,12 +50913,12 @@
50912
50913
  position = context.position,
50913
50914
  target = context.target;
50914
50915
 
50915
- if (isConnection$8(target) && !canInsert(elements, target)) {
50916
+ if (isConnection$1(target) && !canInsert(elements, target)) {
50916
50917
  return false;
50917
50918
  }
50918
50919
 
50919
50920
  return every(elements, function(element) {
50920
- if (isConnection$8(element)) {
50921
+ if (isConnection$1(element)) {
50921
50922
  return canConnect(element.source, element.target, element);
50922
50923
  }
50923
50924
 
@@ -51026,7 +51027,7 @@
51026
51027
  * @return {boolean}
51027
51028
  */
51028
51029
  function nonExistingOrLabel(element) {
51029
- return !element || isLabel$5(element);
51030
+ return !element || isLabel(element);
51030
51031
  }
51031
51032
 
51032
51033
  function isSame$1(a, b) {
@@ -51265,7 +51266,7 @@
51265
51266
  *
51266
51267
  * @return {boolean}
51267
51268
  */
51268
- function isConnection$8(element) {
51269
+ function isConnection$1(element) {
51269
51270
  return element.waypoints;
51270
51271
  }
51271
51272
 
@@ -51359,7 +51360,7 @@
51359
51360
  function canDrop(element, target) {
51360
51361
 
51361
51362
  // can move labels and groups everywhere
51362
- if (isLabel$5(element) || isGroup(element)) {
51363
+ if (isLabel(element) || isGroup(element)) {
51363
51364
  return true;
51364
51365
  }
51365
51366
 
@@ -51449,7 +51450,7 @@
51449
51450
  * @return {boolean}
51450
51451
  */
51451
51452
  function isBoundaryEvent(element) {
51452
- return !isLabel$5(element) && is$1(element, 'bpmn:BoundaryEvent');
51453
+ return !isLabel(element) && is$1(element, 'bpmn:BoundaryEvent');
51453
51454
  }
51454
51455
 
51455
51456
  /**
@@ -51558,7 +51559,7 @@
51558
51559
  var element = elements[0];
51559
51560
 
51560
51561
  // do not attach labels
51561
- if (isLabel$5(element)) {
51562
+ if (isLabel(element)) {
51562
51563
  return false;
51563
51564
  }
51564
51565
 
@@ -51730,7 +51731,7 @@
51730
51731
  return false;
51731
51732
  }
51732
51733
 
51733
- if (isLabel$5(shape) || isGroup(shape)) {
51734
+ if (isLabel(shape) || isGroup(shape)) {
51734
51735
  return true;
51735
51736
  }
51736
51737
 
@@ -51911,7 +51912,7 @@
51911
51912
  // return true if shape can be inserted into connection parent
51912
51913
  return (
51913
51914
  isAny(connection, [ 'bpmn:SequenceFlow', 'bpmn:MessageFlow' ]) &&
51914
- !isLabel$5(connection) &&
51915
+ !isLabel(connection) &&
51915
51916
  is$1(shape, 'bpmn:FlowNode') &&
51916
51917
  !is$1(shape, 'bpmn:BoundaryEvent') &&
51917
51918
  canDrop(shape, connection.parent));
@@ -51934,7 +51935,7 @@
51934
51935
  * @return {boolean}
51935
51936
  */
51936
51937
  function canCopy(elements, element) {
51937
- if (isLabel$5(element)) {
51938
+ if (isLabel(element)) {
51938
51939
  return true;
51939
51940
  }
51940
51941
 
@@ -52842,12 +52843,12 @@
52842
52843
  }
52843
52844
 
52844
52845
  forEach$1(elements, function(element) {
52845
- if (!element.parent || isLabel$2(element)) {
52846
+ if (!element.parent || isLabel$1(element)) {
52846
52847
  return;
52847
52848
  }
52848
52849
 
52849
52850
  // handle connections separately
52850
- if (isConnection$7(element)) {
52851
+ if (isConnection$4(element)) {
52851
52852
  connections.push(element);
52852
52853
 
52853
52854
  return;
@@ -53018,15 +53019,15 @@
53018
53019
 
53019
53020
  // find children that are not moving or resizing
53020
53021
  var nonMovingResizingChildren = filter(children, function(child) {
53021
- return !isConnection$7(child) &&
53022
- !isLabel$2(child) &&
53022
+ return !isConnection$4(child) &&
53023
+ !isLabel$1(child) &&
53023
53024
  !includes$3(movingShapes, child) &&
53024
53025
  !includes$3(resizingShapes, child);
53025
53026
  });
53026
53027
 
53027
53028
  // find children that are moving
53028
53029
  var movingChildren = filter(children, function(child) {
53029
- return !isConnection$7(child) && !isLabel$2(child) && includes$3(movingShapes, child);
53030
+ return !isConnection$4(child) && !isLabel$1(child) && includes$3(movingShapes, child);
53030
53031
  });
53031
53032
 
53032
53033
  var minOrMax,
@@ -53160,14 +53161,6 @@
53160
53161
  return !!element.host;
53161
53162
  }
53162
53163
 
53163
- function isConnection$7(element) {
53164
- return !!element.waypoints;
53165
- }
53166
-
53167
- function isLabel$2(element) {
53168
- return !!element.labelTarget;
53169
- }
53170
-
53171
53164
  var MARKER_DRAGGING$1 = 'djs-dragging',
53172
53165
  MARKER_RESIZING = 'djs-resizing';
53173
53166
 
@@ -53326,7 +53319,7 @@
53326
53319
  });
53327
53320
  });
53328
53321
 
53329
- return isConnection$6(element)
53322
+ return isConnection$4(element)
53330
53323
  && (sourceIsMoving || sourceIsResizing)
53331
53324
  && (targetIsMoving || targetIsResizing);
53332
53325
  });
@@ -53456,16 +53449,6 @@
53456
53449
  'previewSupport'
53457
53450
  ];
53458
53451
 
53459
-
53460
- // helpers //////////////////////
53461
-
53462
- /**
53463
- * Checks if an element is a connection.
53464
- */
53465
- function isConnection$6(element) {
53466
- return element.waypoints;
53467
- }
53468
-
53469
53452
  /**
53470
53453
  * @type { import('didi').ModuleDeclaration }
53471
53454
  */
@@ -55505,7 +55488,7 @@
55505
55488
  BpmnUpdater.prototype.updateParent = function(element, oldParent) {
55506
55489
 
55507
55490
  // do not update BPMN 2.0 label parent
55508
- if (isLabel$5(element)) {
55491
+ if (isLabel(element)) {
55509
55492
  return;
55510
55493
  }
55511
55494
 
@@ -55570,7 +55553,7 @@
55570
55553
  });
55571
55554
  }
55572
55555
 
55573
- var target = isLabel$5(shape) ? this._getLabel(di) : di;
55556
+ var target = isLabel(shape) ? this._getLabel(di) : di;
55574
55557
 
55575
55558
  var bounds = target.bounds;
55576
55559
 
@@ -56631,7 +56614,7 @@
56631
56614
 
56632
56615
  // center elements around position
56633
56616
  forEach$1(elements, function(element) {
56634
- if (isConnection$5(element)) {
56617
+ if (isConnection$4(element)) {
56635
56618
  element.waypoints = map$1(element.waypoints, function(waypoint) {
56636
56619
  return {
56637
56620
  x: round$3(waypoint.x - bbox.x - bbox.width / 2 + position.x),
@@ -56651,7 +56634,7 @@
56651
56634
  var cache = {};
56652
56635
 
56653
56636
  forEach$1(elements, function(element) {
56654
- if (isConnection$5(element)) {
56637
+ if (isConnection$4(element)) {
56655
56638
  cache[ element.id ] = isNumber(parentIndex) ?
56656
56639
  modeling.createConnection(
56657
56640
  cache[ element.source.id ],
@@ -56678,6 +56661,10 @@
56678
56661
  createShapeHints.autoResize = false;
56679
56662
  }
56680
56663
 
56664
+ if (isLabel$1(element)) {
56665
+ createShapeHints = omit(createShapeHints, [ 'attach' ]);
56666
+ }
56667
+
56681
56668
  cache[ element.id ] = isNumber(parentIndex) ?
56682
56669
  modeling.createShape(
56683
56670
  element,
@@ -56695,13 +56682,7 @@
56695
56682
  });
56696
56683
 
56697
56684
  context.elements = values(cache);
56698
- };
56699
-
56700
- // helpers //////////
56701
-
56702
- function isConnection$5(element) {
56703
- return !!element.waypoints;
56704
- }
56685
+ };
56705
56686
 
56706
56687
  /**
56707
56688
  * @typedef {import('../../../model/Types').Element} Element
@@ -57072,10 +57053,6 @@
57072
57053
  return shape;
57073
57054
  };
57074
57055
 
57075
- function isConnection$4(element) {
57076
- return element.waypoints;
57077
- }
57078
-
57079
57056
  /**
57080
57057
  * @typedef {import('../Modeling').default} Modeling
57081
57058
  */
@@ -60206,13 +60183,13 @@
60206
60183
  }
60207
60184
 
60208
60185
  forEach$1(elements, function(element) {
60209
- var assignedDi = isConnection$3(element) ? pick(di, [ 'border-color' ]) : di,
60186
+ var assignedDi = isConnection(element) ? pick(di, [ 'border-color' ]) : di,
60210
60187
  elementDi = getDi(element);
60211
60188
 
60212
60189
  // TODO @barmac: remove once we drop bpmn.io properties
60213
60190
  ensureLegacySupport(assignedDi);
60214
60191
 
60215
- if (isLabel$5(element)) {
60192
+ if (isLabel(element)) {
60216
60193
 
60217
60194
  // set label colors as bpmndi:BPMNLabel#color
60218
60195
  self._commandStack.execute('element.updateModdleProperties', {
@@ -60272,7 +60249,7 @@
60272
60249
  return /^#[0-9a-fA-F]{6}$/.test(context.fillStyle) ? context.fillStyle : null;
60273
60250
  }
60274
60251
 
60275
- function isConnection$3(element) {
60252
+ function isConnection(element) {
60276
60253
  return !!element.waypoints;
60277
60254
  }
60278
60255
 
@@ -60338,7 +60315,7 @@
60338
60315
  businessObject = element.businessObject,
60339
60316
  newLabel = ctx.newLabel;
60340
60317
 
60341
- if (!isLabel$5(element)
60318
+ if (!isLabel(element)
60342
60319
  && isLabelExternal(element)
60343
60320
  && !hasExternalLabel(element)
60344
60321
  && !isEmptyText(newLabel)) {
@@ -60378,11 +60355,11 @@
60378
60355
  hints = ctx.hints || {};
60379
60356
 
60380
60357
  // ignore internal labels for elements except text annotations
60381
- if (!isLabel$5(label) && !is$1(label, 'bpmn:TextAnnotation')) {
60358
+ if (!isLabel(label) && !is$1(label, 'bpmn:TextAnnotation')) {
60382
60359
  return;
60383
60360
  }
60384
60361
 
60385
- if (isLabel$5(label) && isEmptyText(newLabel)) {
60362
+ if (isLabel(label) && isEmptyText(newLabel)) {
60386
60363
 
60387
60364
  if (hints.removeShape !== false) {
60388
60365
  modeling.removeShape(label, { unsetLabel: false });
@@ -62491,7 +62468,7 @@
62491
62468
 
62492
62469
  var filteredElements = filter(elements, function(element) {
62493
62470
 
62494
- if (!isConnection$2(element)) {
62471
+ if (!isConnection$4(element)) {
62495
62472
  return true;
62496
62473
  } else {
62497
62474
 
@@ -62509,13 +62486,6 @@
62509
62486
  return size(groupBy(elements, function(e) { return e.parent && e.parent.id; })) !== 1;
62510
62487
  }
62511
62488
 
62512
- /**
62513
- * Checks if an element is a connection.
62514
- */
62515
- function isConnection$2(element) {
62516
- return element.waypoints;
62517
- }
62518
-
62519
62489
  /**
62520
62490
  * @type { import('didi').ModuleDeclaration }
62521
62491
  */
@@ -64605,7 +64575,7 @@
64605
64575
  }
64606
64576
 
64607
64577
  // handle connections
64608
- if (isConnection$1(snapTarget)) {
64578
+ if (isConnection$4(snapTarget)) {
64609
64579
 
64610
64580
  // ignore single segment connections
64611
64581
  if (snapTarget.waypoints.length < 3) {
@@ -64646,16 +64616,8 @@
64646
64616
 
64647
64617
  // helpers //////////
64648
64618
 
64649
- function isConnection$1(element) {
64650
- return !!element.waypoints;
64651
- }
64652
-
64653
64619
  function isHidden$1(element) {
64654
64620
  return !!element.hidden;
64655
- }
64656
-
64657
- function isLabel$1(element) {
64658
- return !!element.labelTarget;
64659
64621
  }
64660
64622
 
64661
64623
  /**
@@ -65028,9 +64990,9 @@
65028
64990
  ResizeSnapping.prototype.getSnapTargets = function(shape, target) {
65029
64991
  return getChildren(target).filter(function(child) {
65030
64992
  return !isAttached(child, shape)
65031
- && !isConnection(child)
64993
+ && !isConnection$4(child)
65032
64994
  && !isHidden(child)
65033
- && !isLabel(child);
64995
+ && !isLabel$1(child);
65034
64996
  });
65035
64997
  };
65036
64998
 
@@ -65064,18 +65026,10 @@
65064
65026
  return element.host === host;
65065
65027
  }
65066
65028
 
65067
- function isConnection(element) {
65068
- return !!element.waypoints;
65069
- }
65070
-
65071
65029
  function isHidden(element) {
65072
65030
  return !!element.hidden;
65073
65031
  }
65074
65032
 
65075
- function isLabel(element) {
65076
- return !!element.labelTarget;
65077
- }
65078
-
65079
65033
  function isHorizontal(direction) {
65080
65034
  return direction === 'n' || direction === 's';
65081
65035
  }