Commit Graph

50 Commits

Author SHA1 Message Date
Chenlei Hu
52bcf71e44 Relands #31 and #32 (#39)
* Add node disconnect shortcuts (#31)

* Fix loop break missing

* Fix logic - cannot reconnect AND disconnect

* Add ctrl + alt + click to disconnect nodes

Adds disconnect feature and very minor bug fixes (in separate commits):
- Ctrl + Alt + Click: Disconnect an input or output
- Ctrl + Alt + Click & Drag: Rewire any input/output to another node with a single click
- Added LiteGraph setting, on by default.

6036: skip_action = true

Not sure why skip_action was set to true, here.  It prevents disconnect and drag to a new output on the same click, so I've included it in the main commit.  Ideally, this should be controlled by a consumer hook, e.g. onDisconnectInput.

* Add output multi-link move using shift-click (#32)

When an output connects to multiple inputs, and you'd like to move all of those links to another node, you are currently required to drag each new link one by one.

This commit adds the ability to move everything at once, using Shift + Click (and drag).

It -does not- currently work with the drop to blank space + search for new node.  It will j ust rewire the first.  This can probably be fixed easily enough.

It -does- function with reroute nodes, however it requires that they are dropped onto the new output directly, not just anywhere on the node.  This is expected, really.

* Update empty-release event protocol

---------

Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
2024-07-30 15:11:13 -04:00
Chenlei Hu
1592ea97b4 Update types (#14) 2024-07-07 23:20:52 -04:00
Chenlei Hu
e361b39f36 Emit searchbox triggering canvas events (#10)
* Emit canvas event

* Update version
2024-07-06 18:13:26 -04:00
Chenlei Hu
8f1d91f952 Make necessary type def changes for TS repo (#3)
* Make necessary type def changes for TS repo

* Revert unwanted changes

* Revert more accidental changes

* Update version
2024-07-05 15:48:20 -04:00
Michael Poutre
beee147000 fix: Update node.getBounding box to support collapsed nodes and shadows 2023-07-28 20:22:12 -07:00
Moritz Ulmer
aec5d622a9 Remove extending the Javascript builtin objects
- Remove extending the Math & CanvasRenderingContext2D classes.
  - It was messing up the typescript 4.9+
  - Using the built-in roundRect function
  - Adding global clamp function
- Add some type corrections in litegraph.d.ts
- Fix a couple of build issues

Co-authored-by: Ranuka Perera <premium@sawrc.com>
Co-authored-by: Moritz Ulmer <moritz.ulmer@posteo.de>
2023-06-30 13:45:43 +02:00
tamat
8ae1e5568d Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2023-04-11 08:58:01 +02:00
tamat
42cbc5838c just changing modes 2023-04-11 08:57:53 +02:00
Mohsen Karami
6762f1f339 Allow selecting multi nodes without pressing extra keys 2022-11-30 16:00:34 +03:30
Ranuka Perera
8cc0cd39ff Add setProperty to typescript definition 2022-10-24 14:31:54 +05:30
Javi Agenjo
8959e1569e Merge pull request #162 from jitendra-kumawat/master
Updated arrange method to support vertical layout of nodes
2021-12-02 13:11:37 +01:00
ralphwetzel
6198a41972 Update litegraph.d.ts
Fix type definitions:
- LGraph.beforeChange
- LGraph.afterChange
2021-02-13 14:54:36 +01:00
ralphwetzel
3cb6e4586d Update litegraph.d.ts
Fix type definitions:
- LGraph.beforeChange
- LGraph.afterChange
2021-02-13 14:53:06 +01:00
ralphwetzel
5a680b9ac9 Update litegraph.d.ts
Fix type definitions:
- ContextMenu.constructor
2021-02-13 12:55:37 +01:00
ralphwetzel
0ad6104661 Update litegraph.d.ts
Fix type definition:

- LGraph.filter
2021-02-13 12:36:16 +01:00
ralphwetzel
139f9f8b8a Update litegraph.d.ts
Fix type definitions:
- LiteGraph.active_graph
- LGraphCanvas.getNodeTypesInCategory
- LGraphCanvas.getNodeTypesCategories
2021-02-13 12:27:23 +01:00
Javi Agenjo
00c4d8d908 Merge pull request #194 from xuekai-china/master
Pref: ts support about LGraphNode.mouseOver.
2021-01-29 10:51:03 +01:00
Javi Agenjo
a4c6ccd74f Merge pull request #198 from Kidoncio/ts_disconnect_output
TS support about LGraphNode.disconnectOutput
2021-01-29 10:50:38 +01:00
Javi Agenjo
348f5a2e6c Merge pull request #197 from Kidoncio/ts_on_property_changed
TS support about LGraphNode.onPropertyChanged
2021-01-29 10:50:27 +01:00
Lucas Nascimento
effe937e14 TS support about LGraphNode.onPropertyChanged 2021-01-28 00:25:11 -03:00
Lucas Nascimento
efb5d60283 TS support about LGraphNode.disconnectOutput 2021-01-28 00:10:57 -03:00
Lucas Nascimento
2958f443c2 TS support about LGraphNode.has_errors 2021-01-28 00:09:40 -03:00
xuekai-china
ba762d5b38 Pref: ts support about LGraphNode.mouseOver. 2021-01-21 19:17:10 +08:00
ilya
4cff2863b4 Remade lost changes 2020-08-13 01:18:50 +03:00
jitendra kumawat
5365cd1af7 Updated arrange method to support vertical layouting of nodes 2020-07-28 12:56:49 +05:30
ilya
802156e5a0 TypeDef updates and fix of method declaration 2020-07-13 19:54:24 +03:00
ilya
ea63884c83 Added typings for slot shape and replaced built files 2020-07-10 12:23:43 +03:00
Javi Agenjo
5df80e1648 Merge pull request #154 from ilyabesk/replace_connection_improvements
Cheanges to allow ability to automatically create inputs if required.
2020-07-10 09:37:44 +02:00
ilya
0238a5dcae Chenges to allow ability to automatically create inputs if required. 2020-07-08 21:14:36 +03:00
ilyabeskrovniy
115b647bf6 Fixed typings and documentation 2020-07-07 10:27:22 +03:00
altarfinch
93ba405a23 fixed enableWebGL missing declarations 2020-05-15 10:57:17 +02:00
altarfinch
4fe32687d2 fixed mouse function for custom widget : take custom height into account 2020-05-15 01:36:32 +02:00
altarfinch
7ba41d1d75 custom widget custom size support 2020-05-15 01:36:31 +02:00
Javi Agenjo
9fcc6c4975 Merge pull request #139 from sha-N/patch-4
fixes typedef for onDrawBackground and onDrawForeground
2020-05-11 12:54:01 +02:00
Shan M
c2f92e62aa fixes typedef for onDrawBackground and onDrawForeground
fixes the issue #131
2020-05-11 13:49:59 +03:00
Shan M
0a2f8a1d6d added type def for callback onNodeAdded 2020-05-11 13:44:52 +03:00
Javi Agenjo
240cee0209 Merge pull request #124 from sker65/master
Added hook for slot context menu
2020-05-06 10:02:00 +02:00
Shan M
626a69fec4 Error correction in type definition 2020-05-06 09:33:55 +03:00
Shan M
dbb4391099 Update for missing type definitions
Updated onConnectInput to match current function definition

Added missing definitions for

LGraphCanvas.onDrawLinkTooltip
LGraphCanvas.onNodeMoved
LGraphCanvas.onSelectionChange
LGraphCanvas.onNodeSelected
LGraphCanvas.onNodeDeselected
LGraphCanvas.onShowNodePanel
LGraphCanvas.onNodeDblClicked

LGraphNode.onConnectionsChange

Can close #127
2020-05-05 18:07:39 +03:00
Stefan Rinke
ac1d8f8f71 - added hook for slot context menu 2020-04-23 00:07:18 +02:00
Shan M
df5a042099 nodes attribute in selectNodes function is optional 2020-04-20 16:50:53 +03:00
Javi Agenjo
738004f460 Merge pull request #118 from sha-N/patch-4
Fixes type definition for renderInfo()
2020-04-15 10:48:59 +02:00
Javi Agenjo
a027c0eb87 Merge pull request #113 from sha-N/patch-1
fixes type error in function wrapFunctionAsNode
2020-04-15 10:48:42 +02:00
Shan M
6607593471 fix typo 2020-04-15 11:45:25 +03:00
Shan M
9b6ff21e00 Fixes type definition for renderInfo() 2020-04-15 11:41:43 +03:00
Shan M
03408f13df adds missing type unregisterNodeType 2020-04-06 12:06:36 +03:00
Shan M
6ef31c8c3a Adds missing type for showMenuNodeOptionalOutputs 2020-03-31 17:21:53 +03:00
Shan M
d86b463d5e fixes type error in function wrapFunctionAsNode 2020-03-28 10:59:57 +03:00
Julien MOREAU-MATHIS
cfe7cc1bdb Fixed DTS for registered_node_types, node_types_by_file_extension, and Nodes in LiteGraph to properly take LGraphNodeConstructor instead of LGraphNode. 2019-12-03 18:17:27 +01:00
NateScarlet
a7a1bd3aa5 feat: support typescript
add type definitions
2019-05-08 15:47:41 +08:00