Image cache node

This commit is contained in:
space-nuko
2023-05-05 20:22:12 -05:00
parent 7ddda80cf6
commit ad35826c7b
17 changed files with 358 additions and 33 deletions

View File

@@ -34,6 +34,7 @@ export type Attributes = {
classes: string,
blockVariant?: "block" | "hidden",
hidden?: boolean,
disabled?: boolean,
flexGrow?: number
}
@@ -45,6 +46,7 @@ export type AttributesSpec = {
values?: string[],
hidden?: boolean,
validNodeTypes?: string[],
serialize?: (arg: any) => string,
deserialize?: (arg: string) => any,
@@ -73,6 +75,12 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
location: "widget",
editable: true
},
{
name: "disabled",
type: "boolean",
location: "widget",
editable: true
},
{
name: "direction",
type: "enum",
@@ -104,6 +112,7 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
{
categoryName: "behavior",
specs: [
// Node variables
{
name: "tags",
type: "string",
@@ -116,24 +125,40 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
return arg.split(",").map(s => s.trim())
}
},
// Range
{
name: "min",
type: "number",
location: "nodeProps",
editable: true,
validNodeTypes: ["ui/slider"],
},
{
name: "max",
type: "number",
location: "nodeProps",
editable: true
editable: true,
validNodeTypes: ["ui/slider"],
},
{
name: "step",
type: "number",
location: "nodeProps",
editable: true,
validNodeTypes: ["ui/slider"],
},
// Button
{
name: "message",
type: "string",
location: "nodeProps",
editable: true,
validNodeTypes: ["ui/button"],
},
// Workflow
{
name: "defaultWorkflow",
type: "string",
@@ -531,8 +556,6 @@ function deserialize(data: SerializedLayoutState, graph: LGraph) {
attrsChanged: writable(false)
};
dragItem.attrs.flexGrow = 100;
const dragEntry: DragItemEntry = {
dragItem,
children: [],