From 7dd997cbfae82894704b2c0a1f0037694883f5d5 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Tue, 25 Aug 2026 16:03:56 +0000 Subject: [PATCH] feat: four draft templates, shelved out of the gallery Cover letter, CV, invoice and meeting minutes as builder modules on a shared builders.ts (JSON helpers + the 45mm window-envelope arithmetic), localized en/de. They sit in the registry's SHELVED list: compiled and schema-checked per locale by tests/unit/templates.test.ts, but not offered in the gallery until their content is settled. Gallery gains per-template thumbnails. --- src/lib/components/CLAUDE.md | 4 +- .../components/TemplateGalleryDialog.svelte | 60 +++++++++++-- src/lib/i18n/locales/de.ts | 88 ++++++++++++++++++ src/lib/i18n/locales/en.ts | 88 ++++++++++++++++++ src/lib/templates/builders.ts | 35 ++++++++ src/lib/templates/coverLetter.ts | 64 +++++++++++++ src/lib/templates/cv.ts | 52 +++++++++++ src/lib/templates/din5008b.ts | 21 +---- src/lib/templates/invoice.ts | 89 +++++++++++++++++++ src/lib/templates/minutes.ts | 54 +++++++++++ src/lib/templates/privateLetter.ts | 17 +--- src/lib/templates/registry.ts | 8 ++ tests/unit/templates.test.ts | 35 ++++++++ 13 files changed, 573 insertions(+), 42 deletions(-) create mode 100644 src/lib/templates/builders.ts create mode 100644 src/lib/templates/coverLetter.ts create mode 100644 src/lib/templates/cv.ts create mode 100644 src/lib/templates/invoice.ts create mode 100644 src/lib/templates/minutes.ts create mode 100644 tests/unit/templates.test.ts diff --git a/src/lib/components/CLAUDE.md b/src/lib/components/CLAUDE.md index d3aa281..3cc2af0 100644 --- a/src/lib/components/CLAUDE.md +++ b/src/lib/components/CLAUDE.md @@ -206,7 +206,9 @@ size alone makes a short word far too small and a long one overflow the page. then the template's content, margins, styles and fold marks. `documentName` becomes the localized template name and no file handle is bound, so the first Save asks where. The DIN letter's mm positions were verified headlessly (45mm address field, 125mm info -column); its module documents the arithmetic. +column); its module documents the arithmetic. The letter-family templates share that +geometry (and the JSON builders) via `templates/builders.ts`; `tests/unit/templates.test.ts` +schema-checks every entry in both locales. ## Fold marks (`FoldMarkLayer.svelte`, `storage/foldMarks.ts`) diff --git a/src/lib/components/TemplateGalleryDialog.svelte b/src/lib/components/TemplateGalleryDialog.svelte index 87be2a7..21fd11a 100644 --- a/src/lib/components/TemplateGalleryDialog.svelte +++ b/src/lib/components/TemplateGalleryDialog.svelte @@ -42,19 +42,43 @@
{#each TEMPLATES as entry (entry.id)}