# Guide for AI chats: Numsolar offer template "Dagsljus" (Daylight) Give this file and the `src/` folder to the AI chat, then write what you want to change. ## What the template is - A small web app. Numsolar opens `dist/index.html?offerurl=` in a headless Chromium, waits for `html.offer-ready` and prints the pages to an A4 PDF. - Stack: TypeScript, Preact with htm templates (`html\`...\``, no JSX), Paged.js for the pages, Vite. Base library: `@numsolar/offer-templating` 0.2.0. - The kit `kit/` (`@numsolar/template-kit`): the data selectors (`@numsolar/template-kit/offer-data`: `hero`, `facts`, `price`, `months`, `shares`, `roofs`, …), the components (`CoverFrame`, `Hero`, `MonthlyBars`, `ShareBars`, `PriceTable`, `ProductCards`, …), the glossary (`glossary(data)`), `tokens.css` + `components.css` (themes, Inter, type sizes in pt). - Theme: `light`. Page margins: 16/16/22/16 mm. ## Files | File | What it does | | --- | --- | | `src/main.ts` | Entry point: `@page` rules, the footer in the margin, "Sida x / y", PDF metadata. | | `src/pages/Pages.ts` | `src/pages/Pages.ts` (the five pages: `Cover`, `Installation`, `Economy`, `Price`, `Closing`). | | `src/texts.ts` | The template's own texts; the shared terms come from the kit's glossary. | | `src/assets/style.css` | The layout of this template, on the kit's tokens. | | `src/pages.test.ts` | Vitest: mounts the pages with the sample houses (only in the Numsolar workspace). | ## Rules (keep these, or the PDF breaks) 1. Keep `` and `onRenderedPages` in `src/main.ts`: it adds `offer-ready` to ``. 2. `@page` rules and `position: running(...)` go only in the `