mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
* feat(studio): drag and resize draw live on an opaque preview over its channel On a preview frame Studio cannot script, a drag moved only the selection outline: the element stayed put until the save reloaded the preview. A resize threw on every pointer move (it measured the frame's element for the centre pin), saved its size without the centring shift, and then a drag or resize save threw while re-syncing the preview's timeline, which stopped the save queue and paused the preview. The runtime answers a new `draft` request: it adds a gesture's translate to the one the element had and sets its border box, the way the save writes them, and an end either keeps what is drawn (the save landed) or puts back what was there (a cancel, a tap, a failed save). Studio mirrors what a gesture draws on an opaque selection's stand-in to the frame, one request in flight per frame with later moves merged into the next. An opaque resize grows the outline about its centre from the size it wrote rather than measuring the frame. The timeline re-sync after a save reports a frame it cannot reach, so its caller re-seeks or reloads instead of throwing. A stand-in now starts with the inline translate and Studio size and offset of the element it stands for, so a drag on a freshly reloaded preview starts from where the element is. Before, a second drag after a reload saved only its own distance and dropped the first. Same-origin frames do not change: only an opaque selection's stand-in is mirrored, and the re-sync change only catches a read such a frame refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(core): draft writes test an element by its namespace, not its realm The runtime preview guard bans instanceof HTMLElement/SVGElement in the runtime, since a node from another realm fails it; the draft handler uses isStylableElement from domRealm.ts, as other runtime style writes do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio): keep the opaque preview's gesture drafts in step with the saved edit - Grabbing a layer again before its last save settles keeps that save's draft on the frame and draws the new gesture from there; the movement probe's restore no longer ends a draft it never drew. - A move on an opaque preview starts from the px the frame renders the translate at (%, em, var(), or a stylesheet translate), records the author's own value for Reset, and refuses a % it cannot size instead of dropping it. The frame's draft base resolves % to px, so a resize can't shift it again. - The stand-in carries Studio's translate marks, so Reset after a reload restores the author's translate. - A resize with no offset member keeps its draft once saved. - An undo painted over a pending move draws the move again when it is put back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@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 19, Zustand 4/5 (state management; development uses Zustand 5)
- 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