feat: add support for stat sheet SVG rendering

Introduces the ability to discover and render `*.sheet.svg` files.
These files can contain `<text>` elements with `${key}` templates
that reactively update based on the current journal stats.

- Add `StatSheet` type and CLI scanning logic
- Implement `SheetView` for rendering SVGs with live bindings
- Add `parseSheet` utility to extract template patterns from SVG
- Update file indexer to include `.svg` files
This commit is contained in:
2026-07-09 12:04:25 +08:00
parent 4f3b03d082
commit 30d1c5dc1b
9 changed files with 478 additions and 127 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ function ensureIndexLoaded(): Promise<void> {
try {
const context = import.meta.webpackContext("../../content", {
recursive: true,
regExp: /\.md|\.yarn|\.csv$/i,
regExp: /\.md|\.yarn|\.csv|\.svg$/i,
});
const keys = context.keys();
const index: FileIndex = {};
@@ -94,7 +94,7 @@ async function scanDirectory(
prefix = "",
): Promise<FileIndex> {
const index: FileIndex = {};
const acceptedExt = /\.(md|yarn|csv)$/i;
const acceptedExt = /\.(md|yarn|csv|svg)$/i;
for await (const [name, entry] of (handle as any).entries()) {
if (entry.kind === "directory") {