@eventcatalog/visualiser 5.0.0-beta.6 → 5.0.0-beta.8

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/index.js CHANGED
@@ -8087,6 +8087,13 @@ var moveLabel = (label, points, moved) => {
8087
8087
  const [a, b] = [shift(segment), shift(segment + 1)];
8088
8088
  return { x: label.x + (a.x + b.x) / 2, y: label.y + (a.y + b.y) / 2 };
8089
8089
  };
8090
+ var getStepPath = (props) => {
8091
+ const [path, labelX, labelY, offsetX, offsetY] = (0, import_react74.getSmoothStepPath)(props);
8092
+ const { sourceX, targetX, targetY } = props;
8093
+ const forwards = (props.sourcePosition ?? import_react74.Position.Bottom) === import_react74.Position.Right && (props.targetPosition ?? import_react74.Position.Top) === import_react74.Position.Left && targetX > sourceX;
8094
+ if (!forwards) return [path, labelX, labelY, offsetX, offsetY];
8095
+ return [path, (labelX + targetX) / 2, targetY, offsetX, offsetY];
8096
+ };
8090
8097
  var getMoved = (state, nodeId, at) => {
8091
8098
  const position = state.nodeLookup.get(nodeId)?.internals.positionAbsolute;
8092
8099
  return position && { x: position.x - at.x, y: position.y - at.y };
@@ -8189,7 +8196,7 @@ var AnimatedMessageEdge = (0, import_react75.memo)(
8189
8196
  sourceHandleId,
8190
8197
  targetHandleId
8191
8198
  },
8192
- (0, import_react76.getSmoothStepPath)({
8199
+ getStepPath({
8193
8200
  sourceX,
8194
8201
  sourceY,
8195
8202
  sourcePosition,
@@ -8523,7 +8530,7 @@ function LabelledEdge({
8523
8530
  sourceHandleId,
8524
8531
  targetHandleId
8525
8532
  },
8526
- pathType === "bezier" ? (0, import_react81.getBezierPath)(pathProps) : (0, import_react81.getSmoothStepPath)({
8533
+ pathType === "bezier" ? (0, import_react81.getBezierPath)(pathProps) : getStepPath({
8527
8534
  ...pathProps,
8528
8535
  ...pathType === "step" ? { borderRadius: 0 } : {}
8529
8536
  })