@logicflow/core 1.1.28 → 1.1.30

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.
@@ -22413,7 +22413,7 @@ var defaultTheme = {
22413
22413
  stroke: 'red',
22414
22414
  strokeDasharray: '10 10',
22415
22415
  strokeDashoffset: '100%',
22416
- animationName: 'dash',
22416
+ animationName: 'lf_animate_dash',
22417
22417
  animationDuration: '20s',
22418
22418
  animationIterationCount: 'infinite',
22419
22419
  animationTimingFunction: 'linear',
@@ -22869,7 +22869,7 @@ var es_math_hypot = __webpack_require__(203);
22869
22869
  入参:线段1端点: ab, 线段2端点: cd,
22870
22870
  返回值:有交点返回交点,无交点返回false
22871
22871
  */
22872
- var getCorssPointOfLine = function getCorssPointOfLine(a, b, c, d) {
22872
+ var getCrossPointOfLine = function getCrossPointOfLine(a, b, c, d) {
22873
22873
  /** 1 解线性方程组, 求线段交点. * */
22874
22874
  // 如果分母为0 则平行或共线, 不相交
22875
22875
  var denominator = (b.y - a.y) * (d.x - c.x) - (a.x - b.x) * (c.y - d.y);
@@ -23784,6 +23784,23 @@ var BaseEdgeModel_BaseEdgeModel = (BaseEdgeModel_class = /*#__PURE__*/function (
23784
23784
  value: function setProperties(properties) {
23785
23785
  this.properties = BaseEdgeModel_objectSpread(BaseEdgeModel_objectSpread({}, this.properties), formatData(properties));
23786
23786
  this.setAttributes();
23787
+ }
23788
+ }, {
23789
+ key: "changeEdgeId",
23790
+ value: function changeEdgeId(id) {
23791
+ var _this$arrowConfig = this.arrowConfig,
23792
+ markerEnd = _this$arrowConfig.markerEnd,
23793
+ markerStart = _this$arrowConfig.markerStart;
23794
+
23795
+ if (markerStart && markerStart === "url(#marker-start-".concat(this.id, ")")) {
23796
+ this.arrowConfig.markerStart = "url(#marker-start-".concat(id, ")");
23797
+ }
23798
+
23799
+ if (markerEnd && markerEnd === "url(#marker-end-".concat(this.id, ")")) {
23800
+ this.arrowConfig.markerEnd = "url(#marker-end-".concat(id, ")");
23801
+ }
23802
+
23803
+ this.id = id;
23787
23804
  } // 设置样式
23788
23805
 
23789
23806
  }, {
@@ -24171,7 +24188,7 @@ var BaseEdgeModel_BaseEdgeModel = (BaseEdgeModel_class = /*#__PURE__*/function (
24171
24188
  markerStart: ''
24172
24189
  };
24173
24190
  }
24174
- }), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "sourceNode", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "sourceNode"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "targetNode", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "targetNode"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "textPosition", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "textPosition"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setProperty", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setProperty"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "deleteProperty", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "deleteProperty"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setProperties", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setProperties"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setStyle", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setStyle"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setStyles"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateStyles"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "formatText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "formatText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "resetTextPosition", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "resetTextPosition"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "moveText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "moveText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setAnchors", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setAnchors"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setSelected", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setSelected"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setHovered", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setHovered"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setHitable", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setHitable"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "openEdgeAnimation", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "openEdgeAnimation"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "closeEdgeAnimation", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "closeEdgeAnimation"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setElementState", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setElementState"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateStartPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "moveStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "moveStartPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateEndPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "moveEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "moveEndPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setZIndex", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setZIndex"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "initPoints", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "initPoints"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateAttributes", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateAttributes"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "getAdjustStart", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "getAdjustStart"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "getAdjustEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "getAdjustEnd"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd"), BaseEdgeModel_class.prototype)), BaseEdgeModel_class);
24191
+ }), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "sourceNode", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "sourceNode"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "targetNode", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "targetNode"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "textPosition", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "textPosition"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setProperty", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setProperty"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "deleteProperty", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "deleteProperty"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setProperties", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setProperties"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "changeEdgeId", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "changeEdgeId"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setStyle", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setStyle"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setStyles"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateStyles"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "formatText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "formatText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "resetTextPosition", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "resetTextPosition"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "moveText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "moveText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateText"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setAnchors", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setAnchors"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setSelected", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setSelected"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setHovered", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setHovered"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setHitable", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setHitable"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "openEdgeAnimation", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "openEdgeAnimation"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "closeEdgeAnimation", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "closeEdgeAnimation"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setElementState", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setElementState"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateStartPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "moveStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "moveStartPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateEndPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "moveEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "moveEndPoint"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "setZIndex", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "setZIndex"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "initPoints", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "initPoints"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateAttributes", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateAttributes"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "getAdjustStart", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "getAdjustStart"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "getAdjustEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "getAdjustEnd"), BaseEdgeModel_class.prototype), BaseEdgeModel_applyDecoratedDescriptor(BaseEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd"), BaseEdgeModel_class.prototype)), BaseEdgeModel_class);
24175
24192
 
