Closed voxelstack closed 5 months ago
Hello,
I think it's already implemented, Here is the sidebar documentation https://v2.baklava.tech/visual-editor/sidebar.html
Hope it helps,
Louise
There are no explicit events if a node is selected/deselected, but you can watch the selectedNodes
property on the displayed graph:
import { watch } from "vue";
import { useBaklava } from "baklavajs";
const baklava = useBaklava();
watch(() => baklava.displayedGraph.selectedNodes, () => {
// this function is called whenever a node is selected/deselected
});
Then you can programmatically open the sidebar using the OPEN_SIDEBAR
command, as described in the link posted by Louise. Here is a description of how commands work: https://v2.baklava.tech/visual-editor/commands.html
Perfect, that works! I was able to open the sidebar for a given node, all that was missing was a way to watch for the last placed/selected node.
I would like to open the sidebar automatically whenever a node is clicked but I don't see any events for when a node is selected. Is it currently possible?
If not I feel like it should be, and I'd be happy to try making a PR for it if given a little guidance.