@contractspec/lib.video-gen 2.7.16 → 2.7.18

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 (127) hide show
  1. package/dist/browser/compositions/api-overview.js +1 -645
  2. package/dist/browser/compositions/index.js +1 -1133
  3. package/dist/browser/compositions/primitives/animated-text.js +1 -144
  4. package/dist/browser/compositions/primitives/brand-frame.js +1 -181
  5. package/dist/browser/compositions/primitives/code-block.js +1 -226
  6. package/dist/browser/compositions/primitives/index.js +1 -656
  7. package/dist/browser/compositions/primitives/progress-bar.js +1 -59
  8. package/dist/browser/compositions/primitives/terminal.js +1 -265
  9. package/dist/browser/compositions/primitives/transition.js +1 -98
  10. package/dist/browser/compositions/social-clip.js +1 -500
  11. package/dist/browser/compositions/terminal-demo.js +1 -558
  12. package/dist/browser/design/index.js +1 -155
  13. package/dist/browser/design/layouts.js +1 -50
  14. package/dist/browser/design/motion.js +1 -43
  15. package/dist/browser/design/tokens.js +1 -28
  16. package/dist/browser/design/typography.js +1 -61
  17. package/dist/browser/docs/compositions.docblock.js +1 -182
  18. package/dist/browser/docs/design.docblock.js +2 -17
  19. package/dist/browser/docs/generators.docblock.js +2 -24
  20. package/dist/browser/docs/rendering.docblock.js +2 -24
  21. package/dist/browser/docs/video-gen.docblock.js +2 -17
  22. package/dist/browser/generators/index.js +7 -769
  23. package/dist/browser/generators/scene-planner.js +7 -651
  24. package/dist/browser/generators/script-generator.js +7 -599
  25. package/dist/browser/generators/video-generator.js +7 -768
  26. package/dist/browser/i18n/catalogs/en.js +3 -135
  27. package/dist/browser/i18n/catalogs/es.js +3 -135
  28. package/dist/browser/i18n/catalogs/fr.js +3 -135
  29. package/dist/browser/i18n/catalogs/index.js +7 -387
  30. package/dist/browser/i18n/index.js +7 -459
  31. package/dist/browser/i18n/keys.js +1 -54
  32. package/dist/browser/i18n/locale.js +1 -21
  33. package/dist/browser/i18n/messages.js +7 -399
  34. package/dist/browser/index.js +7 -1903
  35. package/dist/browser/player/demo-player.js +1 -1136
  36. package/dist/browser/player/index.js +1 -1136
  37. package/dist/browser/remotion/Root.js +2 -1172
  38. package/dist/browser/remotion/index.js +2 -1173
  39. package/dist/browser/renderers/config.js +1 -40
  40. package/dist/browser/renderers/index.js +1 -160
  41. package/dist/browser/renderers/local.js +1 -156
  42. package/dist/browser/types.js +1 -13
  43. package/dist/compositions/api-overview.js +1 -639
  44. package/dist/compositions/index.js +1 -1127
  45. package/dist/compositions/primitives/animated-text.js +1 -138
  46. package/dist/compositions/primitives/brand-frame.js +1 -175
  47. package/dist/compositions/primitives/code-block.js +1 -220
  48. package/dist/compositions/primitives/index.js +1 -650
  49. package/dist/compositions/primitives/progress-bar.js +1 -53
  50. package/dist/compositions/primitives/terminal.js +1 -259
  51. package/dist/compositions/primitives/transition.js +1 -92
  52. package/dist/compositions/social-clip.js +1 -494
  53. package/dist/compositions/terminal-demo.js +1 -552
  54. package/dist/design/index.js +1 -149
  55. package/dist/design/layouts.js +1 -44
  56. package/dist/design/motion.js +1 -37
  57. package/dist/design/tokens.js +1 -22
  58. package/dist/design/typography.js +1 -55
  59. package/dist/docs/compositions.docblock.js +1 -182
  60. package/dist/docs/design.docblock.js +2 -17
  61. package/dist/docs/generators.docblock.js +2 -24
  62. package/dist/docs/rendering.docblock.js +2 -24
  63. package/dist/docs/video-gen.docblock.js +2 -17
  64. package/dist/generators/index.js +7 -763
  65. package/dist/generators/scene-planner.js +7 -645
  66. package/dist/generators/script-generator.js +7 -593
  67. package/dist/generators/video-generator.js +7 -762
  68. package/dist/i18n/catalogs/en.js +3 -129
  69. package/dist/i18n/catalogs/es.js +3 -129
  70. package/dist/i18n/catalogs/fr.js +3 -129
  71. package/dist/i18n/catalogs/index.js +7 -381
  72. package/dist/i18n/index.js +7 -453
  73. package/dist/i18n/keys.js +1 -48
  74. package/dist/i18n/locale.js +1 -15
  75. package/dist/i18n/messages.js +7 -393
  76. package/dist/index.js +7 -1897
  77. package/dist/node/compositions/api-overview.js +1 -640
  78. package/dist/node/compositions/index.js +1 -1128
  79. package/dist/node/compositions/primitives/animated-text.js +1 -139
  80. package/dist/node/compositions/primitives/brand-frame.js +1 -176
  81. package/dist/node/compositions/primitives/code-block.js +1 -221
  82. package/dist/node/compositions/primitives/index.js +1 -651
  83. package/dist/node/compositions/primitives/progress-bar.js +1 -54
  84. package/dist/node/compositions/primitives/terminal.js +1 -260
  85. package/dist/node/compositions/primitives/transition.js +1 -93
  86. package/dist/node/compositions/social-clip.js +1 -495
  87. package/dist/node/compositions/terminal-demo.js +1 -553
  88. package/dist/node/design/index.js +1 -150
  89. package/dist/node/design/layouts.js +1 -45
  90. package/dist/node/design/motion.js +1 -38
  91. package/dist/node/design/tokens.js +1 -23
  92. package/dist/node/design/typography.js +1 -56
  93. package/dist/node/docs/compositions.docblock.js +1 -182
  94. package/dist/node/docs/design.docblock.js +2 -17
  95. package/dist/node/docs/generators.docblock.js +2 -24
  96. package/dist/node/docs/rendering.docblock.js +2 -24
  97. package/dist/node/docs/video-gen.docblock.js +2 -17
  98. package/dist/node/generators/index.js +7 -764
  99. package/dist/node/generators/scene-planner.js +7 -646
  100. package/dist/node/generators/script-generator.js +7 -594
  101. package/dist/node/generators/video-generator.js +7 -763
  102. package/dist/node/i18n/catalogs/en.js +3 -130
  103. package/dist/node/i18n/catalogs/es.js +3 -130
  104. package/dist/node/i18n/catalogs/fr.js +3 -130
  105. package/dist/node/i18n/catalogs/index.js +7 -382
  106. package/dist/node/i18n/index.js +7 -454
  107. package/dist/node/i18n/keys.js +1 -49
  108. package/dist/node/i18n/locale.js +1 -16
  109. package/dist/node/i18n/messages.js +7 -394
  110. package/dist/node/index.js +7 -1898
  111. package/dist/node/player/demo-player.js +1 -1131
  112. package/dist/node/player/index.js +1 -1131
  113. package/dist/node/remotion/Root.js +2 -1167
  114. package/dist/node/remotion/index.js +2 -1168
  115. package/dist/node/renderers/config.js +1 -35
  116. package/dist/node/renderers/index.js +1 -155
  117. package/dist/node/renderers/local.js +1 -151
  118. package/dist/node/types.js +1 -8
  119. package/dist/player/demo-player.js +1 -1130
  120. package/dist/player/index.js +1 -1130
  121. package/dist/remotion/Root.js +2 -1166
  122. package/dist/remotion/index.js +2 -1167
  123. package/dist/renderers/config.js +1 -34
  124. package/dist/renderers/index.js +1 -154
  125. package/dist/renderers/local.js +1 -150
  126. package/dist/types.js +1 -7
  127. package/package.json +18 -18
