@contractspec/lib.video-gen 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/browser/compositions/api-overview.js +645 -0
  2. package/dist/browser/compositions/index.js +1133 -0
  3. package/dist/browser/compositions/primitives/animated-text.js +144 -0
  4. package/dist/browser/compositions/primitives/brand-frame.js +181 -0
  5. package/dist/browser/compositions/primitives/code-block.js +226 -0
  6. package/dist/browser/compositions/primitives/index.js +656 -0
  7. package/dist/browser/compositions/primitives/progress-bar.js +59 -0
  8. package/dist/browser/compositions/primitives/terminal.js +265 -0
  9. package/dist/browser/compositions/primitives/transition.js +98 -0
  10. package/dist/browser/compositions/social-clip.js +500 -0
  11. package/dist/browser/compositions/terminal-demo.js +558 -0
  12. package/dist/browser/design/index.js +155 -0
  13. package/dist/browser/design/layouts.js +50 -0
  14. package/dist/browser/design/motion.js +43 -0
  15. package/dist/browser/design/tokens.js +28 -0
  16. package/dist/browser/design/typography.js +61 -0
  17. package/dist/browser/docs/compositions.docblock.js +182 -0
  18. package/dist/browser/docs/design.docblock.js +187 -0
  19. package/dist/browser/docs/generators.docblock.js +187 -0
  20. package/dist/browser/docs/rendering.docblock.js +197 -0
  21. package/dist/browser/docs/video-gen.docblock.js +141 -0
  22. package/dist/browser/generators/index.js +416 -0
  23. package/dist/browser/generators/scene-planner.js +205 -0
  24. package/dist/browser/generators/script-generator.js +147 -0
  25. package/dist/browser/generators/video-generator.js +414 -0
  26. package/dist/browser/index.js +1550 -0
  27. package/dist/browser/player/demo-player.js +1136 -0
  28. package/dist/browser/player/index.js +1136 -0
  29. package/dist/browser/remotion/Root.js +1189 -0
  30. package/dist/browser/remotion/index.js +1190 -0
  31. package/dist/browser/renderers/config.js +40 -0
  32. package/dist/browser/renderers/index.js +160 -0
  33. package/dist/browser/renderers/local.js +156 -0
  34. package/dist/browser/types.js +13 -0
  35. package/dist/compositions/api-overview.d.ts +16 -0
  36. package/dist/compositions/api-overview.js +640 -0
  37. package/dist/compositions/index.d.ts +7 -0
  38. package/dist/compositions/index.js +1128 -0
  39. package/dist/compositions/primitives/animated-text.d.ts +22 -0
  40. package/dist/compositions/primitives/animated-text.js +139 -0
  41. package/dist/compositions/primitives/brand-frame.d.ts +14 -0
  42. package/dist/compositions/primitives/brand-frame.js +176 -0
  43. package/dist/compositions/primitives/code-block.d.ts +18 -0
  44. package/dist/compositions/primitives/code-block.js +221 -0
  45. package/dist/compositions/primitives/index.d.ts +12 -0
  46. package/dist/compositions/primitives/index.js +651 -0
  47. package/dist/compositions/primitives/progress-bar.d.ts +12 -0
  48. package/dist/compositions/primitives/progress-bar.js +54 -0
  49. package/dist/compositions/primitives/terminal.d.ts +24 -0
  50. package/dist/compositions/primitives/terminal.js +260 -0
  51. package/dist/compositions/primitives/transition.d.ts +14 -0
  52. package/dist/compositions/primitives/transition.js +93 -0
  53. package/dist/compositions/social-clip.d.ts +16 -0
  54. package/dist/compositions/social-clip.js +495 -0
  55. package/dist/compositions/terminal-demo.d.ts +17 -0
  56. package/dist/compositions/terminal-demo.js +553 -0
  57. package/dist/design/index.d.ts +4 -0
  58. package/dist/design/index.js +150 -0
  59. package/dist/design/layouts.d.ts +69 -0
  60. package/dist/design/layouts.js +45 -0
  61. package/dist/design/motion.d.ts +72 -0
  62. package/dist/design/motion.js +38 -0
  63. package/dist/design/tokens.d.ts +31 -0
  64. package/dist/design/tokens.js +23 -0
  65. package/dist/design/typography.d.ts +61 -0
  66. package/dist/design/typography.js +56 -0
  67. package/dist/docs/compositions.docblock.d.ts +1 -0
  68. package/dist/docs/compositions.docblock.js +183 -0
  69. package/dist/docs/design.docblock.d.ts +1 -0
  70. package/dist/docs/design.docblock.js +188 -0
  71. package/dist/docs/generators.docblock.d.ts +1 -0
  72. package/dist/docs/generators.docblock.js +188 -0
  73. package/dist/docs/rendering.docblock.d.ts +1 -0
  74. package/dist/docs/rendering.docblock.js +198 -0
  75. package/dist/docs/video-gen.docblock.d.ts +1 -0
  76. package/dist/docs/video-gen.docblock.js +142 -0
  77. package/dist/generators/index.d.ts +5 -0
  78. package/dist/generators/index.js +411 -0
  79. package/dist/generators/scene-planner.d.ts +23 -0
  80. package/dist/generators/scene-planner.js +200 -0
  81. package/dist/generators/script-generator.d.ts +49 -0
  82. package/dist/generators/script-generator.js +142 -0
  83. package/dist/generators/video-generator.d.ts +20 -0
  84. package/dist/generators/video-generator.js +409 -0
  85. package/dist/index.d.ts +6 -0
  86. package/dist/index.js +1545 -0
  87. package/dist/node/compositions/api-overview.js +640 -0
  88. package/dist/node/compositions/index.js +1128 -0
  89. package/dist/node/compositions/primitives/animated-text.js +139 -0
  90. package/dist/node/compositions/primitives/brand-frame.js +176 -0
  91. package/dist/node/compositions/primitives/code-block.js +221 -0
  92. package/dist/node/compositions/primitives/index.js +651 -0
  93. package/dist/node/compositions/primitives/progress-bar.js +54 -0
  94. package/dist/node/compositions/primitives/terminal.js +260 -0
  95. package/dist/node/compositions/primitives/transition.js +93 -0
  96. package/dist/node/compositions/social-clip.js +495 -0
  97. package/dist/node/compositions/terminal-demo.js +553 -0
  98. package/dist/node/design/index.js +150 -0
  99. package/dist/node/design/layouts.js +45 -0
  100. package/dist/node/design/motion.js +38 -0
  101. package/dist/node/design/tokens.js +23 -0
  102. package/dist/node/design/typography.js +56 -0
  103. package/dist/node/docs/compositions.docblock.js +182 -0
  104. package/dist/node/docs/design.docblock.js +187 -0
  105. package/dist/node/docs/generators.docblock.js +187 -0
  106. package/dist/node/docs/rendering.docblock.js +197 -0
  107. package/dist/node/docs/video-gen.docblock.js +141 -0
  108. package/dist/node/generators/index.js +411 -0
  109. package/dist/node/generators/scene-planner.js +200 -0
  110. package/dist/node/generators/script-generator.js +142 -0
  111. package/dist/node/generators/video-generator.js +409 -0
  112. package/dist/node/index.js +1545 -0
  113. package/dist/node/player/demo-player.js +1131 -0
  114. package/dist/node/player/index.js +1131 -0
  115. package/dist/node/remotion/Root.js +1184 -0
  116. package/dist/node/remotion/index.js +1185 -0
  117. package/dist/node/renderers/config.js +35 -0
  118. package/dist/node/renderers/index.js +155 -0
  119. package/dist/node/renderers/local.js +151 -0
  120. package/dist/node/types.js +8 -0
  121. package/dist/player/demo-player.d.ts +55 -0
  122. package/dist/player/demo-player.js +1131 -0
  123. package/dist/player/index.d.ts +2 -0
  124. package/dist/player/index.js +1131 -0
  125. package/dist/remotion/Root.d.ts +2 -0
  126. package/dist/remotion/Root.js +1184 -0
  127. package/dist/remotion/index.d.ts +1 -0
  128. package/dist/remotion/index.js +1185 -0
  129. package/dist/renderers/config.d.ts +28 -0
  130. package/dist/renderers/config.js +35 -0
  131. package/dist/renderers/index.d.ts +3 -0
  132. package/dist/renderers/index.js +155 -0
  133. package/dist/renderers/local.d.ts +17 -0
  134. package/dist/renderers/local.js +151 -0
  135. package/dist/types.d.ts +63 -0
  136. package/dist/types.js +8 -0
  137. package/package.json +637 -0
