{"version":3,"file":"schemas-D8VxKrnv.mjs","names":[],"sources":["../src/schemas/frontmatter.ts","../src/schemas/heading.ts","../src/schemas/markdown-config.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// ── Base frontmatter (required for all content items) ──\n\nexport const BaseFrontmatterSchema = z\n  .object({\n    title: z.string(),\n    description: z.string(),\n    publishedDate: z.coerce.date(),\n    lastUpdatedOn: z.coerce.date().optional(),\n    tags: z.array(z.string()).default([]),\n    draft: z.boolean().optional().default(false),\n  })\n  .passthrough();\n\nexport type BaseFrontmatter = z.infer<typeof BaseFrontmatterSchema>;\n\n// ── Project frontmatter (extends base with project-specific fields) ──\n\nexport const ProjectFrontmatterSchema = BaseFrontmatterSchema.extend({\n  gitRepo: z.string().url().optional(),\n  links: z\n    .array(\n      z.object({\n        url: z.string().url(),\n        text: z.string(),\n      }),\n    )\n    .optional(),\n});\n\nexport type ProjectFrontmatter = z.infer<typeof ProjectFrontmatterSchema>;\n\n// ── Blog frontmatter (extends base with blog-specific fields) ──\n\nexport const BlogFrontmatterSchema = BaseFrontmatterSchema.extend({\n  category: z.string().optional(),\n  featured: z.boolean().optional(),\n  coverImage: z.string().optional(),\n});\n\nexport type BlogFrontmatter = z.infer<typeof BlogFrontmatterSchema>;\n","import { z } from \"zod\";\n\n// ── Heading (extracted from markdown) ──\n\nexport const HeadingSchema = z.object({\n  depth: z.number(),\n  text: z.string(),\n  slug: z.string(),\n});\n\nexport type Heading = z.infer<typeof HeadingSchema>;\n","import { z } from \"zod\";\n\n// ── Markdown config ──\n\n/**\n * Image loading-hint behavior applied to in-flow content images during\n * markdown processing.\n *\n * When `lazyLoading` is enabled (the default), Pagesmith walks the rendered\n * images in document order: the first `eagerCount` images are marked\n * `fetchpriority=\"high\"` (eager, tuned for the Largest Contentful Paint hero),\n * and every subsequent image gets `loading=\"lazy\" decoding=\"async\"` so it\n * defers until near the viewport. The hint is applied to the `<img>` inside a\n * generated `<picture>` as well as to plain images.\n */\nexport const MarkdownImagesConfigSchema = z\n  .object({\n    /**\n     * Emit browser loading hints (`loading=\"lazy\"`, `decoding=\"async\"`, and\n     * `fetchpriority`) on content images. Set to `false` to opt out entirely\n     * and leave images without any Pagesmith-added loading attributes.\n     * Defaults to `true`.\n     */\n    lazyLoading: z\n      .boolean()\n      .optional()\n      .describe(\"Emit lazy/eager loading hints on content images.\"),\n    /**\n     * Number of leading images (in document order) to mark eager with\n     * `fetchpriority=\"high\"` instead of lazy. Defaults to `1` so the first\n     * image — typically the LCP hero — is prioritized. Use `0` to make every\n     * image lazy.\n     */\n    eagerCount: z\n      .number()\n      .int()\n      .nonnegative()\n      .optional()\n      .describe(\"Count of leading images loaded eagerly with fetchpriority=high.\"),\n  })\n  .optional();\n\nexport const MarkdownConfigSchema = z.object({\n  remarkPlugins: z.array(z.any()).optional(),\n  rehypePlugins: z.array(z.any()).optional(),\n  allowDangerousHtml: z.boolean().optional(),\n  math: z.union([z.boolean(), z.literal(\"auto\")]).optional(),\n  images: MarkdownImagesConfigSchema,\n  shiki: z\n    .object({\n      themes: z.object({\n        light: z.string(),\n        dark: z.string(),\n      }),\n      langAlias: z.record(z.string(), z.string()).optional(),\n      defaultShowLineNumbers: z.boolean().optional(),\n    })\n    .optional(),\n});\n\nexport type MarkdownConfig = z.infer<typeof MarkdownConfigSchema>;\n"],"mappings":";;AAIA,MAAa,wBAAwB,EAClC,OAAO;CACN,OAAO,EAAE,OAAO;CAChB,aAAa,EAAE,OAAO;CACtB,eAAe,EAAE,OAAO,KAAK;CAC7B,eAAe,EAAE,OAAO,KAAK,EAAE,SAAS;CACxC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;CACpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK;AAC7C,CAAC,EACA,YAAY;AAMf,MAAa,2BAA2B,sBAAsB,OAAO;CACnE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;CACnC,OAAO,EACJ,MACC,EAAE,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