feat: masks, properties refactor, shaders, storage migrations, and more

This commit is contained in:
Maze Winther
2026-03-25 16:47:22 +01:00
parent 4aca4e7756
commit 08f5b92c3d
690 changed files with 35574 additions and 7308 deletions
+31
View File
@@ -0,0 +1,31 @@
import { useCallback, useRef } from "react";
export function useElementRegistry() {
const elementRefs = useRef<Map<string, HTMLElement>>(new Map());
const registerElement = useCallback(
(id: string, element: HTMLElement | null) => {
if (element) {
elementRefs.current.set(id, element);
return;
}
elementRefs.current.delete(id);
},
[],
);
const getElement = useCallback((id: string) => {
return elementRefs.current.get(id) ?? null;
}, []);
const getElements = useCallback(() => {
return elementRefs.current;
}, []);
return {
registerElement,
getElement,
getElements,
};
}