@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.
Files changed (162) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/LICENSE +201 -0
  3. package/PUBLIC-API.md +276 -0
  4. package/README.md +152 -0
  5. package/SECURITY.md +22 -0
  6. package/SUPPORT.md +28 -0
  7. package/bin/vanillasky.js +3 -0
  8. package/dist/bg-confetti-WNQXS7ZS.js +89 -0
  9. package/dist/bg-emoji-ETI47GLS.js +150 -0
  10. package/dist/bg-media-SVUZAMGX.js +99 -0
  11. package/dist/brand-message-F3RD4P3P.js +253 -0
  12. package/dist/builtin-server-F7YXRVCH.js +8 -0
  13. package/dist/catalog-types-BIhSpOWK.d.ts +74 -0
  14. package/dist/chart-bar-CNSC7BNK.js +304 -0
  15. package/dist/chart-counter-MCRHKN77.js +299 -0
  16. package/dist/chart-progress-ring-RMI4A7ZK.js +296 -0
  17. package/dist/check-runtime.d.ts +15 -0
  18. package/dist/check-runtime.js +102 -0
  19. package/dist/chunk-2E6T633S.js +27 -0
  20. package/dist/chunk-352ZZCET.js +83 -0
  21. package/dist/chunk-73NTSFFI.js +81 -0
  22. package/dist/chunk-A2X45FET.js +46 -0
  23. package/dist/chunk-ABPKM4GK.js +187 -0
  24. package/dist/chunk-ABZACD4G.js +216 -0
  25. package/dist/chunk-BCRUUJ6A.js +756 -0
  26. package/dist/chunk-CHLGW22F.js +3551 -0
  27. package/dist/chunk-CJ7F2CE6.js +104 -0
  28. package/dist/chunk-CR7FE7BW.js +109 -0
  29. package/dist/chunk-E7CL7UPB.js +109 -0
  30. package/dist/chunk-EE6PK6XC.js +18 -0
  31. package/dist/chunk-ERY4S6QV.js +385 -0
  32. package/dist/chunk-EVG2ZYIY.js +125 -0
  33. package/dist/chunk-FNAEQ7QO.js +155 -0
  34. package/dist/chunk-FQ47WXAJ.js +38 -0
  35. package/dist/chunk-FSG2PYWG.js +336 -0
  36. package/dist/chunk-GHJEAP4O.js +504 -0
  37. package/dist/chunk-GRMUV7QY.js +262 -0
  38. package/dist/chunk-IFOW65Z6.js +205 -0
  39. package/dist/chunk-IXCUY3B3.js +786 -0
  40. package/dist/chunk-L5BTTCZV.js +97 -0
  41. package/dist/chunk-LMG3GHLL.js +107 -0
  42. package/dist/chunk-OOPIETLW.js +101 -0
  43. package/dist/chunk-P22HHFDK.js +43 -0
  44. package/dist/chunk-QAAO7OAY.js +19 -0
  45. package/dist/chunk-S7HFLYNN.js +35 -0
  46. package/dist/chunk-SPVTJH3F.js +24 -0
  47. package/dist/chunk-W2XJKG6C.js +3177 -0
  48. package/dist/chunk-XB7LH4J2.js +301 -0
  49. package/dist/chunk-XGRA2MUV.js +242 -0
  50. package/dist/chunk-XTOXFMLM.js +105 -0
  51. package/dist/chunk-YC5MFXA5.js +132 -0
  52. package/dist/cli.d.ts +1 -0
  53. package/dist/cli.js +1681 -0
  54. package/dist/compose-video-CN3VSWST.js +13 -0
  55. package/dist/cta-logo-SVA5GP2A.js +209 -0
  56. package/dist/cta-media-E7VLLK42.js +215 -0
  57. package/dist/events-_wfjbmEp.d.ts +81 -0
  58. package/dist/incoming-call-62MFZL3Z.js +320 -0
  59. package/dist/index.d.ts +15 -0
  60. package/dist/index.js +14 -0
  61. package/dist/infographic-before-after-AXCDAWND.js +460 -0
  62. package/dist/infographic-feature-list-GW5GUE6O.js +266 -0
  63. package/dist/infographic-problem-solution-7NURJANA.js +340 -0
  64. package/dist/infographic-stat-row-J7IZR6ZN.js +241 -0
  65. package/dist/infographic-steps-VSZM6F5M.js +400 -0
  66. package/dist/kit-BMNcHqa9.d.ts +79 -0
  67. package/dist/prompt-input-LOUCRXCY.js +236 -0
  68. package/dist/react.d.ts +81 -0
  69. package/dist/react.js +835 -0
  70. package/dist/reaction-QG4CYZLQ.js +119 -0
  71. package/dist/server.d.ts +141 -0
  72. package/dist/server.js +498 -0
  73. package/dist/showcase-code-RUTFZR3H.js +351 -0
  74. package/dist/showcase-phone-6CP6XEU5.js +272 -0
  75. package/dist/showcase-terminal-MGAEQWPR.js +306 -0
  76. package/dist/showcase-web-Y4W2HVRJ.js +390 -0
  77. package/dist/social-conversation-75SD2637.js +695 -0
  78. package/dist/social-milestone-XI2QE5BO.js +292 -0
  79. package/dist/social-notification-2UOHQCUY.js +244 -0
  80. package/dist/social-review-stack-FDYZGZTJ.js +239 -0
  81. package/dist/social-testimonial-OQ7N52GJ.js +284 -0
  82. package/dist/social-tweet-5OLCNPPC.js +295 -0
  83. package/dist/state-DZcKuS32.d.ts +3 -0
  84. package/dist/system-prompt-A6UXNTPK.js +8 -0
  85. package/dist/template-catalog.d.ts +24 -0
  86. package/dist/template-catalog.js +6 -0
  87. package/dist/templates.d.ts +25 -0
  88. package/dist/templates.js +19 -0
  89. package/dist/test.d.ts +149 -0
  90. package/dist/test.js +272 -0
  91. package/dist/text-stream-6XHC7J47.js +10 -0
  92. package/dist/types-B-PZR6G_.d.ts +208 -0
  93. package/dist/validate-T7GBU2YF.js +8 -0
  94. package/docs/agent-integration.md +39 -0
  95. package/docs/architecture.md +84 -0
  96. package/docs/branding-and-personalization.md +87 -0
  97. package/docs/concepts.md +106 -0
  98. package/docs/custom-templates.md +329 -0
  99. package/docs/customization.md +141 -0
  100. package/docs/errors.md +70 -0
  101. package/docs/getting-started.md +111 -0
  102. package/docs/input-and-first-scene.md +41 -0
  103. package/docs/integrate-nextjs.md +79 -0
  104. package/docs/media-and-audio.md +69 -0
  105. package/docs/motion-and-effects.md +107 -0
  106. package/docs/persistence.md +95 -0
  107. package/docs/production.md +122 -0
  108. package/docs/prompt-and-input.md +185 -0
  109. package/docs/provider-integration.md +115 -0
  110. package/docs/reference/protocol.md +96 -0
  111. package/docs/reference/provider-adapters.md +158 -0
  112. package/docs/responsive-orientation.md +37 -0
  113. package/docs/security.md +38 -0
  114. package/docs/streaming-protocol.md +15 -0
  115. package/docs/testing.md +137 -0
  116. package/docs/use-cases.md +59 -0
  117. package/examples/custom-template/README.md +19 -0
  118. package/examples/custom-template/minimal-text.tsx +82 -0
  119. package/examples/custom-template/structured-data.tsx +104 -0
  120. package/examples/custom-template/supplied-media.tsx +92 -0
  121. package/examples/nextjs-quickstart/.env.example +2 -0
  122. package/examples/nextjs-quickstart/README.md +22 -0
  123. package/examples/nextjs-quickstart/next-env.d.ts +4 -0
  124. package/examples/nextjs-quickstart/package.json +24 -0
  125. package/examples/nextjs-quickstart/src/app/api/video/route.ts +22 -0
  126. package/examples/nextjs-quickstart/src/app/layout.tsx +5 -0
  127. package/examples/nextjs-quickstart/src/app/page.tsx +31 -0
  128. package/examples/nextjs-quickstart/tsconfig.json +26 -0
  129. package/package.json +167 -0
  130. package/registry/items/backgrounds.json +52 -0
  131. package/registry/items/barChart.json +237 -0
  132. package/registry/items/beforeAfter.json +180 -0
  133. package/registry/items/bigNumber.json +225 -0
  134. package/registry/items/brandMessage.json +158 -0
  135. package/registry/items/cardList.json +206 -0
  136. package/registry/items/chatMessenger.json +151 -0
  137. package/registry/items/chatWhatsapp.json +151 -0
  138. package/registry/items/codeEditor.json +184 -0
  139. package/registry/items/confetti.json +107 -0
  140. package/registry/items/ctaLogo.json +160 -0
  141. package/registry/items/ctaMedia.json +193 -0
  142. package/registry/items/emojiBurst.json +101 -0
  143. package/registry/items/incomingCall.json +170 -0
  144. package/registry/items/media.json +179 -0
  145. package/registry/items/milestone.json +205 -0
  146. package/registry/items/motion.json +45 -0
  147. package/registry/items/notification.json +182 -0
  148. package/registry/items/phoneMockup.json +254 -0
  149. package/registry/items/problemSolution.json +186 -0
  150. package/registry/items/progressRing.json +199 -0
  151. package/registry/items/promptInput.json +148 -0
  152. package/registry/items/reaction.json +170 -0
  153. package/registry/items/reviewStack.json +224 -0
  154. package/registry/items/steps.json +207 -0
  155. package/registry/items/template-context.json +31 -0
  156. package/registry/items/terminal.json +212 -0
  157. package/registry/items/testimonial.json +164 -0
  158. package/registry/items/theme.json +47 -0
  159. package/registry/items/tripleStats.json +228 -0
  160. package/registry/items/tweet.json +203 -0
  161. package/registry/items/typography.json +47 -0
  162. package/registry/items/webMockup.json +273 -0
