@contractspec/lib.video-gen 2.7.17 → 2.7.19
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/dist/browser/compositions/api-overview.js +1 -645
- package/dist/browser/compositions/index.js +1 -1133
- package/dist/browser/compositions/primitives/animated-text.js +1 -144
- package/dist/browser/compositions/primitives/brand-frame.js +1 -181
- package/dist/browser/compositions/primitives/code-block.js +1 -226
- package/dist/browser/compositions/primitives/index.js +1 -656
- package/dist/browser/compositions/primitives/progress-bar.js +1 -59
- package/dist/browser/compositions/primitives/terminal.js +1 -265
- package/dist/browser/compositions/primitives/transition.js +1 -98
- package/dist/browser/compositions/social-clip.js +1 -500
- package/dist/browser/compositions/terminal-demo.js +1 -558
- package/dist/browser/design/index.js +1 -155
- package/dist/browser/design/layouts.js +1 -50
- package/dist/browser/design/motion.js +1 -43
- package/dist/browser/design/tokens.js +1 -28
- package/dist/browser/design/typography.js +1 -61
- package/dist/browser/docs/compositions.docblock.js +1 -182
- package/dist/browser/docs/design.docblock.js +2 -17
- package/dist/browser/docs/generators.docblock.js +2 -24
- package/dist/browser/docs/rendering.docblock.js +2 -24
- package/dist/browser/docs/video-gen.docblock.js +2 -17
- package/dist/browser/generators/index.js +7 -769
- package/dist/browser/generators/scene-planner.js +7 -651
- package/dist/browser/generators/script-generator.js +7 -599
- package/dist/browser/generators/video-generator.js +7 -768
- package/dist/browser/i18n/catalogs/en.js +3 -135
- package/dist/browser/i18n/catalogs/es.js +3 -135
- package/dist/browser/i18n/catalogs/fr.js +3 -135
- package/dist/browser/i18n/catalogs/index.js +7 -387
- package/dist/browser/i18n/index.js +7 -459
- package/dist/browser/i18n/keys.js +1 -54
- package/dist/browser/i18n/locale.js +1 -21
- package/dist/browser/i18n/messages.js +7 -399
- package/dist/browser/index.js +7 -1903
- package/dist/browser/player/demo-player.js +1 -1136
- package/dist/browser/player/index.js +1 -1136
- package/dist/browser/remotion/Root.js +2 -1172
- package/dist/browser/remotion/index.js +2 -1173
- package/dist/browser/renderers/config.js +1 -40
- package/dist/browser/renderers/index.js +1 -160
- package/dist/browser/renderers/local.js +1 -156
- package/dist/browser/types.js +1 -13
- package/dist/compositions/api-overview.js +1 -639
- package/dist/compositions/index.js +1 -1127
- package/dist/compositions/primitives/animated-text.js +1 -138
- package/dist/compositions/primitives/brand-frame.js +1 -175
- package/dist/compositions/primitives/code-block.js +1 -220
- package/dist/compositions/primitives/index.js +1 -650
- package/dist/compositions/primitives/progress-bar.js +1 -53
- package/dist/compositions/primitives/terminal.js +1 -259
- package/dist/compositions/primitives/transition.js +1 -92
- package/dist/compositions/social-clip.js +1 -494
- package/dist/compositions/terminal-demo.js +1 -552
- package/dist/design/index.js +1 -149
- package/dist/design/layouts.js +1 -44
- package/dist/design/motion.js +1 -37
- package/dist/design/tokens.js +1 -22
- package/dist/design/typography.js +1 -55
- package/dist/docs/compositions.docblock.js +1 -182
- package/dist/docs/design.docblock.js +2 -17
- package/dist/docs/generators.docblock.js +2 -24
- package/dist/docs/rendering.docblock.js +2 -24
- package/dist/docs/video-gen.docblock.js +2 -17
- package/dist/generators/index.js +7 -763
- package/dist/generators/scene-planner.js +7 -645
- package/dist/generators/script-generator.js +7 -593
- package/dist/generators/video-generator.js +7 -762
- package/dist/i18n/catalogs/en.js +3 -129
- package/dist/i18n/catalogs/es.js +3 -129
- package/dist/i18n/catalogs/fr.js +3 -129
- package/dist/i18n/catalogs/index.js +7 -381
- package/dist/i18n/index.js +7 -453
- package/dist/i18n/keys.js +1 -48
- package/dist/i18n/locale.js +1 -15
- package/dist/i18n/messages.js +7 -393
- package/dist/index.js +7 -1897
- package/dist/node/compositions/api-overview.js +1 -640
- package/dist/node/compositions/index.js +1 -1128
- package/dist/node/compositions/primitives/animated-text.js +1 -139
- package/dist/node/compositions/primitives/brand-frame.js +1 -176
- package/dist/node/compositions/primitives/code-block.js +1 -221
- package/dist/node/compositions/primitives/index.js +1 -651
- package/dist/node/compositions/primitives/progress-bar.js +1 -54
- package/dist/node/compositions/primitives/terminal.js +1 -260
- package/dist/node/compositions/primitives/transition.js +1 -93
- package/dist/node/compositions/social-clip.js +1 -495
- package/dist/node/compositions/terminal-demo.js +1 -553
- package/dist/node/design/index.js +1 -150
- package/dist/node/design/layouts.js +1 -45
- package/dist/node/design/motion.js +1 -38
- package/dist/node/design/tokens.js +1 -23
- package/dist/node/design/typography.js +1 -56
- package/dist/node/docs/compositions.docblock.js +1 -182
- package/dist/node/docs/design.docblock.js +2 -17
- package/dist/node/docs/generators.docblock.js +2 -24
- package/dist/node/docs/rendering.docblock.js +2 -24
- package/dist/node/docs/video-gen.docblock.js +2 -17
- package/dist/node/generators/index.js +7 -764
- package/dist/node/generators/scene-planner.js +7 -646
- package/dist/node/generators/script-generator.js +7 -594
- package/dist/node/generators/video-generator.js +7 -763
- package/dist/node/i18n/catalogs/en.js +3 -130
- package/dist/node/i18n/catalogs/es.js +3 -130
- package/dist/node/i18n/catalogs/fr.js +3 -130
- package/dist/node/i18n/catalogs/index.js +7 -382
- package/dist/node/i18n/index.js +7 -454
- package/dist/node/i18n/keys.js +1 -49
- package/dist/node/i18n/locale.js +1 -16
- package/dist/node/i18n/messages.js +7 -394
- package/dist/node/index.js +7 -1898
- package/dist/node/player/demo-player.js +1 -1131
- package/dist/node/player/index.js +1 -1131
- package/dist/node/remotion/Root.js +2 -1167
- package/dist/node/remotion/index.js +2 -1168
- package/dist/node/renderers/config.js +1 -35
- package/dist/node/renderers/index.js +1 -155
- package/dist/node/renderers/local.js +1 -151
- package/dist/node/types.js +1 -8
- package/dist/player/demo-player.js +1 -1130
- package/dist/player/index.js +1 -1130
- package/dist/remotion/Root.js +2 -1166
- package/dist/remotion/index.js +2 -1167
- package/dist/renderers/config.js +1 -34
- package/dist/renderers/index.js +1 -154
- package/dist/renderers/local.js +1 -150
- package/dist/types.js +1 -7
- package/package.json +16 -16
package/dist/browser/index.js
CHANGED
|
@@ -1,1141 +1,4 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined")
|
|
5
|
-
return require.apply(this, arguments);
|
|
6
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
// src/design/motion.ts
|
|
10
|
-
import { Easing } from "remotion";
|
|
11
|
-
var videoEasing = {
|
|
12
|
-
entrance: Easing.out(Easing.exp),
|
|
13
|
-
exit: Easing.in(Easing.exp),
|
|
14
|
-
emphasis: Easing.out(Easing.back(1.4)),
|
|
15
|
-
linear: Easing.linear,
|
|
16
|
-
gentle: Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
17
|
-
spring: Easing.out(Easing.back(1.7))
|
|
18
|
-
};
|
|
19
|
-
var videoDurations = {
|
|
20
|
-
sceneTransition: 20,
|
|
21
|
-
textEntrance: 15,
|
|
22
|
-
textExit: 12,
|
|
23
|
-
codeTypingPerChar: 2,
|
|
24
|
-
sectionPause: 30,
|
|
25
|
-
emphasisPause: 15,
|
|
26
|
-
brandReveal: 25,
|
|
27
|
-
minScene: 60,
|
|
28
|
-
shortScene: 60,
|
|
29
|
-
mediumScene: 120,
|
|
30
|
-
longScene: 240
|
|
31
|
-
};
|
|
32
|
-
var videoTransitions = {
|
|
33
|
-
fade: { type: "fade", durationInFrames: 20 },
|
|
34
|
-
slideLeft: { type: "slide-left", durationInFrames: 20 },
|
|
35
|
-
slideRight: { type: "slide-right", durationInFrames: 20 },
|
|
36
|
-
wipe: { type: "wipe", durationInFrames: 15 },
|
|
37
|
-
none: { type: "none", durationInFrames: 0 }
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// src/design/tokens.ts
|
|
41
|
-
import { defaultTokens } from "@contractspec/lib.design-system";
|
|
42
|
-
var defaultVideoColors = {
|
|
43
|
-
canvasBackground: defaultTokens.colors.background,
|
|
44
|
-
codeBackground: "#1e1e2e",
|
|
45
|
-
terminalBackground: "#0d1117",
|
|
46
|
-
terminalForeground: "#c9d1d9",
|
|
47
|
-
highlight: defaultTokens.colors.accent,
|
|
48
|
-
gradientStart: defaultTokens.colors.primary,
|
|
49
|
-
gradientEnd: defaultTokens.colors.accent
|
|
50
|
-
};
|
|
51
|
-
var defaultVideoTheme = {
|
|
52
|
-
...defaultTokens,
|
|
53
|
-
video: defaultVideoColors
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// src/design/typography.ts
|
|
57
|
-
var videoTypography = {
|
|
58
|
-
title: {
|
|
59
|
-
fontSize: 72,
|
|
60
|
-
lineHeight: 1.1,
|
|
61
|
-
fontWeight: 700,
|
|
62
|
-
letterSpacing: -1
|
|
63
|
-
},
|
|
64
|
-
heading: {
|
|
65
|
-
fontSize: 56,
|
|
66
|
-
lineHeight: 1.2,
|
|
67
|
-
fontWeight: 600,
|
|
68
|
-
letterSpacing: -0.5
|
|
69
|
-
},
|
|
70
|
-
subheading: {
|
|
71
|
-
fontSize: 40,
|
|
72
|
-
lineHeight: 1.25,
|
|
73
|
-
fontWeight: 500
|
|
74
|
-
},
|
|
75
|
-
body: {
|
|
76
|
-
fontSize: 32,
|
|
77
|
-
lineHeight: 1.5,
|
|
78
|
-
fontWeight: 400
|
|
79
|
-
},
|
|
80
|
-
code: {
|
|
81
|
-
fontSize: 28,
|
|
82
|
-
lineHeight: 1.6,
|
|
83
|
-
fontWeight: 400
|
|
84
|
-
},
|
|
85
|
-
caption: {
|
|
86
|
-
fontSize: 24,
|
|
87
|
-
lineHeight: 1.4,
|
|
88
|
-
fontWeight: 400
|
|
89
|
-
},
|
|
90
|
-
label: {
|
|
91
|
-
fontSize: 20,
|
|
92
|
-
lineHeight: 1.3,
|
|
93
|
-
fontWeight: 600,
|
|
94
|
-
letterSpacing: 1
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
function scaleTypography(style, targetWidth) {
|
|
98
|
-
const scale = targetWidth / 1920;
|
|
99
|
-
return {
|
|
100
|
-
...style,
|
|
101
|
-
fontSize: Math.round(style.fontSize * scale),
|
|
102
|
-
letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// src/compositions/primitives/animated-text.tsx
|
|
107
|
-
import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
|
|
108
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
109
|
-
var AnimatedText = ({
|
|
110
|
-
text,
|
|
111
|
-
variant = "body",
|
|
112
|
-
style: styleOverride,
|
|
113
|
-
enterAt = 0,
|
|
114
|
-
exitAt,
|
|
115
|
-
color = "#ffffff",
|
|
116
|
-
align = "left"
|
|
117
|
-
}) => {
|
|
118
|
-
const frame = useCurrentFrame();
|
|
119
|
-
const { width } = useVideoConfig();
|
|
120
|
-
const baseStyle = videoTypography[variant];
|
|
121
|
-
const scaled = scaleTypography(baseStyle, width);
|
|
122
|
-
const finalStyle = { ...scaled, ...styleOverride };
|
|
123
|
-
const enterProgress = interpolate(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
124
|
-
const enterOpacity = interpolate(enterProgress, [0, 1], [0, 1], {
|
|
125
|
-
easing: videoEasing.entrance
|
|
126
|
-
});
|
|
127
|
-
const enterTranslateY = interpolate(enterProgress, [0, 1], [30, 0], {
|
|
128
|
-
easing: videoEasing.entrance
|
|
129
|
-
});
|
|
130
|
-
let exitOpacity = 1;
|
|
131
|
-
let exitTranslateY = 0;
|
|
132
|
-
if (exitAt !== undefined) {
|
|
133
|
-
const exitProgress = interpolate(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
134
|
-
exitOpacity = interpolate(exitProgress, [0, 1], [1, 0], {
|
|
135
|
-
easing: videoEasing.exit
|
|
136
|
-
});
|
|
137
|
-
exitTranslateY = interpolate(exitProgress, [0, 1], [0, -20], {
|
|
138
|
-
easing: videoEasing.exit
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
const opacity = enterOpacity * exitOpacity;
|
|
142
|
-
const translateY = enterTranslateY + exitTranslateY;
|
|
143
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
144
|
-
style: {
|
|
145
|
-
fontSize: finalStyle.fontSize,
|
|
146
|
-
lineHeight: finalStyle.lineHeight,
|
|
147
|
-
fontWeight: finalStyle.fontWeight,
|
|
148
|
-
letterSpacing: finalStyle.letterSpacing,
|
|
149
|
-
color,
|
|
150
|
-
textAlign: align,
|
|
151
|
-
opacity,
|
|
152
|
-
transform: `translateY(${translateY}px)`,
|
|
153
|
-
willChange: "opacity, transform"
|
|
154
|
-
},
|
|
155
|
-
children: text
|
|
156
|
-
}, undefined, false, undefined, this);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// src/design/layouts.ts
|
|
160
|
-
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
161
|
-
var DEFAULT_FPS = 30;
|
|
162
|
-
var videoSafeZone = {
|
|
163
|
-
horizontal: 120,
|
|
164
|
-
vertical: 80,
|
|
165
|
-
contentWidth: 1680,
|
|
166
|
-
contentHeight: 920
|
|
167
|
-
};
|
|
168
|
-
function scaleSafeZone(format) {
|
|
169
|
-
const scaleX = format.width / 1920;
|
|
170
|
-
const scaleY = format.height / 1080;
|
|
171
|
-
return {
|
|
172
|
-
horizontal: Math.round(videoSafeZone.horizontal * scaleX),
|
|
173
|
-
vertical: Math.round(videoSafeZone.vertical * scaleY),
|
|
174
|
-
contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
|
|
175
|
-
contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
var videoPositions = {
|
|
179
|
-
center: { x: 960, y: 540 },
|
|
180
|
-
topLeft: { x: 120, y: 80 },
|
|
181
|
-
topRight: { x: 1800, y: 80 },
|
|
182
|
-
bottomLeft: { x: 120, y: 1000 },
|
|
183
|
-
bottomRight: { x: 1800, y: 1000 },
|
|
184
|
-
bottomCenter: { x: 960, y: 960 }
|
|
185
|
-
};
|
|
186
|
-
function getAllFormatVariants() {
|
|
187
|
-
return [
|
|
188
|
-
VIDEO_FORMATS.landscape,
|
|
189
|
-
VIDEO_FORMATS.square,
|
|
190
|
-
VIDEO_FORMATS.portrait
|
|
191
|
-
];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// src/compositions/primitives/brand-frame.tsx
|
|
195
|
-
import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
|
|
196
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
197
|
-
var BrandFrame = ({
|
|
198
|
-
styleOverrides,
|
|
199
|
-
showBranding = true,
|
|
200
|
-
animateEntrance = true,
|
|
201
|
-
variant = "gradient",
|
|
202
|
-
children
|
|
203
|
-
}) => {
|
|
204
|
-
const frame = useCurrentFrame2();
|
|
205
|
-
const { width, height } = useVideoConfig2();
|
|
206
|
-
const theme = defaultVideoTheme;
|
|
207
|
-
const safeZone = scaleSafeZone({ type: "custom", width, height });
|
|
208
|
-
const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
|
|
209
|
-
const _accentColor = styleOverrides?.accentColor ?? theme.colors.accent;
|
|
210
|
-
const isDark = styleOverrides?.darkMode ?? true;
|
|
211
|
-
let background;
|
|
212
|
-
switch (variant) {
|
|
213
|
-
case "solid":
|
|
214
|
-
background = isDark ? "#0a0a0a" : theme.colors.background;
|
|
215
|
-
break;
|
|
216
|
-
case "gradient":
|
|
217
|
-
background = isDark ? `linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)` : `linear-gradient(135deg, ${theme.colors.background} 0%, ${theme.colors.muted} 100%)`;
|
|
218
|
-
break;
|
|
219
|
-
case "dark":
|
|
220
|
-
background = "#000000";
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
const entranceOpacity = animateEntrance ? interpolate2(frame, [0, 15], [0, 1], {
|
|
224
|
-
extrapolateLeft: "clamp",
|
|
225
|
-
extrapolateRight: "clamp",
|
|
226
|
-
easing: videoEasing.entrance
|
|
227
|
-
}) : 1;
|
|
228
|
-
const brandOpacity = showBranding ? interpolate2(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
|
|
229
|
-
extrapolateLeft: "clamp",
|
|
230
|
-
extrapolateRight: "clamp"
|
|
231
|
-
}) : 0;
|
|
232
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
233
|
-
style: {
|
|
234
|
-
width,
|
|
235
|
-
height,
|
|
236
|
-
background,
|
|
237
|
-
position: "relative",
|
|
238
|
-
overflow: "hidden",
|
|
239
|
-
opacity: entranceOpacity
|
|
240
|
-
},
|
|
241
|
-
children: [
|
|
242
|
-
variant === "gradient" && /* @__PURE__ */ jsxDEV2("div", {
|
|
243
|
-
style: {
|
|
244
|
-
position: "absolute",
|
|
245
|
-
top: "-20%",
|
|
246
|
-
right: "-10%",
|
|
247
|
-
width: "50%",
|
|
248
|
-
height: "50%",
|
|
249
|
-
background: `radial-gradient(circle, ${primaryColor}15 0%, transparent 70%)`,
|
|
250
|
-
borderRadius: "50%",
|
|
251
|
-
pointerEvents: "none"
|
|
252
|
-
}
|
|
253
|
-
}, undefined, false, undefined, this),
|
|
254
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
255
|
-
style: {
|
|
256
|
-
position: "absolute",
|
|
257
|
-
left: safeZone.horizontal,
|
|
258
|
-
top: safeZone.vertical,
|
|
259
|
-
width: safeZone.contentWidth,
|
|
260
|
-
height: safeZone.contentHeight,
|
|
261
|
-
display: "flex",
|
|
262
|
-
flexDirection: "column"
|
|
263
|
-
},
|
|
264
|
-
children
|
|
265
|
-
}, undefined, false, undefined, this),
|
|
266
|
-
showBranding && /* @__PURE__ */ jsxDEV2("div", {
|
|
267
|
-
style: {
|
|
268
|
-
position: "absolute",
|
|
269
|
-
bottom: safeZone.vertical / 2,
|
|
270
|
-
right: safeZone.horizontal,
|
|
271
|
-
opacity: brandOpacity,
|
|
272
|
-
color: isDark ? "#ffffff" : "#000000",
|
|
273
|
-
fontSize: Math.round(16 * (width / 1920)),
|
|
274
|
-
fontWeight: 500,
|
|
275
|
-
letterSpacing: 1
|
|
276
|
-
},
|
|
277
|
-
children: "ContractSpec"
|
|
278
|
-
}, undefined, false, undefined, this)
|
|
279
|
-
]
|
|
280
|
-
}, undefined, true, undefined, this);
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
// src/compositions/primitives/code-block.tsx
|
|
284
|
-
import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
|
|
285
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
286
|
-
var CodeBlock = ({
|
|
287
|
-
code,
|
|
288
|
-
language = "typescript",
|
|
289
|
-
startAt = 0,
|
|
290
|
-
typeAnimation = true,
|
|
291
|
-
backgroundColor = defaultVideoColors.codeBackground,
|
|
292
|
-
textColor = "#abb2bf",
|
|
293
|
-
filename
|
|
294
|
-
}) => {
|
|
295
|
-
const frame = useCurrentFrame3();
|
|
296
|
-
const { width } = useVideoConfig3();
|
|
297
|
-
const codeStyle = scaleTypography(videoTypography.code, width);
|
|
298
|
-
const totalChars = code.length;
|
|
299
|
-
const typingDuration = totalChars * videoDurations.codeTypingPerChar;
|
|
300
|
-
const charsVisible = typeAnimation ? Math.floor(interpolate3(frame, [startAt, startAt + typingDuration], [0, totalChars], {
|
|
301
|
-
extrapolateLeft: "clamp",
|
|
302
|
-
extrapolateRight: "clamp"
|
|
303
|
-
})) : totalChars;
|
|
304
|
-
const visibleCode = code.slice(0, charsVisible);
|
|
305
|
-
const opacity = interpolate3(frame, [startAt, startAt + 10], [0, 1], {
|
|
306
|
-
extrapolateLeft: "clamp",
|
|
307
|
-
extrapolateRight: "clamp",
|
|
308
|
-
easing: videoEasing.entrance
|
|
309
|
-
});
|
|
310
|
-
const showCursor = typeAnimation && charsVisible < totalChars && frame % 16 < 10;
|
|
311
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
312
|
-
style: {
|
|
313
|
-
backgroundColor,
|
|
314
|
-
borderRadius: 16,
|
|
315
|
-
padding: 0,
|
|
316
|
-
opacity,
|
|
317
|
-
overflow: "hidden",
|
|
318
|
-
boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
|
|
319
|
-
},
|
|
320
|
-
children: [
|
|
321
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
322
|
-
style: {
|
|
323
|
-
display: "flex",
|
|
324
|
-
alignItems: "center",
|
|
325
|
-
padding: "12px 20px",
|
|
326
|
-
backgroundColor: "rgba(0,0,0,0.2)",
|
|
327
|
-
gap: 8
|
|
328
|
-
},
|
|
329
|
-
children: [
|
|
330
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
331
|
-
style: { display: "flex", gap: 8 },
|
|
332
|
-
children: [
|
|
333
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
334
|
-
style: {
|
|
335
|
-
width: 12,
|
|
336
|
-
height: 12,
|
|
337
|
-
borderRadius: "50%",
|
|
338
|
-
backgroundColor: "#ff5f57"
|
|
339
|
-
}
|
|
340
|
-
}, undefined, false, undefined, this),
|
|
341
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
342
|
-
style: {
|
|
343
|
-
width: 12,
|
|
344
|
-
height: 12,
|
|
345
|
-
borderRadius: "50%",
|
|
346
|
-
backgroundColor: "#febc2e"
|
|
347
|
-
}
|
|
348
|
-
}, undefined, false, undefined, this),
|
|
349
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
350
|
-
style: {
|
|
351
|
-
width: 12,
|
|
352
|
-
height: 12,
|
|
353
|
-
borderRadius: "50%",
|
|
354
|
-
backgroundColor: "#28c840"
|
|
355
|
-
}
|
|
356
|
-
}, undefined, false, undefined, this)
|
|
357
|
-
]
|
|
358
|
-
}, undefined, true, undefined, this),
|
|
359
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
360
|
-
style: {
|
|
361
|
-
flex: 1,
|
|
362
|
-
textAlign: "center",
|
|
363
|
-
color: "#666",
|
|
364
|
-
fontSize: codeStyle.fontSize * 0.7,
|
|
365
|
-
fontFamily: "monospace"
|
|
366
|
-
},
|
|
367
|
-
children: filename ?? language
|
|
368
|
-
}, undefined, false, undefined, this)
|
|
369
|
-
]
|
|
370
|
-
}, undefined, true, undefined, this),
|
|
371
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
372
|
-
style: { padding: "24px 32px" },
|
|
373
|
-
children: /* @__PURE__ */ jsxDEV3("pre", {
|
|
374
|
-
style: {
|
|
375
|
-
margin: 0,
|
|
376
|
-
fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
|
|
377
|
-
fontSize: codeStyle.fontSize,
|
|
378
|
-
lineHeight: codeStyle.lineHeight,
|
|
379
|
-
color: textColor,
|
|
380
|
-
whiteSpace: "pre-wrap",
|
|
381
|
-
wordBreak: "break-word"
|
|
382
|
-
},
|
|
383
|
-
children: [
|
|
384
|
-
visibleCode,
|
|
385
|
-
showCursor && /* @__PURE__ */ jsxDEV3("span", {
|
|
386
|
-
style: {
|
|
387
|
-
backgroundColor: textColor,
|
|
388
|
-
width: "2px",
|
|
389
|
-
display: "inline-block",
|
|
390
|
-
height: "1.2em",
|
|
391
|
-
verticalAlign: "text-bottom"
|
|
392
|
-
},
|
|
393
|
-
children: " "
|
|
394
|
-
}, undefined, false, undefined, this)
|
|
395
|
-
]
|
|
396
|
-
}, undefined, true, undefined, this)
|
|
397
|
-
}, undefined, false, undefined, this)
|
|
398
|
-
]
|
|
399
|
-
}, undefined, true, undefined, this);
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
// src/compositions/primitives/progress-bar.tsx
|
|
403
|
-
import { useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
404
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
405
|
-
var ProgressBar = ({
|
|
406
|
-
height = 4,
|
|
407
|
-
color = defaultVideoTheme.colors.primary,
|
|
408
|
-
backgroundColor = "rgba(255,255,255,0.1)",
|
|
409
|
-
position = "bottom"
|
|
410
|
-
}) => {
|
|
411
|
-
const frame = useCurrentFrame4();
|
|
412
|
-
const { durationInFrames, width } = useVideoConfig4();
|
|
413
|
-
const progress = frame / durationInFrames;
|
|
414
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
415
|
-
style: {
|
|
416
|
-
position: "absolute",
|
|
417
|
-
[position]: 0,
|
|
418
|
-
left: 0,
|
|
419
|
-
width,
|
|
420
|
-
height,
|
|
421
|
-
backgroundColor,
|
|
422
|
-
zIndex: 100
|
|
423
|
-
},
|
|
424
|
-
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
425
|
-
style: {
|
|
426
|
-
width: `${progress * 100}%`,
|
|
427
|
-
height: "100%",
|
|
428
|
-
backgroundColor: color,
|
|
429
|
-
transition: "none"
|
|
430
|
-
}
|
|
431
|
-
}, undefined, false, undefined, this)
|
|
432
|
-
}, undefined, false, undefined, this);
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
// src/compositions/api-overview.tsx
|
|
436
|
-
import {
|
|
437
|
-
AbsoluteFill,
|
|
438
|
-
interpolate as interpolate4,
|
|
439
|
-
Sequence,
|
|
440
|
-
useCurrentFrame as useCurrentFrame5,
|
|
441
|
-
useVideoConfig as useVideoConfig5
|
|
442
|
-
} from "remotion";
|
|
443
|
-
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
444
|
-
var ApiOverview = ({
|
|
445
|
-
specName,
|
|
446
|
-
method = "POST",
|
|
447
|
-
endpoint = "/api/users",
|
|
448
|
-
specCode,
|
|
449
|
-
generatedOutputs = [
|
|
450
|
-
"REST Endpoint",
|
|
451
|
-
"GraphQL Mutation",
|
|
452
|
-
"Prisma Model",
|
|
453
|
-
"TypeScript SDK",
|
|
454
|
-
"MCP Tool",
|
|
455
|
-
"OpenAPI Spec"
|
|
456
|
-
],
|
|
457
|
-
tagline = "One spec. Every surface."
|
|
458
|
-
}) => {
|
|
459
|
-
const { durationInFrames } = useVideoConfig5();
|
|
460
|
-
const theme = defaultVideoTheme;
|
|
461
|
-
const INTRO_END = 60;
|
|
462
|
-
const CODE_START = 45;
|
|
463
|
-
const CODE_END = INTRO_END + 150;
|
|
464
|
-
const OUTPUTS_START = CODE_END - 30;
|
|
465
|
-
const TAGLINE_START = durationInFrames - 90;
|
|
466
|
-
return /* @__PURE__ */ jsxDEV5(AbsoluteFill, {
|
|
467
|
-
children: [
|
|
468
|
-
/* @__PURE__ */ jsxDEV5(BrandFrame, {
|
|
469
|
-
variant: "gradient",
|
|
470
|
-
showBranding: true,
|
|
471
|
-
children: [
|
|
472
|
-
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
473
|
-
from: 0,
|
|
474
|
-
durationInFrames: CODE_END,
|
|
475
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
476
|
-
style: {
|
|
477
|
-
flex: 1,
|
|
478
|
-
display: "flex",
|
|
479
|
-
flexDirection: "column",
|
|
480
|
-
gap: 16
|
|
481
|
-
},
|
|
482
|
-
children: [
|
|
483
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
484
|
-
style: { display: "flex", alignItems: "center", gap: 16 },
|
|
485
|
-
children: [
|
|
486
|
-
/* @__PURE__ */ jsxDEV5(MethodBadge, {
|
|
487
|
-
method,
|
|
488
|
-
enterAt: 10
|
|
489
|
-
}, undefined, false, undefined, this),
|
|
490
|
-
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
491
|
-
text: endpoint,
|
|
492
|
-
variant: "subheading",
|
|
493
|
-
enterAt: 15,
|
|
494
|
-
color: theme.colors.mutedForeground
|
|
495
|
-
}, undefined, false, undefined, this)
|
|
496
|
-
]
|
|
497
|
-
}, undefined, true, undefined, this),
|
|
498
|
-
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
499
|
-
text: specName,
|
|
500
|
-
variant: "title",
|
|
501
|
-
enterAt: 5,
|
|
502
|
-
color: "#ffffff"
|
|
503
|
-
}, undefined, false, undefined, this),
|
|
504
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
505
|
-
style: { flex: 1, marginTop: 24 },
|
|
506
|
-
children: /* @__PURE__ */ jsxDEV5(CodeBlock, {
|
|
507
|
-
code: specCode,
|
|
508
|
-
language: "typescript",
|
|
509
|
-
filename: `${specName.toLowerCase()}.contract.ts`,
|
|
510
|
-
startAt: CODE_START,
|
|
511
|
-
typeAnimation: true
|
|
512
|
-
}, undefined, false, undefined, this)
|
|
513
|
-
}, undefined, false, undefined, this)
|
|
514
|
-
]
|
|
515
|
-
}, undefined, true, undefined, this)
|
|
516
|
-
}, undefined, false, undefined, this),
|
|
517
|
-
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
518
|
-
from: OUTPUTS_START,
|
|
519
|
-
durationInFrames: durationInFrames - OUTPUTS_START,
|
|
520
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
521
|
-
style: {
|
|
522
|
-
flex: 1,
|
|
523
|
-
display: "flex",
|
|
524
|
-
flexDirection: "column",
|
|
525
|
-
justifyContent: "center",
|
|
526
|
-
alignItems: "center",
|
|
527
|
-
gap: 24
|
|
528
|
-
},
|
|
529
|
-
children: [
|
|
530
|
-
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
531
|
-
text: "Generates:",
|
|
532
|
-
variant: "heading",
|
|
533
|
-
enterAt: 0,
|
|
534
|
-
color: "#ffffff",
|
|
535
|
-
align: "center"
|
|
536
|
-
}, undefined, false, undefined, this),
|
|
537
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
538
|
-
style: {
|
|
539
|
-
display: "flex",
|
|
540
|
-
flexWrap: "wrap",
|
|
541
|
-
gap: 16,
|
|
542
|
-
justifyContent: "center",
|
|
543
|
-
maxWidth: "80%",
|
|
544
|
-
marginTop: 32
|
|
545
|
-
},
|
|
546
|
-
children: generatedOutputs.map((output, i) => /* @__PURE__ */ jsxDEV5(OutputChip, {
|
|
547
|
-
label: output,
|
|
548
|
-
index: i,
|
|
549
|
-
startFrame: 20 + i * 8
|
|
550
|
-
}, output, false, undefined, this))
|
|
551
|
-
}, undefined, false, undefined, this),
|
|
552
|
-
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
553
|
-
from: TAGLINE_START - OUTPUTS_START,
|
|
554
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
555
|
-
style: { marginTop: 48 },
|
|
556
|
-
children: /* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
557
|
-
text: tagline,
|
|
558
|
-
variant: "heading",
|
|
559
|
-
enterAt: 0,
|
|
560
|
-
color: theme.colors.accent,
|
|
561
|
-
align: "center"
|
|
562
|
-
}, undefined, false, undefined, this)
|
|
563
|
-
}, undefined, false, undefined, this)
|
|
564
|
-
}, undefined, false, undefined, this)
|
|
565
|
-
]
|
|
566
|
-
}, undefined, true, undefined, this)
|
|
567
|
-
}, undefined, false, undefined, this)
|
|
568
|
-
]
|
|
569
|
-
}, undefined, true, undefined, this),
|
|
570
|
-
/* @__PURE__ */ jsxDEV5(ProgressBar, {}, undefined, false, undefined, this)
|
|
571
|
-
]
|
|
572
|
-
}, undefined, true, undefined, this);
|
|
573
|
-
};
|
|
574
|
-
var MethodBadge = ({
|
|
575
|
-
method,
|
|
576
|
-
enterAt
|
|
577
|
-
}) => {
|
|
578
|
-
const frame = useCurrentFrame5();
|
|
579
|
-
const opacity = interpolate4(frame, [enterAt, enterAt + 10], [0, 1], {
|
|
580
|
-
extrapolateLeft: "clamp",
|
|
581
|
-
extrapolateRight: "clamp",
|
|
582
|
-
easing: videoEasing.entrance
|
|
583
|
-
});
|
|
584
|
-
const scale = interpolate4(frame, [enterAt, enterAt + 12], [0.8, 1], {
|
|
585
|
-
extrapolateLeft: "clamp",
|
|
586
|
-
extrapolateRight: "clamp",
|
|
587
|
-
easing: videoEasing.emphasis
|
|
588
|
-
});
|
|
589
|
-
const methodColors = {
|
|
590
|
-
GET: "#61afef",
|
|
591
|
-
POST: "#98c379",
|
|
592
|
-
PUT: "#e5c07b",
|
|
593
|
-
PATCH: "#d19a66",
|
|
594
|
-
DELETE: "#e06c75"
|
|
595
|
-
};
|
|
596
|
-
return /* @__PURE__ */ jsxDEV5("div", {
|
|
597
|
-
style: {
|
|
598
|
-
opacity,
|
|
599
|
-
transform: `scale(${scale})`,
|
|
600
|
-
backgroundColor: methodColors[method] ?? "#61afef",
|
|
601
|
-
color: "#000",
|
|
602
|
-
padding: "8px 20px",
|
|
603
|
-
borderRadius: 8,
|
|
604
|
-
fontSize: 24,
|
|
605
|
-
fontWeight: 700,
|
|
606
|
-
fontFamily: "monospace",
|
|
607
|
-
letterSpacing: 1
|
|
608
|
-
},
|
|
609
|
-
children: method
|
|
610
|
-
}, undefined, false, undefined, this);
|
|
611
|
-
};
|
|
612
|
-
var OutputChip = ({ label, startFrame }) => {
|
|
613
|
-
const frame = useCurrentFrame5();
|
|
614
|
-
const opacity = interpolate4(frame, [startFrame, startFrame + 12], [0, 1], {
|
|
615
|
-
extrapolateLeft: "clamp",
|
|
616
|
-
extrapolateRight: "clamp"
|
|
617
|
-
});
|
|
618
|
-
const translateY = interpolate4(frame, [startFrame, startFrame + 15], [20, 0], {
|
|
619
|
-
extrapolateLeft: "clamp",
|
|
620
|
-
extrapolateRight: "clamp",
|
|
621
|
-
easing: videoEasing.emphasis
|
|
622
|
-
});
|
|
623
|
-
const scale = interpolate4(frame, [startFrame, startFrame + 15], [0.9, 1], {
|
|
624
|
-
extrapolateLeft: "clamp",
|
|
625
|
-
extrapolateRight: "clamp",
|
|
626
|
-
easing: videoEasing.emphasis
|
|
627
|
-
});
|
|
628
|
-
return /* @__PURE__ */ jsxDEV5("div", {
|
|
629
|
-
style: {
|
|
630
|
-
opacity,
|
|
631
|
-
transform: `translateY(${translateY}px) scale(${scale})`,
|
|
632
|
-
backgroundColor: "rgba(255,255,255,0.08)",
|
|
633
|
-
border: "1px solid rgba(255,255,255,0.15)",
|
|
634
|
-
color: "#ffffff",
|
|
635
|
-
padding: "16px 32px",
|
|
636
|
-
borderRadius: 12,
|
|
637
|
-
fontSize: 28,
|
|
638
|
-
fontWeight: 500
|
|
639
|
-
},
|
|
640
|
-
children: label
|
|
641
|
-
}, undefined, false, undefined, this);
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
// src/compositions/primitives/terminal.tsx
|
|
645
|
-
import { interpolate as interpolate5, useCurrentFrame as useCurrentFrame6, useVideoConfig as useVideoConfig6 } from "remotion";
|
|
646
|
-
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
647
|
-
var LINE_TYPE_COLORS = {
|
|
648
|
-
command: "#c9d1d9",
|
|
649
|
-
output: "#8b949e",
|
|
650
|
-
error: "#f85149",
|
|
651
|
-
success: "#3fb950",
|
|
652
|
-
comment: "#6e7681"
|
|
653
|
-
};
|
|
654
|
-
var Terminal = ({
|
|
655
|
-
lines,
|
|
656
|
-
startAt = 0,
|
|
657
|
-
prompt = "$ ",
|
|
658
|
-
title = "Terminal",
|
|
659
|
-
backgroundColor = defaultVideoColors.terminalBackground,
|
|
660
|
-
typingSpeed = videoDurations.codeTypingPerChar
|
|
661
|
-
}) => {
|
|
662
|
-
const frame = useCurrentFrame6();
|
|
663
|
-
const { width } = useVideoConfig6();
|
|
664
|
-
const codeStyle = scaleTypography(videoTypography.code, width);
|
|
665
|
-
const lineTimings = [];
|
|
666
|
-
let currentFrame = startAt;
|
|
667
|
-
for (const line of lines) {
|
|
668
|
-
const delay = line.delay ?? 10;
|
|
669
|
-
const lineStart = currentFrame + delay;
|
|
670
|
-
if (line.type === "command") {
|
|
671
|
-
const typeDuration = line.text.length * typingSpeed;
|
|
672
|
-
lineTimings.push({
|
|
673
|
-
startFrame: lineStart,
|
|
674
|
-
endFrame: lineStart + typeDuration
|
|
675
|
-
});
|
|
676
|
-
currentFrame = lineStart + typeDuration;
|
|
677
|
-
} else {
|
|
678
|
-
lineTimings.push({ startFrame: lineStart, endFrame: lineStart + 5 });
|
|
679
|
-
currentFrame = lineStart + 5;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
const opacity = interpolate5(frame, [startAt, startAt + 10], [0, 1], {
|
|
683
|
-
extrapolateLeft: "clamp",
|
|
684
|
-
extrapolateRight: "clamp",
|
|
685
|
-
easing: videoEasing.entrance
|
|
686
|
-
});
|
|
687
|
-
return /* @__PURE__ */ jsxDEV6("div", {
|
|
688
|
-
style: {
|
|
689
|
-
backgroundColor,
|
|
690
|
-
borderRadius: 16,
|
|
691
|
-
overflow: "hidden",
|
|
692
|
-
opacity,
|
|
693
|
-
boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
|
|
694
|
-
},
|
|
695
|
-
children: [
|
|
696
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
697
|
-
style: {
|
|
698
|
-
display: "flex",
|
|
699
|
-
alignItems: "center",
|
|
700
|
-
padding: "12px 20px",
|
|
701
|
-
backgroundColor: "rgba(255,255,255,0.05)",
|
|
702
|
-
gap: 8
|
|
703
|
-
},
|
|
704
|
-
children: [
|
|
705
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
706
|
-
style: { display: "flex", gap: 8 },
|
|
707
|
-
children: [
|
|
708
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
709
|
-
style: {
|
|
710
|
-
width: 12,
|
|
711
|
-
height: 12,
|
|
712
|
-
borderRadius: "50%",
|
|
713
|
-
backgroundColor: "#ff5f57"
|
|
714
|
-
}
|
|
715
|
-
}, undefined, false, undefined, this),
|
|
716
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
717
|
-
style: {
|
|
718
|
-
width: 12,
|
|
719
|
-
height: 12,
|
|
720
|
-
borderRadius: "50%",
|
|
721
|
-
backgroundColor: "#febc2e"
|
|
722
|
-
}
|
|
723
|
-
}, undefined, false, undefined, this),
|
|
724
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
725
|
-
style: {
|
|
726
|
-
width: 12,
|
|
727
|
-
height: 12,
|
|
728
|
-
borderRadius: "50%",
|
|
729
|
-
backgroundColor: "#28c840"
|
|
730
|
-
}
|
|
731
|
-
}, undefined, false, undefined, this)
|
|
732
|
-
]
|
|
733
|
-
}, undefined, true, undefined, this),
|
|
734
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
735
|
-
style: {
|
|
736
|
-
flex: 1,
|
|
737
|
-
textAlign: "center",
|
|
738
|
-
color: "#484f58",
|
|
739
|
-
fontSize: codeStyle.fontSize * 0.7,
|
|
740
|
-
fontFamily: "monospace"
|
|
741
|
-
},
|
|
742
|
-
children: title
|
|
743
|
-
}, undefined, false, undefined, this)
|
|
744
|
-
]
|
|
745
|
-
}, undefined, true, undefined, this),
|
|
746
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
747
|
-
style: { padding: "24px 32px", minHeight: 200 },
|
|
748
|
-
children: lines.map((line, i) => {
|
|
749
|
-
const timing = lineTimings[i];
|
|
750
|
-
if (!timing || frame < timing.startFrame)
|
|
751
|
-
return null;
|
|
752
|
-
const isCommand = line.type === "command";
|
|
753
|
-
const lineColor = LINE_TYPE_COLORS[line.type];
|
|
754
|
-
let visibleText = line.text;
|
|
755
|
-
if (isCommand) {
|
|
756
|
-
const typingProgress = interpolate5(frame, [timing.startFrame, timing.endFrame], [0, line.text.length], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
757
|
-
visibleText = line.text.slice(0, Math.floor(typingProgress));
|
|
758
|
-
}
|
|
759
|
-
const lineOpacity = isCommand ? 1 : interpolate5(frame, [timing.startFrame, timing.startFrame + 5], [0, 1], {
|
|
760
|
-
extrapolateLeft: "clamp",
|
|
761
|
-
extrapolateRight: "clamp"
|
|
762
|
-
});
|
|
763
|
-
const isTyping = isCommand && frame >= timing.startFrame && frame <= timing.endFrame;
|
|
764
|
-
const showCursor = isTyping && frame % 16 < 10;
|
|
765
|
-
return /* @__PURE__ */ jsxDEV6("div", {
|
|
766
|
-
style: {
|
|
767
|
-
fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
|
|
768
|
-
fontSize: codeStyle.fontSize,
|
|
769
|
-
lineHeight: 1.8,
|
|
770
|
-
color: lineColor,
|
|
771
|
-
opacity: lineOpacity,
|
|
772
|
-
whiteSpace: "pre-wrap"
|
|
773
|
-
},
|
|
774
|
-
children: [
|
|
775
|
-
isCommand && /* @__PURE__ */ jsxDEV6("span", {
|
|
776
|
-
style: { color: "#3fb950" },
|
|
777
|
-
children: prompt
|
|
778
|
-
}, undefined, false, undefined, this),
|
|
779
|
-
line.type === "comment" && /* @__PURE__ */ jsxDEV6("span", {
|
|
780
|
-
style: { color: LINE_TYPE_COLORS.comment },
|
|
781
|
-
children: "# "
|
|
782
|
-
}, undefined, false, undefined, this),
|
|
783
|
-
visibleText,
|
|
784
|
-
showCursor && /* @__PURE__ */ jsxDEV6("span", {
|
|
785
|
-
style: {
|
|
786
|
-
backgroundColor: "#c9d1d9",
|
|
787
|
-
width: "2px",
|
|
788
|
-
display: "inline-block",
|
|
789
|
-
height: "1.2em",
|
|
790
|
-
verticalAlign: "text-bottom"
|
|
791
|
-
},
|
|
792
|
-
children: " "
|
|
793
|
-
}, undefined, false, undefined, this)
|
|
794
|
-
]
|
|
795
|
-
}, `${i}-${line.text.slice(0, 20)}`, true, undefined, this);
|
|
796
|
-
})
|
|
797
|
-
}, undefined, false, undefined, this)
|
|
798
|
-
]
|
|
799
|
-
}, undefined, true, undefined, this);
|
|
800
|
-
};
|
|
801
|
-
|
|
802
|
-
// src/compositions/primitives/transition.tsx
|
|
803
|
-
import { interpolate as interpolate6, useCurrentFrame as useCurrentFrame7 } from "remotion";
|
|
804
|
-
import { jsxDEV as jsxDEV7, Fragment } from "react/jsx-dev-runtime";
|
|
805
|
-
var SceneTransitionWrapper = ({
|
|
806
|
-
type,
|
|
807
|
-
durationInFrames,
|
|
808
|
-
direction,
|
|
809
|
-
startAt = 0,
|
|
810
|
-
children
|
|
811
|
-
}) => {
|
|
812
|
-
const frame = useCurrentFrame7();
|
|
813
|
-
if (type === "none" || durationInFrames === 0) {
|
|
814
|
-
return /* @__PURE__ */ jsxDEV7(Fragment, {
|
|
815
|
-
children
|
|
816
|
-
}, undefined, false, undefined, this);
|
|
817
|
-
}
|
|
818
|
-
const progress = interpolate6(frame, [startAt, startAt + durationInFrames], direction === "in" ? [0, 1] : [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
819
|
-
const styles = getTransitionStyles(type, progress);
|
|
820
|
-
return /* @__PURE__ */ jsxDEV7("div", {
|
|
821
|
-
style: styles,
|
|
822
|
-
children
|
|
823
|
-
}, undefined, false, undefined, this);
|
|
824
|
-
};
|
|
825
|
-
function getTransitionStyles(type, progress) {
|
|
826
|
-
const eased = videoEasing.entrance(progress);
|
|
827
|
-
switch (type) {
|
|
828
|
-
case "fade":
|
|
829
|
-
return {
|
|
830
|
-
opacity: eased,
|
|
831
|
-
width: "100%",
|
|
832
|
-
height: "100%"
|
|
833
|
-
};
|
|
834
|
-
case "slide-left":
|
|
835
|
-
return {
|
|
836
|
-
opacity: eased,
|
|
837
|
-
transform: `translateX(${(1 - eased) * 100}%)`,
|
|
838
|
-
width: "100%",
|
|
839
|
-
height: "100%"
|
|
840
|
-
};
|
|
841
|
-
case "slide-right":
|
|
842
|
-
return {
|
|
843
|
-
opacity: eased,
|
|
844
|
-
transform: `translateX(${(1 - eased) * -100}%)`,
|
|
845
|
-
width: "100%",
|
|
846
|
-
height: "100%"
|
|
847
|
-
};
|
|
848
|
-
case "wipe":
|
|
849
|
-
return {
|
|
850
|
-
clipPath: `inset(0 ${(1 - eased) * 100}% 0 0)`,
|
|
851
|
-
width: "100%",
|
|
852
|
-
height: "100%"
|
|
853
|
-
};
|
|
854
|
-
default:
|
|
855
|
-
return { width: "100%", height: "100%" };
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
// src/compositions/social-clip.tsx
|
|
859
|
-
import {
|
|
860
|
-
AbsoluteFill as AbsoluteFill2,
|
|
861
|
-
interpolate as interpolate7,
|
|
862
|
-
Sequence as Sequence2,
|
|
863
|
-
useCurrentFrame as useCurrentFrame8,
|
|
864
|
-
useVideoConfig as useVideoConfig7
|
|
865
|
-
} from "remotion";
|
|
866
|
-
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
867
|
-
var SocialClip = ({
|
|
868
|
-
hook,
|
|
869
|
-
message,
|
|
870
|
-
points = [],
|
|
871
|
-
cta = "Learn more",
|
|
872
|
-
ctaUrl = "contractspec.dev",
|
|
873
|
-
accentColor
|
|
874
|
-
}) => {
|
|
875
|
-
const { durationInFrames, width, height } = useVideoConfig7();
|
|
876
|
-
const theme = defaultVideoTheme;
|
|
877
|
-
const accent = accentColor ?? theme.colors.accent;
|
|
878
|
-
const isPortrait = height > width;
|
|
879
|
-
const HOOK_DURATION = 75;
|
|
880
|
-
const MESSAGE_START = 60;
|
|
881
|
-
const POINTS_START = MESSAGE_START + 60;
|
|
882
|
-
const CTA_START = durationInFrames - 90;
|
|
883
|
-
return /* @__PURE__ */ jsxDEV8(AbsoluteFill2, {
|
|
884
|
-
children: [
|
|
885
|
-
/* @__PURE__ */ jsxDEV8(BrandFrame, {
|
|
886
|
-
variant: "gradient",
|
|
887
|
-
showBranding: true,
|
|
888
|
-
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
889
|
-
style: {
|
|
890
|
-
flex: 1,
|
|
891
|
-
display: "flex",
|
|
892
|
-
flexDirection: "column",
|
|
893
|
-
justifyContent: "center",
|
|
894
|
-
alignItems: "center",
|
|
895
|
-
gap: isPortrait ? 48 : 32,
|
|
896
|
-
textAlign: "center",
|
|
897
|
-
padding: isPortrait ? "0 20px" : 0
|
|
898
|
-
},
|
|
899
|
-
children: [
|
|
900
|
-
/* @__PURE__ */ jsxDEV8(Sequence2, {
|
|
901
|
-
from: 0,
|
|
902
|
-
durationInFrames: HOOK_DURATION + 30,
|
|
903
|
-
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
904
|
-
style: { width: "100%" },
|
|
905
|
-
children: /* @__PURE__ */ jsxDEV8(AnimatedText, {
|
|
906
|
-
text: hook,
|
|
907
|
-
variant: "title",
|
|
908
|
-
enterAt: 5,
|
|
909
|
-
exitAt: HOOK_DURATION,
|
|
910
|
-
color: "#ffffff",
|
|
911
|
-
align: "center"
|
|
912
|
-
}, undefined, false, undefined, this)
|
|
913
|
-
}, undefined, false, undefined, this)
|
|
914
|
-
}, undefined, false, undefined, this),
|
|
915
|
-
/* @__PURE__ */ jsxDEV8(Sequence2, {
|
|
916
|
-
from: MESSAGE_START,
|
|
917
|
-
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
918
|
-
style: { width: "100%" },
|
|
919
|
-
children: /* @__PURE__ */ jsxDEV8(AnimatedText, {
|
|
920
|
-
text: message,
|
|
921
|
-
variant: isPortrait ? "subheading" : "heading",
|
|
922
|
-
enterAt: 0,
|
|
923
|
-
color: "#ffffff",
|
|
924
|
-
align: "center"
|
|
925
|
-
}, undefined, false, undefined, this)
|
|
926
|
-
}, undefined, false, undefined, this)
|
|
927
|
-
}, undefined, false, undefined, this),
|
|
928
|
-
points.length > 0 && /* @__PURE__ */ jsxDEV8(Sequence2, {
|
|
929
|
-
from: POINTS_START,
|
|
930
|
-
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
931
|
-
style: {
|
|
932
|
-
display: "flex",
|
|
933
|
-
flexDirection: "column",
|
|
934
|
-
gap: 16,
|
|
935
|
-
alignItems: isPortrait ? "flex-start" : "center",
|
|
936
|
-
width: "100%",
|
|
937
|
-
maxWidth: isPortrait ? "100%" : "80%",
|
|
938
|
-
marginTop: 16
|
|
939
|
-
},
|
|
940
|
-
children: points.map((point, i) => /* @__PURE__ */ jsxDEV8(PointItem, {
|
|
941
|
-
text: point,
|
|
942
|
-
index: i,
|
|
943
|
-
startFrame: i * 15,
|
|
944
|
-
accent
|
|
945
|
-
}, point, false, undefined, this))
|
|
946
|
-
}, undefined, false, undefined, this)
|
|
947
|
-
}, undefined, false, undefined, this),
|
|
948
|
-
/* @__PURE__ */ jsxDEV8(Sequence2, {
|
|
949
|
-
from: CTA_START,
|
|
950
|
-
children: /* @__PURE__ */ jsxDEV8(CTABlock, {
|
|
951
|
-
cta,
|
|
952
|
-
url: ctaUrl,
|
|
953
|
-
accent
|
|
954
|
-
}, undefined, false, undefined, this)
|
|
955
|
-
}, undefined, false, undefined, this)
|
|
956
|
-
]
|
|
957
|
-
}, undefined, true, undefined, this)
|
|
958
|
-
}, undefined, false, undefined, this),
|
|
959
|
-
/* @__PURE__ */ jsxDEV8(ProgressBar, {
|
|
960
|
-
color: accent
|
|
961
|
-
}, undefined, false, undefined, this)
|
|
962
|
-
]
|
|
963
|
-
}, undefined, true, undefined, this);
|
|
964
|
-
};
|
|
965
|
-
var PointItem = ({ text, startFrame, accent }) => {
|
|
966
|
-
const frame = useCurrentFrame8();
|
|
967
|
-
const opacity = interpolate7(frame, [startFrame, startFrame + 12], [0, 1], {
|
|
968
|
-
extrapolateLeft: "clamp",
|
|
969
|
-
extrapolateRight: "clamp"
|
|
970
|
-
});
|
|
971
|
-
const translateX = interpolate7(frame, [startFrame, startFrame + 15], [-30, 0], {
|
|
972
|
-
extrapolateLeft: "clamp",
|
|
973
|
-
extrapolateRight: "clamp",
|
|
974
|
-
easing: videoEasing.entrance
|
|
975
|
-
});
|
|
976
|
-
return /* @__PURE__ */ jsxDEV8("div", {
|
|
977
|
-
style: {
|
|
978
|
-
opacity,
|
|
979
|
-
transform: `translateX(${translateX}px)`,
|
|
980
|
-
display: "flex",
|
|
981
|
-
alignItems: "center",
|
|
982
|
-
gap: 16,
|
|
983
|
-
fontSize: 28,
|
|
984
|
-
color: "#ffffff"
|
|
985
|
-
},
|
|
986
|
-
children: [
|
|
987
|
-
/* @__PURE__ */ jsxDEV8("div", {
|
|
988
|
-
style: {
|
|
989
|
-
width: 8,
|
|
990
|
-
height: 8,
|
|
991
|
-
borderRadius: "50%",
|
|
992
|
-
backgroundColor: accent,
|
|
993
|
-
flexShrink: 0
|
|
994
|
-
}
|
|
995
|
-
}, undefined, false, undefined, this),
|
|
996
|
-
text
|
|
997
|
-
]
|
|
998
|
-
}, undefined, true, undefined, this);
|
|
999
|
-
};
|
|
1000
|
-
var CTABlock = ({ cta, url, accent }) => {
|
|
1001
|
-
const frame = useCurrentFrame8();
|
|
1002
|
-
const opacity = interpolate7(frame, [0, 15], [0, 1], {
|
|
1003
|
-
extrapolateLeft: "clamp",
|
|
1004
|
-
extrapolateRight: "clamp"
|
|
1005
|
-
});
|
|
1006
|
-
const scale = interpolate7(frame, [0, 18], [0.9, 1], {
|
|
1007
|
-
extrapolateLeft: "clamp",
|
|
1008
|
-
extrapolateRight: "clamp",
|
|
1009
|
-
easing: videoEasing.emphasis
|
|
1010
|
-
});
|
|
1011
|
-
return /* @__PURE__ */ jsxDEV8("div", {
|
|
1012
|
-
style: {
|
|
1013
|
-
opacity,
|
|
1014
|
-
transform: `scale(${scale})`,
|
|
1015
|
-
display: "flex",
|
|
1016
|
-
flexDirection: "column",
|
|
1017
|
-
alignItems: "center",
|
|
1018
|
-
gap: 12,
|
|
1019
|
-
marginTop: 24
|
|
1020
|
-
},
|
|
1021
|
-
children: [
|
|
1022
|
-
/* @__PURE__ */ jsxDEV8("div", {
|
|
1023
|
-
style: {
|
|
1024
|
-
backgroundColor: accent,
|
|
1025
|
-
color: "#ffffff",
|
|
1026
|
-
padding: "16px 48px",
|
|
1027
|
-
borderRadius: 12,
|
|
1028
|
-
fontSize: 28,
|
|
1029
|
-
fontWeight: 600
|
|
1030
|
-
},
|
|
1031
|
-
children: cta
|
|
1032
|
-
}, undefined, false, undefined, this),
|
|
1033
|
-
/* @__PURE__ */ jsxDEV8("div", {
|
|
1034
|
-
style: { color: "rgba(255,255,255,0.5)", fontSize: 20 },
|
|
1035
|
-
children: url
|
|
1036
|
-
}, undefined, false, undefined, this)
|
|
1037
|
-
]
|
|
1038
|
-
}, undefined, true, undefined, this);
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
// src/compositions/terminal-demo.tsx
|
|
1042
|
-
import { AbsoluteFill as AbsoluteFill3, Sequence as Sequence3, useVideoConfig as useVideoConfig8 } from "remotion";
|
|
1043
|
-
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
1044
|
-
var TerminalDemo = ({
|
|
1045
|
-
title,
|
|
1046
|
-
subtitle,
|
|
1047
|
-
lines,
|
|
1048
|
-
terminalTitle = "Terminal",
|
|
1049
|
-
prompt = "$ ",
|
|
1050
|
-
summary
|
|
1051
|
-
}) => {
|
|
1052
|
-
const { durationInFrames } = useVideoConfig8();
|
|
1053
|
-
const theme = defaultVideoTheme;
|
|
1054
|
-
const TERMINAL_START = 40;
|
|
1055
|
-
const SUMMARY_START = durationInFrames - 90;
|
|
1056
|
-
return /* @__PURE__ */ jsxDEV9(AbsoluteFill3, {
|
|
1057
|
-
children: [
|
|
1058
|
-
/* @__PURE__ */ jsxDEV9(BrandFrame, {
|
|
1059
|
-
variant: "dark",
|
|
1060
|
-
showBranding: true,
|
|
1061
|
-
children: /* @__PURE__ */ jsxDEV9("div", {
|
|
1062
|
-
style: {
|
|
1063
|
-
flex: 1,
|
|
1064
|
-
display: "flex",
|
|
1065
|
-
flexDirection: "column",
|
|
1066
|
-
gap: 24
|
|
1067
|
-
},
|
|
1068
|
-
children: [
|
|
1069
|
-
/* @__PURE__ */ jsxDEV9("div", {
|
|
1070
|
-
children: [
|
|
1071
|
-
/* @__PURE__ */ jsxDEV9(AnimatedText, {
|
|
1072
|
-
text: title,
|
|
1073
|
-
variant: "heading",
|
|
1074
|
-
enterAt: 5,
|
|
1075
|
-
color: "#ffffff"
|
|
1076
|
-
}, undefined, false, undefined, this),
|
|
1077
|
-
subtitle && /* @__PURE__ */ jsxDEV9("div", {
|
|
1078
|
-
style: { marginTop: 8 },
|
|
1079
|
-
children: /* @__PURE__ */ jsxDEV9(AnimatedText, {
|
|
1080
|
-
text: subtitle,
|
|
1081
|
-
variant: "body",
|
|
1082
|
-
enterAt: 15,
|
|
1083
|
-
color: theme.colors.mutedForeground
|
|
1084
|
-
}, undefined, false, undefined, this)
|
|
1085
|
-
}, undefined, false, undefined, this)
|
|
1086
|
-
]
|
|
1087
|
-
}, undefined, true, undefined, this),
|
|
1088
|
-
/* @__PURE__ */ jsxDEV9(Sequence3, {
|
|
1089
|
-
from: TERMINAL_START,
|
|
1090
|
-
children: /* @__PURE__ */ jsxDEV9("div", {
|
|
1091
|
-
style: { flex: 1 },
|
|
1092
|
-
children: /* @__PURE__ */ jsxDEV9(Terminal, {
|
|
1093
|
-
lines,
|
|
1094
|
-
startAt: 0,
|
|
1095
|
-
prompt,
|
|
1096
|
-
title: terminalTitle
|
|
1097
|
-
}, undefined, false, undefined, this)
|
|
1098
|
-
}, undefined, false, undefined, this)
|
|
1099
|
-
}, undefined, false, undefined, this),
|
|
1100
|
-
summary && /* @__PURE__ */ jsxDEV9(Sequence3, {
|
|
1101
|
-
from: SUMMARY_START,
|
|
1102
|
-
children: /* @__PURE__ */ jsxDEV9("div", {
|
|
1103
|
-
style: {
|
|
1104
|
-
marginTop: "auto",
|
|
1105
|
-
paddingTop: 24
|
|
1106
|
-
},
|
|
1107
|
-
children: /* @__PURE__ */ jsxDEV9(AnimatedText, {
|
|
1108
|
-
text: summary,
|
|
1109
|
-
variant: "subheading",
|
|
1110
|
-
enterAt: 0,
|
|
1111
|
-
color: theme.colors.accent,
|
|
1112
|
-
align: "center"
|
|
1113
|
-
}, undefined, false, undefined, this)
|
|
1114
|
-
}, undefined, false, undefined, this)
|
|
1115
|
-
}, undefined, false, undefined, this)
|
|
1116
|
-
]
|
|
1117
|
-
}, undefined, true, undefined, this)
|
|
1118
|
-
}, undefined, false, undefined, this),
|
|
1119
|
-
/* @__PURE__ */ jsxDEV9(ProgressBar, {}, undefined, false, undefined, this)
|
|
1120
|
-
]
|
|
1121
|
-
}, undefined, true, undefined, this);
|
|
1122
|
-
};
|
|
1123
|
-
// src/i18n/catalogs/en.ts
|
|
1124
|
-
import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
|
|
1125
|
-
var enMessages = defineTranslation({
|
|
1126
|
-
meta: {
|
|
1127
|
-
key: "video-gen.messages",
|
|
1128
|
-
version: "1.0.0",
|
|
1129
|
-
domain: "video-gen",
|
|
1130
|
-
description: "All user-facing, LLM-facing, and developer-facing strings for the video-gen package",
|
|
1131
|
-
owners: ["platform"],
|
|
1132
|
-
stability: "experimental"
|
|
1133
|
-
},
|
|
1134
|
-
locale: "en",
|
|
1135
|
-
fallback: "en",
|
|
1136
|
-
messages: {
|
|
1137
|
-
"prompt.script.system": {
|
|
1138
|
-
value: `You are a video narration script writer.
|
|
1
|
+
var R1=((G)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(G,{get:(K,L)=>(typeof require<"u"?require:K)[L]}):G)(function(G){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+G+'" is not supported')});import{Easing as w}from"remotion";var R={entrance:w.out(w.exp),exit:w.in(w.exp),emphasis:w.out(w.back(1.4)),linear:w.linear,gentle:w.bezier(0.25,0.1,0.25,1),spring:w.out(w.back(1.7))},V={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},_1={fade:{type:"fade",durationInFrames:20},slideLeft:{type:"slide-left",durationInFrames:20},slideRight:{type:"slide-right",durationInFrames:20},wipe:{type:"wipe",durationInFrames:15},none:{type:"none",durationInFrames:0}};import{defaultTokens as b}from"@contractspec/lib.design-system";var y={canvasBackground:b.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:b.colors.accent,gradientStart:b.colors.primary,gradientEnd:b.colors.accent},P={...b,video:y};var C={title:{fontSize:72,lineHeight:1.1,fontWeight:700,letterSpacing:-1},heading:{fontSize:56,lineHeight:1.2,fontWeight:600,letterSpacing:-0.5},subheading:{fontSize:40,lineHeight:1.25,fontWeight:500},body:{fontSize:32,lineHeight:1.5,fontWeight:400},code:{fontSize:28,lineHeight:1.6,fontWeight:400},caption:{fontSize:24,lineHeight:1.4,fontWeight:400},label:{fontSize:20,lineHeight:1.3,fontWeight:600,letterSpacing:1}};function v(G,K){let L=K/1920;return{...G,fontSize:Math.round(G.fontSize*L),letterSpacing:G.letterSpacing?Math.round(G.letterSpacing*L*10)/10:void 0}}import{interpolate as A,useCurrentFrame as P8,useVideoConfig as O8}from"remotion";import{jsx as k8}from"react/jsx-runtime";var I=({text:G,variant:K="body",style:L,enterAt:z=0,exitAt:H,color:Q="#ffffff",align:$="left"})=>{let W=P8(),{width:U}=O8(),M=C[K],X={...v(M,U),...L},N=A(W,[z,z+V.textEntrance],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),B=A(N,[0,1],[0,1],{easing:R.entrance}),Y=A(N,[0,1],[30,0],{easing:R.entrance}),Z=1,k=0;if(H!==void 0){let o=A(W,[H,H+V.textExit],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});Z=A(o,[0,1],[1,0],{easing:R.exit}),k=A(o,[0,1],[0,-20],{easing:R.exit})}let E=B*Z,c=Y+k;return k8("div",{style:{fontSize:X.fontSize,lineHeight:X.lineHeight,fontWeight:X.fontWeight,letterSpacing:X.letterSpacing,color:Q,textAlign:$,opacity:E,transform:`translateY(${c}px)`,willChange:"opacity, transform"},children:G})};import{VIDEO_FORMATS as r}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var j=30,x={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function J8(G){let K=G.width/1920,L=G.height/1080;return{horizontal:Math.round(x.horizontal*K),vertical:Math.round(x.vertical*L),contentWidth:Math.round(x.contentWidth*K),contentHeight:Math.round(x.contentHeight*L)}}var T1={center:{x:960,y:540},topLeft:{x:120,y:80},topRight:{x:1800,y:80},bottomLeft:{x:120,y:1000},bottomRight:{x:1800,y:1000},bottomCenter:{x:960,y:960}};function C1(){return[r.landscape,r.square,r.portrait]}import{interpolate as Q8,useCurrentFrame as E8,useVideoConfig as S8}from"remotion";import{jsx as a,jsxs as T8}from"react/jsx-runtime";var S=({styleOverrides:G,showBranding:K=!0,animateEntrance:L=!0,variant:z="gradient",children:H})=>{let Q=E8(),{width:$,height:W}=S8(),U=P,M=J8({type:"custom",width:$,height:W}),J=G?.primaryColor??U.colors.primary,X=G?.accentColor??U.colors.accent,N=G?.darkMode??!0,B;switch(z){case"solid":B=N?"#0a0a0a":U.colors.background;break;case"gradient":B=N?"linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)":`linear-gradient(135deg, ${U.colors.background} 0%, ${U.colors.muted} 100%)`;break;case"dark":B="#000000";break}let Y=L?Q8(Q,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.entrance}):1,Z=K?Q8(Q,[V.brandReveal,V.brandReveal+15],[0,0.3],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}):0;return T8("div",{style:{width:$,height:W,background:B,position:"relative",overflow:"hidden",opacity:Y},children:[z==="gradient"&&a("div",{style:{position:"absolute",top:"-20%",right:"-10%",width:"50%",height:"50%",background:`radial-gradient(circle, ${J}15 0%, transparent 70%)`,borderRadius:"50%",pointerEvents:"none"}}),a("div",{style:{position:"absolute",left:M.horizontal,top:M.vertical,width:M.contentWidth,height:M.contentHeight,display:"flex",flexDirection:"column"},children:H}),K&&a("div",{style:{position:"absolute",bottom:M.vertical/2,right:M.horizontal,opacity:Z,color:N?"#ffffff":"#000000",fontSize:Math.round(16*($/1920)),fontWeight:500,letterSpacing:1},children:"ContractSpec"})]})};import{interpolate as $8,useCurrentFrame as C8,useVideoConfig as v8}from"remotion";import{jsx as F,jsxs as p}from"react/jsx-runtime";var n=({code:G,language:K="typescript",startAt:L=0,typeAnimation:z=!0,backgroundColor:H=y.codeBackground,textColor:Q="#abb2bf",filename:$})=>{let W=C8(),{width:U}=v8(),M=v(C.code,U),J=G.length,X=J*V.codeTypingPerChar,N=z?Math.floor($8(W,[L,L+X],[0,J],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})):J,B=G.slice(0,N),Y=$8(W,[L,L+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.entrance}),Z=z&&N<J&&W%16<10;return p("div",{style:{backgroundColor:H,borderRadius:16,padding:0,opacity:Y,overflow:"hidden",boxShadow:"0 8px 32px rgba(0,0,0,0.3)"},children:[p("div",{style:{display:"flex",alignItems:"center",padding:"12px 20px",backgroundColor:"rgba(0,0,0,0.2)",gap:8},children:[p("div",{style:{display:"flex",gap:8},children:[F("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#ff5f57"}}),F("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#febc2e"}}),F("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#28c840"}})]}),F("div",{style:{flex:1,textAlign:"center",color:"#666",fontSize:M.fontSize*0.7,fontFamily:"monospace"},children:$??K})]}),F("div",{style:{padding:"24px 32px"},children:p("pre",{style:{margin:0,fontFamily:"'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",fontSize:M.fontSize,lineHeight:M.lineHeight,color:Q,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[B,Z&&F("span",{style:{backgroundColor:Q,width:"2px",display:"inline-block",height:"1.2em",verticalAlign:"text-bottom"},children:" "})]})})]})};import{useCurrentFrame as A8,useVideoConfig as F8}from"remotion";import{jsx as W8}from"react/jsx-runtime";var T=({height:G=4,color:K=P.colors.primary,backgroundColor:L="rgba(255,255,255,0.1)",position:z="bottom"})=>{let H=A8(),{durationInFrames:Q,width:$}=F8(),W=H/Q;return W8("div",{style:{position:"absolute",[z]:0,left:0,width:$,height:G,backgroundColor:L,zIndex:100},children:W8("div",{style:{width:`${W*100}%`,height:"100%",backgroundColor:K,transition:"none"}})})};import{AbsoluteFill as b8,interpolate as f,Sequence as i,useCurrentFrame as X8,useVideoConfig as y8}from"remotion";import{jsx as _,jsxs as h}from"react/jsx-runtime";var h8=({specName:G,method:K="POST",endpoint:L="/api/users",specCode:z,generatedOutputs:H=["REST Endpoint","GraphQL Mutation","Prisma Model","TypeScript SDK","MCP Tool","OpenAPI Spec"],tagline:Q="One spec. Every surface."})=>{let{durationInFrames:$}=y8(),W=P,U=60,M=45,J=210,X=180,N=$-90;return h(b8,{children:[h(S,{variant:"gradient",showBranding:!0,children:[_(i,{from:0,durationInFrames:210,children:h("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16},children:[h("div",{style:{display:"flex",alignItems:"center",gap:16},children:[_(f8,{method:K,enterAt:10}),_(I,{text:L,variant:"subheading",enterAt:15,color:W.colors.mutedForeground})]}),_(I,{text:G,variant:"title",enterAt:5,color:"#ffffff"}),_("div",{style:{flex:1,marginTop:24},children:_(n,{code:z,language:"typescript",filename:`${G.toLowerCase()}.contract.ts`,startAt:45,typeAnimation:!0})})]})}),_(i,{from:180,durationInFrames:$-180,children:h("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:24},children:[_(I,{text:"Generates:",variant:"heading",enterAt:0,color:"#ffffff",align:"center"}),_("div",{style:{display:"flex",flexWrap:"wrap",gap:16,justifyContent:"center",maxWidth:"80%",marginTop:32},children:H.map((B,Y)=>_(x8,{label:B,index:Y,startFrame:20+Y*8},B))}),_(i,{from:N-180,children:_("div",{style:{marginTop:48},children:_(I,{text:Q,variant:"heading",enterAt:0,color:W.colors.accent,align:"center"})})})]})})]}),_(T,{})]})},f8=({method:G,enterAt:K})=>{let L=X8(),z=f(L,[K,K+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.entrance}),H=f(L,[K,K+12],[0.8,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.emphasis}),Q={GET:"#61afef",POST:"#98c379",PUT:"#e5c07b",PATCH:"#d19a66",DELETE:"#e06c75"};return _("div",{style:{opacity:z,transform:`scale(${H})`,backgroundColor:Q[G]??"#61afef",color:"#000",padding:"8px 20px",borderRadius:8,fontSize:24,fontWeight:700,fontFamily:"monospace",letterSpacing:1},children:G})},x8=({label:G,startFrame:K})=>{let L=X8(),z=f(L,[K,K+12],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),H=f(L,[K,K+15],[20,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.emphasis}),Q=f(L,[K,K+15],[0.9,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.emphasis});return _("div",{style:{opacity:z,transform:`translateY(${H}px) scale(${Q})`,backgroundColor:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",color:"#ffffff",padding:"16px 32px",borderRadius:12,fontSize:28,fontWeight:500},children:G})};import{interpolate as s,useCurrentFrame as j8,useVideoConfig as p8}from"remotion";import{jsx as O,jsxs as g}from"react/jsx-runtime";var U8={command:"#c9d1d9",output:"#8b949e",error:"#f85149",success:"#3fb950",comment:"#6e7681"},t=({lines:G,startAt:K=0,prompt:L="$ ",title:z="Terminal",backgroundColor:H=y.terminalBackground,typingSpeed:Q=V.codeTypingPerChar})=>{let $=j8(),{width:W}=p8(),U=v(C.code,W),M=[],J=K;for(let N of G){let B=N.delay??10,Y=J+B;if(N.type==="command"){let Z=N.text.length*Q;M.push({startFrame:Y,endFrame:Y+Z}),J=Y+Z}else M.push({startFrame:Y,endFrame:Y+5}),J=Y+5}let X=s($,[K,K+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.entrance});return g("div",{style:{backgroundColor:H,borderRadius:16,overflow:"hidden",opacity:X,boxShadow:"0 8px 32px rgba(0,0,0,0.3)"},children:[g("div",{style:{display:"flex",alignItems:"center",padding:"12px 20px",backgroundColor:"rgba(255,255,255,0.05)",gap:8},children:[g("div",{style:{display:"flex",gap:8},children:[O("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#ff5f57"}}),O("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#febc2e"}}),O("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#28c840"}})]}),O("div",{style:{flex:1,textAlign:"center",color:"#484f58",fontSize:U.fontSize*0.7,fontFamily:"monospace"},children:z})]}),O("div",{style:{padding:"24px 32px",minHeight:200},children:G.map((N,B)=>{let Y=M[B];if(!Y||$<Y.startFrame)return null;let Z=N.type==="command",k=U8[N.type],E=N.text;if(Z){let V8=s($,[Y.startFrame,Y.endFrame],[0,N.text.length],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});E=N.text.slice(0,Math.floor(V8))}let c=Z?1:s($,[Y.startFrame,Y.startFrame+5],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),w8=Z&&$>=Y.startFrame&&$<=Y.endFrame&&$%16<10;return g("div",{style:{fontFamily:"'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",fontSize:U.fontSize,lineHeight:1.8,color:k,opacity:c,whiteSpace:"pre-wrap"},children:[Z&&O("span",{style:{color:"#3fb950"},children:L}),N.type==="comment"&&O("span",{style:{color:U8.comment},children:"# "}),E,w8&&O("span",{style:{backgroundColor:"#c9d1d9",width:"2px",display:"inline-block",height:"1.2em",verticalAlign:"text-bottom"},children:" "})]},`${B}-${N.text.slice(0,20)}`)})})]})};import{interpolate as g8,useCurrentFrame as u8}from"remotion";import{jsx as N8,Fragment as l8}from"react/jsx-runtime";var m8=({type:G,durationInFrames:K,direction:L,startAt:z=0,children:H})=>{let Q=u8();if(G==="none"||K===0)return N8(l8,{children:H});let $=g8(Q,[z,z+K],L==="in"?[0,1]:[1,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),W=d8(G,$);return N8("div",{style:W,children:H})};function d8(G,K){let L=R.entrance(K);switch(G){case"fade":return{opacity:L,width:"100%",height:"100%"};case"slide-left":return{opacity:L,transform:`translateX(${(1-L)*100}%)`,width:"100%",height:"100%"};case"slide-right":return{opacity:L,transform:`translateX(${(1-L)*-100}%)`,width:"100%",height:"100%"};case"wipe":return{clipPath:`inset(0 ${(1-L)*100}% 0 0)`,width:"100%",height:"100%"};default:return{width:"100%",height:"100%"}}}import{AbsoluteFill as c8,interpolate as m,Sequence as u,useCurrentFrame as M8,useVideoConfig as o8}from"remotion";import{jsx as q,jsxs as d}from"react/jsx-runtime";var r8=({hook:G,message:K,points:L=[],cta:z="Learn more",ctaUrl:H="contractspec.dev",accentColor:Q})=>{let{durationInFrames:$,width:W,height:U}=o8(),J=Q??P.colors.accent,X=U>W,N=75,B=60,Y=120,Z=$-90;return d(c8,{children:[q(S,{variant:"gradient",showBranding:!0,children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:X?48:32,textAlign:"center",padding:X?"0 20px":0},children:[q(u,{from:0,durationInFrames:105,children:q("div",{style:{width:"100%"},children:q(I,{text:G,variant:"title",enterAt:5,exitAt:75,color:"#ffffff",align:"center"})})}),q(u,{from:60,children:q("div",{style:{width:"100%"},children:q(I,{text:K,variant:X?"subheading":"heading",enterAt:0,color:"#ffffff",align:"center"})})}),L.length>0&&q(u,{from:120,children:q("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:X?"flex-start":"center",width:"100%",maxWidth:X?"100%":"80%",marginTop:16},children:L.map((k,E)=>q(a8,{text:k,index:E,startFrame:E*15,accent:J},k))})}),q(u,{from:Z,children:q(n8,{cta:z,url:H,accent:J})})]})}),q(T,{color:J})]})},a8=({text:G,startFrame:K,accent:L})=>{let z=M8(),H=m(z,[K,K+12],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),Q=m(z,[K,K+15],[-30,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.entrance});return d("div",{style:{opacity:H,transform:`translateX(${Q}px)`,display:"flex",alignItems:"center",gap:16,fontSize:28,color:"#ffffff"},children:[q("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:L,flexShrink:0}}),G]})},n8=({cta:G,url:K,accent:L})=>{let z=M8(),H=m(z,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),Q=m(z,[0,18],[0.9,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:R.emphasis});return d("div",{style:{opacity:H,transform:`scale(${Q})`,display:"flex",flexDirection:"column",alignItems:"center",gap:12,marginTop:24},children:[q("div",{style:{backgroundColor:L,color:"#ffffff",padding:"16px 48px",borderRadius:12,fontSize:28,fontWeight:600},children:G}),q("div",{style:{color:"rgba(255,255,255,0.5)",fontSize:20},children:K})]})};import{AbsoluteFill as i8,Sequence as Y8,useVideoConfig as s8}from"remotion";import{jsx as D,jsxs as e}from"react/jsx-runtime";var t8=({title:G,subtitle:K,lines:L,terminalTitle:z="Terminal",prompt:H="$ ",summary:Q})=>{let{durationInFrames:$}=s8(),W=P,U=40,M=$-90;return e(i8,{children:[D(S,{variant:"dark",showBranding:!0,children:e("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:24},children:[e("div",{children:[D(I,{text:G,variant:"heading",enterAt:5,color:"#ffffff"}),K&&D("div",{style:{marginTop:8},children:D(I,{text:K,variant:"body",enterAt:15,color:W.colors.mutedForeground})})]}),D(Y8,{from:40,children:D("div",{style:{flex:1},children:D(t,{lines:L,startAt:0,prompt:H,title:z})})}),Q&&D(Y8,{from:M,children:D("div",{style:{marginTop:"auto",paddingTop:24},children:D(I,{text:Q,variant:"subheading",enterAt:0,color:W.colors.accent,align:"center"})})})]})}),D(T,{})]})};import{defineTranslation as e8}from"@contractspec/lib.contracts-spec/translations";var G8=e8({meta:{key:"video-gen.messages",version:"1.0.0",domain:"video-gen",description:"All user-facing, LLM-facing, and developer-facing strings for the video-gen package",owners:["platform"],stability:"experimental"},locale:"en",fallback:"en",messages:{"prompt.script.system":{value:`You are a video narration script writer.
|
|
1139
2
|
Write a narration script for a short video (30-60 seconds).
|
|
1140
3
|
{styleGuide}
|
|
1141
4
|
|
|
@@ -1146,12 +9,7 @@ Return JSON with shape:
|
|
|
1146
9
|
}
|
|
1147
10
|
|
|
1148
11
|
Scene IDs should be: "intro", "problems", "solutions", "metrics", "cta".
|
|
1149
|
-
Only include segments that are relevant to the brief content.`,
|
|
1150
|
-
description: "Script generator LLM system prompt",
|
|
1151
|
-
placeholders: [{ name: "styleGuide", type: "string" }]
|
|
1152
|
-
},
|
|
1153
|
-
"prompt.scenePlanner.system": {
|
|
1154
|
-
value: `You are a video scene planner for ContractSpec marketing/documentation videos.
|
|
12
|
+
Only include segments that are relevant to the brief content.`,description:"Script generator LLM system prompt",placeholders:[{name:"styleGuide",type:"string"}]},"prompt.scenePlanner.system":{value:`You are a video scene planner for ContractSpec marketing/documentation videos.
|
|
1155
13
|
Given a content brief, break it into video scenes.
|
|
1156
14
|
|
|
1157
15
|
Each scene must have:
|
|
@@ -1167,125 +25,7 @@ Return a JSON object with shape:
|
|
|
1167
25
|
}
|
|
1168
26
|
|
|
1169
27
|
Keep the total duration around {targetSeconds} seconds.
|
|
1170
|
-
Prioritize clarity and pacing. Each scene should communicate one idea.`,
|
|
1171
|
-
description: "Scene planner LLM system prompt",
|
|
1172
|
-
placeholders: [
|
|
1173
|
-
{ name: "fps", type: "number" },
|
|
1174
|
-
{ name: "targetSeconds", type: "number" }
|
|
1175
|
-
]
|
|
1176
|
-
},
|
|
1177
|
-
"prompt.style.professional": {
|
|
1178
|
-
value: "Use a clear, authoritative, professional tone. Be concise and direct.",
|
|
1179
|
-
description: "Style guide for professional narration"
|
|
1180
|
-
},
|
|
1181
|
-
"prompt.style.casual": {
|
|
1182
|
-
value: "Use a friendly, conversational tone. Be approachable and relatable.",
|
|
1183
|
-
description: "Style guide for casual narration"
|
|
1184
|
-
},
|
|
1185
|
-
"prompt.style.technical": {
|
|
1186
|
-
value: "Use precise technical language. Be detailed and accurate.",
|
|
1187
|
-
description: "Style guide for technical narration"
|
|
1188
|
-
},
|
|
1189
|
-
"script.segment.challenge": {
|
|
1190
|
-
value: "The challenge: {content}",
|
|
1191
|
-
description: "Narration segment prefix for problems",
|
|
1192
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1193
|
-
},
|
|
1194
|
-
"script.segment.solution": {
|
|
1195
|
-
value: "The solution: {content}",
|
|
1196
|
-
description: "Narration segment prefix for solutions",
|
|
1197
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1198
|
-
},
|
|
1199
|
-
"script.segment.results": {
|
|
1200
|
-
value: "The results: {content}",
|
|
1201
|
-
description: "Narration segment prefix for metrics",
|
|
1202
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1203
|
-
},
|
|
1204
|
-
"scene.cta.default": {
|
|
1205
|
-
value: "Learn more",
|
|
1206
|
-
description: "Default call-to-action text for scenes"
|
|
1207
|
-
},
|
|
1208
|
-
"scene.hook.problem": {
|
|
1209
|
-
value: "The Problem",
|
|
1210
|
-
description: "Scene hook label for problem statement"
|
|
1211
|
-
},
|
|
1212
|
-
"scene.narration.problem": {
|
|
1213
|
-
value: "The problem: {content}",
|
|
1214
|
-
description: "Scene narration for problem statement",
|
|
1215
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1216
|
-
},
|
|
1217
|
-
"scene.hook.solution": {
|
|
1218
|
-
value: "The Solution",
|
|
1219
|
-
description: "Scene hook label for solution"
|
|
1220
|
-
},
|
|
1221
|
-
"scene.narration.solution": {
|
|
1222
|
-
value: "The solution: {content}",
|
|
1223
|
-
description: "Scene narration for solution",
|
|
1224
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1225
|
-
},
|
|
1226
|
-
"scene.hook.results": {
|
|
1227
|
-
value: "Results",
|
|
1228
|
-
description: "Scene hook label for results/metrics"
|
|
1229
|
-
},
|
|
1230
|
-
"composition.apiOverview.generates": {
|
|
1231
|
-
value: "Generates:",
|
|
1232
|
-
description: "ApiOverview heading for generated outputs"
|
|
1233
|
-
},
|
|
1234
|
-
"composition.apiOverview.tagline": {
|
|
1235
|
-
value: "One spec. Every surface.",
|
|
1236
|
-
description: "ApiOverview default tagline"
|
|
1237
|
-
},
|
|
1238
|
-
"composition.apiOverview.output.rest": {
|
|
1239
|
-
value: "REST Endpoint",
|
|
1240
|
-
description: "Generated output label: REST"
|
|
1241
|
-
},
|
|
1242
|
-
"composition.apiOverview.output.graphql": {
|
|
1243
|
-
value: "GraphQL Mutation",
|
|
1244
|
-
description: "Generated output label: GraphQL"
|
|
1245
|
-
},
|
|
1246
|
-
"composition.apiOverview.output.prisma": {
|
|
1247
|
-
value: "Prisma Model",
|
|
1248
|
-
description: "Generated output label: Prisma"
|
|
1249
|
-
},
|
|
1250
|
-
"composition.apiOverview.output.typescript": {
|
|
1251
|
-
value: "TypeScript SDK",
|
|
1252
|
-
description: "Generated output label: TypeScript SDK"
|
|
1253
|
-
},
|
|
1254
|
-
"composition.apiOverview.output.mcp": {
|
|
1255
|
-
value: "MCP Tool",
|
|
1256
|
-
description: "Generated output label: MCP Tool"
|
|
1257
|
-
},
|
|
1258
|
-
"composition.apiOverview.output.openapi": {
|
|
1259
|
-
value: "OpenAPI Spec",
|
|
1260
|
-
description: "Generated output label: OpenAPI"
|
|
1261
|
-
},
|
|
1262
|
-
"composition.socialClip.cta": {
|
|
1263
|
-
value: "Learn more",
|
|
1264
|
-
description: "SocialClip default CTA"
|
|
1265
|
-
},
|
|
1266
|
-
"composition.terminal.title": {
|
|
1267
|
-
value: "Terminal",
|
|
1268
|
-
description: "TerminalDemo default window title"
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
});
|
|
1272
|
-
|
|
1273
|
-
// src/i18n/catalogs/es.ts
|
|
1274
|
-
import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
|
|
1275
|
-
var esMessages = defineTranslation2({
|
|
1276
|
-
meta: {
|
|
1277
|
-
key: "video-gen.messages",
|
|
1278
|
-
version: "1.0.0",
|
|
1279
|
-
domain: "video-gen",
|
|
1280
|
-
description: "Spanish translations for the video-gen package",
|
|
1281
|
-
owners: ["platform"],
|
|
1282
|
-
stability: "experimental"
|
|
1283
|
-
},
|
|
1284
|
-
locale: "es",
|
|
1285
|
-
fallback: "en",
|
|
1286
|
-
messages: {
|
|
1287
|
-
"prompt.script.system": {
|
|
1288
|
-
value: `Eres un redactor de guiones de narración para vídeo.
|
|
28
|
+
Prioritize clarity and pacing. Each scene should communicate one idea.`,description:"Scene planner LLM system prompt",placeholders:[{name:"fps",type:"number"},{name:"targetSeconds",type:"number"}]},"prompt.style.professional":{value:"Use a clear, authoritative, professional tone. Be concise and direct.",description:"Style guide for professional narration"},"prompt.style.casual":{value:"Use a friendly, conversational tone. Be approachable and relatable.",description:"Style guide for casual narration"},"prompt.style.technical":{value:"Use precise technical language. Be detailed and accurate.",description:"Style guide for technical narration"},"script.segment.challenge":{value:"The challenge: {content}",description:"Narration segment prefix for problems",placeholders:[{name:"content",type:"string"}]},"script.segment.solution":{value:"The solution: {content}",description:"Narration segment prefix for solutions",placeholders:[{name:"content",type:"string"}]},"script.segment.results":{value:"The results: {content}",description:"Narration segment prefix for metrics",placeholders:[{name:"content",type:"string"}]},"scene.cta.default":{value:"Learn more",description:"Default call-to-action text for scenes"},"scene.hook.problem":{value:"The Problem",description:"Scene hook label for problem statement"},"scene.narration.problem":{value:"The problem: {content}",description:"Scene narration for problem statement",placeholders:[{name:"content",type:"string"}]},"scene.hook.solution":{value:"The Solution",description:"Scene hook label for solution"},"scene.narration.solution":{value:"The solution: {content}",description:"Scene narration for solution",placeholders:[{name:"content",type:"string"}]},"scene.hook.results":{value:"Results",description:"Scene hook label for results/metrics"},"composition.apiOverview.generates":{value:"Generates:",description:"ApiOverview heading for generated outputs"},"composition.apiOverview.tagline":{value:"One spec. Every surface.",description:"ApiOverview default tagline"},"composition.apiOverview.output.rest":{value:"REST Endpoint",description:"Generated output label: REST"},"composition.apiOverview.output.graphql":{value:"GraphQL Mutation",description:"Generated output label: GraphQL"},"composition.apiOverview.output.prisma":{value:"Prisma Model",description:"Generated output label: Prisma"},"composition.apiOverview.output.typescript":{value:"TypeScript SDK",description:"Generated output label: TypeScript SDK"},"composition.apiOverview.output.mcp":{value:"MCP Tool",description:"Generated output label: MCP Tool"},"composition.apiOverview.output.openapi":{value:"OpenAPI Spec",description:"Generated output label: OpenAPI"},"composition.socialClip.cta":{value:"Learn more",description:"SocialClip default CTA"},"composition.terminal.title":{value:"Terminal",description:"TerminalDemo default window title"}}});import{defineTranslation as G1}from"@contractspec/lib.contracts-spec/translations";var K8=G1({meta:{key:"video-gen.messages",version:"1.0.0",domain:"video-gen",description:"Spanish translations for the video-gen package",owners:["platform"],stability:"experimental"},locale:"es",fallback:"en",messages:{"prompt.script.system":{value:`Eres un redactor de guiones de narración para vídeo.
|
|
1289
29
|
Escribe un guión de narración para un vídeo corto (30-60 segundos).
|
|
1290
30
|
{styleGuide}
|
|
1291
31
|
|
|
@@ -1296,12 +36,7 @@ Devuelve JSON con la forma:
|
|
|
1296
36
|
}
|
|
1297
37
|
|
|
1298
38
|
Los identificadores de escena deben ser: "intro", "problems", "solutions", "metrics", "cta".
|
|
1299
|
-
Incluye solo los segmentos relevantes para el brief.`,
|
|
1300
|
-
description: "Script generator LLM system prompt",
|
|
1301
|
-
placeholders: [{ name: "styleGuide", type: "string" }]
|
|
1302
|
-
},
|
|
1303
|
-
"prompt.scenePlanner.system": {
|
|
1304
|
-
value: `Eres un planificador de escenas de vídeo para vídeos de marketing/documentación de ContractSpec.
|
|
39
|
+
Incluye solo los segmentos relevantes para el brief.`,description:"Script generator LLM system prompt",placeholders:[{name:"styleGuide",type:"string"}]},"prompt.scenePlanner.system":{value:`Eres un planificador de escenas de vídeo para vídeos de marketing/documentación de ContractSpec.
|
|
1305
40
|
Dado un brief de contenido, divídelo en escenas de vídeo.
|
|
1306
41
|
|
|
1307
42
|
Cada escena debe tener:
|
|
@@ -1317,125 +52,7 @@ Devuelve un objeto JSON con la forma:
|
|
|
1317
52
|
}
|
|
1318
53
|
|
|
1319
54
|
Mantén la duración total alrededor de {targetSeconds} segundos.
|
|
1320
|
-
Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
1321
|
-
description: "Scene planner LLM system prompt",
|
|
1322
|
-
placeholders: [
|
|
1323
|
-
{ name: "fps", type: "number" },
|
|
1324
|
-
{ name: "targetSeconds", type: "number" }
|
|
1325
|
-
]
|
|
1326
|
-
},
|
|
1327
|
-
"prompt.style.professional": {
|
|
1328
|
-
value: "Usa un tono claro, autoritario y profesional. Sé conciso y directo.",
|
|
1329
|
-
description: "Style guide for professional narration"
|
|
1330
|
-
},
|
|
1331
|
-
"prompt.style.casual": {
|
|
1332
|
-
value: "Usa un tono amigable y conversacional. Sé accesible y cercano.",
|
|
1333
|
-
description: "Style guide for casual narration"
|
|
1334
|
-
},
|
|
1335
|
-
"prompt.style.technical": {
|
|
1336
|
-
value: "Usa un lenguaje técnico preciso. Sé detallado y exacto.",
|
|
1337
|
-
description: "Style guide for technical narration"
|
|
1338
|
-
},
|
|
1339
|
-
"script.segment.challenge": {
|
|
1340
|
-
value: "El desafío: {content}",
|
|
1341
|
-
description: "Narration segment prefix for problems",
|
|
1342
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1343
|
-
},
|
|
1344
|
-
"script.segment.solution": {
|
|
1345
|
-
value: "La solución: {content}",
|
|
1346
|
-
description: "Narration segment prefix for solutions",
|
|
1347
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1348
|
-
},
|
|
1349
|
-
"script.segment.results": {
|
|
1350
|
-
value: "Los resultados: {content}",
|
|
1351
|
-
description: "Narration segment prefix for metrics",
|
|
1352
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1353
|
-
},
|
|
1354
|
-
"scene.cta.default": {
|
|
1355
|
-
value: "Más información",
|
|
1356
|
-
description: "Default call-to-action text for scenes"
|
|
1357
|
-
},
|
|
1358
|
-
"scene.hook.problem": {
|
|
1359
|
-
value: "El problema",
|
|
1360
|
-
description: "Scene hook label for problem statement"
|
|
1361
|
-
},
|
|
1362
|
-
"scene.narration.problem": {
|
|
1363
|
-
value: "El problema: {content}",
|
|
1364
|
-
description: "Scene narration for problem statement",
|
|
1365
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1366
|
-
},
|
|
1367
|
-
"scene.hook.solution": {
|
|
1368
|
-
value: "La solución",
|
|
1369
|
-
description: "Scene hook label for solution"
|
|
1370
|
-
},
|
|
1371
|
-
"scene.narration.solution": {
|
|
1372
|
-
value: "La solución: {content}",
|
|
1373
|
-
description: "Scene narration for solution",
|
|
1374
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1375
|
-
},
|
|
1376
|
-
"scene.hook.results": {
|
|
1377
|
-
value: "Resultados",
|
|
1378
|
-
description: "Scene hook label for results/metrics"
|
|
1379
|
-
},
|
|
1380
|
-
"composition.apiOverview.generates": {
|
|
1381
|
-
value: "Genera:",
|
|
1382
|
-
description: "ApiOverview heading for generated outputs"
|
|
1383
|
-
},
|
|
1384
|
-
"composition.apiOverview.tagline": {
|
|
1385
|
-
value: "Una spec. Todas las superficies.",
|
|
1386
|
-
description: "ApiOverview default tagline"
|
|
1387
|
-
},
|
|
1388
|
-
"composition.apiOverview.output.rest": {
|
|
1389
|
-
value: "Endpoint REST",
|
|
1390
|
-
description: "Generated output label: REST"
|
|
1391
|
-
},
|
|
1392
|
-
"composition.apiOverview.output.graphql": {
|
|
1393
|
-
value: "Mutación GraphQL",
|
|
1394
|
-
description: "Generated output label: GraphQL"
|
|
1395
|
-
},
|
|
1396
|
-
"composition.apiOverview.output.prisma": {
|
|
1397
|
-
value: "Modelo Prisma",
|
|
1398
|
-
description: "Generated output label: Prisma"
|
|
1399
|
-
},
|
|
1400
|
-
"composition.apiOverview.output.typescript": {
|
|
1401
|
-
value: "SDK TypeScript",
|
|
1402
|
-
description: "Generated output label: TypeScript SDK"
|
|
1403
|
-
},
|
|
1404
|
-
"composition.apiOverview.output.mcp": {
|
|
1405
|
-
value: "Herramienta MCP",
|
|
1406
|
-
description: "Generated output label: MCP Tool"
|
|
1407
|
-
},
|
|
1408
|
-
"composition.apiOverview.output.openapi": {
|
|
1409
|
-
value: "Spec OpenAPI",
|
|
1410
|
-
description: "Generated output label: OpenAPI"
|
|
1411
|
-
},
|
|
1412
|
-
"composition.socialClip.cta": {
|
|
1413
|
-
value: "Más información",
|
|
1414
|
-
description: "SocialClip default CTA"
|
|
1415
|
-
},
|
|
1416
|
-
"composition.terminal.title": {
|
|
1417
|
-
value: "Terminal",
|
|
1418
|
-
description: "TerminalDemo default window title"
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
});
|
|
1422
|
-
|
|
1423
|
-
// src/i18n/catalogs/fr.ts
|
|
1424
|
-
import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
|
|
1425
|
-
var frMessages = defineTranslation3({
|
|
1426
|
-
meta: {
|
|
1427
|
-
key: "video-gen.messages",
|
|
1428
|
-
version: "1.0.0",
|
|
1429
|
-
domain: "video-gen",
|
|
1430
|
-
description: "French translations for the video-gen package",
|
|
1431
|
-
owners: ["platform"],
|
|
1432
|
-
stability: "experimental"
|
|
1433
|
-
},
|
|
1434
|
-
locale: "fr",
|
|
1435
|
-
fallback: "en",
|
|
1436
|
-
messages: {
|
|
1437
|
-
"prompt.script.system": {
|
|
1438
|
-
value: `Vous êtes un rédacteur de scripts de narration vidéo.
|
|
55
|
+
Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,description:"Scene planner LLM system prompt",placeholders:[{name:"fps",type:"number"},{name:"targetSeconds",type:"number"}]},"prompt.style.professional":{value:"Usa un tono claro, autoritario y profesional. Sé conciso y directo.",description:"Style guide for professional narration"},"prompt.style.casual":{value:"Usa un tono amigable y conversacional. Sé accesible y cercano.",description:"Style guide for casual narration"},"prompt.style.technical":{value:"Usa un lenguaje técnico preciso. Sé detallado y exacto.",description:"Style guide for technical narration"},"script.segment.challenge":{value:"El desafío: {content}",description:"Narration segment prefix for problems",placeholders:[{name:"content",type:"string"}]},"script.segment.solution":{value:"La solución: {content}",description:"Narration segment prefix for solutions",placeholders:[{name:"content",type:"string"}]},"script.segment.results":{value:"Los resultados: {content}",description:"Narration segment prefix for metrics",placeholders:[{name:"content",type:"string"}]},"scene.cta.default":{value:"Más información",description:"Default call-to-action text for scenes"},"scene.hook.problem":{value:"El problema",description:"Scene hook label for problem statement"},"scene.narration.problem":{value:"El problema: {content}",description:"Scene narration for problem statement",placeholders:[{name:"content",type:"string"}]},"scene.hook.solution":{value:"La solución",description:"Scene hook label for solution"},"scene.narration.solution":{value:"La solución: {content}",description:"Scene narration for solution",placeholders:[{name:"content",type:"string"}]},"scene.hook.results":{value:"Resultados",description:"Scene hook label for results/metrics"},"composition.apiOverview.generates":{value:"Genera:",description:"ApiOverview heading for generated outputs"},"composition.apiOverview.tagline":{value:"Una spec. Todas las superficies.",description:"ApiOverview default tagline"},"composition.apiOverview.output.rest":{value:"Endpoint REST",description:"Generated output label: REST"},"composition.apiOverview.output.graphql":{value:"Mutación GraphQL",description:"Generated output label: GraphQL"},"composition.apiOverview.output.prisma":{value:"Modelo Prisma",description:"Generated output label: Prisma"},"composition.apiOverview.output.typescript":{value:"SDK TypeScript",description:"Generated output label: TypeScript SDK"},"composition.apiOverview.output.mcp":{value:"Herramienta MCP",description:"Generated output label: MCP Tool"},"composition.apiOverview.output.openapi":{value:"Spec OpenAPI",description:"Generated output label: OpenAPI"},"composition.socialClip.cta":{value:"Más información",description:"SocialClip default CTA"},"composition.terminal.title":{value:"Terminal",description:"TerminalDemo default window title"}}});import{defineTranslation as K1}from"@contractspec/lib.contracts-spec/translations";var L8=K1({meta:{key:"video-gen.messages",version:"1.0.0",domain:"video-gen",description:"French translations for the video-gen package",owners:["platform"],stability:"experimental"},locale:"fr",fallback:"en",messages:{"prompt.script.system":{value:`Vous êtes un rédacteur de scripts de narration vidéo.
|
|
1439
56
|
Écrivez un script de narration pour une courte vidéo (30-60 secondes).
|
|
1440
57
|
{styleGuide}
|
|
1441
58
|
|
|
@@ -1446,12 +63,7 @@ Retournez du JSON avec la forme :
|
|
|
1446
63
|
}
|
|
1447
64
|
|
|
1448
65
|
Les identifiants de scène doivent être : "intro", "problems", "solutions", "metrics", "cta".
|
|
1449
|
-
N'incluez que les segments pertinents au brief.`,
|
|
1450
|
-
description: "Script generator LLM system prompt",
|
|
1451
|
-
placeholders: [{ name: "styleGuide", type: "string" }]
|
|
1452
|
-
},
|
|
1453
|
-
"prompt.scenePlanner.system": {
|
|
1454
|
-
value: `Vous êtes un planificateur de scènes vidéo pour les vidéos marketing/documentation de ContractSpec.
|
|
66
|
+
N'incluez que les segments pertinents au brief.`,description:"Script generator LLM system prompt",placeholders:[{name:"styleGuide",type:"string"}]},"prompt.scenePlanner.system":{value:`Vous êtes un planificateur de scènes vidéo pour les vidéos marketing/documentation de ContractSpec.
|
|
1455
67
|
À partir d'un brief, décomposez-le en scènes vidéo.
|
|
1456
68
|
|
|
1457
69
|
Chaque scène doit avoir :
|
|
@@ -1467,512 +79,4 @@ Retournez un objet JSON avec la forme :
|
|
|
1467
79
|
}
|
|
1468
80
|
|
|
1469
81
|
Gardez la durée totale autour de {targetSeconds} secondes.
|
|
1470
|
-
Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`,
|
|
1471
|
-
description: "Scene planner LLM system prompt",
|
|
1472
|
-
placeholders: [
|
|
1473
|
-
{ name: "fps", type: "number" },
|
|
1474
|
-
{ name: "targetSeconds", type: "number" }
|
|
1475
|
-
]
|
|
1476
|
-
},
|
|
1477
|
-
"prompt.style.professional": {
|
|
1478
|
-
value: "Utilisez un ton clair, autoritaire et professionnel. Soyez concis et direct.",
|
|
1479
|
-
description: "Style guide for professional narration"
|
|
1480
|
-
},
|
|
1481
|
-
"prompt.style.casual": {
|
|
1482
|
-
value: "Utilisez un ton amical et conversationnel. Soyez accessible et proche.",
|
|
1483
|
-
description: "Style guide for casual narration"
|
|
1484
|
-
},
|
|
1485
|
-
"prompt.style.technical": {
|
|
1486
|
-
value: "Utilisez un langage technique précis. Soyez détaillé et exact.",
|
|
1487
|
-
description: "Style guide for technical narration"
|
|
1488
|
-
},
|
|
1489
|
-
"script.segment.challenge": {
|
|
1490
|
-
value: "Le défi : {content}",
|
|
1491
|
-
description: "Narration segment prefix for problems",
|
|
1492
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1493
|
-
},
|
|
1494
|
-
"script.segment.solution": {
|
|
1495
|
-
value: "La solution : {content}",
|
|
1496
|
-
description: "Narration segment prefix for solutions",
|
|
1497
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1498
|
-
},
|
|
1499
|
-
"script.segment.results": {
|
|
1500
|
-
value: "Les résultats : {content}",
|
|
1501
|
-
description: "Narration segment prefix for metrics",
|
|
1502
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1503
|
-
},
|
|
1504
|
-
"scene.cta.default": {
|
|
1505
|
-
value: "En savoir plus",
|
|
1506
|
-
description: "Default call-to-action text for scenes"
|
|
1507
|
-
},
|
|
1508
|
-
"scene.hook.problem": {
|
|
1509
|
-
value: "Le problème",
|
|
1510
|
-
description: "Scene hook label for problem statement"
|
|
1511
|
-
},
|
|
1512
|
-
"scene.narration.problem": {
|
|
1513
|
-
value: "Le problème : {content}",
|
|
1514
|
-
description: "Scene narration for problem statement",
|
|
1515
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1516
|
-
},
|
|
1517
|
-
"scene.hook.solution": {
|
|
1518
|
-
value: "La solution",
|
|
1519
|
-
description: "Scene hook label for solution"
|
|
1520
|
-
},
|
|
1521
|
-
"scene.narration.solution": {
|
|
1522
|
-
value: "La solution : {content}",
|
|
1523
|
-
description: "Scene narration for solution",
|
|
1524
|
-
placeholders: [{ name: "content", type: "string" }]
|
|
1525
|
-
},
|
|
1526
|
-
"scene.hook.results": {
|
|
1527
|
-
value: "Résultats",
|
|
1528
|
-
description: "Scene hook label for results/metrics"
|
|
1529
|
-
},
|
|
1530
|
-
"composition.apiOverview.generates": {
|
|
1531
|
-
value: "Génère :",
|
|
1532
|
-
description: "ApiOverview heading for generated outputs"
|
|
1533
|
-
},
|
|
1534
|
-
"composition.apiOverview.tagline": {
|
|
1535
|
-
value: "Un spec. Toutes les surfaces.",
|
|
1536
|
-
description: "ApiOverview default tagline"
|
|
1537
|
-
},
|
|
1538
|
-
"composition.apiOverview.output.rest": {
|
|
1539
|
-
value: "Endpoint REST",
|
|
1540
|
-
description: "Generated output label: REST"
|
|
1541
|
-
},
|
|
1542
|
-
"composition.apiOverview.output.graphql": {
|
|
1543
|
-
value: "Mutation GraphQL",
|
|
1544
|
-
description: "Generated output label: GraphQL"
|
|
1545
|
-
},
|
|
1546
|
-
"composition.apiOverview.output.prisma": {
|
|
1547
|
-
value: "Modèle Prisma",
|
|
1548
|
-
description: "Generated output label: Prisma"
|
|
1549
|
-
},
|
|
1550
|
-
"composition.apiOverview.output.typescript": {
|
|
1551
|
-
value: "SDK TypeScript",
|
|
1552
|
-
description: "Generated output label: TypeScript SDK"
|
|
1553
|
-
},
|
|
1554
|
-
"composition.apiOverview.output.mcp": {
|
|
1555
|
-
value: "Outil MCP",
|
|
1556
|
-
description: "Generated output label: MCP Tool"
|
|
1557
|
-
},
|
|
1558
|
-
"composition.apiOverview.output.openapi": {
|
|
1559
|
-
value: "Spec OpenAPI",
|
|
1560
|
-
description: "Generated output label: OpenAPI"
|
|
1561
|
-
},
|
|
1562
|
-
"composition.socialClip.cta": {
|
|
1563
|
-
value: "En savoir plus",
|
|
1564
|
-
description: "SocialClip default CTA"
|
|
1565
|
-
},
|
|
1566
|
-
"composition.terminal.title": {
|
|
1567
|
-
value: "Terminal",
|
|
1568
|
-
description: "TerminalDemo default window title"
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
});
|
|
1572
|
-
|
|
1573
|
-
// src/i18n/keys.ts
|
|
1574
|
-
var PROMPT_KEYS = {
|
|
1575
|
-
"prompt.script.system": "prompt.script.system",
|
|
1576
|
-
"prompt.scenePlanner.system": "prompt.scenePlanner.system",
|
|
1577
|
-
"prompt.style.professional": "prompt.style.professional",
|
|
1578
|
-
"prompt.style.casual": "prompt.style.casual",
|
|
1579
|
-
"prompt.style.technical": "prompt.style.technical"
|
|
1580
|
-
};
|
|
1581
|
-
var SCRIPT_KEYS = {
|
|
1582
|
-
"script.segment.challenge": "script.segment.challenge",
|
|
1583
|
-
"script.segment.solution": "script.segment.solution",
|
|
1584
|
-
"script.segment.results": "script.segment.results"
|
|
1585
|
-
};
|
|
1586
|
-
var SCENE_KEYS = {
|
|
1587
|
-
"scene.cta.default": "scene.cta.default",
|
|
1588
|
-
"scene.hook.problem": "scene.hook.problem",
|
|
1589
|
-
"scene.narration.problem": "scene.narration.problem",
|
|
1590
|
-
"scene.hook.solution": "scene.hook.solution",
|
|
1591
|
-
"scene.narration.solution": "scene.narration.solution",
|
|
1592
|
-
"scene.hook.results": "scene.hook.results"
|
|
1593
|
-
};
|
|
1594
|
-
var COMPOSITION_KEYS = {
|
|
1595
|
-
"composition.apiOverview.generates": "composition.apiOverview.generates",
|
|
1596
|
-
"composition.apiOverview.tagline": "composition.apiOverview.tagline",
|
|
1597
|
-
"composition.apiOverview.output.rest": "composition.apiOverview.output.rest",
|
|
1598
|
-
"composition.apiOverview.output.graphql": "composition.apiOverview.output.graphql",
|
|
1599
|
-
"composition.apiOverview.output.prisma": "composition.apiOverview.output.prisma",
|
|
1600
|
-
"composition.apiOverview.output.typescript": "composition.apiOverview.output.typescript",
|
|
1601
|
-
"composition.apiOverview.output.mcp": "composition.apiOverview.output.mcp",
|
|
1602
|
-
"composition.apiOverview.output.openapi": "composition.apiOverview.output.openapi",
|
|
1603
|
-
"composition.socialClip.cta": "composition.socialClip.cta",
|
|
1604
|
-
"composition.terminal.title": "composition.terminal.title"
|
|
1605
|
-
};
|
|
1606
|
-
var I18N_KEYS = {
|
|
1607
|
-
...PROMPT_KEYS,
|
|
1608
|
-
...SCRIPT_KEYS,
|
|
1609
|
-
...SCENE_KEYS,
|
|
1610
|
-
...COMPOSITION_KEYS
|
|
1611
|
-
};
|
|
1612
|
-
|
|
1613
|
-
// src/i18n/locale.ts
|
|
1614
|
-
import {
|
|
1615
|
-
DEFAULT_LOCALE,
|
|
1616
|
-
isSupportedLocale,
|
|
1617
|
-
resolveLocale,
|
|
1618
|
-
SUPPORTED_LOCALES
|
|
1619
|
-
} from "@contractspec/lib.contracts-spec/translations";
|
|
1620
|
-
|
|
1621
|
-
// src/i18n/messages.ts
|
|
1622
|
-
import {
|
|
1623
|
-
createI18nFactory
|
|
1624
|
-
} from "@contractspec/lib.contracts-spec/translations";
|
|
1625
|
-
var factory = createI18nFactory({
|
|
1626
|
-
specKey: "video-gen.messages",
|
|
1627
|
-
catalogs: [enMessages, frMessages, esMessages]
|
|
1628
|
-
});
|
|
1629
|
-
var createVideoGenI18n = factory.create;
|
|
1630
|
-
var getDefaultI18n = factory.getDefault;
|
|
1631
|
-
var resetI18nRegistry = factory.resetRegistry;
|
|
1632
|
-
// src/generators/scene-planner.ts
|
|
1633
|
-
class ScenePlanner {
|
|
1634
|
-
llm;
|
|
1635
|
-
model;
|
|
1636
|
-
temperature;
|
|
1637
|
-
fps;
|
|
1638
|
-
i18n;
|
|
1639
|
-
modelSelector;
|
|
1640
|
-
selectionContext;
|
|
1641
|
-
constructor(options) {
|
|
1642
|
-
this.llm = options?.llm;
|
|
1643
|
-
this.model = options?.model;
|
|
1644
|
-
this.temperature = options?.temperature ?? 0.3;
|
|
1645
|
-
this.fps = options?.fps ?? DEFAULT_FPS;
|
|
1646
|
-
this.i18n = createVideoGenI18n(options?.locale);
|
|
1647
|
-
this.modelSelector = options?.modelSelector;
|
|
1648
|
-
this.selectionContext = options?.selectionContext;
|
|
1649
|
-
}
|
|
1650
|
-
async plan(brief) {
|
|
1651
|
-
if (this.llm) {
|
|
1652
|
-
return this.planWithLlm(brief);
|
|
1653
|
-
}
|
|
1654
|
-
return this.planDeterministic(brief);
|
|
1655
|
-
}
|
|
1656
|
-
planDeterministic(brief) {
|
|
1657
|
-
const { content } = brief;
|
|
1658
|
-
const { t } = this.i18n;
|
|
1659
|
-
const scenes = [];
|
|
1660
|
-
const fps = this.fps;
|
|
1661
|
-
scenes.push({
|
|
1662
|
-
compositionId: "SocialClip",
|
|
1663
|
-
props: {
|
|
1664
|
-
hook: content.title,
|
|
1665
|
-
message: content.summary,
|
|
1666
|
-
points: content.solutions.slice(0, 3),
|
|
1667
|
-
cta: content.callToAction ?? t("scene.cta.default")
|
|
1668
|
-
},
|
|
1669
|
-
durationInFrames: 3 * fps,
|
|
1670
|
-
narrationText: `${content.title}. ${content.summary}`
|
|
1671
|
-
});
|
|
1672
|
-
if (content.problems.length > 0) {
|
|
1673
|
-
scenes.push({
|
|
1674
|
-
compositionId: "SocialClip",
|
|
1675
|
-
props: {
|
|
1676
|
-
hook: t("scene.hook.problem"),
|
|
1677
|
-
message: content.problems[0] ?? "",
|
|
1678
|
-
points: content.problems.slice(1, 4)
|
|
1679
|
-
},
|
|
1680
|
-
durationInFrames: 4 * fps,
|
|
1681
|
-
narrationText: t("scene.narration.problem", {
|
|
1682
|
-
content: content.problems.join(". ")
|
|
1683
|
-
})
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1686
|
-
if (content.solutions.length > 0) {
|
|
1687
|
-
scenes.push({
|
|
1688
|
-
compositionId: "SocialClip",
|
|
1689
|
-
props: {
|
|
1690
|
-
hook: t("scene.hook.solution"),
|
|
1691
|
-
message: content.solutions[0] ?? "",
|
|
1692
|
-
points: content.solutions.slice(1, 4)
|
|
1693
|
-
},
|
|
1694
|
-
durationInFrames: 5 * fps,
|
|
1695
|
-
narrationText: t("scene.narration.solution", {
|
|
1696
|
-
content: content.solutions.join(". ")
|
|
1697
|
-
})
|
|
1698
|
-
});
|
|
1699
|
-
}
|
|
1700
|
-
if (content.metrics && content.metrics.length > 0) {
|
|
1701
|
-
scenes.push({
|
|
1702
|
-
compositionId: "SocialClip",
|
|
1703
|
-
props: {
|
|
1704
|
-
hook: t("scene.hook.results"),
|
|
1705
|
-
message: content.metrics[0] ?? "",
|
|
1706
|
-
points: content.metrics.slice(1, 3)
|
|
1707
|
-
},
|
|
1708
|
-
durationInFrames: 3 * fps,
|
|
1709
|
-
narrationText: content.metrics.join(". ")
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
if (content.callToAction) {
|
|
1713
|
-
scenes.push({
|
|
1714
|
-
compositionId: "SocialClip",
|
|
1715
|
-
props: {
|
|
1716
|
-
hook: content.callToAction,
|
|
1717
|
-
message: "",
|
|
1718
|
-
cta: content.callToAction
|
|
1719
|
-
},
|
|
1720
|
-
durationInFrames: 2 * fps,
|
|
1721
|
-
narrationText: content.callToAction
|
|
1722
|
-
});
|
|
1723
|
-
}
|
|
1724
|
-
if (brief.targetDurationSeconds) {
|
|
1725
|
-
const targetFrames = brief.targetDurationSeconds * fps;
|
|
1726
|
-
const currentFrames = scenes.reduce((sum, s) => sum + s.durationInFrames, 0);
|
|
1727
|
-
const ratio = targetFrames / currentFrames;
|
|
1728
|
-
for (const scene of scenes) {
|
|
1729
|
-
scene.durationInFrames = Math.round(scene.durationInFrames * ratio);
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
const totalDuration = scenes.reduce((sum, s) => sum + s.durationInFrames, 0);
|
|
1733
|
-
const narrationScript = scenes.filter((s) => s.narrationText).map((s) => s.narrationText).join(" ");
|
|
1734
|
-
return {
|
|
1735
|
-
scenes,
|
|
1736
|
-
estimatedDurationSeconds: totalDuration / fps,
|
|
1737
|
-
narrationScript
|
|
1738
|
-
};
|
|
1739
|
-
}
|
|
1740
|
-
async resolveModel() {
|
|
1741
|
-
if (this.model)
|
|
1742
|
-
return this.model;
|
|
1743
|
-
if (this.modelSelector) {
|
|
1744
|
-
const ctx = this.selectionContext ?? {
|
|
1745
|
-
taskDimension: "reasoning"
|
|
1746
|
-
};
|
|
1747
|
-
const result = await this.modelSelector.select(ctx);
|
|
1748
|
-
return result.modelId;
|
|
1749
|
-
}
|
|
1750
|
-
return;
|
|
1751
|
-
}
|
|
1752
|
-
async planWithLlm(brief) {
|
|
1753
|
-
const { t } = this.i18n;
|
|
1754
|
-
const messages = [
|
|
1755
|
-
{
|
|
1756
|
-
role: "system",
|
|
1757
|
-
content: [
|
|
1758
|
-
{
|
|
1759
|
-
type: "text",
|
|
1760
|
-
text: t("prompt.scenePlanner.system", {
|
|
1761
|
-
fps: this.fps,
|
|
1762
|
-
targetSeconds: brief.targetDurationSeconds ?? 30
|
|
1763
|
-
})
|
|
1764
|
-
}
|
|
1765
|
-
]
|
|
1766
|
-
},
|
|
1767
|
-
{
|
|
1768
|
-
role: "user",
|
|
1769
|
-
content: [
|
|
1770
|
-
{
|
|
1771
|
-
type: "text",
|
|
1772
|
-
text: JSON.stringify(brief.content)
|
|
1773
|
-
}
|
|
1774
|
-
]
|
|
1775
|
-
}
|
|
1776
|
-
];
|
|
1777
|
-
if (!this.llm) {
|
|
1778
|
-
return this.planDeterministic(brief);
|
|
1779
|
-
}
|
|
1780
|
-
try {
|
|
1781
|
-
const model = await this.resolveModel();
|
|
1782
|
-
const response = await this.llm.chat(messages, {
|
|
1783
|
-
model,
|
|
1784
|
-
temperature: this.temperature,
|
|
1785
|
-
responseFormat: "json"
|
|
1786
|
-
});
|
|
1787
|
-
const text = response.message.content.find((p) => p.type === "text");
|
|
1788
|
-
if (!text || text.type !== "text") {
|
|
1789
|
-
return this.planDeterministic(brief);
|
|
1790
|
-
}
|
|
1791
|
-
const parsed = JSON.parse(text.text);
|
|
1792
|
-
const totalDuration = parsed.scenes.reduce((sum, s) => sum + s.durationInFrames, 0);
|
|
1793
|
-
return {
|
|
1794
|
-
scenes: parsed.scenes,
|
|
1795
|
-
estimatedDurationSeconds: totalDuration / this.fps,
|
|
1796
|
-
narrationScript: parsed.narrationScript
|
|
1797
|
-
};
|
|
1798
|
-
} catch {
|
|
1799
|
-
return this.planDeterministic(brief);
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
// src/generators/video-generator.ts
|
|
1805
|
-
import { VIDEO_FORMATS as VIDEO_FORMATS2 } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
1806
|
-
class VideoGenerator {
|
|
1807
|
-
scenePlanner;
|
|
1808
|
-
voice;
|
|
1809
|
-
transcriber;
|
|
1810
|
-
image;
|
|
1811
|
-
fps;
|
|
1812
|
-
constructor(options) {
|
|
1813
|
-
this.fps = options?.fps ?? DEFAULT_FPS;
|
|
1814
|
-
this.voice = options?.voice;
|
|
1815
|
-
this.transcriber = options?.transcriber;
|
|
1816
|
-
this.image = options?.image;
|
|
1817
|
-
this.scenePlanner = new ScenePlanner({
|
|
1818
|
-
llm: options?.llm,
|
|
1819
|
-
model: options?.model,
|
|
1820
|
-
temperature: options?.temperature,
|
|
1821
|
-
fps: this.fps,
|
|
1822
|
-
locale: options?.locale,
|
|
1823
|
-
modelSelector: options?.modelSelector,
|
|
1824
|
-
selectionContext: options?.selectionContext
|
|
1825
|
-
});
|
|
1826
|
-
}
|
|
1827
|
-
async generate(brief) {
|
|
1828
|
-
const scenePlan = await this.scenePlanner.plan(brief);
|
|
1829
|
-
const scenes = scenePlan.scenes.map((planned, i) => ({
|
|
1830
|
-
id: `scene-${i}`,
|
|
1831
|
-
compositionId: planned.compositionId,
|
|
1832
|
-
props: planned.props,
|
|
1833
|
-
durationInFrames: planned.durationInFrames,
|
|
1834
|
-
narrationText: planned.narrationText
|
|
1835
|
-
}));
|
|
1836
|
-
let ttsProject;
|
|
1837
|
-
let narrationAudio;
|
|
1838
|
-
if (brief.narration?.enabled && this.voice) {
|
|
1839
|
-
try {
|
|
1840
|
-
ttsProject = await this.voice.synthesizeForVideo({
|
|
1841
|
-
content: brief.content,
|
|
1842
|
-
scenePlan: {
|
|
1843
|
-
scenes: scenes.map((s) => ({
|
|
1844
|
-
id: s.id,
|
|
1845
|
-
compositionId: s.compositionId,
|
|
1846
|
-
durationInFrames: s.durationInFrames,
|
|
1847
|
-
narrationText: s.narrationText
|
|
1848
|
-
})),
|
|
1849
|
-
estimatedDurationSeconds: scenePlan.estimatedDurationSeconds
|
|
1850
|
-
},
|
|
1851
|
-
voice: { voiceId: brief.narration.voiceId ?? "" },
|
|
1852
|
-
pacing: { strategy: "scene-matched" },
|
|
1853
|
-
fps: this.fps
|
|
1854
|
-
});
|
|
1855
|
-
if (ttsProject.timingMap) {
|
|
1856
|
-
for (const seg of ttsProject.timingMap.segments) {
|
|
1857
|
-
const scene = scenes.find((s) => s.id === seg.sceneId);
|
|
1858
|
-
if (scene) {
|
|
1859
|
-
scene.durationInFrames = seg.recommendedSceneDurationInFrames;
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
if (ttsProject.assembledAudio) {
|
|
1864
|
-
narrationAudio = {
|
|
1865
|
-
data: ttsProject.assembledAudio.data,
|
|
1866
|
-
format: ttsProject.assembledAudio.format === "wav" ? "wav" : "mp3",
|
|
1867
|
-
durationSeconds: (ttsProject.assembledAudio.durationMs ?? 0) / 1000,
|
|
1868
|
-
volume: 1
|
|
1869
|
-
};
|
|
1870
|
-
}
|
|
1871
|
-
} catch {}
|
|
1872
|
-
}
|
|
1873
|
-
let subtitles;
|
|
1874
|
-
if (this.transcriber && ttsProject?.assembledAudio) {
|
|
1875
|
-
try {
|
|
1876
|
-
const transcription = await this.transcriber.transcribe({
|
|
1877
|
-
audio: ttsProject.assembledAudio,
|
|
1878
|
-
subtitleFormat: "vtt"
|
|
1879
|
-
});
|
|
1880
|
-
subtitles = transcription.subtitles;
|
|
1881
|
-
} catch {}
|
|
1882
|
-
}
|
|
1883
|
-
let thumbnail;
|
|
1884
|
-
if (this.image) {
|
|
1885
|
-
try {
|
|
1886
|
-
const thumbProject = await this.image.generate({
|
|
1887
|
-
content: brief.content,
|
|
1888
|
-
purpose: "video-thumbnail",
|
|
1889
|
-
format: "png",
|
|
1890
|
-
style: "photorealistic"
|
|
1891
|
-
});
|
|
1892
|
-
const imageUrl = thumbProject.results?.images[0]?.url;
|
|
1893
|
-
thumbnail = {
|
|
1894
|
-
prompt: thumbProject.prompt.text,
|
|
1895
|
-
...imageUrl ? { imageUrl } : {}
|
|
1896
|
-
};
|
|
1897
|
-
} catch {}
|
|
1898
|
-
}
|
|
1899
|
-
const format = brief.format ?? VIDEO_FORMATS2.landscape;
|
|
1900
|
-
const totalDurationInFrames = scenes.reduce((sum, s) => sum + s.durationInFrames, 0);
|
|
1901
|
-
const project = {
|
|
1902
|
-
id: generateProjectId(),
|
|
1903
|
-
scenes,
|
|
1904
|
-
totalDurationInFrames,
|
|
1905
|
-
fps: this.fps,
|
|
1906
|
-
format,
|
|
1907
|
-
audio: narrationAudio ? { narration: narrationAudio } : undefined,
|
|
1908
|
-
subtitles,
|
|
1909
|
-
voiceTimingMap: ttsProject?.timingMap,
|
|
1910
|
-
thumbnail
|
|
1911
|
-
};
|
|
1912
|
-
return project;
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
function generateProjectId() {
|
|
1916
|
-
const timestamp = Date.now().toString(36);
|
|
1917
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
1918
|
-
return `vp_${timestamp}_${random}`;
|
|
1919
|
-
}
|
|
1920
|
-
// src/renderers/config.ts
|
|
1921
|
-
var defaultRenderConfig = {
|
|
1922
|
-
codec: "h264",
|
|
1923
|
-
outputFormat: "mp4",
|
|
1924
|
-
crf: 18,
|
|
1925
|
-
pixelFormat: "yuv420p"
|
|
1926
|
-
};
|
|
1927
|
-
var codecFormatMap = {
|
|
1928
|
-
h264: "mp4",
|
|
1929
|
-
h265: "mp4",
|
|
1930
|
-
vp8: "webm",
|
|
1931
|
-
vp9: "webm"
|
|
1932
|
-
};
|
|
1933
|
-
var qualityPresets = {
|
|
1934
|
-
draft: { crf: 28, concurrency: 1 },
|
|
1935
|
-
standard: { crf: 18, concurrency: undefined },
|
|
1936
|
-
high: { crf: 12, concurrency: undefined }
|
|
1937
|
-
};
|
|
1938
|
-
function resolveRenderConfig(userConfig, preset) {
|
|
1939
|
-
const presetValues = preset ? qualityPresets[preset] : {};
|
|
1940
|
-
return {
|
|
1941
|
-
...defaultRenderConfig,
|
|
1942
|
-
...presetValues,
|
|
1943
|
-
...userConfig
|
|
1944
|
-
};
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
// src/types.ts
|
|
1948
|
-
import { VIDEO_FORMATS as VIDEO_FORMATS3 } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
1949
|
-
export {
|
|
1950
|
-
videoTypography,
|
|
1951
|
-
videoTransitions,
|
|
1952
|
-
videoSafeZone,
|
|
1953
|
-
videoPositions,
|
|
1954
|
-
videoEasing,
|
|
1955
|
-
videoDurations,
|
|
1956
|
-
scaleTypography,
|
|
1957
|
-
scaleSafeZone,
|
|
1958
|
-
resolveRenderConfig,
|
|
1959
|
-
qualityPresets,
|
|
1960
|
-
getAllFormatVariants,
|
|
1961
|
-
defaultVideoTheme,
|
|
1962
|
-
defaultVideoColors,
|
|
1963
|
-
defaultTokens,
|
|
1964
|
-
defaultRenderConfig,
|
|
1965
|
-
codecFormatMap,
|
|
1966
|
-
VideoGenerator,
|
|
1967
|
-
TerminalDemo,
|
|
1968
|
-
Terminal,
|
|
1969
|
-
SocialClip,
|
|
1970
|
-
SceneTransitionWrapper,
|
|
1971
|
-
ScenePlanner,
|
|
1972
|
-
ProgressBar,
|
|
1973
|
-
DEFAULT_FPS,
|
|
1974
|
-
CodeBlock,
|
|
1975
|
-
BrandFrame,
|
|
1976
|
-
ApiOverview,
|
|
1977
|
-
AnimatedText
|
|
1978
|
-
};
|
|
82
|
+
Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`,description:"Scene planner LLM system prompt",placeholders:[{name:"fps",type:"number"},{name:"targetSeconds",type:"number"}]},"prompt.style.professional":{value:"Utilisez un ton clair, autoritaire et professionnel. Soyez concis et direct.",description:"Style guide for professional narration"},"prompt.style.casual":{value:"Utilisez un ton amical et conversationnel. Soyez accessible et proche.",description:"Style guide for casual narration"},"prompt.style.technical":{value:"Utilisez un langage technique précis. Soyez détaillé et exact.",description:"Style guide for technical narration"},"script.segment.challenge":{value:"Le défi : {content}",description:"Narration segment prefix for problems",placeholders:[{name:"content",type:"string"}]},"script.segment.solution":{value:"La solution : {content}",description:"Narration segment prefix for solutions",placeholders:[{name:"content",type:"string"}]},"script.segment.results":{value:"Les résultats : {content}",description:"Narration segment prefix for metrics",placeholders:[{name:"content",type:"string"}]},"scene.cta.default":{value:"En savoir plus",description:"Default call-to-action text for scenes"},"scene.hook.problem":{value:"Le problème",description:"Scene hook label for problem statement"},"scene.narration.problem":{value:"Le problème : {content}",description:"Scene narration for problem statement",placeholders:[{name:"content",type:"string"}]},"scene.hook.solution":{value:"La solution",description:"Scene hook label for solution"},"scene.narration.solution":{value:"La solution : {content}",description:"Scene narration for solution",placeholders:[{name:"content",type:"string"}]},"scene.hook.results":{value:"Résultats",description:"Scene hook label for results/metrics"},"composition.apiOverview.generates":{value:"Génère :",description:"ApiOverview heading for generated outputs"},"composition.apiOverview.tagline":{value:"Un spec. Toutes les surfaces.",description:"ApiOverview default tagline"},"composition.apiOverview.output.rest":{value:"Endpoint REST",description:"Generated output label: REST"},"composition.apiOverview.output.graphql":{value:"Mutation GraphQL",description:"Generated output label: GraphQL"},"composition.apiOverview.output.prisma":{value:"Modèle Prisma",description:"Generated output label: Prisma"},"composition.apiOverview.output.typescript":{value:"SDK TypeScript",description:"Generated output label: TypeScript SDK"},"composition.apiOverview.output.mcp":{value:"Outil MCP",description:"Generated output label: MCP Tool"},"composition.apiOverview.output.openapi":{value:"Spec OpenAPI",description:"Generated output label: OpenAPI"},"composition.socialClip.cta":{value:"En savoir plus",description:"SocialClip default CTA"},"composition.terminal.title":{value:"Terminal",description:"TerminalDemo default window title"}}});var R8={"prompt.script.system":"prompt.script.system","prompt.scenePlanner.system":"prompt.scenePlanner.system","prompt.style.professional":"prompt.style.professional","prompt.style.casual":"prompt.style.casual","prompt.style.technical":"prompt.style.technical"},B8={"script.segment.challenge":"script.segment.challenge","script.segment.solution":"script.segment.solution","script.segment.results":"script.segment.results"},Z8={"scene.cta.default":"scene.cta.default","scene.hook.problem":"scene.hook.problem","scene.narration.problem":"scene.narration.problem","scene.hook.solution":"scene.hook.solution","scene.narration.solution":"scene.narration.solution","scene.hook.results":"scene.hook.results"},_8={"composition.apiOverview.generates":"composition.apiOverview.generates","composition.apiOverview.tagline":"composition.apiOverview.tagline","composition.apiOverview.output.rest":"composition.apiOverview.output.rest","composition.apiOverview.output.graphql":"composition.apiOverview.output.graphql","composition.apiOverview.output.prisma":"composition.apiOverview.output.prisma","composition.apiOverview.output.typescript":"composition.apiOverview.output.typescript","composition.apiOverview.output.mcp":"composition.apiOverview.output.mcp","composition.apiOverview.output.openapi":"composition.apiOverview.output.openapi","composition.socialClip.cta":"composition.socialClip.cta","composition.terminal.title":"composition.terminal.title"},L1={...R8,...B8,...Z8,..._8};import{DEFAULT_LOCALE as z1,isSupportedLocale as H1,resolveLocale as J1,SUPPORTED_LOCALES as Q1}from"@contractspec/lib.contracts-spec/translations";import{createI18nFactory as $1}from"@contractspec/lib.contracts-spec/translations";var z8=$1({specKey:"video-gen.messages",catalogs:[G8,L8,K8]}),H8=z8.create,W1=z8.getDefault,X1=z8.resetRegistry;class l{llm;model;temperature;fps;i18n;modelSelector;selectionContext;constructor(G){this.llm=G?.llm,this.model=G?.model,this.temperature=G?.temperature??0.3,this.fps=G?.fps??j,this.i18n=H8(G?.locale),this.modelSelector=G?.modelSelector,this.selectionContext=G?.selectionContext}async plan(G){if(this.llm)return this.planWithLlm(G);return this.planDeterministic(G)}planDeterministic(G){let{content:K}=G,{t:L}=this.i18n,z=[],H=this.fps;if(z.push({compositionId:"SocialClip",props:{hook:K.title,message:K.summary,points:K.solutions.slice(0,3),cta:K.callToAction??L("scene.cta.default")},durationInFrames:3*H,narrationText:`${K.title}. ${K.summary}`}),K.problems.length>0)z.push({compositionId:"SocialClip",props:{hook:L("scene.hook.problem"),message:K.problems[0]??"",points:K.problems.slice(1,4)},durationInFrames:4*H,narrationText:L("scene.narration.problem",{content:K.problems.join(". ")})});if(K.solutions.length>0)z.push({compositionId:"SocialClip",props:{hook:L("scene.hook.solution"),message:K.solutions[0]??"",points:K.solutions.slice(1,4)},durationInFrames:5*H,narrationText:L("scene.narration.solution",{content:K.solutions.join(". ")})});if(K.metrics&&K.metrics.length>0)z.push({compositionId:"SocialClip",props:{hook:L("scene.hook.results"),message:K.metrics[0]??"",points:K.metrics.slice(1,3)},durationInFrames:3*H,narrationText:K.metrics.join(". ")});if(K.callToAction)z.push({compositionId:"SocialClip",props:{hook:K.callToAction,message:"",cta:K.callToAction},durationInFrames:2*H,narrationText:K.callToAction});if(G.targetDurationSeconds){let W=G.targetDurationSeconds*H,U=z.reduce((J,X)=>J+X.durationInFrames,0),M=W/U;for(let J of z)J.durationInFrames=Math.round(J.durationInFrames*M)}let Q=z.reduce((W,U)=>W+U.durationInFrames,0),$=z.filter((W)=>W.narrationText).map((W)=>W.narrationText).join(" ");return{scenes:z,estimatedDurationSeconds:Q/H,narrationScript:$}}async resolveModel(){if(this.model)return this.model;if(this.modelSelector){let G=this.selectionContext??{taskDimension:"reasoning"};return(await this.modelSelector.select(G)).modelId}return}async planWithLlm(G){let{t:K}=this.i18n,L=[{role:"system",content:[{type:"text",text:K("prompt.scenePlanner.system",{fps:this.fps,targetSeconds:G.targetDurationSeconds??30})}]},{role:"user",content:[{type:"text",text:JSON.stringify(G.content)}]}];if(!this.llm)return this.planDeterministic(G);try{let z=await this.resolveModel(),Q=(await this.llm.chat(L,{model:z,temperature:this.temperature,responseFormat:"json"})).message.content.find((U)=>U.type==="text");if(!Q||Q.type!=="text")return this.planDeterministic(G);let $=JSON.parse(Q.text),W=$.scenes.reduce((U,M)=>U+M.durationInFrames,0);return{scenes:$.scenes,estimatedDurationSeconds:W/this.fps,narrationScript:$.narrationScript}}catch{return this.planDeterministic(G)}}}import{VIDEO_FORMATS as U1}from"@contractspec/lib.contracts-integrations/integrations/providers/video";class q8{scenePlanner;voice;transcriber;image;fps;constructor(G){this.fps=G?.fps??j,this.voice=G?.voice,this.transcriber=G?.transcriber,this.image=G?.image,this.scenePlanner=new l({llm:G?.llm,model:G?.model,temperature:G?.temperature,fps:this.fps,locale:G?.locale,modelSelector:G?.modelSelector,selectionContext:G?.selectionContext})}async generate(G){let K=await this.scenePlanner.plan(G),L=K.scenes.map((J,X)=>({id:`scene-${X}`,compositionId:J.compositionId,props:J.props,durationInFrames:J.durationInFrames,narrationText:J.narrationText})),z,H;if(G.narration?.enabled&&this.voice)try{if(z=await this.voice.synthesizeForVideo({content:G.content,scenePlan:{scenes:L.map((J)=>({id:J.id,compositionId:J.compositionId,durationInFrames:J.durationInFrames,narrationText:J.narrationText})),estimatedDurationSeconds:K.estimatedDurationSeconds},voice:{voiceId:G.narration.voiceId??""},pacing:{strategy:"scene-matched"},fps:this.fps}),z.timingMap)for(let J of z.timingMap.segments){let X=L.find((N)=>N.id===J.sceneId);if(X)X.durationInFrames=J.recommendedSceneDurationInFrames}if(z.assembledAudio)H={data:z.assembledAudio.data,format:z.assembledAudio.format==="wav"?"wav":"mp3",durationSeconds:(z.assembledAudio.durationMs??0)/1000,volume:1}}catch{}let Q;if(this.transcriber&&z?.assembledAudio)try{Q=(await this.transcriber.transcribe({audio:z.assembledAudio,subtitleFormat:"vtt"})).subtitles}catch{}let $;if(this.image)try{let J=await this.image.generate({content:G.content,purpose:"video-thumbnail",format:"png",style:"photorealistic"}),X=J.results?.images[0]?.url;$={prompt:J.prompt.text,...X?{imageUrl:X}:{}}}catch{}let W=G.format??U1.landscape,U=L.reduce((J,X)=>J+X.durationInFrames,0);return{id:N1(),scenes:L,totalDurationInFrames:U,fps:this.fps,format:W,audio:H?{narration:H}:void 0,subtitles:Q,voiceTimingMap:z?.timingMap,thumbnail:$}}}function N1(){let G=Date.now().toString(36),K=Math.random().toString(36).slice(2,8);return`vp_${G}_${K}`}var I8={codec:"h264",outputFormat:"mp4",crf:18,pixelFormat:"yuv420p"},M1={h264:"mp4",h265:"mp4",vp8:"webm",vp9:"webm"},D8={draft:{crf:28,concurrency:1},standard:{crf:18,concurrency:void 0},high:{crf:12,concurrency:void 0}};function Y1(G,K){let L=K?D8[K]:{};return{...I8,...L,...G}}import{VIDEO_FORMATS as kK}from"@contractspec/lib.contracts-integrations/integrations/providers/video";export{C as videoTypography,_1 as videoTransitions,x as videoSafeZone,T1 as videoPositions,R as videoEasing,V as videoDurations,v as scaleTypography,J8 as scaleSafeZone,Y1 as resolveRenderConfig,D8 as qualityPresets,C1 as getAllFormatVariants,P as defaultVideoTheme,y as defaultVideoColors,b as defaultTokens,I8 as defaultRenderConfig,M1 as codecFormatMap,q8 as VideoGenerator,t8 as TerminalDemo,t as Terminal,r8 as SocialClip,m8 as SceneTransitionWrapper,l as ScenePlanner,T as ProgressBar,j as DEFAULT_FPS,n as CodeBlock,S as BrandFrame,h8 as ApiOverview,I as AnimatedText};
|