@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/dist/index.d.mts
CHANGED
|
@@ -653,6 +653,7 @@ declare class NodeFlowGraph {
|
|
|
653
653
|
connectedInputsNodeReferences(nodeIndex: number): Array<FlowNode>;
|
|
654
654
|
connectedOutputsNodeReferences(nodeIndex: number): Array<FlowNode>;
|
|
655
655
|
connectNodes(nodeOut: FlowNode, outPort: number, nodeIn: FlowNode, inPort: number): Connection | undefined;
|
|
656
|
+
clearNodeInputConnection(node: FlowNode, index: number): void;
|
|
656
657
|
addNode(node: FlowNode): void;
|
|
657
658
|
removeNode(node: FlowNode): void;
|
|
658
659
|
addNote(note: FlowNote): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -653,6 +653,7 @@ declare class NodeFlowGraph {
|
|
|
653
653
|
connectedInputsNodeReferences(nodeIndex: number): Array<FlowNode>;
|
|
654
654
|
connectedOutputsNodeReferences(nodeIndex: number): Array<FlowNode>;
|
|
655
655
|
connectNodes(nodeOut: FlowNode, outPort: number, nodeIn: FlowNode, inPort: number): Connection | undefined;
|
|
656
|
+
clearNodeInputConnection(node: FlowNode, index: number): void;
|
|
656
657
|
addNode(node: FlowNode): void;
|
|
657
658
|
removeNode(node: FlowNode): void;
|
|
658
659
|
addNote(note: FlowNote): void;
|
package/dist/index.js
CHANGED
|
@@ -6928,12 +6928,25 @@ var NodeFlowGraph = class {
|
|
|
6928
6928
|
this.#pasteCallbacks.forEach((callback) => callback(position));
|
|
6929
6929
|
}
|
|
6930
6930
|
#deleteKey(e) {
|
|
6931
|
-
return e.code === "Delete" || e.
|
|
6931
|
+
return e.code === "Delete" || e.key === "Delete";
|
|
6932
6932
|
}
|
|
6933
6933
|
#keyDown(e) {
|
|
6934
6934
|
if (document.activeElement) {
|
|
6935
6935
|
if (["INPUT", "TEXTAREA"].includes(document.activeElement.tagName)) return;
|
|
6936
6936
|
}
|
|
6937
|
+
if (this.#openQuickMenu) {
|
|
6938
|
+
if (e.code === "Escape") {
|
|
6939
|
+
this.#openQuickMenu = null;
|
|
6940
|
+
return;
|
|
6941
|
+
}
|
|
6942
|
+
if (e.code === "Enter") {
|
|
6943
|
+
this.#openQuickMenu.Menu.execute();
|
|
6944
|
+
this.#openQuickMenu = null;
|
|
6945
|
+
return;
|
|
6946
|
+
}
|
|
6947
|
+
this.#openQuickMenu.Menu.keyboardEvent(e);
|
|
6948
|
+
return;
|
|
6949
|
+
}
|
|
6937
6950
|
if (this.#deleteKey(e)) {
|
|
6938
6951
|
if (this.#mainNodeSubsystem.getSelectedNodes().length > 0) {
|
|
6939
6952
|
e.preventDefault();
|
|
@@ -6958,19 +6971,6 @@ var NodeFlowGraph = class {
|
|
|
6958
6971
|
return;
|
|
6959
6972
|
}
|
|
6960
6973
|
}
|
|
6961
|
-
if (this.#openQuickMenu) {
|
|
6962
|
-
if (e.code === "Escape") {
|
|
6963
|
-
this.#openQuickMenu = null;
|
|
6964
|
-
return;
|
|
6965
|
-
}
|
|
6966
|
-
if (e.code === "Enter") {
|
|
6967
|
-
this.#openQuickMenu.Menu.execute();
|
|
6968
|
-
this.#openQuickMenu = null;
|
|
6969
|
-
return;
|
|
6970
|
-
}
|
|
6971
|
-
this.#openQuickMenu.Menu.keyboardEvent(e);
|
|
6972
|
-
return;
|
|
6973
|
-
}
|
|
6974
6974
|
const spacePressed = e.key == " " || e.code == "Space";
|
|
6975
6975
|
if (!spacePressed) {
|
|
6976
6976
|
return;
|
|
@@ -7169,6 +7169,9 @@ var NodeFlowGraph = class {
|
|
|
7169
7169
|
connectNodes(nodeOut, outPort, nodeIn, inPort) {
|
|
7170
7170
|
return this.#mainNodeSubsystem.connectNodes(nodeOut, outPort, nodeIn, inPort);
|
|
7171
7171
|
}
|
|
7172
|
+
clearNodeInputConnection(node, index) {
|
|
7173
|
+
this.#mainNodeSubsystem.clearNodeInputConnection(node, index);
|
|
7174
|
+
}
|
|
7172
7175
|
addNode(node) {
|
|
7173
7176
|
this.#mainNodeSubsystem.addNode(node);
|
|
7174
7177
|
}
|