@contractspec/lib.video-gen 2.7.17 → 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 +16 -16
@@ -1,656 +1 @@
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/typography.ts
57
- var videoTypography = {
58
- title: {
59
- fontSize: 72,
60
- lineHeight: 1.1,
61
- fontWeight: 700,
62
- letterSpacing: -1
63
- },
64
- heading: {
65
- fontSize: 56,
66
- lineHeight: 1.2,
67
- fontWeight: 600,
68
- letterSpacing: -0.5
69
- },
70
- subheading: {
71
- fontSize: 40,
72
- lineHeight: 1.25,
73
- fontWeight: 500
74
- },
75
- body: {
76
- fontSize: 32,
77
- lineHeight: 1.5,
78
- fontWeight: 400
79
- },
80
- code: {
81
- fontSize: 28,
82
- lineHeight: 1.6,
83
- fontWeight: 400
84
- },
85
- caption: {
86
- fontSize: 24,
87
- lineHeight: 1.4,
88
- fontWeight: 400
89
- },
90
- label: {
91
- fontSize: 20,
92
- lineHeight: 1.3,
93
- fontWeight: 600,
94
- letterSpacing: 1
95
- }
96
- };
97
- function scaleTypography(style, targetWidth) {
98
- const scale = targetWidth / 1920;
99
- return {
100
- ...style,
101
- fontSize: Math.round(style.fontSize * scale),
102
- letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
103
- };
104
- }
105
-
106
- // src/compositions/primitives/animated-text.tsx
107
- import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
108
- import { jsxDEV } from "react/jsx-dev-runtime";
109
- var AnimatedText = ({
110
- text,
111
- variant = "body",
112
- style: styleOverride,
113
- enterAt = 0,
114
- exitAt,
115
- color = "#ffffff",
116
- align = "left"
117
- }) => {
118
- const frame = useCurrentFrame();
119
- const { width } = useVideoConfig();
120
- const baseStyle = videoTypography[variant];
121
- const scaled = scaleTypography(baseStyle, width);
122
- const finalStyle = { ...scaled, ...styleOverride };
123
- const enterProgress = interpolate(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
124
- const enterOpacity = interpolate(enterProgress, [0, 1], [0, 1], {
125
- easing: videoEasing.entrance
126
- });
127
- const enterTranslateY = interpolate(enterProgress, [0, 1], [30, 0], {
128
- easing: videoEasing.entrance
129
- });
130
- let exitOpacity = 1;
131
- let exitTranslateY = 0;
132
- if (exitAt !== undefined) {
133
- const exitProgress = interpolate(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
134
- exitOpacity = interpolate(exitProgress, [0, 1], [1, 0], {
135
- easing: videoEasing.exit
136
- });
137
- exitTranslateY = interpolate(exitProgress, [0, 1], [0, -20], {
138
- easing: videoEasing.exit
139
- });
140
- }
141
- const opacity = enterOpacity * exitOpacity;
142
- const translateY = enterTranslateY + exitTranslateY;
143
- return /* @__PURE__ */ jsxDEV("div", {
144
- style: {
145
- fontSize: finalStyle.fontSize,
146
- lineHeight: finalStyle.lineHeight,
147
- fontWeight: finalStyle.fontWeight,
148
- letterSpacing: finalStyle.letterSpacing,
149
- color,
150
- textAlign: align,
151
- opacity,
152
- transform: `translateY(${translateY}px)`,
153
- willChange: "opacity, transform"
154
- },
155
- children: text
156
- }, undefined, false, undefined, this);
157
- };
158
-
159
- // src/design/layouts.ts
160
- import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
161
- var DEFAULT_FPS = 30;
162
- var videoSafeZone = {
163
- horizontal: 120,
164
- vertical: 80,
165
- contentWidth: 1680,
166
- contentHeight: 920
167
- };
168
- function scaleSafeZone(format) {
169
- const scaleX = format.width / 1920;
170
- const scaleY = format.height / 1080;
171
- return {
172
- horizontal: Math.round(videoSafeZone.horizontal * scaleX),
173
- vertical: Math.round(videoSafeZone.vertical * scaleY),
174
- contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
175
- contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
176
- };
177
- }
178
- var videoPositions = {
179
- center: { x: 960, y: 540 },
180
- topLeft: { x: 120, y: 80 },
181
- topRight: { x: 1800, y: 80 },
182
- bottomLeft: { x: 120, y: 1000 },
183
- bottomRight: { x: 1800, y: 1000 },
184
- bottomCenter: { x: 960, y: 960 }
185
- };
186
- function getAllFormatVariants() {
187
- return [
188
- VIDEO_FORMATS.landscape,
189
- VIDEO_FORMATS.square,
190
- VIDEO_FORMATS.portrait
191
- ];
192
- }
193
-
194
- // src/compositions/primitives/brand-frame.tsx
195
- import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
196
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
197
- var BrandFrame = ({
198
- styleOverrides,
199
- showBranding = true,
200
- animateEntrance = true,
201
- variant = "gradient",
202
- children
203
- }) => {
204
- const frame = useCurrentFrame2();
205
- const { width, height } = useVideoConfig2();
206
- const theme = defaultVideoTheme;
207
- const safeZone = scaleSafeZone({ type: "custom", width, height });
208
- const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
209
- const _accentColor = styleOverrides?.accentColor ?? theme.colors.accent;
210
- const isDark = styleOverrides?.darkMode ?? true;
211
- let background;
212
- switch (variant) {
213
- case "solid":
214
- background = isDark ? "#0a0a0a" : theme.colors.background;
215
- break;
216
- case "gradient":
217
- background = isDark ? `linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)` : `linear-gradient(135deg, ${theme.colors.background} 0%, ${theme.colors.muted} 100%)`;
218
- break;
219
- case "dark":
220
- background = "#000000";
221
- break;
222
- }
223
- const entranceOpacity = animateEntrance ? interpolate2(frame, [0, 15], [0, 1], {
224
- extrapolateLeft: "clamp",
225
- extrapolateRight: "clamp",
226
- easing: videoEasing.entrance
227
- }) : 1;
228
- const brandOpacity = showBranding ? interpolate2(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
229
- extrapolateLeft: "clamp",
230
- extrapolateRight: "clamp"
231
- }) : 0;
232
- return /* @__PURE__ */ jsxDEV2("div", {
233
- style: {
234
- width,
235
- height,
236
- background,
237
- position: "relative",
238
- overflow: "hidden",
239
- opacity: entranceOpacity
240
- },
241
- children: [
242
- variant === "gradient" && /* @__PURE__ */ jsxDEV2("div", {
243
- style: {
244
- position: "absolute",
245
- top: "-20%",
246
- right: "-10%",
247
- width: "50%",
248
- height: "50%",
249
- background: `radial-gradient(circle, ${primaryColor}15 0%, transparent 70%)`,
250
- borderRadius: "50%",
251
- pointerEvents: "none"
252
- }
253
- }, undefined, false, undefined, this),
254
- /* @__PURE__ */ jsxDEV2("div", {
255
- style: {
256
- position: "absolute",
257
- left: safeZone.horizontal,
258
- top: safeZone.vertical,
259
- width: safeZone.contentWidth,
260
- height: safeZone.contentHeight,
261
- display: "flex",
262
- flexDirection: "column"
263
- },
264
- children
265
- }, undefined, false, undefined, this),
266
- showBranding && /* @__PURE__ */ jsxDEV2("div", {
267
- style: {
268
- position: "absolute",
269
- bottom: safeZone.vertical / 2,
270
- right: safeZone.horizontal,
271
- opacity: brandOpacity,
272
- color: isDark ? "#ffffff" : "#000000",
273
- fontSize: Math.round(16 * (width / 1920)),
274
- fontWeight: 500,
275
- letterSpacing: 1
276
- },
277
- children: "ContractSpec"
278
- }, undefined, false, undefined, this)
279
- ]
280
- }, undefined, true, 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
- };
1
+ var XG=((G)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(G,{get:(J,H)=>(typeof require<"u"?require:J)[H]}):G)(function(G){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+G+'" is not supported')});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},RG={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(G,J){let H=J/1920;return{...G,fontSize:Math.round(G.fontSize*H),letterSpacing:G.letterSpacing?Math.round(G.letterSpacing*H*10)/10:void 0}}import{interpolate as V,useCurrentFrame as l,useVideoConfig as o}from"remotion";import{jsx as s}from"react/jsx-runtime";var r=({text:G,variant:J="body",style:H,enterAt:q=0,exitAt:P,color:B="#ffffff",align:U="left"})=>{let z=l(),{width:L}=o(),$=Z[J],_={...D($,L),...H},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 s("div",{style:{fontSize:_.fontSize,lineHeight:_.lineHeight,fontWeight:_.fontWeight,letterSpacing:_.letterSpacing,color:B,textAlign:U,opacity:T,transform:`translateY(${j}px)`,willChange:"opacity, transform"},children:G})};import{VIDEO_FORMATS as x}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var TG=30,S={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function p(G){let J=G.width/1920,H=G.height/1080;return{horizontal:Math.round(S.horizontal*J),vertical:Math.round(S.vertical*H),contentWidth:Math.round(S.contentWidth*J),contentHeight:Math.round(S.contentHeight*H)}}var OG={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 SG(){return[x.landscape,x.square,x.portrait]}import{interpolate as h,useCurrentFrame as n,useVideoConfig as a}from"remotion";import{jsx as v,jsxs as t}from"react/jsx-runtime";var i=({styleOverrides:G,showBranding:J=!0,animateEntrance:H=!0,variant:q="gradient",children:P})=>{let B=n(),{width:U,height:z}=a(),L=O,$=p({type:"custom",width:U,height:z}),M=G?.primaryColor??L.colors.primary,_=G?.accentColor??L.colors.accent,K=G?.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=H?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 t("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 e,useVideoConfig as GG}from"remotion";import{jsx as w,jsxs as E}from"react/jsx-runtime";var HG=({code:G,language:J="typescript",startAt:H=0,typeAnimation:q=!0,backgroundColor:P=b.codeBackground,textColor:B="#abb2bf",filename:U})=>{let z=e(),{width:L}=GG(),$=D(Z.code,L),M=G.length,_=M*Y.codeTypingPerChar,K=q?Math.floor(y(z,[H,H+_],[0,M],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})):M,N=G.slice(0,K),Q=y(z,[H,H+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 JG,useVideoConfig as KG}from"remotion";import{jsx as u}from"react/jsx-runtime";var QG=({height:G=4,color:J=O.colors.primary,backgroundColor:H="rgba(255,255,255,0.1)",position:q="bottom"})=>{let P=JG(),{durationInFrames:B,width:U}=KG(),z=P/B;return u("div",{style:{position:"absolute",[q]:0,left:0,width:U,height:G,backgroundColor:H,zIndex:100},children:u("div",{style:{width:`${z*100}%`,height:"100%",backgroundColor:J,transition:"none"}})})};import{interpolate as f,useCurrentFrame as UG,useVideoConfig as $G}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"},qG=({lines:G,startAt:J=0,prompt:H="$ ",title:q="Terminal",backgroundColor:P=b.terminalBackground,typingSpeed:B=Y.codeTypingPerChar})=>{let U=UG(),{width:z}=$G(),L=D(Z.code,z),$=[],M=J;for(let K of G){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:G.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:H}),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 zG,useCurrentFrame as PG}from"remotion";import{jsx as c,Fragment as NG}from"react/jsx-runtime";var WG=({type:G,durationInFrames:J,direction:H,startAt:q=0,children:P})=>{let B=PG();if(G==="none"||J===0)return c(NG,{children:P});let U=zG(B,[q,q+J],H==="in"?[0,1]:[1,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),z=BG(G,U);return c("div",{style:z,children:P})};function BG(G,J){let H=X.entrance(J);switch(G){case"fade":return{opacity:H,width:"100%",height:"100%"};case"slide-left":return{opacity:H,transform:`translateX(${(1-H)*100}%)`,width:"100%",height:"100%"};case"slide-right":return{opacity:H,transform:`translateX(${(1-H)*-100}%)`,width:"100%",height:"100%"};case"wipe":return{clipPath:`inset(0 ${(1-H)*100}% 0 0)`,width:"100%",height:"100%"};default:return{width:"100%",height:"100%"}}}export{qG as Terminal,WG as SceneTransitionWrapper,QG as ProgressBar,HG as CodeBlock,i as BrandFrame,r as AnimatedText};