* Provide pointerup events to widget.mouse callback
* Fix regression in widget mouse cb
pointerup events are now sent to mouse() callback regardless of CanvasPointer state.
* Fix invalid callback prevents redraw
When widget.mouse() is incorrectly implemented (no return value), it evaluates as falsy and prevents canvas redraw.
Changes default behaviour to ignore the return value when nullish.
* Fix pointermove for custom widget outside nodes
Events are now also sent when the pointer moves outside the bounds of the node.
* Improve group resize UX
Removes the teleport of the group corner to the pointer, on the first move event.
* Select groups when clicking titles
* Add snap to grid for groups
* Apply new group resize UX to nodes
* Implement snap to grid
- Moves positioning logic to LGraph
- Simplifies code
- Adds Pointer API to alt-clone node
- Removes always_round_positions, replaced by always snap to grid (default size is 1 when always snapping)
Fix refator error
* Fix group items snapped without group
* Allow snapping of all items
- Add snapToGrid to Positionable
- Impl. on all types
- Deprecated: alignToGrid is now a wrapper
* Fix test import alias, update expectations
* Prevent desync of before / after change events
Adds ability to perform late binding of finally() during drag start.
* nit - Refactor
* Fix unwanted snap on node/group add
* nit - Doc
* Add shift key state tracking for snap to grid
Private impl., no state API as yet.
* Add snap guides rendering
Nodes, reroutes
* Optimisation - reroute rendering
Fixes exponential redraw
* Add snap guidelines for groups
* Add position rounding feature
Replaces previous impls. which only worked on some items, and were triggered when unexpected e.g. clicking a node that hadn't been moved.
Update test expectations
* Narrow TS types - readonly
* nit - Clean up, Doc
* nit - Clean up legacy accessors
Marks as deprecated
* Fix TS type - IContextMenuOptions.scale
* [Refactor] dist2 for use in pointer API
* Add CanvasPointer - API for pointer events
Add TS strict types
Add final click drag distance math
Add option to retain events
* nit - Rename
* nit
* Remove Subgraph - unused & not maintained
* Remove live_mode
Unused, not maintained.
* Update README
Remove live_mode reference
* Update delete selected - include reroutes & groups
* Bypass link menu if alt/shift pressed
* Remove old dragged_node interface
Incomplete impl. - unused.
Superceded by selectedItems
* Fix top/left edge of rectangles not in hitbox
* [Refactor] Match function names to interface names
* Add interface to find widgets by Point
LGraphNode.getWidgetOnPos
* Add widget search param - includeDisabled
* nit - Doc
* Rewrite canvas mouse handling
- Rewrites most pointer handling to use CanvasPointer callbacks
- All callbacks are declared ahead of time during the initial pointerdown event, logically grouped together
- Drastically simplifies the alteration or creation of new click / drag interactions
- Click events are all clicks, rather than some processed on mouse down, others on mouse up
- Functions return instead of setting and repeatedly checking multiple state vars
- Removes all lines that needed THIRTEEN tab indents
* Split middle click out from processMouseDown
* Use pointer API for link menus
* Narrow canvas event interfaces
* Fix canvas event types
Replaces original workarounds with final types
* Refactor - deprecated isInsideRectangle
* Add canvas hovering over state
- Centralises cursor set behaviour
- Provides simple downstream override
* nit
* [Refactor] Use measure functions
* Add double-click API to CanvasPointer
a
* nit - Doc
* Allow larger gap between double click events
* Rewrite double-click into CanvasPointer actions
* Improve double-click UX
Prefer down events over up events
* Add production defaults
* Add middle-click handling
* Remove debug code
* Remove redundant code
* Fix add reroute alt-click adds two undo steps
* Fix click on connected input disconnects
Old behaviour was to disconnect, then recreate a new link on drop.
* Add module export: CanvasPointer
* Add copy & paste of groups & reroutes
Complete rewrite of copy & paste
Fixes a bug where failure to clone a node would corrupt all subsequent nodes
No longer mutates nodes when copying
* Fix name collision
* Fix cannot copy specified nodes to clipboard
* Allow mapping of original IDs to pasted clones
* Add Reroute
- Initial Reroute implementation
- LLink and Reroute both implement the new LinkSegment interface
- LinkSegments can have a parentId, which always points to a Reroute
* Narrow TS type of schema v0.4 extras
* Add reroutes to schema 0.4
Use extras.reroutes to store additional data
* Add Reroute POC to LLink
* Add Reroute rendering
* Add Reroute context menu - Delete Reroute
* Update delete selected - include reroutes & groups
* Add Reroute select & move
* Include reroutes in area-select
* Move disconnect link logic to LLink
* Add Reroute connect
* nit
* Add Reroute support - connecting links
* Add Add Reroute from link menu (menu)
* nit
* Add shift-drag from reroute to add new link
* Prevent Reroutes from disappearing
Add keepReroutes option to prevent Reroute GC
* Add fourth param to connectInputToOutput
* Allow both connecting in/out to be null
* Move ConnectingLink start pos to Reroute
* Add link render options
* Refactor renderLink - spline / bezier
* Refactor renderLink - linear, straight
* Fix centre points on all link types
Improves link render time
* [Refactor] Generic recursive interface / flat set
* nit
* Allow Reroutes to be members of groups
* Start links from the closest reroute
For the "shift-click drag link from link" feature
* Add Reroutes using alt-click on link paths
* nit - Refactor
* nit - Refactor
* Fix reroute deselect UX
Temporary workaround
* Add Reroute link centre-marker handling
* Add optional link arrow markers
Add enum for link markers
-> Pointing the way forward ->
Set default centre marker to arrow
* Add module export: LinkMarkerShape
* Add link arrow direction for all link types
* Add Reroute auto-swivel with custom curves
* Add state switch to disable reroutes
Works at root of all canvas interactions, should leave existing reroutes untouched but invisible until e.g. links are edited / changed.
* Fix cannot deselect when reroutes disabled
* Include reroutes in select-all
* animateToNodes
- modify existing animation method to support passing multiple nodes, in which case the view is fit to the bounding box around them
* animateToBounds
* amend
* format
* amend
* nit
* Add LGraph state POCO
Moves last_link_id, last_node_id and creates same for group and reroute
fix import
* Add new serialisation to LGraph
Add LGraph schema 1
Remove reroute from old serialised graph
Remove brittle inherited types
Ensure stale links are not kept when clearing graph
* Add serialisable exports
* Ensure valid LGraph.state during deserialise
* Backport group header from frontend
* nit - TS types & redundant code
* Refactor - simplify group resize
* Fix group resize can be inverted
* Move group resize check to group class
* Add config for group padding & default colour
* nit - Remove redundant code
* Add multi-select all canvas items (groups, nodes)
* Add Feat: Group & Node Multi-Select / Nesting
- Groups can now contain groups
- Nested groups re-order on top of parent groups
- Groups can be added / removed from selection
- Uses new Positionable interface - easily extensible to new types
* Enhance add / remove from selection UX
More in line with normal desktop UX. Structured for keys to be customisable (if impl. later).
* Fix regression in link highlight
Legacy selection code still in use
* Allow nested groups to align perfectly on edges
* Remove group-move position rounding
Did not work under all circumstances, and resulted in misalignment more often than it helped.
* Add Positionable interface to canvas elements
* Add group resizeTo children
Refactor out duplicated code from Node
* Remove redundant "is_selected" check
* Improve measure pass - interface, caching
Node bounds once per render
Cached results
* Use cached bounds for repeat canvas calls
- Removes margin param from getNodeOnPos
- Removes margin param from getGroupOnPos
- Hitboxes now uniform for render / mouse features
- Simplifies code
* nit - Refactor
* Fix top-left edge of hitbox missing
* Add ID to groups