@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,144 +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/typography.ts
41
- var videoTypography = {
42
- title: {
43
- fontSize: 72,
44
- lineHeight: 1.1,
45
- fontWeight: 700,
46
- letterSpacing: -1
47
- },
48
- heading: {
49
- fontSize: 56,
50
- lineHeight: 1.2,
51
- fontWeight: 600,
52
- letterSpacing: -0.5
53
- },
54
- subheading: {
55
- fontSize: 40,
56
- lineHeight: 1.25,
57
- fontWeight: 500
58
- },
59
- body: {
60
- fontSize: 32,
61
- lineHeight: 1.5,
62
- fontWeight: 400
63
- },
64
- code: {
65
- fontSize: 28,
66
- lineHeight: 1.6,
67
- fontWeight: 400
68
- },
69
- caption: {
70
- fontSize: 24,
71
- lineHeight: 1.4,
72
- fontWeight: 400
73
- },
74
- label: {
75
- fontSize: 20,
76
- lineHeight: 1.3,
77
- fontWeight: 600,
78
- letterSpacing: 1
79
- }
80
- };
81
- function scaleTypography(style, targetWidth) {
82
- const scale = targetWidth / 1920;
83
- return {
84
- ...style,
85
- fontSize: Math.round(style.fontSize * scale),
86
- letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
87
- };
88
- }
89
-
90
- // src/compositions/primitives/animated-text.tsx
91
- import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
92
- import { jsxDEV } from "react/jsx-dev-runtime";
93
- var AnimatedText = ({
94
- text,
95
- variant = "body",
96
- style: styleOverride,
97
- enterAt = 0,
98
- exitAt,
99
- color = "#ffffff",
100
- align = "left"
101
- }) => {
102
- const frame = useCurrentFrame();
103
- const { width } = useVideoConfig();
104
- const baseStyle = videoTypography[variant];
105
- const scaled = scaleTypography(baseStyle, width);
106
- const finalStyle = { ...scaled, ...styleOverride };
107
- const enterProgress = interpolate(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
108
- const enterOpacity = interpolate(enterProgress, [0, 1], [0, 1], {
109
- easing: videoEasing.entrance
110
- });
111
- const enterTranslateY = interpolate(enterProgress, [0, 1], [30, 0], {
112
- easing: videoEasing.entrance
113
- });
114
- let exitOpacity = 1;
115
- let exitTranslateY = 0;
116
- if (exitAt !== undefined) {
117
- const exitProgress = interpolate(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
118
- exitOpacity = interpolate(exitProgress, [0, 1], [1, 0], {
119
- easing: videoEasing.exit
120
- });
121
- exitTranslateY = interpolate(exitProgress, [0, 1], [0, -20], {
122
- easing: videoEasing.exit
123
- });
124
- }
125
- const opacity = enterOpacity * exitOpacity;
126
- const translateY = enterTranslateY + exitTranslateY;
127
- return /* @__PURE__ */ jsxDEV("div", {
128
- style: {
129
- fontSize: finalStyle.fontSize,
130
- lineHeight: finalStyle.lineHeight,
131
- fontWeight: finalStyle.fontWeight,
132
- letterSpacing: finalStyle.letterSpacing,
133
- color,
134
- textAlign: align,
135
- opacity,
136
- transform: `translateY(${translateY}px)`,
137
- willChange: "opacity, transform"
138
- },
139
- children: text
140
- }, undefined, false, undefined, this);
141
- };
142
- export {
143
- AnimatedText
144
- };
1
+ var P=((k)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(k,{get:(G,z)=>(typeof require<"u"?require:G)[z]}):k)(function(k){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+k+'" is not supported')});import{Easing as q}from"remotion";var H={entrance:q.out(q.exp),exit:q.in(q.exp),emphasis:q.out(q.back(1.4)),linear:q.linear,gentle:q.bezier(0.25,0.1,0.25,1),spring:q.out(q.back(1.7))},K={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},h={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}};var X={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 Z(k,G){let z=G/1920;return{...k,fontSize:Math.round(k.fontSize*z),letterSpacing:k.letterSpacing?Math.round(k.letterSpacing*z*10)/10:void 0}}import{interpolate as B,useCurrentFrame as D,useVideoConfig as W}from"remotion";import{jsx as Y}from"react/jsx-runtime";var E=({text:k,variant:G="body",style:z,enterAt:L=0,exitAt:J,color:_="#ffffff",align:$="left"})=>{let M=D(),{width:F}=W(),V=X[G],I={...Z(V,F),...z},N=B(M,[L,L+K.textEntrance],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),b=B(N,[0,1],[0,1],{easing:H.entrance}),j=B(N,[0,1],[30,0],{easing:H.entrance}),Q=1,R=0;if(J!==void 0){let U=B(M,[J,J+K.textExit],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});Q=B(U,[0,1],[1,0],{easing:H.exit}),R=B(U,[0,1],[0,-20],{easing:H.exit})}let w=b*Q,C=j+R;return Y("div",{style:{fontSize:I.fontSize,lineHeight:I.lineHeight,fontWeight:I.fontWeight,letterSpacing:I.letterSpacing,color:_,textAlign:$,opacity:w,transform:`translateY(${C}px)`,willChange:"opacity, transform"},children:k})};export{E as AnimatedText};
@@ -1,181 +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/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
- export {
180
- BrandFrame
181
- };
1
+ var w=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(H,J)=>(typeof require<"u"?require:H)[J]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});import{Easing as G}from"remotion";var M={entrance:G.out(G.exp),exit:G.in(G.exp),emphasis:G.out(G.back(1.4)),linear:G.linear,gentle:G.bezier(0.25,0.1,0.25,1),spring:G.out(G.back(1.7))},z={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},Z={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 N}from"@contractspec/lib.design-system";var V={canvasBackground:N.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:N.colors.accent,gradientStart:N.colors.primary,gradientEnd:N.colors.accent},R={...N,video:V};import{VIDEO_FORMATS as P}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var h=30,U={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function _(q){let H=q.width/1920,J=q.height/1080;return{horizontal:Math.round(U.horizontal*H),vertical:Math.round(U.vertical*J),contentWidth:Math.round(U.contentWidth*H),contentHeight:Math.round(U.contentHeight*J)}}var u={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 m(){return[P.landscape,P.square,P.portrait]}import{interpolate as j,useCurrentFrame as p,useVideoConfig as D}from"remotion";import{jsx as X,jsxs as S}from"react/jsx-runtime";var r=({styleOverrides:q,showBranding:H=!0,animateEntrance:J=!0,variant:Y="gradient",children:B})=>{let A=p(),{width:W,height:I}=D(),L=R,K=_({type:"custom",width:W,height:I}),F=q?.primaryColor??L.colors.primary,b=q?.accentColor??L.colors.accent,$=q?.darkMode??!0,Q;switch(Y){case"solid":Q=$?"#0a0a0a":L.colors.background;break;case"gradient":Q=$?"linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)":`linear-gradient(135deg, ${L.colors.background} 0%, ${L.colors.muted} 100%)`;break;case"dark":Q="#000000";break}let x=J?j(A,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:M.entrance}):1,C=H?j(A,[z.brandReveal,z.brandReveal+15],[0,0.3],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}):0;return S("div",{style:{width:W,height:I,background:Q,position:"relative",overflow:"hidden",opacity:x},children:[Y==="gradient"&&X("div",{style:{position:"absolute",top:"-20%",right:"-10%",width:"50%",height:"50%",background:`radial-gradient(circle, ${F}15 0%, transparent 70%)`,borderRadius:"50%",pointerEvents:"none"}}),X("div",{style:{position:"absolute",left:K.horizontal,top:K.vertical,width:K.contentWidth,height:K.contentHeight,display:"flex",flexDirection:"column"},children:B}),H&&X("div",{style:{position:"absolute",bottom:K.vertical/2,right:K.horizontal,opacity:C,color:$?"#ffffff":"#000000",fontSize:Math.round(16*(W/1920)),fontWeight:500,letterSpacing:1},children:"ContractSpec"})]})};export{r as BrandFrame};
@@ -1,226 +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/code-block.tsx
107
- import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
108
- import { jsxDEV } from "react/jsx-dev-runtime";
109
- var CodeBlock = ({
110
- code,
111
- language = "typescript",
112
- startAt = 0,
113
- typeAnimation = true,
114
- backgroundColor = defaultVideoColors.codeBackground,
115
- textColor = "#abb2bf",
116
- filename
117
- }) => {
118
- const frame = useCurrentFrame();
119
- const { width } = useVideoConfig();
120
- const codeStyle = scaleTypography(videoTypography.code, width);
121
- const totalChars = code.length;
122
- const typingDuration = totalChars * videoDurations.codeTypingPerChar;
123
- const charsVisible = typeAnimation ? Math.floor(interpolate(frame, [startAt, startAt + typingDuration], [0, totalChars], {
124
- extrapolateLeft: "clamp",
125
- extrapolateRight: "clamp"
126
- })) : totalChars;
127
- const visibleCode = code.slice(0, charsVisible);
128
- const opacity = interpolate(frame, [startAt, startAt + 10], [0, 1], {
129
- extrapolateLeft: "clamp",
130
- extrapolateRight: "clamp",
131
- easing: videoEasing.entrance
132
- });
133
- const showCursor = typeAnimation && charsVisible < totalChars && frame % 16 < 10;
134
- return /* @__PURE__ */ jsxDEV("div", {
135
- style: {
136
- backgroundColor,
137
- borderRadius: 16,
138
- padding: 0,
139
- opacity,
140
- overflow: "hidden",
141
- boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
142
- },
143
- children: [
144
- /* @__PURE__ */ jsxDEV("div", {
145
- style: {
146
- display: "flex",
147
- alignItems: "center",
148
- padding: "12px 20px",
149
- backgroundColor: "rgba(0,0,0,0.2)",
150
- gap: 8
151
- },
152
- children: [
153
- /* @__PURE__ */ jsxDEV("div", {
154
- style: { display: "flex", gap: 8 },
155
- children: [
156
- /* @__PURE__ */ jsxDEV("div", {
157
- style: {
158
- width: 12,
159
- height: 12,
160
- borderRadius: "50%",
161
- backgroundColor: "#ff5f57"
162
- }
163
- }, undefined, false, undefined, this),
164
- /* @__PURE__ */ jsxDEV("div", {
165
- style: {
166
- width: 12,
167
- height: 12,
168
- borderRadius: "50%",
169
- backgroundColor: "#febc2e"
170
- }
171
- }, undefined, false, undefined, this),
172
- /* @__PURE__ */ jsxDEV("div", {
173
- style: {
174
- width: 12,
175
- height: 12,
176
- borderRadius: "50%",
177
- backgroundColor: "#28c840"
178
- }
179
- }, undefined, false, undefined, this)
180
- ]
181
- }, undefined, true, undefined, this),
182
- /* @__PURE__ */ jsxDEV("div", {
183
- style: {
184
- flex: 1,
185
- textAlign: "center",
186
- color: "#666",
187
- fontSize: codeStyle.fontSize * 0.7,
188
- fontFamily: "monospace"
189
- },
190
- children: filename ?? language
191
- }, undefined, false, undefined, this)
192
- ]
193
- }, undefined, true, undefined, this),
194
- /* @__PURE__ */ jsxDEV("div", {
195
- style: { padding: "24px 32px" },
196
- children: /* @__PURE__ */ jsxDEV("pre", {
197
- style: {
198
- margin: 0,
199
- fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
200
- fontSize: codeStyle.fontSize,
201
- lineHeight: codeStyle.lineHeight,
202
- color: textColor,
203
- whiteSpace: "pre-wrap",
204
- wordBreak: "break-word"
205
- },
206
- children: [
207
- visibleCode,
208
- showCursor && /* @__PURE__ */ jsxDEV("span", {
209
- style: {
210
- backgroundColor: textColor,
211
- width: "2px",
212
- display: "inline-block",
213
- height: "1.2em",
214
- verticalAlign: "text-bottom"
215
- },
216
- children: " "
217
- }, undefined, false, undefined, this)
218
- ]
219
- }, undefined, true, undefined, this)
220
- }, undefined, false, undefined, this)
221
- ]
222
- }, undefined, true, undefined, this);
223
- };
224
- export {
225
- CodeBlock
226
- };
1
+ var b=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(H,B)=>(typeof require<"u"?require:H)[B]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});import{Easing as z}from"remotion";var U={entrance:z.out(z.exp),exit:z.in(z.exp),emphasis:z.out(z.back(1.4)),linear:z.linear,gentle:z.bezier(0.25,0.1,0.25,1),spring:z.out(z.back(1.7))},X={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},T={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 I}from"@contractspec/lib.design-system";var N={canvasBackground:I.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:I.colors.accent,gradientStart:I.colors.primary,gradientEnd:I.colors.accent},x={...I,video:N};var Y={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 Z(q,H){let B=H/1920;return{...q,fontSize:Math.round(q.fontSize*B),letterSpacing:q.letterSpacing?Math.round(q.letterSpacing*B*10)/10:void 0}}import{interpolate as _,useCurrentFrame as V,useVideoConfig as v}from"remotion";import{jsx as G,jsxs as K}from"react/jsx-runtime";var y=({code:q,language:H="typescript",startAt:B=0,typeAnimation:O=!0,backgroundColor:$=N.codeBackground,textColor:Q="#abb2bf",filename:P})=>{let L=V(),{width:D}=v(),M=Z(Y.code,D),J=q.length,F=J*X.codeTypingPerChar,R=O?Math.floor(_(L,[B,B+F],[0,J],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})):J,W=q.slice(0,R),w=_(L,[B,B+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:U.entrance}),S=O&&R<J&&L%16<10;return K("div",{style:{backgroundColor:$,borderRadius:16,padding:0,opacity:w,overflow:"hidden",boxShadow:"0 8px 32px rgba(0,0,0,0.3)"},children:[K("div",{style:{display:"flex",alignItems:"center",padding:"12px 20px",backgroundColor:"rgba(0,0,0,0.2)",gap:8},children:[K("div",{style:{display:"flex",gap:8},children:[G("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#ff5f57"}}),G("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#febc2e"}}),G("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#28c840"}})]}),G("div",{style:{flex:1,textAlign:"center",color:"#666",fontSize:M.fontSize*0.7,fontFamily:"monospace"},children:P??H})]}),G("div",{style:{padding:"24px 32px"},children:K("pre",{style:{margin:0,fontFamily:"'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",fontSize:M.fontSize,lineHeight:M.lineHeight,color:Q,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[W,S&&G("span",{style:{backgroundColor:Q,width:"2px",display:"inline-block",height:"1.2em",verticalAlign:"text-bottom"},children:" "})]})})]})};export{y as CodeBlock};