Skip to content

Commit 11071f7

Browse files
committed
chore: merge origin/main (a0c72ad) into the preview preload branch
2 parents c5caff0 + a0c72ad commit 11071f7

249 files changed

Lines changed: 12860 additions & 1791 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hyperframes",
33
"description": "HyperFrames by HeyGen. Write HTML, render video. Compositions, GSAP and runtime adapter animations, captions, voiceovers, audio-reactive visuals, and website capture for HyperFrames.",
4-
"version": "0.8.81",
4+
"version": "0.8.86",
55
"author": {
66
"name": "HeyGen",
77
"email": "[email protected]",

‎.codex-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hyperframes",
33
"description": "Write HTML, render video. Compositions, Tailwind v4 styles, GSAP and runtime adapter animations, captions, voiceovers, audio-reactive visuals, and website capture for HyperFrames.",
4-
"version": "0.8.81",
4+
"version": "0.8.86",
55
"author": {
66
"name": "HeyGen",
77
"email": "[email protected]",

‎.cursor-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "hyperframes",
44
"displayName": "HyperFrames by HeyGen",
55
"description": "Write HTML, render video. Compositions, Tailwind v4 styles, GSAP and runtime adapter animations, captions, voiceovers, audio-reactive visuals, and website capture for HyperFrames.",
6-
"version": "0.8.81",
6+
"version": "0.8.86",
77
"author": {
88
"name": "HeyGen",
99
"email": "[email protected]"

‎.github/workflows/regression.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
# Graphite can update a branch and its PR base separately for the same head
1313
# SHA. Keep only the newest expensive regression run for each PR/ref.
1414
concurrency:
15-
group: regression-${{ github.event.pull_request.number || github.ref }}
15+
group: regression-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'schedule' && '-nightly' || '' }}
1616
# A body or title edit queues behind running checks instead of cancelling them.
1717
cancel-in-progress: ${{ github.event.action != 'edited' || github.event.changes.base != null }}
1818

@@ -31,14 +31,17 @@ on:
3131
push:
3232
branches:
3333
- main
34+
schedule:
35+
# Daily at 06:17 UTC: the full suite, including fixtures too slow for every PR.
36+
- cron: "17 6 * * *"
3437

3538
jobs:
3639
changes:
3740
name: Detect changes
3841
runs-on: ubuntu-latest
3942
timeout-minutes: 2
4043
outputs:
41-
code: ${{ (github.event_name == 'workflow_dispatch' && inputs.catalog_publish) && 'true' || steps.filter.outputs.code }}
44+
code: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.catalog_publish)) && 'true' || steps.filter.outputs.code }}
4245
matrix: ${{ steps.shards.outputs.matrix }}
4346
steps:
4447
# Force git-based change detection instead of the pull_request REST API.
@@ -49,6 +52,7 @@ jobs:
4952
fetch-depth: 0
5053
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
5154
id: filter
55+
if: github.event_name != 'schedule'
5256
with:
5357
token: ""
5458
filters: |
@@ -62,9 +66,11 @@ jobs:
6266
# nor explicitly excluded, so a new fixture cannot silently never run.
6367
- name: Plan regression shards
6468
id: shards
69+
env:
70+
NIGHTLY: ${{ github.event_name == 'schedule' && '--nightly' || '' }}
6571
run: |
66-
echo "matrix=$(node packages/producer/scripts/plan-regression-shards.mjs)" >> "$GITHUB_OUTPUT"
67-
node packages/producer/scripts/plan-regression-shards.mjs --pretty
72+
echo "matrix=$(node packages/producer/scripts/plan-regression-shards.mjs $NIGHTLY)" >> "$GITHUB_OUTPUT"
73+
node packages/producer/scripts/plan-regression-shards.mjs $NIGHTLY --pretty
6874
6975
preflight:
7076
name: Preflight (lint + format)

‎docs/changelog.mdx‎

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.

‎docs/examples.mdx‎

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

‎docs/packages/player.mdx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ Set `autoplay muted` only when playback should start without a user gesture.
4747

