import type { TemplateDefinition } from "./contract"; import { classic } from "./classic"; import { linea } from "./neutral/linea"; import { crimsonGrid } from "./ledger/crimson"; import { tangerineLedger } from "./ledger/tangerine"; import { slateBand } from "./band/slate"; import { tealSwoosh } from "./band/teal"; import { citrusSplit } from "./northline/citrus"; import { purplePop } from "./northline/purple"; import { cobaltStripe } from "./cobalt/cobalt"; import { highlighter } from "./highlighter/highlighter"; import { marble } from "./marble/marble"; import { monolith } from "./monolith/monolith"; import { monogram } from "./neutral/monogram"; import { serenity } from "./neutral/serenity"; /** Picker order: Classic first, Linea (the vendor's original format) second. */ export const TEMPLATES: Record = { classic, linea, monogram, serenity, "crimson-grid": crimsonGrid, "tangerine-ledger": tangerineLedger, "slate-band": slateBand, "teal-swoosh": tealSwoosh, "purple-pop": purplePop, "citrus-split": citrusSplit, monolith, "cobalt-stripe": cobaltStripe, marble, highlighter, }; export const DEFAULT_TEMPLATE_ID = "classic"; /** The template for an id; an unknown id (a template removed later, a corrupt pref) falls back to Classic. */ export function getTemplate(id: string | undefined): TemplateDefinition { return (id !== undefined && Object.hasOwn(TEMPLATES, id) ? TEMPLATES[id] : undefined) ?? TEMPLATES[DEFAULT_TEMPLATE_ID]; }