feat(cv): qualify templates and reliable local import processing
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user