feat(cv): qualify templates and reliable local import processing

This commit is contained in:
cesnimda
2026-10-28 14:36:12 +01:00
parent 73ea888375
commit 3f4db8ca81
69 changed files with 2597 additions and 180 deletions
+10
View File
@@ -23,6 +23,7 @@ export type CvSkillGroupSetting = { name: string; items: string[] };
export type CvVariantSettings = {
themeId: string;
designVersion?: number | null;
accentColor?: string | null;
headingFont?: string | null;
bodyFont?: string | null;
@@ -73,6 +74,10 @@ export type CvTheme = {
swatches: string[];
supportedSettings?: string[];
pageMarginMm?: number;
headingFont?: string;
bodyFont?: string;
baseFontSizePt?: number;
lineHeight?: number;
};
// Master profile resolved to sections+entries (GET /api/cv/outline) — what the Content tab edits.
@@ -197,6 +202,7 @@ export function applyCvTheme(settings: CvVariantSettings, themeId: string): CvVa
return {
...settings,
themeId,
designVersion: 2,
accentColor: null,
headingFont: null,
bodyFont: null,
@@ -243,6 +249,10 @@ export function emptyCvVariantSettings(themeId = "modern"): CvVariantSettings {
};
}
export function newCvVariantSettings(themeId = "modern"): CvVariantSettings {
return { ...emptyCvVariantSettings(themeId), designVersion: 2 };
}
export async function getCvExportFailureKey(error: unknown): Promise<"cvEmptyContent" | "cvPdfBusy" | "cvPdfTimedOut" | undefined> {
const response = (error as { response?: { status?: number; data?: unknown } })?.response;
if (response?.status === 503) return "cvPdfBusy";