react-design-editor 0.0.37 → 0.0.41

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.
Files changed (99) hide show
  1. package/dist/react-design-editor.js +773 -726
  2. package/dist/react-design-editor.min.js +1 -1
  3. package/lib/Canvas.d.ts +18 -0
  4. package/lib/Canvas.js +172 -0
  5. package/lib/CanvasObject.d.ts +10 -0
  6. package/lib/CanvasObject.js +96 -0
  7. package/lib/constants/code.d.ts +19 -0
  8. package/lib/constants/code.js +22 -0
  9. package/lib/constants/defaults.d.ts +38 -0
  10. package/lib/constants/defaults.js +69 -0
  11. package/lib/constants/index.d.ts +3 -0
  12. package/lib/constants/index.js +26 -0
  13. package/lib/handlers/AlignmentHandler.d.ts +18 -0
  14. package/lib/handlers/AlignmentHandler.js +58 -0
  15. package/lib/handlers/AnimationHandler.d.ts +50 -0
  16. package/lib/handlers/AnimationHandler.js +323 -0
  17. package/lib/handlers/ChartHandler.d.ts +8 -0
  18. package/lib/handlers/ChartHandler.js +8 -0
  19. package/lib/handlers/ContextmenuHandler.d.ts +28 -0
  20. package/lib/handlers/ContextmenuHandler.js +65 -0
  21. package/lib/handlers/CropHandler.d.ts +43 -0
  22. package/lib/handlers/CropHandler.js +261 -0
  23. package/lib/handlers/CustomHandler.d.ts +7 -0
  24. package/lib/handlers/CustomHandler.js +10 -0
  25. package/lib/handlers/DrawingHandler.d.ts +28 -0
  26. package/lib/handlers/DrawingHandler.js +318 -0
  27. package/lib/handlers/ElementHandler.d.ts +80 -0
  28. package/lib/handlers/ElementHandler.js +154 -0
  29. package/lib/handlers/EventHandler.d.ts +170 -0
  30. package/lib/handlers/EventHandler.js +880 -0
  31. package/lib/handlers/FiberHandler.d.ts +6 -0
  32. package/lib/handlers/FiberHandler.js +23 -0
  33. package/lib/handlers/GridHandler.d.ts +19 -0
  34. package/lib/handlers/GridHandler.js +77 -0
  35. package/lib/handlers/GuidelineHandler.d.ts +61 -0
  36. package/lib/handlers/GuidelineHandler.js +315 -0
  37. package/lib/handlers/Handler.d.ts +622 -0
  38. package/lib/handlers/Handler.js +1640 -0
  39. package/lib/handlers/ImageHandler.d.ts +307 -0
  40. package/lib/handlers/ImageHandler.js +529 -0
  41. package/lib/handlers/InteractionHandler.d.ts +45 -0
  42. package/lib/handlers/InteractionHandler.js +164 -0
  43. package/lib/handlers/LinkHandler.d.ts +115 -0
  44. package/lib/handlers/LinkHandler.js +247 -0
  45. package/lib/handlers/NodeHandler.d.ts +50 -0
  46. package/lib/handlers/NodeHandler.js +274 -0
  47. package/lib/handlers/PortHandler.d.ts +22 -0
  48. package/lib/handlers/PortHandler.js +179 -0
  49. package/lib/handlers/ShortcutHandler.d.ts +119 -0
  50. package/lib/handlers/ShortcutHandler.js +151 -0
  51. package/lib/handlers/TooltipHandler.d.ts +33 -0
  52. package/lib/handlers/TooltipHandler.js +91 -0
  53. package/lib/handlers/TransactionHandler.d.ts +59 -0
  54. package/lib/handlers/TransactionHandler.js +137 -0
  55. package/lib/handlers/WorkareaHandler.d.ts +43 -0
  56. package/lib/handlers/WorkareaHandler.js +354 -0
  57. package/lib/handlers/ZoomHandler.d.ts +48 -0
  58. package/lib/handlers/ZoomHandler.js +143 -0
  59. package/lib/handlers/index.d.ts +23 -0
  60. package/lib/handlers/index.js +48 -0
  61. package/lib/index.d.ts +6 -0
  62. package/lib/index.js +20 -0
  63. package/lib/objects/Arrow.d.ts +2 -0
  64. package/lib/objects/Arrow.js +40 -0
  65. package/lib/objects/Chart.d.ts +10 -0
  66. package/lib/objects/Chart.js +124 -0
  67. package/lib/objects/CirclePort.d.ts +2 -0
  68. package/lib/objects/CirclePort.js +28 -0
  69. package/lib/objects/Cube.d.ts +5 -0
  70. package/lib/objects/Cube.js +71 -0
  71. package/lib/objects/CurvedLink.d.ts +2 -0
  72. package/lib/objects/CurvedLink.js +51 -0
  73. package/lib/objects/Element.d.ts +13 -0
  74. package/lib/objects/Element.js +84 -0
  75. package/lib/objects/Gif.d.ts +3 -0
  76. package/lib/objects/Gif.js +41 -0
  77. package/lib/objects/Iframe.d.ts +9 -0
  78. package/lib/objects/Iframe.js +70 -0
  79. package/lib/objects/Line.d.ts +2 -0
  80. package/lib/objects/Line.js +24 -0
  81. package/lib/objects/Link.d.ts +15 -0
  82. package/lib/objects/Link.js +106 -0
  83. package/lib/objects/Node.d.ts +59 -0
  84. package/lib/objects/Node.js +271 -0
  85. package/lib/objects/OrthogonalLink.d.ts +2 -0
  86. package/lib/objects/OrthogonalLink.js +54 -0
  87. package/lib/objects/Port.d.ts +12 -0
  88. package/lib/objects/Port.js +28 -0
  89. package/lib/objects/Svg.d.ts +8 -0
  90. package/lib/objects/Svg.js +77 -0
  91. package/lib/objects/Video.d.ts +14 -0
  92. package/lib/objects/Video.js +120 -0
  93. package/lib/objects/index.d.ts +15 -0
  94. package/lib/objects/index.js +32 -0
  95. package/lib/utils/ObjectUtil.d.ts +407 -0
  96. package/lib/utils/ObjectUtil.js +13 -0
  97. package/lib/utils/index.d.ts +1 -0
  98. package/lib/utils/index.js +13 -0
  99. package/package.json +1 -1
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fabric_1 = require("fabric");
4
+ class InteractionHandler {
5
+ constructor(handler) {
6
+ /**
7
+ * Change selection mode
8
+ * @param {(obj: FabricObject) => IReturnType} [callback]
9
+ */
10
+ this.selection = (callback) => {
11
+ if (this.handler.interactionMode === 'selection') {
12
+ return;
13
+ }
14
+ this.handler.interactionMode = 'selection';
15
+ if (typeof this.handler.canvasOption.selection === 'undefined') {
16
+ this.handler.canvas.selection = true;
17
+ }
18
+ else {
19
+ this.handler.canvas.selection = this.handler.canvasOption.selection;
20
+ }
21
+ this.handler.canvas.defaultCursor = 'default';
22
+ this.handler.workarea.hoverCursor = 'default';
23
+ this.handler.getObjects().forEach(obj => {
24
+ if (callback) {
25
+ this.interactionCallback(obj, callback);
26
+ }
27
+ else {
28
+ // When typeof selection is ActiveSelection, ignoring selectable, because link position left: 0, top: 0
29
+ if (obj.superType === 'link' || obj.superType === 'port') {
30
+ obj.selectable = false;
31
+ obj.evented = true;
32
+ obj.hoverCursor = 'pointer';
33
+ return;
34
+ }
35
+ if (this.handler.editable) {
36
+ obj.hoverCursor = 'move';
37
+ }
38
+ else {
39
+ obj.hoverCursor = 'pointer';
40
+ }
41
+ obj.selectable = true;
42
+ obj.evented = true;
43
+ }
44
+ });
45
+ this.handler.canvas.renderAll();
46
+ };
47
+ /**
48
+ * Change grab mode
49
+ * @param {(obj: FabricObject) => IReturnType} [callback]
50
+ */
51
+ this.grab = (callback) => {
52
+ if (this.handler.interactionMode === 'grab') {
53
+ return;
54
+ }
55
+ this.handler.interactionMode = 'grab';
56
+ this.handler.canvas.selection = false;
57
+ this.handler.canvas.defaultCursor = 'grab';
58
+ this.handler.workarea.hoverCursor = 'grab';
59
+ this.handler.getObjects().forEach(obj => {
60
+ if (callback) {
61
+ this.interactionCallback(obj, callback);
62
+ }
63
+ else {
64
+ obj.selectable = false;
65
+ obj.evented = this.handler.editable ? false : true;
66
+ }
67
+ });
68
+ this.handler.canvas.renderAll();
69
+ };
70
+ /**
71
+ * Change drawing mode
72
+ * @param {InteractionMode} [type]
73
+ * @param {(obj: FabricObject) => IReturnType} [callback]
74
+ */
75
+ this.drawing = (type, callback) => {
76
+ if (this.isDrawingMode()) {
77
+ return;
78
+ }
79
+ this.handler.interactionMode = type;
80
+ this.handler.canvas.selection = false;
81
+ this.handler.canvas.defaultCursor = 'pointer';
82
+ this.handler.workarea.hoverCursor = 'pointer';
83
+ this.handler.getObjects().forEach(obj => {
84
+ if (callback) {
85
+ this.interactionCallback(obj, callback);
86
+ }
87
+ else {
88
+ obj.selectable = false;
89
+ obj.evented = this.handler.editable ? false : true;
90
+ }
91
+ });
92
+ this.handler.canvas.renderAll();
93
+ };
94
+ this.linking = (callback) => {
95
+ if (this.isDrawingMode()) {
96
+ return;
97
+ }
98
+ this.handler.interactionMode = 'link';
99
+ this.handler.canvas.selection = false;
100
+ this.handler.canvas.defaultCursor = 'default';
101
+ this.handler.workarea.hoverCursor = 'default';
102
+ this.handler.getObjects().forEach(obj => {
103
+ if (callback) {
104
+ this.interactionCallback(obj, callback);
105
+ }
106
+ else {
107
+ if (obj.superType === 'node' || obj.superType === 'port') {
108
+ obj.hoverCursor = 'pointer';
109
+ obj.selectable = false;
110
+ obj.evented = true;
111
+ return;
112
+ }
113
+ obj.selectable = false;
114
+ obj.evented = this.handler.editable ? false : true;
115
+ }
116
+ });
117
+ this.handler.canvas.renderAll();
118
+ };
119
+ /**
120
+ * Moving objects in grap mode
121
+ * @param {MouseEvent} e
122
+ */
123
+ this.moving = (e) => {
124
+ if (this.isDrawingMode()) {
125
+ return;
126
+ }
127
+ const delta = new fabric_1.fabric.Point(e.movementX, e.movementY);
128
+ this.handler.canvas.relativePan(delta);
129
+ this.handler.canvas.requestRenderAll();
130
+ this.handler.objects.forEach(obj => {
131
+ if (obj.superType === 'element') {
132
+ const { id } = obj;
133
+ const el = this.handler.elementHandler.findById(id);
134
+ // update the element
135
+ this.handler.elementHandler.setPosition(el, obj);
136
+ }
137
+ });
138
+ };
139
+ /**
140
+ * Whether is drawing mode
141
+ * @returns
142
+ */
143
+ this.isDrawingMode = () => {
144
+ return (this.handler.interactionMode === 'link' ||
145
+ this.handler.interactionMode === 'arrow' ||
146
+ this.handler.interactionMode === 'line' ||
147
+ this.handler.interactionMode === 'polygon');
148
+ };
149
+ /**
150
+ * Interaction callback
151
+ *
152
+ * @param {FabricObject} obj
153
+ * @param {(obj: FabricObject) => void} [callback]
154
+ */
155
+ this.interactionCallback = (obj, callback) => {
156
+ callback(obj);
157
+ };
158
+ this.handler = handler;
159
+ if (this.handler.editable) {
160
+ this.selection();
161
+ }
162
+ }
163
+ }
164
+ exports.default = InteractionHandler;
@@ -0,0 +1,115 @@
1
+ import { LinkObject } from '../objects/Link';
2
+ import { PortObject } from '../objects/Port';
3
+ import Handler from './Handler';
4
+ export interface LinkOption {
5
+ /**
6
+ * Link Type
7
+ * @type {string}
8
+ */
9
+ type: string;
10
+ /**
11
+ * FromNode id of Link
12
+ * @type {string}
13
+ */
14
+ fromNodeId?: string;
15
+ /**
16
+ * FromPort id of Link
17
+ * @type {string}
18
+ */
19
+ fromPortId?: string;
20
+ /**
21
+ * ToNode id of Link
22
+ * @type {string}
23
+ */
24
+ toNodeId?: string;
25
+ /**
26
+ * ToPort id of Link
27
+ * @type {string}
28
+ */
29
+ toPortId?: string;
30
+ }
31
+ /**
32
+ * Link Handler Class
33
+ * @author salgum1114
34
+ * @class LinkHandler
35
+ */
36
+ declare class LinkHandler {
37
+ private port;
38
+ handler: Handler;
39
+ constructor(handler: Handler);
40
+ /**
41
+ * On source port click, start link
42
+ * @param {PortObject} port
43
+ */
44
+ init: (port: PortObject) => void;
45
+ /**
46
+ * End drawing link.
47
+ */
48
+ finish: (link?: LinkObject) => void;
49
+ /**
50
+ * On dest port click, finish link
51
+ * @param {PortObject} port
52
+ */
53
+ generate: (port: PortObject) => void;
54
+ /**
55
+ * Add link in Canvas
56
+ * @param {LinkOption} link
57
+ * @param {boolean} [loaded=false]
58
+ * @returns
59
+ */
60
+ create: (link: LinkOption, loaded?: boolean) => LinkObject;
61
+ /**
62
+ * Set coordinate of link
63
+ * @param {number} x1
64
+ * @param {number} y1
65
+ * @param {number} x2
66
+ * @param {number} y2
67
+ * @param {LinkObject} link
68
+ */
69
+ setCoords: (x1: number, y1: number, x2: number, y2: number, link: LinkObject) => void;
70
+ /**
71
+ * When the link is deleted, linked FromNode delete
72
+ * @param {LinkObject} link
73
+ */
74
+ removeFrom: (link: LinkObject) => void;
75
+ /**
76
+ * When the link is deleted, linked ToNode delete
77
+ * @param {LinkObject} link
78
+ */
79
+ removeTo: (link: LinkObject) => void;
80
+ /**
81
+ * When the link is deleted, linked node delete
82
+ * @param {LinkObject} link
83
+ */
84
+ removeAll: (link: LinkObject) => void;
85
+ /**
86
+ * Remove link in canvas
87
+ * @param {LinkObject} link
88
+ * @param {string} [type]
89
+ */
90
+ remove: (link: LinkObject, type?: string) => void;
91
+ /**
92
+ * Check if there is a port connected
93
+ * @param {PortObject} port
94
+ * @returns
95
+ */
96
+ isConnected: (port: PortObject) => boolean;
97
+ /**
98
+ * Check if select same node
99
+ * @param {PortObject} port
100
+ * @returns
101
+ */
102
+ isSameNode: (port: PortObject) => boolean;
103
+ /**
104
+ * Check if select same node
105
+ * @param {PortObject} port
106
+ * @returns
107
+ */
108
+ isDuplicate: (port: PortObject) => boolean;
109
+ /**
110
+ * Check if draw the link
111
+ * @returns
112
+ */
113
+ isDrawing: () => any;
114
+ }
115
+ export default LinkHandler;
@@ -0,0 +1,247 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const warning_1 = __importDefault(require("warning"));
7
+ const objects_1 = require("../objects");
8
+ /**
9
+ * Link Handler Class
10
+ * @author salgum1114
11
+ * @class LinkHandler
12
+ */
13
+ class LinkHandler {
14
+ constructor(handler) {
15
+ this.port = null;
16
+ /**
17
+ * On source port click, start link
18
+ * @param {PortObject} port
19
+ */
20
+ this.init = (port) => {
21
+ if (this.isDrawing()) {
22
+ return;
23
+ }
24
+ if (this.isConnected(port)) {
25
+ return;
26
+ }
27
+ this.port = port;
28
+ this.port.set({
29
+ fill: port.selectFill,
30
+ });
31
+ this.handler.interactionHandler.linking();
32
+ const { left, top, nodeId, id } = port;
33
+ const fromPort = { left, top, id };
34
+ const toPort = { left, top };
35
+ const fromNode = this.handler.objectMap[nodeId];
36
+ this.handler.activeLine = new objects_1.CurvedLink(fromNode, fromPort, null, toPort, {
37
+ strokeWidth: 4,
38
+ fill: '#999999',
39
+ stroke: '#999999',
40
+ class: 'line',
41
+ originX: 'center',
42
+ originY: 'center',
43
+ selectable: false,
44
+ hasBorders: false,
45
+ hasControls: false,
46
+ evented: false,
47
+ });
48
+ this.handler.canvas.add(this.handler.activeLine);
49
+ };
50
+ /**
51
+ * End drawing link.
52
+ */
53
+ this.finish = (link) => {
54
+ if (!link) {
55
+ this.port.set({
56
+ fill: this.port.originFill,
57
+ });
58
+ }
59
+ this.handler.interactionHandler.selection();
60
+ this.handler.canvas.remove(this.handler.activeLine);
61
+ this.handler.activeLine = null;
62
+ this.handler.canvas.renderAll();
63
+ };
64
+ /**
65
+ * On dest port click, finish link
66
+ * @param {PortObject} port
67
+ */
68
+ this.generate = (port) => {
69
+ if (!port) {
70
+ warning_1.default(!port, 'Does not exist target port.');
71
+ return;
72
+ }
73
+ if (this.isDuplicate(port)) {
74
+ return;
75
+ }
76
+ if (this.isSameNode(port)) {
77
+ return;
78
+ }
79
+ const link = {
80
+ type: 'curvedLink',
81
+ fromNodeId: this.handler.activeLine.fromNode.id,
82
+ fromPortId: this.handler.activeLine.fromPort.id,
83
+ toNodeId: port.nodeId,
84
+ toPortId: port.id,
85
+ };
86
+ const createdLink = this.create(link);
87
+ this.finish(createdLink);
88
+ // TODO...
89
+ // Save transactions unconditionally
90
+ if (!this.handler.transactionHandler.active) {
91
+ this.handler.transactionHandler.save('add');
92
+ }
93
+ };
94
+ /**
95
+ * Add link in Canvas
96
+ * @param {LinkOption} link
97
+ * @param {boolean} [loaded=false]
98
+ * @returns
99
+ */
100
+ this.create = (link, loaded = false) => {
101
+ const fromNode = this.handler.objectMap[link.fromNodeId];
102
+ const fromPort = fromNode.fromPort.filter(port => port.id === link.fromPortId || !port.id)[0];
103
+ const toNode = this.handler.objectMap[link.toNodeId];
104
+ const { toPort } = toNode;
105
+ const createdObj = this.handler.fabricObjects[link.type].create(fromNode, fromPort, toNode, toPort, {
106
+ ...link,
107
+ });
108
+ this.handler.canvas.add(createdObj);
109
+ this.handler.objects = this.handler.getObjects();
110
+ const { editable } = this.handler;
111
+ if (this.handler.onAdd && editable && !loaded) {
112
+ this.handler.onAdd(createdObj);
113
+ }
114
+ this.handler.canvas.renderAll();
115
+ createdObj.setPort(fromNode, fromPort, toNode, toPort);
116
+ this.handler.portHandler.setCoords(fromNode);
117
+ this.handler.portHandler.setCoords(toNode);
118
+ this.handler.canvas.requestRenderAll();
119
+ return createdObj;
120
+ };
121
+ /**
122
+ * Set coordinate of link
123
+ * @param {number} x1
124
+ * @param {number} y1
125
+ * @param {number} x2
126
+ * @param {number} y2
127
+ * @param {LinkObject} link
128
+ */
129
+ this.setCoords = (x1, y1, x2, y2, link) => {
130
+ link.set({
131
+ x1,
132
+ y1,
133
+ x2,
134
+ y2,
135
+ });
136
+ link.setCoords();
137
+ };
138
+ /**
139
+ * When the link is deleted, linked FromNode delete
140
+ * @param {LinkObject} link
141
+ */
142
+ this.removeFrom = (link) => {
143
+ if (link.fromPort) {
144
+ let index = -1;
145
+ if (link.fromPort.links.length) {
146
+ link.fromPort.links.some((portLink, i) => {
147
+ if (link.id === portLink.id) {
148
+ index = i;
149
+ return true;
150
+ }
151
+ return false;
152
+ });
153
+ if (index > -1) {
154
+ link.fromPort.links.splice(index, 1);
155
+ }
156
+ }
157
+ link.setPortEnabled(link.fromNode, link.fromPort, true);
158
+ }
159
+ };
160
+ /**
161
+ * When the link is deleted, linked ToNode delete
162
+ * @param {LinkObject} link
163
+ */
164
+ this.removeTo = (link) => {
165
+ if (link.toNode.toPort.links.length) {
166
+ let index = -1;
167
+ link.toNode.toPort.links.some((portLink, i) => {
168
+ if (link.id === portLink.id) {
169
+ index = i;
170
+ return true;
171
+ }
172
+ return false;
173
+ });
174
+ if (index > -1) {
175
+ link.toNode.toPort.links.splice(index, 1);
176
+ }
177
+ link.setPortEnabled(link.toNode, link.toNode.toPort, true);
178
+ }
179
+ };
180
+ /**
181
+ * When the link is deleted, linked node delete
182
+ * @param {LinkObject} link
183
+ */
184
+ this.removeAll = (link) => {
185
+ this.removeFrom(link);
186
+ this.removeTo(link);
187
+ };
188
+ /**
189
+ * Remove link in canvas
190
+ * @param {LinkObject} link
191
+ * @param {string} [type]
192
+ */
193
+ this.remove = (link, type) => {
194
+ if (type === 'from') {
195
+ this.removeFrom(link);
196
+ }
197
+ else if (type === 'to') {
198
+ this.removeTo(link);
199
+ }
200
+ else {
201
+ this.removeAll(link);
202
+ }
203
+ this.handler.canvas.remove(link);
204
+ this.handler.objects = this.handler.getObjects();
205
+ };
206
+ /**
207
+ * Check if there is a port connected
208
+ * @param {PortObject} port
209
+ * @returns
210
+ */
211
+ this.isConnected = (port) => {
212
+ warning_1.default(port.enabled, 'A connected node already exists.');
213
+ return !port.enabled;
214
+ };
215
+ /**
216
+ * Check if select same node
217
+ * @param {PortObject} port
218
+ * @returns
219
+ */
220
+ this.isSameNode = (port) => {
221
+ const validate = port.nodeId === this.handler.activeLine.fromNode.id;
222
+ warning_1.default(!validate, 'Cannot select the same node.');
223
+ return validate;
224
+ };
225
+ /**
226
+ * Check if select same node
227
+ * @param {PortObject} port
228
+ * @returns
229
+ */
230
+ this.isDuplicate = (port) => {
231
+ const validate = port.links.some(link => link.fromNode.id === this.handler.activeLine.fromNode.id);
232
+ warning_1.default(!validate, 'Duplicate connections cannot be made.');
233
+ return validate;
234
+ };
235
+ /**
236
+ * Check if draw the link
237
+ * @returns
238
+ */
239
+ this.isDrawing = () => {
240
+ const validate = this.handler.interactionMode === 'link' && this.handler.activeLine;
241
+ warning_1.default(!validate, 'Already drawing links.');
242
+ return validate;
243
+ };
244
+ this.handler = handler;
245
+ }
246
+ }
247
+ exports.default = LinkHandler;
@@ -0,0 +1,50 @@
1
+ import Handler from './Handler';
2
+ import { FabricObject } from '../utils';
3
+ import { NodeObject } from '../objects/Node';
4
+ declare class NodeHandler {
5
+ handler: Handler;
6
+ constructor(handler: Handler);
7
+ /**
8
+ * Get the node path by target object
9
+ * @param {NodeObject} target
10
+ * @param {NodeObject[]} [nodes=[]]
11
+ * @param {string} [direction='init']
12
+ */
13
+ getNodePath: (target: NodeObject, nodes?: NodeObject[], direction?: string) => void;
14
+ /**
15
+ * Select the node path
16
+ * @param {string[]} [path]
17
+ */
18
+ selectByPath: (path?: string[]) => void;
19
+ /**
20
+ * Select node by id
21
+ * @param {string} id
22
+ */
23
+ selectById: (id: string) => void;
24
+ /**
25
+ * Deselect nodes
26
+ */
27
+ deselect: () => void;
28
+ /**
29
+ * Highlight node path
30
+ * @param {string[]} [path]
31
+ */
32
+ highlightingByPath: (path?: string[]) => void;
33
+ /**
34
+ * Highlight link
35
+ * @param {FabricObject} object
36
+ * @param {FabricObject} targetObject
37
+ * @param {number} [duration=500]
38
+ */
39
+ highlightingLink: (object: FabricObject, targetObject: FabricObject, duration?: number) => void;
40
+ /**
41
+ * Highlight node
42
+ *
43
+ * @param {*} object
44
+ * @param {number} [duration=500]
45
+ * @param {number} [minBlur=0]
46
+ * @param {number} [maxBlur=50]
47
+ */
48
+ highlightingNode: (object: any, duration?: number, minBlur?: number, maxBlur?: number) => void;
49
+ }
50
+ export default NodeHandler;