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