@@ -0,0 +1,320 @@
1
+ import {
2
+ fitTextSize,
3
+ stripPipe
4
+ } from "./chunk-S7HFLYNN.js";
5
+ import {
6
+ SceneBackground,
7
+ getMediaBackgroundProps
8
+ } from "./chunk-IFOW65Z6.js";
9
+ import "./chunk-ABZACD4G.js";
10
+ import {
11
+ SPRING_BOUNCY,
12
+ SPRING_SMOOTH,
13
+ interpolate,
14
+ spring
15
+ } from "./chunk-XTOXFMLM.js";
16
+ import {
17
+ resolveTokens
18
+ } from "./chunk-FNAEQ7QO.js";
19
+
20
+ // src/visual-system/primitives/social/IncomingCallCard.tsx
21
+ import { jsx, jsxs } from "react/jsx-runtime";
22
+ var CLAMP = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
23
+ var DECLINE_RED = "#FF3B30";
24
+ var ACCEPT_GREEN = "#34C759";
25
+ var PhoneIcon = ({ size, rotated }) => /* @__PURE__ */ jsx(
26
+ "svg",
27
+ {
28
+ width: size,
29
+ height: size,
30
+ viewBox: "0 0 24 24",
31
+ style: {
32
+ transform: rotated ? "rotate(135deg)" : "none",
33
+ display: "block"
34
+ },
35
+ children: /* @__PURE__ */ jsx(
36
+ "path",
37
+ {
38
+ d: "M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z",
39
+ fill: "#FFFFFF"
40
+ }
41
+ )
42
+ }
43
+ );
44
+ var IncomingCallCard = ({
45
+ progress,
46
+ width,
47
+ height,
48
+ sceneDuration,
49
+ safeZone,
50
+ callerName: rawCallerName,
51
+ subtitle: rawSubtitle = "is calling....",
52
+ declineLabel: rawDeclineLabel = "Decline",
53
+ acceptLabel: rawAcceptLabel = "Accept",
54
+ textColor = "#FFFFFF",
55
+ beatIntensity = 0
56
+ }) => {
57
+ const dim = Math.min(width, height);
58
+ const callerName = stripPipe(String(rawCallerName || "Your brand"));
59
+ const subtitle = stripPipe(String(rawSubtitle || "is calling...."));
60
+ const declineLabel = stripPipe(String(rawDeclineLabel || "Decline"));
61
+ const acceptLabel = stripPipe(String(rawAcceptLabel || "Accept"));
62
+ const nameSpring = spring(
63
+ interpolate(progress, [0, 0.1], [0, 1], CLAMP),
64
+ SPRING_SMOOTH
65
+ );
66
+ const nameOpacity = interpolate(progress, [0, 0.08], [0, 1], CLAMP);
67
+ const nameY = (1 - nameSpring) * dim * 0.025;
68
+ const subtitleStart = 0.1;
69
+ const subtitleEnd = 0.3;
70
+ const charsRevealed = Math.max(
71
+ 0,
72
+ Math.floor(
73
+ interpolate(
74
+ progress,
75
+ [subtitleStart, subtitleEnd],
76
+ [0, subtitle.length],
77
+ CLAMP
78
+ )
79
+ )
80
+ );
81
+ const visibleSubtitle = subtitle.slice(0, charsRevealed);
82
+ const declineSpring = spring(
83
+ interpolate(progress, [0.1, 0.25], [0, 1], CLAMP),
84
+ SPRING_BOUNCY
85
+ );
86
+ const acceptSpring = spring(
87
+ interpolate(progress, [0.13, 0.28], [0, 1], CLAMP),
88
+ SPRING_BOUNCY
89
+ );
90
+ const declineLabelOpacity = interpolate(progress, [0.1, 0.25], [0, 1], CLAMP);
91
+ const acceptLabelOpacity = interpolate(progress, [0.13, 0.28], [0, 1], CLAMP);
92
+ const realT = progress * sceneDuration;
93
+ const vibrateActive = interpolate(progress, [0.28, 0.38], [0, 1], CLAMP);
94
+ const vibrateAngle = vibrateActive * Math.sin(realT * 7 * Math.PI * 2) * 2.5;
95
+ const acceptPulse = progress > 0.35 ? 1 + 0.04 * Math.max(0, Math.sin(realT * Math.PI * 2.4)) : 1;
96
+ const beatGlow = 1 + beatIntensity * 0.35;
97
+ const topPad = Math.max(safeZone.top, height * 0.07);
98
+ const bottomPad = Math.max(safeZone.bottom, height * 0.1);
99
+ const callerBaseFontSize = Math.min(width * 0.16, dim * 0.13);
100
+ const callerFontSize = fitTextSize(callerName, callerBaseFontSize, width * 0.88, {
101
+ minScale: 0.45
102
+ });
103
+ const subtitleFontSize = Math.min(width * 0.075, dim * 0.062);
104
+ const buttonSize = Math.min(width * 0.18, dim * 0.16);
105
+ const phoneIconSize = buttonSize * 0.46;
106
+ const labelFontSize = Math.min(width * 0.04, dim * 0.034);
107
+ const buttonGap = width * 0.3;
108
+ const buttonsBottomFromBottom = bottomPad + labelFontSize * 1.6;
109
+ return /* @__PURE__ */ jsxs(
110
+ "div",
111
+ {
112
+ style: {
113
+ position: "absolute",
114
+ inset: 0,
115
+ pointerEvents: "none"
116
+ },
117
+ children: [
118
+ /* @__PURE__ */ jsxs(
119
+ "div",
120
+ {
121
+ style: {
122
+ position: "absolute",
123
+ top: topPad,
124
+ left: 0,
125
+ right: 0,
126
+ padding: `0 ${width * 0.06}px`,
127
+ display: "flex",
128
+ flexDirection: "column",
129
+ alignItems: "center",
130
+ gap: callerFontSize * 0.45,
131
+ textAlign: "center"
132
+ },
133
+ children: [
134
+ /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ style: {
138
+ color: textColor,
139
+ fontSize: callerFontSize,
140
+ fontWeight: 600,
141
+ lineHeight: 1.05,
142
+ letterSpacing: -0.5,
143
+ opacity: nameOpacity,
144
+ transform: `translateY(${nameY}px)`,
145
+ textShadow: "0 2px 18px rgba(0,0,0,0.32)"
146
+ },
147
+ children: callerName
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsx(
151
+ "div",
152
+ {
153
+ style: {
154
+ color: textColor,
155
+ fontSize: subtitleFontSize,
156
+ fontWeight: 400,
157
+ textShadow: "0 1px 12px rgba(0,0,0,0.32)",
158
+ minHeight: subtitleFontSize * 1.4
159
+ },
160
+ children: visibleSubtitle
161
+ }
162
+ )
163
+ ]
164
+ }
165
+ ),
166
+ /* @__PURE__ */ jsxs(
167
+ "div",
168
+ {
169
+ style: {
170
+ position: "absolute",
171
+ bottom: buttonsBottomFromBottom,
172
+ left: 0,
173
+ right: 0,
174
+ display: "flex",
175
+ flexDirection: "row",
176
+ justifyContent: "center",
177
+ alignItems: "flex-end",
178
+ gap: buttonGap
179
+ },
180
+ children: [
181
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: labelFontSize * 0.55 }, children: [
182
+ /* @__PURE__ */ jsx(
183
+ "div",
184
+ {
185
+ style: {
186
+ width: buttonSize,
187
+ height: buttonSize,
188
+ borderRadius: "50%",
189
+ backgroundColor: DECLINE_RED,
190
+ display: "flex",
191
+ alignItems: "center",
192
+ justifyContent: "center",
193
+ transform: `rotate(${vibrateAngle}deg) scale(${declineSpring})`,
194
+ boxShadow: `0 ${dim * 0.012}px ${dim * 0.04}px rgba(0,0,0,0.30)`
195
+ },
196
+ children: /* @__PURE__ */ jsx(PhoneIcon, { size: phoneIconSize, rotated: true })
197
+ }
198
+ ),
199
+ /* @__PURE__ */ jsx(
200
+ "div",
201
+ {
202
+ style: {
203
+ color: textColor,
204
+ fontSize: labelFontSize,
205
+ fontWeight: 500,
206
+ opacity: declineLabelOpacity,
207
+ textShadow: "0 1px 8px rgba(0,0,0,0.28)"
208
+ },
209
+ children: declineLabel
210
+ }
211
+ )
212
+ ] }),
213
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: labelFontSize * 0.55 }, children: [
214
+ /* @__PURE__ */ jsx(
215
+ "div",
216
+ {
217
+ style: {
218
+ width: buttonSize,
219
+ height: buttonSize,
220
+ borderRadius: "50%",
221
+ backgroundColor: ACCEPT_GREEN,
222
+ display: "flex",
223
+ alignItems: "center",
224
+ justifyContent: "center",
225
+ transform: `rotate(${vibrateAngle}deg) scale(${acceptSpring * acceptPulse})`,
226
+ boxShadow: `0 ${dim * 0.012}px ${dim * 0.05 * beatGlow}px rgba(52,199,89,0.45)`
227
+ },
228
+ children: /* @__PURE__ */ jsx(PhoneIcon, { size: phoneIconSize, rotated: false })
229
+ }
230
+ ),
231
+ /* @__PURE__ */ jsx(
232
+ "div",
233
+ {
234
+ style: {
235
+ color: textColor,
236
+ fontSize: labelFontSize,
237
+ fontWeight: 500,
238
+ opacity: acceptLabelOpacity,
239
+ textShadow: "0 1px 8px rgba(0,0,0,0.28)"
240
+ },
241
+ children: acceptLabel
242
+ }
243
+ )
244
+ ] })
245
+ ]
246
+ }
247
+ )
248
+ ]
249
+ }
250
+ );
251
+ };
252
+
253
+ // src/visual-system/scene-templates/incoming-call.tsx
254
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
255
+ var IncomingCallTemplate = ({
256
+ variables,
257
+ style,
258
+ progress,
259
+ beatIntensity,
260
+ width,
261
+ height,
262
+ sceneDuration,
263
+ isPlaying = true,
264
+ safeZone,
265
+ backgroundEffect
266
+ }) => {
267
+ const { primary, foreground } = resolveTokens(style);
268
+ const callerName = String(variables.callerName || "Your brand");
269
+ const subtitle = String(variables.subtitle || "is calling....");
270
+ return /* @__PURE__ */ jsxs2(
271
+ "div",
272
+ {
273
+ style: {
274
+ width,
275
+ height,
276
+ backgroundColor: "#000",
277
+ position: "relative",
278
+ overflow: "hidden",
279
+ fontFamily: "system-ui, -apple-system, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif"
280
+ },
281
+ children: [
282
+ /* @__PURE__ */ jsx2(
283
+ SceneBackground,
284
+ {
285
+ style,
286
+ progress,
287
+ sceneDuration,
288
+ width,
289
+ height,
290
+ ...getMediaBackgroundProps(variables),
291
+ backgroundEffect,
292
+ seed: `${callerName}${subtitle}`,
293
+ isPlaying,
294
+ beatIntensity
295
+ }
296
+ ),
297
+ /* @__PURE__ */ jsx2(
298
+ IncomingCallCard,
299
+ {
300
+ progress,
301
+ width,
302
+ height,
303
+ sceneDuration: sceneDuration ?? 4,
304
+ safeZone: { top: safeZone.top, bottom: safeZone.bottom },
305
+ callerName,
306
+ subtitle,
307
+ declineLabel: String(variables.declineLabel || "Decline"),
308
+ acceptLabel: String(variables.acceptLabel || "Accept"),
309
+ textColor: foreground,
310
+ accent: primary,
311
+ beatIntensity
312
+ }
313
+ )
314
+ ]
315
+ }
316
+ );
317
+ };
318
+ export {
319
+ IncomingCallTemplate
320
+ };
@@ -0,0 +1,15 @@
1
+ import { V as Video } from './types-B-PZR6G_.js';
2
+ export { a as VideoAudio, b as VideoBackground, c as VideoBrand, d as VideoInput, e as VideoOrientation, f as VideoScene, g as VideoStyle, h as VideoStyleOptions, i as VideoSuppliedMedia } from './types-B-PZR6G_.js';
3
+ export { V as VideoStatus } from './state-DZcKuS32.js';
4
+
5
+ type VideoValidationErrorCode = "invalid_video" | "unsupported_video_version";
6
+ declare class VideoValidationError extends Error {
7
+ readonly code: VideoValidationErrorCode;
8
+ constructor(message: string, code?: VideoValidationErrorCode);
9
+ }
10
+ /** Parse a persisted Video using the current-only 0.1 schema policy. */
11
+ declare function parseVideo(value: unknown): Video;
12
+
13
+ declare function getVideoDuration(config: Video): number;
14
+
15
+ export { Video, VideoValidationError, type VideoValidationErrorCode, getVideoDuration, parseVideo };
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ import {
2
+ VideoValidationError,
3
+ parseVideo
4
+ } from "./chunk-GHJEAP4O.js";
5
+ import "./chunk-EE6PK6XC.js";
6
+ import {
7
+ getVideoDuration
8
+ } from "./chunk-SPVTJH3F.js";
9
+ import "./chunk-XGRA2MUV.js";
10
+ export {
11
+ VideoValidationError,
12
+ getVideoDuration,
13
+ parseVideo
14
+ };