Commit Graph

330 Commits

Author SHA1 Message Date
Baldur Gislason
cb8c35c760 Preventing slider from rendering outside its designated area if value it is based on is outside the expected range. 2023-04-05 15:21:17 +00:00
Moritz Ulmer
c18df08a74 Add tests for registerNodeType
Why:

- Ensure that the function works as expected

This change addresses the need by:

- Add tests
- Remove duplicate logic
2023-03-31 15:04:49 +02:00
Moritz Ulmer
f64bb7ba6b Replace deprecated function 2023-03-21 09:41:08 +01:00
Moritz Ulmer
6366f9132b Add first test
Why:

- Every journey starts with a first step

This change addresses the need by:

- Adding jest and a test
- Resolve ESLint warnings/errors in the tested function
2023-03-20 16:08:50 +01:00
Javi Agenjo
de997aca7e Merge pull request #348 from atlasan/contrib
fix undefined def_options
2023-03-20 11:40:39 +01:00
atlasan
31ec9567e0 fix undefined def_options
https://github.com/jagenjo/litegraph.js/issues/346
2023-03-20 11:00:23 +01:00
Moritz Ulmer
47ac1b7612 Proposed variable type update
Why:

- Reduces scope to required / expected of variables

This change addresses the need by:

- Using let / const instead of global / var
- Update ESlint configurtation
2023-03-20 10:54:38 +01:00
KaruroChori
23e81adc8e Update litegraph.js
Prevent error since panel is not defined.
2023-03-18 18:07:05 +00:00
Tim Gates
4177923d1d docs: Fix a few typos
There are small typos in:
- editor/js/defaults.js
- editor/js/defaults_mobile.js
- src/litegraph.js
- src/nodes/geometry.js
- src/nodes/gltextures.js

Fixes:
- Should read `sequentially` rather than `sequentually`.
- Should read `default` rather than `deafult`.
- Should read `visually` rather than `visualy`.
- Should read `offscreen` rather than `offscren`.
- Should read `dichotomic` rather than `dichotimic`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2023-03-05 11:51:27 +11:00
Mohsen Karami
d7c118987e Prevent the blocks from becoming unselected as the user drags them. 2023-03-03 10:50:55 +03:30
Mohsen Karami
b57885e3d7 Prevent unselecting blocks if the user double-clicks on them. 2023-03-03 10:33:42 +03:30
Javi Agenjo
1312de64a7 Merge pull request #329 from mohsen-karami/master
Add the ability to select multi nodes/blocks without pressing extra keys (shift/Ctrl)
2023-03-02 11:52:17 +01:00
tamat
29fc1a3929 fix in widget 2023-02-28 14:05:51 +01:00
tamat
4252b513de Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2023-02-28 13:29:00 +01:00
tamat
54c2c1c5f7 fixes 2023-02-28 13:28:57 +01:00
astrot1988
f6920f4699 fix: declare var 2023-02-03 20:05:32 +03:00
Mohsen Karami
f62b33d95a Add the ability to deselect the selected blocks in multi-select mode 2022-12-06 23:27:33 +03:30
Mohsen Karami
6762f1f339 Allow selecting multi nodes without pressing extra keys 2022-11-30 16:00:34 +03:30
Shan M
fd5e8610da Shouldn't update Event.deltaX as it is read-only property
As far as I can tell removing those lines doesn't have any issues. It solves typescripts error for e.deltaX having only getter.
2022-01-16 14:26:28 +03:00
tamat
376f6434e8 fixes to launch onInputAdded or onOutputAdded when configuring node 2021-12-22 18:09:59 +01:00
tamat
8c073dcb10 Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2021-12-02 13:12:20 +01:00
tamat
919007f741 fixes 2021-12-02 13:12:16 +01:00
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
tamat
2401cec699 fix in searchbox retenting the focus 2021-11-25 16:49:22 +01:00
tamat
af19af2c51 fixes in mouse events 2021-11-18 19:29:10 +01:00
tamat
d082927648 Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2021-11-16 17:04:45 +01:00
tamat
fc7045d71f default to drag inputs to disconnect 2021-11-16 17:04:40 +01:00
Gauss Zhou
c0ec1ce0a8 fix: issues #272
We should avoid using undeclared variables
2021-11-14 00:19:12 +08:00
tamat
9853fc2958 fixes 2021-11-10 11:55:31 +01:00
atlasan
e3b6044431 Changed default value for pointerevents_method property 2021-11-09 12:37:38 +01:00
Javi Agenjo
702d8dd373 Merge pull request #264 from atlasan/pulls
Pack
2021-11-03 10:03:54 +01:00
Javi Agenjo
7f9edcb4f2 Merge pull request #256 from Eikeike/widgetFix
make y pos of widgets customizable
2021-11-03 10:02:18 +01:00
atlasan
cb70928146 tiny fix 2021-10-25 12:02:13 +02:00
atlasan
fc605e0171 Fixes
Autoconnect: allows generic types *

Touches, they should be evaluated when pointerEvents are not available?
first glimpse
2021-10-22 16:09:08 +02:00
atlasan
1d118d95ac MultiActions for context menu
- right click node menu actions will be applied to all selected nodes
(mode, resize, collapse, colors, shapes, clone, remove)

- can add to selection with both cntrl and shift, and dragging new rects
with cntr+shift

