- Follow-up on #817
### Unit tests
Adds tests for:
- LinkConnector
- LGraph
### Integration tests for LinkConnector
- Uses and configures a real graph + LGraph
- Avoids mocks
- User input is still mocked
- Performs actual tasks as would be called by LGraphCanvas
- A little verbose in places, but _many_ edge cases are caught by these
tests
- Splits link connect logic out of `LinkConnector` to individual
`RenderLink` classes
- Add support for connecting / reconnecting reroutes in various
configurations
- Adds support for moving existing floating links from outputs / inputs
- Fixes numerous corruption issues when reconnecting reroutes / moving
links
- Tests in separate PR #816
Resolves several issues with floating links. Highlights:
- Caches floating links on slots, removing some loop checks (inefficient
/ does not scale)
- Simpler APIs
- Adds `Reroute.totalLinks` (regular and floating
### 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
- Updates UUIDv4 generator
- Adds a unique id & revision support to graphs
- `revision` to be incremented downstream (e.g. on save)
- `id` automatically assigned if not provided
More intuitive UX when connecting reroutes to each other.
- Remove middle reroutes when connecting around them
- Fix earlier reroutes in chain lost when stitching
- Fix all reroutes removed when stitching in reverse
Previously, gap between slots was the same height as the slot itself.
Gap is now entirely removed, bringing it inline with the
previously-modified snap and link connection hit boxes.
### 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.
- Fixes root cause of minor in-memory-only corruption when deleting
reroutes from output slots
- Already automatically corrected via serialisation
- If `reroutes` or `links` are empty arrays, removes them from newer
object-based serialised output entirely
- Minor refactors
- Removes unused code
- Fixes some serialisation types
- Adds `ReadonlyLinkNetwork` interface
- 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