| // 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, | |
| }); | |
| } | |