@vanillaskyai/video 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/LICENSE +201 -0
- package/PUBLIC-API.md +276 -0
- package/README.md +152 -0
- package/SECURITY.md +22 -0
- package/SUPPORT.md +28 -0
- package/bin/vanillasky.js +3 -0
- package/dist/bg-confetti-WNQXS7ZS.js +89 -0
- package/dist/bg-emoji-ETI47GLS.js +150 -0
- package/dist/bg-media-SVUZAMGX.js +99 -0
- package/dist/brand-message-F3RD4P3P.js +253 -0
- package/dist/builtin-server-F7YXRVCH.js +8 -0
- package/dist/catalog-types-BIhSpOWK.d.ts +74 -0
- package/dist/chart-bar-CNSC7BNK.js +304 -0
- package/dist/chart-counter-MCRHKN77.js +299 -0
- package/dist/chart-progress-ring-RMI4A7ZK.js +296 -0
- package/dist/check-runtime.d.ts +15 -0
- package/dist/check-runtime.js +102 -0
- package/dist/chunk-2E6T633S.js +27 -0
- package/dist/chunk-352ZZCET.js +83 -0
- package/dist/chunk-73NTSFFI.js +81 -0
- package/dist/chunk-A2X45FET.js +46 -0
- package/dist/chunk-ABPKM4GK.js +187 -0
- package/dist/chunk-ABZACD4G.js +216 -0
- package/dist/chunk-BCRUUJ6A.js +756 -0
- package/dist/chunk-CHLGW22F.js +3551 -0
- package/dist/chunk-CJ7F2CE6.js +104 -0
- package/dist/chunk-CR7FE7BW.js +109 -0
- package/dist/chunk-E7CL7UPB.js +109 -0
- package/dist/chunk-EE6PK6XC.js +18 -0
- package/dist/chunk-ERY4S6QV.js +385 -0
- package/dist/chunk-EVG2ZYIY.js +125 -0
- package/dist/chunk-FNAEQ7QO.js +155 -0
- package/dist/chunk-FQ47WXAJ.js +38 -0
- package/dist/chunk-FSG2PYWG.js +336 -0
- package/dist/chunk-GHJEAP4O.js +504 -0
- package/dist/chunk-GRMUV7QY.js +262 -0
- package/dist/chunk-IFOW65Z6.js +205 -0
- package/dist/chunk-IXCUY3B3.js +786 -0
- package/dist/chunk-L5BTTCZV.js +97 -0
- package/dist/chunk-LMG3GHLL.js +107 -0
- package/dist/chunk-OOPIETLW.js +101 -0
- package/dist/chunk-P22HHFDK.js +43 -0
- package/dist/chunk-QAAO7OAY.js +19 -0
- package/dist/chunk-S7HFLYNN.js +35 -0
- package/dist/chunk-SPVTJH3F.js +24 -0
- package/dist/chunk-W2XJKG6C.js +3177 -0
- package/dist/chunk-XB7LH4J2.js +301 -0
- package/dist/chunk-XGRA2MUV.js +242 -0
- package/dist/chunk-XTOXFMLM.js +105 -0
- package/dist/chunk-YC5MFXA5.js +132 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1681 -0
- package/dist/compose-video-CN3VSWST.js +13 -0
- package/dist/cta-logo-SVA5GP2A.js +209 -0
- package/dist/cta-media-E7VLLK42.js +215 -0
- package/dist/events-_wfjbmEp.d.ts +81 -0
- package/dist/incoming-call-62MFZL3Z.js +320 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +14 -0
- package/dist/infographic-before-after-AXCDAWND.js +460 -0
- package/dist/infographic-feature-list-GW5GUE6O.js +266 -0
- package/dist/infographic-problem-solution-7NURJANA.js +340 -0
- package/dist/infographic-stat-row-J7IZR6ZN.js +241 -0
- package/dist/infographic-steps-VSZM6F5M.js +400 -0
- package/dist/kit-BMNcHqa9.d.ts +79 -0
- package/dist/prompt-input-LOUCRXCY.js +236 -0
- package/dist/react.d.ts +81 -0
- package/dist/react.js +835 -0
- package/dist/reaction-QG4CYZLQ.js +119 -0
- package/dist/server.d.ts +141 -0
- package/dist/server.js +498 -0
- package/dist/showcase-code-RUTFZR3H.js +351 -0
- package/dist/showcase-phone-6CP6XEU5.js +272 -0
- package/dist/showcase-terminal-MGAEQWPR.js +306 -0
- package/dist/showcase-web-Y4W2HVRJ.js +390 -0
- package/dist/social-conversation-75SD2637.js +695 -0
- package/dist/social-milestone-XI2QE5BO.js +292 -0
- package/dist/social-notification-2UOHQCUY.js +244 -0
- package/dist/social-review-stack-FDYZGZTJ.js +239 -0
- package/dist/social-testimonial-OQ7N52GJ.js +284 -0
- package/dist/social-tweet-5OLCNPPC.js +295 -0
- package/dist/state-DZcKuS32.d.ts +3 -0
- package/dist/system-prompt-A6UXNTPK.js +8 -0
- package/dist/template-catalog.d.ts +24 -0
- package/dist/template-catalog.js +6 -0
- package/dist/templates.d.ts +25 -0
- package/dist/templates.js +19 -0
- package/dist/test.d.ts +149 -0
- package/dist/test.js +272 -0
- package/dist/text-stream-6XHC7J47.js +10 -0
- package/dist/types-B-PZR6G_.d.ts +208 -0
- package/dist/validate-T7GBU2YF.js +8 -0
- package/docs/agent-integration.md +39 -0
- package/docs/architecture.md +84 -0
- package/docs/branding-and-personalization.md +87 -0
- package/docs/concepts.md +106 -0
- package/docs/custom-templates.md +329 -0
- package/docs/customization.md +141 -0
- package/docs/errors.md +70 -0
- package/docs/getting-started.md +111 -0
- package/docs/input-and-first-scene.md +41 -0
- package/docs/integrate-nextjs.md +79 -0
- package/docs/media-and-audio.md +69 -0
- package/docs/motion-and-effects.md +107 -0
- package/docs/persistence.md +95 -0
- package/docs/production.md +122 -0
- package/docs/prompt-and-input.md +185 -0
- package/docs/provider-integration.md +115 -0
- package/docs/reference/protocol.md +96 -0
- package/docs/reference/provider-adapters.md +158 -0
- package/docs/responsive-orientation.md +37 -0
- package/docs/security.md +38 -0
- package/docs/streaming-protocol.md +15 -0
- package/docs/testing.md +137 -0
- package/docs/use-cases.md +59 -0
- package/examples/custom-template/README.md +19 -0
- package/examples/custom-template/minimal-text.tsx +82 -0
- package/examples/custom-template/structured-data.tsx +104 -0
- package/examples/custom-template/supplied-media.tsx +92 -0
- package/examples/nextjs-quickstart/.env.example +2 -0
- package/examples/nextjs-quickstart/README.md +22 -0
- package/examples/nextjs-quickstart/next-env.d.ts +4 -0
- package/examples/nextjs-quickstart/package.json +24 -0
- package/examples/nextjs-quickstart/src/app/api/video/route.ts +22 -0
- package/examples/nextjs-quickstart/src/app/layout.tsx +5 -0
- package/examples/nextjs-quickstart/src/app/page.tsx +31 -0
- package/examples/nextjs-quickstart/tsconfig.json +26 -0
- package/package.json +167 -0
- package/registry/items/backgrounds.json +52 -0
- package/registry/items/barChart.json +237 -0
- package/registry/items/beforeAfter.json +180 -0
- package/registry/items/bigNumber.json +225 -0
- package/registry/items/brandMessage.json +158 -0
- package/registry/items/cardList.json +206 -0
- package/registry/items/chatMessenger.json +151 -0
- package/registry/items/chatWhatsapp.json +151 -0
- package/registry/items/codeEditor.json +184 -0
- package/registry/items/confetti.json +107 -0
- package/registry/items/ctaLogo.json +160 -0
- package/registry/items/ctaMedia.json +193 -0
- package/registry/items/emojiBurst.json +101 -0
- package/registry/items/incomingCall.json +170 -0
- package/registry/items/media.json +179 -0
- package/registry/items/milestone.json +205 -0
- package/registry/items/motion.json +45 -0
- package/registry/items/notification.json +182 -0
- package/registry/items/phoneMockup.json +254 -0
- package/registry/items/problemSolution.json +186 -0
- package/registry/items/progressRing.json +199 -0
- package/registry/items/promptInput.json +148 -0
- package/registry/items/reaction.json +170 -0
- package/registry/items/reviewStack.json +224 -0
- package/registry/items/steps.json +207 -0
- package/registry/items/template-context.json +31 -0
- package/registry/items/terminal.json +212 -0
- package/registry/items/testimonial.json +164 -0
- package/registry/items/theme.json +47 -0
- package/registry/items/tripleStats.json +228 -0
- package/registry/items/tweet.json +203 -0
- package/registry/items/typography.json +47 -0
- package/registry/items/webMockup.json +273 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createVideo
|
|
3
|
+
} from "./chunk-IXCUY3B3.js";
|
|
4
|
+
import "./chunk-E7CL7UPB.js";
|
|
5
|
+
import "./chunk-ABPKM4GK.js";
|
|
6
|
+
import "./chunk-ERY4S6QV.js";
|
|
7
|
+
import "./chunk-GHJEAP4O.js";
|
|
8
|
+
import "./chunk-EE6PK6XC.js";
|
|
9
|
+
import "./chunk-EVG2ZYIY.js";
|
|
10
|
+
import "./chunk-XGRA2MUV.js";
|
|
11
|
+
export {
|
|
12
|
+
createVideo
|
|
13
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fitTextSize
|
|
3
|
+
} from "./chunk-S7HFLYNN.js";
|
|
4
|
+
import {
|
|
5
|
+
SceneBackground,
|
|
6
|
+
getMediaBackgroundProps
|
|
7
|
+
} from "./chunk-IFOW65Z6.js";
|
|
8
|
+
import "./chunk-ABZACD4G.js";
|
|
9
|
+
import {
|
|
10
|
+
SPRING_SMOOTH,
|
|
11
|
+
interpolate,
|
|
12
|
+
spring
|
|
13
|
+
} from "./chunk-XTOXFMLM.js";
|
|
14
|
+
import {
|
|
15
|
+
TOKEN_DEFAULTS,
|
|
16
|
+
resolveTokens
|
|
17
|
+
} from "./chunk-FNAEQ7QO.js";
|
|
18
|
+
|
|
19
|
+
// src/visual-system/primitives/typography/WordmarkReveal.tsx
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var WordmarkReveal = ({
|
|
22
|
+
progress,
|
|
23
|
+
brandName,
|
|
24
|
+
url = "",
|
|
25
|
+
cta = "",
|
|
26
|
+
logoUrl = "",
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
font = TOKEN_DEFAULTS.font,
|
|
30
|
+
textColor = "#ffffff"
|
|
31
|
+
}) => {
|
|
32
|
+
const s = Math.min(width, height) / 1080;
|
|
33
|
+
const actionText = cta.trim();
|
|
34
|
+
const addressText = url.trim();
|
|
35
|
+
const landP = spring(
|
|
36
|
+
interpolate(progress, [0, 0.85], [0, 1], {
|
|
37
|
+
extrapolateLeft: "clamp",
|
|
38
|
+
extrapolateRight: "clamp"
|
|
39
|
+
}),
|
|
40
|
+
SPRING_SMOOTH
|
|
41
|
+
);
|
|
42
|
+
const logoZoom = 0.94 + 0.14 * landP;
|
|
43
|
+
const itemOpacity = interpolate(progress, [0, 0.3], [0, 1], {
|
|
44
|
+
extrapolateLeft: "clamp",
|
|
45
|
+
extrapolateRight: "clamp"
|
|
46
|
+
});
|
|
47
|
+
const wordmarkTracking = `${interpolate(landP, [0, 1], [0.4, -0.02])}em`;
|
|
48
|
+
const actionTracking = `${interpolate(landP, [0, 1], [0.12, -0.01])}em`;
|
|
49
|
+
const urlTracking = `${interpolate(landP, [0, 1], [0.2, 0.01])}em`;
|
|
50
|
+
const logoWidth = width * 0.6;
|
|
51
|
+
const logoMaxHeight = height * 0.3;
|
|
52
|
+
const wordmarkSize = fitTextSize(brandName, 96 * s, width * 0.9);
|
|
53
|
+
const actionFontSize = fitTextSize(actionText, 48 * s, width * 0.9);
|
|
54
|
+
const urlFontSize = fitTextSize(addressText, actionText ? 34 * s : 48 * s, width * 0.9);
|
|
55
|
+
const bottomGap = 48 * s;
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
style: {
|
|
60
|
+
position: "absolute",
|
|
61
|
+
inset: 0,
|
|
62
|
+
display: "flex",
|
|
63
|
+
flexDirection: "column",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
gap: bottomGap,
|
|
67
|
+
padding: `0 ${48 * s}px`,
|
|
68
|
+
fontFamily: font
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
logoUrl ? /* @__PURE__ */ jsx(
|
|
72
|
+
"img",
|
|
73
|
+
{
|
|
74
|
+
src: logoUrl,
|
|
75
|
+
alt: brandName,
|
|
76
|
+
style: {
|
|
77
|
+
width: logoWidth,
|
|
78
|
+
maxHeight: logoMaxHeight,
|
|
79
|
+
objectFit: "contain",
|
|
80
|
+
transform: `scale(${logoZoom})`,
|
|
81
|
+
transformOrigin: "center center",
|
|
82
|
+
opacity: itemOpacity,
|
|
83
|
+
display: "block"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
) : /* @__PURE__ */ jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
style: {
|
|
90
|
+
fontSize: wordmarkSize,
|
|
91
|
+
fontWeight: 800,
|
|
92
|
+
color: textColor,
|
|
93
|
+
letterSpacing: wordmarkTracking,
|
|
94
|
+
lineHeight: 1.05,
|
|
95
|
+
textAlign: "center",
|
|
96
|
+
transform: `scale(${logoZoom})`,
|
|
97
|
+
transformOrigin: "center center",
|
|
98
|
+
opacity: itemOpacity,
|
|
99
|
+
textShadow: "0 1px 6px rgba(0,0,0,0.25)"
|
|
100
|
+
},
|
|
101
|
+
children: brandName
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
(actionText || addressText) && /* @__PURE__ */ jsxs(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
style: {
|
|
108
|
+
display: "flex",
|
|
109
|
+
flexDirection: "column",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
gap: 12 * s,
|
|
112
|
+
opacity: itemOpacity * 0.92,
|
|
113
|
+
transform: `scale(${0.96 + 0.04 * landP})`,
|
|
114
|
+
transformOrigin: "center center"
|
|
115
|
+
},
|
|
116
|
+
children: [
|
|
117
|
+
actionText && /* @__PURE__ */ jsx("div", { style: {
|
|
118
|
+
fontSize: actionFontSize,
|
|
119
|
+
fontWeight: 700,
|
|
120
|
+
color: textColor,
|
|
121
|
+
textAlign: "center",
|
|
122
|
+
letterSpacing: actionTracking,
|
|
123
|
+
textShadow: "0 1px 6px rgba(0,0,0,0.25)"
|
|
124
|
+
}, children: actionText }),
|
|
125
|
+
addressText && /* @__PURE__ */ jsx("div", { style: {
|
|
126
|
+
fontSize: urlFontSize,
|
|
127
|
+
fontWeight: 500,
|
|
128
|
+
color: textColor,
|
|
129
|
+
textAlign: "center",
|
|
130
|
+
letterSpacing: urlTracking,
|
|
131
|
+
opacity: actionText ? 0.78 : 1,
|
|
132
|
+
textShadow: "0 1px 6px rgba(0,0,0,0.25)"
|
|
133
|
+
}, children: addressText })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// src/visual-system/scene-templates/cta-logo.tsx
|
|
143
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
144
|
+
var CtaLogoTemplate = ({
|
|
145
|
+
variables,
|
|
146
|
+
style,
|
|
147
|
+
progress,
|
|
148
|
+
motionProgress = progress,
|
|
149
|
+
width,
|
|
150
|
+
height,
|
|
151
|
+
sceneDuration,
|
|
152
|
+
isPlaying
|
|
153
|
+
}) => {
|
|
154
|
+
const { foreground, font } = resolveTokens(style);
|
|
155
|
+
const textColor = foreground;
|
|
156
|
+
const brandName = style.brand.name ?? "";
|
|
157
|
+
const url = String(variables.url || "");
|
|
158
|
+
const cta = String(variables.cta || "");
|
|
159
|
+
const logoUrl = style.brand.logoUrl ?? "";
|
|
160
|
+
const mediaUrl = String(variables.mediaUrl || "");
|
|
161
|
+
const mediaType = String(variables.mediaType || "auto");
|
|
162
|
+
return /* @__PURE__ */ jsxs2(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
style: {
|
|
166
|
+
width,
|
|
167
|
+
height,
|
|
168
|
+
backgroundColor: "#000",
|
|
169
|
+
position: "relative",
|
|
170
|
+
overflow: "hidden",
|
|
171
|
+
fontFamily: font
|
|
172
|
+
},
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsx2(
|
|
175
|
+
SceneBackground,
|
|
176
|
+
{
|
|
177
|
+
style,
|
|
178
|
+
progress,
|
|
179
|
+
sceneDuration,
|
|
180
|
+
width,
|
|
181
|
+
height,
|
|
182
|
+
...getMediaBackgroundProps(variables),
|
|
183
|
+
mediaUrl,
|
|
184
|
+
mediaType,
|
|
185
|
+
seed: brandName,
|
|
186
|
+
isPlaying
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ jsx2(
|
|
190
|
+
WordmarkReveal,
|
|
191
|
+
{
|
|
192
|
+
progress: motionProgress,
|
|
193
|
+
brandName,
|
|
194
|
+
url,
|
|
195
|
+
cta,
|
|
196
|
+
logoUrl,
|
|
197
|
+
width,
|
|
198
|
+
height,
|
|
199
|
+
font,
|
|
200
|
+
textColor
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
export {
|
|
208
|
+
CtaLogoTemplate
|
|
209
|
+
};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fitTextSize,
|
|
3
|
+
stripPipe
|
|
4
|
+
} from "./chunk-S7HFLYNN.js";
|
|
5
|
+
import {
|
|
6
|
+
SceneBackground,
|
|
7
|
+
getMediaBackgroundProps
|
|
8
|
+
} from "./chunk-IFOW65Z6.js";
|
|
9
|
+
import {
|
|
10
|
+
TemplateText
|
|
11
|
+
} from "./chunk-BCRUUJ6A.js";
|
|
12
|
+
import "./chunk-L5BTTCZV.js";
|
|
13
|
+
import "./chunk-ABZACD4G.js";
|
|
14
|
+
import {
|
|
15
|
+
SPRING_SMOOTH,
|
|
16
|
+
interpolate,
|
|
17
|
+
spring
|
|
18
|
+
} from "./chunk-XTOXFMLM.js";
|
|
19
|
+
import {
|
|
20
|
+
TOKEN_DEFAULTS,
|
|
21
|
+
resolveTokens
|
|
22
|
+
} from "./chunk-FNAEQ7QO.js";
|
|
23
|
+
|
|
24
|
+
// src/visual-system/primitives/typography/CtaMediaClose.tsx
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
var CLAMP = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
|
|
27
|
+
var CtaMediaClose = ({
|
|
28
|
+
progress,
|
|
29
|
+
motionProgress = progress,
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
brandName: rawBrandName,
|
|
33
|
+
logoUrl = "",
|
|
34
|
+
url: rawUrl = "",
|
|
35
|
+
cta: rawCta = "",
|
|
36
|
+
font = TOKEN_DEFAULTS.font,
|
|
37
|
+
textColor = "#ffffff",
|
|
38
|
+
safeZone = { left: 0, right: 0 }
|
|
39
|
+
}) => {
|
|
40
|
+
const s = Math.min(width, height) / 1080;
|
|
41
|
+
const brandName = stripPipe(String(rawBrandName || ""));
|
|
42
|
+
const url = stripPipe(String(rawUrl || ""));
|
|
43
|
+
const cta = stripPipe(String(rawCta || ""));
|
|
44
|
+
const fadeP = interpolate(motionProgress, [0, 0.3], [0, 1], CLAMP);
|
|
45
|
+
const scaleSpring = spring(fadeP, SPRING_SMOOTH);
|
|
46
|
+
const itemOpacity = fadeP;
|
|
47
|
+
const itemScale = 0.94 + 0.06 * scaleSpring;
|
|
48
|
+
const landP = spring(
|
|
49
|
+
interpolate(motionProgress, [0, 0.85], [0, 1], CLAMP),
|
|
50
|
+
SPRING_SMOOTH
|
|
51
|
+
);
|
|
52
|
+
const logoZoom = 0.94 + 0.14 * landP;
|
|
53
|
+
const logoWidth = width * 0.6;
|
|
54
|
+
const logoMaxHeight = height * 0.22;
|
|
55
|
+
const logoTop = height * 0.13;
|
|
56
|
+
const wordmarkFontSize = Math.min(width * 0.1, height * 0.1);
|
|
57
|
+
const bottomMaxWidth = width - Math.max(safeZone.left, safeZone.right) * 2;
|
|
58
|
+
const ctaFontSize = fitTextSize(cta, 48 * s, bottomMaxWidth);
|
|
59
|
+
const urlFontSize = fitTextSize(url, cta ? 34 * s : 48 * s, bottomMaxWidth);
|
|
60
|
+
const bottomOffset = height * 0.18;
|
|
61
|
+
return /* @__PURE__ */ jsxs(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
style: {
|
|
65
|
+
position: "absolute",
|
|
66
|
+
inset: 0,
|
|
67
|
+
pointerEvents: "none",
|
|
68
|
+
fontFamily: font
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
logoUrl ? /* @__PURE__ */ jsx(
|
|
72
|
+
"img",
|
|
73
|
+
{
|
|
74
|
+
src: logoUrl,
|
|
75
|
+
alt: brandName || "logo",
|
|
76
|
+
style: {
|
|
77
|
+
position: "absolute",
|
|
78
|
+
top: logoTop,
|
|
79
|
+
left: "50%",
|
|
80
|
+
width: logoWidth,
|
|
81
|
+
maxHeight: logoMaxHeight,
|
|
82
|
+
objectFit: "contain",
|
|
83
|
+
transform: `translateX(-50%) scale(${logoZoom})`,
|
|
84
|
+
transformOrigin: "center center",
|
|
85
|
+
opacity: itemOpacity
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
) : brandName && /* @__PURE__ */ jsx(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
style: {
|
|
92
|
+
position: "absolute",
|
|
93
|
+
top: logoTop,
|
|
94
|
+
left: 0,
|
|
95
|
+
right: 0,
|
|
96
|
+
textAlign: "center",
|
|
97
|
+
color: textColor,
|
|
98
|
+
fontSize: wordmarkFontSize,
|
|
99
|
+
fontWeight: 700,
|
|
100
|
+
letterSpacing: -0.5,
|
|
101
|
+
transform: `scale(${logoZoom})`,
|
|
102
|
+
transformOrigin: "center center",
|
|
103
|
+
opacity: itemOpacity,
|
|
104
|
+
textShadow: "0 2px 12px rgba(0,0,0,0.32)"
|
|
105
|
+
},
|
|
106
|
+
children: brandName
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
(cta || url) && /* @__PURE__ */ jsxs(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
style: {
|
|
113
|
+
position: "absolute",
|
|
114
|
+
left: 0,
|
|
115
|
+
right: 0,
|
|
116
|
+
bottom: bottomOffset,
|
|
117
|
+
display: "flex",
|
|
118
|
+
flexDirection: "column",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
gap: 12 * s,
|
|
121
|
+
textAlign: "center",
|
|
122
|
+
color: textColor,
|
|
123
|
+
opacity: itemOpacity * 0.92,
|
|
124
|
+
transform: `scale(${itemScale})`,
|
|
125
|
+
transformOrigin: "center center",
|
|
126
|
+
textShadow: "0 1px 4px rgba(0,0,0,0.35)"
|
|
127
|
+
},
|
|
128
|
+
children: [
|
|
129
|
+
cta && /* @__PURE__ */ jsx("div", { style: { fontSize: ctaFontSize, fontWeight: 700, letterSpacing: -0.3 }, children: cta }),
|
|
130
|
+
url && /* @__PURE__ */ jsx("div", { style: { fontSize: urlFontSize, fontWeight: 500, letterSpacing: 0.5, opacity: cta ? 0.78 : 1 }, children: url })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// src/visual-system/scene-templates/cta-media.tsx
|
|
140
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
141
|
+
var CtaMediaTemplate = ({
|
|
142
|
+
variables,
|
|
143
|
+
style,
|
|
144
|
+
progress,
|
|
145
|
+
motionProgress = progress,
|
|
146
|
+
width,
|
|
147
|
+
height,
|
|
148
|
+
sceneDuration,
|
|
149
|
+
beatIntensity,
|
|
150
|
+
textArchetype,
|
|
151
|
+
safeZone,
|
|
152
|
+
isPlaying = true,
|
|
153
|
+
backgroundEffect
|
|
154
|
+
}) => {
|
|
155
|
+
const { primary, foreground, font } = resolveTokens(style);
|
|
156
|
+
const textColor = foreground;
|
|
157
|
+
const headline = String(variables.headline || "");
|
|
158
|
+
return /* @__PURE__ */ jsxs2("div", { style: { width, height, backgroundColor: "#000", position: "relative", overflow: "hidden", fontFamily: font }, children: [
|
|
159
|
+
/* @__PURE__ */ jsx2(
|
|
160
|
+
SceneBackground,
|
|
161
|
+
{
|
|
162
|
+
style,
|
|
163
|
+
progress,
|
|
164
|
+
sceneDuration,
|
|
165
|
+
width,
|
|
166
|
+
height,
|
|
167
|
+
...getMediaBackgroundProps(variables),
|
|
168
|
+
backgroundEffect,
|
|
169
|
+
seed: headline,
|
|
170
|
+
isPlaying,
|
|
171
|
+
beatIntensity
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ jsx2(
|
|
175
|
+
TemplateText,
|
|
176
|
+
{
|
|
177
|
+
motionProgress,
|
|
178
|
+
typeTreatment: resolveTokens(style).preset.type,
|
|
179
|
+
archetype: textArchetype || "subtle",
|
|
180
|
+
text: headline,
|
|
181
|
+
progress,
|
|
182
|
+
sceneDuration: sceneDuration ?? 4,
|
|
183
|
+
width,
|
|
184
|
+
height,
|
|
185
|
+
position: "center",
|
|
186
|
+
sizeRole: "headline",
|
|
187
|
+
safeZone,
|
|
188
|
+
font,
|
|
189
|
+
color: textColor,
|
|
190
|
+
beatIntensity
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsx2(
|
|
194
|
+
CtaMediaClose,
|
|
195
|
+
{
|
|
196
|
+
progress,
|
|
197
|
+
motionProgress,
|
|
198
|
+
width,
|
|
199
|
+
height,
|
|
200
|
+
brandName: style.brand.name ?? "",
|
|
201
|
+
logoUrl: style.brand.logoUrl ?? "",
|
|
202
|
+
url: String(variables.url || ""),
|
|
203
|
+
cta: String(variables.cta || ""),
|
|
204
|
+
font,
|
|
205
|
+
textColor,
|
|
206
|
+
accent: primary,
|
|
207
|
+
beatIntensity,
|
|
208
|
+
safeZone: { left: safeZone.left, right: safeZone.right }
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
] });
|
|
212
|
+
};
|
|
213
|
+
export {
|
|
214
|
+
CtaMediaTemplate
|
|
215
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { e as VideoOrientation, g as VideoStyle, V as Video, j as VideoCapabilities, a as VideoAudio, f as VideoScene, k as VIDEO_PROTOCOL_VERSION } from './types-B-PZR6G_.js';
|
|
2
|
+
|
|
3
|
+
type VideoWarningCategory = "validation" | "readability" | "grounding" | "provider" | "media" | "protocol";
|
|
4
|
+
type VideoWarningCode = "scene_duration_adjusted" | "scene_omitted_unreadable" | "scene_omitted_for_closer" | "scene_patch_rejected_readability" | "chart_scale_imbalance" | "provider_warning" | "provider_diagnostics_unavailable";
|
|
5
|
+
/** A bounded, client-safe diagnostic that never includes provider payloads. */
|
|
6
|
+
interface VideoWarning {
|
|
7
|
+
code: VideoWarningCode;
|
|
8
|
+
category: VideoWarningCategory;
|
|
9
|
+
message: string;
|
|
10
|
+
sceneId?: string;
|
|
11
|
+
recoverable: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type VideoFinishReason = "stop" | "length" | "content-filter" | "error" | "other";
|
|
15
|
+
interface VideoEventDataMap {
|
|
16
|
+
"response.start": {
|
|
17
|
+
requestId: string;
|
|
18
|
+
format: {
|
|
19
|
+
orientation: VideoOrientation;
|
|
20
|
+
};
|
|
21
|
+
style: VideoStyle;
|
|
22
|
+
meta?: Video["meta"];
|
|
23
|
+
capabilities?: VideoCapabilities;
|
|
24
|
+
};
|
|
25
|
+
"audio.set": {
|
|
26
|
+
audio: VideoAudio;
|
|
27
|
+
};
|
|
28
|
+
"scene.add": {
|
|
29
|
+
scene: VideoScene;
|
|
30
|
+
position: number;
|
|
31
|
+
revision: number;
|
|
32
|
+
};
|
|
33
|
+
"scene.patch": {
|
|
34
|
+
sceneId: string;
|
|
35
|
+
revision: number;
|
|
36
|
+
patch: Partial<Omit<VideoScene, "id" | "templateId">>;
|
|
37
|
+
};
|
|
38
|
+
"asset.patch": {
|
|
39
|
+
sceneId: string;
|
|
40
|
+
revision: number;
|
|
41
|
+
variables: Record<string, unknown>;
|
|
42
|
+
};
|
|
43
|
+
"response.warning": {
|
|
44
|
+
warning: VideoWarning;
|
|
45
|
+
};
|
|
46
|
+
"response.complete": {
|
|
47
|
+
finishReason: VideoFinishReason;
|
|
48
|
+
snapshot: Video;
|
|
49
|
+
checksum: string;
|
|
50
|
+
};
|
|
51
|
+
"response.error": {
|
|
52
|
+
error: {
|
|
53
|
+
code: string;
|
|
54
|
+
message: string;
|
|
55
|
+
recoverable: boolean;
|
|
56
|
+
};
|
|
57
|
+
terminal: boolean;
|
|
58
|
+
snapshot?: Video;
|
|
59
|
+
};
|
|
60
|
+
"response.abort": {
|
|
61
|
+
reason: string;
|
|
62
|
+
snapshot?: Video;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
type VideoCoreEventType = keyof VideoEventDataMap;
|
|
66
|
+
type VideoExtensionEventType = `data.${string}`;
|
|
67
|
+
interface VideoEventEnvelope<TType extends string, TData> {
|
|
68
|
+
protocolVersion: typeof VIDEO_PROTOCOL_VERSION;
|
|
69
|
+
runId: string;
|
|
70
|
+
sequence: number;
|
|
71
|
+
eventId: string;
|
|
72
|
+
type: TType;
|
|
73
|
+
data: TData;
|
|
74
|
+
}
|
|
75
|
+
type VideoCoreEvent = {
|
|
76
|
+
[TType in VideoCoreEventType]: VideoEventEnvelope<TType, VideoEventDataMap[TType]>;
|
|
77
|
+
}[VideoCoreEventType];
|
|
78
|
+
type VideoExtensionEvent<TData = unknown> = VideoEventEnvelope<VideoExtensionEventType, TData>;
|
|
79
|
+
type VideoEvent = VideoCoreEvent | VideoExtensionEvent;
|
|
80
|
+
|
|
81
|
+
export type { VideoEvent as V, VideoWarning as a, VideoFinishReason as b, VideoWarningCategory as c };
|