@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,79 @@
1
+ import { g as VideoStyle, j as VideoCapabilities } from './types-B-PZR6G_.js';
2
+ import { ComponentType } from 'react';
3
+ import { S as SceneTemplateMetadata, d as TemplateJsonSchema, f as TemplateJsonSchemaProperty } from './catalog-types-BIhSpOWK.js';
4
+
5
+ interface TemplateSafeZone {
6
+ top: number;
7
+ right: number;
8
+ bottom: number;
9
+ left: number;
10
+ }
11
+ interface SceneTemplateProps<Variables extends Record<string, unknown> = Record<string, unknown>> {
12
+ variables: Variables;
13
+ style: VideoStyle;
14
+ progress: number;
15
+ /**
16
+ * Optional transition-safe visual progress. Keep grounded values, media,
17
+ * and semantic state on `progress`; use this only for entrance/exit motion.
18
+ * Older renderers may omit it, so templates must fall back to `progress`.
19
+ */
20
+ motionProgress?: number;
21
+ beatIntensity: number;
22
+ width: number;
23
+ height: number;
24
+ textArchetype?: string;
25
+ backgroundEffect?: string;
26
+ safeZone: TemplateSafeZone;
27
+ sceneDuration?: number;
28
+ isPlaying?: boolean;
29
+ }
30
+ type JsonObjectRequiredKeys<Property> = Property extends {
31
+ readonly required: readonly (infer Required)[];
32
+ } ? Required : never;
33
+ type JsonObjectValue<Property extends {
34
+ readonly properties: Readonly<Record<string, TemplateJsonSchemaProperty>>;
35
+ }> = {
36
+ [Key in Extract<JsonObjectRequiredKeys<Property>, keyof Property["properties"]>]: JsonPropertyValue<Property["properties"][Key]>;
37
+ } & {
38
+ [Key in Exclude<keyof Property["properties"], JsonObjectRequiredKeys<Property>>]?: JsonPropertyValue<Property["properties"][Key]>;
39
+ };
40
+ type JsonPropertyValue<Property> = Property extends {
41
+ readonly enum: readonly (infer Value)[];
42
+ } ? Value : Property extends {
43
+ readonly type: "number" | "integer";
44
+ } ? number : Property extends {
45
+ readonly type: "boolean";
46
+ } ? boolean : Property extends {
47
+ readonly type: "array";
48
+ readonly items: infer Item;
49
+ } ? JsonPropertyValue<Item>[] : Property extends {
50
+ readonly type: "array";
51
+ } ? unknown[] : Property extends {
52
+ readonly type: "object";
53
+ readonly properties: Readonly<Record<string, TemplateJsonSchemaProperty>>;
54
+ } ? JsonObjectValue<Property> : Property extends {
55
+ readonly type: "object";
56
+ } ? Record<string, unknown> : string;
57
+ type RequiredJsonSchemaKeys<Schema extends TemplateJsonSchema> = Schema["required"] extends readonly (infer Key)[] ? Extract<Key, keyof Schema["properties"]> : never;
58
+ type InferTemplateJsonSchema<Schema extends TemplateJsonSchema> = {
59
+ [Key in RequiredJsonSchemaKeys<Schema>]: JsonPropertyValue<Schema["properties"][Key]>;
60
+ } & {
61
+ [Key in Exclude<keyof Schema["properties"], RequiredJsonSchemaKeys<Schema>>]?: JsonPropertyValue<Schema["properties"][Key]>;
62
+ };
63
+ interface SceneTemplate<Variables extends Record<string, unknown> = Record<string, unknown>> extends SceneTemplateMetadata {
64
+ component: ComponentType<SceneTemplateProps<Variables>>;
65
+ }
66
+
67
+ interface TemplateRegistry {
68
+ readonly templates: readonly SceneTemplate<any>[];
69
+ readonly capabilities: VideoCapabilities;
70
+ getTemplate(id: string): SceneTemplate | undefined;
71
+ getTemplateMetadata(id: string): SceneTemplateMetadata | undefined;
72
+ listTemplateMetadata(): SceneTemplateMetadata[];
73
+ }
74
+ /** Build the browser renderer registry from customer-owned template definitions. */
75
+ declare function createTemplateRegistry(options: {
76
+ definitions: readonly SceneTemplate<any>[];
77
+ }): TemplateRegistry;
78
+
79
+ export { type InferTemplateJsonSchema as I, type SceneTemplateProps as S, type TemplateRegistry as T, type SceneTemplate as a, createTemplateRegistry as c };
@@ -0,0 +1,236 @@
1
+ import {
2
+ stripPipe
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_BOUNCY,
11
+ SPRING_SMOOTH,
12
+ interpolate,
13
+ spring
14
+ } from "./chunk-XTOXFMLM.js";
15
+ import {
16
+ resolveTokens
17
+ } from "./chunk-FNAEQ7QO.js";
18
+
19
+ // src/visual-system/primitives/typography/PromptInputPill.tsx
20
+ import { jsx, jsxs } from "react/jsx-runtime";
21
+ var CLAMP = {
22
+ extrapolateLeft: "clamp",
23
+ extrapolateRight: "clamp"
24
+ };
25
+ var SparklesIcon = ({ size, gradientId }) => /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: [
26
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
27
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#7C3AED" }),
28
+ /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "#3B82F6" }),
29
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#06B6D4" })
30
+ ] }) }),
31
+ /* @__PURE__ */ jsx(
32
+ "path",
33
+ {
34
+ d: "M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z",
35
+ fill: `url(#${gradientId})`
36
+ }
37
+ )
38
+ ] });
39
+ var PromptInputPill = ({
40
+ progress,
41
+ sceneDuration,
42
+ promptText: rawText,
43
+ pillBg = "#FFFFFF",
44
+ pillTextColor = "#374151",
45
+ width,
46
+ height
47
+ }) => {
48
+ const dim = Math.min(width, height);
49
+ const promptText = stripPipe(rawText || "");
50
+ const seed = promptText.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
51
+ const pillHeight = dim * 0.13;
52
+ const pillTargetWidth = Math.min(width * 0.86, dim * 0.95);
53
+ const pillCircleWidth = pillHeight;
54
+ const pillRadius = pillHeight / 2;
55
+ const iconSize = pillHeight * 0.46;
56
+ const padLeft = pillHeight * 0.3;
57
+ const fontSizeDefault = pillHeight * 0.42;
58
+ const availableTextWidth = pillTargetWidth - padLeft * 3 - iconSize;
59
+ const naturalTextWidth = promptText.length * fontSizeDefault * 0.55 * 1.06;
60
+ const shrinkFactor = naturalTextWidth > availableTextWidth ? Math.max(0.45, availableTextWidth / naturalTextWidth) : 1;
61
+ const fontSize = fontSizeDefault * shrinkFactor;
62
+ const enterSpring = spring(
63
+ interpolate(progress, [0, 0.1], [0, 1], CLAMP),
64
+ SPRING_BOUNCY
65
+ );
66
+ const enterScale = 0.7 + 0.3 * enterSpring;
67
+ const enterOpacity = interpolate(progress, [0, 0.08], [0, 1], CLAMP);
68
+ const widthProgress = spring(
69
+ interpolate(progress, [0.1, 0.3], [0, 1], CLAMP),
70
+ SPRING_SMOOTH
71
+ );
72
+ const pillWidth = pillCircleWidth + (pillTargetWidth - pillCircleWidth) * widthProgress;
73
+ const typeStart = 0.3;
74
+ const typeEnd = 0.68;
75
+ const charsRevealed = Math.max(
76
+ 0,
77
+ Math.floor(
78
+ interpolate(progress, [typeStart, typeEnd], [0, promptText.length], CLAMP)
79
+ )
80
+ );
81
+ const visibleText = promptText.slice(0, charsRevealed);
82
+ const realT = progress * sceneDuration;
83
+ const cursorVisible = progress >= typeStart * 0.9 && Math.sin(realT * Math.PI * 2.4) > 0;
84
+ return /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ style: {
88
+ position: "absolute",
89
+ top: "50%",
90
+ left: "50%",
91
+ transform: `translate(-50%, -50%) scale(${enterScale})`,
92
+ opacity: enterOpacity
93
+ },
94
+ children: /* @__PURE__ */ jsxs(
95
+ "div",
96
+ {
97
+ style: {
98
+ width: pillWidth,
99
+ height: pillHeight,
100
+ backgroundColor: pillBg,
101
+ borderRadius: pillRadius,
102
+ display: "flex",
103
+ alignItems: "center",
104
+ paddingLeft: padLeft,
105
+ paddingRight: padLeft,
106
+ // Clip at the pill border — even after the 0.45× shrink floor,
107
+ // pathologically long prompts can still exceed the pill width.
108
+ // Clipping at the rounded border looks cleaner than letting text
109
+ // bleed past the right edge.
110
+ overflow: "hidden",
111
+ boxShadow: [
112
+ `inset 0 ${1 * (dim / 1080)}px 0 rgba(255,255,255,0.85)`,
113
+ `0 ${8 * (dim / 1080)}px ${24 * (dim / 1080)}px ${-8 * (dim / 1080)}px rgba(110,80,200,0.10)`,
114
+ `0 ${2 * (dim / 1080)}px ${8 * (dim / 1080)}px ${-4 * (dim / 1080)}px rgba(0,0,0,0.05)`
115
+ ].join(", "),
116
+ whiteSpace: "nowrap"
117
+ },
118
+ children: [
119
+ /* @__PURE__ */ jsx(
120
+ "div",
121
+ {
122
+ style: {
123
+ flexShrink: 0,
124
+ display: "flex",
125
+ alignItems: "center",
126
+ justifyContent: "center",
127
+ width: iconSize,
128
+ height: iconSize
129
+ },
130
+ children: /* @__PURE__ */ jsx(SparklesIcon, { size: iconSize, gradientId: `prompt-input-grad-${seed}` })
131
+ }
132
+ ),
133
+ /* @__PURE__ */ jsxs(
134
+ "div",
135
+ {
136
+ style: {
137
+ marginLeft: padLeft,
138
+ fontSize,
139
+ lineHeight: 1.4,
140
+ color: pillTextColor,
141
+ fontWeight: 500,
142
+ letterSpacing: -0.5,
143
+ minWidth: 0,
144
+ display: "flex",
145
+ alignItems: "center"
146
+ },
147
+ children: [
148
+ /* @__PURE__ */ jsx("span", { children: visibleText }),
149
+ /* @__PURE__ */ jsx(
150
+ "span",
151
+ {
152
+ style: {
153
+ display: "inline-block",
154
+ width: fontSize * 0.06,
155
+ height: fontSize * 0.95,
156
+ backgroundColor: pillTextColor,
157
+ marginLeft: fontSize * 0.08,
158
+ opacity: cursorVisible ? 0.85 : 0,
159
+ borderRadius: fontSize * 0.03
160
+ }
161
+ }
162
+ )
163
+ ]
164
+ }
165
+ )
166
+ ]
167
+ }
168
+ )
169
+ }
170
+ );
171
+ };
172
+
173
+ // src/visual-system/scene-templates/prompt-input.tsx
174
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
175
+ var PromptInputTemplate = ({
176
+ variables,
177
+ style,
178
+ progress,
179
+ beatIntensity,
180
+ width,
181
+ height,
182
+ sceneDuration,
183
+ isPlaying = true,
184
+ backgroundEffect
185
+ }) => {
186
+ const { font } = resolveTokens(style);
187
+ const promptText = stripPipe(String(variables.promptText || "Make a launch video for our app"));
188
+ const pillBg = "#FFFFFF";
189
+ const pillTextColor = "#374151";
190
+ const seed = promptText.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
191
+ return /* @__PURE__ */ jsxs2(
192
+ "div",
193
+ {
194
+ style: {
195
+ width,
196
+ height,
197
+ position: "relative",
198
+ overflow: "hidden",
199
+ backgroundColor: "#000",
200
+ fontFamily: font
201
+ },
202
+ children: [
203
+ /* @__PURE__ */ jsx2(
204
+ SceneBackground,
205
+ {
206
+ style,
207
+ progress,
208
+ sceneDuration,
209
+ width,
210
+ height,
211
+ ...getMediaBackgroundProps(variables),
212
+ backgroundEffect,
213
+ seed,
214
+ isPlaying,
215
+ beatIntensity
216
+ }
217
+ ),
218
+ /* @__PURE__ */ jsx2(
219
+ PromptInputPill,
220
+ {
221
+ progress,
222
+ sceneDuration: sceneDuration ?? 4,
223
+ promptText,
224
+ pillBg,
225
+ pillTextColor,
226
+ width,
227
+ height
228
+ }
229
+ )
230
+ ]
231
+ }
232
+ );
233
+ };
234
+ export {
235
+ PromptInputTemplate
236
+ };
@@ -0,0 +1,81 @@
1
+ import { CSSProperties, ReactElement } from 'react';
2
+ import { V as VideoEvent, a as VideoWarning } from './events-_wfjbmEp.js';
3
+ import { e as VideoOrientation, V as Video, d as VideoInput } from './types-B-PZR6G_.js';
4
+ import { T as TemplateRegistry } from './kit-BMNcHqa9.js';
5
+ import { V as VideoStatus } from './state-DZcKuS32.js';
6
+ import './catalog-types-BIhSpOWK.js';
7
+
8
+ interface VideoPlayerSharedProps {
9
+ /** Initial playback state. Reduced-motion preferences take precedence. */
10
+ autoPlay?: boolean;
11
+ startMuted?: boolean;
12
+ /** Fixed display width. Omit to observe and fill the parent width. */
13
+ width?: number;
14
+ /** Override the streamed orientation, or switch at the container breakpoint. */
15
+ orientation?: VideoOrientation | "auto";
16
+ /** Container width at or below which auto orientation uses portrait. */
17
+ responsiveBreakpoint?: number;
18
+ className?: string;
19
+ style?: CSSProperties;
20
+ /** Accessible name for the player region. */
21
+ ariaLabel?: string;
22
+ onComplete?: (video: Video) => void;
23
+ onError?: (error: Error) => void;
24
+ }
25
+ type VideoPlayerProps = VideoPlayerSharedProps & ({
26
+ video: Video;
27
+ stream?: never;
28
+ templates?: TemplateRegistry;
29
+ } | {
30
+ stream?: AsyncIterable<VideoEvent>;
31
+ video?: never;
32
+ templates: TemplateRegistry;
33
+ });
34
+ declare function VideoPlayer({ templates, stream, video, onComplete, onError, ...props }: VideoPlayerProps): ReactElement | null;
35
+
36
+ interface VideoErrorOptions {
37
+ code: string;
38
+ status?: number;
39
+ requestId?: string;
40
+ runId?: string;
41
+ recoverable?: boolean;
42
+ }
43
+ /** A safe, actionable error returned by a VanillaSky video endpoint. */
44
+ declare class VideoError extends Error {
45
+ readonly code: string;
46
+ readonly status?: number;
47
+ readonly requestId?: string;
48
+ readonly runId?: string;
49
+ readonly recoverable?: boolean;
50
+ constructor(message: string, options: VideoErrorOptions);
51
+ }
52
+
53
+ interface UseVideoOptions {
54
+ endpoint?: string | URL;
55
+ /** Customer-owned templates that replace matching built-ins and add new IDs. */
56
+ templates?: TemplateRegistry;
57
+ /** Templates the planner may select for this client experience. Renderers remain available for replay. */
58
+ templateIds?: readonly string[];
59
+ headers?: HeadersInit;
60
+ credentials?: RequestCredentials;
61
+ fetcher?: typeof fetch;
62
+ /** Override ID generation for tracing or deterministic tests. */
63
+ createRequestId?: () => string;
64
+ }
65
+ interface UseVideoResult {
66
+ /** Resolves with a completed video; rejects terminal errors and aborts. */
67
+ generate(input: VideoInput): Promise<Video>;
68
+ abort(reason?: string): void;
69
+ video?: Video;
70
+ status: VideoStatus;
71
+ error?: VideoError;
72
+ warnings: readonly VideoWarning[];
73
+ /** Spread into an explicitly rendered VideoPlayer. */
74
+ playerProps: VideoPlayerProps & {
75
+ templates: TemplateRegistry;
76
+ video?: never;
77
+ };
78
+ }
79
+ declare function useVideo(options?: UseVideoOptions): UseVideoResult;
80
+
81
+ export { type UseVideoOptions, type UseVideoResult, VideoError, type VideoErrorOptions, VideoPlayer, type VideoPlayerProps, useVideo };