@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.
- package/CHANGELOG.md +42 -0
- package/PUBLIC-API.md +5 -8
- package/dist/{builtin-server-CUYPIDE7.js → builtin-server-W4PLJUZ5.js} +2 -2
- package/dist/{catalog-types-BIhSpOWK.d.ts → catalog-types-WTbLP6Jh.d.ts} +5 -1
- package/dist/chapter-title-YRLIQY3V.js +7 -0
- package/dist/check-runtime.js +5 -14
- package/dist/{chunk-AITKH6QT.js → chunk-2HFO22K2.js} +15 -40
- package/dist/chunk-4YM2M62S.js +13 -0
- package/dist/chunk-4ZJLPHBV.js +684 -0
- package/dist/chunk-77VY4O7A.js +390 -0
- package/dist/{chunk-MMUXVA47.js → chunk-7M56IUUX.js} +9 -8
- package/dist/chunk-7NZOMTAL.js +63 -0
- package/dist/{chunk-2DOLF4QN.js → chunk-AUPC6MDK.js} +12 -14
- package/dist/{chunk-352ZZCET.js → chunk-EGVQODKU.js} +2 -2
- package/dist/{chunk-2USVB3CY.js → chunk-ELVOT2FQ.js} +284 -177
- package/dist/chunk-EWWCQFTI.js +18 -0
- package/dist/{chunk-KT3M7KDL.js → chunk-HKUI5BTB.js} +3 -3
- package/dist/chunk-IIN5M5HW.js +697 -0
- package/dist/{chunk-LMG3GHLL.js → chunk-IQMYK5DX.js} +29 -3
- package/dist/{chunk-OWBT45EN.js → chunk-IR44XKBI.js} +1 -1
- package/dist/{chunk-MXZSDGZQ.js → chunk-NMFDC2W2.js} +4 -6
- package/dist/{chunk-5SLENAJW.js → chunk-PAJ44TFW.js} +1 -2
- package/dist/{chunk-L7QGGKJ2.js → chunk-PDQFQIQW.js} +1 -1
- package/dist/{chunk-WJ6FLKNC.js → chunk-R3XAOMKP.js} +14 -0
- package/dist/{chunk-2OKB27TG.js → chunk-RXTN2CW6.js} +2 -2
- package/dist/{chunk-XWWLKRNU.js → chunk-TVIU23OM.js} +38 -49
- package/dist/chunk-XX4GXKTX.js +35 -0
- package/dist/chunk-Z67Q5KUW.js +16 -0
- package/dist/{chunk-3VRMKFM7.js → chunk-ZDJNFA52.js} +11 -24
- package/dist/cinema-media-C7OUPNSH.js +12 -0
- package/dist/cli.js +18 -9
- package/dist/comparison-GNZOR7MF.js +37 -0
- package/dist/compose-video-TBFTONUC.js +12 -0
- package/dist/editorial-timeline-EMV5335S.js +43 -0
- package/dist/{events-BQ6z264n.d.ts → events-B4YCc4vc.d.ts} +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +3 -7
- package/dist/key-figure-P37VK425.js +30 -0
- package/dist/{kit-tQnCPMOM.d.ts → kit-DrRpdn0p.d.ts} +2 -2
- package/dist/mobile-message-OF7T62B7.js +50 -0
- package/dist/quote-T6WYLN7A.js +33 -0
- package/dist/react.d.ts +21 -11
- package/dist/react.js +585 -826
- package/dist/scene-video-backdrop-PCTARAAJ.js +7 -0
- package/dist/server.d.ts +7 -8
- package/dist/server.js +179 -84
- package/dist/{system-prompt-RRXIWDDD.js → system-prompt-SYRT5DWM.js} +1 -1
- package/dist/template-catalog.d.ts +392 -16
- package/dist/template-catalog.js +1 -1
- package/dist/templates.d.ts +5 -5
- package/dist/test.d.ts +3 -3
- package/dist/test.js +18 -18
- package/dist/text-stream-LD364KBI.js +9 -0
- package/dist/{types-DWFO6qca.d.ts → types-CdBmNTGD.d.ts} +1 -1
- package/dist/{types-CEh9eUFu.d.ts → types-DdZw4GRQ.d.ts} +17 -48
- package/dist/validate-4OUD2CLX.js +10 -0
- package/docs/architecture.md +1 -1
- package/docs/concepts.md +1 -1
- package/docs/custom-templates.md +13 -28
- package/docs/customization.md +11 -59
- package/docs/getting-started.md +2 -2
- package/docs/immersive-interface.md +3 -4
- package/docs/maintainers/cinematic-migration.md +38 -0
- package/docs/media-and-audio.md +14 -14
- package/docs/motion-and-effects.md +6 -14
- package/docs/persistence.md +3 -3
- package/docs/production.md +11 -9
- package/docs/provider-integration.md +9 -16
- package/docs/reference/design-system.html +1 -1
- package/docs/reference/protocol.md +14 -4
- package/docs/testing.md +1 -1
- package/package.json +6 -3
- package/registry/items/backgrounds.json +1 -1
- package/registry/items/chapterTitle.json +80 -0
- package/registry/items/cinemaMedia.json +136 -0
- package/registry/items/comparison.json +168 -0
- package/registry/items/editorialTimeline.json +172 -0
- package/registry/items/keyFigure.json +162 -0
- package/registry/items/mobileMessage.json +153 -0
- package/registry/items/quote.json +161 -0
- package/registry/items/template-context.json +1 -1
- package/registry/items/theme.json +1 -1
- package/starters/video-chat/README.md +24 -26
- package/starters/video-chat/package.json +1 -1
- package/starters/video-chat/providers/video.ts +6 -5
- package/starters/video-chat/stock.ts +35 -151
- package/styles/fonts/OFL.txt +93 -0
- package/styles/fonts/manifest.json +66 -0
- package/styles/fonts/roboto-v51-cyrillic-ext.woff2 +0 -0
- package/styles/fonts/roboto-v51-cyrillic.woff2 +0 -0
- package/styles/fonts/roboto-v51-greek-ext.woff2 +0 -0
- package/styles/fonts/roboto-v51-greek.woff2 +0 -0
- package/styles/fonts/roboto-v51-latin-ext.woff2 +0 -0
- package/styles/fonts/roboto-v51-latin.woff2 +0 -0
- package/styles/fonts/roboto-v51-math.woff2 +0 -0
- package/styles/fonts/roboto-v51-symbols.woff2 +0 -0
- package/styles/fonts/roboto-v51-vietnamese.woff2 +0 -0
- package/styles/fonts/roboto.css +91 -0
- package/styles/video-chat.css +30 -22
- package/dist/bg-confetti-HITCGLGD.js +0 -89
- package/dist/bg-emoji-VU4UZYZN.js +0 -150
- package/dist/bg-media-L34PDQXJ.js +0 -106
- package/dist/brand-message-FUJ4STFO.js +0 -256
- package/dist/chart-bar-EGPHJATL.js +0 -310
- package/dist/chart-counter-5FFWQNZO.js +0 -306
- package/dist/chart-progress-ring-JMXQLMLC.js +0 -302
- package/dist/chunk-4UNKZEAT.js +0 -3575
- package/dist/chunk-5CDAM24P.js +0 -31
- package/dist/chunk-AOWSXU2K.js +0 -18
- package/dist/chunk-CJ7F2CE6.js +0 -104
- package/dist/chunk-FRN6WKHA.js +0 -185
- package/dist/chunk-G5JPHBX7.js +0 -336
- package/dist/chunk-L5BTTCZV.js +0 -97
- package/dist/chunk-P22HHFDK.js +0 -43
- package/dist/chunk-PP3MCPN4.js +0 -1998
- package/dist/chunk-QAAO7OAY.js +0 -19
- package/dist/chunk-S7HFLYNN.js +0 -35
- package/dist/chunk-W3VDIBGR.js +0 -217
- package/dist/chunk-XGRA2MUV.js +0 -242
- package/dist/chunk-XTOXFMLM.js +0 -105
- package/dist/chunk-YJJC4N4D.js +0 -761
- package/dist/compose-video-2NFH4DZY.js +0 -13
- package/dist/cta-logo-YR7LYUR5.js +0 -212
- package/dist/cta-media-DQJBKUO2.js +0 -221
- package/dist/incoming-call-54KQ7O5A.js +0 -323
- package/dist/infographic-before-after-ROS52GOW.js +0 -460
- package/dist/infographic-feature-list-E7MGUDAN.js +0 -272
- package/dist/infographic-problem-solution-3S6NGO5N.js +0 -343
- package/dist/infographic-stat-row-SYB7AB7H.js +0 -247
- package/dist/infographic-steps-KCE6JWE2.js +0 -406
- package/dist/prompt-input-MHX4O42G.js +0 -239
- package/dist/reaction-SLEGR3BE.js +0 -122
- package/dist/scene-video-backdrop-XFPX4O3I.js +0 -10
- package/dist/showcase-code-2HLAVKBM.js +0 -357
- package/dist/showcase-phone-Q4HEO4LH.js +0 -278
- package/dist/showcase-terminal-DL45LUFG.js +0 -312
- package/dist/showcase-web-2QZO73FZ.js +0 -396
- package/dist/social-conversation-75SD2637.js +0 -695
- package/dist/social-milestone-GEFUQSBF.js +0 -296
- package/dist/social-notification-FJ5VHVLK.js +0 -247
- package/dist/social-review-stack-KXQCKFRP.js +0 -242
- package/dist/social-testimonial-JZ7CHC7S.js +0 -287
- package/dist/social-tweet-UCDXM25F.js +0 -298
- package/dist/text-stream-54LXABJW.js +0 -10
- package/dist/validate-T7GBU2YF.js +0 -8
- package/registry/items/barChart.json +0 -245
- package/registry/items/beforeAfter.json +0 -180
- package/registry/items/bigNumber.json +0 -232
- package/registry/items/brandMessage.json +0 -164
- package/registry/items/cardList.json +0 -214
- package/registry/items/chatMessenger.json +0 -151
- package/registry/items/chatWhatsapp.json +0 -151
- package/registry/items/codeEditor.json +0 -191
- package/registry/items/confetti.json +0 -107
- package/registry/items/ctaLogo.json +0 -167
- package/registry/items/ctaMedia.json +0 -200
- package/registry/items/emojiBurst.json +0 -101
- package/registry/items/incomingCall.json +0 -177
- package/registry/items/media.json +0 -187
- package/registry/items/milestone.json +0 -212
- package/registry/items/notification.json +0 -189
- package/registry/items/phoneMockup.json +0 -261
- package/registry/items/problemSolution.json +0 -193
- package/registry/items/progressRing.json +0 -206
- package/registry/items/promptInput.json +0 -155
- package/registry/items/reaction.json +0 -176
- package/registry/items/reviewStack.json +0 -231
- package/registry/items/steps.json +0 -215
- package/registry/items/terminal.json +0 -219
- package/registry/items/testimonial.json +0 -171
- package/registry/items/tripleStats.json +0 -235
- package/registry/items/tweet.json +0 -210
- package/registry/items/webMockup.json +0 -280
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fitTextSize,
|
|
3
|
-
stripPipe
|
|
4
|
-
} from "./chunk-S7HFLYNN.js";
|
|
5
|
-
import {
|
|
6
|
-
SceneBackground,
|
|
7
|
-
getMediaBackgroundProps
|
|
8
|
-
} from "./chunk-MXZSDGZQ.js";
|
|
9
|
-
import {
|
|
10
|
-
TemplateText
|
|
11
|
-
} from "./chunk-YJJC4N4D.js";
|
|
12
|
-
import "./chunk-L5BTTCZV.js";
|
|
13
|
-
import "./chunk-FRN6WKHA.js";
|
|
14
|
-
import "./chunk-W3VDIBGR.js";
|
|
15
|
-
import {
|
|
16
|
-
interpolate,
|
|
17
|
-
spring
|
|
18
|
-
} from "./chunk-XTOXFMLM.js";
|
|
19
|
-
import {
|
|
20
|
-
hasSceneMedia
|
|
21
|
-
} from "./chunk-224QNWRA.js";
|
|
22
|
-
import "./chunk-5CDAM24P.js";
|
|
23
|
-
import {
|
|
24
|
-
resolveTokens
|
|
25
|
-
} from "./chunk-XWWLKRNU.js";
|
|
26
|
-
|
|
27
|
-
// src/visual-system/primitives/devices/CodeEditor.tsx
|
|
28
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
-
var SPRING_EDITOR = { damping: 20, stiffness: 100 };
|
|
30
|
-
var CLAMP = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
|
|
31
|
-
var MONO_CHAR_RATIO = 0.63;
|
|
32
|
-
var MONO_MIN_SCALE = 0.68;
|
|
33
|
-
var MONO_FONT = "'Fira Code', 'SF Mono', 'Cascadia Code', Menlo, monospace";
|
|
34
|
-
var CHROME_FONT = "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";
|
|
35
|
-
var KEYWORDS = /* @__PURE__ */ new Set([
|
|
36
|
-
"const",
|
|
37
|
-
"let",
|
|
38
|
-
"var",
|
|
39
|
-
"function",
|
|
40
|
-
"return",
|
|
41
|
-
"import",
|
|
42
|
-
"export",
|
|
43
|
-
"from",
|
|
44
|
-
"async",
|
|
45
|
-
"await",
|
|
46
|
-
"if",
|
|
47
|
-
"else",
|
|
48
|
-
"for",
|
|
49
|
-
"while",
|
|
50
|
-
"class",
|
|
51
|
-
"new",
|
|
52
|
-
"this",
|
|
53
|
-
"true",
|
|
54
|
-
"false",
|
|
55
|
-
"null",
|
|
56
|
-
"undefined",
|
|
57
|
-
"def",
|
|
58
|
-
"self",
|
|
59
|
-
"print",
|
|
60
|
-
"in",
|
|
61
|
-
"not",
|
|
62
|
-
"and",
|
|
63
|
-
"or",
|
|
64
|
-
"try",
|
|
65
|
-
"catch",
|
|
66
|
-
"throw"
|
|
67
|
-
]);
|
|
68
|
-
function tokenizeLine(line, keywordColor, stringColor, commentColor, numberColor, defaultColor) {
|
|
69
|
-
const tokens = [];
|
|
70
|
-
const commentMatch = line.match(/^(.*?)(\/\/.*|#.*)$/);
|
|
71
|
-
if (commentMatch) {
|
|
72
|
-
tokens.push(...tokenizeCode(commentMatch[1], keywordColor, stringColor, numberColor, defaultColor));
|
|
73
|
-
tokens.push({ text: commentMatch[2], color: commentColor });
|
|
74
|
-
return tokens;
|
|
75
|
-
}
|
|
76
|
-
return tokenizeCode(line, keywordColor, stringColor, numberColor, defaultColor);
|
|
77
|
-
}
|
|
78
|
-
function tokenizeCode(code, keywordColor, stringColor, numberColor, defaultColor) {
|
|
79
|
-
const tokens = [];
|
|
80
|
-
const regex = /("[^"]*"|'[^']*'|`[^`]*`|\b\d+\.?\d*\b|\b\w+\b|[^\s]|\s+)/g;
|
|
81
|
-
let match;
|
|
82
|
-
while ((match = regex.exec(code)) !== null) {
|
|
83
|
-
const t = match[0];
|
|
84
|
-
if (t.startsWith('"') || t.startsWith("'") || t.startsWith("`")) {
|
|
85
|
-
tokens.push({ text: t, color: stringColor });
|
|
86
|
-
} else if (/^\d+\.?\d*$/.test(t)) {
|
|
87
|
-
tokens.push({ text: t, color: numberColor });
|
|
88
|
-
} else if (KEYWORDS.has(t)) {
|
|
89
|
-
tokens.push({ text: t, color: keywordColor });
|
|
90
|
-
} else {
|
|
91
|
-
tokens.push({ text: t, color: defaultColor });
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return tokens;
|
|
95
|
-
}
|
|
96
|
-
var CodeEditor = ({
|
|
97
|
-
progress,
|
|
98
|
-
code,
|
|
99
|
-
filename = "app.ts",
|
|
100
|
-
width,
|
|
101
|
-
height,
|
|
102
|
-
beatIntensity = 0
|
|
103
|
-
}) => {
|
|
104
|
-
const s = Math.min(width, height) / 1080;
|
|
105
|
-
const codeRaw = String(code || "").replace(/\\n/g, "\n");
|
|
106
|
-
const filenameClean = stripPipe(String(filename || "app.ts"));
|
|
107
|
-
const codeLines = codeRaw.split("\n");
|
|
108
|
-
const editorWidth = Math.min(width * 0.88, height * 0.55 * (16 / 9));
|
|
109
|
-
const chromeHeight = 44 * s;
|
|
110
|
-
const contentHeight = editorWidth * (9 / 16);
|
|
111
|
-
const editorHeight = chromeHeight + contentHeight;
|
|
112
|
-
const borderRadius = 12 * s;
|
|
113
|
-
const editorBg = "#1e1e2e";
|
|
114
|
-
const chromeBg = "#313244";
|
|
115
|
-
const codeDefault = "#cdd6f4";
|
|
116
|
-
const keywordColor = "#cba6f7";
|
|
117
|
-
const stringColor = "#a6e3a1";
|
|
118
|
-
const commentColor = "#6c7086";
|
|
119
|
-
const numberColor = "#fab387";
|
|
120
|
-
const lineNumColor = "#45475a";
|
|
121
|
-
const lineNumWidth = 40 * s;
|
|
122
|
-
const codeAvailWidth = editorWidth - lineNumWidth - 16 * s;
|
|
123
|
-
const baseFontSize = Math.max(16, 22 * s);
|
|
124
|
-
const longestLineChars = codeLines.reduce((m, l) => Math.max(m, l.length), 1);
|
|
125
|
-
const fontSize = fitTextSize("M".repeat(longestLineChars), baseFontSize, codeAvailWidth, {
|
|
126
|
-
minScale: MONO_MIN_SCALE,
|
|
127
|
-
charWidthRatio: MONO_CHAR_RATIO
|
|
128
|
-
});
|
|
129
|
-
const atFloor = fontSize <= baseFontSize * MONO_MIN_SCALE + 0.01;
|
|
130
|
-
const maxLineChars = atFloor ? Math.max(4, Math.floor(codeAvailWidth / (fontSize * MONO_CHAR_RATIO))) : Infinity;
|
|
131
|
-
const displayLines = codeLines.map(
|
|
132
|
-
(l) => l.length > maxLineChars ? `${l.slice(0, maxLineChars - 1).trimEnd()}\u2026` : l
|
|
133
|
-
);
|
|
134
|
-
const lineHeight = fontSize * 1.7;
|
|
135
|
-
const slideProgress = interpolate(progress, [0.02, 0.15], [0, 1], CLAMP);
|
|
136
|
-
const springVal = spring(slideProgress, SPRING_EDITOR);
|
|
137
|
-
const editorY = (1 - springVal) * 200 * s;
|
|
138
|
-
const editorOpacity = interpolate(slideProgress, [0, 0.08], [0, 1], CLAMP);
|
|
139
|
-
const lineStaggerStart = 0.15;
|
|
140
|
-
const lineStaggerEnd = 0.8;
|
|
141
|
-
const lineSlice = codeLines.length > 0 ? (lineStaggerEnd - lineStaggerStart) / codeLines.length : 0;
|
|
142
|
-
const beatScale = 1 + beatIntensity * 0.01;
|
|
143
|
-
const dotSize = 12 * s;
|
|
144
|
-
const dotGap = 8 * s;
|
|
145
|
-
return /* @__PURE__ */ jsx(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
style: {
|
|
149
|
-
position: "absolute",
|
|
150
|
-
top: height * 0.35,
|
|
151
|
-
left: (width - editorWidth) / 2,
|
|
152
|
-
width: editorWidth,
|
|
153
|
-
height: editorHeight,
|
|
154
|
-
transform: `translateY(${editorY}px) scale(${beatScale})`,
|
|
155
|
-
opacity: editorOpacity
|
|
156
|
-
},
|
|
157
|
-
children: /* @__PURE__ */ jsxs(
|
|
158
|
-
"div",
|
|
159
|
-
{
|
|
160
|
-
style: {
|
|
161
|
-
width: editorWidth,
|
|
162
|
-
height: editorHeight,
|
|
163
|
-
borderRadius,
|
|
164
|
-
overflow: "hidden",
|
|
165
|
-
position: "relative",
|
|
166
|
-
boxShadow: `0 ${20 * s}px ${60 * s}px rgba(0,0,0,0.35)`
|
|
167
|
-
},
|
|
168
|
-
children: [
|
|
169
|
-
/* @__PURE__ */ jsxs(
|
|
170
|
-
"div",
|
|
171
|
-
{
|
|
172
|
-
style: {
|
|
173
|
-
width: "100%",
|
|
174
|
-
height: chromeHeight,
|
|
175
|
-
backgroundColor: chromeBg,
|
|
176
|
-
display: "flex",
|
|
177
|
-
alignItems: "center",
|
|
178
|
-
paddingLeft: 16 * s,
|
|
179
|
-
paddingRight: 16 * s
|
|
180
|
-
},
|
|
181
|
-
children: [
|
|
182
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: dotGap, flexShrink: 0 }, children: [
|
|
183
|
-
/* @__PURE__ */ jsx("div", { style: { width: dotSize, height: dotSize, borderRadius: "50%", backgroundColor: "#ff5f57" } }),
|
|
184
|
-
/* @__PURE__ */ jsx("div", { style: { width: dotSize, height: dotSize, borderRadius: "50%", backgroundColor: "#febc2e" } }),
|
|
185
|
-
/* @__PURE__ */ jsx("div", { style: { width: dotSize, height: dotSize, borderRadius: "50%", backgroundColor: "#28c840" } })
|
|
186
|
-
] }),
|
|
187
|
-
/* @__PURE__ */ jsx(
|
|
188
|
-
"div",
|
|
189
|
-
{
|
|
190
|
-
style: {
|
|
191
|
-
flex: 1,
|
|
192
|
-
textAlign: "center",
|
|
193
|
-
fontSize: 13 * s,
|
|
194
|
-
fontFamily: CHROME_FONT,
|
|
195
|
-
color: "#a6adc8",
|
|
196
|
-
whiteSpace: "nowrap"
|
|
197
|
-
},
|
|
198
|
-
children: filenameClean
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
/* @__PURE__ */ jsx("div", { style: { width: dotSize * 3 + dotGap * 2, flexShrink: 0 } })
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ jsx(
|
|
206
|
-
"div",
|
|
207
|
-
{
|
|
208
|
-
style: {
|
|
209
|
-
width: "100%",
|
|
210
|
-
height: contentHeight,
|
|
211
|
-
backgroundColor: editorBg,
|
|
212
|
-
padding: `${16 * s}px 0`,
|
|
213
|
-
overflow: "hidden"
|
|
214
|
-
},
|
|
215
|
-
children: displayLines.map((line, i) => {
|
|
216
|
-
const lineStart = lineStaggerStart + i * lineSlice;
|
|
217
|
-
const lineOpacity = interpolate(progress, [lineStart, lineStart + 0.04], [0, 1], CLAMP);
|
|
218
|
-
const lineSlideX = interpolate(progress, [lineStart, lineStart + 0.06], [12 * s, 0], CLAMP);
|
|
219
|
-
const tokens = line.trim() === "" ? [{ text: " ", color: codeDefault }] : tokenizeLine(line, keywordColor, stringColor, commentColor, numberColor, codeDefault);
|
|
220
|
-
return /* @__PURE__ */ jsxs(
|
|
221
|
-
"div",
|
|
222
|
-
{
|
|
223
|
-
style: {
|
|
224
|
-
display: "flex",
|
|
225
|
-
alignItems: "baseline",
|
|
226
|
-
height: lineHeight,
|
|
227
|
-
opacity: lineOpacity,
|
|
228
|
-
transform: `translateX(${lineSlideX}px)`
|
|
229
|
-
},
|
|
230
|
-
children: [
|
|
231
|
-
/* @__PURE__ */ jsx(
|
|
232
|
-
"div",
|
|
233
|
-
{
|
|
234
|
-
style: {
|
|
235
|
-
width: lineNumWidth,
|
|
236
|
-
textAlign: "right",
|
|
237
|
-
paddingRight: 12 * s,
|
|
238
|
-
fontSize,
|
|
239
|
-
fontFamily: MONO_FONT,
|
|
240
|
-
color: lineNumColor,
|
|
241
|
-
lineHeight: `${lineHeight}px`,
|
|
242
|
-
flexShrink: 0,
|
|
243
|
-
userSelect: "none"
|
|
244
|
-
},
|
|
245
|
-
children: i + 1
|
|
246
|
-
}
|
|
247
|
-
),
|
|
248
|
-
/* @__PURE__ */ jsx(
|
|
249
|
-
"div",
|
|
250
|
-
{
|
|
251
|
-
style: {
|
|
252
|
-
fontSize,
|
|
253
|
-
fontFamily: MONO_FONT,
|
|
254
|
-
lineHeight: `${lineHeight}px`,
|
|
255
|
-
whiteSpace: "pre"
|
|
256
|
-
},
|
|
257
|
-
children: tokens.map((token, j) => /* @__PURE__ */ jsx("span", { style: { color: token.color }, children: token.text }, j))
|
|
258
|
-
}
|
|
259
|
-
)
|
|
260
|
-
]
|
|
261
|
-
},
|
|
262
|
-
i
|
|
263
|
-
);
|
|
264
|
-
})
|
|
265
|
-
}
|
|
266
|
-
)
|
|
267
|
-
]
|
|
268
|
-
}
|
|
269
|
-
)
|
|
270
|
-
}
|
|
271
|
-
);
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
// src/visual-system/scene-templates/showcase-code.tsx
|
|
275
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
276
|
-
var ShowcaseCodeTemplate = ({
|
|
277
|
-
variables,
|
|
278
|
-
style,
|
|
279
|
-
progress,
|
|
280
|
-
motionProgress = progress,
|
|
281
|
-
beatIntensity,
|
|
282
|
-
width,
|
|
283
|
-
height,
|
|
284
|
-
safeZone,
|
|
285
|
-
sceneDuration,
|
|
286
|
-
backgroundEffect,
|
|
287
|
-
isPlaying = true
|
|
288
|
-
}) => {
|
|
289
|
-
const { primary, foreground, font } = resolveTokens(style);
|
|
290
|
-
const textColor = foreground;
|
|
291
|
-
const textsRaw = String(variables.texts || "");
|
|
292
|
-
return /* @__PURE__ */ jsxs2(
|
|
293
|
-
"div",
|
|
294
|
-
{
|
|
295
|
-
style: {
|
|
296
|
-
width,
|
|
297
|
-
height,
|
|
298
|
-
backgroundColor: "var(--vanillasky-template-surface, #000)",
|
|
299
|
-
position: "relative",
|
|
300
|
-
overflow: "hidden",
|
|
301
|
-
fontFamily: font
|
|
302
|
-
},
|
|
303
|
-
children: [
|
|
304
|
-
/* @__PURE__ */ jsx2(
|
|
305
|
-
SceneBackground,
|
|
306
|
-
{
|
|
307
|
-
style,
|
|
308
|
-
progress,
|
|
309
|
-
sceneDuration,
|
|
310
|
-
width,
|
|
311
|
-
height,
|
|
312
|
-
...getMediaBackgroundProps(variables),
|
|
313
|
-
backgroundEffect,
|
|
314
|
-
seed: textsRaw,
|
|
315
|
-
isPlaying,
|
|
316
|
-
beatIntensity
|
|
317
|
-
}
|
|
318
|
-
),
|
|
319
|
-
/* @__PURE__ */ jsx2(
|
|
320
|
-
TemplateText,
|
|
321
|
-
{
|
|
322
|
-
overMedia: hasSceneMedia(variables),
|
|
323
|
-
motionProgress,
|
|
324
|
-
typeTreatment: resolveTokens(style).preset.type,
|
|
325
|
-
archetype: "subtle",
|
|
326
|
-
text: String(variables.texts ?? ""),
|
|
327
|
-
progress,
|
|
328
|
-
sceneDuration: sceneDuration ?? 3,
|
|
329
|
-
width,
|
|
330
|
-
height,
|
|
331
|
-
position: "top",
|
|
332
|
-
sizeRole: "headline",
|
|
333
|
-
safeZone,
|
|
334
|
-
font,
|
|
335
|
-
color: textColor,
|
|
336
|
-
beatIntensity
|
|
337
|
-
}
|
|
338
|
-
),
|
|
339
|
-
/* @__PURE__ */ jsx2(
|
|
340
|
-
CodeEditor,
|
|
341
|
-
{
|
|
342
|
-
progress,
|
|
343
|
-
code: String(variables.code || ""),
|
|
344
|
-
filename: String(variables.filename || "app.ts"),
|
|
345
|
-
width,
|
|
346
|
-
height,
|
|
347
|
-
accent: primary,
|
|
348
|
-
beatIntensity
|
|
349
|
-
}
|
|
350
|
-
)
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
);
|
|
354
|
-
};
|
|
355
|
-
export {
|
|
356
|
-
ShowcaseCodeTemplate
|
|
357
|
-
};
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PhoneScreenFill,
|
|
3
|
-
ProductSurface,
|
|
4
|
-
resolveProductSurfaceMotion
|
|
5
|
-
} from "./chunk-G5JPHBX7.js";
|
|
6
|
-
import "./chunk-S7HFLYNN.js";
|
|
7
|
-
import {
|
|
8
|
-
SceneBackground,
|
|
9
|
-
getMediaBackgroundProps
|
|
10
|
-
} from "./chunk-MXZSDGZQ.js";
|
|
11
|
-
import {
|
|
12
|
-
TemplateText
|
|
13
|
-
} from "./chunk-YJJC4N4D.js";
|
|
14
|
-
import "./chunk-L5BTTCZV.js";
|
|
15
|
-
import "./chunk-FRN6WKHA.js";
|
|
16
|
-
import "./chunk-W3VDIBGR.js";
|
|
17
|
-
import {
|
|
18
|
-
SPRING_SMOOTH,
|
|
19
|
-
interpolate,
|
|
20
|
-
spring
|
|
21
|
-
} from "./chunk-XTOXFMLM.js";
|
|
22
|
-
import {
|
|
23
|
-
hasSceneMedia
|
|
24
|
-
} from "./chunk-224QNWRA.js";
|
|
25
|
-
import "./chunk-5CDAM24P.js";
|
|
26
|
-
import {
|
|
27
|
-
TOKEN_DEFAULTS,
|
|
28
|
-
resolveTokens
|
|
29
|
-
} from "./chunk-XWWLKRNU.js";
|
|
30
|
-
|
|
31
|
-
// src/visual-system/primitives/devices/PhoneFrame.tsx
|
|
32
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
-
var PhoneFrame = ({
|
|
34
|
-
progress,
|
|
35
|
-
motionProgress = progress,
|
|
36
|
-
screenMediaUrl = "",
|
|
37
|
-
screens = [],
|
|
38
|
-
width,
|
|
39
|
-
height,
|
|
40
|
-
font = TOKEN_DEFAULTS.font,
|
|
41
|
-
beatIntensity = 0,
|
|
42
|
-
accent = TOKEN_DEFAULTS.primary,
|
|
43
|
-
secondary = "#00b5e5",
|
|
44
|
-
bg,
|
|
45
|
-
screenFit = "cover",
|
|
46
|
-
screenFocusX = 50,
|
|
47
|
-
screenFocusY = 50,
|
|
48
|
-
screenMotion = "pushIn",
|
|
49
|
-
screenCalloutText = "",
|
|
50
|
-
screenCalloutX = 70,
|
|
51
|
-
screenCalloutY = 35
|
|
52
|
-
}) => {
|
|
53
|
-
const s = Math.min(width, height) / 1080;
|
|
54
|
-
const slidesMode = screens.length > 0;
|
|
55
|
-
const maxPhoneH = height * 0.6;
|
|
56
|
-
const phoneWidth = width > height ? Math.min(width * 0.55, maxPhoneH / 2) : Math.min(width * 0.55, height * 0.35);
|
|
57
|
-
const phoneHeight = phoneWidth * 2;
|
|
58
|
-
const borderRadius = 40 * s;
|
|
59
|
-
const borderWidth = 6 * s;
|
|
60
|
-
const enterRange = slidesMode ? [0.02, 0.35] : [0.02, 0.85];
|
|
61
|
-
const enterP = spring(
|
|
62
|
-
interpolate(motionProgress, enterRange, [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
|
|
63
|
-
{ damping: 26, stiffness: 80 }
|
|
64
|
-
);
|
|
65
|
-
const phoneRotateX = (1 - enterP) * 60;
|
|
66
|
-
const phoneY = (1 - enterP) * 180 * s;
|
|
67
|
-
const phoneScale = interpolate(enterP, [0, 1], [0.85, 1]);
|
|
68
|
-
const phoneOpacity = interpolate(motionProgress, [0.02, 0.12], [0, 1], {
|
|
69
|
-
extrapolateLeft: "clamp",
|
|
70
|
-
extrapolateRight: "clamp"
|
|
71
|
-
});
|
|
72
|
-
const slide1to2 = slidesMode && screens.length >= 2 ? spring(interpolate(progress, [0.28, 0.48], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }), SPRING_SMOOTH) : 0;
|
|
73
|
-
const slide2to3 = slidesMode && screens.length >= 3 ? spring(interpolate(progress, [0.58, 0.78], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }), SPRING_SMOOTH) : 0;
|
|
74
|
-
const slideOffset = -(slide1to2 + slide2to3) * phoneWidth;
|
|
75
|
-
const beatScale = 1 + beatIntensity * (slidesMode ? 0.01 : 0.015);
|
|
76
|
-
const renderScreen = (url, key, withCallout = false) => /* @__PURE__ */ jsx("div", { style: { position: "relative", width: phoneWidth, height: phoneHeight, flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
77
|
-
ProductSurface,
|
|
78
|
-
{
|
|
79
|
-
mediaUrl: url,
|
|
80
|
-
progress,
|
|
81
|
-
width: phoneWidth,
|
|
82
|
-
height: phoneHeight,
|
|
83
|
-
fit: screenFit,
|
|
84
|
-
focusX: screenFocusX,
|
|
85
|
-
focusY: screenFocusY,
|
|
86
|
-
motion: withCallout ? screenMotion : "still",
|
|
87
|
-
calloutText: withCallout ? screenCalloutText : "",
|
|
88
|
-
calloutX: screenCalloutX,
|
|
89
|
-
calloutY: screenCalloutY,
|
|
90
|
-
accent,
|
|
91
|
-
font,
|
|
92
|
-
placeholder: /* @__PURE__ */ jsx(
|
|
93
|
-
PhoneScreenFill,
|
|
94
|
-
{
|
|
95
|
-
accent,
|
|
96
|
-
secondary,
|
|
97
|
-
bg,
|
|
98
|
-
font,
|
|
99
|
-
s,
|
|
100
|
-
w: phoneWidth,
|
|
101
|
-
h: phoneHeight,
|
|
102
|
-
progress
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
}
|
|
106
|
-
) }, key);
|
|
107
|
-
return /* @__PURE__ */ jsx(
|
|
108
|
-
"div",
|
|
109
|
-
{
|
|
110
|
-
style: {
|
|
111
|
-
position: "absolute",
|
|
112
|
-
top: height * 0.32,
|
|
113
|
-
left: (width - phoneWidth) / 2,
|
|
114
|
-
width: phoneWidth,
|
|
115
|
-
height: phoneHeight,
|
|
116
|
-
perspective: `${1600 * s}px`,
|
|
117
|
-
transformStyle: "preserve-3d"
|
|
118
|
-
},
|
|
119
|
-
children: /* @__PURE__ */ jsx(
|
|
120
|
-
"div",
|
|
121
|
-
{
|
|
122
|
-
style: {
|
|
123
|
-
width: phoneWidth,
|
|
124
|
-
height: phoneHeight,
|
|
125
|
-
transform: `translateY(${phoneY}px) rotateX(${phoneRotateX}deg) scale(${phoneScale * beatScale})`,
|
|
126
|
-
transformOrigin: "center bottom",
|
|
127
|
-
opacity: phoneOpacity
|
|
128
|
-
},
|
|
129
|
-
children: /* @__PURE__ */ jsxs(
|
|
130
|
-
"div",
|
|
131
|
-
{
|
|
132
|
-
style: {
|
|
133
|
-
width: phoneWidth,
|
|
134
|
-
height: phoneHeight,
|
|
135
|
-
borderRadius,
|
|
136
|
-
overflow: "hidden",
|
|
137
|
-
position: "relative",
|
|
138
|
-
boxShadow: `0 ${20 * s}px ${60 * s}px rgba(0,0,0,0.35)`
|
|
139
|
-
},
|
|
140
|
-
children: [
|
|
141
|
-
slidesMode ? /* @__PURE__ */ jsx(
|
|
142
|
-
"div",
|
|
143
|
-
{
|
|
144
|
-
"data-phone-screen-progress": Number((slide1to2 + slide2to3).toFixed(6)),
|
|
145
|
-
style: {
|
|
146
|
-
display: "flex",
|
|
147
|
-
width: phoneWidth * screens.length,
|
|
148
|
-
height: phoneHeight,
|
|
149
|
-
transform: `translateX(${slideOffset}px)`
|
|
150
|
-
},
|
|
151
|
-
children: screens.map((url, i) => renderScreen(url, i))
|
|
152
|
-
}
|
|
153
|
-
) : renderScreen(screenMediaUrl, void 0, true),
|
|
154
|
-
/* @__PURE__ */ jsx(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
style: {
|
|
158
|
-
position: "absolute",
|
|
159
|
-
inset: 0,
|
|
160
|
-
borderRadius,
|
|
161
|
-
border: `${borderWidth * 1.5}px solid rgba(220,220,220,0.6)`,
|
|
162
|
-
boxShadow: `inset 0 0 0 ${1 * s}px rgba(255,255,255,0.1)`,
|
|
163
|
-
pointerEvents: "none",
|
|
164
|
-
zIndex: 2
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
}
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
// src/visual-system/scene-templates/showcase-phone.tsx
|
|
178
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
179
|
-
var ShowcasePhoneTemplate = ({
|
|
180
|
-
variables,
|
|
181
|
-
style,
|
|
182
|
-
progress,
|
|
183
|
-
motionProgress = progress,
|
|
184
|
-
beatIntensity,
|
|
185
|
-
width,
|
|
186
|
-
height,
|
|
187
|
-
textArchetype,
|
|
188
|
-
safeZone,
|
|
189
|
-
sceneDuration,
|
|
190
|
-
backgroundEffect,
|
|
191
|
-
isPlaying
|
|
192
|
-
}) => {
|
|
193
|
-
const tokens = resolveTokens(style);
|
|
194
|
-
const { primary, secondary, foreground, font, background } = tokens;
|
|
195
|
-
const textColor = foreground;
|
|
196
|
-
const screenMediaUrl = String(variables.screenMediaUrl || "");
|
|
197
|
-
const extraScreens = [
|
|
198
|
-
String(variables.screen1Url || ""),
|
|
199
|
-
String(variables.screen2Url || "")
|
|
200
|
-
].filter(Boolean);
|
|
201
|
-
const screens = extraScreens.length > 0 && screenMediaUrl ? [screenMediaUrl, ...extraScreens] : extraScreens;
|
|
202
|
-
return /* @__PURE__ */ jsxs2(
|
|
203
|
-
"div",
|
|
204
|
-
{
|
|
205
|
-
style: {
|
|
206
|
-
width,
|
|
207
|
-
height,
|
|
208
|
-
backgroundColor: "var(--vanillasky-template-surface, #000)",
|
|
209
|
-
position: "relative",
|
|
210
|
-
overflow: "hidden",
|
|
211
|
-
fontFamily: font
|
|
212
|
-
},
|
|
213
|
-
children: [
|
|
214
|
-
/* @__PURE__ */ jsx2(
|
|
215
|
-
SceneBackground,
|
|
216
|
-
{
|
|
217
|
-
style,
|
|
218
|
-
progress,
|
|
219
|
-
sceneDuration,
|
|
220
|
-
width,
|
|
221
|
-
height,
|
|
222
|
-
...getMediaBackgroundProps(variables),
|
|
223
|
-
backgroundEffect,
|
|
224
|
-
seed: String(variables.texts || ""),
|
|
225
|
-
isPlaying,
|
|
226
|
-
beatIntensity
|
|
227
|
-
}
|
|
228
|
-
),
|
|
229
|
-
/* @__PURE__ */ jsx2(
|
|
230
|
-
TemplateText,
|
|
231
|
-
{
|
|
232
|
-
overMedia: hasSceneMedia(variables),
|
|
233
|
-
motionProgress,
|
|
234
|
-
typeTreatment: tokens.preset.type,
|
|
235
|
-
archetype: textArchetype ?? "subtle",
|
|
236
|
-
text: String(variables.texts ?? ""),
|
|
237
|
-
progress,
|
|
238
|
-
sceneDuration: sceneDuration ?? 3,
|
|
239
|
-
width,
|
|
240
|
-
height,
|
|
241
|
-
position: "top",
|
|
242
|
-
sizeRole: "headline",
|
|
243
|
-
safeZone,
|
|
244
|
-
font,
|
|
245
|
-
color: textColor,
|
|
246
|
-
beatIntensity
|
|
247
|
-
}
|
|
248
|
-
),
|
|
249
|
-
/* @__PURE__ */ jsx2(
|
|
250
|
-
PhoneFrame,
|
|
251
|
-
{
|
|
252
|
-
progress,
|
|
253
|
-
motionProgress,
|
|
254
|
-
screenMediaUrl,
|
|
255
|
-
screens,
|
|
256
|
-
width,
|
|
257
|
-
height,
|
|
258
|
-
font,
|
|
259
|
-
beatIntensity,
|
|
260
|
-
accent: primary,
|
|
261
|
-
secondary,
|
|
262
|
-
bg: background.type === "solid" ? background.color : void 0,
|
|
263
|
-
screenFit: variables.screenFit === "contain" ? "contain" : "cover",
|
|
264
|
-
screenFocusX: Number(variables.screenFocusX ?? 50),
|
|
265
|
-
screenFocusY: Number(variables.screenFocusY ?? 50),
|
|
266
|
-
screenMotion: resolveProductSurfaceMotion(variables.screenMotion),
|
|
267
|
-
screenCalloutText: String(variables.screenCalloutText || ""),
|
|
268
|
-
screenCalloutX: Number(variables.screenCalloutX ?? 70),
|
|
269
|
-
screenCalloutY: Number(variables.screenCalloutY ?? 35)
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
]
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
export {
|
|
277
|
-
ShowcasePhoneTemplate
|
|
278
|
-
};
|