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