@elicdavis/node-flow 0.1.19 → 0.1.20
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.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/node.ts +2 -10
- package/src/nodes/subsystem.ts +10 -0
- package/src/widgets/number.ts +1 -1
- package/src/widgets/slider.ts +1 -1
- package/test/hover_after_removal.test.ts +72 -0
- package/test/property_binding.test.ts +49 -0
package/dist/index.js
CHANGED
|
@@ -2080,7 +2080,7 @@ var NumberWidget = class {
|
|
|
2080
2080
|
return { "x": width, "y": height };
|
|
2081
2081
|
}
|
|
2082
2082
|
Set(newNumber) {
|
|
2083
|
-
if (this.#value
|
|
2083
|
+
if (Object.is(this.#value, newNumber)) {
|
|
2084
2084
|
return;
|
|
2085
2085
|
}
|
|
2086
2086
|
this.#value = newNumber;
|
|
@@ -2368,7 +2368,7 @@ var SliderWidget = class {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
SetValue(newValue) {
|
|
2370
2370
|
const cleanedValue = Clamp(newValue, this.#min, this.#max);
|
|
2371
|
-
if (this.#value
|
|
2371
|
+
if (Object.is(this.#value, cleanedValue)) {
|
|
2372
2372
|
return;
|
|
2373
2373
|
}
|
|
2374
2374
|
this.#value = cleanedValue;
|
|
@@ -3967,6 +3967,14 @@ var NodeSubsystem2 = class {
|
|
|
3967
3967
|
this.#removeNodeConnections(nodeIndex);
|
|
3968
3968
|
const node = this.#nodes[nodeIndex];
|
|
3969
3969
|
this.#nodes.splice(nodeIndex, 1);
|
|
3970
|
+
if (this.#nodeHovering === nodeIndex) {
|
|
3971
|
+
this.#nodeHovering = -1;
|
|
3972
|
+
} else if (this.#nodeHovering > nodeIndex) {
|
|
3973
|
+
this.#nodeHovering--;
|
|
3974
|
+
}
|
|
3975
|
+
if (this.#portHovering?.Node === node) {
|
|
3976
|
+
this.#portHovering = null;
|
|
3977
|
+
}
|
|
3970
3978
|
requestRender();
|
|
3971
3979
|
for (let i = 0; i < this.#nodeRemovedCallbacks.length; i++) {
|
|
3972
3980
|
this.#nodeRemovedCallbacks[i](node);
|
|
@@ -4552,7 +4560,7 @@ var FlowNode = class {
|
|
|
4552
4560
|
}
|
|
4553
4561
|
setProperty(name, value) {
|
|
4554
4562
|
const oldValue = this.#data[name];
|
|
4555
|
-
if (oldValue
|
|
4563
|
+
if (Object.is(oldValue, value)) {
|
|
4556
4564
|
return;
|
|
4557
4565
|
}
|
|
4558
4566
|
this.#data[name] = value;
|
|
@@ -5005,10 +5013,6 @@ var FlowNode = class {
|
|
|
5005
5013
|
return this.#title.get();
|
|
5006
5014
|
}
|
|
5007
5015
|
setTitle(newTitle) {
|
|
5008
|
-
if (!this.#canEditTitle) {
|
|
5009
|
-
console.warn("setTitle instruction ignored, as node has been marked un-editable");
|
|
5010
|
-
return;
|
|
5011
|
-
}
|
|
5012
5016
|
let cleaned = newTitle;
|
|
5013
5017
|
if (cleaned === null || cleaned === void 0) {
|
|
5014
5018
|
cleaned = "";
|
|
@@ -5025,9 +5029,6 @@ var FlowNode = class {
|
|
|
5025
5029
|
}
|
|
5026
5030
|
}
|
|
5027
5031
|
setInfo(newInfo) {
|
|
5028
|
-
if (!this.#canEditInfo) {
|
|
5029
|
-
console.warn("setInfo instruction ignored, as node has been marked un-editable");
|
|
5030
|
-
}
|
|
5031
5032
|
let cleaned = newInfo;
|
|
5032
5033
|
if (cleaned === null || cleaned === void 0) {
|
|
5033
5034
|
cleaned = "";
|