@vanillaskyai/video 0.8.8 → 0.10.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 (173) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/PUBLIC-API.md +5 -8
  3. package/dist/{builtin-server-CUYPIDE7.js → builtin-server-W4PLJUZ5.js} +2 -2
  4. package/dist/{catalog-types-BIhSpOWK.d.ts → catalog-types-WTbLP6Jh.d.ts} +5 -1
  5. package/dist/chapter-title-YRLIQY3V.js +7 -0
  6. package/dist/check-runtime.js +5 -14
  7. package/dist/{chunk-AITKH6QT.js → chunk-2HFO22K2.js} +15 -40
  8. package/dist/chunk-4YM2M62S.js +13 -0
  9. package/dist/chunk-4ZJLPHBV.js +684 -0
  10. package/dist/chunk-77VY4O7A.js +390 -0
  11. package/dist/{chunk-MMUXVA47.js → chunk-7M56IUUX.js} +9 -8
  12. package/dist/chunk-7NZOMTAL.js +63 -0
  13. package/dist/{chunk-2DOLF4QN.js → chunk-AUPC6MDK.js} +12 -14
  14. package/dist/{chunk-352ZZCET.js → chunk-EGVQODKU.js} +2 -2
  15. package/dist/{chunk-2USVB3CY.js → chunk-ELVOT2FQ.js} +284 -177
  16. package/dist/chunk-EWWCQFTI.js +18 -0
  17. package/dist/{chunk-KT3M7KDL.js → chunk-HKUI5BTB.js} +3 -3
  18. package/dist/chunk-IIN5M5HW.js +697 -0
  19. package/dist/{chunk-LMG3GHLL.js → chunk-IQMYK5DX.js} +29 -3
  20. package/dist/{chunk-OWBT45EN.js → chunk-IR44XKBI.js} +1 -1
  21. package/dist/{chunk-MXZSDGZQ.js → chunk-NMFDC2W2.js} +4 -6
  22. package/dist/{chunk-5SLENAJW.js → chunk-PAJ44TFW.js} +1 -2
  23. package/dist/{chunk-L7QGGKJ2.js → chunk-PDQFQIQW.js} +1 -1
  24. package/dist/{chunk-WJ6FLKNC.js → chunk-R3XAOMKP.js} +14 -0
  25. package/dist/{chunk-2OKB27TG.js → chunk-RXTN2CW6.js} +2 -2
  26. package/dist/{chunk-XWWLKRNU.js → chunk-TVIU23OM.js} +38 -49
  27. package/dist/chunk-XX4GXKTX.js +35 -0
  28. package/dist/chunk-Z67Q5KUW.js +16 -0
  29. package/dist/{chunk-3VRMKFM7.js → chunk-ZDJNFA52.js} +11 -24
  30. package/dist/cinema-media-C7OUPNSH.js +12 -0
  31. package/dist/cli.js +18 -9
  32. package/dist/comparison-GNZOR7MF.js +37 -0
  33. package/dist/compose-video-TBFTONUC.js +12 -0
  34. package/dist/editorial-timeline-EMV5335S.js +43 -0
  35. package/dist/{events-BQ6z264n.d.ts → events-B4YCc4vc.d.ts} +1 -1
  36. package/dist/index.d.ts +4 -6
  37. package/dist/index.js +3 -7
  38. package/dist/key-figure-P37VK425.js +30 -0
  39. package/dist/{kit-tQnCPMOM.d.ts → kit-DrRpdn0p.d.ts} +2 -2
  40. package/dist/mobile-message-OF7T62B7.js +50 -0
  41. package/dist/quote-T6WYLN7A.js +33 -0
  42. package/dist/react.d.ts +21 -11
  43. package/dist/react.js +585 -826
  44. package/dist/scene-video-backdrop-PCTARAAJ.js +7 -0
  45. package/dist/server.d.ts +7 -8
  46. package/dist/server.js +179 -84
  47. package/dist/{system-prompt-RRXIWDDD.js → system-prompt-SYRT5DWM.js} +1 -1
  48. package/dist/template-catalog.d.ts +392 -16
  49. package/dist/template-catalog.js +1 -1
  50. package/dist/templates.d.ts +5 -5
  51. package/dist/test.d.ts +3 -3
  52. package/dist/test.js +18 -18
  53. package/dist/text-stream-LD364KBI.js +9 -0
  54. package/dist/{types-DWFO6qca.d.ts → types-CdBmNTGD.d.ts} +1 -1
  55. package/dist/{types-CEh9eUFu.d.ts → types-DdZw4GRQ.d.ts} +17 -48
  56. package/dist/validate-4OUD2CLX.js +10 -0
  57. package/docs/architecture.md +1 -1
  58. package/docs/concepts.md +1 -1
  59. package/docs/custom-templates.md +13 -28
  60. package/docs/customization.md +11 -59
  61. package/docs/getting-started.md +2 -2
  62. package/docs/immersive-interface.md +3 -4
  63. package/docs/maintainers/cinematic-migration.md +38 -0
  64. package/docs/media-and-audio.md +14 -14
  65. package/docs/motion-and-effects.md +6 -14
  66. package/docs/persistence.md +3 -3
  67. package/docs/production.md +11 -9
  68. package/docs/provider-integration.md +9 -16
  69. package/docs/reference/design-system.html +1 -1
  70. package/docs/reference/protocol.md +14 -4
  71. package/docs/testing.md +1 -1
  72. package/package.json +6 -3
  73. package/registry/items/backgrounds.json +1 -1
  74. package/registry/items/chapterTitle.json +80 -0
  75. package/registry/items/cinemaMedia.json +136 -0
  76. package/registry/items/comparison.json +168 -0
  77. package/registry/items/editorialTimeline.json +172 -0
  78. package/registry/items/keyFigure.json +162 -0
  79. package/registry/items/mobileMessage.json +153 -0
  80. package/registry/items/quote.json +161 -0
  81. package/registry/items/template-context.json +1 -1
  82. package/registry/items/theme.json +1 -1
  83. package/starters/video-chat/README.md +24 -26
  84. package/starters/video-chat/package.json +1 -1
  85. package/starters/video-chat/providers/video.ts +6 -5
  86. package/starters/video-chat/stock.ts +35 -151
  87. package/styles/fonts/OFL.txt +93 -0
  88. package/styles/fonts/manifest.json +66 -0
  89. package/styles/fonts/roboto-v51-cyrillic-ext.woff2 +0 -0
  90. package/styles/fonts/roboto-v51-cyrillic.woff2 +0 -0
  91. package/styles/fonts/roboto-v51-greek-ext.woff2 +0 -0
  92. package/styles/fonts/roboto-v51-greek.woff2 +0 -0
  93. package/styles/fonts/roboto-v51-latin-ext.woff2 +0 -0
  94. package/styles/fonts/roboto-v51-latin.woff2 +0 -0
  95. package/styles/fonts/roboto-v51-math.woff2 +0 -0
  96. package/styles/fonts/roboto-v51-symbols.woff2 +0 -0
  97. package/styles/fonts/roboto-v51-vietnamese.woff2 +0 -0
  98. package/styles/fonts/roboto.css +91 -0
  99. package/styles/video-chat.css +30 -22
  100. package/dist/bg-confetti-HITCGLGD.js +0 -89
  101. package/dist/bg-emoji-VU4UZYZN.js +0 -150
  102. package/dist/bg-media-L34PDQXJ.js +0 -106
  103. package/dist/brand-message-FUJ4STFO.js +0 -256
  104. package/dist/chart-bar-EGPHJATL.js +0 -310
  105. package/dist/chart-counter-5FFWQNZO.js +0 -306
  106. package/dist/chart-progress-ring-JMXQLMLC.js +0 -302
  107. package/dist/chunk-4UNKZEAT.js +0 -3575
  108. package/dist/chunk-5CDAM24P.js +0 -31
  109. package/dist/chunk-AOWSXU2K.js +0 -18
  110. package/dist/chunk-CJ7F2CE6.js +0 -104
  111. package/dist/chunk-FRN6WKHA.js +0 -185
  112. package/dist/chunk-G5JPHBX7.js +0 -336
  113. package/dist/chunk-L5BTTCZV.js +0 -97
  114. package/dist/chunk-P22HHFDK.js +0 -43
  115. package/dist/chunk-PP3MCPN4.js +0 -1998
  116. package/dist/chunk-QAAO7OAY.js +0 -19
  117. package/dist/chunk-S7HFLYNN.js +0 -35
  118. package/dist/chunk-W3VDIBGR.js +0 -217
  119. package/dist/chunk-XGRA2MUV.js +0 -242
  120. package/dist/chunk-XTOXFMLM.js +0 -105
  121. package/dist/chunk-YJJC4N4D.js +0 -761
  122. package/dist/compose-video-2NFH4DZY.js +0 -13
  123. package/dist/cta-logo-YR7LYUR5.js +0 -212
  124. package/dist/cta-media-DQJBKUO2.js +0 -221
  125. package/dist/incoming-call-54KQ7O5A.js +0 -323
  126. package/dist/infographic-before-after-ROS52GOW.js +0 -460
  127. package/dist/infographic-feature-list-E7MGUDAN.js +0 -272
  128. package/dist/infographic-problem-solution-3S6NGO5N.js +0 -343
  129. package/dist/infographic-stat-row-SYB7AB7H.js +0 -247
  130. package/dist/infographic-steps-KCE6JWE2.js +0 -406
  131. package/dist/prompt-input-MHX4O42G.js +0 -239
  132. package/dist/reaction-SLEGR3BE.js +0 -122
  133. package/dist/scene-video-backdrop-XFPX4O3I.js +0 -10
  134. package/dist/showcase-code-2HLAVKBM.js +0 -357
  135. package/dist/showcase-phone-Q4HEO4LH.js +0 -278
  136. package/dist/showcase-terminal-DL45LUFG.js +0 -312
  137. package/dist/showcase-web-2QZO73FZ.js +0 -396
  138. package/dist/social-conversation-75SD2637.js +0 -695
  139. package/dist/social-milestone-GEFUQSBF.js +0 -296
  140. package/dist/social-notification-FJ5VHVLK.js +0 -247
  141. package/dist/social-review-stack-KXQCKFRP.js +0 -242
  142. package/dist/social-testimonial-JZ7CHC7S.js +0 -287
  143. package/dist/social-tweet-UCDXM25F.js +0 -298
  144. package/dist/text-stream-54LXABJW.js +0 -10
  145. package/dist/validate-T7GBU2YF.js +0 -8
  146. package/registry/items/barChart.json +0 -245
  147. package/registry/items/beforeAfter.json +0 -180
  148. package/registry/items/bigNumber.json +0 -232
  149. package/registry/items/brandMessage.json +0 -164
  150. package/registry/items/cardList.json +0 -214
  151. package/registry/items/chatMessenger.json +0 -151
  152. package/registry/items/chatWhatsapp.json +0 -151
  153. package/registry/items/codeEditor.json +0 -191
  154. package/registry/items/confetti.json +0 -107
  155. package/registry/items/ctaLogo.json +0 -167
  156. package/registry/items/ctaMedia.json +0 -200
  157. package/registry/items/emojiBurst.json +0 -101
  158. package/registry/items/incomingCall.json +0 -177
  159. package/registry/items/media.json +0 -187
  160. package/registry/items/milestone.json +0 -212
  161. package/registry/items/notification.json +0 -189
  162. package/registry/items/phoneMockup.json +0 -261
  163. package/registry/items/problemSolution.json +0 -193
  164. package/registry/items/progressRing.json +0 -206
  165. package/registry/items/promptInput.json +0 -155
  166. package/registry/items/reaction.json +0 -176
  167. package/registry/items/reviewStack.json +0 -231
  168. package/registry/items/steps.json +0 -215
  169. package/registry/items/terminal.json +0 -219
  170. package/registry/items/testimonial.json +0 -171
  171. package/registry/items/tripleStats.json +0 -235
  172. package/registry/items/tweet.json +0 -210
  173. package/registry/items/webMockup.json +0 -280
