@logicflow/core 1.2.0-alpha.10 → 1.2.0-alpha.13

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.
@@ -11337,7 +11337,7 @@ module.exports.f = function (C) {
11337
11337
  /* 161 */
11338
11338
  /***/ (function(module) {
11339
11339
 
11340
- module.exports = JSON.parse("{\"a\":\"1.2.0-alpha.10\"}");
11340
+ module.exports = JSON.parse("{\"a\":\"1.2.0-alpha.12\"}");
11341
11341
 
11342
11342
  /***/ }),
11343
11343
  /* 162 */
@@ -22727,7 +22727,7 @@ var BaseEdgeModel_BaseEdgeModel = /*#__PURE__*/function () {
22727
22727
  BaseEdgeModel_defineProperty(this, "style", {});
22728
22728
 
22729
22729
  BaseEdgeModel_defineProperty(this, "arrowConfig", {
22730
- markerEnd: "url(#marker-end-".concat(this.id, ")"),
22730
+ markerEnd: '',
22731
22731
  markerStart: ''
22732
22732
  });
22733
22733
 
@@ -22824,6 +22824,8 @@ var BaseEdgeModel_BaseEdgeModel = /*#__PURE__*/function () {
22824
22824
  if (overlapMode === OverlapMode.INCREASE) {
22825
22825
  this.zIndex = data.zIndex || getZIndex();
22826
22826
  }
22827
+
22828
+ this.arrowConfig.markerEnd = "url(#marker-end-".concat(this.id, ")");
22827
22829
  }
22828
22830
  /**
22829
22831
  * 设置model属性,每次properties发生变化会触发
@@ -25637,8 +25639,8 @@ var GraphModel_GraphModel = /*#__PURE__*/function () {
25637
25639
  options.height = container.getBoundingClientRect().height;
25638
25640
  }
25639
25641
 
25640
- if (!options.width || !options.height) {
25641
- console.warn('画布初始化确实宽高');
25642
+ if ((!options.width || !options.height) && options.autoExpand) {
25643
+ console.warn('画布初始化缺少宽高,可能会出现节点无法拖动的情况');
25642
25644
  }
25643
25645
 
25644
25646
  this.width = options.width;
@@ -31404,7 +31406,9 @@ var Anchor_Anchor = /*#__PURE__*/function (_Component) {
31404
31406
  eventCenter = graphModel.eventCenter,
31405
31407
  width = graphModel.width,
31406
31408
  height = graphModel.height,
31407
- editConfigModel = graphModel.editConfigModel;
31409
+ _graphModel$editConfi = graphModel.editConfigModel,
31410
+ autoExpand = _graphModel$editConfi.autoExpand,
31411
+ stopMoveGraph = _graphModel$editConfi.stopMoveGraph;
31408
31412
  var clientX = event.clientX,
31409
31413
  clientY = event.clientY;
31410
31414
 
@@ -31444,7 +31448,7 @@ var Anchor_Anchor = /*#__PURE__*/function (_Component) {
31444
31448
 
31445
31449
  _this.moveAnchorEnd(x1, y1);
31446
31450
 
31447
- if (nearBoundary.length > 0 && !editConfigModel.stopMoveGraph) {
31451
+ if (nearBoundary.length > 0 && !stopMoveGraph && autoExpand) {
31448
31452
  _this.t = setInterval(function () {
31449
31453
  var _nearBoundary = nearBoundary,
31450
31454
  _nearBoundary2 = Anchor_slicedToArray(_nearBoundary, 2),
@@ -32228,7 +32232,9 @@ var BaseNode_BaseNode = /*#__PURE__*/function (_Component) {
32228
32232
  model = _this$props2.model,
32229
32233
  graphModel = _this$props2.graphModel; // const { isDragging } = model;
32230
32234
 
32231
- var editConfigModel = graphModel.editConfigModel,
32235
+ var _graphModel$editConfi = graphModel.editConfigModel,
32236
+ stopMoveGraph = _graphModel$editConfi.stopMoveGraph,
32237
+ autoExpand = _graphModel$editConfi.autoExpand,
32232
32238
  transformModel = graphModel.transformModel,
32233
32239
  width = graphModel.width,
32234
32240
  height = graphModel.height,
@@ -32250,7 +32256,7 @@ var BaseNode_BaseNode = /*#__PURE__*/function (_Component) {
32250
32256
  x1 = _transformModel$Canva2[0],
32251
32257
  y1 = _transformModel$Canva2[1];
32252
32258
 
32253
- if (x1 < 0 || y1 < 0 || x1 > width || y1 > height) {
32259
+ if (autoExpand && !stopMoveGraph && (x1 < 0 || y1 < 0 || x1 > width || y1 > height)) {
32254
32260
  // 鼠标超出画布后的拖动,不处理,而是让上一次setInterval持续滚动画布
32255
32261
  return;
32256
32262
  } // 1. 考虑画布被缩放
@@ -32290,7 +32296,7 @@ var BaseNode_BaseNode = /*#__PURE__*/function (_Component) {
32290
32296
  cancelRaf(_this.t);
32291
32297
  }
32292
32298
 
32293
- if (nearBoundary.length > 0 && !editConfigModel.stopMoveGraph && editConfigModel.autoExpand) {
32299
+ if (nearBoundary.length > 0 && !stopMoveGraph && autoExpand) {
32294
32300
  _this.t = raf_createRaf(function () {
32295
32301
  var _nearBoundary = nearBoundary,
32296
32302
  _nearBoundary2 = BaseNode_slicedToArray(_nearBoundary, 2),
@@ -32579,9 +32585,9 @@ var BaseNode_BaseNode = /*#__PURE__*/function (_Component) {
32579
32585
  var _this$props11 = this.props,
32580
32586
  model = _this$props11.model,
32581
32587
  graphModel = _this$props11.graphModel;
32582
- var _graphModel$editConfi = graphModel.editConfigModel,
32583
- hideAnchors = _graphModel$editConfi.hideAnchors,
32584
- adjustNodePosition = _graphModel$editConfi.adjustNodePosition,
32588
+ var _graphModel$editConfi2 = graphModel.editConfigModel,
32589
+ hideAnchors = _graphModel$editConfi2.hideAnchors,
32590
+ adjustNodePosition = _graphModel$editConfi2.adjustNodePosition,
32585
32591
  gridSize = graphModel.gridSize,
32586
32592
  SCALE_X = graphModel.transformModel.SCALE_X;
32587
32593
  var isHitable = model.isHitable,
@@ -35477,7 +35483,11 @@ var History_History = /*#__PURE__*/function () {
35477
35483
 
35478
35484
  this.eventCenter = graphModel.eventCenter;
35479
35485
  var NODE_ADD = EventType.NODE_ADD,
35486
+ NODE_DELETE = EventType.NODE_DELETE,
35487
+ NODE_DND_ADD = EventType.NODE_DND_ADD,
35480
35488
  EDGE_ADD = EventType.EDGE_ADD,
35489
+ EDGE_DELETE = EventType.EDGE_DELETE,
35490
+ TEXT_UPDATE = EventType.TEXT_UPDATE,
35481
35491
  NODE_DROP = EventType.NODE_DROP,
35482
35492
  EDGE_ADJUST = EventType.EDGE_ADJUST,
35483
35493
  SELECTION_DROP = EventType.SELECTION_DROP,
@@ -35488,7 +35498,7 @@ var History_History = /*#__PURE__*/function () {
35488
35498
  NODE_PROPERTY_UPDATE = EventType.NODE_PROPERTY_UPDATE,
35489
35499
  EDGE_PROPERTY_UPDATE = EventType.EDGE_PROPERTY_UPDATE,
35490
35500
  HISTORY_INSERT = EventType.HISTORY_INSERT;
35491
- var historyChangeKeys = "\n ".concat(NODE_ADD, ",\n ").concat(EDGE_ADD, ",\n ").concat(NODE_DROP, ",\n ").concat(EDGE_ADJUST, ",\n ").concat(SELECTION_DROP, ",\n ").concat(TEXT_DROP, ",\n ").concat(NODE_TEXT_UPDATE, ",\n ").concat(EDGE_TEXT_UPDATE, ",\n ").concat(GRAPH_RENDERED, "\n ");
35501
+ var historyChangeKeys = "\n ".concat(NODE_ADD, ",\n ").concat(EDGE_ADD, ",\n ").concat(NODE_DELETE, ",\n ").concat(NODE_DND_ADD, ",\n ").concat(EDGE_DELETE, ",\n ").concat(TEXT_UPDATE, ",\n ").concat(NODE_DROP, ",\n ").concat(EDGE_ADJUST, ",\n ").concat(SELECTION_DROP, ",\n ").concat(TEXT_DROP, ",\n ").concat(NODE_TEXT_UPDATE, ",\n ").concat(EDGE_TEXT_UPDATE, ",\n ").concat(GRAPH_RENDERED, "\n ");
35492
35502
 
35493
35503
  if (isPropertiesChangeHistory) {
35494
35504
  historyChangeKeys += ",".concat(NODE_PROPERTY_UPDATE, ",").concat(EDGE_PROPERTY_UPDATE);
@@ -36540,10 +36550,6 @@ var LogicFlow_LogicFlow = /*#__PURE__*/function () {
36540
36550
 
36541
36551
  LogicFlow_defineProperty(this, "container", void 0);
36542
36552
 
36543
- LogicFlow_defineProperty(this, "width", void 0);
36544
-
36545
- LogicFlow_defineProperty(this, "height", void 0);
36546
-
36547
36553
  LogicFlow_defineProperty(this, "graphModel", void 0);
36548
36554
 
36549
36555
  LogicFlow_defineProperty(this, "history", void 0);