mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 19:36:04 +00:00
* perf(core): a preview loads each web font once, not once per scene * test(core): count the bundle's font rules in its styles, not in the inlined runtime
18 lines
605 B
TypeScript
18 lines
605 B
TypeScript
export const SCENE_PART_ATTR = "data-hf-scene";
|
|
|
|
export const SCENE_PARTS_META = "hf-scene-parts";
|
|
|
|
export const SCENE_FONTS_ATTR = "data-hf-scene-fonts";
|
|
|
|
export const fontFaceBlocks = (css: string): string[] =>
|
|
css.match(/@font-face\s*\{[^}]*\}/gi) ?? [];
|
|
|
|
/** On a scene's top-level host: why the scene cannot be swapped in place, so edits to it reload. */
|
|
export const SCENE_NO_SWAP_ATTR = "data-hf-scene-no-swap";
|
|
|
|
/** Hashes of one preview document: everything outside the scene parts, and each scene's parts. */
|
|
export interface SceneParts {
|
|
shared: string;
|
|
scenes: Record<string, string>;
|
|
}
|