Chenlei Hu
cdbd0899e2
[Reland][TS] Use strict mode in LGraphNode - part 2 ( #604 )
...
Reverts Comfy-Org/litegraph.js#603
2025-02-25 16:39:31 -05:00
Chenlei Hu
67d8c3177a
Revert "[TS] Use strict mode in LGraphNode - part 2" ( #603 )
...
Reverts Comfy-Org/litegraph.js#601
Reason: breaks legacy reroute
On inserting a workflow with legacy reroute node
```
Uncaught (in promise) NullGraphError: Attempted to access LGraph reference that was null or undefined.
at RerouteNode.removeOutput (LGraphNode.ts:1425:28)
at RerouteNode.clone (rerouteNode.ts:215:18)
at LGraphCanvas.copyToClipboard (LGraphCanvas.ts:3331:29)
at Object.insertWorkflow (workflowService.ts:350:12)
```
2025-02-25 14:10:27 -05:00
filtered
67ee55ede1
[TS] Use strict mode in LGraphNode - part 2 ( #601 )
...
- Guards against nullish `graph`
- [Fix regression in return type -
getInputLink](143ca5f3f2 )
- long-standing, so no impact apparently
- Resolves some potential null dereferencing
2025-02-25 13:40:50 -05:00
filtered
f39e1d96e8
[TS] Use strict mode in LLink & Reroute ( #602 )
...
- Adds fallback colour if reroute colour is somehow nullish
2025-02-25 18:00:33 +00:00
filtered
4636367de2
[TS] Use strict mode in LGraphNode - initial ( #598 )
...
- Part of effort to convert LGraphNode to TS strict
- Adds some small runtime changes - no impact expected, but it is
possible
- Runtime changes are in separate commits from compile-time type changes
- Risk of downstream impact is low
2025-02-25 17:19:27 +00:00
filtered
477d498d6b
[API] Remove unused: optional_inputs & outputs ( #597 )
...
Code search shows zero usage. If kept, typing properly would require
effort.
Removed:
- `LGraphNode.optional_inputs`
- `LGraphNode.optional_outputs`
2025-02-25 16:33:21 +00:00
Chenlei Hu
fadece7fdf
Type LGraphNode.addInput/Output ( #585 )
2025-02-24 19:29:04 -05:00
filtered
1800d31a5a
[Refactor] Prefer modern for..of loops 2 ( #569 )
...
* [Refactor] Prefer for..of
* [Refactor] Prefer for..of - manual refactoring
* Partially revert change - potential conflict
Not worth time investment to fix - reverted.
2025-02-23 16:36:52 -05:00
filtered
4add6c3211
[Cleanup] Follow-up on #566 - fix style ( #568 )
2025-02-23 20:20:44 +00:00
filtered
4163cb04b8
[Refactor] Prefer modern for..of loops ( #566 )
...
- Replaces traditional incrementing `for` loops and `forEach()` calls with modern `for..of` syntax
- Improves readability
- Semantic checking used; not expecting issues to arise from this portion
2025-02-23 19:59:41 +00:00
bymyself
d17e7f567d
type LGraphNode.addWidget ( #562 )
...
* type addWidget
* help out ts compiler
* Update LGraphNode.ts
---------
Co-authored-by: Chenlei Hu <huchenlei@proton.me >
2025-02-23 13:01:17 -05:00
Chenlei Hu
c8385657db
Add LGraphNode.expandToFitContent ( #558 )
2025-02-20 13:55:02 -05:00
Chenlei Hu
dcac6dba80
[BugFix] Auto grow node if widgets need more space ( #556 )
2025-02-20 12:45:31 -05:00
filtered
b67f34e7f3
[Cleanup] Remove lint bypass, remove unused vars ( #554 )
2025-02-20 11:17:35 +11:00
filtered
485bfd1628
[Cleanup] Remove unused code ( #553 )
2025-02-20 10:54:24 +11:00
Chenlei Hu
7bab620986
Fix IColorable.getColorOption ( #551 )
...
* Fix IColorable.getColorOption
* nit
2025-02-19 14:57:29 -05:00
Chenlei Hu
6b1e40a011
Add IColorable interface ( #549 )
...
* Add IColorable interface
* Set color option
* nit
* nit
* nit
2025-02-19 13:56:08 -05:00
Chenlei Hu
d27ced7cf3
[BugFix] Fix unknown node with converted widgets ( #547 )
2025-02-18 19:32:06 -05:00
Chenlei Hu
1e71da9a38
Show widget input inplace ( #535 )
...
* Show widget input inplace
* nit
* nit
2025-02-16 11:37:47 -05:00
Chenlei Hu
7a25899ecc
Reverse computeSize and computeLayoutSize priority ( #533 )
2025-02-15 14:35:09 -05:00
Chenlei Hu
d23a320f9f
Upstream frontend widgets layout logic ( #531 )
...
* Upstream frontend widgets layout logic
* Add back LGraphNode.freeWidgetSpace
* nit
* update expectations
2025-02-14 19:22:37 -05:00
Chenlei Hu
a5c89c0152
[Performance] Avoid double measure on node rendering ( #529 )
...
* [Performance] Avoid double measure on node rendering
* Move _collapsed_width calc
* nit
* nit
* nit
* nit
* nit
2025-02-14 14:15:40 -05:00
Chenlei Hu
ce44cea409
Split layout and draw for slots ( #524 )
...
* Split layout and draw for slots
* nit
* nit
* Fix serialization
* Move effect (highlight/invalid) to layout calculation
* nit
* Fix type issue
* Resolve review comments
2025-02-13 20:20:57 -05:00
Chenlei Hu
361a1a76ef
Add LGraphNode.getExtraSlotMenuOptions hook ( #522 )
2025-02-12 15:52:27 -05:00
Chenlei Hu
9abcf0fd32
Remove LGraphNode.horizontal ( #521 )
...
* Remove LGraphNode.horizontal
* nit
2025-02-12 15:11:59 -05:00
Chenlei Hu
7813e5207a
Revert "Revert "Convert i/o slot to class in LGraphNode.configure"" ( #518 )
...
* Revert "Revert "Convert i/o slot to class in LGraphNode.configure (#506 )" (#511 )"
This reverts commit d029bd8924 .
* nit
2025-02-12 11:06:35 -05:00
Chenlei Hu
d029bd8924
Revert "Convert i/o slot to class in LGraphNode.configure ( #506 )" ( #511 )
...
This reverts commit c75157e86e .
2025-02-09 23:35:40 -05:00
Chenlei Hu
c75157e86e
Convert i/o slot to class in LGraphNode.configure ( #506 )
2025-02-09 15:23:38 -05:00
Chenlei Hu
997d673bd9
[Refactor] LgraphNode.drawSlots ( #503 )
...
* wip
* nit
2025-02-09 12:53:41 -05:00
Chenlei Hu
120c606f07
[Refactor] LGraphNode.drawCollapsedSlots ( #500 )
2025-02-09 11:02:20 -05:00
Chenlei Hu
01b8ae5bb8
[Refactor] LGraphNode.drawWidgets ( #499 )
2025-02-08 23:41:01 -05:00
Chenlei Hu
de74d8a08c
[Lint] Lint unused imports ( #493 )
2025-02-08 21:20:39 -05:00
Chenlei Hu
4d36369cd8
Refactor widget switch statement ( #491 )
2025-02-08 19:28:38 -05:00
Chenlei Hu
cdaceebcaa
Implement SliderWidget ( #485 )
2025-02-08 17:28:25 -05:00
Chenlei Hu
2d688a896d
Implement TextWidget ( #484 )
2025-02-08 17:01:54 -05:00
Chenlei Hu
ab14827f87
Implement ButtonWidget ( #483 )
2025-02-08 16:50:02 -05:00
Chenlei Hu
63f9f30eec
Implement NumberWidget ( #481 )
2025-02-08 15:45:23 -05:00
Chenlei Hu
c781053bd2
Implement ComboWidget ( #480 )
...
* wip
* Implement onClick
2025-02-08 15:16:15 -05:00
Chenlei Hu
fcc09c075d
Implement BooleanWidget.onClick ( #479 )
2025-02-08 12:45:51 -05:00
Chenlei Hu
608b5f8342
Implement NodeSlot ( #476 )
...
* Implement NodeSlot
* nit
2025-02-07 17:13:32 -05:00
Chenlei Hu
75f067dbb3
Implement BooleanWidget ( #466 )
...
* Implement BooleanWidget
* Merge function of addWidget
* Class conversion
* nit
2025-02-07 17:10:30 -05:00
Chenlei Hu
c900df750e
Simplify LGraphNode.onDrawBackground signature ( #463 )
2025-02-05 03:53:49 +11:00
Chenlei Hu
5acb656b15
[Refactor] Add LGraphCanvas.drawTitleText ( #462 )
2025-02-04 11:19:49 -05:00
Chenlei Hu
530fa874b0
[Refactor] Add LGraphNode.drawTitleBox ( #461 )
...
* [Refactor] Add LGraphNode.drawTitleBox
* nit
2025-02-04 10:57:50 -05:00
Chenlei Hu
7ea9a8405d
[Reland][Refactor] Move node title background draw logic to LGraphNode ( #459 )
...
* [Refactor] Move node title background draw logic to LGraphNode (#452 )
* Fix collapsed
2025-02-04 00:33:19 -05:00
Chenlei Hu
dc24c6617f
Revert "[Refactor] Move node title background draw logic to LGraphNode ( #452 )" ( #455 )
...
This reverts commit 047bf68dc9 .
2025-02-03 23:34:46 -05:00
Chenlei Hu
b3dbc41368
Remove LGraphNode.subgraph (Legacy subgraph) ( #453 )
...
* Remove LGraphNode.subgraph (Legacy subgraph)
* Update snapshot
2025-02-03 23:27:11 -05:00
Chenlei Hu
047bf68dc9
[Refactor] Move node title background draw logic to LGraphNode ( #452 )
2025-02-03 23:20:51 -05:00
Chenlei Hu
6cf1f2d627
[Refactor] Move shape fallback from LGraphCanvas to LGraphNode ( #451 )
...
* [Refactor] Move shape fallback from LGraphCanvas to LGraphNode
* nit
2025-02-03 23:02:42 -05:00
Chenlei Hu
9d8e49b8f8
Remove LGraphNode.supported_extensions ( #448 )
2025-02-03 20:26:37 -05:00