import { defineToolcraft } from "../../schema/define-toolcraft"; import type { ToolcraftExternalStore } from "../../state/toolcraft-external-store"; import { useToolcraftStore } from "./toolcraft-store-context"; export function StorePersistenceProbe() { const store = useToolcraftStore(); return (
); } export function CaptureStore({ capture, }: { capture: (store: ToolcraftExternalStore) => void; }) { capture(useToolcraftStore()); return null; } export function createHotPersistenceSchema() { return defineToolcraft({ canvas: { enabled: true }, panels: { controls: { sections: [ { controls: { opacity: { defaultValue: 75, target: "selectedLayer.opacity", type: "slider", }, }, }, ], title: "Controls", }, }, persistence: { include: ["values", "canvas", "panels", "timeline"], key: "toolcraft:root-test-hot:state:v1", storage: "localStorage", version: 1, }, }); } export function createValuesPersistenceSchema() { return defineToolcraft({ canvas: { enabled: true }, panels: { controls: { sections: [ { controls: { opacity: { defaultValue: 75, target: "selectedLayer.opacity", type: "slider", }, }, }, ], title: "Controls", }, }, persistence: { include: ["values", "panels"], key: "toolcraft:root-test-committed-values:state:v1", storage: "localStorage", version: 1, }, }); }