@@ -1,651 +1 @@
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/typography.ts
52
- var videoTypography = {
53
- title: {
54
- fontSize: 72,
55
- lineHeight: 1.1,
56
- fontWeight: 700,
57
- letterSpacing: -1
58
- },
59
- heading: {
60
- fontSize: 56,
61
- lineHeight: 1.2,
62
- fontWeight: 600,
63
- letterSpacing: -0.5
64
- },
65
- subheading: {
66
- fontSize: 40,
67
- lineHeight: 1.25,
68
- fontWeight: 500
69
- },
70
- body: {
71
- fontSize: 32,
72
- lineHeight: 1.5,
73
- fontWeight: 400
74
- },
75
- code: {
76
- fontSize: 28,
77
- lineHeight: 1.6,
78
- fontWeight: 400
79
- },
80
- caption: {
81
- fontSize: 24,
82
- lineHeight: 1.4,
83
- fontWeight: 400
84
- },
85
- label: {
86
- fontSize: 20,
87
- lineHeight: 1.3,
88
- fontWeight: 600,
89
- letterSpacing: 1
90
- }
91
- };
92
- function scaleTypography(style, targetWidth) {
93
- const scale = targetWidth / 1920;
94
- return {
95
- ...style,
96
- fontSize: Math.round(style.fontSize * scale),
97
- letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
98
- };
99
- }
100
-
101
- // src/compositions/primitives/animated-text.tsx
102
- import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
103
- import { jsxDEV } from "react/jsx-dev-runtime";
104
- var AnimatedText = ({
105
- text,
106
- variant = "body",
107
- style: styleOverride,
108
- enterAt = 0,
109
- exitAt,
110
- color = "#ffffff",
111
- align = "left"
112
- }) => {
113
- const frame = useCurrentFrame();
114
- const { width } = useVideoConfig();
115
- const baseStyle = videoTypography[variant];
116
- const scaled = scaleTypography(baseStyle, width);
117
- const finalStyle = { ...scaled, ...styleOverride };
118
- const enterProgress = interpolate(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
119
- const enterOpacity = interpolate(enterProgress, [0, 1], [0, 1], {
120
- easing: videoEasing.entrance
121
- });
122
- const enterTranslateY = interpolate(enterProgress, [0, 1], [30, 0], {
123
- easing: videoEasing.entrance
124
- });
125
- let exitOpacity = 1;
126
- let exitTranslateY = 0;
127
- if (exitAt !== undefined) {
128
- const exitProgress = interpolate(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
129
- exitOpacity = interpolate(exitProgress, [0, 1], [1, 0], {
130
- easing: videoEasing.exit
131
- });
132
- exitTranslateY = interpolate(exitProgress, [0, 1], [0, -20], {
133
- easing: videoEasing.exit
134
- });
135
- }
136
- const opacity = enterOpacity * exitOpacity;
137
- const translateY = enterTranslateY + exitTranslateY;
138
- return /* @__PURE__ */ jsxDEV("div", {
139
- style: {
140
- fontSize: finalStyle.fontSize,
141
- lineHeight: finalStyle.lineHeight,
142
- fontWeight: finalStyle.fontWeight,
143
- letterSpacing: finalStyle.letterSpacing,
144
- color,
145
- textAlign: align,
146
- opacity,
147
- transform: `translateY(${translateY}px)`,
148
- willChange: "opacity, transform"
149
- },
150
- children: text
151
- }, undefined, false, undefined, this);
152
- };
153
-
154
- // src/design/layouts.ts
155
- import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
156
- var DEFAULT_FPS = 30;
157
- var videoSafeZone = {
158
- horizontal: 120,
159
- vertical: 80,
160
- contentWidth: 1680,
161
- contentHeight: 920
162
- };
163
- function scaleSafeZone(format) {
164
- const scaleX = format.width / 1920;
165
- const scaleY = format.height / 1080;
166
- return {
167
- horizontal: Math.round(videoSafeZone.horizontal * scaleX),
168
- vertical: Math.round(videoSafeZone.vertical * scaleY),
169
- contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
170
- contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
171
- };
172
- }
173
- var videoPositions = {
174
- center: { x: 960, y: 540 },
175
- topLeft: { x: 120, y: 80 },
176
- topRight: { x: 1800, y: 80 },
177
- bottomLeft: { x: 120, y: 1000 },
178
- bottomRight: { x: 1800, y: 1000 },
179
- bottomCenter: { x: 960, y: 960 }
180
- };
181
- function getAllFormatVariants() {
182
- return [
183
- VIDEO_FORMATS.landscape,
184
- VIDEO_FORMATS.square,
185
- VIDEO_FORMATS.portrait
186
- ];
187
- }
188
-
189
- // src/compositions/primitives/brand-frame.tsx
190
- import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
191
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
192
- var BrandFrame = ({
193
- styleOverrides,
194
- showBranding = true,
195
- animateEntrance = true,
196
- variant = "gradient",
197
- children
198
- }) => {
199
- const frame = useCurrentFrame2();
200
- const { width, height } = useVideoConfig2();
201
- const theme = defaultVideoTheme;
202
- const safeZone = scaleSafeZone({ type: "custom", width, height });
203
- const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
204
- const _accentColor = styleOverrides?.accentColor ?? theme.colors.accent;
205
- const isDark = styleOverrides?.darkMode ?? true;
206
- let background;
207
- switch (variant) {
208
- case "solid":
209
- background = isDark ? "#0a0a0a" : theme.colors.background;
210
- break;
211
- case "gradient":
212
- background = isDark ? `linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)` : `linear-gradient(135deg, ${theme.colors.background} 0%, ${theme.colors.muted} 100%)`;
213
- break;
214
- case "dark":
215
- background = "#000000";
216
- break;
217
- }
218
- const entranceOpacity = animateEntrance ? interpolate2(frame, [0, 15], [0, 1], {
219
- extrapolateLeft: "clamp",
220
- extrapolateRight: "clamp",
221
- easing: videoEasing.entrance
222
- }) : 1;
223
- const brandOpacity = showBranding ? interpolate2(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
224
- extrapolateLeft: "clamp",
225
- extrapolateRight: "clamp"
226
- }) : 0;
227
- return /* @__PURE__ */ jsxDEV2("div", {
228
- style: {
229
- width,
230
- height,
231
- background,
232
- position: "relative",
233
- overflow: "hidden",
234
- opacity: entranceOpacity
235
- },
236
- children: [
237
- variant === "gradient" && /* @__PURE__ */ jsxDEV2("div", {
238
- style: {
239
- position: "absolute",
240
- top: "-20%",
241
- right: "-10%",
242
- width: "50%",
243
- height: "50%",
244
- background: `radial-gradient(circle, ${primaryColor}15 0%, transparent 70%)`,
245
- borderRadius: "50%",
246
- pointerEvents: "none"
247
- }
248
- }, undefined, false, undefined, this),
249
- /* @__PURE__ */ jsxDEV2("div", {
250
- style: {
251
- position: "absolute",
252
- left: safeZone.horizontal,
253
- top: safeZone.vertical,
254
- width: safeZone.contentWidth,
255
- height: safeZone.contentHeight,
256
- display: "flex",
257
- flexDirection: "column"
258
- },
259
- children
260
- }, undefined, false, undefined, this),
261
- showBranding && /* @__PURE__ */ jsxDEV2("div", {
262
- style: {
263
- position: "absolute",
264
- bottom: safeZone.vertical / 2,
265
- right: safeZone.horizontal,
266
- opacity: brandOpacity,
267
- color: isDark ? "#ffffff" : "#000000",
268
- fontSize: Math.round(16 * (width / 1920)),
269
- fontWeight: 500,
270
- letterSpacing: 1
271
- },
272
- children: "ContractSpec"
273
- }, undefined, false, undefined, this)
274
- ]
275
- }, undefined, true, undefined, this);
276
- };
277
-
278
- // src/compositions/primitives/code-block.tsx
279
- import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
280
- import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
281
- var CodeBlock = ({
282
- code,
283
- language = "typescript",
284
- startAt = 0,
285
- typeAnimation = true,
286
- backgroundColor = defaultVideoColors.codeBackground,
287
- textColor = "#abb2bf",
288
- filename
289
- }) => {
290
- const frame = useCurrentFrame3();
291
- const { width } = useVideoConfig3();
292
- const codeStyle = scaleTypography(videoTypography.code, width);
293
- const totalChars = code.length;
294
- const typingDuration = totalChars * videoDurations.codeTypingPerChar;
295
- const charsVisible = typeAnimation ? Math.floor(interpolate3(frame, [startAt, startAt + typingDuration], [0, totalChars], {
296
- extrapolateLeft: "clamp",
297
- extrapolateRight: "clamp"
298
- })) : totalChars;
299
- const visibleCode = code.slice(0, charsVisible);
300
- const opacity = interpolate3(frame, [startAt, startAt + 10], [0, 1], {
301
- extrapolateLeft: "clamp",
302
- extrapolateRight: "clamp",
303
- easing: videoEasing.entrance
304
- });
305
- const showCursor = typeAnimation && charsVisible < totalChars && frame % 16 < 10;
306
- return /* @__PURE__ */ jsxDEV3("div", {
307
- style: {
308
- backgroundColor,
309
- borderRadius: 16,
310
- padding: 0,
311
- opacity,
312
- overflow: "hidden",
313
- boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
314
- },
315
- children: [
316
- /* @__PURE__ */ jsxDEV3("div", {
317
- style: {
318
- display: "flex",
319
- alignItems: "center",
320
- padding: "12px 20px",
321
- backgroundColor: "rgba(0,0,0,0.2)",
322
- gap: 8
323
- },
324
- children: [
325
- /* @__PURE__ */ jsxDEV3("div", {
326
- style: { display: "flex", gap: 8 },
327
- children: [
328
- /* @__PURE__ */ jsxDEV3("div", {
329
- style: {
330
- width: 12,
331
- height: 12,
332
- borderRadius: "50%",
333
- backgroundColor: "#ff5f57"
334
- }
335
- }, undefined, false, undefined, this),
336
- /* @__PURE__ */ jsxDEV3("div", {
337
- style: {
338
- width: 12,
339
- height: 12,
340
- borderRadius: "50%",
341
- backgroundColor: "#febc2e"
342
- }
343
- }, undefined, false, undefined, this),
344
- /* @__PURE__ */ jsxDEV3("div", {
345
- style: {
346
- width: 12,
347
- height: 12,
348
- borderRadius: "50%",
349
- backgroundColor: "#28c840"
350
- }
351
- }, undefined, false, undefined, this)
352
- ]
353
- }, undefined, true, undefined, this),
354
- /* @__PURE__ */ jsxDEV3("div", {
355
- style: {
356
- flex: 1,
357
- textAlign: "center",
358
- color: "#666",
359
- fontSize: codeStyle.fontSize * 0.7,
360
- fontFamily: "monospace"
361
- },
362
- children: filename ?? language
363
- }, undefined, false, undefined, this)
364
- ]
365
- }, undefined, true, undefined, this),
366
- /* @__PURE__ */ jsxDEV3("div", {
367
- style: { padding: "24px 32px" },
368
- children: /* @__PURE__ */ jsxDEV3("pre", {
369
- style: {
370
- margin: 0,
371
- fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
372
- fontSize: codeStyle.fontSize,
373
- lineHeight: codeStyle.lineHeight,
374
- color: textColor,
375
- whiteSpace: "pre-wrap",
376
- wordBreak: "break-word"
377
- },
378
- children: [
379
- visibleCode,
380
- showCursor && /* @__PURE__ */ jsxDEV3("span", {
381
- style: {
382
- backgroundColor: textColor,
383
- width: "2px",
384
- display: "inline-block",
385
- height: "1.2em",
386
- verticalAlign: "text-bottom"
387
- },
388
- children: " "
389
- }, undefined, false, undefined, this)
390
- ]
391
- }, undefined, true, undefined, this)
392
- }, undefined, false, undefined, this)
393
- ]
394
- }, undefined, true, undefined, this);
395
- };
396
-
397
- // src/compositions/primitives/progress-bar.tsx
398
- import { useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4 } from "remotion";
399
- import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
400
- var ProgressBar = ({
401
- height = 4,
402
- color = defaultVideoTheme.colors.primary,
403
- backgroundColor = "rgba(255,255,255,0.1)",
404
- position = "bottom"
405
- }) => {
406
- const frame = useCurrentFrame4();
407
- const { durationInFrames, width } = useVideoConfig4();
408
- const progress = frame / durationInFrames;
409
- return /* @__PURE__ */ jsxDEV4("div", {
410
- style: {
411
- position: "absolute",
412
- [position]: 0,
413
- left: 0,
414
- width,
415
- height,
416
- backgroundColor,
417
- zIndex: 100
418
- },
419
- children: /* @__PURE__ */ jsxDEV4("div", {
420
- style: {
421
- width: `${progress * 100}%`,
422
- height: "100%",
423
- backgroundColor: color,
424
- transition: "none"
425
- }
426
- }, undefined, false, undefined, this)
427
- }, undefined, false, undefined, this);
428
- };
429
-
430
- // src/compositions/primitives/terminal.tsx
431
- import { interpolate as interpolate4, useCurrentFrame as useCurrentFrame5, useVideoConfig as useVideoConfig5 } from "remotion";
432
- import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
433
- var LINE_TYPE_COLORS = {
434
- command: "#c9d1d9",
435
- output: "#8b949e",
436
- error: "#f85149",
437
- success: "#3fb950",
438
- comment: "#6e7681"
439
- };
440
- var Terminal = ({
441
- lines,
442
- startAt = 0,
443
- prompt = "$ ",
444
- title = "Terminal",
445
- backgroundColor = defaultVideoColors.terminalBackground,
446
- typingSpeed = videoDurations.codeTypingPerChar
447
- }) => {
448
- const frame = useCurrentFrame5();
449
- const { width } = useVideoConfig5();
450
- const codeStyle = scaleTypography(videoTypography.code, width);
451
- const lineTimings = [];
452
- let currentFrame = startAt;
453
- for (const line of lines) {
454
- const delay = line.delay ?? 10;
455
- const lineStart = currentFrame + delay;
456
- if (line.type === "command") {
457
- const typeDuration = line.text.length * typingSpeed;
458
- lineTimings.push({
459
- startFrame: lineStart,
460
- endFrame: lineStart + typeDuration
461
- });
462
- currentFrame = lineStart + typeDuration;
463
- } else {
464
- lineTimings.push({ startFrame: lineStart, endFrame: lineStart + 5 });
465
- currentFrame = lineStart + 5;
466
- }
467
- }
468
- const opacity = interpolate4(frame, [startAt, startAt + 10], [0, 1], {
469
- extrapolateLeft: "clamp",
470
- extrapolateRight: "clamp",
471
- easing: videoEasing.entrance
472
- });
473
- return /* @__PURE__ */ jsxDEV5("div", {
474
- style: {
475
- backgroundColor,
476
- borderRadius: 16,
477
- overflow: "hidden",
478
- opacity,
479
- boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
480
- },
481
- children: [
482
- /* @__PURE__ */ jsxDEV5("div", {
483
- style: {
484
- display: "flex",
485
- alignItems: "center",
486
- padding: "12px 20px",
487
- backgroundColor: "rgba(255,255,255,0.05)",
488
- gap: 8
489
- },
490
- children: [
491
- /* @__PURE__ */ jsxDEV5("div", {
492
- style: { display: "flex", gap: 8 },
493
- children: [
494
- /* @__PURE__ */ jsxDEV5("div", {
495
- style: {
496
- width: 12,
497
- height: 12,
498
- borderRadius: "50%",
499
- backgroundColor: "#ff5f57"
500
- }
501
- }, undefined, false, undefined, this),
502
- /* @__PURE__ */ jsxDEV5("div", {
503
- style: {
504
- width: 12,
505
- height: 12,
506
- borderRadius: "50%",
507
- backgroundColor: "#febc2e"
508
- }
509
- }, undefined, false, undefined, this),
510
- /* @__PURE__ */ jsxDEV5("div", {
511
- style: {
512
- width: 12,
513
- height: 12,
514
- borderRadius: "50%",
515
- backgroundColor: "#28c840"
516
- }
517
- }, undefined, false, undefined, this)
518
- ]
519
- }, undefined, true, undefined, this),
520
- /* @__PURE__ */ jsxDEV5("div", {
521
- style: {
522
- flex: 1,
523
- textAlign: "center",
524
- color: "#484f58",
525
- fontSize: codeStyle.fontSize * 0.7,
526
- fontFamily: "monospace"
527
- },
528
- children: title
529
- }, undefined, false, undefined, this)
530
- ]
531
- }, undefined, true, undefined, this),
532
- /* @__PURE__ */ jsxDEV5("div", {
533
- style: { padding: "24px 32px", minHeight: 200 },
534
- children: lines.map((line, i) => {
535
- const timing = lineTimings[i];
536
- if (!timing || frame < timing.startFrame)
537
- return null;
538
- const isCommand = line.type === "command";
539
- const lineColor = LINE_TYPE_COLORS[line.type];
540
- let visibleText = line.text;
541
- if (isCommand) {
542
- const typingProgress = interpolate4(frame, [timing.startFrame, timing.endFrame], [0, line.text.length], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
543
- visibleText = line.text.slice(0, Math.floor(typingProgress));
544
- }
545
- const lineOpacity = isCommand ? 1 : interpolate4(frame, [timing.startFrame, timing.startFrame + 5], [0, 1], {
546
- extrapolateLeft: "clamp",
547
- extrapolateRight: "clamp"
548
- });
549
- const isTyping = isCommand && frame >= timing.startFrame && frame <= timing.endFrame;
550
- const showCursor = isTyping && frame % 16 < 10;
551
- return /* @__PURE__ */ jsxDEV5("div", {
552
- style: {
553
- fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
554
- fontSize: codeStyle.fontSize,
555
- lineHeight: 1.8,
556
- color: lineColor,
557
- opacity: lineOpacity,
558
- whiteSpace: "pre-wrap"
559
- },
560
- children: [
561
- isCommand && /* @__PURE__ */ jsxDEV5("span", {
562
- style: { color: "#3fb950" },
563
- children: prompt
564
- }, undefined, false, undefined, this),
565
- line.type === "comment" && /* @__PURE__ */ jsxDEV5("span", {
566
- style: { color: LINE_TYPE_COLORS.comment },
567
- children: "# "
568
- }, undefined, false, undefined, this),
569
- visibleText,
570
- showCursor && /* @__PURE__ */ jsxDEV5("span", {
571
- style: {
572
- backgroundColor: "#c9d1d9",
573
- width: "2px",
574
- display: "inline-block",
575
- height: "1.2em",
576
- verticalAlign: "text-bottom"
577
- },
578
- children: " "
579
- }, undefined, false, undefined, this)
580
- ]
581
- }, `${i}-${line.text.slice(0, 20)}`, true, undefined, this);
582
- })
583
- }, undefined, false, undefined, this)
584
- ]
585
- }, undefined, true, undefined, this);
586
- };
587
-
588
- // src/compositions/primitives/transition.tsx
589
- import { interpolate as interpolate5, useCurrentFrame as useCurrentFrame6 } from "remotion";
590
- import { jsxDEV as jsxDEV6, Fragment } from "react/jsx-dev-runtime";
591
- var SceneTransitionWrapper = ({
592
- type,
593
- durationInFrames,
594
- direction,
595
- startAt = 0,
596
- children
597
- }) => {
598
- const frame = useCurrentFrame6();
599
- if (type === "none" || durationInFrames === 0) {
600
- return /* @__PURE__ */ jsxDEV6(Fragment, {
601
- children
602
- }, undefined, false, undefined, this);
603
- }
604
- const progress = interpolate5(frame, [startAt, startAt + durationInFrames], direction === "in" ? [0, 1] : [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
605
- const styles = getTransitionStyles(type, progress);
606
- return /* @__PURE__ */ jsxDEV6("div", {
607
- style: styles,
608
- children
609
- }, undefined, false, undefined, this);
610
- };
611
- function getTransitionStyles(type, progress) {
612
- const eased = videoEasing.entrance(progress);
613
- switch (type) {
614
- case "fade":
615
- return {
616
- opacity: eased,
617
- width: "100%",
618
- height: "100%"
619
- };
620
- case "slide-left":
621
- return {
622
- opacity: eased,
623
- transform: `translateX(${(1 - eased) * 100}%)`,
624
- width: "100%",
625
- height: "100%"
626
- };
627
- case "slide-right":
628
- return {
629
- opacity: eased,
630
- transform: `translateX(${(1 - eased) * -100}%)`,
631
- width: "100%",
632
- height: "100%"
633
- };
634
- case "wipe":
635
- return {
636
- clipPath: `inset(0 ${(1 - eased) * 100}% 0 0)`,
637
- width: "100%",
638
- height: "100%"
639
- };
640
- default:
641
- return { width: "100%", height: "100%" };
642
- }
643
- }
644
- export {
645
- Terminal,
646
- SceneTransitionWrapper,
647
- ProgressBar,
648
- CodeBlock,
649
- BrandFrame,
650
- AnimatedText
651
- };
1
+ import{createRequire as l}from"node:module";var MG=l(import.meta.url);import{Easing as R}from"remotion";var X={entrance:R.out(R.exp),exit:R.in(R.exp),emphasis:R.out(R.back(1.4)),linear:R.linear,gentle:R.bezier(0.25,0.1,0.25,1),spring:R.out(R.back(1.7))},Y={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},_G={fade:{type:"fade",durationInFrames:20},slideLeft:{type:"slide-left",durationInFrames:20},slideRight:{type:"slide-right",durationInFrames:20},wipe:{type:"wipe",durationInFrames:15},none:{type:"none",durationInFrames:0}};import{defaultTokens as F}from"@contractspec/lib.design-system";var b={canvasBackground:F.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:F.colors.accent,gradientStart:F.colors.primary,gradientEnd:F.colors.accent},O={...F,video:b};var Z={title:{fontSize:72,lineHeight:1.1,fontWeight:700,letterSpacing:-1},heading:{fontSize:56,lineHeight:1.2,fontWeight:600,letterSpacing:-0.5},subheading:{fontSize:40,lineHeight:1.25,fontWeight:500},body:{fontSize:32,lineHeight:1.5,fontWeight:400},code:{fontSize:28,lineHeight:1.6,fontWeight:400},caption:{fontSize:24,lineHeight:1.4,fontWeight:400},label:{fontSize:20,lineHeight:1.3,fontWeight:600,letterSpacing:1}};function D(H,J){let G=J/1920;return{...H,fontSize:Math.round(H.fontSize*G),letterSpacing:H.letterSpacing?Math.round(H.letterSpacing*G*10)/10:void 0}}import{interpolate as V,useCurrentFrame as o,useVideoConfig as r}from"remotion";import{jsx as n}from"react/jsx-runtime";var s=({text:H,variant:J="body",style:G,enterAt:q=0,exitAt:P,color:B="#ffffff",align:U="left"})=>{let z=o(),{width:L}=r(),$=Z[J],_={...D($,L),...G},K=V(z,[q,q+Y.textEntrance],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),N=V(K,[0,1],[0,1],{easing:X.entrance}),Q=V(K,[0,1],[30,0],{easing:X.entrance}),W=1,k=0;if(P!==void 0){let C=V(z,[P,P+Y.textExit],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});W=V(C,[0,1],[1,0],{easing:X.exit}),k=V(C,[0,1],[0,-20],{easing:X.exit})}let T=N*W,j=Q+k;return n("div",{style:{fontSize:_.fontSize,lineHeight:_.lineHeight,fontWeight:_.fontWeight,letterSpacing:_.letterSpacing,color:B,textAlign:U,opacity:T,transform:`translateY(${j}px)`,willChange:"opacity, transform"},children:H})};import{VIDEO_FORMATS as x}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var SG=30,S={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function p(H){let J=H.width/1920,G=H.height/1080;return{horizontal:Math.round(S.horizontal*J),vertical:Math.round(S.vertical*G),contentWidth:Math.round(S.contentWidth*J),contentHeight:Math.round(S.contentHeight*G)}}var EG={center:{x:960,y:540},topLeft:{x:120,y:80},topRight:{x:1800,y:80},bottomLeft:{x:120,y:1000},bottomRight:{x:1800,y:1000},bottomCenter:{x:960,y:960}};function AG(){return[x.landscape,x.square,x.portrait]}import{interpolate as h,useCurrentFrame as a,useVideoConfig as i}from"remotion";import{jsx as v,jsxs as e}from"react/jsx-runtime";var t=({styleOverrides:H,showBranding:J=!0,animateEntrance:G=!0,variant:q="gradient",children:P})=>{let B=a(),{width:U,height:z}=i(),L=O,$=p({type:"custom",width:U,height:z}),M=H?.primaryColor??L.colors.primary,_=H?.accentColor??L.colors.accent,K=H?.darkMode??!0,N;switch(q){case"solid":N=K?"#0a0a0a":L.colors.background;break;case"gradient":N=K?"linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)":`linear-gradient(135deg, ${L.colors.background} 0%, ${L.colors.muted} 100%)`;break;case"dark":N="#000000";break}let Q=G?h(B,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:X.entrance}):1,W=J?h(B,[Y.brandReveal,Y.brandReveal+15],[0,0.3],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}):0;return e("div",{style:{width:U,height:z,background:N,position:"relative",overflow:"hidden",opacity:Q},children:[q==="gradient"&&v("div",{style:{position:"absolute",top:"-20%",right:"-10%",width:"50%",height:"50%",background:`radial-gradient(circle, ${M}15 0%, transparent 70%)`,borderRadius:"50%",pointerEvents:"none"}}),v("div",{style:{position:"absolute",left:$.horizontal,top:$.vertical,width:$.contentWidth,height:$.contentHeight,display:"flex",flexDirection:"column"},children:P}),J&&v("div",{style:{position:"absolute",bottom:$.vertical/2,right:$.horizontal,opacity:W,color:K?"#ffffff":"#000000",fontSize:Math.round(16*(U/1920)),fontWeight:500,letterSpacing:1},children:"ContractSpec"})]})};import{interpolate as y,useCurrentFrame as GG,useVideoConfig as HG}from"remotion";import{jsx as w,jsxs as E}from"react/jsx-runtime";var JG=({code:H,language:J="typescript",startAt:G=0,typeAnimation:q=!0,backgroundColor:P=b.codeBackground,textColor:B="#abb2bf",filename:U})=>{let z=GG(),{width:L}=HG(),$=D(Z.code,L),M=H.length,_=M*Y.codeTypingPerChar,K=q?Math.floor(y(z,[G,G+_],[0,M],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})):M,N=H.slice(0,K),Q=y(z,[G,G+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:X.entrance}),W=q&&K<M&&z%16<10;return E("div",{style:{backgroundColor:P,borderRadius:16,padding:0,opacity:Q,overflow:"hidden",boxShadow:"0 8px 32px rgba(0,0,0,0.3)"},children:[E("div",{style:{display:"flex",alignItems:"center",padding:"12px 20px",backgroundColor:"rgba(0,0,0,0.2)",gap:8},children:[E("div",{style:{display:"flex",gap:8},children:[w("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#ff5f57"}}),w("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#febc2e"}}),w("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#28c840"}})]}),w("div",{style:{flex:1,textAlign:"center",color:"#666",fontSize:$.fontSize*0.7,fontFamily:"monospace"},children:U??J})]}),w("div",{style:{padding:"24px 32px"},children:E("pre",{style:{margin:0,fontFamily:"'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",fontSize:$.fontSize,lineHeight:$.lineHeight,color:B,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[N,W&&w("span",{style:{backgroundColor:B,width:"2px",display:"inline-block",height:"1.2em",verticalAlign:"text-bottom"},children:" "})]})})]})};import{useCurrentFrame as KG,useVideoConfig as QG}from"remotion";import{jsx as u}from"react/jsx-runtime";var UG=({height:H=4,color:J=O.colors.primary,backgroundColor:G="rgba(255,255,255,0.1)",position:q="bottom"})=>{let P=KG(),{durationInFrames:B,width:U}=QG(),z=P/B;return u("div",{style:{position:"absolute",[q]:0,left:0,width:U,height:H,backgroundColor:G,zIndex:100},children:u("div",{style:{width:`${z*100}%`,height:"100%",backgroundColor:J,transition:"none"}})})};import{interpolate as f,useCurrentFrame as $G,useVideoConfig as qG}from"remotion";import{jsx as I,jsxs as A}from"react/jsx-runtime";var m={command:"#c9d1d9",output:"#8b949e",error:"#f85149",success:"#3fb950",comment:"#6e7681"},zG=({lines:H,startAt:J=0,prompt:G="$ ",title:q="Terminal",backgroundColor:P=b.terminalBackground,typingSpeed:B=Y.codeTypingPerChar})=>{let U=$G(),{width:z}=qG(),L=D(Z.code,z),$=[],M=J;for(let K of H){let N=K.delay??10,Q=M+N;if(K.type==="command"){let W=K.text.length*B;$.push({startFrame:Q,endFrame:Q+W}),M=Q+W}else $.push({startFrame:Q,endFrame:Q+5}),M=Q+5}let _=f(U,[J,J+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:X.entrance});return A("div",{style:{backgroundColor:P,borderRadius:16,overflow:"hidden",opacity:_,boxShadow:"0 8px 32px rgba(0,0,0,0.3)"},children:[A("div",{style:{display:"flex",alignItems:"center",padding:"12px 20px",backgroundColor:"rgba(255,255,255,0.05)",gap:8},children:[A("div",{style:{display:"flex",gap:8},children:[I("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#ff5f57"}}),I("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#febc2e"}}),I("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#28c840"}})]}),I("div",{style:{flex:1,textAlign:"center",color:"#484f58",fontSize:L.fontSize*0.7,fontFamily:"monospace"},children:q})]}),I("div",{style:{padding:"24px 32px",minHeight:200},children:H.map((K,N)=>{let Q=$[N];if(!Q||U<Q.startFrame)return null;let W=K.type==="command",k=m[K.type],T=K.text;if(W){let d=f(U,[Q.startFrame,Q.endFrame],[0,K.text.length],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});T=K.text.slice(0,Math.floor(d))}let j=W?1:f(U,[Q.startFrame,Q.startFrame+5],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),g=W&&U>=Q.startFrame&&U<=Q.endFrame&&U%16<10;return A("div",{style:{fontFamily:"'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",fontSize:L.fontSize,lineHeight:1.8,color:k,opacity:j,whiteSpace:"pre-wrap"},children:[W&&I("span",{style:{color:"#3fb950"},children:G}),K.type==="comment"&&I("span",{style:{color:m.comment},children:"# "}),T,g&&I("span",{style:{backgroundColor:"#c9d1d9",width:"2px",display:"inline-block",height:"1.2em",verticalAlign:"text-bottom"},children:" "})]},`${N}-${K.text.slice(0,20)}`)})})]})};import{interpolate as PG,useCurrentFrame as WG}from"remotion";import{jsx as c,Fragment as XG}from"react/jsx-runtime";var BG=({type:H,durationInFrames:J,direction:G,startAt:q=0,children:P})=>{let B=WG();if(H==="none"||J===0)return c(XG,{children:P});let U=PG(B,[q,q+J],G==="in"?[0,1]:[1,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),z=NG(H,U);return c("div",{style:z,children:P})};function NG(H,J){let G=X.entrance(J);switch(H){case"fade":return{opacity:G,width:"100%",height:"100%"};case"slide-left":return{opacity:G,transform:`translateX(${(1-G)*100}%)`,width:"100%",height:"100%"};case"slide-right":return{opacity:G,transform:`translateX(${(1-G)*-100}%)`,width:"100%",height:"100%"};case"wipe":return{clipPath:`inset(0 ${(1-G)*100}% 0 0)`,width:"100%",height:"100%"};default:return{width:"100%",height:"100%"}}}export{zG as Terminal,BG as SceneTransitionWrapper,UG as ProgressBar,JG as CodeBlock,t as BrandFrame,s as AnimatedText};