@delurio/cli 0.10.0 → 0.12.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/NOTICE +7 -0
  3. package/README.md +38 -22
  4. package/SPEC.md +8 -1
  5. package/js/changes.d.ts +17 -0
  6. package/js/cli.js +6 -0
  7. package/{dist → js}/edges.d.ts +2 -2
  8. package/js/edges.js +40 -0
  9. package/js/expr.js +25 -0
  10. package/{dist → js}/graph.d.ts +3 -0
  11. package/js/graph.js +73 -0
  12. package/{dist → js}/html.d.ts +6 -6
  13. package/js/html.js +13 -0
  14. package/js/internal.js +408 -0
  15. package/js/kit.js +54 -0
  16. package/{dist → js}/model.d.ts +2 -2
  17. package/js/model.js +136 -0
  18. package/js/native.cjs +46 -0
  19. package/js/native.d.cts +328 -0
  20. package/{dist → js}/nav.d.ts +1 -1
  21. package/js/nav.js +70 -0
  22. package/js/needs.js +30 -0
  23. package/{dist → js}/spine.d.ts +3 -3
  24. package/js/spine.js +22 -0
  25. package/{dist → js}/starts.d.ts +1 -3
  26. package/{dist → js}/story.d.ts +2 -2
  27. package/js/story.js +22 -0
  28. package/{dist → js}/wireframe.d.ts +2 -2
  29. package/js/wireframe.js +29 -0
  30. package/js/yaml.d.ts +20 -0
  31. package/js/yaml.js +40 -0
  32. package/package.json +40 -24
  33. package/schemas/binding.schema.json +2211 -0
  34. package/schemas/ui.schema.json +6 -0
  35. package/dist/anchors.d.ts +0 -29
  36. package/dist/anchors.js +0 -160
  37. package/dist/changes.d.ts +0 -25
  38. package/dist/changes.js +0 -101
  39. package/dist/check.d.ts +0 -23
  40. package/dist/check.js +0 -649
  41. package/dist/cli.d.ts +0 -2
  42. package/dist/cli.js +0 -194
  43. package/dist/compare.d.ts +0 -34
  44. package/dist/compare.js +0 -143
  45. package/dist/diff-flow.d.ts +0 -33
  46. package/dist/diff-flow.js +0 -547
  47. package/dist/diff-nav.d.ts +0 -20
  48. package/dist/diff-nav.js +0 -401
  49. package/dist/diff.d.ts +0 -25
  50. package/dist/diff.js +0 -331
  51. package/dist/domain-names.d.ts +0 -18
  52. package/dist/domain-names.js +0 -124
  53. package/dist/domain.d.ts +0 -25
  54. package/dist/domain.js +0 -110
  55. package/dist/edges.js +0 -120
  56. package/dist/expr.js +0 -157
  57. package/dist/graph.js +0 -236
  58. package/dist/html.js +0 -311
  59. package/dist/index-page.d.ts +0 -12
  60. package/dist/index-page.js +0 -50
  61. package/dist/invokes.d.ts +0 -10
  62. package/dist/invokes.js +0 -67
  63. package/dist/kit.js +0 -711
  64. package/dist/mermaid.d.ts +0 -3
  65. package/dist/mermaid.js +0 -50
  66. package/dist/model.js +0 -608
  67. package/dist/nav-page.d.ts +0 -15
  68. package/dist/nav-page.js +0 -283
  69. package/dist/nav.js +0 -578
  70. package/dist/needs.js +0 -335
  71. package/dist/pan.d.ts +0 -2
  72. package/dist/pan.js +0 -252
  73. package/dist/schemas.d.ts +0 -15
  74. package/dist/schemas.js +0 -316
  75. package/dist/spine.js +0 -156
  76. package/dist/starts.js +0 -88
  77. package/dist/story.js +0 -109
  78. package/dist/tutorial-check.d.ts +0 -9
  79. package/dist/tutorial-check.js +0 -297
  80. package/dist/ui-check.d.ts +0 -8
  81. package/dist/ui-check.js +0 -142
  82. package/dist/watch.d.ts +0 -5
  83. package/dist/watch.js +0 -114
  84. package/dist/wireframe.js +0 -276
  85. package/dist/yaml.d.ts +0 -19
  86. package/dist/yaml.js +0 -134
  87. /package/{dist → js}/expr.d.ts +0 -0
  88. /package/{dist → js}/kit.d.ts +0 -0
  89. /package/{dist → js}/needs.d.ts +0 -0
