@contractspec/lib.video-gen 2.7.5 → 2.7.7
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/README.md +67 -25
- package/dist/browser/compositions/api-overview.js +114 -114
- package/dist/browser/compositions/index.js +115 -115
- package/dist/browser/compositions/primitives/index.js +113 -113
- package/dist/browser/compositions/social-clip.js +114 -114
- package/dist/browser/compositions/terminal-demo.js +113 -113
- package/dist/browser/design/index.js +35 -35
- package/dist/browser/generators/index.js +94 -94
- package/dist/browser/generators/scene-planner.js +94 -94
- package/dist/browser/generators/script-generator.js +94 -94
- package/dist/browser/generators/video-generator.js +94 -94
- package/dist/browser/i18n/catalogs/index.js +74 -74
- package/dist/browser/i18n/index.js +94 -94
- package/dist/browser/i18n/locale.js +2 -2
- package/dist/browser/i18n/messages.js +74 -74
- package/dist/browser/index.js +212 -212
- package/dist/browser/player/demo-player.js +116 -116
- package/dist/browser/player/index.js +116 -116
- package/dist/browser/remotion/Root.js +115 -115
- package/dist/browser/remotion/index.js +115 -115
- package/dist/compositions/api-overview.js +114 -114
- package/dist/compositions/index.d.ts +4 -4
- package/dist/compositions/index.js +115 -115
- package/dist/compositions/primitives/animated-text.d.ts +1 -1
- package/dist/compositions/primitives/brand-frame.d.ts +1 -1
- package/dist/compositions/primitives/index.d.ts +8 -8
- package/dist/compositions/primitives/index.js +113 -113
- package/dist/compositions/primitives/transition.d.ts +1 -1
- package/dist/compositions/social-clip.js +114 -114
- package/dist/compositions/terminal-demo.js +113 -113
- package/dist/design/index.d.ts +2 -2
- package/dist/design/index.js +35 -35
- package/dist/generators/index.d.ts +2 -2
- package/dist/generators/index.js +94 -94
- package/dist/generators/scene-planner.d.ts +1 -1
- package/dist/generators/scene-planner.js +94 -94
- package/dist/generators/script-generator.d.ts +2 -2
- package/dist/generators/script-generator.js +94 -94
- package/dist/generators/video-generator.js +94 -94
- package/dist/i18n/catalogs/index.d.ts +1 -1
- package/dist/i18n/catalogs/index.js +74 -74
- package/dist/i18n/index.d.ts +7 -7
- package/dist/i18n/index.js +94 -94
- package/dist/i18n/locale.d.ts +1 -1
- package/dist/i18n/locale.js +2 -2
- package/dist/i18n/messages.js +74 -74
- package/dist/index.d.ts +3 -3
- package/dist/index.js +212 -212
- package/dist/node/compositions/api-overview.js +114 -114
- package/dist/node/compositions/index.js +115 -115
- package/dist/node/compositions/primitives/index.js +113 -113
- package/dist/node/compositions/social-clip.js +114 -114
- package/dist/node/compositions/terminal-demo.js +113 -113
- package/dist/node/design/index.js +35 -35
- package/dist/node/generators/index.js +94 -94
- package/dist/node/generators/scene-planner.js +94 -94
- package/dist/node/generators/script-generator.js +94 -94
- package/dist/node/generators/video-generator.js +94 -94
- package/dist/node/i18n/catalogs/index.js +74 -74
- package/dist/node/i18n/index.js +94 -94
- package/dist/node/i18n/locale.js +2 -2
- package/dist/node/i18n/messages.js +74 -74
- package/dist/node/index.js +212 -212
- package/dist/node/player/demo-player.js +116 -116
- package/dist/node/player/index.js +116 -116
- package/dist/node/remotion/Root.js +115 -115
- package/dist/node/remotion/index.js +115 -115
- package/dist/player/demo-player.js +116 -116
- package/dist/player/index.d.ts +1 -1
- package/dist/player/index.js +116 -116
- package/dist/remotion/Root.js +115 -115
- package/dist/remotion/index.js +115 -115
- package/dist/renderers/index.d.ts +2 -2
- package/dist/types.d.ts +6 -6
- package/package.json +18 -18
package/dist/node/index.js
CHANGED
|
@@ -48,6 +48,109 @@ var defaultVideoTheme = {
|
|
|
48
48
|
video: defaultVideoColors
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
// src/design/typography.ts
|
|
52
|
+
var videoTypography = {
|
|
53
|
+
title: {
|
|
54
|
+
fontSize: 72,
|
|
55
|
+
lineHeight: 1.1,
|
|
56
|
+
fontWeight: 700,
|
|
57
|
+
letterSpacing: -1
|
|
58
|
+
},
|
|
59
|
+
heading: {
|
|
60
|
+
fontSize: 56,
|
|
61
|
+
lineHeight: 1.2,
|
|
62
|
+
fontWeight: 600,
|
|
63
|
+
letterSpacing: -0.5
|
|
64
|
+
},
|
|
65
|
+
subheading: {
|
|
66
|
+
fontSize: 40,
|
|
67
|
+
lineHeight: 1.25,
|
|
68
|
+
fontWeight: 500
|
|
69
|
+
},
|
|
70
|
+
body: {
|
|
71
|
+
fontSize: 32,
|
|
72
|
+
lineHeight: 1.5,
|
|
73
|
+
fontWeight: 400
|
|
74
|
+
},
|
|
75
|
+
code: {
|
|
76
|
+
fontSize: 28,
|
|
77
|
+
lineHeight: 1.6,
|
|
78
|
+
fontWeight: 400
|
|
79
|
+
},
|
|
80
|
+
caption: {
|
|
81
|
+
fontSize: 24,
|
|
82
|
+
lineHeight: 1.4,
|
|
83
|
+
fontWeight: 400
|
|
84
|
+
},
|
|
85
|
+
label: {
|
|
86
|
+
fontSize: 20,
|
|
87
|
+
lineHeight: 1.3,
|
|
88
|
+
fontWeight: 600,
|
|
89
|
+
letterSpacing: 1
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
function scaleTypography(style, targetWidth) {
|
|
93
|
+
const scale = targetWidth / 1920;
|
|
94
|
+
return {
|
|
95
|
+
...style,
|
|
96
|
+
fontSize: Math.round(style.fontSize * scale),
|
|
97
|
+
letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/compositions/primitives/animated-text.tsx
|
|
102
|
+
import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
|
|
103
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
104
|
+
var AnimatedText = ({
|
|
105
|
+
text,
|
|
106
|
+
variant = "body",
|
|
107
|
+
style: styleOverride,
|
|
108
|
+
enterAt = 0,
|
|
109
|
+
exitAt,
|
|
110
|
+
color = "#ffffff",
|
|
111
|
+
align = "left"
|
|
112
|
+
}) => {
|
|
113
|
+
const frame = useCurrentFrame();
|
|
114
|
+
const { width } = useVideoConfig();
|
|
115
|
+
const baseStyle = videoTypography[variant];
|
|
116
|
+
const scaled = scaleTypography(baseStyle, width);
|
|
117
|
+
const finalStyle = { ...scaled, ...styleOverride };
|
|
118
|
+
const enterProgress = interpolate(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
119
|
+
const enterOpacity = interpolate(enterProgress, [0, 1], [0, 1], {
|
|
120
|
+
easing: videoEasing.entrance
|
|
121
|
+
});
|
|
122
|
+
const enterTranslateY = interpolate(enterProgress, [0, 1], [30, 0], {
|
|
123
|
+
easing: videoEasing.entrance
|
|
124
|
+
});
|
|
125
|
+
let exitOpacity = 1;
|
|
126
|
+
let exitTranslateY = 0;
|
|
127
|
+
if (exitAt !== undefined) {
|
|
128
|
+
const exitProgress = interpolate(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
129
|
+
exitOpacity = interpolate(exitProgress, [0, 1], [1, 0], {
|
|
130
|
+
easing: videoEasing.exit
|
|
131
|
+
});
|
|
132
|
+
exitTranslateY = interpolate(exitProgress, [0, 1], [0, -20], {
|
|
133
|
+
easing: videoEasing.exit
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const opacity = enterOpacity * exitOpacity;
|
|
137
|
+
const translateY = enterTranslateY + exitTranslateY;
|
|
138
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
139
|
+
style: {
|
|
140
|
+
fontSize: finalStyle.fontSize,
|
|
141
|
+
lineHeight: finalStyle.lineHeight,
|
|
142
|
+
fontWeight: finalStyle.fontWeight,
|
|
143
|
+
letterSpacing: finalStyle.letterSpacing,
|
|
144
|
+
color,
|
|
145
|
+
textAlign: align,
|
|
146
|
+
opacity,
|
|
147
|
+
transform: `translateY(${translateY}px)`,
|
|
148
|
+
willChange: "opacity, transform"
|
|
149
|
+
},
|
|
150
|
+
children: text
|
|
151
|
+
}, undefined, false, undefined, this);
|
|
152
|
+
};
|
|
153
|
+
|
|
51
154
|
// src/design/layouts.ts
|
|
52
155
|
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
53
156
|
var DEFAULT_FPS = 30;
|
|
@@ -84,8 +187,8 @@ function getAllFormatVariants() {
|
|
|
84
187
|
}
|
|
85
188
|
|
|
86
189
|
// src/compositions/primitives/brand-frame.tsx
|
|
87
|
-
import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
|
|
88
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
190
|
+
import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
|
|
191
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
89
192
|
var BrandFrame = ({
|
|
90
193
|
styleOverrides,
|
|
91
194
|
showBranding = true,
|
|
@@ -93,8 +196,8 @@ var BrandFrame = ({
|
|
|
93
196
|
variant = "gradient",
|
|
94
197
|
children
|
|
95
198
|
}) => {
|
|
96
|
-
const frame =
|
|
97
|
-
const { width, height } =
|
|
199
|
+
const frame = useCurrentFrame2();
|
|
200
|
+
const { width, height } = useVideoConfig2();
|
|
98
201
|
const theme = defaultVideoTheme;
|
|
99
202
|
const safeZone = scaleSafeZone({ type: "custom", width, height });
|
|
100
203
|
const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
|
|
@@ -112,16 +215,16 @@ var BrandFrame = ({
|
|
|
112
215
|
background = "#000000";
|
|
113
216
|
break;
|
|
114
217
|
}
|
|
115
|
-
const entranceOpacity = animateEntrance ?
|
|
218
|
+
const entranceOpacity = animateEntrance ? interpolate2(frame, [0, 15], [0, 1], {
|
|
116
219
|
extrapolateLeft: "clamp",
|
|
117
220
|
extrapolateRight: "clamp",
|
|
118
221
|
easing: videoEasing.entrance
|
|
119
222
|
}) : 1;
|
|
120
|
-
const brandOpacity = showBranding ?
|
|
223
|
+
const brandOpacity = showBranding ? interpolate2(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
|
|
121
224
|
extrapolateLeft: "clamp",
|
|
122
225
|
extrapolateRight: "clamp"
|
|
123
226
|
}) : 0;
|
|
124
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
125
228
|
style: {
|
|
126
229
|
width,
|
|
127
230
|
height,
|
|
@@ -131,7 +234,7 @@ var BrandFrame = ({
|
|
|
131
234
|
opacity: entranceOpacity
|
|
132
235
|
},
|
|
133
236
|
children: [
|
|
134
|
-
variant === "gradient" && /* @__PURE__ */
|
|
237
|
+
variant === "gradient" && /* @__PURE__ */ jsxDEV2("div", {
|
|
135
238
|
style: {
|
|
136
239
|
position: "absolute",
|
|
137
240
|
top: "-20%",
|
|
@@ -143,7 +246,7 @@ var BrandFrame = ({
|
|
|
143
246
|
pointerEvents: "none"
|
|
144
247
|
}
|
|
145
248
|
}, undefined, false, undefined, this),
|
|
146
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
147
250
|
style: {
|
|
148
251
|
position: "absolute",
|
|
149
252
|
left: safeZone.horizontal,
|
|
@@ -155,7 +258,7 @@ var BrandFrame = ({
|
|
|
155
258
|
},
|
|
156
259
|
children
|
|
157
260
|
}, undefined, false, undefined, this),
|
|
158
|
-
showBranding && /* @__PURE__ */
|
|
261
|
+
showBranding && /* @__PURE__ */ jsxDEV2("div", {
|
|
159
262
|
style: {
|
|
160
263
|
position: "absolute",
|
|
161
264
|
bottom: safeZone.vertical / 2,
|
|
@@ -172,109 +275,6 @@ var BrandFrame = ({
|
|
|
172
275
|
}, undefined, true, undefined, this);
|
|
173
276
|
};
|
|
174
277
|
|
|
175
|
-
// src/design/typography.ts
|
|
176
|
-
var videoTypography = {
|
|
177
|
-
title: {
|
|
178
|
-
fontSize: 72,
|
|
179
|
-
lineHeight: 1.1,
|
|
180
|
-
fontWeight: 700,
|
|
181
|
-
letterSpacing: -1
|
|
182
|
-
},
|
|
183
|
-
heading: {
|
|
184
|
-
fontSize: 56,
|
|
185
|
-
lineHeight: 1.2,
|
|
186
|
-
fontWeight: 600,
|
|
187
|
-
letterSpacing: -0.5
|
|
188
|
-
},
|
|
189
|
-
subheading: {
|
|
190
|
-
fontSize: 40,
|
|
191
|
-
lineHeight: 1.25,
|
|
192
|
-
fontWeight: 500
|
|
193
|
-
},
|
|
194
|
-
body: {
|
|
195
|
-
fontSize: 32,
|
|
196
|
-
lineHeight: 1.5,
|
|
197
|
-
fontWeight: 400
|
|
198
|
-
},
|
|
199
|
-
code: {
|
|
200
|
-
fontSize: 28,
|
|
201
|
-
lineHeight: 1.6,
|
|
202
|
-
fontWeight: 400
|
|
203
|
-
},
|
|
204
|
-
caption: {
|
|
205
|
-
fontSize: 24,
|
|
206
|
-
lineHeight: 1.4,
|
|
207
|
-
fontWeight: 400
|
|
208
|
-
},
|
|
209
|
-
label: {
|
|
210
|
-
fontSize: 20,
|
|
211
|
-
lineHeight: 1.3,
|
|
212
|
-
fontWeight: 600,
|
|
213
|
-
letterSpacing: 1
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
function scaleTypography(style, targetWidth) {
|
|
217
|
-
const scale = targetWidth / 1920;
|
|
218
|
-
return {
|
|
219
|
-
...style,
|
|
220
|
-
fontSize: Math.round(style.fontSize * scale),
|
|
221
|
-
letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// src/compositions/primitives/animated-text.tsx
|
|
226
|
-
import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
|
|
227
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
228
|
-
var AnimatedText = ({
|
|
229
|
-
text,
|
|
230
|
-
variant = "body",
|
|
231
|
-
style: styleOverride,
|
|
232
|
-
enterAt = 0,
|
|
233
|
-
exitAt,
|
|
234
|
-
color = "#ffffff",
|
|
235
|
-
align = "left"
|
|
236
|
-
}) => {
|
|
237
|
-
const frame = useCurrentFrame2();
|
|
238
|
-
const { width } = useVideoConfig2();
|
|
239
|
-
const baseStyle = videoTypography[variant];
|
|
240
|
-
const scaled = scaleTypography(baseStyle, width);
|
|
241
|
-
const finalStyle = { ...scaled, ...styleOverride };
|
|
242
|
-
const enterProgress = interpolate2(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
243
|
-
const enterOpacity = interpolate2(enterProgress, [0, 1], [0, 1], {
|
|
244
|
-
easing: videoEasing.entrance
|
|
245
|
-
});
|
|
246
|
-
const enterTranslateY = interpolate2(enterProgress, [0, 1], [30, 0], {
|
|
247
|
-
easing: videoEasing.entrance
|
|
248
|
-
});
|
|
249
|
-
let exitOpacity = 1;
|
|
250
|
-
let exitTranslateY = 0;
|
|
251
|
-
if (exitAt !== undefined) {
|
|
252
|
-
const exitProgress = interpolate2(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
253
|
-
exitOpacity = interpolate2(exitProgress, [0, 1], [1, 0], {
|
|
254
|
-
easing: videoEasing.exit
|
|
255
|
-
});
|
|
256
|
-
exitTranslateY = interpolate2(exitProgress, [0, 1], [0, -20], {
|
|
257
|
-
easing: videoEasing.exit
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
const opacity = enterOpacity * exitOpacity;
|
|
261
|
-
const translateY = enterTranslateY + exitTranslateY;
|
|
262
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
263
|
-
style: {
|
|
264
|
-
fontSize: finalStyle.fontSize,
|
|
265
|
-
lineHeight: finalStyle.lineHeight,
|
|
266
|
-
fontWeight: finalStyle.fontWeight,
|
|
267
|
-
letterSpacing: finalStyle.letterSpacing,
|
|
268
|
-
color,
|
|
269
|
-
textAlign: align,
|
|
270
|
-
opacity,
|
|
271
|
-
transform: `translateY(${translateY}px)`,
|
|
272
|
-
willChange: "opacity, transform"
|
|
273
|
-
},
|
|
274
|
-
children: text
|
|
275
|
-
}, undefined, false, undefined, this);
|
|
276
|
-
};
|
|
277
|
-
|
|
278
278
|
// src/compositions/primitives/code-block.tsx
|
|
279
279
|
import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
|
|
280
280
|
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
@@ -430,8 +430,8 @@ var ProgressBar = ({
|
|
|
430
430
|
// src/compositions/api-overview.tsx
|
|
431
431
|
import {
|
|
432
432
|
AbsoluteFill,
|
|
433
|
-
Sequence,
|
|
434
433
|
interpolate as interpolate4,
|
|
434
|
+
Sequence,
|
|
435
435
|
useCurrentFrame as useCurrentFrame5,
|
|
436
436
|
useVideoConfig as useVideoConfig5
|
|
437
437
|
} from "remotion";
|
|
@@ -853,8 +853,8 @@ function getTransitionStyles(type, progress) {
|
|
|
853
853
|
// src/compositions/social-clip.tsx
|
|
854
854
|
import {
|
|
855
855
|
AbsoluteFill as AbsoluteFill2,
|
|
856
|
-
Sequence as Sequence2,
|
|
857
856
|
interpolate as interpolate7,
|
|
857
|
+
Sequence as Sequence2,
|
|
858
858
|
useCurrentFrame as useCurrentFrame8,
|
|
859
859
|
useVideoConfig as useVideoConfig7
|
|
860
860
|
} from "remotion";
|
|
@@ -1265,54 +1265,54 @@ Prioritize clarity and pacing. Each scene should communicate one idea.`,
|
|
|
1265
1265
|
}
|
|
1266
1266
|
});
|
|
1267
1267
|
|
|
1268
|
-
// src/i18n/catalogs/
|
|
1268
|
+
// src/i18n/catalogs/es.ts
|
|
1269
1269
|
import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
|
|
1270
|
-
var
|
|
1270
|
+
var esMessages = defineTranslation2({
|
|
1271
1271
|
meta: {
|
|
1272
1272
|
key: "video-gen.messages",
|
|
1273
1273
|
version: "1.0.0",
|
|
1274
1274
|
domain: "video-gen",
|
|
1275
|
-
description: "
|
|
1275
|
+
description: "Spanish translations for the video-gen package",
|
|
1276
1276
|
owners: ["platform"],
|
|
1277
1277
|
stability: "experimental"
|
|
1278
1278
|
},
|
|
1279
|
-
locale: "
|
|
1279
|
+
locale: "es",
|
|
1280
1280
|
fallback: "en",
|
|
1281
1281
|
messages: {
|
|
1282
1282
|
"prompt.script.system": {
|
|
1283
|
-
value: `
|
|
1284
|
-
|
|
1283
|
+
value: `Eres un redactor de guiones de narración para vídeo.
|
|
1284
|
+
Escribe un guión de narración para un vídeo corto (30-60 segundos).
|
|
1285
1285
|
{styleGuide}
|
|
1286
1286
|
|
|
1287
|
-
|
|
1287
|
+
Devuelve JSON con la forma:
|
|
1288
1288
|
{
|
|
1289
1289
|
"segments": [{ "sceneId": string, "text": string }],
|
|
1290
1290
|
"fullText": string
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1293
|
+
Los identificadores de escena deben ser: "intro", "problems", "solutions", "metrics", "cta".
|
|
1294
|
+
Incluye solo los segmentos relevantes para el brief.`,
|
|
1295
1295
|
description: "Script generator LLM system prompt",
|
|
1296
1296
|
placeholders: [{ name: "styleGuide", type: "string" }]
|
|
1297
1297
|
},
|
|
1298
1298
|
"prompt.scenePlanner.system": {
|
|
1299
|
-
value: `
|
|
1300
|
-
|
|
1299
|
+
value: `Eres un planificador de escenas de vídeo para vídeos de marketing/documentación de ContractSpec.
|
|
1300
|
+
Dado un brief de contenido, divídelo en escenas de vídeo.
|
|
1301
1301
|
|
|
1302
|
-
|
|
1303
|
-
- compositionId
|
|
1304
|
-
- props
|
|
1305
|
-
- durationInFrames
|
|
1306
|
-
- narrationText
|
|
1302
|
+
Cada escena debe tener:
|
|
1303
|
+
- compositionId: uno de "ApiOverview", "SocialClip", "TerminalDemo"
|
|
1304
|
+
- props: las propiedades de entrada de esa composición
|
|
1305
|
+
- durationInFrames: duración a {fps} fps
|
|
1306
|
+
- narrationText: lo que dice el narrador durante esta escena
|
|
1307
1307
|
|
|
1308
|
-
|
|
1308
|
+
Devuelve un objeto JSON con la forma:
|
|
1309
1309
|
{
|
|
1310
1310
|
"scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
|
|
1311
1311
|
"narrationScript": string
|
|
1312
1312
|
}
|
|
1313
1313
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1314
|
+
Mantén la duración total alrededor de {targetSeconds} segundos.
|
|
1315
|
+
Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
1316
1316
|
description: "Scene planner LLM system prompt",
|
|
1317
1317
|
placeholders: [
|
|
1318
1318
|
{ name: "fps", type: "number" },
|
|
@@ -1320,64 +1320,64 @@ Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`
|
|
|
1320
1320
|
]
|
|
1321
1321
|
},
|
|
1322
1322
|
"prompt.style.professional": {
|
|
1323
|
-
value: "
|
|
1323
|
+
value: "Usa un tono claro, autoritario y profesional. Sé conciso y directo.",
|
|
1324
1324
|
description: "Style guide for professional narration"
|
|
1325
1325
|
},
|
|
1326
1326
|
"prompt.style.casual": {
|
|
1327
|
-
value: "
|
|
1327
|
+
value: "Usa un tono amigable y conversacional. Sé accesible y cercano.",
|
|
1328
1328
|
description: "Style guide for casual narration"
|
|
1329
1329
|
},
|
|
1330
1330
|
"prompt.style.technical": {
|
|
1331
|
-
value: "
|
|
1331
|
+
value: "Usa un lenguaje técnico preciso. Sé detallado y exacto.",
|
|
1332
1332
|
description: "Style guide for technical narration"
|
|
1333
1333
|
},
|
|
1334
1334
|
"script.segment.challenge": {
|
|
1335
|
-
value: "
|
|
1335
|
+
value: "El desafío: {content}",
|
|
1336
1336
|
description: "Narration segment prefix for problems",
|
|
1337
1337
|
placeholders: [{ name: "content", type: "string" }]
|
|
1338
1338
|
},
|
|
1339
1339
|
"script.segment.solution": {
|
|
1340
|
-
value: "La
|
|
1340
|
+
value: "La solución: {content}",
|
|
1341
1341
|
description: "Narration segment prefix for solutions",
|
|
1342
1342
|
placeholders: [{ name: "content", type: "string" }]
|
|
1343
1343
|
},
|
|
1344
1344
|
"script.segment.results": {
|
|
1345
|
-
value: "
|
|
1345
|
+
value: "Los resultados: {content}",
|
|
1346
1346
|
description: "Narration segment prefix for metrics",
|
|
1347
1347
|
placeholders: [{ name: "content", type: "string" }]
|
|
1348
1348
|
},
|
|
1349
1349
|
"scene.cta.default": {
|
|
1350
|
-
value: "
|
|
1350
|
+
value: "Más información",
|
|
1351
1351
|
description: "Default call-to-action text for scenes"
|
|
1352
1352
|
},
|
|
1353
1353
|
"scene.hook.problem": {
|
|
1354
|
-
value: "
|
|
1354
|
+
value: "El problema",
|
|
1355
1355
|
description: "Scene hook label for problem statement"
|
|
1356
1356
|
},
|
|
1357
1357
|
"scene.narration.problem": {
|
|
1358
|
-
value: "
|
|
1358
|
+
value: "El problema: {content}",
|
|
1359
1359
|
description: "Scene narration for problem statement",
|
|
1360
1360
|
placeholders: [{ name: "content", type: "string" }]
|
|
1361
1361
|
},
|
|
1362
1362
|
"scene.hook.solution": {
|
|
1363
|
-
value: "La
|
|
1363
|
+
value: "La solución",
|
|
1364
1364
|
description: "Scene hook label for solution"
|
|
1365
1365
|
},
|
|
1366
1366
|
"scene.narration.solution": {
|
|
1367
|
-
value: "La
|
|
1367
|
+
value: "La solución: {content}",
|
|
1368
1368
|
description: "Scene narration for solution",
|
|
1369
1369
|
placeholders: [{ name: "content", type: "string" }]
|
|
1370
1370
|
},
|
|
1371
1371
|
"scene.hook.results": {
|
|
1372
|
-
value: "
|
|
1372
|
+
value: "Resultados",
|
|
1373
1373
|
description: "Scene hook label for results/metrics"
|
|
1374
1374
|
},
|
|
1375
1375
|
"composition.apiOverview.generates": {
|
|
1376
|
-
value: "
|
|
1376
|
+
value: "Genera:",
|
|
1377
1377
|
description: "ApiOverview heading for generated outputs"
|
|
1378
1378
|
},
|
|
1379
1379
|
"composition.apiOverview.tagline": {
|
|
1380
|
-
value: "
|
|
1380
|
+
value: "Una spec. Todas las superficies.",
|
|
1381
1381
|
description: "ApiOverview default tagline"
|
|
1382
1382
|
},
|
|
1383
1383
|
"composition.apiOverview.output.rest": {
|
|
@@ -1385,11 +1385,11 @@ Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`
|
|
|
1385
1385
|
description: "Generated output label: REST"
|
|
1386
1386
|
},
|
|
1387
1387
|
"composition.apiOverview.output.graphql": {
|
|
1388
|
-
value: "
|
|
1388
|
+
value: "Mutación GraphQL",
|
|
1389
1389
|
description: "Generated output label: GraphQL"
|
|
1390
1390
|
},
|
|
1391
1391
|
"composition.apiOverview.output.prisma": {
|
|
1392
|
-
value: "
|
|
1392
|
+
value: "Modelo Prisma",
|
|
1393
1393
|
description: "Generated output label: Prisma"
|
|
1394
1394
|
},
|
|
1395
1395
|
"composition.apiOverview.output.typescript": {
|
|
@@ -1397,7 +1397,7 @@ Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`
|
|
|
1397
1397
|
description: "Generated output label: TypeScript SDK"
|
|
1398
1398
|
},
|
|
1399
1399
|
"composition.apiOverview.output.mcp": {
|
|
1400
|
-
value: "
|
|
1400
|
+
value: "Herramienta MCP",
|
|
1401
1401
|
description: "Generated output label: MCP Tool"
|
|
1402
1402
|
},
|
|
1403
1403
|
"composition.apiOverview.output.openapi": {
|
|
@@ -1405,7 +1405,7 @@ Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`
|
|
|
1405
1405
|
description: "Generated output label: OpenAPI"
|
|
1406
1406
|
},
|
|
1407
1407
|
"composition.socialClip.cta": {
|
|
1408
|
-
value: "
|
|
1408
|
+
value: "Más información",
|
|
1409
1409
|
description: "SocialClip default CTA"
|
|
1410
1410
|
},
|
|
1411
1411
|
"composition.terminal.title": {
|
|
@@ -1415,54 +1415,54 @@ Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`
|
|
|
1415
1415
|
}
|
|
1416
1416
|
});
|
|
1417
1417
|
|
|
1418
|
-
// src/i18n/catalogs/
|
|
1418
|
+
// src/i18n/catalogs/fr.ts
|
|
1419
1419
|
import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
|
|
1420
|
-
var
|
|
1420
|
+
var frMessages = defineTranslation3({
|
|
1421
1421
|
meta: {
|
|
1422
1422
|
key: "video-gen.messages",
|
|
1423
1423
|
version: "1.0.0",
|
|
1424
1424
|
domain: "video-gen",
|
|
1425
|
-
description: "
|
|
1425
|
+
description: "French translations for the video-gen package",
|
|
1426
1426
|
owners: ["platform"],
|
|
1427
1427
|
stability: "experimental"
|
|
1428
1428
|
},
|
|
1429
|
-
locale: "
|
|
1429
|
+
locale: "fr",
|
|
1430
1430
|
fallback: "en",
|
|
1431
1431
|
messages: {
|
|
1432
1432
|
"prompt.script.system": {
|
|
1433
|
-
value: `
|
|
1434
|
-
|
|
1433
|
+
value: `Vous êtes un rédacteur de scripts de narration vidéo.
|
|
1434
|
+
Écrivez un script de narration pour une courte vidéo (30-60 secondes).
|
|
1435
1435
|
{styleGuide}
|
|
1436
1436
|
|
|
1437
|
-
|
|
1437
|
+
Retournez du JSON avec la forme :
|
|
1438
1438
|
{
|
|
1439
1439
|
"segments": [{ "sceneId": string, "text": string }],
|
|
1440
1440
|
"fullText": string
|
|
1441
1441
|
}
|
|
1442
1442
|
|
|
1443
|
-
|
|
1444
|
-
|
|
1443
|
+
Les identifiants de scène doivent être : "intro", "problems", "solutions", "metrics", "cta".
|
|
1444
|
+
N'incluez que les segments pertinents au brief.`,
|
|
1445
1445
|
description: "Script generator LLM system prompt",
|
|
1446
1446
|
placeholders: [{ name: "styleGuide", type: "string" }]
|
|
1447
1447
|
},
|
|
1448
1448
|
"prompt.scenePlanner.system": {
|
|
1449
|
-
value: `
|
|
1450
|
-
|
|
1449
|
+
value: `Vous êtes un planificateur de scènes vidéo pour les vidéos marketing/documentation de ContractSpec.
|
|
1450
|
+
À partir d'un brief, décomposez-le en scènes vidéo.
|
|
1451
1451
|
|
|
1452
|
-
|
|
1453
|
-
- compositionId:
|
|
1454
|
-
- props:
|
|
1455
|
-
- durationInFrames:
|
|
1456
|
-
- narrationText:
|
|
1452
|
+
Chaque scène doit avoir :
|
|
1453
|
+
- compositionId : un parmi "ApiOverview", "SocialClip", "TerminalDemo"
|
|
1454
|
+
- props : les propriétés d'entrée de cette composition
|
|
1455
|
+
- durationInFrames : durée à {fps} fps
|
|
1456
|
+
- narrationText : ce que le narrateur dit pendant cette scène
|
|
1457
1457
|
|
|
1458
|
-
|
|
1458
|
+
Retournez un objet JSON avec la forme :
|
|
1459
1459
|
{
|
|
1460
1460
|
"scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
|
|
1461
1461
|
"narrationScript": string
|
|
1462
1462
|
}
|
|
1463
1463
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1464
|
+
Gardez la durée totale autour de {targetSeconds} secondes.
|
|
1465
|
+
Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`,
|
|
1466
1466
|
description: "Scene planner LLM system prompt",
|
|
1467
1467
|
placeholders: [
|
|
1468
1468
|
{ name: "fps", type: "number" },
|
|
@@ -1470,64 +1470,64 @@ Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
|
1470
1470
|
]
|
|
1471
1471
|
},
|
|
1472
1472
|
"prompt.style.professional": {
|
|
1473
|
-
value: "
|
|
1473
|
+
value: "Utilisez un ton clair, autoritaire et professionnel. Soyez concis et direct.",
|
|
1474
1474
|
description: "Style guide for professional narration"
|
|
1475
1475
|
},
|
|
1476
1476
|
"prompt.style.casual": {
|
|
1477
|
-
value: "
|
|
1477
|
+
value: "Utilisez un ton amical et conversationnel. Soyez accessible et proche.",
|
|
1478
1478
|
description: "Style guide for casual narration"
|
|
1479
1479
|
},
|
|
1480
1480
|
"prompt.style.technical": {
|
|
1481
|
-
value: "
|
|
1481
|
+
value: "Utilisez un langage technique précis. Soyez détaillé et exact.",
|
|
1482
1482
|
description: "Style guide for technical narration"
|
|
1483
1483
|
},
|
|
1484
1484
|
"script.segment.challenge": {
|
|
1485
|
-
value: "
|
|
1485
|
+
value: "Le défi : {content}",
|
|
1486
1486
|
description: "Narration segment prefix for problems",
|
|
1487
1487
|
placeholders: [{ name: "content", type: "string" }]
|
|
1488
1488
|
},
|
|
1489
1489
|
"script.segment.solution": {
|
|
1490
|
-
value: "La
|
|
1490
|
+
value: "La solution : {content}",
|
|
1491
1491
|
description: "Narration segment prefix for solutions",
|
|
1492
1492
|
placeholders: [{ name: "content", type: "string" }]
|
|
1493
1493
|
},
|
|
1494
1494
|
"script.segment.results": {
|
|
1495
|
-
value: "
|
|
1495
|
+
value: "Les résultats : {content}",
|
|
1496
1496
|
description: "Narration segment prefix for metrics",
|
|
1497
1497
|
placeholders: [{ name: "content", type: "string" }]
|
|
1498
1498
|
},
|
|
1499
1499
|
"scene.cta.default": {
|
|
1500
|
-
value: "
|
|
1500
|
+
value: "En savoir plus",
|
|
1501
1501
|
description: "Default call-to-action text for scenes"
|
|
1502
1502
|
},
|
|
1503
1503
|
"scene.hook.problem": {
|
|
1504
|
-
value: "
|
|
1504
|
+
value: "Le problème",
|
|
1505
1505
|
description: "Scene hook label for problem statement"
|
|
1506
1506
|
},
|
|
1507
1507
|
"scene.narration.problem": {
|
|
1508
|
-
value: "
|
|
1508
|
+
value: "Le problème : {content}",
|
|
1509
1509
|
description: "Scene narration for problem statement",
|
|
1510
1510
|
placeholders: [{ name: "content", type: "string" }]
|
|
1511
1511
|
},
|
|
1512
1512
|
"scene.hook.solution": {
|
|
1513
|
-
value: "La
|
|
1513
|
+
value: "La solution",
|
|
1514
1514
|
description: "Scene hook label for solution"
|
|
1515
1515
|
},
|
|
1516
1516
|
"scene.narration.solution": {
|
|
1517
|
-
value: "La
|
|
1517
|
+
value: "La solution : {content}",
|
|
1518
1518
|
description: "Scene narration for solution",
|
|
1519
1519
|
placeholders: [{ name: "content", type: "string" }]
|
|
1520
1520
|
},
|
|
1521
1521
|
"scene.hook.results": {
|
|
1522
|
-
value: "
|
|
1522
|
+
value: "Résultats",
|
|
1523
1523
|
description: "Scene hook label for results/metrics"
|
|
1524
1524
|
},
|
|
1525
1525
|
"composition.apiOverview.generates": {
|
|
1526
|
-
value: "
|
|
1526
|
+
value: "Génère :",
|
|
1527
1527
|
description: "ApiOverview heading for generated outputs"
|
|
1528
1528
|
},
|
|
1529
1529
|
"composition.apiOverview.tagline": {
|
|
1530
|
-
value: "
|
|
1530
|
+
value: "Un spec. Toutes les surfaces.",
|
|
1531
1531
|
description: "ApiOverview default tagline"
|
|
1532
1532
|
},
|
|
1533
1533
|
"composition.apiOverview.output.rest": {
|
|
@@ -1535,11 +1535,11 @@ Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
|
1535
1535
|
description: "Generated output label: REST"
|
|
1536
1536
|
},
|
|
1537
1537
|
"composition.apiOverview.output.graphql": {
|
|
1538
|
-
value: "
|
|
1538
|
+
value: "Mutation GraphQL",
|
|
1539
1539
|
description: "Generated output label: GraphQL"
|
|
1540
1540
|
},
|
|
1541
1541
|
"composition.apiOverview.output.prisma": {
|
|
1542
|
-
value: "
|
|
1542
|
+
value: "Modèle Prisma",
|
|
1543
1543
|
description: "Generated output label: Prisma"
|
|
1544
1544
|
},
|
|
1545
1545
|
"composition.apiOverview.output.typescript": {
|
|
@@ -1547,7 +1547,7 @@ Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
|
1547
1547
|
description: "Generated output label: TypeScript SDK"
|
|
1548
1548
|
},
|
|
1549
1549
|
"composition.apiOverview.output.mcp": {
|
|
1550
|
-
value: "
|
|
1550
|
+
value: "Outil MCP",
|
|
1551
1551
|
description: "Generated output label: MCP Tool"
|
|
1552
1552
|
},
|
|
1553
1553
|
"composition.apiOverview.output.openapi": {
|
|
@@ -1555,7 +1555,7 @@ Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
|
1555
1555
|
description: "Generated output label: OpenAPI"
|
|
1556
1556
|
},
|
|
1557
1557
|
"composition.socialClip.cta": {
|
|
1558
|
-
value: "
|
|
1558
|
+
value: "En savoir plus",
|
|
1559
1559
|
description: "SocialClip default CTA"
|
|
1560
1560
|
},
|
|
1561
1561
|
"composition.terminal.title": {
|
|
@@ -1565,26 +1565,6 @@ Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
|
|
|
1565
1565
|
}
|
|
1566
1566
|
});
|
|
1567
1567
|
|
|
1568
|
-
// src/i18n/messages.ts
|
|
1569
|
-
import {
|
|
1570
|
-
createI18nFactory
|
|
1571
|
-
} from "@contractspec/lib.contracts-spec/translations";
|
|
1572
|
-
var factory = createI18nFactory({
|
|
1573
|
-
specKey: "video-gen.messages",
|
|
1574
|
-
catalogs: [enMessages, frMessages, esMessages]
|
|
1575
|
-
});
|
|
1576
|
-
var createVideoGenI18n = factory.create;
|
|
1577
|
-
var getDefaultI18n = factory.getDefault;
|
|
1578
|
-
var resetI18nRegistry = factory.resetRegistry;
|
|
1579
|
-
|
|
1580
|
-
// src/i18n/locale.ts
|
|
1581
|
-
import {
|
|
1582
|
-
DEFAULT_LOCALE,
|
|
1583
|
-
SUPPORTED_LOCALES,
|
|
1584
|
-
resolveLocale,
|
|
1585
|
-
isSupportedLocale
|
|
1586
|
-
} from "@contractspec/lib.contracts-spec/translations";
|
|
1587
|
-
|
|
1588
1568
|
// src/i18n/keys.ts
|
|
1589
1569
|
var PROMPT_KEYS = {
|
|
1590
1570
|
"prompt.script.system": "prompt.script.system",
|
|
@@ -1624,6 +1604,26 @@ var I18N_KEYS = {
|
|
|
1624
1604
|
...SCENE_KEYS,
|
|
1625
1605
|
...COMPOSITION_KEYS
|
|
1626
1606
|
};
|
|
1607
|
+
|
|
1608
|
+
// src/i18n/locale.ts
|
|
1609
|
+
import {
|
|
1610
|
+
DEFAULT_LOCALE,
|
|
1611
|
+
isSupportedLocale,
|
|
1612
|
+
resolveLocale,
|
|
1613
|
+
SUPPORTED_LOCALES
|
|
1614
|
+
} from "@contractspec/lib.contracts-spec/translations";
|
|
1615
|
+
|
|
1616
|
+
// src/i18n/messages.ts
|
|
1617
|
+
import {
|
|
1618
|
+
createI18nFactory
|
|
1619
|
+
} from "@contractspec/lib.contracts-spec/translations";
|
|
1620
|
+
var factory = createI18nFactory({
|
|
1621
|
+
specKey: "video-gen.messages",
|
|
1622
|
+
catalogs: [enMessages, frMessages, esMessages]
|
|
1623
|
+
});
|
|
1624
|
+
var createVideoGenI18n = factory.create;
|
|
1625
|
+
var getDefaultI18n = factory.getDefault;
|
|
1626
|
+
var resetI18nRegistry = factory.resetRegistry;
|
|
1627
1627
|
// src/generators/scene-planner.ts
|
|
1628
1628
|
class ScenePlanner {
|
|
1629
1629
|
llm;
|
|
@@ -1912,9 +1912,6 @@ function generateProjectId() {
|
|
|
1912
1912
|
const random = Math.random().toString(36).slice(2, 8);
|
|
1913
1913
|
return `vp_${timestamp}_${random}`;
|
|
1914
1914
|
}
|
|
1915
|
-
// src/types.ts
|
|
1916
|
-
import { VIDEO_FORMATS as VIDEO_FORMATS3 } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
1917
|
-
|
|
1918
1915
|
// src/renderers/config.ts
|
|
1919
1916
|
var defaultRenderConfig = {
|
|
1920
1917
|
codec: "h264",
|
|
@@ -1941,6 +1938,9 @@ function resolveRenderConfig(userConfig, preset) {
|
|
|
1941
1938
|
...userConfig
|
|
1942
1939
|
};
|
|
1943
1940
|
}
|
|
1941
|
+
|
|
1942
|
+
// src/types.ts
|
|
1943
|
+
import { VIDEO_FORMATS as VIDEO_FORMATS3 } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
1944
1944
|
export {
|
|
1945
1945
|
videoTypography,
|
|
1946
1946
|
videoTransitions,
|