* test(studio): a second sealed resize of a scaled layer starts from its saved size * fix(studio): a second sealed resize of a scaled layer no longer jumps and saves the jump * test(studio): count and time the two-resize bench cases * test(studio): a sealed frame's GSAP values are read again after a save reruns its script * fix(studio): a second sealed resize scales from the size the first one saved * test(studio): leave GSAP value reads out of the sealed save's sent-edit list * refactor(studio): name the sealed rerun's re-read so the answer handler stays simple * test(studio): a sealed drag on GSAP's route leaves no offset on the stand-in, one re-read per rerun * fix(studio): a sealed drag that GSAP saves clears Studio's offset, as an unsealed one does * fix(studio): a sealed drag of a GSAP-held layer moves GSAP's x/y, as an open preview does * fix(studio): a sealed drag draws the rounded position an open preview's drag writes * test(studio): a plain layer's frame draft is the open preview's rounded offset less its start * fix(studio): a sealed restore keeps a later position write, and a rejected undo redraws the drop * fix(studio): a sealed restore keeps each axis a later write set, per landed patch * fix(studio): a sealed restore keeps a tween edit's axes only once that edit has drawn * fix(studio): a failed sealed batch keeps the axes an earlier landed batch queued * fix(studio): a sealed restore shows the base and whatever the timeline draws over it * fix(studio): restoring one sealed draft leaves every other live draft where it is drawn * fix(studio): a sealed restore replays only what each live draft draws, rotation included
@hyperframes/core
Types, parsers, generators, compiler, linter, runtime, and frame adapters for the Hyperframes video framework.
Install
npm install @hyperframes/core
Most users don't need to install core directly — the CLI, producer, and studio packages depend on it internally.
What's inside
| Module | Description |
|---|---|
| Types | TimelineElement, CompositionSpec, Asset, canvas dimensions, defaults |
| Parsers | parseHtml — extract timeline elements from HTML; parseGsapScript — parse GSAP animations |
| Generators | generateHyperframesHtml — produce valid Hyperframes HTML from a composition spec |
| Compiler | compileTimingAttrs — resolve data-start / data-duration into absolute times |
| Linter | lintHyperframeHtml — validate Hyperframes HTML (missing attributes, overlapping tracks, etc.) |
| Runtime | IIFE script injected into the browser — manages seek, media playback, and the window.__hf protocol |
| Frame Adapters | Pluggable animation drivers (GSAP, Lottie, CSS, or custom) |
Generated composition trust
Composition generators require trusted authors for code-bearing inputs. styles and
generateHyperframesStyles preserve authored CSS, which can load external resources.
animations may contain __raw: values that are emitted as JavaScript;
includeScripts: true includes executable timeline code. serializeGsapAnimations
also accepts raw preamble, postamble, and a code-bearing timelineVar. Never fill
these inputs with untrusted data. Attribute encoding and closing-tag containment
are not a sandbox; render untrusted compositions in an appropriately isolated
execution environment and never serve them on a privileged origin.
Text content retains the supported inline-formatting sanitizer contract. The clip parser intentionally flattens inner formatting to text, so parse/generate is not a lossless replacement for editing the source HTML.
Frame Adapters
A frame adapter tells the engine how to seek your animation to a specific frame:
import { createGSAPFrameAdapter } from "@hyperframes/core";
const adapter = createGSAPFrameAdapter({
getTimeline: () => gsap.timeline(),
compositionId: "my-video",
});
Implement FrameAdapter for custom animation runtimes:
import type { FrameAdapter } from "@hyperframes/core";
const myAdapter: FrameAdapter = {
id: "my-adapter",
getDurationFrames: () => 300,
seekFrame: (frame) => {
/* seek your animation */
},
};
Parsing and generating HTML
import { parseHtml, generateHyperframesHtml } from "@hyperframes/core";
const { elements, metadata } = parseHtml(htmlString);
const html = generateHyperframesHtml(spec);
Linting
import { lintHyperframeHtml } from "@hyperframes/core/lint";
const result = lintHyperframeHtml(htmlString);
// result.findings: { severity, message, elementId }[]
Documentation
Full documentation: hyperframes.heygen.com/packages/core
Related packages
@hyperframes/engine— rendering engine that drives the browser@hyperframes/producer— full render pipeline (capture + encode)hyperframes— CLI