* 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
* Fix intermittent links bug - graph.links Map()
Replaces graph.links with Map()
Adds a Proxy to provide for...in and indexer access
Temporarily uses merged Map+Record type, to ease downstream migration
* nit - Remove redundant code
* nit - Remove redundant null checks
* Add Serializable interface, used in LLink
Allows LLink to be serialised as an object rather than an array, bringing it inline with the rest of LiteGraph.
* Fix TS errors - use correct property
* Fix graph version bumped without change
* Fix onDrawForeground callback has wrong area
* Move node pos getter/setter to class decl
* Add Snaps for Comfy
* Add snap visual effects
* Update node measure to work everywhere
* Fix findConnectByTypeSlot does not work for "*"
* Fix regression in fast widget conversion
* Add connectByType wrappers
Can find slots without actually connecting. Will be used for link snapping.
* Refactor - generic find free slot
* Fix link/links TS types - should not be undefined
* Fix / add TS types, docs
* Refactor - fix overloads TS types
* Refactor - optional chaining
* Extend node before-connect callback
The callback can now determine if connection is to a specific input, or just trying to connect any valid slot on the node.
* Add TS types - finish IOptionalInputsData
* Add new hover highlight and link dragging features
- Hovering effects added for node inputs and outputs
- Adds "mouseout" handler to properly clear node state when mousing off a node
- Fixes bug that causes outputs to always be dimmed out when connecting from inputs
- Slight performance improvement
* Add node highlight text colour option
* Add slot highlight colour fallback
* Format only
* Revert accidental change
* Fix redundant falsy check - uninit. var
* nit - Refactor const/let
* nit - Refactor const/let (manual)
* nit - Redeclared params
* Add TS types & minor refactor only
* Refactor - Clean up / reformat
- Add strings.ts helper functions
- Remove unused vars & local function params
- Simplifies code
- Rename vars for clarity
- Add TODOs and other comments
- Add ts-expect-error
* Redirect draw.ts enums to global file (temp.)
Should be revisited after TS merge complete
Corrects import of types from draw.ts into interfaces
* Add measure.ts - move util funcs from Global
* Add all imports required for TS conversion
* Refactor - TS narrowing
* nit - TS types & minor refactor
* Add missing types from recent PRs
Removes duplicate declarations
Fixes some type mismatches
* nit - Refactor recent PRs
* Revert incorrect decls backported
* Remove unused params
* Add TS types only
* Fix minor TS type coercion issues
Also removes redundant code
* nit - Refactor
* Remove @ts-nocheck
* Fix refactor regression - drag link to output
Issue was the result of fixing var declared outside of closure
* Restore original logic
---------
Co-authored-by: huchenlei <huchenlei@proton.me>
* Convert litegraph.js to TS
* Overhaul static litegraph.d.ts with updated types
* Fix rename oversights and revert fix unused param
- Some functions were broken by merging updated TS function signatures which included param renames
- Removal of unused params does not belong in the TS conversion PR, and has been reverted
* Remove legacy static .d.ts file
* Add callback decl from #180
Support allowing links to widgets (#180)
c23e610c11
* Convert NodeId to string | number
Results in significantly less downstream changes, despite being a change from the old static file.
---------
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>