Emits an event when attempting to delete items with nothing selected.
Event is generic and should also be used to report any other
user-initiated actions.
Emitted from LGraphCanvas.canvas
- bubbles
- non-cancellable
```
litegraph:no-items-selected
```
- Disables both buttons when there are less than 2 options
- Enables both buttons when combo list values contains error (identical
first and last items).
- Adds deprecation console warning when widget values are passed as a
function
- Fix buttons always dimmed when using legacy values-as-function
- Resolves#984
Sends the `pointermove` event that triggered `onDragStart` with the
callback.
It is possible for no `pointermove` events to occur, but still be far
from the original `pointerdown` event. In this case, `eMove` will be
`undefined`, and `onDragEnd` will be called immediately after
`onDragStart`.
- `LLink.resolve`: Resolves all IDs on the link to their respective
objects (node IDs, slot indexes)
- `LinkNetwork.getLink`: a more concise pattern to resolve links
### Virtual helper "slots"
Adds a virtual input and output slot to native reroutes, allowing links
to be dragged from them to other reroutes or nodes.
https://github.com/user-attachments/assets/67d308c4-4732-4b04-a2b9-0a2b0c79b413
### Notes
- Reroute slots automatically show an outline as the pointer gets close
- When the slot is clickable, it will highlight in the same colour as
the reroute
- Enables opposite direction connecting: from reroute to node outputs
- Floating reroutes only show one slot - to whichever side is not
connected
Adds a global API to notify devs / users of deprecated features.
- Custom callbacks may be added
- By default, remembers message text and only sends each message once
- Sends to console.warn by default
```ts
// Add a custom notification when a warning is encountered
const warnMessage = (message: string, source?: object) => {
addToast({ message, detail: object })
}
LiteGraph.onDeprecationWarning.push(warnMessage)
```
```ts
// Debugging flag. Repeats deprecation warnings every time they are reported.
// May impact performance.
LiteGraph.alwaysRepeatWarnings = true
```
Generate a warning
```ts
import { warnDeprecated } from "@/utils/feedback"
warnDeprecated(
"[DEPRECATED] graph.oldFeature() will be removed from Litegraph. " +
"Please use graph.newFeature() instead. https://helpful.site/faq",
objectThatCausedThis
)
```
Restores the full left-arrow button click area for widgets. Previously
lost ~5 canvas pixels to clicks intercepted by input sockets.
Supporting refactors:
- Maps concrete node slot impls. to private array, once per frame
- Converts slot boundingRect to use absolute canvas pos (same as other
elements)
- Stores parent node ref in concrete slot classes
### Node resize overhaul
- Precisely calculates node minimum size
- Prevents input & output overlap
- Prevents (normal*) widgets from rendering text over the edge of nodes
- Performance impact was sub-millisecond for normal usage in a 500-node
graph

_Minimum size for a few example node configurations_
### Widgets
- Converts hard-coded draw render values to class static properties
- Adds widget button draw function for left/right arrow widgets
_*_ Exception: `control_after_generate`, as it is not a true input /
widget. A check may be added later to handle this special case.
- `draw` is now skipped for slots that should not be shown (prev. drawn
with 0 alpha)
- Fixes slot always rendered when widget not found in `node.widgets`
- Remove redundant check from `isWidgetInputSlot` - type is already
`INodeInputSlot`
- Converts type assertions to use inference via discriminated unions
- Removes the LayoutElement class (only used by node slots, and recently
reduced to a single function)
- Splits `boundingRect` property out from `Positionable` interface
- Slots now use the standard `boundingRect` property
- Perf improvements / Removes redundant code
The current impls. do not work as intended; they will only assign the
additional info properties if there are at least three items in the
input array.
Adding replacements would be trivial, if required, and would benefit by
not inheriting the current public interface.
Confirmed unused via code search.