No hand-written SVG: visx charts, lucide icons, Mermaid journey diagram
- desktop: Growth chart, Health and portfolio sparklines and the rollout bar drawn with visx (responsive width, crosshair tooltip with real values, arrow keys, theme tokens, no animation); icons from lucide-react behind the existing Icon names; empty states are lucide icons on token tiles; store marks are generic lucide icons; stars are lucide; the brand mark moves to ui/brand.tsx as the one allowed inline SVG - fixtures: app icons and store art stand-ins are PNGs rendered by tools/fixture-art.ts (lucide on gradients) - site: icons are lucide's own files in site/img/icons (tools/site-icons.ts, with the ISC licence) shown as CSS masks; the journey diagram is rendered from docs/diagrams/journey.mmd by tools/diagrams.ts (Mermaid CLI), with a tall variant for phones - tests/no-handmade-svg.test.ts fails on new inline SVG drawing in apps/desktop/src and site/*.html - desktop bundle: 598.7 -> 695.5 kB minified, 174.6 -> 206.0 kB gzip
|
|
@ -29,6 +29,12 @@ Try the screenshot and video pipeline on the demo game without any store account
|
||||||
by hand. Frontmatter is `name` + `description` only.
|
by hand. Frontmatter is `name` + `description` only.
|
||||||
- **No secrets, no real ids, no personal data** in code, tests, fixtures or examples: use `com.example.*`,
|
- **No secrets, no real ids, no personal data** in code, tests, fixtures or examples: use `com.example.*`,
|
||||||
`example.com` and obviously fake values. `bun run ci` runs the scrub.
|
`example.com` and obviously fake values. `bun run ci` runs the scrub.
|
||||||
|
- **No hand-written SVG.** Charts come from visx, icons from lucide (`lucide-react` in the desktop app; the site's
|
||||||
|
icons are lucide's own files, vendored by `bun tools/site-icons.ts` into `site/img/icons/` with the licence),
|
||||||
|
diagrams from Mermaid (`docs/diagrams/*.mmd`, rendered by `bun tools/diagrams.ts`), the desktop fixtures' art from
|
||||||
|
`bun tools/fixture-art.ts`. The brand mark and `site/favicon.svg` are brand assets. `tests/no-handmade-svg.test.ts`
|
||||||
|
fails on new inline `<svg>` / `<path>` drawing in `apps/desktop/src` and `site/*.html`. These libraries are desktop
|
||||||
|
dependencies (bundled by Vite) or devDependencies; the CLI package keeps zero runtime dependencies.
|
||||||
- Plain English in docs and messages, short sentences, no marketing words.
|
- Plain English in docs and messages, short sentences, no marketing words.
|
||||||
|
|
||||||
## Pull requests
|
## Pull requests
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,16 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.12.0",
|
"@tauri-apps/api": "^2.12.0",
|
||||||
|
"@visx/axis": "^4.0.0",
|
||||||
|
"@visx/curve": "^4.0.0",
|
||||||
|
"@visx/event": "^4.0.0",
|
||||||
|
"@visx/gradient": "^4.0.0",
|
||||||
|
"@visx/group": "^4.0.0",
|
||||||
|
"@visx/responsive": "^4.0.0",
|
||||||
|
"@visx/scale": "^4.0.0",
|
||||||
|
"@visx/shape": "^4.0.0",
|
||||||
|
"@visx/tooltip": "^4.0.0",
|
||||||
|
"lucide-react": "^1.55.0",
|
||||||
"react": "^19.2.0",
|
"react": "^19.2.0",
|
||||||
"react-dom": "^19.2.0"
|
"react-dom": "^19.2.0"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
BIN
apps/desktop/src/dev/art/icon-block.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
apps/desktop/src/dev/art/icon-focus.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
apps/desktop/src/dev/art/icon-habit.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
apps/desktop/src/dev/art/icon-lantern.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
apps/desktop/src/dev/art/icon-mood.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
apps/desktop/src/dev/art/icon-night.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
apps/desktop/src/dev/art/icon-orbit.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
apps/desktop/src/dev/art/icon-prism.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
apps/desktop/src/dev/art/icon-racer.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
apps/desktop/src/dev/art/icon-sketch.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
apps/desktop/src/dev/art/icon-tidy.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
apps/desktop/src/dev/art/icon-tycoon.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
apps/desktop/src/dev/art/scene1-feature.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
apps/desktop/src/dev/art/scene1-ipad.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
apps/desktop/src/dev/art/scene1-phone.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
apps/desktop/src/dev/art/scene1-play.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
apps/desktop/src/dev/art/scene2-feature.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
apps/desktop/src/dev/art/scene2-ipad.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
apps/desktop/src/dev/art/scene2-phone.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
apps/desktop/src/dev/art/scene2-play.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
apps/desktop/src/dev/art/scene3-feature.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
apps/desktop/src/dev/art/scene3-ipad.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
apps/desktop/src/dev/art/scene3-phone.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
apps/desktop/src/dev/art/scene3-play.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
apps/desktop/src/dev/art/scene4-feature.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
apps/desktop/src/dev/art/scene4-ipad.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
apps/desktop/src/dev/art/scene4-phone.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
apps/desktop/src/dev/art/scene4-play.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
|
@ -116,26 +116,11 @@ export const LISTING_TEXT: Record<string, ListingText> = {
|
||||||
'p-tidy': { play: { path: `${HOME}/apps/tidy-lists/store/listing.md`, text: '## en-US\n' }, apple: { path: `${HOME}/apps/tidy-lists/store/appstore.md`, text: '## en-US\n' } },
|
'p-tidy': { play: { path: `${HOME}/apps/tidy-lists/store/listing.md`, text: '## en-US\n' }, apple: { path: `${HOME}/apps/tidy-lists/store/appstore.md`, text: '## en-US\n' } },
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---- store art: drawn stand-ins for the renders ----
|
// ---- store art: stand-ins for the renders, PNGs from tools/fixture-art.ts (four scenes in four shapes) ----
|
||||||
const COPY: Record<string, string[][]> = {
|
const SHAPE: Record<string, string> = { ios69: 'phone', ios65: 'phone', ipad13: 'ipad', play: 'play', feature: 'feature', poster: 'phone' };
|
||||||
en: [['Catch every', 'color drop!'], ['Chain splashes,', 'stack combos'], ['A new challenge', 'every day'], ['Clear levels,', 'earn 3 stars']],
|
function shot(scene: number, size: string, variant: string): string {
|
||||||
tr: [['Renkli damlaları', 'yakala!'], ['Sıçrat, eşleştir,', 'komboyu büyüt'], ['Her gün', 'yeni bir görev'], ['Bölümleri geç,', '3 yıldız topla']],
|
|
||||||
ja: [['カラフルなしずくを', 'キャッチ!'], ['しずくをそろえて', 'コンボをつなげ'], ['毎日あたらしい', 'チャレンジ'], ['ステージクリアで', '星を3つゲット']],
|
|
||||||
ar: [['التقط كل', 'قطرة ملوّنة!'], ['طابق القطرات', 'وضاعف الكومبو'], ['تحدٍّ جديد', 'كل يوم'], ['أنهِ المراحل', 'واجمع 3 نجوم']],
|
|
||||||
};
|
|
||||||
const PAL = [['#7c5cff', '#ff5fa2', '#ffd36e'], ['#ff7a59', '#ff3d7f', '#ffe08a'], ['#2fb5ff', '#5b6cff', '#b8f3ff'], ['#ffb03b', '#ff7a1a', '#fff1b8']];
|
|
||||||
const esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<');
|
|
||||||
function shot(scene: number, lang: string, w: number, h: number, variant: string): string {
|
|
||||||
const order = variant === 'b' ? [1, 0, 3, 2] : [0, 1, 2, 3];
|
const order = variant === 'b' ? [1, 0, 3, 2] : [0, 1, 2, 3];
|
||||||
const sc = order[scene % 4]!;
|
return new URL(`./art/scene${order[scene % 4]! + 1}-${SHAPE[size] ?? 'phone'}.png`, import.meta.url).href;
|
||||||
const [a, b, c] = PAL[variant === 'b' && sc === 1 ? 2 : sc]!;
|
|
||||||
const t = COPY[lang]?.[sc] ?? COPY.en![sc]!;
|
|
||||||
const land = w > h;
|
|
||||||
const fs = Math.round((land ? h : w) * 0.085);
|
|
||||||
const pw = land ? h * 0.42 : w * 0.62, ph = pw * 2.05, px = land ? w * 0.62 : (w - pw) / 2, py = land ? h * 0.18 : h * 0.3;
|
|
||||||
const drops = Array.from({ length: 7 }, (_, i) => `<circle cx="${px + pw * (0.2 + (i % 3) * 0.3)}" cy="${py + ph * (0.25 + Math.floor(i / 3) * 0.2)}" r="${pw * 0.09}" fill="${[a, b, c][i % 3]}" opacity=".9"/>`).join('');
|
|
||||||
const tx = land ? w * 0.08 : w / 2, anchor = land ? 'start' : 'middle';
|
|
||||||
return `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w} ${h}"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="${a}"/><stop offset="1" stop-color="${b}"/></linearGradient><radialGradient id="r" cx=".5" cy=".3" r=".7"><stop offset="0" stop-color="#fff" stop-opacity=".35"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></radialGradient></defs><rect width="${w}" height="${h}" fill="url(#g)"/><rect width="${w}" height="${h}" fill="url(#r)"/><text x="${tx}" y="${land ? h * 0.42 : h * 0.12}" font-family="Arial Rounded MT Bold, Arial, sans-serif" font-weight="800" font-size="${fs}" fill="#fff" text-anchor="${anchor}">${esc(t[0]!)}</text><text x="${tx}" y="${(land ? h * 0.42 : h * 0.12) + fs * 1.15}" font-family="Arial Rounded MT Bold, Arial, sans-serif" font-weight="800" font-size="${fs}" fill="${c}" text-anchor="${anchor}">${esc(t[1]!)}</text><rect x="${px}" y="${py}" width="${pw}" height="${ph}" rx="${pw * 0.12}" fill="#10142a" stroke="#fff" stroke-opacity=".85" stroke-width="${pw * 0.03}"/><rect x="${px + pw * 0.06}" y="${py + pw * 0.08}" width="${pw * 0.88}" height="${ph - pw * 0.16}" rx="${pw * 0.08}" fill="#1d2350"/>${drops}</svg>`)))}`;
|
|
||||||
}
|
}
|
||||||
const SIZES: [string, string, 'apple' | 'play', number, number][] = [
|
const SIZES: [string, string, 'apple' | 'play', number, number][] = [
|
||||||
['ios69', 'App Store iPhone 6.9"', 'apple', 1320, 2868], ['ios65', 'App Store iPhone 6.5"', 'apple', 1284, 2778], ['ipad13', 'App Store iPad 13"', 'apple', 2064, 2752],
|
['ios69', 'App Store iPhone 6.9"', 'apple', 1320, 2868], ['ios65', 'App Store iPhone 6.5"', 'apple', 1284, 2778], ['ipad13', 'App Store iPad 13"', 'apple', 2064, 2752],
|
||||||
|
|
@ -152,7 +137,7 @@ function renders(langs: string[], variants: string[]): RendersResult {
|
||||||
const n = size === 'feature' ? 1 : lang === 'ar' && size === 'ipad13' ? 0 : 4;
|
const n = size === 'feature' ? 1 : lang === 'ar' && size === 'ipad13' ? 0 : 4;
|
||||||
const tiles: RenderTile[] = Array.from({ length: n }, (_, i) => {
|
const tiles: RenderTile[] = Array.from({ length: n }, (_, i) => {
|
||||||
const src = `${v ? `${v}/` : ''}${lang}/${size}/${size === 'feature' ? '1024x500' : String(i + 1).padStart(2, '0')}.png`;
|
const src = `${v ? `${v}/` : ''}${lang}/${size}/${size === 'feature' ? '1024x500' : String(i + 1).padStart(2, '0')}.png`;
|
||||||
ART[src] = shot(i, lang, w, h, v);
|
ART[src] = shot(i, size, v);
|
||||||
const issues = lang === 'ja' && size === 'play' && i === 1 ? [{ level: 'warn' as const, code: 'overflow', msg: 'title line 2 shrunk to 72 %: consider shorter words' }]
|
const issues = lang === 'ja' && size === 'play' && i === 1 ? [{ level: 'warn' as const, code: 'overflow', msg: 'title line 2 shrunk to 72 %: consider shorter words' }]
|
||||||
: lang === 'tr' && size === 'feature' ? [{ level: 'warn' as const, code: 'bytes', msg: 'PNG is 1.4 MB: the JPEG copy uploads 4x faster (storebound shots jpeg)' }] : [];
|
: lang === 'tr' && size === 'feature' ? [{ level: 'warn' as const, code: 'bytes', msg: 'PNG is 1.4 MB: the JPEG copy uploads 4x faster (storebound shots jpeg)' }] : [];
|
||||||
images++; warnings += issues.length;
|
images++; warnings += issues.length;
|
||||||
|
|
@ -163,7 +148,7 @@ function renders(langs: string[], variants: string[]): RendersResult {
|
||||||
return { size, label, store, tiles, issues: rowIssues };
|
return { size, label, store, tiles, issues: rowIssues };
|
||||||
}), ...(!v && lang !== 'ar' ? [{ size: 'preview/iphone', label: 'App preview iPhone', store: 'apple' as const, issues: [], tiles: [(() => {
|
}), ...(!v && lang !== 'ar' ? [{ size: 'preview/iphone', label: 'App preview iPhone', store: 'apple' as const, issues: [], tiles: [(() => {
|
||||||
const src = `${lang}/preview/iphone/01.mp4`, poster = `${lang}/preview/iphone/01-poster.png`;
|
const src = `${lang}/preview/iphone/01.mp4`, poster = `${lang}/preview/iphone/01-poster.png`;
|
||||||
ART[poster] = shot(1, lang, 886, 1920, '');
|
ART[poster] = shot(1, 'poster', '');
|
||||||
videos++;
|
videos++;
|
||||||
return { src, kind: 'video' as const, poster, name: '01.mp4', w: 886, h: 1920, bytes: 18_400_000, issues: [] };
|
return { src, kind: 'video' as const, poster, name: '01.mp4', w: 886, h: 1920, bytes: 18_400_000, issues: [] };
|
||||||
})()] }] : [])],
|
})()] }] : [])],
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,9 @@ export async function mockListen(event: string, cb: Cb): Promise<() => void> {
|
||||||
const emit = (event: string, payload: unknown) => { for (const cb of listeners.get(event) ?? []) cb(payload); };
|
const emit = (event: string, payload: unknown) => { for (const cb of listeners.get(event) ?? []) cb(payload); };
|
||||||
const cancelled = new Set<string>();
|
const cancelled = new Set<string>();
|
||||||
|
|
||||||
// ---- icons (fixture art, drawn for the demo apps) ----
|
// ---- icons: PNGs rendered by tools/fixture-art.ts (lucide icons on gradients), served by Vite in dev ----
|
||||||
const svg = (s: string) => `data:image/svg+xml;base64,${btoa(s)}`;
|
const art = (name: string) => new URL(`./art/${name}.png`, import.meta.url).href;
|
||||||
const ICONS: Record<string, string> = {
|
const ICONS: Record<string, string> = { 'p-prism': art('icon-prism'), 'p-tidy': art('icon-tidy') };
|
||||||
'p-prism': svg(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#7c5cff"/><stop offset="1" stop-color="#ff5fa2"/></linearGradient></defs><rect width="64" height="64" fill="url(#g)"/><path d="M32 12 50 44H14z" fill="#fff" fill-opacity=".92"/><path d="M32 12 41 44H32z" fill="#ffd36e"/><path d="M46 46c0 4-3 7-6 7s-6-3-6-7 6-10 6-10 6 6 6 10z" fill="#5ee0ff" stroke="#fff" stroke-width="2"/></svg>`),
|
|
||||||
'p-tidy': svg(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="g" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#2fd18b"/><stop offset="1" stop-color="#0f9d74"/></linearGradient></defs><rect width="64" height="64" fill="url(#g)"/><rect x="14" y="13" width="36" height="40" rx="7" fill="#fff"/><path d="M20 25l3 3 6-6M20 37l3 3 6-6" stroke="#0f9d74" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M33 26h11M33 38h11" stroke="#b6e8d4" stroke-width="3" stroke-linecap="round"/></svg>`),
|
|
||||||
};
|
|
||||||
|
|
||||||
// ---- workspace: 3 studios, 2 Play service accounts + 3 App Store Connect teams, 2 app folders, store-only apps ----
|
// ---- workspace: 3 studios, 2 Play service accounts + 3 App Store Connect teams, 2 app folders, store-only apps ----
|
||||||
// Placeholder names only (example.com style): no real studio, person, team or id.
|
// Placeholder names only (example.com style): no real studio, person, team or id.
|
||||||
|
|
@ -57,19 +54,10 @@ let accounts: Account[] = [
|
||||||
];
|
];
|
||||||
if (import.meta.env.VITE_FIXTURES === 'empty') { projects = []; accounts = []; studios = []; }
|
if (import.meta.env.VITE_FIXTURES === 'empty') { projects = []; accounts = []; studios = []; }
|
||||||
|
|
||||||
/** Small drawn icons for the store apps (fixture art). */
|
/** Store app icons (tools/fixture-art.ts). */
|
||||||
const glyph = (a: string, b: string, inner: string) => `data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="${a}"/><stop offset="1" stop-color="${b}"/></linearGradient></defs><rect width="64" height="64" fill="url(#g)"/>${inner}</svg>`)}`;
|
|
||||||
const G = {
|
const G = {
|
||||||
orbit: glyph('#0ea5e9', '#6366f1', '<circle cx="32" cy="32" r="9" fill="#fff"/><ellipse cx="32" cy="32" rx="22" ry="9" fill="none" stroke="#fff" stroke-width="3" transform="rotate(-25 32 32)"/>'),
|
orbit: art('icon-orbit'), block: art('icon-block'), lantern: art('icon-lantern'), tycoon: art('icon-tycoon'), racer: art('icon-racer'),
|
||||||
block: glyph('#22c55e', '#15803d', '<rect x="14" y="30" width="16" height="16" rx="3" fill="#fff"/><rect x="34" y="30" width="16" height="16" rx="3" fill="#bbf7d0"/><rect x="24" y="12" width="16" height="16" rx="3" fill="#fff"/>'),
|
habit: art('icon-habit'), focus: art('icon-focus'), sketch: art('icon-sketch'), night: art('icon-night'), mood: art('icon-mood'),
|
||||||
lantern: glyph('#f59e0b', '#b45309', '<path d="M24 18h16l4 8v16l-4 6H24l-4-6V26z" fill="#fff"/><text x="32" y="41" font-family="Georgia" font-size="16" font-weight="700" text-anchor="middle" fill="#b45309">W</text>'),
|
|
||||||
tycoon: glyph('#a855f7', '#6d28d9', '<circle cx="32" cy="32" r="16" fill="#fde68a"/><text x="32" y="39" font-family="Arial" font-size="18" font-weight="800" text-anchor="middle" fill="#92400e">$</text>'),
|
|
||||||
racer: glyph('#ef4444', '#991b1b', '<path d="M14 38l6-12h24l6 12v6H14z" fill="#fff"/><circle cx="22" cy="44" r="4" fill="#111"/><circle cx="42" cy="44" r="4" fill="#111"/>'),
|
|
||||||
habit: glyph('#14b8a6', '#0f766e', '<ellipse cx="32" cy="36" rx="13" ry="16" fill="#fff"/><path d="M24 34l5 5 11-11" stroke="#0f766e" stroke-width="4" fill="none" stroke-linecap="round"/>'),
|
|
||||||
focus: glyph('#f43f5e', '#be123c', '<circle cx="32" cy="34" r="15" fill="#fff"/><path d="M32 34V24M32 34l7 4" stroke="#be123c" stroke-width="3.5" stroke-linecap="round"/>'),
|
|
||||||
sketch: glyph('#fb923c', '#ea580c', '<path d="M32 13l5 11 12 1-9 8 3 12-11-7-11 7 3-12-9-8 12-1z" fill="#fff"/>'),
|
|
||||||
night: glyph('#1e293b', '#4338ca', '<path d="M38 16a16 16 0 1 0 10 28 13 13 0 0 1-10-28z" fill="#fde68a"/><rect x="18" y="40" width="20" height="3" rx="1.5" fill="#c7d2fe"/>'),
|
|
||||||
mood: glyph('#ec4899', '#8b5cf6', '<rect x="14" y="14" width="10" height="10" rx="3" fill="#fff"/><rect x="27" y="14" width="10" height="10" rx="3" fill="#fbcfe8"/><rect x="40" y="14" width="10" height="10" rx="3" fill="#fff"/><rect x="14" y="27" width="10" height="10" rx="3" fill="#ddd6fe"/><rect x="27" y="27" width="10" height="10" rx="3" fill="#fff"/><rect x="40" y="27" width="10" height="10" rx="3" fill="#fbcfe8"/><rect x="14" y="40" width="10" height="10" rx="3" fill="#fff"/><rect x="27" y="40" width="10" height="10" rx="3" fill="#ddd6fe"/><rect x="40" y="40" width="10" height="10" rx="3" fill="#fff"/>'),
|
|
||||||
};
|
};
|
||||||
const ios = (id: string, bundleId: string, name: string, icon: string | null, latest: [string, string] | null): StoreApp =>
|
const ios = (id: string, bundleId: string, name: string, icon: string | null, latest: [string, string] | null): StoreApp =>
|
||||||
({ store: 'ios', id, bundleId, name, platforms: ['IOS'], sku: null, primaryLocale: 'en-US', latest: latest ? { version: latest[0], state: latest[1], platform: 'IOS' } : null, icon });
|
({ store: 'ios', id, bundleId, name, platforms: ['IOS'], sku: null, primaryLocale: 'en-US', latest: latest ? { version: latest[0], state: latest[1], platform: 'IOS' } : null, icon });
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ function HealthCell({ c, android }: { c: { h: HealthSnapshot; at: string } | nul
|
||||||
const s = healthSeries(play.crash, 'userPerceivedCrashRate', PLAY_THRESHOLDS.crash);
|
const s = healthSeries(play.crash, 'userPerceivedCrashRate', PLAY_THRESHOLDS.crash);
|
||||||
return (
|
return (
|
||||||
<div className="mini-health" title={t('portfolio.healthTitle', { when: ago(c.at) })}>
|
<div className="mini-health" title={t('portfolio.healthTitle', { when: ago(c.at) })}>
|
||||||
<Sparkline values={s.values.slice(-14)} threshold={s.threshold} tone={s.tone} label={t('health.chartAria', { metric: t('health.crash'), value: pct(s.current) })} />
|
<Sparkline compact values={s.values.slice(-14)} threshold={s.threshold} tone={s.tone} label={t('health.chartAria', { metric: t('health.crash'), value: pct(s.current) })} />
|
||||||
<span className={`num small strong ${s.tone === 'bad' ? 'tbad' : s.tone === 'warn' ? 'twarn' : ''}`}>{pct(s.current)}</span>
|
<span className={`num small strong ${s.tone === 'bad' ? 'tbad' : s.tone === 'warn' ? 'twarn' : ''}`}>{pct(s.current)}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ function Metric({ title, s }: { title: string; s: Series }) {
|
||||||
<span className="lg"><span className="sw thr" />{t('health.threshold', { value: pct(s.threshold) })}</span>
|
<span className="lg"><span className="sw thr" />{t('health.threshold', { value: pct(s.threshold) })}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Sparkline values={s.values} threshold={s.threshold} tone={s.tone} label={t('health.chartAria', { metric: title, value: pct(s.current) })} />
|
<Sparkline values={s.values} dates={s.dates} threshold={s.threshold} tone={s.tone} label={t('health.chartAria', { metric: title, value: pct(s.current) })} />
|
||||||
<div className="axis"><span>{date(s.dates[0])}</span><span>{date(s.dates[Math.floor(s.dates.length / 2)])}</span><span>{date(s.dates.at(-1))}</span></div>
|
<div className="axis"><span>{date(s.dates[0])}</span><span>{date(s.dates[Math.floor(s.dates.length / 2)])}</span><span>{date(s.dates.at(-1))}</span></div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ import { ago, date, share } from '../../lib/format';
|
||||||
import { type Lane, STAGES, type TestFlightStatus, trainLanes, versionHistory } from '../../lib/model';
|
import { type Lane, STAGES, type TestFlightStatus, trainLanes, versionHistory } from '../../lib/model';
|
||||||
import { useData, useRead, useWrite } from '../../store';
|
import { useData, useRead, useWrite } from '../../store';
|
||||||
import { Icon, StoreGlyph } from '../../ui/icons';
|
import { Icon, StoreGlyph } from '../../ui/icons';
|
||||||
import { Bar, Card, Chip, Empty, Notice, PhaseChip, storeName } from '../../ui/kit';
|
import { RolloutBar } from '../../ui/charts';
|
||||||
|
import { Card, Chip, Empty, Notice, PhaseChip, storeName } from '../../ui/kit';
|
||||||
import { ascUrl, PLAY_CONSOLE } from '../AppView';
|
import { ascUrl, PLAY_CONSOLE } from '../AppView';
|
||||||
|
|
||||||
const STAGE_KEY: Record<(typeof STAGES)[number], Key> = { build: 'stage.build', testing: 'stage.testing', review: 'stage.review', live: 'stage.live', rollout: 'stage.rollout' };
|
const STAGE_KEY: Record<(typeof STAGES)[number], Key> = { build: 'stage.build', testing: 'stage.testing', review: 'stage.review', live: 'stage.live', rollout: 'stage.rollout' };
|
||||||
|
|
@ -40,7 +41,7 @@ function LaneRow({ lane, version }: { lane: Lane; version: string }) {
|
||||||
<div key={s} className={`tl-step ${cls}${i === 0 ? ' first' : ''}`} title={i === lane.at ? r?.state : undefined}>
|
<div key={s} className={`tl-step ${cls}${i === 0 ? ' first' : ''}`} title={i === lane.at ? r?.state : undefined}>
|
||||||
<span className="tl-node">{i < lane.at && <Icon name="check" />}</span>
|
<span className="tl-node">{i < lane.at && <Icon name="check" />}</span>
|
||||||
{last && i === lane.at && lane.share !== null ? (
|
{last && i === lane.at && lane.share !== null ? (
|
||||||
<div className="tl-roll"><Bar value={lane.share} tone={lane.tone === 'bad' ? 'bad' : lane.share >= 1 ? 'ok' : 'accent'} label={t('tl.rolloutAria')} />
|
<div className="tl-roll"><RolloutBar value={lane.share} tone={lane.tone === 'bad' ? 'bad' : lane.share >= 1 ? 'ok' : 'accent'} label={t('tl.rolloutAria')} />
|
||||||
<span className="pct">{lane.share >= 1 ? t('tl.everyone') : `${share(lane.share)}${r?.phased?.day ? ` · ${t('tl.day', { day: r.phased.day })}` : ''}`}</span></div>
|
<span className="pct">{lane.share >= 1 ? t('tl.everyone') : `${share(lane.share)}${r?.phased?.day ? ` · ${t('tl.day', { day: r.phased.day })}` : ''}`}</span></div>
|
||||||
) : <span className="tl-cap">{stageCaption(lane, i)}</span>}
|
) : <span className="tl-cap">{stageCaption(lane, i)}</span>}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -346,7 +346,7 @@ svg { flex: none; }
|
||||||
.tl-cap { position: absolute; top: calc(50% + 4px); font-size: var(--t-micro); color: var(--muted); white-space: nowrap; font-weight: 550; }
|
.tl-cap { position: absolute; top: calc(50% + 4px); font-size: var(--t-micro); color: var(--muted); white-space: nowrap; font-weight: 550; }
|
||||||
.tl-step.cur .tl-cap { color: var(--ink); font-weight: 650; }
|
.tl-step.cur .tl-cap { color: var(--ink); font-weight: 650; }
|
||||||
.tl-roll { width: 76%; display: grid; gap: 4px; position: absolute; top: calc(50% + 2px); }
|
.tl-roll { width: 76%; display: grid; gap: 4px; position: absolute; top: calc(50% + 2px); }
|
||||||
.tl-roll .bar { height: 6px; }
|
.tl-roll .rbar { height: 6px; }
|
||||||
.tl-roll .pct { font-size: var(--t-micro); text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
|
.tl-roll .pct { font-size: var(--t-micro); text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
|
||||||
.tl-none { grid-column: 2 / -1; color: var(--muted); font-size: var(--t-meta); text-align: center; border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px; }
|
.tl-none { grid-column: 2 / -1; color: var(--muted); font-size: var(--t-meta); text-align: center; border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px; }
|
||||||
.train-head { display: flex; align-items: center; gap: 10px; }
|
.train-head { display: flex; align-items: center; gap: 10px; }
|
||||||
|
|
@ -358,16 +358,34 @@ svg { flex: none; }
|
||||||
.bar.thin { height: 4px; }
|
.bar.thin { height: 4px; }
|
||||||
|
|
||||||
/* ---------- charts ---------- */
|
/* ---------- charts ---------- */
|
||||||
.spark { width: 100%; height: 72px; display: block; overflow: visible; }
|
.spark { width: 100%; height: 72px; display: block; position: relative; --spark: var(--accent-solid); }
|
||||||
.spark .area { opacity: 1; }
|
.spark > svg { display: block; overflow: visible; outline: none; border-radius: 4px; }
|
||||||
.spark .stop-a { stop-color: var(--spark, var(--accent-solid)); stop-opacity: .28; }
|
.spark > svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
|
||||||
.spark .stop-b { stop-color: var(--spark, var(--accent-solid)); stop-opacity: 0; }
|
.spark linearGradient stop { stop-color: var(--spark); }
|
||||||
.spark .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
|
.spark .line { fill: none; stroke: var(--spark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
|
||||||
.spark .thr { stroke: var(--bad-solid); stroke-width: 1.25; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
|
.spark.compact .line { stroke-width: 1.5; }
|
||||||
.spark.ok { --spark: var(--ok-solid); } .spark.ok .line { stroke: var(--ok-solid); }
|
.spark .thr { stroke: var(--bad-solid); stroke-width: 1.25; stroke-dasharray: 4 4; }
|
||||||
.spark.warn { --spark: var(--warn-solid); } .spark.warn .line { stroke: var(--warn-solid); }
|
.spark .hov line { stroke: var(--line-2); stroke-width: 1; }
|
||||||
.spark.bad { --spark: var(--bad-solid); } .spark.bad .line { stroke: var(--bad-solid); }
|
.spark .hov circle { fill: var(--spark); stroke: var(--surface); stroke-width: 2; }
|
||||||
.spark.neutral .line, .spark.accent .line, .spark.info .line { stroke: var(--accent-solid); }
|
.spark.ok { --spark: var(--ok-solid); } .spark.warn { --spark: var(--warn-solid); } .spark.bad { --spark: var(--bad-solid); }
|
||||||
|
/* chart tooltip (visx TooltipWithBounds, unstyled; charts.tsx ChartTip) */
|
||||||
|
.vx-tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 4px; min-width: 150px; padding: 8px 10px; white-space: nowrap;
|
||||||
|
background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); font-size: var(--t-meta); }
|
||||||
|
.vx-tip > b { font-weight: 650; }
|
||||||
|
.vx-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
|
||||||
|
.vx-row.muted { color: var(--muted); }
|
||||||
|
.vx-row b { margin-left: auto; padding-left: 14px; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
|
||||||
|
.vx-tip .sw { width: 10px; height: 3px; border-radius: 2px; flex: none; background: var(--accent-solid); }
|
||||||
|
.vx-tip .sw.ok, .vx-tip .sw.l2 { background: var(--ok-solid); } .vx-tip .sw.warn { background: var(--warn-solid); } .vx-tip .sw.bad { background: var(--bad-solid); }
|
||||||
|
.vx-tip .sw.l3 { background: repeating-linear-gradient(90deg, var(--warn-solid) 0 4px, transparent 4px 6px); }
|
||||||
|
.vx-tip .sw.thr { background: repeating-linear-gradient(90deg, var(--bad-solid) 0 3px, transparent 3px 5px); }
|
||||||
|
.vx-tip .sw.ev { width: 8px; height: 8px; border-radius: 50%; background: var(--info-solid); }
|
||||||
|
/* rollout / phased release share (visx bar, charts.tsx RolloutBar) */
|
||||||
|
.rbar { width: 100%; height: 8px; }
|
||||||
|
.rbar > svg { display: block; }
|
||||||
|
.rbar .track { fill: var(--neutral-bg); stroke: var(--line); stroke-width: 1; }
|
||||||
|
.rbar .fill { fill: var(--accent-solid); }
|
||||||
|
.rbar.ok .fill { fill: var(--ok-solid); } .rbar.warn .fill { fill: var(--warn-solid); } .rbar.bad .fill { fill: var(--bad-solid); } .rbar.info .fill { fill: var(--info-solid); }
|
||||||
.metric { display: grid; gap: 10px; }
|
.metric { display: grid; gap: 10px; }
|
||||||
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
|
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
|
||||||
.metric-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
|
.metric-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
|
||||||
|
|
@ -475,14 +493,21 @@ button.li:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px;
|
||||||
|
|
||||||
/* ---------- empty states ---------- */
|
/* ---------- empty states ---------- */
|
||||||
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 24px 44px; }
|
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 24px 44px; }
|
||||||
.empty svg.illo { width: 168px; height: 112px; margin-bottom: 6px; }
|
.empty .illo { margin-bottom: 6px; }
|
||||||
.empty h3 { font-size: var(--t-section); font-weight: 650; }
|
.empty h3 { font-size: var(--t-section); font-weight: 650; }
|
||||||
.empty p { color: var(--muted); max-width: 52ch; }
|
.empty p { color: var(--muted); max-width: 52ch; }
|
||||||
.empty .actions { margin-top: 10px; justify-content: center; }
|
.empty .actions { margin-top: 10px; justify-content: center; }
|
||||||
.empty.compact { padding: 24px 16px; }
|
.empty.compact { padding: 24px 16px; }
|
||||||
.empty.compact svg.illo { width: 120px; height: 80px; }
|
.empty.compact .illo { --illo-size: 80px; }
|
||||||
.illo .f1 { fill: var(--illo-1); } .illo .f2 { fill: var(--illo-2); } .illo .s1 { stroke: var(--illo-line); fill: none; } .illo .s2 { stroke: var(--illo-soft); fill: none; }
|
/* empty state art (ui/illustrations.tsx): a lucide icon on a soft tile with rings behind it and an optional badge */
|
||||||
.illo .fl { fill: var(--illo-line); } .illo .fs { fill: var(--surface); } .illo .fsoft { fill: var(--illo-soft); }
|
.illo { --illo-size: 112px; width: calc(var(--illo-size) * 1.5); height: var(--illo-size); display: grid; place-items: center; position: relative;
|
||||||
|
background: radial-gradient(circle at 50% 50%, var(--illo-1) 0 30%, transparent 30.5%), radial-gradient(circle at 50% 50%, transparent 0 41%, var(--illo-2) 41.5% 42.5%, transparent 43%); }
|
||||||
|
.illo-tile { width: calc(var(--illo-size) * .54); height: calc(var(--illo-size) * .54); border-radius: 28%; display: grid; place-items: center; position: relative;
|
||||||
|
background: var(--surface); border: 1px solid var(--illo-2); box-shadow: var(--shadow-2); color: var(--illo-line); }
|
||||||
|
.illo-tile > svg { width: 46%; height: 46%; }
|
||||||
|
.illo-badge { position: absolute; right: -10%; bottom: -10%; width: 40%; height: 40%; border-radius: 50%; display: grid; place-items: center;
|
||||||
|
background: var(--illo-line); color: var(--surface); box-shadow: 0 0 0 3px var(--surface); }
|
||||||
|
.illo-badge > svg { width: 58%; height: 58%; }
|
||||||
|
|
||||||
/* ---------- skeletons ---------- */
|
/* ---------- skeletons ---------- */
|
||||||
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--neutral-bg) 0%, color-mix(in srgb, var(--neutral-bg) 55%, var(--surface)) 50%, var(--neutral-bg) 100%); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; }
|
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--neutral-bg) 0%, color-mix(in srgb, var(--neutral-bg) 55%, var(--surface)) 50%, var(--neutral-bg) 100%); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; }
|
||||||
|
|
@ -620,7 +645,7 @@ select.input { padding-right: 8px; }
|
||||||
.fix svg { width: 13px; height: 13px; margin-top: 2px; color: var(--accent-solid); flex: none; }
|
.fix svg { width: 13px; height: 13px; margin-top: 2px; color: var(--accent-solid); flex: none; }
|
||||||
.fix code { font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
.fix code { font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||||
.field > .seg { justify-self: start; }
|
.field > .seg { justify-self: start; }
|
||||||
.wz-body svg.illo { width: 168px; height: 112px; margin-bottom: -6px; }
|
.wz-body .illo { margin-bottom: -6px; }
|
||||||
h2[tabindex="-1"]:focus, h2[tabindex="-1"]:focus-visible { outline: none; }
|
h2[tabindex="-1"]:focus, h2[tabindex="-1"]:focus-visible { outline: none; }
|
||||||
.acc-pick { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; }
|
.acc-pick { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; }
|
||||||
.acc-pick svg { width: 15px; height: 15px; color: var(--muted); }
|
.acc-pick svg { width: 15px; height: 15px; color: var(--muted); }
|
||||||
|
|
@ -852,17 +877,18 @@ textarea.input { height: auto; padding: 8px 10px; line-height: 1.45; resize: ver
|
||||||
|
|
||||||
/* growth chart */
|
/* growth chart */
|
||||||
.lchart { display: grid; gap: 8px; }
|
.lchart { display: grid; gap: 8px; }
|
||||||
.lchart svg { width: 100%; height: auto; display: block; overflow: visible; outline: none; border-radius: 8px; }
|
.lchart-plot { position: relative; width: 100%; }
|
||||||
.lchart svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
|
.lchart-plot > svg { display: block; overflow: visible; outline: none; border-radius: 8px; }
|
||||||
|
.lchart-plot > svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
|
||||||
.lchart .grid-l line { stroke: var(--line); stroke-width: 1; }
|
.lchart .grid-l line { stroke: var(--line); stroke-width: 1; }
|
||||||
.lchart line.base { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
|
.lchart line.base { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
|
||||||
.lchart text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
|
.lchart text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
|
||||||
.lchart .stop-a { stop-color: var(--accent-solid); stop-opacity: .18; }
|
.lchart linearGradient stop { stop-color: var(--accent-solid); }
|
||||||
.lchart .stop-b { stop-color: var(--accent-solid); stop-opacity: 0; }
|
|
||||||
.lchart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
|
.lchart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
|
||||||
.lchart .ln.l1 { stroke: var(--accent-solid); }
|
.lchart .ln.l1 { stroke: var(--accent-solid); }
|
||||||
.lchart .ln.l2 { stroke: var(--ok-solid); }
|
.lchart .ln.l2 { stroke: var(--ok-solid); }
|
||||||
.lchart .ln.l3 { stroke: var(--warn-solid); stroke-dasharray: 5 4; }
|
.lchart .ln.l3 { stroke: var(--warn-solid); stroke-dasharray: 5 4; }
|
||||||
|
.lchart .hov circle { stroke: var(--surface); stroke-width: 2; }
|
||||||
.lchart circle.l1 { fill: var(--accent-solid); } .lchart circle.l2 { fill: var(--ok-solid); } .lchart circle.l3 { fill: var(--warn-solid); }
|
.lchart circle.l1 { fill: var(--accent-solid); } .lchart circle.l2 { fill: var(--ok-solid); } .lchart circle.l3 { fill: var(--warn-solid); }
|
||||||
.lchart .ev line { stroke: var(--info-solid); stroke-width: 1.25; stroke-dasharray: 3 4; }
|
.lchart .ev line { stroke: var(--info-solid); stroke-width: 1.25; stroke-dasharray: 3 4; }
|
||||||
.lchart .ev circle { fill: var(--info-solid); stroke: var(--surface); stroke-width: 2; cursor: help; }
|
.lchart .ev circle { fill: var(--info-solid); stroke: var(--surface); stroke-width: 2; cursor: help; }
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,20 @@
|
||||||
// A small line chart for daily store analytics. Reach (impressions, visitors), installs and conversion differ by one
|
// Daily store analytics as lines, drawn with visx (scales, axes, shapes, gradient, tooltip, responsive width). Reach
|
||||||
// to three orders of magnitude, so on one count axis installs lay flat at the bottom. The chart therefore plots each
|
// (impressions, visitors), installs and conversion differ by one to three orders of magnitude, so on one count axis
|
||||||
// line as an index (100 = that line's own average over the days shown, views.ts indexSeries) on one shared axis: every
|
// installs lay flat at the bottom. The chart therefore plots each line as an index (100 = that line's own average over
|
||||||
// line uses the full height and a listing change shows as lines moving apart. Hover (or arrow keys when focused) shows
|
// the days shown, views.ts indexSeries) on one shared axis with a dashed 100 baseline: every line uses the full height
|
||||||
// the real values of one day; store changes from git are dashed markers.
|
// and a listing change shows as lines moving apart. A crosshair tooltip (pointer, or arrow keys when focused) shows the
|
||||||
import { type KeyboardEvent, useId, useState } from 'react';
|
// real values of one day and the store changes from git made that day; changes are dashed markers.
|
||||||
|
import { AxisBottom, AxisLeft } from '@visx/axis';
|
||||||
|
import { curveMonotoneX } from '@visx/curve';
|
||||||
|
import { LinearGradient } from '@visx/gradient';
|
||||||
|
import { Group } from '@visx/group';
|
||||||
|
import { useParentSize } from '@visx/responsive';
|
||||||
|
import { scaleLinear } from '@visx/scale';
|
||||||
|
import { AreaClosed, Bar, Circle, Line, LinePath } from '@visx/shape';
|
||||||
|
import { useId } from 'react';
|
||||||
import { date, num, pct } from '../lib/format';
|
import { date, num, pct } from '../lib/format';
|
||||||
import { indexSeries } from '../lib/views';
|
import { indexSeries } from '../lib/views';
|
||||||
|
import { ChartTip, useIndexHover } from './charts';
|
||||||
|
|
||||||
export interface ChartLine {
|
export interface ChartLine {
|
||||||
label: string;
|
label: string;
|
||||||
|
|
@ -15,7 +24,7 @@ export interface ChartLine {
|
||||||
unit: 'count' | 'rate';
|
unit: 'count' | 'rate';
|
||||||
}
|
}
|
||||||
|
|
||||||
const W = 800, H = 230, L = 46, R = 18, T = 14, B = 26;
|
const M = { top: 14, right: 18, bottom: 26, left: 46 };
|
||||||
|
|
||||||
/** Index axis: a round top above the highest point (at least 150 so 100 sits in the lower two thirds) and 4 ticks. */
|
/** Index axis: a round top above the highest point (at least 150 so 100 sits in the lower two thirds) and 4 ticks. */
|
||||||
export function indexAxis(lines: (number | null)[][]): { max: number; ticks: number[] } {
|
export function indexAxis(lines: (number | null)[][]): { max: number; ticks: number[] } {
|
||||||
|
|
@ -25,54 +34,79 @@ export function indexAxis(lines: (number | null)[][]): { max: number; ticks: num
|
||||||
return { max, ticks: Array.from({ length: max / step + 1 }, (_, i) => i * step) };
|
return { max, ticks: Array.from({ length: max / step + 1 }, (_, i) => i * step) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Up to `most` evenly spread day indexes, always the first and the last. */
|
||||||
|
export function dateTicks(n: number, most: number): number[] {
|
||||||
|
if (n <= 1) return [0];
|
||||||
|
const k = Math.max(2, Math.min(n, most));
|
||||||
|
return [...new Set(Array.from({ length: k }, (_, i) => Math.round((i * (n - 1)) / (k - 1))))];
|
||||||
|
}
|
||||||
|
|
||||||
export function LineChart({ dates, lines, events, label, eventsLabel, indexLabel }: {
|
export function LineChart({ dates, lines, events, label, eventsLabel, indexLabel }: {
|
||||||
dates: string[]; lines: ChartLine[]; events: { date: string; subject: string }[]; label: string; eventsLabel: string; indexLabel: string;
|
dates: string[]; lines: ChartLine[]; events: { date: string; subject: string }[]; label: string; eventsLabel: string; indexLabel: string;
|
||||||
}) {
|
}) {
|
||||||
const gid = useId().replace(/:/g, '');
|
const gid = `lg${useId().replace(/:/g, '')}`;
|
||||||
const [hover, setHover] = useState<number | null>(null);
|
const { parentRef, width } = useParentSize({ debounceTime: 50 });
|
||||||
const n = dates.length;
|
const n = dates.length;
|
||||||
|
const h = useIndexHover(n, width, M.left, M.right);
|
||||||
if (n < 2) return null;
|
if (n < 2) return null;
|
||||||
|
// responsive: the height follows the width between 180 and 260 px
|
||||||
|
const height = Math.round(Math.max(180, Math.min(260, width * 0.3)));
|
||||||
const plotted = lines.map(l => indexSeries(l.values));
|
const plotted = lines.map(l => indexSeries(l.values));
|
||||||
const { max, ticks } = indexAxis(plotted);
|
const { max, ticks } = indexAxis(plotted);
|
||||||
const x = (i: number) => L + (i / (n - 1)) * (W - L - R);
|
const x = scaleLinear({ domain: [0, n - 1], range: [M.left, Math.max(M.left + 1, width - M.right)] });
|
||||||
const y = (v: number) => H - B - (v / max) * (H - T - B);
|
const y = scaleLinear({ domain: [0, max], range: [height - M.bottom, M.top] });
|
||||||
const path = (vs: (number | null)[]) => vs.map((v, i) => (v === null ? '' : `${i && vs[i - 1] !== null ? 'L' : 'M'}${x(i).toFixed(1)} ${y(v).toFixed(1)}`)).join(' ');
|
const pts = (vs: (number | null)[]) => vs.map((v, i) => [i, v] as const);
|
||||||
const onMove = (ev: React.MouseEvent<SVGSVGElement>) => {
|
const defined = (d: readonly [number, number | null]) => d[1] !== null;
|
||||||
const r = ev.currentTarget.getBoundingClientRect();
|
const xs = dateTicks(n, Math.max(2, Math.floor(width / 110)));
|
||||||
const px = ((ev.clientX - r.left) / r.width) * W;
|
const onDay = (i: number) => events.filter(e => e.date === dates[i]);
|
||||||
setHover(Math.max(0, Math.min(n - 1, Math.round(((px - L) / (W - L - R)) * (n - 1)))));
|
|
||||||
};
|
|
||||||
const onKey = (ev: KeyboardEvent) => {
|
|
||||||
if (ev.key === 'ArrowRight') { ev.preventDefault(); setHover(h => Math.min(n - 1, (h ?? -1) + 1)); }
|
|
||||||
if (ev.key === 'ArrowLeft') { ev.preventDefault(); setHover(h => Math.max(0, (h ?? n) - 1)); }
|
|
||||||
};
|
|
||||||
const fmt = (l: ChartLine, v: number | null) => (v === null ? '–' : l.unit === 'rate' ? pct(v, 1) : num(v));
|
const fmt = (l: ChartLine, v: number | null) => (v === null ? '–' : l.unit === 'rate' ? pct(v, 1) : num(v));
|
||||||
|
const hv = h.hover;
|
||||||
return (
|
return (
|
||||||
<div className="lchart">
|
<div className="lchart">
|
||||||
<svg viewBox={`0 0 ${W} ${H}`} role="img" aria-label={`${label} (${indexLabel})`} tabIndex={0} onMouseMove={onMove} onMouseLeave={() => setHover(null)} onKeyDown={onKey} onBlur={() => setHover(null)}>
|
<div ref={parentRef} className="lchart-plot" style={{ height }}>
|
||||||
<defs><linearGradient id={`lg${gid}`} x1="0" y1="0" x2="0" y2="1"><stop offset="0" className="stop-a" /><stop offset="1" className="stop-b" /></linearGradient></defs>
|
{width > 0 && (
|
||||||
{ticks.map(v => (
|
<svg width={width} height={height} role="img" aria-label={`${label} (${indexLabel})`} tabIndex={0} {...h.handlers}>
|
||||||
<g key={v} className="grid-l">
|
<LinearGradient id={gid} vertical from="var(--accent-solid)" to="var(--accent-solid)" fromOpacity={0.18} toOpacity={0} />
|
||||||
<line x1={L} x2={W - R} y1={y(v)} y2={y(v)} />
|
<Group className="grid-l">
|
||||||
<text x={L - 6} y={y(v) + 4} textAnchor="end">{v}</text>
|
{ticks.map(v => <Line key={v} from={{ x: M.left, y: y(v) }} to={{ x: width - M.right, y: y(v) }} />)}
|
||||||
</g>
|
</Group>
|
||||||
))}
|
<AxisLeft scale={y} left={M.left} tickValues={ticks} hideAxisLine hideTicks tickClassName="ax" tickLabelProps={{ className: 'ax', textAnchor: 'end', dx: -4, dy: 4 }} />
|
||||||
<line className="base" x1={L} x2={W - R} y1={y(100)} y2={y(100)} />
|
<AxisBottom scale={x} top={height - M.bottom} tickValues={xs} tickFormat={v => date(dates[Number(v)])} hideAxisLine hideTicks
|
||||||
{events.map((e, i) => {
|
tickLabelProps={(_, i) => ({ className: 'ax', textAnchor: i === 0 ? 'start' : i === xs.length - 1 ? 'end' : 'middle', dy: 4 })} />
|
||||||
const k = dates.indexOf(e.date);
|
<Line className="base" from={{ x: M.left, y: y(100) }} to={{ x: width - M.right, y: y(100) }} />
|
||||||
if (k < 0) return null;
|
{events.map((e, i) => {
|
||||||
return <g key={i} className="ev"><line x1={x(k)} x2={x(k)} y1={T} y2={H - B} /><circle cx={x(k)} cy={T + 4} r={4}><title>{`${date(e.date)} · ${e.subject}`}</title></circle></g>;
|
const k = dates.indexOf(e.date);
|
||||||
})}
|
if (k < 0) return null;
|
||||||
{plotted[0] && <path className="area" d={`${path(plotted[0])} L${x(n - 1)} ${H - B} L${x(0)} ${H - B} Z`} fill={`url(#lg${gid})`} />}
|
return (
|
||||||
{lines.map((l, k) => <path key={l.label} className={`ln ${l.cls}`} d={path(plotted[k]!)} />)}
|
<Group key={i} className="ev">
|
||||||
{hover !== null && <g className="hov"><line x1={x(hover)} x2={x(hover)} y1={T} y2={H - B} />{lines.map((l, k) => (plotted[k]![hover] === null ? null : <circle key={l.label} className={l.cls} cx={x(hover)} cy={y(plotted[k]![hover]!)} r={3.5} />))}</g>}
|
<Line from={{ x: x(k), y: M.top }} to={{ x: x(k), y: height - M.bottom }} />
|
||||||
<text className="ax" x={L} y={H - 6}>{date(dates[0])}</text>
|
<Circle cx={x(k)} cy={M.top + 4} r={4}><title>{`${date(e.date)} · ${e.subject}`}</title></Circle>
|
||||||
<text className="ax" x={W - R} y={H - 6} textAnchor="end">{date(dates[n - 1])}</text>
|
</Group>
|
||||||
</svg>
|
);
|
||||||
|
})}
|
||||||
|
{plotted[0] && <AreaClosed data={pts(plotted[0])} defined={defined} x={d => x(d[0])} y={d => y(d[1] ?? 0)} yScale={y} curve={curveMonotoneX} fill={`url(#${gid})`} className="area" />}
|
||||||
|
{lines.map((l, k) => <LinePath key={l.label} className={`ln ${l.cls}`} data={pts(plotted[k]!)} defined={defined} x={d => x(d[0])} y={d => y(d[1] ?? 0)} curve={curveMonotoneX} />)}
|
||||||
|
{hv !== null && (
|
||||||
|
<Group className="hov">
|
||||||
|
<Line from={{ x: x(hv), y: M.top }} to={{ x: x(hv), y: height - M.bottom }} />
|
||||||
|
{lines.map((l, k) => (plotted[k]![hv] === null ? null : <Circle key={l.label} className={l.cls} cx={x(hv)} cy={y(plotted[k]![hv]!)} r={3.5} />))}
|
||||||
|
</Group>
|
||||||
|
)}
|
||||||
|
<Bar x={M.left} y={M.top} width={Math.max(0, width - M.left - M.right)} height={height - M.top - M.bottom} fill="transparent" />
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
{hv !== null && width > 0 && (
|
||||||
|
<ChartTip left={x(hv)} top={h.tooltipTop ?? M.top}>
|
||||||
|
<b>{date(dates[hv])}</b>
|
||||||
|
{lines.map(l => <span key={l.label} className="vx-row"><i className={`sw ${l.cls}`} />{l.label}<b className="num">{fmt(l, l.values[hv] ?? null)}</b></span>)}
|
||||||
|
{onDay(hv).map((e, i) => <span key={i} className="vx-row ev"><i className="sw ev" />{e.subject}</span>)}
|
||||||
|
</ChartTip>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<div className="lchart-legend" aria-live="polite">
|
<div className="lchart-legend" aria-live="polite">
|
||||||
<span className="lg idx">{indexLabel}</span>
|
<span className="lg idx">{indexLabel}</span>
|
||||||
{hover !== null && <b className="num">{date(dates[hover])}</b>}
|
{hv !== null && <b className="num">{date(dates[hv])}</b>}
|
||||||
{lines.map(l => <span key={l.label} className="lg"><span className={`sw ${l.cls}`} />{l.label}{hover !== null && <b className="num">{fmt(l, l.values[hover] ?? null)}</b>}</span>)}
|
{lines.map(l => <span key={l.label} className="lg"><span className={`sw ${l.cls}`} />{l.label}{hv !== null && <b className="num">{fmt(l, l.values[hv] ?? null)}</b>}</span>)}
|
||||||
{events.length > 0 && <span className="lg"><span className="sw ev" />{eventsLabel}</span>}
|
{events.length > 0 && <span className="lg"><span className="sw ev" />{eventsLabel}</span>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
16
apps/desktop/src/ui/brand.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// The storebound brand mark (an arrow out of a tray, like site/favicon.svg). A brand asset, kept as the owner made it:
|
||||||
|
// the one file in apps/desktop/src where the CI guard (tests/no-handmade-svg.test.ts) allows inline SVG.
|
||||||
|
export function Mark({ className }: { className?: string }) {
|
||||||
|
return (
|
||||||
|
<svg viewBox="0 0 32 32" className={className} aria-hidden="true">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="sb-mark" x1="0" y1="0" x2="1" y2="1">
|
||||||
|
<stop offset="0" stopColor="#6d67f0" />
|
||||||
|
<stop offset="1" stopColor="#4338ca" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#sb-mark)" />
|
||||||
|
<path d="M16 7.5v11M11 12.5l5-5 5 5M8.5 18v5.5h15V18" fill="none" stroke="#fff" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
99
apps/desktop/src/ui/charts.tsx
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
// Small charts drawn with visx (@visx/*, MIT): scales, shapes, curves, gradients, responsive sizing and tooltips come
|
||||||
|
// from the library; this file only maps data to them. Colours are the design tokens (styles.css .spark, .rbar,
|
||||||
|
// .vx-tip). Nothing animates, so reduced motion needs no extra case.
|
||||||
|
import { localPoint } from '@visx/event';
|
||||||
|
import { curveMonotoneX } from '@visx/curve';
|
||||||
|
import { LinearGradient } from '@visx/gradient';
|
||||||
|
import { useParentSize } from '@visx/responsive';
|
||||||
|
import { scaleLinear } from '@visx/scale';
|
||||||
|
import { Group } from '@visx/group';
|
||||||
|
import { AreaClosed, Bar, Circle, Line, LinePath } from '@visx/shape';
|
||||||
|
import { TooltipWithBounds, useTooltip } from '@visx/tooltip';
|
||||||
|
import { type KeyboardEvent, type PointerEvent, type ReactNode, useId } from 'react';
|
||||||
|
import { date, pct } from '../lib/format';
|
||||||
|
import type { Tone } from '../lib/model';
|
||||||
|
|
||||||
|
/** A hovered (or keyboard-picked) index along x, with pointer and arrow-key handlers for an svg of `width`. */
|
||||||
|
export function useIndexHover(n: number, width: number, left: number, right: number) {
|
||||||
|
const tip = useTooltip<number>();
|
||||||
|
const at = (i: number, top = 0) => tip.showTooltip({ tooltipData: i, tooltipLeft: left + (n < 2 ? 0 : (i / (n - 1)) * (width - left - right)), tooltipTop: top });
|
||||||
|
const onPointerMove = (ev: PointerEvent<SVGElement>) => {
|
||||||
|
const p = localPoint(ev);
|
||||||
|
if (!p || n < 1) return;
|
||||||
|
const span = Math.max(1, width - left - right);
|
||||||
|
at(Math.max(0, Math.min(n - 1, Math.round(((p.x - left) / span) * (n - 1)))), p.y);
|
||||||
|
};
|
||||||
|
const onKeyDown = (ev: KeyboardEvent) => {
|
||||||
|
const cur = tip.tooltipOpen ? tip.tooltipData ?? null : null;
|
||||||
|
if (ev.key === 'ArrowRight') { ev.preventDefault(); at(Math.min(n - 1, (cur ?? -1) + 1), 12); }
|
||||||
|
if (ev.key === 'ArrowLeft') { ev.preventDefault(); at(Math.max(0, (cur ?? n) - 1), 12); }
|
||||||
|
if (ev.key === 'Escape') tip.hideTooltip();
|
||||||
|
};
|
||||||
|
return { ...tip, hover: tip.tooltipOpen ? tip.tooltipData ?? null : null, handlers: { onPointerMove, onPointerLeave: tip.hideTooltip, onKeyDown, onBlur: tip.hideTooltip } };
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The chart tooltip: visx positions it inside the chart's box (flips at the edges); styles.css .vx-tip draws it. */
|
||||||
|
export function ChartTip({ left, top, children }: { left: number; top: number; children: ReactNode }) {
|
||||||
|
return <TooltipWithBounds left={left + 12} top={top + 8} unstyled applyPositionStyle className="vx-tip">{children}</TooltipWithBounds>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Daily rate (crash, ANR) as a line + area with a dashed threshold. The y range always shows the threshold. With
|
||||||
|
* `dates` the chart has a crosshair and a one-line tooltip with the day's real value (the threshold is in the card's
|
||||||
|
* legend); `compact` (portfolio rows) has none. */
|
||||||
|
export function Sparkline({ values, dates, threshold, tone = 'neutral', label, compact }: {
|
||||||
|
values: number[]; dates?: string[]; threshold?: number; tone?: Tone; label: string; compact?: boolean;
|
||||||
|
}) {
|
||||||
|
const { parentRef, width, height } = useParentSize({ debounceTime: 50 });
|
||||||
|
const gid = `sg${useId().replace(/:/g, '')}`;
|
||||||
|
const interactive = !compact && !!dates && dates.length === values.length;
|
||||||
|
const pad = compact ? 2 : 4;
|
||||||
|
const h = hover(useIndexHover(values.length, width, 0, 0), interactive);
|
||||||
|
if (!values.length) return <div className={`spark ${tone}`} />;
|
||||||
|
const max = Math.max(...values, (threshold ?? 0) * 1.25) * 1.08 || 1;
|
||||||
|
const x = scaleLinear({ domain: [0, Math.max(1, values.length - 1)], range: values.length === 1 ? [width / 2, width / 2] : [0, width] });
|
||||||
|
const y = scaleLinear({ domain: [0, max], range: [height - pad, pad] });
|
||||||
|
const pts = values.map((v, i) => [i, v] as const);
|
||||||
|
return (
|
||||||
|
<div ref={parentRef} className={`spark ${tone}${compact ? ' compact' : ''}`}>
|
||||||
|
{width > 0 && height > 0 && (
|
||||||
|
<svg width={width} height={height} role="img" aria-label={label} tabIndex={interactive ? 0 : undefined} {...(interactive ? h.handlers : {})}>
|
||||||
|
<LinearGradient id={gid} from="var(--spark)" to="var(--spark)" fromOpacity={0.28} toOpacity={0} vertical />
|
||||||
|
<AreaClosed data={pts} x={d => x(d[0])} y={d => y(d[1])} yScale={y} curve={curveMonotoneX} fill={`url(#${gid})`} className="area" />
|
||||||
|
{threshold !== undefined && <Line className="thr" from={{ x: 0, y: y(threshold) }} to={{ x: width, y: y(threshold) }} />}
|
||||||
|
<LinePath data={pts} x={d => x(d[0])} y={d => y(d[1])} curve={curveMonotoneX} className="line" />
|
||||||
|
{h.hover !== null && (
|
||||||
|
<Group className="hov">
|
||||||
|
<Line from={{ x: x(h.hover), y: 0 }} to={{ x: x(h.hover), y: height }} />
|
||||||
|
<Circle cx={x(h.hover)} cy={y(values[h.hover]!)} r={3.5} />
|
||||||
|
</Group>
|
||||||
|
)}
|
||||||
|
{interactive && <Bar x={0} y={0} width={width} height={height} fill="transparent" />}
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
{h.hover !== null && dates && (
|
||||||
|
<ChartTip left={x(h.hover)} top={y(values[h.hover]!)}>
|
||||||
|
<span className="vx-row"><i className={`sw ${tone}`} />{date(dates[h.hover])}<b className="num">{pct(values[h.hover]!)}</b></span>
|
||||||
|
</ChartTip>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const hover = (h: ReturnType<typeof useIndexHover>, on: boolean) => (on ? h : { ...h, hover: null });
|
||||||
|
|
||||||
|
/** Staged rollout (Play) or phased release (App Store) share as a visx bar on a track, with the meter semantics. */
|
||||||
|
export function RolloutBar({ value, tone = 'accent', label }: { value: number; tone?: Tone; label: string }) {
|
||||||
|
const { parentRef, width, height } = useParentSize({ debounceTime: 50 });
|
||||||
|
const v = Math.max(0, Math.min(1, value));
|
||||||
|
const x = scaleLinear({ domain: [0, 1], range: [0, width] });
|
||||||
|
return (
|
||||||
|
<div ref={parentRef} className={`rbar ${tone}`} role="meter" aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(v * 100)} aria-label={label}>
|
||||||
|
{width > 0 && height > 0 && (
|
||||||
|
<svg width={width} height={height} aria-hidden="true">
|
||||||
|
<Bar className="track" x={0} y={0} width={width} height={height} rx={height / 2} />
|
||||||
|
{v > 0 && <Bar className="fill" x={0} y={0} width={Math.max(height, x(v))} height={height} rx={height / 2} />}
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,114 +1,44 @@
|
||||||
// One stroke icon set (24 x 24 grid, 1.75 stroke, round caps), drawn for this app. Decorative: aria-hidden.
|
// Icons come from lucide (lucide-react, ISC licence, https://lucide.dev): one named import per icon so Vite
|
||||||
const P = {
|
// tree-shakes the rest. The names below are the app's own (call sites use <Icon name="..." />); each maps to its
|
||||||
portfolio: 'M4 4h6.5v6.5H4zM13.5 4H20v6.5h-6.5zM4 13.5h6.5V20H4zM13.5 13.5H20V20h-6.5z',
|
// closest lucide icon. Decorative unless a title is given. No hand-drawn SVG in the app: see docs/desktop.md.
|
||||||
folder: 'M3.5 7A1.5 1.5 0 0 1 5 5.5h4l2 2h8A1.5 1.5 0 0 1 20.5 9v8.5A1.5 1.5 0 0 1 19 19H5a1.5 1.5 0 0 1-1.5-1.5z',
|
import {
|
||||||
folderPlus: 'M3.5 7A1.5 1.5 0 0 1 5 5.5h4l2 2h8A1.5 1.5 0 0 1 20.5 9v8.5A1.5 1.5 0 0 1 19 19H5a1.5 1.5 0 0 1-1.5-1.5zM12 10.5v5M9.5 13h5',
|
Activity, Apple, ArrowLeft, ArrowRight, Bell, Box, Building2, Check, ChevronDown, ChevronRight, CircleAlert, CircleHelp,
|
||||||
key: 'M8 20a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9zM11.2 12.3 20 3.5M16.5 7l2.5 2.5M14.2 9.3l2 2',
|
ClipboardCheck, Clock, Cloud, Coins, Command, Copy, Database, Dot, Download, ExternalLink, Eye, EyeOff, FileText,
|
||||||
package: 'M12 3 20 7.5v9L12 21l-8-4.5v-9zM4 7.5l8 4.5 8-4.5M12 12v9',
|
FlaskConical, Folder, FolderPlus, Funnel, Globe, Grid3x2, Image, Info, Key, Keyboard, Layers, LayoutGrid, Link, Lock,
|
||||||
settings: 'M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4zM19.1 13.6l1.4 1.1-1.8 3.1-1.7-.6a7 7 0 0 1-1.9 1.1l-.3 1.8h-3.6l-.3-1.8a7 7 0 0 1-1.9-1.1l-1.7.6-1.8-3.1 1.4-1.1a7 7 0 0 1 0-2.2L3.5 9.3l1.8-3.1 1.7.6A7 7 0 0 1 8.9 5.7l.3-1.8h3.6l.3 1.8a7 7 0 0 1 1.9 1.1l1.7-.6 1.8 3.1-1.4 1.1a7 7 0 0 1 0 2.2z',
|
type LucideIcon, MessageSquare, Moon, Package, Pause, Pencil, Play, Plus, RefreshCw, Rocket, RotateCcw, Search, Send,
|
||||||
search: 'M10.5 17a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13zM15.3 15.3 20 20',
|
SendHorizontal, Settings, Share, ShieldCheck, SlidersHorizontal, Smartphone, Sparkles, SquareTerminal, Star, Sun, Tag,
|
||||||
refresh: 'M20 11a8 8 0 0 0-14.3-4.9L4 8M4 4v4h4M4 13a8 8 0 0 0 14.3 4.9L20 16M20 20v-4h-4',
|
Trash2, TrendingUp, TriangleAlert, Unlink, Upload, Users, WandSparkles, X,
|
||||||
chevronRight: 'M9.5 6l6 6-6 6',
|
} from 'lucide-react';
|
||||||
chevronDown: 'M6 9.5l6 6 6-6',
|
|
||||||
plus: 'M12 5v14M5 12h14',
|
|
||||||
x: 'M6 6l12 12M18 6 6 18',
|
|
||||||
check: 'M5 12.5l4.5 4.5L19 7.5',
|
|
||||||
alert: 'M12 4 21 19.5H3zM12 10v4.5M12 17.2v.1',
|
|
||||||
alertCircle: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7.5v5.5M12 16.3v.1',
|
|
||||||
info: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v5.5M12 7.7v.1',
|
|
||||||
external: 'M14 4h6v6M20 4l-8.5 8.5M18 14v4.5A1.5 1.5 0 0 1 16.5 20h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10',
|
|
||||||
download: 'M12 4v11M7.5 10.5 12 15l4.5-4.5M4.5 19.5h15',
|
|
||||||
trash: 'M4.5 7h15M9.5 7V4.5h5V7M6.5 7l1 12.5h9l1-12.5M10.5 11v5M13.5 11v5',
|
|
||||||
star: 'M12 3.8l2.5 5.1 5.6.8-4 4 1 5.5-5.1-2.7-5 2.7 1-5.5-4.1-4 5.7-.8z',
|
|
||||||
message: 'M5 5.5h14A1.5 1.5 0 0 1 20.5 7v9a1.5 1.5 0 0 1-1.5 1.5h-7l-4.5 3v-3H5A1.5 1.5 0 0 1 3.5 16V7A1.5 1.5 0 0 1 5 5.5z',
|
|
||||||
activity: 'M3.5 12h4l2.5-6.5 4 13 2.5-6.5h4',
|
|
||||||
tag: 'M3.5 12.3V4.5a1 1 0 0 1 1-1h7.8l8.2 8.2a1.4 1.4 0 0 1 0 2L13.7 20.5a1.4 1.4 0 0 1-2 0zM8 8.2v.1',
|
|
||||||
text: 'M6 3.5h8.5L19 8v12.5H6zM14 3.5V8.5h5M9 12.5h7M9 16h5',
|
|
||||||
plane: 'M21 3.5 10.5 14M21 3.5l-6.5 17-4-6.5-6.5-4z',
|
|
||||||
rocket: 'M14 4.5c3-1 5.5-1 5.5-1s0 2.5-1 5.5L12 15.5 8.5 12zM8.5 12l-3 .5-2 2 4 1M12 15.5l-.5 3-2 2-1-4M15.5 8.5v.1',
|
|
||||||
shield: 'M12 3.5 19 6v5.5c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6zM8.8 12l2.2 2.2 4.4-4.4',
|
|
||||||
clock: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3.5 2',
|
|
||||||
command: 'M9 6.5A2.5 2.5 0 1 0 6.5 9H9zm0 0v11m0-11h6m-6 11a2.5 2.5 0 1 1-2.5-2.5H9zm6-11A2.5 2.5 0 1 1 17.5 9H15zm0 0v11m0 0a2.5 2.5 0 1 0 2.5-2.5H15zM9 9h6M9 15h6',
|
|
||||||
globe: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3.5 12h17M12 3c2.5 2.5 3.5 5.5 3.5 9s-1 6.5-3.5 9c-2.5-2.5-3.5-5.5-3.5-9S9.5 5.5 12 3z',
|
|
||||||
moon: 'M19.5 14.5A7.5 7.5 0 0 1 9.5 4.5a7.5 7.5 0 1 0 10 10z',
|
|
||||||
sun: 'M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M4.6 4.6l1.4 1.4M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4',
|
|
||||||
terminal: 'M4.5 5h15A1.5 1.5 0 0 1 21 6.5v11a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5v-11A1.5 1.5 0 0 1 4.5 5zM7 9.5l3 2.5-3 2.5M12.5 15h4',
|
|
||||||
copy: 'M9 9h10.5v10.5H9zM15 9V4.5H4.5V15H9',
|
|
||||||
image: 'M5 4.5h14A1.5 1.5 0 0 1 20.5 6v12a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 18V6A1.5 1.5 0 0 1 5 4.5zM3.5 16l5-5 4 4 2.5-2.5 5.5 5.5M15.5 9.5v.1',
|
|
||||||
users: 'M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.3a3.5 3.5 0 0 1 0 6.4M18 14a6.5 6.5 0 0 1 3.5 6',
|
|
||||||
layers: 'M12 3.5 21 8l-9 4.5L3 8zM3 12.5l9 4.5 9-4.5M3 16.5l9 4.5 9-4.5',
|
|
||||||
sparkle: 'M12 3.5c.6 4 2.4 5.9 6.5 6.5-4.1.6-5.9 2.5-6.5 6.5-.6-4-2.4-5.9-6.5-6.5 4.1-.6 5.9-2.5 6.5-6.5zM18.5 15.5c.3 1.6 1 2.3 2.5 2.5-1.5.2-2.2.9-2.5 2.5-.3-1.6-1-2.3-2.5-2.5 1.5-.2 2.2-.9 2.5-2.5z',
|
|
||||||
pause: 'M8.5 5.5v13M15.5 5.5v13',
|
|
||||||
cube: 'M12 3.5 20 8v8l-8 4.5L4 16V8zM12 12.5V20.5M12 12.5 20 8M12 12.5 4 8',
|
|
||||||
arrowRight: 'M5 12h14M13 6l6 6-6 6',
|
|
||||||
arrowLeft: 'M19 12H5M11 6l-6 6 6 6',
|
|
||||||
dot: 'M12 12.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1z',
|
|
||||||
phone: 'M7.5 3h9A1.5 1.5 0 0 1 18 4.5v15a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 6 19.5v-15A1.5 1.5 0 0 1 7.5 3zM10.5 18h3',
|
|
||||||
keyboard: 'M3.5 6.5h17A1 1 0 0 1 21.5 7.5v9a1 1 0 0 1-1 1h-17a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM6.5 10h.1M10 10h.1M13.5 10h.1M17 10h.1M7.5 14h9',
|
|
||||||
database: 'M12 8c4.4 0 8-1.3 8-3s-3.6-3-8-3-8 1.3-8 3 3.6 3 8 3zM4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3',
|
|
||||||
wand: 'M14.5 6.5l3 3M4 20 17.5 6.5l-3-3L1 17zM19 2.5v3M20.5 4h-3M21 10v2M22 11h-2',
|
|
||||||
building: 'M4.5 20.5V5A1.5 1.5 0 0 1 6 3.5h7A1.5 1.5 0 0 1 14.5 5v15.5M14.5 9.5H18a1.5 1.5 0 0 1 1.5 1.5v9.5M3 20.5h18M8 7.5h3M8 11h3M8 14.5h3',
|
|
||||||
eye: 'M2.5 12c1-1.5 4.5-6 9.5-6s8.5 4.5 9.5 6c-1 1.5-4.5 6-9.5 6s-8.5-4.5-9.5-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z',
|
|
||||||
eyeOff: 'M3 3l18 18M10.6 6.1c.5-.1.9-.1 1.4-.1 5 0 8.5 4.5 9.5 6-.5.8-1.6 2.3-3.2 3.6M6.4 7.9C4.7 9.2 3.5 10.9 2.5 12c1 1.5 4.5 6 9.5 6 1.5 0 2.9-.4 4.1-1M9.9 9.9a3 3 0 0 0 4.2 4.2',
|
|
||||||
link: 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1',
|
|
||||||
unlink: 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1M4 4l16 16',
|
|
||||||
bell: 'M6 16.5V11a6 6 0 1 1 12 0v5.5l1.5 2h-15zM10 20.5a2 2 0 0 0 4 0',
|
|
||||||
filter: 'M4 5.5h16l-6 7.5v5.5l-4 1.5v-7z',
|
|
||||||
play: 'M8 5.5v13l10.5-6.5z',
|
|
||||||
send: 'M4 11.5 20 4l-6 16-3-6.5zM11 13.5 20 4',
|
|
||||||
edit: 'M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4',
|
|
||||||
upload: 'M12 20V9M7.5 13.5 12 9l4.5 4.5M4.5 4.5h15',
|
|
||||||
sliders: 'M4 6.5h9M17 6.5h3M4 12h3M11 12h9M4 17.5h11M19 17.5h1M15 4.5v4M9 10v4M17 15.5v4',
|
|
||||||
rotate: 'M4 12a8 8 0 1 0 2.4-5.7L4 8.5M4 4v4.5h4.5',
|
|
||||||
cloud: 'M7 18.5h10.5a4 4 0 0 0 .6-8 6 6 0 0 0-11.6 1.6A3.3 3.3 0 0 0 7 18.5z',
|
|
||||||
coins: 'M9 10c3.3 0 6-1.1 6-2.5S12.3 5 9 5 3 6.1 3 7.5 5.7 10 9 10zM3 7.5v4C3 12.9 5.7 14 9 14s6-1.1 6-2.5v-4M9 18c3.3 0 6-1.1 6-2.5v-4M3 11.5v4C3 16.9 5.7 18 9 18M15.5 10.2c3 .2 5.5 1.2 5.5 2.3v4c0 1.4-2.7 2.5-6 2.5-1.3 0-2.5-.2-3.5-.5',
|
|
||||||
chart: 'M4 19.5h16M6.5 16l4-5 3 3 5-7M15.5 7h3v3',
|
|
||||||
flask: 'M9.5 3.5h5M10.5 3.5v5.2L5 18.2a1.5 1.5 0 0 0 1.3 2.3h11.4a1.5 1.5 0 0 0 1.3-2.3l-5.5-9.5V3.5M7.5 14.5h9',
|
|
||||||
grid: 'M4 4h4.5v6H4zM9.75 4h4.5v6h-4.5zM15.5 4H20v6h-4.5zM4 14h4.5v6H4zM9.75 14h4.5v6h-4.5zM15.5 14H20v6h-4.5z',
|
|
||||||
clipboard: 'M9 4.5H6.5A1.5 1.5 0 0 0 5 6v13.5A1.5 1.5 0 0 0 6.5 21h11a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H15M9 3h6v3H9zM8.5 11.5l2 2 4-4M8.5 17h7',
|
|
||||||
share: 'M12 15V3.5M7.5 8 12 3.5 16.5 8M5 12.5v6A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5v-6',
|
|
||||||
lock: 'M6.5 10.5h11A1.5 1.5 0 0 1 19 12v7a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 19v-7a1.5 1.5 0 0 1 1.5-1.5zM8.5 10.5V7.5a3.5 3.5 0 0 1 7 0v3',
|
|
||||||
question: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9.6 9.3a2.5 2.5 0 0 1 4.8.9c0 1.7-2.4 2.2-2.4 3.8M12 17v.1',
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export type IconName = keyof typeof P;
|
const ICONS = {
|
||||||
|
portfolio: LayoutGrid, folder: Folder, folderPlus: FolderPlus, key: Key, package: Package, settings: Settings,
|
||||||
|
search: Search, refresh: RefreshCw, chevronRight: ChevronRight, chevronDown: ChevronDown, plus: Plus, x: X, check: Check,
|
||||||
|
alert: TriangleAlert, alertCircle: CircleAlert, info: Info, external: ExternalLink, download: Download, trash: Trash2,
|
||||||
|
star: Star, message: MessageSquare, activity: Activity, tag: Tag, text: FileText, plane: Send, rocket: Rocket,
|
||||||
|
shield: ShieldCheck, clock: Clock, command: Command, globe: Globe, moon: Moon, sun: Sun, terminal: SquareTerminal,
|
||||||
|
copy: Copy, image: Image, users: Users, layers: Layers, sparkle: Sparkles, pause: Pause, cube: Box,
|
||||||
|
arrowRight: ArrowRight, arrowLeft: ArrowLeft, dot: Dot, phone: Smartphone, keyboard: Keyboard, database: Database,
|
||||||
|
wand: WandSparkles, building: Building2, eye: Eye, eyeOff: EyeOff, link: Link, unlink: Unlink, bell: Bell,
|
||||||
|
filter: Funnel, play: Play, send: SendHorizontal, edit: Pencil, upload: Upload, sliders: SlidersHorizontal,
|
||||||
|
rotate: RotateCcw, cloud: Cloud, coins: Coins, chart: TrendingUp, flask: FlaskConical, grid: Grid3x2,
|
||||||
|
clipboard: ClipboardCheck, share: Share, lock: Lock, question: CircleHelp,
|
||||||
|
} satisfies Record<string, LucideIcon>;
|
||||||
|
|
||||||
|
export type IconName = keyof typeof ICONS;
|
||||||
|
|
||||||
export function Icon({ name, className, title }: { name: IconName; className?: string; title?: string }) {
|
export function Icon({ name, className, title }: { name: IconName; className?: string; title?: string }) {
|
||||||
return (
|
const C = ICONS[name];
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" className={className} aria-hidden={title ? undefined : true} role={title ? 'img' : undefined}>
|
return title
|
||||||
{title && <title>{title}</title>}
|
? <C className={className} strokeWidth={1.75} role="img" aria-label={title}><title>{title}</title></C>
|
||||||
<path d={P[name]} />
|
: <C className={className} strokeWidth={1.75} aria-hidden="true" />;
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generic store glyphs (not the stores' logos): a rounded "A" tile for the App Store, a play triangle for Google Play. */
|
/** Store marks without the stores' logos (Apple publishes no licence for its App Store icon in third-party tools, and
|
||||||
|
* Google's Play guidelines cover badges): lucide's generic apple (a fruit, not Apple's logo) for the App Store and
|
||||||
|
* lucide's play triangle for Google Play. Text next to them always names the store. */
|
||||||
export function StoreGlyph({ store, className }: { store: 'ios' | 'android'; className?: string }) {
|
export function StoreGlyph({ store, className }: { store: 'ios' | 'android'; className?: string }) {
|
||||||
return store === 'ios' ? (
|
const C = store === 'ios' ? Apple : Play;
|
||||||
<svg viewBox="0 0 24 24" className={className} aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
|
return <C className={className} strokeWidth={1.75} aria-hidden="true" />;
|
||||||
<rect x="3" y="3" width="18" height="18" rx="5" />
|
|
||||||
<path d="M9 16.5 12.6 7.5M15 16.5l-2.2-5.4M8 13.5h8" />
|
|
||||||
</svg>
|
|
||||||
) : (
|
|
||||||
<svg viewBox="0 0 24 24" className={className} aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinejoin="round">
|
|
||||||
<path d="M6 3.8v16.4a.8.8 0 0 0 1.2.7l13.6-8.2a.8.8 0 0 0 0-1.4L7.2 3.1A.8.8 0 0 0 6 3.8z" />
|
|
||||||
<path d="M6.3 3.4 14.5 12l-8.2 8.6" strokeLinecap="round" />
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The storebound mark (an arrow out of a tray, like the site's favicon). */
|
export { Mark } from './brand';
|
||||||
export function Mark({ className }: { className?: string }) {
|
|
||||||
return (
|
|
||||||
<svg viewBox="0 0 32 32" className={className} aria-hidden="true">
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="sb-mark" x1="0" y1="0" x2="1" y2="1">
|
|
||||||
<stop offset="0" stopColor="#6d67f0" />
|
|
||||||
<stop offset="1" stopColor="#4338ca" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<rect width="32" height="32" rx="8" fill="url(#sb-mark)" />
|
|
||||||
<path d="M16 7.5v11M11 12.5l5-5 5 5M8.5 18v5.5h15V18" fill="none" stroke="#fff" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" />
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,103 +1,34 @@
|
||||||
// Empty state illustrations: inline SVG in the theme's tokens (no external assets, both themes). Decorative.
|
// Empty state art: a lucide icon (lucide-react, ISC) on a soft tile with an optional small badge icon, in the theme's
|
||||||
import type { ReactNode } from 'react';
|
// tokens (styles.css .illo), the empty-state style of Linear and Vercel. No drawn artwork. Decorative.
|
||||||
const Frame = ({ children }: { children: ReactNode }) => (
|
import {
|
||||||
<svg className="illo" viewBox="0 0 168 112" aria-hidden="true" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
Activity, Box, CircleHelp, CloudDownload, FileText, KeyRound, type LucideIcon, MessageSquareText, Package, Plus, Send,
|
||||||
<ellipse cx="84" cy="100" rx="58" ry="6" className="f1" />
|
ShieldCheck, Smartphone, Star, Check, Wrench,
|
||||||
{children}
|
} from 'lucide-react';
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
|
|
||||||
export type IlloName = 'apps' | 'cloud' | 'reviews' | 'shield' | 'key' | 'plane' | 'pulse' | 'catalog' | 'text' | 'tools' | 'unknown';
|
export type IlloName = 'apps' | 'cloud' | 'reviews' | 'shield' | 'key' | 'plane' | 'pulse' | 'catalog' | 'text' | 'tools' | 'unknown';
|
||||||
|
|
||||||
|
const ART: Record<IlloName, [LucideIcon, LucideIcon?]> = {
|
||||||
|
apps: [Smartphone, Plus],
|
||||||
|
cloud: [CloudDownload],
|
||||||
|
reviews: [MessageSquareText, Star],
|
||||||
|
shield: [ShieldCheck],
|
||||||
|
key: [KeyRound],
|
||||||
|
plane: [Send],
|
||||||
|
pulse: [Activity],
|
||||||
|
catalog: [Package, Check],
|
||||||
|
text: [FileText, Check],
|
||||||
|
tools: [Box, Wrench],
|
||||||
|
unknown: [CircleHelp],
|
||||||
|
};
|
||||||
|
|
||||||
export function Illo({ name }: { name: IlloName }) {
|
export function Illo({ name }: { name: IlloName }) {
|
||||||
switch (name) {
|
const [Main, Badge] = ART[name] ?? ART.unknown;
|
||||||
case 'apps': return (
|
return (
|
||||||
<Frame>
|
<div className="illo" aria-hidden="true" data-illo={name}>
|
||||||
<rect x="40" y="22" width="40" height="70" rx="9" className="f2" />
|
<span className="illo-tile">
|
||||||
<rect x="64" y="14" width="44" height="78" rx="10" className="fs s1" />
|
<Main strokeWidth={1.6} />
|
||||||
<rect x="72" y="26" width="28" height="28" rx="7" className="f1" />
|
{Badge && <span className="illo-badge"><Badge strokeWidth={2.4} /></span>}
|
||||||
<path d="M80 72h12M80 79h8" className="s2" />
|
</span>
|
||||||
<circle cx="118" cy="28" r="13" className="fl" />
|
</div>
|
||||||
<path d="M118 22v12M112 28h12" stroke="#fff" />
|
);
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'cloud': return (
|
|
||||||
<Frame>
|
|
||||||
<path d="M54 66a16 16 0 0 1 3-31.7A22 22 0 0 1 99 30a17 17 0 0 1 14 36z" className="f2" />
|
|
||||||
<path d="M60 62a14 14 0 0 1 2.6-27.7A19 19 0 0 1 98.5 32 15 15 0 0 1 110 62" className="s1" />
|
|
||||||
<path d="M84 50v32M75 73l9 9 9-9" className="s1" />
|
|
||||||
<path d="M60 92h48" className="s2" strokeDasharray="3 5" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'reviews': return (
|
|
||||||
<Frame>
|
|
||||||
<path d="M38 24h70a8 8 0 0 1 8 8v30a8 8 0 0 1-8 8H66l-14 12V70H38a8 8 0 0 1-8-8V32a8 8 0 0 1 8-8z" className="f2" />
|
|
||||||
<path d="M60 36h66a8 8 0 0 1 8 8v28a8 8 0 0 1-8 8h-12v12l-14-12H60a8 8 0 0 1-8-8V44a8 8 0 0 1 8-8z" className="fs s1" />
|
|
||||||
{[72, 86, 100, 114].map((x, i) => <path key={x} d={`M${x} 52l2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7z`} className={i < 3 ? 'fl' : 'f2'} strokeWidth="0" />)}
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'shield': return (
|
|
||||||
<Frame>
|
|
||||||
<path d="M84 12 116 24v26c0 22-14 36-32 44-18-8-32-22-32-44V24z" className="f2" />
|
|
||||||
<path d="M84 20 110 30v20c0 18-11 30-26 37-15-7-26-19-26-37V30z" className="fs s1" />
|
|
||||||
<path d="M71 52l9 9 18-18" className="s1" strokeWidth="3" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'key': return (
|
|
||||||
<Frame>
|
|
||||||
<rect x="34" y="30" width="100" height="58" rx="10" className="f2" />
|
|
||||||
<rect x="42" y="22" width="84" height="58" rx="10" className="fs s1" />
|
|
||||||
<circle cx="70" cy="51" r="11" className="s1" />
|
|
||||||
<path d="M81 51h30M103 51v8M111 51v6" className="s1" />
|
|
||||||
<path d="M54 70h20" className="s2" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'plane': return (
|
|
||||||
<Frame>
|
|
||||||
<path d="M30 80c20-6 44-6 64-22" className="s2" strokeDasharray="3 6" />
|
|
||||||
<path d="M136 18 58 50l28 10 10 28z" className="f2" />
|
|
||||||
<path d="M136 18 58 50l28 10 10 28zM136 18 86 60" className="s1" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'pulse': return (
|
|
||||||
<Frame>
|
|
||||||
<rect x="26" y="20" width="116" height="68" rx="12" className="f2" />
|
|
||||||
<rect x="34" y="14" width="100" height="68" rx="11" className="fs s1" />
|
|
||||||
<path d="M44 56h16l7-18 12 34 8-22 6 6h21" className="s1" strokeWidth="2.5" />
|
|
||||||
<path d="M44 40h80" className="s2" strokeDasharray="4 5" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'catalog': return (
|
|
||||||
<Frame>
|
|
||||||
<rect x="36" y="26" width="44" height="54" rx="9" className="f2" />
|
|
||||||
<rect x="88" y="26" width="44" height="54" rx="9" className="f2" />
|
|
||||||
<rect x="44" y="18" width="80" height="60" rx="10" className="fs s1" />
|
|
||||||
<path d="M56 36h14M56 48h14M56 60h14" className="s2" />
|
|
||||||
<path d="M86 34l4 4 7-7M86 46l4 4 7-7M86 58l4 4 7-7" className="s1" />
|
|
||||||
<path d="M106 34l8 0M106 46l8 0M106 58l8 0" className="s2" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'text': return (
|
|
||||||
<Frame>
|
|
||||||
<rect x="46" y="18" width="70" height="78" rx="9" className="f2" />
|
|
||||||
<rect x="54" y="10" width="70" height="78" rx="9" className="fs s1" />
|
|
||||||
<path d="M66 28h46M66 40h40M66 52h46M66 64h28" className="s2" />
|
|
||||||
<circle cx="122" cy="76" r="12" className="fl" />
|
|
||||||
<path d="M117 76l4 4 7-8" stroke="#fff" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
case 'tools': return (
|
|
||||||
<Frame>
|
|
||||||
<path d="M84 14 118 32v38L84 88 50 70V32z" className="f2" />
|
|
||||||
<path d="M84 22 112 37v31L84 83 56 68V37zM56 37l28 15 28-15M84 52v31" className="s1" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
default: return (
|
|
||||||
<Frame>
|
|
||||||
<circle cx="84" cy="52" r="34" className="f2" />
|
|
||||||
<circle cx="84" cy="52" r="26" className="s1" strokeDasharray="5 6" />
|
|
||||||
<path d="M76 45a8 8 0 1 1 11 7.5c-2 .8-3 2-3 4v2M84 66v.1" className="s1" strokeWidth="3" />
|
|
||||||
</Frame>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// Shared UI pieces of the design system (styles.css): chips, store badges, app icons, KPI tiles, bars, sparklines,
|
// Shared UI pieces of the design system (styles.css): chips, store badges, app icons, KPI tiles, bars, sparklines
|
||||||
// stars, notices, skeletons, empty states, segmented controls, cards.
|
// (visx, charts.tsx), stars (lucide), notices, skeletons, empty states, segmented controls, cards.
|
||||||
import { type ReactNode, useId } from 'react';
|
import { Star } from 'lucide-react';
|
||||||
|
import type { ReactNode } from 'react';
|
||||||
import type { ReleasePhase, StoreRelease } from '../api';
|
import type { ReleasePhase, StoreRelease } from '../api';
|
||||||
import { t } from '../i18n';
|
import { t } from '../i18n';
|
||||||
import { share } from '../lib/format';
|
import { share } from '../lib/format';
|
||||||
|
|
@ -75,32 +76,13 @@ export function Bar({ value, tone, thin, label }: { value: number; tone?: Tone;
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Line + area sparkline with a dashed threshold line. Values are fractions; the y range always shows the threshold. */
|
/** Crash / ANR sparkline (visx): see charts.tsx. */
|
||||||
export function Sparkline({ values, threshold, tone = 'neutral', label }: { values: number[]; threshold?: number; tone?: Tone; label: string }) {
|
export { Sparkline } from './charts';
|
||||||
const W = 300, H = 72, pad = 4;
|
|
||||||
const gid = useId().replace(/:/g, '');
|
|
||||||
if (!values.length) return <div className="spark" />;
|
|
||||||
const max = Math.max(...values, (threshold ?? 0) * 1.25) * 1.08 || 1;
|
|
||||||
const x = (i: number) => (values.length === 1 ? W / 2 : (i / (values.length - 1)) * W);
|
|
||||||
const y = (v: number) => H - pad - (v / max) * (H - pad * 2);
|
|
||||||
const line = values.map((v, i) => `${i ? 'L' : 'M'}${x(i).toFixed(1)} ${y(v).toFixed(1)}`).join(' ');
|
|
||||||
const area = `${line} L${W} ${H} L0 ${H} Z`;
|
|
||||||
return (
|
|
||||||
<svg className={`spark ${tone}`} viewBox={`0 0 ${W} ${H}`} preserveAspectRatio="none" role="img" aria-label={label}>
|
|
||||||
<defs><linearGradient id={`sg${gid}`} x1="0" y1="0" x2="0" y2="1"><stop offset="0" className="stop-a" /><stop offset="1" className="stop-b" /></linearGradient></defs>
|
|
||||||
<path className="area" d={area} fill={`url(#sg${gid})`} />
|
|
||||||
{threshold !== undefined && <line className="thr" x1="0" x2={W} y1={y(threshold)} y2={y(threshold)} />}
|
|
||||||
<path className="line" d={line} />
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Stars({ n, label }: { n: number; label?: string }) {
|
export function Stars({ n, label }: { n: number; label?: string }) {
|
||||||
return (
|
return (
|
||||||
<span className="stars" role="img" aria-label={label ?? t('reviews.starsAria', { count: n })}>
|
<span className="stars" role="img" aria-label={label ?? t('reviews.starsAria', { count: n })}>
|
||||||
{[1, 2, 3, 4, 5].map(i => (
|
{[1, 2, 3, 4, 5].map(i => <Star key={i} className={i <= n ? '' : 'off'} fill="currentColor" strokeWidth={0} aria-hidden="true" />)}
|
||||||
<svg key={i} viewBox="0 0 24 24" className={i <= n ? '' : 'off'} aria-hidden="true"><path fill="currentColor" d="M12 3.8l2.5 5.1 5.6.8-4 4 1 5.5-5.1-2.7-5 2.7 1-5.5-4.1-4 5.7-.8z" /></svg>
|
|
||||||
))}
|
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,10 @@ describe('webview rules', () => {
|
||||||
// only api.ts talks to the host
|
// only api.ts talks to the host
|
||||||
if (!f.endsWith('api.ts')) expect(s, f).not.toMatch(/@tauri-apps\/api/);
|
if (!f.endsWith('api.ts')) expect(s, f).not.toMatch(/@tauri-apps\/api/);
|
||||||
}
|
}
|
||||||
expect(JSON.parse(src('package.json')).dependencies).toEqual({ '@tauri-apps/api': expect.any(String), react: expect.any(String), 'react-dom': expect.any(String) });
|
// runtime deps: Tauri's API, React, and the chart (visx) and icon (lucide) libraries, all bundled by Vite
|
||||||
|
const deps = Object.keys(JSON.parse(src('package.json')).dependencies).sort();
|
||||||
|
expect(deps.filter(d => !d.startsWith('@visx/'))).toEqual(['@tauri-apps/api', 'lucide-react', 'react', 'react-dom']);
|
||||||
|
expect(deps.filter(d => d.startsWith('@visx/')).length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
test('the confirm token and credentials never appear in the webview code', () => {
|
test('the confirm token and credentials never appear in the webview code', () => {
|
||||||
for (const f of files('src')) expect(src(f), f).not.toMatch(/confirmToken|credentials|PLAY_SERVICE_ACCOUNT|ASC_P8/);
|
for (const f of files('src')) expect(src(f), f).not.toMatch(/confirmToken|credentials|PLAY_SERVICE_ACCOUNT|ASC_P8/);
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,19 @@ Types of the protocol: `cli/lib/desktop-protocol.ts`; pure portfolio logic: `cli
|
||||||
- **i18n**: English and Turkish (`src/i18n`), Settings picks the language (default: the system's); `tools/i18n-check.ts`
|
- **i18n**: English and Turkish (`src/i18n`), Settings picks the language (default: the system's); `tools/i18n-check.ts`
|
||||||
(CI) checks keys, empty messages and placeholders. **Theme**: text tokens keep 7:1 contrast in both themes
|
(CI) checks keys, empty messages and placeholders. **Theme**: text tokens keep 7:1 contrast in both themes
|
||||||
(`tests/theme.test.ts`), motion at most 200 ms and off with reduced motion.
|
(`tests/theme.test.ts`), motion at most 200 ms and off with reduced motion.
|
||||||
|
- **Charts, icons, art: libraries only, no hand-drawn SVG** (owner rule, guarded by `tests/no-handmade-svg.test.ts`).
|
||||||
|
Charts use visx (`@visx/*`, MIT; `src/ui/charts.tsx`, `src/ui/LineChart.tsx`): Growth's indexed lines with the 100
|
||||||
|
baseline, listing-change markers and a crosshair tooltip with the real values; Health's crash / ANR series against
|
||||||
|
the bad behavior threshold (crosshair + tooltip, arrow keys when focused); the portfolio's compact sparklines; the
|
||||||
|
rollout / phased release bar. Widths follow the container (`useParentSize`), colours are the theme tokens, nothing
|
||||||
|
animates. Icons are lucide (`lucide-react`, ISC), one named import each; `src/ui/icons.tsx` maps the app's icon names
|
||||||
|
to them. Store marks are generic lucide icons (an apple, a play triangle), not the stores' logos: simple-icons has
|
||||||
|
both logos (CC0 data), but Apple and Google restrict their marks, so that is an owner decision. Empty states
|
||||||
|
(`src/ui/illustrations.tsx`) are a lucide icon on a token-coloured tile with an optional badge icon, no artwork.
|
||||||
|
The fixtures' app icons and screenshot stand-ins are PNGs from `bun tools/fixture-art.ts` (lucide icons on CSS
|
||||||
|
gradients, photographed by Chromium). The brand mark (`src/ui/brand.tsx`, like `site/favicon.svg`) is the one
|
||||||
|
inline SVG left: a brand asset. Bundle cost: about +97 kB minified, +31 kB gzip (visx with d3-scale / d3-shape and
|
||||||
|
@visx/text for the axes, plus the lucide icons used).
|
||||||
|
|
||||||
## Studios, accounts and store-only apps (D3)
|
## Studios, accounts and store-only apps (D3)
|
||||||
|
|
||||||
|
|
|
||||||
72
docs/diagrams/journey.mmd
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
---
|
||||||
|
title: From zero to “Submit for review”
|
||||||
|
---
|
||||||
|
%% The journey diagram (docs/img/journey.svg, site/img/journey.svg and the tall site/img/journey-tall.svg for phones).
|
||||||
|
%% Edit this file, then run: bun tools/diagrams.ts (Mermaid CLI; the tall variant turns each row into a column)
|
||||||
|
flowchart TB
|
||||||
|
subgraph before["Google Play + App Store, one config, your AI agent"]
|
||||||
|
direction LR
|
||||||
|
s1["`**1 · Config**
|
||||||
|
storebound.config.ts
|
||||||
|
and store/*.md texts, one
|
||||||
|
section per language
|
||||||
|
LOCAL`"]:::local
|
||||||
|
s2["`**2 · App records**
|
||||||
|
bundle id registered;
|
||||||
|
Play app + App Store
|
||||||
|
Connect record created
|
||||||
|
API · UI`"]:::api
|
||||||
|
s3["`**3 · Products**
|
||||||
|
in-app purchases with
|
||||||
|
regional prices, review
|
||||||
|
screenshots, testers
|
||||||
|
API · UI`"]:::api
|
||||||
|
s4["`**4 · Listings**
|
||||||
|
name, subtitle, texts,
|
||||||
|
keywords, contact, in
|
||||||
|
every language
|
||||||
|
API`"]:::api
|
||||||
|
s5["`**5 · Questionnaires**
|
||||||
|
Data safety, age rating,
|
||||||
|
encryption · IARC, target
|
||||||
|
audience, App Privacy
|
||||||
|
API · UI`"]:::api
|
||||||
|
s1 --> s2 --> s3 --> s4 --> s5
|
||||||
|
end
|
||||||
|
subgraph ready["Store art, a last check, your own click"]
|
||||||
|
direction LR
|
||||||
|
s6["`**6 · Privacy & icons**
|
||||||
|
policy page, privacy
|
||||||
|
manifest scan, every
|
||||||
|
icon from one artwork
|
||||||
|
LOCAL`"]:::local
|
||||||
|
s7["`**7 · Store art**
|
||||||
|
screenshots, previews,
|
||||||
|
feature graphic: render,
|
||||||
|
check, upload
|
||||||
|
LOCAL · API`"]:::local
|
||||||
|
s8["`**8 · Validate**
|
||||||
|
offline check, then a
|
||||||
|
read-only store report:
|
||||||
|
blockers in fix order
|
||||||
|
API · LOCAL`"]:::api
|
||||||
|
s9["`**9 · You press Submit**
|
||||||
|
Play Console: Send changes for review
|
||||||
|
App Store Connect: Submit for Review
|
||||||
|
Releases and rollouts stay yours too
|
||||||
|
YOU`"]:::you
|
||||||
|
s6 --> s7 --> s8 --> s9
|
||||||
|
end
|
||||||
|
before --> ready
|
||||||
|
legend["`**API** a storebound command (also an MCP tool)
|
||||||
|
**UI** a skill walks your agent, or you, through the console
|
||||||
|
**LOCAL** runs on your machine
|
||||||
|
**YOU** your own click: storebound never presses Submit`"]:::legend
|
||||||
|
ready ~~~ legend
|
||||||
|
|
||||||
|
classDef local fill:#0c2a3f,stroke:#38bdf8,color:#e2e8f0,stroke-width:1.5px
|
||||||
|
classDef api fill:#1e1b4b,stroke:#818cf8,color:#e2e8f0,stroke-width:1.5px
|
||||||
|
classDef you fill:#052e1c,stroke:#4ade80,color:#f0fdf4,stroke-width:2px
|
||||||
|
classDef legend fill:#0f172a,stroke:#334155,color:#cbd5e1,stroke-dasharray:4 3
|
||||||
|
style before fill:#111a2e,stroke:#334155,color:#94a3b8
|
||||||
|
style ready fill:#111a2e,stroke:#334155,color:#94a3b8
|
||||||
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 42 KiB |
|
|
@ -70,9 +70,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@mermaid-js/mermaid-cli": "12.0.0",
|
||||||
"@types/bun": "1.3.0",
|
"@types/bun": "1.3.0",
|
||||||
|
"lucide-static": "1.55.0",
|
||||||
"playwright": "1.55.0",
|
"playwright": "1.55.0",
|
||||||
"playwright-core": "1.55.0",
|
"playwright-core": "1.55.0",
|
||||||
|
"simple-icons": "16.34.0",
|
||||||
"typescript": "5.9.3"
|
"typescript": "5.9.3"
|
||||||
},
|
},
|
||||||
"homepage": "https://git.crt.fyi/CRT/storebound",
|
"homepage": "https://git.crt.fyi/CRT/storebound",
|
||||||
|
|
|
||||||
46
site/img/icons/LICENSE.txt
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
Icons in this folder: Lucide 1.55.0 (https://lucide.dev), copied unchanged from the lucide-static
|
||||||
|
package by tools/site-icons.ts.
|
||||||
|
|
||||||
|
ISC License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Lucide Icons and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The following Lucide icons are derived from the Feather project:
|
||||||
|
|
||||||
|
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
||||||
|
|
||||||
|
The MIT License (MIT) (for the icons listed above)
|
||||||
|
|
||||||
|
Copyright (c) 2013-present Cole Bemis
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
18
site/img/icons/briefcase-business.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!-- @license lucide-static v1.55.0 - ISC -->
|
||||||
|
<svg
|
||||||
|
class="lucide lucide-briefcase-business"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M12 12h.01" />
|
||||||
|
<path d="M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2" />
|
||||||
|
<path d="M22 13a18.15 18.15 0 0 1-20 0" />
|
||||||
|
<rect width="20" height="14" x="2" y="6" rx="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 477 B |
15
site/img/icons/chevron-right.svg
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!-- @license lucide-static v1.55.0 - ISC -->
|
||||||
|
<svg
|
||||||
|
class="lucide lucide-chevron-right"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="m9 18 6-6-6-6" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 321 B |
18
site/img/icons/layout-grid.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!-- @license lucide-static v1.55.0 - ISC -->
|
||||||
|
<svg
|
||||||
|
class="lucide lucide-layout-grid"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<rect width="7" height="7" x="3" y="3" rx="1" />
|
||||||
|
<rect width="7" height="7" x="14" y="3" rx="1" />
|
||||||
|
<rect width="7" height="7" x="14" y="14" rx="1" />
|
||||||
|
<rect width="7" height="7" x="3" y="14" rx="1" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 498 B |
15
site/img/icons/play.svg
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!-- @license lucide-static v1.55.0 - ISC -->
|
||||||
|
<svg
|
||||||
|
class="lucide lucide-play"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 381 B |
16
site/img/icons/user-round.svg
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<!-- @license lucide-static v1.55.0 - ISC -->
|
||||||
|
<svg
|
||||||
|
class="lucide lucide-user-round"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<circle cx="12" cy="8" r="5" />
|
||||||
|
<path d="M20 21a8 8 0 0 0-16 0" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 360 B |
1
site/img/journey-tall.svg
Normal file
|
After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 42 KiB |
|
|
@ -23,7 +23,7 @@
|
||||||
<meta name="twitter:title" content="storebound · take your app or game from zero to Submit for review">
|
<meta name="twitter:title" content="storebound · take your app or game from zero to Submit for review">
|
||||||
<meta name="twitter:description" content="For mobile apps and games: app records, in-app products and subscriptions, listings in every language, every questionnaire, privacy, icons, screenshots. One config and your AI coding agent.">
|
<meta name="twitter:description" content="For mobile apps and games: app records, in-app products and subscriptions, listings in every language, every questionnaire, privacy, icons, screenshots. One config and your AI coding agent.">
|
||||||
<meta name="twitter:image" content="https://storebound.dev/og.png">
|
<meta name="twitter:image" content="https://storebound.dev/og.png">
|
||||||
<link rel="stylesheet" href="style.css?v=0ac6422">
|
<link rel="stylesheet" href="style.css?v=85dc546">
|
||||||
<script>document.documentElement.classList.add('js')</script>
|
<script>document.documentElement.classList.add('js')</script>
|
||||||
<script src="main.js?v=0ac6422" defer></script>
|
<script src="main.js?v=0ac6422" defer></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<h1>From zero to <span class="hl">Submit for review</span> on both app stores.</h1>
|
<h1>From zero to <span class="hl">Submit for review</span> on both app stores.</h1>
|
||||||
<p class="lede">Your AI coding agent sets up Google Play and the App Store for your app or game: records, products, listings, forms and store art. Dry runs first. <strong>The Submit click stays yours.</strong></p>
|
<p class="lede">Your AI coding agent sets up Google Play and the App Store for your app or game: records, products, listings, forms and store art. Dry runs first. <strong>The Submit click stays yours.</strong></p>
|
||||||
<div class="ctas">
|
<div class="ctas">
|
||||||
<a class="btn btn-primary" href="#start">Get started<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></a>
|
<a class="btn btn-primary" href="#start">Get started<span class="ic ic-chevron-right" aria-hidden="true"></span></a>
|
||||||
<a class="btn btn-ghost" href="#how">How it works</a>
|
<a class="btn btn-ghost" href="#how">How it works</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="install" role="group" aria-label="Install command">
|
<div class="install" role="group" aria-label="Install command">
|
||||||
|
|
@ -300,7 +300,7 @@
|
||||||
<li><code>.storebound/</code><span>your keys, gitignored</span></li>
|
<li><code>.storebound/</code><span>your keys, gitignored</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="pv-note">Needs <a href="https://bun.sh" target="_blank" rel="noopener">Bun<span class="ext" aria-hidden="true">↗</span><span class="sr-only"> (opens in a new tab)</span></a> 1.1+, plus <code>ffmpeg</code> for icons, screenshots and video.</p>
|
<p class="pv-note">Needs <a href="https://bun.sh" target="_blank" rel="noopener">Bun<span class="ext" aria-hidden="true">↗</span><span class="sr-only"> (opens in a new tab)</span></a> 1.1+, plus <code>ffmpeg</code> for icons, screenshots and video.</p>
|
||||||
<div class="st-foot" hidden><span>Step 1 of 5</span><button class="st-next" type="button" data-next="1">Next: Describe the app once<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div>
|
<div class="st-foot" hidden><span>Step 1 of 5</span><button class="st-next" type="button" data-next="1">Next: Describe the app once<span class="ic ic-chevron-right" aria-hidden="true"></span></button></div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
@ -327,7 +327,7 @@
|
||||||
<pre><code><span class="p">$</span> bunx storebound check</code></pre>
|
<pre><code><span class="p">$</span> bunx storebound check</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<p class="pv-note">Store text lives next to it in <code>store/listing.md</code> and <code>store/appstore.md</code>, one section per language.</p>
|
<p class="pv-note">Store text lives next to it in <code>store/listing.md</code> and <code>store/appstore.md</code>, one section per language.</p>
|
||||||
<div class="st-foot" hidden><span>Step 2 of 5</span><button class="st-next" type="button" data-next="2">Next: Add your store keys<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div>
|
<div class="st-foot" hidden><span>Step 2 of 5</span><button class="st-next" type="button" data-next="2">Next: Add your store keys<span class="ic ic-chevron-right" aria-hidden="true"></span></button></div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
@ -347,7 +347,7 @@
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<p class="pv-note">A Play service account and an App Store Connect API key. Env vars work too. Never your password, never committed.</p>
|
<p class="pv-note">A Play service account and an App Store Connect API key. Env vars work too. Never your password, never committed.</p>
|
||||||
<div class="st-foot" hidden><span>Step 3 of 5</span><button class="st-next" type="button" data-next="3">Next: Connect your agent, ask in plain words<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div>
|
<div class="st-foot" hidden><span>Step 3 of 5</span><button class="st-next" type="button" data-next="3">Next: Connect your agent, ask in plain words<span class="ic ic-chevron-right" aria-hidden="true"></span></button></div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
@ -367,7 +367,7 @@
|
||||||
<li><span>Make store screenshots in 14 languages</span><button class="copy" type="button" data-copy="Make store screenshots in 14 languages" aria-label="Copy prompt: Make store screenshots in 14 languages">Copy</button></li>
|
<li><span>Make store screenshots in 14 languages</span><button class="copy" type="button" data-copy="Make store screenshots in 14 languages" aria-label="Copy prompt: Make store screenshots in 14 languages">Copy</button></li>
|
||||||
<li><span>What still blocks my submission?</span><button class="copy" type="button" data-copy="What still blocks my submission?" aria-label="Copy prompt: What still blocks my submission?">Copy</button></li>
|
<li><span>What still blocks my submission?</span><button class="copy" type="button" data-copy="What still blocks my submission?" aria-label="Copy prompt: What still blocks my submission?">Copy</button></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="st-foot" hidden><span>Step 4 of 5</span><button class="st-next" type="button" data-next="4">Next: Zero blockers, then you submit<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div>
|
<div class="st-foot" hidden><span>Step 4 of 5</span><button class="st-next" type="button" data-next="4">Next: Zero blockers, then you submit<span class="ic ic-chevron-right" aria-hidden="true"></span></button></div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
@ -386,7 +386,7 @@
|
||||||
<li><b>Fix, run again, until zero</b><span>read-only, so it is safe to run as often as you like</span></li>
|
<li><b>Fix, run again, until zero</b><span>read-only, so it is safe to run as often as you like</span></li>
|
||||||
<li class="gate-you"><b>You press Submit for review</b><span>and Send changes for review on Play. Never the agent.</span></li>
|
<li class="gate-you"><b>You press Submit for review</b><span>and Send changes for review on Play. Never the agent.</span></li>
|
||||||
</ol>
|
</ol>
|
||||||
<div class="st-foot" hidden><span>Step 5 of 5</span><a class="st-next" href="#start">Set it up in five minutes<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></a></div>
|
<div class="st-foot" hidden><span>Step 5 of 5</span><a class="st-next" href="#start">Set it up in five minutes<span class="ic ic-chevron-right" aria-hidden="true"></span></a></div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
@ -395,15 +395,15 @@
|
||||||
<h3 class="for-h" id="who-h">Built for</h3>
|
<h3 class="for-h" id="who-h">Built for</h3>
|
||||||
<ul class="for-list" aria-labelledby="who-h">
|
<ul class="for-list" aria-labelledby="who-h">
|
||||||
<li>
|
<li>
|
||||||
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="8" r="3.5"/><path d="M5 20c.8-3.6 3.6-5.5 7-5.5s6.2 1.9 7 5.5"/></svg>
|
<span class="for-ic" aria-hidden="true"><span class="ic ic-user-round"></span></span>
|
||||||
<div><b>Indie developers</b><p>One app or a handful: the store chores without a week of console tabs.</p></div>
|
<div><b>Indie developers</b><p>One app or a handful: the store chores without a week of console tabs.</p></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="3.5" width="7" height="7" rx="1.5"/><rect x="13.5" y="3.5" width="7" height="7" rx="1.5"/><rect x="3.5" y="13.5" width="7" height="7" rx="1.5"/><rect x="13.5" y="13.5" width="7" height="7" rx="1.5"/></svg>
|
<span class="for-ic" aria-hidden="true"><span class="ic ic-layout-grid"></span></span>
|
||||||
<div><b>Studios shipping many titles</b><p>One config per title, the same checks and store art pipeline every time.</p></div>
|
<div><b>Studios shipping many titles</b><p>One config per title, the same checks and store art pipeline every time.</p></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="7.5" width="17" height="12" rx="2"/><path d="M9 7.5V6a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1.5M3.5 13h17"/></svg>
|
<span class="for-ic" aria-hidden="true"><span class="ic ic-briefcase-business"></span></span>
|
||||||
<div><b>Agencies</b><p>Reviewable config in the client's repo. Their keys, their Submit.</p></div>
|
<div><b>Agencies</b><p>Reviewable config in the client's repo. Their keys, their Submit.</p></div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -456,7 +456,7 @@
|
||||||
<video controls preload="none" playsinline width="1280" height="720" poster="img/teaser-poster.webp" aria-label="storebound teaser video, 38 seconds, with music">
|
<video controls preload="none" playsinline width="1280" height="720" poster="img/teaser-poster.webp" aria-label="storebound teaser video, 38 seconds, with music">
|
||||||
<source src="img/teaser.mp4" type="video/mp4">
|
<source src="img/teaser.mp4" type="video/mp4">
|
||||||
</video>
|
</video>
|
||||||
<button class="play" type="button" hidden aria-label="Play the 38-second teaser (with sound)"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor"/></svg><span>Play · 0:38</span></button>
|
<button class="play" type="button" hidden aria-label="Play the 38-second teaser (with sound)"><span class="ic ic-play" aria-hidden="true"></span><span>Play · 0:38</span></button>
|
||||||
</div>
|
</div>
|
||||||
<figcaption id="see-cap">38-second teaser: a scripted terminal run with the demo game, from config to “Submit for review · your click”. Has music.</figcaption>
|
<figcaption id="see-cap">38-second teaser: a scripted terminal run with the demo game, from config to “Submit for review · your click”. Has music.</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
@ -476,7 +476,7 @@
|
||||||
<h2 id="journey-h">Everything an app or game needs before review, in order.</h2>
|
<h2 id="journey-h">Everything an app or game needs before review, in order.</h2>
|
||||||
<p class="sub">For each step: what storebound does through the store APIs or on your machine, what a skill walks your agent through where the stores have no public API, and what stays your own click.</p>
|
<p class="sub">For each step: what storebound does through the store APIs or on your machine, what a skill walks your agent through where the stores have no public API, and what stays your own click.</p>
|
||||||
<figure class="journey">
|
<figure class="journey">
|
||||||
<img src="img/journey.svg" width="960" height="560" alt="The journey: config, app records, products, listings, questionnaires, privacy and icons, store art, validate, then you press Submit. Each step is tagged API, UI, local or you." loading="lazy" decoding="async">
|
<picture><source media="(max-width: 640px)" srcset="img/journey-tall.svg" width="422" height="1520"><img src="img/journey.svg" width="1122" height="596" alt="The journey: config, app records, products, listings, questionnaires, privacy and icons, store art, validate, then you press Submit. Each step is tagged API, UI, local or you." loading="lazy" decoding="async"></picture>
|
||||||
</figure>
|
</figure>
|
||||||
<ul class="legend" aria-label="Legend">
|
<ul class="legend" aria-label="Legend">
|
||||||
<li><span class="tag t-api">API</span> a storebound command (also an MCP tool)</li>
|
<li><span class="tag t-api">API</span> a storebound command (also an MCP tool)</li>
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,13 @@ body {
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
img, video, svg { max-width: 100%; height: auto; display: block; }
|
img, video, svg { max-width: 100%; height: auto; display: block; }
|
||||||
|
/* icons: lucide's own SVG files (site/img/icons, vendored by tools/site-icons.ts) as masks in the text colour */
|
||||||
|
.ic { display: inline-block; flex: none; width: 1em; height: 1em; background-color: currentColor; -webkit-mask: none center / contain no-repeat; mask: none center / contain no-repeat; }
|
||||||
|
.ic-chevron-right { -webkit-mask-image: url(img/icons/chevron-right.svg); mask-image: url(img/icons/chevron-right.svg); }
|
||||||
|
.ic-play { -webkit-mask-image: url(img/icons/play.svg); mask-image: url(img/icons/play.svg); }
|
||||||
|
.ic-user-round { -webkit-mask-image: url(img/icons/user-round.svg); mask-image: url(img/icons/user-round.svg); }
|
||||||
|
.ic-layout-grid { -webkit-mask-image: url(img/icons/layout-grid.svg); mask-image: url(img/icons/layout-grid.svg); }
|
||||||
|
.ic-briefcase-business { -webkit-mask-image: url(img/icons/briefcase-business.svg); mask-image: url(img/icons/briefcase-business.svg); }
|
||||||
a { color: var(--accent); text-underline-offset: 3px; }
|
a { color: var(--accent); text-underline-offset: 3px; }
|
||||||
a:hover { text-decoration-thickness: 2px; }
|
a:hover { text-decoration-thickness: 2px; }
|
||||||
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
|
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
|
||||||
|
|
@ -215,7 +222,7 @@ html.js .panel[hidden] { display: none; }
|
||||||
.see video { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--line); background: #0b1020; }
|
.see video { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--line); background: #0b1020; }
|
||||||
.player { position: relative; }
|
.player { position: relative; }
|
||||||
.play { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, #fff 25%, transparent); background: color-mix(in srgb, #0b1020 72%, transparent); color: #fff; font: 650 14.5px var(--font); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
|
.play { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, #fff 25%, transparent); background: color-mix(in srgb, #0b1020 72%, transparent); color: #fff; font: 650 14.5px var(--font); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
|
||||||
.play svg { width: 20px; height: 20px; }
|
.play .ic { width: 20px; height: 20px; }
|
||||||
.play:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
|
.play:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
|
||||||
.play:focus-visible { outline-offset: 3px; border-radius: 999px; }
|
.play:focus-visible { outline-offset: 3px; border-radius: 999px; }
|
||||||
.see figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
|
.see figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
|
||||||
|
|
@ -271,8 +278,8 @@ h1 .hl { color: var(--accent); }
|
||||||
.lede strong { color: var(--ink); font-weight: 650; }
|
.lede strong { color: var(--ink); font-weight: 650; }
|
||||||
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
|
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
|
||||||
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: 15px; transition: background-color .15s ease, border-color .15s ease, transform .12s ease; }
|
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: 15px; transition: background-color .15s ease, border-color .15s ease, transform .12s ease; }
|
||||||
.btn svg { width: 16px; height: 16px; margin-right: -4px; transition: transform .15s ease; }
|
.btn .ic { width: 16px; height: 16px; margin-right: -4px; transition: transform .15s ease; }
|
||||||
.btn:hover svg { transform: translateX(2px); }
|
.btn:hover .ic { transform: translateX(2px); }
|
||||||
.btn:active { transform: translateY(1px); }
|
.btn:active { transform: translateY(1px); }
|
||||||
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgb(255 255 255 / .18) inset, 0 6px 16px -8px var(--accent); }
|
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgb(255 255 255 / .18) inset, 0 6px 16px -8px var(--accent); }
|
||||||
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
|
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
|
||||||
|
|
@ -591,7 +598,8 @@ h2 { font-size: clamp(28px, 4.2vw, 40px); font-weight: 720; letter-spacing: -.03
|
||||||
.for-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 24px; }
|
.for-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 24px; }
|
||||||
@media (min-width: 760px) { .for-list { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
|
@media (min-width: 760px) { .for-list { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
|
||||||
.for-list li { display: flex; gap: 14px; align-items: flex-start; }
|
.for-list li { display: flex; gap: 14px; align-items: flex-start; }
|
||||||
.for-list svg { width: 40px; height: 40px; padding: 9px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
|
.for-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
|
||||||
|
.for-ic .ic { width: 22px; height: 22px; }
|
||||||
.for-list b { display: block; font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
|
.for-list b { display: block; font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
|
||||||
.for-list p { margin-top: 4px; font-size: 15px; color: var(--ink-2); }
|
.for-list p { margin-top: 4px; font-size: 15px; color: var(--ink-2); }
|
||||||
|
|
||||||
|
|
@ -618,6 +626,6 @@ h2 { font-size: clamp(28px, 4.2vw, 40px); font-weight: 720; letter-spacing: -.03
|
||||||
.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
|
.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
|
||||||
.st-foot[hidden] { display: none; }
|
.st-foot[hidden] { display: none; }
|
||||||
.st-next { display: inline-flex; align-items: center; gap: 4px; font: 600 14px var(--font); color: var(--accent); background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: none; border-radius: 6px; }
|
.st-next { display: inline-flex; align-items: center; gap: 4px; font: 600 14px var(--font); color: var(--accent); background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: none; border-radius: 6px; }
|
||||||
.st-next svg { width: 15px; height: 15px; transition: transform .15s ease; }
|
.st-next .ic { width: 15px; height: 15px; transition: transform .15s ease; }
|
||||||
.st-next:hover svg { transform: translateX(2px); }
|
.st-next:hover .ic { transform: translateX(2px); }
|
||||||
@media (min-width: 1024px) { html.js .st-panel:not([hidden]) { display: flex; flex-direction: column; } }
|
@media (min-width: 1024px) { html.js .st-panel:not([hidden]) { display: flex; flex-direction: column; } }
|
||||||
|
|
|
||||||
69
tests/no-handmade-svg.test.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
// Owner rule: no hand-written SVG. Charts come from visx, icons from lucide, the journey diagram from Mermaid, the
|
||||||
|
// fixture art from tools/fixture-art.ts. This guard fails on inline SVG drawing in the desktop webview and the site.
|
||||||
|
// Allowed: the brand mark (apps/desktop/src/ui/brand.tsx, the site's <svg class="mark"> and site/favicon.svg: brand
|
||||||
|
// assets, owner decision), the <svg> root a visx chart renders into (files that import @visx/*), lucide's own files in
|
||||||
|
// site/img/icons (byte-equal to lucide-static) and the Mermaid output (docs/img, site/img journey*.svg).
|
||||||
|
import { describe, expect, test } from 'bun:test';
|
||||||
|
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
||||||
|
import { join, relative } from 'node:path';
|
||||||
|
import { checkSiteIcons } from '../tools/site-icons';
|
||||||
|
|
||||||
|
const ROOT = join(import.meta.dir, '..');
|
||||||
|
const walk = (dir: string, keep: (f: string) => boolean): string[] => readdirSync(join(ROOT, dir)).flatMap(n => {
|
||||||
|
const rel = join(dir, n);
|
||||||
|
if (n === 'node_modules' || n === 'dist') return [];
|
||||||
|
return statSync(join(ROOT, rel)).isDirectory() ? walk(rel, keep) : keep(n) ? [rel] : [];
|
||||||
|
});
|
||||||
|
const read = (f: string) => readFileSync(join(ROOT, f), 'utf8');
|
||||||
|
|
||||||
|
/** SVG drawing elements and inline SVG images. */
|
||||||
|
const SHAPES = /<(path|circle|rect|ellipse|line|polyline|polygon)[\s/>]|data:image\/svg\+xml|<svg[\s>]/g;
|
||||||
|
const BRAND_FILES = ['apps/desktop/src/ui/brand.tsx'];
|
||||||
|
const SITE_MARK = '<svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="8" fill="currentColor"/><path d="M16 7v12M10.5 12.5 16 7l5.5 5.5" fill="none" stroke="var(--mark-ink)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 18v5.5h16V18" fill="none" stroke="var(--mark-ink)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
||||||
|
|
||||||
|
/** Every hand-drawn hit in a source text: "file:line <tag". */
|
||||||
|
export function svgHits(file: string, text: string, opts: { visxRoot?: boolean } = {}): string[] {
|
||||||
|
const out: string[] = [];
|
||||||
|
for (const m of text.matchAll(SHAPES)) {
|
||||||
|
if (opts.visxRoot && /^<svg/.test(m[0])) continue;
|
||||||
|
out.push(`${file}:${text.slice(0, m.index).split('\n').length} ${m[0].trim()}`);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('no hand-written SVG', () => {
|
||||||
|
test('desktop webview: charts through visx, icons through lucide, no inline SVG outside the brand mark', () => {
|
||||||
|
const files = walk('apps/desktop/src', n => /\.(tsx?|css|html)$/.test(n));
|
||||||
|
expect(files.length).toBeGreaterThan(30);
|
||||||
|
const hits = files.filter(f => !BRAND_FILES.includes(f)).flatMap(f => {
|
||||||
|
const s = read(f);
|
||||||
|
return svgHits(f, s, { visxRoot: /from '@visx\//.test(s) });
|
||||||
|
});
|
||||||
|
expect(hits).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the guard itself catches a drawn icon and an inline SVG image', () => {
|
||||||
|
expect(svgHits('x.tsx', 'const a = <svg viewBox="0 0 24 24"><path d="M0 0h1" /></svg>;')).toHaveLength(2);
|
||||||
|
expect(svgHits('x.ts', "const u = 'data:image/svg+xml;base64,AAAA';")).toHaveLength(1);
|
||||||
|
expect(svgHits('x.tsx', '<svg width={w}><LinePath data={d} /></svg>', { visxRoot: true })).toEqual([]);
|
||||||
|
expect(svgHits('x.tsx', '<svg width={w}><circle r={2} /></svg>', { visxRoot: true })).toHaveLength(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('site pages: icons are lucide files in site/img/icons; only the brand mark is inline', () => {
|
||||||
|
const pages = walk('site', n => n.endsWith('.html'));
|
||||||
|
expect(pages.length).toBeGreaterThanOrEqual(2);
|
||||||
|
const hits = pages.flatMap(f => svgHits(f, read(f).split(SITE_MARK).join('')));
|
||||||
|
expect(hits).toEqual([]);
|
||||||
|
expect(checkSiteIcons()).toEqual([]);
|
||||||
|
for (const f of ['site/style.css', 'site/main.js']) expect(svgHits(f, read(f)), f).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('SVG files: brand favicon, vendored lucide icons and Mermaid diagrams only', () => {
|
||||||
|
const svgs = [...walk('site', n => n.endsWith('.svg')), ...walk('docs', n => n.endsWith('.svg'))].map(f => relative(ROOT, join(ROOT, f)));
|
||||||
|
for (const f of svgs) {
|
||||||
|
if (f === 'site/favicon.svg' || f.startsWith('site/img/icons/')) continue;
|
||||||
|
expect(f, `${f}: not a known asset`).toMatch(/^(docs|site)\/img\/journey(-tall)?\.svg$/);
|
||||||
|
expect(read(f), `${f}: render it with bun tools/diagrams.ts`).toContain('aria-roledescription="flowchart-v2"');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env bun
|
#!/usr/bin/env bun
|
||||||
// Everything CI runs, in order; stops at the first failure. bun run ci
|
// Everything CI runs, in order; stops at the first failure. bun run ci
|
||||||
// `bun test` covers the CLI and the desktop webview (apps/desktop/tests: model, i18n, theme contrast, webview rules).
|
// `bun test` covers the CLI and the desktop webview (apps/desktop/tests: model, i18n, theme contrast, webview rules),
|
||||||
|
// and the no-hand-written-SVG guard (tests/no-handmade-svg.test.ts: visx charts, lucide icons, Mermaid diagrams).
|
||||||
// The desktop Rust host (cargo test, clippy
|
// The desktop Rust host (cargo test, clippy
|
||||||
// with warnings as errors) runs when cargo is installed; set STOREBOUND_CI_RUST=0 to skip it on a machine without Rust.
|
// with warnings as errors) runs when cargo is installed; set STOREBOUND_CI_RUST=0 to skip it on a machine without Rust.
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
|
|
||||||
66
tools/diagrams.ts
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
#!/usr/bin/env bun
|
||||||
|
// Renders the diagrams in docs/diagrams/*.mmd with the Mermaid CLI (@mermaid-js/mermaid-cli, a devDependency; never
|
||||||
|
// shipped). Plain SVG text (no HTML labels), a fixed dark canvas so it reads the same on light and dark pages.
|
||||||
|
// bun tools/diagrams.ts
|
||||||
|
// journey.mmd -> docs/img/journey.svg (README), site/img/journey.svg (wide screens) and site/img/journey-tall.svg
|
||||||
|
// (phones: every row turned into a column). Chrome: STOREBOUND_CHROME, Playwright's Chromium, or Google Chrome.
|
||||||
|
import { copyFileSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
||||||
|
import { tmpdir } from 'node:os';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
|
||||||
|
const root = new URL('..', import.meta.url).pathname;
|
||||||
|
const BG = '#0f172a';
|
||||||
|
|
||||||
|
function chrome(): string {
|
||||||
|
const cands = [process.env.STOREBOUND_CHROME ?? ''];
|
||||||
|
try { cands.push((require('playwright') as typeof import('playwright')).chromium.executablePath()); } catch { /* not installed */ }
|
||||||
|
cands.push('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/usr/bin/google-chrome', '/usr/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe');
|
||||||
|
const home = process.env.HOME ?? '';
|
||||||
|
// a newer Playwright Chromium than the installed playwright expects is fine for Mermaid
|
||||||
|
for (const base of [join(home, 'Library/Caches/ms-playwright'), join(home, '.cache/ms-playwright')]) {
|
||||||
|
if (!existsSync(base)) continue;
|
||||||
|
for (const d of Array.from(new Bun.Glob('chromium-*/chrome-*/**/{Google Chrome for Testing,chrome}').scanSync({ cwd: base, onlyFiles: true }))) cands.push(join(base, d));
|
||||||
|
}
|
||||||
|
const hit = cands.find(c => c && existsSync(c));
|
||||||
|
if (!hit) throw new Error('diagrams: no Chrome found (set STOREBOUND_CHROME or run `bunx playwright install chromium`)');
|
||||||
|
return hit;
|
||||||
|
}
|
||||||
|
|
||||||
|
const mermaidConfig = {
|
||||||
|
theme: 'base',
|
||||||
|
htmlLabels: false,
|
||||||
|
flowchart: { htmlLabels: false, curve: 'basis', nodeSpacing: 28, rankSpacing: 36, padding: 14, wrappingWidth: 400 },
|
||||||
|
themeVariables: {
|
||||||
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif', fontSize: '15px',
|
||||||
|
background: BG, primaryColor: '#1e293b', primaryTextColor: '#e2e8f0', primaryBorderColor: '#475569',
|
||||||
|
lineColor: '#94a3b8', textColor: '#e2e8f0', titleColor: '#f8fafc', clusterBkg: '#111a2e', clusterBorder: '#334155',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function render(src: string, out: string, tmp: string, exe: string) {
|
||||||
|
const input = join(tmp, 'in.mmd');
|
||||||
|
writeFileSync(input, src);
|
||||||
|
writeFileSync(join(tmp, 'mermaid.json'), JSON.stringify(mermaidConfig));
|
||||||
|
writeFileSync(join(tmp, 'puppeteer.json'), JSON.stringify({ executablePath: exe, args: ['--no-sandbox'] }));
|
||||||
|
const r = Bun.spawnSync(['node', join(root, 'node_modules/@mermaid-js/mermaid-cli/src/cli.js'), '-q', '-i', input, '-o', out,
|
||||||
|
'-c', join(tmp, 'mermaid.json'), '-p', join(tmp, 'puppeteer.json'), '-b', BG], { stdout: 'inherit', stderr: 'inherit' });
|
||||||
|
if (r.exitCode !== 0) throw new Error(`diagrams: mmdc failed for ${out}`);
|
||||||
|
// a self-describing image: title for screen readers, the dark canvas filled in (some viewers drop the background style)
|
||||||
|
let svg = readFileSync(out, 'utf8');
|
||||||
|
// Mermaid embeds its default web font; the diagram uses the system font stack instead, so drop the font files
|
||||||
|
svg = svg.replace(/@font-face\s*\{[^}]*\}/g, '');
|
||||||
|
// a fixed intrinsic size (from the viewBox) so <img width height> and README renderers keep the aspect ratio
|
||||||
|
const [, , w, h] = (svg.match(/viewBox="([^"]+)"/)?.[1] ?? '0 0 960 560').split(/\s+/).map(Number);
|
||||||
|
svg = svg.replace(/^<svg([^>]*)>/, (_m, a: string) => `<svg${a.replace(/ role="[^"]*"/, '').replace('width="100%"', `width="${Math.ceil(w!)}" height="${Math.ceil(h!)}"`).replace(/max-width: [\d.]+px; ?/, '')} role="img"><title>storebound · the journey from zero to Submit for review</title>`);
|
||||||
|
writeFileSync(out, svg);
|
||||||
|
console.log(`diagrams: ${out.replace(root, '')} (${(svg.length / 1024).toFixed(1)} KB)`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const exe = chrome();
|
||||||
|
const tmp = mkdtempSync(join(tmpdir(), 'sb-diagrams-'));
|
||||||
|
try {
|
||||||
|
const journey = readFileSync(join(root, 'docs/diagrams/journey.mmd'), 'utf8');
|
||||||
|
render(journey, join(root, 'docs/img/journey.svg'), tmp, exe);
|
||||||
|
copyFileSync(join(root, 'docs/img/journey.svg'), join(root, 'site/img/journey.svg'));
|
||||||
|
render(journey.replace(/direction LR/g, 'direction TB'), join(root, 'site/img/journey-tall.svg'), tmp, exe);
|
||||||
|
} finally { rmSync(tmp, { recursive: true, force: true }); }
|
||||||
70
tools/fixture-art.ts
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
#!/usr/bin/env bun
|
||||||
|
// Renders the desktop dev fixtures' art (apps/desktop/src/dev/art/*.png): app icons and store screenshot stand-ins,
|
||||||
|
// each a lucide icon (lucide-static, ISC) on a CSS gradient, photographed by Playwright's Chromium. No drawn SVG: the
|
||||||
|
// icons are lucide's own files. Dev only (the fixtures never ship in the release bundle).
|
||||||
|
// bun tools/fixture-art.ts (Playwright's Chromium, or an installed Google Chrome; same launcher as storebound shots)
|
||||||
|
import { mkdirSync, readFileSync, renameSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import { launch } from '../cli/shots/browser';
|
||||||
|
|
||||||
|
const root = new URL('..', import.meta.url).pathname;
|
||||||
|
const out = join(root, 'apps/desktop/src/dev/art');
|
||||||
|
const lucide = (name: string) => readFileSync(join(root, 'node_modules/lucide-static/icons', `${name}.svg`), 'utf8').replace(/<!--.*?-->/s, '');
|
||||||
|
|
||||||
|
/** [file, lucide icon, gradient from, gradient to] */
|
||||||
|
const ICONS: [string, string, string, string][] = [
|
||||||
|
['icon-prism', 'droplets', '#7c5cff', '#ff5fa2'], ['icon-tidy', 'list-checks', '#2fd18b', '#0f9d74'],
|
||||||
|
['icon-orbit', 'orbit', '#0ea5e9', '#6366f1'], ['icon-block', 'blocks', '#22c55e', '#15803d'],
|
||||||
|
['icon-lantern', 'lamp', '#f59e0b', '#b45309'], ['icon-tycoon', 'coins', '#a855f7', '#6d28d9'],
|
||||||
|
['icon-racer', 'car-front', '#ef4444', '#991b1b'], ['icon-habit', 'egg', '#14b8a6', '#0f766e'],
|
||||||
|
['icon-focus', 'timer', '#f43f5e', '#be123c'], ['icon-sketch', 'star', '#fb923c', '#ea580c'],
|
||||||
|
['icon-night', 'moon', '#1e293b', '#4338ca'], ['icon-mood', 'grid-2x2', '#ec4899', '#8b5cf6'],
|
||||||
|
];
|
||||||
|
/** Four scenes of the demo game: [lucide icon, from, to, accent] */
|
||||||
|
const SCENES: [string, string, string, string][] = [
|
||||||
|
['droplets', '#7c5cff', '#ff5fa2', '#ffd36e'], ['zap', '#ff7a59', '#ff3d7f', '#ffe08a'],
|
||||||
|
['calendar-days', '#2fb5ff', '#5b6cff', '#b8f3ff'], ['trophy', '#ffb03b', '#ff7a1a', '#fff1b8'],
|
||||||
|
];
|
||||||
|
/** Screenshot shapes at a small preview size, in the stores' aspect ratios. */
|
||||||
|
const SHAPES: [string, number, number][] = [['phone', 240, 521], ['play', 240, 427], ['ipad', 300, 400], ['feature', 512, 250]];
|
||||||
|
|
||||||
|
const page = (w: number, h: number, body: string, css: string) =>
|
||||||
|
`<!doctype html><html><head><style>*{margin:0;box-sizing:border-box}html,body{width:${w}px;height:${h}px;overflow:hidden}${css}</style></head><body>${body}</body></html>`;
|
||||||
|
|
||||||
|
mkdirSync(out, { recursive: true });
|
||||||
|
const browser = await launch(root, {});
|
||||||
|
const tab = await browser.newPage({ deviceScaleFactor: 1 });
|
||||||
|
async function snap(file: string, w: number, h: number, html: string) {
|
||||||
|
await tab.setViewportSize({ width: w, height: h });
|
||||||
|
await tab.setContent(html);
|
||||||
|
const png = join(out, `${file}.png`);
|
||||||
|
await tab.screenshot({ path: png, clip: { x: 0, y: 0, width: w, height: h } });
|
||||||
|
// 8-bit palette PNG (ffmpeg, already needed for storebound icons): about a quarter of the bytes; kept as is without it
|
||||||
|
if (Bun.which('ffmpeg')) {
|
||||||
|
const tmp = `${png}.q.png`;
|
||||||
|
const r = Bun.spawnSync(['ffmpeg', '-v', 'error', '-y', '-i', png, '-vf', 'split[a][b];[a]palettegen=max_colors=96:stats_mode=full[p];[b][p]paletteuse=dither=bayer:bayer_scale=3', tmp]);
|
||||||
|
if (r.exitCode === 0) renameSync(tmp, png);
|
||||||
|
}
|
||||||
|
console.log(`fixture-art: ${file}.png ${w}x${h}`);
|
||||||
|
}
|
||||||
|
for (const [file, icon, a, b] of ICONS) {
|
||||||
|
await snap(file, 128, 128, page(128, 128, `<div class="t">${lucide(icon)}</div>`,
|
||||||
|
`.t{width:128px;height:128px;display:grid;place-items:center;background:linear-gradient(135deg,${a},${b});color:#fff}.t svg{width:72px;height:72px;stroke-width:1.8}`));
|
||||||
|
}
|
||||||
|
for (const [i, [icon, a, b, c]] of SCENES.entries()) {
|
||||||
|
for (const [shape, w, h] of SHAPES) {
|
||||||
|
const land = w > h;
|
||||||
|
const phone = land ? { w: h * 0.42, h: h * 0.86 } : { w: w * 0.62, h: Math.min(h * 0.72, w * 0.62 * 2.05) };
|
||||||
|
await snap(`scene${i + 1}-${shape}`, w, h, page(w, h,
|
||||||
|
`<div class="bg"><div class="glow"></div><div class="big">${lucide(icon)}</div><div class="ph"><div class="scr">${lucide(icon)}</div></div></div>`,
|
||||||
|
`.bg{position:relative;width:${w}px;height:${h}px;background:linear-gradient(135deg,${a},${b});color:#fff;overflow:hidden}
|
||||||
|
.glow{position:absolute;inset:0;background:radial-gradient(circle at 50% 30%,rgba(255,255,255,.35),transparent 70%)}
|
||||||
|
.big{position:absolute;${land ? `left:${w * 0.1}px;top:${h * 0.22}px` : `left:50%;top:${h * 0.05}px;transform:translateX(-50%)`};color:${c}}
|
||||||
|
.big svg{width:${land ? h * 0.5 : w * 0.26}px;height:${land ? h * 0.5 : w * 0.26}px;stroke-width:2.2}
|
||||||
|
.ph{position:absolute;width:${phone.w}px;height:${phone.h}px;${land ? `right:${w * 0.1}px;top:${h * 0.07}px` : `left:50%;bottom:-${phone.w * 0.12}px;transform:translateX(-50%)`};
|
||||||
|
border-radius:${phone.w * 0.14}px;background:#10142a;border:${Math.max(2, phone.w * 0.03)}px solid rgba(255,255,255,.85);padding:${phone.w * 0.06}px}
|
||||||
|
.scr{width:100%;height:100%;border-radius:${phone.w * 0.08}px;background:#1d2350;display:grid;place-items:center;color:${c}}
|
||||||
|
.scr svg{width:45%;height:45%;stroke-width:1.6}`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await browser.close();
|
||||||
41
tools/site-icons.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env bun
|
||||||
|
// Vendors the site's icons from lucide (lucide-static, ISC licence) into site/img/icons/: the official SVG files,
|
||||||
|
// copied byte for byte, plus lucide's licence. The pages show them as CSS masks (site/style.css .ic-*), so they take
|
||||||
|
// the text colour in both themes and the site makes no request outside its own folder.
|
||||||
|
// bun tools/site-icons.ts copy (after a lucide-static bump or a new icon in ICONS)
|
||||||
|
// bun tools/site-icons.ts --check fail when a vendored file differs from lucide-static (CI, when installed)
|
||||||
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
|
||||||
|
export const SITE_ICONS = ['chevron-right', 'play', 'user-round', 'layout-grid', 'briefcase-business'] as const;
|
||||||
|
|
||||||
|
const root = new URL('..', import.meta.url).pathname;
|
||||||
|
const from = join(root, 'node_modules/lucide-static');
|
||||||
|
export const ICON_DIR = join(root, 'site/img/icons');
|
||||||
|
|
||||||
|
/** Problems of the vendored folder against lucide-static ([] when it matches, or when lucide-static is not installed). */
|
||||||
|
export function checkSiteIcons(): string[] {
|
||||||
|
if (!existsSync(from)) return [];
|
||||||
|
const out: string[] = [];
|
||||||
|
for (const n of SITE_ICONS) {
|
||||||
|
const f = join(ICON_DIR, `${n}.svg`);
|
||||||
|
if (!existsSync(f)) out.push(`site/img/icons/${n}.svg missing (bun tools/site-icons.ts)`);
|
||||||
|
else if (readFileSync(f, 'utf8') !== readFileSync(join(from, 'icons', `${n}.svg`), 'utf8')) out.push(`site/img/icons/${n}.svg is not lucide-static's file`);
|
||||||
|
}
|
||||||
|
for (const f of readdirSync(ICON_DIR)) if (f.endsWith('.svg') && !(SITE_ICONS as readonly string[]).includes(f.slice(0, -4))) out.push(`site/img/icons/${f} is not in SITE_ICONS`);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (import.meta.main) {
|
||||||
|
if (!existsSync(from)) { console.error('site-icons: lucide-static is not installed (bun install)'); process.exit(1); }
|
||||||
|
if (process.argv.includes('--check')) {
|
||||||
|
const bad = checkSiteIcons();
|
||||||
|
for (const b of bad) console.error(`site-icons: ${b}`);
|
||||||
|
process.exit(bad.length ? 1 : 0);
|
||||||
|
}
|
||||||
|
mkdirSync(ICON_DIR, { recursive: true });
|
||||||
|
const version = JSON.parse(readFileSync(join(from, 'package.json'), 'utf8')).version;
|
||||||
|
for (const n of SITE_ICONS) writeFileSync(join(ICON_DIR, `${n}.svg`), readFileSync(join(from, 'icons', `${n}.svg`)));
|
||||||
|
writeFileSync(join(ICON_DIR, 'LICENSE.txt'), `Icons in this folder: Lucide ${version} (https://lucide.dev), copied unchanged from the lucide-static\npackage by tools/site-icons.ts.\n\n${readFileSync(join(from, 'LICENSE'), 'utf8')}`);
|
||||||
|
console.log(`site-icons: ${SITE_ICONS.length} icons from lucide-static ${version} -> site/img/icons/`);
|
||||||
|
}
|
||||||