24176
24193
  /* harmony default export */ var edge_BaseEdgeModel = (BaseEdgeModel_BaseEdgeModel);
24177
24194
  // CONCATENATED MODULE: ./src/model/edge/LineEdgeModel.ts
@@ -24780,7 +24797,7 @@ var PolylineEdgeModel_PolylineEdgeModel = (PolylineEdgeModel_class = /*#__PURE__
24780
24797
  });
24781
24798
  }
24782
24799
 
24783
- this.updatePointsAfterDrage(draginngPointList);
24800
+ this.updatePointsAfterDrag(draginngPointList);
24784
24801
  this.draginngPointList = draginngPointList;
24785
24802
  this.setText(Object.assign({}, this.text, this.textPosition));
24786
24803
  return {
@@ -24855,10 +24872,9 @@ var PolylineEdgeModel_PolylineEdgeModel = (PolylineEdgeModel_class = /*#__PURE__
24855
24872
  }
24856
24873
  }
24857
24874
 
24858
- draginngPointList = pointFilter(draginngPointList);
24859
- this.updatePointsAfterDrage(draginngPointList); // step3: 调整到对应外框的位置后,执行updatePointsAfterDrage,找到当前线段和图形的准确交点
24875
+ this.updatePointsAfterDrag(draginngPointList); // step3: 调整到对应外框的位置后,执行updatePointsAfterDrag,找到当前线段和图形的准确交点
24860
24876
 
24861
- this.draginngPointList = draginngPointList;
24877
+ this.draggingPointList = draginngPointList;
24862
24878
  } else if (direction === SegmentDirection.VERTICAL) {
24863
24879
  // 垂直,仅调整x坐标, 与水平调整同理
24864
24880
  pointsList[startIndex] = {
@@ -24906,9 +24922,8 @@ var PolylineEdgeModel_PolylineEdgeModel = (PolylineEdgeModel_class = /*#__PURE__
24906
24922
  }
24907
24923
  }
24908
24924
 
24909
- _draginngPointList = pointFilter(_draginngPointList);
24910
- this.updatePointsAfterDrage(_draginngPointList);
24911
- this.draginngPointList = _draginngPointList;
24925
+ this.updatePointsAfterDrag(_draginngPointList);
24926
+ this.draggingPointList = _draginngPointList;
24912
24927
  }
24913
24928
 
24914
24929
  this.setText(Object.assign({}, this.text, this.textPosition));
@@ -24924,7 +24939,7 @@ var PolylineEdgeModel_PolylineEdgeModel = (PolylineEdgeModel_class = /*#__PURE__
24924
24939
  key: "dragAppendEnd",
24925
24940
  value: function dragAppendEnd() {
24926
24941
  if (this.draginngPointList) {
24927
- var pointsList = points2PointsList(this.points); // 更新pointsList,重新渲染appendWidth
24942
+ var pointsList = pointFilter(points2PointsList(this.points)); // 更新pointsList,重新渲染appendWidth
24928
24943
 
24929
24944
  this.pointsList = pointsList.map(function (i) {
24930
24945
  return i;
@@ -24946,8 +24961,8 @@ var PolylineEdgeModel_PolylineEdgeModel = (PolylineEdgeModel_class = /*#__PURE__
24946
24961
  */
24947
24962
 
24948
24963
  }, {
24949
- key: "updatePointsAfterDrage",
24950
- value: function updatePointsAfterDrage(pointsList) {
24964
+ key: "updatePointsAfterDrag",
24965
+ value: function updatePointsAfterDrag(pointsList) {
24951
24966
  // 找到准确的连接点后,更新points, 更新边,同时更新依赖points的箭头
24952
24967
  var list = this.updateCrossPoints(pointsList);
24953
24968
  this.points = list.map(function (point) {
@@ -24993,7 +25008,7 @@ var PolylineEdgeModel_PolylineEdgeModel = (PolylineEdgeModel_class = /*#__PURE__
24993
25008
  enumerable: true,
24994
25009
  writable: true,
24995
25010
  initializer: null
24996
- }), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "initPoints", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "initPoints"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updatePoints", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updatePoints"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updateStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updateStartPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "moveStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "moveStartPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updateEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updateEndPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "moveEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "moveEndPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppendStart", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppendStart"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppendSimple", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppendSimple"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppend", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppend"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppendEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppendEnd"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updatePointsAfterDrage", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updatePointsAfterDrage"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "getAdjustStart", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "getAdjustStart"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "getAdjustEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "getAdjustEnd"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd"), PolylineEdgeModel_class.prototype)), PolylineEdgeModel_class);
25011
+ }), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "initPoints", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "initPoints"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updatePoints", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updatePoints"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updateStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updateStartPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "moveStartPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "moveStartPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updateEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updateEndPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "moveEndPoint", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "moveEndPoint"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppendStart", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppendStart"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppendSimple", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppendSimple"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppend", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppend"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "dragAppendEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "dragAppendEnd"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updatePointsAfterDrag", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updatePointsAfterDrag"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "getAdjustStart", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "getAdjustStart"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "getAdjustEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "getAdjustEnd"), PolylineEdgeModel_class.prototype), PolylineEdgeModel_applyDecoratedDescriptor(PolylineEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(PolylineEdgeModel_class.prototype, "updateAfterAdjustStartAndEnd"), PolylineEdgeModel_class.prototype)), PolylineEdgeModel_class);
24997
25012
 
24998
25013
  // CONCATENATED MODULE: ./src/algorithm/index.ts
24999
25014
  // 各类算法的实现
@@ -25640,7 +25655,7 @@ var edge_getCrossPointInRect = function getCrossPointInRect(start, end, node) {
25640
25655
  }
25641
25656
 
25642
25657
  if (crossSegments) {
25643
- point = getCorssPointOfLine(start, end, crossSegments[0], crossSegments[1]);
25658
+ point = getCrossPointOfLine(start, end, crossSegments[0], crossSegments[1]);
25644
25659
  }
25645
25660
 
25646
25661
  return point;
@@ -26508,8 +26523,7 @@ var GraphModel_GraphModel = (GraphModel_class = /*#__PURE__*/function () {
26508
26523
  return a.zIndex - b.zIndex;
26509
26524
  }); // 只显示可见区域的节点和边
26510
26525
 
26511
- var showElements = [];
26512
- var topElementIdx = -1; // todo: 缓存, 优化计算效率
26526
+ var showElements = []; // todo: 缓存, 优化计算效率
26513
26527
 
26514
26528
  var visibleLt = [-VisibleMoreSpace, -VisibleMoreSpace];
26515
26529
  var visibleRb = [this.width + VisibleMoreSpace, this.height + VisibleMoreSpace];
@@ -26518,20 +26532,10 @@ var GraphModel_GraphModel = (GraphModel_class = /*#__PURE__*/function () {
26518
26532
  var currentItem = elements[i]; // 如果节点不在可见区域,且不是全元素显示模式,则隐藏节点。
26519
26533
 
26520
26534
  if (currentItem.visible && (!this.partial || currentItem.isSelected || this.isElementInArea(currentItem, visibleLt, visibleRb, false, false))) {
26521
- if (currentItem.zIndex === ElementMaxzIndex) {
26522
- topElementIdx = showElements.length;
26523
- }
26524
-
26525
26535
  showElements.push(currentItem);
26526
26536
  }
26527
26537
  }
26528
26538
 
26529
- if (topElementIdx !== -1) {
26530
- var lastElement = showElements[showElements.length - 1];
26531
- showElements[showElements.length - 1] = showElements[topElementIdx];
26532
- showElements[topElementIdx] = lastElement;
26533
- }
26534
-
26535
26539
  return showElements;
26536
26540
  }
26537
26541
  /**
@@ -26995,7 +26999,8 @@ var GraphModel_GraphModel = (GraphModel_class = /*#__PURE__*/function () {
26995
26999
 
26996
27000
  this.edges.forEach(function (edge) {
26997
27001
  if (edge.id === oldId) {
26998
- edge.id = newId;
27002
+ // edge.id = newId;
27003
+ edge.changeEdgeId(newId);
26999
27004
  }
27000
27005
  });
27001
27006
  return newId;
@@ -30438,7 +30443,7 @@ var BaseNodeModel_BaseNodeModel = (BaseNodeModel_class = /*#__PURE__*/function (
30438
30443
 
30439
30444
  }, {
30440
30445
  key: "getAnchorLineStyle",
30441
- value: function getAnchorLineStyle() {
30446
+ value: function getAnchorLineStyle(anchorInfo) {
30442
30447
  var anchorLine = this.graphModel.theme.anchorLine;
30443
30448
  return lodash_es_cloneDeep(anchorLine);
30444
30449
  }
@@ -33571,8 +33576,8 @@ var BaseNode_BaseNode = /*#__PURE__*/function (_Component) {
33571
33576
  isShowAnchor = model.isShowAnchor;
33572
33577
 
33573
33578
  if (isHitable && (isSelected || isShowAnchor) && !isDragging) {
33574
- var edgeStyle = model.getAnchorLineStyle();
33575
33579
  return lodash_es_map(model.anchors, function (anchor, index) {
33580
+ var edgeStyle = model.getAnchorLineStyle(anchor);
33576
33581
  var style = model.getAnchorStyle(anchor);
33577
33582
  return Object(preact_module["g" /* h */])(view_Anchor, {
33578
33583
  anchorData: anchor,
@@ -34274,8 +34279,8 @@ var TextNode_TextNode = /*#__PURE__*/function (_BaseNode) {
34274
34279
  }
34275
34280
 
34276
34281
  TextNode_createClass(TextNode, [{
34277
- key: "getBackgroud",
34278
- value: function getBackgroud() {
34282
+ key: "getBackground",
34283
+ value: function getBackground() {
34279
34284
  var model = this.props.model;
34280
34285
  var style = model.getTextStyle();
34281
34286
  var text = model.text;
@@ -34301,7 +34306,7 @@ var TextNode_TextNode = /*#__PURE__*/function (_BaseNode) {
34301
34306
  }, {
34302
34307
  key: "getShape",
34303
34308
  value: function getShape() {
34304
- return Object(preact_module["g" /* h */])("g", null, this.getBackgroud());
34309
+ return Object(preact_module["g" /* h */])("g", null, this.getBackground());
34305
34310
  }
34306
34311
  }]);
34307
34312
 
@@ -34370,7 +34375,7 @@ var HtmlNode_HtmlNode = /*#__PURE__*/function (_BaseNode) {
34370
34375
 
34371
34376
  HtmlNode_defineProperty(HtmlNode_assertThisInitialized(_this), "ref", void 0);
34372
34377
 
34373
- HtmlNode_defineProperty(HtmlNode_assertThisInitialized(_this), "currrentProperties", void 0);
34378
+ HtmlNode_defineProperty(HtmlNode_assertThisInitialized(_this), "currentProperties", void 0);
34374
34379
 
34375
34380
  HtmlNode_defineProperty(HtmlNode_assertThisInitialized(_this), "preProperties", void 0);
34376
34381
 
@@ -34414,8 +34419,8 @@ var HtmlNode_HtmlNode = /*#__PURE__*/function (_BaseNode) {
34414
34419
  }, {
34415
34420
  key: "shouldUpdate",
34416
34421
  value: function shouldUpdate() {
34417
- if (this.preProperties && this.preProperties === this.currrentProperties) return;
34418
- this.preProperties = this.currrentProperties;
34422
+ if (this.preProperties && this.preProperties === this.currentProperties) return;
34423
+ this.preProperties = this.currentProperties;
34419
34424
  return true;
34420
34425
  }
34421
34426
  }, {
@@ -34441,7 +34446,7 @@ var HtmlNode_HtmlNode = /*#__PURE__*/function (_BaseNode) {
34441
34446
  height = model.height,
34442
34447
  width = model.width;
34443
34448
  var style = model.getNodeStyle();
34444
- this.currrentProperties = JSON.stringify(model.properties);
34449
+ this.currentProperties = JSON.stringify(model.properties);
34445
34450
  return Object(preact_module["g" /* h */])("foreignObject", HtmlNode_extends({}, style, {
34446
34451
  x: x - width / 2,
34447
34452
  y: y - height / 2,
@@ -34557,8 +34562,8 @@ var LineText_LineText = /*#__PURE__*/function (_BaseText) {
34557
34562
  }
34558
34563
 
34559
34564
  LineText_createClass(LineText, [{
34560
- key: "getBackgroud",
34561
- value: function getBackgroud() {
34565
+ key: "getBackground",
34566
+ value: function getBackground() {
34562
34567
  var model = this.props.model;
34563
34568
  var style = model.getTextStyle();
34564
34569
  var text = model.text;
@@ -34676,7 +34681,7 @@ var LineText_LineText = /*#__PURE__*/function (_BaseText) {
34676
34681
  className: "lf-line-text",
34677
34682
  onMouseEnter: this.setHoverON,
34678
34683
  onMouseLeave: this.setHoverOFF
34679
- }, this.getBackgroud(), Object(preact_module["g" /* h */])(Text, LineText_extends({}, attr, {
34684
+ }, this.getBackground(), Object(preact_module["g" /* h */])(Text, LineText_extends({}, attr, {
34680
34685
  model: model
34681
34686
  })));
34682
34687
  }
@@ -35316,7 +35321,7 @@ var BaseEdge_BaseEdge = /*#__PURE__*/function (_Component) {
35316
35321
  _this.toFront();
35317
35322
  });
35318
35323
 
35319
- BaseEdge_defineProperty(BaseEdge_assertThisInitialized(_this), "getIsDraging", function () {
35324
+ BaseEdge_defineProperty(BaseEdge_assertThisInitialized(_this), "getIsDragging", function () {
35320
35325
  return false;
35321
35326
  });
35322
35327
 
@@ -35501,7 +35506,7 @@ var BaseEdge_BaseEdge = /*#__PURE__*/function (_Component) {
35501
35506
  isSelected = _this$props8$model.isSelected,
35502
35507
  isHitable = _this$props8$model.isHitable,
35503
35508
  graphModel = _this$props8.graphModel;
35504
- var isDraging = this.getIsDraging();
35509
+ var isDragging = this.getIsDragging();
35505
35510
  var adjustEdgeStartAndEnd = graphModel.editConfigModel.adjustEdgeStartAndEnd,
35506
35511
  animation = graphModel.animation; // performance 只允许出现一条edge有动画
35507
35512
 
@@ -35514,7 +35519,7 @@ var BaseEdge_BaseEdge = /*#__PURE__*/function (_Component) {
35514
35519
  onMouseOver: this.setHoverON,
35515
35520
  onMouseEnter: this.setHoverON,
35516
35521
  onMouseLeave: this.setHoverOFF
35517
- }, this.getShape(), this.getAppend(), isShowAnimation && this.getAnimation(), this.getText(), this.getArrow()), adjustEdgeStartAndEnd && isSelected && !isDraging ? this.getAdjustPoints() : '');
35522
+ }, this.getShape(), this.getAppend(), isShowAnimation && this.getAnimation(), this.getText(), this.getArrow()), adjustEdgeStartAndEnd && isSelected && !isDragging ? this.getAdjustPoints() : '');
35518
35523
  }
35519
35524
  }]);
35520
35525
 
@@ -35935,7 +35940,7 @@ var PolylineEdge_PolylineEdge = /*#__PURE__*/function (_BaseEdge) {
35935
35940
  _this.appendInfo = appendInfo;
35936
35941
  });
35937
35942
 
35938
- PolylineEdge_defineProperty(PolylineEdge_assertThisInitialized(_this), "getIsDraging", function () {
35943
+ PolylineEdge_defineProperty(PolylineEdge_assertThisInitialized(_this), "getIsDragging", function () {
35939
35944
  return _this.isDraging;
35940
35945
  });
35941
35946
 
@@ -37101,18 +37106,17 @@ var TextEditTool_TextEdit = src_observer(TextEditTool_class = (_temp = _class2 =
37101
37106
 
37102
37107
 
37103
37108
  var graphModel = this.props.graphModel;
37104
- var eventCenter = graphModel.eventCenter,
37105
- _graphModel$editConfi = graphModel.editConfigModel,
37106
- edgeTextEdit = _graphModel$editConfi.edgeTextEdit,
37107
- nodeTextEdit = _graphModel$editConfi.nodeTextEdit;
37109
+ var eventCenter = graphModel.eventCenter;
37110
+ eventCenter.on("".concat(EventType.GRAPH_TRANSFORM, ",").concat(EventType.NODE_CLICK, ",").concat(EventType.BLANK_CLICK, " "), function () {
37111
+ var textEditElement = graphModel.textEditElement,
37112
+ _graphModel$editConfi = graphModel.editConfigModel,
37113
+ edgeTextEdit = _graphModel$editConfi.edgeTextEdit,
37114
+ nodeTextEdit = _graphModel$editConfi.nodeTextEdit; // fix #826, 保留之前的文本可以编辑点击空白才设置为不可编辑。如果以后有其他需求再改。
37108
37115
 
37109
- if (edgeTextEdit || nodeTextEdit) {
37110
- eventCenter.on("".concat(EventType.GRAPH_TRANSFORM, ",").concat(EventType.NODE_CLICK, ",").concat(EventType.BLANK_CLICK, " "), function () {
37111
- if (graphModel.textEditElement) {
37112
- graphModel.textEditElement.setElementState(ElementState.DEFAULT);
37113
- }
37114
- });
37115
- }
37116
+ if ((edgeTextEdit || nodeTextEdit) && textEditElement) {
37117
+ graphModel.textEditElement.setElementState(ElementState.DEFAULT);
37118
+ }
37119
+ });
37116
37120
  }
37117
37121
  }, {
37118
37122
  key: "componentDidUpdate",
@@ -38198,15 +38202,17 @@ var LogicFlow_LogicFlow = /*#__PURE__*/function () {
38198
38202
  * 将图形选中
38199
38203
  * @param id 选择元素ID
38200
38204
  * @param multiple 是否允许多选,如果为true,不会将上一个选中的元素重置
38205
+ * @param toFront 是否将选中的元素置顶,默认为true
38201
38206
  */
38202
38207
 
38203
38208
  }, {
38204
38209
  key: "selectElementById",
38205
38210
  value: function selectElementById(id) {
38206
38211
  var multiple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
38212
+ var toFront = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
38207
38213
  this.graphModel.selectElementById(id, multiple);
38208
38214
 
38209
- if (!multiple) {
38215
+ if (!multiple && toFront) {
38210
38216
  this.graphModel.toFront(id);
38211
38217
  }
38212
38218
  }