@logicflow/extension 0.7.12 → 0.7.13-alpha.0

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.
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.NodeSelection = void 0;
17
+ var lodash_es_1 = require("lodash-es");
18
+ var core_1 = require("@logicflow/core");
19
+ var NodeSelectionView = /** @class */ (function (_super) {
20
+ __extends(NodeSelectionView, _super);
21
+ function NodeSelectionView() {
22
+ var _this = _super !== null && _super.apply(this, arguments) || this;
23
+ _this.d = 10;
24
+ return _this;
25
+ }
26
+ NodeSelectionView.prototype.getShapeStyle = function () {
27
+ // 设置边框为虚线
28
+ var style = _super.prototype.getShapeStyle.call(this);
29
+ // @ts-ignore
30
+ style.strokeDashArray = '10 5';
31
+ return style;
32
+ };
33
+ NodeSelectionView.prototype.getLabelShape = function () {
34
+ var attributes = _super.prototype.getAttributes.call(this);
35
+ var x = attributes.x, // 元素中心点
36
+ y = attributes.y, // 元素中心点
37
+ width = attributes.width, height = attributes.height, stroke = attributes.stroke, id = attributes.id, labelText = attributes.properties.label_text;
38
+ return core_1.h('svg', {
39
+ x: x - width / 2,
40
+ y: y - height / 2,
41
+ style: 'z-index: 0; background: none; overflow: auto;',
42
+ }, labelText ? core_1.h('text', {
43
+ x: 0,
44
+ y: -5,
45
+ width: 50,
46
+ height: 24,
47
+ fontSize: '16px',
48
+ fill: stroke,
49
+ }, '方案') : '', labelText ? core_1.h('text', {
50
+ x: 50,
51
+ y: -5,
52
+ width: 50,
53
+ height: 24,
54
+ fontSize: '24px',
55
+ cursor: 'pointer',
56
+ fill: stroke,
57
+ onclick: this.handleCustomDeleteIconClick.bind(this, id),
58
+ }, 'x') : '');
59
+ };
60
+ NodeSelectionView.prototype.getShape = function () {
61
+ var attributes = _super.prototype.getAttributes.call(this);
62
+ var x = attributes.x, // 元素中心点
63
+ y = attributes.y, // 元素中心点
64
+ width = attributes.width, height = attributes.height, fill = attributes.fill, stroke = attributes.stroke, strokeWidth = attributes.strokeWidth, strokeDashArray = attributes.strokeDashArray, id = attributes.id;
65
+ return core_1.h('g', {}, [
66
+ core_1.h('rect', {
67
+ x: x - width / 2,
68
+ y: y - height / 2,
69
+ fill: fill,
70
+ stroke: stroke,
71
+ strokeWidth: strokeWidth,
72
+ width: width,
73
+ height: height,
74
+ strokeDashArray: strokeDashArray,
75
+ id: id,
76
+ }),
77
+ this.getLabelShape(),
78
+ ]);
79
+ };
80
+ NodeSelectionView.prototype.toFront = function () { };
81
+ /**
82
+ * 点击删除
83
+ * @param id
84
+ */
85
+ NodeSelectionView.prototype.handleCustomDeleteIconClick = function (id) {
86
+ var graphModel = this.props.graphModel;
87
+ graphModel.deleteNode(id);
88
+ };
89
+ return NodeSelectionView;
90
+ }(core_1.PolygonNode));
91
+ var NodeSelectionModel = /** @class */ (function (_super) {
92
+ __extends(NodeSelectionModel, _super);
93
+ function NodeSelectionModel() {
94
+ var _this = _super !== null && _super.apply(this, arguments) || this;
95
+ _this.d = 10;
96
+ return _this;
97
+ }
98
+ NodeSelectionModel.prototype.setAttributes = function () {
99
+ var _this = this;
100
+ // 默认不显示
101
+ this.points = [];
102
+ this.text = {
103
+ value: '',
104
+ x: 0,
105
+ y: 0,
106
+ draggable: false,
107
+ editable: false,
108
+ };
109
+ this.stroke = this.properties.active_color || '#008000';
110
+ this.zIndex = 0;
111
+ this.draggable = false;
112
+ this.anchorsOffset = [[0, 0]];
113
+ if (this.properties.node_selection_ids.length > 1) {
114
+ setTimeout(function () {
115
+ _this.updatePointsByNodes(_this.properties.node_selection_ids);
116
+ });
117
+ }
118
+ };
119
+ NodeSelectionModel.prototype.getAnchorsByOffset = function () {
120
+ return [];
121
+ };
122
+ /**
123
+ * 更新points
124
+ * @param points
125
+ */
126
+ NodeSelectionModel.prototype.updatePoints = function (points) {
127
+ this.points = points;
128
+ };
129
+ /**
130
+ * 更新x y
131
+ */
132
+ NodeSelectionModel.prototype.updateCoordinate = function (_a) {
133
+ var x = _a.x, y = _a.y;
134
+ this.x = x;
135
+ this.y = y;
136
+ };
137
+ /**
138
+ * 更新points
139
+ */
140
+ NodeSelectionModel.prototype.updatePointsByNodes = function (nodesIds) {
141
+ var _this = this;
142
+ // TODO: 临时方案矩形
143
+ var points = [];
144
+ var minX = Infinity;
145
+ var minY = Infinity;
146
+ var maxX = -Infinity;
147
+ var maxY = -Infinity;
148
+ nodesIds.forEach(function (id) {
149
+ var model = _this.graphModel.getNodeModel(id);
150
+ if (!model)
151
+ return;
152
+ var width = model.width, height = model.height, x = model.x, y = model.y;
153
+ minX = Math.min(minX, x - width / 2 - _this.d);
154
+ minY = Math.min(minY, y - height / 2 - _this.d);
155
+ maxX = Math.max(maxX, x + width / 2 + _this.d);
156
+ maxY = Math.max(maxY, y + height / 2 + _this.d);
157
+ });
158
+ points.push([minX, minY], [maxX, minY], [maxX, maxY], [minX, maxY]);
159
+ if ([minX, minY, maxX, maxY].some(function (n) { return Math.abs(n) === Infinity; }))
160
+ return;
161
+ this.updatePoints(points);
162
+ this.updateCoordinate({ x: ((maxX + minX) / 2), y: (maxY + minY) / 2 });
163
+ };
164
+ return NodeSelectionModel;
165
+ }(core_1.PolygonNodeModel));
166
+ var NodeSelection = /** @class */ (function () {
167
+ function NodeSelection(_a) {
168
+ var lf = _a.lf;
169
+ this.lf = null; // lf 实例
170
+ this.selectNodes = []; // 选择的nodes
171
+ this.currentClickNode = null; // 当前点击的节点,选中的节点是无序的
172
+ this.d = 10;
173
+ lf.register({
174
+ type: 'node-selection',
175
+ view: NodeSelectionView,
176
+ model: NodeSelectionModel,
177
+ });
178
+ }
179
+ Object.defineProperty(NodeSelection.prototype, "selectNodesIds", {
180
+ /**
181
+ * 获取所选node的id数组
182
+ */
183
+ get: function () {
184
+ return this.selectNodes.map(function (node) { return node.id; });
185
+ },
186
+ enumerable: false,
187
+ configurable: true
188
+ });
189
+ /**
190
+ * 新建node-selection节点
191
+ */
192
+ NodeSelection.prototype.addNodeSelection = function () {
193
+ var node = this.lf.addNode({
194
+ type: 'node-selection',
195
+ text: '',
196
+ properties: {
197
+ node_selection_ids: this.selectNodesIds,
198
+ },
199
+ });
200
+ node.updatePointsByNodes(this.selectNodesIds);
201
+ };
202
+ /**
203
+ * 删除node-selection节点
204
+ */
205
+ NodeSelection.prototype.deleteNodeSelection = function () {
206
+ var nodeSelection = this.getNodeSelection();
207
+ if (!nodeSelection)
208
+ return;
209
+ this.lf.deleteNode(nodeSelection.id);
210
+ };
211
+ /**
212
+ * 更新node-selection节点
213
+ */
214
+ NodeSelection.prototype.updateNodeSelection = function () {
215
+ var nodeSelection = this.getNodeSelection();
216
+ if (!nodeSelection)
217
+ return;
218
+ this.lf.setProperties(nodeSelection.id, {
219
+ node_selection_ids: this.selectNodesIds,
220
+ });
221
+ this.lf.getNodeModel(nodeSelection.id).updatePointsByNodes(this.selectNodesIds);
222
+ };
223
+ /**
224
+ * 获取所属的node-selection
225
+ */
226
+ NodeSelection.prototype.getNodeSelection = function () {
227
+ var _this = this;
228
+ var ids = this.selectNodesIds;
229
+ var rawData = this.lf.getGraphRawData();
230
+ var oldIds = ids.filter(function (id) { return id !== _this.currentClickNode.id; });
231
+ return rawData.nodes.find(function (node) {
232
+ if (node.type === 'node-selection') {
233
+ var nodeSelectionIds_1 = lodash_es_1.default.get(node, 'properties.node_selection_ids', []);
234
+ return oldIds.every(function (id) { return nodeSelectionIds_1.includes(id); });
235
+ }
236
+ return false;
237
+ });
238
+ };
239
+ NodeSelection.prototype.render = function (lf) {
240
+ var _this = this;
241
+ this.lf = lf;
242
+ lf.on('node:click', function (val) {
243
+ if (!val.e.shiftKey)
244
+ return;
245
+ _this.currentClickNode = val.data;
246
+ // 如果selectNodesIds中已存在此节点,则取消选中次节点
247
+ var isUnSelected = false;
248
+ if (_this.selectNodesIds.includes(val.data.id)) {
249
+ _this.lf.getNodeModel(val.data.id).setSelected(false);
250
+ isUnSelected = true;
251
+ }
252
+ // 获取所有被选中的节点,获取到的数组是无序的
253
+ var nodes = lf.getSelectElements(true).nodes;
254
+ _this.selectNodes = nodes;
255
+ if (_this.selectNodes.length === 1) {
256
+ if (isUnSelected)
257
+ _this.deleteNodeSelection();
258
+ }
259
+ else {
260
+ if (!isUnSelected && _this.selectNodes.length === 2) {
261
+ _this.addNodeSelection();
262
+ return;
263
+ }
264
+ _this.updateNodeSelection();
265
+ }
266
+ });
267
+ };
268
+ NodeSelection.pluginName = 'node-selection';
269
+ return NodeSelection;
270
+ }());
271
+ exports.NodeSelection = NodeSelection;
272
+ exports.default = NodeSelection;
@@ -11,27 +11,24 @@ declare class StartEventView extends CircleNode {
11
11
  width: number;
12
12
  height: number;
13
13
  fill: string;
14
- fillOpacity: number;
15
- strokeWidth: number;
14
+ fillOpacity?: number;
15
+ strokeWidth?: number;
16
16
  stroke: string;
17
- strokeOpacity: number;
18
- opacity: number;
19
- outlineColor: string;
17
+ strokeOpacity?: number;
18
+ opacity?: number;
19
+ outlineColor?: string;
20
20
  id: string;
21
- properties: {
22
- [x: string]: any;
23
- };
21
+ properties: Record<string, any>;
24
22
  type: string;
25
23
  x: number;
26
24
  y: number;
27
25
  isSelected: boolean;
28
26
  isHovered: boolean;
29
27
  text: {
30
- value: string;
28
+ [key: string]: any;
31
29
  x: number;
32
30
  y: number;
33
- draggable: boolean;
34
- editable: boolean;
31
+ value: string;
35
32
  };
36
33
  };
