Files
miga-heygen 3a7fcd10e0 feat(registry): add 25 image carousel blocks (#3790)
* feat(registry): add 25 image carousel blocks (5 families × 5 variants)

Five carousel families, each with 5 style variants:

- Orbit (1–5): image cards on a spinning 3D Fibonacci sphere
- Path (1–5): cards following animated CSS motion paths
- Circle (1–5): circular carousel layouts
- Vision (1–5): Apple Vision-style spatial presentations
- Text Circle (1–5): circular carousels with text overlays

All blocks are 1920×1080 at 6s, with 12–24 configurable image slots.
Includes catalog preview thumbnails for each block.

Co-Authored-By: Jake Moran <jake.moran@heygen.com>

* refactor(registry): host carousel block images on the CDN

The registry is served straight out of this repository
(DEFAULT_REGISTRY_URL points at raw.githubusercontent.com), so every byte a
block ships is permanent history. The 25 carousel blocks added 421 JPEGs,
27.7 MiB in a checkout, and made the diff 472 files. Only 23 of those images
were distinct: the same 12-24 placeholders were copied into every block.

files[] entries gain an optional `url`. When set, the installer fetches the
bytes from there instead of joining the registry base. `path` does not change
and still says where the file lands relative to the item, so composition HTML,
target mirroring and `hyperframes add` behave exactly as before.

Keys are content-addressed, so the 396 manifest entries resolve to 23 objects,
and a changed image gets a new URL rather than a stale one cached behind
`immutable, max-age=31536000`.

The catalog preview renderer copies an item's directory and renders it, so it
needs the same materialisation step. Without it the preview draws every card
blank and reports success, which is worse than failing.

Also drops registry/catalog/, 25 hand-made thumbnails referenced by nothing;
catalog previews are rendered by CI and served from docs/images/catalog.

Verified: all 23 objects return 200 from the CDN with hashes matching their
keys; `hyperframes add carousel-orbit-1` against a local registry installs 24
real JPEGs; the preview render produces the album art, and produces blank
cards when the fetch step is removed.

* style(registry): format the carousel composition HTML

`oxfmt --check .` covers the whole tree, and these 25 files were never run
through it. The pre-commit hook only formats staged files, so nothing local
caught it.

* feat(catalog): publish the carousel blocks without republishing their images

These 25 blocks had no Catalog page. Every other item in the registry has one,
so they shipped invisible: installable by name, unfindable by browsing.

Generating them naively undid the change they were added by. The Catalog
payload copies an item's assets into docs/public/, which is tracked, so the 396
images this PR just removed came back as 43 MB one directory over — worse than
the 3 MB they started as, because each block got its own copy.

The copy exists because these compositions assemble `img.src` at run time out
of a variable value, so there is no `src="..."` in the markup for the payload's
asset scan to resolve. An unpredictable path can only be satisfied by serving
every file beside it, which is what `needsOwnDirectory` asks for.

An absolute URL needs no directory: the scan already skips any `https:`
reference. So for the payload path only, hosted files are left undownloaded and
the composition's variable defaults are rewritten to their URLs. The preview
renderer still downloads them, because it paints real frames and a missing file
is a blank card.

The explorer posts every value to the preview frame on mount, including
untouched ones, so the page's variable list carries the URLs too. Left as local
paths they would have overridden the payload's own defaults and asked the frame
for a file that was deliberately never published.

Result: 25 pages, 25 payloads, zero bytes of image added.

Verified: a spike item declaring no assets at all rendered its 24 covers from
the CDN, proving the variable-default path; payload generation for a carousel
block now writes no item directory and no shared asset; the preview render
still produces the album art. mint validate and mint broken-links pass on the
new pages. test:scripts is green.

* refactor(catalog): split the hosted-asset step out of prepareProjectDir

Two functions rather than one: finding the composition and rewriting its
variable defaults are separate jobs, and inlining the mode branch pushed
prepareProjectDir past the complexity gate it was already sitting on.

Behaviour is unchanged. Re-verified both paths after the split: the payload for
a carousel block still writes no item directory and no shared asset, and the
preview render still produces the album art.

* feat(catalog): give the carousels their own shelf

25 image carousels landed in Showcases and were 53% of it, so the scenes that
shelf exists for disappeared underneath them. That is the same shape the 24
editor themes made, and it gets the same fix they got.

Keyed on the first tag, which is this file's stated grouping rule, rather than
on the name. `screen-flow-carousel` leads with `product-demo` and stays on the
shelf that says what it is for; a future carousel that is not named
`carousel-*` still lands here.

Showcases 47 -> 22, Carousels 25, and no existing item changed shelf.

* fix(registry): centre the circle-5 carousel path in its composition

Its ring was centred at x=3832.6 in a 3840-wide composition, so it sat on the
right edge and most of it fell outside the frame. Only a few cards were ever
visible, cropped, with two thirds of the composition empty.

The exported path carried absolute coordinates from a layout that was never
recentred. Shifting the four vertices by (-1912.597, -4.340) puts the ring on
the composition centre. Handles are relative, so only the anchor points move
and the shape is unchanged.

carousel-text-circle-5 shares the identical path and had the identical fault.

The other three circle variants sit within 12% of centre, which reads as
authored placement rather than the same bug, so they are left alone.

* fix(catalog): rebuild the circle-5 payloads after recentring the path

The Catalog preview plays the payload, not the composition on disk, so
recentring the source changed nothing a reader sees. The payload still carried
the old vertices and the ring still hung off the right edge of the frame.

Verified the consumer this time, not just the producer: both payloads now
resolve to a path centre of x=1920. The other 23 rebuild byte-identical, so the
formatting pass did not reach them.

* feat(catalog): promote Carousels to its own section

It was a shelf inside Scenes & demos, which is where a scene type belongs by
kind but not by weight. At 25 items it is larger than Data & charts (17) and
Blocks (13), each of which is already a section holding a single shelf, so the
catalog's own precedent puts it one level up.

Pulling it out also takes the largest section in the catalog from 120 items to
95, which is the reason the shelf was added in the first place.

The two circle-5 pages change because their embedded source block carries the
recentred path; nothing else in them moved.

---------

Co-authored-by: Jake Moran <jake.moran@heygen.com>
Co-authored-by: Miguel Angel Simon Sierra <miguel.sierra@heygen.com>
2026-09-09 00:47:31 -04:00

206 lines
7.0 KiB
Plaintext

---
title: Contribute to the Catalog
description: Add a reusable block or component to the HyperFrames registry.
---
The Catalog is generated from the registry in the HyperFrames repository. You
can contribute a visual idea or build an item that anyone can install.
## Choose how to contribute
### Suggest an idea
Open a [GitHub issue](https://github.com/heygen-com/hyperframes/issues) with a
visual reference and explain where the effect would be useful. A screen
recording, Figma sketch, or example from another tool is enough to start.
### Build an item
Ask your agent to use the `/hyperframes-registry` skill, or follow the same
workflow below.
## Choose the item type
| Type | Use it for | Required files |
| --- | --- | --- |
| Block | A standalone composition with fixed dimensions and duration | `registry-item.json` and the composition HTML |
| Component | A snippet installed into another composition | `registry-item.json`, the snippet HTML, and a standalone `demo.html` |
Each item has its own directory under `registry/blocks/` or
`registry/components/`. Prefix every element ID with a short abbreviation of
the item name so it cannot collide when installed as a sub-composition.
```text
registry/blocks/my-block/
my-block.html
registry-item.json
registry/components/my-effect/
my-effect.html
demo.html
registry-item.json
```
The Catalog preview generator skips a component without `demo.html`.
## Define the manifest
`registry-item.json` follows the
[registry item schema](https://github.com/heygen-com/hyperframes/blob/main/packages/core/schemas/registry-item.json).
Blocks declare `dimensions` and `duration`; components must not.
```json
{
"$schema": "https://hyperframes.heygen.com/schema/registry-item.json",
"name": "my-block",
"type": "hyperframes:block",
"title": "My Block",
"description": "What this block does in one sentence",
"tags": ["category", "subcategory"],
"dimensions": { "width": 1920, "height": 1080 },
"duration": 5,
"params": [
{
"key": "--accent",
"label": "Accent",
"type": "color",
"default": "#ff4d4d"
}
],
"files": [
{
"path": "my-block.html",
"target": "compositions/my-block.html",
"type": "hyperframes:composition"
}
]
}
```
Use `params` for the values someone should be able to change in Studio without
editing HTML. Supported controls are `color`, `text`, `number`, and `select`.
Other useful optional fields include `author`, `authorUrl`, `relatedSkill`,
`registryDependencies`, `license`, `sourcePrompt`, `minCliVersion`, and
`deprecated`. The TypeScript registry types and existing manifests are the
current authority. The published JSON schema validates the shared manifest
fields but does not yet describe the block-only `params` field.
### Binary assets
The registry is served straight out of the repository, so every byte an item
ships stays in the history forever. Compositions are text and cost nothing;
images, video, audio and fonts do not.
Commit those assets in your pull request as usual. Before merging, a maintainer
runs `bun run host:registry-assets <item-name>`, which uploads them to the CDN,
adds a `url` to each `files[]` entry and removes the bytes from the tree:
```json
{
"path": "assets/carousel-images/one.jpg",
"url": "https://static.heygen.ai/hyperframes-oss/registry-assets/deadbeefdeadbeef.jpg",
"target": "assets/carousel-images/one.jpg",
"type": "hyperframes:asset"
}
```
`path` does not change. It is still where the file lands relative to the item,
so your composition HTML, the Catalog preview renderer and `hyperframes add`
all behave exactly as they did — only the source of the bytes moves. Keys are
content-addressed, so an image shared by several items uploads once and a
changed image gets a new URL rather than a stale cached one.
### Installer metadata
Use `registryDependencies` to name registry items that must be installed first.
The installer resolves dependencies transitively and rejects missing items or
cycles. Reference exact item names and keep the dependency graph small.
Set `minCliVersion` to the first CLI version that supports the item. All resolved
items, including dependencies, must pass the compatibility check before any item
files are installed. An incompatible CLI reports the required version and an
upgrade command.
Set `deprecated` to a short migration message when an item has a replacement.
The installer warns and keeps the item available for existing projects.
```json
{
"minCliVersion": "0.6.96",
"registryDependencies": ["grain-overlay"],
"deprecated": "Use my-block-v2 instead."
}
```
## Build for reuse
Every registry item must:
- use a paused GSAP timeline registered on `window.__timelines`;
- match `data-composition-id` to the registered timeline ID;
- use prefixed element IDs;
- avoid `Date.now()`, unseeded `Math.random()`, and real-time animation loops;
- seek correctly at any frame;
- work after installation outside its source directory.
A one-off example belongs in [Examples](/examples), not the Catalog.
## Validate and preview
Lint the item the way a user receives it — mounted into a real project. A bare
`npx hyperframes lint` cannot validate a registry directory, because the CLI
looks for `index.html` and items ship as `<name>.html` or `demo.html`:
```bash
bun run lint:registry-items my-block
```
To exercise the full gate, install the item into a scratch project and run there:
```bash
npx hyperframes init scratch && cd scratch
npx hyperframes add my-block
npx hyperframes check
```
Generate the Catalog page and preview assets:
```bash
npx tsx scripts/generate-catalog-pages.ts
npx tsx scripts/generate-catalog-previews.ts --only my-block
```
These generators read the item directly from the working tree. The `add`
command cannot install an unpublished local item by name: it resolves items
from the registry URL in `hyperframes.json`. Test `npx hyperframes add my-block`
from a clean project after the item is present in that registry manifest.
Do not hand-edit the generated item page. Fix its registry manifest or the
generator and regenerate it.
Watch the preview at full speed. Passing `check` proves the composition is
valid; it does not prove that the motion is readable or useful.
| Review question | What good looks like |
| --- | --- |
| Is there one visual hero? | The eye knows where to look in the first second |
| Can the important text be read once? | Information lands, then holds before the cut |
| Does motion accelerate and settle? | It does not drift at constant speed like a slide |
| Can someone restyle it? | Brand-facing values are exposed as parameters |
| Is it meaningfully reusable? | It solves a repeated production problem |
## Open the pull request
Include:
- the item directory;
- the matching entry in `registry/registry.json`;
- regenerated Catalog output;
- a `hyperframes.dev` preview from `npx hyperframes publish`;
- when to use it, its useful duration range, and any known pitfalls.
External contributors should attach the preview MP4. A maintainer will publish
the final Catalog media. HeyGen contributors can use
`scripts/upload-docs-images.sh` after preview review.