create-pmos 0.530.0 → 0.531.0

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.
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+ /* report-library.js — the report library's sample deck: each of the 23 slide layouts (lib/report-slides.js) filled with the placeholder words of
3
+ * the agreed canvas (https://claude.ai/artifact/D1ssyUsrbTtxysSuibSjmV, boards L02–L23). It is what `pmos report library` writes, so the
4
+ * look can be checked against the boards in a browser, and what the tests draw.
5
+ *
6
+ * sampleDeck({ today }) → { name, today, slides } (pure; today = YYYY-MM-DD, default 2026-11-04, the canvas's day)
7
+ * libraryHtml(o) → the sample deck as one page (lib/report-slides.js deckHtml)
8
+ *
9
+ * Placeholder words only: nothing here is a reading, so it never goes into a report.
10
+ */
11
+ const RS = require('./report-slides.js');
12
+
13
+ const INSIGHT = (head) => ({ head, text: 'One or two sentences that say what the main part means.',
14
+ points: [{ tone: 'ok', text: 'Good news first' }, { tone: 'watch', text: 'Something to watch' }, { tone: 'bad', text: 'Something that needs a decision' }],
15
+ note: 'Source line or caveat for the insight.' });
16
+
17
+ function sampleDeck({ today = '2026-11-04' } = {}) {
18
+ const S = (layout, eyebrow, title, sub, data, insight) => ({ layout, eyebrow: `${eyebrow} · Slide layout`, title, sub, data, insight: insight ? INSIGHT(insight) : null, source: 'Layout library · placeholder data' });
19
+ const slides = [
20
+ S('overview', 'Overview', 'Pick the layout that fits the message, then fill it', 'Every layout sits in the same frame and uses PMOS components. Change the words, keep the shape.',
21
+ { lead: 'One frame, 23 bodies. Each layout answers one kind of question.', cols: [{ head: 'Say it', text: 'Overview, statement, focus, agenda' }, { head: 'Show it', text: 'Tiles, ledger, donut, heatmap, bubbles, timeline' }, { head: 'Decide it', text: 'Compare, lists, risks, ranked, decisions, actions' }] }),
22
+ S('tiles', 'Tiles', 'Three numbers that matter, each against its target', 'Use for a scorecard of up to four measures.',
23
+ { tiles: [{ label: 'Measure one', value: '82%', note: 'Short note on how it moved', share: 0.82, target: 1, tone: 'ok' }, { label: 'Measure two', value: '4.1%', note: 'Short note on how it moved', share: 0.6, target: 1, tone: 'info' }, { label: 'Measure three', value: '240', note: 'Short note on how it moved', share: 0.9, target: 0.7, tone: 'bad' }] }, 'What the tiles say'),
24
+ S('ledger', 'Ledger', 'Goals, nearest the line first', 'Use for four to six goals with value, progress bar, target mark and verdict.',
25
+ { label: 'Goals', rows: [{ name: 'Goal one', value: '93%', share: 0.93, target: 0.95, target_text: 'Target 95%', verdict: 'On the line', tone: 'ok' }, { name: 'Goal two', value: '4.1%', share: 0.68, target: 0.8, target_text: 'Target under 3%', verdict: 'Closing', tone: 'ok' }, { name: 'Goal three', value: '+3.1%', share: 0.78, target: 1, target_text: 'Target +4%', verdict: 'One week short', tone: 'watch' }, { name: 'Goal four', value: '240', share: 0.9, target: 0.7, target_text: 'Goal under 200', verdict: 'Above', tone: 'bad' }] }, 'Which goal needs attention'),
26
+ S('timeline', 'Timeline', 'Dates on one line, with the risky ones marked', 'Interactive: switch the span, filter to at-risk. Use for a plan or a portfolio.',
27
+ { today, rows: [{ name: 'Item one', start: '2026-11-02', end: '2026-12-04', tag: 'Design', tone: 'none' }, { name: 'Item two', start: '2026-11-20', end: '2027-01-22', tag: 'Build', tone: 'ok' }, { name: 'Item three', start: '2026-12-07', end: '2027-02-05', tag: 'Build', tone: 'watch' }, { name: 'Item four', start: '2027-01-25', end: '2027-02-12', tag: 'Pilot', tone: 'none' }] }, 'What the dates say'),
28
+ S('compare', 'Compare', 'What went well, next to what did not', 'Two columns of tiles. Use for before and after, shipped and slipped, now and needed.',
29
+ { left: { label: 'Shipped', items: [{ value: '–32%', name: 'metric one', note: 'Short explanation', share: 0.68, target: 0.8, tone: 'ok' }, { value: '11', name: 'metric two', note: 'Short explanation', share: 0.8, target: 1, tone: 'ok' }] },
30
+ right: { label: 'Slipped', items: [{ value: '+17%', name: 'metric three', note: 'Short explanation', share: 0.9, target: 0.7, tone: 'bad' }, { value: '3 weeks', name: 'metric four', note: 'Short explanation', share: 0.45, target: 1, tone: 'watch' }] } }, 'Why the split matters'),
31
+ S('lists', 'Two lists', 'What is in, what is out', 'Two columns of short items. Use for scope, open and parked, reached and not reached.',
32
+ { left: { label: 'Left list', tone: 'ok', items: [{ text: 'Item one', detail: 'Detail' }, { text: 'Item two' }, { text: 'Item three' }] }, right: { label: 'Right list', tone: 'bad', items: [{ text: 'Item four', detail: 'Detail' }, { text: 'Item five' }, { text: 'Item six' }] } }, 'The rule between the lists'),
33
+ S('risks', 'Risk table', 'Risks with owner, first move and level', 'Use for four to five risks. Level sets the pill colour.',
34
+ { rows: [{ name: 'Risk one', owner: 'Owner', why: 'why it matters', move: 'First move', level: 'Possible', tone: 'watch' }, { name: 'Risk two', owner: 'Owner', why: 'why it matters', move: 'First move', level: 'Likely', tone: 'bad' }, { name: 'Risk three', owner: 'Owner', why: 'why it matters', move: 'First move', level: 'Low', tone: 'ok' }] }, 'Which risk is real'),
35
+ S('ranked', 'Ranked list', 'Options ranked by impact and effort', 'Two numeric columns with a bar. Use for bets and prioritisation.',
36
+ { a: 'Impact', b: 'Effort, weeks', rows: [{ name: 'Option one', a: 0.8, b: 0.3 }, { name: 'Option two', a: 0.6, b: 0.2 }, { name: 'Option three', a: 0.4, b: 0.6 }] }, 'Why the order'),
37
+ S('decisions', 'Decisions', 'Three decisions we want from the room', 'Each row holds a ✦ proposal, an owner and a date. Use at the end of any deck.',
38
+ { rows: [{ question: 'Decision one as a question?', pick: 'My pick and one line of reason.', who: 'Owner', by: today }, { question: 'Decision two as a question?', pick: 'Cost and consequence in one line.', who: 'Owner', by: '2026-11-06' }, { question: 'Decision three as a question?', pick: 'Cost and consequence in one line.', who: 'Owner', by: '2026-11-20' }] }, 'How the decisions connect'),
39
+ S('quotes', 'Quotes', 'What people said, with who and when', 'Three quotes plus an agreed line. Use for meeting recaps and customer voice.',
40
+ { quotes: [{ text: "Quote that explains the decision in the speaker's own words.", who: 'Name', at: '00:04:12' }, { text: "Quote that explains the decision in the speaker's own words.", who: 'Name', at: '00:11:40' }, { text: "Quote that explains the decision in the speaker's own words.", who: 'Name', at: '00:18:05' }], agreed: 'one line that sums up what the room decided.' }, 'What the quotes add'),
41
+ S('actions', 'Actions', 'Action items that can be ticked off', 'Interactive: tick to close. Use for recaps and weekly notes.',
42
+ { rows: [{ text: 'Action one', who: 'Owner', due: '2026-11-05' }, { text: 'Action two', who: 'Owner', due: '2026-11-06' }, { text: 'Action three', who: 'Owner', due: '2026-11-10' }, { text: 'Action four', who: 'Owner', due: '2026-11-13' }] }, 'Which are due first'),
43
+ S('agenda', 'Agenda', 'Three things in order', 'Numbered rows with a title and one line. Use for plans, agendas and next steps.',
44
+ { rows: [{ title: 'First thing', text: 'One line of detail' }, { title: 'Second thing', text: 'One line of detail' }, { title: 'Third thing', text: 'One line of detail' }] }, 'Why this order'),
45
+ S('heatmap', 'Heatmap', 'Programs by product, hot cells in red', 'Grid with a side total. Use for portfolio health.',
46
+ { cols: ['Col 1', 'Col 2', 'Col 3', 'Col 4'], total: 'Spend', rows: [
47
+ { name: 'Row A', total: '$180k', cells: [{ text: 'Healthy', tone: 'ok' }, { text: 'Healthy', tone: 'ok' }, { text: 'At risk', tone: 'watch' }, { text: 'Healthy', tone: 'ok' }] },
48
+ { name: 'Row B', total: '$420k', cells: [{ text: 'Healthy', tone: 'ok' }, { text: 'Late', tone: 'bad' }, { text: 'At risk', tone: 'watch' }, { text: 'Healthy', tone: 'ok' }] },
49
+ { name: 'Row C', total: '$90k', cells: [{ text: 'At risk', tone: 'watch' }, { text: 'At risk', tone: 'watch' }] }] }, 'Where the heat is'),
50
+ S('network', 'Network', 'What waits on what', 'Nodes and arrows. Use for dependencies and flows.',
51
+ { nodes: [{ id: 'a', label: 'Node A', tone: 'bad' }, { id: 'b', label: 'Node B' }, { id: 'c', label: 'Node C', tone: 'watch' }, { id: 'd', label: 'Node D' }], edges: [['a', 'b'], ['a', 'c'], ['b', 'd'], ['c', 'd']] }, 'Where to unblock'),
52
+ S('schedule', 'Schedule', 'Who did what on which day', 'Week grid with bars. Use for weekly reviews and rosters.',
53
+ { cols: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], rows: [{ name: 'Work one', from: 0, to: 1, text: 'Done', tone: 'ok' }, { name: 'Work two', from: 1, to: 3, text: 'In progress', tone: 'info' }, { name: 'Work three', from: 2, to: 4, text: 'Blocked', tone: 'watch' }, { name: 'Work four', from: 0, to: 4, text: 'Waiting', tone: 'none' }] }, 'How the week went'),
54
+ S('donut', 'Donut', 'Share of the whole, with a headline', 'Ring with a centre number and a legend. Use for health and mix.',
55
+ { center: '7 of 11', center_note: 'healthy', parts: [{ label: 'Healthy', n: 7, names: 'Names', tone: 'ok' }, { label: 'At risk', n: 2, names: 'Names', tone: 'watch' }, { label: 'Late', n: 2, names: 'Names', tone: 'bad' }] }, 'The red part'),
56
+ S('bubbles', 'Bubbles', 'Spend against outcome', 'Scatter with size. Use to spot what costs a lot and returns little.',
57
+ { x: 'More spend', y: 'Outcome', points: [{ label: 'A', x: 0.7, y: 0.62, size: 0.53, tone: 'info' }, { label: 'B', x: 0.4, y: 0.84, size: 0.27, tone: 'ok' }, { label: 'C', x: 0.6, y: 0.4, size: 0.33, tone: 'watch' }, { label: 'D', x: 0.85, y: 0.14, size: 0.87, tone: 'bad' }] }, 'The outlier'),
58
+ S('people', 'People', 'Who owns what', 'Avatar rows with role and remit. Use for kick-offs and handovers.',
59
+ { people: [{ name: 'Name One', initials: 'AB', role: 'Role', owns: 'What they own' }, { name: 'Name Two', initials: 'CD', role: 'Role', owns: 'What they own' }, { name: 'Name Three', initials: 'EF', role: 'Role', owns: 'What they own' }] }, 'Who decides'),
60
+ S('statement', 'Statement', 'One sentence that carries the slide', 'Big sentence and three supporting numbers. Use for the why.',
61
+ { text: 'One sentence of 25 words or fewer that carries the argument of this slide.', figures: [{ value: '–1.4 s', label: 'what it measures', source: 'source', tone: 'ok' }, { value: '3×', label: 'what it measures', source: 'source', tone: 'info' }, { value: '11 days', label: 'what it measures', source: 'source', tone: 'watch' }] }, 'The case in one number'),
62
+ S('sources', 'Sources', 'What was read, and what could not be', 'Reached on the left, not reached on the right. Close every report with it.',
63
+ { read: [{ name: 'Source one', at: '2026-11-02' }, { name: 'Source two', at: today }], missing: [{ name: 'Missing source', why: 'Not connected' }] }, 'What the gap costs'),
64
+ S('minutes', 'Minutes', 'Where the time went', 'Ranked bars with a unit. Use for meeting topics and effort.',
65
+ { unit: 'min', rows: [{ name: 'Topic one', note: 'Short note', value: 14 }, { name: 'Topic two', note: 'Short note', value: 9 }, { name: 'Topic three', note: 'Short note', value: 6 }] }, 'Time and risk'),
66
+ S('focus', 'Focus', 'A four-step path with a gate', 'Callout plus four steps. Use for the first thirty days.',
67
+ { gate: { title: 'Gate · date', text: 'What must be true at the gate.' }, steps: [{ label: 'Week 1', title: 'Step title', text: 'What happens.' }, { label: 'Week 2', title: 'Step title', text: 'What happens.' }, { label: 'Week 3', title: 'Step title', text: 'What happens.' }, { label: 'Week 4', title: 'Step title', text: 'What happens.' }] }, 'Why the gate is real'),
68
+ S('next', 'Next', 'Next meeting, date and agenda', 'Date block plus timed items.',
69
+ { date: '2026-11-10', time: '10:00', items: [{ length: '5 min', text: 'Item' }, { length: '15 min', text: 'Item' }, { length: '10 min', text: 'Item' }] }, 'How the agenda is built'),
70
+ ];
71
+ slides.forEach((s, i) => { s.n = i + 1; });
72
+ return { name: 'Slide layouts', today, slides };
73
+ }
74
+ const libraryHtml = (o) => RS.deckHtml(sampleDeck(o));
75
+
76
+ module.exports = { sampleDeck, libraryHtml };
@@ -490,6 +490,8 @@ function sectionBlockHtml(b, L) {
490
490
  /** The deck as one HTML string (the viewer's frames and the PDF print). */
491
491
  function deckHtml(deck) {
492
492
  if (!deck) return '';
493
+ // the report engine's deck is drawn in the report library's frame (B2, lib/report-slides.js; batch 27 item 14)
494
+ if (deck.frame === 'b2') return require('./report-slides.js').deckHtml(deck);
493
495
  const L = { ...STANDARD, ...(deck.look || {}) };
494
496
  return `<!doctype html><html lang="en"><head><meta charset="utf-8"><title>${esc(deck.name)}</title><style>${css(L)}</style></head><body>${deck.slides.map((s) => slideHtml(s, L)).join('')}</body></html>`;
495
497
  }