( html: string, label: string, source: string, )
| 235 | // ── Composition surfacing ──────────────────────────────────────────────────── |
| 236 | |
| 237 | export 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 |
no test coverage detected