Account for upstream links when refreshing combo widgets
This commit is contained in:
44
src/lib/nodes/widgets/ComfyTextNode.ts
Normal file
44
src/lib/nodes/widgets/ComfyTextNode.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { BuiltInSlotType, LiteGraph, type SlotLayout } from "@litegraph-ts/core";
|
||||
|
||||
import TextWidget from "$lib/widgets/TextWidget.svelte";
|
||||
import ComfyWidgetNode, { type ComfyWidgetProperties } from "./ComfyWidgetNode";
|
||||
|
||||
export interface ComfyTextProperties extends ComfyWidgetProperties {
|
||||
multiline: boolean;
|
||||
}
|
||||
|
||||
export default class ComfyTextNode extends ComfyWidgetNode<string> {
|
||||
override properties: ComfyTextProperties = {
|
||||
tags: [],
|
||||
defaultValue: "",
|
||||
multiline: false
|
||||
}
|
||||
|
||||
static slotLayout: SlotLayout = {
|
||||
inputs: [
|
||||
{ name: "store", type: BuiltInSlotType.ACTION }
|
||||
],
|
||||
outputs: [
|
||||
{ name: "value", type: "string" },
|
||||
{ name: "changed", type: BuiltInSlotType.EVENT }
|
||||
]
|
||||
}
|
||||
|
||||
override svelteComponentType = TextWidget
|
||||
override defaultValue = "";
|
||||
|
||||
constructor(name?: string) {
|
||||
super(name, "")
|
||||
}
|
||||
|
||||
override parseValue(value: any): string {
|
||||
return `${value}`
|
||||
}
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType({
|
||||
class: ComfyTextNode,
|
||||
title: "UI.Text",
|
||||
desc: "Textbox outputting a string value",
|
||||
type: "ui/text"
|
||||
})
|
||||
Reference in New Issue
Block a user