{"_id":"@albionlabs/brochure-templates","_rev":"2-efd08323f0f17a904b2d90b14bc1c188","name":"@albionlabs/brochure-templates","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@albionlabs/brochure-templates","version":"0.0.1","_id":"@albionlabs/brochure-templates@0.0.1","maintainers":[{"name":"alastairongalbion","email":"alastair@albionlabs.org"}],"homepage":"https://github.com/albionlabs/brochure-templates#readme","bugs":{"url":"https://github.com/albionlabs/brochure-templates/issues"},"dist":{"shasum":"6a2a86bbbdec09112d26aae455590f75e19435c8","tarball":"https://registry.npmjs.org/@albionlabs/brochure-templates/-/brochure-templates-0.0.1.tgz","fileCount":41,"integrity":"sha512-jJXtp+Gx4hA/Q89p8SBWIcMUtsy6fkMx4GXFEb08vTBfmmS4eSljuGyPdptP2zJORL9b6P8+6hJoFwg0lIHVOw==","signatures":[{"sig":"MEUCIQCPWR9jc4DUoVa5eLlkVVMWWBCDqECiQCpRNLcQuYQJFAIgeZb8qAL4frd8TwjzxK6mMOAJiKdPh2xgOt5DQEoiq0M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48106},"type":"module","types":"./dist/index.d.ts","svelte":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","svelte":"./dist/index.js","default":"./dist/index.js"},"./templates/investor-pitch":{"types":"./dist/templates/investor-pitch/index.d.ts","svelte":"./dist/templates/investor-pitch/index.js","default":"./dist/templates/investor-pitch/index.js"}},"gitHead":"076f69c843e4837ec14ecaaa57aa8a1d3e2646b6","scripts":{"dev":"vite dev","build":"vite build","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","package":"svelte-kit sync && svelte-package","prepare":"svelte-kit sync || echo ''","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"},"_npmUser":{"name":"alastairongalbion","email":"alastair@albionlabs.org"},"repository":{"url":"git+https://github.com/albionlabs/brochure-templates.git","type":"git"},"_npmVersion":"11.3.0","description":"Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).","directories":{},"sideEffects":false,"_nodeVersion":"24.1.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","svelte":"^5.51.0","typescript":"^5.9.3","svelte-check":"^4.3.6","@sveltejs/kit":"^2.50.2","@sveltejs/package":"^2.5.7","@sveltejs/adapter-auto":"^7.0.0","@sveltejs/vite-plugin-svelte":"^6.2.4"},"peerDependencies":{"svelte":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/brochure-templates_0.0.1_1772192585130_0.6999242357442208","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@albionlabs/brochure-templates","version":"0.0.2","type":"module","svelte":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","svelte":"./dist/index.js","default":"./dist/index.js"},"./templates/investor-pitch":{"types":"./dist/templates/investor-pitch/index.d.ts","svelte":"./dist/templates/investor-pitch/index.js","default":"./dist/templates/investor-pitch/index.js"}},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/albionlabs/token.investor.brochures.git"},"scripts":{"dev":"vite dev","build":"vite build","preview":"vite preview","package":"svelte-kit sync && svelte-package","prepare":"svelte-kit sync || echo ''","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"},"peerDependencies":{"svelte":"^5.0.0"},"devDependencies":{"@sveltejs/adapter-auto":"^7.0.0","@sveltejs/kit":"^2.50.2","@sveltejs/package":"^2.5.7","@sveltejs/vite-plugin-svelte":"^6.2.4","svelte":"^5.51.0","svelte-check":"^4.3.6","typescript":"^5.9.3","vite":"^7.3.1"},"gitHead":"c8401a0d5c8a8604939f7bd46dbca6ba431a2adb","_id":"@albionlabs/brochure-templates@0.0.2","description":"A Svelte 5 component library for generating print-ready brochure templates for Albion protocol investment tokens.","bugs":{"url":"https://github.com/albionlabs/token.investor.brochures/issues"},"homepage":"https://github.com/albionlabs/token.investor.brochures#readme","_nodeVersion":"22.22.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-vuB1I1DNa26DuxfjOJu2ymUhiR/CFrHVMKNqFS1JcYbUkTbA+0fKRXfAu6LDoM0kCgDw1LRQobQawSFF7N7BAw==","shasum":"928a7afe9743b9c2b1cd1967599845068ae024e4","tarball":"https://registry.npmjs.org/@albionlabs/brochure-templates/-/brochure-templates-0.0.2.tgz","fileCount":41,"unpackedSize":52834,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@albionlabs%2fbrochure-templates@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCmeqexwgq1a0D51i8K533Z1A663hwNpwy8vDv6jgpWqQIhAKo9UpKteiXjuutjyY2rPBfFDFA5dBZ6KQZIlDcmpmZE"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2948ed8f-9e9e-4952-be40-a05805f611b2"}},"directories":{},"maintainers":[{"name":"alastairongalbion","email":"alastair@albionlabs.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brochure-templates_0.0.2_1772198944340_0.22857387951540575"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-27T11:43:05.030Z","modified":"2026-02-27T13:29:04.813Z","0.0.1":"2026-02-27T11:43:05.286Z","0.0.2":"2026-02-27T13:29:04.497Z"},"bugs":{"url":"https://github.com/albionlabs/token.investor.brochures/issues"},"homepage":"https://github.com/albionlabs/token.investor.brochures#readme","repository":{"type":"git","url":"git+https://github.com/albionlabs/token.investor.brochures.git"},"description":"A Svelte 5 component library for generating print-ready brochure templates for Albion protocol investment tokens.","maintainers":[{"name":"alastairongalbion","email":"alastair@albionlabs.org"}],"readme":"# @albionlabs/brochure-templates\n\nA Svelte 5 component library for generating print-ready brochure templates for Albion protocol investment tokens.\n\nEach template is a self-contained unit that includes:\n\n- **Renderer** — a Svelte component that accepts a typed `data` prop and renders the full layout\n- **JSON Schema** — for validating input data and powering schema-driven form UIs\n- **TypeScript types** — full type definitions for the template's data shape\n- **Sample data** — a working example you can render out of the box\n- **Metadata** — id, name, description, version, and category\n\nThis library is designed to be consumed by a parent SvelteKit application that handles the surrounding concerns: template picker UI, schema-driven forms, JSON upload, PDF export, and authentication. The library focuses purely on rendering and data contracts.\n\n## Architecture\n\n```\nParent SvelteKit App (template picker, form UI, auth, PDF export)\n  └── imports @albionlabs/brochure-templates\n        ├── listTemplates()            → enumerate available templates\n        ├── getTemplate('investor-pitch') → renderer + schema + sample data\n        └── <InvestorPitchRenderer>    → render with data prop\n```\n\nThe parent app owns layout and orchestration. Each template renderer is self-contained — it sets its own fonts, colors, and spacing without leaking global styles. For PDF export, templates include `@media print` CSS so the parent app can simply call `window.print()` or use server-side rendering.\n\n## Install\n\n```bash\nnpm install @albionlabs/brochure-templates\n```\n\nRequires `svelte ^5.0.0` as a peer dependency.\n\n## Usage\n\n### Registry API\n\nThe registry lets a parent app enumerate templates dynamically — useful for building a template picker or factory UI where users choose which brochure to create.\n\n```ts\nimport { listTemplates, getTemplate } from '@albionlabs/brochure-templates';\n\n// List all available templates (returns TemplateDefinition[])\nconst templates = listTemplates();\ntemplates.forEach(t => console.log(t.meta.name));\n\n// Get a specific template by ID\nconst template = getTemplate('investor-pitch');\n// template.renderer   — Svelte component accepting { data }\n// template.schema     — JSON Schema object (for ajv validation or form generation)\n// template.sampleData — example data to render immediately\n// template.meta       — { id, name, description, version, category }\n```\n\n### Rendering a template\n\n```svelte\n<script>\n  import { getTemplate } from '@albionlabs/brochure-templates';\n\n  const template = getTemplate('investor-pitch');\n  const Renderer = template.renderer;\n  const data = template.sampleData; // or your own data\n</script>\n\n<Renderer {data} />\n```\n\n### Direct imports (tree-shakeable)\n\nIf you know which template you need, import it directly to avoid pulling in the full registry:\n\n```svelte\n<script>\n  import { InvestorPitchRenderer } from '@albionlabs/brochure-templates';\n  import type { InvestorPitch } from '@albionlabs/brochure-templates';\n\n  let { data }: { data: InvestorPitch } = $props();\n</script>\n\n<InvestorPitchRenderer {data} />\n```\n\nYou can also import from the template sub-path:\n\n```ts\nimport { InvestorPitchRenderer, investorPitchSchema } from '@albionlabs/brochure-templates/templates/investor-pitch';\n```\n\n### Schema validation\n\nEach template ships a JSON Schema that describes the exact shape of its data. Use it with any JSON Schema validator (e.g. ajv) to validate user input before rendering, or to generate forms automatically.\n\n```ts\nimport Ajv from 'ajv';\nimport { investorPitchSchema } from '@albionlabs/brochure-templates';\n\nconst ajv = new Ajv();\nconst validate = ajv.compile(investorPitchSchema);\n\nif (!validate(userData)) {\n  console.error(validate.errors);\n}\n```\n\n### Print / PDF\n\nTemplate renderers include `@media print` styles for clean PDF output. The investor-pitch template is optimized for A4 landscape. To generate a PDF from the parent app:\n\n```ts\nwindow.print();\n```\n\nOr use a headless browser (Puppeteer, Playwright) for server-side PDF generation.\n\n## Available templates\n\n| Template | ID | Category | Description |\n|---|---|---|---|\n| Investor Pitch | `investor-pitch` | `investor-relations` | Single-page investor summary with key metrics, portfolio charts, sensitivity analysis, timeline, and risk overview |\n\n## Adding a new template\n\n1. Create a new directory under `src/lib/templates/<template-id>/`\n2. Add the required files:\n   - `types.ts` — data type definitions\n   - `schema.json` — JSON Schema matching the types\n   - `sample.json` — example data\n   - `meta.ts` — template metadata (id, name, description, version, category)\n   - `<Name>Renderer.svelte` — renderer component accepting `{ data }`\n   - `components/` — internal components used by the renderer\n   - `print.css` — `@media print` overrides\n   - `index.ts` — barrel export\n3. Register the template in `src/lib/registry.ts`\n4. Re-export from `src/lib/index.ts`\n5. Add an export path in `package.json` under `exports`\n\n## Development\n\n```bash\nnpm install\nnpm run dev       # Start dev preview at localhost (renders sample data)\nnpm run check     # TypeScript / Svelte type checking\nnpm run package   # Build library output to dist/\n```\n\nThe `src/routes/` directory contains a dev preview app that renders templates using the registry with sample data. It is excluded from the published npm package.\n\n## Publishing\n\nReleases are published to npm automatically via GitHub Actions (OIDC trusted publishing) when a version tag is pushed:\n\n```bash\nnpm version patch  # or minor / major — bumps version and creates a git tag\ngit push --follow-tags\n```\n","readmeFilename":"README.md"}