@flowgram.ai/free-layout-core 0.4.8 → 0.4.10

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/esm/index.js CHANGED
@@ -455,6 +455,7 @@ var WorkflowNodePortsData = class extends EntityData {
455
455
  ...Array.from(elements).map((element) => ({
456
456
  portID: element.getAttribute("data-port-id"),
457
457
  type: element.getAttribute("data-port-type"),
458
+ location: element.getAttribute("data-port-location"),
458
459
  targetElement: element
459
460
  }))
460
461
  );
@@ -1078,7 +1079,9 @@ var _WorkflowLineEntity = class _WorkflowLineEntity extends Entity2 {
1078
1079
  get disabled() {
1079
1080
  return this.linesManager.isDisabledLine(this, this.uiState.disabled);
1080
1081
  }
1081
- /** 是否竖向 */
1082
+ /**
1083
+ * @deprecated
1084
+ */
1082
1085
  get vertical() {
1083
1086
  const fromLocation = this.fromPort.location;
1084
1087
  const toLocation = this.toPort?.location;
@@ -2588,6 +2591,18 @@ function checkDragSuccess(time, e, originLine) {
2588
2591
  }
2589
2592
  return false;
2590
2593
  }
2594
+ function reverseLocation(sourceLocation) {
2595
+ switch (sourceLocation) {
2596
+ case "bottom":
2597
+ return "top";
2598
+ case "left":
2599
+ return "right";
2600
+ case "top":
2601
+ return "bottom";
2602
+ case "right":
2603
+ return "left";
2604
+ }
2605
+ }
2591
2606
  var WorkflowDragService = class {
2592
2607
  constructor() {
2593
2608
  this._onDragLineEventEmitter = new Emitter6();
@@ -3045,7 +3060,7 @@ var WorkflowDragService = class {
3045
3060
  line.drawingTo = {
3046
3061
  x: dragPos.x,
3047
3062
  y: dragPos.y,
3048
- location: line.fromPort.location === "right" ? "left" : "top"
3063
+ location: reverseLocation(line.fromPort.location)
3049
3064
  };
3050
3065
  }
3051
3066
  originLine?.validate();