@atom63/cli 0.1.0-beta.4 → 0.1.0-beta.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atom63/cli",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "Query the Atom63 design system from the command line or an MCP host: components, contracts, tokens, examples and docs",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/format.mjs CHANGED
@@ -135,6 +135,20 @@ function buildKit(data) {
135
135
  '',
136
136
  ]
137
137
  : []),
138
+ ...(data.reading
139
+ ? [
140
+ '## Reading page',
141
+ data.reading.use,
142
+ '',
143
+ '```tsx',
144
+ ...data.reading.imports,
145
+ '',
146
+ data.reading.snippet,
147
+ '```',
148
+ `→ ${data.reading.next}`,
149
+ '',
150
+ ]
151
+ : []),
138
152
  ...(data.amount
139
153
  ? [
140
154
  '## Display amount',
package/src/rules.mjs CHANGED
@@ -64,7 +64,7 @@ export const rules = [
64
64
  },
65
65
  {
66
66
  id: 'content-colors',
67
- rule: 'Draw content that carries its own colours (illustrations, game pieces, map and chart series, story rings, category marks) with the `--a63-category-{hue}` palette: 18 hues, each with `-subtle` and `-subtle-foreground`, as utilities such as `bg-category-green` and `text-category-green-subtle-foreground`. For another shade, mix two tokens with `color-mix(in oklch, var(--a63-category-green) 75%, var(--a63-text-primary))`, never a colour keyword or value.',
67
+ rule: 'Draw content that carries its own colours (illustrations, game pieces, map series, story rings, category marks) with the `--a63-category-{hue}` palette: 18 hues, each with `-subtle` and `-subtle-foreground`, as utilities such as `bg-category-green` and `text-category-green-subtle-foreground`. Chart series take `--a63-chart-1` to `--a63-chart-5`, which keep apart from the brand; the `Chart` component reads them for you. For another shade, mix two tokens with `color-mix(in oklch, var(--a63-category-green) 75%, var(--a63-text-primary))`, never a colour keyword or value.',
68
68
  why: 'The palette follows the theme and the mode, so content stays legible in dark mode. A literal colour, or a keyword such as `black` inside `color-mix()`, fails `raw-color` and makes a vibe case invalid.',
69
69
  check: ['raw-color'],
70
70
  },
package/src/templates.mjs CHANGED
@@ -192,6 +192,51 @@ const phoneScreen = {
192
192
  next: 'atom63 template app-view',
193
193
  }
194
194
 
195
+ /* Words that mark an idea as a page to read: an article, a blog post, a docs page. */
196
+ const readingWords = new Set([
197
+ 'article',
198
+ 'articles',
199
+ 'blog',
200
+ 'blogs',
201
+ 'docs',
202
+ 'documentation',
203
+ 'essay',
204
+ 'essays',
205
+ 'guide',
206
+ 'guides',
207
+ 'longform',
208
+ 'reader',
209
+ 'reading',
210
+ ])
211
+
212
+ /** Whether an idea is a page to read (an article, a blog post, a docs page), not a phone screen. */
213
+ export function isReadingIdea(idea) {
214
+ if (isPhoneIdea(idea)) return false
215
+ return (
216
+ queryTerms(idea).some(({ term, weight }) => weight === 1 && readingWords.has(term)) ||
217
+ /\blong-form\b/i.test(idea)
218
+ )
219
+ }
220
+
221
+ /* What a reading idea is told to build on: Page, Container, Section and ReaderLayout. */
222
+ const readingPage = {
223
+ template: 'reading-page',
224
+ use: 'Build a page to read (an article, a blog post, a docs page) on ReaderLayout, not an app shell: Page owns the main landmark, Container the width, Section the space around the document, and ReaderLayout a centred reading column with a rail beside it on wide screens for the table of contents. Pass reserveAside on pages with no rail so the column keeps its width. Inside an app shell, give Page render={<div />} so the document keeps one main landmark.',
225
+ imports: ["import { Container, Page, ReaderLayout, Section } from '@atom63/ui-react/layout'"],
226
+ snippet: [
227
+ '<Page noPadding>',
228
+ ' <Container maxWidth="widest" padding="none">',
229
+ ' <Section gap={false} removeTopSpacing={false} spacing="tight">',
230
+ ' <ReaderLayout aside={<nav aria-label="On this page">…</nav>}>',
231
+ ' <h1>…</h1>',
232
+ ' </ReaderLayout>',
233
+ ' </Section>',
234
+ ' </Container>',
235
+ '</Page>',
236
+ ].join('\n'),
237
+ next: 'atom63 template reading-page',
238
+ }
239
+
195
240
  /* Words that mark an idea as showing a money amount as its hero number. */
196
241
  const amountWords = new Set([
197
242
  'amount',
@@ -306,8 +351,14 @@ export function build(index, idea) {
306
351
  { ...summaryOf(findTemplate(index, id)), next: `atom63 copy ${id} <dir>` },
307
352
  ...pick(kind, limit).filter(entry => entry.id !== id),
308
353
  ].slice(0, limit)
309
- const pages = phone ? lead('page', 3, 'app-view') : pick('page', 3)
310
- const blocks = phone ? lead('block', 5, 'tab-bar') : pick('block', 5)
354
+ // A reading idea gets the reading page alone: no app-shell page or block fits it.
355
+ const reading = isReadingIdea(idea)
356
+ const pages = phone
357
+ ? lead('page', 3, 'app-view')
358
+ : reading
359
+ ? lead('page', 1, readingPage.template)
360
+ : pick('page', 3)
361
+ const blocks = phone ? lead('block', 5, 'tab-bar') : reading ? [] : pick('block', 5)
311
362
  // What the closest templates are built from comes first, then what the idea names.
312
363
  const bySlug = new Map(index.components.map(entry => [entry.slug, entry]))
313
364
  const used = [pages[0], ...blocks]
@@ -334,6 +385,7 @@ export function build(index, idea) {
334
385
  data: {
335
386
  idea,
336
387
  ...(phone ? { phone: phoneScreen } : {}),
388
+ ...(reading ? { reading: readingPage } : {}),
337
389
  ...(isAmountIdea(idea) ? { amount: displayAmount } : {}),
338
390
  ...(isDenseIdea(idea) ? { density: compactDensity } : {}),
339
391
  pages,