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

This commit is contained in:
Maze Winther
2026-03-29 15:48:22 +02:00
parent 39ea298a9c
commit 8db3bead13
690 changed files with 35618 additions and 7337 deletions
+26
View File
@@ -0,0 +1,26 @@
import { useRef } from "react";
import { useEditor } from "@/hooks/use-editor";
export function useMenuPreview() {
const editor = useEditor();
const didCommitRef = useRef(false);
const discard = () => {
if (!didCommitRef.current && editor.timeline.isPreviewActive()) {
editor.timeline.discardPreview();
}
};
const markCommitted = () => {
didCommitRef.current = true;
};
const onOpenChange = (isOpen: boolean) => {
if (!isOpen) {
discard();
didCommitRef.current = false;
}
};
return { onPointerLeave: discard, onOpenChange, markCommitted };
}