@5cover/lectern 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.js +7 -1
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/client/entry.js +119 -0
  5. package/dist/client/entry.js.map +1 -0
  6. package/dist/client/graph-CUYNIBIQ.js +407 -0
  7. package/dist/client/graph-CUYNIBIQ.js.map +1 -0
  8. package/dist/index.js +3 -4
  9. package/dist/index.js.map +1 -1
  10. package/package.json +4 -5
  11. package/src/cli/build.ts +0 -79
  12. package/src/cli/dev.ts +0 -58
  13. package/src/cli/index.ts +0 -126
  14. package/src/cli/paths.ts +0 -81
  15. package/src/cli/pdf.ts +0 -70
  16. package/src/cli/render.ts +0 -40
  17. package/src/cli/rules.ts +0 -31
  18. package/src/cli/serve.ts +0 -112
  19. package/src/client/entry.ts +0 -170
  20. package/src/client/graph.tsx +0 -207
  21. package/src/components/Deck.tsx +0 -19
  22. package/src/components/InfographDiscovery.tsx +0 -51
  23. package/src/components/layout.tsx +0 -145
  24. package/src/components/mechanics.tsx +0 -74
  25. package/src/components/util.ts +0 -12
  26. package/src/index.ts +0 -37
  27. package/src/infographDiscovery.ts +0 -188
  28. package/src/infographDiscoveryView.tsx +0 -202
  29. package/src/jsx-runtime.ts +0 -4
  30. package/src/profiles/engie/assets/engie-logo-dark.svg +0 -1
  31. package/src/profiles/engie/assets/engie-logo-white.svg +0 -6
  32. package/src/profiles/engie/assets.d.ts +0 -4
  33. package/src/profiles/engie/atoms.tsx +0 -203
  34. package/src/profiles/engie/index.ts +0 -44
  35. package/src/profiles/engie/profile.ts +0 -132
  36. package/src/profiles/engie/slides.tsx +0 -230
  37. package/src/profiles/index.ts +0 -30
  38. package/src/profiles/types.ts +0 -49
  39. package/src/render/renderDeck.tsx +0 -74
  40. package/src/render/template.ts +0 -68
  41. package/src/types.ts +0 -53
  42. /package/{src → dist}/profiles/engie/engie.css +0 -0
package/README.md CHANGED
@@ -233,7 +233,7 @@ flowchart LR
233
233
  H --> O["dev / static / PDF"]
