refactor(v4.0.0-alpha): beginning of a new era

This commit is contained in:
Amruth Pillai
2023-11-05 12:31:42 +01:00
parent 0ba6a444e2
commit 22933bd412
505 changed files with 81829 additions and 0 deletions

View File

@ -0,0 +1,79 @@
import { z } from "zod";
export const defaultLayout = [
[
["summary", "awards", "certifications", "education", "experience", "volunteer"],
["interests", "languages", "profiles", "projects", "publications", "references", "skills"],
],
];
// Schema
export const metadataSchema = z.object({
locale: z.string().default("en"),
template: z.string().default("rhyhorn"),
layout: z.array(z.array(z.array(z.string()))).default(defaultLayout), // pages -> columns -> sections
css: z.object({
value: z.string().default(".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}"),
visible: z.boolean().default(false),
}),
page: z.object({
margin: z.number().default(18),
format: z.enum(["a4", "letter"]).default("a4"),
options: z.object({
breakLine: z.boolean().default(true),
pageNumbers: z.boolean().default(true),
}),
}),
theme: z.object({
background: z.string().default("#ffffff"),
text: z.string().default("#000000"),
primary: z.string().default("#000000"),
}),
typography: z.object({
font: z.object({
family: z.string().default("IBM Plex Serif"),
subset: z.string().default("latin"),
variants: z.array(z.string()).default(["regular"]),
size: z.number().default(14),
}),
lineHeight: z.number().default(1.5),
underlineLinks: z.boolean().default(true),
}),
});
// Type
export type Metadata = z.infer<typeof metadataSchema>;
// Defaults
export const defaultMetadata: Metadata = {
locale: "en",
template: "rhyhorn",
layout: defaultLayout,
css: {
value: ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
visible: false,
},
page: {
margin: 18,
format: "a4",
options: {
breakLine: true,
pageNumbers: true,
},
},
theme: {
background: "#ffffff",
text: "#000000",
primary: "#000000",
},
typography: {
font: {
family: "IBM Plex Serif",
subset: "latin",
variants: ["regular", "italic", "600"],
size: 14,
},
lineHeight: 1.5,
underlineLinks: true,
},
};