@logicflow/core 2.1.0 → 2.1.1

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/es/LogicFlow.js CHANGED
@@ -796,6 +796,9 @@ var LogicFlow = /** @class */ (function () {
796
796
  var _b = this.graphModel.grid.size, size = _b === void 0 ? 1 : _b;
797
797
  this.graphModel.updateGridSize(config.snapGrid ? size : 1);
798
798
  }
799
+ this.emit(EventType.EDIT_CONFIG_CHANGED, {
800
+ data: editConfigModel.getConfig(),
801
+ });
799
802
  };
800
803
  /**
801
804
  * 获取流程图当前编辑相关设置
@@ -82,6 +82,7 @@ export declare enum EventType {
82
82
  BLANK_DRAG = "blank:drag",
83
83
  BLANK_DROP = "blank:drop",
84
84
  BLANK_MOUSEMOVE = "blank:mousemove",
85
+ BLANK_CANVAS_MOUSEMOVE = "blank:canvas-mousemove",
85
86
  BLANK_MOUSEUP = "blank:mouseup",
86
87
  BLANK_CLICK = "blank:click",
87
88
  BLANK_CONTEXTMENU = "blank:contextmenu",
@@ -129,7 +130,8 @@ export declare enum EventType {
129
130
  HISTORY_CHANGE = "history:change",
130
131
  GRAPH_TRANSFORM = "graph:transform",
131
132
  GRAPH_RENDERED = "graph:rendered",
132
- GRAPH_UPDATED = "graph:updated"
133
+ GRAPH_UPDATED = "graph:updated",
134
+ EDIT_CONFIG_CHANGED = "editConfig:changed"
133
135
  }
134
136
  export declare enum OverlapMode {
135
137
  DEFAULT = 0,// 默认
@@ -92,6 +92,7 @@ export var EventType;
92
92
  EventType["BLANK_DRAG"] = "blank:drag";
93
93
  EventType["BLANK_DROP"] = "blank:drop";
94
94
  EventType["BLANK_MOUSEMOVE"] = "blank:mousemove";
95
+ EventType["BLANK_CANVAS_MOUSEMOVE"] = "blank:canvas-mousemove";
95
96
  EventType["BLANK_MOUSEUP"] = "blank:mouseup";
96
97
  EventType["BLANK_CLICK"] = "blank:click";
97
98
  EventType["BLANK_CONTEXTMENU"] = "blank:contextmenu";
@@ -144,6 +145,7 @@ export var EventType;
144
145
  EventType["GRAPH_TRANSFORM"] = "graph:transform";
145
146
  EventType["GRAPH_RENDERED"] = "graph:rendered";
146
147
  EventType["GRAPH_UPDATED"] = "graph:updated";
148
+ EventType["EDIT_CONFIG_CHANGED"] = "editConfig:changed";
147
149
  })(EventType || (EventType = {}));
148
150
  export var OverlapMode;
149
151
  (function (OverlapMode) {
@@ -30,6 +30,9 @@ var Dnd = /** @class */ (function () {
30
30
  })));
31
31
  };