package/dist/nav-page.js DELETED
@@ -1,283 +0,0 @@
1
- import { CSS } from './html.js';
2
- import { pathTo } from './nav.js';
3
- const esc = (s) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
4
- const code = (s) => `<code>${esc(s)}</code>`;
5
- const NAV_CSS = `
6
- .persons { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
7
- .person { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 12px 14px; }
8
- .person h3 { margin-bottom: 4px; } .person p { margin: 4px 0 0; } .person .stat { margin-top: 8px; font-size: 14px; }
9
- .finding { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: 10px; background: var(--surface); }
10
- .finding.problem { border-left-color: var(--bad); } .finding p { margin: 0; } .finding ul { margin: 8px 0 0; padding-left: 20px; } .finding li { margin: 3px 0; }
11
- .finding .tag { margin-right: 6px; }
12
- table.matrix th, table.matrix td { padding: 6px 8px; } table.matrix th.persona { min-width: 92px; text-transform: none; letter-spacing: 0; font-size: 12px; }
13
- table.matrix td.cell { text-align: center; white-space: nowrap; } td.cell .why { display: block; font-size: 11px; color: var(--muted); }
14
- .c-ok { color: var(--ok); font-weight: 600; } .c-refused { color: var(--bad); font-weight: 600; } .c-placeholder { color: var(--muted); font-weight: 600; } .c-missing { color: var(--bad); font-weight: 600; } .c-hidden, .c-none { color: var(--line); }
15
- tr.grp th { background: var(--accent-bg); color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 13px; }
16
- .path { display: block; font-size: 12px; color: var(--muted); max-width: 190px; white-space: normal; text-align: left; }
17
- td.reach { vertical-align: top; } td.reach b { font-size: 15px; }
18
- .legend-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
19
- ul.sitemap { list-style: none; margin: 0; padding: 0; } ul.sitemap li { padding: 6px 0; border-bottom: 1px solid var(--line); } ul.sitemap li:last-child { border-bottom: 0; }
20
- ul.sitemap .route { margin-left: 8px; color: var(--muted); }
21
- .checklist li.fail::before { content: "✗"; color: var(--bad); }
22
- `;
23
- const STANDING_WORD = { ok: 'opens', placeholder: 'not built', missing: 'not found', refused: 'refuses', unreachable: 'no way' };
24
- const STANDING_MARK = { ok: '✓', placeholder: '◌', missing: '✗', refused: '⛔', unreachable: '–' };
25
- function pathWords(entries) {
26
- return entries
27
- .filter((e) => e.label !== '')
28
- .map((e) => e.label)
29
- .join(' → ');
30
- }
31
- // the way to a page in words: its labels from start, or from a page opened by its address (SPEC.md §6)
32
- function wayWords(g, v, page) {
33
- const r = v.reach.get(page);
34
- const steps = r === undefined ? '' : pathWords(pathTo(v.reach, page));
35
- if (r?.byAddress === undefined || r.byAddress === null)
36
- return steps === '' ? 'automatic' : steps;
37
- if (r.byAddress === page)
38
- return 'by its address';
39
- return `by the address of ${g.pages[r.byAddress].title}${steps === '' ? '' : `, then ${steps}`}`;
40
- }
41
- function landingStats(g, v, rows, index) {
42
- if (v.landing === null)
43
- return '';
44
- const frame = g.pages[v.landing].frame;
45
- if (!g.menuFrames.includes(frame))
46
- return '';
47
- const shown = rows.filter((r) => r.frame === frame && r.cells[index].shown);
48
- if (shown.length === 0)
49
- return `The ${(g.frames[frame].menu ?? frame).toLowerCase()} has no entries.`;
50
- const by = (s) => shown.filter((r) => r.cells[index].standing === s).length;
51
- const parts = [`${by('ok')} open`];
52
- if (by('refused') > 0)
53
- parts.push(`${by('refused')} refuse them`);
54
- if (by('placeholder') > 0)
55
- parts.push(`${by('placeholder')} are not built`);
56
- if (by('missing') > 0)
57
- parts.push(`${by('missing')} lead to a page that does not exist`);
58
- return `The ${(g.frames[frame].menu ?? frame).toLowerCase()} has ${shown.length} ${shown.length === 1 ? 'entry' : 'entries'}: ${parts.join(', ')}.`;
59
- }
60
- function findingHtml(f) {
61
- const detail = f.detail.length === 0 ? '' : `<ul>${f.detail.map((d) => `<li>${esc(d)}</li>`).join('')}</ul>`;
62
- return `<section class="finding ${f.level}"><p><span class="tag ${f.level === 'problem' ? 'bad' : ''}">${f.level}</span>${esc(f.say)}</p>${detail}</section>`;
63
- }
64
- function matrix(g, views, rows) {
65
- const out = ['<div class="scroll"><table class="matrix"><thead><tr><th>Menu entry</th>'];
66
- for (const v of views)
67
- out.push(`<th class="persona">${esc(v.persona.title)}</th>`);
68
- out.push('</tr></thead><tbody>');
69
- for (const frame of g.menuFrames) {
70
- out.push(`<tr class="grp"><th colspan="${views.length + 1}">${esc(g.frames[frame].menu ?? frame)}</th></tr>`);
71
- for (const r of rows.filter((x) => x.frame === frame)) {
72
- const target = g.pages[r.entry.to];
73
- out.push(`<tr><td>${esc(r.entry.label)}<span class="path">${esc(target.title === r.entry.label ? target.route : `${target.title} · ${target.route}`)}</span></td>`);
74
- r.cells.forEach((c, i) => {
75
- if (!r.frameKnown[i])
76
- out.push('<td class="cell c-none" title="this kind of user never has this menu"></td>');
77
- else if (!c.shown || c.standing === null)
78
- out.push('<td class="cell c-hidden" title="not in this person’s menu">–</td>');
79
- else
80
- out.push(`<td class="cell c-${c.standing}" title="${STANDING_WORD[c.standing]}">${STANDING_MARK[c.standing]}<span class="why">${STANDING_WORD[c.standing]}</span></td>`);
81
- });
82
- out.push('</tr>');
83
- }
84
- }
85
- out.push('</tbody></table></div>');
86
- out.push(`<p class="legend-row"><span><b class="c-ok">✓ opens</b> nothing in the application’s own code refuses it (the server can still say no)</span><span><b class="c-refused">⛔ refuses</b> the entry is drawn, the page says no</span><span><b class="c-placeholder">◌ not built</b> the page says it is not ready</span>${Object.values(g.pages).some((pg) => pg.kind === 'missing') ? '<span><b class="c-missing">✗ not found</b> there is no such page</span>' : ''}<span>– not in this person’s menu</span><span>blank: this kind of user never has this menu</span></p>`);
87
- return out.join('');
88
- }
89
- function reachTable(g, views) {
90
- const out = ['<div class="scroll"><table class="matrix"><thead><tr><th>Page</th>'];
91
- for (const v of views)
92
- out.push(`<th class="persona">${esc(v.persona.title)}</th>`);
93
- out.push('</tr></thead><tbody>');
94
- for (const frame of Object.keys(g.frames)) {
95
- const pages = Object.values(g.pages).filter((p) => p.frame === frame && p.id !== 'start');
96
- if (pages.length === 0)
97
- continue;
98
- out.push(`<tr class="grp"><th colspan="${views.length + 1}">${esc(g.frames[frame].title)}</th></tr>`);
99
- for (const p of pages) {
100
- out.push(`<tr><td>${esc(p.title)}${p.kind === 'placeholder' ? ' <span class="tag">not built</span>' : p.kind === 'missing' ? ' <span class="tag">does not exist</span>' : ''}<span class="path">${esc(p.route)}</span></td>`);
101
- for (const v of views) {
102
- const st = v.standing[p.id];
103
- if (st === 'unreachable') {
104
- out.push('<td class="reach c-hidden">–</td>');
105
- continue;
106
- }
107
- const r = v.reach.get(p.id);
108
- const mark = st === 'refused' ? ' <span class="c-refused">⛔</span>' : st === 'placeholder' ? ' <span class="c-placeholder">◌</span>' : st === 'missing' ? ' <span class="c-missing">✗</span>' : '';
109
- out.push(`<td class="reach"><b>${r?.clicks ?? 0}</b>${mark}${r?.usesData === true ? ' †' : ''}<span class="path">${esc(wayWords(g, v, p.id))}</span></td>`);
110
- }
111
- out.push('</tr>');
112
- }
113
- }
114
- out.push('</tbody></table></div>');
115
- const typed = Object.values(g.pages).some((pg) => pg.byAddress) ? '<span>by its address: opened by typing its address or by a link from outside the app, such as one in an e-mail, and counted from there</span>' : '';
116
- out.push(`<p class="legend-row"><span>number: fewest clicks from the moment the person signs in and “/” has sent them on</span><span>⛔ the page refuses them</span><span>◌ the page is not built</span><span>† needs an item in a list (a row to pick, a card to open)</span>${typed}<span>–: no way there</span></p>`);
117
- return out.join('');
118
- }
119
- function goalsTable(g, goals) {
120
- if (goals.length === 0)
121
- return '';
122
- const out = ['<h2>Things people come to do</h2><div class="scroll"><table><thead><tr><th>Goal</th><th>Who</th><th>Clicks</th><th>Result</th></tr></thead><tbody>'];
123
- for (const c of goals) {
124
- const ok = c.outcome === 'ok';
125
- out.push(`<tr><td>${esc(c.goal.say)}<span class="path">${esc(g.pages[c.goal.page].route)}</span></td><td>${esc(c.persona.title)}</td><td>${c.clicks === null ? '–' : `${c.clicks} of ${c.goal.within}`}</td><td class="${ok ? 'ok' : 'bad'}">${ok ? 'ok' : esc(c.outcome)}</td></tr>`);
126
- }
127
- out.push('</tbody></table></div>');
128
- return out.join('');
129
- }
130
- function siteMap(g) {
131
- const out = [];
132
- for (const frame of Object.keys(g.frames)) {
133
- const pages = Object.values(g.pages).filter((p) => p.frame === frame);
134
- if (pages.length === 0)
135
- continue;
136
- out.push(`<h3 style="margin:16px 0 4px">${esc(g.frames[frame].title)}</h3><ul class="sitemap">`);
137
- for (const p of pages) {
138
- const tags = [];
139
- if (p.kind !== 'screen')
140
- tags.push(p.kind === 'placeholder' ? 'not built' : p.kind === 'missing' ? 'does not exist' : p.kind);
141
- if (p.opensFor !== null)
142
- tags.push(`opens only when ${p.opensFor}`);
143
- if (p.byAddress)
144
- tags.push('by its address');
145
- const notes = [p.opensFor !== null && p.refusal !== null ? `Otherwise ${p.refusal}.` : null, p.evidence].filter((n) => n !== null);
146
- out.push(`<li>${esc(p.title)}<span class="route">${code(p.route)}</span> ${tags.map((t) => `<span class="tag">${esc(t)}</span>`).join(' ')}${notes.map((n) => `<br><span class="muted">${esc(n)}</span>`).join('')}</li>`);
147
- }
148
- out.push('</ul>');
149
- }
150
- return out.join('');
151
- }
152
- function referenceTable(g) {
153
- const out = ['<div class="scroll" style="margin-top:8px"><table><thead><tr><th>From</th><th>How</th><th>Label</th><th>To</th><th>Only when</th></tr></thead><tbody>'];
154
- g.specs.forEach((s) => {
155
- const from = (Array.isArray(s.from) ? s.from : [s.from]).join(', ');
156
- const target = g.pages[s.to];
157
- const extra = [s.data === true ? 'needs an item in a list' : '', s.back === true ? 'goes back' : ''].filter((x) => x !== '').join('; ');
158
- out.push(`<tr><td>${code(from)}</td><td>${esc(s.how)}</td><td>${esc(s.label === undefined ? '' : (g.catalog[s.label] ?? s.label))}</td><td>${esc(target.title)} ${code(target.route)}</td><td>${s.when === undefined ? '' : code(s.when)}${extra === '' ? '' : ` <span class="muted">${esc(extra)}</span>`}</td></tr>`);
159
- });
160
- out.push('</tbody></table></div>');
161
- return out.join('');
162
- }
163
- function guardsReference(g) {
164
- const out = ['<dl class="guards">'];
165
- for (const [n, expr] of Object.entries(g.guards))
166
- out.push(`<dt>${code(n)}</dt><dd>${code(expr)}</dd>`);
167
- out.push('</dl>');
168
- return out.join('');
169
- }
170
- export function renderNavPage(p) {
171
- const { g, views, rows, goals, found, repo } = p;
172
- const out = [];
173
- const problems = found.filter((f) => f.level === 'problem');
174
- out.push('<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">');
175
- out.push(`<title>${esc(g.title)} navigation</title><style>${CSS}${NAV_CSS}</style></head><body><main>`);
176
- out.push(`<p class="eyebrow"><span class="tag">${esc(g.status)}</span> <span class="mono">${esc(g.id)}</span> · navigation graph</p>`);
177
- out.push(`<h1>${esc(g.title)}: where people go</h1>`);
178
- if (g.summary !== '')
179
- out.push(`<p class="lede">${esc(g.summary)}</p>`);
180
- out.push(`<p class="muted">${Object.keys(g.pages).length} pages · ${g.specs.length} ways to move · ${views.length} kinds of user${g.source.commit === undefined ? '' : ` · read from ${esc(String(g.source.repo ?? 'the app'))} at ${esc(g.source.commit)}`} · wording: ${esc(g.locale)}</p>`);
181
- out.push('<h2>What stands out</h2>');
182
- out.push(problems.length === 0 ? '<p>Nothing blocks anyone.</p>' : `<p>${problems.length} problem${problems.length === 1 ? '' : 's'} and ${found.length - problems.length} note${found.length - problems.length === 1 ? '' : 's'}. Problems send a person somewhere that does not work; notes are about words.</p>`);
183
- for (const f of found)
184
- out.push(findingHtml(f));
185
- out.push('<h2>Who uses it</h2><div class="persons">');
186
- views.forEach((v, i) => {
187
- const landing = v.landing === null ? null : g.pages[v.landing];
188
- out.push(`<div class="person"><h3>${esc(v.persona.title)}</h3><p class="muted">${esc(v.persona.say)}</p>`);
189
- out.push(`<p class="stat">Lands on <b>${esc(landing === null ? '–' : landing.title)}</b>${landing === null ? '' : ` ${code(landing.route)}`}${landing?.kind === 'placeholder' ? ' <span class="tag">not built</span>' : ''}.</p>`);
190
- const line = landingStats(g, v, rows, i);
191
- if (line !== '')
192
- out.push(`<p class="stat">${esc(line)}</p>`);
193
- out.push('</div>');
194
- });
195
- out.push('</div>');
196
- out.push('<h2>What the menu shows each kind of user</h2>');
197
- const menus = g.menuFrames.map((f) => (g.frames[f].menu ?? f).toLowerCase());
198
- out.push(`<p class="muted" style="margin-top:-4px">One row per menu entry.${menus.length > 1 ? ` The ${menus.join(' and the ')} are different menus.` : ''}</p>`);
199
- out.push(matrix(g, views, rows));
200
- out.push('<h2>How to get to each page</h2>');
201
- out.push(reachTable(g, views));
202
- out.push(goalsTable(g, goals));
203
- out.push('<h2>The pages</h2>');
204
- out.push(siteMap(g));
205
- if (repo !== null) {
206
- const bad = repo.checks.filter((c) => !c.ok);
207
- out.push('<h2>Checked against the app</h2>');
208
- out.push(`<p>${repo.checks.length - bad.length} of ${repo.checks.length} checks hold${repo.head === null ? '' : ` in the checkout at ${esc(repo.head)}`}${repo.head !== null && g.source.commit !== undefined && !repo.head.startsWith(g.source.commit) && !g.source.commit.startsWith(repo.head) ? ` <span class="bad">(the graph was read at ${esc(g.source.commit)})</span>` : ''}. The checks read the route files, the menu registry, the permission table and the translation file; they do not run the app.</p>`);
209
- const line = (c) => `<li class="${c.ok ? '' : 'fail'}">${esc(c.what)}${c.detail === '' ? '' : ` <span class="muted">— ${esc(c.detail)}</span>`}</li>`;
210
- if (bad.length > 0)
211
- out.push(`<ul class="checks checklist">${bad.map(line).join('')}</ul>`);
212
- out.push(`<details><summary>${repo.checks.length - bad.length} checks that hold</summary><ul class="checks checklist" style="margin-top:8px">${repo.checks.filter((c) => c.ok).map(line).join('')}</ul></details>`);
213
- }
214
- out.push('<h2>Not modeled</h2><ul>');
215
- for (const n of g.notModeled)
216
- out.push(`<li>${esc(n)}</li>`);
217
- out.push('</ul>');
218
- out.push('<h2>Reference</h2>');
219
- out.push(`<details><summary>Every way to move (${g.specs.length})</summary>${referenceTable(g)}</details>`);
220
- out.push(`<details><summary>Named rules</summary>${guardsReference(g)}</details>`);
221
- out.push('<footer>delurio graph-viz · generated from nav.yaml and the catalog · no AI, no network: the same input gives the same bytes.</footer>');
222
- out.push('</main></body></html>');
223
- return out.join('\n') + '\n';
224
- }
225
- const clean = (s) => s.replace(/"/g, "'").replace(/[<>|]/g, ' ').replace(/\s+/g, ' ').trim();
226
- // Mermaid flowchart for PRs and READMEs: one menu hub per frame; links, buttons and landing rules as arrows.
227
- export function renderNavMermaid(g) {
228
- const lines = ['---', `title: ${clean(g.title)} navigation`, '---', 'flowchart LR'];
229
- const hubOf = (p) => (g.menuFrames.includes(p.frame) ? `hub_${p.frame}` : null);
230
- for (const frame of Object.keys(g.frames)) {
231
- const pages = Object.values(g.pages).filter((p) => p.frame === frame);
232
- if (pages.length === 0)
233
- continue;
234
- lines.push(` subgraph F_${frame}["${clean(g.frames[frame].title.replace(/ \(.*$/, ''))}"]`);
235
- if (g.menuFrames.includes(frame))
236
- lines.push(` hub_${frame}(("menu"))`);
237
- for (const p of pages)
238
- lines.push(` ${p.id}["${clean(p.title)}<br/>${clean(p.route)}"]`);
239
- lines.push(' end');
240
- }
241
- const seen = new Set();
242
- const edge = (from, to, label, dotted) => {
243
- const key = `${from}|${to}|${label}|${dotted}`;
244
- if (seen.has(key))
245
- return;
246
- seen.add(key);
247
- lines.push(` ${from} ${dotted ? '-.->' : '-->'}${label === '' ? '' : `|"${clean(label)}"|`} ${to}`);
248
- };
249
- for (const e of g.entries) {
250
- const from = g.pages[e.from];
251
- const hub = hubOf(from);
252
- if (e.how === 'menu') {
253
- if (hub !== null)
254
- edge(hub, e.to, '', false);
255
- else if (g.frames[from.frame].shows !== undefined)
256
- continue; // drawn through the hubs
257
- }
258
- else if (e.how === 'picker') {
259
- if (hub !== null)
260
- edge(hub, e.to, e.label, true);
261
- }
262
- else if (e.how === 'user') {
263
- if (hub !== null)
264
- edge(hub, e.to, e.label, true);
265
- }
266
- else {
267
- edge(e.from, e.to, e.how === 'auto' ? 'automatic' : e.label, e.how === 'auto');
268
- }
269
- }
270
- lines.push(' classDef placeholder stroke-dasharray:4 3,fill:#f5f5f4,stroke:#78716c');
271
- lines.push(' classDef hub fill:#eef3ff,stroke:#1d4ed8');
272
- const placeholders = Object.values(g.pages).filter((p) => p.kind === 'placeholder').map((p) => p.id);
273
- if (placeholders.length > 0)
274
- lines.push(` class ${placeholders.join(',')} placeholder`);
275
- const gone = Object.values(g.pages).filter((p) => p.kind === 'missing').map((p) => p.id);
276
- if (gone.length > 0) {
277
- lines.push(' classDef missing stroke-dasharray:2 3,fill:#fff5f5,stroke:#b91c1c');
278
- lines.push(` class ${gone.join(',')} missing`);
279
- }
280
- if (g.menuFrames.length > 0)
281
- lines.push(` class ${g.menuFrames.map((f) => `hub_${f}`).join(',')} hub`);
282
- return lines.join('\n') + '\n';
283
- }