Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: rewrite to interactivity
kapishdima294b49d50c90
diff --git a/components/docs/component-preview-mdx.tsx b/components/docs/component-preview-mdx.tsxnew file mode 100644index 00000000..d642f078--- /dev/null+++ b/components/docs/component-preview-mdx.tsx@@ -0,0 +1,19 @@+import { existsSync, readFileSync } from "node:fs";+import { join } from "node:path";+import type { StudioElementPayload } from "@remotion/studio-protocol";+import { ComponentPreview } from "@/components/docs/component-preview";++const ELEMENTS_DIR = join(process.cwd(), "registry-artifacts", "elements");++function loadStudioElement(name: string): StudioElementPayload | undefined {+ if (!/^[a-z0-9-]+$/.test(name)) return undefined;+ const file = join(ELEMENTS_DIR, `${name}.json`);+ if (!existsSync(file)) return undefined;+ return JSON.parse(readFileSync(file, "utf8")) as StudioElementPayload;+}++export function ComponentPreviewMdx({ name }: { name: string }) {+ return (+ <ComponentPreview name={name} studioElement={loadStudioElement(name)} />+ );+}diff --git a/components/docs/component-preview.tsx b/components/docs/component-preview.tsxindex 2542d167..819b0702 100644--- a/components/docs/component-preview.tsx+++ b/components/docs/component-preview.tsx@@ -1,5 +1,6 @@"use client";+import type { StudioElementPayload } from "@remotion/studio-protocol";import { CheckIcon, LinkIcon, RotateCcwIcon } from "lucide-react";import { useQueryStates } from "nuqs";import { Suspense, use, useEffect, useMemo, useRef, useState } from "react";@@ -7,12 +8,22 @@ import { CodeBlock } from "@/components/docs/code-block";import { Button } from "@/components/ui/button";import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";import { useTrackEvent } from "@/lib/analytics";-import { type ComponentConfig, getDefaults } from "@/lib/customizer-config";+import {+ getDefaults,+ type ResolvedComponentConfig,+} from "@/lib/customizer-config";import { buildParsers, PreviewStage } from "@/lib/ui-preview-internals";import registry, { loadComponentConfig } from "@/registry/__index__";import { ComponentCustomizer } from "./component-customizer";+import { StudioActions } from "./studio-actions";-export function ComponentPreview({ name }: { name: string }) {+export function ComponentPreview({+ name,+ studioElement,+}: {+ name: string;+ studioElement?: StudioElementPayload;+}) {const entry = registry[name];if (!entry) {@@ -29,7 +40,7 @@ export function ComponentPreview({ name }: { name: string }) {<div className="not-prose mb-6 aspect-[1.9/1] w-full animate-pulse rounded-2xl bg-muted" />}>- <Preview name={name} load={entry.load} />+ <Preview name={name} load={entry.load} studioElement={studioElement} /></Suspense>);}@@ -37,8 +48,10 @@ export function ComponentPreview({ name }: { name: string }) {function Preview({name,load,+ studioElement,}: {name: string;+ studioElement?: StudioElementPayload;// biome-ignore lint/suspicious/noExplicitAny: dynamically-loaded Remotion composition, props shape varies per componentload: () => Promise<{ default: React.ComponentType<any> }>;}) {@@ -112,10 +125,15 @@ function Preview({return (<div className="not-prose mb-6 flex w-full flex-col gap-4"><Tabs defaultValue="preview" className="gap-3">- <TabsList>- <TabsTrigger value="preview">Preview</TabsTrigger>- <TabsTrigger value="code">Code</TabsTrigger>- </TabsList>+ <div className="flex items-center justify-between gap-3">+ <TabsList>+ <TabsTrigger value="preview">Preview</TabsTrigger>+ <TabsTrigger value="code">Code</TabsTrigger>+ </TabsList>+ {studioElement ? (+ <StudioActions name={name} payload={studioElement} />+ ) : null}+ </div><TabsContent value="preview" className="mt-0"><PreviewStage@@ -176,7 +194,10 @@ function Preview({);}-function generateCode(config: ComponentConfig, props: Record<string, unknown>) {+function generateCode(+ config: ResolvedComponentConfig,+ props: Record<string, unknown>,+) {if (config.snippet) return config.snippet(props);const propsString = Object.entries(props).map(([k, v]) => {diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsxindex 75a60511..545fe3cc 100644--- a/components/docs/icons-gallery.tsx+++ b/components/docs/icons-gallery.tsx@@ -1,10 +1,16 @@"use client";import { Player, type PlayerRef } from "@remotion/player";-import { Check, Copy, Search } from "lucide-react";+import { installInStudio, setStudioDragData } from "@remotion/studio-protocol";+import { Check, Copy, Loader2, Search } from "lucide-react";import type { ComponentType } from "react";import { useEffect, useMemo, useRef, useState } from "react";import { AbsoluteFill } from "remotion";+import { Remotion } from "@/components/ui/svgs/remotion";+import {+ getCachedStudioElement,+ loadStudioElement,+} from "@/lib/studio-element";import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";import { cn } from "@/lib/utils";import registry, { type RegistryEntry } from "@/registry/__index__";@@ -841,6 +847,8 @@ function IconTile({}) {const reducedMotion = usePrefersReducedMotion();const [copied, setCopied] = useState(false);+ const [installing, setInstalling] = useState(false);+ const [installError, setInstallError] = useState<string | null>(null);const entry = registry[icon.name];const preview = previewManifest[icon.name];const command = `npx shadcn@latest add @remocn/${icon.name}`;@@ -853,40 +861,93 @@ function IconTile({setTimeout(() => setCopied(false), 1500);};+ const handleActivate = () => {+ onActivate();+ void loadStudioElement(icon.name);+ };++ const handleDragStart = (event: React.DragEvent) => {+ const payload = getCachedStudioElement(icon.name);+ if (!payload) return;+ setStudioDragData({ dataTransfer: event.dataTransfer, payload });+ };++ const handleInstall = async () => {+ if (installing) return;+ setInstalling(true);+ setInstallError(null);+ const payload = await loadStudioElement(icon.name);+ if (!payload) {+ setInstalling(false);+ return;+ }+ const result = await installInStudio({ payload });+ setInstalling(false);+ if (!result.success) {+ setInstallError(result.message);+ setTimeout(() => setInstallError(null), 5000);+ }+ };+return (- <button- type="button"- onClick={handleCopy}- onMouseEnter={onActivate}- onMouseLeave={onDeactivate}- onFocus={onActivate}- onBlur={onDeactivate}- title={command}- aria-label={`Copy install command for ${icon.label}`}- className={cn(- "surface-card surface-card-interactive group relative flex aspect-square flex-col items-center justify-center gap-2 rounded-xl p-3 text-muted-foreground transition-[color,box-shadow]",- "hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",- )}- >- <span- className="flex items-center justify-center"- style={{ width: MEDIA_SIZE, height: MEDIA_SIZE }}- >- {playing && entry && preview ? (- <IconPlayer load={entry.load} preview={preview} />- ) : (- <Static size={GLYPH_SIZE} strokeWidth={2} />+ <div className="group relative">+ <button+ type="button"+ draggable+ onDragStart={handleDragStart}+ onClick={handleCopy}+ onMouseEnter={handleActivate}+ onMouseLeave={onDeactivate}+ onFocus={handleActivate}+ onBlur={onDeactivate}+ title={command}+ aria-label={`Copy install command for ${icon.label}`}+ className={cn(+ "surface-card surface-card-interactive relative flex aspect-square w-full flex-col items-center justify-center gap-2 rounded-xl p-3 text-muted-foreground transition-[color,box-shadow]",+ "hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",)}- </span>- <span className="max-w-full truncate text-xs">{icon.label}</span>- <span className="absolute top-1.5 right-1.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">- {copied ? (- <Check className="size-3.5" />+ >+ <span+ className="flex items-center justify-center"+ style={{ width: MEDIA_SIZE, height: MEDIA_SIZE }}+ >+ {playing && entry && preview ? (+ <IconPlayer load={entry.load} preview={preview} />+ ) : (+ <Static size={GLYPH_SIZE} strokeWidth={2} />+ )}+ </span>+ <span className="max-w-full truncate text-xs">{icon.label}</span>+ <span className="absolute top-1.5 right-1.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">+ {copied ? (+ <Check className="size-3.5" />+ ) : (+ <Copy className="size-3.5" />+ )}+ </span>+ </button>+ <button+ type="button"+ onClick={handleInstall}+ aria-label={`Add ${icon.label} to Remotion Studio`}+ title="Add to Remotion Studio"+ className="absolute top-1.5 left-1.5 rounded-md p-0.5 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 group-hover:opacity-100"+ >+ {installing ? (+ <Loader2 className="size-3.5 animate-spin" />) : (- <Copy className="size-3.5" />+ <Remotion className="size-3.5" />)}- </span>- </button>+ </button>+ {installError ? (+ <span+ title={installError}+ className="absolute inset-x-1.5 bottom-1.5 truncate rounded-md bg-background/90 px-1.5 py-0.5 text-[10px] text-muted-foreground"+ >+ {installError}+ </span>+ ) : null}+ </div>);}diff --git a/components/docs/studio-actions.tsx b/components/docs/studio-actions.tsxnew file mode 100644index 00000000..6c1c6aa1--- /dev/null+++ b/components/docs/studio-actions.tsx@@ -0,0 +1,92 @@+"use client";++import {+ installInStudio,+ type StudioElementPayload,+ setStudioDragData,+} from "@remotion/studio-protocol";+import { GripVerticalIcon, Loader2Icon } from "lucide-react";+import { useEffect, useRef, useState } from "react";+import { Button } from "@/components/ui/button";+import { Remotion } from "@/components/ui/svgs/remotion";+import { useTrackEvent } from "@/lib/analytics";++type Status = "idle" | "pending" | "error";++export function StudioActions({+ name,+ payload,+}: {+ name: string;+ payload: StudioElementPayload;+}) {+ const trackEvent = useTrackEvent();+ const [status, setStatus] = useState<Status>("idle");+ const [message, setMessage] = useState<string | null>(null);+ const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);++ useEffect(() => {+ return () => {+ if (resetTimer.current) clearTimeout(resetTimer.current);+ };+ }, []);++ const handleInstall = async () => {+ if (status === "pending") return;+ setStatus("pending");+ setMessage(null);+ trackEvent("studio_install_clicked", { component: name });+ const result = await installInStudio({ payload });+ if (result.success) {+ setStatus("idle");+ } else {+ setStatus("error");+ setMessage(result.message);+ if (resetTimer.current) clearTimeout(resetTimer.current);+ resetTimer.current = setTimeout(() => {+ setStatus("idle");+ setMessage(null);+ }, 6000);+ }+ };++ const handleDragStart = (event: React.DragEvent) => {+ setStudioDragData({ dataTransfer: event.dataTransfer, payload });+ trackEvent("studio_drag_started", { component: name });+ };++ return (+ <div className="flex min-w-0 items-center gap-1.5">+ {message ? (+ <span className="truncate text-xs text-muted-foreground">+ {message}+ </span>+ ) : null}+ <Button+ variant="outline"+ size="sm"+ onClick={handleInstall}+ disabled={status === "pending"}+ className="text-muted-foreground hover:text-foreground"+ >+ {status === "pending" ? (+ <Loader2Icon className="size-3.5 animate-spin" />+ ) : (+ <Remotion className="size-3.5" />+ )}+ Add to Remotion Studio+ </Button>+ <Button+ variant="outline"+ size="icon-sm"+ draggable+ onDragStart={handleDragStart}+ aria-label="Drag into Remotion Studio"+ title="Drag into Remotion Studio"+ className="cursor-grab text-muted-foreground hover:text-foreground active:cursor-grabbing"+ >+ <GripVerticalIcon className="size-3.5" />+ </Button>+ </div>+ );+}diff --git a/components/ui/svgs/remotion.tsx b/components/ui/svgs/remotion.tsxindex 697ec109..aa57f59b 100644--- a/components/ui/svgs/remotion.tsx+++ b/components/ui/svgs/remotion.tsx@@ -5,12 +5,12 @@ const Remotion = (props: SVGProps<SVGSVGElement>) => (<pathd="M81.0309 33.9631C77.1822 34.1706 74.0808 34.777 70.9553 35.9581C69.3966 36.5407 66.8415 37.8095 65.4355 38.6874C59.554 42.3503 55.0706 47.8566 52.7325 54.2647C52.2665 55.5335 51.0051 59.5795 50.1936 62.3646C44.7862 80.9823 41.7169 101.34 41.0581 122.886C40.9536 126.318 40.9536 134.489 41.0581 137.865C41.5 152.15 42.8739 165.046 45.3647 178.197C46.3771 183.52 48.0001 190.67 48.9401 193.918C50.8604 200.517 54.7814 206.135 60.3575 210.253C64.0937 213.014 68.336 214.866 73.0363 215.776C75.3021 216.214 78.291 216.414 80.4925 216.27C83.5377 216.071 89.5798 215.265 94.489 214.395C116.617 210.477 137.057 203.462 155.593 193.423C167.332 187.063 177.367 180.176 187.049 171.821C196.699 163.505 204.926 154.56 212.166 144.521C213.845 142.198 214.689 140.842 215.532 139.134C217.702 134.729 218.722 130.348 218.714 125.448C218.714 120.883 217.846 116.829 215.974 112.68C215.074 110.677 214.215 109.24 212.286 106.511C205.184 96.4639 197.301 87.7096 187.692 79.2027C172.796 66.0195 155.103 55.2063 135.346 47.2022C131.063 45.4705 126.845 43.9463 121.767 42.2944C111.016 38.8071 97.711 35.7826 86.4543 34.2743C84.6867 34.0349 82.2843 33.8992 81.0309 33.9631Z"fill="currentColor"- fillOpacity={0.1}+ fillOpacity="0.1"/><pathd="M91.4565 53.3788C88.428 53.5421 85.9875 54.0193 83.528 54.9487C82.3015 55.4071 80.2909 56.4056 79.1844 57.0964C74.5563 59.9787 71.0284 64.3116 69.1885 69.3542C68.8218 70.3526 67.8291 73.5364 67.1906 75.728C62.9355 90.3783 60.5203 106.398 60.0018 123.353C59.9196 126.053 59.9196 132.483 60.0018 135.139C60.3496 146.38 61.4307 156.528 63.3907 166.877C64.1874 171.065 65.4645 176.692 66.2042 179.248C67.7153 184.441 70.8007 188.862 75.1886 192.102C78.1286 194.275 81.4669 195.732 85.1656 196.447C86.9485 196.793 89.3005 196.95 91.0329 196.837C93.4291 196.68 98.1837 196.046 102.047 195.361C119.459 192.278 135.544 186.758 150.13 178.858C159.367 173.853 167.264 168.434 174.882 161.859C182.476 155.316 188.95 148.276 194.647 140.377C195.968 138.549 196.632 137.482 197.296 136.138C199.003 132.672 199.806 129.224 199.8 125.368C199.8 121.776 199.117 118.586 197.644 115.321C196.936 113.745 196.259 112.614 194.742 110.467C189.152 102.561 182.95 95.6721 175.388 88.978C163.666 78.6041 149.744 70.0952 134.197 63.7967C130.827 62.434 127.508 61.2346 123.512 59.9347C115.052 57.1905 104.582 54.8106 95.7242 53.6237C94.3333 53.4353 92.4428 53.3286 91.4565 53.3788Z"fill="currentColor"- fillOpacity={0.3}+ fillOpacity="0.3"/><pathd="M102.247 73.5165C100.069 73.6339 98.314 73.9771 96.5452 74.6455C95.6632 74.9751 94.2173 75.6932 93.4216 76.1899C90.0933 78.2628 87.5562 81.3787 86.2331 85.005C85.9694 85.7231 85.2555 88.0126 84.7963 89.5887C81.7363 100.124 79.9994 111.644 79.6266 123.838C79.5675 125.779 79.5675 130.404 79.6266 132.314C79.8767 140.397 80.6542 147.695 82.0637 155.137C82.6366 158.15 83.555 162.196 84.087 164.034C85.1737 167.768 87.3925 170.948 90.548 173.278C92.6623 174.84 95.063 175.888 97.7229 176.403C99.0051 176.651 100.696 176.764 101.942 176.683C103.666 176.57 107.085 176.114 109.863 175.622C122.385 173.404 133.952 169.435 144.441 163.754C151.084 160.155 156.763 156.257 162.242 151.529C167.703 146.824 172.359 141.761 176.455 136.08C177.406 134.766 177.883 133.998 178.36 133.032C179.588 130.539 180.165 128.06 180.161 125.287C180.161 122.704 179.67 120.41 178.61 118.062C178.101 116.928 177.615 116.115 176.523 114.571C172.504 108.885 168.044 103.931 162.606 99.1173C154.176 91.657 144.164 85.5379 132.983 81.0084C130.56 80.0285 128.173 79.1659 125.299 78.2311C119.216 76.2577 111.686 74.5461 105.316 73.6926C104.316 73.5571 102.956 73.4804 102.247 73.5165Z"diff --git a/content/changelog/2026-08-19-studio-protocol.mdx b/content/changelog/2026-08-19-studio-protocol.mdxnew file mode 100644index 00000000..f0982c04--- /dev/null+++ b/content/changelog/2026-08-19-studio-protocol.mdx@@ -0,0 +1,13 @@+---+title: Add to Studio+date: 2026-08-19+---++Until now there was one way to get a remocn component into your project — `npx shadcn add`, then wire it into a composition by hand. That is still the canonical path, but if a Remotion Studio (4.0.502+) is running locally, the site can now talk to it directly through the [Remotion Studio Protocol](https://www.remotion.dev/docs/studio-protocol/).++### Improvements++- Component pages grew an **Add to Studio** button and a drag handle next to the Preview/Code tabs. The button finds your running Studio and installs the component into the active composition; the handle lets you drag the element onto the timeline and choose its place yourself. Both deliver the same thing the CLI does — editable source code in your project, not a black box.+- The [icons gallery](/docs/icons/gallery) works the same way: every tile is draggable, and a hover button installs the icon in one click.+- Elements arrive editable, not frozen. Almost every element ships with the same knobs its docs page has — text, colors, timings, speed — declared through Remotion's own `InteractivitySchema` and rendered as native controls in the Studio sidebar, plus the standard timeline and transform controls on top. Under the hood the whole catalog now authors its controls in that schema format, so the docs customizer and the Studio panel are generated from one source.+- Coverage is honest rather than total. Primitives, shaders, effects, filters and all icons ship as Studio Elements; compositions and components that build on other remocn components keep the CLI as their only path, because flattening them into a single file would produce source nobody wants to remix. Where the button is absent, `npx shadcn add` is the answer.diff --git a/content/docs/getting-started/installation.mdx b/content/docs/getting-started/installation.mdxindex 718266c3..b8e73793 100644--- a/content/docs/getting-started/installation.mdx+++ b/content/docs/getting-started/installation.mdx@@ -27,6 +27,12 @@ Want the whole library at once? Copy this command to add every remocn component<InstallAll />+## Add straight to Remotion Studio++If a [Remotion Studio](https://www.remotion.dev/docs/studio) (4.0.502 or newer) is running locally, most components can skip the CLI entirely. Component pages show an **Add to Studio** button next to the preview — it finds your running Studio and drops the component into the active composition as source code. The drag handle beside it does the same thing by drag and drop, so you can place the element on the timeline yourself. Icons work the same way from the [icons gallery](/docs/icons/gallery).++Either way the result matches `npx shadcn add`: the source lands in your project and is yours to edit. On top of that, elements arrive with editable controls — the same knobs each docs page shows (text, colors, timings, speed) appear as native controls in the Studio sidebar, alongside the standard timeline and transform handles. Compositions and components that build on other remocn components install through the CLI only.+## 3. Use it in a Remotion composition```tsxdiff --git a/lib/analytics.ts b/lib/analytics.tsindex c1869068..8b69b0e3 100644--- a/lib/analytics.ts+++ b/lib/analytics.ts@@ -52,6 +52,12 @@ type AnalyticsEvents = {docs_component_viewed: {component: string;};+ studio_install_clicked: {+ component: string;+ };+ studio_drag_started: {+ component: string;+ };};export function useTrackEvent() {diff --git a/lib/customizer-config.test.ts b/lib/customizer-config.test.tsnew file mode 100644index 00000000..d7b7ccf3--- /dev/null+++ b/lib/customizer-config.test.ts@@ -0,0 +1,47 @@+import { describe, expect, it } from "bun:test";+import { resolve } from "node:path";+import { Glob } from "bun";+import type { ComponentConfig } from "./customizer-config";+import { schemaFieldToControl } from "./customizer-config";++const configFiles = [...new Glob("registry/*/*/config.ts").scanSync(".")];++async function loadConfigs(): Promise<[string, ComponentConfig][]> {+ return Promise.all(+ configFiles.map(async (file) => {+ const mod = await import(resolve(file));+ const config = Object.values(mod).find(+ (v) => v && typeof v === "object" && "controls" in (v as object),+ ) as ComponentConfig | undefined;+ if (!config) throw new Error(`${file}: no exported config with controls`);+ return [file, config] as [string, ComponentConfig];+ }),+ );+}++describe("config schemas", () => {+ it("every schema field has a concrete default", async () => {+ const bad: string[] = [];+ for (const [file, config] of await loadConfigs()) {+ for (const [key, field] of Object.entries(config.controls)) {+ if (field.type === "hidden") continue;+ if (!("default" in field) || field.default === undefined || field.default === null) {+ bad.push(`${file}: ${key}`);+ }+ }+ }+ expect(bad).toEqual([]);+ });++ it("every schema field renders in the docs customizer", async () => {+ const bad: string[] = [];+ for (const [file, config] of await loadConfigs()) {+ for (const [key, field] of Object.entries(config.controls)) {+ if (schemaFieldToControl(field) === null) {+ bad.push(`${file}: ${key} (${field.type})`);+ }+ }+ }+ expect(bad).toEqual([]);+ });+});diff --git a/lib/customizer-config.ts b/lib/customizer-config.tsindex 40bbfb35..ca13bcc5 100644--- a/lib/customizer-config.ts+++ b/lib/customizer-config.ts@@ -1,5 +1,11 @@+import type { InteractivitySchema, InteractivitySchemaField } from "remotion";import type { BackdropFill } from "@/registry/remocn/backdrop";+/**+ * Internal control descriptors consumed by the docs customizer UI and the+ * nuqs parsers. Authored configs no longer use this shape — they declare a+ * Remotion `InteractivitySchema` and `resolveControls` converts it here.+ */export type ControlType =| { type: "text"; default: string; label: string }| {@@ -25,7 +31,15 @@ export type ControlType =export type ControlConfig = Record<string, ControlType>;export interface ComponentConfig {- controls: ControlConfig;+ /**+ * Remotion `InteractivitySchema` describing the component's props — the+ * same format official Remotion Elements use, so the Studio element+ * generator can embed it verbatim. Convention: a `number` field with `max`+ * renders as a slider in the docs customizer, without `max` as an input.+ * Defaults must be concrete (the site needs them), even though Remotion's+ * type allows `undefined`.+ */+ controls: InteractivitySchema;durationInFrames: number;fps: number;compositionWidth: number;@@ -49,24 +63,40 @@ export interface ComponentConfig {previewBackdrop?: BackdropFill;}+/** `ComponentConfig` after `resolveConfig`: schema converted for the site UI. */+export interface ResolvedComponentConfig+ extends Omit<ComponentConfig, "controls"> {+ controls: ControlConfig;+}+export const FPS = 30;export const W = 1280;export const H = 720;export const FONT_WEIGHT_OPTIONS = ["400", "500", "600", "700"];+/** Flat select options expressed as InteractivitySchema enum variants. */+export function enumVariants(+ options: readonly string[],+): Record<string, InteractivitySchema> {+ const out: Record<string, InteractivitySchema> = {};+ for (const option of options) out[option] = {};+ return out;+}+/**- * Controls present on every animation. Merged into each component's controls+ * Controls present on every animation. Merged into each component's schema* by `resolveControls` so every animation in the customizer exposes the same* baseline knobs.*/-export const SHARED_CONTROLS: ControlConfig = {+export const SHARED_CONTROLS: InteractivitySchema = {speed: {type: "number",default: 1,min: 0.25,max: 4,step: 0.25,- label: "Speed",+ description: "Speed",+ hiddenFromList: false,},};@@ -93,33 +123,107 @@ const SPEED_MIN_ONE = new Set(["x-followers-overview",]);-const SPEED_MIN_ONE_CONTROL: ControlType = {+const SPEED_MIN_ONE_FIELD: InteractivitySchemaField = {type: "number",default: 1,min: 1,max: 4,step: 0.25,- label: "Speed",+ description: "Speed",+ hiddenFromList: false,};-export function resolveControls(+/**+ * Merges the shared schema fields into a component's schema, applying the+ * per-component speed rules. Returns the schema that also feeds the Studio+ * element generator.+ */+export function resolveSchema(slug: string,- controls: ControlConfig,-): ControlConfig {- const out: ControlConfig = { ...controls, ...SHARED_CONTROLS };+ schema: InteractivitySchema,+): InteractivitySchema {+ const out: InteractivitySchema = { ...schema, ...SHARED_CONTROLS };if (NO_SHARED_SPEED.has(slug)) {delete out.speed;return out;}// Reassigning the existing key keeps `speed` in its merged position.- if (SPEED_MIN_ONE.has(slug)) out.speed = SPEED_MIN_ONE_CONTROL;+ if (SPEED_MIN_ONE.has(slug)) out.speed = SPEED_MIN_ONE_FIELD;return out;}+/**+ * Converts one schema field into the customizer's internal control shape.+ * Returns null for field types the docs customizer does not render+ * (`hidden`, transform fields, captions, …).+ */+export function schemaFieldToControl(+ field: InteractivitySchemaField,+): ControlType | null {+ switch (field.type) {+ case "text-content":+ return {+ type: "text",+ default: field.default,+ label: field.description ?? "",+ };+ case "number": {+ if (field.default === null || field.default === undefined) return null;+ const base = {+ default: field.default,+ min: field.min ?? 0,+ step: field.step ?? 1,+ label: field.description ?? "",+ };+ return field.max === undefined+ ? { type: "number-input", max: Number.MAX_SAFE_INTEGER, ...base }+ : { type: "number", max: field.max, ...base };+ }+ case "color":+ if (field.default === undefined) return null;+ return {+ type: "color",+ default: field.default,+ label: field.description ?? "",+ };+ case "boolean":+ return {+ type: "boolean",+ default: field.default,+ label: field.description ?? "",+ };+ case "enum":+ return {+ type: "select",+ default: field.default,+ options: Object.keys(field.variants),+ label: field.description ?? "",+ };+ default:+ return null;+ }+}++export function schemaToControls(schema: InteractivitySchema): ControlConfig {+ const out: ControlConfig = {};+ for (const [key, field] of Object.entries(schema)) {+ const control = schemaFieldToControl(field);+ if (control) out[key] = control;+ }+ return out;+}++export function resolveControls(+ slug: string,+ schema: InteractivitySchema,+): ControlConfig {+ return schemaToControls(resolveSchema(slug, schema));+}+export function resolveConfig(slug: string,config: ComponentConfig,-): ComponentConfig {+): ResolvedComponentConfig {return { ...config, controls: resolveControls(slug, config.controls) };}diff --git a/lib/studio-element.ts b/lib/studio-element.tsnew file mode 100644index 00000000..1e4f456d--- /dev/null+++ b/lib/studio-element.ts@@ -0,0 +1,25 @@+import type { StudioElementPayload } from "@remotion/studio-protocol";++const cache = new Map<string, StudioElementPayload | null>();++export function getCachedStudioElement(+ name: string,+): StudioElementPayload | null {+ return cache.get(name) ?? null;+}++export async function loadStudioElement(+ name: string,+): Promise<StudioElementPayload | null> {+ const cached = cache.get(name);+ if (cached !== undefined) return cached;+ try {+ const mod = await import(`@/registry-artifacts/elements/${name}.json`);+ const payload = mod.default as StudioElementPayload;+ cache.set(name, payload);+ return payload;+ } catch {+ cache.set(name, null);+ return null;+ }+}diff --git a/mdx-components.tsx b/mdx-components.tsxindex a54aca95..d02cad59 100644--- a/mdx-components.tsx+++ b/mdx-components.tsx@@ -8,7 +8,7 @@ import { CanvasTransitionNote } from "@/components/docs/canvas-transition-note";import { getIconForLanguage } from "@/components/docs/code-icons";import { ComponentCardGrid } from "@/components/docs/component-card-grid";import { ComponentExample } from "@/components/docs/component-example";-import { ComponentPreview } from "@/components/docs/component-preview";+import { ComponentPreviewMdx } from "@/components/docs/component-preview-mdx";import { CopyButton } from "@/components/docs/copy-button";import { Dependencies } from "@/components/docs/dependencies";import { GuideVideo } from "@/components/docs/guide-video";@@ -104,7 +104,7 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {code: Code,// Custom doc widgets — registrations only, not reimplemented here.- ComponentPreview,+ ComponentPreview: ComponentPreviewMdx,ComponentExample,UiComponentPreview,BlockPreview,diff --git a/registry-artifacts/elements/animated-bar-chart.json b/registry-artifacts/elements/animated-bar-chart.jsonindex a8f82949..188f2d97 100644--- a/registry-artifacts/elements/animated-bar-chart.json+++ b/registry-artifacts/elements/animated-bar-chart.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Animated Bar Chart","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "animated-bar-chart",- "sourceCode": "import { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedBarChart({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n transform: `scaleY(${scaleY})`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nfunction AnimatedBarChartBase({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n transform: `scaleY(${scaleY})`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n barColor: {\n type: \"color\",\n default: \"#0ea5e9\",\n description: \"Bar color\",\n },\n gap: {\n type: \"number\",\n min: 0,\n max: 80,\n step: 2,\n default: 16,\n description: \"Gap\",\n hiddenFromList: false,\n },\n staggerFrames: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 6,\n description: \"Stagger frames\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"barColor\",\"gap\",\"staggerFrames\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n barColor: \"#0ea5e9\",\n gap: 16,\n staggerFrames: 6,\n speed: 1,\n};\n\ntype AnimatedBarChartElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AnimatedBarChartBase>;\n\nconst AnimatedBarChartInner = forwardRef<\n HTMLDivElement,\n AnimatedBarChartElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AnimatedBarChart>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AnimatedBarChartBase\n {...(componentProps as unknown as ComponentProps<typeof AnimatedBarChartBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AnimatedBarChart = Interactive.withSchema({\n Component: AnimatedBarChartInner,\n componentName: \"<AnimatedBarChart>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/animated-line-chart.json b/registry-artifacts/elements/animated-line-chart.jsonindex 0cf5df38..f11aa95b 100644--- a/registry-artifacts/elements/animated-line-chart.json+++ b/registry-artifacts/elements/animated-line-chart.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Animated Line Chart","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "animated-line-chart",- "sourceCode": "import { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedLineChartProps {\n data?: number[];\n width?: number;\n height?: number;\n strokeColor?: string;\n strokeWidth?: number;\n gridColor?: string;\n showDot?: boolean;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedLineChart({\n data = [12, 19, 8, 15, 22, 18, 28, 25, 32],\n width = 1000,\n height = 500,\n strokeColor = \"#22c55e\",\n strokeWidth = 4,\n gridColor = \"#27272a\",\n showDot = true,\n speed = 1,\n className,\n}: AnimatedLineChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const padding = 60;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n\n const points = data.map((value, index) => {\n const x = padding + (index / (data.length - 1)) * innerWidth;\n const y = padding + innerHeight - ((value - min) / range) * innerHeight;\n return { x, y };\n });\n\n // Analytical path length: sum of segment distances\n let pathLength = 0;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n pathLength += Math.sqrt(dx * dx + dy * dy);\n }\n\n const d = points\n .map((p, i) => `${i === 0 ? \"M\" : \"L\"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)\n .join(\" \");\n\n // Spring-driven progress: smooth, no bounce. Matches the \"smooth\" preset\n // from remotion-best-practices/timing.md.\n const progress = spring({\n frame,\n fps,\n durationInFrames: Math.round(durationInFrames * 0.85),\n config: { damping: 200 },\n });\n\n const dashOffset = pathLength * (1 - progress);\n\n // Find dot position along the path at current progress\n const targetLen = pathLength * progress;\n let traveled = 0;\n let dotX = points[0].x;\n let dotY = points[0].y;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const segLen = Math.sqrt(dx * dx + dy * dy);\n if (traveled + segLen >= targetLen) {\n const t = (targetLen - traveled) / segLen;\n dotX = points[i - 1].x + dx * t;\n dotY = points[i - 1].y + dy * t;\n break;\n }\n traveled += segLen;\n dotX = points[i].x;\n dotY = points[i].y;\n }\n\n const gridRows = 4;\n const gridCols = data.length - 1;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n >\n {/* Horizontal grid */}\n {Array.from({ length: gridRows + 1 }).map((_, i) => {\n const y = padding + (i / gridRows) * innerHeight;\n return (\n <line\n key={`h-${i}`}\n x1={padding}\n x2={padding + innerWidth}\n y1={y}\n y2={y}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Vertical grid */}\n {Array.from({ length: gridCols + 1 }).map((_, i) => {\n const x = padding + (i / gridCols) * innerWidth;\n return (\n <line\n key={`v-${i}`}\n x1={x}\n x2={x}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Axis */}\n <line\n x1={padding}\n x2={padding}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={padding + innerHeight}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n\n {/* Animated line */}\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={pathLength}\n strokeDashoffset={dashOffset}\n style={{\n filter: `drop-shadow(0 0 12px ${strokeColor}55)`,\n }}\n />\n\n {showDot && progress > 0 && progress < 1 && (\n <circle\n cx={dotX}\n cy={dotY}\n r={strokeWidth * 2}\n fill={strokeColor}\n style={{\n filter: `drop-shadow(0 0 8px ${strokeColor})`,\n }}\n />\n )}\n </svg>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface AnimatedLineChartProps {\n data?: number[];\n width?: number;\n height?: number;\n strokeColor?: string;\n strokeWidth?: number;\n gridColor?: string;\n showDot?: boolean;\n speed?: number;\n className?: string;\n}\n\nfunction AnimatedLineChartBase({\n data = [12, 19, 8, 15, 22, 18, 28, 25, 32],\n width = 1000,\n height = 500,\n strokeColor = \"#22c55e\",\n strokeWidth = 4,\n gridColor = \"#27272a\",\n showDot = true,\n speed = 1,\n className,\n}: AnimatedLineChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const padding = 60;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n\n const points = data.map((value, index) => {\n const x = padding + (index / (data.length - 1)) * innerWidth;\n const y = padding + innerHeight - ((value - min) / range) * innerHeight;\n return { x, y };\n });\n\n // Analytical path length: sum of segment distances\n let pathLength = 0;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n pathLength += Math.sqrt(dx * dx + dy * dy);\n }\n\n const d = points\n .map((p, i) => `${i === 0 ? \"M\" : \"L\"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)\n .join(\" \");\n\n // Spring-driven progress: smooth, no bounce. Matches the \"smooth\" preset\n // from remotion-best-practices/timing.md.\n const progress = spring({\n frame,\n fps,\n durationInFrames: Math.round(durationInFrames * 0.85),\n config: { damping: 200 },\n });\n\n const dashOffset = pathLength * (1 - progress);\n\n // Find dot position along the path at current progress\n const targetLen = pathLength * progress;\n let traveled = 0;\n let dotX = points[0].x;\n let dotY = points[0].y;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const segLen = Math.sqrt(dx * dx + dy * dy);\n if (traveled + segLen >= targetLen) {\n const t = (targetLen - traveled) / segLen;\n dotX = points[i - 1].x + dx * t;\n dotY = points[i - 1].y + dy * t;\n break;\n }\n traveled += segLen;\n dotX = points[i].x;\n dotY = points[i].y;\n }\n\n const gridRows = 4;\n const gridCols = data.length - 1;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n >\n {/* Horizontal grid */}\n {Array.from({ length: gridRows + 1 }).map((_, i) => {\n const y = padding + (i / gridRows) * innerHeight;\n return (\n <line\n key={`h-${i}`}\n x1={padding}\n x2={padding + innerWidth}\n y1={y}\n y2={y}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Vertical grid */}\n {Array.from({ length: gridCols + 1 }).map((_, i) => {\n const x = padding + (i / gridCols) * innerWidth;\n return (\n <line\n key={`v-${i}`}\n x1={x}\n x2={x}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Axis */}\n <line\n x1={padding}\n x2={padding}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={padding + innerHeight}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n\n {/* Animated line */}\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={pathLength}\n strokeDashoffset={dashOffset}\n style={{\n filter: `drop-shadow(0 0 12px ${strokeColor}55)`,\n }}\n />\n\n {showDot && progress > 0 && progress < 1 && (\n <circle\n cx={dotX}\n cy={dotY}\n r={strokeWidth * 2}\n fill={strokeColor}\n style={{\n filter: `drop-shadow(0 0 8px ${strokeColor})`,\n }}\n />\n )}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n strokeColor: {\n type: \"color\",\n default: \"#22c55e\",\n description: \"Stroke color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 16,\n step: 1,\n default: 4,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n gridColor: {\n type: \"color\",\n default: \"#27272a\",\n description: \"Grid color\",\n },\n showDot: {\n type: \"boolean\",\n default: true,\n description: \"Show leading dot\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"strokeColor\",\"strokeWidth\",\"gridColor\",\"showDot\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n strokeColor: \"#22c55e\",\n strokeWidth: 4,\n gridColor: \"#27272a\",\n showDot: true,\n speed: 1,\n};\n\ntype AnimatedLineChartElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AnimatedLineChartBase>;\n\nconst AnimatedLineChartInner = forwardRef<\n HTMLDivElement,\n AnimatedLineChartElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AnimatedLineChart>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AnimatedLineChartBase\n {...(componentProps as unknown as ComponentProps<typeof AnimatedLineChartBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AnimatedLineChart = Interactive.withSchema({\n Component: AnimatedLineChartInner,\n componentName: \"<AnimatedLineChart>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/ascii-render.json b/registry-artifacts/elements/ascii-render.jsonindex 6bbbefbf..209c93da 100644--- a/registry-artifacts/elements/ascii-render.json+++ b/registry-artifacts/elements/ascii-render.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "ASCII Render","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "ascii-render",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type AsciiRenderProps = {\n glyphSize?: number;\n charset?: string;\n colored?: boolean;\n ink?: string;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n glyphSize: 26,\n charset: \" .:-=+*#%@\",\n colored: false,\n ink: \"#9dff9d\",\n intensity: 1,\n};\n\nconst GLYPH_ASPECT = 0.545;\nconst ATLAS_CELL_W = 24;\nconst ATLAS_CELL_H = 44;\nconst ATLAS_FONT =\n 'ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace';\n\ntype NormalizedProps = {\n cellX: number;\n cellY: number;\n charset: string;\n colored: boolean;\n ink: string;\n intensity: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform sampler2D u_atlas;\nuniform vec2 u_cell;\nuniform float u_glyph_count;\nuniform float u_colored;\nuniform vec3 u_ink;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 3;\n\nvec4 cellAverage(vec2 center, vec2 cell) {\n vec4 sum = vec4(0.0);\n for (int y = 0; y < TAPS; y++) {\n for (int x = 0; x < TAPS; x++) {\n vec2 offset = (vec2(float(x), float(y)) + 0.5) / float(TAPS) - 0.5;\n sum += texture(u_scene, center + offset * cell);\n }\n }\n return sum / float(TAPS * TAPS);\n}\n\nvoid main() {\n vec2 cell = max(u_cell, vec2(0.001));\n vec2 origin = floor(v_uv / cell) * cell;\n vec4 sampled = cellAverage(origin + cell * 0.5, cell);\n\n float luma = dot(sampled.rgb, vec3(0.299, 0.587, 0.114));\n float index = min(floor(luma * u_glyph_count), u_glyph_count - 1.0);\n\n vec2 local = clamp((v_uv - origin) / cell, 0.008, 0.992);\n float mask =\n texture(u_atlas, vec2((index + local.x) / u_glyph_count, local.y)).r;\n\n vec3 glyph = mix(u_ink, sampled.rgb, u_colored) * mask;\n vec4 source = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n outColor = vec4(\n mix(source.rgb, glyph, amount),\n mix(source.a, max(mask, sampled.a), amount)\n );\n}`;\n\ntype Atlas = { charset: string; texture: WebGLTexture };\n\nconst atlases = new WeakMap<WebGL2RenderingContext, Atlas>();\n\nfunction drawAtlas(charset: string): OffscreenCanvas {\n const canvas = new OffscreenCanvas(\n ATLAS_CELL_W * charset.length,\n ATLAS_CELL_H,\n );\n const context = canvas.getContext(\"2d\");\n if (!context) {\n throw new Error(\"ascii-render: failed to acquire a 2D context\");\n }\n context.fillStyle = \"#000000\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#ffffff\";\n context.font = `${Math.round(ATLAS_CELL_H * 0.74)}px ${ATLAS_FONT}`;\n context.textAlign = \"center\";\n context.textBaseline = \"middle\";\n for (let i = 0; i < charset.length; i++) {\n context.fillText(\n charset[i],\n i * ATLAS_CELL_W + ATLAS_CELL_W / 2,\n ATLAS_CELL_H / 2,\n );\n }\n return canvas;\n}\n\nfunction bindAtlas(gl: WebGL2RenderingContext, charset: string): void {\n gl.activeTexture(gl.TEXTURE1);\n\n let atlas = atlases.get(gl);\n if (!atlas) {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"ascii-render: failed to create the glyph atlas\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n atlas = { charset: \"\", texture };\n atlases.set(gl, atlas);\n } else {\n gl.bindTexture(gl.TEXTURE_2D, atlas.texture);\n }\n\n if (atlas.charset !== charset) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n drawAtlas(charset),\n );\n atlas.charset = charset;\n }\n}\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { cellX, cellY, charset, colored, ink, intensity } = passedProps;\n bindAtlas(gl, charset);\n gl.uniform1i(uniform(\"u_atlas\"), 1);\n gl.uniform1f(uniform(\"u_glyph_count\"), charset.length);\n gl.uniform2f(uniform(\"u_cell\"), cellX, cellY);\n gl.uniform1f(uniform(\"u_colored\"), colored ? 1 : 0);\n gl.uniform3fv(uniform(\"u_ink\"), toRgb(ink));\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst AsciiRenderFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n}) => <AbsoluteFill>{children}</AbsoluteFill>;\n\nconst AsciiRenderCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: AsciiRenderFallback,\n});\n\nexport const AsciiRender: React.FC<AsciiRenderProps & CanvasFilterProps> = ({\n glyphSize = DEFAULTS.glyphSize,\n charset = DEFAULTS.charset,\n colored = DEFAULTS.colored,\n ink = DEFAULTS.ink,\n intensity = DEFAULTS.intensity,\n children,\n}) => {\n const { width, height } = useVideoConfig();\n const resolved = charset.length > 0 ? charset : DEFAULTS.charset;\n\n return (\n <AsciiRenderCanvas\n cellX={(glyphSize * GLYPH_ASPECT) / width}\n cellY={glyphSize / height}\n charset={resolved}\n colored={colored}\n ink={ink}\n intensity={intensity}\n >\n {children}\n </AsciiRenderCanvas>\n );\n};"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype AsciiRenderProps = {\n glyphSize?: number;\n charset?: string;\n colored?: boolean;\n ink?: string;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n glyphSize: 26,\n charset: \" .:-=+*#%@\",\n colored: false,\n ink: \"#9dff9d\",\n intensity: 1,\n};\n\nconst GLYPH_ASPECT = 0.545;\nconst ATLAS_CELL_W = 24;\nconst ATLAS_CELL_H = 44;\nconst ATLAS_FONT =\n 'ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace';\n\ntype NormalizedProps = {\n cellX: number;\n cellY: number;\n charset: string;\n colored: boolean;\n ink: string;\n intensity: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform sampler2D u_atlas;\nuniform vec2 u_cell;\nuniform float u_glyph_count;\nuniform float u_colored;\nuniform vec3 u_ink;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 3;\n\nvec4 cellAverage(vec2 center, vec2 cell) {\n vec4 sum = vec4(0.0);\n for (int y = 0; y < TAPS; y++) {\n for (int x = 0; x < TAPS; x++) {\n vec2 offset = (vec2(float(x), float(y)) + 0.5) / float(TAPS) - 0.5;\n sum += texture(u_scene, center + offset * cell);\n }\n }\n return sum / float(TAPS * TAPS);\n}\n\nvoid main() {\n vec2 cell = max(u_cell, vec2(0.001));\n vec2 origin = floor(v_uv / cell) * cell;\n vec4 sampled = cellAverage(origin + cell * 0.5, cell);\n\n float luma = dot(sampled.rgb, vec3(0.299, 0.587, 0.114));\n float index = min(floor(luma * u_glyph_count), u_glyph_count - 1.0);\n\n vec2 local = clamp((v_uv - origin) / cell, 0.008, 0.992);\n float mask =\n texture(u_atlas, vec2((index + local.x) / u_glyph_count, local.y)).r;\n\n vec3 glyph = mix(u_ink, sampled.rgb, u_colored) * mask;\n vec4 source = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n outColor = vec4(\n mix(source.rgb, glyph, amount),\n mix(source.a, max(mask, sampled.a), amount)\n );\n}`;\n\ntype Atlas = { charset: string; texture: WebGLTexture };\n\nconst atlases = new WeakMap<WebGL2RenderingContext, Atlas>();\n\nfunction drawAtlas(charset: string): OffscreenCanvas {\n const canvas = new OffscreenCanvas(\n ATLAS_CELL_W * charset.length,\n ATLAS_CELL_H,\n );\n const context = canvas.getContext(\"2d\");\n if (!context) {\n throw new Error(\"ascii-render: failed to acquire a 2D context\");\n }\n context.fillStyle = \"#000000\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#ffffff\";\n context.font = `${Math.round(ATLAS_CELL_H * 0.74)}px ${ATLAS_FONT}`;\n context.textAlign = \"center\";\n context.textBaseline = \"middle\";\n for (let i = 0; i < charset.length; i++) {\n context.fillText(\n charset[i],\n i * ATLAS_CELL_W + ATLAS_CELL_W / 2,\n ATLAS_CELL_H / 2,\n );\n }\n return canvas;\n}\n\nfunction bindAtlas(gl: WebGL2RenderingContext, charset: string): void {\n gl.activeTexture(gl.TEXTURE1);\n\n let atlas = atlases.get(gl);\n if (!atlas) {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"ascii-render: failed to create the glyph atlas\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n atlas = { charset: \"\", texture };\n atlases.set(gl, atlas);\n } else {\n gl.bindTexture(gl.TEXTURE_2D, atlas.texture);\n }\n\n if (atlas.charset !== charset) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n drawAtlas(charset),\n );\n atlas.charset = charset;\n }\n}\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { cellX, cellY, charset, colored, ink, intensity } = passedProps;\n bindAtlas(gl, charset);\n gl.uniform1i(uniform(\"u_atlas\"), 1);\n gl.uniform1f(uniform(\"u_glyph_count\"), charset.length);\n gl.uniform2f(uniform(\"u_cell\"), cellX, cellY);\n gl.uniform1f(uniform(\"u_colored\"), colored ? 1 : 0);\n gl.uniform3fv(uniform(\"u_ink\"), toRgb(ink));\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst AsciiRenderFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n}) => <AbsoluteFill>{children}</AbsoluteFill>;\n\nconst AsciiRenderCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: AsciiRenderFallback,\n});\n\nconst AsciiRenderBase: React.FC<AsciiRenderProps & CanvasFilterProps> = ({\n glyphSize = DEFAULTS.glyphSize,\n charset = DEFAULTS.charset,\n colored = DEFAULTS.colored,\n ink = DEFAULTS.ink,\n intensity = DEFAULTS.intensity,\n children,\n}) => {\n const { width, height } = useVideoConfig();\n const resolved = charset.length > 0 ? charset : DEFAULTS.charset;\n\n return (\n <AsciiRenderCanvas\n cellX={(glyphSize * GLYPH_ASPECT) / width}\n cellY={glyphSize / height}\n charset={resolved}\n colored={colored}\n ink={ink}\n intensity={intensity}\n >\n {children}\n </AsciiRenderCanvas>\n );\n};\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n glyphSize: {\n type: \"number\",\n min: 10,\n max: 64,\n step: 2,\n default: 26,\n description: \"Glyph size\",\n hiddenFromList: false,\n },\n charset: {\n type: \"text-content\",\n default: \" .:-=+*#%@\",\n description: \"Charset\",\n },\n colored: {\n type: \"boolean\",\n default: false,\n description: \"Source colour\",\n },\n ink: {\n type: \"color\",\n default: \"#9dff9d\",\n description: \"Ink\",\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"glyphSize\",\"charset\",\"colored\",\"ink\",\"intensity\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n glyphSize: 26,\n charset: \" .:-=+*#%@\",\n colored: false,\n ink: \"#9dff9d\",\n intensity: 1,\n speed: 1,\n};\n\ntype AsciiRenderElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AsciiRenderBase>;\n\nconst AsciiRenderInner = forwardRef<\n HTMLDivElement,\n AsciiRenderElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AsciiRender>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AsciiRenderBase\n {...(componentProps as unknown as ComponentProps<typeof AsciiRenderBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AsciiRender = Interactive.withSchema({\n Component: AsciiRenderInner,\n componentName: \"<AsciiRender>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/backdrop.json b/registry-artifacts/elements/backdrop.jsonindex 96e153a2..4efb532b 100644--- a/registry-artifacts/elements/backdrop.json+++ b/registry-artifacts/elements/backdrop.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Backdrop","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "backdrop",- "sourceCode": "import { isValidElement, type ReactNode } from \"react\";\nimport { AbsoluteFill, Img, useVideoConfig } from \"remotion\";\n\nexport type BackdropFill =\n | { type: \"color\"; value: string }\n | { type: \"gradient\"; value: string }\n | { type: \"image\"; src: string; fit?: \"cover\" | \"contain\" };\n\nexport interface BackdropProps {\n fill?: BackdropFill | ReactNode;\n padding?: number;\n radius?: number;\n shadow?: string;\n children?: ReactNode;\n className?: string;\n}\n\nconst DEFAULT_FILL: BackdropFill = { type: \"color\", value: \"#0a0a0a\" };\n\nfunction FillLayer({ fill }: { fill: BackdropFill }) {\n if (fill.type === \"image\") {\n return (\n <AbsoluteFill>\n <Img\n src={fill.src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: fill.fit ?? \"cover\",\n }}\n />\n </AbsoluteFill>\n );\n }\n\n return <AbsoluteFill style={{ background: fill.value }} />;\n}\n\nexport function Backdrop({\n fill,\n padding = 4,\n radius = 1,\n shadow = \"0 20px 60px rgba(0,0,0,0.4)\",\n children,\n className,\n}: BackdropProps) {\n const { width } = useVideoConfig();\n\n const paddingPx = (padding / 100) * width;\n const radiusPx = (radius / 100) * width;\n\n const fillLayer = isValidElement(fill) ? (\n <AbsoluteFill>{fill}</AbsoluteFill>\n ) : (\n <FillLayer fill={(fill as BackdropFill | undefined) ?? DEFAULT_FILL} />\n );\n\n return (\n <AbsoluteFill className={className}>\n {fillLayer}\n {children != null && (\n <div\n style={{\n position: \"absolute\",\n inset: paddingPx,\n overflow: \"hidden\",\n borderRadius: radiusPx,\n display: \"flex\",\n ...(shadow === \"\" ? {} : { boxShadow: shadow }),\n }}\n >\n <div style={{ width: \"100%\", height: \"100%\" }}>{children}</div>\n </div>\n )}\n </AbsoluteFill>\n );\n}"+ "sourceCode": "import { forwardRef, isValidElement, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Img, Interactive, Sequence, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype BackdropFill =\n | { type: \"color\"; value: string }\n | { type: \"gradient\"; value: string }\n | { type: \"image\"; src: string; fit?: \"cover\" | \"contain\" };\n\ninterface BackdropProps {\n fill?: BackdropFill | ReactNode;\n padding?: number;\n radius?: number;\n shadow?: string;\n children?: ReactNode;\n className?: string;\n}\n\nconst DEFAULT_FILL: BackdropFill = { type: \"color\", value: \"#0a0a0a\" };\n\nfunction FillLayer({ fill }: { fill: BackdropFill }) {\n if (fill.type === \"image\") {\n return (\n <AbsoluteFill>\n <Img\n src={fill.src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: fill.fit ?? \"cover\",\n }}\n />\n </AbsoluteFill>\n );\n }\n\n return <AbsoluteFill style={{ background: fill.value }} />;\n}\n\nfunction BackdropBase({\n fill,\n padding = 4,\n radius = 1,\n shadow = \"0 20px 60px rgba(0,0,0,0.4)\",\n children,\n className,\n}: BackdropProps) {\n const { width } = useVideoConfig();\n\n const paddingPx = (padding / 100) * width;\n const radiusPx = (radius / 100) * width;\n\n const fillLayer = isValidElement(fill) ? (\n <AbsoluteFill>{fill}</AbsoluteFill>\n ) : (\n <FillLayer fill={(fill as BackdropFill | undefined) ?? DEFAULT_FILL} />\n );\n\n return (\n <AbsoluteFill className={className}>\n {fillLayer}\n {children != null && (\n <div\n style={{\n position: \"absolute\",\n inset: paddingPx,\n overflow: \"hidden\",\n borderRadius: radiusPx,\n display: \"flex\",\n ...(shadow === \"\" ? {} : { boxShadow: shadow }),\n }}\n >\n <div style={{ width: \"100%\", height: \"100%\" }}>{children}</div>\n </div>\n )}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fillType: {\n type: \"enum\",\n default: \"gradient\",\n variants: {\n color: {},\n gradient: {},\n image: {},\n },\n description: \"Fill type\",\n },\n color: {\n type: \"color\",\n default: \"#6366f1\",\n description: \"Color\",\n },\n gradient: {\n type: \"text-content\",\n default: \"linear-gradient(135deg, #6366f1 0%, #a855f7 100%)\",\n description: \"Gradient (CSS)\",\n },\n image: {\n type: \"text-content\",\n default: \"/hero.png\",\n description: \"Image URL\",\n },\n padding: {\n type: \"number\",\n min: 0,\n max: 12,\n step: 0.5,\n default: 4,\n description: \"Padding\",\n hiddenFromList: false,\n },\n radius: {\n type: \"number\",\n min: 0,\n max: 4,\n step: 0.25,\n default: 1,\n description: \"Radius\",\n hiddenFromList: false,\n },\n shadow: {\n type: \"text-content\",\n default: \"0 20px 60px rgba(0,0,0,0.4)\",\n description: \"Shadow\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fillType\",\"color\",\"gradient\",\"image\",\"padding\",\"radius\",\"shadow\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fillType: \"gradient\",\n color: \"#6366f1\",\n gradient: \"linear-gradient(135deg, #6366f1 0%, #a855f7 100%)\",\n image: \"/hero.png\",\n padding: 4,\n radius: 1,\n shadow: \"0 20px 60px rgba(0,0,0,0.4)\",\n};\n\ntype BackdropElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BackdropBase>;\n\nconst BackdropInner = forwardRef<\n HTMLDivElement,\n BackdropElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Backdrop>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <BackdropBase\n {...(componentProps as unknown as ComponentProps<typeof BackdropBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Backdrop = Interactive.withSchema({\n Component: BackdropInner,\n componentName: \"<Backdrop>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/blur-out-up.json b/registry-artifacts/elements/blur-out-up.jsonindex 0bf893c7..c59e9c0d 100644--- a/registry-artifacts/elements/blur-out-up.json+++ b/registry-artifacts/elements/blur-out-up.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Blur Out Up","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "blur-out-up",- "sourceCode": "import { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BlurOutUp({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const enterTravel = 6;\n const exitDur = 14;\n const exitTravelFrom = 8;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterTravel], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -14],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction BlurOutUpBase({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const enterTravel = 6;\n const exitDur = 14;\n const exitTravelFrom = 8;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterTravel], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -14],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Clear in, airy out.\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 8,\n step: 1,\n default: 1,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Clear in, airy out.\",\n staggerDelay: 1,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype BlurOutUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BlurOutUpBase>;\n\nconst BlurOutUpInner = forwardRef<\n HTMLDivElement,\n BlurOutUpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<BlurOutUp>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <BlurOutUpBase\n {...(componentProps as unknown as ComponentProps<typeof BlurOutUpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BlurOutUp = Interactive.withSchema({\n Component: BlurOutUpInner,\n componentName: \"<BlurOutUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/bottom-up-letters.json b/registry-artifacts/elements/bottom-up-letters.jsonindex 1b0ed1c3..590b1492 100644--- a/registry-artifacts/elements/bottom-up-letters.json+++ b/registry-artifacts/elements/bottom-up-letters.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Bottom-Up Letters","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "bottom-up-letters",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BottomUpLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction BottomUpLettersBase({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Shift\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 46,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Shift\",\n staggerDelay: 3,\n distance: 46,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype BottomUpLettersElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BottomUpLettersBase>;\n\nconst BottomUpLettersInner = forwardRef<\n HTMLDivElement,\n BottomUpLettersElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<BottomUpLetters>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <BottomUpLettersBase\n {...(componentProps as unknown as ComponentProps<typeof BottomUpLettersBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BottomUpLetters = Interactive.withSchema({\n Component: BottomUpLettersInner,\n componentName: \"<BottomUpLetters>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/camera-lens.json b/registry-artifacts/elements/camera-lens.jsonindex da0d1bb1..4d51bcd1 100644--- a/registry-artifacts/elements/camera-lens.json+++ b/registry-artifacts/elements/camera-lens.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Camera Lens","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "camera-lens",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type CameraLensProps = {\n softness?: number;\n bloom?: number;\n aberration?: number;\n vignette?: number;\n distortion?: number;\n};\n\nconst DEFAULTS = {\n softness: 0.5,\n bloom: 0.5,\n aberration: 0.5,\n vignette: 0.5,\n distortion: 0.05,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_softness;\nuniform float u_bloom;\nuniform float u_aberration;\nuniform float u_vignette;\nuniform float u_distortion;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int SOFT_TAPS = 6;\nconst int GLARE_TAPS = 8;\nconst float GOLDEN = 2.39996323;\n\nvec2 lensUv(vec2 direction, float distance) {\n vec2 q = direction * distance;\n q.x /= u_aspect;\n return q * 0.5 + 0.5;\n}\n\nvec2 spiral(int index, int count, float radius, float turn) {\n float angle = float(index) * GOLDEN + turn;\n float step = sqrt((float(index) + 0.5) / float(count)) * radius;\n return vec2(cos(angle) * step / u_aspect, sin(angle) * step);\n}\n\nvec4 softSample(vec2 uv, float radius) {\n vec4 sum = texture(u_scene, uv);\n if (radius <= 0.00002) {\n return sum;\n }\n for (int i = 0; i < SOFT_TAPS; i++) {\n sum += texture(u_scene, uv + spiral(i, SOFT_TAPS, radius, 0.0));\n }\n return sum / float(SOFT_TAPS + 1);\n}\n\nvoid main() {\n vec2 p = (v_uv - 0.5) * 2.0;\n p.x *= u_aspect;\n\n float span = sqrt(u_aspect * u_aspect + 1.0);\n float reach = length(p);\n float radius = reach / span;\n vec2 direction = reach > 0.0001 ? p / reach : vec2(0.0);\n\n float bend = 1.0 / (1.0 + clamp(u_distortion, 0.0, 1.0) * radius * radius);\n float focused = reach * bend;\n vec2 base = lensUv(direction, focused);\n\n float soft = u_softness * 0.011 * smoothstep(0.22, 1.0, radius);\n float split = u_aberration * 0.0035 * radius;\n\n vec4 mid = softSample(base, soft);\n float red = softSample(lensUv(direction, focused * (1.0 + split)), soft).r;\n float blue = softSample(lensUv(direction, focused * (1.0 - split)), soft).b;\n vec3 color = vec3(red, mid.g, blue);\n\n vec3 glare = vec3(0.0);\n for (int i = 0; i < GLARE_TAPS; i++) {\n vec3 tap =\n texture(u_scene, base + spiral(i, GLARE_TAPS, u_bloom * 0.026, 0.7)).rgb;\n glare += max(tap - 0.62, vec3(0.0));\n }\n color += (glare / float(GLARE_TAPS)) * u_bloom * 1.4;\n\n float falloff = pow(cos(min(radius, 1.0) * 0.55), 4.0);\n color *= mix(1.0, falloff, clamp(u_vignette, 0.0, 1.5));\n\n outColor = vec4(clamp(color, 0.0, 1.0), mid.a);\n}`;\n\nconst shader = makeFilterShader<CameraLensProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n softness = DEFAULTS.softness,\n bloom = DEFAULTS.bloom,\n aberration = DEFAULTS.aberration,\n vignette = DEFAULTS.vignette,\n distortion = DEFAULTS.distortion,\n } = passedProps;\n gl.uniform1f(uniform(\"u_softness\"), softness);\n gl.uniform1f(uniform(\"u_bloom\"), bloom);\n gl.uniform1f(uniform(\"u_aberration\"), aberration);\n gl.uniform1f(uniform(\"u_vignette\"), vignette);\n gl.uniform1f(uniform(\"u_distortion\"), distortion);\n },\n);\n\nconst CameraLensFallback: React.FC<CameraLensProps & CanvasFilterProps> = ({\n children,\n bloom = DEFAULTS.bloom,\n vignette = DEFAULTS.vignette,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill>{children}</AbsoluteFill>\n <AbsoluteFill\n style={{\n filter: `blur(${6 * bloom}px) brightness(1.5) contrast(1.3)`,\n mixBlendMode: \"screen\",\n opacity: 0.3 * bloom,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse 78% 76% at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.5) 100%)\",\n opacity: Math.min(vignette, 1),\n }}\n />\n </AbsoluteFill>\n);\n\nexport const CameraLens = makeCanvasFilter<CameraLensProps>({\n shader,\n fallback: CameraLensFallback,\n});"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype CameraLensProps = {\n softness?: number;\n bloom?: number;\n aberration?: number;\n vignette?: number;\n distortion?: number;\n};\n\nconst DEFAULTS = {\n softness: 0.5,\n bloom: 0.5,\n aberration: 0.5,\n vignette: 0.5,\n distortion: 0.05,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_softness;\nuniform float u_bloom;\nuniform float u_aberration;\nuniform float u_vignette;\nuniform float u_distortion;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int SOFT_TAPS = 6;\nconst int GLARE_TAPS = 8;\nconst float GOLDEN = 2.39996323;\n\nvec2 lensUv(vec2 direction, float distance) {\n vec2 q = direction * distance;\n q.x /= u_aspect;\n return q * 0.5 + 0.5;\n}\n\nvec2 spiral(int index, int count, float radius, float turn) {\n float angle = float(index) * GOLDEN + turn;\n float step = sqrt((float(index) + 0.5) / float(count)) * radius;\n return vec2(cos(angle) * step / u_aspect, sin(angle) * step);\n}\n\nvec4 softSample(vec2 uv, float radius) {\n vec4 sum = texture(u_scene, uv);\n if (radius <= 0.00002) {\n return sum;\n }\n for (int i = 0; i < SOFT_TAPS; i++) {\n sum += texture(u_scene, uv + spiral(i, SOFT_TAPS, radius, 0.0));\n }\n return sum / float(SOFT_TAPS + 1);\n}\n\nvoid main() {\n vec2 p = (v_uv - 0.5) * 2.0;\n p.x *= u_aspect;\n\n float span = sqrt(u_aspect * u_aspect + 1.0);\n float reach = length(p);\n float radius = reach / span;\n vec2 direction = reach > 0.0001 ? p / reach : vec2(0.0);\n\n float bend = 1.0 / (1.0 + clamp(u_distortion, 0.0, 1.0) * radius * radius);\n float focused = reach * bend;\n vec2 base = lensUv(direction, focused);\n\n float soft = u_softness * 0.011 * smoothstep(0.22, 1.0, radius);\n float split = u_aberration * 0.0035 * radius;\n\n vec4 mid = softSample(base, soft);\n float red = softSample(lensUv(direction, focused * (1.0 + split)), soft).r;\n float blue = softSample(lensUv(direction, focused * (1.0 - split)), soft).b;\n vec3 color = vec3(red, mid.g, blue);\n\n vec3 glare = vec3(0.0);\n for (int i = 0; i < GLARE_TAPS; i++) {\n vec3 tap =\n texture(u_scene, base + spiral(i, GLARE_TAPS, u_bloom * 0.026, 0.7)).rgb;\n glare += max(tap - 0.62, vec3(0.0));\n }\n color += (glare / float(GLARE_TAPS)) * u_bloom * 1.4;\n\n float falloff = pow(cos(min(radius, 1.0) * 0.55), 4.0);\n color *= mix(1.0, falloff, clamp(u_vignette, 0.0, 1.5));\n\n outColor = vec4(clamp(color, 0.0, 1.0), mid.a);\n}`;\n\nconst shader = makeFilterShader<CameraLensProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n softness = DEFAULTS.softness,\n bloom = DEFAULTS.bloom,\n aberration = DEFAULTS.aberration,\n vignette = DEFAULTS.vignette,\n distortion = DEFAULTS.distortion,\n } = passedProps;\n gl.uniform1f(uniform(\"u_softness\"), softness);\n gl.uniform1f(uniform(\"u_bloom\"), bloom);\n gl.uniform1f(uniform(\"u_aberration\"), aberration);\n gl.uniform1f(uniform(\"u_vignette\"), vignette);\n gl.uniform1f(uniform(\"u_distortion\"), distortion);\n },\n);\n\nconst CameraLensFallback: React.FC<CameraLensProps & CanvasFilterProps> = ({\n children,\n bloom = DEFAULTS.bloom,\n vignette = DEFAULTS.vignette,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill>{children}</AbsoluteFill>\n <AbsoluteFill\n style={{\n filter: `blur(${6 * bloom}px) brightness(1.5) contrast(1.3)`,\n mixBlendMode: \"screen\",\n opacity: 0.3 * bloom,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse 78% 76% at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.5) 100%)\",\n opacity: Math.min(vignette, 1),\n }}\n />\n </AbsoluteFill>\n);\n\nconst CameraLensBase = makeCanvasFilter<CameraLensProps>({\n shader,\n fallback: CameraLensFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n softness: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.5,\n description: \"Corner softness\",\n hiddenFromList: false,\n },\n bloom: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.5,\n description: \"Bloom\",\n hiddenFromList: false,\n },\n aberration: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 0.5,\n description: \"Aberration\",\n hiddenFromList: false,\n },\n vignette: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 0.5,\n description: \"Vignette\",\n hiddenFromList: false,\n },\n distortion: {\n type: \"number\",\n min: 0,\n max: 0.6,\n step: 0.01,\n default: 0.05,\n description: \"Distortion\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"softness\",\"bloom\",\"aberration\",\"vignette\",\"distortion\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n softness: 0.5,\n bloom: 0.5,\n aberration: 0.5,\n vignette: 0.5,\n distortion: 0.05,\n speed: 1,\n};\n\ntype CameraLensElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CameraLensBase>;\n\nconst CameraLensInner = forwardRef<\n HTMLDivElement,\n CameraLensElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CameraLens>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CameraLensBase\n {...(componentProps as unknown as ComponentProps<typeof CameraLensBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CameraLens = Interactive.withSchema({\n Component: CameraLensInner,\n componentName: \"<CameraLens>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/chat-to-preview-layout.json b/registry-artifacts/elements/chat-to-preview-layout.jsonindex c51dd348..c8727747 100644--- a/registry-artifacts/elements/chat-to-preview-layout.json+++ b/registry-artifacts/elements/chat-to-preview-layout.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Chat to Preview Layout","durationInFrames": 120,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "chat-to-preview-layout",- "sourceCode": "import { type ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nexport function ChatToPreviewLayout({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n transform: `translateX(${previewTx}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nfunction ChatToPreviewLayoutBase({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n transform: `translateX(${previewTx}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n startChatRatio: {\n type: \"number\",\n min: 0.1,\n max: 0.9,\n step: 0.05,\n default: 0.5,\n description: \"Start chat ratio\",\n hiddenFromList: false,\n },\n endChatRatio: {\n type: \"number\",\n min: 0.05,\n max: 0.9,\n step: 0.05,\n default: 0.25,\n description: \"End chat ratio\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"startChatRatio\",\"endChatRatio\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n startChatRatio: 0.5,\n endChatRatio: 0.25,\n speed: 1,\n};\n\ntype ChatToPreviewLayoutElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChatToPreviewLayoutBase>;\n\nconst ChatToPreviewLayoutInner = forwardRef<\n HTMLDivElement,\n ChatToPreviewLayoutElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ChatToPreviewLayout>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ChatToPreviewLayoutBase\n {...(componentProps as unknown as ComponentProps<typeof ChatToPreviewLayoutBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChatToPreviewLayout = Interactive.withSchema({\n Component: ChatToPreviewLayoutInner,\n componentName: \"<ChatToPreviewLayout>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 120}diff --git a/registry-artifacts/elements/chromatic-wave.json b/registry-artifacts/elements/chromatic-wave.jsonindex 0581f9c5..eed8e46c 100644--- a/registry-artifacts/elements/chromatic-wave.json+++ b/registry-artifacts/elements/chromatic-wave.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Chromatic Wave","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "chromatic-wave",- "sourceCode": "import { useId } from \"react\";\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChromaticWaveProps {\n className?: string;\n width?: number;\n height?: number;\n headline?: string;\n kicker?: string;\n headlineFontFamily?: string;\n kickerFontFamily?: string;\n headlineFontSize?: number;\n kickerFontSize?: number;\n kickerTracking?: number;\n headlineBaselineY?: number;\n kickerBaselines?: [number, number];\n textCenterX?: number;\n fill?: string;\n background?: string;\n bandHeight?: number;\n bandCopies?: number;\n bandPitch?: number;\n mapStartY?: number;\n mapEndY?: number;\n mapTravelFrames?: number;\n waveHeight?: number;\n waveWidth?: number;\n waveSpeed?: number;\n turbulentAmount?: number;\n turbulentSize?: number;\n evolutionPerSecond?: number;\n mapBlurRadius?: number;\n mapBlurIterations?: number;\n glassDisplacement?: number;\n maxDisplacementPx?: number;\n glassPasses?: number;\n channelOrder?: (\"red\" | \"green\" | \"blue\")[];\n}\n\nfunction boxBlurSigma(radius: number, iterations: number): number {\n const w = 2 * radius + 1;\n return Math.sqrt((iterations * (w * w - 1)) / 12);\n}\n\nfunction buildMapUri({\n width,\n height,\n bandHeight,\n bandCopies,\n bandPitch,\n mapY,\n waveHeight,\n waveWidth,\n phase,\n}: {\n width: number;\n height: number;\n bandHeight: number;\n bandCopies: number;\n bandPitch: number;\n mapY: number;\n waveHeight: number;\n waveWidth: number;\n phase: number;\n}): string {\n const overhang = 120;\n const segments = 48;\n\n const bands = Array.from({ length: bandCopies }, (_, i) => {\n const top = mapY + i * bandPitch - bandHeight / 2;\n const pts = Array.from({ length: segments + 1 }, (_, s) => {\n const x = -overhang + (s / segments) * (width + overhang * 2);\n const y =\n top + Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;\n return `${x},${y}`;\n });\n const back = Array.from({ length: segments + 1 }, (_, s) => {\n const x =\n -overhang + ((segments - s) / segments) * (width + overhang * 2);\n const y =\n top +\n bandHeight +\n Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;\n return `${x},${y}`;\n });\n return `<path d=\"M${pts.join(\"L\")}L${back.join(\"L\")}Z\" fill=\"url(#g)\"/>`;\n }).join(\"\");\n\n const svg =\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${width}\" height=\"${height}\">` +\n `<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">` +\n `<stop offset=\"0\" stop-color=\"rgb(128,128,128)\"/>` +\n `<stop offset=\"0.25\" stop-color=\"rgb(0,0,0)\"/>` +\n `<stop offset=\"0.5\" stop-color=\"rgb(128,128,128)\"/>` +\n `<stop offset=\"0.75\" stop-color=\"rgb(255,255,255)\"/>` +\n `<stop offset=\"1\" stop-color=\"rgb(128,128,128)\"/>` +\n `</linearGradient></defs>` +\n `<rect width=\"${width}\" height=\"${height}\" fill=\"rgb(128,128,128)\"/>` +\n bands +\n `</svg>`;\n\n return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n}\n\nexport function ChromaticWave({\n className,\n width = 1920,\n height = 1080,\n headline = \"MUSIC\",\n kicker = \"APPLES\",\n headlineFontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n kickerFontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n headlineFontSize = 174,\n kickerFontSize = 52,\n kickerTracking = 32,\n headlineBaselineY = 601,\n kickerBaselines = [444, 670],\n textCenterX = 960,\n fill = \"#ffffff\",\n background = \"#000000\",\n bandHeight = 147.1,\n bandCopies = 7,\n bandPitch = 750,\n mapStartY = 31,\n mapEndY = 1560,\n mapTravelFrames = 150,\n waveHeight = 28,\n waveWidth = 272,\n waveSpeed = 1,\n turbulentAmount = 130,\n turbulentSize = 163,\n evolutionPerSecond = 50,\n mapBlurRadius = 13,\n mapBlurIterations = 6,\n glassDisplacement = 100,\n maxDisplacementPx = 39,\n glassPasses = 3,\n channelOrder = [\"blue\", \"green\", \"red\"],\n}: ChromaticWaveProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const filterId = useId();\n const seconds = frame / fps;\n\n const mapY = interpolate(frame, [0, mapTravelFrames], [mapStartY, mapEndY], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const mapUri = buildMapUri({\n width,\n height,\n bandHeight,\n bandCopies,\n bandPitch,\n mapY,\n waveHeight,\n waveWidth,\n phase: seconds * waveSpeed * Math.PI * 2,\n });\n\n const mapSigma = boxBlurSigma(mapBlurRadius, mapBlurIterations);\n const evolution = seconds * evolutionPerSecond;\n\n const channelMatrix: Record<string, string> = {\n red: \"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n green: \"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n blue: \"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0\",\n };\n\n const content = (\n <>\n <text\n x={textCenterX}\n y={kickerBaselines[0]}\n textAnchor=\"middle\"\n fontFamily={kickerFontFamily}\n fontSize={kickerFontSize}\n letterSpacing={kickerTracking}\n fill={fill}\n >\n {kicker}\n </text>\n <text\n x={textCenterX}\n y={headlineBaselineY}\n textAnchor=\"middle\"\n fontFamily={headlineFontFamily}\n fontWeight={700}\n fontSize={headlineFontSize}\n fill={fill}\n >\n {headline}\n </text>\n <text\n x={textCenterX}\n y={kickerBaselines[1]}\n textAnchor=\"middle\"\n fontFamily={kickerFontFamily}\n fontSize={kickerFontSize}\n letterSpacing={kickerTracking}\n fill={fill}\n >\n {kicker}\n </text>\n </>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <defs>\n {Array.from({ length: glassPasses }, (_, i) => {\n const depth =\n ((i + 1) / glassPasses) *\n maxDisplacementPx *\n (glassDisplacement / 100);\n return (\n <filter\n key={channelOrder[i] ?? i}\n id={`${filterId}-${i}`}\n filterUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width={width}\n height={height}\n colorInterpolationFilters=\"sRGB\"\n >\n <feImage\n href={mapUri}\n x=\"0\"\n y=\"0\"\n width={width}\n height={height}\n result=\"rawMap\"\n />\n <feTurbulence\n type=\"turbulence\"\n baseFrequency={1 / Math.max(turbulentSize, 1)}\n numOctaves={1}\n seed={11}\n result=\"noise\"\n />\n <feOffset\n in=\"noise\"\n dx={evolution}\n dy={evolution * 0.4}\n result=\"noiseMoved\"\n />\n <feDisplacementMap\n in=\"rawMap\"\n in2=\"noiseMoved\"\n scale={turbulentAmount}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n result=\"turbulentMap\"\n />\n <feGaussianBlur\n in=\"turbulentMap\"\n stdDeviation={mapSigma}\n result=\"slopeMap\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"slopeMap\"\n scale={depth}\n xChannelSelector=\"R\"\n yChannelSelector=\"R\"\n result=\"displaced\"\n />\n <feColorMatrix\n in=\"displaced\"\n type=\"matrix\"\n values={channelMatrix[channelOrder[i] ?? \"red\"]}\n />\n </filter>\n );\n })}\n </defs>\n\n <rect width={width} height={height} fill={background} />\n\n {Array.from({ length: glassPasses }, (_, i) => (\n <g\n key={channelOrder[i] ?? i}\n filter={`url(#${filterId}-${i})`}\n style={{ mixBlendMode: \"screen\" }}\n >\n {content}\n </g>\n ))}\n </svg>\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ChromaticWaveProps {\n className?: string;\n width?: number;\n height?: number;\n headline?: string;\n kicker?: string;\n headlineFontFamily?: string;\n kickerFontFamily?: string;\n headlineFontSize?: number;\n kickerFontSize?: number;\n kickerTracking?: number;\n headlineBaselineY?: number;\n kickerBaselines?: [number, number];\n textCenterX?: number;\n fill?: string;\n background?: string;\n bandHeight?: number;\n bandCopies?: number;\n bandPitch?: number;\n mapStartY?: number;\n mapEndY?: number;\n mapTravelFrames?: number;\n waveHeight?: number;\n waveWidth?: number;\n waveSpeed?: number;\n turbulentAmount?: number;\n turbulentSize?: number;\n evolutionPerSecond?: number;\n mapBlurRadius?: number;\n mapBlurIterations?: number;\n glassDisplacement?: number;\n maxDisplacementPx?: number;\n glassPasses?: number;\n channelOrder?: (\"red\" | \"green\" | \"blue\")[];\n}\n\nfunction boxBlurSigma(radius: number, iterations: number): number {\n const w = 2 * radius + 1;\n return Math.sqrt((iterations * (w * w - 1)) / 12);\n}\n\nfunction buildMapUri({\n width,\n height,\n bandHeight,\n bandCopies,\n bandPitch,\n mapY,\n waveHeight,\n waveWidth,\n phase,\n}: {\n width: number;\n height: number;\n bandHeight: number;\n bandCopies: number;\n bandPitch: number;\n mapY: number;\n waveHeight: number;\n waveWidth: number;\n phase: number;\n}): string {\n const overhang = 120;\n const segments = 48;\n\n const bands = Array.from({ length: bandCopies }, (_, i) => {\n const top = mapY + i * bandPitch - bandHeight / 2;\n const pts = Array.from({ length: segments + 1 }, (_, s) => {\n const x = -overhang + (s / segments) * (width + overhang * 2);\n const y =\n top + Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;\n return `${x},${y}`;\n });\n const back = Array.from({ length: segments + 1 }, (_, s) => {\n const x =\n -overhang + ((segments - s) / segments) * (width + overhang * 2);\n const y =\n top +\n bandHeight +\n Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;\n return `${x},${y}`;\n });\n return `<path d=\"M${pts.join(\"L\")}L${back.join(\"L\")}Z\" fill=\"url(#g)\"/>`;\n }).join(\"\");\n\n const svg =\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${width}\" height=\"${height}\">` +\n `<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">` +\n `<stop offset=\"0\" stop-color=\"rgb(128,128,128)\"/>` +\n `<stop offset=\"0.25\" stop-color=\"rgb(0,0,0)\"/>` +\n `<stop offset=\"0.5\" stop-color=\"rgb(128,128,128)\"/>` +\n `<stop offset=\"0.75\" stop-color=\"rgb(255,255,255)\"/>` +\n `<stop offset=\"1\" stop-color=\"rgb(128,128,128)\"/>` +\n `</linearGradient></defs>` +\n `<rect width=\"${width}\" height=\"${height}\" fill=\"rgb(128,128,128)\"/>` +\n bands +\n `</svg>`;\n\n return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n}\n\nfunction ChromaticWaveBase({\n className,\n width = 1920,\n height = 1080,\n headline = \"MUSIC\",\n kicker = \"APPLES\",\n headlineFontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n kickerFontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n headlineFontSize = 174,\n kickerFontSize = 52,\n kickerTracking = 32,\n headlineBaselineY = 601,\n kickerBaselines = [444, 670],\n textCenterX = 960,\n fill = \"#ffffff\",\n background = \"#000000\",\n bandHeight = 147.1,\n bandCopies = 7,\n bandPitch = 750,\n mapStartY = 31,\n mapEndY = 1560,\n mapTravelFrames = 150,\n waveHeight = 28,\n waveWidth = 272,\n waveSpeed = 1,\n turbulentAmount = 130,\n turbulentSize = 163,\n evolutionPerSecond = 50,\n mapBlurRadius = 13,\n mapBlurIterations = 6,\n glassDisplacement = 100,\n maxDisplacementPx = 39,\n glassPasses = 3,\n channelOrder = [\"blue\", \"green\", \"red\"],\n}: ChromaticWaveProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const filterId = useId();\n const seconds = frame / fps;\n\n const mapY = interpolate(frame, [0, mapTravelFrames], [mapStartY, mapEndY], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const mapUri = buildMapUri({\n width,\n height,\n bandHeight,\n bandCopies,\n bandPitch,\n mapY,\n waveHeight,\n waveWidth,\n phase: seconds * waveSpeed * Math.PI * 2,\n });\n\n const mapSigma = boxBlurSigma(mapBlurRadius, mapBlurIterations);\n const evolution = seconds * evolutionPerSecond;\n\n const channelMatrix: Record<string, string> = {\n red: \"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n green: \"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n blue: \"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0\",\n };\n\n const content = (\n <>\n <text\n x={textCenterX}\n y={kickerBaselines[0]}\n textAnchor=\"middle\"\n fontFamily={kickerFontFamily}\n fontSize={kickerFontSize}\n letterSpacing={kickerTracking}\n fill={fill}\n >\n {kicker}\n </text>\n <text\n x={textCenterX}\n y={headlineBaselineY}\n textAnchor=\"middle\"\n fontFamily={headlineFontFamily}\n fontWeight={700}\n fontSize={headlineFontSize}\n fill={fill}\n >\n {headline}\n </text>\n <text\n x={textCenterX}\n y={kickerBaselines[1]}\n textAnchor=\"middle\"\n fontFamily={kickerFontFamily}\n fontSize={kickerFontSize}\n letterSpacing={kickerTracking}\n fill={fill}\n >\n {kicker}\n </text>\n </>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <defs>\n {Array.from({ length: glassPasses }, (_, i) => {\n const depth =\n ((i + 1) / glassPasses) *\n maxDisplacementPx *\n (glassDisplacement / 100);\n return (\n <filter\n key={channelOrder[i] ?? i}\n id={`${filterId}-${i}`}\n filterUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width={width}\n height={height}\n colorInterpolationFilters=\"sRGB\"\n >\n <feImage\n href={mapUri}\n x=\"0\"\n y=\"0\"\n width={width}\n height={height}\n result=\"rawMap\"\n />\n <feTurbulence\n type=\"turbulence\"\n baseFrequency={1 / Math.max(turbulentSize, 1)}\n numOctaves={1}\n seed={11}\n result=\"noise\"\n />\n <feOffset\n in=\"noise\"\n dx={evolution}\n dy={evolution * 0.4}\n result=\"noiseMoved\"\n />\n <feDisplacementMap\n in=\"rawMap\"\n in2=\"noiseMoved\"\n scale={turbulentAmount}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n result=\"turbulentMap\"\n />\n <feGaussianBlur\n in=\"turbulentMap\"\n stdDeviation={mapSigma}\n result=\"slopeMap\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"slopeMap\"\n scale={depth}\n xChannelSelector=\"R\"\n yChannelSelector=\"R\"\n result=\"displaced\"\n />\n <feColorMatrix\n in=\"displaced\"\n type=\"matrix\"\n values={channelMatrix[channelOrder[i] ?? \"red\"]}\n />\n </filter>\n );\n })}\n </defs>\n\n <rect width={width} height={height} fill={background} />\n\n {Array.from({ length: glassPasses }, (_, i) => (\n <g\n key={channelOrder[i] ?? i}\n filter={`url(#${filterId}-${i})`}\n style={{ mixBlendMode: \"screen\" }}\n >\n {content}\n </g>\n ))}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n headline: {\n type: \"text-content\",\n default: \"MUSIC\",\n description: \"Headline\",\n },\n kicker: {\n type: \"text-content\",\n default: \"APPLES\",\n description: \"Kicker\",\n },\n fill: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Fill\",\n },\n waveHeight: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 28,\n description: \"Wave height\",\n hiddenFromList: false,\n },\n maxDisplacementPx: {\n type: \"number\",\n min: 0,\n max: 60,\n step: 1,\n default: 39,\n description: \"Displacement (px)\",\n hiddenFromList: false,\n },\n turbulentAmount: {\n type: \"number\",\n min: 0,\n max: 200,\n step: 2,\n default: 130,\n description: \"Turbulence\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"headline\",\"kicker\",\"fill\",\"waveHeight\",\"maxDisplacementPx\",\"turbulentAmount\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n headline: \"MUSIC\",\n kicker: \"APPLES\",\n fill: \"#ffffff\",\n waveHeight: 28,\n maxDisplacementPx: 39,\n turbulentAmount: 130,\n speed: 1,\n};\n\ntype ChromaticWaveElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChromaticWaveBase>;\n\nconst ChromaticWaveInner = forwardRef<\n HTMLDivElement,\n ChromaticWaveElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ChromaticWave>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ChromaticWaveBase\n {...(componentProps as unknown as ComponentProps<typeof ChromaticWaveBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChromaticWave = Interactive.withSchema({\n Component: ChromaticWaveInner,\n componentName: \"<ChromaticWave>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/confetti.json b/registry-artifacts/elements/confetti.jsonindex 4d68d649..1bb5ba5b 100644--- a/registry-artifacts/elements/confetti.json+++ b/registry-artifacts/elements/confetti.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Confetti","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "confetti",- "sourceCode": "import { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\nexport interface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nexport function mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nexport function makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nexport function particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nexport function Confetti({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\ninterface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nfunction mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nfunction makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nfunction particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nfunction ConfettiBase({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n particleCount: {\n type: \"number\",\n min: 10,\n max: 400,\n step: 10,\n default: 140,\n description: \"Particles\",\n hiddenFromList: false,\n },\n power: {\n type: \"number\",\n min: 4,\n max: 40,\n step: 1,\n default: 17,\n description: \"Power\",\n hiddenFromList: false,\n },\n gravity: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 0.45,\n description: \"Gravity\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 13,\n description: \"Size\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n min: 1,\n step: 1,\n default: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"particleCount\",\"power\",\"gravity\",\"size\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n particleCount: 140,\n power: 17,\n gravity: 0.45,\n size: 13,\n seed: 1,\n speed: 1,\n};\n\ntype ConfettiElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ConfettiBase>;\n\nconst ConfettiInner = forwardRef<\n HTMLDivElement,\n ConfettiElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Confetti>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ConfettiBase\n {...(componentProps as unknown as ComponentProps<typeof ConfettiBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Confetti = Interactive.withSchema({\n Component: ConfettiInner,\n componentName: \"<Confetti>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/crt-screen.json b/registry-artifacts/elements/crt-screen.jsonindex 67bb3bbc..dbee8ea3 100644--- a/registry-artifacts/elements/crt-screen.json+++ b/registry-artifacts/elements/crt-screen.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "CRT Screen","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "crt-screen",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type CrtScreenProps = {\n curvature?: number;\n scanlines?: number;\n maskScale?: number;\n vignette?: number;\n};\n\nconst DEFAULTS = {\n curvature: 1,\n scanlines: 1,\n maskScale: 2,\n vignette: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_curvature;\nuniform float u_scanlines;\nuniform float u_mask_scale;\nuniform float u_vignette;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float SCAN_LINES = 240.0;\n\nvec2 warpTube(vec2 uv, float k) {\n vec2 p = uv * 2.0 - 1.0;\n float x2 = p.x * p.x;\n float y2 = p.y * p.y;\n p.x *= 1.0 + k * 0.11 * y2;\n p.y *= 1.0 + k * 0.17 * x2;\n p /= 1.0 + k * 0.045;\n return p * 0.5 + 0.5;\n}\n\nvec3 phosphorMask(float x, float scale) {\n float sub = mod(floor(x / max(scale, 1.0)), 3.0);\n vec3 lit = vec3(\n step(sub, 0.5),\n step(0.5, sub) * step(sub, 1.5),\n step(1.5, sub)\n );\n return mix(vec3(0.34), vec3(1.0), lit);\n}\n\nvoid main() {\n vec2 uv = warpTube(v_uv, u_curvature);\n\n vec2 edge =\n smoothstep(vec2(0.0), vec2(0.005), uv) *\n smoothstep(vec2(0.0), vec2(0.005), 1.0 - uv);\n float inside = edge.x * edge.y;\n\n vec4 base = texture(u_scene, uv);\n\n vec3 spread = vec3(0.0);\n for (int i = -2; i <= 2; i++) {\n spread += texture(u_scene, uv + vec2(float(i) * 0.0018, 0.0)).rgb;\n }\n spread /= 5.0;\n vec3 bloom = max(spread - 0.5, vec3(0.0));\n\n vec3 color = base.rgb;\n color *= phosphorMask(gl_FragCoord.x, u_mask_scale);\n color += bloom * 0.75;\n\n float scan = mix(1.0, 0.5 + 0.5 * cos(uv.y * SCAN_LINES * PI * 2.0), 0.55);\n color *= mix(1.0, scan, clamp(u_scanlines, 0.0, 1.5));\n\n vec2 vc = uv * 2.0 - 1.0;\n float radius = length(vc * vec2(0.86, 1.0));\n color *= mix(1.0, smoothstep(1.6, 0.35, radius), clamp(u_vignette, 0.0, 1.5));\n\n color *= 1.0 + 0.012 * sin(u_frame * PI / 30.0);\n color *= inside;\n\n outColor = vec4(clamp(color, 0.0, 1.0), max(base.a, 1.0 - inside));\n}`;\n\nconst shader = makeFilterShader<CrtScreenProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n curvature = DEFAULTS.curvature,\n scanlines = DEFAULTS.scanlines,\n maskScale = DEFAULTS.maskScale,\n vignette = DEFAULTS.vignette,\n } = passedProps;\n gl.uniform1f(uniform(\"u_curvature\"), curvature);\n gl.uniform1f(uniform(\"u_scanlines\"), scanlines);\n gl.uniform1f(uniform(\"u_mask_scale\"), maskScale);\n gl.uniform1f(uniform(\"u_vignette\"), vignette);\n },\n);\n\nconst CrtScreenFallback: React.FC<CrtScreenProps & CanvasFilterProps> = ({\n children,\n scanlines = DEFAULTS.scanlines,\n vignette = DEFAULTS.vignette,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill style={{ filter: \"saturate(1.1) contrast(1.06)\" }}>\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.34) 0px, rgba(0, 0, 0, 0.34) 1.5px, transparent 1.5px, transparent 3px)\",\n opacity: Math.min(scanlines, 1),\n }}\n />\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse 82% 78% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.72) 100%)\",\n opacity: Math.min(vignette, 1),\n }}\n />\n </AbsoluteFill>\n);\n\nexport const CrtScreen = makeCanvasFilter<CrtScreenProps>({\n shader,\n fallback: CrtScreenFallback,\n});"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype CrtScreenProps = {\n curvature?: number;\n scanlines?: number;\n maskScale?: number;\n vignette?: number;\n};\n\nconst DEFAULTS = {\n curvature: 1,\n scanlines: 1,\n maskScale: 2,\n vignette: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_curvature;\nuniform float u_scanlines;\nuniform float u_mask_scale;\nuniform float u_vignette;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float SCAN_LINES = 240.0;\n\nvec2 warpTube(vec2 uv, float k) {\n vec2 p = uv * 2.0 - 1.0;\n float x2 = p.x * p.x;\n float y2 = p.y * p.y;\n p.x *= 1.0 + k * 0.11 * y2;\n p.y *= 1.0 + k * 0.17 * x2;\n p /= 1.0 + k * 0.045;\n return p * 0.5 + 0.5;\n}\n\nvec3 phosphorMask(float x, float scale) {\n float sub = mod(floor(x / max(scale, 1.0)), 3.0);\n vec3 lit = vec3(\n step(sub, 0.5),\n step(0.5, sub) * step(sub, 1.5),\n step(1.5, sub)\n );\n return mix(vec3(0.34), vec3(1.0), lit);\n}\n\nvoid main() {\n vec2 uv = warpTube(v_uv, u_curvature);\n\n vec2 edge =\n smoothstep(vec2(0.0), vec2(0.005), uv) *\n smoothstep(vec2(0.0), vec2(0.005), 1.0 - uv);\n float inside = edge.x * edge.y;\n\n vec4 base = texture(u_scene, uv);\n\n vec3 spread = vec3(0.0);\n for (int i = -2; i <= 2; i++) {\n spread += texture(u_scene, uv + vec2(float(i) * 0.0018, 0.0)).rgb;\n }\n spread /= 5.0;\n vec3 bloom = max(spread - 0.5, vec3(0.0));\n\n vec3 color = base.rgb;\n color *= phosphorMask(gl_FragCoord.x, u_mask_scale);\n color += bloom * 0.75;\n\n float scan = mix(1.0, 0.5 + 0.5 * cos(uv.y * SCAN_LINES * PI * 2.0), 0.55);\n color *= mix(1.0, scan, clamp(u_scanlines, 0.0, 1.5));\n\n vec2 vc = uv * 2.0 - 1.0;\n float radius = length(vc * vec2(0.86, 1.0));\n color *= mix(1.0, smoothstep(1.6, 0.35, radius), clamp(u_vignette, 0.0, 1.5));\n\n color *= 1.0 + 0.012 * sin(u_frame * PI / 30.0);\n color *= inside;\n\n outColor = vec4(clamp(color, 0.0, 1.0), max(base.a, 1.0 - inside));\n}`;\n\nconst shader = makeFilterShader<CrtScreenProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n curvature = DEFAULTS.curvature,\n scanlines = DEFAULTS.scanlines,\n maskScale = DEFAULTS.maskScale,\n vignette = DEFAULTS.vignette,\n } = passedProps;\n gl.uniform1f(uniform(\"u_curvature\"), curvature);\n gl.uniform1f(uniform(\"u_scanlines\"), scanlines);\n gl.uniform1f(uniform(\"u_mask_scale\"), maskScale);\n gl.uniform1f(uniform(\"u_vignette\"), vignette);\n },\n);\n\nconst CrtScreenFallback: React.FC<CrtScreenProps & CanvasFilterProps> = ({\n children,\n scanlines = DEFAULTS.scanlines,\n vignette = DEFAULTS.vignette,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill style={{ filter: \"saturate(1.1) contrast(1.06)\" }}>\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.34) 0px, rgba(0, 0, 0, 0.34) 1.5px, transparent 1.5px, transparent 3px)\",\n opacity: Math.min(scanlines, 1),\n }}\n />\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse 82% 78% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.72) 100%)\",\n opacity: Math.min(vignette, 1),\n }}\n />\n </AbsoluteFill>\n);\n\nconst CrtScreenBase = makeCanvasFilter<CrtScreenProps>({\n shader,\n fallback: CrtScreenFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n curvature: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 1,\n description: \"Curvature\",\n hiddenFromList: false,\n },\n scanlines: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 1,\n description: \"Scanlines\",\n hiddenFromList: false,\n },\n maskScale: {\n type: \"number\",\n min: 1,\n max: 6,\n step: 1,\n default: 2,\n description: \"Mask pitch\",\n hiddenFromList: false,\n },\n vignette: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 1,\n description: \"Vignette\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"curvature\",\"scanlines\",\"maskScale\",\"vignette\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n curvature: 1,\n scanlines: 1,\n maskScale: 2,\n vignette: 1,\n speed: 1,\n};\n\ntype CrtScreenElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CrtScreenBase>;\n\nconst CrtScreenInner = forwardRef<\n HTMLDivElement,\n CrtScreenElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CrtScreen>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CrtScreenBase\n {...(componentProps as unknown as ComponentProps<typeof CrtScreenBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CrtScreen = Interactive.withSchema({\n Component: CrtScreenInner,\n componentName: \"<CrtScreen>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/drift.json b/registry-artifacts/elements/drift.jsonindex 00870c67..725726eb 100644--- a/registry-artifacts/elements/drift.json+++ b/registry-artifacts/elements/drift.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Drift","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "drift",- "sourceCode": "import { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nimport type React from \"react\";\n\nexport interface DriftProps {\n children: React.ReactNode;\n grow?: number;\n}\n\nexport function Drift({ children, grow = 0.035 }: DriftProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);\n return (\n <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n {children}\n </AbsoluteFill>\n );\n}"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface DriftProps {\n children: React.ReactNode;\n grow?: number;\n}\n\nfunction DriftBase({ children, grow = 0.035 }: DriftProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);\n return (\n <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n {children}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n grow: {\n type: \"number\",\n min: -0.1,\n max: 0.15,\n step: 0.005,\n default: 0.035,\n description: \"Grow\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"grow\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n grow: 0.035,\n speed: 1,\n};\n\ntype DriftElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DriftBase>;\n\nconst DriftInner = forwardRef<\n HTMLDivElement,\n DriftElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Drift>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <DriftBase\n {...(componentProps as unknown as ComponentProps<typeof DriftBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Drift = Interactive.withSchema({\n Component: DriftInner,\n componentName: \"<Drift>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/ecosystem-constellation.json b/registry-artifacts/elements/ecosystem-constellation.jsonindex 7acf6a5d..be2d2989 100644--- a/registry-artifacts/elements/ecosystem-constellation.json+++ b/registry-artifacts/elements/ecosystem-constellation.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Ecosystem Constellation","durationInFrames": 240,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "ecosystem-constellation",- "sourceCode": "import { type ComponentType } from \"react\";\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nexport function EcosystemConstellation({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n transform: `scale(${centerScale})`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${s.satScale})`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useImperativeHandle, useRef, type ComponentProps, type ComponentType } from \"react\";\nimport { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nfunction EcosystemConstellationBase({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n transform: `scale(${centerScale})`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${s.satScale})`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n satelliteCount: {\n type: \"number\",\n min: 3,\n max: 8,\n step: 1,\n default: 6,\n description: \"Satellite count\",\n hiddenFromList: false,\n },\n centerLabel: {\n type: \"text-content\",\n default: \"V\",\n description: \"Center label\",\n },\n accentColor: {\n type: \"color\",\n default: \"#a855f7\",\n description: \"Accent color\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"satelliteCount\",\"centerLabel\",\"accentColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n satelliteCount: 6,\n centerLabel: \"V\",\n accentColor: \"#a855f7\",\n speed: 1,\n};\n\ntype EcosystemConstellationElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EcosystemConstellationBase>;\n\nconst EcosystemConstellationInner = forwardRef<\n HTMLDivElement,\n EcosystemConstellationElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<EcosystemConstellation>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <EcosystemConstellationBase\n {...(componentProps as unknown as ComponentProps<typeof EcosystemConstellationBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EcosystemConstellation = Interactive.withSchema({\n Component: EcosystemConstellationInner,\n componentName: \"<EcosystemConstellation>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 240}diff --git a/registry-artifacts/elements/extrude-pop.json b/registry-artifacts/elements/extrude-pop.jsonindex f910b373..976624b8 100644--- a/registry-artifacts/elements/extrude-pop.json+++ b/registry-artifacts/elements/extrude-pop.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Extrude Pop","durationInFrames": 48,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "extrude-pop",- "sourceCode": "import { useMemo } from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ExtrudePopProps {\n className?: string;\n width?: number;\n height?: number;\n letter?: string;\n fontFamily?: string;\n fontWeight?: number | string;\n fontSize?: number;\n basePosition?: [number, number];\n maxTextWidth?: number;\n minimaxRadius?: number;\n extrudeAngleDeg?: number;\n extrudeSteps?: number;\n extrudeStartFrame?: number;\n extrudeEndFrame?: number;\n bodyColor?: string;\n faceColor?: string;\n}\n\nexport function ExtrudePop({\n className,\n width = 1920,\n height = 1080,\n letter = \"WIN\",\n fontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n fontWeight = 700,\n fontSize = 603,\n basePosition = [959.2, 752.5],\n maxTextWidth = 1660,\n minimaxRadius = 80,\n extrudeAngleDeg = -58.6,\n extrudeSteps = 200,\n extrudeStartFrame = 0,\n extrudeEndFrame = 48,\n bodyColor = \"#e8192b\",\n faceColor = \"#ffffff\",\n}: ExtrudePopProps) {\n const frame = useCurrentFrame();\n\n const fit = useMemo(() => {\n if (typeof document === \"undefined\") return 1;\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return 1;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n const measured = ctx.measureText(letter).width;\n if (measured <= 0) return 1;\n return Math.min(1, maxTextWidth / measured);\n }, [letter, fontFamily, fontWeight, fontSize, maxTextWidth]);\n\n const fitFontSize = fontSize * fit;\n const fitRadius = minimaxRadius * fit;\n\n const radius = interpolate(\n frame,\n [extrudeStartFrame, extrudeEndFrame],\n [0, fitRadius],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.16, 1, 0.3, 1),\n },\n );\n\n const depth = radius * 2;\n\n const theta = (extrudeAngleDeg * Math.PI) / 180;\n const stepX = (depth * Math.sin(theta)) / extrudeSteps;\n const stepY = (depth * Math.cos(theta)) / extrudeSteps;\n\n const glyph = (fill: string, dx: number, dy: number, key?: string) => (\n <text\n key={key}\n x={basePosition[0] + dx}\n y={basePosition[1] + dy}\n textAnchor=\"middle\"\n fontFamily={fontFamily}\n fontWeight={fontWeight}\n fontSize={fitFontSize}\n fill={fill}\n >\n {letter}\n </text>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <g>\n {Array.from(\n { length: extrudeSteps + 1 },\n (_, i) => extrudeSteps - i,\n ).map((i) => glyph(bodyColor, stepX * i, stepY * i, `body-${i}`))}\n </g>\n\n {glyph(faceColor, stepX * extrudeSteps, stepY * extrudeSteps)}\n </svg>\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ExtrudePopProps {\n className?: string;\n width?: number;\n height?: number;\n letter?: string;\n fontFamily?: string;\n fontWeight?: number | string;\n fontSize?: number;\n basePosition?: [number, number];\n maxTextWidth?: number;\n minimaxRadius?: number;\n extrudeAngleDeg?: number;\n extrudeSteps?: number;\n extrudeStartFrame?: number;\n extrudeEndFrame?: number;\n bodyColor?: string;\n faceColor?: string;\n}\n\nfunction ExtrudePopBase({\n className,\n width = 1920,\n height = 1080,\n letter = \"WIN\",\n fontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n fontWeight = 700,\n fontSize = 603,\n basePosition = [959.2, 752.5],\n maxTextWidth = 1660,\n minimaxRadius = 80,\n extrudeAngleDeg = -58.6,\n extrudeSteps = 200,\n extrudeStartFrame = 0,\n extrudeEndFrame = 48,\n bodyColor = \"#e8192b\",\n faceColor = \"#ffffff\",\n}: ExtrudePopProps) {\n const frame = useCurrentFrame();\n\n const fit = useMemo(() => {\n if (typeof document === \"undefined\") return 1;\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return 1;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n const measured = ctx.measureText(letter).width;\n if (measured <= 0) return 1;\n return Math.min(1, maxTextWidth / measured);\n }, [letter, fontFamily, fontWeight, fontSize, maxTextWidth]);\n\n const fitFontSize = fontSize * fit;\n const fitRadius = minimaxRadius * fit;\n\n const radius = interpolate(\n frame,\n [extrudeStartFrame, extrudeEndFrame],\n [0, fitRadius],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.16, 1, 0.3, 1),\n },\n );\n\n const depth = radius * 2;\n\n const theta = (extrudeAngleDeg * Math.PI) / 180;\n const stepX = (depth * Math.sin(theta)) / extrudeSteps;\n const stepY = (depth * Math.cos(theta)) / extrudeSteps;\n\n const glyph = (fill: string, dx: number, dy: number, key?: string) => (\n <text\n key={key}\n x={basePosition[0] + dx}\n y={basePosition[1] + dy}\n textAnchor=\"middle\"\n fontFamily={fontFamily}\n fontWeight={fontWeight}\n fontSize={fitFontSize}\n fill={fill}\n >\n {letter}\n </text>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <g>\n {Array.from(\n { length: extrudeSteps + 1 },\n (_, i) => extrudeSteps - i,\n ).map((i) => glyph(bodyColor, stepX * i, stepY * i, `body-${i}`))}\n </g>\n\n {glyph(faceColor, stepX * extrudeSteps, stepY * extrudeSteps)}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n letter: {\n type: \"text-content\",\n default: \"WIN\",\n description: \"Text\",\n },\n bodyColor: {\n type: \"color\",\n default: \"#e8192b\",\n description: \"Body color\",\n },\n faceColor: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Face color\",\n },\n minimaxRadius: {\n type: \"number\",\n min: 0,\n max: 200,\n step: 5,\n default: 80,\n description: \"Extrude radius\",\n hiddenFromList: false,\n },\n extrudeAngleDeg: {\n type: \"number\",\n min: -180,\n max: 180,\n step: 1,\n default: -58.6,\n description: \"Extrude angle\",\n hiddenFromList: false,\n },\n extrudeEndFrame: {\n type: \"number\",\n min: 10,\n max: 90,\n step: 1,\n default: 48,\n description: \"Extrude ends (frame)\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"letter\",\"bodyColor\",\"faceColor\",\"minimaxRadius\",\"extrudeAngleDeg\",\"extrudeEndFrame\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n letter: \"WIN\",\n bodyColor: \"#e8192b\",\n faceColor: \"#ffffff\",\n minimaxRadius: 80,\n extrudeAngleDeg: -58.6,\n extrudeEndFrame: 48,\n speed: 1,\n};\n\ntype ExtrudePopElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ExtrudePopBase>;\n\nconst ExtrudePopInner = forwardRef<\n HTMLDivElement,\n ExtrudePopElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ExtrudePop>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ExtrudePopBase\n {...(componentProps as unknown as ComponentProps<typeof ExtrudePopBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ExtrudePop = Interactive.withSchema({\n Component: ExtrudePopInner,\n componentName: \"<ExtrudePop>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 48}diff --git a/registry-artifacts/elements/fade-through.json b/registry-artifacts/elements/fade-through.jsonindex 087be34f..39f3608f 100644--- a/registry-artifacts/elements/fade-through.json+++ b/registry-artifacts/elements/fade-through.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Fade Through","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "fade-through",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface FadeThroughProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function FadeThrough({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FadeThroughProps) {\n const frame = useCurrentFrame() * speed;\n\n const exitDur = 8;\n const enterDur = 13;\n const overlapF = 1;\n const microDelayF = 2;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toY = interpolate(local, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `translateY(${fromY}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `translateY(${toY}px) scale(${toScale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface FadeThroughProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction FadeThroughBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FadeThroughProps) {\n const frame = useCurrentFrame() * speed;\n\n const exitDur = 8;\n const enterDur = 13;\n const overlapF = 1;\n const microDelayF = 2;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toY = interpolate(local, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `translateY(${fromY}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `translateY(${toY}px) scale(${toScale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Calm transitions.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Fade through content.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Calm transitions.\",\n toText: \"Fade through content.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype FadeThroughElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FadeThroughBase>;\n\nconst FadeThroughInner = forwardRef<\n HTMLDivElement,\n FadeThroughElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<FadeThrough>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <FadeThroughBase\n {...(componentProps as unknown as ComponentProps<typeof FadeThroughBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FadeThrough = Interactive.withSchema({\n Component: FadeThroughInner,\n componentName: \"<FadeThrough>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/focus-blur-resolve.json b/registry-artifacts/elements/focus-blur-resolve.jsonindex 753a4099..882195b1 100644--- a/registry-artifacts/elements/focus-blur-resolve.json+++ b/registry-artifacts/elements/focus-blur-resolve.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Focus Blur Resolve","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "focus-blur-resolve",- "sourceCode": "import { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface FocusBlurResolveProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function FocusBlurResolve({\n text,\n blur = 14,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FocusBlurResolveProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDur = 23;\n const exitDur = 16;\n const exitStart = Math.max(enterDur, durationInFrames - exitDur);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDur], [14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(frame, [0, enterDur], [blur, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(frame, [exitStart, durationInFrames], [0, 10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blurVal = blurEnter + blurExit;\n\n const scale = interpolate(frame, [0, enterDur], [1.01, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface FocusBlurResolveProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction FocusBlurResolveBase({\n text,\n blur = 14,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FocusBlurResolveProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDur = 23;\n const exitDur = 16;\n const exitStart = Math.max(enterDur, durationInFrames - exitDur);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDur], [14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(frame, [0, enterDur], [blur, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(frame, [exitStart, durationInFrames], [0, 10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blurVal = blurEnter + blurExit;\n\n const scale = interpolate(frame, [0, enterDur], [1.01, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Focus resolves clearly.\",\n description: \"Text\",\n },\n blur: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 14,\n description: \"Blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"blur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Focus resolves clearly.\",\n blur: 14,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype FocusBlurResolveElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FocusBlurResolveBase>;\n\nconst FocusBlurResolveInner = forwardRef<\n HTMLDivElement,\n FocusBlurResolveElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<FocusBlurResolve>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <FocusBlurResolveBase\n {...(componentProps as unknown as ComponentProps<typeof FocusBlurResolveBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FocusBlurResolve = Interactive.withSchema({\n Component: FocusBlurResolveInner,\n componentName: \"<FocusBlurResolve>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/gooey-morph.json b/registry-artifacts/elements/gooey-morph.jsonindex 445cf4ca..66980be3 100644--- a/registry-artifacts/elements/gooey-morph.json+++ b/registry-artifacts/elements/gooey-morph.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Gooey Morph","durationInFrames": 76,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "gooey-morph",- "sourceCode": "import { useId } from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface GooeyMorphProps {\n className?: string;\n width?: number;\n height?: number;\n barWidth?: number;\n barHeight?: number;\n barStartPositions?: [number, number][];\n barRestPositions?: [number, number][];\n barEntryFrames?: number[];\n barTravelFrames?: number;\n word?: string;\n fontFamily?: string;\n fontSize?: number;\n tracking?: number;\n wordCenterX?: number;\n wordBaselineY?: number;\n blurRadius?: number;\n blurIterations?: number;\n alphaInputBlack?: number;\n alphaInputWhite?: number;\n morphStartFrame?: number;\n morphPeakFrame?: number;\n morphEndFrame?: number;\n displaceAmount?: number;\n displaceSize?: number;\n displaceComplexity?: number;\n displaceEvolutionPerSecond?: number;\n fill?: string;\n}\n\nfunction boxBlurSigma(radius: number, iterations: number): number {\n const w = 2 * radius + 1;\n return Math.sqrt((iterations * (w * w - 1)) / 12);\n}\n\nexport function GooeyMorph({\n className,\n width = 1920,\n height = 1080,\n barWidth = 213,\n barHeight = 181,\n barStartPositions = [\n [956.9, 764.9],\n [297.5, 799.9],\n [738.2, 257.9],\n [1617.9, 302.9],\n ],\n barRestPositions = [\n [634.9, 538.9],\n [852.5, 538.9],\n [1070.2, 538.9],\n [1287.9, 538.9],\n ],\n barEntryFrames = [8, 0, 4, 13],\n barTravelFrames = 30,\n word = \"HELLO\",\n fontFamily = \"sans-serif\",\n fontSize = 237,\n tracking = 0,\n wordCenterX = 961.4,\n wordBaselineY = 601.3,\n blurRadius = 6,\n blurIterations = 6,\n alphaInputBlack = 0.4588,\n alphaInputWhite = 0.5098,\n morphStartFrame = 50,\n morphPeakFrame = 63,\n morphEndFrame = 76,\n displaceAmount = 20,\n displaceSize = 19,\n displaceComplexity = 1,\n displaceEvolutionPerSecond = 50,\n fill = \"#ffffff\",\n}: GooeyMorphProps) {\n const frame = useCurrentFrame();\n const filterId = useId();\n\n const travelEase = Easing.bezier(0.88, 0.14, 0.12, 0.86);\n\n const morphWindow: [number, number, number] = [\n morphStartFrame,\n morphPeakFrame,\n morphEndFrame,\n ];\n\n const blur = interpolate(frame, morphWindow, [0, blurRadius, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.33, 0, 0.67, 1),\n });\n const sigma = boxBlurSigma(blur, blurIterations);\n\n const displaceScale = interpolate(\n frame,\n morphWindow,\n [0, displaceAmount, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.33, 0, 0.67, 1),\n },\n );\n\n const barsOpacity = interpolate(\n frame,\n [morphStartFrame, morphEndFrame],\n [1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n const wordOpacity = interpolate(\n frame,\n [morphStartFrame, morphEndFrame],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const slope = 1 / Math.max(alphaInputWhite - alphaInputBlack, 1e-6);\n const offset = -alphaInputBlack * slope;\n\n const evolution = (frame / 30) * displaceEvolutionPerSecond;\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <defs>\n <filter\n id={filterId}\n x=\"-15%\"\n y=\"-15%\"\n width=\"130%\"\n height=\"130%\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation={sigma}\n result=\"blurred\"\n />\n <feColorMatrix\n in=\"blurred\"\n type=\"matrix\"\n values={[\n \"1 0 0 0 0\",\n \"0 1 0 0 0\",\n \"0 0 1 0 0\",\n `0 0 0 ${slope} ${offset}`,\n ].join(\" \")}\n result=\"threshold\"\n />\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={1 / Math.max(displaceSize, 1)}\n numOctaves={Math.max(1, Math.round(displaceComplexity))}\n seed={7}\n result=\"noise\"\n />\n <feOffset\n in=\"noise\"\n dx={evolution}\n dy={evolution * 0.6}\n result=\"noiseMoved\"\n />\n <feDisplacementMap\n in=\"threshold\"\n in2=\"noiseMoved\"\n scale={displaceScale}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n />\n </filter>\n </defs>\n\n <g filter={`url(#${filterId})`}>\n <g opacity={barsOpacity}>\n {barRestPositions.map((rest, i) => {\n const start = barStartPositions[i] ?? rest;\n const entry = barEntryFrames[i] ?? 0;\n const local = frame - entry;\n const stops = [0, barTravelFrames / 2, barTravelFrames];\n\n const x = interpolate(\n local,\n stops,\n [start[0], rest[0], rest[0]],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEase,\n },\n );\n const y = interpolate(\n local,\n stops,\n [start[1], start[1], rest[1]],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEase,\n },\n );\n\n return (\n <rect\n key={rest.join(\",\")}\n x={x - barWidth / 2}\n y={y - barHeight / 2}\n width={barWidth}\n height={barHeight}\n fill={fill}\n />\n );\n })}\n </g>\n\n <text\n x={wordCenterX}\n y={wordBaselineY}\n textAnchor=\"middle\"\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={900}\n letterSpacing={tracking}\n fill={fill}\n opacity={wordOpacity}\n >\n {word}\n </text>\n </g>\n </svg>\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface GooeyMorphProps {\n className?: string;\n width?: number;\n height?: number;\n barWidth?: number;\n barHeight?: number;\n barStartPositions?: [number, number][];\n barRestPositions?: [number, number][];\n barEntryFrames?: number[];\n barTravelFrames?: number;\n word?: string;\n fontFamily?: string;\n fontSize?: number;\n tracking?: number;\n wordCenterX?: number;\n wordBaselineY?: number;\n blurRadius?: number;\n blurIterations?: number;\n alphaInputBlack?: number;\n alphaInputWhite?: number;\n morphStartFrame?: number;\n morphPeakFrame?: number;\n morphEndFrame?: number;\n displaceAmount?: number;\n displaceSize?: number;\n displaceComplexity?: number;\n displaceEvolutionPerSecond?: number;\n fill?: string;\n}\n\nfunction boxBlurSigma(radius: number, iterations: number): number {\n const w = 2 * radius + 1;\n return Math.sqrt((iterations * (w * w - 1)) / 12);\n}\n\nfunction GooeyMorphBase({\n className,\n width = 1920,\n height = 1080,\n barWidth = 213,\n barHeight = 181,\n barStartPositions = [\n [956.9, 764.9],\n [297.5, 799.9],\n [738.2, 257.9],\n [1617.9, 302.9],\n ],\n barRestPositions = [\n [634.9, 538.9],\n [852.5, 538.9],\n [1070.2, 538.9],\n [1287.9, 538.9],\n ],\n barEntryFrames = [8, 0, 4, 13],\n barTravelFrames = 30,\n word = \"HELLO\",\n fontFamily = \"sans-serif\",\n fontSize = 237,\n tracking = 0,\n wordCenterX = 961.4,\n wordBaselineY = 601.3,\n blurRadius = 6,\n blurIterations = 6,\n alphaInputBlack = 0.4588,\n alphaInputWhite = 0.5098,\n morphStartFrame = 50,\n morphPeakFrame = 63,\n morphEndFrame = 76,\n displaceAmount = 20,\n displaceSize = 19,\n displaceComplexity = 1,\n displaceEvolutionPerSecond = 50,\n fill = \"#ffffff\",\n}: GooeyMorphProps) {\n const frame = useCurrentFrame();\n const filterId = useId();\n\n const travelEase = Easing.bezier(0.88, 0.14, 0.12, 0.86);\n\n const morphWindow: [number, number, number] = [\n morphStartFrame,\n morphPeakFrame,\n morphEndFrame,\n ];\n\n const blur = interpolate(frame, morphWindow, [0, blurRadius, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.33, 0, 0.67, 1),\n });\n const sigma = boxBlurSigma(blur, blurIterations);\n\n const displaceScale = interpolate(\n frame,\n morphWindow,\n [0, displaceAmount, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.33, 0, 0.67, 1),\n },\n );\n\n const barsOpacity = interpolate(\n frame,\n [morphStartFrame, morphEndFrame],\n [1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n const wordOpacity = interpolate(\n frame,\n [morphStartFrame, morphEndFrame],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const slope = 1 / Math.max(alphaInputWhite - alphaInputBlack, 1e-6);\n const offset = -alphaInputBlack * slope;\n\n const evolution = (frame / 30) * displaceEvolutionPerSecond;\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <defs>\n <filter\n id={filterId}\n x=\"-15%\"\n y=\"-15%\"\n width=\"130%\"\n height=\"130%\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation={sigma}\n result=\"blurred\"\n />\n <feColorMatrix\n in=\"blurred\"\n type=\"matrix\"\n values={[\n \"1 0 0 0 0\",\n \"0 1 0 0 0\",\n \"0 0 1 0 0\",\n `0 0 0 ${slope} ${offset}`,\n ].join(\" \")}\n result=\"threshold\"\n />\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={1 / Math.max(displaceSize, 1)}\n numOctaves={Math.max(1, Math.round(displaceComplexity))}\n seed={7}\n result=\"noise\"\n />\n <feOffset\n in=\"noise\"\n dx={evolution}\n dy={evolution * 0.6}\n result=\"noiseMoved\"\n />\n <feDisplacementMap\n in=\"threshold\"\n in2=\"noiseMoved\"\n scale={displaceScale}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n />\n </filter>\n </defs>\n\n <g filter={`url(#${filterId})`}>\n <g opacity={barsOpacity}>\n {barRestPositions.map((rest, i) => {\n const start = barStartPositions[i] ?? rest;\n const entry = barEntryFrames[i] ?? 0;\n const local = frame - entry;\n const stops = [0, barTravelFrames / 2, barTravelFrames];\n\n const x = interpolate(\n local,\n stops,\n [start[0], rest[0], rest[0]],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEase,\n },\n );\n const y = interpolate(\n local,\n stops,\n [start[1], start[1], rest[1]],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEase,\n },\n );\n\n return (\n <rect\n key={rest.join(\",\")}\n x={x - barWidth / 2}\n y={y - barHeight / 2}\n width={barWidth}\n height={barHeight}\n fill={fill}\n />\n );\n })}\n </g>\n\n <text\n x={wordCenterX}\n y={wordBaselineY}\n textAnchor=\"middle\"\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={900}\n letterSpacing={tracking}\n fill={fill}\n opacity={wordOpacity}\n >\n {word}\n </text>\n </g>\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n word: {\n type: \"text-content\",\n default: \"HELLO\",\n description: \"Word\",\n },\n fill: {\n type: \"color\",\n default: \"#f2f2f2\",\n description: \"Fill\",\n },\n fontFamily: {\n type: \"text-content\",\n default: \"'Bodoni Moda', Georgia, serif\",\n description: \"Font family\",\n },\n blurRadius: {\n type: \"number\",\n min: 0,\n max: 20,\n step: 1,\n default: 6,\n description: \"Goo blur radius\",\n hiddenFromList: false,\n },\n displaceAmount: {\n type: \"number\",\n min: 0,\n max: 80,\n step: 1,\n default: 20,\n description: \"Displace amount\",\n hiddenFromList: false,\n },\n barTravelFrames: {\n type: \"number\",\n min: 10,\n max: 60,\n step: 1,\n default: 30,\n description: \"Bar travel (frames)\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"word\",\"fill\",\"fontFamily\",\"blurRadius\",\"displaceAmount\",\"barTravelFrames\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n word: \"HELLO\",\n fill: \"#f2f2f2\",\n fontFamily: \"'Bodoni Moda', Georgia, serif\",\n blurRadius: 6,\n displaceAmount: 20,\n barTravelFrames: 30,\n speed: 1,\n};\n\ntype GooeyMorphElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GooeyMorphBase>;\n\nconst GooeyMorphInner = forwardRef<\n HTMLDivElement,\n GooeyMorphElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<GooeyMorph>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <GooeyMorphBase\n {...(componentProps as unknown as ComponentProps<typeof GooeyMorphBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GooeyMorph = Interactive.withSchema({\n Component: GooeyMorphInner,\n componentName: \"<GooeyMorph>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 76}diff --git a/registry-artifacts/elements/halftone-print.json b/registry-artifacts/elements/halftone-print.jsonindex 04d1780f..1017128b 100644--- a/registry-artifacts/elements/halftone-print.json+++ b/registry-artifacts/elements/halftone-print.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Halftone Print","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "halftone-print",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type HalftonePrintProps = {\n dotSize?: number;\n angle?: number;\n misregistration?: number;\n paperTint?: string;\n};\n\nconst DEFAULTS = {\n dotSize: 10,\n angle: 0,\n misregistration: 1.2,\n paperTint: \"#f4efe4\",\n};\n\ntype NormalizedProps = {\n cell: number;\n angle: number;\n shift: number;\n paper: string;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_cell;\nuniform float u_angle;\nuniform float u_shift;\nuniform vec3 u_paper;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst vec3 CYAN_ABSORB = vec3(0.92, 0.12, 0.02);\nconst vec3 MAGENTA_ABSORB = vec3(0.10, 0.88, 0.06);\nconst vec3 YELLOW_ABSORB = vec3(0.03, 0.10, 0.90);\n\nvec2 toSquare(vec2 uv) {\n return vec2(uv.x * u_aspect, uv.y);\n}\n\nvec2 fromSquare(vec2 p) {\n return vec2(p.x / u_aspect, p.y);\n}\n\nfloat screenInk(float angle, vec2 drift, vec3 pick) {\n vec2 p = toSquare(v_uv);\n float s = sin(angle);\n float c = cos(angle);\n vec2 r = vec2(p.x * c - p.y * s, p.x * s + p.y * c);\n\n vec2 center = (floor(r / u_cell) + 0.5) * u_cell;\n vec2 unrotated =\n vec2(center.x * c + center.y * s, -center.x * s + center.y * c);\n\n vec4 texel = texture(u_scene, fromSquare(unrotated + drift));\n vec3 straight = texel.rgb / max(texel.a, 0.004);\n float ink = clamp(1.0 - dot(straight, pick), 0.0, 1.0) * texel.a;\n\n float radius = sqrt(ink) * u_cell * 0.72;\n float aa = u_cell * 0.045;\n float coverage = 1.0 - smoothstep(radius - aa, radius + aa, length(r - center));\n return coverage * step(0.002, ink);\n}\n\nvoid main() {\n vec4 source = texture(u_scene, v_uv);\n\n float cyan =\n screenInk(u_angle + 0.2618, u_shift * vec2(1.0, 0.0), vec3(1.0, 0.0, 0.0));\n float magenta =\n screenInk(u_angle + 1.3090, u_shift * vec2(-0.5, 0.866), vec3(0.0, 1.0, 0.0));\n float yellow =\n screenInk(u_angle, u_shift * vec2(-0.5, -0.866), vec3(0.0, 0.0, 1.0));\n\n vec3 color = u_paper;\n color *= 1.0 - cyan * CYAN_ABSORB;\n color *= 1.0 - magenta * MAGENTA_ABSORB;\n color *= 1.0 - yellow * YELLOW_ABSORB;\n\n outColor = vec4(color * source.a, source.a);\n}`;\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { cell, angle, shift, paper } = passedProps;\n gl.uniform1f(uniform(\"u_cell\"), cell);\n gl.uniform1f(uniform(\"u_angle\"), angle);\n gl.uniform1f(uniform(\"u_shift\"), shift);\n gl.uniform3fv(uniform(\"u_paper\"), toRgb(paper));\n },\n);\n\nconst HalftonePrintFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n}) => <AbsoluteFill>{children}</AbsoluteFill>;\n\nconst HalftonePrintCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: HalftonePrintFallback,\n});\n\nexport const HalftonePrint: React.FC<\n HalftonePrintProps & CanvasFilterProps\n> = ({\n dotSize = DEFAULTS.dotSize,\n angle = DEFAULTS.angle,\n misregistration = DEFAULTS.misregistration,\n paperTint = DEFAULTS.paperTint,\n children,\n}) => {\n const { height } = useVideoConfig();\n\n return (\n <HalftonePrintCanvas\n cell={Math.max(dotSize, 1) / height}\n angle={(angle * Math.PI) / 180}\n shift={misregistration / height}\n paper={paperTint}\n >\n {children}\n </HalftonePrintCanvas>\n );\n};"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype HalftonePrintProps = {\n dotSize?: number;\n angle?: number;\n misregistration?: number;\n paperTint?: string;\n};\n\nconst DEFAULTS = {\n dotSize: 10,\n angle: 0,\n misregistration: 1.2,\n paperTint: \"#f4efe4\",\n};\n\ntype NormalizedProps = {\n cell: number;\n angle: number;\n shift: number;\n paper: string;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_cell;\nuniform float u_angle;\nuniform float u_shift;\nuniform vec3 u_paper;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst vec3 CYAN_ABSORB = vec3(0.92, 0.12, 0.02);\nconst vec3 MAGENTA_ABSORB = vec3(0.10, 0.88, 0.06);\nconst vec3 YELLOW_ABSORB = vec3(0.03, 0.10, 0.90);\n\nvec2 toSquare(vec2 uv) {\n return vec2(uv.x * u_aspect, uv.y);\n}\n\nvec2 fromSquare(vec2 p) {\n return vec2(p.x / u_aspect, p.y);\n}\n\nfloat screenInk(float angle, vec2 drift, vec3 pick) {\n vec2 p = toSquare(v_uv);\n float s = sin(angle);\n float c = cos(angle);\n vec2 r = vec2(p.x * c - p.y * s, p.x * s + p.y * c);\n\n vec2 center = (floor(r / u_cell) + 0.5) * u_cell;\n vec2 unrotated =\n vec2(center.x * c + center.y * s, -center.x * s + center.y * c);\n\n vec4 texel = texture(u_scene, fromSquare(unrotated + drift));\n vec3 straight = texel.rgb / max(texel.a, 0.004);\n float ink = clamp(1.0 - dot(straight, pick), 0.0, 1.0) * texel.a;\n\n float radius = sqrt(ink) * u_cell * 0.72;\n float aa = u_cell * 0.045;\n float coverage = 1.0 - smoothstep(radius - aa, radius + aa, length(r - center));\n return coverage * step(0.002, ink);\n}\n\nvoid main() {\n vec4 source = texture(u_scene, v_uv);\n\n float cyan =\n screenInk(u_angle + 0.2618, u_shift * vec2(1.0, 0.0), vec3(1.0, 0.0, 0.0));\n float magenta =\n screenInk(u_angle + 1.3090, u_shift * vec2(-0.5, 0.866), vec3(0.0, 1.0, 0.0));\n float yellow =\n screenInk(u_angle, u_shift * vec2(-0.5, -0.866), vec3(0.0, 0.0, 1.0));\n\n vec3 color = u_paper;\n color *= 1.0 - cyan * CYAN_ABSORB;\n color *= 1.0 - magenta * MAGENTA_ABSORB;\n color *= 1.0 - yellow * YELLOW_ABSORB;\n\n outColor = vec4(color * source.a, source.a);\n}`;\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { cell, angle, shift, paper } = passedProps;\n gl.uniform1f(uniform(\"u_cell\"), cell);\n gl.uniform1f(uniform(\"u_angle\"), angle);\n gl.uniform1f(uniform(\"u_shift\"), shift);\n gl.uniform3fv(uniform(\"u_paper\"), toRgb(paper));\n },\n);\n\nconst HalftonePrintFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n}) => <AbsoluteFill>{children}</AbsoluteFill>;\n\nconst HalftonePrintCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: HalftonePrintFallback,\n});\n\nconst HalftonePrintBase: React.FC<\n HalftonePrintProps & CanvasFilterProps\n> = ({\n dotSize = DEFAULTS.dotSize,\n angle = DEFAULTS.angle,\n misregistration = DEFAULTS.misregistration,\n paperTint = DEFAULTS.paperTint,\n children,\n}) => {\n const { height } = useVideoConfig();\n\n return (\n <HalftonePrintCanvas\n cell={Math.max(dotSize, 1) / height}\n angle={(angle * Math.PI) / 180}\n shift={misregistration / height}\n paper={paperTint}\n >\n {children}\n </HalftonePrintCanvas>\n );\n};\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n dotSize: {\n type: \"number\",\n min: 4,\n max: 32,\n step: 1,\n default: 10,\n description: \"Dot size\",\n hiddenFromList: false,\n },\n angle: {\n type: \"number\",\n min: 0,\n max: 90,\n step: 1,\n default: 0,\n description: \"Screen angle\",\n hiddenFromList: false,\n },\n misregistration: {\n type: \"number\",\n min: 0,\n max: 6,\n step: 0.2,\n default: 1.2,\n description: \"Misregistration\",\n hiddenFromList: false,\n },\n paperTint: {\n type: \"color\",\n default: \"#f4efe4\",\n description: \"Paper\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"dotSize\",\"angle\",\"misregistration\",\"paperTint\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n dotSize: 10,\n angle: 0,\n misregistration: 1.2,\n paperTint: \"#f4efe4\",\n speed: 1,\n};\n\ntype HalftonePrintElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HalftonePrintBase>;\n\nconst HalftonePrintInner = forwardRef<\n HTMLDivElement,\n HalftonePrintElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<HalftonePrint>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <HalftonePrintBase\n {...(componentProps as unknown as ComponentProps<typeof HalftonePrintBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HalftonePrint = Interactive.withSchema({\n Component: HalftonePrintInner,\n componentName: \"<HalftonePrint>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/hologram.json b/registry-artifacts/elements/hologram.jsonindex 6e50170c..dd26c0e7 100644--- a/registry-artifacts/elements/hologram.json+++ b/registry-artifacts/elements/hologram.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Hologram","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "hologram",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type HologramProps = {\n tint?: string;\n glow?: number;\n ghost?: number;\n flicker?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n tint: \"#63e8ff\",\n glow: 1,\n ghost: 1,\n flicker: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_frame;\nuniform vec3 u_tint;\nuniform float u_glow;\nuniform float u_ghost;\nuniform float u_flicker;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float TAU = 6.28318530718;\nconst float GOLDEN = 2.39996323;\nconst int HALO_TAPS = 8;\nconst vec3 LUMA = vec3(0.299, 0.587, 0.114);\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\nfloat lumaAt(vec2 uv) {\n return dot(texture(u_scene, uv).rgb, LUMA);\n}\n\nvoid main() {\n vec4 src = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n if (!(amount > 0.001)) {\n outColor = src;\n return;\n }\n\n float row = floor(v_uv.y * 300.0);\n float clock = floor(u_frame);\n float slip =\n (hash(vec2(row, clock)) - 0.5) * u_ghost * 0.006 * step(0.55, hash(vec2(row, clock + 3.0)));\n vec2 base = vec2(v_uv.x + slip / u_aspect, v_uv.y);\n\n vec4 held = texture(u_scene, base);\n float lit = dot(held.rgb, LUMA);\n\n vec2 apart = vec2(u_ghost * 0.0045 / u_aspect, u_ghost * 0.0035);\n vec3 twin = texture(u_scene, base + apart).rgb;\n\n float step2 = 0.0022;\n float gx =\n lumaAt(base + vec2(step2 / u_aspect, 0.0)) -\n lumaAt(base - vec2(step2 / u_aspect, 0.0));\n float gy = lumaAt(base + vec2(0.0, step2)) - lumaAt(base - vec2(0.0, step2));\n float rim = clamp(length(vec2(gx, gy)) * 7.0, 0.0, 1.0);\n\n vec3 halo = vec3(0.0);\n for (int i = 0; i < HALO_TAPS; i++) {\n float angle = float(i) * GOLDEN;\n float reach = sqrt((float(i) + 0.5) / float(HALO_TAPS)) * u_glow * 0.022;\n vec2 at = base + vec2(cos(angle) * reach / u_aspect, sin(angle) * reach);\n halo += max(texture(u_scene, at).rgb - 0.34, vec3(0.0));\n }\n halo /= float(HALO_TAPS);\n\n vec3 core = u_tint * (0.12 + lit * 1.55);\n core = mix(core, held.rgb * u_tint * 1.9, 0.12);\n core += u_tint * rim * 1.9 * u_glow;\n core += halo * u_tint * 2.4 * u_glow;\n core += twin * u_tint * 0.5 * u_ghost;\n\n float interlace = mod(row, 2.0) < 1.0 ? 1.0 : 0.58;\n core *= interlace;\n\n float blink =\n 1.0 -\n u_flicker *\n (0.04 + 0.05 * hash(vec2(clock, 7.0))) *\n (0.5 + 0.5 * sin(u_frame * TAU / 15.0));\n core *= blink;\n\n float presence = clamp(lit * 1.5 + rim * 0.8 + 0.03, 0.0, 1.0);\n vec3 painted = clamp(u_tint * 0.035 + core * presence, 0.0, 1.0);\n\n outColor = vec4(mix(src.rgb, painted, amount), src.a);\n}`;\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<HologramProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n tint = DEFAULTS.tint,\n glow = DEFAULTS.glow,\n ghost = DEFAULTS.ghost,\n flicker = DEFAULTS.flicker,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform3fv(uniform(\"u_tint\"), toRgb(tint));\n gl.uniform1f(uniform(\"u_glow\"), glow);\n gl.uniform1f(uniform(\"u_ghost\"), ghost);\n gl.uniform1f(uniform(\"u_flicker\"), flicker);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst HologramFallback: React.FC<HologramProps & CanvasFilterProps> = ({\n children,\n tint = DEFAULTS.tint,\n intensity = DEFAULTS.intensity,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill style={{ filter: `saturate(${1 - 0.5 * intensity})` }}>\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"color\",\n opacity: 0.75 * intensity,\n }}\n />\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0px, rgba(0, 0, 0, 0.32) 2px, transparent 2px, transparent 4px)\",\n opacity: intensity,\n }}\n />\n </AbsoluteFill>\n);\n\nexport const Hologram = makeCanvasFilter<HologramProps>({\n shader,\n fallback: HologramFallback,\n});"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype HologramProps = {\n tint?: string;\n glow?: number;\n ghost?: number;\n flicker?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n tint: \"#63e8ff\",\n glow: 1,\n ghost: 1,\n flicker: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_frame;\nuniform vec3 u_tint;\nuniform float u_glow;\nuniform float u_ghost;\nuniform float u_flicker;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float TAU = 6.28318530718;\nconst float GOLDEN = 2.39996323;\nconst int HALO_TAPS = 8;\nconst vec3 LUMA = vec3(0.299, 0.587, 0.114);\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\nfloat lumaAt(vec2 uv) {\n return dot(texture(u_scene, uv).rgb, LUMA);\n}\n\nvoid main() {\n vec4 src = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n if (!(amount > 0.001)) {\n outColor = src;\n return;\n }\n\n float row = floor(v_uv.y * 300.0);\n float clock = floor(u_frame);\n float slip =\n (hash(vec2(row, clock)) - 0.5) * u_ghost * 0.006 * step(0.55, hash(vec2(row, clock + 3.0)));\n vec2 base = vec2(v_uv.x + slip / u_aspect, v_uv.y);\n\n vec4 held = texture(u_scene, base);\n float lit = dot(held.rgb, LUMA);\n\n vec2 apart = vec2(u_ghost * 0.0045 / u_aspect, u_ghost * 0.0035);\n vec3 twin = texture(u_scene, base + apart).rgb;\n\n float step2 = 0.0022;\n float gx =\n lumaAt(base + vec2(step2 / u_aspect, 0.0)) -\n lumaAt(base - vec2(step2 / u_aspect, 0.0));\n float gy = lumaAt(base + vec2(0.0, step2)) - lumaAt(base - vec2(0.0, step2));\n float rim = clamp(length(vec2(gx, gy)) * 7.0, 0.0, 1.0);\n\n vec3 halo = vec3(0.0);\n for (int i = 0; i < HALO_TAPS; i++) {\n float angle = float(i) * GOLDEN;\n float reach = sqrt((float(i) + 0.5) / float(HALO_TAPS)) * u_glow * 0.022;\n vec2 at = base + vec2(cos(angle) * reach / u_aspect, sin(angle) * reach);\n halo += max(texture(u_scene, at).rgb - 0.34, vec3(0.0));\n }\n halo /= float(HALO_TAPS);\n\n vec3 core = u_tint * (0.12 + lit * 1.55);\n core = mix(core, held.rgb * u_tint * 1.9, 0.12);\n core += u_tint * rim * 1.9 * u_glow;\n core += halo * u_tint * 2.4 * u_glow;\n core += twin * u_tint * 0.5 * u_ghost;\n\n float interlace = mod(row, 2.0) < 1.0 ? 1.0 : 0.58;\n core *= interlace;\n\n float blink =\n 1.0 -\n u_flicker *\n (0.04 + 0.05 * hash(vec2(clock, 7.0))) *\n (0.5 + 0.5 * sin(u_frame * TAU / 15.0));\n core *= blink;\n\n float presence = clamp(lit * 1.5 + rim * 0.8 + 0.03, 0.0, 1.0);\n vec3 painted = clamp(u_tint * 0.035 + core * presence, 0.0, 1.0);\n\n outColor = vec4(mix(src.rgb, painted, amount), src.a);\n}`;\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<HologramProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n tint = DEFAULTS.tint,\n glow = DEFAULTS.glow,\n ghost = DEFAULTS.ghost,\n flicker = DEFAULTS.flicker,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform3fv(uniform(\"u_tint\"), toRgb(tint));\n gl.uniform1f(uniform(\"u_glow\"), glow);\n gl.uniform1f(uniform(\"u_ghost\"), ghost);\n gl.uniform1f(uniform(\"u_flicker\"), flicker);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst HologramFallback: React.FC<HologramProps & CanvasFilterProps> = ({\n children,\n tint = DEFAULTS.tint,\n intensity = DEFAULTS.intensity,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill style={{ filter: `saturate(${1 - 0.5 * intensity})` }}>\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"color\",\n opacity: 0.75 * intensity,\n }}\n />\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0px, rgba(0, 0, 0, 0.32) 2px, transparent 2px, transparent 4px)\",\n opacity: intensity,\n }}\n />\n </AbsoluteFill>\n);\n\nconst HologramBase = makeCanvasFilter<HologramProps>({\n shader,\n fallback: HologramFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n tint: {\n type: \"color\",\n default: \"#63e8ff\",\n description: \"Tint\",\n },\n glow: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Glow\",\n hiddenFromList: false,\n },\n ghost: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Ghost\",\n hiddenFromList: false,\n },\n flicker: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Flicker\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"tint\",\"glow\",\"ghost\",\"flicker\",\"intensity\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n tint: \"#63e8ff\",\n glow: 1,\n ghost: 1,\n flicker: 1,\n intensity: 1,\n speed: 1,\n};\n\ntype HologramElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HologramBase>;\n\nconst HologramInner = forwardRef<\n HTMLDivElement,\n HologramElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Hologram>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <HologramBase\n {...(componentProps as unknown as ComponentProps<typeof HologramBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Hologram = Interactive.withSchema({\n Component: HologramInner,\n componentName: \"<Hologram>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-activity.json b/registry-artifacts/elements/icon-activity.jsonindex 52a1ec67..9ac7bf92 100644--- a/registry-artifacts/elements/icon-activity.json+++ b/registry-artifacts/elements/icon-activity.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Activity","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-activity",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PULSE_PATH =\n \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nexport function ActivityIcon({\n animation = \"both\",\n loop = true,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const beat = acting\n ? interpolate(\n actionProgress,\n [0, 0.1, 0.18, 0.28, 0.38, 1],\n [1, 1.07, 1, 1.05, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const pulse = drawnPathProps(PULSE_PATH, acting ? 1 : drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PULSE_PATH}\n strokeDasharray={pulse.strokeDasharray}\n strokeDashoffset={pulse.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ActivityIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PULSE_PATH =\n \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nfunction ActivityIconBase({\n animation = \"both\",\n loop = true,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const beat = acting\n ? interpolate(\n actionProgress,\n [0, 0.1, 0.18, 0.28, 0.38, 1],\n [1, 1.07, 1, 1.05, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const pulse = drawnPathProps(PULSE_PATH, acting ? 1 : drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PULSE_PATH}\n strokeDasharray={pulse.strokeDasharray}\n strokeDashoffset={pulse.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ActivityIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ActivityIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ActivityIconBase>;\n\nconst ActivityIconInner = forwardRef<\n HTMLDivElement,\n ActivityIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ActivityIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ActivityIconBase\n {...(componentProps as unknown as ComponentProps<typeof ActivityIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ActivityIcon = Interactive.withSchema({\n Component: ActivityIconInner,\n componentName: \"<ActivityIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-alert-triangle.json b/registry-artifacts/elements/icon-alert-triangle.jsonindex e233e344..9463a186 100644--- a/registry-artifacts/elements/icon-alert-triangle.json+++ b/registry-artifacts/elements/icon-alert-triangle.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Alert Triangle","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-alert-triangle",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\";\nconst STEM_PATH = \"M12 9v4\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function AlertTriangleIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.85, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const blinkOpacity = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.25, 1, 0.25, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const stemSquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.85, 1, 0.85, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n <g opacity={blinkOpacity}>\n <g\n transform={`translate(12 13) scale(1 ${stemSquash}) translate(-12 -13)`}\n >\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n </g>\n <g transform={`translate(12 17) scale(${dotPop}) translate(-12 -17)`}>\n <path d={DOT_PATH} />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AlertTriangleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TRIANGLE_PATH} />\n <path d={STEM_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\";\nconst STEM_PATH = \"M12 9v4\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction AlertTriangleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.85, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const blinkOpacity = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.25, 1, 0.25, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const stemSquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.85, 1, 0.85, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n <g opacity={blinkOpacity}>\n <g\n transform={`translate(12 13) scale(1 ${stemSquash}) translate(-12 -13)`}\n >\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n </g>\n <g transform={`translate(12 17) scale(${dotPop}) translate(-12 -17)`}>\n <path d={DOT_PATH} />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AlertTriangleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TRIANGLE_PATH} />\n <path d={STEM_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AlertTriangleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AlertTriangleIconBase>;\n\nconst AlertTriangleIconInner = forwardRef<\n HTMLDivElement,\n AlertTriangleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AlertTriangleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AlertTriangleIconBase\n {...(componentProps as unknown as ComponentProps<typeof AlertTriangleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AlertTriangleIcon = Interactive.withSchema({\n Component: AlertTriangleIconInner,\n componentName: \"<AlertTriangleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-arrow-down.json b/registry-artifacts/elements/icon-arrow-down.jsonindex 8162e24c..fbfcb888 100644--- a/registry-artifacts/elements/icon-arrow-down.json+++ b/registry-artifacts/elements/icon-arrow-down.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Arrow Down","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-arrow-down",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 5v14\";\nconst HEAD_PATH = \"m19 12-7 7-7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nexport function ArrowDownIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 5v14\";\nconst HEAD_PATH = \"m19 12-7 7-7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowDownIconBase>;\n\nconst ArrowDownIconInner = forwardRef<\n HTMLDivElement,\n ArrowDownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ArrowDownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ArrowDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowDownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowDownIcon = Interactive.withSchema({\n Component: ArrowDownIconInner,\n componentName: \"<ArrowDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-arrow-left.json b/registry-artifacts/elements/icon-arrow-left.jsonindex 65d27d3d..5e584682 100644--- a/registry-artifacts/elements/icon-arrow-left.json+++ b/registry-artifacts/elements/icon-arrow-left.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Arrow Left","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-arrow-left",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M19 12H5\";\nconst HEAD_PATH = \"m12 19-7-7 7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nexport function ArrowLeftIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M19 12H5\";\nconst HEAD_PATH = \"m12 19-7-7 7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowLeftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowLeftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowLeftIconBase>;\n\nconst ArrowLeftIconInner = forwardRef<\n HTMLDivElement,\n ArrowLeftIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ArrowLeftIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ArrowLeftIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowLeftIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowLeftIcon = Interactive.withSchema({\n Component: ArrowLeftIconInner,\n componentName: \"<ArrowLeftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-arrow-right.json b/registry-artifacts/elements/icon-arrow-right.jsonindex ae3d841c..3452f3a1 100644--- a/registry-artifacts/elements/icon-arrow-right.json+++ b/registry-artifacts/elements/icon-arrow-right.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Arrow Right","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-arrow-right",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M5 12h14\";\nconst HEAD_PATH = \"m12 5 7 7-7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nexport function ArrowRightIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M5 12h14\";\nconst HEAD_PATH = \"m12 5 7 7-7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowRightIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowRightIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowRightIconBase>;\n\nconst ArrowRightIconInner = forwardRef<\n HTMLDivElement,\n ArrowRightIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ArrowRightIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ArrowRightIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowRightIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowRightIcon = Interactive.withSchema({\n Component: ArrowRightIconInner,\n componentName: \"<ArrowRightIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-arrow-up.json b/registry-artifacts/elements/icon-arrow-up.jsonindex 6c53c228..610fcf2c 100644--- a/registry-artifacts/elements/icon-arrow-up.json+++ b/registry-artifacts/elements/icon-arrow-up.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Arrow Up","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-arrow-up",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 19V5\";\nconst HEAD_PATH = \"m5 12 7-7 7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nexport function ArrowUpIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 19V5\";\nconst HEAD_PATH = \"m5 12 7-7 7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowUpIconBase>;\n\nconst ArrowUpIconInner = forwardRef<\n HTMLDivElement,\n ArrowUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ArrowUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ArrowUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowUpIcon = Interactive.withSchema({\n Component: ArrowUpIconInner,\n componentName: \"<ArrowUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-at-sign.json b/registry-artifacts/elements/icon-at-sign.jsonindex a182cfb6..3c08e845 100644--- a/registry-artifacts/elements/icon-at-sign.json+++ b/registry-artifacts/elements/icon-at-sign.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "At Sign","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-at-sign",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\nconst SWOOSH_PATH = \"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function AtSignIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const circleDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const swooshDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circlePop = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swooshProgress = acting ? 1 : swooshDraw;\n const circleProgress = acting ? 1 : circleDraw;\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const swoosh = drawnPathProps(SWOOSH_PATH, swooshProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - circlePop)} ${CENTER * (1 - circlePop)}) scale(${circlePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </g>\n <path\n d={SWOOSH_PATH}\n strokeDasharray={swoosh.strokeDasharray}\n strokeDashoffset={swoosh.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction AtSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d={SWOOSH_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\nconst SWOOSH_PATH = \"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction AtSignIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const circleDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const swooshDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circlePop = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swooshProgress = acting ? 1 : swooshDraw;\n const circleProgress = acting ? 1 : circleDraw;\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const swoosh = drawnPathProps(SWOOSH_PATH, swooshProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - circlePop)} ${CENTER * (1 - circlePop)}) scale(${circlePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </g>\n <path\n d={SWOOSH_PATH}\n strokeDasharray={swoosh.strokeDasharray}\n strokeDashoffset={swoosh.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction AtSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d={SWOOSH_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AtSignIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AtSignIconBase>;\n\nconst AtSignIconInner = forwardRef<\n HTMLDivElement,\n AtSignIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AtSignIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AtSignIconBase\n {...(componentProps as unknown as ComponentProps<typeof AtSignIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AtSignIcon = Interactive.withSchema({\n Component: AtSignIconInner,\n componentName: \"<AtSignIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-award.json b/registry-artifacts/elements/icon-award.jsonindex c4dbe974..9640de61 100644--- a/registry-artifacts/elements/icon-award.json+++ b/registry-artifacts/elements/icon-award.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Award","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-award",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MEDAL_PATH = \"M12 2a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RIBBON_PATH =\n \"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\";\n\nconst MEDAL_CX = 12;\nconst MEDAL_CY = 8;\nconst PIVOT_X = 12;\nconst PIVOT_Y = 2;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nexport function AwardIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ribbonDraw = acting\n ? interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.35, 0.55, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swing = acting\n ? interpolate(\n actionProgress,\n [0.35, 0.5, 0.65, 0.8, 1],\n [0, 4, -3, 1.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const medal = drawnPathProps(MEDAL_PATH, acting ? 1 : drawProgress);\n const ribbon = drawnPathProps(RIBBON_PATH, ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${MEDAL_CX * (1 - pop)} ${MEDAL_CY * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={RIBBON_PATH}\n strokeDasharray={ribbon.strokeDasharray}\n strokeDashoffset={ribbon.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={MEDAL_PATH}\n strokeDasharray={medal.strokeDasharray}\n strokeDashoffset={medal.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\" />\n <circle cx=\"12\" cy=\"8\" r=\"6\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MEDAL_PATH = \"M12 2a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RIBBON_PATH =\n \"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\";\n\nconst MEDAL_CX = 12;\nconst MEDAL_CY = 8;\nconst PIVOT_X = 12;\nconst PIVOT_Y = 2;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction AwardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ribbonDraw = acting\n ? interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.35, 0.55, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swing = acting\n ? interpolate(\n actionProgress,\n [0.35, 0.5, 0.65, 0.8, 1],\n [0, 4, -3, 1.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const medal = drawnPathProps(MEDAL_PATH, acting ? 1 : drawProgress);\n const ribbon = drawnPathProps(RIBBON_PATH, ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${MEDAL_CX * (1 - pop)} ${MEDAL_CY * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={RIBBON_PATH}\n strokeDasharray={ribbon.strokeDasharray}\n strokeDashoffset={ribbon.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={MEDAL_PATH}\n strokeDasharray={medal.strokeDasharray}\n strokeDashoffset={medal.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\" />\n <circle cx=\"12\" cy=\"8\" r=\"6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AwardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AwardIconBase>;\n\nconst AwardIconInner = forwardRef<\n HTMLDivElement,\n AwardIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AwardIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AwardIconBase\n {...(componentProps as unknown as ComponentProps<typeof AwardIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AwardIcon = Interactive.withSchema({\n Component: AwardIconInner,\n componentName: \"<AwardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-bar-chart-3.json b/registry-artifacts/elements/icon-bar-chart-3.jsonindex 38669d9e..e1243a5f 100644--- a/registry-artifacts/elements/icon-bar-chart-3.json+++ b/registry-artifacts/elements/icon-bar-chart-3.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Bar Chart 3","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-bar-chart-3",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst AXIS_PATH = \"M3 3v16a2 2 0 0 0 2 2h16\";\nconst BARS = [\"M8 17V14\", \"M13 17V5\", \"M18 17V9\"];\nconst BASE_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nexport function BarChart3Icon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const axis = drawnPathProps(AXIS_PATH, drawProgress);\n\n const bars = BARS.map((d, i) => {\n const start = i * 0.22;\n const grow = interpolate(\n actionProgress,\n [start, start + 0.3, start + 0.42],\n [0, 1.08, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n },\n );\n const scaleY = animation === \"draw\" ? 1 : acting ? grow : 0;\n return { d, scaleY };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={AXIS_PATH}\n strokeDasharray={axis.strokeDasharray}\n strokeDashoffset={axis.strokeDashoffset}\n />\n {bars.map((bar) => (\n <g\n key={bar.d}\n transform={`translate(0 ${BASE_Y * (1 - bar.scaleY)}) scale(1 ${bar.scaleY})`}\n >\n <path d={bar.d} />\n </g>\n ))}\n </svg>\n );\n}\n\nfunction BarChart3IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={AXIS_PATH} />\n <path d=\"M18 17V9\" />\n <path d=\"M13 17V5\" />\n <path d=\"M8 17v-3\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst AXIS_PATH = \"M3 3v16a2 2 0 0 0 2 2h16\";\nconst BARS = [\"M8 17V14\", \"M13 17V5\", \"M18 17V9\"];\nconst BASE_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction BarChart3IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const axis = drawnPathProps(AXIS_PATH, drawProgress);\n\n const bars = BARS.map((d, i) => {\n const start = i * 0.22;\n const grow = interpolate(\n actionProgress,\n [start, start + 0.3, start + 0.42],\n [0, 1.08, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n },\n );\n const scaleY = animation === \"draw\" ? 1 : acting ? grow : 0;\n return { d, scaleY };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={AXIS_PATH}\n strokeDasharray={axis.strokeDasharray}\n strokeDashoffset={axis.strokeDashoffset}\n />\n {bars.map((bar) => (\n <g\n key={bar.d}\n transform={`translate(0 ${BASE_Y * (1 - bar.scaleY)}) scale(1 ${bar.scaleY})`}\n >\n <path d={bar.d} />\n </g>\n ))}\n </svg>\n );\n}\n\nfunction BarChart3IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={AXIS_PATH} />\n <path d=\"M18 17V9\" />\n <path d=\"M13 17V5\" />\n <path d=\"M8 17v-3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BarChart3IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BarChart3IconBase>;\n\nconst BarChart3IconInner = forwardRef<\n HTMLDivElement,\n BarChart3IconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<BarChart3Icon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <BarChart3IconBase\n {...(componentProps as unknown as ComponentProps<typeof BarChart3IconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BarChart3Icon = Interactive.withSchema({\n Component: BarChart3IconInner,\n componentName: \"<BarChart3Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-bell.json b/registry-artifacts/elements/icon-bell.jsonindex 3ba4e6de..ced6f902 100644--- a/registry-artifacts/elements/icon-bell.json+++ b/registry-artifacts/elements/icon-bell.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Bell","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-bell",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\";\nconst CLAPPER_PATH = \"M10.268 21a2 2 0 0 0 3.464 0\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nexport function BellIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const clapperProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const clapper = drawnPathProps(CLAPPER_PATH, clapperProgress);\n\n const ring = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [0, 14, -11, 7, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} 12 2)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={CLAPPER_PATH}\n strokeDasharray={clapper.strokeDasharray}\n strokeDashoffset={clapper.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BellIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={CLAPPER_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\";\nconst CLAPPER_PATH = \"M10.268 21a2 2 0 0 0 3.464 0\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction BellIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const clapperProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const clapper = drawnPathProps(CLAPPER_PATH, clapperProgress);\n\n const ring = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [0, 14, -11, 7, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} 12 2)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={CLAPPER_PATH}\n strokeDasharray={clapper.strokeDasharray}\n strokeDashoffset={clapper.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BellIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={CLAPPER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BellIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BellIconBase>;\n\nconst BellIconInner = forwardRef<\n HTMLDivElement,\n BellIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<BellIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <BellIconBase\n {...(componentProps as unknown as ComponentProps<typeof BellIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BellIcon = Interactive.withSchema({\n Component: BellIconInner,\n componentName: \"<BellIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-bookmark.json b/registry-artifacts/elements/icon-bookmark.jsonindex 5d280775..971d1996 100644--- a/registry-artifacts/elements/icon-bookmark.json+++ b/registry-artifacts/elements/icon-bookmark.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Bookmark","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-bookmark",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOOKMARK_PATH =\n \"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function BookmarkIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.6, 1], [-3, 0.5, -0.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(BOOKMARK_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} 12 3) translate(0 ${drop})`}>\n <path\n d={BOOKMARK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BookmarkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOOKMARK_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOOKMARK_PATH =\n \"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction BookmarkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.6, 1], [-3, 0.5, -0.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(BOOKMARK_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} 12 3) translate(0 ${drop})`}>\n <path\n d={BOOKMARK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BookmarkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOOKMARK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BookmarkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BookmarkIconBase>;\n\nconst BookmarkIconInner = forwardRef<\n HTMLDivElement,\n BookmarkIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<BookmarkIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <BookmarkIconBase\n {...(componentProps as unknown as ComponentProps<typeof BookmarkIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BookmarkIcon = Interactive.withSchema({\n Component: BookmarkIconInner,\n componentName: \"<BookmarkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-calendar.json b/registry-artifacts/elements/icon-calendar.jsonindex 12a276d5..9a093007 100644--- a/registry-artifacts/elements/icon-calendar.json+++ b/registry-artifacts/elements/icon-calendar.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Calendar","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-calendar",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 4H19A2 2 0 0 1 21 6V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V6A2 2 0 0 1 5 4Z\";\nconst RING1_PATH = \"M8 2v4\";\nconst RING2_PATH = \"M16 2v4\";\nconst RULE_PATH = \"M3 10H21\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function CalendarIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const frameDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ringsDraw = interpolate(linearDraw, [0.4, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ruleDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const ring1Dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const ring2Dip = acting\n ? interpolate(actionProgress, [0.1, 0.35, 0.6], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, acting ? 1 : frameDraw);\n const ring1 = drawnPathProps(RING1_PATH, acting ? 1 : ringsDraw);\n const ring2 = drawnPathProps(RING2_PATH, acting ? 1 : ringsDraw);\n const rule = drawnPathProps(RULE_PATH, acting ? 1 : ruleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${ring1Dip})`}>\n <path\n d={RING1_PATH}\n strokeDasharray={ring1.strokeDasharray}\n strokeDashoffset={ring1.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${ring2Dip})`}>\n <path\n d={RING2_PATH}\n strokeDasharray={ring2.strokeDasharray}\n strokeDashoffset={ring2.strokeDashoffset}\n />\n </g>\n <path\n d={RULE_PATH}\n strokeDasharray={rule.strokeDasharray}\n strokeDashoffset={rule.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CalendarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 4H19A2 2 0 0 1 21 6V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V6A2 2 0 0 1 5 4Z\";\nconst RING1_PATH = \"M8 2v4\";\nconst RING2_PATH = \"M16 2v4\";\nconst RULE_PATH = \"M3 10H21\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction CalendarIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const frameDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ringsDraw = interpolate(linearDraw, [0.4, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ruleDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const ring1Dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const ring2Dip = acting\n ? interpolate(actionProgress, [0.1, 0.35, 0.6], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, acting ? 1 : frameDraw);\n const ring1 = drawnPathProps(RING1_PATH, acting ? 1 : ringsDraw);\n const ring2 = drawnPathProps(RING2_PATH, acting ? 1 : ringsDraw);\n const rule = drawnPathProps(RULE_PATH, acting ? 1 : ruleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${ring1Dip})`}>\n <path\n d={RING1_PATH}\n strokeDasharray={ring1.strokeDasharray}\n strokeDashoffset={ring1.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${ring2Dip})`}>\n <path\n d={RING2_PATH}\n strokeDasharray={ring2.strokeDasharray}\n strokeDashoffset={ring2.strokeDashoffset}\n />\n </g>\n <path\n d={RULE_PATH}\n strokeDasharray={rule.strokeDasharray}\n strokeDashoffset={rule.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CalendarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CalendarIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CalendarIconBase>;\n\nconst CalendarIconInner = forwardRef<\n HTMLDivElement,\n CalendarIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CalendarIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CalendarIconBase\n {...(componentProps as unknown as ComponentProps<typeof CalendarIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CalendarIcon = Interactive.withSchema({\n Component: CalendarIconInner,\n componentName: \"<CalendarIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-camera.json b/registry-artifacts/elements/icon-camera.jsonindex ab6aaf1d..edc6e72d 100644--- a/registry-artifacts/elements/icon-camera.json+++ b/registry-artifacts/elements/icon-camera.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Camera","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-camera",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z\";\nconst LENS_PATH =\n \"M12 10 A3 3 0 0 1 15 13 A3 3 0 0 1 12 16 A3 3 0 0 1 9 13 A3 3 0 0 1 12 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function CameraIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.444, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const shutter = acting\n ? interpolate(\n actionProgress,\n [0, 0.28, 0.56, 0.78, 1],\n [1, 0.55, 1.08, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lensTransform = `translate(${12 * (1 - shutter)} ${13 * (1 - shutter)}) scale(${shutter})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={lensTransform}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CameraIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <circle cx=\"12\" cy=\"13\" r=\"3\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z\";\nconst LENS_PATH =\n \"M12 10 A3 3 0 0 1 15 13 A3 3 0 0 1 12 16 A3 3 0 0 1 9 13 A3 3 0 0 1 12 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CameraIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.444, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const shutter = acting\n ? interpolate(\n actionProgress,\n [0, 0.28, 0.56, 0.78, 1],\n [1, 0.55, 1.08, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lensTransform = `translate(${12 * (1 - shutter)} ${13 * (1 - shutter)}) scale(${shutter})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={lensTransform}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CameraIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <circle cx=\"12\" cy=\"13\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CameraIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CameraIconBase>;\n\nconst CameraIconInner = forwardRef<\n HTMLDivElement,\n CameraIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CameraIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CameraIconBase\n {...(componentProps as unknown as ComponentProps<typeof CameraIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CameraIcon = Interactive.withSchema({\n Component: CameraIconInner,\n componentName: \"<CameraIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-check-circle.json b/registry-artifacts/elements/icon-check-circle.jsonindex e2a844f3..7b61daf8 100644--- a/registry-artifacts/elements/icon-check-circle.json+++ b/registry-artifacts/elements/icon-check-circle.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Check Circle","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-check-circle",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst CHECK_PATH = \"M9 12 11 14 15 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function CheckCircleIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const checkProgress = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const check = drawnPathProps(CHECK_PATH, checkProgress);\n\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={CHECK_PATH}\n strokeDasharray={check.strokeDasharray}\n strokeDashoffset={check.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CHECK_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst CHECK_PATH = \"M9 12 11 14 15 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CheckCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const checkProgress = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const check = drawnPathProps(CHECK_PATH, checkProgress);\n\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={CHECK_PATH}\n strokeDasharray={check.strokeDasharray}\n strokeDashoffset={check.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CHECK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CheckCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CheckCircleIconBase>;\n\nconst CheckCircleIconInner = forwardRef<\n HTMLDivElement,\n CheckCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CheckCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CheckCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof CheckCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CheckCircleIcon = Interactive.withSchema({\n Component: CheckCircleIconInner,\n componentName: \"<CheckCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-check.json b/registry-artifacts/elements/icon-check.jsonindex 5c36b8f6..1595a0f0 100644--- a/registry-artifacts/elements/icon-check.json+++ b/registry-artifacts/elements/icon-check.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Check","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-check",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHECK_PATH = \"M4 12 9 17 20 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function CheckIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHECK_PATH, drawProgress);\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const rotate = interpolate(actionProgress, [0, 0.5], [-4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.18 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={CHECK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHECK_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHECK_PATH = \"M4 12 9 17 20 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CheckIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHECK_PATH, drawProgress);\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const rotate = interpolate(actionProgress, [0, 0.5], [-4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.18 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={CHECK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHECK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CheckIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CheckIconBase>;\n\nconst CheckIconInner = forwardRef<\n HTMLDivElement,\n CheckIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CheckIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CheckIconBase\n {...(componentProps as unknown as ComponentProps<typeof CheckIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CheckIcon = Interactive.withSchema({\n Component: CheckIconInner,\n componentName: \"<CheckIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-chevron-down.json b/registry-artifacts/elements/icon-chevron-down.jsonindex bf02abd3..66311665 100644--- a/registry-artifacts/elements/icon-chevron-down.json+++ b/registry-artifacts/elements/icon-chevron-down.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Chevron Down","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-chevron-down",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M6 9 12 15 18 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function ChevronDownIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M6 9 12 15 18 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronDownIconBase>;\n\nconst ChevronDownIconInner = forwardRef<\n HTMLDivElement,\n ChevronDownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ChevronDownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ChevronDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronDownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronDownIcon = Interactive.withSchema({\n Component: ChevronDownIconInner,\n componentName: \"<ChevronDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-chevron-left.json b/registry-artifacts/elements/icon-chevron-left.jsonindex 84a0d1e1..60ff67e1 100644--- a/registry-artifacts/elements/icon-chevron-left.json+++ b/registry-artifacts/elements/icon-chevron-left.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Chevron Left","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-chevron-left",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M15 18 9 12 15 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function ChevronLeftIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M15 18 9 12 15 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronLeftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronLeftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronLeftIconBase>;\n\nconst ChevronLeftIconInner = forwardRef<\n HTMLDivElement,\n ChevronLeftIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ChevronLeftIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ChevronLeftIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronLeftIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronLeftIcon = Interactive.withSchema({\n Component: ChevronLeftIconInner,\n componentName: \"<ChevronLeftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-chevron-right.json b/registry-artifacts/elements/icon-chevron-right.jsonindex e5102bf3..3b13412a 100644--- a/registry-artifacts/elements/icon-chevron-right.json+++ b/registry-artifacts/elements/icon-chevron-right.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Chevron Right","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-chevron-right",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M9 18 15 12 9 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function ChevronRightIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M9 18 15 12 9 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronRightIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronRightIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronRightIconBase>;\n\nconst ChevronRightIconInner = forwardRef<\n HTMLDivElement,\n ChevronRightIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ChevronRightIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ChevronRightIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronRightIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronRightIcon = Interactive.withSchema({\n Component: ChevronRightIconInner,\n componentName: \"<ChevronRightIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-chevron-up.json b/registry-artifacts/elements/icon-chevron-up.jsonindex 0e28d2cc..016af269 100644--- a/registry-artifacts/elements/icon-chevron-up.json+++ b/registry-artifacts/elements/icon-chevron-up.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Chevron Up","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-chevron-up",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M18 15 12 9 6 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function ChevronUpIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M18 15 12 9 6 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronUpIconBase>;\n\nconst ChevronUpIconInner = forwardRef<\n HTMLDivElement,\n ChevronUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ChevronUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ChevronUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronUpIcon = Interactive.withSchema({\n Component: ChevronUpIconInner,\n componentName: \"<ChevronUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-clock.json b/registry-artifacts/elements/icon-clock.jsonindex 9f939b90..ced4fa81 100644--- a/registry-artifacts/elements/icon-clock.json+++ b/registry-artifacts/elements/icon-clock.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Clock","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-clock",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FACE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst HANDS_PATH = \"M12 6v6l4 2\";\nconst MINUTE_PATH = \"M12 6V12\";\nconst HOUR_PATH = \"M12 12 16 14\";\n\nconst CENTER = 12;\nconst STEPS = 4;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nexport function ClockIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const faceDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scaled = actionProgress * STEPS;\n const stepIndex = Math.floor(scaled);\n const frac = scaled - stepIndex;\n const eased = interpolate(frac, [0, 0.55, 1], [0, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tick = acting ? ((stepIndex + eased) / STEPS) * 360 : 0;\n\n const face = drawnPathProps(FACE_PATH, acting ? 1 : faceDraw);\n const minute = drawnPathProps(MINUTE_PATH, acting ? 1 : handsDraw);\n const hour = drawnPathProps(HOUR_PATH, acting ? 1 : handsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FACE_PATH}\n strokeDasharray={face.strokeDasharray}\n strokeDashoffset={face.strokeDashoffset}\n />\n <path\n d={HOUR_PATH}\n strokeDasharray={hour.strokeDasharray}\n strokeDashoffset={hour.strokeDashoffset}\n />\n <g transform={`rotate(${tick} ${CENTER} ${CENTER})`}>\n <path\n d={MINUTE_PATH}\n strokeDasharray={minute.strokeDasharray}\n strokeDashoffset={minute.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ClockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={HANDS_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FACE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst HANDS_PATH = \"M12 6v6l4 2\";\nconst MINUTE_PATH = \"M12 6V12\";\nconst HOUR_PATH = \"M12 12 16 14\";\n\nconst CENTER = 12;\nconst STEPS = 4;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction ClockIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const faceDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scaled = actionProgress * STEPS;\n const stepIndex = Math.floor(scaled);\n const frac = scaled - stepIndex;\n const eased = interpolate(frac, [0, 0.55, 1], [0, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tick = acting ? ((stepIndex + eased) / STEPS) * 360 : 0;\n\n const face = drawnPathProps(FACE_PATH, acting ? 1 : faceDraw);\n const minute = drawnPathProps(MINUTE_PATH, acting ? 1 : handsDraw);\n const hour = drawnPathProps(HOUR_PATH, acting ? 1 : handsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FACE_PATH}\n strokeDasharray={face.strokeDasharray}\n strokeDashoffset={face.strokeDashoffset}\n />\n <path\n d={HOUR_PATH}\n strokeDasharray={hour.strokeDasharray}\n strokeDashoffset={hour.strokeDashoffset}\n />\n <g transform={`rotate(${tick} ${CENTER} ${CENTER})`}>\n <path\n d={MINUTE_PATH}\n strokeDasharray={minute.strokeDasharray}\n strokeDashoffset={minute.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ClockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={HANDS_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ClockIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ClockIconBase>;\n\nconst ClockIconInner = forwardRef<\n HTMLDivElement,\n ClockIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ClockIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ClockIconBase\n {...(componentProps as unknown as ComponentProps<typeof ClockIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ClockIcon = Interactive.withSchema({\n Component: ClockIconInner,\n componentName: \"<ClockIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-cloud.json b/registry-artifacts/elements/icon-cloud.jsonindex 5436874e..746010f4 100644--- a/registry-artifacts/elements/icon-cloud.json+++ b/registry-artifacts/elements/icon-cloud.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Cloud","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-cloud",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CLOUD_PATH = \"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nexport function CloudIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const float = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 0.8, 1], [0, -2, 0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const cloud = drawnPathProps(CLOUD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${float}px) scale(${scale})`,\n }}\n >\n <path\n d={CLOUD_PATH}\n strokeDasharray={cloud.strokeDasharray}\n strokeDashoffset={cloud.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CloudIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CLOUD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CLOUD_PATH = \"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction CloudIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const float = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 0.8, 1], [0, -2, 0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const cloud = drawnPathProps(CLOUD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${float}px) scale(${scale})`,\n }}\n >\n <path\n d={CLOUD_PATH}\n strokeDasharray={cloud.strokeDasharray}\n strokeDashoffset={cloud.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CloudIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CLOUD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CloudIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CloudIconBase>;\n\nconst CloudIconInner = forwardRef<\n HTMLDivElement,\n CloudIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CloudIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CloudIconBase\n {...(componentProps as unknown as ComponentProps<typeof CloudIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CloudIcon = Interactive.withSchema({\n Component: CloudIconInner,\n componentName: \"<CloudIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-code.json b/registry-artifacts/elements/icon-code.jsonindex 2faca5b5..5b4f7c7f 100644--- a/registry-artifacts/elements/icon-code.json+++ b/registry-artifacts/elements/icon-code.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Code","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-code",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RIGHT_PATH = \"M16 18 22 12 16 6\";\nconst LEFT_PATH = \"M8 6 2 12 8 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function CodeIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const open = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, 2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const right = drawnPathProps(RIGHT_PATH, drawProgress);\n const left = drawnPathProps(LEFT_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${open} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-open} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CodeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RIGHT_PATH = \"M16 18 22 12 16 6\";\nconst LEFT_PATH = \"M8 6 2 12 8 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction CodeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const open = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, 2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const right = drawnPathProps(RIGHT_PATH, drawProgress);\n const left = drawnPathProps(LEFT_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${open} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-open} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CodeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CodeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CodeIconBase>;\n\nconst CodeIconInner = forwardRef<\n HTMLDivElement,\n CodeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CodeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CodeIconBase\n {...(componentProps as unknown as ComponentProps<typeof CodeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CodeIcon = Interactive.withSchema({\n Component: CodeIconInner,\n componentName: \"<CodeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-copy.json b/registry-artifacts/elements/icon-copy.jsonindex d14fdf5e..c8147a03 100644--- a/registry-artifacts/elements/icon-copy.json+++ b/registry-artifacts/elements/icon-copy.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Copy","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-copy",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BACK_PATH = \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\";\nconst FRONT_PATH =\n \"M10 8H20A2 2 0 0 1 22 10V20A2 2 0 0 1 20 22H10A2 2 0 0 1 8 20V10A2 2 0 0 1 10 8Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function CopyIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const backProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const frontProgress = interpolate(linearDraw, [0.286, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const back = drawnPathProps(BACK_PATH, backProgress);\n const front = drawnPathProps(FRONT_PATH, frontProgress);\n\n const offset = interpolate(\n actionProgress,\n [0, 0.35, 0.65, 1],\n [0, -2, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BACK_PATH}\n strokeDasharray={back.strokeDasharray}\n strokeDashoffset={back.strokeDashoffset}\n />\n <g transform={`translate(${offset} ${offset})`}>\n <path\n d={FRONT_PATH}\n strokeDasharray={front.strokeDasharray}\n strokeDashoffset={front.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CopyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d={BACK_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BACK_PATH = \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\";\nconst FRONT_PATH =\n \"M10 8H20A2 2 0 0 1 22 10V20A2 2 0 0 1 20 22H10A2 2 0 0 1 8 20V10A2 2 0 0 1 10 8Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction CopyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const backProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const frontProgress = interpolate(linearDraw, [0.286, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const back = drawnPathProps(BACK_PATH, backProgress);\n const front = drawnPathProps(FRONT_PATH, frontProgress);\n\n const offset = interpolate(\n actionProgress,\n [0, 0.35, 0.65, 1],\n [0, -2, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BACK_PATH}\n strokeDasharray={back.strokeDasharray}\n strokeDashoffset={back.strokeDashoffset}\n />\n <g transform={`translate(${offset} ${offset})`}>\n <path\n d={FRONT_PATH}\n strokeDasharray={front.strokeDasharray}\n strokeDashoffset={front.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CopyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d={BACK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CopyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CopyIconBase>;\n\nconst CopyIconInner = forwardRef<\n HTMLDivElement,\n CopyIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CopyIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CopyIconBase\n {...(componentProps as unknown as ComponentProps<typeof CopyIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CopyIcon = Interactive.withSchema({\n Component: CopyIconInner,\n componentName: \"<CopyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-credit-card.json b/registry-artifacts/elements/icon-credit-card.jsonindex 8f44eccd..33257a24 100644--- a/registry-artifacts/elements/icon-credit-card.json+++ b/registry-artifacts/elements/icon-credit-card.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Credit Card","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-credit-card",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CARD_PATH =\n \"M4 5H20A2 2 0 0 1 22 7V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17V7A2 2 0 0 1 4 5Z\";\nconst STRIPE_PATH = \"M2 10H22\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 19;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function CreditCardIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const swipe = interpolate(actionProgress, [0.1, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const tilt = acting\n ? interpolate(actionProgress, [0.4, 0.6, 1], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const stripeProgress = animation === \"draw\" ? 1 : acting ? swipe : 0;\n\n const card = drawnPathProps(CARD_PATH, drawProgress);\n const stripe = drawnPathProps(STRIPE_PATH, stripeProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CARD_PATH}\n strokeDasharray={card.strokeDasharray}\n strokeDashoffset={card.strokeDashoffset}\n />\n <path\n d={STRIPE_PATH}\n strokeDasharray={stripe.strokeDasharray}\n strokeDashoffset={stripe.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CreditCardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CARD_PATH =\n \"M4 5H20A2 2 0 0 1 22 7V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17V7A2 2 0 0 1 4 5Z\";\nconst STRIPE_PATH = \"M2 10H22\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 19;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction CreditCardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const swipe = interpolate(actionProgress, [0.1, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const tilt = acting\n ? interpolate(actionProgress, [0.4, 0.6, 1], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const stripeProgress = animation === \"draw\" ? 1 : acting ? swipe : 0;\n\n const card = drawnPathProps(CARD_PATH, drawProgress);\n const stripe = drawnPathProps(STRIPE_PATH, stripeProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CARD_PATH}\n strokeDasharray={card.strokeDasharray}\n strokeDashoffset={card.strokeDashoffset}\n />\n <path\n d={STRIPE_PATH}\n strokeDasharray={stripe.strokeDasharray}\n strokeDashoffset={stripe.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CreditCardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CreditCardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CreditCardIconBase>;\n\nconst CreditCardIconInner = forwardRef<\n HTMLDivElement,\n CreditCardIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CreditCardIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CreditCardIconBase\n {...(componentProps as unknown as ComponentProps<typeof CreditCardIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CreditCardIcon = Interactive.withSchema({\n Component: CreditCardIconInner,\n componentName: \"<CreditCardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-crown.json b/registry-artifacts/elements/icon-crown.jsonindex 94853b0e..925cc0d7 100644--- a/registry-artifacts/elements/icon-crown.json+++ b/registry-artifacts/elements/icon-crown.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Crown","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-crown",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CROWN_PATH =\n \"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\";\nconst BAND_PATH = \"M5 21h14\";\n\nconst BASE_X = 12;\nconst BASE_Y = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nexport function CrownIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const crownDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const descend = acting\n ? interpolate(actionProgress, [0, 0.22, 0.55], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.55, 0.7], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const rock = acting\n ? interpolate(\n actionProgress,\n [0.55, 0.68, 0.82, 0.94, 1],\n [0, 2, -1.5, 0.8, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const crown = drawnPathProps(CROWN_PATH, acting ? 1 : crownDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const actionTransform = `translate(0 ${descend}) rotate(${rock} ${BASE_X} ${BASE_Y}) translate(${BASE_X * (1 - pop)} ${BASE_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={actionTransform}>\n <path\n d={CROWN_PATH}\n strokeDasharray={crown.strokeDasharray}\n strokeDashoffset={crown.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CrownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CROWN_PATH =\n \"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\";\nconst BAND_PATH = \"M5 21h14\";\n\nconst BASE_X = 12;\nconst BASE_Y = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction CrownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const crownDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const descend = acting\n ? interpolate(actionProgress, [0, 0.22, 0.55], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.55, 0.7], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const rock = acting\n ? interpolate(\n actionProgress,\n [0.55, 0.68, 0.82, 0.94, 1],\n [0, 2, -1.5, 0.8, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const crown = drawnPathProps(CROWN_PATH, acting ? 1 : crownDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const actionTransform = `translate(0 ${descend}) rotate(${rock} ${BASE_X} ${BASE_Y}) translate(${BASE_X * (1 - pop)} ${BASE_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={actionTransform}>\n <path\n d={CROWN_PATH}\n strokeDasharray={crown.strokeDasharray}\n strokeDashoffset={crown.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CrownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CrownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CrownIconBase>;\n\nconst CrownIconInner = forwardRef<\n HTMLDivElement,\n CrownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CrownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <CrownIconBase\n {...(componentProps as unknown as ComponentProps<typeof CrownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CrownIcon = Interactive.withSchema({\n Component: CrownIconInner,\n componentName: \"<CrownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-database.json b/registry-artifacts/elements/icon-database.jsonindex 086fee68..aedebc92 100644--- a/registry-artifacts/elements/icon-database.json+++ b/registry-artifacts/elements/icon-database.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Database","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-database",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISC_PATH = \"M3 5A9 3 0 0 0 21 5A9 3 0 0 0 3 5Z\";\nconst BODY_PATH = \"M3 5V19A9 3 0 0 0 21 19V5\";\nconst MID_PATH = \"M3 12A9 3 0 0 0 21 12\";\n\nconst DISC_CX = 12;\nconst DISC_CY = 5;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function DatabaseIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const discDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bodyDraw = interpolate(linearDraw, [0.35, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const discPop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const midDip = acting\n ? interpolate(actionProgress, [0.25, 0.5, 0.8], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disc = drawnPathProps(DISC_PATH, acting ? 1 : discDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const mid = drawnPathProps(MID_PATH, acting ? 1 : midDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const discTransform = `translate(${DISC_CX * (1 - discPop)} ${DISC_CY * (1 - discPop)}) scale(${discPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${midDip})`}>\n <path\n d={MID_PATH}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n </g>\n <g transform={discTransform}>\n <path\n d={DISC_PATH}\n strokeDasharray={disc.strokeDasharray}\n strokeDashoffset={disc.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DatabaseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISC_PATH = \"M3 5A9 3 0 0 0 21 5A9 3 0 0 0 3 5Z\";\nconst BODY_PATH = \"M3 5V19A9 3 0 0 0 21 19V5\";\nconst MID_PATH = \"M3 12A9 3 0 0 0 21 12\";\n\nconst DISC_CX = 12;\nconst DISC_CY = 5;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction DatabaseIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const discDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bodyDraw = interpolate(linearDraw, [0.35, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const discPop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const midDip = acting\n ? interpolate(actionProgress, [0.25, 0.5, 0.8], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disc = drawnPathProps(DISC_PATH, acting ? 1 : discDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const mid = drawnPathProps(MID_PATH, acting ? 1 : midDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const discTransform = `translate(${DISC_CX * (1 - discPop)} ${DISC_CY * (1 - discPop)}) scale(${discPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${midDip})`}>\n <path\n d={MID_PATH}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n </g>\n <g transform={discTransform}>\n <path\n d={DISC_PATH}\n strokeDasharray={disc.strokeDasharray}\n strokeDashoffset={disc.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DatabaseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DatabaseIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DatabaseIconBase>;\n\nconst DatabaseIconInner = forwardRef<\n HTMLDivElement,\n DatabaseIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<DatabaseIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <DatabaseIconBase\n {...(componentProps as unknown as ComponentProps<typeof DatabaseIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DatabaseIcon = Interactive.withSchema({\n Component: DatabaseIconInner,\n componentName: \"<DatabaseIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-dollar-sign.json b/registry-artifacts/elements/icon-dollar-sign.jsonindex ebcbe6cc..a1a54a90 100644--- a/registry-artifacts/elements/icon-dollar-sign.json+++ b/registry-artifacts/elements/icon-dollar-sign.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Dollar Sign","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-dollar-sign",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BAR_PATH = \"M12 2V22\";\nconst S_PATH = \"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function DollarSignIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const barDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sDraw = interpolate(linearDraw, [0.3, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const stretch = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bar = drawnPathProps(BAR_PATH, acting ? 1 : barDraw);\n const s = drawnPathProps(S_PATH, acting ? 1 : sDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const stretchTransform = `translate(0 ${BASE_Y * (1 - stretch)}) scale(1 ${stretch})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={stretchTransform}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n <path\n d={S_PATH}\n strokeDasharray={s.strokeDasharray}\n strokeDashoffset={s.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DollarSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" x2=\"12\" y1=\"2\" y2=\"22\" />\n <path d={S_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BAR_PATH = \"M12 2V22\";\nconst S_PATH = \"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction DollarSignIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const barDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sDraw = interpolate(linearDraw, [0.3, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const stretch = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bar = drawnPathProps(BAR_PATH, acting ? 1 : barDraw);\n const s = drawnPathProps(S_PATH, acting ? 1 : sDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const stretchTransform = `translate(0 ${BASE_Y * (1 - stretch)}) scale(1 ${stretch})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={stretchTransform}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n <path\n d={S_PATH}\n strokeDasharray={s.strokeDasharray}\n strokeDashoffset={s.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DollarSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" x2=\"12\" y1=\"2\" y2=\"22\" />\n <path d={S_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DollarSignIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DollarSignIconBase>;\n\nconst DollarSignIconInner = forwardRef<\n HTMLDivElement,\n DollarSignIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<DollarSignIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <DollarSignIconBase\n {...(componentProps as unknown as ComponentProps<typeof DollarSignIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DollarSignIcon = Interactive.withSchema({\n Component: DollarSignIconInner,\n componentName: \"<DollarSignIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-download.json b/registry-artifacts/elements/icon-download.jsonindex 11b00fb8..2c910dfc 100644--- a/registry-artifacts/elements/icon-download.json+++ b/registry-artifacts/elements/icon-download.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Download","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-download",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 3V15\";\nconst SHAFT_STATIC = \"M12 15V3\";\nconst HEAD_PATH = \"M7 10 12 15 17 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function DownloadIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const dropY = interpolate(actionProgress, [0, 0.25, 0.65, 1], [0, -4, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.5, 0.65, 0.8, 1],\n [1, 1, 0.94, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${dropY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DownloadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={TRAY_STATIC} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 3V15\";\nconst SHAFT_STATIC = \"M12 15V3\";\nconst HEAD_PATH = \"M7 10 12 15 17 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction DownloadIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const dropY = interpolate(actionProgress, [0, 0.25, 0.65, 1], [0, -4, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.5, 0.65, 0.8, 1],\n [1, 1, 0.94, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${dropY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DownloadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={TRAY_STATIC} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DownloadIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DownloadIconBase>;\n\nconst DownloadIconInner = forwardRef<\n HTMLDivElement,\n DownloadIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<DownloadIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <DownloadIconBase\n {...(componentProps as unknown as ComponentProps<typeof DownloadIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DownloadIcon = Interactive.withSchema({\n Component: DownloadIconInner,\n componentName: \"<DownloadIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-external-link.json b/registry-artifacts/elements/icon-external-link.jsonindex d64d2ff6..a12c618f 100644--- a/registry-artifacts/elements/icon-external-link.json+++ b/registry-artifacts/elements/icon-external-link.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "External Link","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-external-link",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\";\nconst SHAFT_PATH = \"M10 14 21 3\";\nconst HEAD_PATH = \"M15 3h6v6\";\n\nconst ARROW_CX = 15.5;\nconst ARROW_CY = 8.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function ExternalLinkIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boxProgress = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftProgress = interpolate(linearDraw, [0.5, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const box = drawnPathProps(BOX_PATH, boxProgress);\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const dart = interpolate(actionProgress, [0, 0.4, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tx = 3 * dart;\n const ty = -3 * dart;\n const arrowScale = 1 + 0.05 * dart;\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <g\n transform={`translate(${tx} ${ty}) translate(${ARROW_CX} ${ARROW_CY}) scale(${arrowScale}) translate(${-ARROW_CX} ${-ARROW_CY})`}\n >\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ExternalLinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\";\nconst SHAFT_PATH = \"M10 14 21 3\";\nconst HEAD_PATH = \"M15 3h6v6\";\n\nconst ARROW_CX = 15.5;\nconst ARROW_CY = 8.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction ExternalLinkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boxProgress = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftProgress = interpolate(linearDraw, [0.5, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const box = drawnPathProps(BOX_PATH, boxProgress);\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const dart = interpolate(actionProgress, [0, 0.4, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tx = 3 * dart;\n const ty = -3 * dart;\n const arrowScale = 1 + 0.05 * dart;\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <g\n transform={`translate(${tx} ${ty}) translate(${ARROW_CX} ${ARROW_CY}) scale(${arrowScale}) translate(${-ARROW_CX} ${-ARROW_CY})`}\n >\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ExternalLinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ExternalLinkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ExternalLinkIconBase>;\n\nconst ExternalLinkIconInner = forwardRef<\n HTMLDivElement,\n ExternalLinkIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ExternalLinkIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ExternalLinkIconBase\n {...(componentProps as unknown as ComponentProps<typeof ExternalLinkIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ExternalLinkIcon = Interactive.withSchema({\n Component: ExternalLinkIconInner,\n componentName: \"<ExternalLinkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-eye-off.json b/registry-artifacts/elements/icon-eye-off.jsonindex 325c089e..3c63ee7d 100644--- a/registry-artifacts/elements/icon-eye-off.json+++ b/registry-artifacts/elements/icon-eye-off.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Eye Off","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-eye-off",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAG1_PATH =\n \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\";\nconst FRAG2_PATH = \"M14.084 14.158a3 3 0 0 1-4.242-4.242\";\nconst FRAG3_PATH =\n \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\";\nconst SLASH_PATH = \"M2 2 22 22\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst FRAGMENTS = [\n { path: FRAG1_PATH, drawWindow: [0, 0.69] },\n { path: FRAG2_PATH, drawWindow: [0.19, 0.88] },\n { path: FRAG3_PATH, drawWindow: [0.375, 1] },\n] as const;\n\nexport function EyeOffIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slashProgress = acting\n ? interpolate(actionProgress, [0, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const fragOpacity = acting\n ? interpolate(actionProgress, [0.09, 0.5, 1], [1, 0.35, 0.6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const slash = drawnPathProps(SLASH_PATH, slashProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g opacity={fragOpacity}>\n {FRAGMENTS.map((frag) => {\n const drawn = acting\n ? 1\n : interpolate(linearDraw, [...frag.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(frag.path, drawn);\n return (\n <path\n key={frag.path}\n d={frag.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n );\n })}\n </g>\n <path\n d={SLASH_PATH}\n strokeDasharray={slash.strokeDasharray}\n strokeDashoffset={slash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction EyeOffIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FRAG1_PATH} />\n <path d={FRAG2_PATH} />\n <path d={FRAG3_PATH} />\n <path d={SLASH_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAG1_PATH =\n \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\";\nconst FRAG2_PATH = \"M14.084 14.158a3 3 0 0 1-4.242-4.242\";\nconst FRAG3_PATH =\n \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\";\nconst SLASH_PATH = \"M2 2 22 22\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst FRAGMENTS = [\n { path: FRAG1_PATH, drawWindow: [0, 0.69] },\n { path: FRAG2_PATH, drawWindow: [0.19, 0.88] },\n { path: FRAG3_PATH, drawWindow: [0.375, 1] },\n] as const;\n\nfunction EyeOffIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slashProgress = acting\n ? interpolate(actionProgress, [0, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const fragOpacity = acting\n ? interpolate(actionProgress, [0.09, 0.5, 1], [1, 0.35, 0.6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const slash = drawnPathProps(SLASH_PATH, slashProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g opacity={fragOpacity}>\n {FRAGMENTS.map((frag) => {\n const drawn = acting\n ? 1\n : interpolate(linearDraw, [...frag.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(frag.path, drawn);\n return (\n <path\n key={frag.path}\n d={frag.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n );\n })}\n </g>\n <path\n d={SLASH_PATH}\n strokeDasharray={slash.strokeDasharray}\n strokeDashoffset={slash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction EyeOffIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FRAG1_PATH} />\n <path d={FRAG2_PATH} />\n <path d={FRAG3_PATH} />\n <path d={SLASH_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype EyeOffIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EyeOffIconBase>;\n\nconst EyeOffIconInner = forwardRef<\n HTMLDivElement,\n EyeOffIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<EyeOffIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <EyeOffIconBase\n {...(componentProps as unknown as ComponentProps<typeof EyeOffIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EyeOffIcon = Interactive.withSchema({\n Component: EyeOffIconInner,\n componentName: \"<EyeOffIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-eye.json b/registry-artifacts/elements/icon-eye.jsonindex dacabc16..e26698d7 100644--- a/registry-artifacts/elements/icon-eye.json+++ b/registry-artifacts/elements/icon-eye.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Eye","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-eye",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst OUTLINE_PATH =\n \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\";\nconst PUPIL_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function EyeIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outlineDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pupilDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const blink = acting\n ? interpolate(actionProgress, [0, 0.27, 0.55], [1, 0.4, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const pupilPop =\n acting && actionProgress >= 0.55\n ? interpolate(actionProgress, [0.55, 0.77, 1], [0.8, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const outline = drawnPathProps(OUTLINE_PATH, outlineDraw);\n const pupil = drawnPathProps(PUPIL_PATH, pupilDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const pupilTransform = `translate(${12 * (1 - pupilPop)} ${12 * (1 - pupilPop)}) scale(${pupilPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale}) scaleY(${blink})`,\n }}\n >\n <path\n d={OUTLINE_PATH}\n strokeDasharray={outline.strokeDasharray}\n strokeDashoffset={outline.strokeDashoffset}\n />\n <g transform={pupilTransform}>\n <path\n d={PUPIL_PATH}\n strokeDasharray={pupil.strokeDasharray}\n strokeDashoffset={pupil.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction EyeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={OUTLINE_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst OUTLINE_PATH =\n \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\";\nconst PUPIL_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction EyeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outlineDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pupilDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const blink = acting\n ? interpolate(actionProgress, [0, 0.27, 0.55], [1, 0.4, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const pupilPop =\n acting && actionProgress >= 0.55\n ? interpolate(actionProgress, [0.55, 0.77, 1], [0.8, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const outline = drawnPathProps(OUTLINE_PATH, outlineDraw);\n const pupil = drawnPathProps(PUPIL_PATH, pupilDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const pupilTransform = `translate(${12 * (1 - pupilPop)} ${12 * (1 - pupilPop)}) scale(${pupilPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale}) scaleY(${blink})`,\n }}\n >\n <path\n d={OUTLINE_PATH}\n strokeDasharray={outline.strokeDasharray}\n strokeDashoffset={outline.strokeDashoffset}\n />\n <g transform={pupilTransform}>\n <path\n d={PUPIL_PATH}\n strokeDasharray={pupil.strokeDasharray}\n strokeDashoffset={pupil.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction EyeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={OUTLINE_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype EyeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EyeIconBase>;\n\nconst EyeIconInner = forwardRef<\n HTMLDivElement,\n EyeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<EyeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <EyeIconBase\n {...(componentProps as unknown as ComponentProps<typeof EyeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EyeIcon = Interactive.withSchema({\n Component: EyeIconInner,\n componentName: \"<EyeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-file-text.json b/registry-artifacts/elements/icon-file-text.jsonindex 300c482f..11589db8 100644--- a/registry-artifacts/elements/icon-file-text.json+++ b/registry-artifacts/elements/icon-file-text.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "File Text","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-file-text",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PAGE_PATH =\n \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\";\nconst FOLD_PATH = \"M14 2v5a1 1 0 0 0 1 1h5\";\nconst LINE1_PATH = \"M8 9H10\";\nconst LINE2_PATH = \"M8 13H16\";\nconst LINE3_PATH = \"M8 17H16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function FileTextIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pageDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const foldDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const line1Type = interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line2Type = interpolate(actionProgress, [0.3, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line3Type = interpolate(actionProgress, [0.55, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n\n const line1Progress = animation === \"draw\" ? 1 : acting ? line1Type : 0;\n const line2Progress = animation === \"draw\" ? 1 : acting ? line2Type : 0;\n const line3Progress = animation === \"draw\" ? 1 : acting ? line3Type : 0;\n\n const page = drawnPathProps(PAGE_PATH, acting ? 1 : pageDraw);\n const fold = drawnPathProps(FOLD_PATH, acting ? 1 : foldDraw);\n const line1 = drawnPathProps(LINE1_PATH, line1Progress);\n const line2 = drawnPathProps(LINE2_PATH, line2Progress);\n const line3 = drawnPathProps(LINE3_PATH, line3Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PAGE_PATH}\n strokeDasharray={page.strokeDasharray}\n strokeDashoffset={page.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n <path\n d={LINE1_PATH}\n strokeDasharray={line1.strokeDasharray}\n strokeDashoffset={line1.strokeDashoffset}\n />\n <path\n d={LINE2_PATH}\n strokeDasharray={line2.strokeDasharray}\n strokeDashoffset={line2.strokeDashoffset}\n />\n <path\n d={LINE3_PATH}\n strokeDasharray={line3.strokeDasharray}\n strokeDashoffset={line3.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction FileTextIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PAGE_PATH} />\n <path d={FOLD_PATH} />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PAGE_PATH =\n \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\";\nconst FOLD_PATH = \"M14 2v5a1 1 0 0 0 1 1h5\";\nconst LINE1_PATH = \"M8 9H10\";\nconst LINE2_PATH = \"M8 13H16\";\nconst LINE3_PATH = \"M8 17H16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction FileTextIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pageDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const foldDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const line1Type = interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line2Type = interpolate(actionProgress, [0.3, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line3Type = interpolate(actionProgress, [0.55, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n\n const line1Progress = animation === \"draw\" ? 1 : acting ? line1Type : 0;\n const line2Progress = animation === \"draw\" ? 1 : acting ? line2Type : 0;\n const line3Progress = animation === \"draw\" ? 1 : acting ? line3Type : 0;\n\n const page = drawnPathProps(PAGE_PATH, acting ? 1 : pageDraw);\n const fold = drawnPathProps(FOLD_PATH, acting ? 1 : foldDraw);\n const line1 = drawnPathProps(LINE1_PATH, line1Progress);\n const line2 = drawnPathProps(LINE2_PATH, line2Progress);\n const line3 = drawnPathProps(LINE3_PATH, line3Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PAGE_PATH}\n strokeDasharray={page.strokeDasharray}\n strokeDashoffset={page.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n <path\n d={LINE1_PATH}\n strokeDasharray={line1.strokeDasharray}\n strokeDashoffset={line1.strokeDashoffset}\n />\n <path\n d={LINE2_PATH}\n strokeDasharray={line2.strokeDasharray}\n strokeDashoffset={line2.strokeDashoffset}\n />\n <path\n d={LINE3_PATH}\n strokeDasharray={line3.strokeDasharray}\n strokeDashoffset={line3.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction FileTextIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PAGE_PATH} />\n <path d={FOLD_PATH} />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FileTextIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FileTextIconBase>;\n\nconst FileTextIconInner = forwardRef<\n HTMLDivElement,\n FileTextIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<FileTextIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <FileTextIconBase\n {...(componentProps as unknown as ComponentProps<typeof FileTextIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FileTextIcon = Interactive.withSchema({\n Component: FileTextIconInner,\n componentName: \"<FileTextIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-filter.json b/registry-artifacts/elements/icon-filter.jsonindex ef832b66..fcfb206e 100644--- a/registry-artifacts/elements/icon-filter.json+++ b/registry-artifacts/elements/icon-filter.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Filter","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-filter",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FUNNEL_PATH =\n \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function FilterIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, -5, 5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(FUNNEL_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 12 3) translate(0 ${dip})`}>\n <path\n d={FUNNEL_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FilterIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FUNNEL_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FUNNEL_PATH =\n \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction FilterIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, -5, 5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(FUNNEL_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 12 3) translate(0 ${dip})`}>\n <path\n d={FUNNEL_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FilterIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FUNNEL_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FilterIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FilterIconBase>;\n\nconst FilterIconInner = forwardRef<\n HTMLDivElement,\n FilterIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<FilterIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <FilterIconBase\n {...(componentProps as unknown as ComponentProps<typeof FilterIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FilterIcon = Interactive.withSchema({\n Component: FilterIconInner,\n componentName: \"<FilterIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-flame.json b/registry-artifacts/elements/icon-flame.jsonindex 98385822..2c2cb275 100644--- a/registry-artifacts/elements/icon-flame.json+++ b/registry-artifacts/elements/icon-flame.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Flame","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-flame",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAME_PATH =\n \"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nexport function FlameIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const flameProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.85, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flame = drawnPathProps(FLAME_PATH, flameProgress);\n\n const flickerEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scaleY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [1, 1.06, 0.97, 1.04, 1],\n flickerEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, 2, -1, 0],\n flickerEase,\n );\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${entrance})`,\n }}\n >\n <g\n transform={`translate(12 22) scale(1 ${scaleY}) skewX(${skew}) translate(-12 -22)`}\n >\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FlameIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAME_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAME_PATH =\n \"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction FlameIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const flameProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.85, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flame = drawnPathProps(FLAME_PATH, flameProgress);\n\n const flickerEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scaleY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [1, 1.06, 0.97, 1.04, 1],\n flickerEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, 2, -1, 0],\n flickerEase,\n );\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${entrance})`,\n }}\n >\n <g\n transform={`translate(12 22) scale(1 ${scaleY}) skewX(${skew}) translate(-12 -22)`}\n >\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FlameIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAME_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FlameIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FlameIconBase>;\n\nconst FlameIconInner = forwardRef<\n HTMLDivElement,\n FlameIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<FlameIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <FlameIconBase\n {...(componentProps as unknown as ComponentProps<typeof FlameIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FlameIcon = Interactive.withSchema({\n Component: FlameIconInner,\n componentName: \"<FlameIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-folder.json b/registry-artifacts/elements/icon-folder.jsonindex 95108b62..f5656065 100644--- a/registry-artifacts/elements/icon-folder.json+++ b/registry-artifacts/elements/icon-folder.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Folder","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-folder",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FOLDER_PATH =\n \"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\";\n\nconst PIVOT_X = 4;\nconst PIVOT_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function FolderIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const peek = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const folder = drawnPathProps(FOLDER_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${peek} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={FOLDER_PATH}\n strokeDasharray={folder.strokeDasharray}\n strokeDashoffset={folder.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FolderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FOLDER_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FOLDER_PATH =\n \"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\";\n\nconst PIVOT_X = 4;\nconst PIVOT_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction FolderIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const peek = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const folder = drawnPathProps(FOLDER_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${peek} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={FOLDER_PATH}\n strokeDasharray={folder.strokeDasharray}\n strokeDashoffset={folder.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FolderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FOLDER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FolderIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FolderIconBase>;\n\nconst FolderIconInner = forwardRef<\n HTMLDivElement,\n FolderIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<FolderIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <FolderIconBase\n {...(componentProps as unknown as ComponentProps<typeof FolderIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FolderIcon = Interactive.withSchema({\n Component: FolderIconInner,\n componentName: \"<FolderIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-gem.json b/registry-artifacts/elements/icon-gem.jsonindex 9741d8a0..12e2f224 100644--- a/registry-artifacts/elements/icon-gem.json+++ b/registry-artifacts/elements/icon-gem.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Gem","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-gem",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STONE_PATH =\n \"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\";\nconst VCUT_PATH = \"M10.5 3 8 9l4 13 4-13-2.5-6\";\nconst BAND_PATH = \"M2 9h20\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function GemIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const stoneDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vcutDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 1], [1, 1.06, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shimmer = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.45, 0.65, 0.85, 1],\n [1, 0.7, 1, 0.78, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 1;\n\n const stone = drawnPathProps(STONE_PATH, acting ? 1 : stoneDraw);\n const vcut = drawnPathProps(VCUT_PATH, acting ? 1 : vcutDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={STONE_PATH}\n strokeDasharray={stone.strokeDasharray}\n strokeDashoffset={stone.strokeDashoffset}\n />\n <g opacity={shimmer}>\n <path\n d={VCUT_PATH}\n strokeDasharray={vcut.strokeDasharray}\n strokeDashoffset={vcut.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction GemIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10.5 3 8 9l4 13 4-13-2.5-6\" />\n <path d=\"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STONE_PATH =\n \"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\";\nconst VCUT_PATH = \"M10.5 3 8 9l4 13 4-13-2.5-6\";\nconst BAND_PATH = \"M2 9h20\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction GemIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const stoneDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vcutDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 1], [1, 1.06, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shimmer = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.45, 0.65, 0.85, 1],\n [1, 0.7, 1, 0.78, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 1;\n\n const stone = drawnPathProps(STONE_PATH, acting ? 1 : stoneDraw);\n const vcut = drawnPathProps(VCUT_PATH, acting ? 1 : vcutDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={STONE_PATH}\n strokeDasharray={stone.strokeDasharray}\n strokeDashoffset={stone.strokeDashoffset}\n />\n <g opacity={shimmer}>\n <path\n d={VCUT_PATH}\n strokeDasharray={vcut.strokeDasharray}\n strokeDashoffset={vcut.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction GemIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10.5 3 8 9l4 13 4-13-2.5-6\" />\n <path d=\"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GemIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GemIconBase>;\n\nconst GemIconInner = forwardRef<\n HTMLDivElement,\n GemIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<GemIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <GemIconBase\n {...(componentProps as unknown as ComponentProps<typeof GemIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GemIcon = Interactive.withSchema({\n Component: GemIconInner,\n componentName: \"<GemIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-gift.json b/registry-artifacts/elements/icon-gift.jsonindex 27845f4d..1ac7fc7b 100644--- a/registry-artifacts/elements/icon-gift.json+++ b/registry-artifacts/elements/icon-gift.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Gift","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-gift",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8\";\nconst LID_PATH =\n \"M4 7H20A1 1 0 0 1 21 8V10A1 1 0 0 1 20 11H4A1 1 0 0 1 3 10V8A1 1 0 0 1 4 7Z\";\nconst CENTER_TOP_PATH = \"M12 7V11\";\nconst CENTER_BOTTOM_PATH = \"M12 11V21\";\nconst BOW_PATH =\n \"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5\";\n\nconst LID_CX = 12;\nconst LID_CY = 9;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nexport function GiftIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidDraw = interpolate(linearDraw, [0.35, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ribbonDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lidLift = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidTilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidPop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const lid = drawnPathProps(LID_PATH, acting ? 1 : lidDraw);\n const centerTop = drawnPathProps(CENTER_TOP_PATH, acting ? 1 : ribbonDraw);\n const centerBottom = drawnPathProps(\n CENTER_BOTTOM_PATH,\n acting ? 1 : ribbonDraw,\n );\n const bow = drawnPathProps(BOW_PATH, acting ? 1 : ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lidTransform = `translate(0 ${lidLift}) rotate(${lidTilt} ${LID_CX} ${LID_CY}) translate(${LID_CX * (1 - lidPop)} ${LID_CY * (1 - lidPop)}) scale(${lidPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_BOTTOM_PATH}\n strokeDasharray={centerBottom.strokeDasharray}\n strokeDashoffset={centerBottom.strokeDashoffset}\n />\n <g transform={lidTransform}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={CENTER_TOP_PATH}\n strokeDasharray={centerTop.strokeDasharray}\n strokeDashoffset={centerTop.strokeDashoffset}\n />\n <path\n d={BOW_PATH}\n strokeDasharray={bow.strokeDasharray}\n strokeDashoffset={bow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GiftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 7v14\" />\n <path d={BOX_PATH} />\n <path d={BOW_PATH} />\n <rect x=\"3\" y=\"7\" width=\"18\" height=\"4\" rx=\"1\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8\";\nconst LID_PATH =\n \"M4 7H20A1 1 0 0 1 21 8V10A1 1 0 0 1 20 11H4A1 1 0 0 1 3 10V8A1 1 0 0 1 4 7Z\";\nconst CENTER_TOP_PATH = \"M12 7V11\";\nconst CENTER_BOTTOM_PATH = \"M12 11V21\";\nconst BOW_PATH =\n \"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5\";\n\nconst LID_CX = 12;\nconst LID_CY = 9;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction GiftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidDraw = interpolate(linearDraw, [0.35, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ribbonDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lidLift = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidTilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidPop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const lid = drawnPathProps(LID_PATH, acting ? 1 : lidDraw);\n const centerTop = drawnPathProps(CENTER_TOP_PATH, acting ? 1 : ribbonDraw);\n const centerBottom = drawnPathProps(\n CENTER_BOTTOM_PATH,\n acting ? 1 : ribbonDraw,\n );\n const bow = drawnPathProps(BOW_PATH, acting ? 1 : ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lidTransform = `translate(0 ${lidLift}) rotate(${lidTilt} ${LID_CX} ${LID_CY}) translate(${LID_CX * (1 - lidPop)} ${LID_CY * (1 - lidPop)}) scale(${lidPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_BOTTOM_PATH}\n strokeDasharray={centerBottom.strokeDasharray}\n strokeDashoffset={centerBottom.strokeDashoffset}\n />\n <g transform={lidTransform}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={CENTER_TOP_PATH}\n strokeDasharray={centerTop.strokeDasharray}\n strokeDashoffset={centerTop.strokeDashoffset}\n />\n <path\n d={BOW_PATH}\n strokeDasharray={bow.strokeDasharray}\n strokeDashoffset={bow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GiftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 7v14\" />\n <path d={BOX_PATH} />\n <path d={BOW_PATH} />\n <rect x=\"3\" y=\"7\" width=\"18\" height=\"4\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GiftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GiftIconBase>;\n\nconst GiftIconInner = forwardRef<\n HTMLDivElement,\n GiftIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<GiftIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <GiftIconBase\n {...(componentProps as unknown as ComponentProps<typeof GiftIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GiftIcon = Interactive.withSchema({\n Component: GiftIconInner,\n componentName: \"<GiftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-globe.json b/registry-artifacts/elements/icon-globe.jsonindex d8caeae3..5eecdb9a 100644--- a/registry-artifacts/elements/icon-globe.json+++ b/registry-artifacts/elements/icon-globe.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Globe","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-globe",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPHERE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst MERIDIAN_PATH = \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\";\nconst EQUATOR_PATH = \"M2 12H22\";\n\nconst AXIS_X = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nexport function GlobeIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const sphereDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const linesDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const spinX = acting ? Math.cos(actionProgress * Math.PI * 2) : 1;\n\n const sphere = drawnPathProps(SPHERE_PATH, acting ? 1 : sphereDraw);\n const meridian = drawnPathProps(MERIDIAN_PATH, acting ? 1 : linesDraw);\n const equator = drawnPathProps(EQUATOR_PATH, acting ? 1 : linesDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const spinTransform = `translate(${AXIS_X * (1 - spinX)} 0) scale(${spinX} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={spinTransform}>\n <path\n d={SPHERE_PATH}\n strokeDasharray={sphere.strokeDasharray}\n strokeDashoffset={sphere.strokeDashoffset}\n />\n <path\n d={EQUATOR_PATH}\n strokeDasharray={equator.strokeDasharray}\n strokeDashoffset={equator.strokeDashoffset}\n />\n <path\n d={MERIDIAN_PATH}\n strokeDasharray={meridian.strokeDasharray}\n strokeDashoffset={meridian.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GlobeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={MERIDIAN_PATH} />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPHERE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst MERIDIAN_PATH = \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\";\nconst EQUATOR_PATH = \"M2 12H22\";\n\nconst AXIS_X = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction GlobeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const sphereDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const linesDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const spinX = acting ? Math.cos(actionProgress * Math.PI * 2) : 1;\n\n const sphere = drawnPathProps(SPHERE_PATH, acting ? 1 : sphereDraw);\n const meridian = drawnPathProps(MERIDIAN_PATH, acting ? 1 : linesDraw);\n const equator = drawnPathProps(EQUATOR_PATH, acting ? 1 : linesDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const spinTransform = `translate(${AXIS_X * (1 - spinX)} 0) scale(${spinX} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={spinTransform}>\n <path\n d={SPHERE_PATH}\n strokeDasharray={sphere.strokeDasharray}\n strokeDashoffset={sphere.strokeDashoffset}\n />\n <path\n d={EQUATOR_PATH}\n strokeDasharray={equator.strokeDasharray}\n strokeDashoffset={equator.strokeDashoffset}\n />\n <path\n d={MERIDIAN_PATH}\n strokeDasharray={meridian.strokeDasharray}\n strokeDashoffset={meridian.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GlobeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={MERIDIAN_PATH} />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GlobeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GlobeIconBase>;\n\nconst GlobeIconInner = forwardRef<\n HTMLDivElement,\n GlobeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<GlobeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <GlobeIconBase\n {...(componentProps as unknown as ComponentProps<typeof GlobeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GlobeIcon = Interactive.withSchema({\n Component: GlobeIconInner,\n componentName: \"<GlobeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-heart.json b/registry-artifacts/elements/icon-heart.jsonindex 94f8219c..96c74a04 100644--- a/registry-artifacts/elements/icon-heart.json+++ b/registry-artifacts/elements/icon-heart.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Heart","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-heart",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEART_PATH =\n \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function HeartIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const heartProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const heart = drawnPathProps(HEART_PATH, heartProgress);\n\n const beat = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [1, 1.16, 1, 1.1, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEART_PATH}\n strokeDasharray={heart.strokeDasharray}\n strokeDashoffset={heart.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HeartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEART_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEART_PATH =\n \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction HeartIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const heartProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const heart = drawnPathProps(HEART_PATH, heartProgress);\n\n const beat = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [1, 1.16, 1, 1.1, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEART_PATH}\n strokeDasharray={heart.strokeDasharray}\n strokeDashoffset={heart.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HeartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEART_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HeartIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HeartIconBase>;\n\nconst HeartIconInner = forwardRef<\n HTMLDivElement,\n HeartIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<HeartIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <HeartIconBase\n {...(componentProps as unknown as ComponentProps<typeof HeartIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HeartIcon = Interactive.withSchema({\n Component: HeartIconInner,\n componentName: \"<HeartIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-help-circle.json b/registry-artifacts/elements/icon-help-circle.jsonindex e71515e1..d52913e7 100644--- a/registry-artifacts/elements/icon-help-circle.json+++ b/registry-artifacts/elements/icon-help-circle.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Help Circle","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-help-circle",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst CURVE_PATH = \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 8;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function HelpCircleIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ringDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curveDraw = interpolate(linearDraw, [0.4, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotDraw = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, 6, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const ring = drawnPathProps(RING_PATH, acting ? 1 : ringDraw);\n const curve = drawnPathProps(CURVE_PATH, acting ? 1 : curveDraw);\n const dot = drawnPathProps(DOT_PATH, acting ? 1 : dotDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CURVE_PATH}\n strokeDasharray={curve.strokeDasharray}\n strokeDashoffset={curve.strokeDashoffset}\n />\n <path\n d={DOT_PATH}\n strokeDasharray={dot.strokeDasharray}\n strokeDashoffset={dot.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction HelpCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CURVE_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst CURVE_PATH = \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 8;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction HelpCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ringDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curveDraw = interpolate(linearDraw, [0.4, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotDraw = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, 6, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const ring = drawnPathProps(RING_PATH, acting ? 1 : ringDraw);\n const curve = drawnPathProps(CURVE_PATH, acting ? 1 : curveDraw);\n const dot = drawnPathProps(DOT_PATH, acting ? 1 : dotDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CURVE_PATH}\n strokeDasharray={curve.strokeDasharray}\n strokeDashoffset={curve.strokeDashoffset}\n />\n <path\n d={DOT_PATH}\n strokeDasharray={dot.strokeDasharray}\n strokeDashoffset={dot.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction HelpCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CURVE_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HelpCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HelpCircleIconBase>;\n\nconst HelpCircleIconInner = forwardRef<\n HTMLDivElement,\n HelpCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<HelpCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <HelpCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof HelpCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HelpCircleIcon = Interactive.withSchema({\n Component: HelpCircleIconInner,\n componentName: \"<HelpCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-home.json b/registry-artifacts/elements/icon-home.jsonindex b1895d26..06a00552 100644--- a/registry-artifacts/elements/icon-home.json+++ b/registry-artifacts/elements/icon-home.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Home","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-home",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\";\nconst HOUSE_PATH =\n \"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function HomeIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(actionProgress, [0.1, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const doorProgress = animation === \"draw\" ? 1 : acting ? doorDraw : 0;\n\n const house = drawnPathProps(HOUSE_PATH, drawProgress);\n const door = drawnPathProps(DOOR_PATH, doorProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HOUSE_PATH}\n strokeDasharray={house.strokeDasharray}\n strokeDashoffset={house.strokeDashoffset}\n />\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HomeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DOOR_PATH} />\n <path d={HOUSE_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\";\nconst HOUSE_PATH =\n \"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction HomeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(actionProgress, [0.1, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const doorProgress = animation === \"draw\" ? 1 : acting ? doorDraw : 0;\n\n const house = drawnPathProps(HOUSE_PATH, drawProgress);\n const door = drawnPathProps(DOOR_PATH, doorProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HOUSE_PATH}\n strokeDasharray={house.strokeDasharray}\n strokeDashoffset={house.strokeDashoffset}\n />\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HomeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DOOR_PATH} />\n <path d={HOUSE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HomeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HomeIconBase>;\n\nconst HomeIconInner = forwardRef<\n HTMLDivElement,\n HomeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<HomeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <HomeIconBase\n {...(componentProps as unknown as ComponentProps<typeof HomeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HomeIcon = Interactive.withSchema({\n Component: HomeIconInner,\n componentName: \"<HomeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-image.json b/registry-artifacts/elements/icon-image.jsonindex 46a6e561..6e129b78 100644--- a/registry-artifacts/elements/icon-image.json+++ b/registry-artifacts/elements/icon-image.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Image","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-image",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z\";\nconst SUN_PATH =\n \"M9 7 A2 2 0 0 1 11 9 A2 2 0 0 1 9 11 A2 2 0 0 1 7 9 A2 2 0 0 1 9 7\";\nconst MOUNTAIN_PATH = \"M6 21 15.086 11.914A2 2 0 0 1 17.914 11.914L21 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function ImageIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const frameDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sunDraw = interpolate(linearDraw, [0.444, 0.778], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const mountainDraw = interpolate(linearDraw, [0.556, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const mountainProgress = acting\n ? interpolate(actionProgress, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : mountainDraw;\n const sunShiftY = acting\n ? interpolate(actionProgress, [0, 0.6, 0.9], [1, -0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const sunOpacity = acting\n ? interpolate(actionProgress, [0, 0.5], [0.6, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, frameDraw);\n const sun = drawnPathProps(SUN_PATH, acting ? 1 : sunDraw);\n const mountain = drawnPathProps(MOUNTAIN_PATH, mountainProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${sunShiftY})`} opacity={sunOpacity}>\n <path\n d={SUN_PATH}\n strokeDasharray={sun.strokeDasharray}\n strokeDashoffset={sun.strokeDashoffset}\n />\n </g>\n <path\n d={MOUNTAIN_PATH}\n strokeDasharray={mountain.strokeDasharray}\n strokeDashoffset={mountain.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ImageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z\";\nconst SUN_PATH =\n \"M9 7 A2 2 0 0 1 11 9 A2 2 0 0 1 9 11 A2 2 0 0 1 7 9 A2 2 0 0 1 9 7\";\nconst MOUNTAIN_PATH = \"M6 21 15.086 11.914A2 2 0 0 1 17.914 11.914L21 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction ImageIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const frameDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sunDraw = interpolate(linearDraw, [0.444, 0.778], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const mountainDraw = interpolate(linearDraw, [0.556, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const mountainProgress = acting\n ? interpolate(actionProgress, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : mountainDraw;\n const sunShiftY = acting\n ? interpolate(actionProgress, [0, 0.6, 0.9], [1, -0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const sunOpacity = acting\n ? interpolate(actionProgress, [0, 0.5], [0.6, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, frameDraw);\n const sun = drawnPathProps(SUN_PATH, acting ? 1 : sunDraw);\n const mountain = drawnPathProps(MOUNTAIN_PATH, mountainProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${sunShiftY})`} opacity={sunOpacity}>\n <path\n d={SUN_PATH}\n strokeDasharray={sun.strokeDasharray}\n strokeDashoffset={sun.strokeDashoffset}\n />\n </g>\n <path\n d={MOUNTAIN_PATH}\n strokeDasharray={mountain.strokeDasharray}\n strokeDashoffset={mountain.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ImageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ImageIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ImageIconBase>;\n\nconst ImageIconInner = forwardRef<\n HTMLDivElement,\n ImageIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ImageIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ImageIconBase\n {...(componentProps as unknown as ComponentProps<typeof ImageIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ImageIcon = Interactive.withSchema({\n Component: ImageIconInner,\n componentName: \"<ImageIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-inbox.json b/registry-artifacts/elements/icon-inbox.jsonindex 7f4f0c85..859c6f39 100644--- a/registry-artifacts/elements/icon-inbox.json+++ b/registry-artifacts/elements/icon-inbox.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Inbox","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-inbox",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_PATH =\n \"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\";\nconst LIP_PATH = \"M22 12H16L14 15H10L8 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function InboxIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trayDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lipDraw = interpolate(linearDraw, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.55, 1], [0, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.03, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const tray = drawnPathProps(TRAY_PATH, acting ? 1 : trayDraw);\n const lip = drawnPathProps(LIP_PATH, acting ? 1 : lipDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale})`,\n }}\n >\n <path\n d={TRAY_PATH}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n <path\n d={LIP_PATH}\n strokeDasharray={lip.strokeDasharray}\n strokeDashoffset={lip.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction InboxIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d={TRAY_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_PATH =\n \"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\";\nconst LIP_PATH = \"M22 12H16L14 15H10L8 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction InboxIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trayDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lipDraw = interpolate(linearDraw, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.55, 1], [0, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.03, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const tray = drawnPathProps(TRAY_PATH, acting ? 1 : trayDraw);\n const lip = drawnPathProps(LIP_PATH, acting ? 1 : lipDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale})`,\n }}\n >\n <path\n d={TRAY_PATH}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n <path\n d={LIP_PATH}\n strokeDasharray={lip.strokeDasharray}\n strokeDashoffset={lip.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction InboxIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d={TRAY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype InboxIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InboxIconBase>;\n\nconst InboxIconInner = forwardRef<\n HTMLDivElement,\n InboxIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<InboxIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <InboxIconBase\n {...(componentProps as unknown as ComponentProps<typeof InboxIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InboxIcon = Interactive.withSchema({\n Component: InboxIconInner,\n componentName: \"<InboxIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-info.json b/registry-artifacts/elements/icon-info.jsonindex 76ae0758..6bfba2b2 100644--- a/registry-artifacts/elements/icon-info.json+++ b/registry-artifacts/elements/icon-info.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Info","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-info",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst STEM_PATH = \"M12 12v4\";\nconst DOT_PATH = \"M12 8h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nexport function InfoIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.5, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const bob = interpolate(actionProgress, [0, 0.5, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n <g\n transform={`translate(0 ${bob}) translate(12 8) scale(${dotPop}) translate(-12 -8)`}\n >\n <path d={DOT_PATH} />\n </g>\n </svg>\n );\n}\n\nfunction InfoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d={DOT_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst STEM_PATH = \"M12 12v4\";\nconst DOT_PATH = \"M12 8h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction InfoIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.5, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const bob = interpolate(actionProgress, [0, 0.5, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n <g\n transform={`translate(0 ${bob}) translate(12 8) scale(${dotPop}) translate(-12 -8)`}\n >\n <path d={DOT_PATH} />\n </g>\n </svg>\n );\n}\n\nfunction InfoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype InfoIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfoIconBase>;\n\nconst InfoIconInner = forwardRef<\n HTMLDivElement,\n InfoIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<InfoIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <InfoIconBase\n {...(componentProps as unknown as ComponentProps<typeof InfoIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfoIcon = Interactive.withSchema({\n Component: InfoIconInner,\n componentName: \"<InfoIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-key.json b/registry-artifacts/elements/icon-key.jsonindex e8834803..858e2dc8 100644--- a/registry-artifacts/elements/icon-key.json+++ b/registry-artifacts/elements/icon-key.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Key","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-key",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M7.5 10 A5.5 5.5 0 0 1 13 15.5 A5.5 5.5 0 0 1 7.5 21 A5.5 5.5 0 0 1 2 15.5 A5.5 5.5 0 0 1 7.5 10\";\nconst SHAFT_PATH = \"M21 2 11.4 11.6\";\nconst TEETH_PATH =\n \"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nexport function KeyIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const teethDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const turn = acting\n ? interpolate(actionProgress, [0, 0.5, 0.64, 0.9, 1], [0, -25, -25, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const teeth = drawnPathProps(TEETH_PATH, teethDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${turn} 7.5 15.5)`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={TEETH_PATH}\n strokeDasharray={teeth.strokeDasharray}\n strokeDashoffset={teeth.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction KeyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TEETH_PATH} />\n <path d={SHAFT_PATH} />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M7.5 10 A5.5 5.5 0 0 1 13 15.5 A5.5 5.5 0 0 1 7.5 21 A5.5 5.5 0 0 1 2 15.5 A5.5 5.5 0 0 1 7.5 10\";\nconst SHAFT_PATH = \"M21 2 11.4 11.6\";\nconst TEETH_PATH =\n \"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction KeyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const teethDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const turn = acting\n ? interpolate(actionProgress, [0, 0.5, 0.64, 0.9, 1], [0, -25, -25, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const teeth = drawnPathProps(TEETH_PATH, teethDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${turn} 7.5 15.5)`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={TEETH_PATH}\n strokeDasharray={teeth.strokeDasharray}\n strokeDashoffset={teeth.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction KeyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TEETH_PATH} />\n <path d={SHAFT_PATH} />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype KeyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof KeyIconBase>;\n\nconst KeyIconInner = forwardRef<\n HTMLDivElement,\n KeyIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<KeyIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <KeyIconBase\n {...(componentProps as unknown as ComponentProps<typeof KeyIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const KeyIcon = Interactive.withSchema({\n Component: KeyIconInner,\n componentName: \"<KeyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-layout-grid.json b/registry-artifacts/elements/icon-layout-grid.jsonindex f259571f..39b80ba2 100644--- a/registry-artifacts/elements/icon-layout-grid.json+++ b/registry-artifacts/elements/icon-layout-grid.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Layout Grid","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-layout-grid",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH =\n \"M4 3H9A1 1 0 0 1 10 4V9A1 1 0 0 1 9 10H4A1 1 0 0 1 3 9V4A1 1 0 0 1 4 3Z\";\nconst TR_PATH =\n \"M15 3H20A1 1 0 0 1 21 4V9A1 1 0 0 1 20 10H15A1 1 0 0 1 14 9V4A1 1 0 0 1 15 3Z\";\nconst BR_PATH =\n \"M15 14H20A1 1 0 0 1 21 15V20A1 1 0 0 1 20 21H15A1 1 0 0 1 14 20V15A1 1 0 0 1 15 14Z\";\nconst BL_PATH =\n \"M4 14H9A1 1 0 0 1 10 15V20A1 1 0 0 1 9 21H4A1 1 0 0 1 3 20V15A1 1 0 0 1 4 14Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nconst TILES = [\n { path: TL_PATH, cx: 6.5, cy: 6.5, drawWindow: [0, 0.4], stagger: 0 },\n { path: TR_PATH, cx: 17.5, cy: 6.5, drawWindow: [0.2, 0.6], stagger: 0.23 },\n { path: BR_PATH, cx: 17.5, cy: 17.5, drawWindow: [0.4, 0.8], stagger: 0.46 },\n { path: BL_PATH, cx: 6.5, cy: 17.5, drawWindow: [0.6, 1], stagger: 0.69 },\n] as const;\n\nexport function LayoutGridIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {TILES.map((tile) => {\n const drawn = interpolate(linearDraw, [...tile.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(tile.path, drawn);\n const pop =\n acting && actionProgress >= tile.stagger\n ? interpolate(\n actionProgress,\n [tile.stagger, tile.stagger + 0.25, tile.stagger + 0.5],\n [0.85, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const tx = tile.cx * (1 - pop);\n const ty = tile.cy * (1 - pop);\n return (\n <g key={tile.path} transform={`translate(${tx} ${ty}) scale(${pop})`}>\n <path\n d={tile.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction LayoutGridIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH =\n \"M4 3H9A1 1 0 0 1 10 4V9A1 1 0 0 1 9 10H4A1 1 0 0 1 3 9V4A1 1 0 0 1 4 3Z\";\nconst TR_PATH =\n \"M15 3H20A1 1 0 0 1 21 4V9A1 1 0 0 1 20 10H15A1 1 0 0 1 14 9V4A1 1 0 0 1 15 3Z\";\nconst BR_PATH =\n \"M15 14H20A1 1 0 0 1 21 15V20A1 1 0 0 1 20 21H15A1 1 0 0 1 14 20V15A1 1 0 0 1 15 14Z\";\nconst BL_PATH =\n \"M4 14H9A1 1 0 0 1 10 15V20A1 1 0 0 1 9 21H4A1 1 0 0 1 3 20V15A1 1 0 0 1 4 14Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nconst TILES = [\n { path: TL_PATH, cx: 6.5, cy: 6.5, drawWindow: [0, 0.4], stagger: 0 },\n { path: TR_PATH, cx: 17.5, cy: 6.5, drawWindow: [0.2, 0.6], stagger: 0.23 },\n { path: BR_PATH, cx: 17.5, cy: 17.5, drawWindow: [0.4, 0.8], stagger: 0.46 },\n { path: BL_PATH, cx: 6.5, cy: 17.5, drawWindow: [0.6, 1], stagger: 0.69 },\n] as const;\n\nfunction LayoutGridIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {TILES.map((tile) => {\n const drawn = interpolate(linearDraw, [...tile.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(tile.path, drawn);\n const pop =\n acting && actionProgress >= tile.stagger\n ? interpolate(\n actionProgress,\n [tile.stagger, tile.stagger + 0.25, tile.stagger + 0.5],\n [0.85, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const tx = tile.cx * (1 - pop);\n const ty = tile.cy * (1 - pop);\n return (\n <g key={tile.path} transform={`translate(${tx} ${ty}) scale(${pop})`}>\n <path\n d={tile.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction LayoutGridIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LayoutGridIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LayoutGridIconBase>;\n\nconst LayoutGridIconInner = forwardRef<\n HTMLDivElement,\n LayoutGridIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LayoutGridIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LayoutGridIconBase\n {...(componentProps as unknown as ComponentProps<typeof LayoutGridIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LayoutGridIcon = Interactive.withSchema({\n Component: LayoutGridIconInner,\n componentName: \"<LayoutGridIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-link.json b/registry-artifacts/elements/icon-link.jsonindex 6f27862d..01d6fec0 100644--- a/registry-artifacts/elements/icon-link.json+++ b/registry-artifacts/elements/icon-link.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Link","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-link",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\";\nconst BOTTOM_PATH =\n \"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function LinkIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pull = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75], [0, 1.06, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const top = drawnPathProps(TOP_PATH, drawProgress);\n const bottom = drawnPathProps(BOTTOM_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${pull} ${-pull})`}>\n <path\n d={TOP_PATH}\n strokeDasharray={top.strokeDasharray}\n strokeDashoffset={top.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pull} ${pull})`}>\n <path\n d={BOTTOM_PATH}\n strokeDasharray={bottom.strokeDasharray}\n strokeDashoffset={bottom.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={BOTTOM_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\";\nconst BOTTOM_PATH =\n \"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction LinkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pull = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75], [0, 1.06, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const top = drawnPathProps(TOP_PATH, drawProgress);\n const bottom = drawnPathProps(BOTTOM_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${pull} ${-pull})`}>\n <path\n d={TOP_PATH}\n strokeDasharray={top.strokeDasharray}\n strokeDashoffset={top.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pull} ${pull})`}>\n <path\n d={BOTTOM_PATH}\n strokeDasharray={bottom.strokeDasharray}\n strokeDashoffset={bottom.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={BOTTOM_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LinkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LinkIconBase>;\n\nconst LinkIconInner = forwardRef<\n HTMLDivElement,\n LinkIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LinkIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LinkIconBase\n {...(componentProps as unknown as ComponentProps<typeof LinkIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LinkIcon = Interactive.withSchema({\n Component: LinkIconInner,\n componentName: \"<LinkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-loader.json b/registry-artifacts/elements/icon-loader.jsonindex 09ce0920..c9f85e23 100644--- a/registry-artifacts/elements/icon-loader.json+++ b/registry-artifacts/elements/icon-loader.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Loader","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-loader",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_PATH = \"M21 12a9 9 0 1 1-6.219-8.56\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nexport function LoaderIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const arc = drawnPathProps(ARC_PATH, arcProgress);\n const rotate = (cycleIndex + actionProgress) * 360;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${entrance})`,\n }}\n >\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction LoaderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_PATH = \"M21 12a9 9 0 1 1-6.219-8.56\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction LoaderIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const arc = drawnPathProps(ARC_PATH, arcProgress);\n const rotate = (cycleIndex + actionProgress) * 360;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${entrance})`,\n }}\n >\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction LoaderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LoaderIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LoaderIconBase>;\n\nconst LoaderIconInner = forwardRef<\n HTMLDivElement,\n LoaderIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LoaderIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LoaderIconBase\n {...(componentProps as unknown as ComponentProps<typeof LoaderIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LoaderIcon = Interactive.withSchema({\n Component: LoaderIconInner,\n componentName: \"<LoaderIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-lock.json b/registry-artifacts/elements/icon-lock.jsonindex 2e4fd70a..d8be388f 100644--- a/registry-artifacts/elements/icon-lock.json+++ b/registry-artifacts/elements/icon-lock.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Lock","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-lock",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M5 11H19A2 2 0 0 1 21 13V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V13A2 2 0 0 1 5 11Z\";\nconst SHACKLE_PATH = \"M7 11V7a5 5 0 0 1 10 0v4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function LockIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shackleDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.7, 0.85, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const shackle = drawnPathProps(SHACKLE_PATH, shackleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${lift})`}>\n <path\n d={SHACKLE_PATH}\n strokeDasharray={shackle.strokeDasharray}\n strokeDashoffset={shackle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d={SHACKLE_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M5 11H19A2 2 0 0 1 21 13V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V13A2 2 0 0 1 5 11Z\";\nconst SHACKLE_PATH = \"M7 11V7a5 5 0 0 1 10 0v4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction LockIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shackleDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.7, 0.85, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const shackle = drawnPathProps(SHACKLE_PATH, shackleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${lift})`}>\n <path\n d={SHACKLE_PATH}\n strokeDasharray={shackle.strokeDasharray}\n strokeDashoffset={shackle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d={SHACKLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LockIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LockIconBase>;\n\nconst LockIconInner = forwardRef<\n HTMLDivElement,\n LockIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LockIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LockIconBase\n {...(componentProps as unknown as ComponentProps<typeof LockIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LockIcon = Interactive.withSchema({\n Component: LockIconInner,\n componentName: \"<LockIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-log-out.json b/registry-artifacts/elements/icon-log-out.jsonindex e52092c5..1528f3a1 100644--- a/registry-artifacts/elements/icon-log-out.json+++ b/registry-artifacts/elements/icon-log-out.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Log Out","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-log-out",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\";\nconst SHAFT_PATH = \"M21 12H9\";\nconst HEAD_PATH = \"M16 17 21 12 16 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function LogOutIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const exit = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45, 0.68, 1], [0, 4, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const door = drawnPathProps(DOOR_PATH, doorDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const head = drawnPathProps(HEAD_PATH, headDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n <g transform={`translate(${exit} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LogOutIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEAD_PATH} />\n <path d={SHAFT_PATH} />\n <path d={DOOR_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\";\nconst SHAFT_PATH = \"M21 12H9\";\nconst HEAD_PATH = \"M16 17 21 12 16 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction LogOutIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const exit = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45, 0.68, 1], [0, 4, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const door = drawnPathProps(DOOR_PATH, doorDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const head = drawnPathProps(HEAD_PATH, headDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n <g transform={`translate(${exit} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LogOutIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEAD_PATH} />\n <path d={SHAFT_PATH} />\n <path d={DOOR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LogOutIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LogOutIconBase>;\n\nconst LogOutIconInner = forwardRef<\n HTMLDivElement,\n LogOutIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LogOutIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LogOutIconBase\n {...(componentProps as unknown as ComponentProps<typeof LogOutIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LogOutIcon = Interactive.withSchema({\n Component: LogOutIconInner,\n componentName: \"<LogOutIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-mail.json b/registry-artifacts/elements/icon-mail.jsonindex bf4c0b58..4b41b817 100644--- a/registry-artifacts/elements/icon-mail.json+++ b/registry-artifacts/elements/icon-mail.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Mail","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-mail",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 4H20A2 2 0 0 1 22 6V18A2 2 0 0 1 20 20H4A2 2 0 0 1 2 18V6A2 2 0 0 1 4 4Z\";\nconst FLAP_PATH = \"M22 7 13.009 12.727a2 2 0 0 1-2.009 0L2 7\";\nconst FLAP_RIGHT_PATH = \"M22 7 13.009 12.727\";\nconst FLAP_LEFT_PATH = \"M2 7 11 12.727\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function MailIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flapProgress = acting ? 1 : flapDraw;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bob = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const flapRight = drawnPathProps(FLAP_RIGHT_PATH, flapProgress);\n const flapLeft = drawnPathProps(FLAP_LEFT_PATH, flapProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${bob}px) scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_RIGHT_PATH}\n strokeDasharray={flapRight.strokeDasharray}\n strokeDashoffset={flapRight.strokeDashoffset}\n />\n <path\n d={FLAP_LEFT_PATH}\n strokeDasharray={flapLeft.strokeDasharray}\n strokeDashoffset={flapLeft.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MailIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 4H20A2 2 0 0 1 22 6V18A2 2 0 0 1 20 20H4A2 2 0 0 1 2 18V6A2 2 0 0 1 4 4Z\";\nconst FLAP_PATH = \"M22 7 13.009 12.727a2 2 0 0 1-2.009 0L2 7\";\nconst FLAP_RIGHT_PATH = \"M22 7 13.009 12.727\";\nconst FLAP_LEFT_PATH = \"M2 7 11 12.727\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MailIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flapProgress = acting ? 1 : flapDraw;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bob = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const flapRight = drawnPathProps(FLAP_RIGHT_PATH, flapProgress);\n const flapLeft = drawnPathProps(FLAP_LEFT_PATH, flapProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${bob}px) scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_RIGHT_PATH}\n strokeDasharray={flapRight.strokeDasharray}\n strokeDashoffset={flapRight.strokeDashoffset}\n />\n <path\n d={FLAP_LEFT_PATH}\n strokeDasharray={flapLeft.strokeDasharray}\n strokeDashoffset={flapLeft.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MailIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MailIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MailIconBase>;\n\nconst MailIconInner = forwardRef<\n HTMLDivElement,\n MailIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MailIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MailIconBase\n {...(componentProps as unknown as ComponentProps<typeof MailIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MailIcon = Interactive.withSchema({\n Component: MailIconInner,\n componentName: \"<MailIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-maximize.json b/registry-artifacts/elements/icon-maximize.jsonindex 04a2a7ce..0a1c04d6 100644--- a/registry-artifacts/elements/icon-maximize.json+++ b/registry-artifacts/elements/icon-maximize.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Maximize","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-maximize",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH = \"M8 3H5a2 2 0 0 0-2 2v3\";\nconst TR_PATH = \"M21 8V5a2 2 0 0 0-2-2h-3\";\nconst BL_PATH = \"M3 16v3a2 2 0 0 0 2 2h3\";\nconst BR_PATH = \"M16 21h3a2 2 0 0 0 2-2v-3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nconst BRACKETS = [\n { path: TL_PATH, dx: -1, dy: -1 },\n { path: TR_PATH, dx: 1, dy: -1 },\n { path: BL_PATH, dx: -1, dy: 1 },\n { path: BR_PATH, dx: 1, dy: 1 },\n] as const;\n\nexport function MaximizeIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n const expand = acting\n ? interpolate(actionProgress, [0, 0.42, 1], [0, 1.77, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BRACKETS.map((bracket) => {\n const dash = drawnPathProps(bracket.path, drawProgress);\n return (\n <g\n key={bracket.path}\n transform={`translate(${bracket.dx * expand} ${bracket.dy * expand})`}\n >\n <path\n d={bracket.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MaximizeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TL_PATH} />\n <path d={TR_PATH} />\n <path d={BL_PATH} />\n <path d={BR_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH = \"M8 3H5a2 2 0 0 0-2 2v3\";\nconst TR_PATH = \"M21 8V5a2 2 0 0 0-2-2h-3\";\nconst BL_PATH = \"M3 16v3a2 2 0 0 0 2 2h3\";\nconst BR_PATH = \"M16 21h3a2 2 0 0 0 2-2v-3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nconst BRACKETS = [\n { path: TL_PATH, dx: -1, dy: -1 },\n { path: TR_PATH, dx: 1, dy: -1 },\n { path: BL_PATH, dx: -1, dy: 1 },\n { path: BR_PATH, dx: 1, dy: 1 },\n] as const;\n\nfunction MaximizeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n const expand = acting\n ? interpolate(actionProgress, [0, 0.42, 1], [0, 1.77, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BRACKETS.map((bracket) => {\n const dash = drawnPathProps(bracket.path, drawProgress);\n return (\n <g\n key={bracket.path}\n transform={`translate(${bracket.dx * expand} ${bracket.dy * expand})`}\n >\n <path\n d={bracket.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MaximizeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TL_PATH} />\n <path d={TR_PATH} />\n <path d={BL_PATH} />\n <path d={BR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MaximizeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MaximizeIconBase>;\n\nconst MaximizeIconInner = forwardRef<\n HTMLDivElement,\n MaximizeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MaximizeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MaximizeIconBase\n {...(componentProps as unknown as ComponentProps<typeof MaximizeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MaximizeIcon = Interactive.withSchema({\n Component: MaximizeIconInner,\n componentName: \"<MaximizeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-menu.json b/registry-artifacts/elements/icon-menu.jsonindex ad561d70..b69e9d1b 100644--- a/registry-artifacts/elements/icon-menu.json+++ b/registry-artifacts/elements/icon-menu.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Menu","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-menu",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M4 5 20 5\";\nconst MID_PATH = \"M4 12 20 12\";\nconst BOT_PATH = \"M4 19 20 19\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nconst BARS = [\n { path: TOP_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { path: MID_PATH, drawWindow: [0.25, 0.75], stagger: 0.18 },\n { path: BOT_PATH, drawWindow: [0.5, 1], stagger: 0.36 },\n] as const;\n\nexport function MenuIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BARS.map((bar) => {\n const drawn = interpolate(linearDraw, [...bar.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(bar.path, drawn);\n const slide = acting\n ? interpolate(\n actionProgress,\n [bar.stagger, bar.stagger + 0.3, bar.stagger + 0.55],\n [-3, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n return (\n <g key={bar.path} transform={`translate(${slide} 0)`}>\n <path\n d={bar.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MenuIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={MID_PATH} />\n <path d={BOT_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M4 5 20 5\";\nconst MID_PATH = \"M4 12 20 12\";\nconst BOT_PATH = \"M4 19 20 19\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nconst BARS = [\n { path: TOP_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { path: MID_PATH, drawWindow: [0.25, 0.75], stagger: 0.18 },\n { path: BOT_PATH, drawWindow: [0.5, 1], stagger: 0.36 },\n] as const;\n\nfunction MenuIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BARS.map((bar) => {\n const drawn = interpolate(linearDraw, [...bar.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(bar.path, drawn);\n const slide = acting\n ? interpolate(\n actionProgress,\n [bar.stagger, bar.stagger + 0.3, bar.stagger + 0.55],\n [-3, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n return (\n <g key={bar.path} transform={`translate(${slide} 0)`}>\n <path\n d={bar.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MenuIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={MID_PATH} />\n <path d={BOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MenuIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MenuIconBase>;\n\nconst MenuIconInner = forwardRef<\n HTMLDivElement,\n MenuIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MenuIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MenuIconBase\n {...(componentProps as unknown as ComponentProps<typeof MenuIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MenuIcon = Interactive.withSchema({\n Component: MenuIconInner,\n componentName: \"<MenuIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-message-circle.json b/registry-artifacts/elements/icon-message-circle.jsonindex 94f5d5e9..52201841 100644--- a/registry-artifacts/elements/icon-message-circle.json+++ b/registry-artifacts/elements/icon-message-circle.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Message Circle","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-message-circle",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BUBBLE_PATH =\n \"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\";\n\nconst TAIL_X = 4;\nconst TAIL_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function MessageCircleIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const inflate = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.9, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bubble = drawnPathProps(BUBBLE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const inflateTransform = `translate(${TAIL_X * (1 - inflate)} ${TAIL_Y * (1 - inflate)}) scale(${inflate})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={inflateTransform}>\n <path\n d={BUBBLE_PATH}\n strokeDasharray={bubble.strokeDasharray}\n strokeDashoffset={bubble.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MessageCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BUBBLE_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BUBBLE_PATH =\n \"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\";\n\nconst TAIL_X = 4;\nconst TAIL_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction MessageCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const inflate = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.9, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bubble = drawnPathProps(BUBBLE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const inflateTransform = `translate(${TAIL_X * (1 - inflate)} ${TAIL_Y * (1 - inflate)}) scale(${inflate})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={inflateTransform}>\n <path\n d={BUBBLE_PATH}\n strokeDasharray={bubble.strokeDasharray}\n strokeDashoffset={bubble.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MessageCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BUBBLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MessageCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MessageCircleIconBase>;\n\nconst MessageCircleIconInner = forwardRef<\n HTMLDivElement,\n MessageCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MessageCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MessageCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof MessageCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MessageCircleIcon = Interactive.withSchema({\n Component: MessageCircleIconInner,\n componentName: \"<MessageCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-mic.json b/registry-artifacts/elements/icon-mic.jsonindex c99fe06d..6a557dc3 100644--- a/registry-artifacts/elements/icon-mic.json+++ b/registry-artifacts/elements/icon-mic.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Mic","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-mic",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CAPSULE_PATH =\n \"M12 2A3 3 0 0 1 15 5V12A3 3 0 0 1 12 15A3 3 0 0 1 9 12V5A3 3 0 0 1 12 2Z\";\nconst ARC_PATH = \"M19 10v2a7 7 0 0 1-14 0v-2\";\nconst STAND_PATH = \"M12 19v3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function MicIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const capsuleDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arcDraw = interpolate(linearDraw, [0.375, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const standDraw = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const capsuleScaleY = acting\n ? interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.5, 0.65, 0.8, 1],\n [1, 0.94, 1.04, 1, 0.97, 1.02, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const capsule = drawnPathProps(CAPSULE_PATH, capsuleDraw);\n const arc = drawnPathProps(ARC_PATH, arcDraw);\n const stand = drawnPathProps(STAND_PATH, standDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const capsuleTransform = `translate(0 ${8.5 * (1 - capsuleScaleY)}) scale(1 ${capsuleScaleY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={capsuleTransform}>\n <path\n d={CAPSULE_PATH}\n strokeDasharray={capsule.strokeDasharray}\n strokeDashoffset={capsule.strokeDashoffset}\n />\n </g>\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n <path\n d={STAND_PATH}\n strokeDasharray={stand.strokeDasharray}\n strokeDashoffset={stand.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MicIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAND_PATH} />\n <path d={ARC_PATH} />\n <rect x=\"9\" y=\"2\" width=\"6\" height=\"13\" rx=\"3\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CAPSULE_PATH =\n \"M12 2A3 3 0 0 1 15 5V12A3 3 0 0 1 12 15A3 3 0 0 1 9 12V5A3 3 0 0 1 12 2Z\";\nconst ARC_PATH = \"M19 10v2a7 7 0 0 1-14 0v-2\";\nconst STAND_PATH = \"M12 19v3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MicIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const capsuleDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arcDraw = interpolate(linearDraw, [0.375, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const standDraw = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const capsuleScaleY = acting\n ? interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.5, 0.65, 0.8, 1],\n [1, 0.94, 1.04, 1, 0.97, 1.02, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const capsule = drawnPathProps(CAPSULE_PATH, capsuleDraw);\n const arc = drawnPathProps(ARC_PATH, arcDraw);\n const stand = drawnPathProps(STAND_PATH, standDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const capsuleTransform = `translate(0 ${8.5 * (1 - capsuleScaleY)}) scale(1 ${capsuleScaleY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={capsuleTransform}>\n <path\n d={CAPSULE_PATH}\n strokeDasharray={capsule.strokeDasharray}\n strokeDashoffset={capsule.strokeDashoffset}\n />\n </g>\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n <path\n d={STAND_PATH}\n strokeDasharray={stand.strokeDasharray}\n strokeDashoffset={stand.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MicIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAND_PATH} />\n <path d={ARC_PATH} />\n <rect x=\"9\" y=\"2\" width=\"6\" height=\"13\" rx=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MicIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MicIconBase>;\n\nconst MicIconInner = forwardRef<\n HTMLDivElement,\n MicIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MicIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MicIconBase\n {...(componentProps as unknown as ComponentProps<typeof MicIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MicIcon = Interactive.withSchema({\n Component: MicIconInner,\n componentName: \"<MicIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-monitor.json b/registry-artifacts/elements/icon-monitor.jsonindex 4852db27..c209262b 100644--- a/registry-artifacts/elements/icon-monitor.json+++ b/registry-artifacts/elements/icon-monitor.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Monitor","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-monitor",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SCREEN_PATH =\n \"M4 3H20A2 2 0 0 1 22 5V15A2 2 0 0 1 20 17H4A2 2 0 0 1 2 15V5A2 2 0 0 1 4 3Z\";\nconst BASE_PATH = \"M8 21H16\";\nconst NECK_PATH = \"M12 17V21\";\n\nconst SCREEN_CY = 10;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function MonitorIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const standDraw = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const screenDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const screenYScale = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.92, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.02, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const screen = drawnPathProps(SCREEN_PATH, acting ? 1 : screenDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : standDraw);\n const neck = drawnPathProps(NECK_PATH, acting ? 1 : standDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n const screenTransform = `translate(0 ${SCREEN_CY * (1 - screenYScale)}) scale(1 ${screenYScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={screenTransform}>\n <path\n d={SCREEN_PATH}\n strokeDasharray={screen.strokeDasharray}\n strokeDashoffset={screen.strokeDashoffset}\n />\n </g>\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n <path\n d={NECK_PATH}\n strokeDasharray={neck.strokeDasharray}\n strokeDashoffset={neck.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MonitorIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"3\" rx=\"2\" />\n <line x1=\"8\" x2=\"16\" y1=\"21\" y2=\"21\" />\n <line x1=\"12\" x2=\"12\" y1=\"17\" y2=\"21\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SCREEN_PATH =\n \"M4 3H20A2 2 0 0 1 22 5V15A2 2 0 0 1 20 17H4A2 2 0 0 1 2 15V5A2 2 0 0 1 4 3Z\";\nconst BASE_PATH = \"M8 21H16\";\nconst NECK_PATH = \"M12 17V21\";\n\nconst SCREEN_CY = 10;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction MonitorIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const standDraw = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const screenDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const screenYScale = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.92, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.02, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const screen = drawnPathProps(SCREEN_PATH, acting ? 1 : screenDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : standDraw);\n const neck = drawnPathProps(NECK_PATH, acting ? 1 : standDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n const screenTransform = `translate(0 ${SCREEN_CY * (1 - screenYScale)}) scale(1 ${screenYScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={screenTransform}>\n <path\n d={SCREEN_PATH}\n strokeDasharray={screen.strokeDasharray}\n strokeDashoffset={screen.strokeDashoffset}\n />\n </g>\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n <path\n d={NECK_PATH}\n strokeDasharray={neck.strokeDasharray}\n strokeDashoffset={neck.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MonitorIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"3\" rx=\"2\" />\n <line x1=\"8\" x2=\"16\" y1=\"21\" y2=\"21\" />\n <line x1=\"12\" x2=\"12\" y1=\"17\" y2=\"21\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MonitorIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MonitorIconBase>;\n\nconst MonitorIconInner = forwardRef<\n HTMLDivElement,\n MonitorIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MonitorIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MonitorIconBase\n {...(componentProps as unknown as ComponentProps<typeof MonitorIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MonitorIcon = Interactive.withSchema({\n Component: MonitorIconInner,\n componentName: \"<MonitorIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-moon.json b/registry-artifacts/elements/icon-moon.jsonindex 2df0de49..3180753d 100644--- a/registry-artifacts/elements/icon-moon.json+++ b/registry-artifacts/elements/icon-moon.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Moon","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-moon",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MOON_PATH =\n \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function MoonIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const settle = acting\n ? interpolate(actionProgress, [0, 0.2, 0.5, 0.78, 1], [0, -16, 9, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const moon = drawnPathProps(MOON_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${settle} ${CENTER} ${CENTER})`}>\n <path\n d={MOON_PATH}\n strokeDasharray={moon.strokeDasharray}\n strokeDashoffset={moon.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MoonIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MOON_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MOON_PATH =\n \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MoonIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const settle = acting\n ? interpolate(actionProgress, [0, 0.2, 0.5, 0.78, 1], [0, -16, 9, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const moon = drawnPathProps(MOON_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${settle} ${CENTER} ${CENTER})`}>\n <path\n d={MOON_PATH}\n strokeDasharray={moon.strokeDasharray}\n strokeDashoffset={moon.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MoonIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MOON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MoonIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MoonIconBase>;\n\nconst MoonIconInner = forwardRef<\n HTMLDivElement,\n MoonIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MoonIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MoonIconBase\n {...(componentProps as unknown as ComponentProps<typeof MoonIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MoonIcon = Interactive.withSchema({\n Component: MoonIconInner,\n componentName: \"<MoonIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-more-horizontal.json b/registry-artifacts/elements/icon-more-horizontal.jsonindex b6dba57b..c5dbdc49 100644--- a/registry-artifacts/elements/icon-more-horizontal.json+++ b/registry-artifacts/elements/icon-more-horizontal.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "More Horizontal","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-more-horizontal",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M5 11 A1 1 0 0 1 6 12 A1 1 0 0 1 5 13 A1 1 0 0 1 4 12 A1 1 0 0 1 5 11\";\nconst CENTER_PATH =\n \"M12 11 A1 1 0 0 1 13 12 A1 1 0 0 1 12 13 A1 1 0 0 1 11 12 A1 1 0 0 1 12 11\";\nconst RIGHT_PATH =\n \"M19 11 A1 1 0 0 1 20 12 A1 1 0 0 1 19 13 A1 1 0 0 1 18 12 A1 1 0 0 1 19 11\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst DOTS = [\n { cx: 5, path: LEFT_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { cx: 12, path: CENTER_PATH, drawWindow: [0.25, 0.75], stagger: 0.27 },\n { cx: 19, path: RIGHT_PATH, drawWindow: [0.5, 1], stagger: 0.54 },\n] as const;\n\nexport function MoreHorizontalIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {DOTS.map((dot) => {\n const drawn = interpolate(linearDraw, [...dot.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(dot.path, drawn);\n const dotScale = 0.6 + 0.4 * drawn;\n const lift = acting\n ? interpolate(\n actionProgress,\n [dot.stagger, dot.stagger + 0.2, dot.stagger + 0.4],\n [0, -3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n const tx = dot.cx * (1 - dotScale);\n const ty = 12 * (1 - dotScale) + lift;\n return (\n <g\n key={dot.cx}\n transform={`translate(${tx} ${ty}) scale(${dotScale})`}\n >\n <path\n d={dot.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MoreHorizontalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M5 11 A1 1 0 0 1 6 12 A1 1 0 0 1 5 13 A1 1 0 0 1 4 12 A1 1 0 0 1 5 11\";\nconst CENTER_PATH =\n \"M12 11 A1 1 0 0 1 13 12 A1 1 0 0 1 12 13 A1 1 0 0 1 11 12 A1 1 0 0 1 12 11\";\nconst RIGHT_PATH =\n \"M19 11 A1 1 0 0 1 20 12 A1 1 0 0 1 19 13 A1 1 0 0 1 18 12 A1 1 0 0 1 19 11\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst DOTS = [\n { cx: 5, path: LEFT_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { cx: 12, path: CENTER_PATH, drawWindow: [0.25, 0.75], stagger: 0.27 },\n { cx: 19, path: RIGHT_PATH, drawWindow: [0.5, 1], stagger: 0.54 },\n] as const;\n\nfunction MoreHorizontalIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {DOTS.map((dot) => {\n const drawn = interpolate(linearDraw, [...dot.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(dot.path, drawn);\n const dotScale = 0.6 + 0.4 * drawn;\n const lift = acting\n ? interpolate(\n actionProgress,\n [dot.stagger, dot.stagger + 0.2, dot.stagger + 0.4],\n [0, -3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n const tx = dot.cx * (1 - dotScale);\n const ty = 12 * (1 - dotScale) + lift;\n return (\n <g\n key={dot.cx}\n transform={`translate(${tx} ${ty}) scale(${dotScale})`}\n >\n <path\n d={dot.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MoreHorizontalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MoreHorizontalIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MoreHorizontalIconBase>;\n\nconst MoreHorizontalIconInner = forwardRef<\n HTMLDivElement,\n MoreHorizontalIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MoreHorizontalIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MoreHorizontalIconBase\n {...(componentProps as unknown as ComponentProps<typeof MoreHorizontalIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MoreHorizontalIcon = Interactive.withSchema({\n Component: MoreHorizontalIconInner,\n componentName: \"<MoreHorizontalIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-package.json b/registry-artifacts/elements/icon-package.jsonindex 4b93cc35..a1391727 100644--- a/registry-artifacts/elements/icon-package.json+++ b/registry-artifacts/elements/icon-package.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Package","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-package",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH =\n \"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\";\nconst CENTER_PATH = \"M12 22V12\";\nconst EDGE_PATH = \"M7.5 4.27 16.5 9.42\";\nconst SEAM_PATH = \"M3.29 7 12 12 20.71 7\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function PackageIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const edgesDraw = interpolate(linearDraw, [0.45, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const seamDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const squashY = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.7, 1],\n [1, 0.95, 1.04, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const center = drawnPathProps(CENTER_PATH, acting ? 1 : edgesDraw);\n const edge = drawnPathProps(EDGE_PATH, acting ? 1 : edgesDraw);\n const seam = drawnPathProps(SEAM_PATH, acting ? 1 : seamDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const bodyTransform = `translate(0 ${drop + BASE_Y * (1 - squashY)}) scale(1 ${squashY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={bodyTransform}>\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_PATH}\n strokeDasharray={center.strokeDasharray}\n strokeDashoffset={center.strokeDashoffset}\n />\n <path\n d={EDGE_PATH}\n strokeDasharray={edge.strokeDasharray}\n strokeDashoffset={edge.strokeDashoffset}\n />\n <path\n d={SEAM_PATH}\n strokeDasharray={seam.strokeDasharray}\n strokeDashoffset={seam.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PackageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={CENTER_PATH} />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH =\n \"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\";\nconst CENTER_PATH = \"M12 22V12\";\nconst EDGE_PATH = \"M7.5 4.27 16.5 9.42\";\nconst SEAM_PATH = \"M3.29 7 12 12 20.71 7\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction PackageIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const edgesDraw = interpolate(linearDraw, [0.45, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const seamDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const squashY = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.7, 1],\n [1, 0.95, 1.04, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const center = drawnPathProps(CENTER_PATH, acting ? 1 : edgesDraw);\n const edge = drawnPathProps(EDGE_PATH, acting ? 1 : edgesDraw);\n const seam = drawnPathProps(SEAM_PATH, acting ? 1 : seamDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const bodyTransform = `translate(0 ${drop + BASE_Y * (1 - squashY)}) scale(1 ${squashY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={bodyTransform}>\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_PATH}\n strokeDasharray={center.strokeDasharray}\n strokeDashoffset={center.strokeDashoffset}\n />\n <path\n d={EDGE_PATH}\n strokeDasharray={edge.strokeDasharray}\n strokeDashoffset={edge.strokeDashoffset}\n />\n <path\n d={SEAM_PATH}\n strokeDasharray={seam.strokeDasharray}\n strokeDashoffset={seam.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PackageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={CENTER_PATH} />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PackageIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PackageIconBase>;\n\nconst PackageIconInner = forwardRef<\n HTMLDivElement,\n PackageIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PackageIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PackageIconBase\n {...(componentProps as unknown as ComponentProps<typeof PackageIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PackageIcon = Interactive.withSchema({\n Component: PackageIconInner,\n componentName: \"<PackageIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-party-popper.json b/registry-artifacts/elements/icon-party-popper.jsonindex c47c5412..c3f138f7 100644--- a/registry-artifacts/elements/icon-party-popper.json+++ b/registry-artifacts/elements/icon-party-popper.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Party Popper","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-party-popper",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CONE_MAIN = \"M5.8 11.3 2 22l10.7-3.79\";\nconst CONE_CURL =\n \"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\";\n\nconst CONFETTI = [\n {\n d: \"M11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7\",\n cx: 10,\n cy: 4.5,\n dx: 0.22,\n dy: -0.98,\n },\n { d: \"M4 3h.01\", cx: 4, cy: 3, dx: -0.64, dy: -0.77 },\n { d: \"M15 2h.01\", cx: 15, cy: 2, dx: 0.65, dy: -0.76 },\n {\n d: \"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10\",\n cx: 18,\n cy: 6,\n dx: 0.95,\n dy: -0.32,\n },\n {\n d: \"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17\",\n cx: 19,\n cy: 14,\n dx: 0.89,\n dy: 0.45,\n },\n { d: \"M22 8h.01\", cx: 22, cy: 8, dx: 1, dy: -0.08 },\n { d: \"M22 20h.01\", cx: 22, cy: 20, dx: 0.76, dy: 0.65 },\n] as const;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function PartyPopperIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curlProgress = interpolate(linearDraw, [0.4, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const main = drawnPathProps(CONE_MAIN, mainProgress);\n const curl = drawnPathProps(CONE_CURL, curlProgress);\n\n const recoil = interpolate(actionProgress, [0, 0.35, 1], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${recoil} 2 22)`}>\n <path\n d={CONE_MAIN}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n <path\n d={CONE_CURL}\n strokeDasharray={curl.strokeDasharray}\n strokeDashoffset={curl.strokeDashoffset}\n />\n </g>\n {CONFETTI.map((piece, index) => {\n const pieceFrame = actionFrame - index * 2;\n const burst =\n pieceFrame <= 0\n ? 0\n : spring({\n frame: pieceFrame,\n fps,\n config: { damping: 12, stiffness: 170, mass: 0.7 },\n durationInFrames: 20,\n });\n const dist = 3 * burst;\n const opacity = interpolate(burst, [0, 0.15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <path\n key={index}\n d={piece.d}\n opacity={opacity}\n transform={`translate(${piece.dx * dist} ${piece.dy * dist}) translate(${piece.cx} ${piece.cy}) scale(${burst}) translate(${-piece.cx} ${-piece.cy})`}\n />\n );\n })}\n </svg>\n );\n}\n\nfunction PartyPopperIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CONE_MAIN} />\n <path d={CONE_CURL} />\n {CONFETTI.map((piece, index) => (\n <path key={index} d={piece.d} />\n ))}\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CONE_MAIN = \"M5.8 11.3 2 22l10.7-3.79\";\nconst CONE_CURL =\n \"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\";\n\nconst CONFETTI = [\n {\n d: \"M11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7\",\n cx: 10,\n cy: 4.5,\n dx: 0.22,\n dy: -0.98,\n },\n { d: \"M4 3h.01\", cx: 4, cy: 3, dx: -0.64, dy: -0.77 },\n { d: \"M15 2h.01\", cx: 15, cy: 2, dx: 0.65, dy: -0.76 },\n {\n d: \"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10\",\n cx: 18,\n cy: 6,\n dx: 0.95,\n dy: -0.32,\n },\n {\n d: \"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17\",\n cx: 19,\n cy: 14,\n dx: 0.89,\n dy: 0.45,\n },\n { d: \"M22 8h.01\", cx: 22, cy: 8, dx: 1, dy: -0.08 },\n { d: \"M22 20h.01\", cx: 22, cy: 20, dx: 0.76, dy: 0.65 },\n] as const;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction PartyPopperIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curlProgress = interpolate(linearDraw, [0.4, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const main = drawnPathProps(CONE_MAIN, mainProgress);\n const curl = drawnPathProps(CONE_CURL, curlProgress);\n\n const recoil = interpolate(actionProgress, [0, 0.35, 1], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${recoil} 2 22)`}>\n <path\n d={CONE_MAIN}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n <path\n d={CONE_CURL}\n strokeDasharray={curl.strokeDasharray}\n strokeDashoffset={curl.strokeDashoffset}\n />\n </g>\n {CONFETTI.map((piece, index) => {\n const pieceFrame = actionFrame - index * 2;\n const burst =\n pieceFrame <= 0\n ? 0\n : spring({\n frame: pieceFrame,\n fps,\n config: { damping: 12, stiffness: 170, mass: 0.7 },\n durationInFrames: 20,\n });\n const dist = 3 * burst;\n const opacity = interpolate(burst, [0, 0.15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <path\n key={index}\n d={piece.d}\n opacity={opacity}\n transform={`translate(${piece.dx * dist} ${piece.dy * dist}) translate(${piece.cx} ${piece.cy}) scale(${burst}) translate(${-piece.cx} ${-piece.cy})`}\n />\n );\n })}\n </svg>\n );\n}\n\nfunction PartyPopperIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CONE_MAIN} />\n <path d={CONE_CURL} />\n {CONFETTI.map((piece, index) => (\n <path key={index} d={piece.d} />\n ))}\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PartyPopperIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PartyPopperIconBase>;\n\nconst PartyPopperIconInner = forwardRef<\n HTMLDivElement,\n PartyPopperIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PartyPopperIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PartyPopperIconBase\n {...(componentProps as unknown as ComponentProps<typeof PartyPopperIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PartyPopperIcon = Interactive.withSchema({\n Component: PartyPopperIconInner,\n componentName: \"<PartyPopperIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-pause.json b/registry-artifacts/elements/icon-pause.jsonindex 9bd526d2..370167d0 100644--- a/registry-artifacts/elements/icon-pause.json+++ b/registry-artifacts/elements/icon-pause.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Pause","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-pause",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M6 21A1 1 0 0 1 5 20V4A1 1 0 0 1 6 3H9A1 1 0 0 1 10 4V20A1 1 0 0 1 9 21H6Z\";\nconst RIGHT_PATH =\n \"M18 21A1 1 0 0 0 19 20V4A1 1 0 0 0 18 3H15A1 1 0 0 0 14 4V20A1 1 0 0 0 15 21H18Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function PauseIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const leftProgress = interpolate(linearDraw, [0, 0.88], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightProgress = interpolate(linearDraw, [0.12, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const left = drawnPathProps(LEFT_PATH, leftProgress);\n const right = drawnPathProps(RIGHT_PATH, rightProgress);\n\n const pinch = interpolate(actionProgress, [0, 0.45, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const squash = interpolate(actionProgress, [0, 0.45, 1], [1, 0.94, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scaleX(${scale}) scaleY(${scale * squash})`,\n }}\n >\n <g transform={`translate(${pinch} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pinch} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PauseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M6 21A1 1 0 0 1 5 20V4A1 1 0 0 1 6 3H9A1 1 0 0 1 10 4V20A1 1 0 0 1 9 21H6Z\";\nconst RIGHT_PATH =\n \"M18 21A1 1 0 0 0 19 20V4A1 1 0 0 0 18 3H15A1 1 0 0 0 14 4V20A1 1 0 0 0 15 21H18Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction PauseIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const leftProgress = interpolate(linearDraw, [0, 0.88], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightProgress = interpolate(linearDraw, [0.12, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const left = drawnPathProps(LEFT_PATH, leftProgress);\n const right = drawnPathProps(RIGHT_PATH, rightProgress);\n\n const pinch = interpolate(actionProgress, [0, 0.45, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const squash = interpolate(actionProgress, [0, 0.45, 1], [1, 0.94, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scaleX(${scale}) scaleY(${scale * squash})`,\n }}\n >\n <g transform={`translate(${pinch} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pinch} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PauseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PauseIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PauseIconBase>;\n\nconst PauseIconInner = forwardRef<\n HTMLDivElement,\n PauseIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PauseIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PauseIconBase\n {...(componentProps as unknown as ComponentProps<typeof PauseIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PauseIcon = Interactive.withSchema({\n Component: PauseIconInner,\n componentName: \"<PauseIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-pencil.json b/registry-artifacts/elements/icon-pencil.jsonindex 13b9759b..2f1318b6 100644--- a/registry-artifacts/elements/icon-pencil.json+++ b/registry-artifacts/elements/icon-pencil.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Pencil","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-pencil",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\";\nconst TIP_PATH = \"M15 5 19 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function PencilIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const tipDraw = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -6, 4, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const nudge = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, 1, -0.5, 0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const tip = drawnPathProps(TIP_PATH, tipDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 3 21) translate(${nudge} 0)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={TIP_PATH}\n strokeDasharray={tip.strokeDasharray}\n strokeDashoffset={tip.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PencilIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={TIP_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\";\nconst TIP_PATH = \"M15 5 19 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction PencilIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const tipDraw = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -6, 4, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const nudge = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, 1, -0.5, 0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const tip = drawnPathProps(TIP_PATH, tipDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 3 21) translate(${nudge} 0)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={TIP_PATH}\n strokeDasharray={tip.strokeDasharray}\n strokeDashoffset={tip.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PencilIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={TIP_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PencilIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PencilIconBase>;\n\nconst PencilIconInner = forwardRef<\n HTMLDivElement,\n PencilIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PencilIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PencilIconBase\n {...(componentProps as unknown as ComponentProps<typeof PencilIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PencilIcon = Interactive.withSchema({\n Component: PencilIconInner,\n componentName: \"<PencilIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-phone.json b/registry-artifacts/elements/icon-phone.jsonindex c5ab7977..0b704ed7 100644--- a/registry-artifacts/elements/icon-phone.json+++ b/registry-artifacts/elements/icon-phone.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Phone","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-phone",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PHONE_PATH =\n \"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nexport function PhoneIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ring = acting\n ? interpolate(\n actionProgress,\n [0, 0.18, 0.4, 0.62, 0.82, 1],\n [0, 10, -8, 5, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const phone = drawnPathProps(PHONE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} ${CENTER} ${CENTER})`}>\n <path\n d={PHONE_PATH}\n strokeDasharray={phone.strokeDasharray}\n strokeDashoffset={phone.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PhoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PHONE_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PHONE_PATH =\n \"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction PhoneIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ring = acting\n ? interpolate(\n actionProgress,\n [0, 0.18, 0.4, 0.62, 0.82, 1],\n [0, 10, -8, 5, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const phone = drawnPathProps(PHONE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} ${CENTER} ${CENTER})`}>\n <path\n d={PHONE_PATH}\n strokeDasharray={phone.strokeDasharray}\n strokeDashoffset={phone.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PhoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PHONE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PhoneIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PhoneIconBase>;\n\nconst PhoneIconInner = forwardRef<\n HTMLDivElement,\n PhoneIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PhoneIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PhoneIconBase\n {...(componentProps as unknown as ComponentProps<typeof PhoneIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PhoneIcon = Interactive.withSchema({\n Component: PhoneIconInner,\n componentName: \"<PhoneIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-play.json b/registry-artifacts/elements/icon-play.jsonindex 09b12701..3e91af50 100644--- a/registry-artifacts/elements/icon-play.json+++ b/registry-artifacts/elements/icon-play.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Play","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-play",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLAY_PATH =\n \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function PlayIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(PLAY_PATH, drawProgress);\n const press = interpolate(\n actionProgress,\n [0, 0.33, 0.66, 1],\n [1, 0.92, 1.1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const nudge = interpolate(actionProgress, [0.33, 0.66, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * press;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={PLAY_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlayIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLAY_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLAY_PATH =\n \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction PlayIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(PLAY_PATH, drawProgress);\n const press = interpolate(\n actionProgress,\n [0, 0.33, 0.66, 1],\n [1, 0.92, 1.1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const nudge = interpolate(actionProgress, [0.33, 0.66, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * press;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={PLAY_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlayIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLAY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlayIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PlayIconBase>;\n\nconst PlayIconInner = forwardRef<\n HTMLDivElement,\n PlayIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PlayIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PlayIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlayIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PlayIcon = Interactive.withSchema({\n Component: PlayIconInner,\n componentName: \"<PlayIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-plus-circle.json b/registry-artifacts/elements/icon-plus-circle.jsonindex 01dec068..a425de12 100644--- a/registry-artifacts/elements/icon-plus-circle.json+++ b/registry-artifacts/elements/icon-plus-circle.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Plus Circle","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-plus-circle",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst H_PATH = \"M8 12h8\";\nconst V_PATH = \"M12 8v8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function PlusCircleIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const hDraw = interpolate(actionProgress, [0.1, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vDraw = interpolate(actionProgress, [0.25, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const hProgress = animation === \"draw\" ? 1 : acting ? hDraw : 0;\n const vProgress = animation === \"draw\" ? 1 : acting ? vDraw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const h = drawnPathProps(H_PATH, hProgress);\n const v = drawnPathProps(V_PATH, vProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={H_PATH}\n strokeDasharray={h.strokeDasharray}\n strokeDashoffset={h.strokeDashoffset}\n />\n <path\n d={V_PATH}\n strokeDasharray={v.strokeDasharray}\n strokeDashoffset={v.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={H_PATH} />\n <path d={V_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst H_PATH = \"M8 12h8\";\nconst V_PATH = \"M12 8v8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction PlusCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const hDraw = interpolate(actionProgress, [0.1, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vDraw = interpolate(actionProgress, [0.25, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const hProgress = animation === \"draw\" ? 1 : acting ? hDraw : 0;\n const vProgress = animation === \"draw\" ? 1 : acting ? vDraw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const h = drawnPathProps(H_PATH, hProgress);\n const v = drawnPathProps(V_PATH, vProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={H_PATH}\n strokeDasharray={h.strokeDasharray}\n strokeDashoffset={h.strokeDashoffset}\n />\n <path\n d={V_PATH}\n strokeDasharray={v.strokeDasharray}\n strokeDashoffset={v.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={H_PATH} />\n <path d={V_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlusCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PlusCircleIconBase>;\n\nconst PlusCircleIconInner = forwardRef<\n HTMLDivElement,\n PlusCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PlusCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PlusCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlusCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PlusCircleIcon = Interactive.withSchema({\n Component: PlusCircleIconInner,\n componentName: \"<PlusCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-plus.json b/registry-artifacts/elements/icon-plus.jsonindex aabe7259..90dc4c09 100644--- a/registry-artifacts/elements/icon-plus.json+++ b/registry-artifacts/elements/icon-plus.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Plus","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-plus",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HORIZONTAL_PATH = \"M5 12h14\";\nconst VERTICAL_PATH = \"M12 5v14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nexport function PlusIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const horizontalProgress = interpolate(linearDraw, [0, 0.571], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const verticalProgress = interpolate(linearDraw, [0.286, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const horizontal = drawnPathProps(HORIZONTAL_PATH, horizontalProgress);\n const vertical = drawnPathProps(VERTICAL_PATH, verticalProgress);\n\n const rotate =\n 90 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 130, mass: 0.8 },\n durationInFrames: 16,\n });\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.15 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={HORIZONTAL_PATH}\n strokeDasharray={horizontal.strokeDasharray}\n strokeDashoffset={horizontal.strokeDashoffset}\n />\n <path\n d={VERTICAL_PATH}\n strokeDasharray={vertical.strokeDasharray}\n strokeDashoffset={vertical.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HORIZONTAL_PATH} />\n <path d={VERTICAL_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HORIZONTAL_PATH = \"M5 12h14\";\nconst VERTICAL_PATH = \"M12 5v14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction PlusIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const horizontalProgress = interpolate(linearDraw, [0, 0.571], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const verticalProgress = interpolate(linearDraw, [0.286, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const horizontal = drawnPathProps(HORIZONTAL_PATH, horizontalProgress);\n const vertical = drawnPathProps(VERTICAL_PATH, verticalProgress);\n\n const rotate =\n 90 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 130, mass: 0.8 },\n durationInFrames: 16,\n });\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.15 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={HORIZONTAL_PATH}\n strokeDasharray={horizontal.strokeDasharray}\n strokeDashoffset={horizontal.strokeDashoffset}\n />\n <path\n d={VERTICAL_PATH}\n strokeDasharray={vertical.strokeDasharray}\n strokeDashoffset={vertical.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HORIZONTAL_PATH} />\n <path d={VERTICAL_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlusIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PlusIconBase>;\n\nconst PlusIconInner = forwardRef<\n HTMLDivElement,\n PlusIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PlusIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PlusIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlusIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PlusIcon = Interactive.withSchema({\n Component: PlusIconInner,\n componentName: \"<PlusIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-refresh-cw.json b/registry-artifacts/elements/icon-refresh-cw.jsonindex 601e8623..9582e114 100644--- a/registry-artifacts/elements/icon-refresh-cw.json+++ b/registry-artifacts/elements/icon-refresh-cw.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Refresh Cw","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-refresh-cw",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_TOP = \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\";\nconst ARROW_TOP = \"M21 3v5h-5\";\nconst ARC_BOTTOM = \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\";\nconst ARROW_BOTTOM = \"M8 16H3v5\";\n\nconst SPIN_EASE = Easing.bezier(0.45, 0, 0.25, 1);\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 55,\n loop: true,\n} as const;\n\nexport function RefreshCwIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowTopPop = interpolate(linearDraw, [0.6, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const arrowBottomPop = interpolate(linearDraw, [0.76, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const arcTop = drawnPathProps(ARC_TOP, arcProgress);\n const arcBottom = drawnPathProps(ARC_BOTTOM, arcProgress);\n\n const resolvedLoop = loop ?? TIMINGS.loop;\n const rotate = resolvedLoop\n ? cycleIndex * 360 +\n interpolate(actionFrame, [0, 44], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: SPIN_EASE,\n })\n : 360 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 44,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={ARC_TOP}\n strokeDasharray={arcTop.strokeDasharray}\n strokeDashoffset={arcTop.strokeDashoffset}\n />\n <path\n d={ARC_BOTTOM}\n strokeDasharray={arcBottom.strokeDasharray}\n strokeDashoffset={arcBottom.strokeDashoffset}\n />\n <g transform={`translate(21 8) scale(${arrowTopPop}) translate(-21 -8)`}>\n <path d={ARROW_TOP} />\n </g>\n <g\n transform={`translate(3 16) scale(${arrowBottomPop}) translate(-3 -16)`}\n >\n <path d={ARROW_BOTTOM} />\n </g>\n </svg>\n );\n}\n\nfunction RefreshCwIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_TOP} />\n <path d={ARROW_TOP} />\n <path d={ARC_BOTTOM} />\n <path d={ARROW_BOTTOM} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_TOP = \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\";\nconst ARROW_TOP = \"M21 3v5h-5\";\nconst ARC_BOTTOM = \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\";\nconst ARROW_BOTTOM = \"M8 16H3v5\";\n\nconst SPIN_EASE = Easing.bezier(0.45, 0, 0.25, 1);\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 55,\n loop: true,\n} as const;\n\nfunction RefreshCwIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowTopPop = interpolate(linearDraw, [0.6, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const arrowBottomPop = interpolate(linearDraw, [0.76, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const arcTop = drawnPathProps(ARC_TOP, arcProgress);\n const arcBottom = drawnPathProps(ARC_BOTTOM, arcProgress);\n\n const resolvedLoop = loop ?? TIMINGS.loop;\n const rotate = resolvedLoop\n ? cycleIndex * 360 +\n interpolate(actionFrame, [0, 44], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: SPIN_EASE,\n })\n : 360 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 44,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={ARC_TOP}\n strokeDasharray={arcTop.strokeDasharray}\n strokeDashoffset={arcTop.strokeDashoffset}\n />\n <path\n d={ARC_BOTTOM}\n strokeDasharray={arcBottom.strokeDasharray}\n strokeDashoffset={arcBottom.strokeDashoffset}\n />\n <g transform={`translate(21 8) scale(${arrowTopPop}) translate(-21 -8)`}>\n <path d={ARROW_TOP} />\n </g>\n <g\n transform={`translate(3 16) scale(${arrowBottomPop}) translate(-3 -16)`}\n >\n <path d={ARROW_BOTTOM} />\n </g>\n </svg>\n );\n}\n\nfunction RefreshCwIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_TOP} />\n <path d={ARROW_TOP} />\n <path d={ARC_BOTTOM} />\n <path d={ARROW_BOTTOM} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype RefreshCwIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RefreshCwIconBase>;\n\nconst RefreshCwIconInner = forwardRef<\n HTMLDivElement,\n RefreshCwIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<RefreshCwIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <RefreshCwIconBase\n {...(componentProps as unknown as ComponentProps<typeof RefreshCwIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RefreshCwIcon = Interactive.withSchema({\n Component: RefreshCwIconInner,\n componentName: \"<RefreshCwIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-rocket.json b/registry-artifacts/elements/icon-rocket.jsonindex 169ee64a..ccf5ffa4 100644--- a/registry-artifacts/elements/icon-rocket.json+++ b/registry-artifacts/elements/icon-rocket.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Rocket","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-rocket",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\";\nconst FIN_RIGHT_PATH = \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\";\nconst FIN_LEFT_PATH = \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\";\nconst FLAME_PATH =\n \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nexport function RocketIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const finsDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flameDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const flicker = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 1.2, 1, 1.18, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const finRight = drawnPathProps(FIN_RIGHT_PATH, acting ? 1 : finsDraw);\n const finLeft = drawnPathProps(FIN_LEFT_PATH, acting ? 1 : finsDraw);\n const flame = drawnPathProps(FLAME_PATH, acting ? 1 : flameDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const flameTransform = `translate(${4.5 * (1 - flicker)} ${18 * (1 - flicker)}) scale(${flicker})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${rise}) rotate(${tilt} 8 20)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FIN_RIGHT_PATH}\n strokeDasharray={finRight.strokeDasharray}\n strokeDashoffset={finRight.strokeDashoffset}\n />\n <path\n d={FIN_LEFT_PATH}\n strokeDasharray={finLeft.strokeDasharray}\n strokeDashoffset={finLeft.strokeDashoffset}\n />\n <g transform={flameTransform}>\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction RocketIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\";\nconst FIN_RIGHT_PATH = \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\";\nconst FIN_LEFT_PATH = \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\";\nconst FLAME_PATH =\n \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction RocketIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const finsDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flameDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const flicker = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 1.2, 1, 1.18, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const finRight = drawnPathProps(FIN_RIGHT_PATH, acting ? 1 : finsDraw);\n const finLeft = drawnPathProps(FIN_LEFT_PATH, acting ? 1 : finsDraw);\n const flame = drawnPathProps(FLAME_PATH, acting ? 1 : flameDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const flameTransform = `translate(${4.5 * (1 - flicker)} ${18 * (1 - flicker)}) scale(${flicker})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${rise}) rotate(${tilt} 8 20)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FIN_RIGHT_PATH}\n strokeDasharray={finRight.strokeDasharray}\n strokeDashoffset={finRight.strokeDashoffset}\n />\n <path\n d={FIN_LEFT_PATH}\n strokeDasharray={finLeft.strokeDasharray}\n strokeDashoffset={finLeft.strokeDashoffset}\n />\n <g transform={flameTransform}>\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction RocketIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype RocketIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RocketIconBase>;\n\nconst RocketIconInner = forwardRef<\n HTMLDivElement,\n RocketIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<RocketIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <RocketIconBase\n {...(componentProps as unknown as ComponentProps<typeof RocketIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RocketIcon = Interactive.withSchema({\n Component: RocketIconInner,\n componentName: \"<RocketIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-save.json b/registry-artifacts/elements/icon-save.jsonindex 5b33ae68..ed33c800 100644--- a/registry-artifacts/elements/icon-save.json+++ b/registry-artifacts/elements/icon-save.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Save","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-save",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISK_PATH =\n \"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\";\nconst LABEL_PATH = \"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\";\nconst SLOT_PATH = \"M7 3v4a1 1 0 0 0 1 1h7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function SaveIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const diskDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const labelDraw = interpolate(linearDraw, [0.444, 0.889], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slotDraw = interpolate(linearDraw, [0.667, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const slotProgress = acting\n ? interpolate(actionProgress, [0.25, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : slotDraw;\n\n const squash = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [1, 0.92, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [0, -1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disk = drawnPathProps(DISK_PATH, diskDraw);\n const label = drawnPathProps(LABEL_PATH, labelDraw);\n const slot = drawnPathProps(SLOT_PATH, slotProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale}) scaleY(${squash})`,\n }}\n >\n <path\n d={DISK_PATH}\n strokeDasharray={disk.strokeDasharray}\n strokeDashoffset={disk.strokeDashoffset}\n />\n <path\n d={LABEL_PATH}\n strokeDasharray={label.strokeDasharray}\n strokeDashoffset={label.strokeDashoffset}\n />\n <path\n d={SLOT_PATH}\n strokeDasharray={slot.strokeDasharray}\n strokeDashoffset={slot.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SaveIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DISK_PATH} />\n <path d={LABEL_PATH} />\n <path d={SLOT_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISK_PATH =\n \"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\";\nconst LABEL_PATH = \"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\";\nconst SLOT_PATH = \"M7 3v4a1 1 0 0 0 1 1h7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction SaveIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const diskDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const labelDraw = interpolate(linearDraw, [0.444, 0.889], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slotDraw = interpolate(linearDraw, [0.667, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const slotProgress = acting\n ? interpolate(actionProgress, [0.25, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : slotDraw;\n\n const squash = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [1, 0.92, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [0, -1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disk = drawnPathProps(DISK_PATH, diskDraw);\n const label = drawnPathProps(LABEL_PATH, labelDraw);\n const slot = drawnPathProps(SLOT_PATH, slotProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale}) scaleY(${squash})`,\n }}\n >\n <path\n d={DISK_PATH}\n strokeDasharray={disk.strokeDasharray}\n strokeDashoffset={disk.strokeDashoffset}\n />\n <path\n d={LABEL_PATH}\n strokeDasharray={label.strokeDasharray}\n strokeDashoffset={label.strokeDashoffset}\n />\n <path\n d={SLOT_PATH}\n strokeDasharray={slot.strokeDasharray}\n strokeDashoffset={slot.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SaveIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DISK_PATH} />\n <path d={LABEL_PATH} />\n <path d={SLOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SaveIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SaveIconBase>;\n\nconst SaveIconInner = forwardRef<\n HTMLDivElement,\n SaveIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SaveIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SaveIconBase\n {...(componentProps as unknown as ComponentProps<typeof SaveIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SaveIcon = Interactive.withSchema({\n Component: SaveIconInner,\n componentName: \"<SaveIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-search.json b/registry-artifacts/elements/icon-search.jsonindex b9828622..9d091e55 100644--- a/registry-artifacts/elements/icon-search.json+++ b/registry-artifacts/elements/icon-search.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Search","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-search",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M11 3 A8 8 0 0 1 19 11 A8 8 0 0 1 11 19 A8 8 0 0 1 3 11 A8 8 0 0 1 11 3\";\nconst HANDLE_DRAW = \"M16.66 16.66 21 21\";\nconst HANDLE_STATIC = \"m21 21-4.34-4.34\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: false,\n} as const;\n\nexport function SearchIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const handleProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const handle = drawnPathProps(HANDLE_DRAW, handleProgress);\n\n const scanEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scanX = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -3, 3, -1, 0],\n scanEase,\n );\n const scanY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, -1, 2, 0],\n scanEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${scanX} ${scanY})`}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={HANDLE_DRAW}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SearchIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d={HANDLE_STATIC} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M11 3 A8 8 0 0 1 19 11 A8 8 0 0 1 11 19 A8 8 0 0 1 3 11 A8 8 0 0 1 11 3\";\nconst HANDLE_DRAW = \"M16.66 16.66 21 21\";\nconst HANDLE_STATIC = \"m21 21-4.34-4.34\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: false,\n} as const;\n\nfunction SearchIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const handleProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const handle = drawnPathProps(HANDLE_DRAW, handleProgress);\n\n const scanEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scanX = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -3, 3, -1, 0],\n scanEase,\n );\n const scanY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, -1, 2, 0],\n scanEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${scanX} ${scanY})`}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={HANDLE_DRAW}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SearchIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d={HANDLE_STATIC} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SearchIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SearchIconBase>;\n\nconst SearchIconInner = forwardRef<\n HTMLDivElement,\n SearchIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SearchIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SearchIconBase\n {...(componentProps as unknown as ComponentProps<typeof SearchIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SearchIcon = Interactive.withSchema({\n Component: SearchIconInner,\n componentName: \"<SearchIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-send.json b/registry-artifacts/elements/icon-send.jsonindex 95e4520e..6ee6ecdb 100644--- a/registry-artifacts/elements/icon-send.json+++ b/registry-artifacts/elements/icon-send.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Send","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-send",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLANE_PATH =\n \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\";\nconst FOLD_PATH = \"m21.854 2.147-10.94 10.939\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function SendIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const planeProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const foldProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const plane = drawnPathProps(PLANE_PATH, planeProgress);\n const fold = drawnPathProps(FOLD_PATH, foldProgress);\n\n const dartEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const tx = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, -1.5, 5, 0],\n dartEase,\n );\n const ty = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 1, -4, 0],\n dartEase,\n );\n const rot = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 2, -12, 0],\n dartEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${tx} ${ty}) rotate(${rot} 12 12)`}>\n <path\n d={PLANE_PATH}\n strokeDasharray={plane.strokeDasharray}\n strokeDashoffset={plane.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SendIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLANE_PATH} />\n <path d={FOLD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLANE_PATH =\n \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\";\nconst FOLD_PATH = \"m21.854 2.147-10.94 10.939\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction SendIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const planeProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const foldProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const plane = drawnPathProps(PLANE_PATH, planeProgress);\n const fold = drawnPathProps(FOLD_PATH, foldProgress);\n\n const dartEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const tx = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, -1.5, 5, 0],\n dartEase,\n );\n const ty = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 1, -4, 0],\n dartEase,\n );\n const rot = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 2, -12, 0],\n dartEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${tx} ${ty}) rotate(${rot} 12 12)`}>\n <path\n d={PLANE_PATH}\n strokeDasharray={plane.strokeDasharray}\n strokeDashoffset={plane.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SendIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLANE_PATH} />\n <path d={FOLD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SendIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SendIconBase>;\n\nconst SendIconInner = forwardRef<\n HTMLDivElement,\n SendIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SendIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SendIconBase\n {...(componentProps as unknown as ComponentProps<typeof SendIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SendIcon = Interactive.withSchema({\n Component: SendIconInner,\n componentName: \"<SendIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-settings.json b/registry-artifacts/elements/icon-settings.jsonindex 22cd7e66..0bf64493 100644--- a/registry-artifacts/elements/icon-settings.json+++ b/registry-artifacts/elements/icon-settings.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Settings","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-settings",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst GEAR_PATH =\n \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\";\nconst CIRCLE_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function SettingsIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const gearProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const circleProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const gear = drawnPathProps(GEAR_PATH, gearProgress);\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n\n const gearRotate =\n 60 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 26,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${gearRotate} 12 12)`}>\n <path\n d={GEAR_PATH}\n strokeDasharray={gear.strokeDasharray}\n strokeDashoffset={gear.strokeDashoffset}\n />\n </g>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SettingsIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={GEAR_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst GEAR_PATH =\n \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\";\nconst CIRCLE_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction SettingsIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const gearProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const circleProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const gear = drawnPathProps(GEAR_PATH, gearProgress);\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n\n const gearRotate =\n 60 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 26,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${gearRotate} 12 12)`}>\n <path\n d={GEAR_PATH}\n strokeDasharray={gear.strokeDasharray}\n strokeDashoffset={gear.strokeDashoffset}\n />\n </g>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SettingsIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={GEAR_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SettingsIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SettingsIconBase>;\n\nconst SettingsIconInner = forwardRef<\n HTMLDivElement,\n SettingsIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SettingsIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SettingsIconBase\n {...(componentProps as unknown as ComponentProps<typeof SettingsIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SettingsIcon = Interactive.withSchema({\n Component: SettingsIconInner,\n componentName: \"<SettingsIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-share-2.json b/registry-artifacts/elements/icon-share-2.jsonindex bb881dfd..bd0a13fc 100644--- a/registry-artifacts/elements/icon-share-2.json+++ b/registry-artifacts/elements/icon-share-2.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Share 2","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-share-2",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_NODE_PATH =\n \"M6 9 A3 3 0 0 1 9 12 A3 3 0 0 1 6 15 A3 3 0 0 1 3 12 A3 3 0 0 1 6 9\";\nconst TOP_NODE_PATH =\n \"M18 2 A3 3 0 0 1 21 5 A3 3 0 0 1 18 8 A3 3 0 0 1 15 5 A3 3 0 0 1 18 2\";\nconst BOTTOM_NODE_PATH =\n \"M18 16 A3 3 0 0 1 21 19 A3 3 0 0 1 18 22 A3 3 0 0 1 15 19 A3 3 0 0 1 18 16\";\nconst TOP_LINE_PATH = \"M8.59 10.49 15.41 6.51\";\nconst BOTTOM_LINE_PATH = \"M8.59 13.51 15.42 17.49\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function Share2Icon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const leftNodeDraw = interpolate(linearDraw, [0, 0.44], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const connectorDraw = interpolate(linearDraw, [0.33, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightNodeDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const topLineProgress = acting\n ? interpolate(actionProgress, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n const bottomLineProgress = acting\n ? interpolate(actionProgress, [0.15, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n\n const topPop = acting\n ? interpolate(actionProgress, [0.3, 0.45, 0.65], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bottomPop = acting\n ? interpolate(actionProgress, [0.45, 0.6, 0.8], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const leftNode = drawnPathProps(LEFT_NODE_PATH, leftNodeDraw);\n const topLine = drawnPathProps(TOP_LINE_PATH, topLineProgress);\n const bottomLine = drawnPathProps(BOTTOM_LINE_PATH, bottomLineProgress);\n const topNode = drawnPathProps(TOP_NODE_PATH, rightNodeDraw);\n const bottomNode = drawnPathProps(BOTTOM_NODE_PATH, rightNodeDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const topTransform = `translate(${18 * (1 - topPop)} ${5 * (1 - topPop)}) scale(${topPop})`;\n const bottomTransform = `translate(${18 * (1 - bottomPop)} ${19 * (1 - bottomPop)}) scale(${bottomPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={LEFT_NODE_PATH}\n strokeDasharray={leftNode.strokeDasharray}\n strokeDashoffset={leftNode.strokeDashoffset}\n />\n <path\n d={TOP_LINE_PATH}\n strokeDasharray={topLine.strokeDasharray}\n strokeDashoffset={topLine.strokeDashoffset}\n />\n <path\n d={BOTTOM_LINE_PATH}\n strokeDasharray={bottomLine.strokeDasharray}\n strokeDashoffset={bottomLine.strokeDashoffset}\n />\n <g transform={topTransform}>\n <path\n d={TOP_NODE_PATH}\n strokeDasharray={topNode.strokeDasharray}\n strokeDashoffset={topNode.strokeDashoffset}\n />\n </g>\n <g transform={bottomTransform}>\n <path\n d={BOTTOM_NODE_PATH}\n strokeDasharray={bottomNode.strokeDasharray}\n strokeDashoffset={bottomNode.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Share2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_NODE_PATH =\n \"M6 9 A3 3 0 0 1 9 12 A3 3 0 0 1 6 15 A3 3 0 0 1 3 12 A3 3 0 0 1 6 9\";\nconst TOP_NODE_PATH =\n \"M18 2 A3 3 0 0 1 21 5 A3 3 0 0 1 18 8 A3 3 0 0 1 15 5 A3 3 0 0 1 18 2\";\nconst BOTTOM_NODE_PATH =\n \"M18 16 A3 3 0 0 1 21 19 A3 3 0 0 1 18 22 A3 3 0 0 1 15 19 A3 3 0 0 1 18 16\";\nconst TOP_LINE_PATH = \"M8.59 10.49 15.41 6.51\";\nconst BOTTOM_LINE_PATH = \"M8.59 13.51 15.42 17.49\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction Share2IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const leftNodeDraw = interpolate(linearDraw, [0, 0.44], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const connectorDraw = interpolate(linearDraw, [0.33, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightNodeDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const topLineProgress = acting\n ? interpolate(actionProgress, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n const bottomLineProgress = acting\n ? interpolate(actionProgress, [0.15, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n\n const topPop = acting\n ? interpolate(actionProgress, [0.3, 0.45, 0.65], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bottomPop = acting\n ? interpolate(actionProgress, [0.45, 0.6, 0.8], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const leftNode = drawnPathProps(LEFT_NODE_PATH, leftNodeDraw);\n const topLine = drawnPathProps(TOP_LINE_PATH, topLineProgress);\n const bottomLine = drawnPathProps(BOTTOM_LINE_PATH, bottomLineProgress);\n const topNode = drawnPathProps(TOP_NODE_PATH, rightNodeDraw);\n const bottomNode = drawnPathProps(BOTTOM_NODE_PATH, rightNodeDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const topTransform = `translate(${18 * (1 - topPop)} ${5 * (1 - topPop)}) scale(${topPop})`;\n const bottomTransform = `translate(${18 * (1 - bottomPop)} ${19 * (1 - bottomPop)}) scale(${bottomPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={LEFT_NODE_PATH}\n strokeDasharray={leftNode.strokeDasharray}\n strokeDashoffset={leftNode.strokeDashoffset}\n />\n <path\n d={TOP_LINE_PATH}\n strokeDasharray={topLine.strokeDasharray}\n strokeDashoffset={topLine.strokeDashoffset}\n />\n <path\n d={BOTTOM_LINE_PATH}\n strokeDasharray={bottomLine.strokeDasharray}\n strokeDashoffset={bottomLine.strokeDashoffset}\n />\n <g transform={topTransform}>\n <path\n d={TOP_NODE_PATH}\n strokeDasharray={topNode.strokeDasharray}\n strokeDashoffset={topNode.strokeDashoffset}\n />\n </g>\n <g transform={bottomTransform}>\n <path\n d={BOTTOM_NODE_PATH}\n strokeDasharray={bottomNode.strokeDasharray}\n strokeDashoffset={bottomNode.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Share2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype Share2IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof Share2IconBase>;\n\nconst Share2IconInner = forwardRef<\n HTMLDivElement,\n Share2IconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Share2Icon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <Share2IconBase\n {...(componentProps as unknown as ComponentProps<typeof Share2IconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Share2Icon = Interactive.withSchema({\n Component: Share2IconInner,\n componentName: \"<Share2Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-shield.json b/registry-artifacts/elements/icon-shield.jsonindex 8d42d72a..62c1472b 100644--- a/registry-artifacts/elements/icon-shield.json+++ b/registry-artifacts/elements/icon-shield.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shield","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-shield",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHIELD_PATH =\n \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function ShieldIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const brace = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const lean = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shield = drawnPathProps(SHIELD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`rotate(${lean} ${CENTER} ${CENTER}) translate(${CENTER * (1 - brace)} ${CENTER * (1 - brace)}) scale(${brace})`}\n >\n <path\n d={SHIELD_PATH}\n strokeDasharray={shield.strokeDasharray}\n strokeDashoffset={shield.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ShieldIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHIELD_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHIELD_PATH =\n \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction ShieldIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const brace = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const lean = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shield = drawnPathProps(SHIELD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`rotate(${lean} ${CENTER} ${CENTER}) translate(${CENTER * (1 - brace)} ${CENTER * (1 - brace)}) scale(${brace})`}\n >\n <path\n d={SHIELD_PATH}\n strokeDasharray={shield.strokeDasharray}\n strokeDashoffset={shield.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ShieldIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHIELD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ShieldIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShieldIconBase>;\n\nconst ShieldIconInner = forwardRef<\n HTMLDivElement,\n ShieldIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShieldIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShieldIconBase\n {...(componentProps as unknown as ComponentProps<typeof ShieldIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShieldIcon = Interactive.withSchema({\n Component: ShieldIconInner,\n componentName: \"<ShieldIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-shopping-cart.json b/registry-artifacts/elements/icon-shopping-cart.jsonindex b5afa25c..c731bc8b 100644--- a/registry-artifacts/elements/icon-shopping-cart.json+++ b/registry-artifacts/elements/icon-shopping-cart.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shopping Cart","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-shopping-cart",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\";\nconst BACK_WHEEL_PATH = \"M8 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\nconst FRONT_WHEEL_PATH = \"M19 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\n\nconst BACK_CX = 8;\nconst FRONT_CX = 19;\nconst WHEEL_CY = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function ShoppingCartIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const wheelsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rollX = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const backPop = acting\n ? interpolate(actionProgress, [0.5, 0.65, 0.85], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const frontPop = acting\n ? interpolate(actionProgress, [0.6, 0.75, 0.95], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const backWheel = drawnPathProps(BACK_WHEEL_PATH, acting ? 1 : wheelsDraw);\n const frontWheel = drawnPathProps(FRONT_WHEEL_PATH, acting ? 1 : wheelsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const backTransform = `translate(${BACK_CX * (1 - backPop)} ${WHEEL_CY * (1 - backPop)}) scale(${backPop})`;\n const frontTransform = `translate(${FRONT_CX * (1 - frontPop)} ${WHEEL_CY * (1 - frontPop)}) scale(${frontPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${rollX} 0) rotate(${tilt} 12 12)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={backTransform}>\n <path\n d={BACK_WHEEL_PATH}\n strokeDasharray={backWheel.strokeDasharray}\n strokeDashoffset={backWheel.strokeDashoffset}\n />\n </g>\n <g transform={frontTransform}>\n <path\n d={FRONT_WHEEL_PATH}\n strokeDasharray={frontWheel.strokeDasharray}\n strokeDashoffset={frontWheel.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction ShoppingCartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"21\" r=\"1\" />\n <circle cx=\"19\" cy=\"21\" r=\"1\" />\n <path d={BODY_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\";\nconst BACK_WHEEL_PATH = \"M8 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\nconst FRONT_WHEEL_PATH = \"M19 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\n\nconst BACK_CX = 8;\nconst FRONT_CX = 19;\nconst WHEEL_CY = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction ShoppingCartIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const wheelsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rollX = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const backPop = acting\n ? interpolate(actionProgress, [0.5, 0.65, 0.85], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const frontPop = acting\n ? interpolate(actionProgress, [0.6, 0.75, 0.95], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const backWheel = drawnPathProps(BACK_WHEEL_PATH, acting ? 1 : wheelsDraw);\n const frontWheel = drawnPathProps(FRONT_WHEEL_PATH, acting ? 1 : wheelsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const backTransform = `translate(${BACK_CX * (1 - backPop)} ${WHEEL_CY * (1 - backPop)}) scale(${backPop})`;\n const frontTransform = `translate(${FRONT_CX * (1 - frontPop)} ${WHEEL_CY * (1 - frontPop)}) scale(${frontPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${rollX} 0) rotate(${tilt} 12 12)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={backTransform}>\n <path\n d={BACK_WHEEL_PATH}\n strokeDasharray={backWheel.strokeDasharray}\n strokeDashoffset={backWheel.strokeDashoffset}\n />\n </g>\n <g transform={frontTransform}>\n <path\n d={FRONT_WHEEL_PATH}\n strokeDasharray={frontWheel.strokeDasharray}\n strokeDashoffset={frontWheel.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction ShoppingCartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"21\" r=\"1\" />\n <circle cx=\"19\" cy=\"21\" r=\"1\" />\n <path d={BODY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ShoppingCartIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShoppingCartIconBase>;\n\nconst ShoppingCartIconInner = forwardRef<\n HTMLDivElement,\n ShoppingCartIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShoppingCartIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShoppingCartIconBase\n {...(componentProps as unknown as ComponentProps<typeof ShoppingCartIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShoppingCartIcon = Interactive.withSchema({\n Component: ShoppingCartIconInner,\n componentName: \"<ShoppingCartIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-skip-forward.json b/registry-artifacts/elements/icon-skip-forward.jsonindex 0dd6cd7a..11e33110 100644--- a/registry-artifacts/elements/icon-skip-forward.json+++ b/registry-artifacts/elements/icon-skip-forward.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Skip Forward","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-skip-forward",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z\";\nconst BAR_PATH = \"M21 4v16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function SkipForwardIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const barProgress = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const bar = drawnPathProps(BAR_PATH, barProgress);\n\n const dash = interpolate(\n actionProgress,\n [0, 0.2, 0.6, 0.82, 1],\n [0, -1.2, 2, -0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const squeeze = interpolate(actionProgress, [0.45, 0.6, 0.78], [1, 0.96, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const shove = interpolate(actionProgress, [0.55, 0.62, 1], [0, 0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(${dash} 0) scale(${squeeze} 1)`}\n style={{ transformOrigin: \"16px 12px\" }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${shove} 0)`}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SkipForwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BAR_PATH} />\n <path d={TRIANGLE_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z\";\nconst BAR_PATH = \"M21 4v16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction SkipForwardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const barProgress = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const bar = drawnPathProps(BAR_PATH, barProgress);\n\n const dash = interpolate(\n actionProgress,\n [0, 0.2, 0.6, 0.82, 1],\n [0, -1.2, 2, -0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const squeeze = interpolate(actionProgress, [0.45, 0.6, 0.78], [1, 0.96, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const shove = interpolate(actionProgress, [0.55, 0.62, 1], [0, 0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(${dash} 0) scale(${squeeze} 1)`}\n style={{ transformOrigin: \"16px 12px\" }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${shove} 0)`}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SkipForwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BAR_PATH} />\n <path d={TRIANGLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SkipForwardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SkipForwardIconBase>;\n\nconst SkipForwardIconInner = forwardRef<\n HTMLDivElement,\n SkipForwardIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SkipForwardIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SkipForwardIconBase\n {...(componentProps as unknown as ComponentProps<typeof SkipForwardIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SkipForwardIcon = Interactive.withSchema({\n Component: SkipForwardIconInner,\n componentName: \"<SkipForwardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-smartphone.json b/registry-artifacts/elements/icon-smartphone.jsonindex 86fe5388..37384986 100644--- a/registry-artifacts/elements/icon-smartphone.json+++ b/registry-artifacts/elements/icon-smartphone.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Smartphone","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-smartphone",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M7 2H17A2 2 0 0 1 19 4V20A2 2 0 0 1 17 22H7A2 2 0 0 1 5 20V4A2 2 0 0 1 7 2Z\";\nconst BUTTON_PATH = \"M12 18h.01\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function SmartphoneIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buzz = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.45, 0.7, 0.9, 1],\n [0, 3, -3, 2, -1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${buzz} ${CENTER} ${CENTER})`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SmartphoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"20\" x=\"5\" y=\"2\" rx=\"2\" ry=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M7 2H17A2 2 0 0 1 19 4V20A2 2 0 0 1 17 22H7A2 2 0 0 1 5 20V4A2 2 0 0 1 7 2Z\";\nconst BUTTON_PATH = \"M12 18h.01\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction SmartphoneIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buzz = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.45, 0.7, 0.9, 1],\n [0, 3, -3, 2, -1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${buzz} ${CENTER} ${CENTER})`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SmartphoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"20\" x=\"5\" y=\"2\" rx=\"2\" ry=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SmartphoneIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SmartphoneIconBase>;\n\nconst SmartphoneIconInner = forwardRef<\n HTMLDivElement,\n SmartphoneIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SmartphoneIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SmartphoneIconBase\n {...(componentProps as unknown as ComponentProps<typeof SmartphoneIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SmartphoneIcon = Interactive.withSchema({\n Component: SmartphoneIconInner,\n componentName: \"<SmartphoneIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-sparkles.json b/registry-artifacts/elements/icon-sparkles.jsonindex fb7a0dc3..1c766dc5 100644--- a/registry-artifacts/elements/icon-sparkles.json+++ b/registry-artifacts/elements/icon-sparkles.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Sparkles","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-sparkles",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MAIN_PATH =\n \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\";\nconst ACCENT_TR_V = \"M20 2v4\";\nconst ACCENT_TR_H = \"M22 4h-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nexport function SparklesIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const popTR = interpolate(linearDraw, [0.55, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const popBL = interpolate(linearDraw, [0.857, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const main = drawnPathProps(MAIN_PATH, mainProgress);\n\n const mainPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 0.7, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallOpacity = interpolate(actionProgress, [0, 0.5, 1], [1, 0.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const trScale = popTR * smallPulse;\n const blScale = popBL * smallPulse;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(12 12) scale(${mainPulse}) translate(-12 -12)`}>\n <path\n d={MAIN_PATH}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(20 4) scale(${trScale}) translate(-20 -4)`}\n >\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(4 20) scale(${blScale}) translate(-4 -20)`}\n >\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </g>\n </svg>\n );\n}\n\nfunction SparklesIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MAIN_PATH} />\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MAIN_PATH =\n \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\";\nconst ACCENT_TR_V = \"M20 2v4\";\nconst ACCENT_TR_H = \"M22 4h-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nfunction SparklesIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const popTR = interpolate(linearDraw, [0.55, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const popBL = interpolate(linearDraw, [0.857, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const main = drawnPathProps(MAIN_PATH, mainProgress);\n\n const mainPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 0.7, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallOpacity = interpolate(actionProgress, [0, 0.5, 1], [1, 0.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const trScale = popTR * smallPulse;\n const blScale = popBL * smallPulse;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(12 12) scale(${mainPulse}) translate(-12 -12)`}>\n <path\n d={MAIN_PATH}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(20 4) scale(${trScale}) translate(-20 -4)`}\n >\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(4 20) scale(${blScale}) translate(-4 -20)`}\n >\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </g>\n </svg>\n );\n}\n\nfunction SparklesIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MAIN_PATH} />\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SparklesIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SparklesIconBase>;\n\nconst SparklesIconInner = forwardRef<\n HTMLDivElement,\n SparklesIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SparklesIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SparklesIconBase\n {...(componentProps as unknown as ComponentProps<typeof SparklesIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SparklesIcon = Interactive.withSchema({\n Component: SparklesIconInner,\n componentName: \"<SparklesIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-star.json b/registry-artifacts/elements/icon-star.jsonindex 20feb68f..eb61d957 100644--- a/registry-artifacts/elements/icon-star.json+++ b/registry-artifacts/elements/icon-star.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Star","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-star",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STAR_PATH =\n \"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function StarIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const starProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const star = drawnPathProps(STAR_PATH, starProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 12, stiffness: 140, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -8 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={STAR_PATH}\n strokeDasharray={star.strokeDasharray}\n strokeDashoffset={star.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction StarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAR_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STAR_PATH =\n \"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction StarIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const starProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const star = drawnPathProps(STAR_PATH, starProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 12, stiffness: 140, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -8 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={STAR_PATH}\n strokeDasharray={star.strokeDasharray}\n strokeDashoffset={star.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction StarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype StarIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof StarIconBase>;\n\nconst StarIconInner = forwardRef<\n HTMLDivElement,\n StarIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<StarIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <StarIconBase\n {...(componentProps as unknown as ComponentProps<typeof StarIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const StarIcon = Interactive.withSchema({\n Component: StarIconInner,\n componentName: \"<StarIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-sun.json b/registry-artifacts/elements/icon-sun.jsonindex f555be53..cf146910 100644--- a/registry-artifacts/elements/icon-sun.json+++ b/registry-artifacts/elements/icon-sun.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Sun","durationInFrames": 85,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-sun",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CORE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\n\nconst RAYS = [\n \"M12 4 12 2\",\n \"M17.66 6.34 19.07 4.93\",\n \"M20 12 22 12\",\n \"M17.66 17.66 19.07 19.07\",\n \"M12 20 12 22\",\n \"M6.34 17.66 4.93 19.07\",\n \"M4 12 2 12\",\n \"M6.34 6.34 4.93 4.93\",\n];\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nexport function SunIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const corePop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const core = drawnPathProps(CORE_PATH, drawProgress);\n\n const rays = RAYS.map((d, i) => {\n const start = i * 0.07;\n const rayFan = interpolate(actionProgress, [start, start + 0.28], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const progress = animation === \"draw\" ? 1 : acting ? rayFan : 0;\n return { d, ...drawnPathProps(d, progress) };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const coreTransform = `translate(${CENTER * (1 - corePop)} ${CENTER * (1 - corePop)}) scale(${corePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {rays.map((ray) => (\n <path\n key={ray.d}\n d={ray.d}\n strokeDasharray={ray.strokeDasharray}\n strokeDashoffset={ray.strokeDashoffset}\n />\n ))}\n <g transform={coreTransform}>\n <path\n d={CORE_PATH}\n strokeDasharray={core.strokeDasharray}\n strokeDashoffset={core.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SunIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CORE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\n\nconst RAYS = [\n \"M12 4 12 2\",\n \"M17.66 6.34 19.07 4.93\",\n \"M20 12 22 12\",\n \"M17.66 17.66 19.07 19.07\",\n \"M12 20 12 22\",\n \"M6.34 17.66 4.93 19.07\",\n \"M4 12 2 12\",\n \"M6.34 6.34 4.93 4.93\",\n];\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction SunIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const corePop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const core = drawnPathProps(CORE_PATH, drawProgress);\n\n const rays = RAYS.map((d, i) => {\n const start = i * 0.07;\n const rayFan = interpolate(actionProgress, [start, start + 0.28], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const progress = animation === \"draw\" ? 1 : acting ? rayFan : 0;\n return { d, ...drawnPathProps(d, progress) };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const coreTransform = `translate(${CENTER * (1 - corePop)} ${CENTER * (1 - corePop)}) scale(${corePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {rays.map((ray) => (\n <path\n key={ray.d}\n d={ray.d}\n strokeDasharray={ray.strokeDasharray}\n strokeDashoffset={ray.strokeDashoffset}\n />\n ))}\n <g transform={coreTransform}>\n <path\n d={CORE_PATH}\n strokeDasharray={core.strokeDasharray}\n strokeDashoffset={core.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SunIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SunIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SunIconBase>;\n\nconst SunIconInner = forwardRef<\n HTMLDivElement,\n SunIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SunIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SunIconBase\n {...(componentProps as unknown as ComponentProps<typeof SunIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SunIcon = Interactive.withSchema({\n Component: SunIconInner,\n componentName: \"<SunIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 85}diff --git a/registry-artifacts/elements/icon-tag.json b/registry-artifacts/elements/icon-tag.jsonindex f9f7dd60..89861426 100644--- a/registry-artifacts/elements/icon-tag.json+++ b/registry-artifacts/elements/icon-tag.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Tag","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-tag",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TAG_PATH =\n \"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\";\n\nconst HOLE_X = 7.5;\nconst HOLE_Y = 7.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function TagIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const holeScale = acting\n ? 1\n : interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const swing = acting\n ? interpolate(actionProgress, [0, 0.2, 0.45, 0.7, 1], [0, 8, -6, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const tag = drawnPathProps(TAG_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const holeTransform = `translate(${HOLE_X * (1 - holeScale)} ${HOLE_Y * (1 - holeScale)}) scale(${holeScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${HOLE_X} ${HOLE_Y})`}>\n <path\n d={TAG_PATH}\n strokeDasharray={tag.strokeDasharray}\n strokeDashoffset={tag.strokeDashoffset}\n />\n <g transform={holeTransform}>\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TagIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TAG_PATH} />\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TAG_PATH =\n \"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\";\n\nconst HOLE_X = 7.5;\nconst HOLE_Y = 7.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction TagIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const holeScale = acting\n ? 1\n : interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const swing = acting\n ? interpolate(actionProgress, [0, 0.2, 0.45, 0.7, 1], [0, 8, -6, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const tag = drawnPathProps(TAG_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const holeTransform = `translate(${HOLE_X * (1 - holeScale)} ${HOLE_Y * (1 - holeScale)}) scale(${holeScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${HOLE_X} ${HOLE_Y})`}>\n <path\n d={TAG_PATH}\n strokeDasharray={tag.strokeDasharray}\n strokeDashoffset={tag.strokeDashoffset}\n />\n <g transform={holeTransform}>\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TagIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TAG_PATH} />\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TagIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TagIconBase>;\n\nconst TagIconInner = forwardRef<\n HTMLDivElement,\n TagIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TagIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TagIconBase\n {...(componentProps as unknown as ComponentProps<typeof TagIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TagIcon = Interactive.withSchema({\n Component: TagIconInner,\n componentName: \"<TagIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-target.json b/registry-artifacts/elements/icon-target.jsonindex 5280e92a..c2f94703 100644--- a/registry-artifacts/elements/icon-target.json+++ b/registry-artifacts/elements/icon-target.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Target","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-target",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_OUTER = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst RING_MID = \"M12 6a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RING_INNER = \"M12 10a2 2 0 1 0 0 4 2 2 0 1 0 0-4Z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function TargetIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outerDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.28, 0.83], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.6], [1, 1.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.6, 0.68, 0.78, 0.88, 1],\n [0, 0.6, -0.6, 0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const outer = drawnPathProps(RING_OUTER, acting ? 1 : outerDraw);\n const mid = drawnPathProps(RING_MID, acting ? 1 : midDraw);\n const inner = drawnPathProps(RING_INNER, acting ? 1 : innerDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${shake} 0)`}>\n <path\n d={RING_OUTER}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n <path\n d={RING_MID}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={RING_INNER}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TargetIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_OUTER = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst RING_MID = \"M12 6a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RING_INNER = \"M12 10a2 2 0 1 0 0 4 2 2 0 1 0 0-4Z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TargetIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outerDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.28, 0.83], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.6], [1, 1.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.6, 0.68, 0.78, 0.88, 1],\n [0, 0.6, -0.6, 0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const outer = drawnPathProps(RING_OUTER, acting ? 1 : outerDraw);\n const mid = drawnPathProps(RING_MID, acting ? 1 : midDraw);\n const inner = drawnPathProps(RING_INNER, acting ? 1 : innerDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${shake} 0)`}>\n <path\n d={RING_OUTER}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n <path\n d={RING_MID}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={RING_INNER}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TargetIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TargetIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TargetIconBase>;\n\nconst TargetIconInner = forwardRef<\n HTMLDivElement,\n TargetIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TargetIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TargetIconBase\n {...(componentProps as unknown as ComponentProps<typeof TargetIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TargetIcon = Interactive.withSchema({\n Component: TargetIconInner,\n componentName: \"<TargetIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-terminal.json b/registry-artifacts/elements/icon-terminal.jsonindex c4b1359c..34adeaf7 100644--- a/registry-artifacts/elements/icon-terminal.json+++ b/registry-artifacts/elements/icon-terminal.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Terminal","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-terminal",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M4 17 10 11 4 5\";\nconst CURSOR_PATH = \"M12 19H20\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 32,\n loop: false,\n} as const;\n\nexport function TerminalIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const chevronDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cursorDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const nudge = acting\n ? interpolate(actionProgress, [0, 0.15, 0.35], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const cursorOpacity = acting\n ? interpolate(\n actionProgress,\n [0.3, 0.42, 0.54, 0.66, 0.78],\n [1, 0, 1, 0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n )\n : 1;\n\n const chevron = drawnPathProps(CHEVRON_PATH, acting ? 1 : chevronDraw);\n const cursor = drawnPathProps(CURSOR_PATH, acting ? 1 : cursorDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudge} 0)`}>\n <path\n d={CHEVRON_PATH}\n strokeDasharray={chevron.strokeDasharray}\n strokeDashoffset={chevron.strokeDashoffset}\n />\n </g>\n <path\n d={CURSOR_PATH}\n strokeDasharray={cursor.strokeDasharray}\n strokeDashoffset={cursor.strokeDashoffset}\n opacity={cursorOpacity}\n />\n </svg>\n );\n}\n\nfunction TerminalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M4 17 10 11 4 5\";\nconst CURSOR_PATH = \"M12 19H20\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 32,\n loop: false,\n} as const;\n\nfunction TerminalIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const chevronDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cursorDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const nudge = acting\n ? interpolate(actionProgress, [0, 0.15, 0.35], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const cursorOpacity = acting\n ? interpolate(\n actionProgress,\n [0.3, 0.42, 0.54, 0.66, 0.78],\n [1, 0, 1, 0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n )\n : 1;\n\n const chevron = drawnPathProps(CHEVRON_PATH, acting ? 1 : chevronDraw);\n const cursor = drawnPathProps(CURSOR_PATH, acting ? 1 : cursorDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudge} 0)`}>\n <path\n d={CHEVRON_PATH}\n strokeDasharray={chevron.strokeDasharray}\n strokeDashoffset={chevron.strokeDashoffset}\n />\n </g>\n <path\n d={CURSOR_PATH}\n strokeDasharray={cursor.strokeDasharray}\n strokeDashoffset={cursor.strokeDashoffset}\n opacity={cursorOpacity}\n />\n </svg>\n );\n}\n\nfunction TerminalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TerminalIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TerminalIconBase>;\n\nconst TerminalIconInner = forwardRef<\n HTMLDivElement,\n TerminalIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TerminalIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TerminalIconBase\n {...(componentProps as unknown as ComponentProps<typeof TerminalIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TerminalIcon = Interactive.withSchema({\n Component: TerminalIconInner,\n componentName: \"<TerminalIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-thumbs-up.json b/registry-artifacts/elements/icon-thumbs-up.jsonindex cba19704..275f1978 100644--- a/registry-artifacts/elements/icon-thumbs-up.json+++ b/registry-artifacts/elements/icon-thumbs-up.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Thumbs Up","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-thumbs-up",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HAND_PATH =\n \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\";\nconst CUFF_PATH = \"M7 10v12\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function ThumbsUpIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const handProgress = interpolate(linearDraw, [0.25, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cuffProgress = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const hand = drawnPathProps(HAND_PATH, handProgress);\n const cuff = drawnPathProps(CUFF_PATH, cuffProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 11, stiffness: 150, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -18 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 4 22)`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n <path\n d={CUFF_PATH}\n strokeDasharray={cuff.strokeDasharray}\n strokeDashoffset={cuff.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ThumbsUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HAND_PATH} />\n <path d={CUFF_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HAND_PATH =\n \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\";\nconst CUFF_PATH = \"M7 10v12\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction ThumbsUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const handProgress = interpolate(linearDraw, [0.25, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cuffProgress = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const hand = drawnPathProps(HAND_PATH, handProgress);\n const cuff = drawnPathProps(CUFF_PATH, cuffProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 11, stiffness: 150, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -18 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 4 22)`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n <path\n d={CUFF_PATH}\n strokeDasharray={cuff.strokeDasharray}\n strokeDashoffset={cuff.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ThumbsUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HAND_PATH} />\n <path d={CUFF_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ThumbsUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ThumbsUpIconBase>;\n\nconst ThumbsUpIconInner = forwardRef<\n HTMLDivElement,\n ThumbsUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ThumbsUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ThumbsUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ThumbsUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ThumbsUpIcon = Interactive.withSchema({\n Component: ThumbsUpIconInner,\n componentName: \"<ThumbsUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-timer.json b/registry-artifacts/elements/icon-timer.jsonindex 44011995..39ac4a0e 100644--- a/registry-artifacts/elements/icon-timer.json+++ b/registry-artifacts/elements/icon-timer.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Timer","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-timer",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DIAL_PATH = \"M12 6a8 8 0 1 0 0 16 8 8 0 1 0 0-16Z\";\nconst BUTTON_PATH = \"M10 2H14\";\nconst HAND_PATH = \"M12 14 15 11\";\n\nconst DIAL_CX = 12;\nconst DIAL_CY = 14;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 48,\n loop: false,\n} as const;\n\nexport function TimerIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const dialDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.45, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buttonDip = acting\n ? interpolate(actionProgress, [0, 0.15, 0.3], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const handSweep = acting\n ? interpolate(actionProgress, [0.3, 1], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n })\n : 0;\n\n const dial = drawnPathProps(DIAL_PATH, acting ? 1 : dialDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n const hand = drawnPathProps(HAND_PATH, acting ? 1 : handDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DIAL_PATH}\n strokeDasharray={dial.strokeDasharray}\n strokeDashoffset={dial.strokeDashoffset}\n />\n <g transform={`translate(0 ${buttonDip})`}>\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n <g transform={`rotate(${handSweep} ${DIAL_CX} ${DIAL_CY})`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TimerIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DIAL_PATH = \"M12 6a8 8 0 1 0 0 16 8 8 0 1 0 0-16Z\";\nconst BUTTON_PATH = \"M10 2H14\";\nconst HAND_PATH = \"M12 14 15 11\";\n\nconst DIAL_CX = 12;\nconst DIAL_CY = 14;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 48,\n loop: false,\n} as const;\n\nfunction TimerIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const dialDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.45, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buttonDip = acting\n ? interpolate(actionProgress, [0, 0.15, 0.3], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const handSweep = acting\n ? interpolate(actionProgress, [0.3, 1], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n })\n : 0;\n\n const dial = drawnPathProps(DIAL_PATH, acting ? 1 : dialDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n const hand = drawnPathProps(HAND_PATH, acting ? 1 : handDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DIAL_PATH}\n strokeDasharray={dial.strokeDasharray}\n strokeDashoffset={dial.strokeDashoffset}\n />\n <g transform={`translate(0 ${buttonDip})`}>\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n <g transform={`rotate(${handSweep} ${DIAL_CX} ${DIAL_CY})`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TimerIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TimerIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TimerIconBase>;\n\nconst TimerIconInner = forwardRef<\n HTMLDivElement,\n TimerIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TimerIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TimerIconBase\n {...(componentProps as unknown as ComponentProps<typeof TimerIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TimerIcon = Interactive.withSchema({\n Component: TimerIconInner,\n componentName: \"<TimerIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/icon-trash.json b/registry-artifacts/elements/icon-trash.jsonindex a1c090e5..c6f4efc3 100644--- a/registry-artifacts/elements/icon-trash.json+++ b/registry-artifacts/elements/icon-trash.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Trash","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-trash",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH = \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\";\nconst INNER1_PATH = \"M10 11v6\";\nconst INNER2_PATH = \"M14 11v6\";\nconst LID_PATH = \"M3 6h18\";\nconst HANDLE_PATH = \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function TrashIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const innerProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const inner1 = drawnPathProps(INNER1_PATH, innerProgress);\n const inner2 = drawnPathProps(INNER2_PATH, innerProgress);\n const lid = drawnPathProps(LID_PATH, lidProgress);\n const handle = drawnPathProps(HANDLE_PATH, lidProgress);\n\n const lidRotate = interpolate(actionProgress, [0, 0.4, 1], [0, -14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const lidLift = interpolate(actionProgress, [0, 0.4, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={INNER1_PATH}\n strokeDasharray={inner1.strokeDasharray}\n strokeDashoffset={inner1.strokeDashoffset}\n />\n <path\n d={INNER2_PATH}\n strokeDasharray={inner2.strokeDasharray}\n strokeDashoffset={inner2.strokeDashoffset}\n />\n <g transform={`translate(0 ${lidLift}) rotate(${lidRotate} 3 6)`}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={HANDLE_PATH}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrashIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={INNER1_PATH} />\n <path d={INNER2_PATH} />\n <path d={BODY_PATH} />\n <path d={LID_PATH} />\n <path d={HANDLE_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH = \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\";\nconst INNER1_PATH = \"M10 11v6\";\nconst INNER2_PATH = \"M14 11v6\";\nconst LID_PATH = \"M3 6h18\";\nconst HANDLE_PATH = \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TrashIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const innerProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const inner1 = drawnPathProps(INNER1_PATH, innerProgress);\n const inner2 = drawnPathProps(INNER2_PATH, innerProgress);\n const lid = drawnPathProps(LID_PATH, lidProgress);\n const handle = drawnPathProps(HANDLE_PATH, lidProgress);\n\n const lidRotate = interpolate(actionProgress, [0, 0.4, 1], [0, -14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const lidLift = interpolate(actionProgress, [0, 0.4, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={INNER1_PATH}\n strokeDasharray={inner1.strokeDasharray}\n strokeDashoffset={inner1.strokeDashoffset}\n />\n <path\n d={INNER2_PATH}\n strokeDasharray={inner2.strokeDasharray}\n strokeDashoffset={inner2.strokeDashoffset}\n />\n <g transform={`translate(0 ${lidLift}) rotate(${lidRotate} 3 6)`}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={HANDLE_PATH}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrashIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={INNER1_PATH} />\n <path d={INNER2_PATH} />\n <path d={BODY_PATH} />\n <path d={LID_PATH} />\n <path d={HANDLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrashIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrashIconBase>;\n\nconst TrashIconInner = forwardRef<\n HTMLDivElement,\n TrashIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TrashIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TrashIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrashIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrashIcon = Interactive.withSchema({\n Component: TrashIconInner,\n componentName: \"<TrashIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-trending-down.json b/registry-artifacts/elements/icon-trending-down.jsonindex 928b035e..7669f8c6 100644--- a/registry-artifacts/elements/icon-trending-down.json+++ b/registry-artifacts/elements/icon-trending-down.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Trending Down","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-trending-down",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 7 8.5 13.5 13.5 8.5 22 17\";\nconst ARROW_PATH = \"M16 17H22V11\";\n\nconst LOW_X = 22;\nconst LOW_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function TrendingDownIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const drop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${LOW_X * (1 - pop)} ${LOW_Y * (1 - pop) + drop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 17h6v-6\" />\n <path d=\"m22 17-8.5-8.5-5 5L2 7\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 7 8.5 13.5 13.5 8.5 22 17\";\nconst ARROW_PATH = \"M16 17H22V11\";\n\nconst LOW_X = 22;\nconst LOW_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction TrendingDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const drop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${LOW_X * (1 - pop)} ${LOW_Y * (1 - pop) + drop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 17h6v-6\" />\n <path d=\"m22 17-8.5-8.5-5 5L2 7\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrendingDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrendingDownIconBase>;\n\nconst TrendingDownIconInner = forwardRef<\n HTMLDivElement,\n TrendingDownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TrendingDownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TrendingDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrendingDownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrendingDownIcon = Interactive.withSchema({\n Component: TrendingDownIconInner,\n componentName: \"<TrendingDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-trending-up.json b/registry-artifacts/elements/icon-trending-up.jsonindex a50d9989..43befd1a 100644--- a/registry-artifacts/elements/icon-trending-up.json+++ b/registry-artifacts/elements/icon-trending-up.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Trending Up","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-trending-up",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 17 8.5 10.5 13.5 15.5 22 7\";\nconst ARROW_PATH = \"M16 7H22V13\";\n\nconst PEAK_X = 22;\nconst PEAK_Y = 7;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function TrendingUpIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${PEAK_X * (1 - pop)} ${PEAK_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 7h6v6\" />\n <path d=\"m22 7-8.5 8.5-5-5L2 17\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 17 8.5 10.5 13.5 15.5 22 7\";\nconst ARROW_PATH = \"M16 7H22V13\";\n\nconst PEAK_X = 22;\nconst PEAK_Y = 7;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction TrendingUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${PEAK_X * (1 - pop)} ${PEAK_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 7h6v6\" />\n <path d=\"m22 7-8.5 8.5-5-5L2 17\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrendingUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrendingUpIconBase>;\n\nconst TrendingUpIconInner = forwardRef<\n HTMLDivElement,\n TrendingUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TrendingUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TrendingUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrendingUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrendingUpIcon = Interactive.withSchema({\n Component: TrendingUpIconInner,\n componentName: \"<TrendingUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-trophy.json b/registry-artifacts/elements/icon-trophy.jsonindex 3c026300..e735c833 100644--- a/registry-artifacts/elements/icon-trophy.json+++ b/registry-artifacts/elements/icon-trophy.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Trophy","durationInFrames": 85,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-trophy",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CUP_PATH = \"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\";\nconst LEG_LEFT_PATH = \"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\";\nconst LEG_RIGHT_PATH =\n \"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\";\nconst BASE_PATH = \"M4 22h16\";\nconst HANDLE_LEFT_PATH = \"M6 9H4.5a1 1 0 0 1 0-5H6\";\nconst HANDLE_RIGHT_PATH = \"M18 9h1.5a1 1 0 0 0 0-5H18\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function TrophyIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const cupDraw = interpolate(linearDraw, [0, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const legDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hop = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75, 1], [1, 1.08, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const handleDraw = acting\n ? interpolate(actionProgress, [0.1, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const cup = drawnPathProps(CUP_PATH, acting ? 1 : cupDraw);\n const legLeft = drawnPathProps(LEG_LEFT_PATH, acting ? 1 : legDraw);\n const legRight = drawnPathProps(LEG_RIGHT_PATH, acting ? 1 : legDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : legDraw);\n const handleLeft = drawnPathProps(HANDLE_LEFT_PATH, handleDraw);\n const handleRight = drawnPathProps(HANDLE_RIGHT_PATH, handleDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const hoistTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop) + hop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={hoistTransform}>\n <path\n d={HANDLE_LEFT_PATH}\n strokeDasharray={handleLeft.strokeDasharray}\n strokeDashoffset={handleLeft.strokeDashoffset}\n />\n <path\n d={HANDLE_RIGHT_PATH}\n strokeDasharray={handleRight.strokeDasharray}\n strokeDashoffset={handleRight.strokeDashoffset}\n />\n <path\n d={CUP_PATH}\n strokeDasharray={cup.strokeDasharray}\n strokeDashoffset={cup.strokeDashoffset}\n />\n <path\n d={LEG_LEFT_PATH}\n strokeDasharray={legLeft.strokeDasharray}\n strokeDashoffset={legLeft.strokeDashoffset}\n />\n <path\n d={LEG_RIGHT_PATH}\n strokeDasharray={legRight.strokeDasharray}\n strokeDashoffset={legRight.strokeDashoffset}\n />\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrophyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\" />\n <path d=\"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\" />\n <path d=\"M18 9h1.5a1 1 0 0 0 0-5H18\" />\n <path d=\"M4 22h16\" />\n <path d=\"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\" />\n <path d=\"M6 9H4.5a1 1 0 0 1 0-5H6\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CUP_PATH = \"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\";\nconst LEG_LEFT_PATH = \"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\";\nconst LEG_RIGHT_PATH =\n \"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\";\nconst BASE_PATH = \"M4 22h16\";\nconst HANDLE_LEFT_PATH = \"M6 9H4.5a1 1 0 0 1 0-5H6\";\nconst HANDLE_RIGHT_PATH = \"M18 9h1.5a1 1 0 0 0 0-5H18\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TrophyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const cupDraw = interpolate(linearDraw, [0, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const legDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hop = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75, 1], [1, 1.08, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const handleDraw = acting\n ? interpolate(actionProgress, [0.1, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const cup = drawnPathProps(CUP_PATH, acting ? 1 : cupDraw);\n const legLeft = drawnPathProps(LEG_LEFT_PATH, acting ? 1 : legDraw);\n const legRight = drawnPathProps(LEG_RIGHT_PATH, acting ? 1 : legDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : legDraw);\n const handleLeft = drawnPathProps(HANDLE_LEFT_PATH, handleDraw);\n const handleRight = drawnPathProps(HANDLE_RIGHT_PATH, handleDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const hoistTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop) + hop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={hoistTransform}>\n <path\n d={HANDLE_LEFT_PATH}\n strokeDasharray={handleLeft.strokeDasharray}\n strokeDashoffset={handleLeft.strokeDashoffset}\n />\n <path\n d={HANDLE_RIGHT_PATH}\n strokeDasharray={handleRight.strokeDasharray}\n strokeDashoffset={handleRight.strokeDashoffset}\n />\n <path\n d={CUP_PATH}\n strokeDasharray={cup.strokeDasharray}\n strokeDashoffset={cup.strokeDashoffset}\n />\n <path\n d={LEG_LEFT_PATH}\n strokeDasharray={legLeft.strokeDasharray}\n strokeDashoffset={legLeft.strokeDashoffset}\n />\n <path\n d={LEG_RIGHT_PATH}\n strokeDasharray={legRight.strokeDasharray}\n strokeDashoffset={legRight.strokeDashoffset}\n />\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrophyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\" />\n <path d=\"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\" />\n <path d=\"M18 9h1.5a1 1 0 0 0 0-5H18\" />\n <path d=\"M4 22h16\" />\n <path d=\"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\" />\n <path d=\"M6 9H4.5a1 1 0 0 1 0-5H6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrophyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrophyIconBase>;\n\nconst TrophyIconInner = forwardRef<\n HTMLDivElement,\n TrophyIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TrophyIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TrophyIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrophyIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrophyIcon = Interactive.withSchema({\n Component: TrophyIconInner,\n componentName: \"<TrophyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 85}diff --git a/registry-artifacts/elements/icon-upload.json b/registry-artifacts/elements/icon-upload.jsonindex 7f203415..354cff48 100644--- a/registry-artifacts/elements/icon-upload.json+++ b/registry-artifacts/elements/icon-upload.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Upload","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-upload",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 15V3\";\nconst SHAFT_STATIC = \"M12 3v12\";\nconst HEAD_PATH = \"M17 8 12 3 7 8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function UploadIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const launchY = interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, -5, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 1],\n [1, 0.96, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${launchY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UploadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={HEAD_PATH} />\n <path d={TRAY_STATIC} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 15V3\";\nconst SHAFT_STATIC = \"M12 3v12\";\nconst HEAD_PATH = \"M17 8 12 3 7 8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction UploadIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const launchY = interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, -5, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 1],\n [1, 0.96, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${launchY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UploadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={HEAD_PATH} />\n <path d={TRAY_STATIC} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UploadIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UploadIconBase>;\n\nconst UploadIconInner = forwardRef<\n HTMLDivElement,\n UploadIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<UploadIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <UploadIconBase\n {...(componentProps as unknown as ComponentProps<typeof UploadIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UploadIcon = Interactive.withSchema({\n Component: UploadIconInner,\n componentName: \"<UploadIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-user-plus.json b/registry-artifacts/elements/icon-user-plus.jsonindex f915ee46..a7129ce2 100644--- a/registry-artifacts/elements/icon-user-plus.json+++ b/registry-artifacts/elements/icon-user-plus.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "User Plus","durationInFrames": 75,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-user-plus",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst PLUS_H_PATH = \"M22 11 16 11\";\nconst PLUS_V_PATH = \"M19 8 19 14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nexport function UserPlusIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hProgress = acting\n ? interpolate(actionProgress, [0.08, 0.31], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const vProgress = acting\n ? interpolate(actionProgress, [0.19, 0.42], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const plusPop = acting\n ? interpolate(actionProgress, [0.42, 0.65, 1], [1, 1.3, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n const plusH = drawnPathProps(PLUS_H_PATH, hProgress);\n const plusV = drawnPathProps(PLUS_V_PATH, vProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const plusTransform = `translate(${19 * (1 - plusPop)} ${11 * (1 - plusPop)}) scale(${plusPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n <g transform={plusTransform}>\n <path\n d={PLUS_H_PATH}\n strokeDasharray={plusH.strokeDasharray}\n strokeDashoffset={plusH.strokeDashoffset}\n />\n <path\n d={PLUS_V_PATH}\n strokeDasharray={plusV.strokeDasharray}\n strokeDashoffset={plusV.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserPlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <line x1=\"19\" x2=\"19\" y1=\"8\" y2=\"14\" />\n <line x1=\"22\" x2=\"16\" y1=\"11\" y2=\"11\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst PLUS_H_PATH = \"M22 11 16 11\";\nconst PLUS_V_PATH = \"M19 8 19 14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction UserPlusIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hProgress = acting\n ? interpolate(actionProgress, [0.08, 0.31], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const vProgress = acting\n ? interpolate(actionProgress, [0.19, 0.42], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const plusPop = acting\n ? interpolate(actionProgress, [0.42, 0.65, 1], [1, 1.3, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n const plusH = drawnPathProps(PLUS_H_PATH, hProgress);\n const plusV = drawnPathProps(PLUS_V_PATH, vProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const plusTransform = `translate(${19 * (1 - plusPop)} ${11 * (1 - plusPop)}) scale(${plusPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n <g transform={plusTransform}>\n <path\n d={PLUS_H_PATH}\n strokeDasharray={plusH.strokeDasharray}\n strokeDashoffset={plusH.strokeDashoffset}\n />\n <path\n d={PLUS_V_PATH}\n strokeDasharray={plusV.strokeDasharray}\n strokeDashoffset={plusV.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserPlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <line x1=\"19\" x2=\"19\" y1=\"8\" y2=\"14\" />\n <line x1=\"22\" x2=\"16\" y1=\"11\" y2=\"11\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UserPlusIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UserPlusIconBase>;\n\nconst UserPlusIconInner = forwardRef<\n HTMLDivElement,\n UserPlusIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<UserPlusIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <UserPlusIconBase\n {...(componentProps as unknown as ComponentProps<typeof UserPlusIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UserPlusIcon = Interactive.withSchema({\n Component: UserPlusIconInner,\n componentName: \"<UserPlusIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 75}diff --git a/registry-artifacts/elements/icon-user.json b/registry-artifacts/elements/icon-user.jsonindex d859c18a..42a6c380 100644--- a/registry-artifacts/elements/icon-user.json+++ b/registry-artifacts/elements/icon-user.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "User","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-user",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M12 3 A4 4 0 0 1 16 7 A4 4 0 0 1 12 11 A4 4 0 0 1 8 7 A4 4 0 0 1 12 3\";\nconst SHOULDERS_PATH = \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function UserIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const headDip = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const shoulderRise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${headDip})`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${shoulderRise})`}>\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M12 3 A4 4 0 0 1 16 7 A4 4 0 0 1 12 11 A4 4 0 0 1 8 7 A4 4 0 0 1 12 3\";\nconst SHOULDERS_PATH = \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction UserIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const headDip = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const shoulderRise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${headDip})`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${shoulderRise})`}>\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UserIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UserIconBase>;\n\nconst UserIconInner = forwardRef<\n HTMLDivElement,\n UserIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<UserIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <UserIconBase\n {...(componentProps as unknown as ComponentProps<typeof UserIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UserIcon = Interactive.withSchema({\n Component: UserIconInner,\n componentName: \"<UserIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-users.json b/registry-artifacts/elements/icon-users.jsonindex dd14dd11..8f944775 100644--- a/registry-artifacts/elements/icon-users.json+++ b/registry-artifacts/elements/icon-users.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Users","durationInFrames": 80,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-users",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst BACK_HEAD_PATH = \"M16 3.128a4 4 0 0 1 0 7.744\";\nconst BACK_SHOULDERS_PATH = \"M22 21v-2a4 4 0 0 0-3-3.87\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nexport function UsersIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.42], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const backOpacity = acting\n ? interpolate(actionProgress, [0.33, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const backSlide = acting\n ? interpolate(actionProgress, [0.33, 1], [-2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : -2;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const frontTransform = `translate(${9 * (1 - pop)} ${12 * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${backSlide} 0)`} opacity={backOpacity}>\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n </g>\n <g transform={frontTransform}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UsersIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst BACK_HEAD_PATH = \"M16 3.128a4 4 0 0 1 0 7.744\";\nconst BACK_SHOULDERS_PATH = \"M22 21v-2a4 4 0 0 0-3-3.87\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction UsersIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.42], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const backOpacity = acting\n ? interpolate(actionProgress, [0.33, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const backSlide = acting\n ? interpolate(actionProgress, [0.33, 1], [-2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : -2;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const frontTransform = `translate(${9 * (1 - pop)} ${12 * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${backSlide} 0)`} opacity={backOpacity}>\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n </g>\n <g transform={frontTransform}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UsersIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UsersIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UsersIconBase>;\n\nconst UsersIconInner = forwardRef<\n HTMLDivElement,\n UsersIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<UsersIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <UsersIconBase\n {...(componentProps as unknown as ComponentProps<typeof UsersIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UsersIcon = Interactive.withSchema({\n Component: UsersIconInner,\n componentName: \"<UsersIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 80}diff --git a/registry-artifacts/elements/icon-video.json b/registry-artifacts/elements/icon-video.jsonindex 83997255..c17a22f9 100644--- a/registry-artifacts/elements/icon-video.json+++ b/registry-artifacts/elements/icon-video.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Video","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-video",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 6H14A2 2 0 0 1 16 8V16A2 2 0 0 1 14 18H4A2 2 0 0 1 2 16V8A2 2 0 0 1 4 6Z\";\nconst LENS_PATH =\n \"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function VideoIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pan = acting\n ? interpolate(actionProgress, [0, 0.5, 0.75, 1], [0, 8, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`rotate(${pan} 16 11.75)`}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction VideoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={LENS_PATH} />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 6H14A2 2 0 0 1 16 8V16A2 2 0 0 1 14 18H4A2 2 0 0 1 2 16V8A2 2 0 0 1 4 6Z\";\nconst LENS_PATH =\n \"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction VideoIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pan = acting\n ? interpolate(actionProgress, [0, 0.5, 0.75, 1], [0, 8, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`rotate(${pan} 16 11.75)`}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction VideoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={LENS_PATH} />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype VideoIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VideoIconBase>;\n\nconst VideoIconInner = forwardRef<\n HTMLDivElement,\n VideoIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<VideoIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <VideoIconBase\n {...(componentProps as unknown as ComponentProps<typeof VideoIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VideoIcon = Interactive.withSchema({\n Component: VideoIconInner,\n componentName: \"<VideoIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-volume-2.json b/registry-artifacts/elements/icon-volume-2.jsonindex 63ce7f6a..f8e4c3de 100644--- a/registry-artifacts/elements/icon-volume-2.json+++ b/registry-artifacts/elements/icon-volume-2.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Volume 2","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-volume-2",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst INNER_PATH = \"M16 9a5 5 0 0 1 0 6\";\nconst OUTER_PATH = \"M19.364 18.364a9 9 0 0 0 0-12.728\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function Volume2Icon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.4, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const outerDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const innerProgress = acting ? 1 : innerDraw;\n const outerProgress = acting ? 1 : outerDraw;\n\n const innerShift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const innerGrow = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const outerShift = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const outerGrow = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const body = drawnPathProps(SPEAKER_PATH, bodyDraw);\n const inner = drawnPathProps(INNER_PATH, innerProgress);\n const outer = drawnPathProps(OUTER_PATH, outerProgress);\n\n const innerTransform = `translate(${11 * (1 - innerGrow) + innerShift} ${12 * (1 - innerGrow)}) scale(${innerGrow})`;\n const outerTransform = `translate(${11 * (1 - outerGrow) + outerShift} ${12 * (1 - outerGrow)}) scale(${outerGrow})`;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={innerTransform}>\n <path\n d={INNER_PATH}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n <g transform={outerTransform}>\n <path\n d={OUTER_PATH}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Volume2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <path d={INNER_PATH} />\n <path d={OUTER_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst INNER_PATH = \"M16 9a5 5 0 0 1 0 6\";\nconst OUTER_PATH = \"M19.364 18.364a9 9 0 0 0 0-12.728\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction Volume2IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.4, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const outerDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const innerProgress = acting ? 1 : innerDraw;\n const outerProgress = acting ? 1 : outerDraw;\n\n const innerShift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const innerGrow = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const outerShift = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const outerGrow = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const body = drawnPathProps(SPEAKER_PATH, bodyDraw);\n const inner = drawnPathProps(INNER_PATH, innerProgress);\n const outer = drawnPathProps(OUTER_PATH, outerProgress);\n\n const innerTransform = `translate(${11 * (1 - innerGrow) + innerShift} ${12 * (1 - innerGrow)}) scale(${innerGrow})`;\n const outerTransform = `translate(${11 * (1 - outerGrow) + outerShift} ${12 * (1 - outerGrow)}) scale(${outerGrow})`;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={innerTransform}>\n <path\n d={INNER_PATH}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n <g transform={outerTransform}>\n <path\n d={OUTER_PATH}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Volume2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <path d={INNER_PATH} />\n <path d={OUTER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype Volume2IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof Volume2IconBase>;\n\nconst Volume2IconInner = forwardRef<\n HTMLDivElement,\n Volume2IconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Volume2Icon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <Volume2IconBase\n {...(componentProps as unknown as ComponentProps<typeof Volume2IconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Volume2Icon = Interactive.withSchema({\n Component: Volume2IconInner,\n componentName: \"<Volume2Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-volume-x.json b/registry-artifacts/elements/icon-volume-x.jsonindex 753ec6bf..325c00b3 100644--- a/registry-artifacts/elements/icon-volume-x.json+++ b/registry-artifacts/elements/icon-volume-x.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Volume X","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-volume-x",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst X1_PATH = \"M22 9 16 15\";\nconst X2_PATH = \"M16 9 22 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function VolumeXIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const x1Progress = acting\n ? interpolate(actionProgress, [0.09, 0.32], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const x2Progress = acting\n ? interpolate(actionProgress, [0.23, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.45, 0.55, 0.65, 0.75, 0.85, 1],\n [0, 2, -1.5, 1, -0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const body = drawnPathProps(SPEAKER_PATH, drawProgress);\n const x1 = drawnPathProps(X1_PATH, x1Progress);\n const x2 = drawnPathProps(X2_PATH, x2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={X1_PATH}\n strokeDasharray={x1.strokeDasharray}\n strokeDashoffset={x1.strokeDashoffset}\n />\n <path\n d={X2_PATH}\n strokeDasharray={x2.strokeDasharray}\n strokeDashoffset={x2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction VolumeXIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst X1_PATH = \"M22 9 16 15\";\nconst X2_PATH = \"M16 9 22 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction VolumeXIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const x1Progress = acting\n ? interpolate(actionProgress, [0.09, 0.32], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const x2Progress = acting\n ? interpolate(actionProgress, [0.23, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.45, 0.55, 0.65, 0.75, 0.85, 1],\n [0, 2, -1.5, 1, -0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const body = drawnPathProps(SPEAKER_PATH, drawProgress);\n const x1 = drawnPathProps(X1_PATH, x1Progress);\n const x2 = drawnPathProps(X2_PATH, x2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={X1_PATH}\n strokeDasharray={x1.strokeDasharray}\n strokeDashoffset={x1.strokeDashoffset}\n />\n <path\n d={X2_PATH}\n strokeDasharray={x2.strokeDasharray}\n strokeDashoffset={x2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction VolumeXIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype VolumeXIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VolumeXIconBase>;\n\nconst VolumeXIconInner = forwardRef<\n HTMLDivElement,\n VolumeXIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<VolumeXIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <VolumeXIconBase\n {...(componentProps as unknown as ComponentProps<typeof VolumeXIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VolumeXIcon = Interactive.withSchema({\n Component: VolumeXIconInner,\n componentName: \"<VolumeXIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-wallet.json b/registry-artifacts/elements/icon-wallet.jsonindex fd69277f..974aacf9 100644--- a/registry-artifacts/elements/icon-wallet.json+++ b/registry-artifacts/elements/icon-wallet.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Wallet","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-wallet",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAP_PATH =\n \"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\";\nconst BODY_PATH = \"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function WalletIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const fatten = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const flap = drawnPathProps(FLAP_PATH, acting ? 1 : flapDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const fattenTransform = `translate(${CENTER * (1 - fatten)} 0) scale(${fatten} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={fattenTransform}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_PATH}\n strokeDasharray={flap.strokeDasharray}\n strokeDashoffset={flap.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction WalletIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <path d={BODY_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAP_PATH =\n \"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\";\nconst BODY_PATH = \"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction WalletIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const fatten = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const flap = drawnPathProps(FLAP_PATH, acting ? 1 : flapDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const fattenTransform = `translate(${CENTER * (1 - fatten)} 0) scale(${fatten} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={fattenTransform}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_PATH}\n strokeDasharray={flap.strokeDasharray}\n strokeDashoffset={flap.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction WalletIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <path d={BODY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype WalletIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof WalletIconBase>;\n\nconst WalletIconInner = forwardRef<\n HTMLDivElement,\n WalletIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<WalletIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <WalletIconBase\n {...(componentProps as unknown as ComponentProps<typeof WalletIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const WalletIcon = Interactive.withSchema({\n Component: WalletIconInner,\n componentName: \"<WalletIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-x-circle.json b/registry-artifacts/elements/icon-x-circle.jsonindex a4b65e6b..d4f56780 100644--- a/registry-artifacts/elements/icon-x-circle.json+++ b/registry-artifacts/elements/icon-x-circle.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "X Circle","durationInFrames": 70,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-x-circle",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst SLASH1_PATH = \"M15 9 9 15\";\nconst SLASH2_PATH = \"M9 9 15 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nexport function XCircleIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slash1Draw = interpolate(actionProgress, [0.1, 0.35], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slash2Draw = interpolate(actionProgress, [0.25, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.5, 0.62, 0.74, 0.86, 1],\n [0, 2, -2, 1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const slash1Progress = animation === \"draw\" ? 1 : acting ? slash1Draw : 0;\n const slash2Progress = animation === \"draw\" ? 1 : acting ? slash2Draw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const slash1 = drawnPathProps(SLASH1_PATH, slash1Progress);\n const slash2 = drawnPathProps(SLASH2_PATH, slash2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={SLASH1_PATH}\n strokeDasharray={slash1.strokeDasharray}\n strokeDashoffset={slash1.strokeDashoffset}\n />\n <path\n d={SLASH2_PATH}\n strokeDasharray={slash2.strokeDasharray}\n strokeDashoffset={slash2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={SLASH1_PATH} />\n <path d={SLASH2_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst SLASH1_PATH = \"M15 9 9 15\";\nconst SLASH2_PATH = \"M9 9 15 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction XCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slash1Draw = interpolate(actionProgress, [0.1, 0.35], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slash2Draw = interpolate(actionProgress, [0.25, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.5, 0.62, 0.74, 0.86, 1],\n [0, 2, -2, 1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const slash1Progress = animation === \"draw\" ? 1 : acting ? slash1Draw : 0;\n const slash2Progress = animation === \"draw\" ? 1 : acting ? slash2Draw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const slash1 = drawnPathProps(SLASH1_PATH, slash1Progress);\n const slash2 = drawnPathProps(SLASH2_PATH, slash2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={SLASH1_PATH}\n strokeDasharray={slash1.strokeDasharray}\n strokeDashoffset={slash1.strokeDashoffset}\n />\n <path\n d={SLASH2_PATH}\n strokeDasharray={slash2.strokeDasharray}\n strokeDashoffset={slash2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={SLASH1_PATH} />\n <path d={SLASH2_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype XCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof XCircleIconBase>;\n\nconst XCircleIconInner = forwardRef<\n HTMLDivElement,\n XCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<XCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <XCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof XCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const XCircleIcon = Interactive.withSchema({\n Component: XCircleIconInner,\n componentName: \"<XCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 70}diff --git a/registry-artifacts/elements/icon-x.json b/registry-artifacts/elements/icon-x.jsonindex c783b500..5f50eb07 100644--- a/registry-artifacts/elements/icon-x.json+++ b/registry-artifacts/elements/icon-x.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "X","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-x",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FIRST_PATH = \"M18 6 6 18\";\nconst SECOND_PATH = \"M6 6 18 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nexport function XIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const firstProgress = interpolate(linearDraw, [0, 0.57], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const secondProgress = interpolate(linearDraw, [0.29, 0.86], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const first = drawnPathProps(FIRST_PATH, firstProgress);\n const second = drawnPathProps(SECOND_PATH, secondProgress);\n\n const rotate = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -8, 6, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={FIRST_PATH}\n strokeDasharray={first.strokeDasharray}\n strokeDashoffset={first.strokeDashoffset}\n />\n <path\n d={SECOND_PATH}\n strokeDasharray={second.strokeDasharray}\n strokeDashoffset={second.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FIRST_PATH} />\n <path d={SECOND_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FIRST_PATH = \"M18 6 6 18\";\nconst SECOND_PATH = \"M6 6 18 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction XIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const firstProgress = interpolate(linearDraw, [0, 0.57], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const secondProgress = interpolate(linearDraw, [0.29, 0.86], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const first = drawnPathProps(FIRST_PATH, firstProgress);\n const second = drawnPathProps(SECOND_PATH, secondProgress);\n\n const rotate = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -8, 6, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={FIRST_PATH}\n strokeDasharray={first.strokeDasharray}\n strokeDashoffset={first.strokeDashoffset}\n />\n <path\n d={SECOND_PATH}\n strokeDasharray={second.strokeDasharray}\n strokeDashoffset={second.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FIRST_PATH} />\n <path d={SECOND_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype XIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof XIconBase>;\n\nconst XIconInner = forwardRef<\n HTMLDivElement,\n XIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<XIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <XIconBase\n {...(componentProps as unknown as ComponentProps<typeof XIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const XIcon = Interactive.withSchema({\n Component: XIconInner,\n componentName: \"<XIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/icon-zap.json b/registry-artifacts/elements/icon-zap.jsonindex 0eef2f5b..7a74b000 100644--- a/registry-artifacts/elements/icon-zap.json+++ b/registry-artifacts/elements/icon-zap.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Zap","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "icon-zap",- "sourceCode": "import { Easing, interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ZAP_PATH =\n \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 14,\n loop: false,\n} as const;\n\nexport function ZapIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boltProgress = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const bolt = drawnPathProps(ZAP_PATH, boltProgress);\n\n const flash = interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.45, 0.6, 1],\n [1, 0.3, 1, 0.3, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const pop = interpolate(actionProgress, [0, 0.3, 0.6, 1], [1, 1.1, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const strikeEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const strikeX = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, 1.5, -3, 0],\n strikeEase,\n );\n const strikeY = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, -2, 4, 0],\n strikeEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 0.7, 1],\n [0, -4, 9, -2, 0],\n strikeEase,\n );\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n opacity={flash}\n transform={`translate(${strikeX} ${strikeY}) translate(12 12) skewX(${skew}) translate(-12 -12)`}\n >\n <path\n d={ZAP_PATH}\n strokeDasharray={bolt.strokeDasharray}\n strokeDashoffset={bolt.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ZapIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ZAP_PATH} />\n </svg>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ZAP_PATH =\n \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 14,\n loop: false,\n} as const;\n\nfunction ZapIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boltProgress = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const bolt = drawnPathProps(ZAP_PATH, boltProgress);\n\n const flash = interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.45, 0.6, 1],\n [1, 0.3, 1, 0.3, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const pop = interpolate(actionProgress, [0, 0.3, 0.6, 1], [1, 1.1, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const strikeEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const strikeX = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, 1.5, -3, 0],\n strikeEase,\n );\n const strikeY = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, -2, 4, 0],\n strikeEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 0.7, 1],\n [0, -4, 9, -2, 0],\n strikeEase,\n );\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n opacity={flash}\n transform={`translate(${strikeX} ${strikeY}) translate(12 12) skewX(${skew}) translate(-12 -12)`}\n >\n <path\n d={ZAP_PATH}\n strokeDasharray={bolt.strokeDasharray}\n strokeDashoffset={bolt.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ZapIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ZAP_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ZapIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ZapIconBase>;\n\nconst ZapIconInner = forwardRef<\n HTMLDivElement,\n ZapIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ZapIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ZapIconBase\n {...(componentProps as unknown as ComponentProps<typeof ZapIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ZapIcon = Interactive.withSchema({\n Component: ZapIconInner,\n componentName: \"<ZapIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/infinite-bento-pan.json b/registry-artifacts/elements/infinite-bento-pan.jsonindex 99f49b40..52b1e8ae 100644--- a/registry-artifacts/elements/infinite-bento-pan.json+++ b/registry-artifacts/elements/infinite-bento-pan.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Infinite Bento Pan","durationInFrames": 300,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "infinite-bento-pan",- "sourceCode": "import { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nexport function InfiniteBentoPan({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n transform: `translate(${-px}px, ${-py}px)`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nfunction InfiniteBentoPanBase({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n transform: `translate(${-px}px, ${-py}px)`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n panSpeed: {\n type: \"number\",\n min: 0.25,\n max: 3,\n step: 0.25,\n default: 1,\n description: \"Pan speed\",\n hiddenFromList: false,\n },\n accentColor: {\n type: \"color\",\n default: \"#7c3aed\",\n description: \"Accent color\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"panSpeed\",\"accentColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n panSpeed: 1,\n accentColor: \"#7c3aed\",\n speed: 1,\n};\n\ntype InfiniteBentoPanElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfiniteBentoPanBase>;\n\nconst InfiniteBentoPanInner = forwardRef<\n HTMLDivElement,\n InfiniteBentoPanElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<InfiniteBentoPan>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <InfiniteBentoPanBase\n {...(componentProps as unknown as ComponentProps<typeof InfiniteBentoPanBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfiniteBentoPan = Interactive.withSchema({\n Component: InfiniteBentoPanInner,\n componentName: \"<InfiniteBentoPan>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 300}diff --git a/registry-artifacts/elements/infinite-marquee.json b/registry-artifacts/elements/infinite-marquee.jsonindex 1c5fbf46..3ff55226 100644--- a/registry-artifacts/elements/infinite-marquee.json+++ b/registry-artifacts/elements/infinite-marquee.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Infinite Marquee","durationInFrames": 180,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "infinite-marquee",- "sourceCode": "import { useCurrentFrame } from \"remotion\";\n\nexport interface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nexport function InfiniteMarquee({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nfunction InfiniteMarqueeBase({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"ship · build · animate · \",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 240,\n step: 1,\n default: 120,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n pixelsPerFrame: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 4,\n description: \"Pixels / frame\",\n hiddenFromList: false,\n },\n stroke: {\n type: \"boolean\",\n default: false,\n description: \"Stroke\",\n },\n strokeColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Stroke color\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"pixelsPerFrame\",\"stroke\",\"strokeColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"ship · build · animate · \",\n fontSize: 120,\n color: \"#171717\",\n fontWeight: \"700\",\n pixelsPerFrame: 4,\n stroke: false,\n strokeColor: \"#171717\",\n speed: 1,\n};\n\ntype InfiniteMarqueeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfiniteMarqueeBase>;\n\nconst InfiniteMarqueeInner = forwardRef<\n HTMLDivElement,\n InfiniteMarqueeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<InfiniteMarquee>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <InfiniteMarqueeBase\n {...(componentProps as unknown as ComponentProps<typeof InfiniteMarqueeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfiniteMarquee = Interactive.withSchema({\n Component: InfiniteMarqueeInner,\n componentName: \"<InfiniteMarquee>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 180}diff --git a/registry-artifacts/elements/inline-highlight.json b/registry-artifacts/elements/inline-highlight.jsonindex 57ed3460..ba8eadf5 100644--- a/registry-artifacts/elements/inline-highlight.json+++ b/registry-artifacts/elements/inline-highlight.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Inline Highlight","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "inline-highlight",- "sourceCode": "import { interpolate, interpolateColors, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface InlineHighlightProps {\n before: string;\n highlight: string;\n after?: string;\n baseColor?: string;\n highlightColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function InlineHighlight({\n before,\n highlight,\n after = \"\",\n baseColor = \"#171717\",\n highlightColor = \"#ff5e3a\",\n fontSize = 48,\n fontWeight = 600,\n speed = 1,\n className,\n}: InlineHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const progress = interpolate(\n frame,\n [durationInFrames * 0.2, durationInFrames * 0.7],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const color = interpolateColors(\n progress,\n [0, 1],\n [baseColor, highlightColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ color }}>{highlight}</span>\n {after}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, interpolateColors, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InlineHighlightProps {\n before: string;\n highlight: string;\n after?: string;\n baseColor?: string;\n highlightColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction InlineHighlightBase({\n before,\n highlight,\n after = \"\",\n baseColor = \"#171717\",\n highlightColor = \"#ff5e3a\",\n fontSize = 48,\n fontWeight = 600,\n speed = 1,\n className,\n}: InlineHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const progress = interpolate(\n frame,\n [durationInFrames * 0.2, durationInFrames * 0.7],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const color = interpolateColors(\n progress,\n [0, 1],\n [baseColor, highlightColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ color }}>{highlight}</span>\n {after}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n before: {\n type: \"text-content\",\n default: \"Ship faster with \",\n description: \"Before\",\n },\n highlight: {\n type: \"text-content\",\n default: \"remocn\",\n description: \"Highlight\",\n },\n after: {\n type: \"text-content\",\n default: \".\",\n description: \"After\",\n },\n baseColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Base color\",\n },\n highlightColor: {\n type: \"color\",\n default: \"#ff5e3a\",\n description: \"Highlight color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"before\",\"highlight\",\"after\",\"baseColor\",\"highlightColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n before: \"Ship faster with \",\n highlight: \"remocn\",\n after: \".\",\n baseColor: \"#171717\",\n highlightColor: \"#ff5e3a\",\n fontSize: 72,\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype InlineHighlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InlineHighlightBase>;\n\nconst InlineHighlightInner = forwardRef<\n HTMLDivElement,\n InlineHighlightElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<InlineHighlight>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <InlineHighlightBase\n {...(componentProps as unknown as ComponentProps<typeof InlineHighlightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InlineHighlight = Interactive.withSchema({\n Component: InlineHighlightInner,\n componentName: \"<InlineHighlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/kinetic-center-build.json b/registry-artifacts/elements/kinetic-center-build.jsonindex aec16f6b..9b354fd8 100644--- a/registry-artifacts/elements/kinetic-center-build.json+++ b/registry-artifacts/elements/kinetic-center-build.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Kinetic Center Build","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "kinetic-center-build",- "sourceCode": "import { useMemo } from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface KineticCenterBuildProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst MEASURE_FONT =\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif';\n\nfunction measureWidths(\n words: string[],\n fontSize: number,\n fontWeight: number,\n): number[] {\n if (typeof document === \"undefined\") {\n return words.map((w) => w.length * fontSize * 0.55);\n }\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return words.map((w) => w.length * fontSize * 0.55);\n ctx.font = `${fontWeight} ${fontSize}px ${MEASURE_FONT}`;\n return words.map((w) => ctx.measureText(w).width);\n}\n\nexport function KineticCenterBuild({\n text,\n entryOffset = 88,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: KineticCenterBuildProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const widths = useMemo(\n () => measureWidths(words, fontSize, fontWeight),\n [words, fontSize, fontWeight],\n );\n\n const gap = 10;\n const firstDur = 10;\n const pushDur = 13;\n const travelDur = 7;\n const entryScale = 0.992;\n const entryBlur = 3.5;\n const reflowBlur = 0.8;\n const firstWordY = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= words.length; k++) {\n let total = gap * (k - 1);\n for (let j = 0; j < k; j++) total += widths[j];\n let cursor = -total / 2;\n const xs: number[] = [];\n for (let j = 0; j < k; j++) {\n xs.push(cursor + widths[j] / 2);\n cursor += widths[j] + gap;\n }\n out.push(xs);\n }\n return out;\n }, [words, widths]);\n\n const n = words.length;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetX = positionsAt[j][j];\n const xFrom = j === 0 ? 0 : targetX + entryOffset;\n\n let x = targetX;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n let y = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n x = xFrom;\n scale = entryScale;\n blur = entryBlur;\n y = j === 0 ? firstWordY : 0;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n x = interpolate(frame, travelRange, [xFrom, targetX], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n y =\n j === 0\n ? interpolate(frame, travelRange, [firstWordY, 0], opts)\n : 0;\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromX = positionsAt[w - 1][j];\n const toX = positionsAt[w][j];\n if (frame >= pushEnd) {\n x = toX;\n } else if (frame >= pushStart) {\n x = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromX, toX],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n x = fromX;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(${x}px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface KineticCenterBuildProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst MEASURE_FONT =\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif';\n\nfunction measureWidths(\n words: string[],\n fontSize: number,\n fontWeight: number,\n): number[] {\n if (typeof document === \"undefined\") {\n return words.map((w) => w.length * fontSize * 0.55);\n }\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return words.map((w) => w.length * fontSize * 0.55);\n ctx.font = `${fontWeight} ${fontSize}px ${MEASURE_FONT}`;\n return words.map((w) => ctx.measureText(w).width);\n}\n\nfunction KineticCenterBuildBase({\n text,\n entryOffset = 88,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: KineticCenterBuildProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const widths = useMemo(\n () => measureWidths(words, fontSize, fontWeight),\n [words, fontSize, fontWeight],\n );\n\n const gap = 10;\n const firstDur = 10;\n const pushDur = 13;\n const travelDur = 7;\n const entryScale = 0.992;\n const entryBlur = 3.5;\n const reflowBlur = 0.8;\n const firstWordY = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= words.length; k++) {\n let total = gap * (k - 1);\n for (let j = 0; j < k; j++) total += widths[j];\n let cursor = -total / 2;\n const xs: number[] = [];\n for (let j = 0; j < k; j++) {\n xs.push(cursor + widths[j] / 2);\n cursor += widths[j] + gap;\n }\n out.push(xs);\n }\n return out;\n }, [words, widths]);\n\n const n = words.length;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetX = positionsAt[j][j];\n const xFrom = j === 0 ? 0 : targetX + entryOffset;\n\n let x = targetX;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n let y = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n x = xFrom;\n scale = entryScale;\n blur = entryBlur;\n y = j === 0 ? firstWordY : 0;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n x = interpolate(frame, travelRange, [xFrom, targetX], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n y =\n j === 0\n ? interpolate(frame, travelRange, [firstWordY, 0], opts)\n : 0;\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromX = positionsAt[w - 1][j];\n const toX = positionsAt[w][j];\n if (frame >= pushEnd) {\n x = toX;\n } else if (frame >= pushStart) {\n x = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromX, toX],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n x = fromX;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(${x}px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Words push left.\",\n description: \"Text\",\n },\n entryOffset: {\n type: \"number\",\n min: 20,\n max: 160,\n step: 1,\n default: 88,\n description: \"Entry offset\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"entryOffset\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Words push left.\",\n entryOffset: 88,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype KineticCenterBuildElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof KineticCenterBuildBase>;\n\nconst KineticCenterBuildInner = forwardRef<\n HTMLDivElement,\n KineticCenterBuildElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<KineticCenterBuild>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <KineticCenterBuildBase\n {...(componentProps as unknown as ComponentProps<typeof KineticCenterBuildBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const KineticCenterBuild = Interactive.withSchema({\n Component: KineticCenterBuildInner,\n componentName: \"<KineticCenterBuild>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/kinetic-warp.json b/registry-artifacts/elements/kinetic-warp.jsonindex 99003911..76e927ff 100644--- a/registry-artifacts/elements/kinetic-warp.json+++ b/registry-artifacts/elements/kinetic-warp.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Kinetic Warp","durationInFrames": 100,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "kinetic-warp",- "sourceCode": "import { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Easing, continueRender, delayRender, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface KineticWarpProps {\n className?: string;\n compWidth?: number;\n compHeight?: number;\n textColor?: string;\n text?: string;\n fontFamily?: string;\n fontUrl?: string;\n fontWeight?: number;\n fontSize?: number;\n leading?: number;\n tracking?: number;\n layerScale?: number;\n positionX?: number;\n positionY?: number;\n meshRows?: number;\n meshColumns?: number;\n colRestX?: number;\n colRightX?: number;\n colLeftX?: number;\n rowRestY?: number;\n rowDownY?: number;\n rowUpY?: number;\n keyframeStride?: number;\n easingBezier?: [number, number, number, number];\n resampleStep?: number;\n}\n\nfunction monotoneSpline(xs: number[], ys: number[]): (x: number) => number {\n const n = xs.length;\n const dx: number[] = [];\n const secant: number[] = [];\n for (let i = 0; i < n - 1; i++) {\n dx.push(xs[i + 1] - xs[i]);\n secant.push((ys[i + 1] - ys[i]) / (xs[i + 1] - xs[i]));\n }\n\n const m: number[] = new Array(n);\n m[0] = secant[0];\n m[n - 1] = secant[n - 2];\n for (let i = 1; i < n - 1; i++) {\n m[i] = secant[i - 1] * secant[i] <= 0 ? 0 : (secant[i - 1] + secant[i]) / 2;\n }\n\n for (let i = 0; i < n - 1; i++) {\n if (secant[i] === 0) {\n m[i] = 0;\n m[i + 1] = 0;\n continue;\n }\n const a = m[i] / secant[i];\n const b = m[i + 1] / secant[i];\n const s = a * a + b * b;\n if (s > 9) {\n const t = 3 / Math.sqrt(s);\n m[i] = t * a * secant[i];\n m[i + 1] = t * b * secant[i];\n }\n }\n\n return (x: number) => {\n if (x <= xs[0]) return ys[0] + m[0] * (x - xs[0]);\n if (x >= xs[n - 1]) return ys[n - 1] + m[n - 1] * (x - xs[n - 1]);\n let i = n - 2;\n while (i > 0 && x < xs[i]) i--;\n const h = dx[i];\n const t = (x - xs[i]) / h;\n const t2 = t * t;\n const t3 = t2 * t;\n return (\n (2 * t3 - 3 * t2 + 1) * ys[i] +\n (t3 - 2 * t2 + t) * h * m[i] +\n (-2 * t3 + 3 * t2) * ys[i + 1] +\n (t3 - t2) * h * m[i + 1]\n );\n };\n}\n\nexport function KineticWarp({\n className,\n compWidth = 1920,\n compHeight = 1080,\n textColor = \"#FFFFFF\",\n text = \"REM\\nOCN\",\n fontFamily = \"sans-serif\",\n fontUrl = \"\",\n fontWeight = 700,\n fontSize = 107.1,\n leading = 70,\n tracking = -21,\n layerScale = 480,\n positionX = 960,\n positionY = 540,\n meshRows = 2,\n meshColumns = 4,\n colRestX = 960,\n colRightX = 1255,\n colLeftX = 678,\n rowRestY = 540,\n rowDownY = 850,\n rowUpY = 387,\n keyframeStride = 20,\n easingBezier = [0.3, 0.74, 0.09, 1],\n resampleStep = 4,\n}: KineticWarpProps) {\n const frame = useCurrentFrame();\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n const [fontReady, setFontReady] = useState(false);\n\n const scale = layerScale / 100;\n const pxSize = fontSize * scale;\n const pxLeading = leading * scale;\n const pxTracking = (tracking / 1000) * pxSize;\n\n useEffect(() => {\n const handle = delayRender(\"kinetic-warp: loading font\");\n let cancelled = false;\n const done = () => {\n if (!cancelled) setFontReady(true);\n continueRender(handle);\n };\n if (typeof document === \"undefined\" || !document.fonts) {\n done();\n return;\n }\n document.fonts\n .load(`${fontWeight} ${pxSize}px \"${fontFamily}\"`)\n .then(done, done);\n return () => {\n cancelled = true;\n };\n }, [fontFamily, fontWeight, pxSize]);\n\n const source = useMemo(() => {\n if (!fontReady || typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = compWidth;\n canvas.height = compHeight;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n\n ctx.font = `${fontWeight} ${pxSize}px \"${fontFamily}\", sans-serif`;\n ctx.letterSpacing = `${pxTracking}px`;\n ctx.fillStyle = textColor;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"alphabetic\";\n\n const lines = text.split(\"\\n\");\n const metrics = lines.map((line) => ctx.measureText(line));\n\n const ascent = metrics[0].actualBoundingBoxAscent;\n const descent = metrics[metrics.length - 1].actualBoundingBoxDescent;\n const span = (lines.length - 1) * pxLeading;\n const firstBaseline = positionY - (span - ascent + descent) / 2;\n\n lines.forEach((line, i) => {\n const m = metrics[i];\n const x =\n positionX - (m.actualBoundingBoxRight - m.actualBoundingBoxLeft) / 2;\n ctx.fillText(line, x, firstBaseline + i * pxLeading);\n });\n\n return canvas;\n }, [\n compWidth,\n compHeight,\n text,\n fontFamily,\n fontWeight,\n pxSize,\n pxLeading,\n pxTracking,\n textColor,\n positionX,\n positionY,\n fontReady,\n ]);\n\n const scratch = useMemo(() => {\n if (typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = compWidth;\n canvas.height = compHeight;\n return canvas;\n }, [compWidth, compHeight]);\n\n const easing = Easing.bezier(...easingBezier);\n const stops = [0, 1, 2, 3, 4, 5].map((i) => i * keyframeStride);\n const clamp = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n } as const;\n\n const colX = interpolate(\n frame,\n stops,\n [colRestX, colRightX, colRightX, colLeftX, colLeftX, colRestX],\n clamp,\n );\n const rowY = interpolate(\n frame,\n stops,\n [rowRestY, rowRestY, rowDownY, rowDownY, rowUpY, rowRestY],\n clamp,\n );\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || !source || !scratch) return;\n const out = canvas.getContext(\"2d\");\n const mid = scratch.getContext(\"2d\");\n if (!out || !mid) return;\n\n const xs = Array.from(\n { length: meshColumns + 1 },\n (_, i) => (i * compWidth) / meshColumns,\n );\n const ys = Array.from(\n { length: meshRows + 1 },\n (_, i) => (i * compHeight) / meshRows,\n );\n const xd = xs.slice();\n const yd = ys.slice();\n xd[Math.round(meshColumns / 2)] = colX;\n yd[Math.round(meshRows / 2)] = rowY;\n\n const gx = monotoneSpline(xd, xs);\n const gy = monotoneSpline(yd, ys);\n\n mid.clearRect(0, 0, compWidth, compHeight);\n out.clearRect(0, 0, compWidth, compHeight);\n\n for (let d0 = 0; d0 < compWidth; d0 += resampleStep) {\n const d1 = Math.min(d0 + resampleStep, compWidth);\n const s0 = gx(d0);\n const sw = gx(d1) - s0;\n if (sw <= 0) continue;\n mid.drawImage(source, s0, 0, sw, compHeight, d0, 0, d1 - d0, compHeight);\n }\n\n for (let d0 = 0; d0 < compHeight; d0 += resampleStep) {\n const d1 = Math.min(d0 + resampleStep, compHeight);\n const s0 = gy(d0);\n const sh = gy(d1) - s0;\n if (sh <= 0) continue;\n out.drawImage(scratch, 0, s0, compWidth, sh, 0, d0, compWidth, d1 - d0);\n }\n }, [\n source,\n scratch,\n colX,\n rowY,\n compWidth,\n compHeight,\n meshRows,\n meshColumns,\n resampleStep,\n ]);\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n {fontUrl ? <link rel=\"stylesheet\" href={fontUrl} /> : null}\n <canvas\n ref={canvasRef}\n width={compWidth}\n height={compHeight}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, continueRender, delayRender, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface KineticWarpProps {\n className?: string;\n compWidth?: number;\n compHeight?: number;\n textColor?: string;\n text?: string;\n fontFamily?: string;\n fontUrl?: string;\n fontWeight?: number;\n fontSize?: number;\n leading?: number;\n tracking?: number;\n layerScale?: number;\n positionX?: number;\n positionY?: number;\n meshRows?: number;\n meshColumns?: number;\n colRestX?: number;\n colRightX?: number;\n colLeftX?: number;\n rowRestY?: number;\n rowDownY?: number;\n rowUpY?: number;\n keyframeStride?: number;\n easingBezier?: [number, number, number, number];\n resampleStep?: number;\n}\n\nfunction monotoneSpline(xs: number[], ys: number[]): (x: number) => number {\n const n = xs.length;\n const dx: number[] = [];\n const secant: number[] = [];\n for (let i = 0; i < n - 1; i++) {\n dx.push(xs[i + 1] - xs[i]);\n secant.push((ys[i + 1] - ys[i]) / (xs[i + 1] - xs[i]));\n }\n\n const m: number[] = new Array(n);\n m[0] = secant[0];\n m[n - 1] = secant[n - 2];\n for (let i = 1; i < n - 1; i++) {\n m[i] = secant[i - 1] * secant[i] <= 0 ? 0 : (secant[i - 1] + secant[i]) / 2;\n }\n\n for (let i = 0; i < n - 1; i++) {\n if (secant[i] === 0) {\n m[i] = 0;\n m[i + 1] = 0;\n continue;\n }\n const a = m[i] / secant[i];\n const b = m[i + 1] / secant[i];\n const s = a * a + b * b;\n if (s > 9) {\n const t = 3 / Math.sqrt(s);\n m[i] = t * a * secant[i];\n m[i + 1] = t * b * secant[i];\n }\n }\n\n return (x: number) => {\n if (x <= xs[0]) return ys[0] + m[0] * (x - xs[0]);\n if (x >= xs[n - 1]) return ys[n - 1] + m[n - 1] * (x - xs[n - 1]);\n let i = n - 2;\n while (i > 0 && x < xs[i]) i--;\n const h = dx[i];\n const t = (x - xs[i]) / h;\n const t2 = t * t;\n const t3 = t2 * t;\n return (\n (2 * t3 - 3 * t2 + 1) * ys[i] +\n (t3 - 2 * t2 + t) * h * m[i] +\n (-2 * t3 + 3 * t2) * ys[i + 1] +\n (t3 - t2) * h * m[i + 1]\n );\n };\n}\n\nfunction KineticWarpBase({\n className,\n compWidth = 1920,\n compHeight = 1080,\n textColor = \"#FFFFFF\",\n text = \"REM\\nOCN\",\n fontFamily = \"sans-serif\",\n fontUrl = \"\",\n fontWeight = 700,\n fontSize = 107.1,\n leading = 70,\n tracking = -21,\n layerScale = 480,\n positionX = 960,\n positionY = 540,\n meshRows = 2,\n meshColumns = 4,\n colRestX = 960,\n colRightX = 1255,\n colLeftX = 678,\n rowRestY = 540,\n rowDownY = 850,\n rowUpY = 387,\n keyframeStride = 20,\n easingBezier = [0.3, 0.74, 0.09, 1],\n resampleStep = 4,\n}: KineticWarpProps) {\n const frame = useCurrentFrame();\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n const [fontReady, setFontReady] = useState(false);\n\n const scale = layerScale / 100;\n const pxSize = fontSize * scale;\n const pxLeading = leading * scale;\n const pxTracking = (tracking / 1000) * pxSize;\n\n useEffect(() => {\n const handle = delayRender(\"kinetic-warp: loading font\");\n let cancelled = false;\n const done = () => {\n if (!cancelled) setFontReady(true);\n continueRender(handle);\n };\n if (typeof document === \"undefined\" || !document.fonts) {\n done();\n return;\n }\n document.fonts\n .load(`${fontWeight} ${pxSize}px \"${fontFamily}\"`)\n .then(done, done);\n return () => {\n cancelled = true;\n };\n }, [fontFamily, fontWeight, pxSize]);\n\n const source = useMemo(() => {\n if (!fontReady || typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = compWidth;\n canvas.height = compHeight;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n\n ctx.font = `${fontWeight} ${pxSize}px \"${fontFamily}\", sans-serif`;\n ctx.letterSpacing = `${pxTracking}px`;\n ctx.fillStyle = textColor;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"alphabetic\";\n\n const lines = text.split(\"\\n\");\n const metrics = lines.map((line) => ctx.measureText(line));\n\n const ascent = metrics[0].actualBoundingBoxAscent;\n const descent = metrics[metrics.length - 1].actualBoundingBoxDescent;\n const span = (lines.length - 1) * pxLeading;\n const firstBaseline = positionY - (span - ascent + descent) / 2;\n\n lines.forEach((line, i) => {\n const m = metrics[i];\n const x =\n positionX - (m.actualBoundingBoxRight - m.actualBoundingBoxLeft) / 2;\n ctx.fillText(line, x, firstBaseline + i * pxLeading);\n });\n\n return canvas;\n }, [\n compWidth,\n compHeight,\n text,\n fontFamily,\n fontWeight,\n pxSize,\n pxLeading,\n pxTracking,\n textColor,\n positionX,\n positionY,\n fontReady,\n ]);\n\n const scratch = useMemo(() => {\n if (typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = compWidth;\n canvas.height = compHeight;\n return canvas;\n }, [compWidth, compHeight]);\n\n const easing = Easing.bezier(...easingBezier);\n const stops = [0, 1, 2, 3, 4, 5].map((i) => i * keyframeStride);\n const clamp = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n } as const;\n\n const colX = interpolate(\n frame,\n stops,\n [colRestX, colRightX, colRightX, colLeftX, colLeftX, colRestX],\n clamp,\n );\n const rowY = interpolate(\n frame,\n stops,\n [rowRestY, rowRestY, rowDownY, rowDownY, rowUpY, rowRestY],\n clamp,\n );\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || !source || !scratch) return;\n const out = canvas.getContext(\"2d\");\n const mid = scratch.getContext(\"2d\");\n if (!out || !mid) return;\n\n const xs = Array.from(\n { length: meshColumns + 1 },\n (_, i) => (i * compWidth) / meshColumns,\n );\n const ys = Array.from(\n { length: meshRows + 1 },\n (_, i) => (i * compHeight) / meshRows,\n );\n const xd = xs.slice();\n const yd = ys.slice();\n xd[Math.round(meshColumns / 2)] = colX;\n yd[Math.round(meshRows / 2)] = rowY;\n\n const gx = monotoneSpline(xd, xs);\n const gy = monotoneSpline(yd, ys);\n\n mid.clearRect(0, 0, compWidth, compHeight);\n out.clearRect(0, 0, compWidth, compHeight);\n\n for (let d0 = 0; d0 < compWidth; d0 += resampleStep) {\n const d1 = Math.min(d0 + resampleStep, compWidth);\n const s0 = gx(d0);\n const sw = gx(d1) - s0;\n if (sw <= 0) continue;\n mid.drawImage(source, s0, 0, sw, compHeight, d0, 0, d1 - d0, compHeight);\n }\n\n for (let d0 = 0; d0 < compHeight; d0 += resampleStep) {\n const d1 = Math.min(d0 + resampleStep, compHeight);\n const s0 = gy(d0);\n const sh = gy(d1) - s0;\n if (sh <= 0) continue;\n out.drawImage(scratch, 0, s0, compWidth, sh, 0, d0, compWidth, d1 - d0);\n }\n }, [\n source,\n scratch,\n colX,\n rowY,\n compWidth,\n compHeight,\n meshRows,\n meshColumns,\n resampleStep,\n ]);\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n {fontUrl ? <link rel=\"stylesheet\" href={fontUrl} /> : null}\n <canvas\n ref={canvasRef}\n width={compWidth}\n height={compHeight}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"REM\\nOCN\",\n description: \"Text\",\n },\n textColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Color\",\n },\n fontFamily: {\n type: \"text-content\",\n default: \"Passion One\",\n description: \"Font family\",\n },\n fontUrl: {\n type: \"text-content\",\n default: \"https://fonts.googleapis.com/css2?family=Passion+One:wght@400;700;900&display=block\",\n description: \"Font URL\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n fontSize: {\n type: \"number\",\n min: 40,\n max: 200,\n step: 0.1,\n default: 107.1,\n description: \"Font size\",\n hiddenFromList: false,\n },\n layerScale: {\n type: \"number\",\n min: 100,\n max: 800,\n step: 10,\n default: 480,\n description: \"Layer scale (%)\",\n hiddenFromList: false,\n },\n keyframeStride: {\n type: \"number\",\n min: 5,\n max: 40,\n step: 1,\n default: 20,\n description: \"Keyframe stride\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"textColor\",\"fontFamily\",\"fontUrl\",\"fontWeight\",\"fontSize\",\"layerScale\",\"keyframeStride\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"REM\\nOCN\",\n textColor: \"#FFFFFF\",\n fontFamily: \"Passion One\",\n fontUrl: \"https://fonts.googleapis.com/css2?family=Passion+One:wght@400;700;900&display=block\",\n fontWeight: \"700\",\n fontSize: 107.1,\n layerScale: 480,\n keyframeStride: 20,\n speed: 1,\n};\n\ntype KineticWarpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof KineticWarpBase>;\n\nconst KineticWarpInner = forwardRef<\n HTMLDivElement,\n KineticWarpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<KineticWarp>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <KineticWarpBase\n {...(componentProps as unknown as ComponentProps<typeof KineticWarpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const KineticWarp = Interactive.withSchema({\n Component: KineticWarpInner,\n componentName: \"<KineticWarp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 100}diff --git a/registry-artifacts/elements/line-by-line-slide.json b/registry-artifacts/elements/line-by-line-slide.jsonindex 4fe521b6..d4174d93 100644--- a/registry-artifacts/elements/line-by-line-slide.json+++ b/registry-artifacts/elements/line-by-line-slide.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Line-by-Line Slide","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "line-by-line-slide",- "sourceCode": "import { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function LineByLineSlide({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const enterTravel = 14;\n const exitDur = 18;\n const exitTravelFrom = 8;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, distance],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n transform: `translateX(${x}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction LineByLineSlideBase({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const enterTravel = 14;\n const exitDur = 18;\n const exitTravelFrom = 8;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, distance],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n transform: `translateX(${x}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Think different.\\nDo more.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 160,\n step: 1,\n default: 48,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Think different.\\nDo more.\",\n distance: 48,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype LineByLineSlideElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LineByLineSlideBase>;\n\nconst LineByLineSlideInner = forwardRef<\n HTMLDivElement,\n LineByLineSlideElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LineByLineSlide>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LineByLineSlideBase\n {...(componentProps as unknown as ComponentProps<typeof LineByLineSlideBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LineByLineSlide = Interactive.withSchema({\n Component: LineByLineSlideInner,\n componentName: \"<LineByLineSlide>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/marker-highlight.json b/registry-artifacts/elements/marker-highlight.jsonindex 74b14e22..0044bad7 100644--- a/registry-artifacts/elements/marker-highlight.json+++ b/registry-artifacts/elements/marker-highlight.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Marker Highlight","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "marker-highlight",- "sourceCode": "import { interpolate, interpolateColors, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MarkerHighlightProps {\n before?: string;\n highlight: string;\n after?: string;\n markerColor?: string;\n baseColor?: string;\n highlightedTextColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MarkerHighlight({\n before = \"\",\n highlight,\n after = \"\",\n markerColor = \"#facc15\",\n baseColor = \"#171717\",\n highlightedTextColor = \"#171717\",\n fontSize = 72,\n fontWeight = 600,\n speed = 1,\n className,\n}: MarkerHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const markerScale = spring({\n frame: frame - 15,\n fps,\n config: { damping: 14 },\n });\n\n const textColor = interpolateColors(\n interpolate(markerScale, [0.5, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n [0, 1],\n [baseColor, highlightedTextColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ position: \"relative\", display: \"inline-block\" }}>\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n inset: \"0 -0.1em\",\n background: markerColor,\n transformOrigin: \"left center\",\n transform: `scaleX(${markerScale})`,\n zIndex: 0,\n }}\n />\n <span style={{ position: \"relative\", zIndex: 1, color: textColor }}>\n {highlight}\n </span>\n </span>\n {after}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, interpolateColors, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MarkerHighlightProps {\n before?: string;\n highlight: string;\n after?: string;\n markerColor?: string;\n baseColor?: string;\n highlightedTextColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MarkerHighlightBase({\n before = \"\",\n highlight,\n after = \"\",\n markerColor = \"#facc15\",\n baseColor = \"#171717\",\n highlightedTextColor = \"#171717\",\n fontSize = 72,\n fontWeight = 600,\n speed = 1,\n className,\n}: MarkerHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const markerScale = spring({\n frame: frame - 15,\n fps,\n config: { damping: 14 },\n });\n\n const textColor = interpolateColors(\n interpolate(markerScale, [0.5, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n [0, 1],\n [baseColor, highlightedTextColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ position: \"relative\", display: \"inline-block\" }}>\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n inset: \"0 -0.1em\",\n background: markerColor,\n transformOrigin: \"left center\",\n transform: `scaleX(${markerScale})`,\n zIndex: 0,\n }}\n />\n <span style={{ position: \"relative\", zIndex: 1, color: textColor }}>\n {highlight}\n </span>\n </span>\n {after}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n before: {\n type: \"text-content\",\n default: \"Made for \",\n description: \"Before\",\n },\n highlight: {\n type: \"text-content\",\n default: \"builders\",\n description: \"Highlight\",\n },\n after: {\n type: \"text-content\",\n default: \".\",\n description: \"After\",\n },\n markerColor: {\n type: \"color\",\n default: \"#facc15\",\n description: \"Marker color\",\n },\n baseColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Base color\",\n },\n highlightedTextColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Highlighted text color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"before\",\"highlight\",\"after\",\"markerColor\",\"baseColor\",\"highlightedTextColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n before: \"Made for \",\n highlight: \"builders\",\n after: \".\",\n markerColor: \"#facc15\",\n baseColor: \"#171717\",\n highlightedTextColor: \"#171717\",\n fontSize: 72,\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MarkerHighlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MarkerHighlightBase>;\n\nconst MarkerHighlightInner = forwardRef<\n HTMLDivElement,\n MarkerHighlightElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MarkerHighlight>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MarkerHighlightBase\n {...(componentProps as unknown as ComponentProps<typeof MarkerHighlightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MarkerHighlight = Interactive.withSchema({\n Component: MarkerHighlightInner,\n componentName: \"<MarkerHighlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/mask-reveal-up.json b/registry-artifacts/elements/mask-reveal-up.jsonindex 10b10258..d5ac8aa5 100644--- a/registry-artifacts/elements/mask-reveal-up.json+++ b/registry-artifacts/elements/mask-reveal-up.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Mask Reveal Up","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "mask-reveal-up",- "sourceCode": "import { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MaskRevealUp({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const enterTravel = 11;\n const exitDur = 16;\n const exitTravelFrom = 8;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -22],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MaskRevealUpBase({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const enterTravel = 11;\n const exitDur = 16;\n const exitTravelFrom = 8;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -22],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Designed to move.\\nBuilt to focus.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 30,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Designed to move.\\nBuilt to focus.\",\n distance: 30,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MaskRevealUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MaskRevealUpBase>;\n\nconst MaskRevealUpInner = forwardRef<\n HTMLDivElement,\n MaskRevealUpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MaskRevealUp>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MaskRevealUpBase\n {...(componentProps as unknown as ComponentProps<typeof MaskRevealUpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MaskRevealUp = Interactive.withSchema({\n Component: MaskRevealUpInner,\n componentName: \"<MaskRevealUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/matrix-decode.json b/registry-artifacts/elements/matrix-decode.jsonindex 49264a40..f4dcb521 100644--- a/registry-artifacts/elements/matrix-decode.json+++ b/registry-artifacts/elements/matrix-decode.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Matrix Decode","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "matrix-decode",- "sourceCode": "import { random, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MatrixDecodeProps {\n text: string;\n charset?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n revealDuration?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MatrixDecode({\n text,\n charset = \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize = 72,\n color = \"#22c55e\",\n fontWeight = 600,\n revealDuration = 60,\n speed = 1,\n className,\n}: MatrixDecodeProps) {\n const frame = useCurrentFrame() * speed;\n // useVideoConfig kept for consistency with sibling primitives\n useVideoConfig();\n\n let output = \"\";\n for (let i = 0; i < text.length; i++) {\n const revealFrame = (i / Math.max(text.length, 1)) * revealDuration;\n if (text[i] === \" \") {\n output += \" \";\n } else if (frame >= revealFrame) {\n output += text[i];\n } else {\n const r = random(`${i}-${Math.floor(frame / 2)}`);\n const ch = charset[Math.floor(r * charset.length)];\n output += ch;\n }\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"0.05em\",\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {output}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MatrixDecodeProps {\n text: string;\n charset?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n revealDuration?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MatrixDecodeBase({\n text,\n charset = \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize = 72,\n color = \"#22c55e\",\n fontWeight = 600,\n revealDuration = 60,\n speed = 1,\n className,\n}: MatrixDecodeProps) {\n const frame = useCurrentFrame() * speed;\n // useVideoConfig kept for consistency with sibling primitives\n useVideoConfig();\n\n let output = \"\";\n for (let i = 0; i < text.length; i++) {\n const revealFrame = (i / Math.max(text.length, 1)) * revealDuration;\n if (text[i] === \" \") {\n output += \" \";\n } else if (frame >= revealFrame) {\n output += text[i];\n } else {\n const r = random(`${i}-${Math.floor(frame / 2)}`);\n const ch = charset[Math.floor(r * charset.length)];\n output += ch;\n }\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"0.05em\",\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {output}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"DECRYPTED\",\n description: \"Text\",\n },\n charset: {\n type: \"text-content\",\n default: \"!@#$%^&*()_+-=<>?/\\\\|\",\n description: \"Charset\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#22c55e\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n revealDuration: {\n type: \"number\",\n min: 10,\n max: 240,\n step: 1,\n default: 60,\n description: \"Reveal duration\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"charset\",\"fontSize\",\"color\",\"fontWeight\",\"revealDuration\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"DECRYPTED\",\n charset: \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize: 72,\n color: \"#22c55e\",\n fontWeight: \"600\",\n revealDuration: 60,\n speed: 1,\n};\n\ntype MatrixDecodeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MatrixDecodeBase>;\n\nconst MatrixDecodeInner = forwardRef<\n HTMLDivElement,\n MatrixDecodeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MatrixDecode>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MatrixDecodeBase\n {...(componentProps as unknown as ComponentProps<typeof MatrixDecodeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MatrixDecode = Interactive.withSchema({\n Component: MatrixDecodeInner,\n componentName: \"<MatrixDecode>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/micro-scale-fade.json b/registry-artifacts/elements/micro-scale-fade.jsonindex 269b37e1..04fc301d 100644--- a/registry-artifacts/elements/micro-scale-fade.json+++ b/registry-artifacts/elements/micro-scale-fade.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Micro Scale Fade","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "micro-scale-fade",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface MicroScaleFadeProps {\n text: string;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MicroScaleFade({\n text,\n scaleFrom = 0.96,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MicroScaleFadeProps) {\n const frame = useCurrentFrame() * speed;\n const easing = Easing.bezier(0.32, 0.72, 0, 1);\n\n const opacity = interpolate(frame, [0, 18], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const scale = interpolate(frame, [0, 18], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MicroScaleFadeProps {\n text: string;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MicroScaleFadeBase({\n text,\n scaleFrom = 0.96,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MicroScaleFadeProps) {\n const frame = useCurrentFrame() * speed;\n const easing = Easing.bezier(0.32, 0.72, 0, 1);\n\n const opacity = interpolate(frame, [0, 18], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const scale = interpolate(frame, [0, 18], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Welcome to motion.\",\n description: \"Text\",\n },\n scaleFrom: {\n type: \"number\",\n min: 0.8,\n max: 1,\n step: 0.01,\n default: 0.96,\n description: \"Scale from\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"scaleFrom\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Welcome to motion.\",\n scaleFrom: 0.96,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MicroScaleFadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MicroScaleFadeBase>;\n\nconst MicroScaleFadeInner = forwardRef<\n HTMLDivElement,\n MicroScaleFadeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MicroScaleFade>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MicroScaleFadeBase\n {...(componentProps as unknown as ComponentProps<typeof MicroScaleFadeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MicroScaleFade = Interactive.withSchema({\n Component: MicroScaleFadeInner,\n componentName: \"<MicroScaleFade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/per-character-rise.json b/registry-artifacts/elements/per-character-rise.jsonindex 5e0c70e7..8fe86f16 100644--- a/registry-artifacts/elements/per-character-rise.json+++ b/registry-artifacts/elements/per-character-rise.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Per Character Rise","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "per-character-rise",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerCharacterRise({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const charTravelFrames = 10;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const travelEasing = Easing.bezier(0.2, 0.8, 0.6, 0.85);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction PerCharacterRiseBase({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const charTravelFrames = 10;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const travelEasing = Easing.bezier(0.2, 0.8, 0.6, 0.85);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"One more thing.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 32,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"One more thing.\",\n distance: 32,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype PerCharacterRiseElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerCharacterRiseBase>;\n\nconst PerCharacterRiseInner = forwardRef<\n HTMLDivElement,\n PerCharacterRiseElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PerCharacterRise>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PerCharacterRiseBase\n {...(componentProps as unknown as ComponentProps<typeof PerCharacterRiseBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerCharacterRise = Interactive.withSchema({\n Component: PerCharacterRiseInner,\n componentName: \"<PerCharacterRise>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/per-word-crossfade.json b/registry-artifacts/elements/per-word-crossfade.jsonindex 45ce0714..b9cae01b 100644--- a/registry-artifacts/elements/per-word-crossfade.json+++ b/registry-artifacts/elements/per-word-crossfade.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Per-Word Crossfade","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "per-word-crossfade",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerWordCrossfadeProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerWordCrossfade({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerWordCrossfadeProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 21;\n const enterTravel = 5;\n const exitDur = 15;\n const exitTravelFrom = 6;\n const enterStagger = 2;\n const exitStagger = 1;\n const overlapF = 5;\n const microDelayF = 2;\n\n const enterEasing = Easing.bezier(0.16, 1, 0.3, 1);\n const exitEasing = Easing.bezier(0.7, 0, 0.84, 0);\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const y = interpolate(local, [exitTravelFrom, exitDur], [0, -6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const y = interpolate(local, [0, enterTravel], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerWordCrossfadeProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction PerWordCrossfadeBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerWordCrossfadeProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 21;\n const enterTravel = 5;\n const exitDur = 15;\n const exitTravelFrom = 6;\n const enterStagger = 2;\n const exitStagger = 1;\n const overlapF = 5;\n const microDelayF = 2;\n\n const enterEasing = Easing.bezier(0.16, 1, 0.3, 1);\n const exitEasing = Easing.bezier(0.7, 0, 0.84, 0);\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const y = interpolate(local, [exitTravelFrom, exitDur], [0, -6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const y = interpolate(local, [0, enterTravel], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Beautifully simple.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Designed for focus.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Beautifully simple.\",\n toText: \"Designed for focus.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype PerWordCrossfadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerWordCrossfadeBase>;\n\nconst PerWordCrossfadeInner = forwardRef<\n HTMLDivElement,\n PerWordCrossfadeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PerWordCrossfade>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PerWordCrossfadeBase\n {...(componentProps as unknown as ComponentProps<typeof PerWordCrossfadeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerWordCrossfade = Interactive.withSchema({\n Component: PerWordCrossfadeInner,\n componentName: \"<PerWordCrossfade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/perspective-marquee.json b/registry-artifacts/elements/perspective-marquee.jsonindex e13d1376..81f6fece 100644--- a/registry-artifacts/elements/perspective-marquee.json+++ b/registry-artifacts/elements/perspective-marquee.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Perspective Marquee","durationInFrames": 240,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "perspective-marquee",- "sourceCode": "import { useCurrentFrame } from \"remotion\";\n\nexport interface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nexport function PerspectiveMarquee({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nfunction PerspectiveMarqueeBase({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fontSize: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 2,\n default: 84,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#fafafa\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n pixelsPerFrame: {\n type: \"number\",\n min: 0.25,\n max: 10,\n step: 0.25,\n default: 2,\n description: \"Pixels / frame\",\n hiddenFromList: false,\n },\n rotateY: {\n type: \"number\",\n min: -60,\n max: 60,\n step: 1,\n default: -28,\n description: \"Rotate Y (deg)\",\n hiddenFromList: false,\n },\n rotateX: {\n type: \"number\",\n min: -30,\n max: 30,\n step: 1,\n default: 8,\n description: \"Rotate X (deg)\",\n hiddenFromList: false,\n },\n perspective: {\n type: \"number\",\n min: 400,\n max: 3000,\n step: 50,\n default: 1200,\n description: \"Perspective\",\n hiddenFromList: false,\n },\n fadeColor: {\n type: \"color\",\n default: \"#050505\",\n description: \"Fade color\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fontSize\",\"color\",\"fontWeight\",\"pixelsPerFrame\",\"rotateY\",\"rotateX\",\"perspective\",\"fadeColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fontSize: 84,\n color: \"#fafafa\",\n fontWeight: \"700\",\n pixelsPerFrame: 2,\n rotateY: -28,\n rotateX: 8,\n perspective: 1200,\n fadeColor: \"#050505\",\n speed: 1,\n};\n\ntype PerspectiveMarqueeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerspectiveMarqueeBase>;\n\nconst PerspectiveMarqueeInner = forwardRef<\n HTMLDivElement,\n PerspectiveMarqueeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PerspectiveMarquee>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PerspectiveMarqueeBase\n {...(componentProps as unknown as ComponentProps<typeof PerspectiveMarqueeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerspectiveMarquee = Interactive.withSchema({\n Component: PerspectiveMarqueeInner,\n componentName: \"<PerspectiveMarquee>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 240}diff --git a/registry-artifacts/elements/perspective-squeeze.json b/registry-artifacts/elements/perspective-squeeze.jsonindex 7311a7c6..e1f12a61 100644--- a/registry-artifacts/elements/perspective-squeeze.json+++ b/registry-artifacts/elements/perspective-squeeze.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Perspective Squeeze","durationInFrames": 225,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "perspective-squeeze",- "sourceCode": "import { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\ntype Corners = [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n];\n\nexport interface PerspectiveSqueezeProps {\n className?: string;\n width?: number;\n height?: number;\n blockWidth?: number;\n blockHeight?: number;\n lowerBlockPosition?: [number, number];\n upperBlockPosition?: [number, number];\n cornersRest?: Corners;\n cornerKeyframes?: number[];\n upperCornersMid?: Corners;\n upperCornersEnd?: Corners;\n lowerCornersMid?: Corners;\n lowerCornersEnd?: Corners;\n upperText?: string;\n lowerText?: string;\n upperFontFamily?: string;\n lowerFontFamily?: string;\n upperFontSize?: number;\n lowerFontSize?: number;\n capRatio?: number;\n lineGap?: number;\n scaleKeyframes?: number[];\n lowerScaleY?: number[];\n upperScaleY?: number[];\n fill?: string;\n}\n\nfunction cornerPinMatrix(src: Corners, dst: Corners): string {\n const a: number[][] = [];\n const rhs: number[] = [];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = src[i];\n const [u, v] = dst[i];\n a.push([x, y, 1, 0, 0, 0, -u * x, -u * y]);\n rhs.push(u);\n a.push([0, 0, 0, x, y, 1, -v * x, -v * y]);\n rhs.push(v);\n }\n\n const n = 8;\n for (let col = 0; col < n; col++) {\n let pivot = col;\n for (let r = col + 1; r < n; r++) {\n if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;\n }\n [a[col], a[pivot]] = [a[pivot], a[col]];\n [rhs[col], rhs[pivot]] = [rhs[pivot], rhs[col]];\n\n const d = a[col][col];\n if (Math.abs(d) < 1e-12) continue;\n for (let c = col; c < n; c++) a[col][c] /= d;\n rhs[col] /= d;\n\n for (let r = 0; r < n; r++) {\n if (r === col) continue;\n const f = a[r][col];\n if (f === 0) continue;\n for (let c = col; c < n; c++) a[r][c] -= f * a[col][c];\n rhs[r] -= f * rhs[col];\n }\n }\n\n const [m0, m1, m2, m3, m4, m5, m6, m7] = rhs;\n return `matrix3d(${m0}, ${m3}, 0, ${m6}, ${m1}, ${m4}, 0, ${m7}, 0, 0, 1, 0, ${m2}, ${m5}, 0, 1)`;\n}\n\nfunction lerpCorners(from: Corners, to: Corners, t: number): Corners {\n return from.map((p, i) => [\n p[0] + (to[i][0] - p[0]) * t,\n p[1] + (to[i][1] - p[1]) * t,\n ]) as Corners;\n}\n\nexport function PerspectiveSqueeze({\n className,\n width = 1920,\n height = 1080,\n blockWidth = 990,\n blockHeight = 546,\n lowerBlockPosition = [960, 860],\n upperBlockPosition = [960, 314],\n cornersRest = [\n [0, 0],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n cornerKeyframes = [0, 45, 70],\n upperCornersMid = [\n [0, -326],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n upperCornersEnd = [\n [0, 352],\n [990, -428],\n [460, 546],\n [990, 546],\n ],\n lowerCornersMid = [\n [0, 0],\n [990, 0],\n [0, 225],\n [990, 546],\n ],\n lowerCornersEnd = [\n [0, 0],\n [990, 0],\n [0, 897],\n [990, 116],\n ],\n upperText = \"REMOCN\",\n lowerText = \"BEST\",\n upperFontFamily = \"sans-serif\",\n lowerFontFamily = \"sans-serif\",\n upperFontSize = 603,\n lowerFontSize = 124,\n capRatio = 0.65,\n lineGap = 50,\n scaleKeyframes = [0, 60, 118, 161, 196, 225],\n lowerScaleY = [100, 384.8, 270, 330, 150, 100],\n upperScaleY = [100, 35.8, 64, 45, 110, 100],\n fill = \"#ffffff\",\n}: PerspectiveSqueezeProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const stageScale = Math.min(compWidth / width, compHeight / height);\n\n const squishEase = Easing.bezier(0.6, 0, 0.4, 1);\n\n const scaleAt = (track: number[]) =>\n interpolate(frame, scaleKeyframes, track, {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: squishEase,\n }) / 100;\n\n const cornersAt = (mid: Corners, end: Corners): Corners => {\n const [k0, k1, k2] = cornerKeyframes;\n if (frame <= k0) return cornersRest;\n if (frame >= k2) return end;\n if (frame <= k1) {\n return lerpCorners(\n cornersRest,\n mid,\n squishEase((frame - k0) / Math.max(k1 - k0, 1)),\n );\n }\n return lerpCorners(\n mid,\n end,\n squishEase((frame - k1) / Math.max(k2 - k1, 1)),\n );\n };\n\n const upperScale = scaleAt(upperScaleY);\n const lowerScale = scaleAt(lowerScaleY);\n\n const upperBoxHeight = upperFontSize * capRatio * upperScale;\n const lowerBoxHeight = lowerFontSize * capRatio * lowerScale;\n const stackTop =\n (blockHeight - (upperBoxHeight + lineGap + lowerBoxHeight)) / 2;\n const upperBaseline = stackTop + upperBoxHeight;\n const lowerBaseline = upperBaseline + lineGap + lowerBoxHeight;\n\n const line = (\n text: string,\n family: string,\n size: number,\n baseline: number,\n scale: number,\n ) => (\n <text\n x={0}\n y={baseline}\n textLength={blockWidth}\n lengthAdjust=\"spacingAndGlyphs\"\n fontFamily={family}\n fontSize={size}\n fontWeight={800}\n fill={fill}\n transform={`matrix(1, 0, 0, ${scale}, 0, ${baseline * (1 - scale)})`}\n >\n {text}\n </text>\n );\n\n const block = (corners: Corners, position: [number, number]) => (\n <div\n style={{\n position: \"absolute\",\n left: position[0] - blockWidth / 2,\n top: position[1] - blockHeight / 2,\n width: blockWidth,\n height: blockHeight,\n transformOrigin: \"0 0\",\n transform: cornerPinMatrix(cornersRest, corners),\n }}\n >\n <svg\n width={blockWidth}\n height={blockHeight}\n viewBox={`0 0 ${blockWidth} ${blockHeight}`}\n style={{ display: \"block\", overflow: \"hidden\" }}\n >\n {line(\n upperText,\n upperFontFamily,\n upperFontSize,\n upperBaseline,\n upperScale,\n )}\n {line(\n lowerText,\n lowerFontFamily,\n lowerFontSize,\n lowerBaseline,\n lowerScale,\n )}\n </svg>\n </div>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (compWidth - width * stageScale) / 2,\n top: (compHeight - height * stageScale) / 2,\n width,\n height,\n transform: `scale(${stageScale})`,\n transformOrigin: \"0 0\",\n }}\n >\n {block(cornersAt(upperCornersMid, upperCornersEnd), upperBlockPosition)}\n {block(cornersAt(lowerCornersMid, lowerCornersEnd), lowerBlockPosition)}\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype Corners = [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n];\n\ninterface PerspectiveSqueezeProps {\n className?: string;\n width?: number;\n height?: number;\n blockWidth?: number;\n blockHeight?: number;\n lowerBlockPosition?: [number, number];\n upperBlockPosition?: [number, number];\n cornersRest?: Corners;\n cornerKeyframes?: number[];\n upperCornersMid?: Corners;\n upperCornersEnd?: Corners;\n lowerCornersMid?: Corners;\n lowerCornersEnd?: Corners;\n upperText?: string;\n lowerText?: string;\n upperFontFamily?: string;\n lowerFontFamily?: string;\n upperFontSize?: number;\n lowerFontSize?: number;\n capRatio?: number;\n lineGap?: number;\n scaleKeyframes?: number[];\n lowerScaleY?: number[];\n upperScaleY?: number[];\n fill?: string;\n}\n\nfunction cornerPinMatrix(src: Corners, dst: Corners): string {\n const a: number[][] = [];\n const rhs: number[] = [];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = src[i];\n const [u, v] = dst[i];\n a.push([x, y, 1, 0, 0, 0, -u * x, -u * y]);\n rhs.push(u);\n a.push([0, 0, 0, x, y, 1, -v * x, -v * y]);\n rhs.push(v);\n }\n\n const n = 8;\n for (let col = 0; col < n; col++) {\n let pivot = col;\n for (let r = col + 1; r < n; r++) {\n if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;\n }\n [a[col], a[pivot]] = [a[pivot], a[col]];\n [rhs[col], rhs[pivot]] = [rhs[pivot], rhs[col]];\n\n const d = a[col][col];\n if (Math.abs(d) < 1e-12) continue;\n for (let c = col; c < n; c++) a[col][c] /= d;\n rhs[col] /= d;\n\n for (let r = 0; r < n; r++) {\n if (r === col) continue;\n const f = a[r][col];\n if (f === 0) continue;\n for (let c = col; c < n; c++) a[r][c] -= f * a[col][c];\n rhs[r] -= f * rhs[col];\n }\n }\n\n const [m0, m1, m2, m3, m4, m5, m6, m7] = rhs;\n return `matrix3d(${m0}, ${m3}, 0, ${m6}, ${m1}, ${m4}, 0, ${m7}, 0, 0, 1, 0, ${m2}, ${m5}, 0, 1)`;\n}\n\nfunction lerpCorners(from: Corners, to: Corners, t: number): Corners {\n return from.map((p, i) => [\n p[0] + (to[i][0] - p[0]) * t,\n p[1] + (to[i][1] - p[1]) * t,\n ]) as Corners;\n}\n\nfunction PerspectiveSqueezeBase({\n className,\n width = 1920,\n height = 1080,\n blockWidth = 990,\n blockHeight = 546,\n lowerBlockPosition = [960, 860],\n upperBlockPosition = [960, 314],\n cornersRest = [\n [0, 0],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n cornerKeyframes = [0, 45, 70],\n upperCornersMid = [\n [0, -326],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n upperCornersEnd = [\n [0, 352],\n [990, -428],\n [460, 546],\n [990, 546],\n ],\n lowerCornersMid = [\n [0, 0],\n [990, 0],\n [0, 225],\n [990, 546],\n ],\n lowerCornersEnd = [\n [0, 0],\n [990, 0],\n [0, 897],\n [990, 116],\n ],\n upperText = \"REMOCN\",\n lowerText = \"BEST\",\n upperFontFamily = \"sans-serif\",\n lowerFontFamily = \"sans-serif\",\n upperFontSize = 603,\n lowerFontSize = 124,\n capRatio = 0.65,\n lineGap = 50,\n scaleKeyframes = [0, 60, 118, 161, 196, 225],\n lowerScaleY = [100, 384.8, 270, 330, 150, 100],\n upperScaleY = [100, 35.8, 64, 45, 110, 100],\n fill = \"#ffffff\",\n}: PerspectiveSqueezeProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const stageScale = Math.min(compWidth / width, compHeight / height);\n\n const squishEase = Easing.bezier(0.6, 0, 0.4, 1);\n\n const scaleAt = (track: number[]) =>\n interpolate(frame, scaleKeyframes, track, {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: squishEase,\n }) / 100;\n\n const cornersAt = (mid: Corners, end: Corners): Corners => {\n const [k0, k1, k2] = cornerKeyframes;\n if (frame <= k0) return cornersRest;\n if (frame >= k2) return end;\n if (frame <= k1) {\n return lerpCorners(\n cornersRest,\n mid,\n squishEase((frame - k0) / Math.max(k1 - k0, 1)),\n );\n }\n return lerpCorners(\n mid,\n end,\n squishEase((frame - k1) / Math.max(k2 - k1, 1)),\n );\n };\n\n const upperScale = scaleAt(upperScaleY);\n const lowerScale = scaleAt(lowerScaleY);\n\n const upperBoxHeight = upperFontSize * capRatio * upperScale;\n const lowerBoxHeight = lowerFontSize * capRatio * lowerScale;\n const stackTop =\n (blockHeight - (upperBoxHeight + lineGap + lowerBoxHeight)) / 2;\n const upperBaseline = stackTop + upperBoxHeight;\n const lowerBaseline = upperBaseline + lineGap + lowerBoxHeight;\n\n const line = (\n text: string,\n family: string,\n size: number,\n baseline: number,\n scale: number,\n ) => (\n <text\n x={0}\n y={baseline}\n textLength={blockWidth}\n lengthAdjust=\"spacingAndGlyphs\"\n fontFamily={family}\n fontSize={size}\n fontWeight={800}\n fill={fill}\n transform={`matrix(1, 0, 0, ${scale}, 0, ${baseline * (1 - scale)})`}\n >\n {text}\n </text>\n );\n\n const block = (corners: Corners, position: [number, number]) => (\n <div\n style={{\n position: \"absolute\",\n left: position[0] - blockWidth / 2,\n top: position[1] - blockHeight / 2,\n width: blockWidth,\n height: blockHeight,\n transformOrigin: \"0 0\",\n transform: cornerPinMatrix(cornersRest, corners),\n }}\n >\n <svg\n width={blockWidth}\n height={blockHeight}\n viewBox={`0 0 ${blockWidth} ${blockHeight}`}\n style={{ display: \"block\", overflow: \"hidden\" }}\n >\n {line(\n upperText,\n upperFontFamily,\n upperFontSize,\n upperBaseline,\n upperScale,\n )}\n {line(\n lowerText,\n lowerFontFamily,\n lowerFontSize,\n lowerBaseline,\n lowerScale,\n )}\n </svg>\n </div>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (compWidth - width * stageScale) / 2,\n top: (compHeight - height * stageScale) / 2,\n width,\n height,\n transform: `scale(${stageScale})`,\n transformOrigin: \"0 0\",\n }}\n >\n {block(cornersAt(upperCornersMid, upperCornersEnd), upperBlockPosition)}\n {block(cornersAt(lowerCornersMid, lowerCornersEnd), lowerBlockPosition)}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n upperText: {\n type: \"text-content\",\n default: \"REMOCN\",\n description: \"Upper line\",\n },\n lowerText: {\n type: \"text-content\",\n default: \"BEST\",\n description: \"Lower line\",\n },\n fill: {\n type: \"color\",\n default: \"#f2f2f2\",\n description: \"Fill\",\n },\n upperFontFamily: {\n type: \"text-content\",\n default: \"Impact, 'Arial Narrow', sans-serif\",\n description: \"Upper font\",\n },\n lowerFontFamily: {\n type: \"text-content\",\n default: \"Impact, 'Arial Narrow', sans-serif\",\n description: \"Lower font\",\n },\n lineGap: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 2,\n default: 50,\n description: \"Line gap\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"upperText\",\"lowerText\",\"fill\",\"upperFontFamily\",\"lowerFontFamily\",\"lineGap\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n upperText: \"REMOCN\",\n lowerText: \"BEST\",\n fill: \"#f2f2f2\",\n upperFontFamily: \"Impact, 'Arial Narrow', sans-serif\",\n lowerFontFamily: \"Impact, 'Arial Narrow', sans-serif\",\n lineGap: 50,\n speed: 1,\n};\n\ntype PerspectiveSqueezeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerspectiveSqueezeBase>;\n\nconst PerspectiveSqueezeInner = forwardRef<\n HTMLDivElement,\n PerspectiveSqueezeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PerspectiveSqueeze>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PerspectiveSqueezeBase\n {...(componentProps as unknown as ComponentProps<typeof PerspectiveSqueezeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerspectiveSqueeze = Interactive.withSchema({\n Component: PerspectiveSqueezeInner,\n componentName: \"<PerspectiveSqueeze>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 225}diff --git a/registry-artifacts/elements/pixelate-region.json b/registry-artifacts/elements/pixelate-region.jsonindex be2785b2..41c2292d 100644--- a/registry-artifacts/elements/pixelate-region.json+++ b/registry-artifacts/elements/pixelate-region.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Pixelate Region","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "pixelate-region",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type PixelateRect = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type PixelateRegionProps = {\n regions: PixelateRect[];\n cellSize?: number;\n};\n\nconst MAX_REGIONS = 8;\n\nconst DEFAULTS = {\n cellSize: 24,\n};\n\ntype NormalizedProps = {\n rects: PixelateRect[];\n cellX: number;\n cellY: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec4 u_regions[${MAX_REGIONS}];\nuniform int u_region_count;\nuniform vec2 u_cell;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 3;\n\nvec4 cellAverage(vec2 center, vec2 cell) {\n vec4 sum = vec4(0.0);\n for (int y = 0; y < TAPS; y++) {\n for (int x = 0; x < TAPS; x++) {\n vec2 offset =\n (vec2(float(x), float(y)) + 0.5) / float(TAPS) - 0.5;\n sum += texture(u_scene, center + offset * cell);\n }\n }\n return sum / float(TAPS * TAPS);\n}\n\nvoid main() {\n vec4 result = texture(u_scene, v_uv);\n vec2 cell = max(u_cell, vec2(0.0005));\n\n for (int i = 0; i < ${MAX_REGIONS}; i++) {\n if (i >= u_region_count) {\n continue;\n }\n vec4 region = u_regions[i];\n vec2 lo = region.xy;\n vec2 hi = region.xy + region.zw;\n vec2 hit = step(lo, v_uv) * step(v_uv, hi);\n if (hit.x * hit.y < 0.5) {\n continue;\n }\n vec2 center = lo + (floor((v_uv - lo) / cell) + 0.5) * cell;\n result = vec4(cellAverage(center, cell).rgb, 1.0);\n }\n\n outColor = result;\n}`;\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { rects, cellX, cellY } = passedProps;\n const packed = new Float32Array(MAX_REGIONS * 4);\n const count = Math.min(rects.length, MAX_REGIONS);\n for (let i = 0; i < count; i++) {\n const rect = rects[i];\n packed[i * 4] = rect.x;\n packed[i * 4 + 1] = rect.y;\n packed[i * 4 + 2] = rect.width;\n packed[i * 4 + 3] = rect.height;\n }\n gl.uniform4fv(uniform(\"u_regions[0]\"), packed);\n gl.uniform1i(uniform(\"u_region_count\"), count);\n gl.uniform2f(uniform(\"u_cell\"), cellX, cellY);\n },\n);\n\nconst PixelateRegionFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n rects,\n}) => (\n <AbsoluteFill>\n {children}\n {rects.map((rect) => (\n <div\n key={`${rect.x}-${rect.y}-${rect.width}-${rect.height}`}\n style={{\n position: \"absolute\",\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n background: \"#14161c\",\n }}\n />\n ))}\n </AbsoluteFill>\n);\n\nconst PixelateRegionCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: PixelateRegionFallback,\n});\n\nexport const PixelateRegion: React.FC<\n PixelateRegionProps & CanvasFilterProps\n> = ({ regions, cellSize = DEFAULTS.cellSize, children }) => {\n const { width, height } = useVideoConfig();\n\n if (regions.length > MAX_REGIONS) {\n throw new Error(\n `pixelate-region: at most ${MAX_REGIONS} regions can be covered at once, received ${regions.length}. Dropping any of them would leave what it covered visible, so nest a second PixelateRegion instead.`,\n );\n }\n\n const rects = regions.map((region) => ({\n x: region.x / width,\n y: region.y / height,\n width: region.width / width,\n height: region.height / height,\n }));\n\n return (\n <PixelateRegionCanvas\n rects={rects}\n cellX={cellSize / width}\n cellY={cellSize / height}\n >\n {children}\n </PixelateRegionCanvas>\n );\n};"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype PixelateRect = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\ntype PixelateRegionProps = {\n regions: PixelateRect[];\n cellSize?: number;\n};\n\nconst MAX_REGIONS = 8;\n\nconst DEFAULTS = {\n cellSize: 24,\n};\n\ntype NormalizedProps = {\n rects: PixelateRect[];\n cellX: number;\n cellY: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec4 u_regions[${MAX_REGIONS}];\nuniform int u_region_count;\nuniform vec2 u_cell;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 3;\n\nvec4 cellAverage(vec2 center, vec2 cell) {\n vec4 sum = vec4(0.0);\n for (int y = 0; y < TAPS; y++) {\n for (int x = 0; x < TAPS; x++) {\n vec2 offset =\n (vec2(float(x), float(y)) + 0.5) / float(TAPS) - 0.5;\n sum += texture(u_scene, center + offset * cell);\n }\n }\n return sum / float(TAPS * TAPS);\n}\n\nvoid main() {\n vec4 result = texture(u_scene, v_uv);\n vec2 cell = max(u_cell, vec2(0.0005));\n\n for (int i = 0; i < ${MAX_REGIONS}; i++) {\n if (i >= u_region_count) {\n continue;\n }\n vec4 region = u_regions[i];\n vec2 lo = region.xy;\n vec2 hi = region.xy + region.zw;\n vec2 hit = step(lo, v_uv) * step(v_uv, hi);\n if (hit.x * hit.y < 0.5) {\n continue;\n }\n vec2 center = lo + (floor((v_uv - lo) / cell) + 0.5) * cell;\n result = vec4(cellAverage(center, cell).rgb, 1.0);\n }\n\n outColor = result;\n}`;\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { rects, cellX, cellY } = passedProps;\n const packed = new Float32Array(MAX_REGIONS * 4);\n const count = Math.min(rects.length, MAX_REGIONS);\n for (let i = 0; i < count; i++) {\n const rect = rects[i];\n packed[i * 4] = rect.x;\n packed[i * 4 + 1] = rect.y;\n packed[i * 4 + 2] = rect.width;\n packed[i * 4 + 3] = rect.height;\n }\n gl.uniform4fv(uniform(\"u_regions[0]\"), packed);\n gl.uniform1i(uniform(\"u_region_count\"), count);\n gl.uniform2f(uniform(\"u_cell\"), cellX, cellY);\n },\n);\n\nconst PixelateRegionFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n rects,\n}) => (\n <AbsoluteFill>\n {children}\n {rects.map((rect) => (\n <div\n key={`${rect.x}-${rect.y}-${rect.width}-${rect.height}`}\n style={{\n position: \"absolute\",\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n background: \"#14161c\",\n }}\n />\n ))}\n </AbsoluteFill>\n);\n\nconst PixelateRegionCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: PixelateRegionFallback,\n});\n\nconst PixelateRegionBase: React.FC<\n PixelateRegionProps & CanvasFilterProps\n> = ({ regions, cellSize = DEFAULTS.cellSize, children }) => {\n const { width, height } = useVideoConfig();\n\n if (regions.length > MAX_REGIONS) {\n throw new Error(\n `pixelate-region: at most ${MAX_REGIONS} regions can be covered at once, received ${regions.length}. Dropping any of them would leave what it covered visible, so nest a second PixelateRegionBase instead.`,\n );\n }\n\n const rects = regions.map((region) => ({\n x: region.x / width,\n y: region.y / height,\n width: region.width / width,\n height: region.height / height,\n }));\n\n return (\n <PixelateRegionCanvas\n rects={rects}\n cellX={cellSize / width}\n cellY={cellSize / height}\n >\n {children}\n </PixelateRegionCanvas>\n );\n};\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n cellSize: {\n type: \"number\",\n min: 6,\n max: 72,\n step: 2,\n default: 24,\n description: \"Cell size\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"cellSize\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n cellSize: 24,\n speed: 1,\n};\n\ntype PixelateRegionElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PixelateRegionBase>;\n\nconst PixelateRegionInner = forwardRef<\n HTMLDivElement,\n PixelateRegionElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<PixelateRegion>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <PixelateRegionBase\n {...(componentProps as unknown as ComponentProps<typeof PixelateRegionBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PixelateRegion = Interactive.withSchema({\n Component: PixelateRegionInner,\n componentName: \"<PixelateRegion>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/reel.json b/registry-artifacts/elements/reel.jsonindex 83d93c06..d4fe767b 100644--- a/registry-artifacts/elements/reel.json+++ b/registry-artifacts/elements/reel.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Reel","durationInFrames": 160,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "reel",- "sourceCode": "import { AbsoluteFill, Easing, Img, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst EASE_OUT = Easing.out(Easing.cubic);\n\nexport type ReelProps = {\n images: string[];\n width?: number;\n height?: number;\n radius?: number;\n step?: number;\n reveal?: number;\n objectPosition?: string;\n background?: string;\n};\n\nexport function Reel({\n images,\n width = 1180,\n height = 676,\n radius = 16,\n step = 20,\n reveal = 13,\n objectPosition = \"top\",\n background = \"#050506\",\n}: ReelProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const left = (compWidth - width) / 2;\n const top = (compHeight - height) / 2;\n\n return (\n <AbsoluteFill>\n {images.map((src, i) => {\n const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {\n ...clamp,\n easing: EASE_OUT,\n });\n if (p <= 0) return null;\n const inset = (1 - p) * 50;\n const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left,\n top,\n width,\n height,\n zIndex: i,\n clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n background,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.6)\",\n willChange: \"clip-path\",\n }}\n >\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n objectPosition,\n transform: `scale(${imgScale})`,\n willChange: \"transform\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}"+ "sourceCode": "import { AbsoluteFill, Easing, Img, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst EASE_OUT = Easing.out(Easing.cubic);\n\ntype ReelProps = {\n images: string[];\n width?: number;\n height?: number;\n radius?: number;\n step?: number;\n reveal?: number;\n objectPosition?: string;\n background?: string;\n};\n\nfunction ReelBase({\n images,\n width = 1180,\n height = 676,\n radius = 16,\n step = 20,\n reveal = 13,\n objectPosition = \"top\",\n background = \"#050506\",\n}: ReelProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const left = (compWidth - width) / 2;\n const top = (compHeight - height) / 2;\n\n return (\n <AbsoluteFill>\n {images.map((src, i) => {\n const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {\n ...clamp,\n easing: EASE_OUT,\n });\n if (p <= 0) return null;\n const inset = (1 - p) * 50;\n const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left,\n top,\n width,\n height,\n zIndex: i,\n clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n background,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.6)\",\n willChange: \"clip-path\",\n }}\n >\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n objectPosition,\n transform: `scale(${imgScale})`,\n willChange: \"transform\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n width: {\n type: \"number\",\n min: 600,\n max: 1280,\n step: 20,\n default: 1180,\n description: \"Card width\",\n hiddenFromList: false,\n },\n height: {\n type: \"number\",\n min: 360,\n max: 720,\n step: 4,\n default: 676,\n description: \"Card height\",\n hiddenFromList: false,\n },\n radius: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 16,\n description: \"Corner radius\",\n hiddenFromList: false,\n },\n step: {\n type: \"number\",\n min: 6,\n max: 40,\n step: 1,\n default: 20,\n description: \"Frames / image\",\n hiddenFromList: false,\n },\n reveal: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 13,\n description: \"Reveal frames\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"width\",\"height\",\"radius\",\"step\",\"reveal\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n width: 1180,\n height: 676,\n radius: 16,\n step: 20,\n reveal: 13,\n speed: 1,\n};\n\ntype ReelElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ReelBase>;\n\nconst ReelInner = forwardRef<\n HTMLDivElement,\n ReelElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<Reel>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ReelBase\n {...(componentProps as unknown as ComponentProps<typeof ReelBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Reel = Interactive.withSchema({\n Component: ReelInner,\n componentName: \"<Reel>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 160}diff --git a/registry-artifacts/elements/rgb-glitch-text.json b/registry-artifacts/elements/rgb-glitch-text.jsonindex 35b58f5e..9cb568a7 100644--- a/registry-artifacts/elements/rgb-glitch-text.json+++ b/registry-artifacts/elements/rgb-glitch-text.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "RGB Glitch Text","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "rgb-glitch-text",- "sourceCode": "import { random, useCurrentFrame } from \"remotion\";\n\nexport interface RGBGlitchTextProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n glitchAt?: number;\n glitchDuration?: number;\n intensity?: number;\n seed?: string;\n speed?: number;\n className?: string;\n}\n\nexport function RGBGlitchText({\n text,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n glitchAt = 20,\n glitchDuration = 8,\n intensity = 6,\n seed = \"glitch\",\n speed = 1,\n className,\n}: RGBGlitchTextProps) {\n const frame = useCurrentFrame() * speed;\n\n const isGlitching = frame >= glitchAt && frame < glitchAt + glitchDuration;\n\n const offset = (axisSeed: string, scale: number) =>\n (random(`${seed}-${axisSeed}-${frame}`) * 2 - 1) * scale;\n\n const rX = isGlitching ? offset(\"r-x\", intensity) : 0;\n const rY = isGlitching ? offset(\"r-y\", intensity * 0.4) : 0;\n const gX = isGlitching ? offset(\"g-x\", intensity) : 0;\n const gY = isGlitching ? offset(\"g-y\", intensity * 0.4) : 0;\n const bX = isGlitching ? offset(\"b-x\", intensity) : 0;\n const bY = isGlitching ? offset(\"b-y\", intensity * 0.4) : 0;\n\n const copyOpacity = isGlitching ? 1 : 0;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n mixBlendMode: \"multiply\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#fafafa\",\n }}\n >\n <div\n className={className}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <span\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#ff0040\",\n opacity: copyOpacity,\n transform: `translateX(${rX}px) translateY(${rY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#00ff80\",\n opacity: copyOpacity,\n transform: `translateX(${gX}px) translateY(${gY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#0080ff\",\n opacity: copyOpacity,\n transform: `translateX(${bX}px) translateY(${bY}px)`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, random, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface RGBGlitchTextProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n glitchAt?: number;\n glitchDuration?: number;\n intensity?: number;\n seed?: string;\n speed?: number;\n className?: string;\n}\n\nfunction RGBGlitchTextBase({\n text,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n glitchAt = 20,\n glitchDuration = 8,\n intensity = 6,\n seed = \"glitch\",\n speed = 1,\n className,\n}: RGBGlitchTextProps) {\n const frame = useCurrentFrame() * speed;\n\n const isGlitching = frame >= glitchAt && frame < glitchAt + glitchDuration;\n\n const offset = (axisSeed: string, scale: number) =>\n (random(`${seed}-${axisSeed}-${frame}`) * 2 - 1) * scale;\n\n const rX = isGlitching ? offset(\"r-x\", intensity) : 0;\n const rY = isGlitching ? offset(\"r-y\", intensity * 0.4) : 0;\n const gX = isGlitching ? offset(\"g-x\", intensity) : 0;\n const gY = isGlitching ? offset(\"g-y\", intensity * 0.4) : 0;\n const bX = isGlitching ? offset(\"b-x\", intensity) : 0;\n const bY = isGlitching ? offset(\"b-y\", intensity * 0.4) : 0;\n\n const copyOpacity = isGlitching ? 1 : 0;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n mixBlendMode: \"multiply\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#fafafa\",\n }}\n >\n <div\n className={className}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <span\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#ff0040\",\n opacity: copyOpacity,\n transform: `translateX(${rX}px) translateY(${rY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#00ff80\",\n opacity: copyOpacity,\n transform: `translateX(${gX}px) translateY(${gY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#0080ff\",\n opacity: copyOpacity,\n transform: `translateX(${bX}px) translateY(${bY}px)`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"GLITCH\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n glitchAt: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 20,\n description: \"Glitch at (frame)\",\n hiddenFromList: false,\n },\n glitchDuration: {\n type: \"number\",\n min: 1,\n max: 60,\n step: 1,\n default: 8,\n description: \"Glitch duration\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 6,\n description: \"Intensity (px)\",\n hiddenFromList: false,\n },\n seed: {\n type: \"text-content\",\n default: \"glitch\",\n description: \"Seed\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"glitchAt\",\"glitchDuration\",\"intensity\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"GLITCH\",\n fontSize: 96,\n color: \"#171717\",\n fontWeight: \"700\",\n glitchAt: 20,\n glitchDuration: 8,\n intensity: 6,\n seed: \"glitch\",\n speed: 1,\n};\n\ntype RGBGlitchTextElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RGBGlitchTextBase>;\n\nconst RGBGlitchTextInner = forwardRef<\n HTMLDivElement,\n RGBGlitchTextElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<RGBGlitchText>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <RGBGlitchTextBase\n {...(componentProps as unknown as ComponentProps<typeof RGBGlitchTextBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RGBGlitchText = Interactive.withSchema({\n Component: RGBGlitchTextInner,\n componentName: \"<RGBGlitchText>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/rolling-number.json b/registry-artifacts/elements/rolling-number.jsonindex 2d43506c..fb5ff061 100644--- a/registry-artifacts/elements/rolling-number.json+++ b/registry-artifacts/elements/rolling-number.json@@ -13,7 +13,7 @@"durationInFrames": 150,"installationMode": "wrapped","slug": "rolling-number",- "sourceCode": "import { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport { AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nimport type React from \"react\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}"+ "sourceCode": "import { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport { AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport React from \"react\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/rolodex-flip.json b/registry-artifacts/elements/rolodex-flip.jsonindex 350916e3..160ab987 100644--- a/registry-artifacts/elements/rolodex-flip.json+++ b/registry-artifacts/elements/rolodex-flip.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Rolodex Flip","durationInFrames": 110,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "rolodex-flip",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nimport type React from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport interface RolodexFlipProps {\n items: string[];\n from?: number;\n interval?: number;\n flipDuration?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function RolodexFlip({\n items,\n from = 0,\n interval = 20,\n flipDuration = 10,\n className,\n style,\n}: RolodexFlipProps) {\n const frame = useCurrentFrame();\n const sizer = items.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n perspective: 420,\n verticalAlign: \"bottom\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {items.map((item, i) => {\n const inStart = from + (i - 1) * interval + flipDuration / 2;\n const outStart = from + i * interval;\n\n let rotate = 0;\n let y = 0;\n let opacity = 1;\n\n if (i > 0) {\n const pIn = interpolate(\n frame,\n [inStart, inStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.out(Easing.cubic) },\n );\n rotate = (1 - pIn) * -85;\n y = (1 - pIn) * 20;\n opacity = pIn;\n }\n if (i < items.length - 1) {\n const pOut = interpolate(\n frame,\n [outStart, outStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.in(Easing.cubic) },\n );\n rotate += pOut * 85;\n y -= pOut * 20;\n opacity *= 1 - pOut;\n }\n if (opacity <= 0.001) return null;\n\n return (\n <span\n key={`${i}-${item}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px) rotateX(${rotate}deg)`,\n transformOrigin: \"50% 50%\",\n backfaceVisibility: \"hidden\",\n }}\n >\n {item}\n </span>\n );\n })}\n </span>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ninterface RolodexFlipProps {\n items: string[];\n from?: number;\n interval?: number;\n flipDuration?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction RolodexFlipBase({\n items,\n from = 0,\n interval = 20,\n flipDuration = 10,\n className,\n style,\n}: RolodexFlipProps) {\n const frame = useCurrentFrame();\n const sizer = items.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n perspective: 420,\n verticalAlign: \"bottom\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {items.map((item, i) => {\n const inStart = from + (i - 1) * interval + flipDuration / 2;\n const outStart = from + i * interval;\n\n let rotate = 0;\n let y = 0;\n let opacity = 1;\n\n if (i > 0) {\n const pIn = interpolate(\n frame,\n [inStart, inStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.out(Easing.cubic) },\n );\n rotate = (1 - pIn) * -85;\n y = (1 - pIn) * 20;\n opacity = pIn;\n }\n if (i < items.length - 1) {\n const pOut = interpolate(\n frame,\n [outStart, outStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.in(Easing.cubic) },\n );\n rotate += pOut * 85;\n y -= pOut * 20;\n opacity *= 1 - pOut;\n }\n if (opacity <= 0.001) return null;\n\n return (\n <span\n key={`${i}-${item}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px) rotateX(${rotate}deg)`,\n transformOrigin: \"50% 50%\",\n backfaceVisibility: \"hidden\",\n }}\n >\n {item}\n </span>\n );\n })}\n </span>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n interval: {\n type: \"number\",\n min: 10,\n max: 40,\n step: 2,\n default: 20,\n description: \"Interval\",\n hiddenFromList: false,\n },\n flipDuration: {\n type: \"number\",\n min: 4,\n max: 20,\n step: 1,\n default: 10,\n description: \"Flip duration\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"interval\",\"flipDuration\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n interval: 20,\n flipDuration: 10,\n speed: 1,\n};\n\ntype RolodexFlipElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RolodexFlipBase>;\n\nconst RolodexFlipInner = forwardRef<\n HTMLDivElement,\n RolodexFlipElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<RolodexFlip>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <RolodexFlipBase\n {...(componentProps as unknown as ComponentProps<typeof RolodexFlipBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RolodexFlip = Interactive.withSchema({\n Component: RolodexFlipInner,\n componentName: \"<RolodexFlip>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 110}diff --git a/registry-artifacts/elements/scale-down-fade.json b/registry-artifacts/elements/scale-down-fade.jsonindex a33cc17d..979d41e8 100644--- a/registry-artifacts/elements/scale-down-fade.json+++ b/registry-artifacts/elements/scale-down-fade.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Scale Down Fade","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "scale-down-fade",- "sourceCode": "import { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ScaleDownFade({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ScaleDownFadeBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Quietly refined.\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Quietly refined.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ScaleDownFadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ScaleDownFadeBase>;\n\nconst ScaleDownFadeInner = forwardRef<\n HTMLDivElement,\n ScaleDownFadeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ScaleDownFade>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ScaleDownFadeBase\n {...(componentProps as unknown as ComponentProps<typeof ScaleDownFadeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ScaleDownFade = Interactive.withSchema({\n Component: ScaleDownFadeInner,\n componentName: \"<ScaleDownFade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/security-cam.json b/registry-artifacts/elements/security-cam.jsonindex c60d0529..e9a30f8f 100644--- a/registry-artifacts/elements/security-cam.json+++ b/registry-artifacts/elements/security-cam.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Security Cam","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "security-cam",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type SecurityCamProps = {\n compression?: number;\n blockSize?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n compression: 0.7,\n blockSize: 10,\n noise: 0.6,\n intensity: 1,\n};\n\ntype NormalizedProps = {\n compression: number;\n cellX: number;\n cellY: number;\n noise: number;\n intensity: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform vec2 u_cell;\nuniform float u_compression;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\nfloat lumaOf(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nvec2 chromaOf(vec3 c) {\n return vec2(c.b - lumaOf(c), c.r - lumaOf(c));\n}\n\nvec3 fromLumaChroma(float y, vec2 cbcr) {\n return vec3(y + cbcr.y, y - 0.194 * cbcr.x - 0.509 * cbcr.y, y + cbcr.x);\n}\n\nvec3 blockMean(vec2 origin, vec2 cell) {\n vec3 total = vec3(0.0);\n for (int y = 0; y < 2; y++) {\n for (int x = 0; x < 2; x++) {\n vec2 at = origin + (vec2(float(x), float(y)) + 0.5) * cell * 0.5;\n total += texture(u_scene, at).rgb;\n }\n }\n return total * 0.25;\n}\n\nvoid main() {\n vec4 src = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n if (!(amount > 0.001)) {\n outColor = src;\n return;\n }\n\n vec2 cell = max(u_cell, vec2(0.0008));\n vec2 wide = cell * 2.0;\n\n vec3 lumaBlock = blockMean(floor(v_uv / cell) * cell, cell);\n vec3 chromaBlock = blockMean(floor(v_uv / wide) * wide, wide);\n\n float squeeze = clamp(u_compression, 0.0, 1.0) * amount;\n\n float y = mix(lumaOf(src.rgb), lumaOf(lumaBlock), squeeze * 0.8);\n float levels = mix(255.0, 20.0, squeeze);\n y = floor(y * levels + 0.5) / levels;\n\n vec2 cbcr = mix(chromaOf(src.rgb), chromaOf(chromaBlock), squeeze);\n cbcr *= mix(1.0, 0.62, amount);\n\n vec3 color = fromLumaChroma(y, cbcr);\n\n float pump = 1.0 + 0.03 * sin(u_frame * PI / 45.0) * amount;\n color = clamp((color * pump - 0.05 * amount) / (1.0 - 0.14 * amount), 0.0, 1.0);\n\n float clock = mod(u_frame, 64.0);\n float shadow = 1.0 - smoothstep(0.0, 0.55, y);\n float grain =\n hash(v_uv + vec2(clock * 0.017, clock * 0.029)) - 0.5;\n color += grain * 0.16 * u_noise * amount * (0.25 + shadow);\n\n outColor = vec4(clamp(color, 0.0, 1.0), src.a);\n}`;\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { compression, cellX, cellY, noise, intensity } = passedProps;\n gl.uniform1f(uniform(\"u_compression\"), compression);\n gl.uniform2f(uniform(\"u_cell\"), cellX, cellY);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst SecurityCamFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n intensity,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n filter: `saturate(${1 - 0.38 * intensity}) contrast(${1 + 0.22 * intensity}) brightness(${1 - 0.05 * intensity})`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse 82% 80% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.55) 100%)\",\n opacity: intensity,\n }}\n />\n </AbsoluteFill>\n);\n\nconst SecurityCamCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: SecurityCamFallback,\n});\n\nexport const SecurityCam: React.FC<SecurityCamProps & CanvasFilterProps> = ({\n compression = DEFAULTS.compression,\n blockSize = DEFAULTS.blockSize,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n children,\n}) => {\n const { width, height } = useVideoConfig();\n\n return (\n <SecurityCamCanvas\n compression={compression}\n cellX={Math.max(blockSize, 1) / width}\n cellY={Math.max(blockSize, 1) / height}\n noise={noise}\n intensity={intensity}\n >\n {children}\n </SecurityCamCanvas>\n );\n};"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype SecurityCamProps = {\n compression?: number;\n blockSize?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n compression: 0.7,\n blockSize: 10,\n noise: 0.6,\n intensity: 1,\n};\n\ntype NormalizedProps = {\n compression: number;\n cellX: number;\n cellY: number;\n noise: number;\n intensity: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform vec2 u_cell;\nuniform float u_compression;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\nfloat lumaOf(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nvec2 chromaOf(vec3 c) {\n return vec2(c.b - lumaOf(c), c.r - lumaOf(c));\n}\n\nvec3 fromLumaChroma(float y, vec2 cbcr) {\n return vec3(y + cbcr.y, y - 0.194 * cbcr.x - 0.509 * cbcr.y, y + cbcr.x);\n}\n\nvec3 blockMean(vec2 origin, vec2 cell) {\n vec3 total = vec3(0.0);\n for (int y = 0; y < 2; y++) {\n for (int x = 0; x < 2; x++) {\n vec2 at = origin + (vec2(float(x), float(y)) + 0.5) * cell * 0.5;\n total += texture(u_scene, at).rgb;\n }\n }\n return total * 0.25;\n}\n\nvoid main() {\n vec4 src = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n if (!(amount > 0.001)) {\n outColor = src;\n return;\n }\n\n vec2 cell = max(u_cell, vec2(0.0008));\n vec2 wide = cell * 2.0;\n\n vec3 lumaBlock = blockMean(floor(v_uv / cell) * cell, cell);\n vec3 chromaBlock = blockMean(floor(v_uv / wide) * wide, wide);\n\n float squeeze = clamp(u_compression, 0.0, 1.0) * amount;\n\n float y = mix(lumaOf(src.rgb), lumaOf(lumaBlock), squeeze * 0.8);\n float levels = mix(255.0, 20.0, squeeze);\n y = floor(y * levels + 0.5) / levels;\n\n vec2 cbcr = mix(chromaOf(src.rgb), chromaOf(chromaBlock), squeeze);\n cbcr *= mix(1.0, 0.62, amount);\n\n vec3 color = fromLumaChroma(y, cbcr);\n\n float pump = 1.0 + 0.03 * sin(u_frame * PI / 45.0) * amount;\n color = clamp((color * pump - 0.05 * amount) / (1.0 - 0.14 * amount), 0.0, 1.0);\n\n float clock = mod(u_frame, 64.0);\n float shadow = 1.0 - smoothstep(0.0, 0.55, y);\n float grain =\n hash(v_uv + vec2(clock * 0.017, clock * 0.029)) - 0.5;\n color += grain * 0.16 * u_noise * amount * (0.25 + shadow);\n\n outColor = vec4(clamp(color, 0.0, 1.0), src.a);\n}`;\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { compression, cellX, cellY, noise, intensity } = passedProps;\n gl.uniform1f(uniform(\"u_compression\"), compression);\n gl.uniform2f(uniform(\"u_cell\"), cellX, cellY);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst SecurityCamFallback: React.FC<NormalizedProps & CanvasFilterProps> = ({\n children,\n intensity,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n filter: `saturate(${1 - 0.38 * intensity}) contrast(${1 + 0.22 * intensity}) brightness(${1 - 0.05 * intensity})`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse 82% 80% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.55) 100%)\",\n opacity: intensity,\n }}\n />\n </AbsoluteFill>\n);\n\nconst SecurityCamCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: SecurityCamFallback,\n});\n\nconst SecurityCamBase: React.FC<SecurityCamProps & CanvasFilterProps> = ({\n compression = DEFAULTS.compression,\n blockSize = DEFAULTS.blockSize,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n children,\n}) => {\n const { width, height } = useVideoConfig();\n\n return (\n <SecurityCamCanvas\n compression={compression}\n cellX={Math.max(blockSize, 1) / width}\n cellY={Math.max(blockSize, 1) / height}\n noise={noise}\n intensity={intensity}\n >\n {children}\n </SecurityCamCanvas>\n );\n};\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n compression: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.7,\n description: \"Compression\",\n hiddenFromList: false,\n },\n blockSize: {\n type: \"number\",\n min: 4,\n max: 32,\n step: 1,\n default: 10,\n description: \"Macroblock\",\n hiddenFromList: false,\n },\n noise: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.6,\n description: \"Sensor noise\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"compression\",\"blockSize\",\"noise\",\"intensity\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n compression: 0.7,\n blockSize: 10,\n noise: 0.6,\n intensity: 1,\n speed: 1,\n};\n\ntype SecurityCamElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SecurityCamBase>;\n\nconst SecurityCamInner = forwardRef<\n HTMLDivElement,\n SecurityCamElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SecurityCam>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SecurityCamBase\n {...(componentProps as unknown as ComponentProps<typeof SecurityCamBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SecurityCam = Interactive.withSchema({\n Component: SecurityCamInner,\n componentName: \"<SecurityCam>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/shader-caustics.json b/registry-artifacts/elements/shader-caustics.jsonindex 00c89be8..c146846f 100644--- a/registry-artifacts/elements/shader-caustics.json+++ b/registry-artifacts/elements/shader-caustics.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Shader Caustics","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-caustics",- "sourceCode": "import { useEffect, useRef, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\n// A field of refracted light — caustics. The web of bright filaments light\n// makes when it passes through a surface and lands on the floor beneath.\n// Written for the remocn registry as a custom WebGL shader (not a\n// paper-design wrapper): frame-driven, deterministic, no wall-clock time.\n//\n// The filaments are slightly denser and brighter toward the bottom of the\n// frame — the light lands on the base — which makes it a natural carrier for\n// foundation stories. `accent` / `accentAmount` tint the filaments themselves\n// (not the floor), so an undertone can arrive mid-video by animating\n// `accentAmount` from the master timeline and stay in the light afterwards.\n\nexport interface ShaderCausticsProps {\n /** [floor color, filament light color]. */\n colors?: [string, string];\n /** Tint mixed into the bright filaments. */\n accent?: string;\n /** 0..1 — how much of the accent the filaments take. */\n accentAmount?: number;\n /** Spatial frequency of the light web. */\n scale?: number;\n /** Overall brightness of the filaments. */\n intensity?: number;\n /** Global time multiplier. */\n speed?: number;\n className?: string;\n}\n\nconst VERT = `\nattribute vec2 a_pos;\nvoid main() {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `\nprecision highp float;\n\nuniform vec2 u_res;\nuniform float u_time;\nuniform float u_scale;\nuniform float u_intensity;\nuniform vec3 u_floor;\nuniform vec3 u_light;\nuniform vec3 u_accent;\nuniform float u_accentAmt;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / u_res;\n float aspect = u_res.x / u_res.y;\n vec2 p = vec2(uv.x * aspect, uv.y) * u_scale;\n\n // Iterative trigonometric warp: each pass bends the sample point by the\n // previous pass, and the reciprocal distance to the warped axes\n // accumulates into the caustic web.\n float t = u_time * 0.35;\n vec2 i = p;\n float c = 0.0;\n for (int n = 0; n < 4; n++) {\n float phase = t * (1.0 - 3.2 / float(n + 2));\n i = p + vec2(\n cos(phase - i.x) + sin(phase + i.y),\n sin(phase - i.y) + cos(phase + i.x)\n );\n c += 1.0 / length(vec2(\n p.x / (sin(i.x + phase) * 90.0),\n p.y / (cos(i.y + phase) * 90.0)\n ));\n }\n c /= 4.0;\n c = 1.24 - pow(abs(c), 1.35);\n // |c| collapses to zero along thin branching veins — that zero-crossing\n // set IS the caustic web. Light the veins with an exponential falloff\n // (sharp core + a soft halo) and leave everything else near-black.\n float web = exp(-abs(c) * 0.5) + 0.22 * exp(-abs(c) * 0.12);\n web = web / (1.0 + 0.6 * web);\n\n // The light lands on the base: filaments read stronger low in the frame.\n float ground = mix(1.25, 0.55, uv.y);\n web *= ground * u_intensity;\n\n // Vignette keeps the corners quiet so type always wins.\n vec2 v = uv - 0.5;\n float vig = 1.0 - dot(v, v) * 1.1;\n web *= clamp(vig, 0.0, 1.0);\n\n vec3 filament = mix(u_light, u_accent, clamp(u_accentAmt, 0.0, 1.0));\n vec3 col = u_floor + filament * web;\n\n // A whisper of living grain, time-derived so it stays deterministic.\n col += (hash(gl_FragCoord.xy + floor(u_time * 9.0)) - 0.5) * 0.012;\n\n gl_FragColor = vec4(col, 1.0);\n}\n`;\n\nconst hexToRgb = (hex: string): [number, number, number] => {\n const h = hex.replace(\"#\", \"\");\n const v =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n const n = parseInt(v, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n};\n\ntype GlState = {\n gl: WebGLRenderingContext;\n uniforms: Record<string, WebGLUniformLocation | null>;\n};\n\nexport function ShaderCaustics({\n colors = [\"#0a0a0a\", \"#2e2e33\"],\n accent = \"#7F57FF\",\n accentAmount = 0,\n scale = 5.2,\n intensity = 1,\n speed = 1,\n className,\n}: ShaderCausticsProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const stateRef = useRef<GlState | null>(null);\n const [handle] = useState(() => delayRender(\"shader-caustics\"));\n const continuedRef = useRef(false);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || stateRef.current) return;\n const gl = canvas.getContext(\"webgl\", {\n antialias: false,\n preserveDrawingBuffer: true,\n });\n if (!gl) return;\n\n const compile = (type: number, src: string) => {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"Failed to create WebGL shader\");\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n };\n const program = gl.createProgram();\n if (!program) return;\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n // biome-ignore lint/correctness/useHookAtTopLevel: gl.useProgram is a WebGL method, not a React hook\n gl.useProgram(program);\n\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([-1, -1, 3, -1, -1, 3]),\n gl.STATIC_DRAW,\n );\n const loc = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n const uniforms: GlState[\"uniforms\"] = {};\n for (const name of [\n \"u_res\",\n \"u_time\",\n \"u_scale\",\n \"u_intensity\",\n \"u_floor\",\n \"u_light\",\n \"u_accent\",\n \"u_accentAmt\",\n ]) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n stateRef.current = { gl, uniforms };\n }, []);\n\n useEffect(() => {\n const state = stateRef.current;\n const canvas = canvasRef.current;\n if (!state || !canvas) return;\n const { gl, uniforms } = state;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uniforms.u_res, canvas.width, canvas.height);\n gl.uniform1f(uniforms.u_time, (frame / fps) * speed);\n gl.uniform1f(uniforms.u_scale, scale);\n gl.uniform1f(uniforms.u_intensity, intensity);\n gl.uniform3fv(uniforms.u_floor, hexToRgb(colors[0]));\n gl.uniform3fv(uniforms.u_light, hexToRgb(colors[1]));\n gl.uniform3fv(uniforms.u_accent, hexToRgb(accent));\n gl.uniform1f(uniforms.u_accentAmt, accentAmount);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n if (!continuedRef.current) {\n continuedRef.current = true;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n }\n }, [\n frame,\n fps,\n speed,\n scale,\n intensity,\n colors,\n accent,\n accentAmount,\n handle,\n ]);\n\n return (\n <div className={className} style={{ position: \"absolute\", inset: 0 }}>\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useEffect, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n// A field of refracted light — caustics. The web of bright filaments light\n// makes when it passes through a surface and lands on the floor beneath.\n// Written for the remocn registry as a custom WebGL shader (not a\n// paper-design wrapper): frame-driven, deterministic, no wall-clock time.\n//\n// The filaments are slightly denser and brighter toward the bottom of the\n// frame — the light lands on the base — which makes it a natural carrier for\n// foundation stories. `accent` / `accentAmount` tint the filaments themselves\n// (not the floor), so an undertone can arrive mid-video by animating\n// `accentAmount` from the master timeline and stay in the light afterwards.\n\ninterface ShaderCausticsProps {\n /** [floor color, filament light color]. */\n colors?: [string, string];\n /** Tint mixed into the bright filaments. */\n accent?: string;\n /** 0..1 — how much of the accent the filaments take. */\n accentAmount?: number;\n /** Spatial frequency of the light web. */\n scale?: number;\n /** Overall brightness of the filaments. */\n intensity?: number;\n /** Global time multiplier. */\n speed?: number;\n className?: string;\n}\n\nconst VERT = `\nattribute vec2 a_pos;\nvoid main() {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `\nprecision highp float;\n\nuniform vec2 u_res;\nuniform float u_time;\nuniform float u_scale;\nuniform float u_intensity;\nuniform vec3 u_floor;\nuniform vec3 u_light;\nuniform vec3 u_accent;\nuniform float u_accentAmt;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / u_res;\n float aspect = u_res.x / u_res.y;\n vec2 p = vec2(uv.x * aspect, uv.y) * u_scale;\n\n // Iterative trigonometric warp: each pass bends the sample point by the\n // previous pass, and the reciprocal distance to the warped axes\n // accumulates into the caustic web.\n float t = u_time * 0.35;\n vec2 i = p;\n float c = 0.0;\n for (int n = 0; n < 4; n++) {\n float phase = t * (1.0 - 3.2 / float(n + 2));\n i = p + vec2(\n cos(phase - i.x) + sin(phase + i.y),\n sin(phase - i.y) + cos(phase + i.x)\n );\n c += 1.0 / length(vec2(\n p.x / (sin(i.x + phase) * 90.0),\n p.y / (cos(i.y + phase) * 90.0)\n ));\n }\n c /= 4.0;\n c = 1.24 - pow(abs(c), 1.35);\n // |c| collapses to zero along thin branching veins — that zero-crossing\n // set IS the caustic web. Light the veins with an exponential falloff\n // (sharp core + a soft halo) and leave everything else near-black.\n float web = exp(-abs(c) * 0.5) + 0.22 * exp(-abs(c) * 0.12);\n web = web / (1.0 + 0.6 * web);\n\n // The light lands on the base: filaments read stronger low in the frame.\n float ground = mix(1.25, 0.55, uv.y);\n web *= ground * u_intensity;\n\n // Vignette keeps the corners quiet so type always wins.\n vec2 v = uv - 0.5;\n float vig = 1.0 - dot(v, v) * 1.1;\n web *= clamp(vig, 0.0, 1.0);\n\n vec3 filament = mix(u_light, u_accent, clamp(u_accentAmt, 0.0, 1.0));\n vec3 col = u_floor + filament * web;\n\n // A whisper of living grain, time-derived so it stays deterministic.\n col += (hash(gl_FragCoord.xy + floor(u_time * 9.0)) - 0.5) * 0.012;\n\n gl_FragColor = vec4(col, 1.0);\n}\n`;\n\nconst hexToRgb = (hex: string): [number, number, number] => {\n const h = hex.replace(\"#\", \"\");\n const v =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n const n = parseInt(v, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n};\n\ntype GlState = {\n gl: WebGLRenderingContext;\n uniforms: Record<string, WebGLUniformLocation | null>;\n};\n\nfunction ShaderCausticsBase({\n colors = [\"#0a0a0a\", \"#2e2e33\"],\n accent = \"#7F57FF\",\n accentAmount = 0,\n scale = 5.2,\n intensity = 1,\n speed = 1,\n className,\n}: ShaderCausticsProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const stateRef = useRef<GlState | null>(null);\n const [handle] = useState(() => delayRender(\"shader-caustics\"));\n const continuedRef = useRef(false);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || stateRef.current) return;\n const gl = canvas.getContext(\"webgl\", {\n antialias: false,\n preserveDrawingBuffer: true,\n });\n if (!gl) return;\n\n const compile = (type: number, src: string) => {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"Failed to create WebGL shader\");\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n };\n const program = gl.createProgram();\n if (!program) return;\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n // biome-ignore lint/correctness/useHookAtTopLevel: gl.useProgram is a WebGL method, not a React hook\n gl.useProgram(program);\n\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([-1, -1, 3, -1, -1, 3]),\n gl.STATIC_DRAW,\n );\n const loc = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n const uniforms: GlState[\"uniforms\"] = {};\n for (const name of [\n \"u_res\",\n \"u_time\",\n \"u_scale\",\n \"u_intensity\",\n \"u_floor\",\n \"u_light\",\n \"u_accent\",\n \"u_accentAmt\",\n ]) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n stateRef.current = { gl, uniforms };\n }, []);\n\n useEffect(() => {\n const state = stateRef.current;\n const canvas = canvasRef.current;\n if (!state || !canvas) return;\n const { gl, uniforms } = state;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uniforms.u_res, canvas.width, canvas.height);\n gl.uniform1f(uniforms.u_time, (frame / fps) * speed);\n gl.uniform1f(uniforms.u_scale, scale);\n gl.uniform1f(uniforms.u_intensity, intensity);\n gl.uniform3fv(uniforms.u_floor, hexToRgb(colors[0]));\n gl.uniform3fv(uniforms.u_light, hexToRgb(colors[1]));\n gl.uniform3fv(uniforms.u_accent, hexToRgb(accent));\n gl.uniform1f(uniforms.u_accentAmt, accentAmount);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n if (!continuedRef.current) {\n continuedRef.current = true;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n }\n }, [\n frame,\n fps,\n speed,\n scale,\n intensity,\n colors,\n accent,\n accentAmount,\n handle,\n ]);\n\n return (\n <div className={className} style={{ position: \"absolute\", inset: 0 }}>\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n scale: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 0.1,\n default: 5.2,\n description: \"Scale\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.1,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n accent: {\n type: \"color\",\n default: \"#7F57FF\",\n description: \"Accent\",\n },\n accentAmount: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0,\n description: \"Accent amount\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"scale\",\"intensity\",\"accent\",\"accentAmount\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n scale: 5.2,\n intensity: 1,\n accent: \"#7F57FF\",\n accentAmount: 0,\n};\n\ntype ShaderCausticsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderCausticsBase>;\n\nconst ShaderCausticsInner = forwardRef<\n HTMLDivElement,\n ShaderCausticsElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderCaustics>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderCausticsBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderCausticsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderCaustics = Interactive.withSchema({\n Component: ShaderCausticsInner,\n componentName: \"<ShaderCaustics>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-color-panels.json b/registry-artifacts/elements/shader-color-panels.jsonindex be01379a..5d1b3d43 100644--- a/registry-artifacts/elements/shader-color-panels.json+++ b/registry-artifacts/elements/shader-color-panels.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Color Panels","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-color-panels",- "sourceCode": "import { ColorPanels, type ColorPanelsProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#52527a\", \"#5a5a8a\"];\n\nexport interface ShaderColorPanelsProps\n extends Omit<ColorPanelsProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderColorPanels({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#12121a\",\n density = 3,\n length = 1.1,\n className,\n ...rest\n}: ShaderColorPanelsProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-color-panels\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <ColorPanels\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n density={density}\n length={length}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { ColorPanels, type ColorPanelsProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#52527a\", \"#5a5a8a\"];\n\ninterface ShaderColorPanelsProps\n extends Omit<ColorPanelsProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderColorPanelsBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#12121a\",\n density = 3,\n length = 1.1,\n className,\n ...rest\n}: ShaderColorPanelsProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-color-panels\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <ColorPanels\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n density={density}\n length={length}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n density: {\n type: \"number\",\n min: 1,\n max: 8,\n step: 1,\n default: 3,\n description: \"Density\",\n hiddenFromList: false,\n },\n length: {\n type: \"number\",\n min: 0.5,\n max: 3,\n step: 0.1,\n default: 1.1,\n description: \"Length\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"density\",\"length\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n density: 3,\n length: 1.1,\n colorBack: \"#12121a\",\n};\n\ntype ShaderColorPanelsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderColorPanelsBase>;\n\nconst ShaderColorPanelsInner = forwardRef<\n HTMLDivElement,\n ShaderColorPanelsElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderColorPanels>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderColorPanelsBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderColorPanelsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderColorPanels = Interactive.withSchema({\n Component: ShaderColorPanelsInner,\n componentName: \"<ShaderColorPanels>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-dithering.json b/registry-artifacts/elements/shader-dithering.jsonindex d6aa6917..0de97f17 100644--- a/registry-artifacts/elements/shader-dithering.json+++ b/registry-artifacts/elements/shader-dithering.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Dithering","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-dithering",- "sourceCode": "import { Dithering, type DitheringProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShaderDitheringProps\n extends Omit<DitheringProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderDithering({\n speed = 1,\n colorBack = \"#12121a\",\n colorFront = \"#6a6a85\",\n shape = \"wave\",\n type = \"4x4\",\n size = 2,\n className,\n ...rest\n}: ShaderDitheringProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-dithering\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Dithering\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorFront={colorFront}\n shape={shape}\n type={type}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Dithering, type DitheringProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShaderDitheringProps\n extends Omit<DitheringProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderDitheringBase({\n speed = 1,\n colorBack = \"#12121a\",\n colorFront = \"#6a6a85\",\n shape = \"wave\",\n type = \"4x4\",\n size = 2,\n className,\n ...rest\n}: ShaderDitheringProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-dithering\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Dithering\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorFront={colorFront}\n shape={shape}\n type={type}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 1,\n max: 8,\n step: 1,\n default: 2,\n description: \"Dot Size\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n colorFront: {\n type: \"color\",\n default: \"#6a6a85\",\n description: \"Front\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"size\",\"colorBack\",\"colorFront\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n size: 2,\n colorBack: \"#12121a\",\n colorFront: \"#6a6a85\",\n};\n\ntype ShaderDitheringElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderDitheringBase>;\n\nconst ShaderDitheringInner = forwardRef<\n HTMLDivElement,\n ShaderDitheringElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderDithering>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderDitheringBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderDitheringBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderDithering = Interactive.withSchema({\n Component: ShaderDitheringInner,\n componentName: \"<ShaderDithering>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-dot-orbit.json b/registry-artifacts/elements/shader-dot-orbit.jsonindex 6a5152d8..eea044b5 100644--- a/registry-artifacts/elements/shader-dot-orbit.json+++ b/registry-artifacts/elements/shader-dot-orbit.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Dot Orbit","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-dot-orbit",- "sourceCode": "import { DotOrbit, type DotOrbitProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#4a4a68\", \"#52527a\", \"#3a3a5c\"];\n\nexport interface ShaderDotOrbitProps\n extends Omit<DotOrbitProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderDotOrbit({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n size = 1,\n spreading = 1,\n className,\n ...rest\n}: ShaderDotOrbitProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-dot-orbit\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <DotOrbit\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n size={size}\n spreading={spreading}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { DotOrbit, type DotOrbitProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#4a4a68\", \"#52527a\", \"#3a3a5c\"];\n\ninterface ShaderDotOrbitProps\n extends Omit<DotOrbitProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderDotOrbitBase({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n size = 1,\n spreading = 1,\n className,\n ...rest\n}: ShaderDotOrbitProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-dot-orbit\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <DotOrbit\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n size={size}\n spreading={spreading}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 0.1,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Size\",\n hiddenFromList: false,\n },\n spreading: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.1,\n default: 1,\n description: \"Spreading\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"size\",\"spreading\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n size: 1,\n spreading: 1,\n colorBack: \"#12121a\",\n};\n\ntype ShaderDotOrbitElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderDotOrbitBase>;\n\nconst ShaderDotOrbitInner = forwardRef<\n HTMLDivElement,\n ShaderDotOrbitElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderDotOrbit>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderDotOrbitBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderDotOrbitBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderDotOrbit = Interactive.withSchema({\n Component: ShaderDotOrbitInner,\n componentName: \"<ShaderDotOrbit>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-gem-smoke.json b/registry-artifacts/elements/shader-gem-smoke.jsonindex ebe9d7c2..de5341f5 100644--- a/registry-artifacts/elements/shader-gem-smoke.json+++ b/registry-artifacts/elements/shader-gem-smoke.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Gem Smoke","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-gem-smoke",- "sourceCode": "import { GemSmoke, type GemSmokeProps } from \"@paper-design/shaders-react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nimport React, { useCallback, useState } from \"react\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\"];\n\nexport interface ShaderGemSmokeProps\n extends Omit<GemSmokeProps, \"frame\" | \"ref\"> {}\n\n/**\n * Paper's Gem Smoke shader, driven deterministically by the current frame.\n *\n * Animated color fields placed over a logo shape — smoke lives behind (and\n * inside) the glassy silhouette. Feed it a brand mark via `image` (a URL,\n * e.g. staticFile('prisma/symbol-light.svg')); the shape is processed once\n * and cached, so every frame renders the same smoke at the same time.\n */\nexport function ShaderGemSmoke({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#0a0a10\",\n innerDistortion = 0.8,\n outerDistortion = 0.6,\n outerGlow = 0.55,\n innerGlow = 1,\n size = 0.8,\n className,\n ...rest\n}: ShaderGemSmokeProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-gem-smoke\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <React.Suspense fallback={null}>\n <GemSmoke\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n innerDistortion={innerDistortion}\n outerDistortion={outerDistortion}\n outerGlow={outerGlow}\n innerGlow={innerGlow}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n suspendWhenProcessingImage\n {...rest}\n />\n </React.Suspense>\n </div>\n );\n}"+ "sourceCode": "import { GemSmoke, type GemSmokeProps } from \"@paper-design/shaders-react\";\nimport React, { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\"];\n\ninterface ShaderGemSmokeProps\n extends Omit<GemSmokeProps, \"frame\" | \"ref\"> {}\n\n/**\n * Paper's Gem Smoke shader, driven deterministically by the current frame.\n *\n * Animated color fields placed over a logo shape — smoke lives behind (and\n * inside) the glassy silhouette. Feed it a brand mark via `image` (a URL,\n * e.g. staticFile('prisma/symbol-light.svg')); the shape is processed once\n * and cached, so every frame renders the same smoke at the same time.\n */\nfunction ShaderGemSmokeBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#0a0a10\",\n innerDistortion = 0.8,\n outerDistortion = 0.6,\n outerGlow = 0.55,\n innerGlow = 1,\n size = 0.8,\n className,\n ...rest\n}: ShaderGemSmokeProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-gem-smoke\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <React.Suspense fallback={null}>\n <GemSmoke\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n innerDistortion={innerDistortion}\n outerDistortion={outerDistortion}\n outerGlow={outerGlow}\n innerGlow={innerGlow}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n suspendWhenProcessingImage\n {...rest}\n />\n </React.Suspense>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#0a0a10\",\n description: \"Background\",\n },\n innerDistortion: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.8,\n description: \"Inner distortion\",\n hiddenFromList: false,\n },\n outerDistortion: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.6,\n description: \"Outer distortion\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 0.2,\n max: 1.5,\n step: 0.05,\n default: 0.8,\n description: \"Size\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"colorBack\",\"innerDistortion\",\"outerDistortion\",\"size\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n colorBack: \"#0a0a10\",\n innerDistortion: 0.8,\n outerDistortion: 0.6,\n size: 0.8,\n};\n\ntype ShaderGemSmokeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderGemSmokeBase>;\n\nconst ShaderGemSmokeInner = forwardRef<\n HTMLDivElement,\n ShaderGemSmokeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderGemSmoke>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderGemSmokeBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderGemSmokeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderGemSmoke = Interactive.withSchema({\n Component: ShaderGemSmokeInner,\n componentName: \"<ShaderGemSmoke>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-god-rays.json b/registry-artifacts/elements/shader-god-rays.jsonindex 09c704c0..3d147cd7 100644--- a/registry-artifacts/elements/shader-god-rays.json+++ b/registry-artifacts/elements/shader-god-rays.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader God Rays","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-god-rays",- "sourceCode": "import { GodRays, type GodRaysProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#5a5a7e\", \"#8a8a95\", \"#ffffff\", \"#3a3a5c\"];\n\nexport interface ShaderGodRaysProps\n extends Omit<GodRaysProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderGodRays({\n speed = 1,\n colorBack = \"#12121a\",\n colorBloom = \"#3a3a5c\",\n colors = NEUTRAL_COLORS,\n intensity = 0.8,\n density = 0.3,\n bloom = 0.4,\n className,\n ...rest\n}: ShaderGodRaysProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-god-rays\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <GodRays\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorBloom={colorBloom}\n colors={colors}\n intensity={intensity}\n density={density}\n bloom={bloom}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { GodRays, type GodRaysProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#5a5a7e\", \"#8a8a95\", \"#ffffff\", \"#3a3a5c\"];\n\ninterface ShaderGodRaysProps\n extends Omit<GodRaysProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderGodRaysBase({\n speed = 1,\n colorBack = \"#12121a\",\n colorBloom = \"#3a3a5c\",\n colors = NEUTRAL_COLORS,\n intensity = 0.8,\n density = 0.3,\n bloom = 0.4,\n className,\n ...rest\n}: ShaderGodRaysProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-god-rays\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <GodRays\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorBloom={colorBloom}\n colors={colors}\n intensity={intensity}\n density={density}\n bloom={bloom}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.8,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n density: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.3,\n description: \"Density\",\n hiddenFromList: false,\n },\n bloom: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.4,\n description: \"Bloom\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"intensity\",\"density\",\"bloom\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n intensity: 0.8,\n density: 0.3,\n bloom: 0.4,\n colorBack: \"#12121a\",\n};\n\ntype ShaderGodRaysElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderGodRaysBase>;\n\nconst ShaderGodRaysInner = forwardRef<\n HTMLDivElement,\n ShaderGodRaysElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderGodRays>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderGodRaysBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderGodRaysBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderGodRays = Interactive.withSchema({\n Component: ShaderGodRaysInner,\n componentName: \"<ShaderGodRays>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-grain-gradient.json b/registry-artifacts/elements/shader-grain-gradient.jsonindex c05cdbca..df8a7f8b 100644--- a/registry-artifacts/elements/shader-grain-gradient.json+++ b/registry-artifacts/elements/shader-grain-gradient.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Grain Gradient","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-grain-gradient",- "sourceCode": "import { GrainGradient, type GrainGradientProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#5a5a7e\"];\n\nexport interface ShaderGrainGradientProps\n extends Omit<GrainGradientProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderGrainGradient({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#12121a\",\n softness = 0.6,\n intensity = 0.2,\n noise = 0.15,\n className,\n ...rest\n}: ShaderGrainGradientProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-grain-gradient\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <GrainGradient\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n softness={softness}\n intensity={intensity}\n noise={noise}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { GrainGradient, type GrainGradientProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#5a5a7e\"];\n\ninterface ShaderGrainGradientProps\n extends Omit<GrainGradientProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderGrainGradientBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#12121a\",\n softness = 0.6,\n intensity = 0.2,\n noise = 0.15,\n className,\n ...rest\n}: ShaderGrainGradientProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-grain-gradient\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <GrainGradient\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n softness={softness}\n intensity={intensity}\n noise={noise}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n softness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.6,\n description: \"Softness\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.2,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n noise: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.15,\n description: \"Noise\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"softness\",\"intensity\",\"noise\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n softness: 0.6,\n intensity: 0.2,\n noise: 0.15,\n colorBack: \"#12121a\",\n};\n\ntype ShaderGrainGradientElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderGrainGradientBase>;\n\nconst ShaderGrainGradientInner = forwardRef<\n HTMLDivElement,\n ShaderGrainGradientElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderGrainGradient>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderGrainGradientBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderGrainGradientBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderGrainGradient = Interactive.withSchema({\n Component: ShaderGrainGradientInner,\n componentName: \"<ShaderGrainGradient>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-liquid-metal.json b/registry-artifacts/elements/shader-liquid-metal.jsonindex c157c70b..1e71de47 100644--- a/registry-artifacts/elements/shader-liquid-metal.json+++ b/registry-artifacts/elements/shader-liquid-metal.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Liquid Metal","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-liquid-metal",- "sourceCode": "import { LiquidMetal, type LiquidMetalProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShaderLiquidMetalProps\n extends Omit<LiquidMetalProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderLiquidMetal({\n speed = 1,\n colorBack = \"#2a2a30\",\n colorTint = \"#8a8a95\",\n distortion = 0.1,\n repetition = 1.5,\n contour = 0.4,\n softness = 0.05,\n shape = \"none\",\n className,\n ...rest\n}: ShaderLiquidMetalProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-liquid-metal\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <LiquidMetal\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorTint={colorTint}\n distortion={distortion}\n repetition={repetition}\n contour={contour}\n softness={softness}\n shape={shape}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { LiquidMetal, type LiquidMetalProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShaderLiquidMetalProps\n extends Omit<LiquidMetalProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderLiquidMetalBase({\n speed = 1,\n colorBack = \"#2a2a30\",\n colorTint = \"#8a8a95\",\n distortion = 0.1,\n repetition = 1.5,\n contour = 0.4,\n softness = 0.05,\n shape = \"none\",\n className,\n ...rest\n}: ShaderLiquidMetalProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-liquid-metal\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <LiquidMetal\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorTint={colorTint}\n distortion={distortion}\n repetition={repetition}\n contour={contour}\n softness={softness}\n shape={shape}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n distortion: {\n type: \"number\",\n min: 0,\n max: 0.5,\n step: 0.01,\n default: 0.1,\n description: \"Distortion\",\n hiddenFromList: false,\n },\n repetition: {\n type: \"number\",\n min: 1,\n max: 6,\n step: 0.5,\n default: 1.5,\n description: \"Repetition\",\n hiddenFromList: false,\n },\n contour: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.4,\n description: \"Contour\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#2a2a30\",\n description: \"Background\",\n },\n colorTint: {\n type: \"color\",\n default: \"#8a8a95\",\n description: \"Tint\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"distortion\",\"repetition\",\"contour\",\"colorBack\",\"colorTint\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n distortion: 0.1,\n repetition: 1.5,\n contour: 0.4,\n colorBack: \"#2a2a30\",\n colorTint: \"#8a8a95\",\n};\n\ntype ShaderLiquidMetalElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderLiquidMetalBase>;\n\nconst ShaderLiquidMetalInner = forwardRef<\n HTMLDivElement,\n ShaderLiquidMetalElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderLiquidMetal>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderLiquidMetalBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderLiquidMetalBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderLiquidMetal = Interactive.withSchema({\n Component: ShaderLiquidMetalInner,\n componentName: \"<ShaderLiquidMetal>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-mesh-gradient.json b/registry-artifacts/elements/shader-mesh-gradient.jsonindex bc4fe674..15d16d3d 100644--- a/registry-artifacts/elements/shader-mesh-gradient.json+++ b/registry-artifacts/elements/shader-mesh-gradient.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Mesh Gradient","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-mesh-gradient",- "sourceCode": "import { MeshGradient, type MeshGradientProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#12121a\", \"#232338\", \"#3a3a5c\", \"#52527a\"];\n\nexport interface ShaderMeshGradientProps\n extends Omit<MeshGradientProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderMeshGradient({\n speed = 1,\n colors = NEUTRAL_COLORS,\n distortion = 0.6,\n swirl = 0.1,\n className,\n ...rest\n}: ShaderMeshGradientProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-mesh-gradient\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <MeshGradient\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n distortion={distortion}\n swirl={swirl}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { MeshGradient, type MeshGradientProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#12121a\", \"#232338\", \"#3a3a5c\", \"#52527a\"];\n\ninterface ShaderMeshGradientProps\n extends Omit<MeshGradientProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderMeshGradientBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n distortion = 0.6,\n swirl = 0.1,\n className,\n ...rest\n}: ShaderMeshGradientProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-mesh-gradient\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <MeshGradient\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n distortion={distortion}\n swirl={swirl}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n distortion: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 0.6,\n description: \"Distortion\",\n hiddenFromList: false,\n },\n swirl: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.1,\n description: \"Swirl\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"distortion\",\"swirl\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n distortion: 0.6,\n swirl: 0.1,\n};\n\ntype ShaderMeshGradientElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderMeshGradientBase>;\n\nconst ShaderMeshGradientInner = forwardRef<\n HTMLDivElement,\n ShaderMeshGradientElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderMeshGradient>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderMeshGradientBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderMeshGradientBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderMeshGradient = Interactive.withSchema({\n Component: ShaderMeshGradientInner,\n componentName: \"<ShaderMeshGradient>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-metaballs.json b/registry-artifacts/elements/shader-metaballs.jsonindex f1c2d6d5..31578618 100644--- a/registry-artifacts/elements/shader-metaballs.json+++ b/registry-artifacts/elements/shader-metaballs.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Metaballs","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-metaballs",- "sourceCode": "import { Metaballs, type MetaballsProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\", \"#8a8a95\"];\n\nexport interface ShaderMetaballsProps\n extends Omit<MetaballsProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderMetaballs({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n count = 10,\n size = 0.83,\n className,\n ...rest\n}: ShaderMetaballsProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-metaballs\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Metaballs\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n count={count}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Metaballs, type MetaballsProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\", \"#8a8a95\"];\n\ninterface ShaderMetaballsProps\n extends Omit<MetaballsProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderMetaballsBase({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n count = 10,\n size = 0.83,\n className,\n ...rest\n}: ShaderMetaballsProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-metaballs\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Metaballs\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n count={count}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n count: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 10,\n description: \"Count\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 0.2,\n max: 1.5,\n step: 0.05,\n default: 0.83,\n description: \"Size\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"count\",\"size\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n count: 10,\n size: 0.83,\n colorBack: \"#12121a\",\n};\n\ntype ShaderMetaballsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderMetaballsBase>;\n\nconst ShaderMetaballsInner = forwardRef<\n HTMLDivElement,\n ShaderMetaballsElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderMetaballs>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderMetaballsBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderMetaballsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderMetaballs = Interactive.withSchema({\n Component: ShaderMetaballsInner,\n componentName: \"<ShaderMetaballs>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-neuro-noise.json b/registry-artifacts/elements/shader-neuro-noise.jsonindex 108bd563..1c1832d8 100644--- a/registry-artifacts/elements/shader-neuro-noise.json+++ b/registry-artifacts/elements/shader-neuro-noise.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Neuro Noise","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-neuro-noise",- "sourceCode": "import { NeuroNoise, type NeuroNoiseProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShaderNeuroNoiseProps\n extends Omit<NeuroNoiseProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderNeuroNoise({\n speed = 1,\n colorFront = \"#8a8a95\",\n colorMid = \"#4a4a68\",\n colorBack = \"#12121a\",\n brightness = 0.05,\n contrast = 0.3,\n className,\n ...rest\n}: ShaderNeuroNoiseProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-neuro-noise\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <NeuroNoise\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorFront={colorFront}\n colorMid={colorMid}\n colorBack={colorBack}\n brightness={brightness}\n contrast={contrast}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { NeuroNoise, type NeuroNoiseProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShaderNeuroNoiseProps\n extends Omit<NeuroNoiseProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderNeuroNoiseBase({\n speed = 1,\n colorFront = \"#8a8a95\",\n colorMid = \"#4a4a68\",\n colorBack = \"#12121a\",\n brightness = 0.05,\n contrast = 0.3,\n className,\n ...rest\n}: ShaderNeuroNoiseProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-neuro-noise\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <NeuroNoise\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorFront={colorFront}\n colorMid={colorMid}\n colorBack={colorBack}\n brightness={brightness}\n contrast={contrast}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n brightness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.05,\n description: \"Brightness\",\n hiddenFromList: false,\n },\n contrast: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.3,\n description: \"Contrast\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n colorMid: {\n type: \"color\",\n default: \"#4a4a68\",\n description: \"Mid\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"brightness\",\"contrast\",\"colorBack\",\"colorMid\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n brightness: 0.05,\n contrast: 0.3,\n colorBack: \"#12121a\",\n colorMid: \"#4a4a68\",\n};\n\ntype ShaderNeuroNoiseElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderNeuroNoiseBase>;\n\nconst ShaderNeuroNoiseInner = forwardRef<\n HTMLDivElement,\n ShaderNeuroNoiseElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderNeuroNoise>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderNeuroNoiseBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderNeuroNoiseBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderNeuroNoise = Interactive.withSchema({\n Component: ShaderNeuroNoiseInner,\n componentName: \"<ShaderNeuroNoise>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-perlin-noise.json b/registry-artifacts/elements/shader-perlin-noise.jsonindex 7bd590ca..6ebd18d4 100644--- a/registry-artifacts/elements/shader-perlin-noise.json+++ b/registry-artifacts/elements/shader-perlin-noise.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Perlin Noise","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-perlin-noise",- "sourceCode": "import { PerlinNoise, type PerlinNoiseProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShaderPerlinNoiseProps\n extends Omit<PerlinNoiseProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderPerlinNoise({\n speed = 1,\n colorBack = \"#12121a\",\n colorFront = \"#6a6a85\",\n proportion = 0.35,\n softness = 0.1,\n className,\n ...rest\n}: ShaderPerlinNoiseProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-perlin-noise\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <PerlinNoise\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorFront={colorFront}\n proportion={proportion}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { PerlinNoise, type PerlinNoiseProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShaderPerlinNoiseProps\n extends Omit<PerlinNoiseProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderPerlinNoiseBase({\n speed = 1,\n colorBack = \"#12121a\",\n colorFront = \"#6a6a85\",\n proportion = 0.35,\n softness = 0.1,\n className,\n ...rest\n}: ShaderPerlinNoiseProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-perlin-noise\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <PerlinNoise\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorFront={colorFront}\n proportion={proportion}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n proportion: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.35,\n description: \"Proportion\",\n hiddenFromList: false,\n },\n softness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.1,\n description: \"Softness\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n colorFront: {\n type: \"color\",\n default: \"#6a6a85\",\n description: \"Front\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"proportion\",\"softness\",\"colorBack\",\"colorFront\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n proportion: 0.35,\n softness: 0.1,\n colorBack: \"#12121a\",\n colorFront: \"#6a6a85\",\n};\n\ntype ShaderPerlinNoiseElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderPerlinNoiseBase>;\n\nconst ShaderPerlinNoiseInner = forwardRef<\n HTMLDivElement,\n ShaderPerlinNoiseElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderPerlinNoise>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderPerlinNoiseBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderPerlinNoiseBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderPerlinNoise = Interactive.withSchema({\n Component: ShaderPerlinNoiseInner,\n componentName: \"<ShaderPerlinNoise>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-pulsing-border.json b/registry-artifacts/elements/shader-pulsing-border.jsonindex d429ed16..e865409d 100644--- a/registry-artifacts/elements/shader-pulsing-border.json+++ b/registry-artifacts/elements/shader-pulsing-border.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Pulsing Border","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-pulsing-border",- "sourceCode": "import { PulsingBorder, type PulsingBorderProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#52527a\", \"#8a8a95\", \"#3a3a5c\"];\n\nexport interface ShaderPulsingBorderProps\n extends Omit<PulsingBorderProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderPulsingBorder({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n roundness = 0.25,\n thickness = 0.1,\n intensity = 0.2,\n bloom = 0.25,\n className,\n ...rest\n}: ShaderPulsingBorderProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-pulsing-border\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <PulsingBorder\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n roundness={roundness}\n thickness={thickness}\n intensity={intensity}\n bloom={bloom}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { PulsingBorder, type PulsingBorderProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#52527a\", \"#8a8a95\", \"#3a3a5c\"];\n\ninterface ShaderPulsingBorderProps\n extends Omit<PulsingBorderProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderPulsingBorderBase({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n roundness = 0.25,\n thickness = 0.1,\n intensity = 0.2,\n bloom = 0.25,\n className,\n ...rest\n}: ShaderPulsingBorderProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-pulsing-border\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <PulsingBorder\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n roundness={roundness}\n thickness={thickness}\n intensity={intensity}\n bloom={bloom}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n thickness: {\n type: \"number\",\n min: 0.02,\n max: 0.5,\n step: 0.02,\n default: 0.1,\n description: \"Thickness\",\n hiddenFromList: false,\n },\n roundness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.25,\n description: \"Roundness\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.2,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"thickness\",\"roundness\",\"intensity\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n thickness: 0.1,\n roundness: 0.25,\n intensity: 0.2,\n colorBack: \"#12121a\",\n};\n\ntype ShaderPulsingBorderElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderPulsingBorderBase>;\n\nconst ShaderPulsingBorderInner = forwardRef<\n HTMLDivElement,\n ShaderPulsingBorderElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderPulsingBorder>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderPulsingBorderBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderPulsingBorderBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderPulsingBorder = Interactive.withSchema({\n Component: ShaderPulsingBorderInner,\n componentName: \"<ShaderPulsingBorder>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-simplex-noise.json b/registry-artifacts/elements/shader-simplex-noise.jsonindex 15e92367..350ae367 100644--- a/registry-artifacts/elements/shader-simplex-noise.json+++ b/registry-artifacts/elements/shader-simplex-noise.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Simplex Noise","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-simplex-noise",- "sourceCode": "import { SimplexNoise, type SimplexNoiseProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#12121a\", \"#3a3a5c\", \"#52527a\", \"#8a8a95\"];\n\nexport interface ShaderSimplexNoiseProps\n extends Omit<SimplexNoiseProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderSimplexNoise({\n speed = 1,\n colors = NEUTRAL_COLORS,\n stepsPerColor = 2,\n softness = 0.1,\n className,\n ...rest\n}: ShaderSimplexNoiseProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-simplex-noise\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <SimplexNoise\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n stepsPerColor={stepsPerColor}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { SimplexNoise, type SimplexNoiseProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#12121a\", \"#3a3a5c\", \"#52527a\", \"#8a8a95\"];\n\ninterface ShaderSimplexNoiseProps\n extends Omit<SimplexNoiseProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderSimplexNoiseBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n stepsPerColor = 2,\n softness = 0.1,\n className,\n ...rest\n}: ShaderSimplexNoiseProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-simplex-noise\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <SimplexNoise\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n stepsPerColor={stepsPerColor}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n stepsPerColor: {\n type: \"number\",\n min: 1,\n max: 6,\n step: 1,\n default: 2,\n description: \"Steps\",\n hiddenFromList: false,\n },\n softness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.1,\n description: \"Softness\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"stepsPerColor\",\"softness\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n stepsPerColor: 2,\n softness: 0.1,\n};\n\ntype ShaderSimplexNoiseElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderSimplexNoiseBase>;\n\nconst ShaderSimplexNoiseInner = forwardRef<\n HTMLDivElement,\n ShaderSimplexNoiseElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderSimplexNoise>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderSimplexNoiseBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderSimplexNoiseBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderSimplexNoise = Interactive.withSchema({\n Component: ShaderSimplexNoiseInner,\n componentName: \"<ShaderSimplexNoise>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-smoke-ring.json b/registry-artifacts/elements/shader-smoke-ring.jsonindex f53d1c60..3b08eccc 100644--- a/registry-artifacts/elements/shader-smoke-ring.json+++ b/registry-artifacts/elements/shader-smoke-ring.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Smoke Ring","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-smoke-ring",- "sourceCode": "import { SmokeRing, type SmokeRingProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#c8c8d0\"];\n\nexport interface ShaderSmokeRingProps\n extends Omit<SmokeRingProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderSmokeRing({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n radius = 0.25,\n thickness = 0.65,\n scale = 0.8,\n className,\n ...rest\n}: ShaderSmokeRingProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-smoke-ring\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <SmokeRing\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n radius={radius}\n thickness={thickness}\n scale={scale}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { SmokeRing, type SmokeRingProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#c8c8d0\"];\n\ninterface ShaderSmokeRingProps\n extends Omit<SmokeRingProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderSmokeRingBase({\n speed = 1,\n colorBack = \"#12121a\",\n colors = NEUTRAL_COLORS,\n radius = 0.25,\n thickness = 0.65,\n scale = 0.8,\n className,\n ...rest\n}: ShaderSmokeRingProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-smoke-ring\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <SmokeRing\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colors={colors}\n radius={radius}\n thickness={thickness}\n scale={scale}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n radius: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.25,\n description: \"Radius\",\n hiddenFromList: false,\n },\n thickness: {\n type: \"number\",\n min: 0.1,\n max: 1.5,\n step: 0.05,\n default: 0.65,\n description: \"Thickness\",\n hiddenFromList: false,\n },\n scale: {\n type: \"number\",\n min: 0.3,\n max: 2,\n step: 0.05,\n default: 0.8,\n description: \"Scale\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"radius\",\"thickness\",\"scale\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n radius: 0.25,\n thickness: 0.65,\n scale: 0.8,\n colorBack: \"#12121a\",\n};\n\ntype ShaderSmokeRingElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderSmokeRingBase>;\n\nconst ShaderSmokeRingInner = forwardRef<\n HTMLDivElement,\n ShaderSmokeRingElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderSmokeRing>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderSmokeRingBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderSmokeRingBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderSmokeRing = Interactive.withSchema({\n Component: ShaderSmokeRingInner,\n componentName: \"<ShaderSmokeRing>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-spiral.json b/registry-artifacts/elements/shader-spiral.jsonindex 696caf33..631845b3 100644--- a/registry-artifacts/elements/shader-spiral.json+++ b/registry-artifacts/elements/shader-spiral.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Spiral","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-spiral",- "sourceCode": "import { Spiral, type SpiralProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShaderSpiralProps extends Omit<SpiralProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderSpiral({\n speed = 1,\n colorBack = \"#12121a\",\n colorFront = \"#52527a\",\n density = 1,\n strokeWidth = 0.5,\n softness = 0.2,\n className,\n ...rest\n}: ShaderSpiralProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-spiral\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Spiral\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorFront={colorFront}\n density={density}\n strokeWidth={strokeWidth}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Spiral, type SpiralProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShaderSpiralProps extends Omit<SpiralProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderSpiralBase({\n speed = 1,\n colorBack = \"#12121a\",\n colorFront = \"#52527a\",\n density = 1,\n strokeWidth = 0.5,\n softness = 0.2,\n className,\n ...rest\n}: ShaderSpiralProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-spiral\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Spiral\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorFront={colorFront}\n density={density}\n strokeWidth={strokeWidth}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n density: {\n type: \"number\",\n min: 0.2,\n max: 4,\n step: 0.1,\n default: 1,\n description: \"Density\",\n hiddenFromList: false,\n },\n strokeWidth: {\n type: \"number\",\n min: 0.05,\n max: 1,\n step: 0.05,\n default: 0.5,\n description: \"Stroke\",\n hiddenFromList: false,\n },\n softness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.2,\n description: \"Softness\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"density\",\"strokeWidth\",\"softness\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n density: 1,\n strokeWidth: 0.5,\n softness: 0.2,\n colorBack: \"#12121a\",\n};\n\ntype ShaderSpiralElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderSpiralBase>;\n\nconst ShaderSpiralInner = forwardRef<\n HTMLDivElement,\n ShaderSpiralElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderSpiral>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderSpiralBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderSpiralBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderSpiral = Interactive.withSchema({\n Component: ShaderSpiralInner,\n componentName: \"<ShaderSpiral>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-strata.json b/registry-artifacts/elements/shader-strata.jsonindex 92f93519..e55e2b03 100644--- a/registry-artifacts/elements/shader-strata.json+++ b/registry-artifacts/elements/shader-strata.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Shader Strata","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-strata",- "sourceCode": "import { useEffect, useRef, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\n// A field of fine horizontal sediment layers — strata. Each layer's edge is\n// displaced by fbm noise and drifts at its own depth speed, so the stack reads\n// as a living foundation rather than a gradient. Written for the remocn\n// registry as a custom WebGL shader (not a paper-design wrapper): frame-driven,\n// deterministic, no wall-clock time anywhere.\n//\n// `accent` / `accentAmount` tint the DEEP strata (the bottom of the frame) —\n// the layers everything else stands on — which is what makes it a natural\n// carrier for \"base\" stories: the undertone can arrive mid-video by animating\n// `accentAmount` with the master timeline.\n\nexport interface ShaderStrataProps {\n /** Palette from the deepest layer to the surface layer. Exactly 4 stops. */\n colors?: [string, string, string, string];\n /** Tint mixed into the deep strata. */\n accent?: string;\n /** 0..1 — how much of the accent the deep strata take. */\n accentAmount?: number;\n /** Number of strata bands across the frame height. */\n layers?: number;\n /** Edge waviness of each layer, in fractions of the frame height. */\n amplitude?: number;\n /** Global time multiplier. */\n speed?: number;\n className?: string;\n}\n\nconst VERT = `\nattribute vec2 a_pos;\nvoid main() {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `\nprecision highp float;\n\nuniform vec2 u_res;\nuniform float u_time;\nuniform float u_layers;\nuniform float u_amp;\nuniform vec3 u_c0;\nuniform vec3 u_c1;\nuniform vec3 u_c2;\nuniform vec3 u_c3;\nuniform vec3 u_accent;\nuniform float u_accentAmt;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * noise(p);\n p *= 2.03;\n a *= 0.5;\n }\n return v;\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / u_res;\n float aspect = u_res.x / u_res.y;\n\n // Deeper layers drift faster — parallax without per-band recursion.\n float drift = u_time * (0.012 + 0.05 * (1.0 - uv.y));\n float w = fbm(vec2(uv.x * 2.6 * aspect + drift, uv.y * 2.2 - u_time * 0.01));\n\n float yd = uv.y + (w - 0.5) * u_amp;\n float band = yd * u_layers;\n float idx = floor(band);\n float f = fract(band);\n\n // Per-band value jitter + a soft sediment shadow at each band's lower edge.\n float j = hash(vec2(idx, 7.0));\n float edge = smoothstep(0.0, 0.4, f) * (1.0 - 0.3 * smoothstep(0.8, 1.0, f));\n\n float depth = clamp(idx / u_layers, 0.0, 1.0);\n vec3 col = mix(u_c0, u_c1, smoothstep(0.0, 0.4, depth));\n col = mix(col, u_c2, smoothstep(0.35, 0.75, depth));\n col = mix(col, u_c3, smoothstep(0.7, 1.0, depth));\n col *= 0.84 + 0.16 * j;\n col *= 0.92 + 0.08 * edge;\n\n // The accent rises from the deep strata and thins toward the surface.\n float mask = (1.0 - uv.y);\n mask *= mask;\n col = mix(col, u_accent, clamp(u_accentAmt, 0.0, 1.0) * mask * 0.38);\n\n // A whisper of living grain, time-derived so it stays deterministic.\n col += (hash(gl_FragCoord.xy + floor(u_time * 9.0)) - 0.5) * 0.012;\n\n gl_FragColor = vec4(col, 1.0);\n}\n`;\n\nconst hexToRgb = (hex: string): [number, number, number] => {\n const h = hex.replace(\"#\", \"\");\n const v =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n const n = parseInt(v, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n};\n\ntype GlState = {\n gl: WebGLRenderingContext;\n uniforms: Record<string, WebGLUniformLocation | null>;\n};\n\nexport function ShaderStrata({\n colors = [\"#050507\", \"#0a0a0d\", \"#111014\", \"#17161b\"],\n accent = \"#6733FF\",\n accentAmount = 0,\n layers = 14,\n amplitude = 0.16,\n speed = 1,\n className,\n}: ShaderStrataProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const stateRef = useRef<GlState | null>(null);\n const [handle] = useState(() => delayRender(\"shader-strata\"));\n const continuedRef = useRef(false);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || stateRef.current) return;\n const gl = canvas.getContext(\"webgl\", {\n antialias: false,\n preserveDrawingBuffer: true,\n });\n if (!gl) return;\n\n const compile = (type: number, src: string) => {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"Failed to create WebGL shader\");\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n };\n const program = gl.createProgram();\n if (!program) return;\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n // biome-ignore lint/correctness/useHookAtTopLevel: gl.useProgram is a WebGL method, not a React hook\n gl.useProgram(program);\n\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([-1, -1, 3, -1, -1, 3]),\n gl.STATIC_DRAW,\n );\n const loc = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n const uniforms: GlState[\"uniforms\"] = {};\n for (const name of [\n \"u_res\",\n \"u_time\",\n \"u_layers\",\n \"u_amp\",\n \"u_c0\",\n \"u_c1\",\n \"u_c2\",\n \"u_c3\",\n \"u_accent\",\n \"u_accentAmt\",\n ]) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n stateRef.current = { gl, uniforms };\n }, []);\n\n useEffect(() => {\n const state = stateRef.current;\n const canvas = canvasRef.current;\n if (!state || !canvas) return;\n const { gl, uniforms } = state;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uniforms.u_res, canvas.width, canvas.height);\n gl.uniform1f(uniforms.u_time, (frame / fps) * speed);\n gl.uniform1f(uniforms.u_layers, layers);\n gl.uniform1f(uniforms.u_amp, amplitude);\n gl.uniform3fv(uniforms.u_c0, hexToRgb(colors[0]));\n gl.uniform3fv(uniforms.u_c1, hexToRgb(colors[1]));\n gl.uniform3fv(uniforms.u_c2, hexToRgb(colors[2]));\n gl.uniform3fv(uniforms.u_c3, hexToRgb(colors[3]));\n gl.uniform3fv(uniforms.u_accent, hexToRgb(accent));\n gl.uniform1f(uniforms.u_accentAmt, accentAmount);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n if (!continuedRef.current) {\n continuedRef.current = true;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n }\n }, [\n frame,\n fps,\n speed,\n layers,\n amplitude,\n colors,\n accent,\n accentAmount,\n handle,\n ]);\n\n return (\n <div className={className} style={{ position: \"absolute\", inset: 0 }}>\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useEffect, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n// A field of fine horizontal sediment layers — strata. Each layer's edge is\n// displaced by fbm noise and drifts at its own depth speed, so the stack reads\n// as a living foundation rather than a gradient. Written for the remocn\n// registry as a custom WebGL shader (not a paper-design wrapper): frame-driven,\n// deterministic, no wall-clock time anywhere.\n//\n// `accent` / `accentAmount` tint the DEEP strata (the bottom of the frame) —\n// the layers everything else stands on — which is what makes it a natural\n// carrier for \"base\" stories: the undertone can arrive mid-video by animating\n// `accentAmount` with the master timeline.\n\ninterface ShaderStrataProps {\n /** Palette from the deepest layer to the surface layer. Exactly 4 stops. */\n colors?: [string, string, string, string];\n /** Tint mixed into the deep strata. */\n accent?: string;\n /** 0..1 — how much of the accent the deep strata take. */\n accentAmount?: number;\n /** Number of strata bands across the frame height. */\n layers?: number;\n /** Edge waviness of each layer, in fractions of the frame height. */\n amplitude?: number;\n /** Global time multiplier. */\n speed?: number;\n className?: string;\n}\n\nconst VERT = `\nattribute vec2 a_pos;\nvoid main() {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `\nprecision highp float;\n\nuniform vec2 u_res;\nuniform float u_time;\nuniform float u_layers;\nuniform float u_amp;\nuniform vec3 u_c0;\nuniform vec3 u_c1;\nuniform vec3 u_c2;\nuniform vec3 u_c3;\nuniform vec3 u_accent;\nuniform float u_accentAmt;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * noise(p);\n p *= 2.03;\n a *= 0.5;\n }\n return v;\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / u_res;\n float aspect = u_res.x / u_res.y;\n\n // Deeper layers drift faster — parallax without per-band recursion.\n float drift = u_time * (0.012 + 0.05 * (1.0 - uv.y));\n float w = fbm(vec2(uv.x * 2.6 * aspect + drift, uv.y * 2.2 - u_time * 0.01));\n\n float yd = uv.y + (w - 0.5) * u_amp;\n float band = yd * u_layers;\n float idx = floor(band);\n float f = fract(band);\n\n // Per-band value jitter + a soft sediment shadow at each band's lower edge.\n float j = hash(vec2(idx, 7.0));\n float edge = smoothstep(0.0, 0.4, f) * (1.0 - 0.3 * smoothstep(0.8, 1.0, f));\n\n float depth = clamp(idx / u_layers, 0.0, 1.0);\n vec3 col = mix(u_c0, u_c1, smoothstep(0.0, 0.4, depth));\n col = mix(col, u_c2, smoothstep(0.35, 0.75, depth));\n col = mix(col, u_c3, smoothstep(0.7, 1.0, depth));\n col *= 0.84 + 0.16 * j;\n col *= 0.92 + 0.08 * edge;\n\n // The accent rises from the deep strata and thins toward the surface.\n float mask = (1.0 - uv.y);\n mask *= mask;\n col = mix(col, u_accent, clamp(u_accentAmt, 0.0, 1.0) * mask * 0.38);\n\n // A whisper of living grain, time-derived so it stays deterministic.\n col += (hash(gl_FragCoord.xy + floor(u_time * 9.0)) - 0.5) * 0.012;\n\n gl_FragColor = vec4(col, 1.0);\n}\n`;\n\nconst hexToRgb = (hex: string): [number, number, number] => {\n const h = hex.replace(\"#\", \"\");\n const v =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n const n = parseInt(v, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n};\n\ntype GlState = {\n gl: WebGLRenderingContext;\n uniforms: Record<string, WebGLUniformLocation | null>;\n};\n\nfunction ShaderStrataBase({\n colors = [\"#050507\", \"#0a0a0d\", \"#111014\", \"#17161b\"],\n accent = \"#6733FF\",\n accentAmount = 0,\n layers = 14,\n amplitude = 0.16,\n speed = 1,\n className,\n}: ShaderStrataProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const stateRef = useRef<GlState | null>(null);\n const [handle] = useState(() => delayRender(\"shader-strata\"));\n const continuedRef = useRef(false);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || stateRef.current) return;\n const gl = canvas.getContext(\"webgl\", {\n antialias: false,\n preserveDrawingBuffer: true,\n });\n if (!gl) return;\n\n const compile = (type: number, src: string) => {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"Failed to create WebGL shader\");\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n };\n const program = gl.createProgram();\n if (!program) return;\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n // biome-ignore lint/correctness/useHookAtTopLevel: gl.useProgram is a WebGL method, not a React hook\n gl.useProgram(program);\n\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([-1, -1, 3, -1, -1, 3]),\n gl.STATIC_DRAW,\n );\n const loc = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n const uniforms: GlState[\"uniforms\"] = {};\n for (const name of [\n \"u_res\",\n \"u_time\",\n \"u_layers\",\n \"u_amp\",\n \"u_c0\",\n \"u_c1\",\n \"u_c2\",\n \"u_c3\",\n \"u_accent\",\n \"u_accentAmt\",\n ]) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n stateRef.current = { gl, uniforms };\n }, []);\n\n useEffect(() => {\n const state = stateRef.current;\n const canvas = canvasRef.current;\n if (!state || !canvas) return;\n const { gl, uniforms } = state;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uniforms.u_res, canvas.width, canvas.height);\n gl.uniform1f(uniforms.u_time, (frame / fps) * speed);\n gl.uniform1f(uniforms.u_layers, layers);\n gl.uniform1f(uniforms.u_amp, amplitude);\n gl.uniform3fv(uniforms.u_c0, hexToRgb(colors[0]));\n gl.uniform3fv(uniforms.u_c1, hexToRgb(colors[1]));\n gl.uniform3fv(uniforms.u_c2, hexToRgb(colors[2]));\n gl.uniform3fv(uniforms.u_c3, hexToRgb(colors[3]));\n gl.uniform3fv(uniforms.u_accent, hexToRgb(accent));\n gl.uniform1f(uniforms.u_accentAmt, accentAmount);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n if (!continuedRef.current) {\n continuedRef.current = true;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n }\n }, [\n frame,\n fps,\n speed,\n layers,\n amplitude,\n colors,\n accent,\n accentAmount,\n handle,\n ]);\n\n return (\n <div className={className} style={{ position: \"absolute\", inset: 0 }}>\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n layers: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 14,\n description: \"Layers\",\n hiddenFromList: false,\n },\n amplitude: {\n type: \"number\",\n min: 0,\n max: 0.5,\n step: 0.01,\n default: 0.16,\n description: \"Amplitude\",\n hiddenFromList: false,\n },\n accent: {\n type: \"color\",\n default: \"#6733FF\",\n description: \"Accent\",\n },\n accentAmount: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0,\n description: \"Accent amount\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"layers\",\"amplitude\",\"accent\",\"accentAmount\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n layers: 14,\n amplitude: 0.16,\n accent: \"#6733FF\",\n accentAmount: 0,\n};\n\ntype ShaderStrataElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderStrataBase>;\n\nconst ShaderStrataInner = forwardRef<\n HTMLDivElement,\n ShaderStrataElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderStrata>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderStrataBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderStrataBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderStrata = Interactive.withSchema({\n Component: ShaderStrataInner,\n componentName: \"<ShaderStrata>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-swirl.json b/registry-artifacts/elements/shader-swirl.jsonindex f0965ce9..c0d6e3af 100644--- a/registry-artifacts/elements/shader-swirl.json+++ b/registry-artifacts/elements/shader-swirl.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Swirl","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-swirl",- "sourceCode": "import { Swirl, type SwirlProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#52527a\", \"#3a3a5c\", \"#232338\"];\n\nexport interface ShaderSwirlProps extends Omit<SwirlProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderSwirl({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#12121a\",\n bandCount = 4,\n twist = 0.1,\n softness = 0.2,\n className,\n ...rest\n}: ShaderSwirlProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-swirl\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Swirl\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n bandCount={bandCount}\n twist={twist}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Swirl, type SwirlProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#52527a\", \"#3a3a5c\", \"#232338\"];\n\ninterface ShaderSwirlProps extends Omit<SwirlProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderSwirlBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#12121a\",\n bandCount = 4,\n twist = 0.1,\n softness = 0.2,\n className,\n ...rest\n}: ShaderSwirlProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-swirl\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Swirl\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n bandCount={bandCount}\n twist={twist}\n softness={softness}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n bandCount: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 4,\n description: \"Bands\",\n hiddenFromList: false,\n },\n twist: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.1,\n description: \"Twist\",\n hiddenFromList: false,\n },\n softness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.2,\n description: \"Softness\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"bandCount\",\"twist\",\"softness\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n bandCount: 4,\n twist: 0.1,\n softness: 0.2,\n colorBack: \"#12121a\",\n};\n\ntype ShaderSwirlElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderSwirlBase>;\n\nconst ShaderSwirlInner = forwardRef<\n HTMLDivElement,\n ShaderSwirlElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderSwirl>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderSwirlBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderSwirlBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderSwirl = Interactive.withSchema({\n Component: ShaderSwirlInner,\n componentName: \"<ShaderSwirl>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-voronoi.json b/registry-artifacts/elements/shader-voronoi.jsonindex d8497625..26cc0fbb 100644--- a/registry-artifacts/elements/shader-voronoi.json+++ b/registry-artifacts/elements/shader-voronoi.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Voronoi","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-voronoi",- "sourceCode": "import { Voronoi, type VoronoiProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\"];\n\nexport interface ShaderVoronoiProps\n extends Omit<VoronoiProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderVoronoi({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorGap = \"#12121a\",\n distortion = 0.4,\n gap = 0.04,\n glow = 0,\n className,\n ...rest\n}: ShaderVoronoiProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-voronoi\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Voronoi\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorGap={colorGap}\n distortion={distortion}\n gap={gap}\n glow={glow}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Voronoi, type VoronoiProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\"];\n\ninterface ShaderVoronoiProps\n extends Omit<VoronoiProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderVoronoiBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorGap = \"#12121a\",\n distortion = 0.4,\n gap = 0.04,\n glow = 0,\n className,\n ...rest\n}: ShaderVoronoiProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-voronoi\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Voronoi\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorGap={colorGap}\n distortion={distortion}\n gap={gap}\n glow={glow}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n distortion: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.4,\n description: \"Distortion\",\n hiddenFromList: false,\n },\n gap: {\n type: \"number\",\n min: 0,\n max: 0.2,\n step: 0.01,\n default: 0.04,\n description: \"Gap\",\n hiddenFromList: false,\n },\n glow: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0,\n description: \"Glow\",\n hiddenFromList: false,\n },\n colorGap: {\n type: \"color\",\n default: \"#12121a\",\n description: \"Gap Color\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"distortion\",\"gap\",\"glow\",\"colorGap\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n distortion: 0.4,\n gap: 0.04,\n glow: 0,\n colorGap: \"#12121a\",\n};\n\ntype ShaderVoronoiElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderVoronoiBase>;\n\nconst ShaderVoronoiInner = forwardRef<\n HTMLDivElement,\n ShaderVoronoiElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderVoronoi>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderVoronoiBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderVoronoiBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderVoronoi = Interactive.withSchema({\n Component: ShaderVoronoiInner,\n componentName: \"<ShaderVoronoi>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-warp.json b/registry-artifacts/elements/shader-warp.jsonindex 149cae18..1b88038c 100644--- a/registry-artifacts/elements/shader-warp.json+++ b/registry-artifacts/elements/shader-warp.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Warp","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-warp",- "sourceCode": "import { Warp, type WarpProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#12121a\", \"#3a3a5c\", \"#12121a\", \"#52527a\"];\n\nexport interface ShaderWarpProps extends Omit<WarpProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderWarp({\n speed = 1,\n colors = NEUTRAL_COLORS,\n proportion = 0.5,\n softness = 1,\n distortion = 0.2,\n swirl = 0.4,\n className,\n ...rest\n}: ShaderWarpProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-warp\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Warp\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n proportion={proportion}\n softness={softness}\n distortion={distortion}\n swirl={swirl}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Warp, type WarpProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#12121a\", \"#3a3a5c\", \"#12121a\", \"#52527a\"];\n\ninterface ShaderWarpProps extends Omit<WarpProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderWarpBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n proportion = 0.5,\n softness = 1,\n distortion = 0.2,\n swirl = 0.4,\n className,\n ...rest\n}: ShaderWarpProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-warp\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Warp\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n proportion={proportion}\n softness={softness}\n distortion={distortion}\n swirl={swirl}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n distortion: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.2,\n description: \"Distortion\",\n hiddenFromList: false,\n },\n swirl: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.4,\n description: \"Swirl\",\n hiddenFromList: false,\n },\n softness: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Softness\",\n hiddenFromList: false,\n },\n proportion: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.5,\n description: \"Proportion\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"distortion\",\"swirl\",\"softness\",\"proportion\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n distortion: 0.2,\n swirl: 0.4,\n softness: 1,\n proportion: 0.5,\n};\n\ntype ShaderWarpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderWarpBase>;\n\nconst ShaderWarpInner = forwardRef<\n HTMLDivElement,\n ShaderWarpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderWarp>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderWarpBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderWarpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderWarp = Interactive.withSchema({\n Component: ShaderWarpInner,\n componentName: \"<ShaderWarp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-water.json b/registry-artifacts/elements/shader-water.jsonindex 85e2ab88..6c55f247 100644--- a/registry-artifacts/elements/shader-water.json+++ b/registry-artifacts/elements/shader-water.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Shader Water","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-water",- "sourceCode": "import { Water, type WaterProps } from \"@paper-design/shaders-react\";\nimport { useCallback, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShaderWaterProps extends Omit<WaterProps, \"frame\" | \"ref\"> {}\n\nexport function ShaderWater({\n speed = 1,\n colorBack = \"#16202b\",\n colorHighlight = \"#5a6a7a\",\n highlights = 0.06,\n waves = 0.3,\n caustic = 0.08,\n className,\n ...rest\n}: ShaderWaterProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-water\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Water\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorHighlight={colorHighlight}\n highlights={highlights}\n waves={waves}\n caustic={caustic}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}"+ "sourceCode": "import { Water, type WaterProps } from \"@paper-design/shaders-react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShaderWaterProps extends Omit<WaterProps, \"frame\" | \"ref\"> {}\n\nfunction ShaderWaterBase({\n speed = 1,\n colorBack = \"#16202b\",\n colorHighlight = \"#5a6a7a\",\n highlights = 0.06,\n waves = 0.3,\n caustic = 0.08,\n className,\n ...rest\n}: ShaderWaterProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-water\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <Water\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colorBack={colorBack}\n colorHighlight={colorHighlight}\n highlights={highlights}\n waves={waves}\n caustic={caustic}\n fit=\"cover\"\n width={width}\n height={height}\n {...rest}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n waves: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0.3,\n description: \"Waves\",\n hiddenFromList: false,\n },\n caustic: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.02,\n default: 0.08,\n description: \"Caustic\",\n hiddenFromList: false,\n },\n highlights: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.02,\n default: 0.06,\n description: \"Highlights\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#16202b\",\n description: \"Background\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"waves\",\"caustic\",\"highlights\",\"colorBack\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n waves: 0.3,\n caustic: 0.08,\n highlights: 0.06,\n colorBack: \"#16202b\",\n};\n\ntype ShaderWaterElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderWaterBase>;\n\nconst ShaderWaterInner = forwardRef<\n HTMLDivElement,\n ShaderWaterElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderWater>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderWaterBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderWaterBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderWater = Interactive.withSchema({\n Component: ShaderWaterInner,\n componentName: \"<ShaderWater>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shader-weave.json b/registry-artifacts/elements/shader-weave.jsonindex b59fa300..b7a3091d 100644--- a/registry-artifacts/elements/shader-weave.json+++ b/registry-artifacts/elements/shader-weave.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Shader Weave","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shader-weave",- "sourceCode": "import { useEffect, useRef, useState } from \"react\";\nimport { continueRender, delayRender, useCurrentFrame, useVideoConfig } from \"remotion\";\n\n// A woven substrate — warp and weft threads crossing on a domain-warped grid,\n// interlacing over/under like real cloth, with a slow sheen of light travelling\n// across the fabric rather than the grid scrolling. The metaphor: the base a\n// component is woven from. Written for the remocn registry as a custom WebGL\n// shader (not a paper-design wrapper): frame-driven, deterministic, no\n// wall-clock time anywhere.\n//\n// `accent` / `accentAmount` run a coloured thread through the weave — the tint\n// lives mostly IN the threads, so raising `accentAmount` mid-video reads as a\n// violet thread lighting up across the whole cloth (a natural carrier for a\n// \"new base\" story). The grid itself never moves; only the light does.\n\nexport interface ShaderWeaveProps {\n /** Palette: fabric-shadow, fabric-mid, fabric-warm, thread-highlight. 4 stops. */\n colors?: [string, string, string, string];\n /** Tint carried by the threads. */\n accent?: string;\n /** 0..1 — how much accent the threads take. */\n accentAmount?: number;\n /** Thread density across the frame height. */\n scale?: number;\n /** Domain-warp amount — how hand-woven the threads bend (fractions of frame). */\n warp?: number;\n /** Global time multiplier (drives only the sheen, never the grid position). */\n speed?: number;\n className?: string;\n}\n\nconst VERT = `\nattribute vec2 a_pos;\nvoid main() {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `\nprecision highp float;\n\nuniform vec2 u_res;\nuniform float u_time;\nuniform float u_scale;\nuniform float u_warp;\nuniform vec3 u_c0;\nuniform vec3 u_c1;\nuniform vec3 u_c2;\nuniform vec3 u_c3;\nuniform vec3 u_accent;\nuniform float u_accentAmt;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * noise(p);\n p *= 2.03;\n a *= 0.5;\n }\n return v;\n}\n\n// A thin ridge line at every integer of x — the profile of one thread.\nfloat thread(float x, float sharp) {\n float f = fract(x);\n float d = min(f, 1.0 - f);\n return smoothstep(sharp, 0.0, d);\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / u_res;\n float aspect = u_res.x / u_res.y;\n\n // Domain warp — bend the weave so it reads hand-made, not a CSS grid. The\n // warp field drifts very slowly; the grid lattice itself stays put.\n vec2 q = uv + u_warp * vec2(\n fbm(uv * 3.0 + vec2(u_time * 0.03, 0.0)) - 0.5,\n fbm(uv * 3.0 + vec2(7.3, -u_time * 0.02)) - 0.5\n );\n\n float qx = q.x * u_scale * aspect;\n float qy = q.y * u_scale;\n\n float tw = thread(qx, 0.09); // warp (vertical threads)\n float tf = thread(qy, 0.09); // weft (horizontal threads)\n\n // Interlace: per cell, one direction sits over the other.\n float over = mod(floor(qx) + floor(qy), 2.0);\n float warpB = tw * (over < 0.5 ? 1.0 : 0.5);\n float weftB = tf * (over < 0.5 ? 0.5 : 1.0);\n float weave = max(warpB, weftB);\n\n // Sheen — light travelling across a still cloth (this is the only motion).\n float sheen = fbm(q * 1.7 + vec2(u_time * 0.05, u_time * 0.028));\n weave *= 0.3 + 0.95 * sheen;\n\n // Fabric ground: near-black, faintly breathing between the shadow stops.\n vec3 base = mix(u_c0, u_c1, smoothstep(0.15, 0.8, sheen));\n base = mix(base, u_c2, smoothstep(0.62, 1.0, sheen) * 0.5);\n\n // Threads sit a touch above the ground.\n vec3 col = mix(base, u_c3, clamp(weave, 0.0, 1.0) * 0.55);\n\n // The accent runs through the threads — a violet thread across the cloth.\n float amt = clamp(u_accentAmt, 0.0, 1.0);\n col = mix(col, u_accent, amt * (0.08 + 0.34 * weave));\n col += u_accent * amt * 0.015;\n\n // A whisper of living grain, time-derived so it stays deterministic.\n col += (hash(gl_FragCoord.xy + floor(u_time * 9.0)) - 0.5) * 0.012;\n\n gl_FragColor = vec4(col, 1.0);\n}\n`;\n\nconst hexToRgb = (hex: string): [number, number, number] => {\n const h = hex.replace(\"#\", \"\");\n const v =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n const n = parseInt(v, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n};\n\ntype GlState = {\n gl: WebGLRenderingContext;\n uniforms: Record<string, WebGLUniformLocation | null>;\n};\n\nexport function ShaderWeave({\n colors = [\"#050506\", \"#0a0a0c\", \"#111015\", \"#1b1a22\"],\n accent = \"#6733FF\",\n accentAmount = 0,\n scale = 22,\n warp = 0.03,\n speed = 1,\n className,\n}: ShaderWeaveProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const stateRef = useRef<GlState | null>(null);\n const [handle] = useState(() => delayRender(\"shader-weave\"));\n const continuedRef = useRef(false);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || stateRef.current) return;\n const gl = canvas.getContext(\"webgl\", {\n antialias: false,\n preserveDrawingBuffer: true,\n });\n if (!gl) return;\n\n const compile = (type: number, src: string) => {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"Failed to create WebGL shader\");\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n };\n const program = gl.createProgram();\n if (!program) return;\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n // biome-ignore lint/correctness/useHookAtTopLevel: gl.useProgram is a WebGL method, not a React hook\n gl.useProgram(program);\n\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([-1, -1, 3, -1, -1, 3]),\n gl.STATIC_DRAW,\n );\n const loc = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n const uniforms: GlState[\"uniforms\"] = {};\n for (const name of [\n \"u_res\",\n \"u_time\",\n \"u_scale\",\n \"u_warp\",\n \"u_c0\",\n \"u_c1\",\n \"u_c2\",\n \"u_c3\",\n \"u_accent\",\n \"u_accentAmt\",\n ]) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n stateRef.current = { gl, uniforms };\n }, []);\n\n useEffect(() => {\n const state = stateRef.current;\n const canvas = canvasRef.current;\n if (!state || !canvas) return;\n const { gl, uniforms } = state;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uniforms.u_res, canvas.width, canvas.height);\n gl.uniform1f(uniforms.u_time, (frame / fps) * speed);\n gl.uniform1f(uniforms.u_scale, scale);\n gl.uniform1f(uniforms.u_warp, warp);\n gl.uniform3fv(uniforms.u_c0, hexToRgb(colors[0]));\n gl.uniform3fv(uniforms.u_c1, hexToRgb(colors[1]));\n gl.uniform3fv(uniforms.u_c2, hexToRgb(colors[2]));\n gl.uniform3fv(uniforms.u_c3, hexToRgb(colors[3]));\n gl.uniform3fv(uniforms.u_accent, hexToRgb(accent));\n gl.uniform1f(uniforms.u_accentAmt, accentAmount);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n if (!continuedRef.current) {\n continuedRef.current = true;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n }\n }, [frame, fps, speed, scale, warp, colors, accent, accentAmount, handle]);\n\n return (\n <div className={className} style={{ position: \"absolute\", inset: 0 }}>\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useEffect, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n// A woven substrate — warp and weft threads crossing on a domain-warped grid,\n// interlacing over/under like real cloth, with a slow sheen of light travelling\n// across the fabric rather than the grid scrolling. The metaphor: the base a\n// component is woven from. Written for the remocn registry as a custom WebGL\n// shader (not a paper-design wrapper): frame-driven, deterministic, no\n// wall-clock time anywhere.\n//\n// `accent` / `accentAmount` run a coloured thread through the weave — the tint\n// lives mostly IN the threads, so raising `accentAmount` mid-video reads as a\n// violet thread lighting up across the whole cloth (a natural carrier for a\n// \"new base\" story). The grid itself never moves; only the light does.\n\ninterface ShaderWeaveProps {\n /** Palette: fabric-shadow, fabric-mid, fabric-warm, thread-highlight. 4 stops. */\n colors?: [string, string, string, string];\n /** Tint carried by the threads. */\n accent?: string;\n /** 0..1 — how much accent the threads take. */\n accentAmount?: number;\n /** Thread density across the frame height. */\n scale?: number;\n /** Domain-warp amount — how hand-woven the threads bend (fractions of frame). */\n warp?: number;\n /** Global time multiplier (drives only the sheen, never the grid position). */\n speed?: number;\n className?: string;\n}\n\nconst VERT = `\nattribute vec2 a_pos;\nvoid main() {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `\nprecision highp float;\n\nuniform vec2 u_res;\nuniform float u_time;\nuniform float u_scale;\nuniform float u_warp;\nuniform vec3 u_c0;\nuniform vec3 u_c1;\nuniform vec3 u_c2;\nuniform vec3 u_c3;\nuniform vec3 u_accent;\nuniform float u_accentAmt;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * noise(p);\n p *= 2.03;\n a *= 0.5;\n }\n return v;\n}\n\n// A thin ridge line at every integer of x — the profile of one thread.\nfloat thread(float x, float sharp) {\n float f = fract(x);\n float d = min(f, 1.0 - f);\n return smoothstep(sharp, 0.0, d);\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / u_res;\n float aspect = u_res.x / u_res.y;\n\n // Domain warp — bend the weave so it reads hand-made, not a CSS grid. The\n // warp field drifts very slowly; the grid lattice itself stays put.\n vec2 q = uv + u_warp * vec2(\n fbm(uv * 3.0 + vec2(u_time * 0.03, 0.0)) - 0.5,\n fbm(uv * 3.0 + vec2(7.3, -u_time * 0.02)) - 0.5\n );\n\n float qx = q.x * u_scale * aspect;\n float qy = q.y * u_scale;\n\n float tw = thread(qx, 0.09); // warp (vertical threads)\n float tf = thread(qy, 0.09); // weft (horizontal threads)\n\n // Interlace: per cell, one direction sits over the other.\n float over = mod(floor(qx) + floor(qy), 2.0);\n float warpB = tw * (over < 0.5 ? 1.0 : 0.5);\n float weftB = tf * (over < 0.5 ? 0.5 : 1.0);\n float weave = max(warpB, weftB);\n\n // Sheen — light travelling across a still cloth (this is the only motion).\n float sheen = fbm(q * 1.7 + vec2(u_time * 0.05, u_time * 0.028));\n weave *= 0.3 + 0.95 * sheen;\n\n // Fabric ground: near-black, faintly breathing between the shadow stops.\n vec3 base = mix(u_c0, u_c1, smoothstep(0.15, 0.8, sheen));\n base = mix(base, u_c2, smoothstep(0.62, 1.0, sheen) * 0.5);\n\n // Threads sit a touch above the ground.\n vec3 col = mix(base, u_c3, clamp(weave, 0.0, 1.0) * 0.55);\n\n // The accent runs through the threads — a violet thread across the cloth.\n float amt = clamp(u_accentAmt, 0.0, 1.0);\n col = mix(col, u_accent, amt * (0.08 + 0.34 * weave));\n col += u_accent * amt * 0.015;\n\n // A whisper of living grain, time-derived so it stays deterministic.\n col += (hash(gl_FragCoord.xy + floor(u_time * 9.0)) - 0.5) * 0.012;\n\n gl_FragColor = vec4(col, 1.0);\n}\n`;\n\nconst hexToRgb = (hex: string): [number, number, number] => {\n const h = hex.replace(\"#\", \"\");\n const v =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n const n = parseInt(v, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n};\n\ntype GlState = {\n gl: WebGLRenderingContext;\n uniforms: Record<string, WebGLUniformLocation | null>;\n};\n\nfunction ShaderWeaveBase({\n colors = [\"#050506\", \"#0a0a0c\", \"#111015\", \"#1b1a22\"],\n accent = \"#6733FF\",\n accentAmount = 0,\n scale = 22,\n warp = 0.03,\n speed = 1,\n className,\n}: ShaderWeaveProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const stateRef = useRef<GlState | null>(null);\n const [handle] = useState(() => delayRender(\"shader-weave\"));\n const continuedRef = useRef(false);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || stateRef.current) return;\n const gl = canvas.getContext(\"webgl\", {\n antialias: false,\n preserveDrawingBuffer: true,\n });\n if (!gl) return;\n\n const compile = (type: number, src: string) => {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"Failed to create WebGL shader\");\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n };\n const program = gl.createProgram();\n if (!program) return;\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n // biome-ignore lint/correctness/useHookAtTopLevel: gl.useProgram is a WebGL method, not a React hook\n gl.useProgram(program);\n\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([-1, -1, 3, -1, -1, 3]),\n gl.STATIC_DRAW,\n );\n const loc = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n const uniforms: GlState[\"uniforms\"] = {};\n for (const name of [\n \"u_res\",\n \"u_time\",\n \"u_scale\",\n \"u_warp\",\n \"u_c0\",\n \"u_c1\",\n \"u_c2\",\n \"u_c3\",\n \"u_accent\",\n \"u_accentAmt\",\n ]) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n stateRef.current = { gl, uniforms };\n }, []);\n\n useEffect(() => {\n const state = stateRef.current;\n const canvas = canvasRef.current;\n if (!state || !canvas) return;\n const { gl, uniforms } = state;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uniforms.u_res, canvas.width, canvas.height);\n gl.uniform1f(uniforms.u_time, (frame / fps) * speed);\n gl.uniform1f(uniforms.u_scale, scale);\n gl.uniform1f(uniforms.u_warp, warp);\n gl.uniform3fv(uniforms.u_c0, hexToRgb(colors[0]));\n gl.uniform3fv(uniforms.u_c1, hexToRgb(colors[1]));\n gl.uniform3fv(uniforms.u_c2, hexToRgb(colors[2]));\n gl.uniform3fv(uniforms.u_c3, hexToRgb(colors[3]));\n gl.uniform3fv(uniforms.u_accent, hexToRgb(accent));\n gl.uniform1f(uniforms.u_accentAmt, accentAmount);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n if (!continuedRef.current) {\n continuedRef.current = true;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n }\n }, [frame, fps, speed, scale, warp, colors, accent, accentAmount, handle]);\n\n return (\n <div className={className} style={{ position: \"absolute\", inset: 0 }}>\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n scale: {\n type: \"number\",\n min: 6,\n max: 48,\n step: 1,\n default: 22,\n description: \"Scale\",\n hiddenFromList: false,\n },\n warp: {\n type: \"number\",\n min: 0,\n max: 0.2,\n step: 0.01,\n default: 0.03,\n description: \"Warp\",\n hiddenFromList: false,\n },\n accent: {\n type: \"color\",\n default: \"#6733FF\",\n description: \"Accent\",\n },\n accentAmount: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 0,\n description: \"Accent amount\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"scale\",\"warp\",\"accent\",\"accentAmount\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n scale: 22,\n warp: 0.03,\n accent: \"#6733FF\",\n accentAmount: 0,\n};\n\ntype ShaderWeaveElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderWeaveBase>;\n\nconst ShaderWeaveInner = forwardRef<\n HTMLDivElement,\n ShaderWeaveElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderWeave>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderWeaveBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderWeaveBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderWeave = Interactive.withSchema({\n Component: ShaderWeaveInner,\n componentName: \"<ShaderWeave>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/shared-axis-y.json b/registry-artifacts/elements/shared-axis-y.jsonindex 48910d26..fed48bda 100644--- a/registry-artifacts/elements/shared-axis-y.json+++ b/registry-artifacts/elements/shared-axis-y.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Shared Axis Y","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shared-axis-y",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SharedAxisYProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SharedAxisY({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisYProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 5;\n const exitDur = 4;\n const enterStagger = 2;\n const exitStagger = 2;\n const overlapF = 0;\n const microDelayF = 1;\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SharedAxisYProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SharedAxisYBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisYProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 5;\n const exitDur = 4;\n const enterStagger = 2;\n const exitStagger = 2;\n const overlapF = 0;\n const microDelayF = 1;\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Layered navigation.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Hierarchy made clear.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Layered navigation.\",\n toText: \"Hierarchy made clear.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SharedAxisYElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SharedAxisYBase>;\n\nconst SharedAxisYInner = forwardRef<\n HTMLDivElement,\n SharedAxisYElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SharedAxisY>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SharedAxisYBase\n {...(componentProps as unknown as ComponentProps<typeof SharedAxisYBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SharedAxisY = Interactive.withSchema({\n Component: SharedAxisYInner,\n componentName: \"<SharedAxisY>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/shared-axis-z.json b/registry-artifacts/elements/shared-axis-z.jsonindex e102ad6b..e21f624a 100644--- a/registry-artifacts/elements/shared-axis-z.json+++ b/registry-artifacts/elements/shared-axis-z.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Shared Axis Z","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shared-axis-z",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SharedAxisZProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SharedAxisZ({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisZProps) {\n const frame = useCurrentFrame() * speed;\n\n const enterDur = 16;\n const exitDur = 11;\n const overlapF = 3;\n const microDelayF = 1;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toBlur = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `scale(${fromScale})`,\n filter: `blur(${fromBlur}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `scale(${toScale})`,\n filter: `blur(${toBlur}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SharedAxisZProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SharedAxisZBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisZProps) {\n const frame = useCurrentFrame() * speed;\n\n const enterDur = 16;\n const exitDur = 11;\n const overlapF = 3;\n const microDelayF = 1;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toBlur = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `scale(${fromScale})`,\n filter: `blur(${fromBlur}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `scale(${toScale})`,\n filter: `blur(${toBlur}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Zooming between states.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Elevate and settle.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Zooming between states.\",\n toText: \"Elevate and settle.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SharedAxisZElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SharedAxisZBase>;\n\nconst SharedAxisZInner = forwardRef<\n HTMLDivElement,\n SharedAxisZElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SharedAxisZ>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SharedAxisZBase\n {...(componentProps as unknown as ComponentProps<typeof SharedAxisZBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SharedAxisZ = Interactive.withSchema({\n Component: SharedAxisZInner,\n componentName: \"<SharedAxisZ>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/shimmer-sweep.json b/registry-artifacts/elements/shimmer-sweep.jsonindex e87e4d6a..2849d8f4 100644--- a/registry-artifacts/elements/shimmer-sweep.json+++ b/registry-artifacts/elements/shimmer-sweep.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Shimmer Sweep","durationInFrames": 120,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "shimmer-sweep",- "sourceCode": "import { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ShimmerSweepProps {\n text: string;\n baseColor?: string;\n shineColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ShimmerSweep({\n text,\n baseColor = \"#3f3f46\",\n shineColor = \"#fafafa\",\n fontSize = 96,\n fontWeight = 700,\n speed = 1,\n className,\n}: ShimmerSweepProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const position = interpolate(\n frame,\n [0, durationInFrames * 0.8],\n [200, -100],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n margin: 0,\n lineHeight: 1,\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div style={{ position: \"relative\", display: \"inline-block\" }}>\n <span style={{ ...textStyle, color: baseColor }}>{text}</span>\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(110deg, transparent 30%, ${shineColor} 50%, transparent 70%)`,\n backgroundSize: \"200% 100%\",\n backgroundPosition: `${position}% 50%`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ShimmerSweepProps {\n text: string;\n baseColor?: string;\n shineColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ShimmerSweepBase({\n text,\n baseColor = \"#3f3f46\",\n shineColor = \"#fafafa\",\n fontSize = 96,\n fontWeight = 700,\n speed = 1,\n className,\n}: ShimmerSweepProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const position = interpolate(\n frame,\n [0, durationInFrames * 0.8],\n [200, -100],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n margin: 0,\n lineHeight: 1,\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div style={{ position: \"relative\", display: \"inline-block\" }}>\n <span style={{ ...textStyle, color: baseColor }}>{text}</span>\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(110deg, transparent 30%, ${shineColor} 50%, transparent 70%)`,\n backgroundSize: \"200% 100%\",\n backgroundPosition: `${position}% 50%`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Generating\",\n description: \"Text\",\n },\n baseColor: {\n type: \"color\",\n default: \"#3f3f46\",\n description: \"Base color\",\n },\n shineColor: {\n type: \"color\",\n default: \"#fafafa\",\n description: \"Shine color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"baseColor\",\"shineColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Generating\",\n baseColor: \"#3f3f46\",\n shineColor: \"#fafafa\",\n fontSize: 96,\n fontWeight: \"700\",\n speed: 1,\n};\n\ntype ShimmerSweepElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShimmerSweepBase>;\n\nconst ShimmerSweepInner = forwardRef<\n HTMLDivElement,\n ShimmerSweepElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShimmerSweep>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShimmerSweepBase\n {...(componentProps as unknown as ComponentProps<typeof ShimmerSweepBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShimmerSweep = Interactive.withSchema({\n Component: ShimmerSweepInner,\n componentName: \"<ShimmerSweep>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 120}diff --git a/registry-artifacts/elements/short-slide-down.json b/registry-artifacts/elements/short-slide-down.jsonindex a82d13cd..1aaea595 100644--- a/registry-artifacts/elements/short-slide-down.json+++ b/registry-artifacts/elements/short-slide-down.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Short Slide Down","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "short-slide-down",- "sourceCode": "import { useMemo } from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ShortSlideDownProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nexport function ShortSlideDown({\n text,\n entryOffset = 28,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideDownProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const n = words.length;\n\n const lineGap = 12;\n const rowHeight = fontSize;\n const firstDur = 11;\n const pushDur = 15;\n const travelDur = 8;\n const entryScale = 0.992;\n const entryBlur = 2.4;\n const reflowBlur = 0.7;\n const firstWordY = -14;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= n; k++) {\n const total = rowHeight * k + lineGap * (k - 1);\n const start = -total / 2 + rowHeight / 2;\n const ys: number[] = [];\n for (let j = 0; j < k; j++) ys.push(start + j * (rowHeight + lineGap));\n out.push(ys);\n }\n return out;\n }, [n, rowHeight]);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetY = positionsAt[j][j];\n const yFrom = j === 0 ? firstWordY : targetY - entryOffset;\n\n let y = targetY;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n y = yFrom;\n scale = entryScale;\n blur = entryBlur;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n y = interpolate(frame, travelRange, [yFrom, targetY], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromY = positionsAt[w - 1][j];\n const toY = positionsAt[w][j];\n if (frame >= pushEnd) {\n y = toY;\n } else if (frame >= pushStart) {\n y = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromY, toY],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n y = fromY;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(0px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}"+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShortSlideDownProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction ShortSlideDownBase({\n text,\n entryOffset = 28,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideDownProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const n = words.length;\n\n const lineGap = 12;\n const rowHeight = fontSize;\n const firstDur = 11;\n const pushDur = 15;\n const travelDur = 8;\n const entryScale = 0.992;\n const entryBlur = 2.4;\n const reflowBlur = 0.7;\n const firstWordY = -14;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= n; k++) {\n const total = rowHeight * k + lineGap * (k - 1);\n const start = -total / 2 + rowHeight / 2;\n const ys: number[] = [];\n for (let j = 0; j < k; j++) ys.push(start + j * (rowHeight + lineGap));\n out.push(ys);\n }\n return out;\n }, [n, rowHeight]);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetY = positionsAt[j][j];\n const yFrom = j === 0 ? firstWordY : targetY - entryOffset;\n\n let y = targetY;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n y = yFrom;\n scale = entryScale;\n blur = entryBlur;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n y = interpolate(frame, travelRange, [yFrom, targetY], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromY = positionsAt[w - 1][j];\n const toY = positionsAt[w][j];\n if (frame >= pushEnd) {\n y = toY;\n } else if (frame >= pushStart) {\n y = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromY, toY],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n y = fromY;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(0px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Build from above.\",\n description: \"Text\",\n },\n entryOffset: {\n type: \"number\",\n min: 8,\n max: 80,\n step: 1,\n default: 28,\n description: \"Entry offset\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"entryOffset\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Build from above.\",\n entryOffset: 28,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ShortSlideDownElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShortSlideDownBase>;\n\nconst ShortSlideDownInner = forwardRef<\n HTMLDivElement,\n ShortSlideDownElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShortSlideDown>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShortSlideDownBase\n {...(componentProps as unknown as ComponentProps<typeof ShortSlideDownBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShortSlideDown = Interactive.withSchema({\n Component: ShortSlideDownInner,\n componentName: \"<ShortSlideDown>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/short-slide-right.json b/registry-artifacts/elements/short-slide-right.jsonindex 16b4be75..43e9e611 100644--- a/registry-artifacts/elements/short-slide-right.json+++ b/registry-artifacts/elements/short-slide-right.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Short Slide Right","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "short-slide-right",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ShortSlideRight({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const travelDur = 8;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, travelDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transform: `translateX(${x}px)`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ShortSlideRightBase({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const travelDur = 8;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, travelDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transform: `translateX(${x}px)`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Move with intent.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 24,\n description: \"Distance\",\n hiddenFromList: false,\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"staggerDelay\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Move with intent.\",\n distance: 24,\n staggerDelay: 3,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ShortSlideRightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShortSlideRightBase>;\n\nconst ShortSlideRightInner = forwardRef<\n HTMLDivElement,\n ShortSlideRightElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShortSlideRight>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShortSlideRightBase\n {...(componentProps as unknown as ComponentProps<typeof ShortSlideRightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShortSlideRight = Interactive.withSchema({\n Component: ShortSlideRightInner,\n componentName: \"<ShortSlideRight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/simulated-cursor.json b/registry-artifacts/elements/simulated-cursor.jsonindex 47f536e5..a602cd0a 100644--- a/registry-artifacts/elements/simulated-cursor.json+++ b/registry-artifacts/elements/simulated-cursor.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Simulated Cursor","durationInFrames": 150,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "simulated-cursor",- "sourceCode": "import { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\nexport interface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nexport function SimulatedCursor({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n transform: `scale(${clickScale})`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\ninterface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nfunction SimulatedCursorBase({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n transform: `scale(${clickScale})`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Color\",\n },\n size: {\n type: \"number\",\n min: 12,\n max: 96,\n step: 1,\n default: 32,\n description: \"Size\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"color\",\"size\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#ffffff\",\n size: 32,\n speed: 1,\n};\n\ntype SimulatedCursorElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SimulatedCursorBase>;\n\nconst SimulatedCursorInner = forwardRef<\n HTMLDivElement,\n SimulatedCursorElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SimulatedCursor>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SimulatedCursorBase\n {...(componentProps as unknown as ComponentProps<typeof SimulatedCursorBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SimulatedCursor = Interactive.withSchema({\n Component: SimulatedCursorInner,\n componentName: \"<SimulatedCursor>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 150}diff --git a/registry-artifacts/elements/soft-blur-in.json b/registry-artifacts/elements/soft-blur-in.jsonindex 7ce64f5d..efdc41d8 100644--- a/registry-artifacts/elements/soft-blur-in.json+++ b/registry-artifacts/elements/soft-blur-in.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Soft Blur In","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "soft-blur-in",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SoftBlurIn({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const charTravelFrames = 9;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SoftBlurInBase({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const charTravelFrames = 9;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Think different.\",\n description: \"Text\",\n },\n blur: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 12,\n description: \"Blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"blur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Think different.\",\n blur: 12,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SoftBlurInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SoftBlurInBase>;\n\nconst SoftBlurInInner = forwardRef<\n HTMLDivElement,\n SoftBlurInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SoftBlurIn>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SoftBlurInBase\n {...(componentProps as unknown as ComponentProps<typeof SoftBlurInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SoftBlurIn = Interactive.withSchema({\n Component: SoftBlurInInner,\n componentName: \"<SoftBlurIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/spring-scale-in.json b/registry-artifacts/elements/spring-scale-in.jsonindex 45ed646e..26439a3c 100644--- a/registry-artifacts/elements/spring-scale-in.json+++ b/registry-artifacts/elements/spring-scale-in.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Spring Scale In","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "spring-scale-in",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SpringScaleIn({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SpringScaleInBase({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Fast. Crisp. Fluid.\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n scaleFrom: {\n type: \"number\",\n min: 0.1,\n max: 1,\n step: 0.05,\n default: 0.7,\n description: \"Scale from\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"scaleFrom\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Fast. Crisp. Fluid.\",\n staggerDelay: 3,\n scaleFrom: 0.7,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SpringScaleInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SpringScaleInBase>;\n\nconst SpringScaleInInner = forwardRef<\n HTMLDivElement,\n SpringScaleInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SpringScaleIn>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SpringScaleInBase\n {...(componentProps as unknown as ComponentProps<typeof SpringScaleInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SpringScaleIn = Interactive.withSchema({\n Component: SpringScaleInInner,\n componentName: \"<SpringScaleIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/staggered-fade-up.json b/registry-artifacts/elements/staggered-fade-up.jsonindex e778b2e6..2fd11949 100644--- a/registry-artifacts/elements/staggered-fade-up.json+++ b/registry-artifacts/elements/staggered-fade-up.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Staggered Fade Up","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "staggered-fade-up",- "sourceCode": "import { interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface StaggeredFadeUpProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StaggeredFadeUp({\n text,\n staggerDelay = 4,\n distance = 20,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StaggeredFadeUpProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const y = interpolate(local, [0, 12], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface StaggeredFadeUpProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction StaggeredFadeUpBase({\n text,\n staggerDelay = 4,\n distance = 20,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StaggeredFadeUpProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const y = interpolate(local, [0, 12], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Ship faster with remocn\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 4,\n description: \"Stagger delay\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 20,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Ship faster with remocn\",\n staggerDelay: 4,\n distance: 20,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype StaggeredFadeUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof StaggeredFadeUpBase>;\n\nconst StaggeredFadeUpInner = forwardRef<\n HTMLDivElement,\n StaggeredFadeUpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<StaggeredFadeUp>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <StaggeredFadeUpBase\n {...(componentProps as unknown as ComponentProps<typeof StaggeredFadeUpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const StaggeredFadeUp = Interactive.withSchema({\n Component: StaggeredFadeUpInner,\n componentName: \"<StaggeredFadeUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/stretch-in.json b/registry-artifacts/elements/stretch-in.jsonindex 108a0794..44f51e3e 100644--- a/registry-artifacts/elements/stretch-in.json+++ b/registry-artifacts/elements/stretch-in.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Stretch In","durationInFrames": 48,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "stretch-in",- "sourceCode": "import { parse, type Font } from \"opentype.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { Easing, continueRender, delayRender, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface StretchInProps {\n className?: string;\n width?: number;\n height?: number;\n text?: string;\n fontUrl?: string;\n fontSize?: number;\n letterSpacing?: number;\n baselineY?: number;\n entryStart?: number;\n entryStagger?: number;\n travelFrames?: number;\n travelDistance?: number;\n vertexLagFrames?: number;\n curveSteps?: number;\n fill?: string;\n strokeWidth?: number;\n stroke?: string;\n}\n\ntype Contour = [number, number][];\n\nfunction flattenPath(\n commands: ReturnType<Font[\"getPath\"]>[\"commands\"],\n steps: number,\n): Contour[] {\n const contours: Contour[] = [];\n let current: Contour = [];\n let cx = 0;\n let cy = 0;\n\n for (const cmd of commands) {\n if (cmd.type === \"M\") {\n if (current.length > 0) contours.push(current);\n current = [[cmd.x, cmd.y]];\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"L\") {\n current.push([cmd.x, cmd.y]);\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"Q\") {\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const mt = 1 - t;\n current.push([\n mt * mt * cx + 2 * mt * t * cmd.x1 + t * t * cmd.x,\n mt * mt * cy + 2 * mt * t * cmd.y1 + t * t * cmd.y,\n ]);\n }\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"C\") {\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const mt = 1 - t;\n current.push([\n mt * mt * mt * cx +\n 3 * mt * mt * t * cmd.x1 +\n 3 * mt * t * t * cmd.x2 +\n t * t * t * cmd.x,\n mt * mt * mt * cy +\n 3 * mt * mt * t * cmd.y1 +\n 3 * mt * t * t * cmd.y2 +\n t * t * t * cmd.y,\n ]);\n }\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"Z\") {\n if (current.length > 0) contours.push(current);\n current = [];\n }\n }\n if (current.length > 0) contours.push(current);\n return contours;\n}\n\nexport function StretchIn({\n className,\n width = 1920,\n height = 1080,\n text = \"REMOCN\",\n fontUrl = \"https://fonts.gstatic.com/s/anton/v27/1Ptgg87LROyAm0K0.ttf\",\n fontSize = 510,\n letterSpacing = 0,\n baselineY,\n entryStart = 0,\n entryStagger = 3,\n travelFrames = 33,\n travelDistance = 1500,\n vertexLagFrames = 3.5,\n curveSteps = 8,\n fill = \"#ffffff\",\n strokeWidth = 0,\n stroke = \"#ffffff\",\n}: StretchInProps) {\n const frame = useCurrentFrame();\n const [font, setFont] = useState<Font | null>(null);\n\n useEffect(() => {\n const handle = delayRender(\"stretch-in: loading font\");\n let cancelled = false;\n fetch(fontUrl)\n .then((res) => res.arrayBuffer())\n .then((buffer) => {\n if (!cancelled) setFont(parse(buffer));\n continueRender(handle);\n })\n .catch(() => {\n continueRender(handle);\n });\n return () => {\n cancelled = true;\n };\n }, [fontUrl]);\n\n const letters = useMemo(() => {\n if (!font) return null;\n const scale = fontSize / font.unitsPerEm;\n const glyphs = font.stringToGlyphs(text);\n let x = 0;\n const items = glyphs.map((glyph, i) => {\n if (i > 0) x += font.getKerningValue(glyphs[i - 1], glyph) * scale;\n const left = x;\n const advance = (glyph.advanceWidth ?? 0) * scale;\n const contours = flattenPath(\n glyph.getPath(x, 0, fontSize).commands,\n curveSteps,\n );\n x += advance + letterSpacing;\n return { left, width: advance, contours };\n });\n return { items, totalWidth: Math.max(0, x - letterSpacing) };\n }, [font, text, fontSize, letterSpacing, curveSteps]);\n\n if (!letters) return null;\n\n const startX = (width - letters.totalWidth) / 2;\n const resolvedBaseline = baselineY ?? (height + fontSize * 0.72) / 2;\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n {letters.items.map((glyph, i) => {\n const entry = entryStart + entryStagger * i;\n const run = Math.max(1, travelFrames - vertexLagFrames);\n\n const d = glyph.contours\n .map((contour) => {\n const pts = contour.map(([px, py]) => {\n const u =\n glyph.width === 0\n ? 0\n : Math.min(1, Math.max(0, (px - glyph.left) / glyph.width));\n const start = entry + u * vertexLagFrames;\n const remaining = interpolate(\n frame,\n [start, start + run],\n [1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.2, 0.9, 0.25, 1),\n },\n );\n return [\n startX + px + travelDistance * remaining,\n resolvedBaseline + py,\n ];\n });\n return (\n `M${pts[0][0].toFixed(2)},${pts[0][1].toFixed(2)}` +\n pts\n .slice(1)\n .map((p) => `L${p[0].toFixed(2)},${p[1].toFixed(2)}`)\n .join(\"\") +\n \"Z\"\n );\n })\n .join(\" \");\n\n return (\n <path\n key={`${i}-${glyph.left}`}\n d={d}\n fill={fill}\n fillRule=\"evenodd\"\n stroke={strokeWidth > 0 ? stroke : \"none\"}\n strokeWidth={strokeWidth}\n />\n );\n })}\n </svg>\n </div>\n );\n}"+ "sourceCode": "import { parse, type Font } from \"opentype.js\";\nimport { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, continueRender, delayRender, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface StretchInProps {\n className?: string;\n width?: number;\n height?: number;\n text?: string;\n fontUrl?: string;\n fontSize?: number;\n letterSpacing?: number;\n baselineY?: number;\n entryStart?: number;\n entryStagger?: number;\n travelFrames?: number;\n travelDistance?: number;\n vertexLagFrames?: number;\n curveSteps?: number;\n fill?: string;\n strokeWidth?: number;\n stroke?: string;\n}\n\ntype Contour = [number, number][];\n\nfunction flattenPath(\n commands: ReturnType<Font[\"getPath\"]>[\"commands\"],\n steps: number,\n): Contour[] {\n const contours: Contour[] = [];\n let current: Contour = [];\n let cx = 0;\n let cy = 0;\n\n for (const cmd of commands) {\n if (cmd.type === \"M\") {\n if (current.length > 0) contours.push(current);\n current = [[cmd.x, cmd.y]];\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"L\") {\n current.push([cmd.x, cmd.y]);\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"Q\") {\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const mt = 1 - t;\n current.push([\n mt * mt * cx + 2 * mt * t * cmd.x1 + t * t * cmd.x,\n mt * mt * cy + 2 * mt * t * cmd.y1 + t * t * cmd.y,\n ]);\n }\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"C\") {\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const mt = 1 - t;\n current.push([\n mt * mt * mt * cx +\n 3 * mt * mt * t * cmd.x1 +\n 3 * mt * t * t * cmd.x2 +\n t * t * t * cmd.x,\n mt * mt * mt * cy +\n 3 * mt * mt * t * cmd.y1 +\n 3 * mt * t * t * cmd.y2 +\n t * t * t * cmd.y,\n ]);\n }\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"Z\") {\n if (current.length > 0) contours.push(current);\n current = [];\n }\n }\n if (current.length > 0) contours.push(current);\n return contours;\n}\n\nfunction StretchInBase({\n className,\n width = 1920,\n height = 1080,\n text = \"REMOCN\",\n fontUrl = \"https://fonts.gstatic.com/s/anton/v27/1Ptgg87LROyAm0K0.ttf\",\n fontSize = 510,\n letterSpacing = 0,\n baselineY,\n entryStart = 0,\n entryStagger = 3,\n travelFrames = 33,\n travelDistance = 1500,\n vertexLagFrames = 3.5,\n curveSteps = 8,\n fill = \"#ffffff\",\n strokeWidth = 0,\n stroke = \"#ffffff\",\n}: StretchInProps) {\n const frame = useCurrentFrame();\n const [font, setFont] = useState<Font | null>(null);\n\n useEffect(() => {\n const handle = delayRender(\"stretch-in: loading font\");\n let cancelled = false;\n fetch(fontUrl)\n .then((res) => res.arrayBuffer())\n .then((buffer) => {\n if (!cancelled) setFont(parse(buffer));\n continueRender(handle);\n })\n .catch(() => {\n continueRender(handle);\n });\n return () => {\n cancelled = true;\n };\n }, [fontUrl]);\n\n const letters = useMemo(() => {\n if (!font) return null;\n const scale = fontSize / font.unitsPerEm;\n const glyphs = font.stringToGlyphs(text);\n let x = 0;\n const items = glyphs.map((glyph, i) => {\n if (i > 0) x += font.getKerningValue(glyphs[i - 1], glyph) * scale;\n const left = x;\n const advance = (glyph.advanceWidth ?? 0) * scale;\n const contours = flattenPath(\n glyph.getPath(x, 0, fontSize).commands,\n curveSteps,\n );\n x += advance + letterSpacing;\n return { left, width: advance, contours };\n });\n return { items, totalWidth: Math.max(0, x - letterSpacing) };\n }, [font, text, fontSize, letterSpacing, curveSteps]);\n\n if (!letters) return null;\n\n const startX = (width - letters.totalWidth) / 2;\n const resolvedBaseline = baselineY ?? (height + fontSize * 0.72) / 2;\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n {letters.items.map((glyph, i) => {\n const entry = entryStart + entryStagger * i;\n const run = Math.max(1, travelFrames - vertexLagFrames);\n\n const d = glyph.contours\n .map((contour) => {\n const pts = contour.map(([px, py]) => {\n const u =\n glyph.width === 0\n ? 0\n : Math.min(1, Math.max(0, (px - glyph.left) / glyph.width));\n const start = entry + u * vertexLagFrames;\n const remaining = interpolate(\n frame,\n [start, start + run],\n [1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.2, 0.9, 0.25, 1),\n },\n );\n return [\n startX + px + travelDistance * remaining,\n resolvedBaseline + py,\n ];\n });\n return (\n `M${pts[0][0].toFixed(2)},${pts[0][1].toFixed(2)}` +\n pts\n .slice(1)\n .map((p) => `L${p[0].toFixed(2)},${p[1].toFixed(2)}`)\n .join(\"\") +\n \"Z\"\n );\n })\n .join(\" \");\n\n return (\n <path\n key={`${i}-${glyph.left}`}\n d={d}\n fill={fill}\n fillRule=\"evenodd\"\n stroke={strokeWidth > 0 ? stroke : \"none\"}\n strokeWidth={strokeWidth}\n />\n );\n })}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"REMOCN\",\n description: \"Text\",\n },\n fill: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Fill\",\n },\n fontSize: {\n type: \"number\",\n min: 100,\n max: 700,\n step: 10,\n default: 510,\n description: \"Font size\",\n hiddenFromList: false,\n },\n entryStagger: {\n type: \"number\",\n min: 0,\n max: 12,\n step: 1,\n default: 3,\n description: \"Letter stagger\",\n hiddenFromList: false,\n },\n travelFrames: {\n type: \"number\",\n min: 4,\n max: 40,\n step: 1,\n default: 33,\n description: \"Travel (frames)\",\n hiddenFromList: false,\n },\n vertexLagFrames: {\n type: \"number\",\n min: 0,\n max: 8,\n step: 0.5,\n default: 3.5,\n description: \"Smear lag (frames)\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fill\",\"fontSize\",\"entryStagger\",\"travelFrames\",\"vertexLagFrames\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"REMOCN\",\n fill: \"#ffffff\",\n fontSize: 510,\n entryStagger: 3,\n travelFrames: 33,\n vertexLagFrames: 3.5,\n speed: 1,\n};\n\ntype StretchInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof StretchInBase>;\n\nconst StretchInInner = forwardRef<\n HTMLDivElement,\n StretchInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<StretchIn>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <StretchInBase\n {...(componentProps as unknown as ComponentProps<typeof StretchInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const StretchIn = Interactive.withSchema({\n Component: StretchInInner,\n componentName: \"<StretchIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 48}diff --git a/registry-artifacts/elements/sustained-glitch.json b/registry-artifacts/elements/sustained-glitch.jsonindex 2b4fb0cc..7bcc92bd 100644--- a/registry-artifacts/elements/sustained-glitch.json+++ b/registry-artifacts/elements/sustained-glitch.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Sustained Glitch","durationInFrames": 120,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "sustained-glitch",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type SustainedGlitchProps = {\n intensity?: number;\n frequency?: number;\n slices?: number;\n seed?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_intensity;\nuniform float u_frequency;\nuniform float u_slices;\nuniform float u_seed;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(vec2 uv, float split) {\n vec4 center = texture(u_scene, uv);\n float r = texture(u_scene, fract(vec2(uv.x + split, uv.y))).r;\n float b = texture(u_scene, fract(vec2(uv.x - split, uv.y))).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float slotLength = max(30.0 / max(u_frequency, 0.1), 4.0);\n float slot = floor(u_frame / slotLength);\n float local = u_frame - slot * slotLength;\n\n float burstLength = 2.0 + floor(hash(vec2(slot, u_seed + 2.0)) * 4.0);\n float start =\n floor(hash(vec2(slot, u_seed + 1.0)) * max(slotLength - burstLength, 1.0));\n float fires = step(0.25, hash(vec2(slot, u_seed + 3.0)));\n\n float age = local - start;\n float live = fires * step(0.0, age) * step(age, burstLength - 1.0);\n float energy =\n max(u_intensity, 0.0) * live * (1.0 - age / burstLength);\n\n if (energy <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n\n float clock = mod(u_frame, 512.0) + u_seed;\n float row = floor(v_uv.y * max(u_slices, 2.0));\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.28 * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(1.0 - 0.45 * min(energy, 1.0), hash(block + clock * 7.3));\n vec2 jump =\n vec2(\n hash(block + clock * 3.1 + 5.0) - 0.5,\n hash(block + clock * 9.7 + 11.0) - 0.5\n ) *\n vec2(0.62, 0.34) *\n corrupt;\n\n vec2 uv = fract(v_uv + vec2(sliceShift, 0.0) + jump);\n float split = 0.02 * energy * (0.35 + abs(amount));\n\n vec4 color = sampleSplit(uv, split);\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = vec4(clamp(color.rgb, 0.0, 1.0), color.a);\n}`;\n\nconst shader = makeFilterShader<SustainedGlitchProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_frequency\"), frequency);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_seed\"), seed);\n },\n);\n\nfunction burstEnergy(\n frame: number,\n intensity: number,\n frequency: number,\n seed: number,\n): number {\n const slotLength = Math.max(30 / Math.max(frequency, 0.1), 4);\n const slot = Math.floor(frame / slotLength);\n const local = frame - slot * slotLength;\n\n const burstLength = 2 + Math.floor(random(`glitch-len-${seed}-${slot}`) * 4);\n const start = Math.floor(\n random(`glitch-start-${seed}-${slot}`) *\n Math.max(slotLength - burstLength, 1),\n );\n if (random(`glitch-fire-${seed}-${slot}`) < 0.25) return 0;\n\n const age = local - start;\n if (age < 0 || age > burstLength - 1) return 0;\n return Math.max(intensity, 0) * (1 - age / burstLength);\n}\n\nconst SustainedGlitchFallback: React.FC<\n SustainedGlitchProps & CanvasFilterProps\n> = ({\n children,\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n}) => {\n const frame = useCurrentFrame();\n const energy = burstEnergy(frame, intensity, frequency, seed);\n\n if (energy <= 0) {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shift =\n (random(`glitch-shift-${seed}-${frame}-${band}`) - 0.5) * 46 * energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n transform: `translateX(${shift}px)`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity:\n 0.18 *\n energy *\n random(`glitch-tint-${seed}-${frame}-${band}`),\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nexport const SustainedGlitch = makeCanvasFilter<SustainedGlitchProps>({\n shader,\n fallback: SustainedGlitchFallback,\n});"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype SustainedGlitchProps = {\n intensity?: number;\n frequency?: number;\n slices?: number;\n seed?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_intensity;\nuniform float u_frequency;\nuniform float u_slices;\nuniform float u_seed;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(vec2 uv, float split) {\n vec4 center = texture(u_scene, uv);\n float r = texture(u_scene, fract(vec2(uv.x + split, uv.y))).r;\n float b = texture(u_scene, fract(vec2(uv.x - split, uv.y))).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float slotLength = max(30.0 / max(u_frequency, 0.1), 4.0);\n float slot = floor(u_frame / slotLength);\n float local = u_frame - slot * slotLength;\n\n float burstLength = 2.0 + floor(hash(vec2(slot, u_seed + 2.0)) * 4.0);\n float start =\n floor(hash(vec2(slot, u_seed + 1.0)) * max(slotLength - burstLength, 1.0));\n float fires = step(0.25, hash(vec2(slot, u_seed + 3.0)));\n\n float age = local - start;\n float live = fires * step(0.0, age) * step(age, burstLength - 1.0);\n float energy =\n max(u_intensity, 0.0) * live * (1.0 - age / burstLength);\n\n if (energy <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n\n float clock = mod(u_frame, 512.0) + u_seed;\n float row = floor(v_uv.y * max(u_slices, 2.0));\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.28 * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(1.0 - 0.45 * min(energy, 1.0), hash(block + clock * 7.3));\n vec2 jump =\n vec2(\n hash(block + clock * 3.1 + 5.0) - 0.5,\n hash(block + clock * 9.7 + 11.0) - 0.5\n ) *\n vec2(0.62, 0.34) *\n corrupt;\n\n vec2 uv = fract(v_uv + vec2(sliceShift, 0.0) + jump);\n float split = 0.02 * energy * (0.35 + abs(amount));\n\n vec4 color = sampleSplit(uv, split);\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = vec4(clamp(color.rgb, 0.0, 1.0), color.a);\n}`;\n\nconst shader = makeFilterShader<SustainedGlitchProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_frequency\"), frequency);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_seed\"), seed);\n },\n);\n\nfunction burstEnergy(\n frame: number,\n intensity: number,\n frequency: number,\n seed: number,\n): number {\n const slotLength = Math.max(30 / Math.max(frequency, 0.1), 4);\n const slot = Math.floor(frame / slotLength);\n const local = frame - slot * slotLength;\n\n const burstLength = 2 + Math.floor(random(`glitch-len-${seed}-${slot}`) * 4);\n const start = Math.floor(\n random(`glitch-start-${seed}-${slot}`) *\n Math.max(slotLength - burstLength, 1),\n );\n if (random(`glitch-fire-${seed}-${slot}`) < 0.25) return 0;\n\n const age = local - start;\n if (age < 0 || age > burstLength - 1) return 0;\n return Math.max(intensity, 0) * (1 - age / burstLength);\n}\n\nconst SustainedGlitchFallback: React.FC<\n SustainedGlitchProps & CanvasFilterProps\n> = ({\n children,\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n}) => {\n const frame = useCurrentFrame();\n const energy = burstEnergy(frame, intensity, frequency, seed);\n\n if (energy <= 0) {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shift =\n (random(`glitch-shift-${seed}-${frame}-${band}`) - 0.5) * 46 * energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n transform: `translateX(${shift}px)`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity:\n 0.18 *\n energy *\n random(`glitch-tint-${seed}-${frame}-${band}`),\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nconst SustainedGlitchBase = makeCanvasFilter<SustainedGlitchProps>({\n shader,\n fallback: SustainedGlitchFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n intensity: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n frequency: {\n type: \"number\",\n min: 0.1,\n max: 6,\n step: 0.1,\n default: 1,\n description: \"Frequency\",\n hiddenFromList: false,\n },\n slices: {\n type: \"number\",\n min: 6,\n max: 48,\n step: 1,\n default: 24,\n description: \"Slices\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"intensity\",\"frequency\",\"slices\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n speed: 1,\n};\n\ntype SustainedGlitchElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SustainedGlitchBase>;\n\nconst SustainedGlitchInner = forwardRef<\n HTMLDivElement,\n SustainedGlitchElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SustainedGlitch>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <SustainedGlitchBase\n {...(componentProps as unknown as ComponentProps<typeof SustainedGlitchBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SustainedGlitch = Interactive.withSchema({\n Component: SustainedGlitchInner,\n componentName: \"<SustainedGlitch>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 120}diff --git a/registry-artifacts/elements/terminal-simulator.json b/registry-artifacts/elements/terminal-simulator.jsonindex bf2de0db..f864c749 100644--- a/registry-artifacts/elements/terminal-simulator.json+++ b/registry-artifacts/elements/terminal-simulator.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Terminal Simulator","durationInFrames": 240,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "terminal-simulator",- "sourceCode": "import { Sequence, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport type TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\nexport interface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\nexport interface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nexport function TerminalSimulator({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n transform: `translateY(${translateY}px)`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\ninterface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\ninterface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nfunction TerminalSimulatorBase({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n transform: `translateY(${translateY}px)`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n prompt: {\n type: \"text-content\",\n default: \"$\",\n description: \"Prompt\",\n },\n title: {\n type: \"text-content\",\n default: \"~/projects/remocn\",\n description: \"Title\",\n },\n background: {\n type: \"color\",\n default: \"#0a0a0a\",\n description: \"Background\",\n },\n chromeColor: {\n type: \"color\",\n default: \"#1a1a1a\",\n description: \"Chrome color\",\n },\n fontSize: {\n type: \"number\",\n min: 10,\n max: 32,\n step: 1,\n default: 18,\n description: \"Font size\",\n hiddenFromList: false,\n },\n charsPerFrame: {\n type: \"number\",\n min: 0.25,\n max: 6,\n step: 0.25,\n default: 1,\n description: \"Chars / frame\",\n hiddenFromList: false,\n },\n chunkSize: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 1,\n description: \"Chunk size\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"prompt\",\"title\",\"background\",\"chromeColor\",\"fontSize\",\"charsPerFrame\",\"chunkSize\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n prompt: \"$\",\n title: \"~/projects/remocn\",\n background: \"#0a0a0a\",\n chromeColor: \"#1a1a1a\",\n fontSize: 18,\n charsPerFrame: 1,\n chunkSize: 1,\n speed: 1,\n};\n\ntype TerminalSimulatorElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TerminalSimulatorBase>;\n\nconst TerminalSimulatorInner = forwardRef<\n HTMLDivElement,\n TerminalSimulatorElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TerminalSimulator>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TerminalSimulatorBase\n {...(componentProps as unknown as ComponentProps<typeof TerminalSimulatorBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TerminalSimulator = Interactive.withSchema({\n Component: TerminalSimulatorInner,\n componentName: \"<TerminalSimulator>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 240}diff --git a/registry-artifacts/elements/top-down-letters.json b/registry-artifacts/elements/top-down-letters.jsonindex 28da870d..005b89c3 100644--- a/registry-artifacts/elements/top-down-letters.json+++ b/registry-artifacts/elements/top-down-letters.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Top-Down Letters","durationInFrames": 60,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "top-down-letters",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TopDownLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction TopDownLettersBase({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Signal\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 46,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Signal\",\n staggerDelay: 3,\n distance: 46,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype TopDownLettersElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TopDownLettersBase>;\n\nconst TopDownLettersInner = forwardRef<\n HTMLDivElement,\n TopDownLettersElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TopDownLetters>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TopDownLettersBase\n {...(componentProps as unknown as ComponentProps<typeof TopDownLettersBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TopDownLetters = Interactive.withSchema({\n Component: TopDownLettersInner,\n componentName: \"<TopDownLetters>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 60}diff --git a/registry-artifacts/elements/tracking-in.json b/registry-artifacts/elements/tracking-in.jsonindex 2347954f..5ffaafaa 100644--- a/registry-artifacts/elements/tracking-in.json+++ b/registry-artifacts/elements/tracking-in.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Tracking In","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "tracking-in",- "sourceCode": "import { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface TrackingInProps {\n text: string;\n startTracking?: number;\n startBlur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TrackingIn({\n text,\n startTracking = 0.5,\n startBlur = 12,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: TrackingInProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const t = spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 90 },\n });\n\n const letterSpacing = `${interpolate(t, [0, 1], [startTracking, -0.03])}em`;\n const blurAmount = interpolate(t, [0, 1], [startBlur, 0]);\n const opacity = interpolate(frame, [0, 15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing,\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </span>\n </div>\n );\n}"+ "sourceCode": "import { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface TrackingInProps {\n text: string;\n startTracking?: number;\n startBlur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction TrackingInBase({\n text,\n startTracking = 0.5,\n startBlur = 12,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: TrackingInProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const t = spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 90 },\n });\n\n const letterSpacing = `${interpolate(t, [0, 1], [startTracking, -0.03])}em`;\n const blurAmount = interpolate(t, [0, 1], [startBlur, 0]);\n const opacity = interpolate(frame, [0, 15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing,\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"tracking in\",\n description: \"Text\",\n },\n startTracking: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.5,\n description: \"Start tracking (em)\",\n hiddenFromList: false,\n },\n startBlur: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 12,\n description: \"Start blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"startTracking\",\"startBlur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"tracking in\",\n startTracking: 0.5,\n startBlur: 12,\n fontSize: 96,\n color: \"#171717\",\n fontWeight: \"700\",\n speed: 1,\n};\n\ntype TrackingInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrackingInBase>;\n\nconst TrackingInInner = forwardRef<\n HTMLDivElement,\n TrackingInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TrackingIn>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TrackingInBase\n {...(componentProps as unknown as ComponentProps<typeof TrackingInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrackingIn = Interactive.withSchema({\n Component: TrackingInInner,\n componentName: \"<TrackingIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry-artifacts/elements/tv-power-off.json b/registry-artifacts/elements/tv-power-off.jsonindex 721270a4..d7ada2e1 100644--- a/registry-artifacts/elements/tv-power-off.json+++ b/registry-artifacts/elements/tv-power-off.json@@ -13,7 +13,7 @@"durationInFrames": 18,"installationMode": "wrapped","slug": "tv-power-off",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type TvPowerOffProps = {\n durationInFrames?: number;\n delay?: number;\n gain?: number;\n afterglow?: number;\n phosphor?: string;\n};\n\nconst DEFAULTS = {\n durationInFrames: 18,\n delay: 0,\n gain: 1,\n afterglow: 1,\n phosphor: \"#d8ecff\",\n};\n\nconst COLLAPSE_END = 0.6;\nconst PINCH_END = 0.82;\nconst MIN_SQUASH = 0.0055;\nconst MIN_PINCH = 0.004;\nconst CONCENTRATION = 0.3;\nconst DECAY_CURVE = 2.6;\nconst BLACKOUT_IN = 0.06;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec2 u_resolution;\nuniform float u_aspect;\nuniform float u_progress;\nuniform float u_gain;\nuniform float u_afterglow;\nuniform vec3 u_phosphor;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 32;\nconst int COLUMN_TAPS = 8;\nconst float GOLDEN = 0.6180339887;\nconst float COLLAPSE_END = ${COLLAPSE_END.toFixed(4)};\nconst float PINCH_END = ${PINCH_END.toFixed(4)};\nconst float MIN_SQUASH = ${MIN_SQUASH.toFixed(5)};\nconst float MIN_PINCH = ${MIN_PINCH.toFixed(5)};\nconst float CONCENTRATION = ${CONCENTRATION.toFixed(4)};\nconst float DECAY_CURVE = ${DECAY_CURVE.toFixed(4)};\nconst float BLACKOUT_IN = ${BLACKOUT_IN.toFixed(4)};\n\nvoid main() {\n float p = u_progress;\n\n if (p <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n if (p >= 1.0) {\n outColor = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n\n float collapse = clamp(p / COLLAPSE_END, 0.0, 1.0);\n float pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0.0, 1.0);\n float decayed = clamp((p - PINCH_END) / (1.0 - PINCH_END), 0.0, 1.0);\n\n vec2 scale = vec2(pow(MIN_PINCH, pinch), pow(MIN_SQUASH, collapse));\n vec2 centered = (v_uv - 0.5) / scale + 0.5;\n vec2 span = 1.0 / (scale * u_resolution);\n\n vec3 sum = vec3(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n vec2 at = centered + vec2(\n (fract(fi * GOLDEN + 0.5) - 0.5) * span.x,\n ((fi + 0.5) / float(TAPS) - 0.5) * span.y\n );\n vec2 inside = step(vec2(0.0), at) * step(at, vec2(1.0));\n sum += texture(u_scene, at).rgb * inside.x * inside.y;\n }\n\n float concentrate = pow(1.0 / (scale.x * scale.y), CONCENTRATION);\n vec3 light =\n (sum / float(TAPS)) * (1.0 + (concentrate - 1.0) * max(u_gain, 0.0));\n\n float glow = max(u_afterglow, 0.0);\n float bleed = smoothstep(0.2, 0.8, collapse) * (1.0 - pinch) * glow;\n\n if (bleed > 0.0) {\n vec3 column = vec3(0.0);\n float cx = clamp(centered.x, 0.0, 1.0);\n for (int i = 0; i < COLUMN_TAPS; i++) {\n column +=\n texture(u_scene, vec2(cx, (float(i) + 0.5) / float(COLUMN_TAPS))).rgb;\n }\n column /= float(COLUMN_TAPS);\n\n float dy = v_uv.y - 0.5;\n float reach = 0.02 + 0.03 * collapse;\n light +=\n column *\n mix(vec3(1.0), u_phosphor, 0.65) *\n exp(-(dy * dy) / (reach * reach)) *\n bleed *\n 0.9;\n }\n\n if (pinch > 0.0) {\n vec2 d = (v_uv - 0.5) * vec2(u_aspect, 1.0);\n float radius = max(0.045 * glow, 0.0005);\n light +=\n u_phosphor *\n exp(-dot(d, d) / (radius * radius)) *\n smoothstep(0.0, 0.5, pinch) *\n 1.15;\n }\n\n light *= pow(max(1.0 - decayed, 0.0001), DECAY_CURVE);\n\n float blackout = smoothstep(0.0, BLACKOUT_IN, p);\n outColor = vec4(\n clamp(light, 0.0, 1.0),\n mix(texture(u_scene, v_uv).a, 1.0, blackout)\n );\n}`;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nfunction powerProgress(props: TvPowerOffProps, frame: number): number {\n const {\n durationInFrames = DEFAULTS.durationInFrames,\n delay = DEFAULTS.delay,\n } = props;\n return clamp((frame - delay) / Math.max(1, durationInFrames), 0, 1);\n}\n\nconst shader = makeFilterShader<TvPowerOffProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, frame, passedProps }) => {\n const {\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = passedProps;\n gl.uniform1f(uniform(\"u_progress\"), powerProgress(passedProps, frame));\n gl.uniform2f(uniform(\"u_resolution\"), width, height);\n gl.uniform1f(uniform(\"u_gain\"), gain);\n gl.uniform1f(uniform(\"u_afterglow\"), afterglow);\n gl.uniform3fv(uniform(\"u_phosphor\"), toRgb(phosphor));\n },\n);\n\nconst TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (\n props,\n) => {\n const frame = useCurrentFrame();\n const {\n children,\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = props;\n\n const p = powerProgress(props, frame);\n const collapse = clamp(p / COLLAPSE_END, 0, 1);\n const pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0, 1);\n const decayed = clamp((p - PINCH_END) / (1 - PINCH_END), 0, 1);\n\n const squash = MIN_SQUASH ** collapse;\n const pinchX = MIN_PINCH ** pinch;\n const concentrate = (1 / (squash * pinchX)) ** CONCENTRATION;\n const fade = (1 - decayed) ** DECAY_CURVE;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n background: \"#000000\",\n opacity: clamp(p / BLACKOUT_IN, 0, 1),\n }}\n />\n <AbsoluteFill\n style={{\n transform: `scale(${pinchX}, ${squash})`,\n filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,\n opacity: fade,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: `radial-gradient(circle at 50% 50%, ${phosphor} 0%, transparent 55%)`,\n opacity: clamp(pinch * afterglow, 0, 1) * fade,\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const TvPowerOff = makeCanvasFilter<TvPowerOffProps>({\n shader,\n fallback: TvPowerOffFallback,\n});"+ "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport React from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nexport type TvPowerOffProps = {\n durationInFrames?: number;\n delay?: number;\n gain?: number;\n afterglow?: number;\n phosphor?: string;\n};\n\nconst DEFAULTS = {\n durationInFrames: 18,\n delay: 0,\n gain: 1,\n afterglow: 1,\n phosphor: \"#d8ecff\",\n};\n\nconst COLLAPSE_END = 0.6;\nconst PINCH_END = 0.82;\nconst MIN_SQUASH = 0.0055;\nconst MIN_PINCH = 0.004;\nconst CONCENTRATION = 0.3;\nconst DECAY_CURVE = 2.6;\nconst BLACKOUT_IN = 0.06;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec2 u_resolution;\nuniform float u_aspect;\nuniform float u_progress;\nuniform float u_gain;\nuniform float u_afterglow;\nuniform vec3 u_phosphor;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 32;\nconst int COLUMN_TAPS = 8;\nconst float GOLDEN = 0.6180339887;\nconst float COLLAPSE_END = ${COLLAPSE_END.toFixed(4)};\nconst float PINCH_END = ${PINCH_END.toFixed(4)};\nconst float MIN_SQUASH = ${MIN_SQUASH.toFixed(5)};\nconst float MIN_PINCH = ${MIN_PINCH.toFixed(5)};\nconst float CONCENTRATION = ${CONCENTRATION.toFixed(4)};\nconst float DECAY_CURVE = ${DECAY_CURVE.toFixed(4)};\nconst float BLACKOUT_IN = ${BLACKOUT_IN.toFixed(4)};\n\nvoid main() {\n float p = u_progress;\n\n if (p <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n if (p >= 1.0) {\n outColor = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n\n float collapse = clamp(p / COLLAPSE_END, 0.0, 1.0);\n float pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0.0, 1.0);\n float decayed = clamp((p - PINCH_END) / (1.0 - PINCH_END), 0.0, 1.0);\n\n vec2 scale = vec2(pow(MIN_PINCH, pinch), pow(MIN_SQUASH, collapse));\n vec2 centered = (v_uv - 0.5) / scale + 0.5;\n vec2 span = 1.0 / (scale * u_resolution);\n\n vec3 sum = vec3(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n vec2 at = centered + vec2(\n (fract(fi * GOLDEN + 0.5) - 0.5) * span.x,\n ((fi + 0.5) / float(TAPS) - 0.5) * span.y\n );\n vec2 inside = step(vec2(0.0), at) * step(at, vec2(1.0));\n sum += texture(u_scene, at).rgb * inside.x * inside.y;\n }\n\n float concentrate = pow(1.0 / (scale.x * scale.y), CONCENTRATION);\n vec3 light =\n (sum / float(TAPS)) * (1.0 + (concentrate - 1.0) * max(u_gain, 0.0));\n\n float glow = max(u_afterglow, 0.0);\n float bleed = smoothstep(0.2, 0.8, collapse) * (1.0 - pinch) * glow;\n\n if (bleed > 0.0) {\n vec3 column = vec3(0.0);\n float cx = clamp(centered.x, 0.0, 1.0);\n for (int i = 0; i < COLUMN_TAPS; i++) {\n column +=\n texture(u_scene, vec2(cx, (float(i) + 0.5) / float(COLUMN_TAPS))).rgb;\n }\n column /= float(COLUMN_TAPS);\n\n float dy = v_uv.y - 0.5;\n float reach = 0.02 + 0.03 * collapse;\n light +=\n column *\n mix(vec3(1.0), u_phosphor, 0.65) *\n exp(-(dy * dy) / (reach * reach)) *\n bleed *\n 0.9;\n }\n\n if (pinch > 0.0) {\n vec2 d = (v_uv - 0.5) * vec2(u_aspect, 1.0);\n float radius = max(0.045 * glow, 0.0005);\n light +=\n u_phosphor *\n exp(-dot(d, d) / (radius * radius)) *\n smoothstep(0.0, 0.5, pinch) *\n 1.15;\n }\n\n light *= pow(max(1.0 - decayed, 0.0001), DECAY_CURVE);\n\n float blackout = smoothstep(0.0, BLACKOUT_IN, p);\n outColor = vec4(\n clamp(light, 0.0, 1.0),\n mix(texture(u_scene, v_uv).a, 1.0, blackout)\n );\n}`;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nfunction powerProgress(props: TvPowerOffProps, frame: number): number {\n const {\n durationInFrames = DEFAULTS.durationInFrames,\n delay = DEFAULTS.delay,\n } = props;\n return clamp((frame - delay) / Math.max(1, durationInFrames), 0, 1);\n}\n\nconst shader = makeFilterShader<TvPowerOffProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, frame, passedProps }) => {\n const {\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = passedProps;\n gl.uniform1f(uniform(\"u_progress\"), powerProgress(passedProps, frame));\n gl.uniform2f(uniform(\"u_resolution\"), width, height);\n gl.uniform1f(uniform(\"u_gain\"), gain);\n gl.uniform1f(uniform(\"u_afterglow\"), afterglow);\n gl.uniform3fv(uniform(\"u_phosphor\"), toRgb(phosphor));\n },\n);\n\nconst TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (\n props,\n) => {\n const frame = useCurrentFrame();\n const {\n children,\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = props;\n\n const p = powerProgress(props, frame);\n const collapse = clamp(p / COLLAPSE_END, 0, 1);\n const pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0, 1);\n const decayed = clamp((p - PINCH_END) / (1 - PINCH_END), 0, 1);\n\n const squash = MIN_SQUASH ** collapse;\n const pinchX = MIN_PINCH ** pinch;\n const concentrate = (1 / (squash * pinchX)) ** CONCENTRATION;\n const fade = (1 - decayed) ** DECAY_CURVE;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n background: \"#000000\",\n opacity: clamp(p / BLACKOUT_IN, 0, 1),\n }}\n />\n <AbsoluteFill\n style={{\n transform: `scale(${pinchX}, ${squash})`,\n filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,\n opacity: fade,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: `radial-gradient(circle at 50% 50%, ${phosphor} 0%, transparent 55%)`,\n opacity: clamp(pinch * afterglow, 0, 1) * fade,\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const TvPowerOff = makeCanvasFilter<TvPowerOffProps>({\n shader,\n fallback: TvPowerOffFallback,\n});"},"durationInFrames": 18}diff --git a/registry-artifacts/elements/underwater-ripple.json b/registry-artifacts/elements/underwater-ripple.jsonindex 92866e02..6a93cca1 100644--- a/registry-artifacts/elements/underwater-ripple.json+++ b/registry-artifacts/elements/underwater-ripple.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "Underwater Ripple","durationInFrames": 120,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "underwater-ripple",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type UnderwaterRippleProps = {\n amplitude?: number;\n scale?: number;\n speed?: number;\n dispersion?: number;\n};\n\nconst DEFAULTS = {\n amplitude: 7,\n scale: 1,\n speed: 2,\n dispersion: 1,\n};\n\ntype NormalizedProps = {\n amplitude: number;\n scale: number;\n phase: number;\n dispersion: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_phase;\nuniform float u_amplitude;\nuniform float u_scale;\nuniform float u_dispersion;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nvec2 fieldGradient(vec2 p, float phase) {\n float scale = max(u_scale, 0.05);\n vec2 k1 = vec2(1.0, 0.35);\n vec2 k2 = vec2(-0.42, 1.0);\n vec2 k3 = vec2(0.78, -0.63);\n float f1 = 6.1 * scale;\n float f2 = 8.7 * scale;\n float f3 = 12.3 * scale;\n\n vec2 g = vec2(0.0);\n g += cos(dot(p, k1) * f1 + phase) * f1 * k1;\n g += cos(dot(p, k2) * f2 - phase * 2.0) * f2 * k2;\n g += cos(dot(p, k3) * f3 + phase * 3.0) * f3 * k3;\n\n return g / (3.0 * f2);\n}\n\nvoid main() {\n vec2 p = vec2(v_uv.x * u_aspect, v_uv.y);\n vec2 grad = fieldGradient(p, u_phase);\n\n vec2 offset = grad * u_amplitude;\n float strength = length(grad);\n vec2 direction = strength > 0.0001 ? grad / strength : vec2(0.0);\n float spread = u_dispersion * u_amplitude * 0.3 * min(strength, 2.0);\n\n vec2 base = v_uv + vec2(offset.x / u_aspect, offset.y);\n vec2 lead = vec2(direction.x / u_aspect, direction.y) * spread;\n\n vec4 center = texture(u_scene, base);\n float r = texture(u_scene, base + lead).r;\n float b = texture(u_scene, base - lead).b;\n\n outColor = vec4(r, center.g, b, center.a);\n}`;\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { amplitude, scale, phase, dispersion } = passedProps;\n gl.uniform1f(uniform(\"u_amplitude\"), amplitude);\n gl.uniform1f(uniform(\"u_scale\"), scale);\n gl.uniform1f(uniform(\"u_phase\"), phase);\n gl.uniform1f(uniform(\"u_dispersion\"), dispersion);\n },\n);\n\nconst UnderwaterRippleFallback: React.FC<\n NormalizedProps & CanvasFilterProps\n> = ({ children }) => <AbsoluteFill>{children}</AbsoluteFill>;\n\nconst UnderwaterRippleCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: UnderwaterRippleFallback,\n});\n\nexport const UnderwaterRipple: React.FC<\n UnderwaterRippleProps & CanvasFilterProps\n> = ({\n amplitude = DEFAULTS.amplitude,\n scale = DEFAULTS.scale,\n speed = DEFAULTS.speed,\n dispersion = DEFAULTS.dispersion,\n children,\n}) => {\n const frame = useCurrentFrame();\n const { height, durationInFrames } = useVideoConfig();\n const cycle = Math.max(durationInFrames, 1);\n\n return (\n <UnderwaterRippleCanvas\n amplitude={amplitude / height}\n scale={scale}\n phase={(frame / cycle) * speed * Math.PI * 2}\n dispersion={dispersion}\n >\n {children}\n </UnderwaterRippleCanvas>\n );\n};"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype UnderwaterRippleProps = {\n amplitude?: number;\n scale?: number;\n speed?: number;\n dispersion?: number;\n};\n\nconst DEFAULTS = {\n amplitude: 7,\n scale: 1,\n speed: 2,\n dispersion: 1,\n};\n\ntype NormalizedProps = {\n amplitude: number;\n scale: number;\n phase: number;\n dispersion: number;\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_phase;\nuniform float u_amplitude;\nuniform float u_scale;\nuniform float u_dispersion;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nvec2 fieldGradient(vec2 p, float phase) {\n float scale = max(u_scale, 0.05);\n vec2 k1 = vec2(1.0, 0.35);\n vec2 k2 = vec2(-0.42, 1.0);\n vec2 k3 = vec2(0.78, -0.63);\n float f1 = 6.1 * scale;\n float f2 = 8.7 * scale;\n float f3 = 12.3 * scale;\n\n vec2 g = vec2(0.0);\n g += cos(dot(p, k1) * f1 + phase) * f1 * k1;\n g += cos(dot(p, k2) * f2 - phase * 2.0) * f2 * k2;\n g += cos(dot(p, k3) * f3 + phase * 3.0) * f3 * k3;\n\n return g / (3.0 * f2);\n}\n\nvoid main() {\n vec2 p = vec2(v_uv.x * u_aspect, v_uv.y);\n vec2 grad = fieldGradient(p, u_phase);\n\n vec2 offset = grad * u_amplitude;\n float strength = length(grad);\n vec2 direction = strength > 0.0001 ? grad / strength : vec2(0.0);\n float spread = u_dispersion * u_amplitude * 0.3 * min(strength, 2.0);\n\n vec2 base = v_uv + vec2(offset.x / u_aspect, offset.y);\n vec2 lead = vec2(direction.x / u_aspect, direction.y) * spread;\n\n vec4 center = texture(u_scene, base);\n float r = texture(u_scene, base + lead).r;\n float b = texture(u_scene, base - lead).b;\n\n outColor = vec4(r, center.g, b, center.a);\n}`;\n\nconst shader = makeFilterShader<NormalizedProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const { amplitude, scale, phase, dispersion } = passedProps;\n gl.uniform1f(uniform(\"u_amplitude\"), amplitude);\n gl.uniform1f(uniform(\"u_scale\"), scale);\n gl.uniform1f(uniform(\"u_phase\"), phase);\n gl.uniform1f(uniform(\"u_dispersion\"), dispersion);\n },\n);\n\nconst UnderwaterRippleFallback: React.FC<\n NormalizedProps & CanvasFilterProps\n> = ({ children }) => <AbsoluteFill>{children}</AbsoluteFill>;\n\nconst UnderwaterRippleCanvas = makeCanvasFilter<NormalizedProps>({\n shader,\n fallback: UnderwaterRippleFallback,\n});\n\nconst UnderwaterRippleBase: React.FC<\n UnderwaterRippleProps & CanvasFilterProps\n> = ({\n amplitude = DEFAULTS.amplitude,\n scale = DEFAULTS.scale,\n speed = DEFAULTS.speed,\n dispersion = DEFAULTS.dispersion,\n children,\n}) => {\n const frame = useCurrentFrame();\n const { height, durationInFrames } = useVideoConfig();\n const cycle = Math.max(durationInFrames, 1);\n\n return (\n <UnderwaterRippleCanvas\n amplitude={amplitude / height}\n scale={scale}\n phase={(frame / cycle) * speed * Math.PI * 2}\n dispersion={dispersion}\n >\n {children}\n </UnderwaterRippleCanvas>\n );\n};\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n amplitude: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 7,\n description: \"Amplitude\",\n hiddenFromList: false,\n },\n scale: {\n type: \"number\",\n min: 0.2,\n max: 4,\n step: 0.1,\n default: 1,\n description: \"Scale\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n dispersion: {\n type: \"number\",\n min: 0,\n max: 4,\n step: 0.1,\n default: 1,\n description: \"Dispersion\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"amplitude\",\"scale\",\"speed\",\"dispersion\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n amplitude: 7,\n scale: 1,\n speed: 1,\n dispersion: 1,\n};\n\ntype UnderwaterRippleElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UnderwaterRippleBase>;\n\nconst UnderwaterRippleInner = forwardRef<\n HTMLDivElement,\n UnderwaterRippleElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<UnderwaterRipple>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <UnderwaterRippleBase\n {...(componentProps as unknown as ComponentProps<typeof UnderwaterRippleBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UnderwaterRipple = Interactive.withSchema({\n Component: UnderwaterRippleInner,\n componentName: \"<UnderwaterRipple>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 120}diff --git a/registry-artifacts/elements/value-swap.json b/registry-artifacts/elements/value-swap.jsonindex 56a90d04..55464800 100644--- a/registry-artifacts/elements/value-swap.json+++ b/registry-artifacts/elements/value-swap.json@@ -6,9 +6,9 @@"dimensions": null,"displayName": "Value Swap","durationInFrames": 100,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "value-swap",- "sourceCode": "import { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nimport type React from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport interface ValueSwapProps {\n values: string[];\n at: number | number[];\n duration?: number;\n distance?: number;\n direction?: \"up\" | \"down\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function ValueSwap({\n values,\n at,\n duration = 10,\n distance = 12,\n direction = \"up\",\n className,\n style,\n}: ValueSwapProps) {\n const frame = useCurrentFrame();\n const ats = Array.isArray(at) ? at : [at];\n const d = direction === \"down\" ? -distance : distance;\n const count = Math.min(values.length, ats.length + 1);\n const rendered = values.slice(0, count);\n const sizer = rendered.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n const swapP = (start: number) =>\n interpolate(frame, [start, start + duration], [0, 1], {\n ...clampOpts,\n easing: Easing.inOut(Easing.cubic),\n });\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {rendered.map((value, i) => {\n const pIn = i > 0 ? swapP(ats[i - 1]) : 1;\n const pOut = i < count - 1 ? swapP(ats[i]) : 0;\n const opacity = pIn * (1 - pOut);\n if (opacity <= 0.001) return null;\n const y = (1 - pIn) * d + pOut * -d;\n return (\n <span\n key={`${i}-${value}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {value}\n </span>\n );\n })}\n </span>\n );\n}"+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ninterface ValueSwapProps {\n values: string[];\n at: number | number[];\n duration?: number;\n distance?: number;\n direction?: \"up\" | \"down\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction ValueSwapBase({\n values,\n at,\n duration = 10,\n distance = 12,\n direction = \"up\",\n className,\n style,\n}: ValueSwapProps) {\n const frame = useCurrentFrame();\n const ats = Array.isArray(at) ? at : [at];\n const d = direction === \"down\" ? -distance : distance;\n const count = Math.min(values.length, ats.length + 1);\n const rendered = values.slice(0, count);\n const sizer = rendered.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n const swapP = (start: number) =>\n interpolate(frame, [start, start + duration], [0, 1], {\n ...clampOpts,\n easing: Easing.inOut(Easing.cubic),\n });\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {rendered.map((value, i) => {\n const pIn = i > 0 ? swapP(ats[i - 1]) : 1;\n const pOut = i < count - 1 ? swapP(ats[i]) : 0;\n const opacity = pIn * (1 - pOut);\n if (opacity <= 0.001) return null;\n const y = (1 - pIn) * d + pOut * -d;\n return (\n <span\n key={`${i}-${value}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {value}\n </span>\n );\n })}\n </span>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n duration: {\n type: \"number\",\n min: 4,\n max: 24,\n step: 1,\n default: 10,\n description: \"Duration\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 4,\n max: 32,\n step: 2,\n default: 12,\n description: \"Distance\",\n hiddenFromList: false,\n },\n direction: {\n type: \"enum\",\n default: \"up\",\n variants: {\n up: {},\n down: {},\n },\n description: \"Direction\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"duration\",\"distance\",\"direction\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n duration: 10,\n distance: 12,\n direction: \"up\",\n speed: 1,\n};\n\ntype ValueSwapElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ValueSwapBase>;\n\nconst ValueSwapInner = forwardRef<\n HTMLDivElement,\n ValueSwapElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ValueSwap>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ValueSwapBase\n {...(componentProps as unknown as ComponentProps<typeof ValueSwapBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ValueSwap = Interactive.withSchema({\n Component: ValueSwapInner,\n componentName: \"<ValueSwap>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 100}diff --git a/registry-artifacts/elements/vhs-filter.json b/registry-artifacts/elements/vhs-filter.jsonindex 5f4da933..725242f6 100644--- a/registry-artifacts/elements/vhs-filter.json+++ b/registry-artifacts/elements/vhs-filter.json@@ -11,9 +11,9 @@"dimensions": null,"displayName": "VHS Filter","durationInFrames": 90,- "installationMode": "wrapped",+ "installationMode": "component-owned-sequence","slug": "vhs-filter",- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nimport React from \"react\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nimport type React from \"react\";\n\n\nexport type VhsFilterProps = {\n bleed?: number;\n wobble?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_time;\nuniform float u_bleed;\nuniform float u_wobble;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float LINES = 486.0;\nconst int TAPS = 6;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat valueNoise(float x) {\n float i = floor(x);\n float f = fract(x);\n float a = hash(vec2(i, 7.0));\n float b = hash(vec2(i + 1.0, 7.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec3 rgb2yiq(vec3 c) {\n return vec3(\n dot(c, vec3(0.299, 0.587, 0.114)),\n dot(c, vec3(0.5959, -0.2746, -0.3213)),\n dot(c, vec3(0.2115, -0.5227, 0.3112))\n );\n}\n\nvec3 yiq2rgb(vec3 c) {\n return vec3(\n c.x + 0.956 * c.y + 0.619 * c.z,\n c.x - 0.272 * c.y - 0.647 * c.z,\n c.x - 1.106 * c.y + 1.703 * c.z\n );\n}\n\nvoid main() {\n float line = floor(v_uv.y * LINES);\n float clock = mod(u_frame, 64.0);\n\n float drift =\n sin(v_uv.y * 37.0 + u_time * 2.3) * 0.55 +\n sin(v_uv.y * 96.0 - u_time * 1.1) * 0.25;\n float jitter = valueNoise(line * 0.61 + u_time * 24.0) - 0.5;\n float wobble = (drift * 0.35 + jitter * 0.9) * 0.007 * u_wobble * u_intensity;\n\n float band = smoothstep(0.955, 0.994, v_uv.y);\n float tear = valueNoise(line * 2.7 + u_time * 43.0) - 0.5;\n float headSwitch = band * tear * 0.085 * u_intensity;\n\n vec2 uv = vec2(v_uv.x + wobble + headSwitch, v_uv.y);\n vec4 base = texture(u_scene, uv);\n float luma = rgb2yiq(base.rgb).x;\n\n float smear = u_bleed * 0.02 * u_intensity;\n vec2 chroma = vec2(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1);\n float weight = 1.0 - t * 0.72;\n vec3 tap = texture(u_scene, vec2(uv.x - smear * t, uv.y)).rgb;\n chroma += rgb2yiq(tap).yz * weight;\n total += weight;\n }\n\n vec3 color = yiq2rgb(vec3(luma, chroma / total));\n\n float scan = 0.94 + 0.06 * cos(v_uv.y * LINES * PI);\n color *= mix(1.0, scan, u_intensity);\n\n float grain =\n hash(vec2(v_uv.x * 640.0 + clock * 13.0, line + clock * 5.0)) - 0.5;\n color += grain * 0.07 * u_noise * u_intensity;\n\n color = mix(color, vec3(luma), band * 0.55 * u_intensity);\n color += band * (hash(vec2(line, clock * 3.0)) - 0.5) * 0.26 * u_intensity;\n\n outColor = vec4(clamp(color, 0.0, 1.0), base.a);\n}`;\n\nconst shader = makeFilterShader<VhsFilterProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform1f(uniform(\"u_bleed\"), bleed);\n gl.uniform1f(uniform(\"u_wobble\"), wobble);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({\n children,\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n}) => {\n const frame = useCurrentFrame();\n const shift =\n (random(`vhs-wobble-${frame}`) - 0.5) * 3.4 * wobble * intensity;\n const flicker =\n 1 + (random(`vhs-flicker-${frame}`) - 0.5) * 0.07 * noise * intensity;\n const smear = 3 + bleed * 5;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift}px)`,\n filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift - smear}px)`,\n filter: \"saturate(2.2) blur(1.4px)\",\n mixBlendMode: \"screen\",\n opacity: 0.24 * bleed * intensity,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px)\",\n opacity: intensity,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n insetInline: 0,\n bottom: 0,\n height: \"3.6%\",\n transform: `translateX(${shift * 3}px)`,\n background: `rgba(228, 228, 228, ${0.13 * intensity})`,\n mixBlendMode: \"screen\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const VhsFilter = makeCanvasFilter<VhsFilterProps>({\n shader,\n fallback: VhsFilterFallback,\n});"+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype VhsFilterProps = {\n bleed?: number;\n wobble?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_time;\nuniform float u_bleed;\nuniform float u_wobble;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float LINES = 486.0;\nconst int TAPS = 6;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat valueNoise(float x) {\n float i = floor(x);\n float f = fract(x);\n float a = hash(vec2(i, 7.0));\n float b = hash(vec2(i + 1.0, 7.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec3 rgb2yiq(vec3 c) {\n return vec3(\n dot(c, vec3(0.299, 0.587, 0.114)),\n dot(c, vec3(0.5959, -0.2746, -0.3213)),\n dot(c, vec3(0.2115, -0.5227, 0.3112))\n );\n}\n\nvec3 yiq2rgb(vec3 c) {\n return vec3(\n c.x + 0.956 * c.y + 0.619 * c.z,\n c.x - 0.272 * c.y - 0.647 * c.z,\n c.x - 1.106 * c.y + 1.703 * c.z\n );\n}\n\nvoid main() {\n float line = floor(v_uv.y * LINES);\n float clock = mod(u_frame, 64.0);\n\n float drift =\n sin(v_uv.y * 37.0 + u_time * 2.3) * 0.55 +\n sin(v_uv.y * 96.0 - u_time * 1.1) * 0.25;\n float jitter = valueNoise(line * 0.61 + u_time * 24.0) - 0.5;\n float wobble = (drift * 0.35 + jitter * 0.9) * 0.007 * u_wobble * u_intensity;\n\n float band = smoothstep(0.955, 0.994, v_uv.y);\n float tear = valueNoise(line * 2.7 + u_time * 43.0) - 0.5;\n float headSwitch = band * tear * 0.085 * u_intensity;\n\n vec2 uv = vec2(v_uv.x + wobble + headSwitch, v_uv.y);\n vec4 base = texture(u_scene, uv);\n float luma = rgb2yiq(base.rgb).x;\n\n float smear = u_bleed * 0.02 * u_intensity;\n vec2 chroma = vec2(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1);\n float weight = 1.0 - t * 0.72;\n vec3 tap = texture(u_scene, vec2(uv.x - smear * t, uv.y)).rgb;\n chroma += rgb2yiq(tap).yz * weight;\n total += weight;\n }\n\n vec3 color = yiq2rgb(vec3(luma, chroma / total));\n\n float scan = 0.94 + 0.06 * cos(v_uv.y * LINES * PI);\n color *= mix(1.0, scan, u_intensity);\n\n float grain =\n hash(vec2(v_uv.x * 640.0 + clock * 13.0, line + clock * 5.0)) - 0.5;\n color += grain * 0.07 * u_noise * u_intensity;\n\n color = mix(color, vec3(luma), band * 0.55 * u_intensity);\n color += band * (hash(vec2(line, clock * 3.0)) - 0.5) * 0.26 * u_intensity;\n\n outColor = vec4(clamp(color, 0.0, 1.0), base.a);\n}`;\n\nconst shader = makeFilterShader<VhsFilterProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform1f(uniform(\"u_bleed\"), bleed);\n gl.uniform1f(uniform(\"u_wobble\"), wobble);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({\n children,\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n}) => {\n const frame = useCurrentFrame();\n const shift =\n (random(`vhs-wobble-${frame}`) - 0.5) * 3.4 * wobble * intensity;\n const flicker =\n 1 + (random(`vhs-flicker-${frame}`) - 0.5) * 0.07 * noise * intensity;\n const smear = 3 + bleed * 5;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift}px)`,\n filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift - smear}px)`,\n filter: \"saturate(2.2) blur(1.4px)\",\n mixBlendMode: \"screen\",\n opacity: 0.24 * bleed * intensity,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px)\",\n opacity: intensity,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n insetInline: 0,\n bottom: 0,\n height: \"3.6%\",\n transform: `translateX(${shift * 3}px)`,\n background: `rgba(228, 228, 228, ${0.13 * intensity})`,\n mixBlendMode: \"screen\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nconst VhsFilterBase = makeCanvasFilter<VhsFilterProps>({\n shader,\n fallback: VhsFilterFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n bleed: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Chroma bleed\",\n hiddenFromList: false,\n },\n wobble: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Tape wobble\",\n hiddenFromList: false,\n },\n noise: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Noise\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"bleed\",\"wobble\",\"noise\",\"intensity\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n speed: 1,\n};\n\ntype VhsFilterElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VhsFilterBase>;\n\nconst VhsFilterInner = forwardRef<\n HTMLDivElement,\n VhsFilterElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<VhsFilter>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <VhsFilterBase\n {...(componentProps as unknown as ComponentProps<typeof VhsFilterBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VhsFilter = Interactive.withSchema({\n Component: VhsFilterInner,\n componentName: \"<VhsFilter>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"},"durationInFrames": 90}diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 1d4df436..09005663 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -1,5 +1,9 @@import type React from "react";-import { type ComponentConfig, resolveConfig } from "@/lib/customizer-config";+import {+ type ComponentConfig,+ type ResolvedComponentConfig,+ resolveConfig,+} from "@/lib/customizer-config";export interface RegistryEntry {// biome-ignore lint/suspicious/noExplicitAny: dynamically-loaded Remotion composition, props shape varies per component@@ -2655,9 +2659,11 @@ const registry: Record<string, RegistryEntry> = {},};-const configCache = new Map<string, Promise<ComponentConfig>>();+const configCache = new Map<string, Promise<ResolvedComponentConfig>>();-export function loadComponentConfig(slug: string): Promise<ComponentConfig> {+export function loadComponentConfig(+ slug: string,+): Promise<ResolvedComponentConfig> {let promise = configCache.get(slug);if (!promise) {const entry = registry[slug];diff --git a/registry/__manifest__.ts b/registry/__manifest__.tsindex 37139f2a..f5b36f3c 100644--- a/registry/__manifest__.ts+++ b/registry/__manifest__.ts@@ -323,6 +323,21 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "chromatic-wave": {+ durationInFrames: 100,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ defaults: {+ headline: "MUSIC",+ kicker: "APPLES",+ fill: "#ffffff",+ waveHeight: 28,+ maxDisplacementPx: 39,+ turbulentAmount: 130,+ speed: 1,+ },+ },"claude-chat": {durationInFrames: 150,fps: 30,@@ -656,6 +671,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "extrude-pop": {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#141318",+ },+ defaults: {+ letter: "WIN",+ bodyColor: "#e8192b",+ faceColor: "#ffffff",+ minimaxRadius: 80,+ extrudeAngleDeg: -58.6,+ extrudeEndFrame: 48,+ speed: 1,+ },+ },"fade-through": {durationInFrames: 90,fps: 30,@@ -788,6 +822,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "gooey-morph": {+ durationInFrames: 120,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#141318",+ },+ defaults: {+ word: "HELLO",+ fill: "#f2f2f2",+ fontFamily: "'Bodoni Moda', Georgia, serif",+ blurRadius: 6,+ displaceAmount: 20,+ barTravelFrames: 30,+ speed: 1,+ },+ },"grain-dissolve": {durationInFrames: 116,fps: 30,@@ -2453,6 +2506,41 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "kinetic-warp": {+ durationInFrames: 120,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ defaults: {+ text: "REM\nOCN",+ textColor: "#FFFFFF",+ fontFamily: "Passion One",+ fontUrl:+ "https://fonts.googleapis.com/css2?family=Passion+One:wght@400;700;900&display=block",+ fontWeight: "700",+ fontSize: 107.1,+ layerScale: 480,+ keyframeStride: 20,+ speed: 1,+ },+ },+ "lens-zoom": {+ durationInFrames: 112,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#141318",+ },+ defaults: {+ lensSteps: 9,+ blurSamples: 7,+ shakeAmount: 50,+ shakeTranslatePx: 73,+ speed: 1,+ },+ },"line-by-line-slide": {durationInFrames: 90,fps: 30,@@ -2763,6 +2851,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "perspective-squeeze": {+ durationInFrames: 225,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#141318",+ },+ defaults: {+ upperText: "REMOCN",+ lowerText: "BEST",+ fill: "#f2f2f2",+ upperFontFamily: "Impact, 'Arial Narrow', sans-serif",+ lowerFontFamily: "Impact, 'Arial Narrow', sans-serif",+ lineGap: 50,+ speed: 1,+ },+ },"pixelate-region": {durationInFrames: 90,fps: 30,@@ -3632,6 +3739,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "stretch-in": {+ durationInFrames: 60,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#141318",+ },+ defaults: {+ text: "REMOCN",+ fill: "#ffffff",+ fontSize: 510,+ entryStagger: 3,+ travelFrames: 33,+ vertexLagFrames: 3.5,+ speed: 1,+ },+ },"strikethrough-replace": {durationInFrames: 120,fps: 30,diff --git a/registry/remocn-icons/icon-activity/config.ts b/registry/remocn-icons/icon-activity/config.tsindex d037266f..ebbaf572 100644--- a/registry/remocn-icons/icon-activity/config.ts+++ b/registry/remocn-icons/icon-activity/config.ts@@ -5,36 +5,42 @@ export const iconActivityConfig: ComponentConfig = {importPath: "@/components/remocn/icon-activity",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-alert-triangle/config.ts b/registry/remocn-icons/icon-alert-triangle/config.tsindex b32f99f2..91829500 100644--- a/registry/remocn-icons/icon-alert-triangle/config.ts+++ b/registry/remocn-icons/icon-alert-triangle/config.ts@@ -5,36 +5,42 @@ export const iconAlertTriangleConfig: ComponentConfig = {importPath: "@/components/remocn/icon-alert-triangle",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-arrow-down/config.ts b/registry/remocn-icons/icon-arrow-down/config.tsindex 52b5af60..272daa58 100644--- a/registry/remocn-icons/icon-arrow-down/config.ts+++ b/registry/remocn-icons/icon-arrow-down/config.ts@@ -5,36 +5,42 @@ export const iconArrowDownConfig: ComponentConfig = {importPath: "@/components/remocn/icon-arrow-down",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-arrow-left/config.ts b/registry/remocn-icons/icon-arrow-left/config.tsindex e438a8df..50b4e796 100644--- a/registry/remocn-icons/icon-arrow-left/config.ts+++ b/registry/remocn-icons/icon-arrow-left/config.ts@@ -5,36 +5,42 @@ export const iconArrowLeftConfig: ComponentConfig = {importPath: "@/components/remocn/icon-arrow-left",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-arrow-right/config.ts b/registry/remocn-icons/icon-arrow-right/config.tsindex 7867f9d9..811e2256 100644--- a/registry/remocn-icons/icon-arrow-right/config.ts+++ b/registry/remocn-icons/icon-arrow-right/config.ts@@ -5,36 +5,42 @@ export const iconArrowRightConfig: ComponentConfig = {importPath: "@/components/remocn/icon-arrow-right",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-arrow-up/config.ts b/registry/remocn-icons/icon-arrow-up/config.tsindex 6f6d9539..6da757c0 100644--- a/registry/remocn-icons/icon-arrow-up/config.ts+++ b/registry/remocn-icons/icon-arrow-up/config.ts@@ -5,36 +5,42 @@ export const iconArrowUpConfig: ComponentConfig = {importPath: "@/components/remocn/icon-arrow-up",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-at-sign/config.ts b/registry/remocn-icons/icon-at-sign/config.tsindex eada2271..adf201ce 100644--- a/registry/remocn-icons/icon-at-sign/config.ts+++ b/registry/remocn-icons/icon-at-sign/config.ts@@ -5,36 +5,42 @@ export const iconAtSignConfig: ComponentConfig = {importPath: "@/components/remocn/icon-at-sign",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-award/config.ts b/registry/remocn-icons/icon-award/config.tsindex 19f44d30..5bbb4248 100644--- a/registry/remocn-icons/icon-award/config.ts+++ b/registry/remocn-icons/icon-award/config.ts@@ -5,36 +5,42 @@ export const iconAwardConfig: ComponentConfig = {importPath: "@/components/remocn/icon-award",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-bar-chart-3/config.ts b/registry/remocn-icons/icon-bar-chart-3/config.tsindex 7bea95f2..44a4638a 100644--- a/registry/remocn-icons/icon-bar-chart-3/config.ts+++ b/registry/remocn-icons/icon-bar-chart-3/config.ts@@ -5,36 +5,42 @@ export const iconBarChart3Config: ComponentConfig = {importPath: "@/components/remocn/icon-bar-chart-3",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-bell/config.ts b/registry/remocn-icons/icon-bell/config.tsindex 12e5fdf2..a49fc424 100644--- a/registry/remocn-icons/icon-bell/config.ts+++ b/registry/remocn-icons/icon-bell/config.ts@@ -5,36 +5,42 @@ export const iconBellConfig: ComponentConfig = {importPath: "@/components/remocn/icon-bell",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-bookmark/config.ts b/registry/remocn-icons/icon-bookmark/config.tsindex 57482c46..38346d25 100644--- a/registry/remocn-icons/icon-bookmark/config.ts+++ b/registry/remocn-icons/icon-bookmark/config.ts@@ -5,36 +5,42 @@ export const iconBookmarkConfig: ComponentConfig = {importPath: "@/components/remocn/icon-bookmark",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-calendar/config.ts b/registry/remocn-icons/icon-calendar/config.tsindex 4926dffb..bfdda877 100644--- a/registry/remocn-icons/icon-calendar/config.ts+++ b/registry/remocn-icons/icon-calendar/config.ts@@ -5,36 +5,42 @@ export const iconCalendarConfig: ComponentConfig = {importPath: "@/components/remocn/icon-calendar",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-camera/config.ts b/registry/remocn-icons/icon-camera/config.tsindex 38272a2b..bf7b528d 100644--- a/registry/remocn-icons/icon-camera/config.ts+++ b/registry/remocn-icons/icon-camera/config.ts@@ -5,36 +5,42 @@ export const iconCameraConfig: ComponentConfig = {importPath: "@/components/remocn/icon-camera",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-check-circle/config.ts b/registry/remocn-icons/icon-check-circle/config.tsindex 931d7f9e..8f464699 100644--- a/registry/remocn-icons/icon-check-circle/config.ts+++ b/registry/remocn-icons/icon-check-circle/config.ts@@ -5,36 +5,42 @@ export const iconCheckCircleConfig: ComponentConfig = {importPath: "@/components/remocn/icon-check-circle",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-check/config.ts b/registry/remocn-icons/icon-check/config.tsindex cc48f451..3cc30544 100644--- a/registry/remocn-icons/icon-check/config.ts+++ b/registry/remocn-icons/icon-check/config.ts@@ -5,36 +5,42 @@ export const iconCheckConfig: ComponentConfig = {importPath: "@/components/remocn/icon-check",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-chevron-down/config.ts b/registry/remocn-icons/icon-chevron-down/config.tsindex a44cd7a5..396a0090 100644--- a/registry/remocn-icons/icon-chevron-down/config.ts+++ b/registry/remocn-icons/icon-chevron-down/config.ts@@ -5,36 +5,42 @@ export const iconChevronDownConfig: ComponentConfig = {importPath: "@/components/remocn/icon-chevron-down",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-chevron-left/config.ts b/registry/remocn-icons/icon-chevron-left/config.tsindex 65373a3f..ae42828e 100644--- a/registry/remocn-icons/icon-chevron-left/config.ts+++ b/registry/remocn-icons/icon-chevron-left/config.ts@@ -5,36 +5,42 @@ export const iconChevronLeftConfig: ComponentConfig = {importPath: "@/components/remocn/icon-chevron-left",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-chevron-right/config.ts b/registry/remocn-icons/icon-chevron-right/config.tsindex 6a80daad..992e173c 100644--- a/registry/remocn-icons/icon-chevron-right/config.ts+++ b/registry/remocn-icons/icon-chevron-right/config.ts@@ -5,36 +5,42 @@ export const iconChevronRightConfig: ComponentConfig = {importPath: "@/components/remocn/icon-chevron-right",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-chevron-up/config.ts b/registry/remocn-icons/icon-chevron-up/config.tsindex 621173f8..717d66a8 100644--- a/registry/remocn-icons/icon-chevron-up/config.ts+++ b/registry/remocn-icons/icon-chevron-up/config.ts@@ -5,36 +5,42 @@ export const iconChevronUpConfig: ComponentConfig = {importPath: "@/components/remocn/icon-chevron-up",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-clock/config.ts b/registry/remocn-icons/icon-clock/config.tsindex a82ed873..9222553f 100644--- a/registry/remocn-icons/icon-clock/config.ts+++ b/registry/remocn-icons/icon-clock/config.ts@@ -5,36 +5,42 @@ export const iconClockConfig: ComponentConfig = {importPath: "@/components/remocn/icon-clock",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-cloud/config.ts b/registry/remocn-icons/icon-cloud/config.tsindex 517b6aa0..cb4c0583 100644--- a/registry/remocn-icons/icon-cloud/config.ts+++ b/registry/remocn-icons/icon-cloud/config.ts@@ -5,36 +5,42 @@ export const iconCloudConfig: ComponentConfig = {importPath: "@/components/remocn/icon-cloud",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-code/config.ts b/registry/remocn-icons/icon-code/config.tsindex 64ecc037..0adf6fda 100644--- a/registry/remocn-icons/icon-code/config.ts+++ b/registry/remocn-icons/icon-code/config.ts@@ -5,36 +5,42 @@ export const iconCodeConfig: ComponentConfig = {importPath: "@/components/remocn/icon-code",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-copy/config.ts b/registry/remocn-icons/icon-copy/config.tsindex 72915046..71ed0aad 100644--- a/registry/remocn-icons/icon-copy/config.ts+++ b/registry/remocn-icons/icon-copy/config.ts@@ -5,36 +5,42 @@ export const iconCopyConfig: ComponentConfig = {importPath: "@/components/remocn/icon-copy",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-credit-card/config.ts b/registry/remocn-icons/icon-credit-card/config.tsindex a6636099..87f6bd42 100644--- a/registry/remocn-icons/icon-credit-card/config.ts+++ b/registry/remocn-icons/icon-credit-card/config.ts@@ -5,36 +5,42 @@ export const iconCreditCardConfig: ComponentConfig = {importPath: "@/components/remocn/icon-credit-card",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-crown/config.ts b/registry/remocn-icons/icon-crown/config.tsindex 93c6cc0b..593e2b3d 100644--- a/registry/remocn-icons/icon-crown/config.ts+++ b/registry/remocn-icons/icon-crown/config.ts@@ -5,36 +5,42 @@ export const iconCrownConfig: ComponentConfig = {importPath: "@/components/remocn/icon-crown",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-database/config.ts b/registry/remocn-icons/icon-database/config.tsindex 40750136..22f122a6 100644--- a/registry/remocn-icons/icon-database/config.ts+++ b/registry/remocn-icons/icon-database/config.ts@@ -5,36 +5,42 @@ export const iconDatabaseConfig: ComponentConfig = {importPath: "@/components/remocn/icon-database",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-dollar-sign/config.ts b/registry/remocn-icons/icon-dollar-sign/config.tsindex f595f663..863df34f 100644--- a/registry/remocn-icons/icon-dollar-sign/config.ts+++ b/registry/remocn-icons/icon-dollar-sign/config.ts@@ -5,36 +5,42 @@ export const iconDollarSignConfig: ComponentConfig = {importPath: "@/components/remocn/icon-dollar-sign",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-download/config.ts b/registry/remocn-icons/icon-download/config.tsindex 6dd11234..bd054e5e 100644--- a/registry/remocn-icons/icon-download/config.ts+++ b/registry/remocn-icons/icon-download/config.ts@@ -5,36 +5,42 @@ export const iconDownloadConfig: ComponentConfig = {importPath: "@/components/remocn/icon-download",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-external-link/config.ts b/registry/remocn-icons/icon-external-link/config.tsindex 9d298367..2fa9edae 100644--- a/registry/remocn-icons/icon-external-link/config.ts+++ b/registry/remocn-icons/icon-external-link/config.ts@@ -5,36 +5,42 @@ export const iconExternalLinkConfig: ComponentConfig = {importPath: "@/components/remocn/icon-external-link",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-eye-off/config.ts b/registry/remocn-icons/icon-eye-off/config.tsindex f41a04b7..a7bc9f6c 100644--- a/registry/remocn-icons/icon-eye-off/config.ts+++ b/registry/remocn-icons/icon-eye-off/config.ts@@ -5,36 +5,42 @@ export const iconEyeOffConfig: ComponentConfig = {importPath: "@/components/remocn/icon-eye-off",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-eye/config.ts b/registry/remocn-icons/icon-eye/config.tsindex d98ce1d8..fdadc571 100644--- a/registry/remocn-icons/icon-eye/config.ts+++ b/registry/remocn-icons/icon-eye/config.ts@@ -5,36 +5,42 @@ export const iconEyeConfig: ComponentConfig = {importPath: "@/components/remocn/icon-eye",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-file-text/config.ts b/registry/remocn-icons/icon-file-text/config.tsindex f8ff23f0..1273f8e2 100644--- a/registry/remocn-icons/icon-file-text/config.ts+++ b/registry/remocn-icons/icon-file-text/config.ts@@ -5,36 +5,42 @@ export const iconFileTextConfig: ComponentConfig = {importPath: "@/components/remocn/icon-file-text",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-filter/config.ts b/registry/remocn-icons/icon-filter/config.tsindex 365f9b9d..7fbe94da 100644--- a/registry/remocn-icons/icon-filter/config.ts+++ b/registry/remocn-icons/icon-filter/config.ts@@ -5,36 +5,42 @@ export const iconFilterConfig: ComponentConfig = {importPath: "@/components/remocn/icon-filter",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-flame/config.ts b/registry/remocn-icons/icon-flame/config.tsindex b199a86f..c2f84516 100644--- a/registry/remocn-icons/icon-flame/config.ts+++ b/registry/remocn-icons/icon-flame/config.ts@@ -5,36 +5,42 @@ export const iconFlameConfig: ComponentConfig = {importPath: "@/components/remocn/icon-flame",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-folder/config.ts b/registry/remocn-icons/icon-folder/config.tsindex 1390d8a8..a56ceeef 100644--- a/registry/remocn-icons/icon-folder/config.ts+++ b/registry/remocn-icons/icon-folder/config.ts@@ -5,36 +5,42 @@ export const iconFolderConfig: ComponentConfig = {importPath: "@/components/remocn/icon-folder",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-gem/config.ts b/registry/remocn-icons/icon-gem/config.tsindex 0c8f96e2..0705a0df 100644--- a/registry/remocn-icons/icon-gem/config.ts+++ b/registry/remocn-icons/icon-gem/config.ts@@ -5,36 +5,42 @@ export const iconGemConfig: ComponentConfig = {importPath: "@/components/remocn/icon-gem",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-gift/config.ts b/registry/remocn-icons/icon-gift/config.tsindex a8a93a41..21382f05 100644--- a/registry/remocn-icons/icon-gift/config.ts+++ b/registry/remocn-icons/icon-gift/config.ts@@ -5,36 +5,42 @@ export const iconGiftConfig: ComponentConfig = {importPath: "@/components/remocn/icon-gift",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-globe/config.ts b/registry/remocn-icons/icon-globe/config.tsindex 5c4289e4..a25d6960 100644--- a/registry/remocn-icons/icon-globe/config.ts+++ b/registry/remocn-icons/icon-globe/config.ts@@ -5,36 +5,42 @@ export const iconGlobeConfig: ComponentConfig = {importPath: "@/components/remocn/icon-globe",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-heart/config.ts b/registry/remocn-icons/icon-heart/config.tsindex 955803c9..a842585e 100644--- a/registry/remocn-icons/icon-heart/config.ts+++ b/registry/remocn-icons/icon-heart/config.ts@@ -5,36 +5,42 @@ export const iconHeartConfig: ComponentConfig = {importPath: "@/components/remocn/icon-heart",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-help-circle/config.ts b/registry/remocn-icons/icon-help-circle/config.tsindex c07002cc..3f49f3de 100644--- a/registry/remocn-icons/icon-help-circle/config.ts+++ b/registry/remocn-icons/icon-help-circle/config.ts@@ -5,36 +5,42 @@ export const iconHelpCircleConfig: ComponentConfig = {importPath: "@/components/remocn/icon-help-circle",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-home/config.ts b/registry/remocn-icons/icon-home/config.tsindex ab88ad1d..ca37ea3e 100644--- a/registry/remocn-icons/icon-home/config.ts+++ b/registry/remocn-icons/icon-home/config.ts@@ -5,36 +5,42 @@ export const iconHomeConfig: ComponentConfig = {importPath: "@/components/remocn/icon-home",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-image/config.ts b/registry/remocn-icons/icon-image/config.tsindex 466f9f23..388a97de 100644--- a/registry/remocn-icons/icon-image/config.ts+++ b/registry/remocn-icons/icon-image/config.ts@@ -5,36 +5,42 @@ export const iconImageConfig: ComponentConfig = {importPath: "@/components/remocn/icon-image",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-inbox/config.ts b/registry/remocn-icons/icon-inbox/config.tsindex eab22d29..e7d6568d 100644--- a/registry/remocn-icons/icon-inbox/config.ts+++ b/registry/remocn-icons/icon-inbox/config.ts@@ -5,36 +5,42 @@ export const iconInboxConfig: ComponentConfig = {importPath: "@/components/remocn/icon-inbox",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-info/config.ts b/registry/remocn-icons/icon-info/config.tsindex 46e4d36b..35f27009 100644--- a/registry/remocn-icons/icon-info/config.ts+++ b/registry/remocn-icons/icon-info/config.ts@@ -5,36 +5,42 @@ export const iconInfoConfig: ComponentConfig = {importPath: "@/components/remocn/icon-info",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-key/config.ts b/registry/remocn-icons/icon-key/config.tsindex 49f280b8..7f01dd5d 100644--- a/registry/remocn-icons/icon-key/config.ts+++ b/registry/remocn-icons/icon-key/config.ts@@ -5,36 +5,42 @@ export const iconKeyConfig: ComponentConfig = {importPath: "@/components/remocn/icon-key",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-layout-grid/config.ts b/registry/remocn-icons/icon-layout-grid/config.tsindex d8ced674..a4146e12 100644--- a/registry/remocn-icons/icon-layout-grid/config.ts+++ b/registry/remocn-icons/icon-layout-grid/config.ts@@ -5,36 +5,42 @@ export const iconLayoutGridConfig: ComponentConfig = {importPath: "@/components/remocn/icon-layout-grid",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-link/config.ts b/registry/remocn-icons/icon-link/config.tsindex 68cd3082..bb90a58c 100644--- a/registry/remocn-icons/icon-link/config.ts+++ b/registry/remocn-icons/icon-link/config.ts@@ -5,36 +5,42 @@ export const iconLinkConfig: ComponentConfig = {importPath: "@/components/remocn/icon-link",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-loader/config.ts b/registry/remocn-icons/icon-loader/config.tsindex 1c705e50..ecbc0178 100644--- a/registry/remocn-icons/icon-loader/config.ts+++ b/registry/remocn-icons/icon-loader/config.ts@@ -5,36 +5,42 @@ export const iconLoaderConfig: ComponentConfig = {importPath: "@/components/remocn/icon-loader",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-lock/config.ts b/registry/remocn-icons/icon-lock/config.tsindex 823ee449..9795f3ba 100644--- a/registry/remocn-icons/icon-lock/config.ts+++ b/registry/remocn-icons/icon-lock/config.ts@@ -5,36 +5,42 @@ export const iconLockConfig: ComponentConfig = {importPath: "@/components/remocn/icon-lock",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-log-out/config.ts b/registry/remocn-icons/icon-log-out/config.tsindex 589e443f..4c64ca58 100644--- a/registry/remocn-icons/icon-log-out/config.ts+++ b/registry/remocn-icons/icon-log-out/config.ts@@ -5,36 +5,42 @@ export const iconLogOutConfig: ComponentConfig = {importPath: "@/components/remocn/icon-log-out",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-mail/config.ts b/registry/remocn-icons/icon-mail/config.tsindex d8996e40..812273e0 100644--- a/registry/remocn-icons/icon-mail/config.ts+++ b/registry/remocn-icons/icon-mail/config.ts@@ -5,36 +5,42 @@ export const iconMailConfig: ComponentConfig = {importPath: "@/components/remocn/icon-mail",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-maximize/config.ts b/registry/remocn-icons/icon-maximize/config.tsindex 4559298c..ab9ae837 100644--- a/registry/remocn-icons/icon-maximize/config.ts+++ b/registry/remocn-icons/icon-maximize/config.ts@@ -5,36 +5,42 @@ export const iconMaximizeConfig: ComponentConfig = {importPath: "@/components/remocn/icon-maximize",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-menu/config.ts b/registry/remocn-icons/icon-menu/config.tsindex 9302db12..98783a0c 100644--- a/registry/remocn-icons/icon-menu/config.ts+++ b/registry/remocn-icons/icon-menu/config.ts@@ -5,36 +5,42 @@ export const iconMenuConfig: ComponentConfig = {importPath: "@/components/remocn/icon-menu",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-message-circle/config.ts b/registry/remocn-icons/icon-message-circle/config.tsindex d5fcf7e0..3bba5e66 100644--- a/registry/remocn-icons/icon-message-circle/config.ts+++ b/registry/remocn-icons/icon-message-circle/config.ts@@ -5,36 +5,42 @@ export const iconMessageCircleConfig: ComponentConfig = {importPath: "@/components/remocn/icon-message-circle",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-mic/config.ts b/registry/remocn-icons/icon-mic/config.tsindex 591bf01e..bddaec00 100644--- a/registry/remocn-icons/icon-mic/config.ts+++ b/registry/remocn-icons/icon-mic/config.ts@@ -5,36 +5,42 @@ export const iconMicConfig: ComponentConfig = {importPath: "@/components/remocn/icon-mic",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-monitor/config.ts b/registry/remocn-icons/icon-monitor/config.tsindex e3f9fd89..d515b354 100644--- a/registry/remocn-icons/icon-monitor/config.ts+++ b/registry/remocn-icons/icon-monitor/config.ts@@ -5,36 +5,42 @@ export const iconMonitorConfig: ComponentConfig = {importPath: "@/components/remocn/icon-monitor",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-moon/config.ts b/registry/remocn-icons/icon-moon/config.tsindex 4eb5b579..067ce4bf 100644--- a/registry/remocn-icons/icon-moon/config.ts+++ b/registry/remocn-icons/icon-moon/config.ts@@ -5,36 +5,42 @@ export const iconMoonConfig: ComponentConfig = {importPath: "@/components/remocn/icon-moon",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-more-horizontal/config.ts b/registry/remocn-icons/icon-more-horizontal/config.tsindex 9d0dd57f..0232ec19 100644--- a/registry/remocn-icons/icon-more-horizontal/config.ts+++ b/registry/remocn-icons/icon-more-horizontal/config.ts@@ -5,36 +5,42 @@ export const iconMoreHorizontalConfig: ComponentConfig = {importPath: "@/components/remocn/icon-more-horizontal",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-package/config.ts b/registry/remocn-icons/icon-package/config.tsindex 3ea2bd09..b6c2bcf3 100644--- a/registry/remocn-icons/icon-package/config.ts+++ b/registry/remocn-icons/icon-package/config.ts@@ -5,36 +5,42 @@ export const iconPackageConfig: ComponentConfig = {importPath: "@/components/remocn/icon-package",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-party-popper/config.ts b/registry/remocn-icons/icon-party-popper/config.tsindex 232292ae..5929cea3 100644--- a/registry/remocn-icons/icon-party-popper/config.ts+++ b/registry/remocn-icons/icon-party-popper/config.ts@@ -5,36 +5,42 @@ export const iconPartyPopperConfig: ComponentConfig = {importPath: "@/components/remocn/icon-party-popper",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-pause/config.ts b/registry/remocn-icons/icon-pause/config.tsindex 9b07983f..70ad0ac7 100644--- a/registry/remocn-icons/icon-pause/config.ts+++ b/registry/remocn-icons/icon-pause/config.ts@@ -5,36 +5,42 @@ export const iconPauseConfig: ComponentConfig = {importPath: "@/components/remocn/icon-pause",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-pencil/config.ts b/registry/remocn-icons/icon-pencil/config.tsindex 71fb999a..f2a5c6af 100644--- a/registry/remocn-icons/icon-pencil/config.ts+++ b/registry/remocn-icons/icon-pencil/config.ts@@ -5,36 +5,42 @@ export const iconPencilConfig: ComponentConfig = {importPath: "@/components/remocn/icon-pencil",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-phone/config.ts b/registry/remocn-icons/icon-phone/config.tsindex e5a382a4..dff16977 100644--- a/registry/remocn-icons/icon-phone/config.ts+++ b/registry/remocn-icons/icon-phone/config.ts@@ -5,36 +5,42 @@ export const iconPhoneConfig: ComponentConfig = {importPath: "@/components/remocn/icon-phone",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-play/config.ts b/registry/remocn-icons/icon-play/config.tsindex 307130c9..99706cff 100644--- a/registry/remocn-icons/icon-play/config.ts+++ b/registry/remocn-icons/icon-play/config.ts@@ -5,36 +5,42 @@ export const iconPlayConfig: ComponentConfig = {importPath: "@/components/remocn/icon-play",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-plus-circle/config.ts b/registry/remocn-icons/icon-plus-circle/config.tsindex 2dc3998b..576dc735 100644--- a/registry/remocn-icons/icon-plus-circle/config.ts+++ b/registry/remocn-icons/icon-plus-circle/config.ts@@ -5,36 +5,42 @@ export const iconPlusCircleConfig: ComponentConfig = {importPath: "@/components/remocn/icon-plus-circle",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-plus/config.ts b/registry/remocn-icons/icon-plus/config.tsindex 57cdcc7c..90a52733 100644--- a/registry/remocn-icons/icon-plus/config.ts+++ b/registry/remocn-icons/icon-plus/config.ts@@ -5,36 +5,42 @@ export const iconPlusConfig: ComponentConfig = {importPath: "@/components/remocn/icon-plus",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-refresh-cw/config.ts b/registry/remocn-icons/icon-refresh-cw/config.tsindex 9d7d9862..85f45045 100644--- a/registry/remocn-icons/icon-refresh-cw/config.ts+++ b/registry/remocn-icons/icon-refresh-cw/config.ts@@ -5,36 +5,42 @@ export const iconRefreshCwConfig: ComponentConfig = {importPath: "@/components/remocn/icon-refresh-cw",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-rocket/config.ts b/registry/remocn-icons/icon-rocket/config.tsindex 3e84d7d0..020f7d5b 100644--- a/registry/remocn-icons/icon-rocket/config.ts+++ b/registry/remocn-icons/icon-rocket/config.ts@@ -5,36 +5,42 @@ export const iconRocketConfig: ComponentConfig = {importPath: "@/components/remocn/icon-rocket",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-save/config.ts b/registry/remocn-icons/icon-save/config.tsindex 4af0852c..40f94890 100644--- a/registry/remocn-icons/icon-save/config.ts+++ b/registry/remocn-icons/icon-save/config.ts@@ -5,36 +5,42 @@ export const iconSaveConfig: ComponentConfig = {importPath: "@/components/remocn/icon-save",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-search/config.ts b/registry/remocn-icons/icon-search/config.tsindex 0c566f5d..770e4ee6 100644--- a/registry/remocn-icons/icon-search/config.ts+++ b/registry/remocn-icons/icon-search/config.ts@@ -5,36 +5,42 @@ export const iconSearchConfig: ComponentConfig = {importPath: "@/components/remocn/icon-search",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-send/config.ts b/registry/remocn-icons/icon-send/config.tsindex f5594dff..65b35434 100644--- a/registry/remocn-icons/icon-send/config.ts+++ b/registry/remocn-icons/icon-send/config.ts@@ -5,36 +5,42 @@ export const iconSendConfig: ComponentConfig = {importPath: "@/components/remocn/icon-send",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-settings/config.ts b/registry/remocn-icons/icon-settings/config.tsindex 62a53c2c..140e48f1 100644--- a/registry/remocn-icons/icon-settings/config.ts+++ b/registry/remocn-icons/icon-settings/config.ts@@ -5,36 +5,42 @@ export const iconSettingsConfig: ComponentConfig = {importPath: "@/components/remocn/icon-settings",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-share-2/config.ts b/registry/remocn-icons/icon-share-2/config.tsindex 97dd9520..810ef6c9 100644--- a/registry/remocn-icons/icon-share-2/config.ts+++ b/registry/remocn-icons/icon-share-2/config.ts@@ -5,36 +5,42 @@ export const iconShare2Config: ComponentConfig = {importPath: "@/components/remocn/icon-share-2",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-shield/config.ts b/registry/remocn-icons/icon-shield/config.tsindex 9ce73db7..c60f955c 100644--- a/registry/remocn-icons/icon-shield/config.ts+++ b/registry/remocn-icons/icon-shield/config.ts@@ -5,36 +5,42 @@ export const iconShieldConfig: ComponentConfig = {importPath: "@/components/remocn/icon-shield",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-shopping-cart/config.ts b/registry/remocn-icons/icon-shopping-cart/config.tsindex a23d537b..c56243a9 100644--- a/registry/remocn-icons/icon-shopping-cart/config.ts+++ b/registry/remocn-icons/icon-shopping-cart/config.ts@@ -5,36 +5,42 @@ export const iconShoppingCartConfig: ComponentConfig = {importPath: "@/components/remocn/icon-shopping-cart",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-skip-forward/config.ts b/registry/remocn-icons/icon-skip-forward/config.tsindex 52bf4470..bc4b211c 100644--- a/registry/remocn-icons/icon-skip-forward/config.ts+++ b/registry/remocn-icons/icon-skip-forward/config.ts@@ -5,36 +5,42 @@ export const iconSkipForwardConfig: ComponentConfig = {importPath: "@/components/remocn/icon-skip-forward",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-smartphone/config.ts b/registry/remocn-icons/icon-smartphone/config.tsindex da07f44e..21f37089 100644--- a/registry/remocn-icons/icon-smartphone/config.ts+++ b/registry/remocn-icons/icon-smartphone/config.ts@@ -5,36 +5,42 @@ export const iconSmartphoneConfig: ComponentConfig = {importPath: "@/components/remocn/icon-smartphone",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-sparkles/config.ts b/registry/remocn-icons/icon-sparkles/config.tsindex 402e21c2..4e0c08b8 100644--- a/registry/remocn-icons/icon-sparkles/config.ts+++ b/registry/remocn-icons/icon-sparkles/config.ts@@ -5,36 +5,42 @@ export const iconSparklesConfig: ComponentConfig = {importPath: "@/components/remocn/icon-sparkles",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: true,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-star/config.ts b/registry/remocn-icons/icon-star/config.tsindex 75baa50a..87e7f8c5 100644--- a/registry/remocn-icons/icon-star/config.ts+++ b/registry/remocn-icons/icon-star/config.ts@@ -5,36 +5,42 @@ export const iconStarConfig: ComponentConfig = {importPath: "@/components/remocn/icon-star",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-sun/config.ts b/registry/remocn-icons/icon-sun/config.tsindex c9d89f29..666d2c1b 100644--- a/registry/remocn-icons/icon-sun/config.ts+++ b/registry/remocn-icons/icon-sun/config.ts@@ -5,36 +5,42 @@ export const iconSunConfig: ComponentConfig = {importPath: "@/components/remocn/icon-sun",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 85,diff --git a/registry/remocn-icons/icon-tag/config.ts b/registry/remocn-icons/icon-tag/config.tsindex 138d537c..c501d848 100644--- a/registry/remocn-icons/icon-tag/config.ts+++ b/registry/remocn-icons/icon-tag/config.ts@@ -5,36 +5,42 @@ export const iconTagConfig: ComponentConfig = {importPath: "@/components/remocn/icon-tag",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-target/config.ts b/registry/remocn-icons/icon-target/config.tsindex bc4850d9..200c0149 100644--- a/registry/remocn-icons/icon-target/config.ts+++ b/registry/remocn-icons/icon-target/config.ts@@ -5,36 +5,42 @@ export const iconTargetConfig: ComponentConfig = {importPath: "@/components/remocn/icon-target",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-terminal/config.ts b/registry/remocn-icons/icon-terminal/config.tsindex 071ee491..6d5fa2d6 100644--- a/registry/remocn-icons/icon-terminal/config.ts+++ b/registry/remocn-icons/icon-terminal/config.ts@@ -5,36 +5,42 @@ export const iconTerminalConfig: ComponentConfig = {importPath: "@/components/remocn/icon-terminal",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-thumbs-up/config.ts b/registry/remocn-icons/icon-thumbs-up/config.tsindex a5ea2edd..792409c2 100644--- a/registry/remocn-icons/icon-thumbs-up/config.ts+++ b/registry/remocn-icons/icon-thumbs-up/config.ts@@ -5,36 +5,42 @@ export const iconThumbsUpConfig: ComponentConfig = {importPath: "@/components/remocn/icon-thumbs-up",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-timer/config.ts b/registry/remocn-icons/icon-timer/config.tsindex e6f77ba4..068b6b75 100644--- a/registry/remocn-icons/icon-timer/config.ts+++ b/registry/remocn-icons/icon-timer/config.ts@@ -5,36 +5,42 @@ export const iconTimerConfig: ComponentConfig = {importPath: "@/components/remocn/icon-timer",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn-icons/icon-trash/config.ts b/registry/remocn-icons/icon-trash/config.tsindex 4590a7e6..e975aafa 100644--- a/registry/remocn-icons/icon-trash/config.ts+++ b/registry/remocn-icons/icon-trash/config.ts@@ -5,36 +5,42 @@ export const iconTrashConfig: ComponentConfig = {importPath: "@/components/remocn/icon-trash",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-trending-down/config.ts b/registry/remocn-icons/icon-trending-down/config.tsindex 7ce1ec87..5836d291 100644--- a/registry/remocn-icons/icon-trending-down/config.ts+++ b/registry/remocn-icons/icon-trending-down/config.ts@@ -5,36 +5,42 @@ export const iconTrendingDownConfig: ComponentConfig = {importPath: "@/components/remocn/icon-trending-down",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-trending-up/config.ts b/registry/remocn-icons/icon-trending-up/config.tsindex 4f9edeb6..732d741d 100644--- a/registry/remocn-icons/icon-trending-up/config.ts+++ b/registry/remocn-icons/icon-trending-up/config.ts@@ -5,36 +5,42 @@ export const iconTrendingUpConfig: ComponentConfig = {importPath: "@/components/remocn/icon-trending-up",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-trophy/config.ts b/registry/remocn-icons/icon-trophy/config.tsindex b4feda82..201fe895 100644--- a/registry/remocn-icons/icon-trophy/config.ts+++ b/registry/remocn-icons/icon-trophy/config.ts@@ -5,36 +5,42 @@ export const iconTrophyConfig: ComponentConfig = {importPath: "@/components/remocn/icon-trophy",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 85,diff --git a/registry/remocn-icons/icon-upload/config.ts b/registry/remocn-icons/icon-upload/config.tsindex 7bce51e1..02167f44 100644--- a/registry/remocn-icons/icon-upload/config.ts+++ b/registry/remocn-icons/icon-upload/config.ts@@ -5,36 +5,42 @@ export const iconUploadConfig: ComponentConfig = {importPath: "@/components/remocn/icon-upload",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-user-plus/config.ts b/registry/remocn-icons/icon-user-plus/config.tsindex 1fec0386..553e8135 100644--- a/registry/remocn-icons/icon-user-plus/config.ts+++ b/registry/remocn-icons/icon-user-plus/config.ts@@ -5,36 +5,42 @@ export const iconUserPlusConfig: ComponentConfig = {importPath: "@/components/remocn/icon-user-plus",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 75,diff --git a/registry/remocn-icons/icon-user/config.ts b/registry/remocn-icons/icon-user/config.tsindex d0310be0..605be769 100644--- a/registry/remocn-icons/icon-user/config.ts+++ b/registry/remocn-icons/icon-user/config.ts@@ -5,36 +5,42 @@ export const iconUserConfig: ComponentConfig = {importPath: "@/components/remocn/icon-user",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-users/config.ts b/registry/remocn-icons/icon-users/config.tsindex 69babff3..74659d64 100644--- a/registry/remocn-icons/icon-users/config.ts+++ b/registry/remocn-icons/icon-users/config.ts@@ -5,36 +5,42 @@ export const iconUsersConfig: ComponentConfig = {importPath: "@/components/remocn/icon-users",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn-icons/icon-video/config.ts b/registry/remocn-icons/icon-video/config.tsindex d813cb97..423098e2 100644--- a/registry/remocn-icons/icon-video/config.ts+++ b/registry/remocn-icons/icon-video/config.ts@@ -5,36 +5,42 @@ export const iconVideoConfig: ComponentConfig = {importPath: "@/components/remocn/icon-video",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-volume-2/config.ts b/registry/remocn-icons/icon-volume-2/config.tsindex b6c6cb5d..0c79f0ef 100644--- a/registry/remocn-icons/icon-volume-2/config.ts+++ b/registry/remocn-icons/icon-volume-2/config.ts@@ -5,36 +5,42 @@ export const iconVolume2Config: ComponentConfig = {importPath: "@/components/remocn/icon-volume-2",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-volume-x/config.ts b/registry/remocn-icons/icon-volume-x/config.tsindex 6d19e269..8320ba27 100644--- a/registry/remocn-icons/icon-volume-x/config.ts+++ b/registry/remocn-icons/icon-volume-x/config.ts@@ -5,36 +5,42 @@ export const iconVolumeXConfig: ComponentConfig = {importPath: "@/components/remocn/icon-volume-x",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-wallet/config.ts b/registry/remocn-icons/icon-wallet/config.tsindex 26f05057..bc89b2f1 100644--- a/registry/remocn-icons/icon-wallet/config.ts+++ b/registry/remocn-icons/icon-wallet/config.ts@@ -5,36 +5,42 @@ export const iconWalletConfig: ComponentConfig = {importPath: "@/components/remocn/icon-wallet",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-x-circle/config.ts b/registry/remocn-icons/icon-x-circle/config.tsindex dc127932..36706ed1 100644--- a/registry/remocn-icons/icon-x-circle/config.ts+++ b/registry/remocn-icons/icon-x-circle/config.ts@@ -5,36 +5,42 @@ export const iconXCircleConfig: ComponentConfig = {importPath: "@/components/remocn/icon-x-circle",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 70,diff --git a/registry/remocn-icons/icon-x/config.ts b/registry/remocn-icons/icon-x/config.tsindex ad672a3e..a5e18c25 100644--- a/registry/remocn-icons/icon-x/config.ts+++ b/registry/remocn-icons/icon-x/config.ts@@ -5,36 +5,42 @@ export const iconXConfig: ComponentConfig = {importPath: "@/components/remocn/icon-x",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-icons/icon-zap/config.ts b/registry/remocn-icons/icon-zap/config.tsindex 0c493246..f940af1f 100644--- a/registry/remocn-icons/icon-zap/config.ts+++ b/registry/remocn-icons/icon-zap/config.ts@@ -5,36 +5,42 @@ export const iconZapConfig: ComponentConfig = {importPath: "@/components/remocn/icon-zap",controls: {animation: {- type: "select",+ type: "enum",default: "both",- options: ["draw", "action", "both"],- label: "Animation",+ variants: {+ draw: {},+ action: {},+ both: {},+ },+ description: "Animation",},loop: {type: "boolean",default: false,- label: "Loop",+ description: "Loop",},size: {type: "number",- default: 48,min: 24,max: 200,step: 4,- label: "Size",+ default: 48,+ description: "Size",+ hiddenFromList: false,},color: {type: "color",default: "#171717",- label: "Color",+ description: "Color",},strokeWidth: {type: "number",- default: 2,min: 1,max: 3,step: 0.25,- label: "Stroke width",+ default: 2,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn-ui/accordion/config.ts b/registry/remocn-ui/accordion/config.tsindex 44dbf75f..e7a1ffa1 100644--- a/registry/remocn-ui/accordion/config.ts+++ b/registry/remocn-ui/accordion/config.ts@@ -5,23 +5,33 @@ export const accordionConfig: ComponentConfig = {componentName: "Accordion",importPath: "@/components/remocn/accordion",controls: {- title: { type: "text", default: "Is it accessible?", label: "Title" },+ title: {+ type: "text-content",+ default: "Is it accessible?",+ description: "Title",+ },content: {- type: "text",+ type: "text-content",default: "Yes. It adheres to the WAI-ARIA design pattern.",- label: "Content",+ description: "Content",},variant: {- type: "select",+ type: "enum",default: "default",- options: ["default", "ghost"],- label: "Variant",+ variants: {+ default: {},+ ghost: {},+ },+ description: "Variant",},state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/alert-dialog/config.ts b/registry/remocn-ui/alert-dialog/config.tsindex 339915ea..b68c7ef3 100644--- a/registry/remocn-ui/alert-dialog/config.ts+++ b/registry/remocn-ui/alert-dialog/config.ts@@ -8,19 +8,35 @@ export const alertDialogConfig: ComponentConfig = {componentName: "AlertDialog",importPath: "@/components/remocn/alert-dialog",controls: {- title: { type: "text", default: "Delete account?", label: "Title" },+ title: {+ type: "text-content",+ default: "Delete account?",+ description: "Title",+ },description: {- type: "text",- default: DEFAULT_DESCRIPTION,- label: "Description",+ type: "text-content",+ default:+ "This action cannot be undone. This will permanently remove your data from our servers.",+ description: "Description",+ },+ actionLabel: {+ type: "text-content",+ default: "Delete",+ description: "Action Label",+ },+ cancelLabel: {+ type: "text-content",+ default: "Cancel",+ description: "Cancel Label",},- actionLabel: { type: "text", default: "Delete", label: "Action Label" },- cancelLabel: { type: "text", default: "Cancel", label: "Cancel Label" },state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/blur-in/config.ts b/registry/remocn-ui/blur-in/config.tsindex 1e4cd44e..bc147eeb 100644--- a/registry/remocn-ui/blur-in/config.ts+++ b/registry/remocn-ui/blur-in/config.ts@@ -1,10 +1,4 @@-import {- type ComponentConfig,- FPS,- H,- SHARED_CONTROLS,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";import type {BlurInDirection,BlurInState,@@ -15,34 +9,52 @@ export const blurInConfig: ComponentConfig = {importPath: "@/components/remocn/blur-in",controls: {state: {- type: "select",+ type: "enum",default: "revealed",- options: ["hidden", "revealed"],- label: "State",+ variants: {+ hidden: {},+ revealed: {},+ },+ description: "State",},blur: {type: "number",- default: 8,min: 0,max: 40,step: 1,- label: "Blur",+ default: 8,+ description: "Blur",+ hiddenFromList: false,},distance: {type: "number",- default: 12,min: 0,max: 80,step: 1,- label: "Distance",+ default: 12,+ description: "Distance",+ hiddenFromList: false,},direction: {- type: "select",+ type: "enum",default: "up",- options: ["up", "down", "left", "right"],- label: "Direction",+ variants: {+ up: {},+ down: {},+ left: {},+ right: {},+ },+ description: "Direction",+ },+ speed: {+ type: "number",+ min: 0.25,+ max: 4,+ step: 0.25,+ default: 1,+ description: "",+ hiddenFromList: false,},- ...SHARED_CONTROLS,},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/button/config.ts b/registry/remocn-ui/button/config.tsindex fa5571ef..72947c09 100644--- a/registry/remocn-ui/button/config.ts+++ b/registry/remocn-ui/button/config.ts@@ -5,26 +5,50 @@ export const buttonConfig: ComponentConfig = {componentName: "Button",importPath: "@/components/remocn/button",controls: {- label: { type: "text", default: "Continue", label: "Label" },+ label: {+ type: "text-content",+ default: "Continue",+ description: "Label",+ },variant: {- type: "select",+ type: "enum",default: "default",- options: ["default", "secondary", "destructive", "outline", "ghost"],- label: "Variant",+ variants: {+ default: {},+ secondary: {},+ destructive: {},+ outline: {},+ ghost: {},+ },+ description: "Variant",},size: {- type: "select",+ type: "enum",default: "default",- options: ["sm", "default", "lg"],- label: "Size",+ variants: {+ sm: {},+ default: {},+ lg: {},+ },+ description: "Size",},state: {- type: "select",+ type: "enum",default: "loading",- options: ["idle", "hover", "press", "loading", "success"],- label: "State",+ variants: {+ idle: {},+ hover: {},+ press: {},+ loading: {},+ success: {},+ },+ description: "State",+ },+ primary: {+ type: "color",+ default: "#171717",+ description: "Primary",},- primary: { type: "color", default: "#171717", label: "Primary" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/caret/config.ts b/registry/remocn-ui/caret/config.tsindex 095e6729..f466ccf6 100644--- a/registry/remocn-ui/caret/config.ts+++ b/registry/remocn-ui/caret/config.ts@@ -6,38 +6,50 @@ export const caretConfig: ComponentConfig = {controls: {height: {type: "number",- default: 28,min: 8,max: 80,step: 2,- label: "Height",+ default: 28,+ description: "Height",+ hiddenFromList: false,},width: {type: "number",- default: 3,min: 1,max: 8,step: 1,- label: "Width",+ default: 3,+ description: "Width",+ hiddenFromList: false,},radius: {type: "number",- default: 1,min: 0,max: 8,step: 1,- label: "Radius",+ default: 1,+ description: "Radius",+ hiddenFromList: false,+ },+ blink: {+ type: "boolean",+ default: true,+ description: "Blink",},- blink: { type: "boolean", default: true, label: "Blink" },blinkPerSecond: {type: "number",- default: 1,min: 0.25,max: 4,step: 0.25,- label: "Blink/sec",+ default: 1,+ description: "Blink/sec",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#1F1E1D",+ description: "Color",},- color: { type: "color", default: "#1F1E1D", label: "Color" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/checkbox/config.ts b/registry/remocn-ui/checkbox/config.tsindex 9b31ae4c..350dbf7e 100644--- a/registry/remocn-ui/checkbox/config.ts+++ b/registry/remocn-ui/checkbox/config.ts@@ -5,20 +5,35 @@ export const checkboxConfig: ComponentConfig = {componentName: "Checkbox",importPath: "@/components/remocn/checkbox",controls: {- label: { type: "text", default: "", label: "Label" },+ label: {+ type: "text-content",+ default: "",+ description: "Label",+ },size: {- type: "select",+ type: "enum",default: "default",- options: ["sm", "default", "lg"],- label: "Size",+ variants: {+ sm: {},+ default: {},+ lg: {},+ },+ description: "Size",},state: {- type: "select",+ type: "enum",default: "checked",- options: ["unchecked", "checked"],- label: "State",+ variants: {+ unchecked: {},+ checked: {},+ },+ description: "State",+ },+ primary: {+ type: "color",+ default: "#171717",+ description: "Primary",},- primary: { type: "color", default: "#171717", label: "Primary" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/combobox/config.ts b/registry/remocn-ui/combobox/config.tsindex 3c17111a..c20a5d03 100644--- a/registry/remocn-ui/combobox/config.ts+++ b/registry/remocn-ui/combobox/config.ts@@ -9,40 +9,50 @@ export const comboboxConfig: ComponentConfig = {importPath: "@/components/remocn/combobox",controls: {state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",+ },+ query: {+ type: "text-content",+ default: "",+ description: "Query",},- query: { type: "text", default: DEFAULT_QUERY, label: "Query" },revealCount: {type: "number",- default: 0,min: 0,max: 20,step: 1,- label: "Reveal Count",+ default: 0,+ description: "Reveal Count",+ hiddenFromList: false,},placeholder: {- type: "text",- default: DEFAULT_PLACEHOLDER,- label: "Placeholder",+ type: "text-content",+ default: "Select a fruit…",+ description: "Placeholder",},selectedIndex: {type: "number",- default: -1,min: -1,max: 5,step: 1,- label: "Selected Index",+ default: -1,+ description: "Selected Index",+ hiddenFromList: false,},highlightedIndex: {type: "number",- default: 0,min: -1,max: 5,step: 1,- label: "Highlighted Index",+ default: 0,+ description: "Highlighted Index",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/command-menu-item/config.ts b/registry/remocn-ui/command-menu-item/config.tsindex 4bfc44c6..cd550f00 100644--- a/registry/remocn-ui/command-menu-item/config.ts+++ b/registry/remocn-ui/command-menu-item/config.ts@@ -5,19 +5,37 @@ export const commandMenuItemConfig: ComponentConfig = {componentName: "CommandMenuItem",importPath: "@/components/remocn/command-menu-item",controls: {- label: { type: "text", default: "Settings", label: "Label" },+ label: {+ type: "text-content",+ default: "Settings",+ description: "Label",+ },icon: {- type: "select",+ type: "enum",default: "settings",- options: ["search", "settings", "user", "file"],- label: "Icon",+ variants: {+ search: {},+ settings: {},+ user: {},+ file: {},+ },+ description: "Icon",+ },+ shortcut: {+ type: "text-content",+ default: "⌘ S",+ description: "Shortcut",},- shortcut: { type: "text", default: "⌘ S", label: "Shortcut" },state: {- type: "select",+ type: "enum",default: "selected",- options: ["idle", "hover", "press", "selected"],- label: "State",+ variants: {+ idle: {},+ hover: {},+ press: {},+ selected: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/command-menu/config.ts b/registry/remocn-ui/command-menu/config.tsindex 1b954769..cadbeedb 100644--- a/registry/remocn-ui/command-menu/config.ts+++ b/registry/remocn-ui/command-menu/config.ts@@ -8,35 +8,45 @@ export const commandMenuConfig: ComponentConfig = {importPath: "@/components/remocn/command-menu",controls: {state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",+ },+ query: {+ type: "text-content",+ default: "",+ description: "Query",},- query: { type: "text", default: DEFAULT_QUERY, label: "Query" },revealCount: {type: "number",- default: 0,min: 0,max: 20,step: 1,- label: "Reveal Count",+ default: 0,+ description: "Reveal Count",+ hiddenFromList: false,},selectedIndex: {type: "number",- default: -1,min: -1,max: 5,step: 1,- label: "Selected Index",+ default: -1,+ description: "Selected Index",+ hiddenFromList: false,},highlightedIndex: {type: "number",- default: 0,min: -1,max: 5,step: 1,- label: "Highlighted Index",+ default: 0,+ description: "Highlighted Index",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/context-menu/config.ts b/registry/remocn-ui/context-menu/config.tsindex 12fd23a3..7bce55eb 100644--- a/registry/remocn-ui/context-menu/config.ts+++ b/registry/remocn-ui/context-menu/config.ts@@ -8,18 +8,22 @@ export const contextMenuConfig: ComponentConfig = {importPath: "@/components/remocn/context-menu",controls: {state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},highlightedIndex: {type: "number",- default: 1,min: -1,max: 5,step: 1,- label: "Highlighted Index",+ default: 1,+ description: "Highlighted Index",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/cursor/config.ts b/registry/remocn-ui/cursor/config.tsindex 8c9614ad..892b6da9 100644--- a/registry/remocn-ui/cursor/config.ts+++ b/registry/remocn-ui/cursor/config.ts@@ -5,20 +5,28 @@ export const cursorConfig: ComponentConfig = {importPath: "@/components/remocn/cursor",controls: {variant: {- type: "select",+ type: "enum",default: "arrow",- options: ["arrow", "pointer"],- label: "Variant",+ variants: {+ arrow: {},+ pointer: {},+ },+ description: "Variant",},size: {type: "number",- default: 28,min: 16,max: 64,step: 2,- label: "Size",+ default: 28,+ description: "Size",+ hiddenFromList: false,+ },+ rippleColor: {+ type: "color",+ default: "#171717",+ description: "Ripple",},- rippleColor: { type: "color", default: "#171717", label: "Ripple" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/dialog/config.ts b/registry/remocn-ui/dialog/config.tsindex 281e0172..44a3e827 100644--- a/registry/remocn-ui/dialog/config.ts+++ b/registry/remocn-ui/dialog/config.ts@@ -8,23 +8,35 @@ export const dialogConfig: ComponentConfig = {componentName: "Dialog",importPath: "@/components/remocn/dialog",controls: {- title: { type: "text", default: "Edit profile", label: "Title" },+ title: {+ type: "text-content",+ default: "Edit profile",+ description: "Title",+ },description: {- type: "text",- default: DEFAULT_DESCRIPTION,- label: "Description",+ type: "text-content",+ default:+ "Make changes to your profile here. Click save when you're done.",+ description: "Description",},actionLabel: {- type: "text",+ type: "text-content",default: "Save changes",- label: "Action Label",+ description: "Action Label",+ },+ cancelLabel: {+ type: "text-content",+ default: "Cancel",+ description: "Cancel Label",},- cancelLabel: { type: "text", default: "Cancel", label: "Cancel Label" },state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/drawer/config.ts b/registry/remocn-ui/drawer/config.tsindex 2e24099f..02a3f7af 100644--- a/registry/remocn-ui/drawer/config.ts+++ b/registry/remocn-ui/drawer/config.ts@@ -8,23 +8,35 @@ export const drawerConfig: ComponentConfig = {componentName: "Drawer",importPath: "@/components/remocn/drawer",controls: {- title: { type: "text", default: "Edit profile", label: "Title" },+ title: {+ type: "text-content",+ default: "Edit profile",+ description: "Title",+ },description: {- type: "text",- default: DEFAULT_DESCRIPTION,- label: "Description",+ type: "text-content",+ default:+ "Make changes to your profile here. Click save when you're done.",+ description: "Description",},actionLabel: {- type: "text",+ type: "text-content",default: "Save changes",- label: "Action Label",+ description: "Action Label",+ },+ cancelLabel: {+ type: "text-content",+ default: "Cancel",+ description: "Cancel Label",},- cancelLabel: { type: "text", default: "Cancel", label: "Cancel Label" },state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/dropdown-menu-item/config.ts b/registry/remocn-ui/dropdown-menu-item/config.tsindex 5b69a217..fda76222 100644--- a/registry/remocn-ui/dropdown-menu-item/config.ts+++ b/registry/remocn-ui/dropdown-menu-item/config.ts@@ -5,12 +5,20 @@ export const dropdownMenuItemConfig: ComponentConfig = {componentName: "DropdownMenuItem",importPath: "@/components/remocn/dropdown-menu-item",controls: {- label: { type: "text", default: "Profile", label: "Label" },+ label: {+ type: "text-content",+ default: "Profile",+ description: "Label",+ },state: {- type: "select",+ type: "enum",default: "hover",- options: ["idle", "hover", "press"],- label: "State",+ variants: {+ idle: {},+ hover: {},+ press: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/dropdown-menu/config.ts b/registry/remocn-ui/dropdown-menu/config.tsindex bf658f1a..e3068dd2 100644--- a/registry/remocn-ui/dropdown-menu/config.ts+++ b/registry/remocn-ui/dropdown-menu/config.ts@@ -5,20 +5,28 @@ export const dropdownMenuConfig: ComponentConfig = {componentName: "DropdownMenu",importPath: "@/components/remocn/dropdown-menu",controls: {- label: { type: "text", default: "Options", label: "Label" },+ label: {+ type: "text-content",+ default: "Options",+ description: "Label",+ },state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},highlightedIndex: {type: "number",- default: 0,min: -1,max: 3,step: 1,- label: "Highlighted Index",+ default: 0,+ description: "Highlighted Index",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/input/config.ts b/registry/remocn-ui/input/config.tsindex 52ba085e..bfc5763b 100644--- a/registry/remocn-ui/input/config.ts+++ b/registry/remocn-ui/input/config.ts@@ -6,24 +6,43 @@ export const inputConfig: ComponentConfig = {importPath: "@/components/remocn/input",controls: {placeholder: {- type: "text",+ type: "text-content",default: "[email protected]",- label: "Placeholder",+ description: "Placeholder",+ },+ value: {+ type: "text-content",+ default: "[email protected]",+ description: "Value",},- value: { type: "text", default: "[email protected]", label: "Value" },size: {- type: "select",+ type: "enum",default: "default",- options: ["sm", "default", "lg"],- label: "Size",+ variants: {+ sm: {},+ default: {},+ lg: {},+ },+ description: "Size",},state: {- type: "select",+ type: "enum",default: "typing",- options: ["idle", "hover", "active", "typing", "blur", "invalid"],- label: "State",+ variants: {+ idle: {},+ hover: {},+ active: {},+ typing: {},+ blur: {},+ invalid: {},+ },+ description: "State",+ },+ primary: {+ type: "color",+ default: "#171717",+ description: "Primary",},- primary: { type: "color", default: "#171717", label: "Primary" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/message-bubble/config.ts b/registry/remocn-ui/message-bubble/config.tsindex 53b1c076..af5d7e4f 100644--- a/registry/remocn-ui/message-bubble/config.ts+++ b/registry/remocn-ui/message-bubble/config.ts@@ -5,25 +5,39 @@ import type {} from "@/registry/remocn-ui/message-bubble";const DEFAULT_TEXT = "Yep, pushing it live now";-const DEFAULT_REACTION = "🔥";+const _DEFAULT_REACTION = "🔥";export const messageBubbleConfig: ComponentConfig = {componentName: "MessageBubble",importPath: "@/components/remocn/message-bubble",controls: {- text: { type: "text", default: DEFAULT_TEXT, label: "Text" },+ text: {+ type: "text-content",+ default: "Yep, pushing it live now",+ description: "Text",+ },variant: {- type: "select",+ type: "enum",default: "incoming",- options: ["incoming", "outgoing"],- label: "Variant",+ variants: {+ incoming: {},+ outgoing: {},+ },+ description: "Variant",+ },+ reaction: {+ type: "text-content",+ default: "🔥",+ description: "Reaction",},- reaction: { type: "text", default: DEFAULT_REACTION, label: "Reaction" },state: {- type: "select",+ type: "enum",default: "visible",- options: ["hidden", "visible"],- label: "State",+ variants: {+ hidden: {},+ visible: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/popover/config.ts b/registry/remocn-ui/popover/config.tsindex 5d7ff77d..acf6f849 100644--- a/registry/remocn-ui/popover/config.ts+++ b/registry/remocn-ui/popover/config.ts@@ -1,38 +1,51 @@import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";import type { PopoverState } from "@/registry/remocn-ui/popover";-const DEFAULT_TITLE = "Dimensions";-const DEFAULT_DESCRIPTION = "Set the dimensions for the layer.";+const _DEFAULT_TITLE = "Dimensions";+const _DEFAULT_DESCRIPTION = "Set the dimensions for the layer.";export const popoverConfig: ComponentConfig = {componentName: "Popover",importPath: "@/components/remocn/popover",controls: {- title: { type: "text", default: DEFAULT_TITLE, label: "Title" },+ title: {+ type: "text-content",+ default: "Dimensions",+ description: "Title",+ },description: {- type: "text",- default: DEFAULT_DESCRIPTION,- label: "Description",+ type: "text-content",+ default: "Set the dimensions for the layer.",+ description: "Description",},side: {- type: "select",+ type: "enum",default: "bottom",- options: ["top", "bottom", "left", "right"],- label: "Side",+ variants: {+ top: {},+ bottom: {},+ left: {},+ right: {},+ },+ description: "Side",},width: {type: "number",- default: 288,min: 160,max: 480,step: 8,- label: "Width",+ default: 288,+ description: "Width",+ hiddenFromList: false,},state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/progress/config.ts b/registry/remocn-ui/progress/config.tsindex d421227b..79839325 100644--- a/registry/remocn-ui/progress/config.ts+++ b/registry/remocn-ui/progress/config.ts@@ -6,21 +6,27 @@ export const progressConfig: ComponentConfig = {controls: {value: {type: "number",- default: 62,min: 0,max: 100,step: 1,- label: "Value",+ default: 62,+ description: "Value",+ hiddenFromList: false,},width: {type: "number",- default: 320,min: 120,max: 640,step: 20,- label: "Width",+ default: 320,+ description: "Width",+ hiddenFromList: false,+ },+ showLabel: {+ type: "boolean",+ default: true,+ description: "Show Label",},- showLabel: { type: "boolean", default: true, label: "Show Label" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/radio/config.ts b/registry/remocn-ui/radio/config.tsindex c2d3ffe8..7f374ddc 100644--- a/registry/remocn-ui/radio/config.ts+++ b/registry/remocn-ui/radio/config.ts@@ -5,20 +5,35 @@ export const radioConfig: ComponentConfig = {componentName: "Radio",importPath: "@/components/remocn/radio",controls: {- label: { type: "text", default: "", label: "Label" },+ label: {+ type: "text-content",+ default: "",+ description: "Label",+ },size: {- type: "select",+ type: "enum",default: "default",- options: ["sm", "default", "lg"],- label: "Size",+ variants: {+ sm: {},+ default: {},+ lg: {},+ },+ description: "Size",},state: {- type: "select",+ type: "enum",default: "checked",- options: ["unchecked", "checked"],- label: "State",+ variants: {+ unchecked: {},+ checked: {},+ },+ description: "State",+ },+ primary: {+ type: "color",+ default: "#171717",+ description: "Primary",},- primary: { type: "color", default: "#171717", label: "Primary" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/resizable/config.ts b/registry/remocn-ui/resizable/config.tsindex 0ba804a5..f6b331b3 100644--- a/registry/remocn-ui/resizable/config.ts+++ b/registry/remocn-ui/resizable/config.ts@@ -10,23 +10,31 @@ export const resizableConfig: ComponentConfig = {controls: {ratio: {type: "number",- default: 0.5,min: 0,max: 1,step: 0.05,- label: "Ratio",+ default: 0.5,+ description: "Ratio",+ hiddenFromList: false,},handleState: {- type: "select",+ type: "enum",default: "idle",- options: ["idle", "hover", "press"],- label: "Handle State",+ variants: {+ idle: {},+ hover: {},+ press: {},+ },+ description: "Handle State",},direction: {- type: "select",+ type: "enum",default: "horizontal",- options: ["horizontal", "vertical"],- label: "Direction",+ variants: {+ horizontal: {},+ vertical: {},+ },+ description: "Direction",},},durationInFrames: 120,diff --git a/registry/remocn-ui/select-item/config.ts b/registry/remocn-ui/select-item/config.tsindex 4c6a3759..34a9c4d4 100644--- a/registry/remocn-ui/select-item/config.ts+++ b/registry/remocn-ui/select-item/config.ts@@ -5,12 +5,21 @@ export const selectItemConfig: ComponentConfig = {componentName: "SelectItem",importPath: "@/components/remocn/select-item",controls: {- label: { type: "text", default: "Banana", label: "Label" },+ label: {+ type: "text-content",+ default: "Banana",+ description: "Label",+ },state: {- type: "select",+ type: "enum",default: "selected",- options: ["idle", "hover", "press", "selected"],- label: "State",+ variants: {+ idle: {},+ hover: {},+ press: {},+ selected: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/select/config.ts b/registry/remocn-ui/select/config.tsindex ee7da8c9..3ae070a9 100644--- a/registry/remocn-ui/select/config.ts+++ b/registry/remocn-ui/select/config.ts@@ -5,28 +5,37 @@ export const selectConfig: ComponentConfig = {componentName: "Select",importPath: "@/components/remocn/select",controls: {- label: { type: "text", default: "Select a fruit", label: "Label" },+ label: {+ type: "text-content",+ default: "Select a fruit",+ description: "Label",+ },state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},selectedIndex: {type: "number",- default: 1,min: -1,max: 3,step: 1,- label: "Selected Index",+ default: 1,+ description: "Selected Index",+ hiddenFromList: false,},highlightedIndex: {type: "number",- default: -1,min: -1,max: 3,step: 1,- label: "Highlighted Index",+ default: -1,+ description: "Highlighted Index",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/sheet/config.ts b/registry/remocn-ui/sheet/config.tsindex 2e3947aa..36cc6ce0 100644--- a/registry/remocn-ui/sheet/config.ts+++ b/registry/remocn-ui/sheet/config.ts@@ -8,23 +8,35 @@ export const sheetConfig: ComponentConfig = {componentName: "Sheet",importPath: "@/components/remocn/sheet",controls: {- title: { type: "text", default: "Edit profile", label: "Title" },+ title: {+ type: "text-content",+ default: "Edit profile",+ description: "Title",+ },description: {- type: "text",- default: DEFAULT_DESCRIPTION,- label: "Description",+ type: "text-content",+ default:+ "Make changes to your profile here. Click save when you're done.",+ description: "Description",},actionLabel: {- type: "text",+ type: "text-content",default: "Save changes",- label: "Action Label",+ description: "Action Label",+ },+ cancelLabel: {+ type: "text-content",+ default: "Cancel",+ description: "Cancel Label",},- cancelLabel: { type: "text", default: "Cancel", label: "Cancel Label" },state: {- type: "select",+ type: "enum",default: "opened",- options: ["opened", "closed"],- label: "State",+ variants: {+ opened: {},+ closed: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/skeleton-block/config.ts b/registry/remocn-ui/skeleton-block/config.tsindex ee420f5d..b92d85ce 100644--- a/registry/remocn-ui/skeleton-block/config.ts+++ b/registry/remocn-ui/skeleton-block/config.ts@@ -6,27 +6,30 @@ export const skeletonBlockConfig: ComponentConfig = {controls: {width: {type: "number",- default: 240,min: 40,max: 600,step: 10,- label: "Width",+ default: 240,+ description: "Width",+ hiddenFromList: false,},height: {type: "number",- default: 20,min: 8,max: 120,step: 2,- label: "Height",+ default: 20,+ description: "Height",+ hiddenFromList: false,},radius: {type: "number",- default: 6,min: 0,max: 60,step: 1,- label: "Radius",+ default: 6,+ description: "Radius",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/skeleton/config.ts b/registry/remocn-ui/skeleton/config.tsindex 058f3dce..91039770 100644--- a/registry/remocn-ui/skeleton/config.ts+++ b/registry/remocn-ui/skeleton/config.ts@@ -6,16 +6,22 @@ export const skeletonConfig: ComponentConfig = {importPath: "@/components/remocn/skeleton",controls: {layout: {- type: "select",+ type: "enum",default: "card",- options: ["lines", "card"],- label: "Layout",+ variants: {+ lines: {},+ card: {},+ },+ description: "Layout",},state: {- type: "select",+ type: "enum",default: "loading",- options: ["loading", "loaded"],- label: "State",+ variants: {+ loading: {},+ loaded: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/slider/config.ts b/registry/remocn-ui/slider/config.tsindex f0aeb97d..ffa689a4 100644--- a/registry/remocn-ui/slider/config.ts+++ b/registry/remocn-ui/slider/config.ts@@ -7,27 +7,37 @@ export const sliderConfig: ComponentConfig = {controls: {value: {type: "number",- default: 40,min: 0,max: 100,step: 1,- label: "Value",+ default: 40,+ description: "Value",+ hiddenFromList: false,},thumbState: {- type: "select",+ type: "enum",default: "idle",- options: ["idle", "hover", "press"],- label: "Thumb State",+ variants: {+ idle: {},+ hover: {},+ press: {},+ },+ description: "Thumb State",},width: {type: "number",- default: 320,min: 120,max: 640,step: 20,- label: "Width",+ default: 320,+ description: "Width",+ hiddenFromList: false,+ },+ showValue: {+ type: "boolean",+ default: true,+ description: "Show Value",},- showValue: { type: "boolean", default: true, label: "Show Value" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/spinner/config.ts b/registry/remocn-ui/spinner/config.tsindex 55ab0669..e2ff337b 100644--- a/registry/remocn-ui/spinner/config.ts+++ b/registry/remocn-ui/spinner/config.ts@@ -6,19 +6,21 @@ export const spinnerConfig: ComponentConfig = {controls: {size: {type: "number",- default: 20,min: 8,max: 64,step: 2,- label: "Size",+ default: 20,+ description: "Size",+ hiddenFromList: false,},strokeWidth: {type: "number",- default: 2.5,min: 1,max: 6,step: 0.5,- label: "Stroke width",+ default: 2.5,+ description: "Stroke width",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/stepper/config.ts b/registry/remocn-ui/stepper/config.tsindex 18deaa9e..fcc66bb7 100644--- a/registry/remocn-ui/stepper/config.ts+++ b/registry/remocn-ui/stepper/config.ts@@ -8,11 +8,12 @@ export const stepperConfig: ComponentConfig = {controls: {activeIndex: {type: "number",- default: 1,min: 0,max: 2,step: 1,- label: "Active Index",+ default: 1,+ description: "Active Index",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn-ui/switch/config.ts b/registry/remocn-ui/switch/config.tsindex a189713b..db0bf4be 100644--- a/registry/remocn-ui/switch/config.ts+++ b/registry/remocn-ui/switch/config.ts@@ -5,20 +5,35 @@ export const switchConfig: ComponentConfig = {componentName: "Switch",importPath: "@/components/remocn/switch",controls: {- label: { type: "text", default: "", label: "Label" },+ label: {+ type: "text-content",+ default: "",+ description: "Label",+ },size: {- type: "select",+ type: "enum",default: "default",- options: ["sm", "default", "lg"],- label: "Size",+ variants: {+ sm: {},+ default: {},+ lg: {},+ },+ description: "Size",},state: {- type: "select",+ type: "enum",default: "checked",- options: ["unchecked", "checked"],- label: "State",+ variants: {+ unchecked: {},+ checked: {},+ },+ description: "State",+ },+ primary: {+ type: "color",+ default: "#171717",+ description: "Primary",},- primary: { type: "color", default: "#171717", label: "Primary" },},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn-ui/tabs/config.ts b/registry/remocn-ui/tabs/config.tsindex ebf73a71..75585ce0 100644--- a/registry/remocn-ui/tabs/config.ts+++ b/registry/remocn-ui/tabs/config.ts@@ -6,16 +6,23 @@ export const tabsConfig: ComponentConfig = {importPath: "@/components/remocn/tabs",controls: {state: {- type: "select",+ type: "enum",default: "Account",- options: ["Account", "Password", "Settings"],- label: "State",+ variants: {+ Account: {},+ Password: {},+ Settings: {},+ },+ description: "State",},variant: {- type: "select",+ type: "enum",default: "pill",- options: ["pill", "underline"],- label: "Variant",+ variants: {+ pill: {},+ underline: {},+ },+ description: "Variant",},},durationInFrames: 120,diff --git a/registry/remocn-ui/toast/config.ts b/registry/remocn-ui/toast/config.tsindex 67cb58eb..ac93c02a 100644--- a/registry/remocn-ui/toast/config.ts+++ b/registry/remocn-ui/toast/config.ts@@ -8,23 +8,34 @@ export const toastConfig: ComponentConfig = {componentName: "Toast",importPath: "@/components/remocn/toast",controls: {- title: { type: "text", default: DEFAULT_TITLE, label: "Title" },+ title: {+ type: "text-content",+ default: "Changes saved",+ description: "Title",+ },description: {- type: "text",- default: DEFAULT_DESCRIPTION,- label: "Description",+ type: "text-content",+ default: "Your profile has been updated.",+ description: "Description",},variant: {- type: "select",+ type: "enum",default: "success",- options: ["default", "success", "error"],- label: "Variant",+ variants: {+ default: {},+ success: {},+ error: {},+ },+ description: "Variant",},state: {- type: "select",+ type: "enum",default: "visible",- options: ["hidden", "visible"],- label: "State",+ variants: {+ hidden: {},+ visible: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/toggle-group/config.ts b/registry/remocn-ui/toggle-group/config.tsindex d111470c..1af6817a 100644--- a/registry/remocn-ui/toggle-group/config.ts+++ b/registry/remocn-ui/toggle-group/config.ts@@ -6,16 +6,22 @@ export const toggleGroupConfig: ComponentConfig = {importPath: "@/components/remocn/toggle-group",controls: {state: {- type: "select",+ type: "enum",default: "Monthly",- options: ["Monthly", "Yearly"],- label: "State",+ variants: {+ Monthly: {},+ Yearly: {},+ },+ description: "State",},size: {- type: "select",+ type: "enum",default: "default",- options: ["default", "sm"],- label: "Size",+ variants: {+ default: {},+ sm: {},+ },+ description: "Size",},},durationInFrames: 120,diff --git a/registry/remocn-ui/tooltip/config.ts b/registry/remocn-ui/tooltip/config.tsindex 7f450e14..45c9d7f5 100644--- a/registry/remocn-ui/tooltip/config.ts+++ b/registry/remocn-ui/tooltip/config.ts@@ -7,18 +7,30 @@ export const tooltipConfig: ComponentConfig = {componentName: "Tooltip",importPath: "@/components/remocn/tooltip",controls: {- label: { type: "text", default: DEFAULT_LABEL, label: "Label" },+ label: {+ type: "text-content",+ default: "Add to library",+ description: "Label",+ },side: {- type: "select",+ type: "enum",default: "top",- options: ["top", "bottom", "left", "right"],- label: "Side",+ variants: {+ top: {},+ bottom: {},+ left: {},+ right: {},+ },+ description: "Side",},state: {- type: "select",+ type: "enum",default: "visible",- options: ["hidden", "visible"],- label: "State",+ variants: {+ hidden: {},+ visible: {},+ },+ description: "State",},},durationInFrames: 120,diff --git a/registry/remocn-ui/typing-indicator/config.ts b/registry/remocn-ui/typing-indicator/config.tsindex f6673659..9858bffe 100644--- a/registry/remocn-ui/typing-indicator/config.ts+++ b/registry/remocn-ui/typing-indicator/config.ts@@ -6,27 +6,30 @@ export const typingIndicatorConfig: ComponentConfig = {controls: {dotCount: {type: "number",- default: 3,min: 2,max: 5,step: 1,- label: "Dots",+ default: 3,+ description: "Dots",+ hiddenFromList: false,},size: {type: "number",- default: 8,min: 4,max: 16,step: 1,- label: "Dot size",+ default: 8,+ description: "Dot size",+ hiddenFromList: false,},amplitude: {type: "number",- default: 5,min: 0,max: 14,step: 1,- label: "Bounce",+ default: 5,+ description: "Bounce",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/animated-bar-chart/config.ts b/registry/remocn/animated-bar-chart/config.tsindex dd7e3e62..f4bc7c06 100644--- a/registry/remocn/animated-bar-chart/config.ts+++ b/registry/remocn/animated-bar-chart/config.ts@@ -4,22 +4,28 @@ export const animatedBarChartConfig: ComponentConfig = {componentName: "AnimatedBarChart",importPath: "@/components/remocn/animated-bar-chart",controls: {- barColor: { type: "color", default: "#0ea5e9", label: "Bar color" },+ barColor: {+ type: "color",+ default: "#0ea5e9",+ description: "Bar color",+ },gap: {type: "number",- default: 16,min: 0,max: 80,step: 2,- label: "Gap",+ default: 16,+ description: "Gap",+ hiddenFromList: false,},staggerFrames: {type: "number",- default: 6,min: 0,max: 30,step: 1,- label: "Stagger frames",+ default: 6,+ description: "Stagger frames",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/animated-line-chart/config.ts b/registry/remocn/animated-line-chart/config.tsindex 8fa6c8bb..68298b3e 100644--- a/registry/remocn/animated-line-chart/config.ts+++ b/registry/remocn/animated-line-chart/config.ts@@ -4,17 +4,30 @@ export const animatedLineChartConfig: ComponentConfig = {componentName: "AnimatedLineChart",importPath: "@/components/remocn/animated-line-chart",controls: {- strokeColor: { type: "color", default: "#22c55e", label: "Stroke color" },+ strokeColor: {+ type: "color",+ default: "#22c55e",+ description: "Stroke color",+ },strokeWidth: {type: "number",- default: 4,min: 1,max: 16,step: 1,- label: "Stroke width",+ default: 4,+ description: "Stroke width",+ hiddenFromList: false,+ },+ gridColor: {+ type: "color",+ default: "#27272a",+ description: "Grid color",+ },+ showDot: {+ type: "boolean",+ default: true,+ description: "Show leading dot",},- gridColor: { type: "color", default: "#27272a", label: "Grid color" },- showDot: { type: "boolean", default: true, label: "Show leading dot" },},durationInFrames: 90,fps: FPS,diff --git a/registry/remocn/ascii-dissolve/config.ts b/registry/remocn/ascii-dissolve/config.tsindex 4bbd26c7..a58da4d2 100644--- a/registry/remocn/ascii-dissolve/config.ts+++ b/registry/remocn/ascii-dissolve/config.ts@@ -5,15 +5,24 @@ export const asciiDissolveConfig: ComponentConfig = {componentName: "asciiDissolve",importPath: "@/components/remocn/ascii-dissolve",controls: {- colorBack: { type: "color", default: "#0d0d10", label: "Background" },- colorFront: { type: "color", default: "#f2f2f2", label: "Glyphs" },+ colorBack: {+ type: "color",+ default: "#0d0d10",+ description: "Background",+ },+ colorFront: {+ type: "color",+ default: "#f2f2f2",+ description: "Glyphs",+ },cellSize: {type: "number",- default: 22,min: 10,max: 36,step: 2,- label: "Cell size",+ default: 22,+ description: "Cell size",+ hiddenFromList: false,},},durationInFrames: 100,diff --git a/registry/remocn/ascii-render/config.ts b/registry/remocn/ascii-render/config.tsindex c54e617b..af88a47f 100644--- a/registry/remocn/ascii-render/config.ts+++ b/registry/remocn/ascii-render/config.ts@@ -7,34 +7,36 @@ export const asciiRenderConfig: ComponentConfig = {controls: {glyphSize: {type: "number",- default: 26,min: 10,max: 64,step: 2,- label: "Glyph size",+ default: 26,+ description: "Glyph size",+ hiddenFromList: false,},charset: {- type: "text",+ type: "text-content",default: " .:-=+*#%@",- label: "Charset",+ description: "Charset",},colored: {type: "boolean",default: false,- label: "Source colour",+ description: "Source colour",},ink: {type: "color",default: "#9dff9d",- label: "Ink",+ description: "Ink",},intensity: {type: "number",- default: 1,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/backdrop/config.ts b/registry/remocn/backdrop/config.tsindex 2c4baf55..8985b29c 100644--- a/registry/remocn/backdrop/config.ts+++ b/registry/remocn/backdrop/config.ts@@ -5,42 +5,52 @@ export const backdropConfig: ComponentConfig = {importPath: "@/components/remocn/backdrop",controls: {fillType: {- type: "select",+ type: "enum",default: "gradient",- options: ["color", "gradient", "image"],- label: "Fill type",+ variants: {+ color: {},+ gradient: {},+ image: {},+ },+ description: "Fill type",+ },+ color: {+ type: "color",+ default: "#6366f1",+ description: "Color",},- color: { type: "color", default: "#6366f1", label: "Color" },gradient: {- type: "text",+ type: "text-content",default: "linear-gradient(135deg, #6366f1 0%, #a855f7 100%)",- label: "Gradient (CSS)",+ description: "Gradient (CSS)",},image: {- type: "text",+ type: "text-content",default: "/hero.png",- label: "Image URL",+ description: "Image URL",},padding: {type: "number",- default: 4,min: 0,max: 12,step: 0.5,- label: "Padding",+ default: 4,+ description: "Padding",+ hiddenFromList: false,},radius: {type: "number",- default: 1,min: 0,max: 4,step: 0.25,- label: "Radius",+ default: 1,+ description: "Radius",+ hiddenFromList: false,},shadow: {- type: "text",+ type: "text-content",default: "0 20px 60px rgba(0,0,0,0.4)",- label: "Shadow",+ description: "Shadow",},},durationInFrames: 150,diff --git a/registry/remocn/blur-out-up/config.ts b/registry/remocn/blur-out-up/config.tsindex 1570d0be..8658b5f0 100644--- a/registry/remocn/blur-out-up/config.ts+++ b/registry/remocn/blur-out-up/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const blurOutUpConfig: ComponentConfig = {componentName: "BlurOutUp",importPath: "@/components/remocn/blur-out-up",controls: {- text: { type: "text", default: "Clear in, airy out.", label: "Text" },+ text: {+ type: "text-content",+ default: "Clear in, airy out.",+ description: "Text",+ },staggerDelay: {type: "number",- default: 1,min: 0,max: 8,step: 1,- label: "Stagger",+ default: 1,+ description: "Stagger",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/bottom-up-letters/config.ts b/registry/remocn/bottom-up-letters/config.tsindex 6257a136..7e7b843f 100644--- a/registry/remocn/bottom-up-letters/config.ts+++ b/registry/remocn/bottom-up-letters/config.ts@@ -1,46 +1,56 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const bottomUpLettersConfig: ComponentConfig = {componentName: "BottomUpLetters",importPath: "@/components/remocn/bottom-up-letters",controls: {- text: { type: "text", default: "Shift", label: "Text" },+ text: {+ type: "text-content",+ default: "Shift",+ description: "Text",+ },staggerDelay: {type: "number",- default: 3,min: 1,max: 12,step: 1,- label: "Stagger",+ default: 3,+ description: "Stagger",+ hiddenFromList: false,},distance: {type: "number",- default: 46,min: 0,max: 120,step: 1,- label: "Distance",+ default: 46,+ description: "Distance",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/camera-lens/config.ts b/registry/remocn/camera-lens/config.tsindex 16c1ae45..865faac7 100644--- a/registry/remocn/camera-lens/config.ts+++ b/registry/remocn/camera-lens/config.ts@@ -7,43 +7,48 @@ export const cameraLensConfig: ComponentConfig = {controls: {softness: {type: "number",- default: 0.5,min: 0,max: 2,step: 0.05,- label: "Corner softness",+ default: 0.5,+ description: "Corner softness",+ hiddenFromList: false,},bloom: {type: "number",- default: 0.5,min: 0,max: 2,step: 0.05,- label: "Bloom",+ default: 0.5,+ description: "Bloom",+ hiddenFromList: false,},aberration: {type: "number",- default: 0.5,min: 0,max: 3,step: 0.1,- label: "Aberration",+ default: 0.5,+ description: "Aberration",+ hiddenFromList: false,},vignette: {type: "number",- default: 0.5,min: 0,max: 1.5,step: 0.05,- label: "Vignette",+ default: 0.5,+ description: "Vignette",+ hiddenFromList: false,},distortion: {type: "number",- default: 0.05,min: 0,max: 0.6,step: 0.01,- label: "Distortion",+ default: 0.05,+ description: "Distortion",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/caret-wipe/config.ts b/registry/remocn/caret-wipe/config.tsindex 3e929379..d2c1fb21 100644--- a/registry/remocn/caret-wipe/config.ts+++ b/registry/remocn/caret-wipe/config.ts@@ -6,19 +6,27 @@ export const caretWipeConfig: ComponentConfig = {importPath: "@/components/remocn/caret-wipe",controls: {direction: {- type: "select",+ type: "enum",default: "right",- options: ["left", "right"],- label: "Direction",+ variants: {+ left: {},+ right: {},+ },+ description: "Direction",+ },+ caretColor: {+ type: "color",+ default: "#C3E88D",+ description: "Caret",},- caretColor: { type: "color", default: "#C3E88D", label: "Caret" },caretWidth: {type: "number",- default: 3,min: 1,max: 8,step: 1,- label: "Caret width",+ default: 3,+ description: "Caret width",+ hiddenFromList: false,},},durationInFrames: 100,diff --git a/registry/remocn/chat-gpt/config.ts b/registry/remocn/chat-gpt/config.tsindex 1352e1ba..cf8e7ac9 100644--- a/registry/remocn/chat-gpt/config.ts+++ b/registry/remocn/chat-gpt/config.ts@@ -5,21 +5,25 @@ export const chatGptConfig: ComponentConfig = {importPath: "@/components/remocn/chat-gpt",controls: {greeting: {- type: "text",+ type: "text-content",default: "What's on your mind today?",- label: "Greeting",+ description: "Greeting",},placeholder: {- type: "text",+ type: "text-content",default: "Ask anything",- label: "Placeholder",+ description: "Placeholder",},prompt: {- type: "text",+ type: "text-content",default: "Make a sunset over a calm ocean",- label: "Prompt",+ description: "Prompt",+ },+ accentColor: {+ type: "color",+ default: "#2F6FED",+ description: "Accent",},- accentColor: { type: "color", default: "#2F6FED", label: "Accent" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/chat-to-preview-layout/config.ts b/registry/remocn/chat-to-preview-layout/config.tsindex 8d3cb9c1..d0f8d128 100644--- a/registry/remocn/chat-to-preview-layout/config.ts+++ b/registry/remocn/chat-to-preview-layout/config.ts@@ -6,19 +6,21 @@ export const chatToPreviewLayoutConfig: ComponentConfig = {controls: {startChatRatio: {type: "number",- default: 0.5,min: 0.1,max: 0.9,step: 0.05,- label: "Start chat ratio",+ default: 0.5,+ description: "Start chat ratio",+ hiddenFromList: false,},endChatRatio: {type: "number",- default: 0.25,min: 0.05,max: 0.9,step: 0.05,- label: "End chat ratio",+ default: 0.25,+ description: "End chat ratio",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn/check-list/config.ts b/registry/remocn/check-list/config.tsindex 30c25760..7ae2dd85 100644--- a/registry/remocn/check-list/config.ts+++ b/registry/remocn/check-list/config.ts@@ -7,53 +7,67 @@ export const checkListConfig: ComponentConfig = {controls: {fontSize: {type: "number",- default: 40,min: 24,max: 64,step: 2,- label: "Font size",+ default: 40,+ description: "Font size",+ hiddenFromList: false,},itemGap: {type: "number",- default: 18,min: 6,max: 48,step: 3,- label: "Frames between items",+ default: 18,+ description: "Frames between items",+ hiddenFromList: false,},closeGap: {type: "number",- default: 9,min: 3,max: 24,step: 3,- label: "Frames between ticks",+ default: 9,+ description: "Frames between ticks",+ hiddenFromList: false,},perStep: {type: "number",- default: 1.6,min: 0.8,max: 3,step: 0.2,- label: "Letters / pose",+ default: 1.6,+ description: "Letters / pose",+ hiddenFromList: false,},strokeWidth: {type: "number",- default: 3,min: 1,max: 8,step: 1,- label: "Stroke width",+ default: 3,+ description: "Stroke width",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#26242c",+ description: "Label color",+ },+ tickColor: {+ type: "color",+ default: "#6f7f35",+ description: "Tick color",},- color: { type: "color", default: "#26242c", label: "Label color" },- tickColor: { type: "color", default: "#6f7f35", label: "Tick color" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: checkListExampleCode,diff --git a/registry/remocn/chromatic-wave/config.ts b/registry/remocn/chromatic-wave/config.tsindex b16b17e5..ddc8ff8a 100644--- a/registry/remocn/chromatic-wave/config.ts+++ b/registry/remocn/chromatic-wave/config.ts@@ -4,32 +4,47 @@ export const chromaticWaveConfig: ComponentConfig = {componentName: "ChromaticWave",importPath: "@/components/remocn/chromatic-wave",controls: {- headline: { type: "text", default: "MUSIC", label: "Headline" },- kicker: { type: "text", default: "APPLES", label: "Kicker" },- fill: { type: "color", default: "#ffffff", label: "Fill" },+ headline: {+ type: "text-content",+ default: "MUSIC",+ description: "Headline",+ },+ kicker: {+ type: "text-content",+ default: "APPLES",+ description: "Kicker",+ },+ fill: {+ type: "color",+ default: "#ffffff",+ description: "Fill",+ },waveHeight: {type: "number",- default: 28,min: 0,max: 40,step: 1,- label: "Wave height",+ default: 28,+ description: "Wave height",+ hiddenFromList: false,},maxDisplacementPx: {type: "number",- default: 39,min: 0,max: 60,step: 1,- label: "Displacement (px)",+ default: 39,+ description: "Displacement (px)",+ hiddenFromList: false,},turbulentAmount: {type: "number",- default: 130,min: 0,max: 200,step: 2,- label: "Turbulence",+ default: 130,+ description: "Turbulence",+ hiddenFromList: false,},},durationInFrames: 100,diff --git a/registry/remocn/claude-chat/config.ts b/registry/remocn/claude-chat/config.tsindex 15491119..eb45459c 100644--- a/registry/remocn/claude-chat/config.ts+++ b/registry/remocn/claude-chat/config.ts@@ -4,20 +4,36 @@ export const claudeChatConfig: ComponentConfig = {componentName: "ClaudeChat",importPath: "@/components/remocn/claude-chat",controls: {- greeting: { type: "text", default: "Back at it, Dima", label: "Greeting" },+ greeting: {+ type: "text-content",+ default: "Back at it, Dima",+ description: "Greeting",+ },placeholder: {- type: "text",+ type: "text-content",default: "Try: draft an email · summarize a doc · plan your week",- label: "Placeholder",+ description: "Placeholder",},prompt: {- type: "text",+ type: "text-content",default: "Draft a launch tweet for our new release",- label: "Prompt",+ description: "Prompt",+ },+ modelName: {+ type: "text-content",+ default: "Opus 4.8",+ description: "Model",+ },+ modelTier: {+ type: "text-content",+ default: "Max",+ description: "Tier",+ },+ accentColor: {+ type: "color",+ default: "#D97757",+ description: "Accent",},- modelName: { type: "text", default: "Opus 4.8", label: "Model" },- modelTier: { type: "text", default: "Max", label: "Tier" },- accentColor: { type: "color", default: "#D97757", label: "Accent" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/claude-code/config.ts b/registry/remocn/claude-code/config.tsindex b37acdc2..d2d7d8ef 100644--- a/registry/remocn/claude-code/config.ts+++ b/registry/remocn/claude-code/config.ts@@ -4,21 +4,41 @@ export const claudeCodeConfig: ComponentConfig = {componentName: "ClaudeCode",importPath: "@/components/remocn/claude-code",controls: {- title: { type: "text", default: "Claude Code v2.0.0", label: "Title" },- userName: { type: "text", default: "Remocn", label: "User name" },- model: { type: "text", default: "Opus 4.8 • Max 20x", label: "Model" },- cwd: { type: "text", default: "/users/remocn/code/apps", label: "Cwd" },+ title: {+ type: "text-content",+ default: "Claude Code v2.0.0",+ description: "Title",+ },+ userName: {+ type: "text-content",+ default: "Remocn",+ description: "User name",+ },+ model: {+ type: "text-content",+ default: "Opus 4.8 • Max 20x",+ description: "Model",+ },+ cwd: {+ type: "text-content",+ default: "/users/remocn/code/apps",+ description: "Cwd",+ },placeholder: {- type: "text",+ type: "text-content",default: 'Try "edit <filepath> to ..."',- label: "Placeholder",+ description: "Placeholder",},prompt: {- type: "text",+ type: "text-content",default: "edit src/theme.ts to add a dark mode toggle",- label: "Prompt",+ description: "Prompt",+ },+ accentColor: {+ type: "color",+ default: "#D97757",+ description: "Accent",},- accentColor: { type: "color", default: "#D97757", label: "Accent" },},durationInFrames: 160,fps: FPS,diff --git a/registry/remocn/confetti/config.ts b/registry/remocn/confetti/config.tsindex 447a7919..06ddbfc4 100644--- a/registry/remocn/confetti/config.ts+++ b/registry/remocn/confetti/config.ts@@ -6,43 +6,47 @@ export const confettiConfig: ComponentConfig = {controls: {particleCount: {type: "number",- default: 140,min: 10,max: 400,step: 10,- label: "Particles",+ default: 140,+ description: "Particles",+ hiddenFromList: false,},power: {type: "number",- default: 17,min: 4,max: 40,step: 1,- label: "Power",+ default: 17,+ description: "Power",+ hiddenFromList: false,},gravity: {type: "number",- default: 0.45,min: 0,max: 1.5,step: 0.05,- label: "Gravity",+ default: 0.45,+ description: "Gravity",+ hiddenFromList: false,},size: {type: "number",- default: 13,min: 4,max: 30,step: 1,- label: "Size",+ default: 13,+ description: "Size",+ hiddenFromList: false,},seed: {- type: "number-input",- default: 1,+ type: "number",min: 1,- max: 9999,step: 1,- label: "Seed",+ default: 1,+ description: "Seed",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/crt-screen/config.ts b/registry/remocn/crt-screen/config.tsindex 8819fac5..4d25228c 100644--- a/registry/remocn/crt-screen/config.ts+++ b/registry/remocn/crt-screen/config.ts@@ -7,35 +7,39 @@ export const crtScreenConfig: ComponentConfig = {controls: {curvature: {type: "number",- default: 1,min: 0,max: 2,step: 0.05,- label: "Curvature",+ default: 1,+ description: "Curvature",+ hiddenFromList: false,},scanlines: {type: "number",- default: 1,min: 0,max: 1.5,step: 0.05,- label: "Scanlines",+ default: 1,+ description: "Scanlines",+ hiddenFromList: false,},maskScale: {type: "number",- default: 2,min: 1,max: 6,step: 1,- label: "Mask pitch",+ default: 2,+ description: "Mask pitch",+ hiddenFromList: false,},vignette: {type: "number",- default: 1,min: 0,max: 1.5,step: 0.05,- label: "Vignette",+ default: 1,+ description: "Vignette",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/crumple-toss/config.ts b/registry/remocn/crumple-toss/config.tsindex dc9e2856..6c39de18 100644--- a/registry/remocn/crumple-toss/config.ts+++ b/registry/remocn/crumple-toss/config.ts@@ -7,92 +7,107 @@ export const crumpleTossConfig: ComponentConfig = {controls: {at: {type: "number",- default: 6,min: 0,max: 24,step: 3,- label: "Crumple starts",+ default: 6,+ description: "Crumple starts",+ hiddenFromList: false,},crumpleSteps: {type: "number",- default: 4,min: 2,max: 8,step: 1,- label: "Crush poses",+ default: 4,+ description: "Crush poses",+ hiddenFromList: false,},tossSteps: {type: "number",- default: 5,min: 2,max: 10,step: 1,- label: "Flight poses",+ default: 5,+ description: "Flight poses",+ hiddenFromList: false,},direction: {type: "number",- default: -35,min: -180,max: 180,step: 5,- label: "Throw angle",+ default: -35,+ description: "Throw angle",+ hiddenFromList: false,},distance: {type: "number",- default: 440,min: 200,max: 1600,step: 20,- label: "Arc scale",+ default: 440,+ description: "Arc scale",+ hiddenFromList: false,},spin: {type: "number",- default: 220,min: 0,max: 720,step: 10,- label: "Tumble",+ default: 220,+ description: "Tumble",+ hiddenFromList: false,},segments: {type: "number",- default: 9,min: 5,max: 14,step: 1,- label: "Paper segments",+ default: 9,+ description: "Paper segments",+ hiddenFromList: false,},layers: {type: "number",- default: 2,min: 1,max: 3,step: 1,- label: "Fold layers",+ default: 2,+ description: "Fold layers",+ hiddenFromList: false,},randomness: {type: "number",- default: 0.6,min: 0,max: 1,step: 0.05,- label: "Fold randomness",+ default: 0.6,+ description: "Fold randomness",+ hiddenFromList: false,},crushTo: {type: "number",- default: 0.34,min: 0.15,max: 0.7,step: 0.01,- label: "Wad size",+ default: 0.34,+ description: "Wad size",+ hiddenFromList: false,+ },+ seed: {+ type: "text-content",+ default: "toss",+ description: "Seed",},- seed: { type: "text", default: "toss", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: crumpleTossExampleCode,diff --git a/registry/remocn/displacement/config.ts b/registry/remocn/displacement/config.tsindex 0b4353de..78e03dc1 100644--- a/registry/remocn/displacement/config.ts+++ b/registry/remocn/displacement/config.ts@@ -7,51 +7,57 @@ export const displacementConfig: ComponentConfig = {controls: {grid: {type: "number",- default: 60,min: 4,max: 100,step: 2,- label: "Grid",+ default: 60,+ description: "Grid",+ hiddenFromList: false,},cellAspect: {type: "number",- default: 1,min: 0.25,max: 4,step: 0.25,- label: "Cell aspect",+ default: 1,+ description: "Cell aspect",+ hiddenFromList: false,},shift: {type: "number",- default: 1,min: 0,max: 4,step: 0.1,- label: "Shift",+ default: 1,+ description: "Shift",+ hiddenFromList: false,},aberration: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Aberration",+ default: 1,+ description: "Aberration",+ hiddenFromList: false,},grain: {type: "number",- default: 0.5,min: 0,max: 1,step: 0.05,- label: "Grain",+ default: 0.5,+ description: "Grain",+ hiddenFromList: false,},stagger: {type: "number",- default: 0.45,min: 0,max: 0.85,step: 0.05,- label: "Stagger",+ default: 0.45,+ description: "Stagger",+ hiddenFromList: false,},},durationInFrames: 72,diff --git a/registry/remocn/dither-dissolve/config.ts b/registry/remocn/dither-dissolve/config.tsindex 9d8dac31..261a62ba 100644--- a/registry/remocn/dither-dissolve/config.ts+++ b/registry/remocn/dither-dissolve/config.ts@@ -6,13 +6,29 @@ export const ditherDissolveConfig: ComponentConfig = {importPath: "@/components/remocn/dither-dissolve",controls: {shape: {- type: "select",+ type: "enum",default: "simplex",- options: ["simplex", "warp", "dots", "wave", "ripple", "swirl", "sphere"],- label: "Shape",+ variants: {+ simplex: {},+ warp: {},+ dots: {},+ wave: {},+ ripple: {},+ swirl: {},+ sphere: {},+ },+ description: "Shape",+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",+ },+ colorFront: {+ type: "color",+ default: "#8f88ae",+ description: "Ink",},- colorBack: { type: "color", default: "#141318", label: "Background" },- colorFront: { type: "color", default: "#8f88ae", label: "Ink" },},durationInFrames: 100,fps: FPS,diff --git a/registry/remocn/drift/config.ts b/registry/remocn/drift/config.tsindex 743adfba..2f6afcb3 100644--- a/registry/remocn/drift/config.ts+++ b/registry/remocn/drift/config.ts@@ -7,11 +7,12 @@ export const driftConfig: ComponentConfig = {controls: {grow: {type: "number",- default: 0.035,min: -0.1,max: 0.15,step: 0.005,- label: "Grow",+ default: 0.035,+ description: "Grow",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/ecosystem-constellation/config.ts b/registry/remocn/ecosystem-constellation/config.tsindex feac4703..79fd9bcf 100644--- a/registry/remocn/ecosystem-constellation/config.ts+++ b/registry/remocn/ecosystem-constellation/config.ts@@ -6,21 +6,22 @@ export const ecosystemConstellationConfig: ComponentConfig = {controls: {satelliteCount: {type: "number",- default: 6,min: 3,max: 8,step: 1,- label: "Satellite count",+ default: 6,+ description: "Satellite count",+ hiddenFromList: false,},centerLabel: {- type: "text",+ type: "text-content",default: "V",- label: "Center label",+ description: "Center label",},accentColor: {type: "color",default: "#a855f7",- label: "Accent color",+ description: "Accent color",},},durationInFrames: 240,diff --git a/registry/remocn/ember-burn/config.ts b/registry/remocn/ember-burn/config.tsindex 65e6bcf4..17f0a53f 100644--- a/registry/remocn/ember-burn/config.ts+++ b/registry/remocn/ember-burn/config.ts@@ -7,44 +7,53 @@ export const emberBurnConfig: ComponentConfig = {controls: {patches: {type: "number",- default: 5,min: 2,max: 16,step: 1,- label: "Patches",+ default: 5,+ description: "Patches",+ hiddenFromList: false,},edgeSoftness: {type: "number",- default: 0.07,min: 0.005,max: 0.2,step: 0.005,- label: "Edge softness",+ default: 0.07,+ description: "Edge softness",+ hiddenFromList: false,},contentBias: {type: "number",- default: 0.6,min: 0,max: 1,step: 0.05,- label: "Eats bright first",+ default: 0.6,+ description: "Eats bright first",+ hiddenFromList: false,},heat: {type: "number",- default: 0.5,min: 0,max: 1.5,step: 0.05,- label: "Heat distortion",+ default: 0.5,+ description: "Heat distortion",+ hiddenFromList: false,+ },+ glowColor: {+ type: "color",+ default: "#ff7a2f",+ description: "Glow",},- glowColor: { type: "color", default: "#ff7a2f", label: "Glow" },emberAmount: {type: "number",- default: 0.5,min: 0,max: 1,step: 0.05,- label: "Embers",+ default: 0.5,+ description: "Embers",+ hiddenFromList: false,},},durationInFrames: 80,diff --git a/registry/remocn/extrude-pop/config.ts b/registry/remocn/extrude-pop/config.tsindex 618e5e9d..bacce4b2 100644--- a/registry/remocn/extrude-pop/config.ts+++ b/registry/remocn/extrude-pop/config.ts@@ -4,32 +4,47 @@ export const extrudePopConfig: ComponentConfig = {componentName: "ExtrudePop",importPath: "@/components/remocn/extrude-pop",controls: {- letter: { type: "text", default: "WIN", label: "Text" },- bodyColor: { type: "color", default: "#e8192b", label: "Body color" },- faceColor: { type: "color", default: "#ffffff", label: "Face color" },+ letter: {+ type: "text-content",+ default: "WIN",+ description: "Text",+ },+ bodyColor: {+ type: "color",+ default: "#e8192b",+ description: "Body color",+ },+ faceColor: {+ type: "color",+ default: "#ffffff",+ description: "Face color",+ },minimaxRadius: {type: "number",- default: 80,min: 0,max: 200,step: 5,- label: "Extrude radius",+ default: 80,+ description: "Extrude radius",+ hiddenFromList: false,},extrudeAngleDeg: {type: "number",- default: -58.6,min: -180,max: 180,step: 1,- label: "Extrude angle",+ default: -58.6,+ description: "Extrude angle",+ hiddenFromList: false,},extrudeEndFrame: {type: "number",- default: 48,min: 10,max: 90,step: 1,- label: "Extrude ends (frame)",+ default: 48,+ description: "Extrude ends (frame)",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/fade-through/config.ts b/registry/remocn/fade-through/config.tsindex 08463cbe..b1cf3634 100644--- a/registry/remocn/fade-through/config.ts+++ b/registry/remocn/fade-through/config.ts@@ -1,39 +1,43 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const fadeThroughConfig: ComponentConfig = {componentName: "FadeThrough",importPath: "@/components/remocn/fade-through",controls: {fromText: {- type: "text",+ type: "text-content",default: "Calm transitions.",- label: "From text",+ description: "From text",},toText: {- type: "text",+ type: "text-content",default: "Fade through content.",- label: "To text",+ description: "To text",},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/focus-blur-resolve/config.ts b/registry/remocn/focus-blur-resolve/config.tsindex 0c7fecc8..8499f1ec 100644--- a/registry/remocn/focus-blur-resolve/config.ts+++ b/registry/remocn/focus-blur-resolve/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const focusBlurResolveConfig: ComponentConfig = {componentName: "FocusBlurResolve",importPath: "@/components/remocn/focus-blur-resolve",controls: {- text: { type: "text", default: "Focus resolves clearly.", label: "Text" },+ text: {+ type: "text-content",+ default: "Focus resolves clearly.",+ description: "Text",+ },blur: {type: "number",- default: 14,min: 1,max: 30,step: 1,- label: "Blur",+ default: 14,+ description: "Blur",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/focus-pull/config.ts b/registry/remocn/focus-pull/config.tsindex b6bc50e8..93909c3a 100644--- a/registry/remocn/focus-pull/config.ts+++ b/registry/remocn/focus-pull/config.ts@@ -7,11 +7,12 @@ export const focusPullConfig: ComponentConfig = {controls: {blur: {type: "number",- default: 16,min: 4,max: 32,step: 1,- label: "Blur",+ default: 16,+ description: "Blur",+ hiddenFromList: false,},},durationInFrames: 114,diff --git a/registry/remocn/github-sponsors/config.ts b/registry/remocn/github-sponsors/config.tsindex cff28b4a..8037ca22 100644--- a/registry/remocn/github-sponsors/config.ts+++ b/registry/remocn/github-sponsors/config.ts@@ -5,16 +5,23 @@ export const githubSponsorsConfig: ComponentConfig = {importPath: "@/components/remocn/github-sponsors",controls: {account: {- type: "text",+ type: "text-content",default: "remocn",- label: "Account",+ description: "Account",+ },+ accentColor: {+ type: "color",+ default: "#db61a2",+ description: "Accent",},- accentColor: { type: "color", default: "#db61a2", label: "Accent" },theme: {- type: "select",+ type: "enum",default: "light",- options: ["light", "dark"],- label: "Theme",+ variants: {+ light: {},+ dark: {},+ },+ description: "Theme",},},durationInFrames: 270,diff --git a/registry/remocn/github-stars/config.ts b/registry/remocn/github-stars/config.tsindex ebc92d63..87039d61 100644--- a/registry/remocn/github-stars/config.ts+++ b/registry/remocn/github-stars/config.ts@@ -5,33 +5,41 @@ export const githubStarsConfig: ComponentConfig = {importPath: "@/components/remocn/github-stars",controls: {repo: {- type: "text",+ type: "text-content",default: "Remocn/remocn",- label: "Repository",+ description: "Repository",},totalStars: {- type: "number-input",- default: 24813,+ type: "number",min: 0,- max: 500000,step: 1,- label: "Total stars",+ default: 24813,+ description: "Total stars",+ hiddenFromList: false,},orientation: {- type: "select",+ type: "enum",default: "horizontal",- options: ["horizontal", "vertical"],- label: "Orientation",+ variants: {+ horizontal: {},+ vertical: {},+ },+ description: "Orientation",+ },+ accentColor: {+ type: "color",+ default: "#ffbb00",+ description: "Accent",},- accentColor: { type: "color", default: "#ffbb00", label: "Accent" },theme: {- type: "select",+ type: "enum",default: "light",- options: ["light", "dark"],- label: "Theme",+ variants: {+ light: {},+ dark: {},+ },+ description: "Theme",},- // `speed` is appended from SHARED_CONTROLS in registry/__index__.tsx.- // `stargazers` is an array → not a control; preview uses SAMPLE_STARGAZERS.},durationInFrames: 120,fps: FPS,diff --git a/registry/remocn/glass-code-block/config.ts b/registry/remocn/glass-code-block/config.tsindex 98326a91..9cc9f8d7 100644--- a/registry/remocn/glass-code-block/config.ts+++ b/registry/remocn/glass-code-block/config.ts@@ -4,48 +4,56 @@ export const glassCodeBlockConfig: ComponentConfig = {componentName: "GlassCodeBlock",importPath: "@/components/remocn/glass-code-block",controls: {- title: { type: "text", default: "hero.tsx", label: "Title" },+ title: {+ type: "text-content",+ default: "hero.tsx",+ description: "Title",+ },width: {type: "number",- default: 760,min: 300,max: 1100,step: 10,- label: "Width",+ default: 760,+ description: "Width",+ hiddenFromList: false,},height: {type: "number",- default: 460,min: 200,max: 700,step: 10,- label: "Height",+ default: 460,+ description: "Height",+ hiddenFromList: false,},fontSize: {type: "number",- default: 16,min: 10,max: 28,step: 1,- label: "Font size",+ default: 16,+ description: "Font size",+ hiddenFromList: false,},glassColor: {- type: "text",+ type: "text-content",default: "rgba(10, 10, 10, 0.6)",- label: "Glass color",+ description: "Glass color",},staggerFrames: {type: "number",- default: 4,min: 0,max: 30,step: 1,- label: "Stagger frames",+ default: 4,+ description: "Stagger frames",+ hiddenFromList: false,},showTrafficLights: {type: "boolean",default: true,- label: "Traffic lights",+ description: "Traffic lights",},},durationInFrames: 180,diff --git a/registry/remocn/glass-code-walk/config.ts b/registry/remocn/glass-code-walk/config.tsindex 54a8dd86..13d2491b 100644--- a/registry/remocn/glass-code-walk/config.ts+++ b/registry/remocn/glass-code-walk/config.ts@@ -4,46 +4,55 @@ export const glassCodeWalkConfig: ComponentConfig = {componentName: "GlassCodeWalk",importPath: "@/components/remocn/glass-code-walk",controls: {- title: { type: "text", default: "scene.tsx", label: "Title" },+ title: {+ type: "text-content",+ default: "scene.tsx",+ description: "Title",+ },zoom: {type: "number",- default: 2.6,min: 1,max: 4,step: 0.1,- label: "Zoom",+ default: 2.6,+ description: "Zoom",+ hiddenFromList: false,},fontSize: {type: "number",- default: 18,min: 10,max: 28,step: 1,- label: "Font size",+ default: 18,+ description: "Font size",+ hiddenFromList: false,},staggerFrames: {type: "number",- default: 10,min: 1,max: 30,step: 1,- label: "Stagger frames",+ default: 10,+ description: "Stagger frames",+ hiddenFromList: false,},width: {type: "number",- default: 880,min: 300,max: 1100,step: 10,- label: "Width",+ default: 880,+ description: "Width",+ hiddenFromList: false,},height: {type: "number",- default: 420,min: 200,max: 700,step: 10,- label: "Height",+ default: 420,+ description: "Height",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/glitch-cut/config.ts b/registry/remocn/glitch-cut/config.tsindex c834a93b..f5ceb4d8 100644--- a/registry/remocn/glitch-cut/config.ts+++ b/registry/remocn/glitch-cut/config.ts@@ -7,35 +7,39 @@ export const glitchCutConfig: ComponentConfig = {controls: {intensity: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,},slices: {type: "number",- default: 24,min: 8,max: 64,step: 2,- label: "Slices",+ default: 24,+ description: "Slices",+ hiddenFromList: false,},rgbSplit: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "RGB split",+ default: 1,+ description: "RGB split",+ hiddenFromList: false,},blockNoise: {type: "number",- default: 0.6,min: 0,max: 1,step: 0.05,- label: "Block noise",+ default: 0.6,+ description: "Block noise",+ hiddenFromList: false,},},durationInFrames: 78,diff --git a/registry/remocn/gooey-morph/config.ts b/registry/remocn/gooey-morph/config.tsindex a3849ced..321ddde6 100644--- a/registry/remocn/gooey-morph/config.ts+++ b/registry/remocn/gooey-morph/config.ts@@ -4,36 +4,47 @@ export const gooeyMorphConfig: ComponentConfig = {componentName: "GooeyMorph",importPath: "@/components/remocn/gooey-morph",controls: {- word: { type: "text", default: "HELLO", label: "Word" },- fill: { type: "color", default: "#f2f2f2", label: "Fill" },+ word: {+ type: "text-content",+ default: "HELLO",+ description: "Word",+ },+ fill: {+ type: "color",+ default: "#f2f2f2",+ description: "Fill",+ },fontFamily: {- type: "text",+ type: "text-content",default: "'Bodoni Moda', Georgia, serif",- label: "Font family",+ description: "Font family",},blurRadius: {type: "number",- default: 6,min: 0,max: 20,step: 1,- label: "Goo blur radius",+ default: 6,+ description: "Goo blur radius",+ hiddenFromList: false,},displaceAmount: {type: "number",- default: 20,min: 0,max: 80,step: 1,- label: "Displace amount",+ default: 20,+ description: "Displace amount",+ hiddenFromList: false,},barTravelFrames: {type: "number",- default: 30,min: 10,max: 60,step: 1,- label: "Bar travel (frames)",+ default: 30,+ description: "Bar travel (frames)",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn/grain-dissolve/config.ts b/registry/remocn/grain-dissolve/config.tsindex b0220ecc..8811e566 100644--- a/registry/remocn/grain-dissolve/config.ts+++ b/registry/remocn/grain-dissolve/config.ts@@ -6,36 +6,42 @@ export const grainDissolveConfig: ComponentConfig = {importPath: "@/components/remocn/grain-dissolve",controls: {shape: {- type: "select",+ type: "enum",default: "blob",- options: [- "wave",- "dots",- "truchet",- "corners",- "ripple",- "blob",- "sphere",- ],- label: "Shape",+ variants: {+ wave: {},+ dots: {},+ truchet: {},+ corners: {},+ ripple: {},+ blob: {},+ sphere: {},+ },+ description: "Shape",},noise: {type: "number",- default: 0.3,min: 0,max: 1,step: 0.05,- label: "Noise",+ default: 0.3,+ description: "Noise",+ hiddenFromList: false,},zoom: {type: "number",- default: 2,min: 0.5,max: 4,step: 0.25,- label: "Zoom",+ default: 2,+ description: "Zoom",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",},- colorBack: { type: "color", default: "#141318", label: "Background" },},durationInFrames: 116,fps: FPS,diff --git a/registry/remocn/grid-wave/config.ts b/registry/remocn/grid-wave/config.tsindex 90a153f9..3ef0a43f 100644--- a/registry/remocn/grid-wave/config.ts+++ b/registry/remocn/grid-wave/config.ts@@ -7,42 +7,56 @@ export const gridWaveConfig: ComponentConfig = {controls: {tileSize: {type: "number",- default: 90,min: 30,max: 260,step: 10,- label: "Tile size",+ default: 90,+ description: "Tile size",+ hiddenFromList: false,},waveWidth: {type: "number",- default: 0.16,min: 0.04,max: 0.5,step: 0.02,- label: "Wave width",+ default: 0.16,+ description: "Wave width",+ hiddenFromList: false,},lift: {type: "number",- default: 2,min: 0,max: 4,step: 0.1,- label: "Lift",+ default: 2,+ description: "Lift",+ hiddenFromList: false,},gap: {type: "number",- default: 0.12,min: 0,max: 0.45,step: 0.01,- label: "Gap",+ default: 0.12,+ description: "Gap",+ hiddenFromList: false,+ },+ tint: {+ type: "color",+ default: "#8fb4ff",+ description: "Tint",},- tint: { type: "color", default: "#8fb4ff", label: "Tint" },direction: {- type: "select",+ type: "enum",default: "ripple",- options: ["ripple", "left", "right", "up", "down"],- label: "Direction",+ variants: {+ ripple: {},+ left: {},+ right: {},+ up: {},+ down: {},+ },+ description: "Direction",},},durationInFrames: 84,diff --git a/registry/remocn/halftone-print/config.ts b/registry/remocn/halftone-print/config.tsindex 1c81d402..9c38338c 100644--- a/registry/remocn/halftone-print/config.ts+++ b/registry/remocn/halftone-print/config.ts@@ -7,32 +7,35 @@ export const halftonePrintConfig: ComponentConfig = {controls: {dotSize: {type: "number",- default: 10,min: 4,max: 32,step: 1,- label: "Dot size",+ default: 10,+ description: "Dot size",+ hiddenFromList: false,},angle: {type: "number",- default: 0,min: 0,max: 90,step: 1,- label: "Screen angle",+ default: 0,+ description: "Screen angle",+ hiddenFromList: false,},misregistration: {type: "number",- default: 1.2,min: 0,max: 6,step: 0.2,- label: "Misregistration",+ default: 1.2,+ description: "Misregistration",+ hiddenFromList: false,},paperTint: {type: "color",default: "#f4efe4",- label: "Paper",+ description: "Paper",},},durationInFrames: 90,diff --git a/registry/remocn/hand-count/config.ts b/registry/remocn/hand-count/config.tsindex 97ec7cf9..129d1524 100644--- a/registry/remocn/hand-count/config.ts+++ b/registry/remocn/hand-count/config.ts@@ -6,61 +6,87 @@ export const handCountConfig: ComponentConfig = {controls: {to: {type: "number",- default: 1284,min: 0,max: 10000,step: 1,- label: "Count to",+ default: 1284,+ description: "Count to",+ hiddenFromList: false,},from: {type: "number",- default: 0,min: 0,max: 1000,step: 1,- label: "Count from",+ default: 0,+ description: "Count from",+ hiddenFromList: false,},durationSteps: {type: "number",- default: 18,min: 2,max: 24,step: 1,- label: "Poses counting",+ default: 18,+ description: "Poses counting",+ hiddenFromList: false,},decimals: {type: "number",- default: 0,min: 0,max: 2,step: 1,- label: "Decimals",+ default: 0,+ description: "Decimals",+ hiddenFromList: false,+ },+ prefix: {+ type: "text-content",+ default: "",+ description: "Prefix",+ },+ suffix: {+ type: "text-content",+ default: "",+ description: "Suffix",},- prefix: { type: "text", default: "", label: "Prefix" },- suffix: { type: "text", default: "", label: "Suffix" },fontSize: {type: "number",- default: 96,min: 32,max: 200,step: 2,- label: "Font size",+ default: 96,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#26242c",+ description: "Color",},- color: { type: "color", default: "#26242c", label: "Color" },ease: {- type: "select",+ type: "enum",default: "in-out",- options: ["in-out", "out", "linear"],- label: "Ease",+ variants: {+ "in-out": {},+ out: {},+ linear: {},+ },+ description: "Ease",+ },+ seed: {+ type: "text-content",+ default: "count",+ description: "Seed",},- seed: { type: "text", default: "count", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/handwrite/config.ts b/registry/remocn/handwrite/config.tsindex 3583c1a6..0ccfc56a 100644--- a/registry/remocn/handwrite/config.ts+++ b/registry/remocn/handwrite/config.ts@@ -1,52 +1,65 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const handwriteConfig: ComponentConfig = {componentName: "Handwrite",importPath: "@/components/remocn/handwrite",controls: {- text: { type: "text", default: "Made by hand", label: "Text" },+ text: {+ type: "text-content",+ default: "Made by hand",+ description: "Text",+ },fontSize: {type: "number",- default: 72,min: 24,max: 120,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,},perStep: {type: "number",- default: 1.6,min: 0.5,max: 4,step: 0.1,- label: "Letters / pose",+ default: 1.6,+ description: "Letters / pose",+ hiddenFromList: false,},weight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",+ },+ color: {+ type: "color",+ default: "#26242c",+ description: "Color",},- color: { type: "color", default: "#26242c", label: "Color" },align: {- type: "select",+ type: "enum",default: "center",- options: ["center", "left"],- label: "Align",+ variants: {+ center: {},+ left: {},+ },+ description: "Align",},step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn/hologram/config.ts b/registry/remocn/hologram/config.tsindex 7c5c621e..4703dc2d 100644--- a/registry/remocn/hologram/config.ts+++ b/registry/remocn/hologram/config.ts@@ -8,39 +8,43 @@ export const hologramConfig: ComponentConfig = {tint: {type: "color",default: "#63e8ff",- label: "Tint",+ description: "Tint",},glow: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Glow",+ default: 1,+ description: "Glow",+ hiddenFromList: false,},ghost: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Ghost",+ default: 1,+ description: "Ghost",+ hiddenFromList: false,},flicker: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Flicker",+ default: 1,+ description: "Flicker",+ hiddenFromList: false,},intensity: {type: "number",- default: 1,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/icon-scatter/config.ts b/registry/remocn/icon-scatter/config.tsindex 73241ef3..6a5d4901 100644--- a/registry/remocn/icon-scatter/config.ts+++ b/registry/remocn/icon-scatter/config.ts@@ -7,21 +7,31 @@ export const iconScatterConfig: ComponentConfig = {controls: {count: {type: "number",- default: 15,min: 4,max: 30,step: 1,- label: "Icon count",+ default: 15,+ description: "Icon count",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#fafafa",+ description: "Icons",+ },+ coverColor: {+ type: "color",+ default: "#0a0a0a",+ description: "Cover",},- color: { type: "color", default: "#fafafa", label: "Icons" },- coverColor: { type: "color", default: "#0a0a0a", label: "Cover" },flyDistance: {type: "number",- default: 260,min: 80,max: 500,step: 10,- label: "Fly distance",+ default: 260,+ description: "Fly distance",+ hiddenFromList: false,},},durationInFrames: 100,diff --git a/registry/remocn/infinite-bento-pan/config.ts b/registry/remocn/infinite-bento-pan/config.tsindex 3d712e6f..89688aef 100644--- a/registry/remocn/infinite-bento-pan/config.ts+++ b/registry/remocn/infinite-bento-pan/config.ts@@ -6,16 +6,17 @@ export const infiniteBentoPanConfig: ComponentConfig = {controls: {panSpeed: {type: "number",- default: 1,min: 0.25,max: 3,step: 0.25,- label: "Pan speed",+ default: 1,+ description: "Pan speed",+ hiddenFromList: false,},accentColor: {type: "color",default: "#7c3aed",- label: "Accent color",+ description: "Accent color",},},durationInFrames: 300,diff --git a/registry/remocn/infinite-marquee/config.ts b/registry/remocn/infinite-marquee/config.tsindex cb057c63..7e587d85 100644--- a/registry/remocn/infinite-marquee/config.ts+++ b/registry/remocn/infinite-marquee/config.ts@@ -1,41 +1,58 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const infiniteMarqueeConfig: ComponentConfig = {componentName: "InfiniteMarquee",importPath: "@/components/remocn/infinite-marquee",controls: {- text: { type: "text", default: "ship · build · animate · ", label: "Text" },+ text: {+ type: "text-content",+ default: "ship · build · animate · ",+ description: "Text",+ },fontSize: {type: "number",- default: 120,min: 12,max: 240,step: 1,- label: "Font size",+ default: 120,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},pixelsPerFrame: {type: "number",- default: 4,min: 1,max: 30,step: 1,- label: "Pixels / frame",+ default: 4,+ description: "Pixels / frame",+ hiddenFromList: false,+ },+ stroke: {+ type: "boolean",+ default: false,+ description: "Stroke",+ },+ strokeColor: {+ type: "color",+ default: "#171717",+ description: "Stroke color",},- stroke: { type: "boolean", default: false, label: "Stroke" },- strokeColor: { type: "color", default: "#171717", label: "Stroke color" },},durationInFrames: 180,fps: FPS,diff --git a/registry/remocn/ink-arrow/config.ts b/registry/remocn/ink-arrow/config.tsindex 4e725c06..76467497 100644--- a/registry/remocn/ink-arrow/config.ts+++ b/registry/remocn/ink-arrow/config.ts@@ -7,77 +7,94 @@ export const inkArrowConfig: ComponentConfig = {controls: {curvature: {type: "number",- default: 0.35,min: -1,max: 1,step: 0.05,- label: "Curvature",+ default: 0.35,+ description: "Curvature",+ hiddenFromList: false,},strokeWidth: {type: "number",- default: 8,min: 2,max: 24,step: 1,- label: "Brush width",+ default: 8,+ description: "Brush width",+ hiddenFromList: false,},pressure: {type: "number",- default: 0.2,min: 0.05,max: 1,step: 0.05,- label: "Opening pressure",+ default: 0.2,+ description: "Opening pressure",+ hiddenFromList: false,},release: {type: "number",- default: 1,min: 0.05,max: 1,step: 0.05,- label: "Closing pressure",+ default: 1,+ description: "Closing pressure",+ hiddenFromList: false,},grain: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "Grain",+ default: 1,+ description: "Grain",+ hiddenFromList: false,},headSize: {type: "number",- default: 24,min: 8,max: 48,step: 1,- label: "Head size",+ default: 24,+ description: "Head size",+ hiddenFromList: false,},drawDur: {type: "number",- default: 36,min: 12,max: 90,step: 1,- label: "Draw frames",+ default: 36,+ description: "Draw frames",+ hiddenFromList: false,},headDur: {type: "number",- default: 12,min: 4,max: 48,step: 1,- label: "Head frames",+ default: 12,+ description: "Head frames",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#26242c",+ description: "Ink color",+ },+ seed: {+ type: "text-content",+ default: "arrow",+ description: "Seed",},- color: { type: "color", default: "#26242c", label: "Ink color" },- seed: { type: "text", default: "arrow", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: inkArrowExampleCode,diff --git a/registry/remocn/ink-underline/config.ts b/registry/remocn/ink-underline/config.tsindex 884e31f6..6a3f88cb 100644--- a/registry/remocn/ink-underline/config.ts+++ b/registry/remocn/ink-underline/config.ts@@ -7,61 +7,76 @@ export const inkUnderlineConfig: ComponentConfig = {controls: {width: {type: "number",- default: 420,min: 100,max: 800,step: 10,- label: "Width",+ default: 420,+ description: "Width",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#6f7f35",+ description: "Ink color",},- color: { type: "color", default: "#6f7f35", label: "Ink color" },thickness: {type: "number",- default: 9,min: 2,max: 24,step: 1,- label: "Brush width",+ default: 9,+ description: "Brush width",+ hiddenFromList: false,},pressure: {type: "number",- default: 1,min: 0.05,max: 1,step: 0.05,- label: "Opening pressure",+ default: 1,+ description: "Opening pressure",+ hiddenFromList: false,},release: {type: "number",- default: 0.15,min: 0.05,max: 1,step: 0.05,- label: "Closing pressure",+ default: 0.15,+ description: "Closing pressure",+ hiddenFromList: false,},grain: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "Grain",+ default: 1,+ description: "Grain",+ hiddenFromList: false,},durationSteps: {type: "number",- default: 5,min: 2,max: 10,step: 1,- label: "Poses to draw",+ default: 5,+ description: "Poses to draw",+ hiddenFromList: false,+ },+ seed: {+ type: "text-content",+ default: "ink",+ description: "Seed",},- seed: { type: "text", default: "ink", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: inkUnderlineExampleCode,diff --git a/registry/remocn/inline-highlight/config.ts b/registry/remocn/inline-highlight/config.tsindex 636c27fe..6384542c 100644--- a/registry/remocn/inline-highlight/config.ts+++ b/registry/remocn/inline-highlight/config.ts@@ -1,37 +1,53 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const inlineHighlightConfig: ComponentConfig = {componentName: "InlineHighlight",importPath: "@/components/remocn/inline-highlight",controls: {- before: { type: "text", default: "Ship faster with ", label: "Before" },- highlight: { type: "text", default: "remocn", label: "Highlight" },- after: { type: "text", default: ".", label: "After" },- baseColor: { type: "color", default: "#171717", label: "Base color" },+ before: {+ type: "text-content",+ default: "Ship faster with ",+ description: "Before",+ },+ highlight: {+ type: "text-content",+ default: "remocn",+ description: "Highlight",+ },+ after: {+ type: "text-content",+ default: ".",+ description: "After",+ },+ baseColor: {+ type: "color",+ default: "#171717",+ description: "Base color",+ },highlightColor: {type: "color",default: "#ff5e3a",- label: "Highlight color",+ description: "Highlight color",},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,},fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/kinetic-center-build/config.ts b/registry/remocn/kinetic-center-build/config.tsindex eb8ef5d3..8f445ecd 100644--- a/registry/remocn/kinetic-center-build/config.ts+++ b/registry/remocn/kinetic-center-build/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const kineticCenterBuildConfig: ComponentConfig = {componentName: "KineticCenterBuild",importPath: "@/components/remocn/kinetic-center-build",controls: {- text: { type: "text", default: "Words push left.", label: "Text" },+ text: {+ type: "text-content",+ default: "Words push left.",+ description: "Text",+ },entryOffset: {type: "number",- default: 88,min: 20,max: 160,step: 1,- label: "Entry offset",+ default: 88,+ description: "Entry offset",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/kinetic-warp/config.ts b/registry/remocn/kinetic-warp/config.tsindex b6184c85..9a69ccd7 100644--- a/registry/remocn/kinetic-warp/config.ts+++ b/registry/remocn/kinetic-warp/config.ts@@ -1,53 +1,67 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const kineticWarpConfig: ComponentConfig = {componentName: "KineticWarp",importPath: "@/components/remocn/kinetic-warp",controls: {- text: { type: "text", default: "REM\nOCN", label: "Text" },- textColor: { type: "color", default: "#FFFFFF", label: "Color" },- fontFamily: { type: "text", default: "Passion One", label: "Font family" },+ text: {+ type: "text-content",+ default: "REM\nOCN",+ description: "Text",+ },+ textColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Color",+ },+ fontFamily: {+ type: "text-content",+ default: "Passion One",+ description: "Font family",+ },fontUrl: {- type: "text",+ type: "text-content",default:"https://fonts.googleapis.com/css2?family=Passion+One:wght@400;700;900&display=block",- label: "Font URL",+ description: "Font URL",},fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},fontSize: {type: "number",- default: 107.1,min: 40,max: 200,step: 0.1,- label: "Font size",+ default: 107.1,+ description: "Font size",+ hiddenFromList: false,},layerScale: {type: "number",- default: 480,min: 100,max: 800,step: 10,- label: "Layer scale (%)",+ default: 480,+ description: "Layer scale (%)",+ hiddenFromList: false,},keyframeStride: {type: "number",- default: 20,min: 5,max: 40,step: 1,- label: "Keyframe stride",+ default: 20,+ description: "Keyframe stride",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn/lens-zoom/config.ts b/registry/remocn/lens-zoom/config.tsindex f7cb62bf..1a2ffd61 100644--- a/registry/remocn/lens-zoom/config.ts+++ b/registry/remocn/lens-zoom/config.ts@@ -7,35 +7,39 @@ export const lensZoomConfig: ComponentConfig = {controls: {lensSteps: {type: "number",- default: 9,min: 4,max: 32,step: 1,- label: "Lens steps",+ default: 9,+ description: "Lens steps",+ hiddenFromList: false,},blurSamples: {type: "number",- default: 7,min: 2,max: 32,step: 1,- label: "Blur samples",+ default: 7,+ description: "Blur samples",+ hiddenFromList: false,},shakeAmount: {type: "number",- default: 50,min: 0,max: 300,step: 5,- label: "Shake amount",+ default: 50,+ description: "Shake amount",+ hiddenFromList: false,},shakeTranslatePx: {type: "number",- default: 73,min: 0,max: 80,step: 1,- label: "Shake travel (px)",+ default: 73,+ description: "Shake travel (px)",+ hiddenFromList: false,},},durationInFrames: 112,diff --git a/registry/remocn/line-by-line-slide/config.ts b/registry/remocn/line-by-line-slide/config.tsindex 57280776..9ba56773 100644--- a/registry/remocn/line-by-line-slide/config.ts+++ b/registry/remocn/line-by-line-slide/config.ts@@ -1,42 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const lineByLineSlideConfig: ComponentConfig = {componentName: "LineByLineSlide",importPath: "@/components/remocn/line-by-line-slide",controls: {text: {- type: "text",+ type: "text-content",default: "Think different.\nDo more.",- label: "Text",+ description: "Text",},distance: {type: "number",- default: 48,min: 0,max: 160,step: 1,- label: "Distance",+ default: 48,+ description: "Distance",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/live-code-compilation/config.ts b/registry/remocn/live-code-compilation/config.tsindex 0bd02b28..dad9ec6e 100644--- a/registry/remocn/live-code-compilation/config.ts+++ b/registry/remocn/live-code-compilation/config.ts@@ -7,7 +7,7 @@ export const liveCodeCompilationConfig: ComponentConfig = {accentColor: {type: "color",default: "#3b82f6",- label: "Accent color",+ description: "Accent color",},},durationInFrames: 260,diff --git a/registry/remocn/logo-enter/config.ts b/registry/remocn/logo-enter/config.tsindex a031b824..e91662f7 100644--- a/registry/remocn/logo-enter/config.ts+++ b/registry/remocn/logo-enter/config.ts@@ -5,35 +5,42 @@ export const logoEnterConfig: ComponentConfig = {importPath: "@/components/remocn/logo-enter",controls: {diameter: {- type: "number-input",- default: 118,+ type: "number",min: 48,- max: 280,step: 1,- label: "Diameter",+ default: 118,+ description: "Diameter",+ hiddenFromList: false,},overlap: {- type: "number-input",- default: 38,+ type: "number",min: 0,- max: 160,step: 1,- label: "Overlap",+ default: 38,+ description: "Overlap",+ hiddenFromList: false,+ },+ ringColor: {+ type: "color",+ default: "#fff",+ description: "Ring",},- ringColor: { type: "color", default: "#fff", label: "Ring" },orientation: {- type: "select",+ type: "enum",default: "horizontal",- options: ["horizontal", "vertical"],- label: "Orientation",+ variants: {+ horizontal: {},+ vertical: {},+ },+ description: "Orientation",},stagger: {- type: "number-input",- default: 7,+ type: "number",min: 0,- max: 30,step: 1,- label: "Stagger",+ default: 7,+ description: "Stagger",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/marker-highlight/config.ts b/registry/remocn/marker-highlight/config.tsindex bfc86382..48e2a4a5 100644--- a/registry/remocn/marker-highlight/config.ts+++ b/registry/remocn/marker-highlight/config.ts@@ -1,38 +1,58 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const markerHighlightConfig: ComponentConfig = {componentName: "MarkerHighlight",importPath: "@/components/remocn/marker-highlight",controls: {- before: { type: "text", default: "Made for ", label: "Before" },- highlight: { type: "text", default: "builders", label: "Highlight" },- after: { type: "text", default: ".", label: "After" },- markerColor: { type: "color", default: "#facc15", label: "Marker color" },- baseColor: { type: "color", default: "#171717", label: "Base color" },+ before: {+ type: "text-content",+ default: "Made for ",+ description: "Before",+ },+ highlight: {+ type: "text-content",+ default: "builders",+ description: "Highlight",+ },+ after: {+ type: "text-content",+ default: ".",+ description: "After",+ },+ markerColor: {+ type: "color",+ default: "#facc15",+ description: "Marker color",+ },+ baseColor: {+ type: "color",+ default: "#171717",+ description: "Base color",+ },highlightedTextColor: {type: "color",default: "#171717",- label: "Highlighted text color",+ description: "Highlighted text color",},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,},fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/mask-reveal-up/config.ts b/registry/remocn/mask-reveal-up/config.tsindex 1bca3daa..c8650f7a 100644--- a/registry/remocn/mask-reveal-up/config.ts+++ b/registry/remocn/mask-reveal-up/config.ts@@ -1,42 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const maskRevealUpConfig: ComponentConfig = {componentName: "MaskRevealUp",importPath: "@/components/remocn/mask-reveal-up",controls: {text: {- type: "text",+ type: "text-content",default: "Designed to move.\nBuilt to focus.",- label: "Text",+ description: "Text",},distance: {type: "number",- default: 30,min: 0,max: 120,step: 1,- label: "Distance",+ default: 30,+ description: "Distance",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/matrix-decode/config.ts b/registry/remocn/matrix-decode/config.tsindex 945b2226..f73e0f26 100644--- a/registry/remocn/matrix-decode/config.ts+++ b/registry/remocn/matrix-decode/config.ts@@ -1,43 +1,52 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const matrixDecodeConfig: ComponentConfig = {componentName: "MatrixDecode",importPath: "@/components/remocn/matrix-decode",controls: {- text: { type: "text", default: "DECRYPTED", label: "Text" },+ text: {+ type: "text-content",+ default: "DECRYPTED",+ description: "Text",+ },charset: {- type: "text",+ type: "text-content",default: "!@#$%^&*()_+-=<>?/\\|",- label: "Charset",+ description: "Charset",},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#22c55e",+ description: "Color",},- color: { type: "color", default: "#22c55e", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},revealDuration: {type: "number",- default: 60,min: 10,max: 240,step: 1,- label: "Reveal duration",+ default: 60,+ description: "Reveal duration",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/micro-scale-fade/config.ts b/registry/remocn/micro-scale-fade/config.tsindex 84e1bd8f..50b5e62f 100644--- a/registry/remocn/micro-scale-fade/config.ts+++ b/registry/remocn/micro-scale-fade/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const microScaleFadeConfig: ComponentConfig = {componentName: "MicroScaleFade",importPath: "@/components/remocn/micro-scale-fade",controls: {- text: { type: "text", default: "Welcome to motion.", label: "Text" },+ text: {+ type: "text-content",+ default: "Welcome to motion.",+ description: "Text",+ },scaleFrom: {type: "number",- default: 0.96,min: 0.8,max: 1,step: 0.01,- label: "Scale from",+ default: 0.96,+ description: "Scale from",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/number-wheel/config.ts b/registry/remocn/number-wheel/config.tsindex de5068f2..3a06318e 100644--- a/registry/remocn/number-wheel/config.ts+++ b/registry/remocn/number-wheel/config.ts@@ -5,30 +5,35 @@ export const numberWheelConfig: ComponentConfig = {importPath: "@/components/remocn/number-wheel",controls: {from: {- type: "number-input",- default: 0,+ type: "number",min: 0,- max: 1000000,step: 1,- label: "From",+ default: 0,+ description: "From",+ hiddenFromList: false,},to: {- type: "number-input",- default: 24813,+ type: "number",min: 0,- max: 1000000,step: 1,- label: "To",+ default: 24813,+ description: "To",+ hiddenFromList: false,},fontSize: {type: "number",- default: 120,min: 24,max: 280,step: 4,- label: "Font size",+ default: 120,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },},durationInFrames: 112,fps: FPS,diff --git a/registry/remocn/opencode/config.ts b/registry/remocn/opencode/config.tsindex 525e19b6..22d18611 100644--- a/registry/remocn/opencode/config.ts+++ b/registry/remocn/opencode/config.ts@@ -5,19 +5,35 @@ export const opencodeConfig: ComponentConfig = {importPath: "@/components/remocn/opencode",controls: {placeholder: {- type: "text",+ type: "text-content",default: "Ask anything... ",- label: "Placeholder",+ description: "Placeholder",},query: {- type: "text",+ type: "text-content",default: '"What is the tech stack of this project?"',- label: "Query",+ description: "Query",+ },+ agentName: {+ type: "text-content",+ default: "Build",+ description: "Agent",+ },+ modelName: {+ type: "text-content",+ default: "Kimi K2.5",+ description: "Model",+ },+ provider: {+ type: "text-content",+ default: "Moonshot AI",+ description: "Provider",+ },+ accentColor: {+ type: "color",+ default: "#2B7FFF",+ description: "Accent",},- agentName: { type: "text", default: "Build", label: "Agent" },- modelName: { type: "text", default: "Kimi K2.5", label: "Model" },- provider: { type: "text", default: "Moonshot AI", label: "Provider" },- accentColor: { type: "color", default: "#2B7FFF", label: "Accent" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/page-turn/config.ts b/registry/remocn/page-turn/config.tsindex 7669c54e..6ad787c5 100644--- a/registry/remocn/page-turn/config.ts+++ b/registry/remocn/page-turn/config.ts@@ -7,19 +7,21 @@ export const pageTurnConfig: ComponentConfig = {controls: {angle: {type: "number",- default: -7,min: -20,max: 20,step: 1,- label: "Angle",+ default: -7,+ description: "Angle",+ hiddenFromList: false,},poses: {type: "number",- default: 8,min: 2,max: 16,step: 1,- label: "Poses",+ default: 8,+ description: "Poses",+ hiddenFromList: false,},},durationInFrames: 128,diff --git a/registry/remocn/paper-sticker/config.ts b/registry/remocn/paper-sticker/config.tsindex 2e76a9ea..6fbffd50 100644--- a/registry/remocn/paper-sticker/config.ts+++ b/registry/remocn/paper-sticker/config.ts@@ -7,30 +7,45 @@ export const paperStickerConfig: ComponentConfig = {controls: {at: {type: "number",- default: 0,min: 0,max: 60,step: 1,- label: "Slap frame",+ default: 0,+ description: "Slap frame",+ hiddenFromList: false,+ },+ padding: {+ type: "text-content",+ default: "10px 16px",+ description: "Padding",+ },+ background: {+ type: "color",+ default: "#fbfaf6",+ description: "Paper",},- padding: { type: "text", default: "10px 16px", label: "Padding" },- background: { type: "color", default: "#fbfaf6", label: "Paper" },maxTilt: {type: "number",- default: 2.6,min: 0,max: 8,step: 0.2,- label: "Max tilt",+ default: 2.6,+ description: "Max tilt",+ hiddenFromList: false,+ },+ seed: {+ type: "text-content",+ default: "sticker",+ description: "Seed",},- seed: { type: "text", default: "sticker", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: paperStickerExampleCode,diff --git a/registry/remocn/paper-wobble/config.ts b/registry/remocn/paper-wobble/config.tsindex a2c1316d..f96ab2a0 100644--- a/registry/remocn/paper-wobble/config.ts+++ b/registry/remocn/paper-wobble/config.ts@@ -7,28 +7,35 @@ export const paperWobbleConfig: ComponentConfig = {controls: {amp: {type: "number",- default: 1.4,min: 0,max: 6,step: 0.1,- label: "Offset",+ default: 1.4,+ description: "Offset",+ hiddenFromList: false,},rotAmp: {type: "number",- default: 0.35,min: 0,max: 2,step: 0.05,- label: "Rotation",+ default: 0.35,+ description: "Rotation",+ hiddenFromList: false,+ },+ seed: {+ type: "text-content",+ default: "wobble",+ description: "Seed",},- seed: { type: "text", default: "wobble", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: paperWobbleExampleCode,diff --git a/registry/remocn/particle-dissolve/config.ts b/registry/remocn/particle-dissolve/config.tsindex c1c233a7..0995cd22 100644--- a/registry/remocn/particle-dissolve/config.ts+++ b/registry/remocn/particle-dissolve/config.ts@@ -7,49 +7,60 @@ export const particleDissolveConfig: ComponentConfig = {controls: {particleSize: {type: "number",- default: 4,min: 1,max: 16,step: 1,- label: "Grain size",+ default: 4,+ description: "Grain size",+ hiddenFromList: false,},scatter: {type: "number",- default: 0.08,min: 0.01,max: 0.4,step: 0.01,- label: "Scatter",+ default: 0.08,+ description: "Scatter",+ hiddenFromList: false,},shimmer: {type: "number",- default: 0.6,min: 0,max: 1.5,step: 0.05,- label: "Shimmer",+ default: 0.6,+ description: "Shimmer",+ hiddenFromList: false,},aberration: {type: "number",- default: 0.5,min: 0,max: 1.5,step: 0.05,- label: "Aberration",+ default: 0.5,+ description: "Aberration",+ hiddenFromList: false,},direction: {- type: "select",+ type: "enum",default: "reveal",- options: ["reveal", "up", "down", "left", "right"],- label: "Direction",+ variants: {+ reveal: {},+ up: {},+ down: {},+ left: {},+ right: {},+ },+ description: "Direction",},stagger: {type: "number",- default: 0.55,min: 0,max: 0.9,step: 0.05,- label: "Stagger",+ default: 0.55,+ description: "Stagger",+ hiddenFromList: false,},},durationInFrames: 84,diff --git a/registry/remocn/per-character-rise/config.ts b/registry/remocn/per-character-rise/config.tsindex 5982fbca..26488955 100644--- a/registry/remocn/per-character-rise/config.ts+++ b/registry/remocn/per-character-rise/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const perCharacterRiseConfig: ComponentConfig = {componentName: "PerCharacterRise",importPath: "@/components/remocn/per-character-rise",controls: {- text: { type: "text", default: "One more thing.", label: "Text" },+ text: {+ type: "text-content",+ default: "One more thing.",+ description: "Text",+ },distance: {type: "number",- default: 32,min: 0,max: 120,step: 1,- label: "Distance",+ default: 32,+ description: "Distance",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/per-word-crossfade/config.ts b/registry/remocn/per-word-crossfade/config.tsindex 4e7ffa75..35a221c1 100644--- a/registry/remocn/per-word-crossfade/config.ts+++ b/registry/remocn/per-word-crossfade/config.ts@@ -1,35 +1,43 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const perWordCrossfadeConfig: ComponentConfig = {componentName: "PerWordCrossfade",importPath: "@/components/remocn/per-word-crossfade",controls: {fromText: {- type: "text",+ type: "text-content",default: "Beautifully simple.",- label: "From text",+ description: "From text",+ },+ toText: {+ type: "text-content",+ default: "Designed for focus.",+ description: "To text",},- toText: { type: "text", default: "Designed for focus.", label: "To text" },fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/perlin-dissolve/config.ts b/registry/remocn/perlin-dissolve/config.tsindex e9a80adb..5fe502b6 100644--- a/registry/remocn/perlin-dissolve/config.ts+++ b/registry/remocn/perlin-dissolve/config.ts@@ -5,15 +5,24 @@ export const perlinDissolveConfig: ComponentConfig = {componentName: "perlinDissolve",importPath: "@/components/remocn/perlin-dissolve",controls: {- colorFront: { type: "color", default: "#8f88ae", label: "Ink" },- colorBack: { type: "color", default: "#141318", label: "Background" },+ colorFront: {+ type: "color",+ default: "#8f88ae",+ description: "Ink",+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",+ },softness: {type: "number",- default: 0.1,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.1,+ description: "Softness",+ hiddenFromList: false,},},durationInFrames: 116,diff --git a/registry/remocn/perspective-marquee/config.ts b/registry/remocn/perspective-marquee/config.tsindex 4f96c9be..ff2632ba 100644--- a/registry/remocn/perspective-marquee/config.ts+++ b/registry/remocn/perspective-marquee/config.ts@@ -1,10 +1,4 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const perspectiveMarqueeConfig: ComponentConfig = {componentName: "PerspectiveMarquee",@@ -12,52 +6,70 @@ export const perspectiveMarqueeConfig: ComponentConfig = {controls: {fontSize: {type: "number",- default: 84,min: 24,max: 200,step: 2,- label: "Font size",+ default: 84,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#fafafa",+ description: "Color",},- color: { type: "color", default: "#fafafa", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},pixelsPerFrame: {type: "number",- default: 2,min: 0.25,max: 10,step: 0.25,- label: "Pixels / frame",+ default: 2,+ description: "Pixels / frame",+ hiddenFromList: false,},rotateY: {type: "number",- default: -28,min: -60,max: 60,step: 1,- label: "Rotate Y (deg)",+ default: -28,+ description: "Rotate Y (deg)",+ hiddenFromList: false,},rotateX: {type: "number",- default: 8,min: -30,max: 30,step: 1,- label: "Rotate X (deg)",+ default: 8,+ description: "Rotate X (deg)",+ hiddenFromList: false,},perspective: {type: "number",- default: 1200,min: 400,max: 3000,step: 50,- label: "Perspective",+ default: 1200,+ description: "Perspective",+ hiddenFromList: false,+ },+ fadeColor: {+ type: "color",+ default: "#050505",+ description: "Fade color",},- fadeColor: { type: "color", default: "#050505", label: "Fade color" },},durationInFrames: 240,fps: FPS,diff --git a/registry/remocn/perspective-squeeze/config.ts b/registry/remocn/perspective-squeeze/config.tsindex 48591ed7..65ebcec5 100644--- a/registry/remocn/perspective-squeeze/config.ts+++ b/registry/remocn/perspective-squeeze/config.ts@@ -4,26 +4,39 @@ export const perspectiveSqueezeConfig: ComponentConfig = {componentName: "PerspectiveSqueeze",importPath: "@/components/remocn/perspective-squeeze",controls: {- upperText: { type: "text", default: "REMOCN", label: "Upper line" },- lowerText: { type: "text", default: "BEST", label: "Lower line" },- fill: { type: "color", default: "#f2f2f2", label: "Fill" },+ upperText: {+ type: "text-content",+ default: "REMOCN",+ description: "Upper line",+ },+ lowerText: {+ type: "text-content",+ default: "BEST",+ description: "Lower line",+ },+ fill: {+ type: "color",+ default: "#f2f2f2",+ description: "Fill",+ },upperFontFamily: {- type: "text",+ type: "text-content",default: "Impact, 'Arial Narrow', sans-serif",- label: "Upper font",+ description: "Upper font",},lowerFontFamily: {- type: "text",+ type: "text-content",default: "Impact, 'Arial Narrow', sans-serif",- label: "Lower font",+ description: "Lower font",},lineGap: {type: "number",- default: 50,min: 0,max: 120,step: 2,- label: "Line gap",+ default: 50,+ description: "Line gap",+ hiddenFromList: false,},},durationInFrames: 225,diff --git a/registry/remocn/pixelate-region/config.ts b/registry/remocn/pixelate-region/config.tsindex bdcd54bf..fac2c8c3 100644--- a/registry/remocn/pixelate-region/config.ts+++ b/registry/remocn/pixelate-region/config.ts@@ -7,11 +7,12 @@ export const pixelateRegionConfig: ComponentConfig = {controls: {cellSize: {type: "number",- default: 24,min: 6,max: 72,step: 2,- label: "Cell size",+ default: 24,+ description: "Cell size",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/polaroid/config.ts b/registry/remocn/polaroid/config.tsindex 5dfc2ecc..af96b52f 100644--- a/registry/remocn/polaroid/config.ts+++ b/registry/remocn/polaroid/config.ts@@ -5,38 +5,46 @@ export const polaroidConfig: ComponentConfig = {componentName: "Polaroid",importPath: "@/components/remocn/polaroid",controls: {- caption: { type: "text", default: "first light", label: "Caption" },+ caption: {+ type: "text-content",+ default: "first light",+ description: "Caption",+ },captionAt: {type: "number",- default: 0,min: 0,max: 60,step: 1,- label: "Caption starts",+ default: 0,+ description: "Caption starts",+ hiddenFromList: false,},width: {type: "number",- default: 652,min: 320,max: 900,step: 4,- label: "Card width",+ default: 652,+ description: "Card width",+ hiddenFromList: false,},captionSize: {type: "number",- default: 36,min: 20,max: 56,step: 1,- label: "Caption size",+ default: 36,+ description: "Caption size",+ hiddenFromList: false,},step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: polaroidExampleCode,diff --git a/registry/remocn/push-through/config.ts b/registry/remocn/push-through/config.tsindex 6c54562a..7b23c722 100644--- a/registry/remocn/push-through/config.ts+++ b/registry/remocn/push-through/config.ts@@ -7,19 +7,21 @@ export const pushThroughConfig: ComponentConfig = {controls: {zoom: {type: "number",- default: 2.4,min: 1.5,max: 4,step: 0.1,- label: "Zoom",+ default: 2.4,+ description: "Zoom",+ hiddenFromList: false,},blur: {type: "number",- default: 14,min: 0,max: 30,step: 1,- label: "Blur",+ default: 14,+ description: "Blur",+ hiddenFromList: false,},},durationInFrames: 112,diff --git a/registry/remocn/reel/config.ts b/registry/remocn/reel/config.tsindex 4b8b2869..cd520480 100644--- a/registry/remocn/reel/config.ts+++ b/registry/remocn/reel/config.ts@@ -7,43 +7,48 @@ export const reelConfig: ComponentConfig = {controls: {width: {type: "number",- default: 1180,min: 600,max: 1280,step: 20,- label: "Card width",+ default: 1180,+ description: "Card width",+ hiddenFromList: false,},height: {type: "number",- default: 676,min: 360,max: 720,step: 4,- label: "Card height",+ default: 676,+ description: "Card height",+ hiddenFromList: false,},radius: {type: "number",- default: 16,min: 0,max: 40,step: 1,- label: "Corner radius",+ default: 16,+ description: "Corner radius",+ hiddenFromList: false,},step: {type: "number",- default: 20,min: 6,max: 40,step: 1,- label: "Frames / image",+ default: 20,+ description: "Frames / image",+ hiddenFromList: false,},reveal: {type: "number",- default: 13,min: 4,max: 30,step: 1,- label: "Reveal frames",+ default: 13,+ description: "Reveal frames",+ hiddenFromList: false,},},durationInFrames: 160,diff --git a/registry/remocn/rgb-glitch-text/config.ts b/registry/remocn/rgb-glitch-text/config.tsindex c1f11a32..d1b6c352 100644--- a/registry/remocn/rgb-glitch-text/config.ts+++ b/registry/remocn/rgb-glitch-text/config.ts@@ -1,56 +1,71 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const rgbGlitchTextConfig: ComponentConfig = {componentName: "RGBGlitchText",importPath: "@/components/remocn/rgb-glitch-text",controls: {- text: { type: "text", default: "GLITCH", label: "Text" },+ text: {+ type: "text-content",+ default: "GLITCH",+ description: "Text",+ },fontSize: {type: "number",- default: 96,min: 12,max: 200,step: 1,- label: "Font size",+ default: 96,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},glitchAt: {type: "number",- default: 20,min: 0,max: 120,step: 1,- label: "Glitch at (frame)",+ default: 20,+ description: "Glitch at (frame)",+ hiddenFromList: false,},glitchDuration: {type: "number",- default: 8,min: 1,max: 60,step: 1,- label: "Glitch duration",+ default: 8,+ description: "Glitch duration",+ hiddenFromList: false,},intensity: {type: "number",- default: 6,min: 0,max: 30,step: 1,- label: "Intensity (px)",+ default: 6,+ description: "Intensity (px)",+ hiddenFromList: false,+ },+ seed: {+ type: "text-content",+ default: "glitch",+ description: "Seed",},- seed: { type: "text", default: "glitch", label: "Seed" },},durationInFrames: 90,fps: FPS,diff --git a/registry/remocn/ripple-zoom/config.ts b/registry/remocn/ripple-zoom/config.tsindex cf1ca2df..da696a5e 100644--- a/registry/remocn/ripple-zoom/config.ts+++ b/registry/remocn/ripple-zoom/config.ts@@ -7,29 +7,36 @@ export const rippleZoomConfig: ComponentConfig = {controls: {zoom: {type: "number",- default: 4,min: 1.5,max: 8,step: 0.25,- label: "Zoom",+ default: 4,+ description: "Zoom",+ hiddenFromList: false,},intensity: {type: "number",- default: 0.5,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 0.5,+ description: "Intensity",+ hiddenFromList: false,},softness: {type: "number",- default: 0.5,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.5,+ description: "Softness",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",},- colorBack: { type: "color", default: "#141318", label: "Background" },},durationInFrames: 116,fps: FPS,diff --git a/registry/remocn/rolling-number/config.ts b/registry/remocn/rolling-number/config.tsindex e60cfe75..e27b0a4a 100644--- a/registry/remocn/rolling-number/config.ts+++ b/registry/remocn/rolling-number/config.ts@@ -5,30 +5,35 @@ export const rollingNumberConfig: ComponentConfig = {importPath: "@/components/remocn/rolling-number",controls: {from: {- type: "number-input",- default: 0,+ type: "number",min: 0,- max: 1000000,step: 1,- label: "From",+ default: 0,+ description: "From",+ hiddenFromList: false,},to: {- type: "number-input",- default: 24813,+ type: "number",min: 0,- max: 1000000,step: 1,- label: "To",+ default: 24813,+ description: "To",+ hiddenFromList: false,},fontSize: {type: "number",- default: 120,min: 24,max: 280,step: 4,- label: "Font size",+ default: 120,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/rolodex-flip/config.ts b/registry/remocn/rolodex-flip/config.tsindex a5fb3469..8e738694 100644--- a/registry/remocn/rolodex-flip/config.ts+++ b/registry/remocn/rolodex-flip/config.ts@@ -7,19 +7,21 @@ export const rolodexFlipConfig: ComponentConfig = {controls: {interval: {type: "number",- default: 20,min: 10,max: 40,step: 2,- label: "Interval",+ default: 20,+ description: "Interval",+ hiddenFromList: false,},flipDuration: {type: "number",- default: 10,min: 4,max: 20,step: 1,- label: "Flip duration",+ default: 10,+ description: "Flip duration",+ hiddenFromList: false,},},durationInFrames: 110,diff --git a/registry/remocn/scale-down-fade/config.ts b/registry/remocn/scale-down-fade/config.tsindex d9da3bcd..4dc165a7 100644--- a/registry/remocn/scale-down-fade/config.ts+++ b/registry/remocn/scale-down-fade/config.ts@@ -1,30 +1,38 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const scaleDownFadeConfig: ComponentConfig = {componentName: "ScaleDownFade",importPath: "@/components/remocn/scale-down-fade",controls: {- text: { type: "text", default: "Quietly refined.", label: "Text" },+ text: {+ type: "text-content",+ default: "Quietly refined.",+ description: "Text",+ },fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/scribble-circle/config.ts b/registry/remocn/scribble-circle/config.tsindex 0947fc06..72bc1712 100644--- a/registry/remocn/scribble-circle/config.ts+++ b/registry/remocn/scribble-circle/config.ts@@ -7,53 +7,67 @@ export const scribbleCircleConfig: ComponentConfig = {controls: {laps: {type: "number",- default: 1.15,min: 0.5,max: 3,step: 0.05,- label: "Laps",+ default: 1.15,+ description: "Laps",+ hiddenFromList: false,},strokeWidth: {type: "number",- default: 14,min: 4,max: 32,step: 1,- label: "Brush width",+ default: 14,+ description: "Brush width",+ hiddenFromList: false,},pressure: {type: "number",- default: 0.2,min: 0.05,max: 1,step: 0.05,- label: "Opening pressure",+ default: 0.2,+ description: "Opening pressure",+ hiddenFromList: false,},grain: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "Grain",+ default: 1,+ description: "Grain",+ hiddenFromList: false,},durationSteps: {type: "number",- default: 10,min: 2,max: 20,step: 1,- label: "Poses to draw",+ default: 10,+ description: "Poses to draw",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#6f7f35",+ description: "Ink color",+ },+ seed: {+ type: "text-content",+ default: "scribble",+ description: "Seed",},- color: { type: "color", default: "#6f7f35", label: "Ink color" },- seed: { type: "text", default: "scribble", label: "Seed" },step: {type: "number",- default: 3,min: 1,max: 6,step: 1,- label: "Frames / pose",+ default: 3,+ description: "Frames / pose",+ hiddenFromList: false,},},snippet: scribbleCircleExampleCode,diff --git a/registry/remocn/security-cam/config.ts b/registry/remocn/security-cam/config.tsindex 7e374e42..790819ad 100644--- a/registry/remocn/security-cam/config.ts+++ b/registry/remocn/security-cam/config.ts@@ -7,35 +7,39 @@ export const securityCamConfig: ComponentConfig = {controls: {compression: {type: "number",- default: 0.7,min: 0,max: 1,step: 0.05,- label: "Compression",+ default: 0.7,+ description: "Compression",+ hiddenFromList: false,},blockSize: {type: "number",- default: 10,min: 4,max: 32,step: 1,- label: "Macroblock",+ default: 10,+ description: "Macroblock",+ hiddenFromList: false,},noise: {type: "number",- default: 0.6,min: 0,max: 2,step: 0.05,- label: "Sensor noise",+ default: 0.6,+ description: "Sensor noise",+ hiddenFromList: false,},intensity: {type: "number",- default: 1,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/shader-caustics/config.ts b/registry/remocn/shader-caustics/config.tsindex 0450523c..57e56f47 100644--- a/registry/remocn/shader-caustics/config.ts+++ b/registry/remocn/shader-caustics/config.ts@@ -6,36 +6,44 @@ export const shaderCausticsConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},scale: {type: "number",- default: 5.2,min: 1,max: 12,step: 0.1,- label: "Scale",+ default: 5.2,+ description: "Scale",+ hiddenFromList: false,},intensity: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,+ },+ accent: {+ type: "color",+ default: "#7F57FF",+ description: "Accent",},- accent: { type: "color", default: "#7F57FF", label: "Accent" },accentAmount: {type: "number",- default: 0,min: 0,max: 1,step: 0.05,- label: "Accent amount",+ default: 0,+ description: "Accent amount",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shader-color-panels/config.ts b/registry/remocn/shader-color-panels/config.tsindex 49a15646..c3c664ba 100644--- a/registry/remocn/shader-color-panels/config.ts+++ b/registry/remocn/shader-color-panels/config.ts@@ -6,29 +6,36 @@ export const shaderColorPanelsConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},density: {type: "number",- default: 3,min: 1,max: 8,step: 1,- label: "Density",+ default: 3,+ description: "Density",+ hiddenFromList: false,},length: {type: "number",- default: 1.1,min: 0.5,max: 3,step: 0.1,- label: "Length",+ default: 1.1,+ description: "Length",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-dithering/config.ts b/registry/remocn/shader-dithering/config.tsindex 9bac4830..b2d13790 100644--- a/registry/remocn/shader-dithering/config.ts+++ b/registry/remocn/shader-dithering/config.ts@@ -6,22 +6,32 @@ export const shaderDitheringConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},size: {type: "number",- default: 2,min: 1,max: 8,step: 1,- label: "Dot Size",+ default: 2,+ description: "Dot Size",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",+ },+ colorFront: {+ type: "color",+ default: "#6a6a85",+ description: "Front",},- colorBack: { type: "color", default: "#12121a", label: "Background" },- colorFront: { type: "color", default: "#6a6a85", label: "Front" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-dot-orbit/config.ts b/registry/remocn/shader-dot-orbit/config.tsindex 91dcd00c..30d030db 100644--- a/registry/remocn/shader-dot-orbit/config.ts+++ b/registry/remocn/shader-dot-orbit/config.ts@@ -6,29 +6,36 @@ export const shaderDotOrbitConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},size: {type: "number",- default: 1,min: 0.1,max: 3,step: 0.1,- label: "Size",+ default: 1,+ description: "Size",+ hiddenFromList: false,},spreading: {type: "number",- default: 1,min: 0,max: 2,step: 0.1,- label: "Spreading",+ default: 1,+ description: "Spreading",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-gem-smoke/config.ts b/registry/remocn/shader-gem-smoke/config.tsindex 8494d202..ba0c387a 100644--- a/registry/remocn/shader-gem-smoke/config.ts+++ b/registry/remocn/shader-gem-smoke/config.ts@@ -6,36 +6,44 @@ export const shaderGemSmokeConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#0a0a10",+ description: "Background",},- colorBack: { type: "color", default: "#0a0a10", label: "Background" },innerDistortion: {type: "number",- default: 0.8,min: 0,max: 2,step: 0.05,- label: "Inner distortion",+ default: 0.8,+ description: "Inner distortion",+ hiddenFromList: false,},outerDistortion: {type: "number",- default: 0.6,min: 0,max: 2,step: 0.05,- label: "Outer distortion",+ default: 0.6,+ description: "Outer distortion",+ hiddenFromList: false,},size: {type: "number",- default: 0.8,min: 0.2,max: 1.5,step: 0.05,- label: "Size",+ default: 0.8,+ description: "Size",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shader-god-rays/config.ts b/registry/remocn/shader-god-rays/config.tsindex be593dae..565de616 100644--- a/registry/remocn/shader-god-rays/config.ts+++ b/registry/remocn/shader-god-rays/config.ts@@ -6,37 +6,45 @@ export const shaderGodRaysConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},intensity: {type: "number",- default: 0.8,min: 0,max: 2,step: 0.05,- label: "Intensity",+ default: 0.8,+ description: "Intensity",+ hiddenFromList: false,},density: {type: "number",- default: 0.3,min: 0,max: 1,step: 0.05,- label: "Density",+ default: 0.3,+ description: "Density",+ hiddenFromList: false,},bloom: {type: "number",- default: 0.4,min: 0,max: 1,step: 0.05,- label: "Bloom",+ default: 0.4,+ description: "Bloom",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-grain-gradient/config.ts b/registry/remocn/shader-grain-gradient/config.tsindex 82e2c897..8e8c53c5 100644--- a/registry/remocn/shader-grain-gradient/config.ts+++ b/registry/remocn/shader-grain-gradient/config.ts@@ -6,37 +6,45 @@ export const shaderGrainGradientConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},softness: {type: "number",- default: 0.6,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.6,+ description: "Softness",+ hiddenFromList: false,},intensity: {type: "number",- default: 0.2,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 0.2,+ description: "Intensity",+ hiddenFromList: false,},noise: {type: "number",- default: 0.15,min: 0,max: 1,step: 0.05,- label: "Noise",+ default: 0.15,+ description: "Noise",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-liquid-metal/config.ts b/registry/remocn/shader-liquid-metal/config.tsindex aa4259ef..45a6cd8c 100644--- a/registry/remocn/shader-liquid-metal/config.ts+++ b/registry/remocn/shader-liquid-metal/config.ts@@ -6,38 +6,50 @@ export const shaderLiquidMetalConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},distortion: {type: "number",- default: 0.1,min: 0,max: 0.5,step: 0.01,- label: "Distortion",+ default: 0.1,+ description: "Distortion",+ hiddenFromList: false,},repetition: {type: "number",- default: 1.5,min: 1,max: 6,step: 0.5,- label: "Repetition",+ default: 1.5,+ description: "Repetition",+ hiddenFromList: false,},contour: {type: "number",- default: 0.4,min: 0,max: 1,step: 0.05,- label: "Contour",+ default: 0.4,+ description: "Contour",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#2a2a30",+ description: "Background",+ },+ colorTint: {+ type: "color",+ default: "#8a8a95",+ description: "Tint",},- colorBack: { type: "color", default: "#2a2a30", label: "Background" },- colorTint: { type: "color", default: "#8a8a95", label: "Tint" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-mesh-gradient/config.ts b/registry/remocn/shader-mesh-gradient/config.tsindex 25967c5e..2542309a 100644--- a/registry/remocn/shader-mesh-gradient/config.ts+++ b/registry/remocn/shader-mesh-gradient/config.ts@@ -6,27 +6,30 @@ export const shaderMeshGradientConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},distortion: {type: "number",- default: 0.6,min: 0,max: 1.5,step: 0.05,- label: "Distortion",+ default: 0.6,+ description: "Distortion",+ hiddenFromList: false,},swirl: {type: "number",- default: 0.1,min: 0,max: 1,step: 0.05,- label: "Swirl",+ default: 0.1,+ description: "Swirl",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shader-metaballs/config.ts b/registry/remocn/shader-metaballs/config.tsindex a4f36b5d..386be456 100644--- a/registry/remocn/shader-metaballs/config.ts+++ b/registry/remocn/shader-metaballs/config.ts@@ -6,29 +6,36 @@ export const shaderMetaballsConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},count: {type: "number",- default: 10,min: 1,max: 20,step: 1,- label: "Count",+ default: 10,+ description: "Count",+ hiddenFromList: false,},size: {type: "number",- default: 0.83,min: 0.2,max: 1.5,step: 0.05,- label: "Size",+ default: 0.83,+ description: "Size",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-neuro-noise/config.ts b/registry/remocn/shader-neuro-noise/config.tsindex d3632a03..6f40b8d5 100644--- a/registry/remocn/shader-neuro-noise/config.ts+++ b/registry/remocn/shader-neuro-noise/config.ts@@ -6,30 +6,41 @@ export const shaderNeuroNoiseConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},brightness: {type: "number",- default: 0.05,min: 0,max: 1,step: 0.05,- label: "Brightness",+ default: 0.05,+ description: "Brightness",+ hiddenFromList: false,},contrast: {type: "number",- default: 0.3,min: 0,max: 1,step: 0.05,- label: "Contrast",+ default: 0.3,+ description: "Contrast",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",+ },+ colorMid: {+ type: "color",+ default: "#4a4a68",+ description: "Mid",},- colorBack: { type: "color", default: "#12121a", label: "Background" },- colorMid: { type: "color", default: "#4a4a68", label: "Mid" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-perlin-noise/config.ts b/registry/remocn/shader-perlin-noise/config.tsindex 06decf29..25f3b571 100644--- a/registry/remocn/shader-perlin-noise/config.ts+++ b/registry/remocn/shader-perlin-noise/config.ts@@ -6,30 +6,41 @@ export const shaderPerlinNoiseConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},proportion: {type: "number",- default: 0.35,min: 0,max: 1,step: 0.05,- label: "Proportion",+ default: 0.35,+ description: "Proportion",+ hiddenFromList: false,},softness: {type: "number",- default: 0.1,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.1,+ description: "Softness",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",+ },+ colorFront: {+ type: "color",+ default: "#6a6a85",+ description: "Front",},- colorBack: { type: "color", default: "#12121a", label: "Background" },- colorFront: { type: "color", default: "#6a6a85", label: "Front" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-pulsing-border/config.ts b/registry/remocn/shader-pulsing-border/config.tsindex 6407db58..28334b16 100644--- a/registry/remocn/shader-pulsing-border/config.ts+++ b/registry/remocn/shader-pulsing-border/config.ts@@ -6,37 +6,45 @@ export const shaderPulsingBorderConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},thickness: {type: "number",- default: 0.1,min: 0.02,max: 0.5,step: 0.02,- label: "Thickness",+ default: 0.1,+ description: "Thickness",+ hiddenFromList: false,},roundness: {type: "number",- default: 0.25,min: 0,max: 1,step: 0.05,- label: "Roundness",+ default: 0.25,+ description: "Roundness",+ hiddenFromList: false,},intensity: {type: "number",- default: 0.2,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 0.2,+ description: "Intensity",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-simplex-noise/config.ts b/registry/remocn/shader-simplex-noise/config.tsindex ed873162..e49c2157 100644--- a/registry/remocn/shader-simplex-noise/config.ts+++ b/registry/remocn/shader-simplex-noise/config.ts@@ -6,27 +6,30 @@ export const shaderSimplexNoiseConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},stepsPerColor: {type: "number",- default: 2,min: 1,max: 6,step: 1,- label: "Steps",+ default: 2,+ description: "Steps",+ hiddenFromList: false,},softness: {type: "number",- default: 0.1,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.1,+ description: "Softness",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shader-smoke-ring/config.ts b/registry/remocn/shader-smoke-ring/config.tsindex c9d0c9d4..caefacd6 100644--- a/registry/remocn/shader-smoke-ring/config.ts+++ b/registry/remocn/shader-smoke-ring/config.ts@@ -6,37 +6,45 @@ export const shaderSmokeRingConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},radius: {type: "number",- default: 0.25,min: 0,max: 1,step: 0.05,- label: "Radius",+ default: 0.25,+ description: "Radius",+ hiddenFromList: false,},thickness: {type: "number",- default: 0.65,min: 0.1,max: 1.5,step: 0.05,- label: "Thickness",+ default: 0.65,+ description: "Thickness",+ hiddenFromList: false,},scale: {type: "number",- default: 0.8,min: 0.3,max: 2,step: 0.05,- label: "Scale",+ default: 0.8,+ description: "Scale",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-spiral/config.ts b/registry/remocn/shader-spiral/config.tsindex fbb2e3b8..804c1222 100644--- a/registry/remocn/shader-spiral/config.ts+++ b/registry/remocn/shader-spiral/config.ts@@ -6,37 +6,45 @@ export const shaderSpiralConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},density: {type: "number",- default: 1,min: 0.2,max: 4,step: 0.1,- label: "Density",+ default: 1,+ description: "Density",+ hiddenFromList: false,},strokeWidth: {type: "number",- default: 0.5,min: 0.05,max: 1,step: 0.05,- label: "Stroke",+ default: 0.5,+ description: "Stroke",+ hiddenFromList: false,},softness: {type: "number",- default: 0.2,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.2,+ description: "Softness",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-strata/config.ts b/registry/remocn/shader-strata/config.tsindex 8adcd174..704eb3e4 100644--- a/registry/remocn/shader-strata/config.ts+++ b/registry/remocn/shader-strata/config.ts@@ -6,36 +6,44 @@ export const shaderStrataConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},layers: {type: "number",- default: 14,min: 4,max: 30,step: 1,- label: "Layers",+ default: 14,+ description: "Layers",+ hiddenFromList: false,},amplitude: {type: "number",- default: 0.16,min: 0,max: 0.5,step: 0.01,- label: "Amplitude",+ default: 0.16,+ description: "Amplitude",+ hiddenFromList: false,+ },+ accent: {+ type: "color",+ default: "#6733FF",+ description: "Accent",},- accent: { type: "color", default: "#6733FF", label: "Accent" },accentAmount: {type: "number",- default: 0,min: 0,max: 1,step: 0.05,- label: "Accent amount",+ default: 0,+ description: "Accent amount",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shader-swirl/config.ts b/registry/remocn/shader-swirl/config.tsindex 5685531e..d56a87d2 100644--- a/registry/remocn/shader-swirl/config.ts+++ b/registry/remocn/shader-swirl/config.ts@@ -6,37 +6,45 @@ export const shaderSwirlConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},bandCount: {type: "number",- default: 4,min: 1,max: 12,step: 1,- label: "Bands",+ default: 4,+ description: "Bands",+ hiddenFromList: false,},twist: {type: "number",- default: 0.1,min: 0,max: 1,step: 0.05,- label: "Twist",+ default: 0.1,+ description: "Twist",+ hiddenFromList: false,},softness: {type: "number",- default: 0.2,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.2,+ description: "Softness",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#12121a",+ description: "Background",},- colorBack: { type: "color", default: "#12121a", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-voronoi/config.ts b/registry/remocn/shader-voronoi/config.tsindex 7ad2108e..3a7250a2 100644--- a/registry/remocn/shader-voronoi/config.ts+++ b/registry/remocn/shader-voronoi/config.ts@@ -6,37 +6,45 @@ export const shaderVoronoiConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},distortion: {type: "number",- default: 0.4,min: 0,max: 1,step: 0.05,- label: "Distortion",+ default: 0.4,+ description: "Distortion",+ hiddenFromList: false,},gap: {type: "number",- default: 0.04,min: 0,max: 0.2,step: 0.01,- label: "Gap",+ default: 0.04,+ description: "Gap",+ hiddenFromList: false,},glow: {type: "number",- default: 0,min: 0,max: 1,step: 0.05,- label: "Glow",+ default: 0,+ description: "Glow",+ hiddenFromList: false,+ },+ colorGap: {+ type: "color",+ default: "#12121a",+ description: "Gap Color",},- colorGap: { type: "color", default: "#12121a", label: "Gap Color" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-warp/config.ts b/registry/remocn/shader-warp/config.tsindex 062c8d2c..ce03a817 100644--- a/registry/remocn/shader-warp/config.ts+++ b/registry/remocn/shader-warp/config.ts@@ -6,43 +6,48 @@ export const shaderWarpConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},distortion: {type: "number",- default: 0.2,min: 0,max: 1,step: 0.05,- label: "Distortion",+ default: 0.2,+ description: "Distortion",+ hiddenFromList: false,},swirl: {type: "number",- default: 0.4,min: 0,max: 1,step: 0.05,- label: "Swirl",+ default: 0.4,+ description: "Swirl",+ hiddenFromList: false,},softness: {type: "number",- default: 1,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 1,+ description: "Softness",+ hiddenFromList: false,},proportion: {type: "number",- default: 0.5,min: 0,max: 1,step: 0.05,- label: "Proportion",+ default: 0.5,+ description: "Proportion",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shader-water/config.ts b/registry/remocn/shader-water/config.tsindex e0982647..2e528c2e 100644--- a/registry/remocn/shader-water/config.ts+++ b/registry/remocn/shader-water/config.ts@@ -6,37 +6,45 @@ export const shaderWaterConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0.1,max: 4,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},waves: {type: "number",- default: 0.3,min: 0,max: 1,step: 0.05,- label: "Waves",+ default: 0.3,+ description: "Waves",+ hiddenFromList: false,},caustic: {type: "number",- default: 0.08,min: 0,max: 1,step: 0.02,- label: "Caustic",+ default: 0.08,+ description: "Caustic",+ hiddenFromList: false,},highlights: {type: "number",- default: 0.06,min: 0,max: 1,step: 0.02,- label: "Highlights",+ default: 0.06,+ description: "Highlights",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#16202b",+ description: "Background",},- colorBack: { type: "color", default: "#16202b", label: "Background" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/shader-weave/config.ts b/registry/remocn/shader-weave/config.tsindex 743b7b0a..88cc71d7 100644--- a/registry/remocn/shader-weave/config.ts+++ b/registry/remocn/shader-weave/config.ts@@ -6,36 +6,44 @@ export const shaderWeaveConfig: ComponentConfig = {controls: {speed: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Speed",+ default: 1,+ description: "Speed",+ hiddenFromList: false,},scale: {type: "number",- default: 22,min: 6,max: 48,step: 1,- label: "Scale",+ default: 22,+ description: "Scale",+ hiddenFromList: false,},warp: {type: "number",- default: 0.03,min: 0,max: 0.2,step: 0.01,- label: "Warp",+ default: 0.03,+ description: "Warp",+ hiddenFromList: false,+ },+ accent: {+ type: "color",+ default: "#6733FF",+ description: "Accent",},- accent: { type: "color", default: "#6733FF", label: "Accent" },accentAmount: {type: "number",- default: 0,min: 0,max: 1,step: 0.05,- label: "Accent amount",+ default: 0,+ description: "Accent amount",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/shared-axis-y/config.ts b/registry/remocn/shared-axis-y/config.tsindex 621000c4..c8f50f15 100644--- a/registry/remocn/shared-axis-y/config.ts+++ b/registry/remocn/shared-axis-y/config.ts@@ -1,39 +1,43 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const sharedAxisYConfig: ComponentConfig = {componentName: "SharedAxisY",importPath: "@/components/remocn/shared-axis-y",controls: {fromText: {- type: "text",+ type: "text-content",default: "Layered navigation.",- label: "From text",+ description: "From text",},toText: {- type: "text",+ type: "text-content",default: "Hierarchy made clear.",- label: "To text",+ description: "To text",},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/shared-axis-z/config.ts b/registry/remocn/shared-axis-z/config.tsindex 75805447..32a6eae6 100644--- a/registry/remocn/shared-axis-z/config.ts+++ b/registry/remocn/shared-axis-z/config.ts@@ -1,35 +1,43 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const sharedAxisZConfig: ComponentConfig = {componentName: "SharedAxisZ",importPath: "@/components/remocn/shared-axis-z",controls: {fromText: {- type: "text",+ type: "text-content",default: "Zooming between states.",- label: "From text",+ description: "From text",+ },+ toText: {+ type: "text-content",+ default: "Elevate and settle.",+ description: "To text",},- toText: { type: "text", default: "Elevate and settle.", label: "To text" },fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/shimmer-sweep/config.ts b/registry/remocn/shimmer-sweep/config.tsindex 19fd3940..650b8227 100644--- a/registry/remocn/shimmer-sweep/config.ts+++ b/registry/remocn/shimmer-sweep/config.ts@@ -1,31 +1,43 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const shimmerSweepConfig: ComponentConfig = {componentName: "ShimmerSweep",importPath: "@/components/remocn/shimmer-sweep",controls: {- text: { type: "text", default: "Generating", label: "Text" },- baseColor: { type: "color", default: "#3f3f46", label: "Base color" },- shineColor: { type: "color", default: "#fafafa", label: "Shine color" },+ text: {+ type: "text-content",+ default: "Generating",+ description: "Text",+ },+ baseColor: {+ type: "color",+ default: "#3f3f46",+ description: "Base color",+ },+ shineColor: {+ type: "color",+ default: "#fafafa",+ description: "Shine color",+ },fontSize: {type: "number",- default: 96,min: 12,max: 200,step: 1,- label: "Font size",+ default: 96,+ description: "Font size",+ hiddenFromList: false,},fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 120,diff --git a/registry/remocn/short-slide-down/config.ts b/registry/remocn/short-slide-down/config.tsindex 4e51a7d6..777cc3fd 100644--- a/registry/remocn/short-slide-down/config.ts+++ b/registry/remocn/short-slide-down/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const shortSlideDownConfig: ComponentConfig = {componentName: "ShortSlideDown",importPath: "@/components/remocn/short-slide-down",controls: {- text: { type: "text", default: "Build from above.", label: "Text" },+ text: {+ type: "text-content",+ default: "Build from above.",+ description: "Text",+ },entryOffset: {type: "number",- default: 28,min: 8,max: 80,step: 1,- label: "Entry offset",+ default: 28,+ description: "Entry offset",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/short-slide-right/config.ts b/registry/remocn/short-slide-right/config.tsindex d4ceb712..adb8482d 100644--- a/registry/remocn/short-slide-right/config.ts+++ b/registry/remocn/short-slide-right/config.ts@@ -1,46 +1,56 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const shortSlideRightConfig: ComponentConfig = {componentName: "ShortSlideRight",importPath: "@/components/remocn/short-slide-right",controls: {- text: { type: "text", default: "Move with intent.", label: "Text" },+ text: {+ type: "text-content",+ default: "Move with intent.",+ description: "Text",+ },distance: {type: "number",- default: 24,min: 0,max: 120,step: 1,- label: "Distance",+ default: 24,+ description: "Distance",+ hiddenFromList: false,},staggerDelay: {type: "number",- default: 3,min: 0,max: 12,step: 1,- label: "Stagger",+ default: 3,+ description: "Stagger",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/simulated-cursor/config.ts b/registry/remocn/simulated-cursor/config.tsindex 2d0db66e..1e0f4fad 100644--- a/registry/remocn/simulated-cursor/config.ts+++ b/registry/remocn/simulated-cursor/config.ts@@ -4,14 +4,19 @@ export const simulatedCursorConfig: ComponentConfig = {componentName: "SimulatedCursor",importPath: "@/components/remocn/simulated-cursor",controls: {- color: { type: "color", default: "#ffffff", label: "Color" },+ color: {+ type: "color",+ default: "#ffffff",+ description: "Color",+ },size: {type: "number",- default: 32,min: 12,max: 96,step: 1,- label: "Size",+ default: 32,+ description: "Size",+ hiddenFromList: false,},},durationInFrames: 150,diff --git a/registry/remocn/slide-swap/config.ts b/registry/remocn/slide-swap/config.tsindex f0f5fcdc..ba2c98f9 100644--- a/registry/remocn/slide-swap/config.ts+++ b/registry/remocn/slide-swap/config.ts@@ -6,34 +6,40 @@ export const slideSwapConfig: ComponentConfig = {importPath: "@/components/remocn/slide-swap",controls: {axis: {- type: "select",+ type: "enum",default: "x",- options: ["x", "y"],- label: "Axis",+ variants: {+ x: {},+ y: {},+ },+ description: "Axis",},inDistance: {type: "number",- default: 0.28,min: 0.05,max: 0.8,step: 0.01,- label: "Enter distance",+ default: 0.28,+ description: "Enter distance",+ hiddenFromList: false,},outDistance: {type: "number",- default: 0.1,min: 0,max: 0.5,step: 0.01,- label: "Exit distance",+ default: 0.1,+ description: "Exit distance",+ hiddenFromList: false,},slideFrames: {type: "number",- default: 30,min: 12,max: 60,step: 1,- label: "Enter window",+ default: 30,+ description: "Enter window",+ hiddenFromList: false,},},durationInFrames: 210,diff --git a/registry/remocn/slot-machine-roll/config.ts b/registry/remocn/slot-machine-roll/config.tsindex 7109c9db..bacccae5 100644--- a/registry/remocn/slot-machine-roll/config.ts+++ b/registry/remocn/slot-machine-roll/config.ts@@ -1,31 +1,43 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const slotMachineRollConfig: ComponentConfig = {componentName: "SlotMachineRoll",importPath: "@/components/remocn/slot-machine-roll",controls: {- from: { type: "text", default: "$99", label: "From" },- to: { type: "text", default: "$199", label: "To" },+ from: {+ type: "text-content",+ default: "$99",+ description: "From",+ },+ to: {+ type: "text-content",+ default: "$199",+ description: "To",+ },fontSize: {type: "number",- default: 120,min: 12,max: 240,step: 1,- label: "Font size",+ default: 120,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/smoke-dissolve/config.ts b/registry/remocn/smoke-dissolve/config.tsindex b149784d..697aedee 100644--- a/registry/remocn/smoke-dissolve/config.ts+++ b/registry/remocn/smoke-dissolve/config.ts@@ -5,8 +5,16 @@ export const smokeDissolveConfig: ComponentConfig = {componentName: "smokeDissolve",importPath: "@/components/remocn/smoke-dissolve",controls: {- ringColor: { type: "color", default: "#8f88ae", label: "Ring" },- colorBack: { type: "color", default: "#141318", label: "Background" },+ ringColor: {+ type: "color",+ default: "#8f88ae",+ description: "Ring",+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",+ },},durationInFrames: 116,fps: FPS,diff --git a/registry/remocn/soft-blur-in/config.ts b/registry/remocn/soft-blur-in/config.tsindex 45860e86..b2e05af9 100644--- a/registry/remocn/soft-blur-in/config.ts+++ b/registry/remocn/soft-blur-in/config.ts@@ -1,38 +1,47 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const softBlurInConfig: ComponentConfig = {componentName: "SoftBlurIn",importPath: "@/components/remocn/soft-blur-in",controls: {- text: { type: "text", default: "Think different.", label: "Text" },+ text: {+ type: "text-content",+ default: "Think different.",+ description: "Text",+ },blur: {type: "number",- default: 12,min: 1,max: 30,step: 1,- label: "Blur",+ default: 12,+ description: "Blur",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/spring-scale-in/config.ts b/registry/remocn/spring-scale-in/config.tsindex fa3427be..30b5be9e 100644--- a/registry/remocn/spring-scale-in/config.ts+++ b/registry/remocn/spring-scale-in/config.ts@@ -1,46 +1,56 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const springScaleInConfig: ComponentConfig = {componentName: "SpringScaleIn",importPath: "@/components/remocn/spring-scale-in",controls: {- text: { type: "text", default: "Fast. Crisp. Fluid.", label: "Text" },+ text: {+ type: "text-content",+ default: "Fast. Crisp. Fluid.",+ description: "Text",+ },staggerDelay: {type: "number",- default: 3,min: 1,max: 12,step: 1,- label: "Stagger",+ default: 3,+ description: "Stagger",+ hiddenFromList: false,},scaleFrom: {type: "number",- default: 0.7,min: 0.1,max: 1,step: 0.05,- label: "Scale from",+ default: 0.7,+ description: "Scale from",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/spring-settle/config.ts b/registry/remocn/spring-settle/config.tsindex c9390451..24c702d6 100644--- a/registry/remocn/spring-settle/config.ts+++ b/registry/remocn/spring-settle/config.ts@@ -7,35 +7,39 @@ export const springSettleConfig: ComponentConfig = {controls: {enterScale: {type: "number",- default: 1.24,min: 1,max: 1.8,step: 0.02,- label: "Enter scale",+ default: 1.24,+ description: "Enter scale",+ hiddenFromList: false,},enterStagger: {type: "number",- default: 3,min: 0,max: 10,step: 0.5,- label: "Stagger",+ default: 3,+ description: "Stagger",+ hiddenFromList: false,},exitScale: {type: "number",- default: 0.84,min: 0.5,max: 1,step: 0.02,- label: "Exit scale",+ default: 0.84,+ description: "Exit scale",+ hiddenFromList: false,},exitFrames: {type: "number",- default: 6,min: 2,max: 24,step: 1,- label: "Exit frames",+ default: 6,+ description: "Exit frames",+ hiddenFromList: false,},},durationInFrames: 213,diff --git a/registry/remocn/staggered-fade-up/config.ts b/registry/remocn/staggered-fade-up/config.tsindex 6ca0454a..dbd5e935 100644--- a/registry/remocn/staggered-fade-up/config.ts+++ b/registry/remocn/staggered-fade-up/config.ts@@ -1,46 +1,56 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const staggeredFadeUpConfig: ComponentConfig = {componentName: "StaggeredFadeUp",importPath: "@/components/remocn/staggered-fade-up",controls: {- text: { type: "text", default: "Ship faster with remocn", label: "Text" },+ text: {+ type: "text-content",+ default: "Ship faster with remocn",+ description: "Text",+ },staggerDelay: {type: "number",- default: 4,min: 0,max: 30,step: 1,- label: "Stagger delay",+ default: 4,+ description: "Stagger delay",+ hiddenFromList: false,},distance: {type: "number",- default: 20,min: 0,max: 120,step: 1,- label: "Distance",+ default: 20,+ description: "Distance",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/stretch-in/config.ts b/registry/remocn/stretch-in/config.tsindex 399822e8..23d9fc4a 100644--- a/registry/remocn/stretch-in/config.ts+++ b/registry/remocn/stretch-in/config.ts@@ -4,39 +4,51 @@ export const stretchInConfig: ComponentConfig = {componentName: "StretchIn",importPath: "@/components/remocn/stretch-in",controls: {- text: { type: "text", default: "REMOCN", label: "Text" },- fill: { type: "color", default: "#ffffff", label: "Fill" },+ text: {+ type: "text-content",+ default: "REMOCN",+ description: "Text",+ },+ fill: {+ type: "color",+ default: "#ffffff",+ description: "Fill",+ },fontSize: {type: "number",- default: 510,min: 100,max: 700,step: 10,- label: "Font size",+ default: 510,+ description: "Font size",+ hiddenFromList: false,},entryStagger: {type: "number",- default: 3,min: 0,max: 12,step: 1,- label: "Letter stagger",+ default: 3,+ description: "Letter stagger",+ hiddenFromList: false,},travelFrames: {type: "number",- default: 33,min: 4,max: 40,step: 1,- label: "Travel (frames)",+ default: 33,+ description: "Travel (frames)",+ hiddenFromList: false,},vertexLagFrames: {type: "number",- default: 3.5,min: 0,max: 8,step: 0.5,- label: "Smear lag (frames)",+ default: 3.5,+ description: "Smear lag (frames)",+ hiddenFromList: false,},},durationInFrames: 60,diff --git a/registry/remocn/strikethrough-replace/config.ts b/registry/remocn/strikethrough-replace/config.tsindex 04110270..ad155182 100644--- a/registry/remocn/strikethrough-replace/config.ts+++ b/registry/remocn/strikethrough-replace/config.ts@@ -1,32 +1,48 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const strikethroughReplaceConfig: ComponentConfig = {componentName: "StrikethroughReplace",importPath: "@/components/remocn/strikethrough-replace",controls: {- from: { type: "text", default: "$49/mo", label: "From" },- to: { type: "text", default: "Free", label: "To" },- lineColor: { type: "color", default: "#ff5e3a", label: "Line color" },+ from: {+ type: "text-content",+ default: "$49/mo",+ description: "From",+ },+ to: {+ type: "text-content",+ default: "Free",+ description: "To",+ },+ lineColor: {+ type: "color",+ default: "#ff5e3a",+ description: "Line color",+ },fontSize: {type: "number",- default: 96,min: 12,max: 160,step: 1,- label: "Font size",+ default: 96,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 120,diff --git a/registry/remocn/sustained-glitch/config.ts b/registry/remocn/sustained-glitch/config.tsindex 8f9c0aaa..ca0bb42d 100644--- a/registry/remocn/sustained-glitch/config.ts+++ b/registry/remocn/sustained-glitch/config.ts@@ -7,35 +7,39 @@ export const sustainedGlitchConfig: ComponentConfig = {controls: {intensity: {type: "number",- default: 1,min: 0,max: 2,step: 0.05,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,},frequency: {type: "number",- default: 1,min: 0.1,max: 6,step: 0.1,- label: "Frequency",+ default: 1,+ description: "Frequency",+ hiddenFromList: false,},slices: {type: "number",- default: 24,min: 6,max: 48,step: 1,- label: "Slices",+ default: 24,+ description: "Slices",+ hiddenFromList: false,},seed: {type: "number",- default: 1,min: 1,max: 20,step: 1,- label: "Seed",+ default: 1,+ description: "Seed",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn/swirl-dissolve/config.ts b/registry/remocn/swirl-dissolve/config.tsindex c2cbd157..61345109 100644--- a/registry/remocn/swirl-dissolve/config.ts+++ b/registry/remocn/swirl-dissolve/config.ts@@ -7,21 +7,27 @@ export const swirlDissolveConfig: ComponentConfig = {controls: {bandCount: {type: "number",- default: 10,min: 1,max: 12,step: 1,- label: "Bands",+ default: 10,+ description: "Bands",+ hiddenFromList: false,},softness: {type: "number",- default: 0.35,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.35,+ description: "Softness",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",},- colorBack: { type: "color", default: "#141318", label: "Background" },},durationInFrames: 116,fps: FPS,diff --git a/registry/remocn/terminal-cursor-zoom/config.ts b/registry/remocn/terminal-cursor-zoom/config.tsindex bbf96c06..88f1d28a 100644--- a/registry/remocn/terminal-cursor-zoom/config.ts+++ b/registry/remocn/terminal-cursor-zoom/config.ts@@ -5,28 +5,38 @@ export const terminalCursorZoomConfig: ComponentConfig = {importPath: "@/components/remocn/terminal-cursor-zoom",controls: {command: {- type: "text",+ type: "text-content",default: "npx shadcn add @remocn/terminal-cursor-zoom",- label: "Command",+ description: "Command",},zoom: {type: "number",- default: 2.8,min: 1,max: 4,step: 0.1,- label: "Zoom",+ default: 2.8,+ description: "Zoom",+ hiddenFromList: false,},fontSize: {type: "number",- default: 20,min: 10,max: 32,step: 1,- label: "Font size",+ default: 20,+ description: "Font size",+ hiddenFromList: false,+ },+ prompt: {+ type: "text-content",+ default: "$",+ description: "Prompt",+ },+ title: {+ type: "text-content",+ default: "~/code/remocn-demo",+ description: "Title",},- prompt: { type: "text", default: "$", label: "Prompt" },- title: { type: "text", default: "~/code/remocn-demo", label: "Title" },},durationInFrames: 90,fps: FPS,diff --git a/registry/remocn/terminal-simulator/config.ts b/registry/remocn/terminal-simulator/config.tsindex 19c88147..c7583e4f 100644--- a/registry/remocn/terminal-simulator/config.ts+++ b/registry/remocn/terminal-simulator/config.ts@@ -4,33 +4,52 @@ export const terminalSimulatorConfig: ComponentConfig = {componentName: "TerminalSimulator",importPath: "@/components/remocn/terminal-simulator",controls: {- prompt: { type: "text", default: "$", label: "Prompt" },- title: { type: "text", default: "~/projects/remocn", label: "Title" },- background: { type: "color", default: "#0a0a0a", label: "Background" },- chromeColor: { type: "color", default: "#1a1a1a", label: "Chrome color" },+ prompt: {+ type: "text-content",+ default: "$",+ description: "Prompt",+ },+ title: {+ type: "text-content",+ default: "~/projects/remocn",+ description: "Title",+ },+ background: {+ type: "color",+ default: "#0a0a0a",+ description: "Background",+ },+ chromeColor: {+ type: "color",+ default: "#1a1a1a",+ description: "Chrome color",+ },fontSize: {type: "number",- default: 18,min: 10,max: 32,step: 1,- label: "Font size",+ default: 18,+ description: "Font size",+ hiddenFromList: false,},charsPerFrame: {type: "number",- default: 1,min: 0.25,max: 6,step: 0.25,- label: "Chars / frame",+ default: 1,+ description: "Chars / frame",+ hiddenFromList: false,},chunkSize: {type: "number",- default: 1,min: 1,max: 20,step: 1,- label: "Chunk size",+ default: 1,+ description: "Chunk size",+ hiddenFromList: false,},},durationInFrames: 240,diff --git a/registry/remocn/top-down-letters/config.ts b/registry/remocn/top-down-letters/config.tsindex 37d18088..07722518 100644--- a/registry/remocn/top-down-letters/config.ts+++ b/registry/remocn/top-down-letters/config.ts@@ -1,46 +1,56 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const topDownLettersConfig: ComponentConfig = {componentName: "TopDownLetters",importPath: "@/components/remocn/top-down-letters",controls: {- text: { type: "text", default: "Signal", label: "Text" },+ text: {+ type: "text-content",+ default: "Signal",+ description: "Text",+ },staggerDelay: {type: "number",- default: 3,min: 1,max: 12,step: 1,- label: "Stagger",+ default: 3,+ description: "Stagger",+ hiddenFromList: false,},distance: {type: "number",- default: 46,min: 0,max: 120,step: 1,- label: "Distance",+ default: 46,+ description: "Distance",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 60,diff --git a/registry/remocn/tracking-in/config.ts b/registry/remocn/tracking-in/config.tsindex db161726..ed35ea0b 100644--- a/registry/remocn/tracking-in/config.ts+++ b/registry/remocn/tracking-in/config.ts@@ -1,46 +1,56 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const trackingInConfig: ComponentConfig = {componentName: "TrackingIn",importPath: "@/components/remocn/tracking-in",controls: {- text: { type: "text", default: "tracking in", label: "Text" },+ text: {+ type: "text-content",+ default: "tracking in",+ description: "Text",+ },startTracking: {type: "number",- default: 0.5,min: 0,max: 2,step: 0.05,- label: "Start tracking (em)",+ default: 0.5,+ description: "Start tracking (em)",+ hiddenFromList: false,},startBlur: {type: "number",- default: 12,min: 0,max: 40,step: 1,- label: "Start blur",+ default: 12,+ description: "Start blur",+ hiddenFromList: false,},fontSize: {type: "number",- default: 96,min: 12,max: 200,step: 1,- label: "Font size",+ default: 96,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",},- color: { type: "color", default: "#171717", label: "Color" },fontWeight: {- type: "select",+ type: "enum",default: "700",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 90,diff --git a/registry/remocn/tv-power-off/config.ts b/registry/remocn/tv-power-off/config.tsindex c19d2618..4c3450fe 100644--- a/registry/remocn/tv-power-off/config.ts+++ b/registry/remocn/tv-power-off/config.ts@@ -7,32 +7,35 @@ export const tvPowerOffConfig: ComponentConfig = {controls: {durationInFrames: {type: "number",- default: 18,min: 8,max: 30,step: 1,- label: "Duration",+ default: 18,+ description: "Duration",+ hiddenFromList: false,},gain: {type: "number",- default: 1,min: 0,max: 2,step: 0.05,- label: "Surge",+ default: 1,+ description: "Surge",+ hiddenFromList: false,},afterglow: {type: "number",- default: 1,min: 0,max: 2,step: 0.05,- label: "Afterglow",+ default: 1,+ description: "Afterglow",+ hiddenFromList: false,},phosphor: {type: "color",default: "#d8ecff",- label: "Phosphor",+ description: "Phosphor",},},durationInFrames: 62,diff --git a/registry/remocn/typewriter/config.ts b/registry/remocn/typewriter/config.tsindex c26b8b47..c42c31f6 100644--- a/registry/remocn/typewriter/config.ts+++ b/registry/remocn/typewriter/config.ts@@ -1,44 +1,57 @@-import {- type ComponentConfig,- FONT_WEIGHT_OPTIONS,- FPS,- H,- W,-} from "@/lib/customizer-config";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";export const typewriterConfig: ComponentConfig = {componentName: "Typewriter",importPath: "@/components/remocn/typewriter",controls: {text: {- type: "text",+ type: "text-content",default: "console.log('hello, world')",- label: "Text",+ description: "Text",+ },+ cursor: {+ type: "boolean",+ default: true,+ description: "Show cursor",},- cursor: { type: "boolean", default: true, label: "Show cursor" },charsPerSecond: {type: "number",- default: 22,min: 4,max: 60,step: 1,- label: "Chars / sec",+ default: 22,+ description: "Chars / sec",+ hiddenFromList: false,},fontSize: {type: "number",- default: 72,min: 12,max: 160,step: 1,- label: "Font size",+ default: 72,+ description: "Font size",+ hiddenFromList: false,+ },+ color: {+ type: "color",+ default: "#171717",+ description: "Color",+ },+ cursorColor: {+ type: "color",+ default: "#171717",+ description: "Cursor color",},- color: { type: "color", default: "#171717", label: "Color" },- cursorColor: { type: "color", default: "#171717", label: "Cursor color" },fontWeight: {- type: "select",+ type: "enum",default: "600",- options: FONT_WEIGHT_OPTIONS,- label: "Font weight",+ variants: {+ "400": {},+ "500": {},+ "600": {},+ "700": {},+ },+ description: "Font weight",},},durationInFrames: 120,diff --git a/registry/remocn/underwater-ripple/config.ts b/registry/remocn/underwater-ripple/config.tsindex 758dd668..dc363afe 100644--- a/registry/remocn/underwater-ripple/config.ts+++ b/registry/remocn/underwater-ripple/config.ts@@ -7,35 +7,39 @@ export const underwaterRippleConfig: ComponentConfig = {controls: {amplitude: {type: "number",- default: 7,min: 0,max: 40,step: 1,- label: "Amplitude",+ default: 7,+ description: "Amplitude",+ hiddenFromList: false,},scale: {type: "number",- default: 1,min: 0.2,max: 4,step: 0.1,- label: "Scale",+ default: 1,+ description: "Scale",+ hiddenFromList: false,},speed: {type: "number",- default: 2,min: 1,max: 8,step: 1,- label: "Cycles",+ default: 2,+ description: "Cycles",+ hiddenFromList: false,},dispersion: {type: "number",- default: 1,min: 0,max: 4,step: 0.1,- label: "Dispersion",+ default: 1,+ description: "Dispersion",+ hiddenFromList: false,},},durationInFrames: 120,diff --git a/registry/remocn/v0/config.ts b/registry/remocn/v0/config.tsindex d2984940..5c163482 100644--- a/registry/remocn/v0/config.ts+++ b/registry/remocn/v0/config.ts@@ -5,22 +5,30 @@ export const v0Config: ComponentConfig = {importPath: "@/components/remocn/v0",controls: {greeting: {- type: "text",+ type: "text-content",default: "What do you want to create?",- label: "Greeting",+ description: "Greeting",},placeholder: {- type: "text",+ type: "text-content",default: "Ask v0 to build…",- label: "Placeholder",+ description: "Placeholder",},prompt: {- type: "text",+ type: "text-content",default: "a landing page for my SaaS with pricing and testimonials",- label: "Prompt",+ description: "Prompt",+ },+ modelName: {+ type: "text-content",+ default: "v0 Max",+ description: "Model",+ },+ projectName: {+ type: "text-content",+ default: "Project",+ description: "Project",},- modelName: { type: "text", default: "v0 Max", label: "Model" },- projectName: { type: "text", default: "Project", label: "Project" },},durationInFrames: 150,fps: FPS,diff --git a/registry/remocn/value-swap/config.ts b/registry/remocn/value-swap/config.tsindex d6333773..e3e86802 100644--- a/registry/remocn/value-swap/config.ts+++ b/registry/remocn/value-swap/config.ts@@ -7,25 +7,30 @@ export const valueSwapConfig: ComponentConfig = {controls: {duration: {type: "number",- default: 10,min: 4,max: 24,step: 1,- label: "Duration",+ default: 10,+ description: "Duration",+ hiddenFromList: false,},distance: {type: "number",- default: 12,min: 4,max: 32,step: 2,- label: "Distance",+ default: 12,+ description: "Distance",+ hiddenFromList: false,},direction: {- type: "select",+ type: "enum",default: "up",- options: ["up", "down"],- label: "Direction",+ variants: {+ up: {},+ down: {},+ },+ description: "Direction",},},durationInFrames: 100,diff --git a/registry/remocn/vhs-filter/config.ts b/registry/remocn/vhs-filter/config.tsindex a0b5b9d3..00bf07e6 100644--- a/registry/remocn/vhs-filter/config.ts+++ b/registry/remocn/vhs-filter/config.ts@@ -7,35 +7,39 @@ export const vhsFilterConfig: ComponentConfig = {controls: {bleed: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Chroma bleed",+ default: 1,+ description: "Chroma bleed",+ hiddenFromList: false,},wobble: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Tape wobble",+ default: 1,+ description: "Tape wobble",+ hiddenFromList: false,},noise: {type: "number",- default: 1,min: 0,max: 3,step: 0.1,- label: "Noise",+ default: 1,+ description: "Noise",+ hiddenFromList: false,},intensity: {type: "number",- default: 1,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 1,+ description: "Intensity",+ hiddenFromList: false,},},durationInFrames: 90,diff --git a/registry/remocn/warp-dissolve/config.ts b/registry/remocn/warp-dissolve/config.tsindex a9439204..d72d0b06 100644--- a/registry/remocn/warp-dissolve/config.ts+++ b/registry/remocn/warp-dissolve/config.ts@@ -7,27 +7,30 @@ export const warpDissolveConfig: ComponentConfig = {controls: {distortion: {type: "number",- default: 0.8,min: 0.1,max: 1,step: 0.05,- label: "Distortion",+ default: 0.8,+ description: "Distortion",+ hiddenFromList: false,},swirl: {type: "number",- default: 0.6,min: 0,max: 1,step: 0.05,- label: "Swirl",+ default: 0.6,+ description: "Swirl",+ hiddenFromList: false,},softness: {type: "number",- default: 1,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 1,+ description: "Softness",+ hiddenFromList: false,},},durationInFrames: 116,diff --git a/registry/remocn/wave-wipe/config.ts b/registry/remocn/wave-wipe/config.tsindex d20d07cc..ea27aadd 100644--- a/registry/remocn/wave-wipe/config.ts+++ b/registry/remocn/wave-wipe/config.ts@@ -7,29 +7,36 @@ export const waveWipeConfig: ComponentConfig = {controls: {intensity: {type: "number",- default: 0.2,min: 0,max: 1,step: 0.05,- label: "Intensity",+ default: 0.2,+ description: "Intensity",+ hiddenFromList: false,},softness: {type: "number",- default: 0.7,min: 0,max: 1,step: 0.05,- label: "Softness",+ default: 0.7,+ description: "Softness",+ hiddenFromList: false,},noise: {type: "number",- default: 0.4,min: 0,max: 1,step: 0.05,- label: "Noise",+ default: 0.4,+ description: "Noise",+ hiddenFromList: false,+ },+ colorBack: {+ type: "color",+ default: "#141318",+ description: "Background",},- colorBack: { type: "color", default: "#141318", label: "Background" },},durationInFrames: 116,fps: FPS,diff --git a/registry/remocn/whip-pan/config.ts b/registry/remocn/whip-pan/config.tsindex af50c5e4..7fe6518b 100644--- a/registry/remocn/whip-pan/config.ts+++ b/registry/remocn/whip-pan/config.ts@@ -6,18 +6,24 @@ export const whipPanConfig: ComponentConfig = {importPath: "@/components/remocn/whip-pan",controls: {direction: {- type: "select",+ type: "enum",default: "left",- options: ["left", "right", "up", "down"],- label: "Direction",+ variants: {+ left: {},+ right: {},+ up: {},+ down: {},+ },+ description: "Direction",},blur: {type: "number",- default: 24,min: 0,max: 48,step: 2,- label: "Blur",+ default: 24,+ description: "Blur",+ hiddenFromList: false,},},durationInFrames: 114,diff --git a/registry/remocn/x-follow-card/config.ts b/registry/remocn/x-follow-card/config.tsindex 577d52e9..704fbc7a 100644--- a/registry/remocn/x-follow-card/config.ts+++ b/registry/remocn/x-follow-card/config.ts@@ -4,30 +4,65 @@ export const xFollowCardConfig: ComponentConfig = {componentName: "XFollowCard",importPath: "@/components/remocn/x-follow-card",controls: {- name: { type: "text", default: "remocn", label: "Name" },- handle: { type: "text", default: "remocn", label: "Handle" },+ name: {+ type: "text-content",+ default: "remocn",+ description: "Name",+ },+ handle: {+ type: "text-content",+ default: "remocn",+ description: "Handle",+ },bio: {- type: "text",+ type: "text-content",default:"Production-ready components for Remotion - text animations, backgrounds, transitions, UI blocks, and full scene compositions",- label: "Bio",+ description: "Bio",+ },+ avatarUrl: {+ type: "text-content",+ default: "/logo.svg",+ description: "Avatar URL",},- avatarUrl: { type: "text", default: "/logo.svg", label: "Avatar URL" },coverUrl: {- type: "text",+ type: "text-content",default: "/imgs/x-cover.png",- label: "Cover URL",+ description: "Cover URL",+ },+ location: {+ type: "text-content",+ default: "Ukraine",+ description: "Location",+ },+ website: {+ type: "text-content",+ default: "remocn.dev",+ description: "Website",+ },+ joined: {+ type: "text-content",+ default: "January 2024",+ description: "Joined",+ },+ verified: {+ type: "boolean",+ default: true,+ description: "Verified",+ },+ accentColor: {+ type: "color",+ default: "#1d9bf0",+ description: "Accent",},- location: { type: "text", default: "Ukraine", label: "Location" },- website: { type: "text", default: "remocn.dev", label: "Website" },- joined: { type: "text", default: "January 2024", label: "Joined" },- verified: { type: "boolean", default: true, label: "Verified" },- accentColor: { type: "color", default: "#1d9bf0", label: "Accent" },orientation: {- type: "select",+ type: "enum",default: "horizontal",- options: ["horizontal", "vertical"],- label: "Orientation",+ variants: {+ horizontal: {},+ vertical: {},+ },+ description: "Orientation",},},durationInFrames: 165,diff --git a/registry/remocn/x-followers-overview/config.ts b/registry/remocn/x-followers-overview/config.tsindex 31eeaf93..a014d628 100644--- a/registry/remocn/x-followers-overview/config.ts+++ b/registry/remocn/x-followers-overview/config.ts@@ -5,24 +5,37 @@ export const xFollowersOverviewConfig: ComponentConfig = {importPath: "@/components/remocn/x-followers-overview",controls: {totalFollowers: {- type: "number-input",- default: 1709,+ type: "number",min: 0,- max: 10000000,step: 1,- label: "Total followers",+ default: 1709,+ description: "Total followers",+ hiddenFromList: false,+ },+ handle: {+ type: "text-content",+ default: "remocn",+ description: "Handle",+ },+ avatarUrl: {+ type: "text-content",+ default: "/logo.svg",+ description: "Avatar URL",+ },+ accentColor: {+ type: "color",+ default: "#1d9bf0",+ description: "Accent",},- handle: { type: "text", default: "remocn", label: "Handle" },- avatarUrl: { type: "text", default: "/logo.svg", label: "Avatar URL" },- accentColor: { type: "color", default: "#1d9bf0", label: "Accent" },orientation: {- type: "select",+ type: "enum",default: "horizontal",- options: ["horizontal", "vertical"],- label: "Orientation",+ variants: {+ horizontal: {},+ vertical: {},+ },+ description: "Orientation",},- // `speed` is appended from SHARED_CONTROLS in registry/__index__.tsx.- // `notifications` is an array → not a control; preview uses SAMPLE_FOLLOWERS.},durationInFrames: 360,fps: FPS,diff --git a/registry/remocn/zoom-blur/config.ts b/registry/remocn/zoom-blur/config.tsindex 1c96e0ba..c75ddee2 100644--- a/registry/remocn/zoom-blur/config.ts+++ b/registry/remocn/zoom-blur/config.ts@@ -7,19 +7,21 @@ export const zoomBlurConfig: ComponentConfig = {controls: {blur: {type: "number",- default: 16,min: 0,max: 40,step: 2,- label: "Blur",+ default: 16,+ description: "Blur",+ hiddenFromList: false,},rise: {type: "number",- default: 0,min: 0,max: 160,step: 10,- label: "Rise",+ default: 0,+ description: "Rise",+ hiddenFromList: false,},},durationInFrames: 114,diff --git a/scripts/build-elements.mts b/scripts/build-elements.mtsindex c5497acf..f0dc909a 100644--- a/scripts/build-elements.mts+++ b/scripts/build-elements.mts@@ -1,13 +1,16 @@import {+ existsSync,mkdirSync,readdirSync,readFileSync,rmSync,writeFileSync,} from "node:fs";-import { join } from "node:path";+import { dirname, join, resolve } from "node:path";import { createElementPayload } from "@remotion/studio-protocol";import { Glob } from "bun";+import type { InteractivitySchema } from "remotion";+import { resolveSchema } from "../lib/customizer-config";import { previewManifest } from "../registry/__manifest__";const ARTIFACTS_DIR = "registry-artifacts";@@ -50,7 +53,7 @@ function resolveDependencies(names: Set<string>) {.filter((name) => name !== "remotion").map((name) => {if (name.startsWith("@remotion/")) {- return { name, version: null };+ return { name: name as `@remotion/${string}`, version: null };}const raw = pinnedVersions[name];if (!raw) {@@ -80,24 +83,41 @@ function loadFrontmatterLengths(): Record<string, number> {}interface ParsedSource {- imports: Map<string, { named: Set<string>; typeNamed: Set<string> }>;+ imports: Map<+ string,+ { named: Set<string>; typeNamed: Set<string>; defaults: Set<string> }+ >;body: string;}+function getImportEntry(imports: ParsedSource["imports"], module: string) {+ let entry = imports.get(module);+ if (!entry) {+ entry = { named: new Set(), typeNamed: new Set(), defaults: new Set() };+ imports.set(module, entry);+ }+ return entry;+}+function parseSource(source: string): ParsedSource {const imports: ParsedSource["imports"] = new Map();const importRe =- /^import\s+(type\s+)?\{([\s\S]*?)\}\s+from\s+"([^"]+)";?\s*$/gm;+ /^import\s+(type\s+)?(?:([A-Za-z_$][\w$]*)\s*,\s*)?\{([\s\S]*?)\}\s+from\s+"([^"]+)";?\s*$/gm;+ const defaultImportRe =+ /^import\s+(?:type\s+)?([A-Za-z_$][\w$]*)\s+from\s+"([^"]+)";?\s*$/gm;const body = source.replace(/^"use client";\s*/m, "").replace(importRe,- (_, typeOnly: string | undefined, specifiers: string, module: string) => {- let entry = imports.get(module);- if (!entry) {- entry = { named: new Set(), typeNamed: new Set() };- imports.set(module, entry);- }+ (+ _,+ typeOnly: string | undefined,+ defaultName: string | undefined,+ specifiers: string,+ module: string,+ ) => {+ const entry = getImportEntry(imports, module);+ if (defaultName) entry.defaults.add(defaultName);for (const spec of specifiers.split(",")) {const trimmed = spec.trim();if (!trimmed) continue;@@ -110,6 +130,10 @@ function parseSource(source: string): ParsedSource {return "";},)+ .replace(defaultImportRe, (_, defaultName: string, module: string) => {+ getImportEntry(imports, module).defaults.add(defaultName);+ return "";+ }).trim();return { imports, body };}@@ -121,23 +145,48 @@ function stripExports(body: string): string {);}-function mergeSources(component: ParsedSource, libs: ParsedSource[]): string {+const WRAPPER_IMPORTS: ParsedSource["imports"] = new Map([+ [+ "react",+ {+ named: new Set(["forwardRef", "useImperativeHandle", "useRef"]),+ typeNamed: new Set(["ComponentProps"]),+ defaults: new Set<string>(),+ },+ ],+ [+ "remotion",+ {+ named: new Set(["Interactive", "Sequence"]),+ typeNamed: new Set([+ "InteractiveBaseProps",+ "InteractiveTransformProps",+ "InteractivitySchema",+ "SequenceControls",+ ]),+ defaults: new Set<string>(),+ },+ ],+]);++function mergeSources(+ component: ParsedSource,+ libs: ParsedSource[],+ extra: ParsedSource["imports"] = new Map(),+): string {const merged: ParsedSource["imports"] = new Map();- for (const source of [component, ...libs]) {+ for (const source of [component, ...libs, { imports: extra, body: "" }]) {for (const [module, entry] of source.imports) {if (Object.values(INLINABLE_LIBS).some((lib) => lib.importPath === module))continue;- let target = merged.get(module);- if (!target) {- target = { named: new Set(), typeNamed: new Set() };- merged.set(module, target);- }+ const target = getImportEntry(merged, module);for (const spec of entry.named) target.named.add(spec);for (const spec of entry.typeNamed) {target.typeNamed.add(spec);}+ for (const spec of entry.defaults) target.defaults.add(spec);}}const importLines = [...merged.entries()].map(([module, entry]) => {@@ -148,6 +197,11 @@ function mergeSources(component: ParsedSource, libs: ParsedSource[]): string {.filter((spec) => !entry.named.has(spec)).map((spec) => `type ${spec}`),];+ const defaultName = [...entry.defaults][0];+ if (defaultName && specs.length > 0) {+ return `import ${defaultName}, { ${specs.join(", ")} } from "${module}";`;+ }+ if (defaultName) return `import ${defaultName} from "${module}";`;return `import { ${specs.join(", ")} } from "${module}";`;});const libBodies = libs.map((lib) => stripExports(lib.body));@@ -166,6 +220,143 @@ function countExportedComponents(source: string): string[] {];}+const RESERVED_SCHEMA_KEYS = new Set([+ "name",+ "style",+ "from",+ "durationInFrames",+ "trimBefore",+ "freeze",+ "hidden",+ "showInTimeline",+ "premountFor",+ "controls",+]);++const IDENT = /^[A-Za-z_$][\w$]*$/;++function serializeSchema(value: unknown, indent: string): string {+ if (value === null) return "null";+ if (typeof value === "string") return JSON.stringify(value);+ if (typeof value === "number" || typeof value === "boolean") {+ return String(value);+ }+ if (Array.isArray(value)) {+ return `[${value.map((v) => serializeSchema(v, indent)).join(", ")}]`;+ }+ const entries = Object.entries(value as Record<string, unknown>);+ if (entries.length === 0) return "{}";+ const inner = `${indent} `;+ const lines = entries.map(([k, v]) => {+ const key = IDENT.test(k) ? k : JSON.stringify(k);+ return `${inner}${key}: ${serializeSchema(v, inner)},`;+ });+ return `{\n${lines.join("\n")}\n${indent}}`;+}++async function loadElementSchema(+ name: string,+ sourcePath: string,+): Promise<InteractivitySchema | null> {+ const configPath = join(dirname(sourcePath), "config.ts");+ if (!existsSync(configPath)) return null;+ const mod = await import(resolve(configPath));+ const config = Object.values(mod).find(+ (v) => v && typeof v === "object" && "controls" in (v as object),+ ) as { controls: InteractivitySchema } | undefined;+ if (!config) return null;+ const schema = resolveSchema(name, config.controls);+ if (Object.keys(schema).some((key) => RESERVED_SCHEMA_KEYS.has(key))) {+ return null;+ }+ return schema;+}++function makeInteractiveWrapper(+ componentName: string,+ schema: InteractivitySchema,+): string {+ const keys = Object.keys(schema);+ return `const elementSchema = {+ ...Interactive.baseSchema,+${Object.entries(schema)+ .map(+ ([k, v]) =>+ ` ${IDENT.test(k) ? k : JSON.stringify(k)}: ${serializeSchema(v, " ")},`,+ )+ .join("\n")}+ ...Interactive.transformSchema,+} as const satisfies InteractivitySchema;++const ELEMENT_PROP_KEYS = new Set(${JSON.stringify(keys)});++const ELEMENT_PROP_DEFAULTS: Record<string, unknown> = ${serializeSchema(+ Object.fromEntries(+ Object.entries(schema).flatMap(([k, v]) =>+ "default" in v && v.default !== undefined && v.default !== null+ ? [[k, v.default]]+ : [],+ ),+ ),+ "",+ )};++type ${componentName}ElementProps = InteractiveBaseProps &+ InteractiveTransformProps &+ ComponentProps<typeof ${componentName}Base>;++const ${componentName}Inner = forwardRef<+ HTMLDivElement,+ ${componentName}ElementProps & { readonly controls: SequenceControls | undefined }+>(({ controls, name, style, ...rest }, ref) => {+ const outlineRef = useRef<HTMLDivElement>(null);+ useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);+ const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };+ const sequenceProps: Record<string, unknown> = {};+ for (const [key, value] of Object.entries(rest)) {+ if (ELEMENT_PROP_KEYS.has(key)) {+ if (value !== undefined) componentProps[key] = value;+ } else {+ sequenceProps[key] = value;+ }+ }+ return (+ <Sequence+ layout="none"+ {...sequenceProps}+ controls={controls}+ name={name ?? "<${componentName}>"}+ outlineRef={outlineRef}+ >+ <div+ ref={outlineRef}+ style={{+ position: "relative",+ width: "100%",+ height: "100%",+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ ...style,+ }}+ >+ <${componentName}Base+ {...(componentProps as unknown as ComponentProps<typeof ${componentName}Base>)}+ />+ </div>+ </Sequence>+ );+});++export const ${componentName} = Interactive.withSchema({+ Component: ${componentName}Inner,+ componentName: "<${componentName}>",+ componentIdentity: null,+ schema: elementSchema,+ supportsEffects: false,+});`;+}+const frontmatterLengths = loadFrontmatterLengths();const libSources = new Map(Object.entries(INLINABLE_LIBS).map(([dep, { artifact }]) => {@@ -184,6 +375,7 @@ rmSync(ELEMENTS_DIR, { recursive: true, force: true });mkdirSync(ELEMENTS_DIR, { recursive: true });let built = 0;+let interactive = 0;const skipped: string[] = [];for (const file of readdirSync(ARTIFACTS_DIR).sort()) {@@ -214,9 +406,11 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {const lib = libSources.get(dep);return lib ? [lib] : [];});+ const schema = await loadElementSchema(item.name, path);let sourceCode = mergeSources(parseSource(item.files[0].content),libs.map((lib) => lib.parsed),+ schema ? WRAPPER_IMPORTS : undefined,);let exported = countExportedComponents(sourceCode);if (exported.length === 2) {@@ -238,6 +432,20 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {skipped.push(`${item.name} (${exported.length} exported components)`);continue;}+ let installationMode: "wrapped" | "component-owned-sequence" = "wrapped";+ if (schema) {+ const componentName = exported[0];+ sourceCode = stripExports(+ sourceCode.replace(+ new RegExp(`\\b${componentName}\\b`, "g"),+ `${componentName}Base`,+ ),+ );+ sourceCode += `\n\n${makeInteractiveWrapper(componentName, schema)}\n`;+ installationMode = "component-owned-sequence";+ interactive++;+ }+const depNames = new Set([...(item.dependencies ?? []),...libs.flatMap((lib) => lib.dependencies),@@ -250,7 +458,7 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {dependencies: resolveDependencies(depNames),dimensions: null,durationInFrames,- installationMode: "wrapped",+ installationMode,});writeFileSync(@@ -260,6 +468,8 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {built++;}-console.log(`Built ${built} element payloads into ${ELEMENTS_DIR}`);+console.log(+ `Built ${built} element payloads into ${ELEMENTS_DIR} (${interactive} interactive)`,+);console.log(`Skipped ${skipped.length} incompatible items`);for (const s of skipped) console.log(" -", s);diff --git a/scripts/codemod-controls.mts b/scripts/codemod-controls.mtsnew file mode 100644index 00000000..a2a4defd--- /dev/null+++ b/scripts/codemod-controls.mts@@ -0,0 +1,146 @@+import { readFileSync, writeFileSync } from "node:fs";+import { resolve } from "node:path";+import { Glob } from "bun";++type OldControl = {+ type: string;+ default: unknown;+ label?: string;+ min?: number;+ max?: number;+ step?: number;+ options?: string[];+};++function convertField(control: OldControl): Record<string, unknown> {+ const description = control.label ?? "";+ switch (control.type) {+ case "text":+ return { type: "text-content", default: control.default, description };+ case "number":+ return {+ type: "number",+ min: control.min,+ max: control.max,+ step: control.step,+ default: control.default,+ description,+ hiddenFromList: false,+ };+ case "number-input":+ return {+ type: "number",+ min: control.min,+ step: control.step,+ default: control.default,+ description,+ hiddenFromList: false,+ };+ case "color":+ return { type: "color", default: control.default, description };+ case "boolean":+ return { type: "boolean", default: control.default, description };+ case "select": {+ const variants: Record<string, Record<string, never>> = {};+ for (const option of control.options ?? []) variants[option] = {};+ return {+ type: "enum",+ default: control.default,+ variants,+ description,+ };+ }+ default:+ throw new Error(`Unknown control type: ${control.type}`);+ }+}++const IDENT = /^[A-Za-z_$][\w$]*$/;++function serialize(value: unknown, indent: string): string {+ if (value === null) return "null";+ if (typeof value === "string") return JSON.stringify(value);+ if (typeof value === "number" || typeof value === "boolean") {+ return String(value);+ }+ if (Array.isArray(value)) {+ return `[${value.map((v) => serialize(v, indent)).join(", ")}]`;+ }+ const entries = Object.entries(value as Record<string, unknown>);+ if (entries.length === 0) return "{}";+ const inner = indent + " ";+ const lines = entries.map(([k, v]) => {+ const key = IDENT.test(k) ? k : JSON.stringify(k);+ return `${inner}${key}: ${serialize(v, inner)},`;+ });+ return `{\n${lines.join("\n")}\n${indent}}`;+}++function findControlsBlock(source: string): { start: number; end: number } {+ const matches = [...source.matchAll(/controls:\s*\{/g)];+ if (matches.length !== 1) {+ throw new Error(+ `Expected exactly one "controls: {" (found ${matches.length})`,+ );+ }+ const match = matches[0];+ const braceStart = match.index + match[0].length - 1;+ let depth = 0;+ for (let i = braceStart; i < source.length; i++) {+ const ch = source[i];+ if (ch === "{") depth++;+ else if (ch === "}") {+ depth--;+ if (depth === 0) return { start: match.index, end: i + 1 };+ } else if (ch === '"' || ch === "'" || ch === "`") {+ const quote = ch;+ i++;+ while (i < source.length && source[i] !== quote) {+ if (source[i] === "\\") i++;+ i++;+ }+ }+ }+ throw new Error("Unbalanced braces in controls block");+}++const failures: string[] = [];+let changed = 0;++for (const file of new Glob("registry/*/*/config.ts").scanSync(".")) {+ try {+ const mod = await import(resolve(file));+ const config = Object.values(mod).find(+ (v) => v && typeof v === "object" && "controls" in (v as object),+ ) as { controls: Record<string, OldControl> } | undefined;+ if (!config) throw new Error("No exported config with controls");++ const schema: Record<string, unknown> = {};+ for (const [key, control] of Object.entries(config.controls)) {+ if (typeof control.type !== "string") {+ throw new Error(`Control "${key}" already migrated or malformed`);+ }+ schema[key] = convertField(control);+ }++ const source = readFileSync(file, "utf8");+ const { start, end } = findControlsBlock(source);+ const lineStart = source.lastIndexOf("\n", start) + 1;+ const indent = source.slice(lineStart, start);+ const replacement = `controls: ${serialize(schema, indent)}`;+ writeFileSync(+ file,+ source.slice(0, start) + replacement + source.slice(end),+ );+ changed++;+ } catch (error) {+ failures.push(`${file}: ${(error as Error).message}`);+ }+}++console.log(`Migrated ${changed} config files`);+if (failures.length > 0) {+ console.log(`Failed ${failures.length}:`);+ for (const f of failures) console.log(" -", f);+ process.exit(1);+}diff --git a/src/remotion/Root.tsx b/src/remotion/Root.tsxdeleted file mode 100644index b4780933..00000000--- a/src/remotion/Root.tsx+++ /dev/null@@ -1,42 +0,0 @@-import { Composition, registerRoot } from "remotion";-import {- GitHubStars,- type GitHubStarsProps,- SAMPLE_STARGAZERS,-} from "@/registry/remocn/github-stars";--/**- * Sample props so the composition validates + renders standalone in the Remotion- * bundle (Studio / pre-render). Real renders override these via `inputProps`.- */-const DEFAULT_PROPS: GitHubStarsProps = {- repo: "remotion-dev/remotion",- totalStars: 24813,- stargazers: SAMPLE_STARGAZERS,- orientation: "horizontal",- accentColor: "#ffbb00",- speed: 1,- theme: "light",-};--/**- * Bundle root. Declares the single `github-stars` composition at full native- * horizontal quality (1280×720 / 30fps / 300 frames). The server overrides- * width/height per orientation at render time (see lib/server/render.ts) — one- * composition, no duplicate vertical entry.- */-export function RemotionRoot() {- return (- <Composition- id="github-stars"- component={GitHubStars}- durationInFrames={300}- fps={30}- width={1280}- height={720}- defaultProps={DEFAULT_PROPS}- />- );-}--registerRoot(RemotionRoot);diff --git a/src/remotion/canvas-spike-root.tsx b/src/remotion/canvas-spike-root.tsxdeleted file mode 100644index a1cea43c..00000000--- a/src/remotion/canvas-spike-root.tsx+++ /dev/null@@ -1,127 +0,0 @@-import { loadFont } from "@remotion/google-fonts/Geist";-import type { ComponentType } from "react";-import {- AbsoluteFill,- Composition,- isHtmlInCanvasSupported,- registerRoot,-} from "remotion";-import { AsciiRenderExampleScene } from "@/components/docs/examples/ascii-render-example";-import { CameraLensExampleScene } from "@/components/docs/examples/camera-lens-example";-import { CrtScreenExampleScene } from "@/components/docs/examples/crt-screen-example";-import { DisplacementExampleScene } from "@/components/docs/examples/displacement-example";-import { EmberBurnExampleScene } from "@/components/docs/examples/ember-burn-example";-import { GlitchCutExampleScene } from "@/components/docs/examples/glitch-cut-example";-import { GridWaveExampleScene } from "@/components/docs/examples/grid-wave-example";-import { HalftonePrintExampleScene } from "@/components/docs/examples/halftone-print-example";-import { HologramExampleScene } from "@/components/docs/examples/hologram-example";-import { ParticleDissolveExampleScene } from "@/components/docs/examples/particle-dissolve-example";-import { PixelateRegionExampleScene } from "@/components/docs/examples/pixelate-region-example";-import { SecurityCamExampleScene } from "@/components/docs/examples/security-cam-example";-import { SustainedGlitchExampleScene } from "@/components/docs/examples/sustained-glitch-example";-import { UnderwaterRippleExampleScene } from "@/components/docs/examples/underwater-ripple-example";-import { VhsFilterExampleScene } from "@/components/docs/examples/vhs-filter-example";-import type { ComponentConfig } from "@/lib/customizer-config";-import { asciiRenderConfig } from "@/registry/remocn/ascii-render/config";-import { cameraLensConfig } from "@/registry/remocn/camera-lens/config";-import { crtScreenConfig } from "@/registry/remocn/crt-screen/config";-import { displacementConfig } from "@/registry/remocn/displacement/config";-import { emberBurnConfig } from "@/registry/remocn/ember-burn/config";-import { glitchCutConfig } from "@/registry/remocn/glitch-cut/config";-import { gridWaveConfig } from "@/registry/remocn/grid-wave/config";-import { halftonePrintConfig } from "@/registry/remocn/halftone-print/config";-import { hologramConfig } from "@/registry/remocn/hologram/config";-import { particleDissolveConfig } from "@/registry/remocn/particle-dissolve/config";-import { pixelateRegionConfig } from "@/registry/remocn/pixelate-region/config";-import { securityCamConfig } from "@/registry/remocn/security-cam/config";-import { sustainedGlitchConfig } from "@/registry/remocn/sustained-glitch/config";-import { underwaterRippleConfig } from "@/registry/remocn/underwater-ripple/config";-import { vhsFilterConfig } from "@/registry/remocn/vhs-filter/config";--const { fontFamily: GEIST } = loadFont();--if (typeof document !== "undefined") {- console.log(- `[canvas-spike] htmlInCanvasSupported=${isHtmlInCanvasSupported()}`,- );- console.log(`[canvas-spike] userAgent=${navigator.userAgent}`);-}--const SCENES: Record<- string,- { Scene: ComponentType; config: ComponentConfig }-> = {- "glitch-cut": { Scene: GlitchCutExampleScene, config: glitchCutConfig },- "ember-burn": { Scene: EmberBurnExampleScene, config: emberBurnConfig },- "particle-dissolve": {- Scene: ParticleDissolveExampleScene,- config: particleDissolveConfig,- },- "grid-wave": { Scene: GridWaveExampleScene, config: gridWaveConfig },- displacement: {- Scene: DisplacementExampleScene,- config: displacementConfig,- },- "vhs-filter": { Scene: VhsFilterExampleScene, config: vhsFilterConfig },- "crt-screen": { Scene: CrtScreenExampleScene, config: crtScreenConfig },- "sustained-glitch": {- Scene: SustainedGlitchExampleScene,- config: sustainedGlitchConfig,- },- "pixelate-region": {- Scene: PixelateRegionExampleScene,- config: pixelateRegionConfig,- },- "ascii-render": { Scene: AsciiRenderExampleScene, config: asciiRenderConfig },- "halftone-print": {- Scene: HalftonePrintExampleScene,- config: halftonePrintConfig,- },- "underwater-ripple": {- Scene: UnderwaterRippleExampleScene,- config: underwaterRippleConfig,- },- "camera-lens": { Scene: CameraLensExampleScene, config: cameraLensConfig },- "security-cam": { Scene: SecurityCamExampleScene, config: securityCamConfig },- hologram: { Scene: HologramExampleScene, config: hologramConfig },-};--function makeStage(Scene: ComponentType) {- return function CanvasSpikeStage() {- return (- <AbsoluteFill- style={{- backgroundColor: "#0a0a0a",- ["--font-geist-sans" as string]: GEIST,- fontFamily: GEIST,- }}- >- <Scene />- </AbsoluteFill>- );- };-}--const STAGES: Record<string, ReturnType<typeof makeStage>> = Object.fromEntries(- Object.entries(SCENES).map(([id, entry]) => [id, makeStage(entry.Scene)]),-);--export function CanvasSpikeRoot() {- return (- <>- {Object.entries(SCENES).map(([id, entry]) => (- <Composition- key={id}- id={id}- component={STAGES[id]}- durationInFrames={entry.config.durationInFrames}- fps={entry.config.fps}- width={entry.config.compositionWidth}- height={entry.config.compositionHeight}- />- ))}- </>- );-}--registerRoot(CanvasSpikeRoot);diff --git a/src/remotion/demos-entry.ts b/src/remotion/demos-entry.tsdeleted file mode 100644index 48f1df2e..00000000--- a/src/remotion/demos-entry.ts+++ /dev/null@@ -1,5 +0,0 @@-// Bundler entry for the demos render script (scripts/render-demos.mts).-// Importing the root runs `registerRoot(DemosRoot)`. Kept separate from-// index.ts so the github-stars server bundle and the demos bundle don't collide-// (a bundle registers exactly one root). Side-effect-only by design.-import "./demos-root";diff --git a/src/remotion/demos-root.tsx b/src/remotion/demos-root.tsxdeleted file mode 100644index fc239635..00000000--- a/src/remotion/demos-root.tsx+++ /dev/null@@ -1,94 +0,0 @@-import { loadFont } from "@remotion/google-fonts/Geist";-import type { ComponentType } from "react";-import { AbsoluteFill, Composition, Loop, registerRoot } from "remotion";-import { examples } from "@/components/docs/examples";-import { aiExamples } from "@/components/docs/examples/ai";-import { blockExamples } from "@/components/docs/examples/blocks";--/**- * Every renderable scene: the ui-tier `examples` (keyed `<name>-example`) plus- * the composition `blockExamples` (keyed `<name>-flow`). Key namespaces don't- * overlap, and both records share the timing/scene shape this root consumes.- */-const ALL_SCENES = { ...examples, ...blockExamples, ...aiExamples };--/**- * Demos bundle root. Auto-declares one Remotion composition per docs example- * (the `examples` record is the single source of truth for timing + scene), so- * `scripts/render-demos.mts` can render every example to an mp4. Kept separate- * from `Root.tsx`/`index.ts` (the github-stars server bundle) — that entry is- * untouched; this one is bundled only by the demos render script.- *- * Two fidelity bridges make the mp4 match the on-site @remotion/player preview:- * - white stage background (= `--card` light = the `.surface-card` the preview- * sits on); self-painting scenes (e.g. blur-in) just cover it.- * - Geist loaded via @remotion/google-fonts, exposed as `--font-geist-sans` so- * the CSS var the scenes reference resolves to the real face (the site gets- * this from next/font, which doesn't exist in a standalone Remotion bundle).- */--const { fontFamily: GEIST } = loadFont();--interface StageProps {- // Remotion requires composition props to extend Record<string, unknown>.- [key: string]: unknown;- /** One animation cycle, in frames (from the example's `durationInFrames`). */- loopFrames: number;- /** Repeat the cycle this many times (CLI `--loops`, default 1). */- loops: number;-}--/**- * Bind each example's scene at bundle time via closure — components are not- * JSON-serializable, so they can't ride through `defaultProps`/`inputProps`.- * Only the numeric loop knobs cross that boundary.- */-function makeStage(Example: ComponentType) {- return function DemoStage({ loopFrames }: StageProps) {- return (- <AbsoluteFill- style={{- backgroundColor: "#ffffff",- ["--font-geist-sans" as string]: GEIST,- fontFamily: GEIST,- }}- >- <Loop durationInFrames={loopFrames}>- <Example />- </Loop>- </AbsoluteFill>- );- };-}--// Stable component reference per composition (don't re-create inside render).-const STAGES: Record<string, ReturnType<typeof makeStage>> = Object.fromEntries(- Object.entries(ALL_SCENES).map(([id, entry]) => [- id,- makeStage(entry.Component),- ]),-);--export function DemosRoot() {- return (- <>- {Object.entries(ALL_SCENES).map(([id, entry]) => (- <Composition- key={id}- id={id}- component={STAGES[id]}- durationInFrames={entry.durationInFrames}- fps={entry.fps}- width={entry.width}- height={entry.height}- defaultProps={{ loopFrames: entry.durationInFrames, loops: 1 }}- calculateMetadata={({ props }) => ({- durationInFrames: props.loopFrames * Math.max(1, props.loops),- })}- />- ))}- </>- );-}--registerRoot(DemosRoot);diff --git a/src/remotion/hero-bg-root.tsx b/src/remotion/hero-bg-root.tsxdeleted file mode 100644index 5eb51ed8..00000000--- a/src/remotion/hero-bg-root.tsx+++ /dev/null@@ -1,50 +0,0 @@-import { AbsoluteFill, Composition, registerRoot } from "remotion";-import {- ShaderWarp,- type ShaderWarpProps,-} from "@/registry/remocn/shader-warp";--export const HERO_BG_WIDTH = 1200;-export const HERO_BG_HEIGHT = 630;-export const HERO_BG_FPS = 30;-export const HERO_BG_DURATION = 300;--export const HERO_BG_COLORS = ["#000d14", "#001929", "#00263d", "#00355a"];--export const HERO_BG_DEFAULTS: ShaderWarpProps = {- colors: HERO_BG_COLORS,- proportion: 0.5,- softness: 0.15,- distortion: 0.2,- swirl: 0.4,- swirlIterations: 10,- shape: "checks",- shapeScale: 0.5,- scale: 1,- rotation: 0,-};--export function HeroBgScene(props: ShaderWarpProps) {- const colors = props.colors ?? HERO_BG_COLORS;- return (- <AbsoluteFill style={{ backgroundColor: colors[0] }}>- <ShaderWarp {...props} />- </AbsoluteFill>- );-}--export function HeroBgRoot() {- return (- <Composition- id="hero-bg"- component={HeroBgScene}- durationInFrames={HERO_BG_DURATION}- fps={HERO_BG_FPS}- width={HERO_BG_WIDTH}- height={HERO_BG_HEIGHT}- defaultProps={HERO_BG_DEFAULTS}- />- );-}--registerRoot(HeroBgRoot);diff --git a/src/remotion/index.ts b/src/remotion/index.tsdeleted file mode 100644index 84502a19..00000000--- a/src/remotion/index.ts+++ /dev/null@@ -1,4 +0,0 @@-// Bundler entry point. Importing Root runs `registerRoot(RemotionRoot)`, which-// is what `@remotion/bundler` (and the Remotion CLI) look for. Keep this file-// side-effect-only so the entry stays a stable, single source of truth.-import "./Root";diff --git a/src/remotion/not-found-root.tsx b/src/remotion/not-found-root.tsxdeleted file mode 100644index a86406f4..00000000--- a/src/remotion/not-found-root.tsx+++ /dev/null@@ -1,24 +0,0 @@-import { Composition, registerRoot } from "remotion";-import {- NOT_FOUND_DURATION,- NOT_FOUND_FPS,- NOT_FOUND_HEIGHT,- NOT_FOUND_WIDTH,- NotFoundScene,-} from "./not-found-scene";--export function NotFoundRoot() {- return (- <Composition- id="not-found"- component={NotFoundScene}- durationInFrames={NOT_FOUND_DURATION}- fps={NOT_FOUND_FPS}- width={NOT_FOUND_WIDTH}- height={NOT_FOUND_HEIGHT}- defaultProps={{ theme: "dark" as const }}- />- );-}--registerRoot(NotFoundRoot);diff --git a/src/remotion/not-found-scene.tsx b/src/remotion/not-found-scene.tsxdeleted file mode 100644index 67a0b83b..00000000--- a/src/remotion/not-found-scene.tsx+++ /dev/null@@ -1,90 +0,0 @@-import { loadFont } from "@remotion/google-fonts/Manrope";-import { linearTiming, TransitionSeries } from "@remotion/transitions";-import { AbsoluteFill } from "remotion";-import { swirlDissolve } from "@/registry/remocn/swirl-dissolve";--const { fontFamily } = loadFont("normal", {- weights: ["600"],- subsets: ["latin"],-});--export type NotFoundTheme = "light" | "dark";--export type NotFoundSceneProps = {- [key: string]: unknown;- theme: NotFoundTheme;-};--const PALETTE = {- dark: {- backdrop: "#111115",- text: "#eeeeee",- swirl: ["#1b1926", "#463c5e", "#d4b3ff"],- },- light: {- backdrop: "#ffffff",- text: "#0a0a0a",- swirl: ["#f3eefb", "#cdb9ef", "#8266b8"],- },-} satisfies Record<- NotFoundTheme,- { backdrop: string; text: string; swirl: string[] }->;--export const NOT_FOUND_FPS = 30;-export const NOT_FOUND_WIDTH = 1920;-export const NOT_FOUND_HEIGHT = 720;--const TRANSITION_FRAMES = 90;-const HOLD_FRAMES = 130;--export const NOT_FOUND_DURATION = HOLD_FRAMES * 2 - TRANSITION_FRAMES;--function Code({ color }: { color: string }) {- return (- <AbsoluteFill- style={{- alignItems: "center",- justifyContent: "center",- }}- >- <span- style={{- fontFamily,- fontSize: 260,- fontWeight: 600,- letterSpacing: "-0.05em",- color,- }}- >- 404- </span>- </AbsoluteFill>- );-}--export function NotFoundScene({ theme }: NotFoundSceneProps) {- const { backdrop, text, swirl } = PALETTE[theme];-- return (- <AbsoluteFill style={{ backgroundColor: backdrop }}>- <TransitionSeries>- <TransitionSeries.Sequence durationInFrames={HOLD_FRAMES}>- <Code color={text} />- </TransitionSeries.Sequence>- <TransitionSeries.Transition- timing={linearTiming({ durationInFrames: TRANSITION_FRAMES })}- presentation={swirlDissolve({- colors: swirl,- colorBack: backdrop,- bandCount: 10,- softness: 0.35,- })}- />- <TransitionSeries.Sequence durationInFrames={HOLD_FRAMES}>- <Code color={text} />- </TransitionSeries.Sequence>- </TransitionSeries>- </AbsoluteFill>- );-}