@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,356 @@
|
|
|
1
|
+
// src/schema.ts
|
|
2
|
+
import { defineSchema } from "@json-render/core";
|
|
3
|
+
function remotionPromptTemplate(context) {
|
|
4
|
+
const { catalog, options } = context;
|
|
5
|
+
const { system = "You are a video timeline generator.", customRules = [] } = options;
|
|
6
|
+
const lines = [];
|
|
7
|
+
lines.push(system);
|
|
8
|
+
lines.push("");
|
|
9
|
+
lines.push("OUTPUT FORMAT:");
|
|
10
|
+
lines.push(
|
|
11
|
+
"Output JSONL (one JSON object per line) with patches to build a timeline spec."
|
|
12
|
+
);
|
|
13
|
+
lines.push(
|
|
14
|
+
"Each line is a JSON patch operation. Build the timeline incrementally."
|
|
15
|
+
);
|
|
16
|
+
lines.push("");
|
|
17
|
+
lines.push("Example output (each line is a separate JSON object):");
|
|
18
|
+
lines.push("");
|
|
19
|
+
lines.push(`{"op":"set","path":"/composition","value":{"id":"intro","fps":30,"width":1920,"height":1080,"durationInFrames":300}}
|
|
20
|
+
{"op":"set","path":"/tracks","value":[{"id":"main","name":"Main","type":"video","enabled":true},{"id":"overlay","name":"Overlay","type":"overlay","enabled":true}]}
|
|
21
|
+
{"op":"set","path":"/clips/0","value":{"id":"clip-1","trackId":"main","component":"TitleCard","props":{"title":"Welcome","subtitle":"Getting Started"},"from":0,"durationInFrames":90,"transitionIn":{"type":"fade","durationInFrames":15},"transitionOut":{"type":"fade","durationInFrames":15}}}
|
|
22
|
+
{"op":"set","path":"/clips/1","value":{"id":"clip-2","trackId":"main","component":"TitleCard","props":{"title":"Features"},"from":90,"durationInFrames":90}}
|
|
23
|
+
{"op":"set","path":"/audio","value":{"tracks":[]}}`);
|
|
24
|
+
lines.push("");
|
|
25
|
+
const catalogData = catalog;
|
|
26
|
+
if (catalogData.components) {
|
|
27
|
+
lines.push(
|
|
28
|
+
`AVAILABLE COMPONENTS (${Object.keys(catalogData.components).length}):`
|
|
29
|
+
);
|
|
30
|
+
lines.push("");
|
|
31
|
+
for (const [name, def] of Object.entries(catalogData.components)) {
|
|
32
|
+
const duration = def.defaultDuration ? ` [default: ${def.defaultDuration} frames]` : "";
|
|
33
|
+
lines.push(
|
|
34
|
+
`- ${name}: ${def.description || "No description"}${duration}`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
lines.push("");
|
|
38
|
+
}
|
|
39
|
+
if (catalogData.transitions && Object.keys(catalogData.transitions).length > 0) {
|
|
40
|
+
lines.push("AVAILABLE TRANSITIONS:");
|
|
41
|
+
lines.push("");
|
|
42
|
+
for (const [name, def] of Object.entries(catalogData.transitions)) {
|
|
43
|
+
lines.push(`- ${name}: ${def.description || "No description"}`);
|
|
44
|
+
}
|
|
45
|
+
lines.push("");
|
|
46
|
+
}
|
|
47
|
+
lines.push("RULES:");
|
|
48
|
+
const baseRules = [
|
|
49
|
+
"Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences",
|
|
50
|
+
"First set /composition with {id, fps:30, width:1920, height:1080, durationInFrames}",
|
|
51
|
+
"Then set /tracks array with video/overlay tracks",
|
|
52
|
+
"Then set each clip: /clips/0, /clips/1, etc.",
|
|
53
|
+
"Finally set /audio with {tracks:[]}",
|
|
54
|
+
"ONLY use components listed above",
|
|
55
|
+
"fps is always 30 (1 second = 30 frames, 10 seconds = 300 frames)",
|
|
56
|
+
`Clips on "main" track flow sequentially (from = previous clip's from + durationInFrames)`,
|
|
57
|
+
'Overlay clips (LowerThird, TextOverlay) go on "overlay" track'
|
|
58
|
+
];
|
|
59
|
+
const allRules = [...baseRules, ...customRules];
|
|
60
|
+
allRules.forEach((rule, i) => {
|
|
61
|
+
lines.push(`${i + 1}. ${rule}`);
|
|
62
|
+
});
|
|
63
|
+
return lines.join("\n");
|
|
64
|
+
}
|
|
65
|
+
var schema = defineSchema(
|
|
66
|
+
(s) => ({
|
|
67
|
+
// What the AI-generated SPEC looks like (timeline-based)
|
|
68
|
+
spec: s.object({
|
|
69
|
+
/** Composition settings */
|
|
70
|
+
composition: s.object({
|
|
71
|
+
/** Unique composition ID */
|
|
72
|
+
id: s.string(),
|
|
73
|
+
/** Frames per second */
|
|
74
|
+
fps: s.number(),
|
|
75
|
+
/** Width in pixels */
|
|
76
|
+
width: s.number(),
|
|
77
|
+
/** Height in pixels */
|
|
78
|
+
height: s.number(),
|
|
79
|
+
/** Total duration in frames */
|
|
80
|
+
durationInFrames: s.number()
|
|
81
|
+
}),
|
|
82
|
+
/** Timeline tracks (like layers in video editing) */
|
|
83
|
+
tracks: s.array(
|
|
84
|
+
s.object({
|
|
85
|
+
/** Unique track ID */
|
|
86
|
+
id: s.string(),
|
|
87
|
+
/** Track name for organization */
|
|
88
|
+
name: s.string(),
|
|
89
|
+
/** Track type: "video" | "audio" | "overlay" | "text" */
|
|
90
|
+
type: s.string(),
|
|
91
|
+
/** Whether track is muted/hidden */
|
|
92
|
+
enabled: s.boolean()
|
|
93
|
+
})
|
|
94
|
+
),
|
|
95
|
+
/** Clips placed on the timeline */
|
|
96
|
+
clips: s.array(
|
|
97
|
+
s.object({
|
|
98
|
+
/** Unique clip ID */
|
|
99
|
+
id: s.string(),
|
|
100
|
+
/** Which track this clip belongs to */
|
|
101
|
+
trackId: s.string(),
|
|
102
|
+
/** Component type from catalog */
|
|
103
|
+
component: s.ref("catalog.components"),
|
|
104
|
+
/** Component props */
|
|
105
|
+
props: s.propsOf("catalog.components"),
|
|
106
|
+
/** Start frame (when clip begins) */
|
|
107
|
+
from: s.number(),
|
|
108
|
+
/** Duration in frames */
|
|
109
|
+
durationInFrames: s.number(),
|
|
110
|
+
/** Transition in effect */
|
|
111
|
+
transitionIn: s.object({
|
|
112
|
+
type: s.ref("catalog.transitions"),
|
|
113
|
+
durationInFrames: s.number()
|
|
114
|
+
}),
|
|
115
|
+
/** Transition out effect */
|
|
116
|
+
transitionOut: s.object({
|
|
117
|
+
type: s.ref("catalog.transitions"),
|
|
118
|
+
durationInFrames: s.number()
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
),
|
|
122
|
+
/** Audio configuration */
|
|
123
|
+
audio: s.object({
|
|
124
|
+
/** Background music/audio clips */
|
|
125
|
+
tracks: s.array(
|
|
126
|
+
s.object({
|
|
127
|
+
id: s.string(),
|
|
128
|
+
src: s.string(),
|
|
129
|
+
from: s.number(),
|
|
130
|
+
durationInFrames: s.number(),
|
|
131
|
+
volume: s.number()
|
|
132
|
+
})
|
|
133
|
+
)
|
|
134
|
+
})
|
|
135
|
+
}),
|
|
136
|
+
// What the CATALOG must provide
|
|
137
|
+
catalog: s.object({
|
|
138
|
+
/** Video component definitions (scenes, overlays, etc.) */
|
|
139
|
+
components: s.map({
|
|
140
|
+
/** Zod schema for component props */
|
|
141
|
+
props: s.zod(),
|
|
142
|
+
/** Component type: "scene" | "overlay" | "text" | "image" | "video" */
|
|
143
|
+
type: s.string(),
|
|
144
|
+
/** Default duration in frames (can be overridden per clip) */
|
|
145
|
+
defaultDuration: s.number(),
|
|
146
|
+
/** Description for AI generation hints */
|
|
147
|
+
description: s.string()
|
|
148
|
+
}),
|
|
149
|
+
/** Transition effect definitions */
|
|
150
|
+
transitions: s.map({
|
|
151
|
+
/** Default duration in frames */
|
|
152
|
+
defaultDuration: s.number(),
|
|
153
|
+
/** Description for AI generation hints */
|
|
154
|
+
description: s.string()
|
|
155
|
+
}),
|
|
156
|
+
/** Effect definitions (filters, animations, etc.) */
|
|
157
|
+
effects: s.map({
|
|
158
|
+
/** Zod schema for effect params */
|
|
159
|
+
params: s.zod(),
|
|
160
|
+
/** Description for AI generation hints */
|
|
161
|
+
description: s.string()
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
}),
|
|
165
|
+
{
|
|
166
|
+
promptTemplate: remotionPromptTemplate
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
// src/catalog/definitions.ts
|
|
171
|
+
import { z } from "zod";
|
|
172
|
+
var standardComponentDefinitions = {
|
|
173
|
+
// ==========================================================================
|
|
174
|
+
// Scene Components (full-screen)
|
|
175
|
+
// ==========================================================================
|
|
176
|
+
TitleCard: {
|
|
177
|
+
props: z.object({
|
|
178
|
+
title: z.string(),
|
|
179
|
+
subtitle: z.string().nullable(),
|
|
180
|
+
backgroundColor: z.string().nullable(),
|
|
181
|
+
textColor: z.string().nullable()
|
|
182
|
+
}),
|
|
183
|
+
type: "scene",
|
|
184
|
+
defaultDuration: 90,
|
|
185
|
+
description: "Full-screen title card with centered text. Use for intros, outros, and section breaks."
|
|
186
|
+
},
|
|
187
|
+
ImageSlide: {
|
|
188
|
+
props: z.object({
|
|
189
|
+
src: z.string(),
|
|
190
|
+
alt: z.string(),
|
|
191
|
+
fit: z.enum(["cover", "contain"]).nullable(),
|
|
192
|
+
backgroundColor: z.string().nullable()
|
|
193
|
+
}),
|
|
194
|
+
type: "image",
|
|
195
|
+
defaultDuration: 150,
|
|
196
|
+
description: "Full-screen image display. Use for product shots, photos, and visual content."
|
|
197
|
+
},
|
|
198
|
+
SplitScreen: {
|
|
199
|
+
props: z.object({
|
|
200
|
+
leftTitle: z.string(),
|
|
201
|
+
rightTitle: z.string(),
|
|
202
|
+
leftColor: z.string().nullable(),
|
|
203
|
+
rightColor: z.string().nullable()
|
|
204
|
+
}),
|
|
205
|
+
type: "scene",
|
|
206
|
+
defaultDuration: 120,
|
|
207
|
+
description: "Split screen with two sides. Use for comparisons or before/after."
|
|
208
|
+
},
|
|
209
|
+
QuoteCard: {
|
|
210
|
+
props: z.object({
|
|
211
|
+
quote: z.string(),
|
|
212
|
+
author: z.string().nullable(),
|
|
213
|
+
backgroundColor: z.string().nullable()
|
|
214
|
+
}),
|
|
215
|
+
type: "scene",
|
|
216
|
+
defaultDuration: 150,
|
|
217
|
+
description: "Quote display with attribution. Use for testimonials."
|
|
218
|
+
},
|
|
219
|
+
StatCard: {
|
|
220
|
+
props: z.object({
|
|
221
|
+
value: z.string(),
|
|
222
|
+
label: z.string(),
|
|
223
|
+
prefix: z.string().nullable(),
|
|
224
|
+
suffix: z.string().nullable(),
|
|
225
|
+
backgroundColor: z.string().nullable()
|
|
226
|
+
}),
|
|
227
|
+
type: "scene",
|
|
228
|
+
defaultDuration: 90,
|
|
229
|
+
description: "Large statistic display. Use for key metrics and numbers."
|
|
230
|
+
},
|
|
231
|
+
TypingText: {
|
|
232
|
+
props: z.object({
|
|
233
|
+
text: z.string(),
|
|
234
|
+
backgroundColor: z.string().nullable(),
|
|
235
|
+
textColor: z.string().nullable(),
|
|
236
|
+
fontSize: z.number().nullable(),
|
|
237
|
+
fontFamily: z.enum(["monospace", "sans-serif", "serif"]).nullable(),
|
|
238
|
+
showCursor: z.boolean().nullable(),
|
|
239
|
+
cursorChar: z.string().nullable(),
|
|
240
|
+
charsPerSecond: z.number().nullable()
|
|
241
|
+
}),
|
|
242
|
+
type: "scene",
|
|
243
|
+
defaultDuration: 180,
|
|
244
|
+
description: "Terminal-style typing animation that reveals text character by character. Perfect for code demos, CLI commands, and dramatic text reveals."
|
|
245
|
+
},
|
|
246
|
+
// ==========================================================================
|
|
247
|
+
// Overlay Components
|
|
248
|
+
// ==========================================================================
|
|
249
|
+
LowerThird: {
|
|
250
|
+
props: z.object({
|
|
251
|
+
name: z.string(),
|
|
252
|
+
title: z.string().nullable(),
|
|
253
|
+
backgroundColor: z.string().nullable()
|
|
254
|
+
}),
|
|
255
|
+
type: "overlay",
|
|
256
|
+
defaultDuration: 120,
|
|
257
|
+
description: "Name/title overlay in lower third of screen. Use to identify speakers."
|
|
258
|
+
},
|
|
259
|
+
TextOverlay: {
|
|
260
|
+
props: z.object({
|
|
261
|
+
text: z.string(),
|
|
262
|
+
position: z.enum(["top", "center", "bottom"]).nullable(),
|
|
263
|
+
fontSize: z.enum(["small", "medium", "large"]).nullable()
|
|
264
|
+
}),
|
|
265
|
+
type: "overlay",
|
|
266
|
+
defaultDuration: 90,
|
|
267
|
+
description: "Simple text overlay. Use for captions and annotations."
|
|
268
|
+
},
|
|
269
|
+
LogoBug: {
|
|
270
|
+
props: z.object({
|
|
271
|
+
position: z.enum(["top-left", "top-right", "bottom-left", "bottom-right"]).nullable(),
|
|
272
|
+
opacity: z.number().nullable()
|
|
273
|
+
}),
|
|
274
|
+
type: "overlay",
|
|
275
|
+
defaultDuration: 300,
|
|
276
|
+
description: "Corner logo watermark. Use for branding throughout video."
|
|
277
|
+
},
|
|
278
|
+
// ==========================================================================
|
|
279
|
+
// Video Components
|
|
280
|
+
// ==========================================================================
|
|
281
|
+
VideoClip: {
|
|
282
|
+
props: z.object({
|
|
283
|
+
src: z.string(),
|
|
284
|
+
startFrom: z.number().nullable(),
|
|
285
|
+
volume: z.number().nullable()
|
|
286
|
+
}),
|
|
287
|
+
type: "video",
|
|
288
|
+
defaultDuration: 150,
|
|
289
|
+
description: "Video file playback. Use for B-roll and footage."
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
var standardTransitionDefinitions = {
|
|
293
|
+
fade: {
|
|
294
|
+
defaultDuration: 15,
|
|
295
|
+
description: "Smooth fade in/out. Use for gentle transitions."
|
|
296
|
+
},
|
|
297
|
+
slideLeft: {
|
|
298
|
+
defaultDuration: 20,
|
|
299
|
+
description: "Slide from right to left. Use for forward progression."
|
|
300
|
+
},
|
|
301
|
+
slideRight: {
|
|
302
|
+
defaultDuration: 20,
|
|
303
|
+
description: "Slide from left to right. Use for backward progression."
|
|
304
|
+
},
|
|
305
|
+
slideUp: {
|
|
306
|
+
defaultDuration: 15,
|
|
307
|
+
description: "Slide from bottom to top. Use for overlays appearing."
|
|
308
|
+
},
|
|
309
|
+
slideDown: {
|
|
310
|
+
defaultDuration: 15,
|
|
311
|
+
description: "Slide from top to bottom. Use for overlays disappearing."
|
|
312
|
+
},
|
|
313
|
+
zoom: {
|
|
314
|
+
defaultDuration: 20,
|
|
315
|
+
description: "Zoom in/out effect. Use for emphasis."
|
|
316
|
+
},
|
|
317
|
+
wipe: {
|
|
318
|
+
defaultDuration: 15,
|
|
319
|
+
description: "Horizontal wipe. Use for scene changes."
|
|
320
|
+
},
|
|
321
|
+
none: {
|
|
322
|
+
defaultDuration: 0,
|
|
323
|
+
description: "No transition (hard cut)."
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
var standardEffectDefinitions = {
|
|
327
|
+
kenBurns: {
|
|
328
|
+
params: z.object({
|
|
329
|
+
startScale: z.number(),
|
|
330
|
+
endScale: z.number(),
|
|
331
|
+
panX: z.number().nullable(),
|
|
332
|
+
panY: z.number().nullable()
|
|
333
|
+
}),
|
|
334
|
+
description: "Ken Burns pan and zoom effect for images."
|
|
335
|
+
},
|
|
336
|
+
pulse: {
|
|
337
|
+
params: z.object({
|
|
338
|
+
intensity: z.number()
|
|
339
|
+
}),
|
|
340
|
+
description: "Subtle pulsing scale effect for emphasis."
|
|
341
|
+
},
|
|
342
|
+
shake: {
|
|
343
|
+
params: z.object({
|
|
344
|
+
intensity: z.number()
|
|
345
|
+
}),
|
|
346
|
+
description: "Camera shake effect for energy."
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export {
|
|
351
|
+
schema,
|
|
352
|
+
standardComponentDefinitions,
|
|
353
|
+
standardTransitionDefinitions,
|
|
354
|
+
standardEffectDefinitions
|
|
355
|
+
};
|
|
356
|
+
//# sourceMappingURL=chunk-5C3GTKV7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema.ts","../src/catalog/definitions.ts"],"sourcesContent":["import { defineSchema, type PromptContext } from \"@json-render/core\";\n\n/**\n * Prompt template for Remotion timeline generation\n *\n * Uses JSONL patch format (same as React) but builds up a timeline spec structure.\n */\nfunction remotionPromptTemplate(context: PromptContext): string {\n const { catalog, options } = context;\n const { system = \"You are a video timeline generator.\", customRules = [] } =\n options;\n\n const lines: string[] = [];\n lines.push(system);\n lines.push(\"\");\n\n // Output format - JSONL patches\n lines.push(\"OUTPUT FORMAT:\");\n lines.push(\n \"Output JSONL (one JSON object per line) with patches to build a timeline spec.\",\n );\n lines.push(\n \"Each line is a JSON patch operation. Build the timeline incrementally.\",\n );\n lines.push(\"\");\n lines.push(\"Example output (each line is a separate JSON object):\");\n lines.push(\"\");\n lines.push(`{\"op\":\"set\",\"path\":\"/composition\",\"value\":{\"id\":\"intro\",\"fps\":30,\"width\":1920,\"height\":1080,\"durationInFrames\":300}}\n{\"op\":\"set\",\"path\":\"/tracks\",\"value\":[{\"id\":\"main\",\"name\":\"Main\",\"type\":\"video\",\"enabled\":true},{\"id\":\"overlay\",\"name\":\"Overlay\",\"type\":\"overlay\",\"enabled\":true}]}\n{\"op\":\"set\",\"path\":\"/clips/0\",\"value\":{\"id\":\"clip-1\",\"trackId\":\"main\",\"component\":\"TitleCard\",\"props\":{\"title\":\"Welcome\",\"subtitle\":\"Getting Started\"},\"from\":0,\"durationInFrames\":90,\"transitionIn\":{\"type\":\"fade\",\"durationInFrames\":15},\"transitionOut\":{\"type\":\"fade\",\"durationInFrames\":15}}}\n{\"op\":\"set\",\"path\":\"/clips/1\",\"value\":{\"id\":\"clip-2\",\"trackId\":\"main\",\"component\":\"TitleCard\",\"props\":{\"title\":\"Features\"},\"from\":90,\"durationInFrames\":90}}\n{\"op\":\"set\",\"path\":\"/audio\",\"value\":{\"tracks\":[]}}`);\n lines.push(\"\");\n\n // Components\n const catalogData = catalog as {\n components?: Record<\n string,\n { description?: string; defaultDuration?: number }\n >;\n transitions?: Record<string, { description?: string }>;\n effects?: Record<string, { description?: string }>;\n };\n\n if (catalogData.components) {\n lines.push(\n `AVAILABLE COMPONENTS (${Object.keys(catalogData.components).length}):`,\n );\n lines.push(\"\");\n for (const [name, def] of Object.entries(catalogData.components)) {\n const duration = def.defaultDuration\n ? ` [default: ${def.defaultDuration} frames]`\n : \"\";\n lines.push(\n `- ${name}: ${def.description || \"No description\"}${duration}`,\n );\n }\n lines.push(\"\");\n }\n\n // Transitions\n if (\n catalogData.transitions &&\n Object.keys(catalogData.transitions).length > 0\n ) {\n lines.push(\"AVAILABLE TRANSITIONS:\");\n lines.push(\"\");\n for (const [name, def] of Object.entries(catalogData.transitions)) {\n lines.push(`- ${name}: ${def.description || \"No description\"}`);\n }\n lines.push(\"\");\n }\n\n // Rules\n lines.push(\"RULES:\");\n const baseRules = [\n \"Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences\",\n \"First set /composition with {id, fps:30, width:1920, height:1080, durationInFrames}\",\n \"Then set /tracks array with video/overlay tracks\",\n \"Then set each clip: /clips/0, /clips/1, etc.\",\n \"Finally set /audio with {tracks:[]}\",\n \"ONLY use components listed above\",\n \"fps is always 30 (1 second = 30 frames, 10 seconds = 300 frames)\",\n 'Clips on \"main\" track flow sequentially (from = previous clip\\'s from + durationInFrames)',\n 'Overlay clips (LowerThird, TextOverlay) go on \"overlay\" track',\n ];\n const allRules = [...baseRules, ...customRules];\n allRules.forEach((rule, i) => {\n lines.push(`${i + 1}. ${rule}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * The schema for @json-render/remotion\n *\n * This schema is fundamentally different from the React element tree schema.\n * It's timeline-based, designed for video composition:\n *\n * - Spec: A composition with tracks containing timed clips\n * - Catalog: Video components (scenes, overlays, etc.) and effects\n *\n * This demonstrates that json-render is truly agnostic - different renderers\n * can have completely different spec formats.\n */\nexport const schema = defineSchema(\n (s) => ({\n // What the AI-generated SPEC looks like (timeline-based)\n spec: s.object({\n /** Composition settings */\n composition: s.object({\n /** Unique composition ID */\n id: s.string(),\n /** Frames per second */\n fps: s.number(),\n /** Width in pixels */\n width: s.number(),\n /** Height in pixels */\n height: s.number(),\n /** Total duration in frames */\n durationInFrames: s.number(),\n }),\n\n /** Timeline tracks (like layers in video editing) */\n tracks: s.array(\n s.object({\n /** Unique track ID */\n id: s.string(),\n /** Track name for organization */\n name: s.string(),\n /** Track type: \"video\" | \"audio\" | \"overlay\" | \"text\" */\n type: s.string(),\n /** Whether track is muted/hidden */\n enabled: s.boolean(),\n }),\n ),\n\n /** Clips placed on the timeline */\n clips: s.array(\n s.object({\n /** Unique clip ID */\n id: s.string(),\n /** Which track this clip belongs to */\n trackId: s.string(),\n /** Component type from catalog */\n component: s.ref(\"catalog.components\"),\n /** Component props */\n props: s.propsOf(\"catalog.components\"),\n /** Start frame (when clip begins) */\n from: s.number(),\n /** Duration in frames */\n durationInFrames: s.number(),\n /** Transition in effect */\n transitionIn: s.object({\n type: s.ref(\"catalog.transitions\"),\n durationInFrames: s.number(),\n }),\n /** Transition out effect */\n transitionOut: s.object({\n type: s.ref(\"catalog.transitions\"),\n durationInFrames: s.number(),\n }),\n }),\n ),\n\n /** Audio configuration */\n audio: s.object({\n /** Background music/audio clips */\n tracks: s.array(\n s.object({\n id: s.string(),\n src: s.string(),\n from: s.number(),\n durationInFrames: s.number(),\n volume: s.number(),\n }),\n ),\n }),\n }),\n\n // What the CATALOG must provide\n catalog: s.object({\n /** Video component definitions (scenes, overlays, etc.) */\n components: s.map({\n /** Zod schema for component props */\n props: s.zod(),\n /** Component type: \"scene\" | \"overlay\" | \"text\" | \"image\" | \"video\" */\n type: s.string(),\n /** Default duration in frames (can be overridden per clip) */\n defaultDuration: s.number(),\n /** Description for AI generation hints */\n description: s.string(),\n }),\n /** Transition effect definitions */\n transitions: s.map({\n /** Default duration in frames */\n defaultDuration: s.number(),\n /** Description for AI generation hints */\n description: s.string(),\n }),\n /** Effect definitions (filters, animations, etc.) */\n effects: s.map({\n /** Zod schema for effect params */\n params: s.zod(),\n /** Description for AI generation hints */\n description: s.string(),\n }),\n }),\n }),\n {\n promptTemplate: remotionPromptTemplate,\n },\n);\n\n/**\n * Type for the Remotion schema\n */\nexport type RemotionSchema = typeof schema;\n\n/**\n * Infer the spec type from a catalog\n */\nexport type RemotionSpec<TCatalog> = typeof schema extends {\n createCatalog: (catalog: TCatalog) => { _specType: infer S };\n}\n ? S\n : never;\n","import { z } from \"zod\";\n\n/**\n * Standard component definitions for Remotion catalogs\n *\n * These can be used directly or extended with custom components.\n */\nexport const standardComponentDefinitions = {\n // ==========================================================================\n // Scene Components (full-screen)\n // ==========================================================================\n\n TitleCard: {\n props: z.object({\n title: z.string(),\n subtitle: z.string().nullable(),\n backgroundColor: z.string().nullable(),\n textColor: z.string().nullable(),\n }),\n type: \"scene\",\n defaultDuration: 90,\n description:\n \"Full-screen title card with centered text. Use for intros, outros, and section breaks.\",\n },\n\n ImageSlide: {\n props: z.object({\n src: z.string(),\n alt: z.string(),\n fit: z.enum([\"cover\", \"contain\"]).nullable(),\n backgroundColor: z.string().nullable(),\n }),\n type: \"image\",\n defaultDuration: 150,\n description:\n \"Full-screen image display. Use for product shots, photos, and visual content.\",\n },\n\n SplitScreen: {\n props: z.object({\n leftTitle: z.string(),\n rightTitle: z.string(),\n leftColor: z.string().nullable(),\n rightColor: z.string().nullable(),\n }),\n type: \"scene\",\n defaultDuration: 120,\n description:\n \"Split screen with two sides. Use for comparisons or before/after.\",\n },\n\n QuoteCard: {\n props: z.object({\n quote: z.string(),\n author: z.string().nullable(),\n backgroundColor: z.string().nullable(),\n }),\n type: \"scene\",\n defaultDuration: 150,\n description: \"Quote display with attribution. Use for testimonials.\",\n },\n\n StatCard: {\n props: z.object({\n value: z.string(),\n label: z.string(),\n prefix: z.string().nullable(),\n suffix: z.string().nullable(),\n backgroundColor: z.string().nullable(),\n }),\n type: \"scene\",\n defaultDuration: 90,\n description: \"Large statistic display. Use for key metrics and numbers.\",\n },\n\n TypingText: {\n props: z.object({\n text: z.string(),\n backgroundColor: z.string().nullable(),\n textColor: z.string().nullable(),\n fontSize: z.number().nullable(),\n fontFamily: z.enum([\"monospace\", \"sans-serif\", \"serif\"]).nullable(),\n showCursor: z.boolean().nullable(),\n cursorChar: z.string().nullable(),\n charsPerSecond: z.number().nullable(),\n }),\n type: \"scene\",\n defaultDuration: 180,\n description:\n \"Terminal-style typing animation that reveals text character by character. Perfect for code demos, CLI commands, and dramatic text reveals.\",\n },\n\n // ==========================================================================\n // Overlay Components\n // ==========================================================================\n\n LowerThird: {\n props: z.object({\n name: z.string(),\n title: z.string().nullable(),\n backgroundColor: z.string().nullable(),\n }),\n type: \"overlay\",\n defaultDuration: 120,\n description:\n \"Name/title overlay in lower third of screen. Use to identify speakers.\",\n },\n\n TextOverlay: {\n props: z.object({\n text: z.string(),\n position: z.enum([\"top\", \"center\", \"bottom\"]).nullable(),\n fontSize: z.enum([\"small\", \"medium\", \"large\"]).nullable(),\n }),\n type: \"overlay\",\n defaultDuration: 90,\n description: \"Simple text overlay. Use for captions and annotations.\",\n },\n\n LogoBug: {\n props: z.object({\n position: z\n .enum([\"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\"])\n .nullable(),\n opacity: z.number().nullable(),\n }),\n type: \"overlay\",\n defaultDuration: 300,\n description: \"Corner logo watermark. Use for branding throughout video.\",\n },\n\n // ==========================================================================\n // Video Components\n // ==========================================================================\n\n VideoClip: {\n props: z.object({\n src: z.string(),\n startFrom: z.number().nullable(),\n volume: z.number().nullable(),\n }),\n type: \"video\",\n defaultDuration: 150,\n description: \"Video file playback. Use for B-roll and footage.\",\n },\n};\n\n/**\n * Standard transition definitions for Remotion catalogs\n */\nexport const standardTransitionDefinitions = {\n fade: {\n defaultDuration: 15,\n description: \"Smooth fade in/out. Use for gentle transitions.\",\n },\n slideLeft: {\n defaultDuration: 20,\n description: \"Slide from right to left. Use for forward progression.\",\n },\n slideRight: {\n defaultDuration: 20,\n description: \"Slide from left to right. Use for backward progression.\",\n },\n slideUp: {\n defaultDuration: 15,\n description: \"Slide from bottom to top. Use for overlays appearing.\",\n },\n slideDown: {\n defaultDuration: 15,\n description: \"Slide from top to bottom. Use for overlays disappearing.\",\n },\n zoom: {\n defaultDuration: 20,\n description: \"Zoom in/out effect. Use for emphasis.\",\n },\n wipe: {\n defaultDuration: 15,\n description: \"Horizontal wipe. Use for scene changes.\",\n },\n none: {\n defaultDuration: 0,\n description: \"No transition (hard cut).\",\n },\n};\n\n/**\n * Standard effect definitions for Remotion catalogs\n */\nexport const standardEffectDefinitions = {\n kenBurns: {\n params: z.object({\n startScale: z.number(),\n endScale: z.number(),\n panX: z.number().nullable(),\n panY: z.number().nullable(),\n }),\n description: \"Ken Burns pan and zoom effect for images.\",\n },\n pulse: {\n params: z.object({\n intensity: z.number(),\n }),\n description: \"Subtle pulsing scale effect for emphasis.\",\n },\n shake: {\n params: z.object({\n intensity: z.number(),\n }),\n description: \"Camera shake effect for energy.\",\n },\n};\n\n/**\n * Type for component definition\n */\nexport type ComponentDefinition = {\n props: z.ZodType;\n type: string;\n defaultDuration: number;\n description: string;\n};\n\n/**\n * Type for transition definition\n */\nexport type TransitionDefinition = {\n defaultDuration: number;\n description: string;\n};\n\n/**\n * Type for effect definition\n */\nexport type EffectDefinition = {\n params: z.ZodType;\n description: string;\n};\n"],"mappings":";AAAA,SAAS,oBAAwC;AAOjD,SAAS,uBAAuB,SAAgC;AAC9D,QAAM,EAAE,SAAS,QAAQ,IAAI;AAC7B,QAAM,EAAE,SAAS,uCAAuC,cAAc,CAAC,EAAE,IACvE;AAEF,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,MAAM;AACjB,QAAM,KAAK,EAAE;AAGb,QAAM,KAAK,gBAAgB;AAC3B,QAAM;AAAA,IACJ;AAAA,EACF;AACA,QAAM;AAAA,IACJ;AAAA,EACF;AACA,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,uDAAuD;AAClE,QAAM,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,IACjB,aAAa;AAAA,EACf;AACF;AAKO,IAAM,gCAAgC;AAAA,EAC3C,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,YAAY;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AACF;AAKO,IAAM,4BAA4B;AAAA,EACvC,UAAU;AAAA,IACR,QAAQ,EAAE,OAAO;AAAA,MACf,YAAY,EAAE,OAAO;AAAA,MACrB,UAAU,EAAE,OAAO;AAAA,MACnB,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,MAC1B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,CAAC;AAAA,IACD,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,QAAQ,EAAE,OAAO;AAAA,MACf,WAAW,EAAE,OAAO;AAAA,IACtB,CAAC;AAAA,IACD,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,QAAQ,EAAE,OAAO;AAAA,MACf,WAAW,EAAE,OAAO;AAAA,IACtB,CAAC;AAAA,IACD,aAAa;AAAA,EACf;AACF;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export { BuiltInTransition, ComponentDefinition, EffectDefinition, EffectFn, Effects, FrameContext, RemotionSchema, RemotionSpec, TransitionDefinition, TransitionFn, VideoComponentContext, VideoComponentFn, VideoComponents, schema, standardComponentDefinitions, standardEffectDefinitions, standardTransitionDefinitions } from './server.mjs';
|
|
2
|
+
export { Spec } from '@json-render/core';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Types for Remotion timeline components
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Clip data passed to components
|
|
12
|
+
*/
|
|
13
|
+
interface Clip {
|
|
14
|
+
id: string;
|
|
15
|
+
trackId: string;
|
|
16
|
+
component: string;
|
|
17
|
+
props: Record<string, unknown>;
|
|
18
|
+
from: number;
|
|
19
|
+
durationInFrames: number;
|
|
20
|
+
transitionIn?: {
|
|
21
|
+
type: string;
|
|
22
|
+
durationInFrames: number;
|
|
23
|
+
};
|
|
24
|
+
transitionOut?: {
|
|
25
|
+
type: string;
|
|
26
|
+
durationInFrames: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Timeline spec structure
|
|
31
|
+
*/
|
|
32
|
+
interface TimelineSpec {
|
|
33
|
+
composition?: {
|
|
34
|
+
id: string;
|
|
35
|
+
fps: number;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
durationInFrames: number;
|
|
39
|
+
};
|
|
40
|
+
tracks?: {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
type: string;
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
}[];
|
|
46
|
+
clips?: Clip[];
|
|
47
|
+
audio?: {
|
|
48
|
+
tracks: AudioTrack[];
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Audio track in the timeline
|
|
53
|
+
*/
|
|
54
|
+
interface AudioTrack {
|
|
55
|
+
id: string;
|
|
56
|
+
src: string;
|
|
57
|
+
from: number;
|
|
58
|
+
durationInFrames: number;
|
|
59
|
+
volume: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Transition styles calculated by useTransition hook
|
|
63
|
+
*/
|
|
64
|
+
interface TransitionStyles {
|
|
65
|
+
opacity: number;
|
|
66
|
+
translateX: number;
|
|
67
|
+
translateY: number;
|
|
68
|
+
scale: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Component render function type
|
|
72
|
+
*/
|
|
73
|
+
type ClipComponent = React.ComponentType<{
|
|
74
|
+
clip: Clip;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Component registry type
|
|
78
|
+
*/
|
|
79
|
+
type ComponentRegistry = Record<string, ClipComponent>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Calculate transition styles based on clip configuration
|
|
83
|
+
*
|
|
84
|
+
* Handles both transitionIn and transitionOut with support for:
|
|
85
|
+
* - fade
|
|
86
|
+
* - slideLeft / slideRight
|
|
87
|
+
* - slideUp / slideDown
|
|
88
|
+
* - zoom
|
|
89
|
+
* - wipe
|
|
90
|
+
*/
|
|
91
|
+
declare function useTransition(clip: Clip, frame: number): TransitionStyles;
|
|
92
|
+
|
|
93
|
+
interface ClipWrapperProps {
|
|
94
|
+
clip: Clip;
|
|
95
|
+
children: React.ReactNode;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Wrapper component that applies transition animations to clips
|
|
99
|
+
*
|
|
100
|
+
* Automatically handles transitionIn and transitionOut based on clip config.
|
|
101
|
+
*/
|
|
102
|
+
declare function ClipWrapper({ clip, children }: ClipWrapperProps): react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
declare function TitleCard({ clip }: {
|
|
105
|
+
clip: Clip;
|
|
106
|
+
}): react_jsx_runtime.JSX.Element;
|
|
107
|
+
declare function ImageSlide({ clip }: {
|
|
108
|
+
clip: Clip;
|
|
109
|
+
}): react_jsx_runtime.JSX.Element;
|
|
110
|
+
declare function SplitScreen({ clip }: {
|
|
111
|
+
clip: Clip;
|
|
112
|
+
}): react_jsx_runtime.JSX.Element;
|
|
113
|
+
declare function QuoteCard({ clip }: {
|
|
114
|
+
clip: Clip;
|
|
115
|
+
}): react_jsx_runtime.JSX.Element;
|
|
116
|
+
declare function StatCard({ clip }: {
|
|
117
|
+
clip: Clip;
|
|
118
|
+
}): react_jsx_runtime.JSX.Element;
|
|
119
|
+
declare function LowerThird({ clip }: {
|
|
120
|
+
clip: Clip;
|
|
121
|
+
}): react_jsx_runtime.JSX.Element;
|
|
122
|
+
declare function TextOverlay({ clip }: {
|
|
123
|
+
clip: Clip;
|
|
124
|
+
}): react_jsx_runtime.JSX.Element;
|
|
125
|
+
declare function TypingText({ clip }: {
|
|
126
|
+
clip: Clip;
|
|
127
|
+
}): react_jsx_runtime.JSX.Element;
|
|
128
|
+
declare function LogoBug({ clip }: {
|
|
129
|
+
clip: Clip;
|
|
130
|
+
}): react_jsx_runtime.JSX.Element;
|
|
131
|
+
declare function VideoClip({ clip }: {
|
|
132
|
+
clip: Clip;
|
|
133
|
+
}): react_jsx_runtime.JSX.Element;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Standard components provided by @json-render/remotion
|
|
137
|
+
*/
|
|
138
|
+
declare const standardComponents: ComponentRegistry;
|
|
139
|
+
interface RendererProps {
|
|
140
|
+
/** The timeline spec to render */
|
|
141
|
+
spec: TimelineSpec;
|
|
142
|
+
/**
|
|
143
|
+
* Custom component registry to merge with standard components.
|
|
144
|
+
* Custom components override standard ones with the same name.
|
|
145
|
+
*/
|
|
146
|
+
components?: ComponentRegistry;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Renders a timeline spec into Remotion components
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* // Use with standard components only
|
|
153
|
+
* <Renderer spec={mySpec} />
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* // Add custom components
|
|
157
|
+
* <Renderer
|
|
158
|
+
* spec={mySpec}
|
|
159
|
+
* components={{
|
|
160
|
+
* CustomScene: MyCustomSceneComponent,
|
|
161
|
+
* }}
|
|
162
|
+
* />
|
|
163
|
+
*/
|
|
164
|
+
declare function Renderer({ spec, components: customComponents, }: RendererProps): react_jsx_runtime.JSX.Element;
|
|
165
|
+
|
|
166
|
+
export { type AudioTrack, type Clip, type ClipComponent, ClipWrapper, type ComponentRegistry, ImageSlide, LogoBug, LowerThird, QuoteCard, Renderer, SplitScreen, StatCard, TextOverlay, type TimelineSpec, TitleCard, type TransitionStyles, TypingText, VideoClip, standardComponents, useTransition };
|