import type { Block } from "@/features/editor/state/editorStore"; interface PublicProjectSnapshot { slug: string; title: string; contentJson: Block[]; } function getStore(): Map { const g = globalThis as any; if (!g.__PB_PUBLIC_PROJECTS) { g.__PB_PUBLIC_PROJECTS = new Map(); } return g.__PB_PUBLIC_PROJECTS as Map; } export function cachePublicProject(snapshot: PublicProjectSnapshot): void { const store = getStore(); store.set(snapshot.slug, snapshot); } export function getCachedPublicProject(slug: string): PublicProjectSnapshot | null { const store = getStore(); return store.get(slug) ?? null; }