mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 22:37:32 +00:00
Add LGraphNode.getExtraSlotMenuOptions hook (#522)
This commit is contained in:
@@ -7393,6 +7393,10 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
}
|
||||
if (!_slot.nameLocked)
|
||||
menu_info.push({ content: "Rename Slot", slot: slot })
|
||||
|
||||
if (node.getExtraSlotMenuOptions) {
|
||||
menu_info.push(...node.getExtraSlotMenuOptions(slot))
|
||||
}
|
||||
}
|
||||
// @ts-expect-error Slot type can be number and has number checks
|
||||
options.title = (slot.input ? slot.input.type : slot.output.type) || "*"
|
||||
|
||||
@@ -458,7 +458,15 @@ export class LGraphNode implements Positionable, IPinnable {
|
||||
canvasElement: HTMLCanvasElement,
|
||||
): void
|
||||
onMouseLeave?(this: LGraphNode, e: CanvasMouseEvent): void
|
||||
/**
|
||||
* Override the default slot menu options.
|
||||
*/
|
||||
getSlotMenuOptions?(this: LGraphNode, slot: IFoundSlot): IContextMenuValue[]
|
||||
/**
|
||||
* Add extra menu options to the slot context menu.
|
||||
*/
|
||||
getExtraSlotMenuOptions?(this: LGraphNode, slot: IFoundSlot): IContextMenuValue[]
|
||||
|
||||
// FIXME: Re-typing
|
||||
onDropItem?(this: LGraphNode, event: Event): boolean
|
||||
onDropData?(
|
||||
|
||||
Reference in New Issue
Block a user