chore: editor App and SceneGraph updates
This commit is contained in:
@@ -20,11 +20,12 @@ const emit = defineEmits<{
|
||||
selectNode: [id: string]
|
||||
addEdge: [source: string, target: string]
|
||||
testScene: [id: string]
|
||||
clearSelection: []
|
||||
}>()
|
||||
|
||||
const nodes = ref<any[]>([])
|
||||
const edges = ref<any[]>([])
|
||||
const { onNodeClick, onConnect, onNodeContextMenu, onNodeDragStop, fitView } = useVueFlow()
|
||||
const { onNodeClick, onConnect, onNodeContextMenu, onNodeDragStop, onPaneClick, fitView } = useVueFlow()
|
||||
const ctxMenuVisible = ref(false)
|
||||
const ctxMenuX = ref(0)
|
||||
const ctxMenuY = ref(0)
|
||||
@@ -135,6 +136,8 @@ onNodeDragStop((ev) => {
|
||||
savePosition(ev.node.id, Math.round(pos.x), Math.round(pos.y))
|
||||
})
|
||||
|
||||
onPaneClick(() => emit('clearSelection'))
|
||||
|
||||
onConnect((conn: Connection) => {
|
||||
if (conn.source && conn.target) emit('addEdge', conn.source, conn.target)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user