@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,460 +0,0 @@
1
- import {
2
- parseList
3
- } from "./chunk-P22HHFDK.js";
4
- import {
5
- stripPipe
6
- } from "./chunk-S7HFLYNN.js";
7
- import {
8
- smoothSize
9
- } from "./chunk-YJJC4N4D.js";
10
- import {
11
- Emoji,
12
- renderWithEmoji
13
- } from "./chunk-L5BTTCZV.js";
14
- import {
15
- gradientBackground
16
- } from "./chunk-W3VDIBGR.js";
17
- import {
18
- interpolate,
19
- spring
20
- } from "./chunk-XTOXFMLM.js";
21
- import {
22
- TOKEN_DEFAULTS,
23
- resolveTokens
24
- } from "./chunk-XWWLKRNU.js";
25
-
26
- // src/visual-system/primitives/infographic/BeforeAfterSplit.tsx
27
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
28
- var SPRING_POP = { damping: 6, stiffness: 250 };
29
- var SPRING_HAPPY = { damping: 9, stiffness: 220 };
30
- var SPRING_TEXT = { damping: 10, stiffness: 150 };
31
- var POSITIONS = [
32
- { x: 0.06, y: 0.06 },
33
- { x: 0.3, y: 0.1 },
34
- { x: 0.62, y: 0.07 },
35
- { x: 0.92, y: 0.09 },
36
- { x: 0.08, y: 0.26 },
37
- { x: 0.92, y: 0.24 },
38
- { x: 0.04, y: 0.4 },
39
- { x: 0.96, y: 0.42 },
40
- { x: 0.04, y: 0.62 },
41
- { x: 0.96, y: 0.6 },
42
- { x: 0.1, y: 0.78 },
43
- { x: 0.34, y: 0.82 },
44
- { x: 0.66, y: 0.8 },
45
- { x: 0.9, y: 0.78 },
46
- { x: 0.22, y: 0.92 },
47
- { x: 0.78, y: 0.94 }
48
- ];
49
- var ROTATIONS = [-12, 8, -5, 15, -8, 10, -15, 6, -10, 12, -6, 14, -9, 7, -13, 11];
50
- var POP_ORDER = [7, 12, 3, 9, 0, 14, 5, 11, 2, 8, 15, 4, 10, 1, 13, 6];
51
- var FALL_SWAY = [0.7, -1, 0.4, -0.6, 0.9, -0.3, 0.5, -0.8, 0.6, -0.5, 0.3, -0.9, 0.8, -0.4, 0.2, -0.7];
52
- var BeforeAfterSplit = ({
53
- progress,
54
- width,
55
- height,
56
- problemHeadline: rawProblemHeadline,
57
- solutionHeadline: rawSolutionHeadline,
58
- problemEmojis: rawProblemEmojis = [],
59
- solutionEmojis: rawSolutionEmojis = [],
60
- showEmojis = true,
61
- beforeLabel = "BEFORE",
62
- afterLabel = "AFTER",
63
- beforeUrl,
64
- afterUrl,
65
- textColor = "#ffffff",
66
- font = TOKEN_DEFAULTS.font,
67
- beatIntensity = 0
68
- }) => {
69
- const s = Math.min(width, height) / 1080;
70
- const problemLabel = String(beforeLabel || "BEFORE").toUpperCase();
71
- const solutionLabel = String(afterLabel || "AFTER").toUpperCase();
72
- const problemHeadline = stripPipe(String(rawProblemHeadline || ""));
73
- const solutionHeadline = stripPipe(String(rawSolutionHeadline || ""));
74
- const problemTypes = showEmojis ? rawProblemEmojis.filter((e) => (e || "").length > 0) : [];
75
- const solutionTypes = showEmojis ? rawSolutionEmojis.filter((e) => (e || "").length > 0) : [];
76
- if (showEmojis && problemTypes.length === 0) problemTypes.push("\u{1F4C5}", "\u{1F630}");
77
- if (showEmojis && solutionTypes.length === 0) solutionTypes.push("\u2728", "\u2705");
78
- const beforeColor = "#ef4444";
79
- const afterColor = "#22c55e";
80
- const SLOT_COUNT = POSITIONS.length;
81
- const problemEmojis = showEmojis ? Array.from({ length: SLOT_COUNT }, (_, i) => problemTypes[POP_ORDER[i] % problemTypes.length]) : [];
82
- const solutionEmojis = showEmojis ? Array.from({ length: SLOT_COUNT }, (_, i) => solutionTypes[POP_ORDER[i] % solutionTypes.length]) : [];
83
- const PROBLEM_BASE = 0.05;
84
- const PROBLEM_STAGGER = 0.01;
85
- const FALL_START = 0.35;
86
- const FALL_END = 0.5;
87
- const HEADLINE_FADE = [0.4, 0.5];
88
- const SOLUTION_BASE = 0.5;
89
- const SOLUTION_STAGGER = 8e-3;
90
- const problemHeadlineMask = 1 - interpolate(progress, [HEADLINE_FADE[0], HEADLINE_FADE[1]], [0, 1], {
91
- extrapolateLeft: "clamp",
92
- extrapolateRight: "clamp"
93
- });
94
- const solutionHeadlineMask = interpolate(progress, [HEADLINE_FADE[0] + 0.05, HEADLINE_FADE[1] + 0.05], [0, 1], {
95
- extrapolateLeft: "clamp",
96
- extrapolateRight: "clamp"
97
- });
98
- const emojiFontSize = Math.min(72 * s, width * 0.085);
99
- const emojiHalf = emojiFontSize / 2;
100
- const padX = emojiHalf + 8 * s;
101
- const padY = emojiHalf + 8 * s;
102
- const zoneTop = padY;
103
- const zoneLeft = padX;
104
- const zoneWidth = width - padX * 2;
105
- const zoneHeight = height - padY * 2;
106
- const labelFontSize = 32 * s;
107
- const pillTop = height * 0.38;
108
- const textTop = height * 0.46;
109
- const longerChars = Math.max(problemHeadline.length, solutionHeadline.length, 1);
110
- const mainSize = smoothSize(longerChars, 70, 88, 60) * s;
111
- const problemTextP = spring(
112
- interpolate(progress, [0.1, 0.25], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
113
- SPRING_TEXT
114
- );
115
- const problemTextScale = interpolate(problemTextP, [0, 1], [1.4, 1]);
116
- const problemTextOpacity = interpolate(progress, [0.1, 0.2], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
117
- const solutionTextP = spring(
118
- interpolate(progress, [0.55, 0.7], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
119
- SPRING_TEXT
120
- );
121
- const solutionTextScale = interpolate(solutionTextP, [0, 1], [1.4, 1]);
122
- const solutionTextOpacity = interpolate(progress, [0.55, 0.65], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
123
- return /* @__PURE__ */ jsxs(Fragment, { children: [
124
- beforeUrl ? /* @__PURE__ */ jsx(
125
- "div",
126
- {
127
- style: {
128
- position: "absolute",
129
- inset: 0,
130
- opacity: problemHeadlineMask * 0.6,
131
- backgroundImage: `url(${beforeUrl})`,
132
- backgroundSize: "cover",
133
- backgroundPosition: "center",
134
- pointerEvents: "none"
135
- }
136
- }
137
- ) : null,
138
- afterUrl ? /* @__PURE__ */ jsx(
139
- "div",
140
- {
141
- style: {
142
- position: "absolute",
143
- inset: 0,
144
- opacity: solutionHeadlineMask * 0.6,
145
- backgroundImage: `url(${afterUrl})`,
146
- backgroundSize: "cover",
147
- backgroundPosition: "center",
148
- pointerEvents: "none"
149
- }
150
- }
151
- ) : null,
152
- problemEmojis.map((emoji, i) => {
153
- const pos = POSITIONS[i];
154
- const rotation = ROTATIONS[i];
155
- const popRank = POP_ORDER[i];
156
- const sway = FALL_SWAY[i];
157
- const cx = zoneLeft + pos.x * zoneWidth;
158
- const cy = zoneTop + pos.y * zoneHeight;
159
- const popDelay = PROBLEM_BASE + popRank * PROBLEM_STAGGER;
160
- const popP = spring(
161
- interpolate(progress, [popDelay, popDelay + 0.1], [0, 1], {
162
- extrapolateLeft: "clamp",
163
- extrapolateRight: "clamp"
164
- }),
165
- SPRING_POP
166
- );
167
- const emojiScale = interpolate(popP, [0, 1], [0, 1]);
168
- const settled = popP > 0.5;
169
- const inFall = progress >= FALL_START;
170
- const shakePhase = progress * 50;
171
- const shakeX = settled && !inFall ? Math.sin(shakePhase + i * 1.7) * 7 * s : 0;
172
- const shakeY = settled && !inFall ? Math.cos(shakePhase + i * 2.3) * 5 * s : 0;
173
- const shakeRotate = settled && !inFall ? rotation + Math.sin(shakePhase * 0.7 + i * 3.1) * 9 : rotation;
174
- const fallProgress = interpolate(progress, [FALL_START, FALL_END], [0, 1], {
175
- extrapolateLeft: "clamp",
176
- extrapolateRight: "clamp"
177
- });
178
- const fallY = fallProgress * fallProgress * height * 1.3;
179
- const fallSwayX = Math.sin(fallProgress * Math.PI * 2 + i * 0.7) * 30 * s * sway;
180
- const fallRotate = fallProgress * (180 + i % 5 * 60) * (i % 2 === 0 ? 1 : -1);
181
- const fadeOut = interpolate(progress, [FALL_END - 0.02, FALL_END + 0.02], [1, 0], {
182
- extrapolateLeft: "clamp",
183
- extrapolateRight: "clamp"
184
- });
185
- const beatPulse = 1 + beatIntensity * 0.04 * (i % 2 === 0 ? 1 : -0.5);
186
- return /* @__PURE__ */ jsx(
187
- "div",
188
- {
189
- style: {
190
- position: "absolute",
191
- left: cx - emojiHalf,
192
- top: cy - emojiHalf,
193
- width: emojiFontSize,
194
- height: emojiFontSize,
195
- fontSize: emojiFontSize,
196
- lineHeight: 1,
197
- display: "flex",
198
- alignItems: "center",
199
- justifyContent: "center",
200
- opacity: fadeOut,
201
- transform: `translate(${shakeX + fallSwayX}px, ${shakeY + fallY}px) rotate(${shakeRotate + fallRotate}deg) scale(${emojiScale * beatPulse})`,
202
- transformOrigin: "center center",
203
- pointerEvents: "none"
204
- },
205
- children: /* @__PURE__ */ jsx(Emoji, { char: emoji, size: emojiFontSize, verticalAlign: "baseline" })
206
- },
207
- `problem-${i}`
208
- );
209
- }),
210
- solutionEmojis.map((emoji, i) => {
211
- const pos = POSITIONS[i];
212
- const popRank = POP_ORDER[i];
213
- const cx = zoneLeft + pos.x * zoneWidth;
214
- const cy = zoneTop + pos.y * zoneHeight;
215
- const popDelay = SOLUTION_BASE + popRank * SOLUTION_STAGGER;
216
- const popP = spring(
217
- interpolate(progress, [popDelay, popDelay + 0.14], [0, 1], {
218
- extrapolateLeft: "clamp",
219
- extrapolateRight: "clamp"
220
- }),
221
- SPRING_HAPPY
222
- );
223
- const emojiScale = interpolate(popP, [0, 1], [0, 1]);
224
- const liftY = (1 - Math.min(1, popP)) * 14 * s;
225
- const settled = popP > 0.95;
226
- const breathe = settled ? 1 + Math.sin(progress * Math.PI * 4 + i * 0.9) * 0.015 : 1;
227
- const exitP = interpolate(progress, [0.9, 1], [0, 1], {
228
- extrapolateLeft: "clamp",
229
- extrapolateRight: "clamp"
230
- });
231
- const exitFade = 1 - exitP;
232
- const exitLift = exitP * -20 * s;
233
- const exitShrink = 1 - exitP * 0.06;
234
- const beatPulse = 1 + beatIntensity * 0.03;
235
- const opacity = interpolate(popP, [0, 0.3], [0, 1], {
236
- extrapolateLeft: "clamp",
237
- extrapolateRight: "clamp"
238
- }) * exitFade;
239
- return /* @__PURE__ */ jsx(
240
- "div",
241
- {
242
- style: {
243
- position: "absolute",
244
- left: cx - emojiHalf,
245
- top: cy - emojiHalf,
246
- width: emojiFontSize,
247
- height: emojiFontSize,
248
- fontSize: emojiFontSize,
249
- lineHeight: 1,
250
- display: "flex",
251
- alignItems: "center",
252
- justifyContent: "center",
253
- opacity,
254
- transform: `translateY(${liftY + exitLift}px) scale(${emojiScale * breathe * beatPulse * exitShrink})`,
255
- transformOrigin: "center center",
256
- pointerEvents: "none"
257
- },
258
- children: /* @__PURE__ */ jsx(Emoji, { char: emoji, size: emojiFontSize, verticalAlign: "baseline" })
259
- },
260
- `solution-${i}`
261
- );
262
- }),
263
- /* @__PURE__ */ jsxs("div", { style: { position: "absolute", inset: 0, opacity: problemHeadlineMask, pointerEvents: "none" }, children: [
264
- /* @__PURE__ */ jsx(
265
- "div",
266
- {
267
- style: {
268
- position: "absolute",
269
- top: pillTop,
270
- left: 0,
271
- right: 0,
272
- display: "flex",
273
- justifyContent: "center"
274
- },
275
- children: /* @__PURE__ */ jsx(
276
- "div",
277
- {
278
- style: {
279
- fontSize: labelFontSize,
280
- fontWeight: 700,
281
- color: beforeColor,
282
- letterSpacing: 3 * s,
283
- textTransform: "uppercase",
284
- whiteSpace: "nowrap",
285
- transform: `scale(${interpolate(spring(interpolate(progress, [0.03, 0.18], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }), { damping: 9, stiffness: 220 }), [0, 1], [0.55, 1])})`,
286
- transformOrigin: "center center",
287
- fontFamily: font,
288
- backgroundColor: "rgba(0,0,0,0.3)",
289
- border: "1px solid rgba(255,255,255,0.15)",
290
- borderRadius: 100 * s,
291
- padding: `${14 * s}px ${36 * s}px`,
292
- textShadow: "0 1px 6px rgba(0,0,0,0.1)"
293
- },
294
- children: problemLabel
295
- }
296
- )
297
- }
298
- ),
299
- /* @__PURE__ */ jsx(
300
- "div",
301
- {
302
- style: {
303
- position: "absolute",
304
- top: textTop,
305
- left: 0,
306
- right: 0,
307
- fontSize: mainSize,
308
- fontWeight: 800,
309
- color: textColor,
310
- textAlign: "center",
311
- padding: `0 ${60 * s}px`,
312
- lineHeight: 1.2,
313
- opacity: problemTextOpacity,
314
- transform: `scale(${problemTextScale})`,
315
- fontFamily: font
316
- },
317
- children: renderWithEmoji(problemHeadline, mainSize)
318
- }
319
- )
320
- ] }),
321
- /* @__PURE__ */ jsxs("div", { style: { position: "absolute", inset: 0, opacity: solutionHeadlineMask, pointerEvents: "none" }, children: [
322
- /* @__PURE__ */ jsx(
323
- "div",
324
- {
325
- style: {
326
- position: "absolute",
327
- top: pillTop,
328
- left: 0,
329
- right: 0,
330
- display: "flex",
331
- justifyContent: "center"
332
- },
333
- children: /* @__PURE__ */ jsx(
334
- "div",
335
- {
336
- style: {
337
- fontSize: labelFontSize,
338
- fontWeight: 700,
339
- color: afterColor,
340
- letterSpacing: 3 * s,
341
- textTransform: "uppercase",
342
- whiteSpace: "nowrap",
343
- transform: `scale(${interpolate(spring(interpolate(progress, [0.5, 0.65], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }), { damping: 9, stiffness: 220 }), [0, 1], [0.55, 1])})`,
344
- transformOrigin: "center center",
345
- fontFamily: font,
346
- backgroundColor: "rgba(0,0,0,0.3)",
347
- border: "1px solid rgba(255,255,255,0.15)",
348
- borderRadius: 100 * s,
349
- padding: `${14 * s}px ${36 * s}px`,
350
- textShadow: "0 1px 6px rgba(0,0,0,0.1)"
351
- },
352
- children: solutionLabel
353
- }
354
- )
355
- }
356
- ),
357
- /* @__PURE__ */ jsx(
358
- "div",
359
- {
360
- style: {
361
- position: "absolute",
362
- top: textTop,
363
- left: 0,
364
- right: 0,
365
- fontSize: mainSize,
366
- fontWeight: 800,
367
- color: textColor,
368
- textAlign: "center",
369
- padding: `0 ${60 * s}px`,
370
- lineHeight: 1.2,
371
- opacity: solutionTextOpacity,
372
- transform: `scale(${solutionTextScale})`,
373
- fontFamily: font
374
- },
375
- children: renderWithEmoji(solutionHeadline, mainSize)
376
- }
377
- )
378
- ] })
379
- ] });
380
- };
381
-
382
- // src/visual-system/scene-templates/infographic-before-after.tsx
383
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
384
- var InfographicBeforeAfterTemplate = ({
385
- variables,
386
- style,
387
- progress,
388
- beatIntensity,
389
- width,
390
- height,
391
- textArchetype,
392
- safeZone,
393
- sceneDuration
394
- }) => {
395
- const { background, foreground, font } = resolveTokens(style);
396
- const textColor = foreground;
397
- const problemHeadline = String(variables.problemHeadline || "");
398
- const solutionHeadline = String(variables.solutionHeadline || "");
399
- const problemTypes = parseList(variables.problemEmojis);
400
- const solutionTypes = parseList(variables.solutionEmojis);
401
- const showEmojis = variables.showEmojis !== false && String(variables.showEmojis ?? "true").toLowerCase() !== "false";
402
- const gradSeed = (problemHeadline + solutionHeadline).split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
403
- void textArchetype;
404
- void safeZone;
405
- return /* @__PURE__ */ jsxs2(
406
- "div",
407
- {
408
- style: {
409
- width,
410
- height,
411
- backgroundColor: "var(--vanillasky-template-surface, #000)",
412
- position: "relative",
413
- overflow: "hidden",
414
- fontFamily: font
415
- },
416
- children: [
417
- /* @__PURE__ */ jsx2(
418
- "div",
419
- {
420
- style: {
421
- position: "absolute",
422
- inset: 0,
423
- background: gradientBackground({
424
- colorA: background.type === "solid" ? background.color : background.colors[0],
425
- colorB: background.type === "solid" ? background.color : background.colors[1],
426
- solidBg: background.type === "solid" ? background.color : void 0,
427
- progress,
428
- sceneDuration,
429
- seed: gradSeed,
430
- family: resolveTokens(style).preset.background
431
- }),
432
- pointerEvents: "none"
433
- }
434
- }
435
- ),
436
- /* @__PURE__ */ jsx2(
437
- BeforeAfterSplit,
438
- {
439
- progress,
440
- width,
441
- height,
442
- problemHeadline,
443
- solutionHeadline,
444
- problemEmojis: problemTypes,
445
- solutionEmojis: solutionTypes,
446
- showEmojis,
447
- beforeLabel: String(variables.problemLabel || ""),
448
- afterLabel: String(variables.solutionLabel || ""),
449
- textColor,
450
- font,
451
- beatIntensity
452
- }
453
- )
454
- ]
455
- }
456
- );
457
- };
458
- export {
459
- InfographicBeforeAfterTemplate
460
- };