retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
9.79k stars 642 forks source link

Menu handle on top right of node #700

Open michaelsboost opened 3 months ago

michaelsboost commented 3 months ago

I would love to use this framework to build my app but it's focused on mobile and I don't see anyway to add a menubar to each node where on the top right users would be able to clone or delete that specific node.

Similar to how BaklavaJS does it here - https://codesandbox.io/p/sandbox/baklavajs-v2-example-zpfkec

Demo only for BaklavaJS - https://zpfkec.csb.app/

Ni55aN commented 3 months ago

it can be done using a custom node

https://retejs.org/examples/customization/react in CustomNode you can add a button with onClick, e.g. onClick={props.data.openContentMenu}

where props.data is a Node instance with openContentMenu handler you specify