@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,292 @@
|
|
|
1
|
+
import {
|
|
2
|
+
stripPipe
|
|
3
|
+
} from "./chunk-S7HFLYNN.js";
|
|
4
|
+
import {
|
|
5
|
+
SceneBackground,
|
|
6
|
+
getMediaBackgroundProps
|
|
7
|
+
} from "./chunk-IFOW65Z6.js";
|
|
8
|
+
import {
|
|
9
|
+
ConfettiLayer
|
|
10
|
+
} from "./chunk-CJ7F2CE6.js";
|
|
11
|
+
import "./chunk-QAAO7OAY.js";
|
|
12
|
+
import {
|
|
13
|
+
Emoji,
|
|
14
|
+
renderWithEmoji
|
|
15
|
+
} from "./chunk-L5BTTCZV.js";
|
|
16
|
+
import {
|
|
17
|
+
accessibleTextColor,
|
|
18
|
+
withOpacity
|
|
19
|
+
} from "./chunk-ABZACD4G.js";
|
|
20
|
+
import {
|
|
21
|
+
SPRING_BOUNCY,
|
|
22
|
+
SPRING_SMOOTH,
|
|
23
|
+
interpolate,
|
|
24
|
+
spring
|
|
25
|
+
} from "./chunk-XTOXFMLM.js";
|
|
26
|
+
import {
|
|
27
|
+
TOKEN_DEFAULTS,
|
|
28
|
+
resolveTokens
|
|
29
|
+
} from "./chunk-FNAEQ7QO.js";
|
|
30
|
+
|
|
31
|
+
// src/visual-system/primitives/social/MilestoneBadge.tsx
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
var CLAMP = {
|
|
34
|
+
extrapolateLeft: "clamp",
|
|
35
|
+
extrapolateRight: "clamp"
|
|
36
|
+
};
|
|
37
|
+
var MilestoneBadge = ({
|
|
38
|
+
progress,
|
|
39
|
+
width,
|
|
40
|
+
height,
|
|
41
|
+
targetNumber,
|
|
42
|
+
label: rawLabel,
|
|
43
|
+
prefix = "",
|
|
44
|
+
suffix = "",
|
|
45
|
+
startNumber,
|
|
46
|
+
badgeText: rawBadgeText = "",
|
|
47
|
+
badgeEmoji = "\u{1F389}",
|
|
48
|
+
accent = TOKEN_DEFAULTS.primary,
|
|
49
|
+
hasMedia = false,
|
|
50
|
+
foreground = TOKEN_DEFAULTS.foreground,
|
|
51
|
+
surfaceElevated = TOKEN_DEFAULTS.surfaceElevated,
|
|
52
|
+
beatIntensity = 0,
|
|
53
|
+
confettiBgColor
|
|
54
|
+
}) => {
|
|
55
|
+
const dim = Math.min(width, height);
|
|
56
|
+
const s = dim / 1080;
|
|
57
|
+
const label = stripPipe(rawLabel || "");
|
|
58
|
+
const badgeText = stripPipe(rawBadgeText || "");
|
|
59
|
+
const safeTarget = Number.isFinite(targetNumber) ? targetNumber : 0;
|
|
60
|
+
const safeStart = startNumber != null && Number.isFinite(startNumber) ? startNumber : Math.max(0, Math.round(safeTarget * 0.98));
|
|
61
|
+
const mainTextColor = hasMedia ? "#FFFFFF" : foreground;
|
|
62
|
+
const pillTextColor = accessibleTextColor(surfaceElevated, foreground);
|
|
63
|
+
const mediaTextShadow = hasMedia ? "0 2px 8px rgba(0,0,0,0.55), 0 6px 16px rgba(0,0,0,0.35)" : void 0;
|
|
64
|
+
const followerCount = Math.round(
|
|
65
|
+
interpolate(progress, [0.056, 0.556], [safeStart, safeTarget], CLAMP)
|
|
66
|
+
);
|
|
67
|
+
const hasHitTarget = followerCount >= safeTarget;
|
|
68
|
+
const numberScale = spring(
|
|
69
|
+
interpolate(progress, [0, 0.25], [0, 1], CLAMP),
|
|
70
|
+
SPRING_SMOOTH
|
|
71
|
+
);
|
|
72
|
+
const glowIntensity = interpolate(progress, [0.33, 0.556], [0, 1], CLAMP);
|
|
73
|
+
const labelOpacity = interpolate(progress, [0, 0.167], [0, 1], CLAMP);
|
|
74
|
+
const badgeP = hasHitTarget ? spring(
|
|
75
|
+
interpolate(progress, [0.556, 0.85], [0, 1], CLAMP),
|
|
76
|
+
SPRING_BOUNCY
|
|
77
|
+
) : 0;
|
|
78
|
+
const badgeScale = interpolate(badgeP, [0, 0.5, 1], [0, 1.2, 1], CLAMP);
|
|
79
|
+
const badgeOpacity = badgeP;
|
|
80
|
+
const confettiActive = hasHitTarget;
|
|
81
|
+
const confettiProgress = confettiActive ? Math.max(0, (progress - 0.556) / 0.444) : 0;
|
|
82
|
+
const beatScale = 1 + beatIntensity * 0.02;
|
|
83
|
+
const numberDisplay = `${prefix}${followerCount.toLocaleString()}${suffix}`;
|
|
84
|
+
const fontSize = numberDisplay.length > 9 ? dim * 0.09 : numberDisplay.length > 6 ? dim * 0.12 : dim * 0.16;
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
style: {
|
|
89
|
+
position: "absolute",
|
|
90
|
+
inset: 0,
|
|
91
|
+
display: "flex",
|
|
92
|
+
justifyContent: "center",
|
|
93
|
+
alignItems: "center"
|
|
94
|
+
},
|
|
95
|
+
children: [
|
|
96
|
+
confettiActive && /* @__PURE__ */ jsx(
|
|
97
|
+
ConfettiLayer,
|
|
98
|
+
{
|
|
99
|
+
progress: confettiProgress,
|
|
100
|
+
width,
|
|
101
|
+
height,
|
|
102
|
+
beatIntensity,
|
|
103
|
+
bgColor: hasMedia ? void 0 : confettiBgColor || accent
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ jsxs(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
style: {
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "column",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
gap: dim * 0.015,
|
|
114
|
+
transform: `scale(${numberScale * beatScale})`,
|
|
115
|
+
position: "relative",
|
|
116
|
+
zIndex: 1,
|
|
117
|
+
width: "100%"
|
|
118
|
+
},
|
|
119
|
+
children: [
|
|
120
|
+
label && /* @__PURE__ */ jsx(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
style: {
|
|
124
|
+
color: mainTextColor,
|
|
125
|
+
fontSize: dim * 0.032,
|
|
126
|
+
fontWeight: 500,
|
|
127
|
+
textTransform: "uppercase",
|
|
128
|
+
letterSpacing: dim * 4e-3,
|
|
129
|
+
opacity: labelOpacity,
|
|
130
|
+
textAlign: "center",
|
|
131
|
+
...mediaTextShadow ? { textShadow: mediaTextShadow } : {}
|
|
132
|
+
},
|
|
133
|
+
children: label
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ jsxs(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
style: {
|
|
140
|
+
color: mainTextColor,
|
|
141
|
+
fontSize,
|
|
142
|
+
fontWeight: 800,
|
|
143
|
+
letterSpacing: dim * -4e-3,
|
|
144
|
+
lineHeight: 1,
|
|
145
|
+
position: "relative",
|
|
146
|
+
maxWidth: "90%",
|
|
147
|
+
textAlign: "center",
|
|
148
|
+
...mediaTextShadow ? { textShadow: mediaTextShadow } : {}
|
|
149
|
+
},
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
style: {
|
|
155
|
+
position: "absolute",
|
|
156
|
+
top: "50%",
|
|
157
|
+
left: "50%",
|
|
158
|
+
transform: "translate(-50%, -50%)",
|
|
159
|
+
width: dim * 0.5,
|
|
160
|
+
height: dim * 0.2,
|
|
161
|
+
borderRadius: "50%",
|
|
162
|
+
background: `radial-gradient(ellipse, ${withOpacity(accent, glowIntensity * 0.2)} 0%, ${withOpacity(accent, glowIntensity * 0.05)} 50%, transparent 70%)`,
|
|
163
|
+
pointerEvents: "none"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative" }, children: numberDisplay })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
badgeText && /* @__PURE__ */ jsxs(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
style: {
|
|
175
|
+
position: "absolute",
|
|
176
|
+
top: "100%",
|
|
177
|
+
left: "50%",
|
|
178
|
+
transform: `translateX(-50%) scale(${badgeScale})`,
|
|
179
|
+
opacity: badgeOpacity,
|
|
180
|
+
backgroundColor: surfaceElevated,
|
|
181
|
+
border: "1px solid rgba(255,255,255,0.15)",
|
|
182
|
+
borderRadius: 100 * s,
|
|
183
|
+
padding: `${dim * 0.015}px ${dim * 0.037}px`,
|
|
184
|
+
display: "flex",
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
justifyContent: "center",
|
|
187
|
+
gap: dim * 0.011,
|
|
188
|
+
whiteSpace: "nowrap",
|
|
189
|
+
marginTop: dim * 0.02
|
|
190
|
+
},
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsx(Emoji, { char: badgeEmoji, size: dim * 0.045, verticalAlign: "middle" }),
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
"span",
|
|
195
|
+
{
|
|
196
|
+
style: {
|
|
197
|
+
color: pillTextColor,
|
|
198
|
+
fontSize: dim * 0.036,
|
|
199
|
+
fontWeight: 700,
|
|
200
|
+
letterSpacing: dim * 5e-4
|
|
201
|
+
},
|
|
202
|
+
children: renderWithEmoji(badgeText, dim * 0.036)
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// src/visual-system/scene-templates/social-milestone.tsx
|
|
217
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
218
|
+
var SocialMilestoneTemplate = ({
|
|
219
|
+
variables,
|
|
220
|
+
style,
|
|
221
|
+
progress,
|
|
222
|
+
beatIntensity,
|
|
223
|
+
width,
|
|
224
|
+
height,
|
|
225
|
+
sceneDuration,
|
|
226
|
+
isPlaying = true,
|
|
227
|
+
backgroundEffect
|
|
228
|
+
}) => {
|
|
229
|
+
const { primary, secondary, foreground, surfaceElevated, font } = resolveTokens(style);
|
|
230
|
+
const label = stripPipe(String(variables.label || "Followers"));
|
|
231
|
+
const gradSeed = label.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
|
|
232
|
+
const targetNumber = Number(variables.targetNumber) || 1e4;
|
|
233
|
+
const rawStart = variables.startNumber != null ? Number(variables.startNumber) : void 0;
|
|
234
|
+
const badgeText = stripPipe(String(variables.badgeText || ""));
|
|
235
|
+
const badgeEmoji = String(variables.badgeEmoji || "\u{1F389}");
|
|
236
|
+
const hasMedia = !!String(variables.mediaUrl || "").trim() && String(variables.mediaType || "auto") !== "gradient";
|
|
237
|
+
return /* @__PURE__ */ jsxs2(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
style: {
|
|
241
|
+
width,
|
|
242
|
+
height,
|
|
243
|
+
backgroundColor: "#000",
|
|
244
|
+
position: "relative",
|
|
245
|
+
overflow: "hidden",
|
|
246
|
+
fontFamily: font,
|
|
247
|
+
display: "flex",
|
|
248
|
+
justifyContent: "center",
|
|
249
|
+
alignItems: "center"
|
|
250
|
+
},
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ jsx2(
|
|
253
|
+
SceneBackground,
|
|
254
|
+
{
|
|
255
|
+
style,
|
|
256
|
+
progress,
|
|
257
|
+
sceneDuration,
|
|
258
|
+
width,
|
|
259
|
+
height,
|
|
260
|
+
...getMediaBackgroundProps(variables),
|
|
261
|
+
backgroundEffect,
|
|
262
|
+
seed: gradSeed,
|
|
263
|
+
isPlaying,
|
|
264
|
+
beatIntensity
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
/* @__PURE__ */ jsx2(
|
|
268
|
+
MilestoneBadge,
|
|
269
|
+
{
|
|
270
|
+
progress,
|
|
271
|
+
width,
|
|
272
|
+
height,
|
|
273
|
+
targetNumber,
|
|
274
|
+
label,
|
|
275
|
+
startNumber: rawStart,
|
|
276
|
+
badgeText,
|
|
277
|
+
badgeEmoji,
|
|
278
|
+
accent: primary,
|
|
279
|
+
hasMedia,
|
|
280
|
+
foreground,
|
|
281
|
+
surfaceElevated,
|
|
282
|
+
beatIntensity,
|
|
283
|
+
confettiBgColor: secondary
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
};
|
|
290
|
+
export {
|
|
291
|
+
SocialMilestoneTemplate
|
|
292
|
+
};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import {
|
|
2
|
+
stripPipe
|
|
3
|
+
} from "./chunk-S7HFLYNN.js";
|
|
4
|
+
import {
|
|
5
|
+
SceneBackground,
|
|
6
|
+
getMediaBackgroundProps
|
|
7
|
+
} from "./chunk-IFOW65Z6.js";
|
|
8
|
+
import {
|
|
9
|
+
Emoji,
|
|
10
|
+
renderWithEmoji
|
|
11
|
+
} from "./chunk-L5BTTCZV.js";
|
|
12
|
+
import "./chunk-ABZACD4G.js";
|
|
13
|
+
import {
|
|
14
|
+
SPRING_SMOOTH,
|
|
15
|
+
interpolate,
|
|
16
|
+
spring
|
|
17
|
+
} from "./chunk-XTOXFMLM.js";
|
|
18
|
+
import {
|
|
19
|
+
resolveTokens
|
|
20
|
+
} from "./chunk-FNAEQ7QO.js";
|
|
21
|
+
|
|
22
|
+
// src/visual-system/primitives/social/NotificationCard.tsx
|
|
23
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
var CLAMP = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
|
|
25
|
+
var NotificationCard = ({
|
|
26
|
+
progress,
|
|
27
|
+
motionProgress = progress,
|
|
28
|
+
appName: rawAppName,
|
|
29
|
+
appIcon: rawAppIcon,
|
|
30
|
+
message: rawMessage,
|
|
31
|
+
width,
|
|
32
|
+
height,
|
|
33
|
+
beatIntensity = 0
|
|
34
|
+
}) => {
|
|
35
|
+
const dim = Math.min(width, height);
|
|
36
|
+
const appName = stripPipe(rawAppName);
|
|
37
|
+
const appIcon = (rawAppIcon || "\u{1F514}").trim() || "\u{1F514}";
|
|
38
|
+
const message = rawMessage;
|
|
39
|
+
const presentationProgress = Math.max(progress, motionProgress);
|
|
40
|
+
const cardSpring = spring(interpolate(presentationProgress, [0.05, 0.2], [0, 1], CLAMP), SPRING_SMOOTH);
|
|
41
|
+
const cardOpacity = interpolate(presentationProgress, [0.05, 0.15], [0, 1], CLAMP);
|
|
42
|
+
const cardScale = interpolate(cardSpring, [0, 1], [0.95, 1]);
|
|
43
|
+
const cardLift = (1 - cardSpring) * 12;
|
|
44
|
+
const headerOpacity = interpolate(presentationProgress, [0.18, 0.3], [0, 1], CLAMP);
|
|
45
|
+
const words = message.split(/\s+/).filter(Boolean);
|
|
46
|
+
const wordStart = 0.3;
|
|
47
|
+
const wordEnd = 0.7;
|
|
48
|
+
const wordSlice = (wordEnd - wordStart) / Math.max(words.length, 1);
|
|
49
|
+
const cardW = Math.min(width * 0.88, dim * 0.9);
|
|
50
|
+
const cardPad = dim * 0.038;
|
|
51
|
+
const cardRadius = dim * 0.025;
|
|
52
|
+
const iconSize = dim * 0.045;
|
|
53
|
+
const iconRadius = iconSize * 0.28;
|
|
54
|
+
const iconFont = iconSize * 0.66;
|
|
55
|
+
const appFontSize = dim * 0.03;
|
|
56
|
+
const timeFontSize = dim * 0.026;
|
|
57
|
+
const msgFontSize = dim * 0.04;
|
|
58
|
+
const beatGlow = 1 + beatIntensity * 0.3;
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
"data-notification-card": "true",
|
|
63
|
+
style: {
|
|
64
|
+
position: "absolute",
|
|
65
|
+
top: "50%",
|
|
66
|
+
left: (width - cardW) / 2,
|
|
67
|
+
width: cardW,
|
|
68
|
+
transform: `translateY(calc(-50% + ${cardLift}px))`,
|
|
69
|
+
opacity: cardOpacity
|
|
70
|
+
},
|
|
71
|
+
children: /* @__PURE__ */ jsxs(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
style: {
|
|
75
|
+
backgroundColor: "rgba(245,242,238,0.92)",
|
|
76
|
+
borderRadius: cardRadius,
|
|
77
|
+
padding: cardPad,
|
|
78
|
+
boxShadow: `0 ${dim * 0.012}px ${dim * 0.05 * beatGlow}px rgba(0,0,0,0.18)`,
|
|
79
|
+
transform: `scale(${cardScale})`,
|
|
80
|
+
transformOrigin: "center top",
|
|
81
|
+
display: "flex",
|
|
82
|
+
flexDirection: "column",
|
|
83
|
+
gap: dim * 0.018
|
|
84
|
+
},
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsxs(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
"data-notification-header": "true",
|
|
90
|
+
style: {
|
|
91
|
+
display: "flex",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
gap: dim * 0.014,
|
|
94
|
+
opacity: headerOpacity
|
|
95
|
+
},
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
style: {
|
|
101
|
+
width: iconSize,
|
|
102
|
+
height: iconSize,
|
|
103
|
+
borderRadius: iconRadius,
|
|
104
|
+
backgroundColor: "rgba(0,0,0,0.06)",
|
|
105
|
+
display: "flex",
|
|
106
|
+
alignItems: "center",
|
|
107
|
+
justifyContent: "center",
|
|
108
|
+
lineHeight: 1,
|
|
109
|
+
fontSize: iconFont
|
|
110
|
+
},
|
|
111
|
+
children: /* @__PURE__ */ jsx(Emoji, { char: appIcon, size: iconFont, verticalAlign: "middle" })
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
style: {
|
|
118
|
+
fontSize: appFontSize,
|
|
119
|
+
fontWeight: 600,
|
|
120
|
+
color: "rgba(0,0,0,0.65)",
|
|
121
|
+
letterSpacing: 0.2
|
|
122
|
+
},
|
|
123
|
+
children: appName
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
"span",
|
|
128
|
+
{
|
|
129
|
+
style: {
|
|
130
|
+
fontSize: timeFontSize,
|
|
131
|
+
color: "rgba(0,0,0,0.4)",
|
|
132
|
+
marginLeft: "auto"
|
|
133
|
+
},
|
|
134
|
+
children: "now"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ jsx(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
style: {
|
|
144
|
+
fontSize: msgFontSize,
|
|
145
|
+
fontWeight: 400,
|
|
146
|
+
color: "#1c1c1e",
|
|
147
|
+
lineHeight: 1.28,
|
|
148
|
+
display: "flex",
|
|
149
|
+
flexWrap: "wrap",
|
|
150
|
+
gap: `0 ${dim * 9e-3}px`
|
|
151
|
+
},
|
|
152
|
+
children: words.map((word, wi) => {
|
|
153
|
+
const wordP = interpolate(
|
|
154
|
+
presentationProgress,
|
|
155
|
+
[wordStart + wi * wordSlice, wordStart + wi * wordSlice + wordSlice * 0.6],
|
|
156
|
+
[0, 1],
|
|
157
|
+
CLAMP
|
|
158
|
+
);
|
|
159
|
+
return /* @__PURE__ */ jsx(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
style: {
|
|
163
|
+
opacity: wordP,
|
|
164
|
+
transform: `translateY(${(1 - wordP) * 4}px)`,
|
|
165
|
+
display: "inline-block"
|
|
166
|
+
},
|
|
167
|
+
children: renderWithEmoji(word, msgFontSize)
|
|
168
|
+
},
|
|
169
|
+
wi
|
|
170
|
+
);
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// src/visual-system/scene-templates/social-notification.tsx
|
|
182
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
183
|
+
var SocialNotificationTemplate = ({
|
|
184
|
+
variables,
|
|
185
|
+
style,
|
|
186
|
+
progress,
|
|
187
|
+
motionProgress = progress,
|
|
188
|
+
beatIntensity,
|
|
189
|
+
width,
|
|
190
|
+
height,
|
|
191
|
+
sceneDuration,
|
|
192
|
+
isPlaying = true,
|
|
193
|
+
backgroundEffect
|
|
194
|
+
}) => {
|
|
195
|
+
const { font } = resolveTokens(style);
|
|
196
|
+
const message = String(variables.message || "");
|
|
197
|
+
const gradSeed = message.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
|
|
198
|
+
return /* @__PURE__ */ jsxs2(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
style: {
|
|
202
|
+
width,
|
|
203
|
+
height,
|
|
204
|
+
backgroundColor: "#000",
|
|
205
|
+
position: "relative",
|
|
206
|
+
overflow: "hidden",
|
|
207
|
+
fontFamily: font
|
|
208
|
+
},
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ jsx2(
|
|
211
|
+
SceneBackground,
|
|
212
|
+
{
|
|
213
|
+
style,
|
|
214
|
+
progress,
|
|
215
|
+
sceneDuration,
|
|
216
|
+
width,
|
|
217
|
+
height,
|
|
218
|
+
...getMediaBackgroundProps(variables),
|
|
219
|
+
backgroundEffect,
|
|
220
|
+
seed: gradSeed,
|
|
221
|
+
isPlaying,
|
|
222
|
+
beatIntensity
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ jsx2(
|
|
226
|
+
NotificationCard,
|
|
227
|
+
{
|
|
228
|
+
progress,
|
|
229
|
+
motionProgress,
|
|
230
|
+
appName: String(variables.appName || "Reminder"),
|
|
231
|
+
appIcon: String(variables.appIcon || "\u{1F514}"),
|
|
232
|
+
message,
|
|
233
|
+
width,
|
|
234
|
+
height,
|
|
235
|
+
beatIntensity
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
};
|
|
242
|
+
export {
|
|
243
|
+
SocialNotificationTemplate
|
|
244
|
+
};
|