Add the Neutral template family, template picker and text-only logo allowances

Linea (the vendor's original format.pdf design), Monogram and Serenity are
rebuilt from the Canva PDFs as one parametric family on the engine, with
the user's logo in the measured slot, a home for every GST field and
A4/Letter support. Adds static Montserrat, Open Sans and Poppins fonts and
a generated Ms Madi outline for Serenity's vertical word. Text-only logo
placeholders (Monolith, Tangerine) use a doc-derived allowance box. A
Carbon TemplatePicker with committed thumbnails opens from the page
setup controls.
This commit is contained in:
2026-10-04 07:27:12 +05:30
parent 490c5b9009
commit 3f7c12b7dd
65 changed files with 3278 additions and 110 deletions
+32
View File
@@ -0,0 +1,32 @@
/**
* What the template picker shows about each template. Kept free of layout code so the UI can import it
* without pulling react-pdf into the main bundle; every TemplateDefinition takes its identity from here.
*/
export interface TemplateCatalogEntry {
id: string;
name: string;
family: "classic" | "neutral";
/** Static PNG from /public, written by scripts/thumbnails.mjs (sample data, not the user's invoice). */
thumbnail: string;
badge?: "Matches your original format";
/** No Canva placeholder: the logo shows only when the user turns it on. */
logoOptIn?: boolean;
}
export const FAMILY_LABELS: Record<TemplateCatalogEntry["family"], string> = {
classic: "Classic",
neutral: "Neutral",
};
/** Picker order: Classic first, Linea (the vendor's original format) second. */
export const TEMPLATE_CATALOG: readonly TemplateCatalogEntry[] = [
{ id: "classic", name: "Voiced Standard", family: "classic", thumbnail: "/templates/classic.png" },
{ id: "linea", name: "Linea", family: "neutral", thumbnail: "/templates/linea.png", badge: "Matches your original format", logoOptIn: true },
{ id: "monogram", name: "Monogram", family: "neutral", thumbnail: "/templates/monogram.png" },
{ id: "serenity", name: "Serenity", family: "neutral", thumbnail: "/templates/serenity.png" },
];
/** The entry for an id; an unknown id falls back to Classic, like getTemplate. */
export function catalogEntry(id: string | undefined): TemplateCatalogEntry {
return TEMPLATE_CATALOG.find((e) => e.id === id) ?? TEMPLATE_CATALOG[0];
}