fix: zoom pan helper

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent a895853b64
commit c3fb3cd10a
38 changed files with 214 additions and 277 deletions
+15
View File
@@ -0,0 +1,15 @@
import { ElementId, RevueFlowStore, UpdateNodeInternals } from '../types'
function useUpdateNodeInternals(): UpdateNodeInternals {
const store = inject<RevueFlowStore>('store')!
return (id: ElementId) => {
const nodeElement: HTMLDivElement | null = document.querySelector(`.revue-flow__node[data-id="${id}"]`)
if (nodeElement) {
store.updateNodeDimensions([{ id, nodeElement, forceUpdate: true }])
}
}
}
export default useUpdateNodeInternals