MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / surfaceComposition

Function surfaceComposition

packages/cli/src/commands/keyframes.ts:237–259  ·  view source on GitHub ↗
(
  html: string,
  label: string,
  source: string,
)

Source from the content-addressed store, hash-verified

235// ── Composition surfacing ────────────────────────────────────────────────────
236
237export function surfaceComposition(
238 html: string,
239 label: string,
240 source: string,
241): SurfacedComposition {
242 const script = inlineScriptText(html);
243 let animations: GsapAnimation[] = [];
244 try {
245 animations = parseGsapScript(script).animations;
246 } catch {
247 animations = [];
248 }
249 const tweens = animations.filter((a) => !isHoldMarker(a)).map(surfaceTween);
250 attachComposedAncestors(tweens, html);
251 return {
252 composition: label,
253 source,
254 tweens,
255 traces: groupTraces(tweens),
256 cssKeyframes: surfaceCssKeyframes(inlineStyleText(html)),
257 anime: surfaceAnime(inlineScriptText(html)),
258 };
259}
260
261// ── CSS / Anime extraction ───────────────────────────────────────────────────
262

Callers 3

collectCompositionsFunction · 0.85
resolveScopeFunction · 0.85
keyframes.test.tsFile · 0.85

Calls 8

inlineScriptTextFunction · 0.85
parseGsapScriptFunction · 0.85
isHoldMarkerFunction · 0.85
attachComposedAncestorsFunction · 0.85
groupTracesFunction · 0.85
surfaceCssKeyframesFunction · 0.85
inlineStyleTextFunction · 0.85
surfaceAnimeFunction · 0.85

Tested by

no test coverage detected