@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,656 @@
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/code-block.tsx
284
+ import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
285
+ import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
286
+ var CodeBlock = ({
287
+ code,
288
+ language = "typescript",
289
+ startAt = 0,
290
+ typeAnimation = true,
291
+ backgroundColor = defaultVideoColors.codeBackground,
292
+ textColor = "#abb2bf",
293
+ filename
294
+ }) => {
295
+ const frame = useCurrentFrame3();
296
+ const { width } = useVideoConfig3();
297
+ const codeStyle = scaleTypography(videoTypography.code, width);
298
+ const totalChars = code.length;
299
+ const typingDuration = totalChars * videoDurations.codeTypingPerChar;
300
+ const charsVisible = typeAnimation ? Math.floor(interpolate3(frame, [startAt, startAt + typingDuration], [0, totalChars], {
301
+ extrapolateLeft: "clamp",
302
+ extrapolateRight: "clamp"
303
+ })) : totalChars;
304
+ const visibleCode = code.slice(0, charsVisible);
305
+ const opacity = interpolate3(frame, [startAt, startAt + 10], [0, 1], {
306
+ extrapolateLeft: "clamp",
307
+ extrapolateRight: "clamp",
308
+ easing: videoEasing.entrance
309
+ });
310
+ const showCursor = typeAnimation && charsVisible < totalChars && frame % 16 < 10;
311
+ return /* @__PURE__ */ jsxDEV3("div", {
312
+ style: {
313
+ backgroundColor,
314
+ borderRadius: 16,
315
+ padding: 0,
316
+ opacity,
317
+ overflow: "hidden",
318
+ boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
319
+ },
320
+ children: [
321
+ /* @__PURE__ */ jsxDEV3("div", {
322
+ style: {
323
+ display: "flex",
324
+ alignItems: "center",
325
+ padding: "12px 20px",
326
+ backgroundColor: "rgba(0,0,0,0.2)",
327
+ gap: 8
328
+ },
329
+ children: [
330
+ /* @__PURE__ */ jsxDEV3("div", {
331
+ style: { display: "flex", gap: 8 },
332
+ children: [
333
+ /* @__PURE__ */ jsxDEV3("div", {
334
+ style: {
335
+ width: 12,
336
+ height: 12,
337
+ borderRadius: "50%",
338
+ backgroundColor: "#ff5f57"
339
+ }
340
+ }, undefined, false, undefined, this),
341
+ /* @__PURE__ */ jsxDEV3("div", {
342
+ style: {
343
+ width: 12,
344
+ height: 12,
345
+ borderRadius: "50%",
346
+ backgroundColor: "#febc2e"
347
+ }
348
+ }, undefined, false, undefined, this),
349
+ /* @__PURE__ */ jsxDEV3("div", {
350
+ style: {
351
+ width: 12,
352
+ height: 12,
353
+ borderRadius: "50%",
354
+ backgroundColor: "#28c840"
355
+ }
356
+ }, undefined, false, undefined, this)
357
+ ]
358
+ }, undefined, true, undefined, this),
359
+ /* @__PURE__ */ jsxDEV3("div", {
360
+ style: {
361
+ flex: 1,
362
+ textAlign: "center",
363
+ color: "#666",
364
+ fontSize: codeStyle.fontSize * 0.7,
365
+ fontFamily: "monospace"
366
+ },
367
+ children: filename ?? language
368
+ }, undefined, false, undefined, this)
369
+ ]
370
+ }, undefined, true, undefined, this),
371
+ /* @__PURE__ */ jsxDEV3("div", {
372
+ style: { padding: "24px 32px" },
373
+ children: /* @__PURE__ */ jsxDEV3("pre", {
374
+ style: {
375
+ margin: 0,
376
+ fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
377
+ fontSize: codeStyle.fontSize,
378
+ lineHeight: codeStyle.lineHeight,
379
+ color: textColor,
380
+ whiteSpace: "pre-wrap",
381
+ wordBreak: "break-word"
382
+ },
383
+ children: [
384
+ visibleCode,
385
+ showCursor && /* @__PURE__ */ jsxDEV3("span", {
386
+ style: {
387
+ backgroundColor: textColor,
388
+ width: "2px",
389
+ display: "inline-block",
390
+ height: "1.2em",
391
+ verticalAlign: "text-bottom"
392
+ },
393
+ children: " "
394
+ }, undefined, false, undefined, this)
395
+ ]
396
+ }, undefined, true, undefined, this)
397
+ }, undefined, false, undefined, this)
398
+ ]
399
+ }, undefined, true, undefined, this);
400
+ };
401
+
402
+ // src/compositions/primitives/progress-bar.tsx
403
+ import { useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4 } from "remotion";
404
+ import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
405
+ var ProgressBar = ({
406
+ height = 4,
407
+ color = defaultVideoTheme.colors.primary,
408
+ backgroundColor = "rgba(255,255,255,0.1)",
409
+ position = "bottom"
410
+ }) => {
411
+ const frame = useCurrentFrame4();
412
+ const { durationInFrames, width } = useVideoConfig4();
413
+ const progress = frame / durationInFrames;
414
+ return /* @__PURE__ */ jsxDEV4("div", {
415
+ style: {
416
+ position: "absolute",
417
+ [position]: 0,
418
+ left: 0,
419
+ width,
420
+ height,
421
+ backgroundColor,
422
+ zIndex: 100
423
+ },
424
+ children: /* @__PURE__ */ jsxDEV4("div", {
425
+ style: {
426
+ width: `${progress * 100}%`,
427
+ height: "100%",
428
+ backgroundColor: color,
429
+ transition: "none"
430
+ }
431
+ }, undefined, false, undefined, this)
432
+ }, undefined, false, undefined, this);
433
+ };
434
+
435
+ // src/compositions/primitives/terminal.tsx
436
+ import { interpolate as interpolate4, useCurrentFrame as useCurrentFrame5, useVideoConfig as useVideoConfig5 } from "remotion";
437
+ import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
438
+ var LINE_TYPE_COLORS = {
439
+ command: "#c9d1d9",
440
+ output: "#8b949e",
441
+ error: "#f85149",
442
+ success: "#3fb950",
443
+ comment: "#6e7681"
444
+ };
445
+ var Terminal = ({
446
+ lines,
447
+ startAt = 0,
448
+ prompt = "$ ",
449
+ title = "Terminal",
450
+ backgroundColor = defaultVideoColors.terminalBackground,
451
+ typingSpeed = videoDurations.codeTypingPerChar
452
+ }) => {
453
+ const frame = useCurrentFrame5();
454
+ const { width } = useVideoConfig5();
455
+ const codeStyle = scaleTypography(videoTypography.code, width);
456
+ const lineTimings = [];
457
+ let currentFrame = startAt;
458
+ for (const line of lines) {
459
+ const delay = line.delay ?? 10;
460
+ const lineStart = currentFrame + delay;
461
+ if (line.type === "command") {
462
+ const typeDuration = line.text.length * typingSpeed;
463
+ lineTimings.push({
464
+ startFrame: lineStart,
465
+ endFrame: lineStart + typeDuration
466
+ });
467
+ currentFrame = lineStart + typeDuration;
468
+ } else {
469
+ lineTimings.push({ startFrame: lineStart, endFrame: lineStart + 5 });
470
+ currentFrame = lineStart + 5;
471
+ }
472
+ }
473
+ const opacity = interpolate4(frame, [startAt, startAt + 10], [0, 1], {
474
+ extrapolateLeft: "clamp",
475
+ extrapolateRight: "clamp",
476
+ easing: videoEasing.entrance
477
+ });
478
+ return /* @__PURE__ */ jsxDEV5("div", {
479
+ style: {
480
+ backgroundColor,
481
+ borderRadius: 16,
482
+ overflow: "hidden",
483
+ opacity,
484
+ boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
485
+ },
486
+ children: [
487
+ /* @__PURE__ */ jsxDEV5("div", {
488
+ style: {
489
+ display: "flex",
490
+ alignItems: "center",
491
+ padding: "12px 20px",
492
+ backgroundColor: "rgba(255,255,255,0.05)",
493
+ gap: 8
494
+ },
495
+ children: [
496
+ /* @__PURE__ */ jsxDEV5("div", {
497
+ style: { display: "flex", gap: 8 },
498
+ children: [
499
+ /* @__PURE__ */ jsxDEV5("div", {
500
+ style: {
501
+ width: 12,
502
+ height: 12,
503
+ borderRadius: "50%",
504
+ backgroundColor: "#ff5f57"
505
+ }
506
+ }, undefined, false, undefined, this),
507
+ /* @__PURE__ */ jsxDEV5("div", {
508
+ style: {
509
+ width: 12,
510
+ height: 12,
511
+ borderRadius: "50%",
512
+ backgroundColor: "#febc2e"
513
+ }
514
+ }, undefined, false, undefined, this),
515
+ /* @__PURE__ */ jsxDEV5("div", {
516
+ style: {
517
+ width: 12,
518
+ height: 12,
519
+ borderRadius: "50%",
520
+ backgroundColor: "#28c840"
521
+ }
522
+ }, undefined, false, undefined, this)
523
+ ]
524
+ }, undefined, true, undefined, this),
525
+ /* @__PURE__ */ jsxDEV5("div", {
526
+ style: {
527
+ flex: 1,
528
+ textAlign: "center",
529
+ color: "#484f58",
530
+ fontSize: codeStyle.fontSize * 0.7,
531
+ fontFamily: "monospace"
532
+ },
533
+ children: title
534
+ }, undefined, false, undefined, this)
535
+ ]
536
+ }, undefined, true, undefined, this),
537
+ /* @__PURE__ */ jsxDEV5("div", {
538
+ style: { padding: "24px 32px", minHeight: 200 },
539
+ children: lines.map((line, i) => {
540
+ const timing = lineTimings[i];
541
+ if (!timing || frame < timing.startFrame)
542
+ return null;
543
+ const isCommand = line.type === "command";
544
+ const lineColor = LINE_TYPE_COLORS[line.type];
545
+ let visibleText = line.text;
546
+ if (isCommand) {
547
+ const typingProgress = interpolate4(frame, [timing.startFrame, timing.endFrame], [0, line.text.length], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
548
+ visibleText = line.text.slice(0, Math.floor(typingProgress));
549
+ }
550
+ const lineOpacity = isCommand ? 1 : interpolate4(frame, [timing.startFrame, timing.startFrame + 5], [0, 1], {
551
+ extrapolateLeft: "clamp",
552
+ extrapolateRight: "clamp"
553
+ });
554
+ const isTyping = isCommand && frame >= timing.startFrame && frame <= timing.endFrame;
555
+ const showCursor = isTyping && frame % 16 < 10;
556
+ return /* @__PURE__ */ jsxDEV5("div", {
557
+ style: {
558
+ fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
559
+ fontSize: codeStyle.fontSize,
560
+ lineHeight: 1.8,
561
+ color: lineColor,
562
+ opacity: lineOpacity,
563
+ whiteSpace: "pre-wrap"
564
+ },
565
+ children: [
566
+ isCommand && /* @__PURE__ */ jsxDEV5("span", {
567
+ style: { color: "#3fb950" },
568
+ children: prompt
569
+ }, undefined, false, undefined, this),
570
+ line.type === "comment" && /* @__PURE__ */ jsxDEV5("span", {
571
+ style: { color: LINE_TYPE_COLORS.comment },
572
+ children: "# "
573
+ }, undefined, false, undefined, this),
574
+ visibleText,
575
+ showCursor && /* @__PURE__ */ jsxDEV5("span", {
576
+ style: {
577
+ backgroundColor: "#c9d1d9",
578
+ width: "2px",
579
+ display: "inline-block",
580
+ height: "1.2em",
581
+ verticalAlign: "text-bottom"
582
+ },
583
+ children: " "
584
+ }, undefined, false, undefined, this)
585
+ ]
586
+ }, `${i}-${line.text.slice(0, 20)}`, true, undefined, this);
587
+ })
588
+ }, undefined, false, undefined, this)
589
+ ]
590
+ }, undefined, true, undefined, this);
591
+ };
592
+
593
+ // src/compositions/primitives/transition.tsx
594
+ import { interpolate as interpolate5, useCurrentFrame as useCurrentFrame6 } from "remotion";
595
+ import { jsxDEV as jsxDEV6, Fragment } from "react/jsx-dev-runtime";
596
+ var SceneTransitionWrapper = ({
597
+ type,
598
+ durationInFrames,
599
+ direction,
600
+ startAt = 0,
601
+ children
602
+ }) => {
603
+ const frame = useCurrentFrame6();
604
+ if (type === "none" || durationInFrames === 0) {
605
+ return /* @__PURE__ */ jsxDEV6(Fragment, {
606
+ children
607
+ }, undefined, false, undefined, this);
608
+ }
609
+ const progress = interpolate5(frame, [startAt, startAt + durationInFrames], direction === "in" ? [0, 1] : [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
610
+ const styles = getTransitionStyles(type, progress);
611
+ return /* @__PURE__ */ jsxDEV6("div", {
612
+ style: styles,
613
+ children
614
+ }, undefined, false, undefined, this);
615
+ };
616
+ function getTransitionStyles(type, progress) {
617
+ const eased = videoEasing.entrance(progress);
618
+ switch (type) {
619
+ case "fade":
620
+ return {
621
+ opacity: eased,
622
+ width: "100%",
623
+ height: "100%"
624
+ };
625
+ case "slide-left":
626
+ return {
627
+ opacity: eased,
628
+ transform: `translateX(${(1 - eased) * 100}%)`,
629
+ width: "100%",
630
+ height: "100%"
631
+ };
632
+ case "slide-right":
633
+ return {
634
+ opacity: eased,
635
+ transform: `translateX(${(1 - eased) * -100}%)`,
636
+ width: "100%",
637
+ height: "100%"
638
+ };
639
+ case "wipe":
640
+ return {
641
+ clipPath: `inset(0 ${(1 - eased) * 100}% 0 0)`,
642
+ width: "100%",
643
+ height: "100%"
644
+ };
645
+ default:
646
+ return { width: "100%", height: "100%" };
647
+ }
648
+ }
649
+ export {
650
+ Terminal,
651
+ SceneTransitionWrapper,
652
+ ProgressBar,
653
+ CodeBlock,
654
+ BrandFrame,
655
+ AnimatedText
656
+ };
@@ -0,0 +1,59 @@
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/tokens.ts
10
+ import { defaultTokens } from "@contractspec/lib.design-system";
11
+ var defaultVideoColors = {
12
+ canvasBackground: defaultTokens.colors.background,
13
+ codeBackground: "#1e1e2e",
14
+ terminalBackground: "#0d1117",
15
+ terminalForeground: "#c9d1d9",
16
+ highlight: defaultTokens.colors.accent,
17
+ gradientStart: defaultTokens.colors.primary,
18
+ gradientEnd: defaultTokens.colors.accent
19
+ };
20
+ var defaultVideoTheme = {
21
+ ...defaultTokens,
22
+ video: defaultVideoColors
23
+ };
24
+
25
+ // src/compositions/primitives/progress-bar.tsx
26
+ import { useCurrentFrame, useVideoConfig } from "remotion";
27
+ import { jsxDEV } from "react/jsx-dev-runtime";
28
+ var ProgressBar = ({
29
+ height = 4,
30
+ color = defaultVideoTheme.colors.primary,
31
+ backgroundColor = "rgba(255,255,255,0.1)",
32
+ position = "bottom"
33
+ }) => {
34
+ const frame = useCurrentFrame();
35
+ const { durationInFrames, width } = useVideoConfig();
36
+ const progress = frame / durationInFrames;
37
+ return /* @__PURE__ */ jsxDEV("div", {
38
+ style: {
39
+ position: "absolute",
40
+ [position]: 0,
41
+ left: 0,
42
+ width,
43
+ height,
44
+ backgroundColor,
45
+ zIndex: 100
46
+ },
47
+ children: /* @__PURE__ */ jsxDEV("div", {
48
+ style: {
49
+ width: `${progress * 100}%`,
50
+ height: "100%",
51
+ backgroundColor: color,
52
+ transition: "none"
53
+ }
54
+ }, undefined, false, undefined, this)
55
+ }, undefined, false, undefined, this);
56
+ };
57
+ export {
58
+ ProgressBar
59
+ };