### Reroute snap highlight
When connecting links, a simple border now helps to indicate that a
connecting link can be dropped on a reroute below the pointer.
### Reroute ID badges
Optionally, intended for debugging purposes, drawing of ID badges can
also be manually enabled via console.
- Fixes TS types
- Various bug fixes for reroute / link (re)connect
- Adds reroute snap circle when connecting links
- Validates reroutes on drop (part of larger work)
- Prevent nodes linking to themselves
### Floating reroutes
Native reroutes can now be kept in a disconnected state.
Link chains may be kept provided they are connected to _either_ an input
or an output. By design, reroutes will be automatically removed if both
sides are disconnected.
- Enables floating reroutes
- Allows rendering logic for a chain of reroutes to be called without a
real `LLink` connected to an input
- Deprecates unused `visible_links` array
- Removes null widget skip - this _should_ throw
- Removes widget locator that was on LGraphCanvas - canvas should not
functions that find things in graph space.
Workaround originally implemented when converting to ES modules, but is
now redundant.
`DEFAULT_EVENT_LINK_COLOR` confirmed unused in code search (litegraph
events).
### LinkConnector
Replaces the minimal-change effort of `connecting_links` with a more
reliable implementation.
- Subscribable, event-based API
- Uses browser-standard `e.preventDefault()` to cancel `before-*` events
- Uses standard `state` POJO - can be proxied without issue
- Structures code and separates concerns out of `LGraphCanvas`
- Link creation calls can now be made from anywhere, without the need
for a rewrite
- New canvas sub-components now live in `src/canvas/`
### Rendering
- Skips link segments by setting a `_dragging` bool flag on the LLink or
Reroute
- Moves some previously nested code to event listeners, configured in
the `LGraphCanvas` constructor
### Deprecation
`LGraphCanvas.connecting_links` is now deprecated and will later be
removed.
Until it is removed, to prevent breaking extensions it will continue to
be set and cleared by a legacy callback. The contents of this property
are ignored; code search revealed no exentsions actually modifying the
array.
- Returns object with slot, index, and pos
- Locate-by-type returns object with slot & index
- Uses standard `undefined` return for concise chaining & validation
- Free 10x perf increase over getConnectionPos (used basic random data
to test, out of curiosity)
Fixes regression added in TS strict conversion. A fallback to `null`
added to match the TS type, however value being stored was actually
uncaught use of `undefined`.
`null` !== `undefined` -> redraw every frame the pointer moves
### Current
- Connections are disconnected the moment a link starts being dragged
- Reseating a connection where it came from creates a new connection
- If the process is somehow interrupted, the links are already gone
### Proposed
- Connection is disconnected after a new connection is made
- Rendering is bypassed for the link segment being moved
- Does nothing if dropping a link exactly where it came from
- Adds early return when trying to connect a node to itself
- Removes unused context menu for optional in/outputs
- At the top of the node context menu, greyed out `Inputs` and `Outputs`
- API does not fit with current design
- If required, rewrite would be simpler
- Adds remaining TS nullable types
- Adds type guards to allow strict mode
- Uses explicit throw in places that would throw regardless
- Adds ts-ignore that must be removed later
* [ ] #578