@elicdavis/node-flow 0.1.10 → 0.1.11

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@elicdavis/node-flow",
3
3
  "description": "build node graphs",
4
4
  "author": "Eli C Davis",
5
- "version": "0.1.10",
5
+ "version": "0.1.11",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "nodes",
package/src/index.ts CHANGED
@@ -14,12 +14,14 @@ export { FlowNote };
14
14
  import { NumberWidget } from './widgets/number';
15
15
  import { ColorWidget } from './widgets/color';
16
16
  import { StringWidget } from './widgets/string';
17
+ import { TextWidget } from './widgets/text';
17
18
  import { ButtonWidget } from './widgets/button';
18
19
  import { ToggleWidget } from './widgets/toggle';
19
20
  import { SliderWidget } from './widgets/slider';
20
21
  import { ImageWidget } from './widgets/image';
21
22
  export {
22
- NumberWidget, ColorWidget, StringWidget, ButtonWidget, ToggleWidget, SliderWidget, ImageWidget
23
+ NumberWidget, ColorWidget, StringWidget, TextWidget,
24
+ ButtonWidget, ToggleWidget, SliderWidget, ImageWidget
23
25
  };
24
26
 
25
27
  import { GlobalWidgetFactory } from './widgets/factory';
package/src/node.ts CHANGED
@@ -856,6 +856,14 @@ export class FlowNode {
856
856
  this.#widgets.push(widget);
857
857
  }
858
858
 
859
+ removeWidget(widget: Widget): void {
860
+ const index = this.#widgets.indexOf(widget, 0);
861
+ if (index === -1) {
862
+ throw new Error("node does not contain widget");
863
+ }
864
+ this.#widgets.splice(index, 1);
865
+ }
866
+
859
867
  getWidget(index: number): Widget {
860
868
  return this.#widgets[index];
861
869
  }