@elicdavis/node-flow 0.1.10 → 0.1.12
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/README.md +10 -0
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -0
- package/dist/index.mjs.map +1 -1
- package/dist/web/NodeFlow.js +8 -0
- package/dist/web/NodeFlow.js.map +7 -0
- package/package.json +1 -1
- package/src/graph.ts +12 -0
- package/src/index.ts +14 -3
- package/src/node.ts +8 -0
- package/src/notes/subsystem.ts +17 -0
- package/src/utils/string.ts +3 -3
package/dist/index.mjs
CHANGED
|
@@ -4383,6 +4383,13 @@ var FlowNode = class {
|
|
|
4383
4383
|
addWidget(widget) {
|
|
4384
4384
|
__privateGet(this, _widgets).push(widget);
|
|
4385
4385
|
}
|
|
4386
|
+
removeWidget(widget) {
|
|
4387
|
+
const index = __privateGet(this, _widgets).indexOf(widget, 0);
|
|
4388
|
+
if (index === -1) {
|
|
4389
|
+
throw new Error("node does not contain widget");
|
|
4390
|
+
}
|
|
4391
|
+
__privateGet(this, _widgets).splice(index, 1);
|
|
4392
|
+
}
|
|
4386
4393
|
getWidget(index) {
|
|
4387
4394
|
return __privateGet(this, _widgets)[index];
|
|
4388
4395
|
}
|
|
@@ -5717,6 +5724,9 @@ var NoteSubsystem = class {
|
|
|
5717
5724
|
__privateGet(this, _onNoteAddedCallbacks)[i](note);
|
|
5718
5725
|
}
|
|
5719
5726
|
}
|
|
5727
|
+
getNotes() {
|
|
5728
|
+
return __privateGet(this, _notes);
|
|
5729
|
+
}
|
|
5720
5730
|
addNoteAddedListener(callback) {
|
|
5721
5731
|
if (callback === null || callback === void 0) {
|
|
5722
5732
|
return;
|
|
@@ -5840,6 +5850,17 @@ var NoteSubsystem = class {
|
|
|
5840
5850
|
console.error("no note found to remove");
|
|
5841
5851
|
}
|
|
5842
5852
|
}
|
|
5853
|
+
removeAllNotes() {
|
|
5854
|
+
const notes = __privateGet(this, _notes);
|
|
5855
|
+
__privateSet(this, _notes, []);
|
|
5856
|
+
__privateSet(this, _noteHovering, null);
|
|
5857
|
+
__privateSet(this, _noteSelected, null);
|
|
5858
|
+
for (let i = 0; i < notes.length; i++) {
|
|
5859
|
+
for (let j = 0; j < __privateGet(this, _onNoteRemovedCallbacks).length; j++) {
|
|
5860
|
+
__privateGet(this, _onNoteRemovedCallbacks)[j](notes[i]);
|
|
5861
|
+
}
|
|
5862
|
+
}
|
|
5863
|
+
}
|
|
5843
5864
|
render(ctx, camera, mousePosition) {
|
|
5844
5865
|
__privateSet(this, _noteHovering, null);
|
|
5845
5866
|
__privateSet(this, _hoveringHandle, 0 /* None */);
|
|
@@ -6434,6 +6455,15 @@ var NodeFlowGraph = class {
|
|
|
6434
6455
|
addNote(note) {
|
|
6435
6456
|
__privateGet(this, _mainNoteSubsystem).addNote(note);
|
|
6436
6457
|
}
|
|
6458
|
+
removeNote(note) {
|
|
6459
|
+
__privateGet(this, _mainNoteSubsystem).removeNote(note);
|
|
6460
|
+
}
|
|
6461
|
+
removeAllNotes() {
|
|
6462
|
+
__privateGet(this, _mainNoteSubsystem).removeAllNotes();
|
|
6463
|
+
}
|
|
6464
|
+
getNotes() {
|
|
6465
|
+
return __privateGet(this, _mainNoteSubsystem).getNotes();
|
|
6466
|
+
}
|
|
6437
6467
|
addOnNodeCreatedListener(callback) {
|
|
6438
6468
|
__privateGet(this, _mainNodeSubsystem).addOnNodeCreatedListener(callback);
|
|
6439
6469
|
}
|
|
@@ -6599,6 +6629,7 @@ export {
|
|
|
6599
6629
|
Publisher,
|
|
6600
6630
|
SliderWidget,
|
|
6601
6631
|
StringWidget,
|
|
6632
|
+
TextWidget,
|
|
6602
6633
|
Theme,
|
|
6603
6634
|
ToggleWidget
|
|
6604
6635
|
};
|