- TODO apply to alt-drag clone, properties(?), ..
2021-10-15 16:37:25 +02:00
atlasan
d842c98e21 Fix and refactor 2021-10-15 02:27:46 +02:00
atlasan
84ff381c46 Small fix and new features
- nodes_executing, nodes_actioning initial set
- slot_types_default (in and out) helps in having defaults nodes for
specific slot_types
- slot_types_default are filled as an example in src/nodes/others.js
- middle_click_slot_add_default_node allows auto-placing defaults nodes
next to a slot
- release_link_on_empty_shows_menu conditions having
realease-in-empty-space functionality
- keypress for slot name
- do include new js/defaults.js in editor and leave the Lib with new
functionalities off by default

- new html with mobile editor (working on)
	- separate defaults
	- optional thirdy-party html console
2021-10-14 18:42:57 +02:00
atlasan
dfa7a2a71a Change new options to disabled, fix retrocompatibility
- currently testing with webglstudio
2021-10-11 14:53:34 +02:00
atlasan
cbbdd38eab ctx.roundRect re-Apply modern way for [radius] 2021-10-11 11:51:51 +02:00
atlasan
edfcc5ccbf Fixes and cleaning
- broken missing LGraph.nodes_executing and nodes_actioning

- fix detect location for in out buttons in subgraph

- clean debugs
2021-10-09 18:48:45 +02:00
atlasan
95e10bd80e some cleaning 2021-10-09 12:42:46 +02:00
atlasan
662817ecbd Cleaning and LOST CHANGES 2021-10-09 12:34:56 +02:00
atlasan
b337cd07ef Many improvements and implementations, TEST EM
- allow connecting from IN to OUT (drag an IN slot to create a link to
OUT slots)

- dim (opacity) uncompatible slots while creating a link

- filter in the searchbox for types (slotsIn, slotsOut), autofilter when
chaining

- drag-shift a slot to search and connect a new node

- code widget re-enabled

- properties panel improvements

- paste will use mouse coordinates


:: properties and methods ::
- additional shape GRID_SHAPE intended for slot arrays
- NODE_MODES_COLORS array of colors based on the node modes

node_box_coloured_by_mode: false, // [true!] nodebox colored on node
mode, visual feedback
node_box_coloured_when_on: false, // [true!] this make the nodes box
(top left circle) coloured when triggered (execute/action), visual
feedback

dialog_close_on_mouse_leave: true, // better true if not touch device
dialog_close_on_mouse_leave_delay: 500,

shift_click_do_break_link_from: false, // [false!] prefer false if
results too easy to break links - TODO custom keys
click_do_break_link_to: false, // [false!] prefer false, way too easy to
break links

search_hide_on_mouse_leave: true, // better true if not touch device
search_filter_enabled: true, // [true!] enable filtering slots type in
the search widget, !requires auto_load_slot_types
search_show_all_on_open: true, // [true!] opens the results list when
opening the search widget

auto_load_slot_types: true, // [if want false, use true, run, get vars
values to be statically set, than disable] nodes types and nodeclass
association with node types need to be calculated, if dont want this,
calculate once and set registered_slot_[in/out]_types and
slot_types_[in/out]
- this will create (without adding it) a node for each class when they
are registered. This allows for slots checking. Could raise errors in
case some node miss something: somehow nice.


alt_drag_do_clone_nodes: false, // [true!] very handy, ALT click to
clone and drag the new node

do_add_triggers_slots: false, // [true!] will create and connect event
slots when using action/events connections, !WILL CHANGE node mode when
using onTrigger (enable mode colors), onExecuted does not need this

allowMultiOutputForEvents: true, // [false!] being events, it is
strongly reccomended to use them sequentually, one by one


- find(Input/Output)Slot functions can return the object instead

- connectByType - allow connecting a node slot to a target node using an
auto-slot mode that looks for the right types

- onNodeCreated - new callback

- addOnTriggerInput, addOnExecutedOutput - creates action slots
(triggerIn, executedOut) when needed (changing mode, dragging events
onto the node)

- doExecute and doAction - wraps the onExecute and onAction node
functions with helpers and checks

- onAfterExecuteNode - new callback

- onBeforeConnectInput - new callback, can change slot while connecting
(or create a new one)

- onConnectOutput - new callback, similar to onConnectInput

- onNodeInputAdd, onNodeOutputAdd - new callbacks

- isOverNodeOutput - similar to isOverNodeInput

- helpers findInput, findOutput, findInputSlotFree, findOutputSlotFree,
findSlotByType

- canvas default_connection_color_byType[Off] allows custom colors type
based

- ESC will close panels

- showConnectionMenu will show the "Add menu" while dragging, to connect
after creation
2021-10-09 11:34:33 +02:00
atlasan
a3055c7fcb Couple implementations
- matrix shape (enabled for array slots)
- dim opacity on incompatibile slots when dragging
2021-10-06 17:43:48 +02:00
atlasan
ad9611ce4f Helper pointerListener(Add/Remove)
- moved from LGCanvas to LiteGraph to allow contextmenu and others to
access it easily
2021-10-03 20:29:09 +02:00
atlasan
8d302bd4f9 Simulate right click by multiple fingers 2021-10-02 16:33:50 +02:00
atlasan
b793e5c1d5 remove console.log for pointerevents 2021-10-02 14:29:38 +02:00
atlasan
a66d822e2a PointerEvents: from mouse events to pointer events v1
added LiteGraph.pointerevents_method with default "pointer"
replaced EventListeners with pointerevents_method+"down", "up", etc..
replaced e.localX (and Y) for e.clientX (Y)
fixed e.clientX is not writable

TODO: finish checks and clean
version with console.log("pointerevents..) enabled
alpha working for mobile, touch enabled
2021-10-02 14:26:15 +02:00
atlasan
d3d2586039 First easy fix to touch integration: 2021-10-01 17:02:11 +02:00
tamat
9ad6301101 make removable slots only the ones created from editor 2021-09-16 11:25:32 +02:00