37
34
  }
package/es/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export * from './materials/group';
14
14
  export * from './NodeResize';
15
15
  export * from './tools/flow-path';
16
16
  export * from './tools/auto-layout';
17
+ export * from './materials/node-selection';
package/es/index.js CHANGED
@@ -15,3 +15,4 @@ export * from './materials/group';
15
15
  export * from './NodeResize';
16
16
  export * from './tools/flow-path';
17
17
  export * from './tools/auto-layout';
18
+ export * from './materials/node-selection';
@@ -29,12 +29,12 @@ declare class GroupNode extends RectNode {
29
29
  width: number;
30
30
  height: number;
31
31
  fill: string;
32
- fillOpacity: number;
33
- strokeWidth: number;
32
+ fillOpacity?: number;
33
+ strokeWidth?: number;
34
34
  stroke: string;
35
- strokeOpacity: number;
36
- opacity: number;
37
- outlineColor: string;
35
+ strokeOpacity?: number;
36
+ opacity?: number;
37
+ outlineColor?: string;
38
38
  };
39
39
  }
40
40
  declare const _default: {
@@ -0,0 +1,33 @@
1
+ declare class NodeSelection {
2
+ static pluginName: string;
3
+ lf: any;
4
+ selectNodes: any[];
5
+ currentClickNode: any;
6
+ d: number;
7
+ constructor({ lf }: {
8
+ lf: any;
9
+ });
10
+ /**
11
+ * 获取所选node的id数组
12
+ */
13
+ get selectNodesIds(): any[];
14
+ /**
15
+ * 新建node-selection节点
16
+ */
17
+ addNodeSelection(): void;
18
+ /**
19
+ * 删除node-selection节点
20
+ */
21
+ deleteNodeSelection(): void;
22
+ /**
23
+ * 更新node-selection节点
24
+ */
25
+ updateNodeSelection(): void;
26
+ /**
27
+ * 获取所属的node-selection
28
+ */
29
+ getNodeSelection(): any;
30
+ render(lf: any): void;
31
+ }
32
+ export default NodeSelection;
33
+ export { NodeSelection, };
@@ -0,0 +1,269 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ import _ from 'lodash-es';
15
+ import { h, PolygonNode, PolygonNodeModel } from '@logicflow/core';
16
+ var NodeSelectionView = /** @class */ (function (_super) {
17
+ __extends(NodeSelectionView, _super);
18
+ function NodeSelectionView() {
19
+ var _this = _super !== null && _super.apply(this, arguments) || this;
20
+ _this.d = 10;
21
+ return _this;
22
+ }
23
+ NodeSelectionView.prototype.getShapeStyle = function () {
24
+ // 设置边框为虚线
25
+ var style = _super.prototype.getShapeStyle.call(this);
26
+ // @ts-ignore
27
+ style.strokeDashArray = '10 5';
28
+ return style;
29
+ };
30
+ NodeSelectionView.prototype.getLabelShape = function () {
31
+ var attributes = _super.prototype.getAttributes.call(this);
32
+ var x = attributes.x, // 元素中心点
33
+ y = attributes.y, // 元素中心点
34
+ width = attributes.width, height = attributes.height, stroke = attributes.stroke, id = attributes.id, labelText = attributes.properties.label_text;
35
+ return h('svg', {
36
+ x: x - width / 2,
37
+ y: y - height / 2,
38
+ style: 'z-index: 0; background: none; overflow: auto;',
39
+ }, labelText ? h('text', {
40
+ x: 0,
41
+ y: -5,
42
+ width: 50,
43
+ height: 24,
44
+ fontSize: '16px',
45
+ fill: stroke,
46
+ }, '方案') : '', labelText ? h('text', {
47
+ x: 50,
48
+ y: -5,
49
+ width: 50,
50
+ height: 24,
51
+ fontSize: '24px',
52
+ cursor: 'pointer',
53
+ fill: stroke,
54
+ onclick: this.handleCustomDeleteIconClick.bind(this, id),
55
+ }, 'x') : '');
56
+ };
57
+ NodeSelectionView.prototype.getShape = function () {
58
+ var attributes = _super.prototype.getAttributes.call(this);
59
+ var x = attributes.x, // 元素中心点
60
+ y = attributes.y, // 元素中心点
61
+ width = attributes.width, height = attributes.height, fill = attributes.fill, stroke = attributes.stroke, strokeWidth = attributes.strokeWidth, strokeDashArray = attributes.strokeDashArray, id = attributes.id;
62
+ return h('g', {}, [
63
+ h('rect', {
64
+ x: x - width / 2,
65
+ y: y - height / 2,
66
+ fill: fill,
67
+ stroke: stroke,
68
+ strokeWidth: strokeWidth,
69
+ width: width,
70
+ height: height,
71
+ strokeDashArray: strokeDashArray,
72
+ id: id,
73
+ }),
74
+ this.getLabelShape(),
75
+ ]);
76
+ };
77
+ NodeSelectionView.prototype.toFront = function () { };
78
+ /**
79
+ * 点击删除
80
+ * @param id
81
+ */
82
+ NodeSelectionView.prototype.handleCustomDeleteIconClick = function (id) {
83
+ var graphModel = this.props.graphModel;
84
+ graphModel.deleteNode(id);
85
+ };
86
+ return NodeSelectionView;
87
+ }(PolygonNode));
88
+ var NodeSelectionModel = /** @class */ (function (_super) {
89
+ __extends(NodeSelectionModel, _super);
90
+ function NodeSelectionModel() {
91
+ var _this = _super !== null && _super.apply(this, arguments) || this;
92
+ _this.d = 10;
93
+ return _this;
94
+ }
95
+ NodeSelectionModel.prototype.setAttributes = function () {
96
+ var _this = this;
97
+ // 默认不显示
98
+ this.points = [];
99
+ this.text = {
100
+ value: '',
101
+ x: 0,
102
+ y: 0,
103
+ draggable: false,
104
+ editable: false,
105
+ };
106
+ this.stroke = this.properties.active_color || '#008000';
107
+ this.zIndex = 0;
108
+ this.draggable = false;
109
+ this.anchorsOffset = [[0, 0]];
110
+ if (this.properties.node_selection_ids.length > 1) {
111
+ setTimeout(function () {
112
+ _this.updatePointsByNodes(_this.properties.node_selection_ids);
113
+ });
114
+ }
115
+ };
116
+ NodeSelectionModel.prototype.getAnchorsByOffset = function () {
117
+ return [];
118
+ };
119
+ /**
120
+ * 更新points
121
+ * @param points
122
+ */
123
+ NodeSelectionModel.prototype.updatePoints = function (points) {
124
+ this.points = points;
125
+ };
126
+ /**
127
+ * 更新x y
128
+ */
129
+ NodeSelectionModel.prototype.updateCoordinate = function (_a) {
130
+ var x = _a.x, y = _a.y;
131
+ this.x = x;
132
+ this.y = y;
133
+ };
134
+ /**
135
+ * 更新points
136
+ */
137
+ NodeSelectionModel.prototype.updatePointsByNodes = function (nodesIds) {
138
+ var _this = this;
139
+ // TODO: 临时方案矩形
140
+ var points = [];
141
+ var minX = Infinity;
142
+ var minY = Infinity;
143
+ var maxX = -Infinity;
144
+ var maxY = -Infinity;
145
+ nodesIds.forEach(function (id) {
146
+ var model = _this.graphModel.getNodeModel(id);
147
+ if (!model)
148
+ return;
149
+ var width = model.width, height = model.height, x = model.x, y = model.y;
150
+ minX = Math.min(minX, x - width / 2 - _this.d);
151
+ minY = Math.min(minY, y - height / 2 - _this.d);
152
+ maxX = Math.max(maxX, x + width / 2 + _this.d);
153
+ maxY = Math.max(maxY, y + height / 2 + _this.d);
154
+ });
155
+ points.push([minX, minY], [maxX, minY], [maxX, maxY], [minX, maxY]);
156
+ if ([minX, minY, maxX, maxY].some(function (n) { return Math.abs(n) === Infinity; }))
157
+ return;
158
+ this.updatePoints(points);
159
+ this.updateCoordinate({ x: ((maxX + minX) / 2), y: (maxY + minY) / 2 });
160
+ };
161
+ return NodeSelectionModel;
162
+ }(PolygonNodeModel));
163
+ var NodeSelection = /** @class */ (function () {
164
+ function NodeSelection(_a) {
165
+ var lf = _a.lf;
166
+ this.lf = null; // lf 实例
167
+ this.selectNodes = []; // 选择的nodes
168
+ this.currentClickNode = null; // 当前点击的节点,选中的节点是无序的
169
+ this.d = 10;
170
+ lf.register({
171
+ type: 'node-selection',
172
+ view: NodeSelectionView,
173
+ model: NodeSelectionModel,
174
+ });
175
+ }
176
+ Object.defineProperty(NodeSelection.prototype, "selectNodesIds", {
177
+ /**
178
+ * 获取所选node的id数组
179
+ */
180
+ get: function () {
181
+ return this.selectNodes.map(function (node) { return node.id; });
182
+ },
183
+ enumerable: false,
184
+ configurable: true
185
+ });
186
+ /**
187
+ * 新建node-selection节点
188
+ */
189
+ NodeSelection.prototype.addNodeSelection = function () {
190
+ var node = this.lf.addNode({
191
+ type: 'node-selection',
192
+ text: '',
193
+ properties: {
194
+ node_selection_ids: this.selectNodesIds,
195
+ },
196
+ });
197
+ node.updatePointsByNodes(this.selectNodesIds);
198
+ };
199
+ /**
200
+ * 删除node-selection节点
201
+ */
202
+ NodeSelection.prototype.deleteNodeSelection = function () {
203
+ var nodeSelection = this.getNodeSelection();
204
+ if (!nodeSelection)
205
+ return;
206
+ this.lf.deleteNode(nodeSelection.id);
207
+ };
208
+ /**
209
+ * 更新node-selection节点
210
+ */
211
+ NodeSelection.prototype.updateNodeSelection = function () {
212
+ var nodeSelection = this.getNodeSelection();
213
+ if (!nodeSelection)
214
+ return;
215
+ this.lf.setProperties(nodeSelection.id, {
216
+ node_selection_ids: this.selectNodesIds,
217
+ });
218
+ this.lf.getNodeModel(nodeSelection.id).updatePointsByNodes(this.selectNodesIds);
219
+ };
220
+ /**
221
+ * 获取所属的node-selection
222
+ */
223
+ NodeSelection.prototype.getNodeSelection = function () {
224
+ var _this = this;
225
+ var ids = this.selectNodesIds;
226
+ var rawData = this.lf.getGraphRawData();
227
+ var oldIds = ids.filter(function (id) { return id !== _this.currentClickNode.id; });
228
+ return rawData.nodes.find(function (node) {
229
+ if (node.type === 'node-selection') {
230
+ var nodeSelectionIds_1 = _.get(node, 'properties.node_selection_ids', []);
231
+ return oldIds.every(function (id) { return nodeSelectionIds_1.includes(id); });
232
+ }
233
+ return false;
234
+ });
235
+ };
236
+ NodeSelection.prototype.render = function (lf) {
237
+ var _this = this;
238
+ this.lf = lf;
239
+ lf.on('node:click', function (val) {
240
+ if (!val.e.shiftKey)
241
+ return;
242
+ _this.currentClickNode = val.data;
243
+ // 如果selectNodesIds中已存在此节点,则取消选中次节点
244
+ var isUnSelected = false;
245
+ if (_this.selectNodesIds.includes(val.data.id)) {
246
+ _this.lf.getNodeModel(val.data.id).setSelected(false);
247
+ isUnSelected = true;
248
+ }
249
+ // 获取所有被选中的节点,获取到的数组是无序的
250
+ var nodes = lf.getSelectElements(true).nodes;
251
+ _this.selectNodes = nodes;
252
+ if (_this.selectNodes.length === 1) {
253
+ if (isUnSelected)
254
+ _this.deleteNodeSelection();
255
+ }
256
+ else {
257
+ if (!isUnSelected && _this.selectNodes.length === 2) {
258
+ _this.addNodeSelection();
259
+ return;
260
+ }
261
+ _this.updateNodeSelection();
262
+ }
263
+ });
264
+ };
265
+ NodeSelection.pluginName = 'node-selection';
266
+ return NodeSelection;
267
+ }());
268
+ export default NodeSelection;
269
+ export { NodeSelection, };