@@ -0,0 +1,553 @@
1
+ import { createRequire } from "node:module";
2
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
+
4
+ // src/design/motion.ts
5
+ import { Easing } from "remotion";
6
+ var videoEasing = {
7
+ entrance: Easing.out(Easing.exp),
8
+ exit: Easing.in(Easing.exp),
9
+ emphasis: Easing.out(Easing.back(1.4)),
10
+ linear: Easing.linear,
11
+ gentle: Easing.bezier(0.25, 0.1, 0.25, 1),
12
+ spring: Easing.out(Easing.back(1.7))
13
+ };
14
+ var videoDurations = {
15
+ sceneTransition: 20,
16
+ textEntrance: 15,
17
+ textExit: 12,
18
+ codeTypingPerChar: 2,
19
+ sectionPause: 30,
20
+ emphasisPause: 15,
21
+ brandReveal: 25,
22
+ minScene: 60,
23
+ shortScene: 60,
24
+ mediumScene: 120,
25
+ longScene: 240
26
+ };
27
+ var videoTransitions = {
28
+ fade: { type: "fade", durationInFrames: 20 },
29
+ slideLeft: { type: "slide-left", durationInFrames: 20 },
30
+ slideRight: { type: "slide-right", durationInFrames: 20 },
31
+ wipe: { type: "wipe", durationInFrames: 15 },
32
+ none: { type: "none", durationInFrames: 0 }
33
+ };
34
+
35
+ // src/design/tokens.ts
36
+ import { defaultTokens } from "@contractspec/lib.design-system";
37
+ var defaultVideoColors = {
38
+ canvasBackground: defaultTokens.colors.background,
39
+ codeBackground: "#1e1e2e",
40
+ terminalBackground: "#0d1117",
41
+ terminalForeground: "#c9d1d9",
42
+ highlight: defaultTokens.colors.accent,
43
+ gradientStart: defaultTokens.colors.primary,
44
+ gradientEnd: defaultTokens.colors.accent
45
+ };
46
+ var defaultVideoTheme = {
47
+ ...defaultTokens,
48
+ video: defaultVideoColors
49
+ };
50
+
51
+ // src/design/layouts.ts
52
+ import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
53
+ var DEFAULT_FPS = 30;
54
+ var videoSafeZone = {
55
+ horizontal: 120,
56
+ vertical: 80,
57
+ contentWidth: 1680,
58
+ contentHeight: 920
59
+ };
60
+ function scaleSafeZone(format) {
61
+ const scaleX = format.width / 1920;
62
+ const scaleY = format.height / 1080;
63
+ return {
64
+ horizontal: Math.round(videoSafeZone.horizontal * scaleX),
65
+ vertical: Math.round(videoSafeZone.vertical * scaleY),
66
+ contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
67
+ contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
68
+ };
69
+ }
70
+ var videoPositions = {
71
+ center: { x: 960, y: 540 },
72
+ topLeft: { x: 120, y: 80 },
73
+ topRight: { x: 1800, y: 80 },
74
+ bottomLeft: { x: 120, y: 1000 },
75
+ bottomRight: { x: 1800, y: 1000 },
76
+ bottomCenter: { x: 960, y: 960 }
77
+ };
78
+ function getAllFormatVariants() {
79
+ return [
80
+ VIDEO_FORMATS.landscape,
81
+ VIDEO_FORMATS.square,
82
+ VIDEO_FORMATS.portrait
83
+ ];
84
+ }
85
+
86
+ // src/compositions/primitives/brand-frame.tsx
87
+ import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
88
+ import { jsxDEV } from "react/jsx-dev-runtime";
89
+ var BrandFrame = ({
90
+ styleOverrides,
91
+ showBranding = true,
92
+ animateEntrance = true,
93
+ variant = "gradient",
94
+ children
95
+ }) => {
96
+ const frame = useCurrentFrame();
97
+ const { width, height } = useVideoConfig();
98
+ const theme = defaultVideoTheme;
99
+ const safeZone = scaleSafeZone({ type: "custom", width, height });
100
+ const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
101
+ const _accentColor = styleOverrides?.accentColor ?? theme.colors.accent;
102
+ const isDark = styleOverrides?.darkMode ?? true;
103
+ let background;
104
+ switch (variant) {
105
+ case "solid":
106
+ background = isDark ? "#0a0a0a" : theme.colors.background;
107
+ break;
108
+ case "gradient":
109
+ background = isDark ? `linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)` : `linear-gradient(135deg, ${theme.colors.background} 0%, ${theme.colors.muted} 100%)`;
110
+ break;
111
+ case "dark":
112
+ background = "#000000";
113
+ break;
114
+ }
115
+ const entranceOpacity = animateEntrance ? interpolate(frame, [0, 15], [0, 1], {
116
+ extrapolateLeft: "clamp",
117
+ extrapolateRight: "clamp",
118
+ easing: videoEasing.entrance
119
+ }) : 1;
120
+ const brandOpacity = showBranding ? interpolate(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
121
+ extrapolateLeft: "clamp",
122
+ extrapolateRight: "clamp"
123
+ }) : 0;
124
+ return /* @__PURE__ */ jsxDEV("div", {
125
+ style: {
126
+ width,
127
+ height,
128
+ background,
129
+ position: "relative",
130
+ overflow: "hidden",
131
+ opacity: entranceOpacity
132
+ },
133
+ children: [
134
+ variant === "gradient" && /* @__PURE__ */ jsxDEV("div", {
135
+ style: {
136
+ position: "absolute",
137
+ top: "-20%",
138
+ right: "-10%",
139
+ width: "50%",
140
+ height: "50%",
141
+ background: `radial-gradient(circle, ${primaryColor}15 0%, transparent 70%)`,
142
+ borderRadius: "50%",
143
+ pointerEvents: "none"
144
+ }
145
+ }, undefined, false, undefined, this),
146
+ /* @__PURE__ */ jsxDEV("div", {
147
+ style: {
148
+ position: "absolute",
149
+ left: safeZone.horizontal,
150
+ top: safeZone.vertical,
151
+ width: safeZone.contentWidth,
152
+ height: safeZone.contentHeight,
153
+ display: "flex",
154
+ flexDirection: "column"
155
+ },
156
+ children
157
+ }, undefined, false, undefined, this),
158
+ showBranding && /* @__PURE__ */ jsxDEV("div", {
159
+ style: {
160
+ position: "absolute",
161
+ bottom: safeZone.vertical / 2,
162
+ right: safeZone.horizontal,
163
+ opacity: brandOpacity,
164
+ color: isDark ? "#ffffff" : "#000000",
165
+ fontSize: Math.round(16 * (width / 1920)),
166
+ fontWeight: 500,
167
+ letterSpacing: 1
168
+ },
169
+ children: "ContractSpec"
170
+ }, undefined, false, undefined, this)
171
+ ]
172
+ }, undefined, true, undefined, this);
173
+ };
174
+
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
+ // src/compositions/primitives/progress-bar.tsx
279
+ import { useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
280
+ import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
281
+ var ProgressBar = ({
282
+ height = 4,
283
+ color = defaultVideoTheme.colors.primary,
284
+ backgroundColor = "rgba(255,255,255,0.1)",
285
+ position = "bottom"
286
+ }) => {
287
+ const frame = useCurrentFrame3();
288
+ const { durationInFrames, width } = useVideoConfig3();
289
+ const progress = frame / durationInFrames;
290
+ return /* @__PURE__ */ jsxDEV3("div", {
291
+ style: {
292
+ position: "absolute",
293
+ [position]: 0,
294
+ left: 0,
295
+ width,
296
+ height,
297
+ backgroundColor,
298
+ zIndex: 100
299
+ },
300
+ children: /* @__PURE__ */ jsxDEV3("div", {
301
+ style: {
302
+ width: `${progress * 100}%`,
303
+ height: "100%",
304
+ backgroundColor: color,
305
+ transition: "none"
306
+ }
307
+ }, undefined, false, undefined, this)
308
+ }, undefined, false, undefined, this);
309
+ };
310
+
311
+ // src/compositions/primitives/terminal.tsx
312
+ import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4 } from "remotion";
313
+ import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
314
+ var LINE_TYPE_COLORS = {
315
+ command: "#c9d1d9",
316
+ output: "#8b949e",
317
+ error: "#f85149",
318
+ success: "#3fb950",
319
+ comment: "#6e7681"
320
+ };
321
+ var Terminal = ({
322
+ lines,
323
+ startAt = 0,
324
+ prompt = "$ ",
325
+ title = "Terminal",
326
+ backgroundColor = defaultVideoColors.terminalBackground,
327
+ typingSpeed = videoDurations.codeTypingPerChar
328
+ }) => {
329
+ const frame = useCurrentFrame4();
330
+ const { width } = useVideoConfig4();
331
+ const codeStyle = scaleTypography(videoTypography.code, width);
332
+ const lineTimings = [];
333
+ let currentFrame = startAt;
334
+ for (const line of lines) {
335
+ const delay = line.delay ?? 10;
336
+ const lineStart = currentFrame + delay;
337
+ if (line.type === "command") {
338
+ const typeDuration = line.text.length * typingSpeed;
339
+ lineTimings.push({
340
+ startFrame: lineStart,
341
+ endFrame: lineStart + typeDuration
342
+ });
343
+ currentFrame = lineStart + typeDuration;
344
+ } else {
345
+ lineTimings.push({ startFrame: lineStart, endFrame: lineStart + 5 });
346
+ currentFrame = lineStart + 5;
347
+ }
348
+ }
349
+ const opacity = interpolate3(frame, [startAt, startAt + 10], [0, 1], {
350
+ extrapolateLeft: "clamp",
351
+ extrapolateRight: "clamp",
352
+ easing: videoEasing.entrance
353
+ });
354
+ return /* @__PURE__ */ jsxDEV4("div", {
355
+ style: {
356
+ backgroundColor,
357
+ borderRadius: 16,
358
+ overflow: "hidden",
359
+ opacity,
360
+ boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
361
+ },
362
+ children: [
363
+ /* @__PURE__ */ jsxDEV4("div", {
364
+ style: {
365
+ display: "flex",
366
+ alignItems: "center",
367
+ padding: "12px 20px",
368
+ backgroundColor: "rgba(255,255,255,0.05)",
369
+ gap: 8
370
+ },
371
+ children: [
372
+ /* @__PURE__ */ jsxDEV4("div", {
373
+ style: { display: "flex", gap: 8 },
374
+ children: [
375
+ /* @__PURE__ */ jsxDEV4("div", {
376
+ style: {
377
+ width: 12,
378
+ height: 12,
379
+ borderRadius: "50%",
380
+ backgroundColor: "#ff5f57"
381
+ }
382
+ }, undefined, false, undefined, this),
383
+ /* @__PURE__ */ jsxDEV4("div", {
384
+ style: {
385
+ width: 12,
386
+ height: 12,
387
+ borderRadius: "50%",
388
+ backgroundColor: "#febc2e"
389
+ }
390
+ }, undefined, false, undefined, this),
391
+ /* @__PURE__ */ jsxDEV4("div", {
392
+ style: {
393
+ width: 12,
394
+ height: 12,
395
+ borderRadius: "50%",
396
+ backgroundColor: "#28c840"
397
+ }
398
+ }, undefined, false, undefined, this)
399
+ ]
400
+ }, undefined, true, undefined, this),
401
+ /* @__PURE__ */ jsxDEV4("div", {
402
+ style: {
403
+ flex: 1,
404
+ textAlign: "center",
405
+ color: "#484f58",
406
+ fontSize: codeStyle.fontSize * 0.7,
407
+ fontFamily: "monospace"
408
+ },
409
+ children: title
410
+ }, undefined, false, undefined, this)
411
+ ]
412
+ }, undefined, true, undefined, this),
413
+ /* @__PURE__ */ jsxDEV4("div", {
414
+ style: { padding: "24px 32px", minHeight: 200 },
415
+ children: lines.map((line, i) => {
416
+ const timing = lineTimings[i];
417
+ if (!timing || frame < timing.startFrame)
418
+ return null;
419
+ const isCommand = line.type === "command";
420
+ const lineColor = LINE_TYPE_COLORS[line.type];
421
+ let visibleText = line.text;
422
+ if (isCommand) {
423
+ const typingProgress = interpolate3(frame, [timing.startFrame, timing.endFrame], [0, line.text.length], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
424
+ visibleText = line.text.slice(0, Math.floor(typingProgress));
425
+ }
426
+ const lineOpacity = isCommand ? 1 : interpolate3(frame, [timing.startFrame, timing.startFrame + 5], [0, 1], {
427
+ extrapolateLeft: "clamp",
428
+ extrapolateRight: "clamp"
429
+ });
430
+ const isTyping = isCommand && frame >= timing.startFrame && frame <= timing.endFrame;
431
+ const showCursor = isTyping && frame % 16 < 10;
432
+ return /* @__PURE__ */ jsxDEV4("div", {
433
+ style: {
434
+ fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
435
+ fontSize: codeStyle.fontSize,
436
+ lineHeight: 1.8,
437
+ color: lineColor,
438
+ opacity: lineOpacity,
439
+ whiteSpace: "pre-wrap"
440
+ },
441
+ children: [
442
+ isCommand && /* @__PURE__ */ jsxDEV4("span", {
443
+ style: { color: "#3fb950" },
444
+ children: prompt
445
+ }, undefined, false, undefined, this),
446
+ line.type === "comment" && /* @__PURE__ */ jsxDEV4("span", {
447
+ style: { color: LINE_TYPE_COLORS.comment },
448
+ children: "# "
449
+ }, undefined, false, undefined, this),
450
+ visibleText,
451
+ showCursor && /* @__PURE__ */ jsxDEV4("span", {
452
+ style: {
453
+ backgroundColor: "#c9d1d9",
454
+ width: "2px",
455
+ display: "inline-block",
456
+ height: "1.2em",
457
+ verticalAlign: "text-bottom"
458
+ },
459
+ children: " "
460
+ }, undefined, false, undefined, this)
461
+ ]
462
+ }, `${i}-${line.text.slice(0, 20)}`, true, undefined, this);
463
+ })
464
+ }, undefined, false, undefined, this)
465
+ ]
466
+ }, undefined, true, undefined, this);
467
+ };
468
+
469
+ // src/compositions/terminal-demo.tsx
470
+ import { AbsoluteFill, Sequence, useVideoConfig as useVideoConfig5 } from "remotion";
471
+ import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
472
+ var TerminalDemo = ({
473
+ title,
474
+ subtitle,
475
+ lines,
476
+ terminalTitle = "Terminal",
477
+ prompt = "$ ",
478
+ summary
479
+ }) => {
480
+ const { durationInFrames } = useVideoConfig5();
481
+ const theme = defaultVideoTheme;
482
+ const TERMINAL_START = 40;
483
+ const SUMMARY_START = durationInFrames - 90;
484
+ return /* @__PURE__ */ jsxDEV5(AbsoluteFill, {
485
+ children: [
486
+ /* @__PURE__ */ jsxDEV5(BrandFrame, {
487
+ variant: "dark",
488
+ showBranding: true,
489
+ children: /* @__PURE__ */ jsxDEV5("div", {
490
+ style: {
491
+ flex: 1,
492
+ display: "flex",
493
+ flexDirection: "column",
494
+ gap: 24
495
+ },
496
+ children: [
497
+ /* @__PURE__ */ jsxDEV5("div", {
498
+ children: [
499
+ /* @__PURE__ */ jsxDEV5(AnimatedText, {
500
+ text: title,
501
+ variant: "heading",
502
+ enterAt: 5,
503
+ color: "#ffffff"
504
+ }, undefined, false, undefined, this),
505
+ subtitle && /* @__PURE__ */ jsxDEV5("div", {
506
+ style: { marginTop: 8 },
507
+ children: /* @__PURE__ */ jsxDEV5(AnimatedText, {
508
+ text: subtitle,
509
+ variant: "body",
510
+ enterAt: 15,
511
+ color: theme.colors.mutedForeground
512
+ }, undefined, false, undefined, this)
513
+ }, undefined, false, undefined, this)
514
+ ]
515
+ }, undefined, true, undefined, this),
516
+ /* @__PURE__ */ jsxDEV5(Sequence, {
517
+ from: TERMINAL_START,
518
+ children: /* @__PURE__ */ jsxDEV5("div", {
519
+ style: { flex: 1 },
520
+ children: /* @__PURE__ */ jsxDEV5(Terminal, {
521
+ lines,
522
+ startAt: 0,
523
+ prompt,
524
+ title: terminalTitle
525
+ }, undefined, false, undefined, this)
526
+ }, undefined, false, undefined, this)
527
+ }, undefined, false, undefined, this),
528
+ summary && /* @__PURE__ */ jsxDEV5(Sequence, {
529
+ from: SUMMARY_START,
530
+ children: /* @__PURE__ */ jsxDEV5("div", {
531
+ style: {
532
+ marginTop: "auto",
533
+ paddingTop: 24
534
+ },
535
+ children: /* @__PURE__ */ jsxDEV5(AnimatedText, {
536
+ text: summary,
537
+ variant: "subheading",
538
+ enterAt: 0,
539
+ color: theme.colors.accent,
540
+ align: "center"
541
+ }, undefined, false, undefined, this)
542
+ }, undefined, false, undefined, this)
543
+ }, undefined, false, undefined, this)
544
+ ]
545
+ }, undefined, true, undefined, this)
546
+ }, undefined, false, undefined, this),
547
+ /* @__PURE__ */ jsxDEV5(ProgressBar, {}, undefined, false, undefined, this)
548
+ ]
549
+ }, undefined, true, undefined, this);
550
+ };
551
+ export {
552
+ TerminalDemo
553
+ };
@@ -0,0 +1,150 @@
1
+ import { createRequire } from "node:module";
2
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
+
4
+ // src/design/motion.ts
5
+ import { Easing } from "remotion";
6
+ var videoEasing = {
7
+ entrance: Easing.out(Easing.exp),
8
+ exit: Easing.in(Easing.exp),
9
+ emphasis: Easing.out(Easing.back(1.4)),
10
+ linear: Easing.linear,
11
+ gentle: Easing.bezier(0.25, 0.1, 0.25, 1),
12
+ spring: Easing.out(Easing.back(1.7))
13
+ };
14
+ var videoDurations = {
15
+ sceneTransition: 20,
16
+ textEntrance: 15,
17
+ textExit: 12,
18
+ codeTypingPerChar: 2,
19
+ sectionPause: 30,
20
+ emphasisPause: 15,
21
+ brandReveal: 25,
22
+ minScene: 60,
23
+ shortScene: 60,
24
+ mediumScene: 120,
25
+ longScene: 240
26
+ };
27
+ var videoTransitions = {
28
+ fade: { type: "fade", durationInFrames: 20 },
29
+ slideLeft: { type: "slide-left", durationInFrames: 20 },
30
+ slideRight: { type: "slide-right", durationInFrames: 20 },
31
+ wipe: { type: "wipe", durationInFrames: 15 },
32
+ none: { type: "none", durationInFrames: 0 }
33
+ };
34
+
35
+ // src/design/tokens.ts
36
+ import { defaultTokens } from "@contractspec/lib.design-system";
37
+ var defaultVideoColors = {
38
+ canvasBackground: defaultTokens.colors.background,
39
+ codeBackground: "#1e1e2e",
40
+ terminalBackground: "#0d1117",
41
+ terminalForeground: "#c9d1d9",
42
+ highlight: defaultTokens.colors.accent,
43
+ gradientStart: defaultTokens.colors.primary,
44
+ gradientEnd: defaultTokens.colors.accent
45
+ };
46
+ var defaultVideoTheme = {
47
+ ...defaultTokens,
48
+ video: defaultVideoColors
49
+ };
50
+
51
+ // src/design/layouts.ts
52
+ import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
53
+ var DEFAULT_FPS = 30;
54
+ var videoSafeZone = {
55
+ horizontal: 120,
56
+ vertical: 80,
57
+ contentWidth: 1680,
58
+ contentHeight: 920
59
+ };
60
+ function scaleSafeZone(format) {
61
+ const scaleX = format.width / 1920;
62
+ const scaleY = format.height / 1080;
63
+ return {
64
+ horizontal: Math.round(videoSafeZone.horizontal * scaleX),
65
+ vertical: Math.round(videoSafeZone.vertical * scaleY),
66
+ contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
67
+ contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
68
+ };
69
+ }
70
+ var videoPositions = {
71
+ center: { x: 960, y: 540 },
72
+ topLeft: { x: 120, y: 80 },
73
+ topRight: { x: 1800, y: 80 },
74
+ bottomLeft: { x: 120, y: 1000 },
75
+ bottomRight: { x: 1800, y: 1000 },
76
+ bottomCenter: { x: 960, y: 960 }
77
+ };
78
+ function getAllFormatVariants() {
79
+ return [
80
+ VIDEO_FORMATS.landscape,
81
+ VIDEO_FORMATS.square,
82
+ VIDEO_FORMATS.portrait
83
+ ];
84
+ }
85
+
86
+ // src/design/typography.ts
87
+ var videoTypography = {
88
+ title: {
89
+ fontSize: 72,
90
+ lineHeight: 1.1,
91
+ fontWeight: 700,
92
+ letterSpacing: -1
93
+ },
94
+ heading: {
95
+ fontSize: 56,
96
+ lineHeight: 1.2,
97
+ fontWeight: 600,
98
+ letterSpacing: -0.5
99
+ },
100
+ subheading: {
101
+ fontSize: 40,
102
+ lineHeight: 1.25,
103
+ fontWeight: 500
104
+ },
105
+ body: {
106
+ fontSize: 32,
107
+ lineHeight: 1.5,
108
+ fontWeight: 400
109
+ },
110
+ code: {
111
+ fontSize: 28,
112
+ lineHeight: 1.6,
113
+ fontWeight: 400
114
+ },
115
+ caption: {
116
+ fontSize: 24,
117
+ lineHeight: 1.4,
118
+ fontWeight: 400
119
+ },
120
+ label: {
121
+ fontSize: 20,
122
+ lineHeight: 1.3,
123
+ fontWeight: 600,
124
+ letterSpacing: 1
125
+ }
126
+ };
127
+ function scaleTypography(style, targetWidth) {
128
+ const scale = targetWidth / 1920;
129
+ return {
130
+ ...style,
131
+ fontSize: Math.round(style.fontSize * scale),
132
+ letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
133
+ };
134
+ }
135
+ export {
136
+ videoTypography,
137
+ videoTransitions,
138
+ videoSafeZone,
139
+ videoPositions,
140
+ videoEasing,
141
+ videoDurations,
142
+ scaleTypography,
143
+ scaleSafeZone,
144
+ getAllFormatVariants,
145
+ defaultVideoTheme,
146
+ defaultVideoColors,
147
+ defaultTokens,
148
+ VIDEO_FORMATS,
149
+ DEFAULT_FPS
150
+ };