234
234
  ```
235
235
 
236
- The `engie` stylesheet (`src/profiles/engie/engie.css`) builds on Fluid's `--nj-*` design tokens, so an ENGIE deck is on-brand with zero per-slide styling.
236
+ The `@5cover/lectern/engie.css` stylesheet builds on Fluid's `--nj-*` design tokens, so an ENGIE deck is on-brand with zero per-slide styling.
237
237
 
238
238
  ## Notes
239
239
 
package/dist/cli/index.js CHANGED
@@ -156,7 +156,10 @@ var init_paths = __esm({
156
156
  join(BASE, "profiles", "engie", "index.ts"),
157
157
  join(PACKAGE_ROOT, "dist", "profiles", "engie", "index.js")
158
158
  );
159
- ENGIE_STYLESHEET = join(PACKAGE_ROOT, "src", "profiles", "engie", "engie.css");
159
+ ENGIE_STYLESHEET = firstExisting(
160
+ join(PACKAGE_ROOT, "src", "profiles", "engie", "engie.css"),
161
+ join(PACKAGE_ROOT, "dist", "profiles", "engie", "engie.css")
162
+ );
160
163
  }
161
164
  });
162
165
 
@@ -426,6 +429,7 @@ __export(dev_exports, {
426
429
  dev: () => dev
427
430
  });
428
431
  import http from "http";
432
+ import { relative } from "path";
429
433
  import { createServer as createServer2 } from "vite";
430
434
  async function dev({ deckPath, port }) {
431
435
  const server = await createServer2({
@@ -435,6 +439,8 @@ async function dev({ deckPath, port }) {
435
439
  appType: "custom",
436
440
  esbuild: { jsx: "automatic", jsxImportSource: "@5cover/lectern" },
437
441
  resolve: { alias: presentAlias() },
442
+ // The deck HTML is generated on demand, so Vite cannot discover this entry from disk.
443
+ optimizeDeps: { entries: [posix(relative(process.cwd(), CLIENT_ENTRY))] },
438
444
  server: { middlewareMode: true, fs: { allow: fsAllow(deckPath) } }
439
445
  });
440
446
  async function renderPage(url2) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/rules.ts","../../src/render/template.ts","../../src/cli/paths.ts","../../src/cli/render.ts","../../src/cli/build.ts","../../src/profiles/engie/profile.ts","../../src/profiles/index.ts","../../src/cli/dev.ts","../../src/cli/serve.ts","../../src/cli/pdf.ts","../../src/cli/index.ts"],"sourcesContent":["import type { Profile, RuleSeverity } from '../profiles/types'\n\nconst SEVERITY_LABEL: Record<RuleSeverity, string> = {\n must: 'MUST',\n should: 'SHOULD',\n advisory: 'ADVISORY',\n}\n\nconst useColor = process.stdout.isTTY\nconst bold = (s: string) => (useColor ? `\\x1b[1m${s}\\x1b[0m` : s)\nconst dim = (s: string) => (useColor ? `\\x1b[2m${s}\\x1b[0m` : s)\nconst blue = (s: string) => (useColor ? `\\x1b[38;5;39m${s}\\x1b[0m` : s)\n\n/** Print a profile's natural-language rulebook. */\nexport function rules(profile: Profile): void {\n console.log()\n console.log(` ${bold(profile.label)} ${dim(`(${profile.name})`)} — presentation rules`)\n console.log(` ${dim(profile.description)}`)\n\n for (const group of profile.rules) {\n console.log()\n console.log(` ${blue(`▸ ${group.title}`)}`)\n for (const r of group.rules) {\n const tag = `[${SEVERITY_LABEL[r.severity]}]`.padEnd(11)\n console.log(` ${dim(tag)} ${r.statement}`)\n }\n }\n console.log()\n console.log(dim(` Guidelines are descriptive; linting is not implemented yet.`))\n console.log()\n}\n","import type { ResolvedDeckMeta } from '../types'\n\nexport interface ShellInput {\n meta: ResolvedDeckMeta\n slidesHtml: string\n /**\n * Injected before `</body>`\n *\n * Typically the bundled client entry script.\n */\n bodyScripts: string\n /**\n * Injected into `<head>`\n *\n * Extra CSS/link tags.\n */\n headTags: string\n}\n\nfunction escapeHtml(s: string): string {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;')\n}\n\n/** Serialize deck config for the client, safe to embed in a `<script>`. */\nfunction configScript(meta: ResolvedDeckMeta): string {\n const config = {\n profile: meta.profile,\n transition: meta.transition ?? 'slide',\n reveal: meta.reveal ?? {},\n }\n // Escape `<` to avoid breaking out of the script element.\n const json = JSON.stringify(config).replace(/</g, '\\\\u003c')\n return `<script type=\"application/json\" id=\"lectern-config\">${json}</script>`\n}\n\nfunction footer(meta: ResolvedDeckMeta): string {\n if (!meta.footer && !meta.author) return ''\n const parts: string[] = []\n if (meta.author) parts.push(`<span class=\"lectern-footer-brand\">${escapeHtml(meta.author)}</span>`)\n if (meta.footer) parts.push(`<span>${escapeHtml(meta.footer)}</span>`)\n return `<div class=\"lectern-footer\">${parts.join(`<span class=\"lectern-sep\"> · </span>`)}</div>`\n}\n\n/**\n * Assemble the complete HTML document. The client entry (bundled by the CLI)\n * imports all CSS/JS, so the <head> here stays minimal.\n */\nexport function htmlShell({ meta, slidesHtml, bodyScripts, headTags }: ShellInput): string {\n return `<!doctype html>\n<html lang=\"fr\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\" />\n <title>${escapeHtml(meta.title)}</title>\n ${headTags}\n </head>\n <body>\n <div class=\"reveal profile-${meta.profile}\">\n <div class=\"slides\">\n${slidesHtml}\n </div>\n ${footer(meta)}\n </div>\n ${configScript(meta)}\n ${bodyScripts}\n </body>\n</html>`\n}\n","import { existsSync } from 'node:fs'\nimport { isAbsolute, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Profile } from '../profiles/types'\n\n/** Convert any OS path to a POSIX-style path (safe in import specifiers / Vite ids). */\nexport function posix(p: string): string {\n return p.replace(/\\\\/g, '/')\n}\n\n/** Package root: two levels up from src/cli or dist/cli. */\nexport const PACKAGE_ROOT = resolve(import.meta.dirname, '..', '..')\n\n/**\n * Prefer running from source (`src/`), the client entry imports raw CSS which only Vite should process. Fall back to `dist/` for an installed package.\n */\nfunction pickBase(): string {\n const srcClient = join(PACKAGE_ROOT, 'src', 'client', 'entry.ts')\n if (existsSync(srcClient)) return join(PACKAGE_ROOT, 'src')\n return join(PACKAGE_ROOT, 'dist')\n}\n\nconst BASE = pickBase()\n\nfunction firstExisting(...candidates: string[]): string {\n for (const c of candidates) if (existsSync(c)) return c\n return candidates[0]\n}\n\n/** Absolute path to the browser client entry (Vite processes it). */\nexport const CLIENT_ENTRY = firstExisting(join(BASE, 'client', 'entry.ts'), join(BASE, 'client', 'entry.js'))\n\n/** Absolute path to the SSR renderDeck module. */\nexport const RENDER_MODULE = firstExisting(\n join(BASE, 'render', 'renderDeck.tsx'),\n join(BASE, 'render', 'renderDeck.ts'),\n join(BASE, 'render', 'renderDeck.js'),\n join(PACKAGE_ROOT, 'dist', 'index.js')\n)\n\n/** Public package entry, used for the `lectern` alias during in-repo runs. */\nconst INDEX_MODULE = firstExisting(join(BASE, 'index.ts'), join(PACKAGE_ROOT, 'dist', 'index.js'))\nconst JSX_MODULE = firstExisting(join(BASE, 'jsx-runtime.ts'), join(PACKAGE_ROOT, 'dist', 'jsx-runtime.js'))\nconst ENGIE_MODULE = firstExisting(\n join(BASE, 'profiles', 'engie', 'index.ts'),\n join(PACKAGE_ROOT, 'dist', 'profiles', 'engie', 'index.js')\n)\nconst ENGIE_STYLESHEET = join(PACKAGE_ROOT, 'src', 'profiles', 'engie', 'engie.css')\n\n/**\n * Source of the browser entry module: lectern's client runtime, then the\n * profile's stylesheet, so profile rules come last in the cascade.\n */\nexport function clientEntrySource(profile: Profile): string {\n const imports = [posix(CLIENT_ENTRY)]\n const { stylesheet } = profile\n if (stylesheet) {\n const spec = String(stylesheet)\n imports.push(spec.startsWith('file:') ? posix(fileURLToPath(spec)) : isAbsolute(spec) ? posix(spec) : spec)\n }\n return imports.map(i => `import ${JSON.stringify(i)};`).join('\\n')\n}\n\n/**\n * When running inside the `lectern` repo, decks import the bare `lectern` specifier, which node_modules can't resolve (this *is* that package).\n * Alias it to the local source. Harmless for installed usage (the real package resolves first, this alias only kicks in when it points at src).\n */\nexport function presentAlias(): Array<{ find: RegExp; replacement: string }> {\n return [\n { find: /^@5cover\\/lectern$/, replacement: INDEX_MODULE },\n { find: /^@5cover\\/lectern\\/jsx-runtime$/, replacement: JSX_MODULE },\n { find: /^@5cover\\/lectern\\/jsx-dev-runtime$/, replacement: JSX_MODULE },\n { find: /^@5cover\\/lectern\\/engie$/, replacement: ENGIE_MODULE },\n { find: /^@5cover\\/lectern\\/engie\\.css$/, replacement: ENGIE_STYLESHEET },\n { find: /^lectern\\/jsx-runtime$/, replacement: JSX_MODULE },\n { find: /^lectern\\/jsx-dev-runtime$/, replacement: JSX_MODULE },\n { find: /^lectern\\/engie$/, replacement: ENGIE_MODULE },\n { find: /^lectern\\/engie\\.css$/, replacement: ENGIE_STYLESHEET },\n { find: /^lectern$/, replacement: INDEX_MODULE },\n ]\n}\n","import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { dirname, join } from 'node:path'\nimport type { ViteDevServer } from 'vite'\nimport type { Profile } from '../profiles/types'\nimport type { ResolvedDeckMeta } from '../types'\nimport { CLIENT_ENTRY, PACKAGE_ROOT, RENDER_MODULE, posix } from './paths'\n\nexport interface RenderedDeck {\n meta: ResolvedDeckMeta\n profile: Profile\n slidesHtml: string\n}\n\n/**\n * Render the deck INSIDE the Vite SSR graph so the deck's VNodes and\n * `renderDeck` share one Preact instance (avoids dual-instance Fragment bugs).\n * We do this by loading a tiny generated harness module through ssrLoadModule.\n */\nexport async function renderDeckViaVite(server: ViteDevServer, deckPath: string): Promise<RenderedDeck> {\n const harnessDir = mkdtempSync(join(tmpdir(), 'lectern-harness-'))\n const harnessPath = join(harnessDir, 'harness.tsx')\n const source = [\n `import deckModule from ${JSON.stringify(posix(deckPath))};`,\n `import { renderDeck } from ${JSON.stringify(posix(RENDER_MODULE))};`,\n `export function run() { return renderDeck(deckModule); }`,\n ].join('\\n')\n writeFileSync(harnessPath, source, 'utf8')\n try {\n const mod = await server.ssrLoadModule(posix(harnessPath))\n return (mod.run as () => RenderedDeck)()\n } finally {\n rmSync(harnessDir, { recursive: true, force: true })\n }\n}\n\n/** Vite fs.allow list covering the package, deck and temp locations. */\nexport function fsAllow(deckPath: string): string[] {\n return [PACKAGE_ROOT, dirname(deckPath), dirname(CLIENT_ENTRY), tmpdir(), process.cwd()]\n}\n","import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\nimport { createServer, build as viteBuild } from 'vite'\nimport { viteSingleFile } from 'vite-plugin-singlefile'\nimport { htmlShell } from '../render/template'\nimport { clientEntrySource, presentAlias } from './paths'\nimport { fsAllow, renderDeckViaVite, type RenderedDeck } from './render'\n\nexport interface BuildOptions {\n deckPath: string\n outDir: string\n /** Inline all assets into a single index.html (default true). */\n singleFile?: boolean\n}\n\n/** SSR-render the deck to { meta, slidesHtml } using a throwaway Vite server. */\nexport async function renderStatic(deckPath: string): Promise<RenderedDeck> {\n const server = await createServer({\n configFile: false,\n root: process.cwd(),\n logLevel: 'warn',\n appType: 'custom',\n esbuild: { jsx: 'automatic', jsxImportSource: '@5cover/lectern' },\n resolve: { alias: presentAlias() },\n server: { middlewareMode: true, fs: { allow: fsAllow(deckPath) } },\n })\n try {\n return await renderDeckViaVite(server, deckPath)\n } finally {\n await server.close()\n }\n}\n\n/**\n * Build a self-contained static deck. The slides are pre-rendered into\n * index.html; a single Vite pass bundles the client runtime (reveal + mermaid)\n * with the profile's stylesheet and, by default, inlines everything into one file.\n */\nexport async function build({ deckPath, outDir, singleFile = true }: BuildOptions): Promise<string> {\n const { meta, profile, slidesHtml } = await renderStatic(deckPath)\n\n // The build root must sit inside the project so its `node_modules`\n // (preact, reveal.js, mermaid, fluid…) resolves during bundling.\n const tmpBase = join(process.cwd(), 'node_modules', '.lectern-tmp')\n mkdirSync(tmpBase, { recursive: true })\n const workDir = mkdtempSync(join(tmpBase, 'build-'))\n // A local entry that re-exports the package client entry (keeps its own\n // relative CSS imports resolving from the real location) and the profile's stylesheet.\n writeFileSync(join(workDir, 'lectern-entry.ts'), `${clientEntrySource(profile)}\\n`, 'utf8')\n const clientTag = `<script type=\"module\" src=\"./lectern-entry.ts\"></script>`\n writeFileSync(\n join(workDir, 'index.html'),\n htmlShell({ meta, slidesHtml, bodyScripts: clientTag, headTags: '' }),\n 'utf8'\n )\n\n const outAbs = resolve(process.cwd(), outDir)\n try {\n await viteBuild({\n configFile: false,\n root: workDir,\n logLevel: 'warn',\n esbuild: { jsx: 'automatic', jsxImportSource: '@5cover/lectern' },\n resolve: { alias: presentAlias() },\n plugins: singleFile ? [viteSingleFile()] : [],\n build: {\n outDir: outAbs,\n emptyOutDir: true,\n assetsInlineLimit: singleFile ? Number.MAX_SAFE_INTEGER : 4096,\n chunkSizeWarningLimit: 4096,\n },\n server: { fs: { allow: fsAllow(deckPath) } },\n })\n } finally {\n rmSync(workDir, { recursive: true, force: true })\n }\n\n return join(outAbs, 'index.html')\n}\n","import type { Profile } from '../types'\n\n/**\n * ENGIE / Fluid profile — derived from the official \"ENGIE PowerPoint Template\".\n * Look lives in `engie.css` (Fluid + the template layer). This module holds\n * the Node-safe data: stylesheet, reveal defaults and the natural-language rulebook.\n */\nexport const engie: Profile = {\n name: 'engie',\n label: 'ENGIE / Fluid',\n description:\n 'ENGIE corporate house style (Fluid design system): navy #17255F & ENGIE blue #007bc5, Fluid typography, 16:9.',\n stylesheet: '@5cover/lectern/engie.css',\n reveal: {\n // 16:9 design canvas. Reveal scales this scene to the available viewport\n // while preserving its proportions.\n width: 1280,\n height: 720,\n slideNumber: 'c/t',\n // Corporate decks are top-anchored (title at top, logo pinned to the corner),\n // not vertically centred — so disable reveal's vertical centering.\n center: false,\n margin: 0,\n },\n rules: [\n {\n title: 'Structure & titles',\n rules: [\n {\n id: 'presentation-title-lines',\n statement: 'The cover title fits in two or three lines maximum.',\n severity: 'should',\n },\n {\n id: 'slide-title-lines',\n statement: 'A slide title is two or three lines maximum — ideally one. The subtitle is one line maximum.',\n severity: 'should',\n },\n {\n id: 'two-title-levels',\n statement: 'Use a second title level (title + subtitle) only when it genuinely adds structure.',\n severity: 'advisory',\n },\n {\n id: 'chapters-numbered',\n statement:\n 'Introduce each chapter with a numbered section divider (01, 02, …); a Summary slide lists the chapters.',\n severity: 'should',\n },\n {\n id: 'one-idea-per-slide',\n statement: 'Prefer one message per slide; keep body copy concise.',\n severity: 'advisory',\n },\n ],\n },\n {\n title: 'Confidentiality & rights',\n rules: [\n {\n id: 'confidentiality-level',\n statement:\n 'Every deck declares a confidentiality level: Non-confidential, Confidential, or Strictly confidential.',\n severity: 'must',\n },\n {\n id: 'visual-rights',\n statement:\n 'Iconography and visuals are for internal use only — verify the rights of every visual you include.',\n severity: 'must',\n },\n ],\n },\n {\n title: 'Footer',\n rules: [\n {\n id: 'footer-format',\n statement: 'Footer format: \"© ENGIE {year} - {presentation title} - {date} - {page}\".',\n severity: 'should',\n },\n ],\n },\n {\n title: 'Colours',\n rules: [\n {\n id: 'primary-colours',\n statement: 'Primary palette: navy #17255F, ENGIE blue #007bc5, teal #00817d, purple #6c4796.',\n severity: 'should',\n },\n {\n id: 'accent-colours',\n statement: 'Accent palette: coral #eb5d40, magenta #e94287, yellow #f4c867 — use for emphasis, sparingly.',\n severity: 'advisory',\n },\n {\n id: 'secondary-colours',\n statement:\n 'Secondary palette: #e18554, #4bb0b9, #67ae6e, #278cbc. Tints at 50% and 20% are available for backgrounds.',\n severity: 'advisory',\n },\n ],\n },\n {\n title: 'Typography',\n rules: [\n {\n id: 'fonts',\n statement:\n 'Typography follows the Fluid design system (Lato, with system fallbacks); titles are bold, body is regular.',\n severity: 'should',\n },\n ],\n },\n {\n title: 'Format & figures',\n rules: [\n {\n id: 'aspect-ratio',\n statement: 'Slides are 16:9.',\n severity: 'must',\n },\n {\n id: 'kpi-style',\n statement: 'Highlight key figures as a large number with a short label (e.g. \"9-10 Md€\").',\n severity: 'advisory',\n },\n ],\n },\n ],\n}\n","import type { Profile } from './types'\nimport { engie } from './engie/profile'\n\n/** All registered profiles, keyed by name. */\nexport const profiles: Record<string, Profile> = {\n engie,\n}\n\n/** The default profile applied when a deck doesn't name one. */\nexport const DEFAULT_PROFILE = 'engie'\n\n/** Look up a profile by name; returns undefined if unknown. */\nexport function getProfile(name: string | undefined): Profile | undefined {\n return profiles[name ?? DEFAULT_PROFILE]\n}\n\n/** Names of all registered profiles. */\nexport function profileNames(): string[] {\n return Object.keys(profiles)\n}\n\n/** Resolve a deck's `profile` (object or built-in name) to a profile; throws on an unknown name. */\nexport function resolveProfile(profile: string | Profile | undefined): Profile {\n if (typeof profile === 'object') return profile\n const found = getProfile(profile)\n if (!found) throw new Error(`Unknown profile: \"${profile}\". Available: ${profileNames().join(', ')}`)\n return found\n}\n\nexport type { Profile, Rule, RuleGroup, RuleSeverity } from './types'\n","import http from 'node:http'\nimport { createServer } from 'vite'\nimport { htmlShell } from '../render/template'\nimport { clientEntrySource, presentAlias } from './paths'\nimport { fsAllow, renderDeckViaVite } from './render'\n\nexport interface DevOptions {\n deckPath: string\n port: number\n}\n\nexport async function dev({ deckPath, port }: DevOptions): Promise<void> {\n const server = await createServer({\n configFile: false,\n root: process.cwd(),\n logLevel: 'warn',\n appType: 'custom',\n esbuild: { jsx: 'automatic', jsxImportSource: '@5cover/lectern' },\n resolve: { alias: presentAlias() },\n server: { middlewareMode: true, fs: { allow: fsAllow(deckPath) } },\n })\n\n async function renderPage(url: string): Promise<string> {\n const { meta, profile, slidesHtml } = await renderDeckViaVite(server, deckPath)\n const clientTag = `<script type=\"module\">${clientEntrySource(profile)}</script>`\n const html = htmlShell({ meta, slidesHtml, bodyScripts: clientTag, headTags: '' })\n return server.transformIndexHtml(url, html)\n }\n\n const httpServer = http.createServer((req, res) => {\n server.middlewares(req, res, async () => {\n try {\n const html = await renderPage(req.url ?? '/')\n res.statusCode = 200\n res.setHeader('content-type', 'text/html; charset=utf-8')\n res.end(html)\n } catch (err) {\n server.ssrFixStacktrace(err as Error)\n res.statusCode = 500\n res.setHeader('content-type', 'text/plain; charset=utf-8')\n res.end(`lectern dev error:\\n\\n${(err as Error).stack ?? String(err)}`)\n }\n })\n })\n\n // reveal owns the DOM, so any source change triggers a full page reload.\n server.watcher.on('change', () => {\n server.moduleGraph.invalidateAll()\n server.ws.send({ type: 'full-reload' })\n })\n\n await new Promise<void>(res => httpServer.listen(port, res))\n const url = `http://localhost:${port}/`\n // eslint-disable-next-line no-console\n console.log(\n `\\n lectern dev server running\\n ➜ ${url}\\n Editing ${deckPath} reloads automatically. Ctrl+C to stop.\\n`\n )\n}\n","import http, { type Server } from 'node:http'\nimport { mkdtempSync, readFileSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join } from 'node:path'\nimport { build } from './build'\n\nexport interface ServeOptions {\n deckPath: string\n port: number\n host: string\n}\n\nexport interface ServeHandle {\n url: string\n close(): Promise<void>\n}\n\n/**\n * Build a deck into a temporary, single-file production bundle and host it\n * locally. Unlike `dev`, this never starts Vite's development server or\n * watches source files.\n */\nexport async function serve({ deckPath, port, host }: ServeOptions): Promise<ServeHandle> {\n const outDir = mkdtempSync(join(tmpdir(), 'lectern-serve-'))\n let document: Buffer\n\n try {\n const indexHtml = await build({ deckPath, outDir, singleFile: true })\n document = readFileSync(indexHtml)\n } catch (err) {\n rmSync(outDir, { recursive: true, force: true })\n throw err\n }\n\n const server = http.createServer((req, res) => {\n const path = new URL(req.url ?? '/', `http://${req.headers.host ?? host}`).pathname\n if (req.method !== 'GET' && req.method !== 'HEAD') {\n res.statusCode = 405\n res.setHeader('allow', 'GET, HEAD')\n res.end()\n return\n }\n\n if (path !== '/' && path !== '/index.html') {\n res.statusCode = 404\n res.end('Not found')\n return\n }\n\n res.statusCode = 200\n res.setHeader('content-type', 'text/html; charset=utf-8')\n res.setHeader('content-length', document.length)\n if (req.method === 'HEAD') {\n res.end()\n return\n }\n res.end(document)\n })\n\n let closed = false\n const cleanup = () => rmSync(outDir, { recursive: true, force: true })\n const close = () =>\n new Promise<void>((resolve, reject) => {\n if (closed) {\n resolve()\n return\n }\n closed = true\n process.removeListener('SIGINT', shutdown)\n process.removeListener('SIGTERM', shutdown)\n server.close(err => (err ? reject(err) : resolve()))\n })\n const shutdown = () => {\n void close()\n }\n\n server.once('close', cleanup)\n process.once('SIGINT', shutdown)\n process.once('SIGTERM', shutdown)\n\n try {\n await listen(server, port, host)\n } catch (err) {\n process.removeListener('SIGINT', shutdown)\n process.removeListener('SIGTERM', shutdown)\n server.removeListener('close', cleanup)\n cleanup()\n throw err\n }\n\n const displayHost = host.includes(':') && !host.startsWith('[') ? `[${host}]` : host\n const address = server.address()\n const actualPort = typeof address === 'object' && address ? address.port : port\n return { url: `http://${displayHost}:${actualPort}/`, close }\n}\n\nfunction listen(server: Server, port: number, host: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const onError = (err: Error) => {\n server.off('listening', onListening)\n reject(err)\n }\n const onListening = () => {\n server.off('error', onError)\n resolve()\n }\n\n server.once('error', onError)\n server.once('listening', onListening)\n server.listen(port, host)\n })\n}\n","import { mkdtempSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { build } from './build'\n\nexport interface PdfOptions {\n deckPath: string\n out: string\n}\n\n/**\n * Export the deck to PDF: build a static bundle, then drive reveal.js's\n * `?print-pdf` mode with headless Chromium (Playwright) and print to PDF.\n */\nexport async function pdf({ deckPath, out }: PdfOptions): Promise<string> {\n const workDir = mkdtempSync(join(tmpdir(), 'lectern-pdf-'))\n const indexHtml = await build({ deckPath, outDir: workDir, singleFile: true })\n\n let chromium: typeof import('playwright').chromium\n try {\n ;({ chromium } = await import('playwright'))\n } catch {\n rmSync(workDir, { recursive: true, force: true })\n throw new Error(\n 'PDF export needs Playwright. Install it with:\\n pnpm add -D playwright\\n npx playwright install chromium'\n )\n }\n\n let browser\n try {\n browser = await chromium.launch()\n } catch (err) {\n rmSync(workDir, { recursive: true, force: true })\n throw new Error(\n `Could not launch Chromium. Install the browser once with:\\n npx playwright install chromium\\n\\nOriginal error: ${(err as Error).message}`\n )\n }\n\n const outAbs = resolve(process.cwd(), out)\n try {\n const page = await browser.newPage()\n const url = `${pathToFileURL(indexHtml).href}?print-pdf`\n await page.goto(url, { waitUntil: 'load' })\n\n // Wait until reveal is ready, its per-slide print pages (.pdf-page) have\n // been laid out, and every mermaid diagram has finished rendering.\n await page.waitForFunction(\n () => {\n const w = window as unknown as { Reveal?: { isReady?: () => boolean } }\n const revealReady = !!w.Reveal?.isReady?.()\n const pages = document.querySelectorAll('.pdf-page').length\n const pendingMermaid = document.querySelectorAll('.mermaid:not([data-processed])').length\n return revealReady && pages > 0 && pendingMermaid === 0\n },\n { timeout: 45_000 }\n )\n\n await page.pdf({\n path: outAbs,\n printBackground: true,\n preferCSSPageSize: true,\n })\n } finally {\n await browser.close()\n rmSync(workDir, { recursive: true, force: true })\n }\n\n return outAbs\n}\n","#!/usr/bin/env node\nimport { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { parseArgs } from 'node:util'\n\nconst HELP = `lectern - reveal.js decks authored as TSX, styled with ENGIE Fluid.\n\nUsage:\n lectern dev [deck.tsx] [--port 4321]\n lectern build [deck.tsx] [--out dist] [--no-single-file]\n lectern serve [deck.tsx] [--port 4321] [--host 127.0.0.1]\n lectern pdf [deck.tsx] [--out deck.pdf]\n lectern rules [profile | deck.tsx] (default profile: engie)\n\nArguments:\n deck.tsx Path to the deck entry (default: ./deck.tsx)\n profile Built-in profile name to describe (default: engie);\n pass a deck path to describe the profile it uses\n\nOptions:\n --port, -p Dev or production server port (default 4321)\n --host Production server host (default 127.0.0.1)\n --out, -o Output dir (build) or file (pdf)\n --no-single-file Emit separate assets instead of one inlined index.html\n --help, -h Show this help\n`\n\nfunction resolveDeck(input: string | undefined): string {\n const candidate = resolve(process.cwd(), input ?? 'deck.tsx')\n if (!existsSync(candidate)) {\n console.error(`Deck not found: ${candidate}`)\n process.exit(1)\n }\n return candidate\n}\n\nasync function main() {\n const argv = process.argv.slice(2)\n const command = argv[0]\n\n if (!command || command === '--help' || command === '-h' || command === 'help') {\n console.log(HELP)\n return\n }\n\n const { values, positionals } = parseArgs({\n args: argv.slice(1),\n allowPositionals: true,\n options: {\n port: { type: 'string', short: 'p' },\n host: { type: 'string' },\n out: { type: 'string', short: 'o' },\n 'single-file': { type: 'boolean', default: true },\n help: { type: 'boolean', short: 'h' },\n },\n })\n\n if (values.help) {\n console.log(HELP)\n return\n }\n\n // `rules` takes a built-in profile name or a deck path; a deck is rendered to find its profile.\n if (command === 'rules') {\n const { rules } = await import('./rules')\n const target = positionals[0]\n if (target && existsSync(resolve(process.cwd(), target))) {\n const { renderStatic } = await import('./build')\n rules((await renderStatic(resolveDeck(target))).profile)\n } else {\n const { resolveProfile } = await import('../profiles')\n try {\n rules(resolveProfile(target))\n } catch (err) {\n console.error((err as Error).message)\n process.exit(1)\n }\n }\n return\n }\n\n const deckPath = resolveDeck(positionals[0])\n\n switch (command) {\n case 'dev': {\n const { dev } = await import('./dev')\n await dev({ deckPath, port: values.port ? Number(values.port) : 4321 })\n break\n }\n case 'build': {\n const { build } = await import('./build')\n const outDir = values.out ?? 'dist'\n const file = await build({ deckPath, outDir, singleFile: values['single-file'] })\n console.log(`✔ Built ${file}`)\n break\n }\n case 'serve': {\n const { serve } = await import('./serve')\n const { url } = await serve({\n deckPath,\n port: values.port ? Number(values.port) : 4321,\n host: values.host ?? '127.0.0.1',\n })\n console.log(\n `\\n lectern production server running\\n ➜ ${url}\\n Built from ${deckPath}. Source changes require a restart. Ctrl+C to stop.\\n`\n )\n break\n }\n case 'pdf': {\n const { pdf } = await import('./pdf')\n const out = values.out ?? 'deck.pdf'\n const file = await pdf({ deckPath, out })\n console.log(`✔ Exported ${file}`)\n break\n }\n default:\n console.error(`Unknown command: ${command}\\n`)\n console.log(HELP)\n process.exit(1)\n }\n}\n\nmain().catch(err => {\n console.error(err)\n process.exit(1)\n})\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAcO,SAAS,MAAM,SAAwB;AAC5C,UAAQ,IAAI;AACZ,UAAQ,IAAI,KAAK,KAAK,QAAQ,KAAK,CAAC,IAAI,I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M,OAAO,OAAO,OAAO,OAAO,IAAI,IAAI,KAAK,CAAC;AACtE;AAAA,IACF;AAAA,IACA,KAAK,SAAS;AACZ,YAAM,EAAE,OAAAC,OAAM,IAAI,MAAM;AACxB,YAAM,SAAS,OAAO,OAAO;AAC7B,YAAM,OAAO,MAAMA,OAAM,EAAE,UAAU,QAAQ,YAAY,OAAO,aAAa,EAAE,CAAC;AAChF,cAAQ,IAAI,gBAAW,IAAI,EAAE;AAC7B;AAAA,IACF;AAAA,IACA,KAAK,SAAS;AACZ,YAAM,EAAE,OAAAC,OAAM,IAAI,MAAM;AACxB,YAAM,EAAE,IAAI,IAAI,MAAMA,OAAM;AAAA,QAC1B;AAAA,QACA,MAAM,OAAO,OAAO,OAAO,OAAO,IAAI,IAAI;AAAA,QAC1C,MAAM,OAAO,QAAQ;AAAA,MACvB,CAAC;AACD,cAAQ;AAAA,QACN;AAAA;AAAA,YAA+C,GAAG;AAAA,eAAkB,QAAQ;AAAA;AAAA,MAC9E;AACA;AAAA,IACF;AAAA,IACA,KAAK,OAAO;AACV,YAAM,EAAE,KAAAC,KAAI,IAAI,MAAM;AACtB,YAAM,MAAM,OAAO,OAAO;AAC1B,YAAM,OAAO,MAAMA,KAAI,EAAE,UAAU,IAAI,CAAC;AACxC,cAAQ,IAAI,mBAAc,IAAI,EAAE;AAChC;AAAA,IACF;AAAA,IACA;AACE,cAAQ,MAAM,oBAAoB,OAAO;AAAA,CAAI;AAC7C,cAAQ,IAAI,IAAI;AAChB,cAAQ,KAAK,CAAC;AAAA,EAClB;AACF;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,UAAQ,MAAM,GAAG;AACjB,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["join","mkdtempSync","rmSync","writeFileSync","join","resolve","createServer","url","http","mkdtempSync","rmSync","tmpdir","join","document","resolve","mkdtempSync","rmSync","tmpdir","join","resolve","existsSync","resolve","rules","renderStatic","resolveProfile","dev","build","serve","pdf"]}
1
+ {"version":3,"sources":["../../src/cli/rules.ts","../../src/render/template.ts","../../src/cli/paths.ts","../../src/cli/render.ts","../../src/cli/build.ts","../../src/profiles/engie/profile.ts","../../src/profiles/index.ts","../../src/cli/dev.ts","../../src/cli/serve.ts","../../src/cli/pdf.ts","../../src/cli/index.ts"],"sourcesContent":["import type { Profile, RuleSeverity } from '../profiles/types'\n\nconst SEVERITY_LABEL: Record<RuleSeverity, string> = {\n must: 'MUST',\n should: 'SHOULD',\n advisory: 'ADVISORY',\n}\n\nconst useColor = process.stdout.isTTY\nconst bold = (s: string) => (useColor ? `\\x1b[1m${s}\\x1b[0m` : s)\nconst dim = (s: string) => (useColor ? `\\x1b[2m${s}\\x1b[0m` : s)\nconst blue = (s: string) => (useColor ? `\\x1b[38;5;39m${s}\\x1b[0m` : s)\n\n/** Print a profile's natural-language rulebook. */\nexport function rules(profile: Profile): void {\n console.log()\n console.log(` ${bold(profile.label)} ${dim(`(${profile.name})`)} — presentation rules`)\n console.log(` ${dim(profile.description)}`)\n\n for (const group of profile.rules) {\n console.log()\n console.log(` ${blue(`▸ ${group.title}`)}`)\n for (const r of group.rules) {\n const tag = `[${SEVERITY_LABEL[r.severity]}]`.padEnd(11)\n console.log(` ${dim(tag)} ${r.statement}`)\n }\n }\n console.log()\n console.log(dim(` Guidelines are descriptive; linting is not implemented yet.`))\n console.log()\n}\n","import type { ResolvedDeckMeta } from '../types'\n\nexport interface ShellInput {\n meta: ResolvedDeckMeta\n slidesHtml: string\n /**\n * Injected before `</body>`\n *\n * Typically the bundled client entry script.\n */\n bodyScripts: string\n /**\n * Injected into `<head>`\n *\n * Extra CSS/link tags.\n */\n headTags: string\n}\n\nfunction escapeHtml(s: string): string {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;')\n}\n\n/** Serialize deck config for the client, safe to embed in a `<script>`. */\nfunction configScript(meta: ResolvedDeckMeta): string {\n const config = {\n profile: meta.profile,\n transition: meta.transition ?? 'slide',\n reveal: meta.reveal ?? {},\n }\n // Escape `<` to avoid breaking out of the script element.\n const json = JSON.stringify(config).replace(/</g, '\\\\u003c')\n return `<script type=\"application/json\" id=\"lectern-config\">${json}</script>`\n}\n\nfunction footer(meta: ResolvedDeckMeta): string {\n if (!meta.footer && !meta.author) return ''\n const parts: string[] = []\n if (meta.author) parts.push(`<span class=\"lectern-footer-brand\">${escapeHtml(meta.author)}</span>`)\n if (meta.footer) parts.push(`<span>${escapeHtml(meta.footer)}</span>`)\n return `<div class=\"lectern-footer\">${parts.join(`<span class=\"lectern-sep\"> · </span>`)}</div>`\n}\n\n/**\n * Assemble the complete HTML document. The client entry (bundled by the CLI)\n * imports all CSS/JS, so the <head> here stays minimal.\n */\nexport function htmlShell({ meta, slidesHtml, bodyScripts, headTags }: ShellInput): string {\n return `<!doctype html>\n<html lang=\"fr\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\" />\n <title>${escapeHtml(meta.title)}</title>\n ${headTags}\n </head>\n <body>\n <div class=\"reveal profile-${meta.profile}\">\n <div class=\"slides\">\n${slidesHtml}\n </div>\n ${footer(meta)}\n </div>\n ${configScript(meta)}\n ${bodyScripts}\n </body>\n</html>`\n}\n","import { existsSync } from 'node:fs'\nimport { isAbsolute, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Profile } from '../profiles/types'\n\n/** Convert any OS path to a POSIX-style path (safe in import specifiers / Vite ids). */\nexport function posix(p: string): string {\n return p.replace(/\\\\/g, '/')\n}\n\n/** Package root: two levels up from src/cli or dist/cli. */\nexport const PACKAGE_ROOT = resolve(import.meta.dirname, '..', '..')\n\n/**\n * Prefer running from source (`src/`), the client entry imports raw CSS which only Vite should process. Fall back to `dist/` for an installed package.\n */\nfunction pickBase(): string {\n const srcClient = join(PACKAGE_ROOT, 'src', 'client', 'entry.ts')\n if (existsSync(srcClient)) return join(PACKAGE_ROOT, 'src')\n return join(PACKAGE_ROOT, 'dist')\n}\n\nconst BASE = pickBase()\n\nfunction firstExisting(...candidates: string[]): string {\n for (const c of candidates) if (existsSync(c)) return c\n return candidates[0]\n}\n\n/** Absolute path to the browser client entry (Vite processes it). */\nexport const CLIENT_ENTRY = firstExisting(join(BASE, 'client', 'entry.ts'), join(BASE, 'client', 'entry.js'))\n\n/** Absolute path to the SSR renderDeck module. */\nexport const RENDER_MODULE = firstExisting(\n join(BASE, 'render', 'renderDeck.tsx'),\n join(BASE, 'render', 'renderDeck.ts'),\n join(BASE, 'render', 'renderDeck.js'),\n join(PACKAGE_ROOT, 'dist', 'index.js')\n)\n\n/** Public package entry, used for the `lectern` alias during in-repo runs. */\nconst INDEX_MODULE = firstExisting(join(BASE, 'index.ts'), join(PACKAGE_ROOT, 'dist', 'index.js'))\nconst JSX_MODULE = firstExisting(join(BASE, 'jsx-runtime.ts'), join(PACKAGE_ROOT, 'dist', 'jsx-runtime.js'))\nconst ENGIE_MODULE = firstExisting(\n join(BASE, 'profiles', 'engie', 'index.ts'),\n join(PACKAGE_ROOT, 'dist', 'profiles', 'engie', 'index.js')\n)\nconst ENGIE_STYLESHEET = firstExisting(\n join(PACKAGE_ROOT, 'src', 'profiles', 'engie', 'engie.css'),\n join(PACKAGE_ROOT, 'dist', 'profiles', 'engie', 'engie.css')\n)\n\n/**\n * Source of the browser entry module: lectern's client runtime, then the\n * profile's stylesheet, so profile rules come last in the cascade.\n */\nexport function clientEntrySource(profile: Profile): string {\n const imports = [posix(CLIENT_ENTRY)]\n const { stylesheet } = profile\n if (stylesheet) {\n const spec = String(stylesheet)\n imports.push(spec.startsWith('file:') ? posix(fileURLToPath(spec)) : isAbsolute(spec) ? posix(spec) : spec)\n }\n return imports.map(i => `import ${JSON.stringify(i)};`).join('\\n')\n}\n\n/**\n * When running inside the `lectern` repo, decks import the bare `lectern` specifier, which node_modules can't resolve (this *is* that package).\n * Alias it to the local source. Harmless for installed usage (the real package resolves first, this alias only kicks in when it points at src).\n */\nexport function presentAlias(): Array<{ find: RegExp; replacement: string }> {\n return [\n { find: /^@5cover\\/lectern$/, replacement: INDEX_MODULE },\n { find: /^@5cover\\/lectern\\/jsx-runtime$/, replacement: JSX_MODULE },\n { find: /^@5cover\\/lectern\\/jsx-dev-runtime$/, replacement: JSX_MODULE },\n { find: /^@5cover\\/lectern\\/engie$/, replacement: ENGIE_MODULE },\n { find: /^@5cover\\/lectern\\/engie\\.css$/, replacement: ENGIE_STYLESHEET },\n { find: /^lectern\\/jsx-runtime$/, replacement: JSX_MODULE },\n { find: /^lectern\\/jsx-dev-runtime$/, replacement: JSX_MODULE },\n { find: /^lectern\\/engie$/, replacement: ENGIE_MODULE },\n { find: /^lectern\\/engie\\.css$/, replacement: ENGIE_STYLESHEET },\n { find: /^lectern$/, replacement: INDEX_MODULE },\n ]\n}\n","import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { dirname, join } from 'node:path'\nimport type { ViteDevServer } from 'vite'\nimport type { Profile } from '../profiles/types'\nimport type { ResolvedDeckMeta } from '../types'\nimport { CLIENT_ENTRY, PACKAGE_ROOT, RENDER_MODULE, posix } from './paths'\n\nexport interface RenderedDeck {\n meta: ResolvedDeckMeta\n profile: Profile\n slidesHtml: string\n}\n\n/**\n * Render the deck INSIDE the Vite SSR graph so the deck's VNodes and\n * `renderDeck` share one Preact instance (avoids dual-instance Fragment bugs).\n * We do this by loading a tiny generated harness module through ssrLoadModule.\n */\nexport async function renderDeckViaVite(server: ViteDevServer, deckPath: string): Promise<RenderedDeck> {\n const harnessDir = mkdtempSync(join(tmpdir(), 'lectern-harness-'))\n const harnessPath = join(harnessDir, 'harness.tsx')\n const source = [\n `import deckModule from ${JSON.stringify(posix(deckPath))};`,\n `import { renderDeck } from ${JSON.stringify(posix(RENDER_MODULE))};`,\n `export function run() { return renderDeck(deckModule); }`,\n ].join('\\n')\n writeFileSync(harnessPath, source, 'utf8')\n try {\n const mod = await server.ssrLoadModule(posix(harnessPath))\n return (mod.run as () => RenderedDeck)()\n } finally {\n rmSync(harnessDir, { recursive: true, force: true })\n }\n}\n\n/** Vite fs.allow list covering the package, deck and temp locations. */\nexport function fsAllow(deckPath: string): string[] {\n return [PACKAGE_ROOT, dirname(deckPath), dirname(CLIENT_ENTRY), tmpdir(), process.cwd()]\n}\n","import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\nimport { createServer, build as viteBuild } from 'vite'\nimport { viteSingleFile } from 'vite-plugin-singlefile'\nimport { htmlShell } from '../render/template'\nimport { clientEntrySource, presentAlias } from './paths'\nimport { fsAllow, renderDeckViaVite, type RenderedDeck } from './render'\n\nexport interface BuildOptions {\n deckPath: string\n outDir: string\n /** Inline all assets into a single index.html (default true). */\n singleFile?: boolean\n}\n\n/** SSR-render the deck to { meta, slidesHtml } using a throwaway Vite server. */\nexport async function renderStatic(deckPath: string): Promise<RenderedDeck> {\n const server = await createServer({\n configFile: false,\n root: process.cwd(),\n logLevel: 'warn',\n appType: 'custom',\n esbuild: { jsx: 'automatic', jsxImportSource: '@5cover/lectern' },\n resolve: { alias: presentAlias() },\n server: { middlewareMode: true, fs: { allow: fsAllow(deckPath) } },\n })\n try {\n return await renderDeckViaVite(server, deckPath)\n } finally {\n await server.close()\n }\n}\n\n/**\n * Build a self-contained static deck. The slides are pre-rendered into\n * index.html; a single Vite pass bundles the client runtime (reveal + mermaid)\n * with the profile's stylesheet and, by default, inlines everything into one file.\n */\nexport async function build({ deckPath, outDir, singleFile = true }: BuildOptions): Promise<string> {\n const { meta, profile, slidesHtml } = await renderStatic(deckPath)\n\n // The build root must sit inside the project so its `node_modules`\n // (preact, reveal.js, mermaid, fluid…) resolves during bundling.\n const tmpBase = join(process.cwd(), 'node_modules', '.lectern-tmp')\n mkdirSync(tmpBase, { recursive: true })\n const workDir = mkdtempSync(join(tmpBase, 'build-'))\n // A local entry that re-exports the package client entry (keeps its own\n // relative CSS imports resolving from the real location) and the profile's stylesheet.\n writeFileSync(join(workDir, 'lectern-entry.ts'), `${clientEntrySource(profile)}\\n`, 'utf8')\n const clientTag = `<script type=\"module\" src=\"./lectern-entry.ts\"></script>`\n writeFileSync(\n join(workDir, 'index.html'),\n htmlShell({ meta, slidesHtml, bodyScripts: clientTag, headTags: '' }),\n 'utf8'\n )\n\n const outAbs = resolve(process.cwd(), outDir)\n try {\n await viteBuild({\n configFile: false,\n root: workDir,\n logLevel: 'warn',\n esbuild: { jsx: 'automatic', jsxImportSource: '@5cover/lectern' },\n resolve: { alias: presentAlias() },\n plugins: singleFile ? [viteSingleFile()] : [],\n build: {\n outDir: outAbs,\n emptyOutDir: true,\n assetsInlineLimit: singleFile ? Number.MAX_SAFE_INTEGER : 4096,\n chunkSizeWarningLimit: 4096,\n },\n server: { fs: { allow: fsAllow(deckPath) } },\n })\n } finally {\n rmSync(workDir, { recursive: true, force: true })\n }\n\n return join(outAbs, 'index.html')\n}\n","import type { Profile } from '../types'\n\n/**\n * ENGIE / Fluid profile — derived from the official \"ENGIE PowerPoint Template\".\n * Look lives in `engie.css` (Fluid + the template layer). This module holds\n * the Node-safe data: stylesheet, reveal defaults and the natural-language rulebook.\n */\nexport const engie: Profile = {\n name: 'engie',\n label: 'ENGIE / Fluid',\n description:\n 'ENGIE corporate house style (Fluid design system): navy #17255F & ENGIE blue #007bc5, Fluid typography, 16:9.',\n stylesheet: '@5cover/lectern/engie.css',\n reveal: {\n // 16:9 design canvas. Reveal scales this scene to the available viewport\n // while preserving its proportions.\n width: 1280,\n height: 720,\n slideNumber: 'c/t',\n // Corporate decks are top-anchored (title at top, logo pinned to the corner),\n // not vertically centred — so disable reveal's vertical centering.\n center: false,\n margin: 0,\n },\n rules: [\n {\n title: 'Structure & titles',\n rules: [\n {\n id: 'presentation-title-lines',\n statement: 'The cover title fits in two or three lines maximum.',\n severity: 'should',\n },\n {\n id: 'slide-title-lines',\n statement: 'A slide title is two or three lines maximum — ideally one. The subtitle is one line maximum.',\n severity: 'should',\n },\n {\n id: 'two-title-levels',\n statement: 'Use a second title level (title + subtitle) only when it genuinely adds structure.',\n severity: 'advisory',\n },\n {\n id: 'chapters-numbered',\n statement:\n 'Introduce each chapter with a numbered section divider (01, 02, …); a Summary slide lists the chapters.',\n severity: 'should',\n },\n {\n id: 'one-idea-per-slide',\n statement: 'Prefer one message per slide; keep body copy concise.',\n severity: 'advisory',\n },\n ],\n },\n {\n title: 'Confidentiality & rights',\n rules: [\n {\n id: 'confidentiality-level',\n statement:\n 'Every deck declares a confidentiality level: Non-confidential, Confidential, or Strictly confidential.',\n severity: 'must',\n },\n {\n id: 'visual-rights',\n statement:\n 'Iconography and visuals are for internal use only — verify the rights of every visual you include.',\n severity: 'must',\n },\n ],\n },\n {\n title: 'Footer',\n rules: [\n {\n id: 'footer-format',\n statement: 'Footer format: \"© ENGIE {year} - {presentation title} - {date} - {page}\".',\n severity: 'should',\n },\n ],\n },\n {\n title: 'Colours',\n rules: [\n {\n id: 'primary-colours',\n statement: 'Primary palette: navy #17255F, ENGIE blue #007bc5, teal #00817d, purple #6c4796.',\n severity: 'should',\n },\n {\n id: 'accent-colours',\n statement: 'Accent palette: coral #eb5d40, magenta #e94287, yellow #f4c867 — use for emphasis, sparingly.',\n severity: 'advisory',\n },\n {\n id: 'secondary-colours',\n statement:\n 'Secondary palette: #e18554, #4bb0b9, #67ae6e, #278cbc. Tints at 50% and 20% are available for backgrounds.',\n severity: 'advisory',\n },\n ],\n },\n {\n title: 'Typography',\n rules: [\n {\n id: 'fonts',\n statement:\n 'Typography follows the Fluid design system (Lato, with system fallbacks); titles are bold, body is regular.',\n severity: 'should',\n },\n ],\n },\n {\n title: 'Format & figures',\n rules: [\n {\n id: 'aspect-ratio',\n statement: 'Slides are 16:9.',\n severity: 'must',\n },\n {\n id: 'kpi-style',\n statement: 'Highlight key figures as a large number with a short label (e.g. \"9-10 Md€\").',\n severity: 'advisory',\n },\n ],\n },\n ],\n}\n","import type { Profile } from './types'\nimport { engie } from './engie/profile'\n\n/** All registered profiles, keyed by name. */\nexport const profiles: Record<string, Profile> = {\n engie,\n}\n\n/** The default profile applied when a deck doesn't name one. */\nexport const DEFAULT_PROFILE = 'engie'\n\n/** Look up a profile by name; returns undefined if unknown. */\nexport function getProfile(name: string | undefined): Profile | undefined {\n return profiles[name ?? DEFAULT_PROFILE]\n}\n\n/** Names of all registered profiles. */\nexport function profileNames(): string[] {\n return Object.keys(profiles)\n}\n\n/** Resolve a deck's `profile` (object or built-in name) to a profile; throws on an unknown name. */\nexport function resolveProfile(profile: string | Profile | undefined): Profile {\n if (typeof profile === 'object') return profile\n const found = getProfile(profile)\n if (!found) throw new Error(`Unknown profile: \"${profile}\". Available: ${profileNames().join(', ')}`)\n return found\n}\n\nexport type { Profile, Rule, RuleGroup, RuleSeverity } from './types'\n","import http from 'node:http'\nimport { relative } from 'node:path'\nimport { createServer } from 'vite'\nimport { htmlShell } from '../render/template'\nimport { CLIENT_ENTRY, clientEntrySource, posix, presentAlias } from './paths'\nimport { fsAllow, renderDeckViaVite } from './render'\n\nexport interface DevOptions {\n deckPath: string\n port: number\n}\n\nexport async function dev({ deckPath, port }: DevOptions): Promise<void> {\n const server = await createServer({\n configFile: false,\n root: process.cwd(),\n logLevel: 'warn',\n appType: 'custom',\n esbuild: { jsx: 'automatic', jsxImportSource: '@5cover/lectern' },\n resolve: { alias: presentAlias() },\n // The deck HTML is generated on demand, so Vite cannot discover this entry from disk.\n optimizeDeps: { entries: [posix(relative(process.cwd(), CLIENT_ENTRY))] },\n server: { middlewareMode: true, fs: { allow: fsAllow(deckPath) } },\n })\n\n async function renderPage(url: string): Promise<string> {\n const { meta, profile, slidesHtml } = await renderDeckViaVite(server, deckPath)\n const clientTag = `<script type=\"module\">${clientEntrySource(profile)}</script>`\n const html = htmlShell({ meta, slidesHtml, bodyScripts: clientTag, headTags: '' })\n return server.transformIndexHtml(url, html)\n }\n\n const httpServer = http.createServer((req, res) => {\n server.middlewares(req, res, async () => {\n try {\n const html = await renderPage(req.url ?? '/')\n res.statusCode = 200\n res.setHeader('content-type', 'text/html; charset=utf-8')\n res.end(html)\n } catch (err) {\n server.ssrFixStacktrace(err as Error)\n res.statusCode = 500\n res.setHeader('content-type', 'text/plain; charset=utf-8')\n res.end(`lectern dev error:\\n\\n${(err as Error).stack ?? String(err)}`)\n }\n })\n })\n\n // reveal owns the DOM, so any source change triggers a full page reload.\n server.watcher.on('change', () => {\n server.moduleGraph.invalidateAll()\n server.ws.send({ type: 'full-reload' })\n })\n\n await new Promise<void>(res => httpServer.listen(port, res))\n const url = `http://localhost:${port}/`\n // eslint-disable-next-line no-console\n console.log(\n `\\n lectern dev server running\\n ➜ ${url}\\n Editing ${deckPath} reloads automatically. Ctrl+C to stop.\\n`\n )\n}\n","import http, { type Server } from 'node:http'\nimport { mkdtempSync, readFileSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join } from 'node:path'\nimport { build } from './build'\n\nexport interface ServeOptions {\n deckPath: string\n port: number\n host: string\n}\n\nexport interface ServeHandle {\n url: string\n close(): Promise<void>\n}\n\n/**\n * Build a deck into a temporary, single-file production bundle and host it\n * locally. Unlike `dev`, this never starts Vite's development server or\n * watches source files.\n */\nexport async function serve({ deckPath, port, host }: ServeOptions): Promise<ServeHandle> {\n const outDir = mkdtempSync(join(tmpdir(), 'lectern-serve-'))\n let document: Buffer\n\n try {\n const indexHtml = await build({ deckPath, outDir, singleFile: true })\n document = readFileSync(indexHtml)\n } catch (err) {\n rmSync(outDir, { recursive: true, force: true })\n throw err\n }\n\n const server = http.createServer((req, res) => {\n const path = new URL(req.url ?? '/', `http://${req.headers.host ?? host}`).pathname\n if (req.method !== 'GET' && req.method !== 'HEAD') {\n res.statusCode = 405\n res.setHeader('allow', 'GET, HEAD')\n res.end()\n return\n }\n\n if (path !== '/' && path !== '/index.html') {\n res.statusCode = 404\n res.end('Not found')\n return\n }\n\n res.statusCode = 200\n res.setHeader('content-type', 'text/html; charset=utf-8')\n res.setHeader('content-length', document.length)\n if (req.method === 'HEAD') {\n res.end()\n return\n }\n res.end(document)\n })\n\n let closed = false\n const cleanup = () => rmSync(outDir, { recursive: true, force: true })\n const close = () =>\n new Promise<void>((resolve, reject) => {\n if (closed) {\n resolve()\n return\n }\n closed = true\n process.removeListener('SIGINT', shutdown)\n process.removeListener('SIGTERM', shutdown)\n server.close(err => (err ? reject(err) : resolve()))\n })\n const shutdown = () => {\n void close()\n }\n\n server.once('close', cleanup)\n process.once('SIGINT', shutdown)\n process.once('SIGTERM', shutdown)\n\n try {\n await listen(server, port, host)\n } catch (err) {\n process.removeListener('SIGINT', shutdown)\n process.removeListener('SIGTERM', shutdown)\n server.removeListener('close', cleanup)\n cleanup()\n throw err\n }\n\n const displayHost = host.includes(':') && !host.startsWith('[') ? `[${host}]` : host\n const address = server.address()\n const actualPort = typeof address === 'object' && address ? address.port : port\n return { url: `http://${displayHost}:${actualPort}/`, close }\n}\n\nfunction listen(server: Server, port: number, host: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const onError = (err: Error) => {\n server.off('listening', onListening)\n reject(err)\n }\n const onListening = () => {\n server.off('error', onError)\n resolve()\n }\n\n server.once('error', onError)\n server.once('listening', onListening)\n server.listen(port, host)\n })\n}\n","import { mkdtempSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { build } from './build'\n\nexport interface PdfOptions {\n deckPath: string\n out: string\n}\n\n/**\n * Export the deck to PDF: build a static bundle, then drive reveal.js's\n * `?print-pdf` mode with headless Chromium (Playwright) and print to PDF.\n */\nexport async function pdf({ deckPath, out }: PdfOptions): Promise<string> {\n const workDir = mkdtempSync(join(tmpdir(), 'lectern-pdf-'))\n const indexHtml = await build({ deckPath, outDir: workDir, singleFile: true })\n\n let chromium: typeof import('playwright').chromium\n try {\n ;({ chromium } = await import('playwright'))\n } catch {\n rmSync(workDir, { recursive: true, force: true })\n throw new Error(\n 'PDF export needs Playwright. Install it with:\\n pnpm add -D playwright\\n npx playwright install chromium'\n )\n }\n\n let browser\n try {\n browser = await chromium.launch()\n } catch (err) {\n rmSync(workDir, { recursive: true, force: true })\n throw new Error(\n `Could not launch Chromium. Install the browser once with:\\n npx playwright install chromium\\n\\nOriginal error: ${(err as Error).message}`\n )\n }\n\n const outAbs = resolve(process.cwd(), out)\n try {\n const page = await browser.newPage()\n const url = `${pathToFileURL(indexHtml).href}?print-pdf`\n await page.goto(url, { waitUntil: 'load' })\n\n // Wait until reveal is ready, its per-slide print pages (.pdf-page) have\n // been laid out, and every mermaid diagram has finished rendering.\n await page.waitForFunction(\n () => {\n const w = window as unknown as { Reveal?: { isReady?: () => boolean } }\n const revealReady = !!w.Reveal?.isReady?.()\n const pages = document.querySelectorAll('.pdf-page').length\n const pendingMermaid = document.querySelectorAll('.mermaid:not([data-processed])').length\n return revealReady && pages > 0 && pendingMermaid === 0\n },\n { timeout: 45_000 }\n )\n\n await page.pdf({\n path: outAbs,\n printBackground: true,\n preferCSSPageSize: true,\n })\n } finally {\n await browser.close()\n rmSync(workDir, { recursive: true, force: true })\n }\n\n return outAbs\n}\n","#!/usr/bin/env node\nimport { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { parseArgs } from 'node:util'\n\nconst HELP = `lectern - reveal.js decks authored as TSX, styled with ENGIE Fluid.\n\nUsage:\n lectern dev [deck.tsx] [--port 4321]\n lectern build [deck.tsx] [--out dist] [--no-single-file]\n lectern serve [deck.tsx] [--port 4321] [--host 127.0.0.1]\n lectern pdf [deck.tsx] [--out deck.pdf]\n lectern rules [profile | deck.tsx] (default profile: engie)\n\nArguments:\n deck.tsx Path to the deck entry (default: ./deck.tsx)\n profile Built-in profile name to describe (default: engie);\n pass a deck path to describe the profile it uses\n\nOptions:\n --port, -p Dev or production server port (default 4321)\n --host Production server host (default 127.0.0.1)\n --out, -o Output dir (build) or file (pdf)\n --no-single-file Emit separate assets instead of one inlined index.html\n --help, -h Show this help\n`\n\nfunction resolveDeck(input: string | undefined): string {\n const candidate = resolve(process.cwd(), input ?? 'deck.tsx')\n if (!existsSync(candidate)) {\n console.error(`Deck not found: ${candidate}`)\n process.exit(1)\n }\n return candidate\n}\n\nasync function main() {\n const argv = process.argv.slice(2)\n const command = argv[0]\n\n if (!command || command === '--help' || command === '-h' || command === 'help') {\n console.log(HELP)\n return\n }\n\n const { values, positionals } = parseArgs({\n args: argv.slice(1),\n allowPositionals: true,\n options: {\n port: { type: 'string', short: 'p' },\n host: { type: 'string' },\n out: { type: 'string', short: 'o' },\n 'single-file': { type: 'boolean', default: true },\n help: { type: 'boolean', short: 'h' },\n },\n })\n\n if (values.help) {\n console.log(HELP)\n return\n }\n\n // `rules` takes a built-in profile name or a deck path; a deck is rendered to find its profile.\n if (command === 'rules') {\n const { rules } = await import('./rules')\n const target = positionals[0]\n if (target && existsSync(resolve(process.cwd(), target))) {\n const { renderStatic } = await import('./build')\n rules((await renderStatic(resolveDeck(target))).profile)\n } else {\n const { resolveProfile } = await import('../profiles')\n try {\n rules(resolveProfile(target))\n } catch (err) {\n console.error((err as Error).message)\n process.exit(1)\n }\n }\n return\n }\n\n const deckPath = resolveDeck(positionals[0])\n\n switch (command) {\n case 'dev': {\n const { dev } = await import('./dev')\n await dev({ deckPath, port: values.port ? Number(values.port) : 4321 })\n break\n }\n case 'build': {\n const { build } = await import('./build')\n const outDir = values.out ?? 'dist'\n const file = await build({ deckPath, outDir, singleFile: values['single-file'] })\n console.log(`✔ Built ${file}`)\n break\n }\n case 'serve': {\n const { serve } = await import('./serve')\n const { url } = await serve({\n deckPath,\n port: values.port ? Number(values.port) : 4321,\n host: values.host ?? '127.0.0.1',\n })\n console.log(\n `\\n lectern production server running\\n ➜ ${url}\\n Built from ${deckPath}. Source changes require a restart. Ctrl+C to stop.\\n`\n )\n break\n }\n case 'pdf': {\n const { pdf } = await import('./pdf')\n const out = values.out ?? 'deck.pdf'\n const file = await pdf({ deckPath, out })\n console.log(`✔ Exported ${file}`)\n break\n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AAC;AACxC,cAAQ,IAAI,mBAAc,IAAI,EAAE;AAChC;AAAA,IACF;AAAA,IACA;AACE,cAAQ,MAAM,oBAAoB,OAAO;AAAA,CAAI;AAC7C,cAAQ,IAAI,IAAI;AAChB,cAAQ,KAAK,CAAC;AAAA,EAClB;AACF;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,UAAQ,MAAM,GAAG;AACjB,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["join","mkdtempSync","rmSync","writeFileSync","join","resolve","createServer","url","http","mkdtempSync","rmSync","tmpdir","join","document","resolve","mkdtempSync","rmSync","tmpdir","join","resolve","existsSync","resolve","rules","renderStatic","resolveProfile","dev","build","serve","pdf"]}
@@ -0,0 +1,119 @@
1
+ // src/client/entry.ts
2
+ import mermaid from "mermaid";
3
+ import Reveal from "reveal.js";
4
+ import RevealHighlight from "reveal.js/plugin/highlight";
5
+ import RevealNotes from "reveal.js/plugin/notes";
6
+ import "reveal.js/plugin/highlight/monokai.css";
7
+ import "reveal.js/reveal.css";
8
+ function readConfig() {
9
+ const el = document.getElementById("lectern-config");
10
+ if (!el?.textContent) return {};
11
+ try {
12
+ return JSON.parse(el.textContent);
13
+ } catch {
14
+ return {};
15
+ }
16
+ }
17
+ function cssVar(name, fallback) {
18
+ const root = document.querySelector(".reveal") ?? document.documentElement;
19
+ const v = getComputedStyle(root).getPropertyValue(name).trim();
20
+ return v || fallback;
21
+ }
22
+ async function main() {
23
+ const config = readConfig();
24
+ const revealEl = document.querySelector(".reveal");
25
+ if (config.profile && revealEl && !revealEl.classList.contains(`profile-${config.profile}`)) {
26
+ revealEl.classList.add(`profile-${config.profile}`);
27
+ }
28
+ const brand = cssVar("--lectern-brand", "#007bc5");
29
+ const brandStrong = cssVar("--lectern-brand-strong", "#004573");
30
+ const ink = cssVar("--lectern-ink", "#232d35");
31
+ const line = cssVar("--lectern-line", "#d6dde2");
32
+ const bgSoft = cssVar("--lectern-bg-soft", "#f6f8f9");
33
+ const font = getComputedStyle(revealEl ?? document.documentElement).fontFamily || "sans-serif";
34
+ mermaid.initialize({
35
+ startOnLoad: false,
36
+ securityLevel: "loose",
37
+ theme: "base",
38
+ fontFamily: font,
39
+ flowchart: { htmlLabels: false, useMaxWidth: false, padding: 10, nodeSpacing: 50, rankSpacing: 55 },
40
+ themeVariables: {
41
+ fontFamily: font,
42
+ primaryColor: bgSoft,
43
+ primaryBorderColor: brand,
44
+ primaryTextColor: ink,
45
+ lineColor: brandStrong,
46
+ secondaryColor: "#ffffff",
47
+ tertiaryColor: bgSoft,
48
+ tertiaryBorderColor: line,
49
+ clusterBkg: "#ffffff",
50
+ clusterBorder: line
51
+ }
52
+ });
53
+ const deck = new Reveal({
54
+ width: 1280,
55
+ height: 720,
56
+ // Let the presentation fill any viewport. A deck may still explicitly
57
+ // cap either value through its `reveal` configuration.
58
+ minScale: 0,
59
+ maxScale: Infinity,
60
+ hash: true,
61
+ // In PDF export, keep one page per slide (show all fragments) instead of one page per fragment step: better for a handout.
62
+ pdfSeparateFragments: false,
63
+ transition: config.transition ?? "slide",
64
+ plugins: [RevealHighlight, RevealNotes],
65
+ ...config.reveal ?? {}
66
+ });
67
+ await deck.initialize();
68
+ const viewport = revealEl?.closest(".reveal-viewport");
69
+ if (config.profile && viewport) viewport.classList.add(`profile-${config.profile}`);
70
+ async function renderMermaid(scope) {
71
+ const nodes = Array.from((scope ?? document).querySelectorAll(".mermaid:not([data-processed])"));
72
+ if (!nodes.length) return;
73
+ const slides = document.querySelector(".reveal .slides");
74
+ const transform = slides?.style.transform;
75
+ if (slides && transform?.includes("scale(")) {
76
+ slides.style.transform = transform.replace(/scale\([^)]*\)/, "scale(1)");
77
+ }
78
+ try {
79
+ await mermaid.run({ nodes });
80
+ } catch (err) {
81
+ console.error("[lectern] mermaid render error", err);
82
+ } finally {
83
+ if (slides && transform !== void 0) {
84
+ slides.style.transform = transform;
85
+ }
86
+ }
87
+ document.querySelectorAll("body > .mermaidTooltip").forEach((tooltip) => {
88
+ tooltip.style.position = "fixed";
89
+ });
90
+ deck.layout();
91
+ }
92
+ const isPrint = /print-pdf/.test(location.search);
93
+ if (isPrint) {
94
+ const formatPdfSlideNumbers = () => {
95
+ const pages = Array.from(document.querySelectorAll(".pdf-page"));
96
+ pages.forEach((page, index) => {
97
+ const number = page.querySelector(".slide-number-pdf");
98
+ if (number) number.textContent = `${index + 1} / ${pages.length}`;
99
+ });
100
+ };
101
+ deck.on("pdf-ready", formatPdfSlideNumbers);
102
+ await renderMermaid(document);
103
+ formatPdfSlideNumbers();
104
+ } else {
105
+ await renderMermaid(deck.getCurrentSlide());
106
+ deck.on("slidechanged", (event) => {
107
+ void renderMermaid(event.currentSlide);
108
+ });
109
+ }
110
+ if (document.querySelector("[data-lectern-infograph-discovery]")) {
111
+ const { initInfographDiscovery } = await import("./graph-CUYNIBIQ.js");
112
+ const infographReady = initInfographDiscovery(deck);
113
+ if (isPrint) await infographReady;
114
+ }
115
+ ;
116
+ window.Reveal = deck;
117
+ }
118
+ void main();
119
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/entry.ts"],"sourcesContent":["/*\n * Browser runtime for a `lectern` deck. Bundled by Vite (dev + build).\n * Imports every core asset so the built output is fully self-contained:\n * reveal.js core + plugins and Mermaid. The active profile's stylesheet is\n * imported after this module by the CLI. Reads deck config from the\n * `#lectern-config` JSON script tag.\n */\nimport mermaid from 'mermaid'\nimport Reveal from 'reveal.js'\nimport RevealHighlight from 'reveal.js/plugin/highlight'\nimport RevealNotes from 'reveal.js/plugin/notes'\n\nimport 'reveal.js/plugin/highlight/monokai.css'\nimport 'reveal.js/reveal.css'\n\ninterface PresentConfig {\n profile?: string\n transition?: string\n reveal?: Record<string, unknown>\n}\n\nfunction readConfig(): PresentConfig {\n const el = document.getElementById('lectern-config')\n if (!el?.textContent) return {}\n try {\n return JSON.parse(el.textContent) as PresentConfig\n } catch {\n return {}\n }\n}\n\n// Profile tokens live on the `.reveal.profile-<name>` element, not :root.\nfunction cssVar(name: string, fallback: string): string {\n const root = document.querySelector('.reveal') ?? document.documentElement\n const v = getComputedStyle(root).getPropertyValue(name).trim()\n return v || fallback\n}\n\nasync function main() {\n const config = readConfig()\n\n // Ensure the active profile class is lectern (the renderer sets it server-side).\n const revealEl = document.querySelector('.reveal')\n if (config.profile && revealEl && !revealEl.classList.contains(`profile-${config.profile}`)) {\n revealEl.classList.add(`profile-${config.profile}`)\n }\n\n // Theme Mermaid to match the active profile before rendering.\n const brand = cssVar('--lectern-brand', '#007bc5')\n const brandStrong = cssVar('--lectern-brand-strong', '#004573')\n const ink = cssVar('--lectern-ink', '#232d35')\n const line = cssVar('--lectern-line', '#d6dde2')\n const bgSoft = cssVar('--lectern-bg-soft', '#f6f8f9')\n // The profile's *resolved* font stack (from Fluid) — we don't invent a font.\n // Mermaid pins labels to this value in its generated stylesheet, so measured\n // and rendered widths agree.\n const font = getComputedStyle(revealEl ?? document.documentElement).fontFamily || 'sans-serif'\n\n mermaid.initialize({\n startOnLoad: false,\n securityLevel: 'loose',\n theme: 'base',\n fontFamily: font,\n flowchart: { htmlLabels: false, useMaxWidth: false, padding: 10, nodeSpacing: 50, rankSpacing: 55 },\n themeVariables: {\n fontFamily: font,\n primaryColor: bgSoft,\n primaryBorderColor: brand,\n primaryTextColor: ink,\n lineColor: brandStrong,\n secondaryColor: '#ffffff',\n tertiaryColor: bgSoft,\n tertiaryBorderColor: line,\n clusterBkg: '#ffffff',\n clusterBorder: line,\n },\n })\n\n const deck = new Reveal({\n width: 1280,\n height: 720,\n // Let the presentation fill any viewport. A deck may still explicitly\n // cap either value through its `reveal` configuration.\n minScale: 0,\n maxScale: Infinity,\n hash: true,\n // In PDF export, keep one page per slide (show all fragments) instead of one page per fragment step: better for a handout.\n pdfSeparateFragments: false,\n transition: (config.transition as 'slide') ?? 'slide',\n plugins: [RevealHighlight, RevealNotes],\n ...(config.reveal ?? {}),\n })\n\n await deck.initialize()\n\n // Reveal marks its viewport during initialization; tag it with the profile so\n // profile CSS can style the area around the scaled canvas.\n const viewport = revealEl?.closest('.reveal-viewport')\n if (config.profile && viewport) viewport.classList.add(`profile-${config.profile}`)\n\n // Mermaid must render while its slide is VISIBLE: a diagram rendered inside a `display:none` slide collapses to zero size. So we render lazily: all at once for PDF (every slide is shown), otherwise per-slide on navigation.\n async function renderMermaid(scope: ParentNode | null) {\n const nodes = Array.from((scope ?? document).querySelectorAll<HTMLElement>('.mermaid:not([data-processed])'))\n if (!nodes.length) return\n // Mermaid measures SVG labels in screen coordinates. Reveal scales the\n // `.slides` canvas with a CSS transform, which would make Mermaid bake\n // that scale into node dimensions and then scale them a second time.\n // Render in the unscaled 1280×720 coordinate system, then restore\n // Reveal's transform for display.\n const slides = document.querySelector<HTMLElement>('.reveal .slides')\n const transform = slides?.style.transform\n if (slides && transform?.includes('scale(')) {\n slides.style.transform = transform.replace(/scale\\([^)]*\\)/, 'scale(1)')\n }\n try {\n await mermaid.run({ nodes })\n } catch (err) {\n console.error('[lectern] mermaid render error', err)\n } finally {\n if (slides && transform !== undefined) {\n slides.style.transform = transform\n }\n }\n // Mermaid appends a shared tooltip to <body>. Its default absolute\n // position extends the document by a few pixels, which becomes a\n // trailing blank PDF page in print mode. Keep it available for hover\n // interactions without letting it participate in document height.\n document.querySelectorAll<HTMLElement>('body > .mermaidTooltip').forEach(tooltip => {\n tooltip.style.position = 'fixed'\n })\n deck.layout()\n }\n\n const isPrint = /print-pdf/.test(location.search)\n if (isPrint) {\n const formatPdfSlideNumbers = () => {\n const pages = Array.from(document.querySelectorAll<HTMLElement>('.pdf-page'))\n pages.forEach((page, index) => {\n const number = page.querySelector<HTMLElement>('.slide-number-pdf')\n if (number) number.textContent = `${index + 1} / ${pages.length}`\n })\n }\n deck.on('pdf-ready', formatPdfSlideNumbers)\n await renderMermaid(document)\n // Reveal's PDF renderer ignores the `c/t` slide-number format and\n // injects a bare sequential number into each generated `.pdf-page`.\n // Its asynchronous `pdf-ready` event is the point at which the total\n // number of exported pages is known.\n formatPdfSlideNumbers()\n } else {\n await renderMermaid(deck.getCurrentSlide())\n deck.on('slidechanged', event => {\n void renderMermaid((event as unknown as { currentSlide: HTMLElement }).currentSlide)\n })\n }\n\n // Opt-in infograph discovery. Dynamic import keeps Cytoscape out of decks\n // that do not embed the component; in PDF mode it renders the seed graph\n // without an interactive surface.\n if (document.querySelector('[data-lectern-infograph-discovery]')) {\n const { initInfographDiscovery } = await import('./graph')\n const infographReady = initInfographDiscovery(deck as unknown as Parameters<typeof initInfographDiscovery>[0])\n if (isPrint) await infographReady\n }\n\n // Expose for tooling (PDF export waits on this).\n ;(window as unknown as { Reveal: unknown }).Reveal = deck\n}\n\nvoid main()\n"],"mappings":";AAOA,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,qBAAqB;AAC5B,OAAO,iBAAiB;AAExB,OAAO;AACP,OAAO;AAQP,SAAS,aAA4B;AACnC,QAAM,KAAK,SAAS,eAAe,gBAAgB;AACnD,MAAI,CAAC,IAAI,YAAa,QAAO,CAAC;AAC9B,MAAI;AACF,WAAO,KAAK,MAAM,GAAG,WAAW;AAAA,EAClC,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAGA,SAAS,OAAO,MAAc,UAA0B;AACtD,QAAM,OAAO,SAAS,cAAc,SAAS,KAAK,SAAS;AAC3D,QAAM,IAAI,iBAAiB,IAAI,EAAE,iBAAiB,IAAI,EAAE,KAAK;AAC7D,SAAO,KAAK;AACd;AAEA,eAAe,OAAO;AACpB,QAAM,SAAS,WAAW;AAG1B,QAAM,WAAW,SAAS,cAAc,SAAS;AACjD,MAAI,OAAO,WAAW,YAAY,CAAC,SAAS,UAAU,SAAS,WAAW,OAAO,OAAO,EAAE,GAAG;AAC3F,aAAS,UAAU,IAAI,WAAW,OAAO,OAAO,EAAE;AAAA,EACpD;AAGA,QAAM,QAAQ,OAAO,mBAAmB,SAAS;AACjD,QAAM,cAAc,OAAO,0BAA0B,SAAS;AAC9D,QAAM,MAAM,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