/** * LiveThumbnail * * Renders a real, scaled-down preview of a single Puck component using the * component's own `defaultProps`, via Puck's . The preview is clipped * to a fixed height and made non-interactive so it reads as a static thumbnail * inside the visual component sidebar. * * Rendering is cached (see thumbnailCache): on a miss we render live and * capture the resulting HTML; on a hit we re-inject the cached HTML instead of * re-rendering the component. The cache survives editor remounts within a * page load, avoiding re-rendering identical previews on every document * switch. * * The initial capture happens right after the component's first commit, but a * component that renders its own content asynchronously (e.g. after a fetch, * in its own effect) may still be showing a loading state at that point. A * MutationObserver keeps watching the live render and re-captures on every * DOM change, so the cache converges on the settled output instead of * permanently freezing whatever was on screen first. * * The config handed to Puck's has its `root` swapped for a * pass-through: this preview is a single component, not a page, so it must * not run the site's real page-root wrapper (e.g. a title `

`) — that * wrapper reflects the actual document currently open in the editor, not * this isolated stub, and would otherwise leak into every preview. * * Unlike the exploratory spike this does NOT self-measure its height — grid * cards want a uniform, fixed size, so we clip overflow instead. */ import React from 'react'; type RenderConfig = any; export interface LiveThumbnailProps { /** The Puck config the component belongs to. */ config: RenderConfig; /** Component key to preview (e.g. "HeroBlock"). */ name: string; /** Zoom factor applied to the live render. Lower = more fits. */ scale?: number; /** Fixed height of the clipped preview box, in pixels. */ height?: number; } declare function LiveThumbnailImpl({ config, name, scale, height }: LiveThumbnailProps): React.JSX.Element; /** Memoized so re-expanding a category doesn't re-render existing previews. */ export declare const LiveThumbnail: React.MemoExoticComponent; export {};