4848
| Attribute | Type | Default | Description |
4949
| --------------- | ------- | ------- | --------------------------------------------------------- |
50-
| `src` | string | — | URL or relative path to composition HTML |
50+
| `src` | string | — | URL or relative path to composition HTML, or to a video file with `type` |
51+
| `type` | string | — | A `video/...` type (e.g. `video/mp4`) plays `src` as a video file |
5152
| `srcdoc` | string | — | Composition HTML already available as a string |
5253
| `width` | number | 1920 | Native composition width used for aspect ratio |
5354
| `height` | number | 1080 | Native composition height used for aspect ratio |
@@ -68,6 +69,10 @@ Player also accepts `shader-capture-scale` and `shader-loading` for previewing
6869
projects that use shader transitions. These are preview controls, not composition
6970
authoring attributes.
7071

72+
With a `video/...` `type`, `src` plays in a `<video>` behind the same playback API and
73+
events. `scenes`, `setRuntimeData()`, `setColorGrading()`, `iframeElement` and `stopMedia()`
74+
are composition-only, and `srcdoc` wins over a video `src`, as it does in an iframe.
75+
7176
## JavaScript API
7277

7378
The main API follows familiar media-player behavior:
@@ -113,7 +118,8 @@ player.addEventListener("timeupdate", (event) => {
113118
| `ratechange` | — | Playback rate changed |
114119
| `volumechange` | — | Volume or muted state changed |
115120
| `scenes` | `{ scenes }` | The runtime reported its scene list |
116-
| `error` | `{ message }` | Load or runtime error |
121+
| `error` | `{ message }` | Load or runtime error; a video adds its `MediaError` `code` |
122+
| `playbackerror` | `{ source, error }` | The browser blocked playback, for example unmuted autoplay |
117123

118124
## Advanced: iframe access
119125

‎docs/packages/studio-server.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ bundle: (dir, options) => bundleToSingleHtml(dir, { runtime: "inline", ...option
6060
| --- | --- |
6161
| `@hyperframes/studio-server/source-mutation` | Apply guarded changes to composition source |
6262
| `@hyperframes/studio-server/screenshot-clip` | Calculate element screenshot geometry |
63+
| `@hyperframes/studio-server/safe-path` | Resolve paths inside a project and walk its files, without the server |
64+
| `@hyperframes/studio-server/hf-ids` | Stamp stable element ids into a project's HTML, without the server |
65+
| `@hyperframes/studio-server/history` | Open a project's undo history, without the server |
6366
| `@hyperframes/studio-server/manual-edits-render-script` | Reapply Studio manual edits during render |
6467
| `@hyperframes/studio-server/studio-motion-render-script` | Reapply Studio motion edits during render |
6568
| `@hyperframes/studio-server/draft-markers` | Work with draft gesture markers |

‎docs/packages/studio.mdx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ When you run Studio from the monorepo, its dev server listens on `http://localho
3131

3232
## Entry points
3333

34-
| Import | Contains |
35-
| ------------------------------------- | ---------------------------------------------------------- |
36-
| `@hyperframes/studio` | React components, hooks, utilities, and their public types |
37-
| `@hyperframes/studio/tailwind-preset` | Tailwind preset used by Studio |
34+
| Import | Contains |
35+
| ------------------------------------- | ------------------------------------------------------------------- |
36+
| `@hyperframes/studio` | React components, hooks, utilities, and their public types |
37+
| `@hyperframes/studio/ui` | UI primitives (buttons, menus, popovers, fields) without the editor |
38+
| `@hyperframes/studio/player` | The `Player` component alone, without the timeline |
39+
| `@hyperframes/studio/tailwind-preset` | Tailwind preset used by Studio |
3840

3941
Peer dependencies are React 19, React DOM 19, and Zustand 4 or 5.
4042

@@ -73,6 +75,7 @@ Peer dependencies are React 19, React DOM 19, and Zustand 4 or 5.
7375
| ----------------------------------------------------------- | ----------------------------------------------------- |
7476
| `useTimelinePlayer` | Read and control the shared player state |
7577
| `usePlayerStore` | Access the Zustand player store |
78+
| `useCompositionStack` | Drill into and back out of nested compositions |
7679
| `useElementPicker` | Select and edit an element through the preview iframe |
7780
| `resolveSourceFile`, `applyPatch` | Locate and patch source |
7881
| `parseStyleString`, `mergeStyleIntoTag`, `findElementBlock` | Work with inline source styles and elements |

‎docs/snippets/example-player.jsx‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
export const ExamplePlayer = ({ src, poster, title, className }) => {
2+
// Keep this bootstrap self-contained: Mintlify evaluates snippet exports only.
3+
const mount = (source, image) => {
4+
const fallback = document.createElement("video");
5+
fallback.controls = true;
6+
fallback.playsInline = true;
7+
fallback.preload = "metadata";
8+
fallback.poster = image || "";
9+
fallback.style.cssText = "display:block;width:100%;height:100%;object-fit:contain";
10+
document.body.appendChild(fallback);
11+
const upgrade = () => {
12+
if (!customElements.get("hyperframes-player") || !Number.isFinite(fallback.duration)) return;
13+
const width = fallback.videoWidth || 1920;
14+
const height = fallback.videoHeight || 1080;
15+
const composition = document.createElement("div");
16+
composition.setAttribute("data-composition-id", "example-film");
17+
composition.setAttribute("data-width", String(width));
18+
composition.setAttribute("data-height", String(height));
19+
composition.setAttribute("data-duration", String(fallback.duration));
20+
const clip = document.createElement("video");
21+
clip.src = source;
22+
clip.className = "clip";
23+
clip.setAttribute("data-start", "0");
24+
clip.setAttribute("data-duration", String(fallback.duration));
25+
clip.setAttribute("playsinline", "");
26+
clip.style.cssText = "width:100%;height:100%;object-fit:contain";
27+
composition.appendChild(clip);
28+
const player = document.createElement("hyperframes-player");
29+
// Fit posters in published player builds that predate the sizing fix.
30+
const posterStyle = document.createElement("style");
31+
posterStyle.textContent = ".hfp-poster{width:100%;height:100%}";
32+
player.shadowRoot.appendChild(posterStyle);
33+
player.setAttribute("controls", "");
34+
player.setAttribute("low-power-idle", "");
35+
player.setAttribute("width", String(width));
36+
player.setAttribute("height", String(height));
37+
if (image) player.setAttribute("poster", image);
38+
player.style.cssText = "position:absolute;inset:0;width:100%;height:100%;visibility:hidden";
39+
player.setAttribute("srcdoc", "<!doctype html><html><head><style>html,body{margin:0;width:100%;height:100%}body>div{width:100%;height:100%}</style></head><body>" + composition.outerHTML + "</body></html>");
40+
player.addEventListener("ready", () => {
41+
const resume = !fallback.paused;
42+
player.seek(fallback.currentTime);
43+
player.muted = fallback.muted;
44+
player.volume = fallback.volume;
45+
fallback.pause();
46+
fallback.removeAttribute("src");
47+
fallback.load();
48+
fallback.remove();
49+
player.style.visibility = "visible";
50+
if (resume) player.play();
51+
}, { once: true });
52+
document.body.appendChild(player);
53+
};
54+
const script = document.createElement("script");
55+
script.src = "https://cdn.jsdelivr.net/npm/@hyperframes/player@latest/dist/hyperframes-player.global.js";
56+
script.onload = () => {
57+
if (fallback.readyState >= 1) upgrade();
58+
else fallback.addEventListener("loadedmetadata", upgrade, { once: true });
59+
};
60+
document.head.appendChild(script);
61+
fallback.src = source;
62+
};
63+
const args = JSON.stringify([src, poster]).replace(/</g, "\\u003c");
64+
const html = "<!doctype html><html><head><meta charset='utf-8'><style>html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#111}</style>" +
65+
"</head><body><script>(" +
66+
mount.toString() + ")(..." + args + ");</" + "script></body></html>";
67+
return <iframe title={title} className={className} style={{ display: "block", width: "100%", aspectRatio: "16 / 9", border: 0 }} srcDoc={html} loading="lazy" allow="fullscreen" allowFullScreen />;
68+
};

0 commit comments

Comments
 (0)