@@ -1,296 +0,0 @@
1
- import {
2
- stripPipe
3
- } from "./chunk-S7HFLYNN.js";
4
- import {
5
- ConfettiLayer
6
- } from "./chunk-CJ7F2CE6.js";
7
- import "./chunk-QAAO7OAY.js";
8
- import {
9
- SceneBackground,
10
- getMediaBackgroundProps
11
- } from "./chunk-MXZSDGZQ.js";
12
- import {
13
- Emoji,
14
- renderWithEmoji
15
- } from "./chunk-L5BTTCZV.js";
16
- import "./chunk-FRN6WKHA.js";
17
- import {
18
- accessibleTextColor,
19
- withOpacity
20
- } from "./chunk-W3VDIBGR.js";
21
- import {
22
- SPRING_BOUNCY,
23
- SPRING_SMOOTH,
24
- interpolate,
25
- spring
26
- } from "./chunk-XTOXFMLM.js";
27
- import "./chunk-224QNWRA.js";
28
- import "./chunk-5CDAM24P.js";
29
- import {
30
- MEDIA_TEXT_SHADOW,
31
- TOKEN_DEFAULTS,
32
- resolveTokens
33
- } from "./chunk-XWWLKRNU.js";
34
-
35
- // src/visual-system/primitives/social/MilestoneBadge.tsx
36
- import { jsx, jsxs } from "react/jsx-runtime";
37
- var CLAMP = {
38
- extrapolateLeft: "clamp",
39
- extrapolateRight: "clamp"
40
- };
41
- var MilestoneBadge = ({
42
- progress,
43
- width,
44
- height,
45
- targetNumber,
46
- label: rawLabel,
47
- prefix = "",
48
- suffix = "",
49
- startNumber,
50
- badgeText: rawBadgeText = "",
51
- badgeEmoji = "\u{1F389}",
52
- accent = TOKEN_DEFAULTS.primary,
53
- hasMedia = false,
54
- foreground = TOKEN_DEFAULTS.foreground,
55
- surfaceElevated = TOKEN_DEFAULTS.surfaceElevated,
56
- beatIntensity = 0,
57
- confettiBgColor
58
- }) => {
59
- const dim = Math.min(width, height);
60
- const s = dim / 1080;
61
- const label = stripPipe(rawLabel || "");
62
- const badgeText = stripPipe(rawBadgeText || "");
63
- const safeTarget = Number.isFinite(targetNumber) ? targetNumber : 0;
64
- const safeStart = startNumber != null && Number.isFinite(startNumber) ? startNumber : Math.max(0, Math.round(safeTarget * 0.98));
65
- const mainTextColor = hasMedia ? "#FFFFFF" : foreground;
66
- const pillTextColor = accessibleTextColor(surfaceElevated, foreground);
67
- const mediaTextShadow = hasMedia ? MEDIA_TEXT_SHADOW : void 0;
68
- const followerCount = Math.round(
69
- interpolate(progress, [0.056, 0.556], [safeStart, safeTarget], CLAMP)
70
- );
71
- const hasHitTarget = followerCount >= safeTarget;
72
- const numberScale = spring(
73
- interpolate(progress, [0, 0.25], [0, 1], CLAMP),
74
- SPRING_SMOOTH
75
- );
76
- const glowIntensity = interpolate(progress, [0.33, 0.556], [0, 1], CLAMP);
77
- const labelOpacity = interpolate(progress, [0, 0.167], [0, 1], CLAMP);
78
- const badgeP = hasHitTarget ? spring(
79
- interpolate(progress, [0.556, 0.85], [0, 1], CLAMP),
80
- SPRING_BOUNCY
81
- ) : 0;
82
- const badgeScale = interpolate(badgeP, [0, 0.5, 1], [0, 1.2, 1], CLAMP);
83
- const badgeOpacity = badgeP;
84
- const confettiActive = hasHitTarget;
85
- const confettiProgress = confettiActive ? Math.max(0, (progress - 0.556) / 0.444) : 0;
86
- const beatScale = 1 + beatIntensity * 0.02;
87
- const numberDisplay = `${prefix}${followerCount.toLocaleString()}${suffix}`;
88
- const fontSize = numberDisplay.length > 9 ? dim * 0.09 : numberDisplay.length > 6 ? dim * 0.12 : dim * 0.16;
89
- return /* @__PURE__ */ jsxs(
90
- "div",
91
- {
92
- style: {
93
- position: "absolute",
94
- inset: 0,
95
- display: "flex",
96
- justifyContent: "center",
97
- alignItems: "center"
98
- },
99
- children: [
100
- confettiActive && /* @__PURE__ */ jsx(
101
- ConfettiLayer,
102
- {
103
- progress: confettiProgress,
104
- width,
105
- height,
106
- beatIntensity,
107
- bgColor: hasMedia ? void 0 : confettiBgColor || accent
108
- }
109
- ),
110
- /* @__PURE__ */ jsxs(
111
- "div",
112
- {
113
- style: {
114
- display: "flex",
115
- flexDirection: "column",
116
- alignItems: "center",
117
- gap: dim * 0.015,
118
- transform: `scale(${numberScale * beatScale})`,
119
- position: "relative",
120
- zIndex: 1,
121
- width: "100%"
122
- },
123
- children: [
124
- label && /* @__PURE__ */ jsx(
125
- "div",
126
- {
127
- style: {
128
- color: mainTextColor,
129
- fontSize: dim * 0.032,
130
- fontWeight: 500,
131
- textTransform: "uppercase",
132
- letterSpacing: dim * 4e-3,
133
- opacity: labelOpacity,
134
- textAlign: "center",
135
- ...mediaTextShadow ? { textShadow: mediaTextShadow } : {}
136
- },
137
- children: label
138
- }
139
- ),
140
- /* @__PURE__ */ jsxs(
141
- "div",
142
- {
143
- style: {
144
- color: mainTextColor,
145
- fontSize,
146
- fontWeight: 800,
147
- letterSpacing: dim * -4e-3,
148
- lineHeight: 1,
149
- position: "relative",
150
- maxWidth: "90%",
151
- textAlign: "center",
152
- ...mediaTextShadow ? { textShadow: mediaTextShadow } : {}
153
- },
154
- children: [
155
- /* @__PURE__ */ jsx(
156
- "div",
157
- {
158
- style: {
159
- position: "absolute",
160
- top: "50%",
161
- left: "50%",
162
- transform: "translate(-50%, -50%)",
163
- width: dim * 0.5,
164
- height: dim * 0.2,
165
- borderRadius: "50%",
166
- background: `radial-gradient(ellipse, ${withOpacity(accent, glowIntensity * 0.2)} 0%, ${withOpacity(accent, glowIntensity * 0.05)} 50%, transparent 70%)`,
167
- pointerEvents: "none"
168
- }
169
- }
170
- ),
171
- /* @__PURE__ */ jsx("span", { style: { position: "relative" }, children: numberDisplay })
172
- ]
173
- }
174
- ),
175
- badgeText && /* @__PURE__ */ jsxs(
176
- "div",
177
- {
178
- style: {
179
- position: "absolute",
180
- top: "100%",
181
- left: "50%",
182
- transform: `translateX(-50%) scale(${badgeScale})`,
183
- opacity: badgeOpacity,
184
- backgroundColor: surfaceElevated,
185
- border: "1px solid rgba(255,255,255,0.15)",
186
- borderRadius: 100 * s,
187
- padding: `${dim * 0.015}px ${dim * 0.037}px`,
188
- display: "flex",
189
- alignItems: "center",
190
- justifyContent: "center",
191
- gap: dim * 0.011,
192
- whiteSpace: "nowrap",
193
- marginTop: dim * 0.02
194
- },
195
- children: [
196
- /* @__PURE__ */ jsx(Emoji, { char: badgeEmoji, size: dim * 0.045, verticalAlign: "middle" }),
197
- /* @__PURE__ */ jsx(
198
- "span",
199
- {
200
- style: {
201
- color: pillTextColor,
202
- fontSize: dim * 0.036,
203
- fontWeight: 700,
204
- letterSpacing: dim * 5e-4
205
- },
206
- children: renderWithEmoji(badgeText, dim * 0.036)
207
- }
208
- )
209
- ]
210
- }
211
- )
212
- ]
213
- }
214
- )
215
- ]
216
- }
217
- );
218
- };
219
-
220
- // src/visual-system/scene-templates/social-milestone.tsx
221
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
222
- var SocialMilestoneTemplate = ({
223
- variables,
224
- style,
225
- progress,
226
- beatIntensity,
227
- width,
228
- height,
229
- sceneDuration,
230
- isPlaying = true,
231
- backgroundEffect
232
- }) => {
233
- const { primary, secondary, foreground, surfaceElevated, font } = resolveTokens(style);
234
- const label = stripPipe(String(variables.label || "Followers"));
235
- const gradSeed = label.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
236
- const targetNumber = Number(variables.targetNumber) || 1e4;
237
- const rawStart = variables.startNumber != null ? Number(variables.startNumber) : void 0;
238
- const badgeText = stripPipe(String(variables.badgeText || ""));
239
- const badgeEmoji = String(variables.badgeEmoji || "\u{1F389}");
240
- const hasMedia = !!String(variables.mediaUrl || "").trim() && String(variables.mediaType || "auto") !== "gradient";
241
- return /* @__PURE__ */ jsxs2(
242
- "div",
243
- {
244
- style: {
245
- width,
246
- height,
247
- backgroundColor: "var(--vanillasky-template-surface, #000)",
248
- position: "relative",
249
- overflow: "hidden",
250
- fontFamily: font,
251
- display: "flex",
252
- justifyContent: "center",
253
- alignItems: "center"
254
- },
255
- children: [
256
- /* @__PURE__ */ jsx2(
257
- SceneBackground,
258
- {
259
- style,
260
- progress,
261
- sceneDuration,
262
- width,
263
- height,
264
- ...getMediaBackgroundProps(variables),
265
- backgroundEffect,
266
- seed: gradSeed,
267
- isPlaying,
268
- beatIntensity
269
- }
270
- ),
271
- /* @__PURE__ */ jsx2(
272
- MilestoneBadge,
273
- {
274
- progress,
275
- width,
276
- height,
277
- targetNumber,
278
- label,
279
- startNumber: rawStart,
280
- badgeText,
281
- badgeEmoji,
282
- accent: primary,
283
- hasMedia,
284
- foreground,
285
- surfaceElevated,
286
- beatIntensity,
287
- confettiBgColor: secondary
288
- }
289
- )
290
- ]
291
- }
292
- );
293
- };
294
- export {
295
- SocialMilestoneTemplate
296
- };
@@ -1,247 +0,0 @@
1
- import {
2
- stripPipe
3
- } from "./chunk-S7HFLYNN.js";
4
- import {
5
- SceneBackground,
6
- getMediaBackgroundProps
7
- } from "./chunk-MXZSDGZQ.js";
8
- import {
9
- Emoji,
10
- renderWithEmoji
11
- } from "./chunk-L5BTTCZV.js";
12
- import "./chunk-FRN6WKHA.js";
13
- import "./chunk-W3VDIBGR.js";
14
- import {
15
- SPRING_SMOOTH,
16
- interpolate,
17
- spring
18
- } from "./chunk-XTOXFMLM.js";
19
- import "./chunk-224QNWRA.js";
20
- import "./chunk-5CDAM24P.js";
21
- import {
22
- resolveTokens
23
- } from "./chunk-XWWLKRNU.js";
24
-
25
- // src/visual-system/primitives/social/NotificationCard.tsx
26
- import { jsx, jsxs } from "react/jsx-runtime";
27
- var CLAMP = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
28
- var NotificationCard = ({
29
- progress,
30
- motionProgress = progress,
31
- appName: rawAppName,
32
- appIcon: rawAppIcon,
33
- message: rawMessage,
34
- width,
35
- height,
36
- beatIntensity = 0
37
- }) => {
38
- const dim = Math.min(width, height);
39
- const appName = stripPipe(rawAppName);
40
- const appIcon = (rawAppIcon || "\u{1F514}").trim() || "\u{1F514}";
41
- const message = rawMessage;
42
- const presentationProgress = Math.max(progress, motionProgress);
43
- const cardSpring = spring(interpolate(presentationProgress, [0.05, 0.2], [0, 1], CLAMP), SPRING_SMOOTH);
44
- const cardOpacity = interpolate(presentationProgress, [0.05, 0.15], [0, 1], CLAMP);
45
- const cardScale = interpolate(cardSpring, [0, 1], [0.95, 1]);
46
- const cardLift = (1 - cardSpring) * 12;
47
- const headerOpacity = interpolate(presentationProgress, [0.18, 0.3], [0, 1], CLAMP);
48
- const words = message.split(/\s+/).filter(Boolean);
49
- const wordStart = 0.3;
50
- const wordEnd = 0.7;
51
- const wordSlice = (wordEnd - wordStart) / Math.max(words.length, 1);
52
- const cardW = Math.min(width * 0.88, dim * 0.9);
53
- const cardPad = dim * 0.038;
54
- const cardRadius = dim * 0.025;
55
- const iconSize = dim * 0.045;
56
- const iconRadius = iconSize * 0.28;
57
- const iconFont = iconSize * 0.66;
58
- const appFontSize = dim * 0.03;
59
- const timeFontSize = dim * 0.026;
60
- const msgFontSize = dim * 0.04;
61
- const beatGlow = 1 + beatIntensity * 0.3;
62
- return /* @__PURE__ */ jsx(
63
- "div",
64
- {
65
- "data-notification-card": "true",
66
- style: {
67
- position: "absolute",
68
- top: "50%",
69
- left: (width - cardW) / 2,
70
- width: cardW,
71
- transform: `translateY(calc(-50% + ${cardLift}px))`,
72
- opacity: cardOpacity
73
- },
74
- children: /* @__PURE__ */ jsxs(
75
- "div",
76
- {
77
- style: {
78
- backgroundColor: "rgba(245,242,238,0.92)",
79
- borderRadius: cardRadius,
80
- padding: cardPad,
81
- boxShadow: `0 ${dim * 0.012}px ${dim * 0.05 * beatGlow}px rgba(0,0,0,0.18)`,
82
- transform: `scale(${cardScale})`,
83
- transformOrigin: "center top",
84
- display: "flex",
85
- flexDirection: "column",
86
- gap: dim * 0.018
87
- },
88
- children: [
89
- /* @__PURE__ */ jsxs(
90
- "div",
91
- {
92
- "data-notification-header": "true",
93
- style: {
94
- display: "flex",
95
- alignItems: "center",
96
- gap: dim * 0.014,
97
- opacity: headerOpacity
98
- },
99
- children: [
100
- /* @__PURE__ */ jsx(
101
- "div",
102
- {
103
- style: {
104
- width: iconSize,
105
- height: iconSize,
106
- borderRadius: iconRadius,
107
- backgroundColor: "rgba(0,0,0,0.06)",
108
- display: "flex",
109
- alignItems: "center",
110
- justifyContent: "center",
111
- lineHeight: 1,
112
- fontSize: iconFont
113
- },
114
- children: /* @__PURE__ */ jsx(Emoji, { char: appIcon, size: iconFont, verticalAlign: "middle" })
115
- }
116
- ),
117
- /* @__PURE__ */ jsx(
118
- "span",
119
- {
120
- style: {
121
- fontSize: appFontSize,
122
- fontWeight: 600,
123
- color: "rgba(0,0,0,0.65)",
124
- letterSpacing: 0.2
125
- },
126
- children: appName
127
- }
128
- ),
129
- /* @__PURE__ */ jsx(
130
- "span",
131
- {
132
- style: {
133
- fontSize: timeFontSize,
134
- color: "rgba(0,0,0,0.4)",
135
- marginLeft: "auto"
136
- },
137
- children: "now"
138
- }
139
- )
140
- ]
141
- }
142
- ),
143
- /* @__PURE__ */ jsx(
144
- "div",
145
- {
146
- style: {
147
- fontSize: msgFontSize,
148
- fontWeight: 400,
149
- color: "#1c1c1e",
150
- lineHeight: 1.28,
151
- display: "flex",
152
- flexWrap: "wrap",
153
- gap: `0 ${dim * 9e-3}px`
154
- },
155
- children: words.map((word, wi) => {
156
- const wordP = interpolate(
157
- presentationProgress,
158
- [wordStart + wi * wordSlice, wordStart + wi * wordSlice + wordSlice * 0.6],
159
- [0, 1],
160
- CLAMP
161
- );
162
- return /* @__PURE__ */ jsx(
163
- "span",
164
- {
165
- style: {
166
- opacity: wordP,
167
- transform: `translateY(${(1 - wordP) * 4}px)`,
168
- display: "inline-block"
169
- },
170
- children: renderWithEmoji(word, msgFontSize)
171
- },
172
- wi
173
- );
174
- })
175
- }
176
- )
177
- ]
178
- }
179
- )
180
- }
181
- );
182
- };
183
-
184
- // src/visual-system/scene-templates/social-notification.tsx
185
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
186
- var SocialNotificationTemplate = ({
187
- variables,
188
- style,
189
- progress,
190
- motionProgress = progress,
191
- beatIntensity,
192
- width,
193
- height,
194
- sceneDuration,
195
- isPlaying = true,
196
- backgroundEffect
197
- }) => {
198
- const { font } = resolveTokens(style);
199
- const message = String(variables.message || "");
200
- const gradSeed = message.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
201
- return /* @__PURE__ */ jsxs2(
202
- "div",
203
- {
204
- style: {
205
- width,
206
- height,
207
- backgroundColor: "var(--vanillasky-template-surface, #000)",
208
- position: "relative",
209
- overflow: "hidden",
210
- fontFamily: font
211
- },
212
- children: [
213
- /* @__PURE__ */ jsx2(
214
- SceneBackground,
215
- {
216
- style,
217
- progress,
218
- sceneDuration,
219
- width,
220
- height,
221
- ...getMediaBackgroundProps(variables),
222
- backgroundEffect,
223
- seed: gradSeed,
224
- isPlaying,
225
- beatIntensity
226
- }
227
- ),
228
- /* @__PURE__ */ jsx2(
229
- NotificationCard,
230
- {
231
- progress,
232
- motionProgress,
233
- appName: String(variables.appName || "Reminder"),
234
- appIcon: String(variables.appIcon || "\u{1F514}"),
235
- message,
236
- width,
237
- height,
238
- beatIntensity
239
- }
240
- )
241
- ]
242
- }
243
- );
244
- };
245
- export {
246
- SocialNotificationTemplate
247
- };