tfrere's picture
tfrere HF Staff
feat(frontend): editor refresh (embed studio, comment popover, shiki, top bar, hooks, styles)
76fc93a
Raw
History Blame Contribute Delete
707 Bytes
// Editor-side wrapper around the shared embed srcdoc builder.
// Keeping this thin shim avoids churning every import site, and preserves
// the editor-specific call signature (isDark / primaryColor).
import { buildEmbedSrcdoc, DEFAULT_EMBED_HEIGHT } from "#shared/embed-doc";
export { DEFAULT_EMBED_HEIGHT };
interface BuildDocOptions {
isDark: boolean;
primaryColor?: string;
/** Edge-to-edge mode used for banner embeds. See buildEmbedSrcdoc. */
fullBleed?: boolean;
}
export function buildDoc(htmlFragment: string, opts: BuildDocOptions): string {
return buildEmbedSrcdoc(htmlFragment, {
isDark: opts.isDark,
primaryColor: opts.primaryColor,
fullBleed: opts.fullBleed,
});
}