@elicdavis/node-flow 0.1.18 → 0.1.19
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/graph.ts +22 -17
package/package.json
CHANGED
package/src/graph.ts
CHANGED
|
@@ -292,7 +292,7 @@ export class NodeFlowGraph {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
#deleteKey(e: KeyboardEvent): boolean {
|
|
295
|
-
return e.code === "Delete" || e.
|
|
295
|
+
return e.code === "Delete" || e.key === "Delete";
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
#keyDown(e: KeyboardEvent): void {
|
|
@@ -300,6 +300,23 @@ export class NodeFlowGraph {
|
|
|
300
300
|
if (["INPUT", "TEXTAREA"].includes(document.activeElement.tagName)) return;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
+
// Open menus eat input
|
|
304
|
+
if (this.#openQuickMenu) {
|
|
305
|
+
if (e.code === "Escape") {
|
|
306
|
+
this.#openQuickMenu = null;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (e.code === "Enter") {
|
|
311
|
+
this.#openQuickMenu.Menu.execute();
|
|
312
|
+
this.#openQuickMenu = null;
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
this.#openQuickMenu.Menu.keyboardEvent(e);
|
|
317
|
+
return
|
|
318
|
+
}
|
|
319
|
+
|
|
303
320
|
if (this.#deleteKey(e)) {
|
|
304
321
|
if (this.#mainNodeSubsystem.getSelectedNodes().length > 0) {
|
|
305
322
|
e.preventDefault();
|
|
@@ -331,22 +348,6 @@ export class NodeFlowGraph {
|
|
|
331
348
|
}
|
|
332
349
|
}
|
|
333
350
|
|
|
334
|
-
if (this.#openQuickMenu) {
|
|
335
|
-
if (e.code === "Escape") {
|
|
336
|
-
this.#openQuickMenu = null;
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
if (e.code === "Enter") {
|
|
341
|
-
this.#openQuickMenu.Menu.execute();
|
|
342
|
-
this.#openQuickMenu = null;
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
this.#openQuickMenu.Menu.keyboardEvent(e);
|
|
347
|
-
return
|
|
348
|
-
}
|
|
349
|
-
|
|
350
351
|
const spacePressed = e.key == " " || e.code == "Space";
|
|
351
352
|
if (!spacePressed) {
|
|
352
353
|
return;
|
|
@@ -595,6 +596,10 @@ export class NodeFlowGraph {
|
|
|
595
596
|
return this.#mainNodeSubsystem.connectNodes(nodeOut, outPort, nodeIn, inPort);
|
|
596
597
|
}
|
|
597
598
|
|
|
599
|
+
clearNodeInputConnection(node: FlowNode, index: number): void {
|
|
600
|
+
this.#mainNodeSubsystem.clearNodeInputConnection(node, index);
|
|
601
|
+
}
|
|
602
|
+
|
|
598
603
|
addNode(node: FlowNode): void {
|
|
599
604
|
this.#mainNodeSubsystem.addNode(node);
|
|
600
605
|
}
|