mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 06:19:21 +00:00
Replaces the bundled percentage-keyframe model (one GSAP tween per element
with all properties in each keyframe) with per-property-group tweens. Each
studio operation creates/edits only its own group's tween:
drag → position group (x, y)
resize → scale group (scale, scaleX, scaleY) or size group (width, height)
rotate → rotation group (rotation, skewX, skewY)
This eliminates cross-property contamination: dragging no longer changes
scale, resizing no longer changes position, and backfill no longer bleeds
values between unrelated properties.
Architecture:
- PropertyGroupName type + PROPERTY_GROUPS constant + classification functions
- Group-aware animation IDs: #box-to-0-position, #box-from-500-scale
- split-into-property-groups atomic server mutation for legacy tween migration
- resolveGroupTween helper routes each intercept to the correct group tween
- Lazy legacy split: first keyframe edit on a mixed tween splits it into groups
- replace-with-keyframes atomic mutation for extend operations
- Tween cache tracks propertyGroup per keyframe for diamond display
- activeKeyframePct targeting: clicking a diamond targets that exact keyframe
Foundation fixes (from the 6 root causes trace investigation):
- Timeline position resolver for chained tweens (+=, -=, <, >)
- Parse timeline({defaults}) and inherit ease/duration
- Numeric keyframe matching with 2% tolerance
- Non-destructive from/fromTo conversion (merge, not replace)
- Server returns changed:false for no-op mutations
- ID rescue on all mutation functions
- Soft reload: clearProps after kill, globalTimeline sweep, success check
- Drag draft reads GSAP base + delta, cancel restores base
- Gesture recording: sign fix, selection capture, per-property RDP epsilon
- GSAP drag intercept enabled by default
@hyperframes/studio
Browser-based composition editor UI for Hyperframes. Provides a visual timeline, code editor, and live preview for building video compositions.
Install
npm install @hyperframes/studio
What it does
The studio is a React application with:
- Visual timeline — drag, resize, and arrange elements on tracks
- Code editor — edit HTML and GSAP scripts with CodeMirror (syntax highlighting, autocomplete)
- Live preview — see changes in real time as you edit
- Composition inspector — view and modify element properties
Development
The studio is embedded in the hyperframes preview command. To develop the studio UI itself:
cd packages/studio
bun run dev # Start Vite dev server
bun run build # Build for production
bun run typecheck # Type-check
Tech stack
- React 18/19, Zustand (state management)
- CodeMirror 6 (editor)
- Tailwind CSS (styling)
- Vite (bundler)
- Phosphor Icons
Documentation
Full documentation: hyperframes.heygen.com/packages/studio
Related packages
@hyperframes/core— types and parsers used by the editorhyperframes— CLI that serves the studio viahyperframes preview