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
+3 -1
View File
@@ -22,7 +22,7 @@ import {
resolveBlockAs,
parseSparkTableCsv,
} from "./block-scanner.js";
import type { SparkTableCompletion } from "./types.js";
import type { SparkTableCompletion, StatSheet } from "./types.js";
// Re-export shared pieces for convenience
export {
@@ -41,6 +41,7 @@ export interface ProcessedBlocks {
stats: StatDef[];
statTemplates: StatTemplate[];
sparkTables: SparkTableCompletion[];
statSheets: StatSheet[];
}
export interface BlockResult {
@@ -81,6 +82,7 @@ export function processBlocks(
stats: [],
statTemplates: [],
sparkTables: [],
statSheets: [],
};
const stripped = content.replace(