32
32
  this.onDragOver = function (e) {
33
+ _this.lf.graphModel.eventCenter.emit(EventType.BLANK_CANVAS_MOUSEMOVE, {
34
+ e: e,
35
+ });
33
36
  e.preventDefault();
34
37
  if (_this.fakeNode) {
35
38
  var _a = _this.clientToLocalPoint({
@@ -257,7 +257,6 @@ var BaseNode = /** @class */ (function (_super) {
257
257
  var _a = _this.props, model = _a.model, graphModel = _a.graphModel;
258
258
  _this.startTime = new Date().getTime();
259
259
  var editConfigModel = graphModel.editConfigModel;
260
- model.setSelected(true);
261
260
  if (editConfigModel.adjustNodePosition && model.draggable) {
262
261
  _this.stepDrag && _this.stepDrag.handleMouseDown(ev);
263
262
  }
package/lib/LogicFlow.js CHANGED
@@ -825,6 +825,9 @@ var LogicFlow = /** @class */ (function () {
825
825
  var _b = this.graphModel.grid.size, size = _b === void 0 ? 1 : _b;
826
826
  this.graphModel.updateGridSize(config.snapGrid ? size : 1);
827
827
  }
828
+ this.emit(constant_1.EventType.EDIT_CONFIG_CHANGED, {
829
+ data: editConfigModel.getConfig(),
830
+ });
828
831
  };
829
832
  /**
830
833
  * 获取流程图当前编辑相关设置
@@ -82,6 +82,7 @@ export declare enum EventType {
82
82
  BLANK_DRAG = "blank:drag",
83
83
  BLANK_DROP = "blank:drop",
84
84
  BLANK_MOUSEMOVE = "blank:mousemove",
85
+ BLANK_CANVAS_MOUSEMOVE = "blank:canvas-mousemove",
85
86
  BLANK_MOUSEUP = "blank:mouseup",
86
87
  BLANK_CLICK = "blank:click",
87
88
  BLANK_CONTEXTMENU = "blank:contextmenu",
@@ -129,7 +130,8 @@ export declare enum EventType {
129
130
  HISTORY_CHANGE = "history:change",
130
131
  GRAPH_TRANSFORM = "graph:transform",
131
132
  GRAPH_RENDERED = "graph:rendered",
132
- GRAPH_UPDATED = "graph:updated"
133
+ GRAPH_UPDATED = "graph:updated",
134
+ EDIT_CONFIG_CHANGED = "editConfig:changed"
133
135
  }
134
136
  export declare enum OverlapMode {
135
137
  DEFAULT = 0,// 默认
@@ -95,6 +95,7 @@ var EventType;
95
95
  EventType["BLANK_DRAG"] = "blank:drag";
96
96
  EventType["BLANK_DROP"] = "blank:drop";
97
97
  EventType["BLANK_MOUSEMOVE"] = "blank:mousemove";
98
+ EventType["BLANK_CANVAS_MOUSEMOVE"] = "blank:canvas-mousemove";
98
99
  EventType["BLANK_MOUSEUP"] = "blank:mouseup";
99
100
  EventType["BLANK_CLICK"] = "blank:click";
100
101
  EventType["BLANK_CONTEXTMENU"] = "blank:contextmenu";
@@ -147,6 +148,7 @@ var EventType;
147
148
  EventType["GRAPH_TRANSFORM"] = "graph:transform";
148
149
  EventType["GRAPH_RENDERED"] = "graph:rendered";
149
150
  EventType["GRAPH_UPDATED"] = "graph:updated";
151
+ EventType["EDIT_CONFIG_CHANGED"] = "editConfig:changed";
150
152
  })(EventType || (exports.EventType = EventType = {}));
151
153
  var OverlapMode;
152
154
  (function (OverlapMode) {
@@ -33,6 +33,9 @@ var Dnd = /** @class */ (function () {
33
33
  })));
34
34
  };
35
35
  this.onDragOver = function (e) {
36
+ _this.lf.graphModel.eventCenter.emit(constant_1.EventType.BLANK_CANVAS_MOUSEMOVE, {
37
+ e: e,
38
+ });
36
39
  e.preventDefault();
37
40
  if (_this.fakeNode) {
38
41
  var _a = _this.clientToLocalPoint({
@@ -261,7 +261,6 @@ var BaseNode = /** @class */ (function (_super) {
261
261
  var _a = _this.props, model = _a.model, graphModel = _a.graphModel;
262
262
  _this.startTime = new Date().getTime();
263
263
  var editConfigModel = graphModel.editConfigModel;
264
- model.setSelected(true);
265
264
  if (editConfigModel.adjustNodePosition && model.draggable) {
266
265
  _this.stepDrag && _this.stepDrag.handleMouseDown(ev);
267
266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "LogicFlow, help you quickly create flowcharts",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -427,7 +427,6 @@ export abstract class BaseNode<P extends IProps = IProps> extends Component<
427
427
  const { model, graphModel } = this.props
428
428
  this.startTime = new Date().getTime()
429
429
  const { editConfigModel } = graphModel
430
- model.setSelected(true)
431
430
  if (editConfigModel.adjustNodePosition && model.draggable) {
432
431
  this.stepDrag && this.stepDrag.handleMouseDown(ev)
433
432
  }