@json-render/remotion 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +310 -0
- package/dist/chunk-5C3GTKV7.mjs +356 -0
- package/dist/chunk-5C3GTKV7.mjs.map +1 -0
- package/dist/index.d.mts +166 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +913 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +532 -0
- package/dist/index.mjs.map +1 -0
- package/dist/server.d.mts +426 -0
- package/dist/server.d.ts +426 -0
- package/dist/server.js +385 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +13 -0
- package/dist/server.mjs.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/hooks.ts","../src/components/ClipWrapper.tsx","../src/components/standard.tsx","../src/components/Renderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { useVideoConfig, spring, interpolate } from \"remotion\";\nimport type { Clip, TransitionStyles } from \"./types\";\n\n/**\n * Calculate transition styles based on clip configuration\n *\n * Handles both transitionIn and transitionOut with support for:\n * - fade\n * - slideLeft / slideRight\n * - slideUp / slideDown\n * - zoom\n * - wipe\n */\nexport function useTransition(clip: Clip, frame: number): TransitionStyles {\n const { fps } = useVideoConfig();\n const relativeFrame = frame - clip.from;\n const clipEnd = clip.durationInFrames;\n\n let opacity = 1;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n\n // Transition in\n if (clip.transitionIn && relativeFrame < clip.transitionIn.durationInFrames) {\n const progress = relativeFrame / clip.transitionIn.durationInFrames;\n const easedProgress = spring({\n frame: relativeFrame,\n fps,\n config: { damping: 200 },\n durationInFrames: clip.transitionIn.durationInFrames,\n });\n\n switch (clip.transitionIn.type) {\n case \"fade\":\n opacity = easedProgress;\n break;\n case \"slideLeft\":\n translateX = interpolate(easedProgress, [0, 1], [100, 0]);\n opacity = easedProgress;\n break;\n case \"slideRight\":\n translateX = interpolate(easedProgress, [0, 1], [-100, 0]);\n opacity = easedProgress;\n break;\n case \"slideUp\":\n translateY = interpolate(easedProgress, [0, 1], [100, 0]);\n opacity = easedProgress;\n break;\n case \"slideDown\":\n translateY = interpolate(easedProgress, [0, 1], [-100, 0]);\n opacity = easedProgress;\n break;\n case \"zoom\":\n scale = interpolate(easedProgress, [0, 1], [0.8, 1]);\n opacity = easedProgress;\n break;\n case \"wipe\":\n opacity = progress;\n break;\n }\n }\n\n // Transition out\n if (\n clip.transitionOut &&\n relativeFrame > clipEnd - clip.transitionOut.durationInFrames\n ) {\n const outStart = clipEnd - clip.transitionOut.durationInFrames;\n const outProgress =\n (relativeFrame - outStart) / clip.transitionOut.durationInFrames;\n const easedOutProgress = 1 - outProgress;\n\n switch (clip.transitionOut.type) {\n case \"fade\":\n opacity = Math.min(opacity, easedOutProgress);\n break;\n case \"slideLeft\":\n translateX = interpolate(outProgress, [0, 1], [0, -100]);\n opacity = Math.min(opacity, easedOutProgress);\n break;\n case \"slideRight\":\n translateX = interpolate(outProgress, [0, 1], [0, 100]);\n opacity = Math.min(opacity, easedOutProgress);\n break;\n case \"slideUp\":\n translateY = interpolate(outProgress, [0, 1], [0, -100]);\n opacity = Math.min(opacity, easedOutProgress);\n break;\n case \"slideDown\":\n translateY = interpolate(outProgress, [0, 1], [0, 100]);\n opacity = Math.min(opacity, easedOutProgress);\n break;\n case \"zoom\":\n scale = interpolate(outProgress, [0, 1], [1, 1.2]);\n opacity = Math.min(opacity, easedOutProgress);\n break;\n }\n }\n\n return { opacity, translateX, translateY, scale };\n}\n","\"use client\";\n\nimport { AbsoluteFill, useCurrentFrame } from \"remotion\";\nimport { useTransition } from \"./hooks\";\nimport type { Clip } from \"./types\";\n\ninterface ClipWrapperProps {\n clip: Clip;\n children: React.ReactNode;\n}\n\n/**\n * Wrapper component that applies transition animations to clips\n *\n * Automatically handles transitionIn and transitionOut based on clip config.\n */\nexport function ClipWrapper({ clip, children }: ClipWrapperProps) {\n const frame = useCurrentFrame();\n const { opacity, translateX, translateY, scale } = useTransition(\n clip,\n frame + clip.from,\n );\n\n return (\n <AbsoluteFill\n style={{\n opacity,\n transform: `translateX(${translateX}%) translateY(${translateY}%) scale(${scale})`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n}\n","\"use client\";\n\nimport {\n AbsoluteFill,\n useCurrentFrame,\n useVideoConfig,\n spring,\n} from \"remotion\";\nimport { ClipWrapper } from \"./ClipWrapper\";\nimport type { Clip } from \"./types\";\n\n// =============================================================================\n// TitleCard - Full-screen title with optional subtitle\n// =============================================================================\n\nexport function TitleCard({ clip }: { clip: Clip }) {\n const { title, subtitle, backgroundColor, textColor } = clip.props as {\n title: string;\n subtitle?: string;\n backgroundColor?: string;\n textColor?: string;\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill\n style={{\n backgroundColor: backgroundColor || \"#1a1a2e\",\n color: textColor || \"#ffffff\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 40,\n }}\n >\n <div\n style={{\n fontSize: 72,\n fontWeight: \"bold\",\n textAlign: \"center\",\n marginBottom: 16,\n }}\n >\n {title}\n </div>\n {subtitle && (\n <div\n style={{\n fontSize: 36,\n opacity: 0.7,\n textAlign: \"center\",\n }}\n >\n {subtitle}\n </div>\n )}\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// ImageSlide - Full-screen image display\n// =============================================================================\n\nexport function ImageSlide({ clip }: { clip: Clip }) {\n const { src, alt, fit, backgroundColor } = clip.props as {\n src: string;\n alt: string;\n fit?: \"cover\" | \"contain\";\n backgroundColor?: string;\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill\n style={{\n backgroundColor: backgroundColor || \"#0a0a0a\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {src ? (\n <img\n src={src}\n alt={alt}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: fit || \"cover\",\n }}\n />\n ) : (\n <div style={{ color: \"rgba(255,255,255,0.5)\", fontSize: 24 }}>\n [{alt}]\n </div>\n )}\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// SplitScreen - Two-panel comparison view\n// =============================================================================\n\nexport function SplitScreen({ clip }: { clip: Clip }) {\n const { leftTitle, rightTitle, leftColor, rightColor } = clip.props as {\n leftTitle: string;\n rightTitle: string;\n leftColor?: string;\n rightColor?: string;\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill style={{ display: \"flex\", flexDirection: \"row\" }}>\n <div\n style={{\n flex: 1,\n backgroundColor: leftColor || \"#1a1a2e\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"#ffffff\",\n }}\n >\n <div style={{ fontSize: 48, fontWeight: \"bold\" }}>{leftTitle}</div>\n </div>\n <div\n style={{\n flex: 1,\n backgroundColor: rightColor || \"#2e1a1a\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"#ffffff\",\n }}\n >\n <div style={{ fontSize: 48, fontWeight: \"bold\" }}>{rightTitle}</div>\n </div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// QuoteCard - Quote with attribution\n// =============================================================================\n\nexport function QuoteCard({ clip }: { clip: Clip }) {\n const { quote, author, backgroundColor } = clip.props as {\n quote: string;\n author?: string;\n backgroundColor?: string;\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill\n style={{\n backgroundColor: backgroundColor || \"#1a1a2e\",\n color: \"#ffffff\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 80,\n }}\n >\n <div\n style={{\n fontSize: 48,\n fontStyle: \"italic\",\n textAlign: \"center\",\n marginBottom: 24,\n }}\n >\n “{quote}”\n </div>\n {author && <div style={{ fontSize: 28, opacity: 0.7 }}>- {author}</div>}\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// StatCard - Large statistic display with animation\n// =============================================================================\n\nexport function StatCard({ clip }: { clip: Clip }) {\n const { value, label, prefix, suffix, backgroundColor } = clip.props as {\n value: string | number;\n label: string;\n prefix?: string;\n suffix?: string;\n backgroundColor?: string;\n };\n\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n\n // Animate the number counting up\n const animationProgress = spring({\n frame,\n fps,\n config: { damping: 100 },\n durationInFrames: 30,\n });\n\n const numValue = typeof value === \"number\" ? value : parseFloat(value) || 0;\n const displayValue = Math.round(numValue * animationProgress);\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill\n style={{\n backgroundColor: backgroundColor || \"#1a1a2e\",\n color: \"#ffffff\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div style={{ fontSize: 96, fontWeight: \"bold\", marginBottom: 16 }}>\n {prefix || \"\"}\n {typeof value === \"number\" ? displayValue : value}\n {suffix || \"\"}\n </div>\n <div style={{ fontSize: 32, opacity: 0.7 }}>{label}</div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// LowerThird - Name/title overlay\n// =============================================================================\n\nexport function LowerThird({ clip }: { clip: Clip }) {\n const { name, title } = clip.props as {\n name: string;\n title?: string;\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill>\n <div\n style={{\n position: \"absolute\",\n bottom: 100,\n left: 40,\n backgroundColor: \"rgba(0,0,0,0.8)\",\n color: \"#ffffff\",\n padding: \"16px 24px\",\n borderRadius: 8,\n }}\n >\n <div style={{ fontSize: 28, fontWeight: \"bold\" }}>{name}</div>\n {title && <div style={{ fontSize: 20, opacity: 0.7 }}>{title}</div>}\n </div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// TextOverlay - Simple text overlay\n// =============================================================================\n\nexport function TextOverlay({ clip }: { clip: Clip }) {\n const { text, position, fontSize } = clip.props as {\n text: string;\n position?: \"top\" | \"center\" | \"bottom\";\n fontSize?: \"small\" | \"medium\" | \"large\";\n };\n\n const positionStyles: Record<string, React.CSSProperties> = {\n top: { top: 100, left: 0, right: 0 },\n center: { top: \"50%\", left: 0, right: 0, transform: \"translateY(-50%)\" },\n bottom: { bottom: 100, left: 0, right: 0 },\n };\n\n const fontSizes: Record<string, number> = {\n small: 24,\n medium: 36,\n large: 56,\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill>\n <div\n style={{\n position: \"absolute\",\n ...positionStyles[position || \"center\"],\n textAlign: \"center\",\n color: \"#ffffff\",\n fontSize: fontSizes[fontSize || \"medium\"],\n padding: 20,\n textShadow: \"2px 2px 4px rgba(0,0,0,0.5)\",\n }}\n >\n {text}\n </div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// TypingText - Terminal-style typing animation\n// =============================================================================\n\nexport function TypingText({ clip }: { clip: Clip }) {\n const {\n text,\n backgroundColor,\n textColor,\n fontSize,\n fontFamily,\n showCursor = true,\n cursorChar = \"|\",\n charsPerSecond = 15,\n } = clip.props as {\n text: string;\n backgroundColor?: string;\n textColor?: string;\n fontSize?: number;\n fontFamily?: \"monospace\" | \"sans-serif\" | \"serif\";\n showCursor?: boolean;\n cursorChar?: string;\n charsPerSecond?: number;\n };\n\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n\n // Calculate how many characters to show based on current frame\n const framesPerChar = fps / charsPerSecond;\n const charsToShow = Math.min(Math.floor(frame / framesPerChar), text.length);\n const displayedText = text.slice(0, charsToShow);\n const isTypingComplete = charsToShow >= text.length;\n\n // Blinking cursor (blinks every 0.5 seconds)\n const cursorVisible =\n showCursor &&\n (Math.floor(frame / (fps / 2)) % 2 === 0 || !isTypingComplete);\n\n const fontFamilyMap: Record<string, string> = {\n monospace: \"'Courier New', Consolas, monospace\",\n \"sans-serif\": \"system-ui, -apple-system, sans-serif\",\n serif: \"Georgia, 'Times New Roman', serif\",\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill\n style={{\n backgroundColor: backgroundColor || \"#1e1e1e\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 60,\n }}\n >\n <div\n style={{\n color: textColor || \"#00ff00\",\n fontSize: fontSize || 48,\n fontFamily: fontFamilyMap[fontFamily || \"monospace\"],\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n maxWidth: \"90%\",\n textAlign: \"left\",\n }}\n >\n {displayedText}\n {cursorVisible && (\n <span\n style={{\n opacity: isTypingComplete\n ? Math.floor(frame / (fps / 2)) % 2 === 0\n ? 1\n : 0\n : 1,\n }}\n >\n {cursorChar}\n </span>\n )}\n </div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// LogoBug - Corner watermark/logo\n// =============================================================================\n\nexport function LogoBug({ clip }: { clip: Clip }) {\n const { position, opacity: propOpacity } = clip.props as {\n position?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n opacity?: number;\n };\n\n const positionStyles: Record<string, React.CSSProperties> = {\n \"top-left\": { top: 20, left: 20 },\n \"top-right\": { top: 20, right: 20 },\n \"bottom-left\": { bottom: 20, left: 20 },\n \"bottom-right\": { bottom: 20, right: 20 },\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill>\n <div\n style={{\n position: \"absolute\",\n ...positionStyles[position || \"bottom-right\"],\n opacity: propOpacity ?? 0.5,\n color: \"#ffffff\",\n fontSize: 14,\n fontWeight: \"bold\",\n textShadow: \"1px 1px 2px rgba(0,0,0,0.5)\",\n }}\n >\n LOGO\n </div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n\n// =============================================================================\n// VideoClip - Video file playback (placeholder)\n// =============================================================================\n\nexport function VideoClip({ clip }: { clip: Clip }) {\n const { src } = clip.props as {\n src: string;\n startFrom?: number;\n volume?: number;\n };\n\n return (\n <ClipWrapper clip={clip}>\n <AbsoluteFill\n style={{\n backgroundColor: \"#000000\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"rgba(255,255,255,0.5)\",\n }}\n >\n <div>[Video: {src}]</div>\n </AbsoluteFill>\n </ClipWrapper>\n );\n}\n","\"use client\";\n\nimport { AbsoluteFill, Sequence } from \"remotion\";\nimport type { TimelineSpec, ComponentRegistry, Clip } from \"./types\";\n\n// Import standard components\nimport {\n TitleCard,\n ImageSlide,\n SplitScreen,\n QuoteCard,\n StatCard,\n LowerThird,\n TextOverlay,\n TypingText,\n LogoBug,\n VideoClip,\n} from \"./standard\";\n\n/**\n * Standard components provided by @json-render/remotion\n */\nexport const standardComponents: ComponentRegistry = {\n TitleCard,\n ImageSlide,\n SplitScreen,\n QuoteCard,\n StatCard,\n LowerThird,\n TextOverlay,\n TypingText,\n LogoBug,\n VideoClip,\n};\n\ninterface RendererProps {\n /** The timeline spec to render */\n spec: TimelineSpec;\n /**\n * Custom component registry to merge with standard components.\n * Custom components override standard ones with the same name.\n */\n components?: ComponentRegistry;\n}\n\n/**\n * Renders a timeline spec into Remotion components\n *\n * @example\n * // Use with standard components only\n * <Renderer spec={mySpec} />\n *\n * @example\n * // Add custom components\n * <Renderer\n * spec={mySpec}\n * components={{\n * CustomScene: MyCustomSceneComponent,\n * }}\n * />\n */\nexport function Renderer({\n spec,\n components: customComponents,\n}: RendererProps) {\n // Merge standard + custom components (custom overrides standard)\n const components: ComponentRegistry = {\n ...standardComponents,\n ...customComponents,\n };\n\n if (!spec.clips || spec.clips.length === 0) {\n return (\n <AbsoluteFill\n style={{\n backgroundColor: \"#1a1a2e\",\n color: \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div style={{ fontSize: 24, opacity: 0.5 }}>No clips</div>\n </AbsoluteFill>\n );\n }\n\n // Separate main track clips from overlay clips\n const mainClips = spec.clips.filter((c) => c.trackId === \"main\");\n const overlayClips = spec.clips.filter((c) => c.trackId === \"overlay\");\n\n const renderClip = (clip: Clip) => {\n const Component = components[clip.component];\n if (!Component) {\n console.warn(`Unknown component: ${clip.component}`);\n return null;\n }\n\n return (\n <Sequence\n key={clip.id}\n from={clip.from}\n durationInFrames={clip.durationInFrames}\n >\n <Component clip={clip} />\n </Sequence>\n );\n };\n\n return (\n <AbsoluteFill style={{ backgroundColor: \"#000000\" }}>\n {/* Main track clips */}\n {mainClips.map(renderClip)}\n\n {/* Overlay clips */}\n {overlayClips.map(renderClip)}\n </AbsoluteFill>\n );\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,gBAAgB,QAAQ,mBAAmB;AAa7C,SAAS,cAAc,MAAY,OAAiC;AACzE,QAAM,EAAE,IAAI,IAAI,eAAe;AAC/B,QAAM,gBAAgB,QAAQ,KAAK;AACnC,QAAM,UAAU,KAAK;AAErB,MAAI,UAAU;AACd,MAAI,aAAa;AACjB,MAAI,aAAa;AACjB,MAAI,QAAQ;AAGZ,MAAI,KAAK,gBAAgB,gBAAgB,KAAK,aAAa,kBAAkB;AAC3E,UAAM,WAAW,gBAAgB,KAAK,aAAa;AACnD,UAAM,gBAAgB,OAAO;AAAA,MAC3B,OAAO;AAAA,MACP;AAAA,MACA,QAAQ,EAAE,SAAS,IAAI;AAAA,MACvB,kBAAkB,KAAK,aAAa;AAAA,IACtC,CAAC;AAED,YAAQ,KAAK,aAAa,MAAM;AAAA,MAC9B,KAAK;AACH,kBAAU;AACV;AAAA,MACF,KAAK;AACH,qBAAa,YAAY,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxD,kBAAU;AACV;AAAA,MACF,KAAK;AACH,qBAAa,YAAY,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACzD,kBAAU;AACV;AAAA,MACF,KAAK;AACH,qBAAa,YAAY,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxD,kBAAU;AACV;AAAA,MACF,KAAK;AACH,q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AAK;AAAA,QACX,kBAAkB,KAAK;AAAA,QAEvB,0BAAAA,KAAC,aAAU,MAAY;AAAA;AAAA,MAJlB,KAAK;AAAA,IAKZ;AAAA,EAEJ;AAEA,SACE,gBAAAC,MAACC,eAAA,EAAa,OAAO,EAAE,iBAAiB,UAAU,GAE/C;AAAA,cAAU,IAAI,UAAU;AAAA,IAGxB,aAAa,IAAI,UAAU;AAAA,KAC9B;AAEJ;","names":["AbsoluteFill","useCurrentFrame","useVideoConfig","spring","jsx","AbsoluteFill","useCurrentFrame","useVideoConfig","spring","AbsoluteFill","jsx","jsxs","AbsoluteFill"]}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import * as _json_render_core from '@json-render/core';
|
|
2
|
+
import { Catalog, InferCatalogComponents, InferComponentProps } from '@json-render/core';
|
|
3
|
+
export { Spec } from '@json-render/core';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The schema for @json-render/remotion
|
|
9
|
+
*
|
|
10
|
+
* This schema is fundamentally different from the React element tree schema.
|
|
11
|
+
* It's timeline-based, designed for video composition:
|
|
12
|
+
*
|
|
13
|
+
* - Spec: A composition with tracks containing timed clips
|
|
14
|
+
* - Catalog: Video components (scenes, overlays, etc.) and effects
|
|
15
|
+
*
|
|
16
|
+
* This demonstrates that json-render is truly agnostic - different renderers
|
|
17
|
+
* can have completely different spec formats.
|
|
18
|
+
*/
|
|
19
|
+
declare const schema: _json_render_core.Schema<{
|
|
20
|
+
spec: _json_render_core.SchemaType<"object", {
|
|
21
|
+
/** Composition settings */
|
|
22
|
+
composition: _json_render_core.SchemaType<"object", {
|
|
23
|
+
/** Unique composition ID */
|
|
24
|
+
id: _json_render_core.SchemaType<"string", unknown>;
|
|
25
|
+
/** Frames per second */
|
|
26
|
+
fps: _json_render_core.SchemaType<"number", unknown>;
|
|
27
|
+
/** Width in pixels */
|
|
28
|
+
width: _json_render_core.SchemaType<"number", unknown>;
|
|
29
|
+
/** Height in pixels */
|
|
30
|
+
height: _json_render_core.SchemaType<"number", unknown>;
|
|
31
|
+
/** Total duration in frames */
|
|
32
|
+
durationInFrames: _json_render_core.SchemaType<"number", unknown>;
|
|
33
|
+
}>;
|
|
34
|
+
/** Timeline tracks (like layers in video editing) */
|
|
35
|
+
tracks: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"object", {
|
|
36
|
+
/** Unique track ID */
|
|
37
|
+
id: _json_render_core.SchemaType<"string", unknown>;
|
|
38
|
+
/** Track name for organization */
|
|
39
|
+
name: _json_render_core.SchemaType<"string", unknown>;
|
|
40
|
+
/** Track type: "video" | "audio" | "overlay" | "text" */
|
|
41
|
+
type: _json_render_core.SchemaType<"string", unknown>;
|
|
42
|
+
/** Whether track is muted/hidden */
|
|
43
|
+
enabled: _json_render_core.SchemaType<"boolean", unknown>;
|
|
44
|
+
}>>;
|
|
45
|
+
/** Clips placed on the timeline */
|
|
46
|
+
clips: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"object", {
|
|
47
|
+
/** Unique clip ID */
|
|
48
|
+
id: _json_render_core.SchemaType<"string", unknown>;
|
|
49
|
+
/** Which track this clip belongs to */
|
|
50
|
+
trackId: _json_render_core.SchemaType<"string", unknown>;
|
|
51
|
+
/** Component type from catalog */
|
|
52
|
+
component: _json_render_core.SchemaType<"ref", string>;
|
|
53
|
+
/** Component props */
|
|
54
|
+
props: _json_render_core.SchemaType<"propsOf", string>;
|
|
55
|
+
/** Start frame (when clip begins) */
|
|
56
|
+
from: _json_render_core.SchemaType<"number", unknown>;
|
|
57
|
+
/** Duration in frames */
|
|
58
|
+
durationInFrames: _json_render_core.SchemaType<"number", unknown>;
|
|
59
|
+
/** Transition in effect */
|
|
60
|
+
transitionIn: _json_render_core.SchemaType<"object", {
|
|
61
|
+
type: _json_render_core.SchemaType<"ref", string>;
|
|
62
|
+
durationInFrames: _json_render_core.SchemaType<"number", unknown>;
|
|
63
|
+
}>;
|
|
64
|
+
/** Transition out effect */
|
|
65
|
+
transitionOut: _json_render_core.SchemaType<"object", {
|
|
66
|
+
type: _json_render_core.SchemaType<"ref", string>;
|
|
67
|
+
durationInFrames: _json_render_core.SchemaType<"number", unknown>;
|
|
68
|
+
}>;
|
|
69
|
+
}>>;
|
|
70
|
+
/** Audio configuration */
|
|
71
|
+
audio: _json_render_core.SchemaType<"object", {
|
|
72
|
+
/** Background music/audio clips */
|
|
73
|
+
tracks: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"object", {
|
|
74
|
+
id: _json_render_core.SchemaType<"string", unknown>;
|
|
75
|
+
src: _json_render_core.SchemaType<"string", unknown>;
|
|
76
|
+
from: _json_render_core.SchemaType<"number", unknown>;
|
|
77
|
+
durationInFrames: _json_render_core.SchemaType<"number", unknown>;
|
|
78
|
+
volume: _json_render_core.SchemaType<"number", unknown>;
|
|
79
|
+
}>>;
|
|
80
|
+
}>;
|
|
81
|
+
}>;
|
|
82
|
+
catalog: _json_render_core.SchemaType<"object", {
|
|
83
|
+
/** Video component definitions (scenes, overlays, etc.) */
|
|
84
|
+
components: _json_render_core.SchemaType<"map", {
|
|
85
|
+
/** Zod schema for component props */
|
|
86
|
+
props: _json_render_core.SchemaType<"zod", unknown>;
|
|
87
|
+
/** Component type: "scene" | "overlay" | "text" | "image" | "video" */
|
|
88
|
+
type: _json_render_core.SchemaType<"string", unknown>;
|
|
89
|
+
/** Default duration in frames (can be overridden per clip) */
|
|
90
|
+
defaultDuration: _json_render_core.SchemaType<"number", unknown>;
|
|
91
|
+
/** Description for AI generation hints */
|
|
92
|
+
description: _json_render_core.SchemaType<"string", unknown>;
|
|
93
|
+
}>;
|
|
94
|
+
/** Transition effect definitions */
|
|
95
|
+
transitions: _json_render_core.SchemaType<"map", {
|
|
96
|
+
/** Default duration in frames */
|
|
97
|
+
defaultDuration: _json_render_core.SchemaType<"number", unknown>;
|
|
98
|
+
/** Description for AI generation hints */
|
|
99
|
+
description: _json_render_core.SchemaType<"string", unknown>;
|
|
100
|
+
}>;
|
|
101
|
+
/** Effect definitions (filters, animations, etc.) */
|
|
102
|
+
effects: _json_render_core.SchemaType<"map", {
|
|
103
|
+
/** Zod schema for effect params */
|
|
104
|
+
params: _json_render_core.SchemaType<"zod", unknown>;
|
|
105
|
+
/** Description for AI generation hints */
|
|
106
|
+
description: _json_render_core.SchemaType<"string", unknown>;
|
|
107
|
+
}>;
|
|
108
|
+
}>;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Type for the Remotion schema
|
|
112
|
+
*/
|
|
113
|
+
type RemotionSchema = typeof schema;
|
|
114
|
+
/**
|
|
115
|
+
* Infer the spec type from a catalog
|
|
116
|
+
*/
|
|
117
|
+
type RemotionSpec<TCatalog> = typeof schema extends {
|
|
118
|
+
createCatalog: (catalog: TCatalog) => {
|
|
119
|
+
_specType: infer S;
|
|
120
|
+
};
|
|
121
|
+
} ? S : never;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Frame information passed to video components
|
|
125
|
+
*/
|
|
126
|
+
interface FrameContext {
|
|
127
|
+
/** Current frame number */
|
|
128
|
+
frame: number;
|
|
129
|
+
/** Frames per second */
|
|
130
|
+
fps: number;
|
|
131
|
+
/** Total duration in frames */
|
|
132
|
+
durationInFrames: number;
|
|
133
|
+
/** Width in pixels */
|
|
134
|
+
width: number;
|
|
135
|
+
/** Height in pixels */
|
|
136
|
+
height: number;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Context passed to video component render functions
|
|
140
|
+
*/
|
|
141
|
+
interface VideoComponentContext<C extends Catalog, K extends keyof InferCatalogComponents<C>> {
|
|
142
|
+
/** Component props from the spec */
|
|
143
|
+
props: InferComponentProps<C, K>;
|
|
144
|
+
/** Frame information */
|
|
145
|
+
frame: FrameContext;
|
|
146
|
+
/** Children (for container components) */
|
|
147
|
+
children?: ReactNode;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Video component render function type
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* const TitleCard: VideoComponentFn<typeof catalog, 'TitleCard'> = ({ props, frame }) => {
|
|
154
|
+
* const opacity = interpolate(frame.frame, [0, 30], [0, 1]);
|
|
155
|
+
* return <div style={{ opacity }}>{props.title}</div>;
|
|
156
|
+
* };
|
|
157
|
+
*/
|
|
158
|
+
type VideoComponentFn<C extends Catalog, K extends keyof InferCatalogComponents<C>> = (ctx: VideoComponentContext<C, K>) => ReactNode;
|
|
159
|
+
/**
|
|
160
|
+
* Registry of all video component render functions for a catalog
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* const components: VideoComponents<typeof myCatalog> = {
|
|
164
|
+
* TitleCard: ({ props, frame }) => <TitleCard {...props} />,
|
|
165
|
+
* ImageSlide: ({ props }) => <Img src={props.src} />,
|
|
166
|
+
* };
|
|
167
|
+
*/
|
|
168
|
+
type VideoComponents<C extends Catalog> = {
|
|
169
|
+
[K in keyof InferCatalogComponents<C>]: VideoComponentFn<C, K>;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Transition render function
|
|
173
|
+
* Returns a style object to apply during the transition
|
|
174
|
+
*/
|
|
175
|
+
type TransitionFn = (progress: number) => React.CSSProperties;
|
|
176
|
+
/**
|
|
177
|
+
* Built-in transition types
|
|
178
|
+
*/
|
|
179
|
+
type BuiltInTransition = "fade" | "slideLeft" | "slideRight" | "slideUp" | "slideDown" | "zoom" | "wipe";
|
|
180
|
+
/**
|
|
181
|
+
* Infer effect params from catalog
|
|
182
|
+
*/
|
|
183
|
+
type InferCatalogEffects<C extends Catalog> = C extends {
|
|
184
|
+
data: {
|
|
185
|
+
effects: infer E;
|
|
186
|
+
};
|
|
187
|
+
} ? E : never;
|
|
188
|
+
/**
|
|
189
|
+
* Effect handler function
|
|
190
|
+
*/
|
|
191
|
+
type EffectFn<C extends Catalog, K extends keyof InferCatalogEffects<C>> = InferCatalogEffects<C>[K] extends {
|
|
192
|
+
params: {
|
|
193
|
+
_output: infer P;
|
|
194
|
+
};
|
|
195
|
+
} ? (params: P, frame: FrameContext) => React.CSSProperties : (params: undefined, frame: FrameContext) => React.CSSProperties;
|
|
196
|
+
/**
|
|
197
|
+
* Registry of all effect handlers for a catalog
|
|
198
|
+
*/
|
|
199
|
+
type Effects<C extends Catalog> = {
|
|
200
|
+
[K in keyof InferCatalogEffects<C>]: EffectFn<C, K>;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Standard component definitions for Remotion catalogs
|
|
205
|
+
*
|
|
206
|
+
* These can be used directly or extended with custom components.
|
|
207
|
+
*/
|
|
208
|
+
declare const standardComponentDefinitions: {
|
|
209
|
+
TitleCard: {
|
|
210
|
+
props: z.ZodObject<{
|
|
211
|
+
title: z.ZodString;
|
|
212
|
+
subtitle: z.ZodNullable<z.ZodString>;
|
|
213
|
+
backgroundColor: z.ZodNullable<z.ZodString>;
|
|
214
|
+
textColor: z.ZodNullable<z.ZodString>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
type: string;
|
|
217
|
+
defaultDuration: number;
|
|
218
|
+
description: string;
|
|
219
|
+
};
|
|
220
|
+
ImageSlide: {
|
|
221
|
+
props: z.ZodObject<{
|
|
222
|
+
src: z.ZodString;
|
|
223
|
+
alt: z.ZodString;
|
|
224
|
+
fit: z.ZodNullable<z.ZodEnum<{
|
|
225
|
+
cover: "cover";
|
|
226
|
+
contain: "contain";
|
|
227
|
+
}>>;
|
|
228
|
+
backgroundColor: z.ZodNullable<z.ZodString>;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
type: string;
|
|
231
|
+
defaultDuration: number;
|
|
232
|
+
description: string;
|
|
233
|
+
};
|
|
234
|
+
SplitScreen: {
|
|
235
|
+
props: z.ZodObject<{
|
|
236
|
+
leftTitle: z.ZodString;
|
|
237
|
+
rightTitle: z.ZodString;
|
|
238
|
+
leftColor: z.ZodNullable<z.ZodString>;
|
|
239
|
+
rightColor: z.ZodNullable<z.ZodString>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
type: string;
|
|
242
|
+
defaultDuration: number;
|
|
243
|
+
description: string;
|
|
244
|
+
};
|
|
245
|
+
QuoteCard: {
|
|
246
|
+
props: z.ZodObject<{
|
|
247
|
+
quote: z.ZodString;
|
|
248
|
+
author: z.ZodNullable<z.ZodString>;
|
|
249
|
+
backgroundColor: z.ZodNullable<z.ZodString>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
type: string;
|
|
252
|
+
defaultDuration: number;
|
|
253
|
+
description: string;
|
|
254
|
+
};
|
|
255
|
+
StatCard: {
|
|
256
|
+
props: z.ZodObject<{
|
|
257
|
+
value: z.ZodString;
|
|
258
|
+
label: z.ZodString;
|
|
259
|
+
prefix: z.ZodNullable<z.ZodString>;
|
|
260
|
+
suffix: z.ZodNullable<z.ZodString>;
|
|
261
|
+
backgroundColor: z.ZodNullable<z.ZodString>;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
type: string;
|
|
264
|
+
defaultDuration: number;
|
|
265
|
+
description: string;
|
|
266
|
+
};
|
|
267
|
+
TypingText: {
|
|
268
|
+
props: z.ZodObject<{
|
|
269
|
+
text: z.ZodString;
|
|
270
|
+
backgroundColor: z.ZodNullable<z.ZodString>;
|
|
271
|
+
textColor: z.ZodNullable<z.ZodString>;
|
|
272
|
+
fontSize: z.ZodNullable<z.ZodNumber>;
|
|
273
|
+
fontFamily: z.ZodNullable<z.ZodEnum<{
|
|
274
|
+
monospace: "monospace";
|
|
275
|
+
"sans-serif": "sans-serif";
|
|
276
|
+
serif: "serif";
|
|
277
|
+
}>>;
|
|
278
|
+
showCursor: z.ZodNullable<z.ZodBoolean>;
|
|
279
|
+
cursorChar: z.ZodNullable<z.ZodString>;
|
|
280
|
+
charsPerSecond: z.ZodNullable<z.ZodNumber>;
|
|
281
|
+
}, z.core.$strip>;
|
|
282
|
+
type: string;
|
|
283
|
+
defaultDuration: number;
|
|
284
|
+
description: string;
|
|
285
|
+
};
|
|
286
|
+
LowerThird: {
|
|
287
|
+
props: z.ZodObject<{
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
title: z.ZodNullable<z.ZodString>;
|
|
290
|
+
backgroundColor: z.ZodNullable<z.ZodString>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
type: string;
|
|
293
|
+
defaultDuration: number;
|
|
294
|
+
description: string;
|
|
295
|
+
};
|
|
296
|
+
TextOverlay: {
|
|
297
|
+
props: z.ZodObject<{
|
|
298
|
+
text: z.ZodString;
|
|
299
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
300
|
+
top: "top";
|
|
301
|
+
center: "center";
|
|
302
|
+
bottom: "bottom";
|
|
303
|
+
}>>;
|
|
304
|
+
fontSize: z.ZodNullable<z.ZodEnum<{
|
|
305
|
+
small: "small";
|
|
306
|
+
medium: "medium";
|
|
307
|
+
large: "large";
|
|
308
|
+
}>>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
type: string;
|
|
311
|
+
defaultDuration: number;
|
|
312
|
+
description: string;
|
|
313
|
+
};
|
|
314
|
+
LogoBug: {
|
|
315
|
+
props: z.ZodObject<{
|
|
316
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
317
|
+
"top-left": "top-left";
|
|
318
|
+
"top-right": "top-right";
|
|
319
|
+
"bottom-left": "bottom-left";
|
|
320
|
+
"bottom-right": "bottom-right";
|
|
321
|
+
}>>;
|
|
322
|
+
opacity: z.ZodNullable<z.ZodNumber>;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
type: string;
|
|
325
|
+
defaultDuration: number;
|
|
326
|
+
description: string;
|
|
327
|
+
};
|
|
328
|
+
VideoClip: {
|
|
329
|
+
props: z.ZodObject<{
|
|
330
|
+
src: z.ZodString;
|
|
331
|
+
startFrom: z.ZodNullable<z.ZodNumber>;
|
|
332
|
+
volume: z.ZodNullable<z.ZodNumber>;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
type: string;
|
|
335
|
+
defaultDuration: number;
|
|
336
|
+
description: string;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Standard transition definitions for Remotion catalogs
|
|
341
|
+
*/
|
|
342
|
+
declare const standardTransitionDefinitions: {
|
|
343
|
+
fade: {
|
|
344
|
+
defaultDuration: number;
|
|
345
|
+
description: string;
|
|
346
|
+
};
|
|
347
|
+
slideLeft: {
|
|
348
|
+
defaultDuration: number;
|
|
349
|
+
description: string;
|
|
350
|
+
};
|
|
351
|
+
slideRight: {
|
|
352
|
+
defaultDuration: number;
|
|
353
|
+
description: string;
|
|
354
|
+
};
|
|
355
|
+
slideUp: {
|
|
356
|
+
defaultDuration: number;
|
|
357
|
+
description: string;
|
|
358
|
+
};
|
|
359
|
+
slideDown: {
|
|
360
|
+
defaultDuration: number;
|
|
361
|
+
description: string;
|
|
362
|
+
};
|
|
363
|
+
zoom: {
|
|
364
|
+
defaultDuration: number;
|
|
365
|
+
description: string;
|
|
366
|
+
};
|
|
367
|
+
wipe: {
|
|
368
|
+
defaultDuration: number;
|
|
369
|
+
description: string;
|
|
370
|
+
};
|
|
371
|
+
none: {
|
|
372
|
+
defaultDuration: number;
|
|
373
|
+
description: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* Standard effect definitions for Remotion catalogs
|
|
378
|
+
*/
|
|
379
|
+
declare const standardEffectDefinitions: {
|
|
380
|
+
kenBurns: {
|
|
381
|
+
params: z.ZodObject<{
|
|
382
|
+
startScale: z.ZodNumber;
|
|
383
|
+
endScale: z.ZodNumber;
|
|
384
|
+
panX: z.ZodNullable<z.ZodNumber>;
|
|
385
|
+
panY: z.ZodNullable<z.ZodNumber>;
|
|
386
|
+
}, z.core.$strip>;
|
|
387
|
+
description: string;
|
|
388
|
+
};
|
|
389
|
+
pulse: {
|
|
390
|
+
params: z.ZodObject<{
|
|
391
|
+
intensity: z.ZodNumber;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
description: string;
|
|
394
|
+
};
|
|
395
|
+
shake: {
|
|
396
|
+
params: z.ZodObject<{
|
|
397
|
+
intensity: z.ZodNumber;
|
|
398
|
+
}, z.core.$strip>;
|
|
399
|
+
description: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
* Type for component definition
|
|
404
|
+
*/
|
|
405
|
+
type ComponentDefinition = {
|
|
406
|
+
props: z.ZodType;
|
|
407
|
+
type: string;
|
|
408
|
+
defaultDuration: number;
|
|
409
|
+
description: string;
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* Type for transition definition
|
|
413
|
+
*/
|
|
414
|
+
type TransitionDefinition = {
|
|
415
|
+
defaultDuration: number;
|
|
416
|
+
description: string;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Type for effect definition
|
|
420
|
+
*/
|
|
421
|
+
type EffectDefinition = {
|
|
422
|
+
params: z.ZodType;
|
|
423
|
+
description: string;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export { type BuiltInTransition, type ComponentDefinition, type EffectDefinition, type EffectFn, type Effects, type FrameContext, type RemotionSchema, type RemotionSpec, type TransitionDefinition, type TransitionFn, type VideoComponentContext, type VideoComponentFn, type VideoComponents, schema, standardComponentDefinitions, standardEffectDefinitions, standardTransitionDefinitions };
|