@astryxdesign/cli 0.7.17 → 0.7.18-canary.g57306fd

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 (241) hide show
  1. package/README.md +1 -1
  2. package/api/discover/_adapter.d.mts +7 -5
  3. package/api/discover/_adapter.mjs +12 -11
  4. package/api/docs/_adapter.d.mts +19 -2
  5. package/api/docs/_adapter.mjs +66 -5
  6. package/api/doctor/_adapter.d.mts +11 -62
  7. package/api/doctor/_adapter.mjs +242 -472
  8. package/api/doctor/doctor.d.mts +1 -1
  9. package/api/doctor/doctor.mjs +3 -3
  10. package/api/doctor/theme-checks.mjs +37 -45
  11. package/api/error.d.mts +21 -0
  12. package/api/error.mjs +89 -0
  13. package/api/hook/list/list.d.mts +1 -1
  14. package/api/icon/_adapter.d.mts +8 -0
  15. package/api/icon/_adapter.mjs +17 -0
  16. package/api/icon/_authoring.mjs +6 -6
  17. package/api/icon/_default-look.mjs +16 -16
  18. package/api/icon/add/add.mjs +3 -3
  19. package/api/icon/exportIconIndex.doc.mjs +2 -2
  20. package/api/icon/icon.doc.mjs +2 -2
  21. package/api/icon/icon.type.d.mts +4 -0
  22. package/api/icon/icon.type.mjs +2 -1
  23. package/api/icon/search/icon-index.mjs +16 -3
  24. package/api/icon/search/search.d.mts +15 -5
  25. package/api/icon/search/search.mjs +74 -16
  26. package/api/icon/use/use.mjs +4 -4
  27. package/api/render/_adapter.mjs +233 -40
  28. package/api/render/render.type.d.mts +1 -1
  29. package/api/render/render.type.mjs +1 -1
  30. package/api/search/ORDERING.md +2 -2
  31. package/api/search/_adapter.mjs +4 -0
  32. package/api/search/_candidate-score.mjs +32 -8
  33. package/api/search/_cards.json +1 -1
  34. package/api/search/_compound.d.mts +0 -1
  35. package/api/search/_compound.mjs +93 -2
  36. package/api/search/_icons.d.mts +4 -2
  37. package/api/search/_icons.mjs +4 -2
  38. package/api/search/_lexical.mjs +177 -17
  39. package/api/search/_order.d.mts +3 -1
  40. package/api/search/_order.mjs +16 -5
  41. package/api/search/_result.d.mts +9 -0
  42. package/api/search/_result.mjs +10 -0
  43. package/api/search/_score.mjs +21 -3
  44. package/api/swizzle/_moduleGraph.d.mts +8 -0
  45. package/api/swizzle/_moduleGraph.mjs +61 -3
  46. package/api/template/copy/copy.mjs +5 -3
  47. package/api/theme/_adapter.mjs +48 -12
  48. package/api/theme/build/build.d.mts +4 -0
  49. package/api/theme/build/build.mjs +69 -18
  50. package/api/theme/build/style-keys.mjs +4 -5
  51. package/api/theme/build/theme-object.mjs +5 -0
  52. package/api/theme/palette/generate/color.d.mts +47 -0
  53. package/api/theme/palette/generate/color.mjs +58 -1
  54. package/api/theme/palette/generate/derive-look.d.mts +293 -0
  55. package/api/theme/palette/generate/derive-look.mjs +1362 -0
  56. package/api/theme/palette/generate/editor-look.d.mts +62 -0
  57. package/api/theme/palette/generate/editor-look.mjs +550 -0
  58. package/api/theme/palette/generate/mapping.d.mts +94 -9
  59. package/api/theme/palette/generate/mapping.mjs +94 -22
  60. package/api/theme-edit/_adapter.mjs +13 -2
  61. package/api/theme-edit/_catalog.d.mts +13 -13
  62. package/api/theme-edit/_catalog.mjs +66 -28
  63. package/api/theme-edit/_check.d.mts +82 -6
  64. package/api/theme-edit/_check.mjs +1270 -238
  65. package/api/theme-edit/_color.d.mts +74 -0
  66. package/api/theme-edit/_color.mjs +168 -3
  67. package/api/theme-edit/_compiler.d.mts +3 -5
  68. package/api/theme-edit/_compiler.mjs +122 -23
  69. package/api/theme-edit/_context.d.mts +55 -12
  70. package/api/theme-edit/_context.mjs +114 -60
  71. package/api/theme-edit/_css.d.mts +11 -0
  72. package/api/theme-edit/_css.mjs +40 -0
  73. package/api/theme-edit/_edit.d.mts +15 -2
  74. package/api/theme-edit/_edit.mjs +1469 -133
  75. package/api/theme-edit/_how-commands.d.mts +116 -0
  76. package/api/theme-edit/_how-commands.mjs +227 -115
  77. package/api/theme-edit/_how-question.d.mts +74 -29
  78. package/api/theme-edit/_how-question.mjs +8514 -1256
  79. package/api/theme-edit/_how-sides.d.mts +22 -0
  80. package/api/theme-edit/_how-sides.mjs +173 -0
  81. package/api/theme-edit/_how-steps.d.mts +42 -0
  82. package/api/theme-edit/_how-steps.mjs +208 -0
  83. package/api/theme-edit/_how-values.d.mts +29 -0
  84. package/api/theme-edit/_how-values.mjs +111 -0
  85. package/api/theme-edit/_how-words.d.mts +15 -0
  86. package/api/theme-edit/_how-words.mjs +239 -0
  87. package/api/theme-edit/_how.d.mts +1 -1
  88. package/api/theme-edit/_how.mjs +422 -37
  89. package/api/theme-edit/_missed.d.mts +2 -1
  90. package/api/theme-edit/_missed.mjs +125 -13
  91. package/api/theme-edit/_normal.d.mts +5 -3
  92. package/api/theme-edit/_normal.mjs +54 -14
  93. package/api/theme-edit/_palette.d.mts +204 -4
  94. package/api/theme-edit/_palette.mjs +901 -25
  95. package/api/theme-edit/_part-pieces.d.mts +54 -0
  96. package/api/theme-edit/_part-pieces.mjs +179 -0
  97. package/api/theme-edit/_part-words.mjs +33 -5
  98. package/api/theme-edit/_parts.d.mts +133 -0
  99. package/api/theme-edit/_parts.mjs +599 -10
  100. package/api/theme-edit/_picture-traits.d.mts +259 -0
  101. package/api/theme-edit/_picture-traits.mjs +1030 -0
  102. package/api/theme-edit/_preview.d.mts +95 -4
  103. package/api/theme-edit/_preview.mjs +284 -31
  104. package/api/theme-edit/_project.d.mts +14 -4
  105. package/api/theme-edit/_project.mjs +95 -26
  106. package/api/theme-edit/_resolved.d.mts +46 -0
  107. package/api/theme-edit/_resolved.mjs +800 -0
  108. package/api/theme-edit/_set-line.d.mts +29 -0
  109. package/api/theme-edit/_set-line.mjs +100 -0
  110. package/api/theme-edit/_settings.d.mts +625 -28
  111. package/api/theme-edit/_settings.mjs +4867 -888
  112. package/api/theme-edit/_tables.d.mts +25 -1
  113. package/api/theme-edit/_tables.mjs +115 -11
  114. package/api/theme-edit/_text-looks.d.mts +78 -0
  115. package/api/theme-edit/_text-looks.mjs +376 -0
  116. package/api/theme-edit/_vet.d.mts +3 -26
  117. package/api/theme-edit/_vet.mjs +5 -89
  118. package/api/theme-edit/how/how.d.mts +1 -1
  119. package/api/theme-edit/how/how.mjs +1 -1
  120. package/api/theme-edit/show/show.d.mts +4 -3
  121. package/api/theme-edit/show/show.mjs +3 -2
  122. package/api/theme-edit/theme-edit.type.d.mts +117 -1
  123. package/api/theme-edit/theme-edit.type.mjs +46 -3
  124. package/api/theme-edit/themeEditHow.doc.mjs +3 -3
  125. package/api/theme-edit/themeEditNew.doc.mjs +4 -0
  126. package/api/theme-edit/themeEditSet.doc.mjs +6 -2
  127. package/api/theme-edit/themeEditShow.doc.mjs +22 -3
  128. package/api/theme-edit/themeEditUndo.doc.mjs +4 -0
  129. package/assets/component-list.generated.json +1 -1
  130. package/assets/docs/author-a-theme.doc.mjs +7 -4
  131. package/assets/docs/theme.doc.dense.mjs +10 -0
  132. package/assets/docs/theme.doc.mjs +10 -0
  133. package/assets/docs/theme.doc.zh.mjs +10 -0
  134. package/assets/docs/tree/export-pages.doc.mjs +1 -1
  135. package/assets/docs/tree/icon-sets.doc.mjs +1 -1
  136. package/assets/docs/use-a-theme.doc.mjs +89 -17
  137. package/assets/docs-routes.generated.json +1 -1
  138. package/assets/docs.generated.json +2 -2
  139. package/assets/icons/definitions/article.doc.mjs +9 -0
  140. package/assets/icons/template-icons.json +5 -0
  141. package/assets/search-catalog.generated.json +2 -2
  142. package/assets/self-audit.generated.json +1 -1
  143. package/assets/templates/blocks/components/Citation/CitationInlineText.doc.mjs +1 -1
  144. package/assets/templates/blocks/components/Citation/CitationInlineText.tsx +3 -1
  145. package/assets/templates/blocks/components/Citation/CitationShowcase.doc.mjs +1 -1
  146. package/assets/templates/blocks/components/Citation/CitationShowcase.tsx +3 -1
  147. package/assets/templates/blocks/components/Citation/CitationSourceList.doc.mjs +1 -1
  148. package/assets/templates/blocks/components/Citation/CitationSourceList.tsx +7 -3
  149. package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.doc.mjs +1 -1
  150. package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.tsx +5 -2
  151. package/assets/templates/components.generated.json +1 -1
  152. package/assets/templates/pages/ide/page.tsx +5 -10
  153. package/assets/templates/pages/payment-form/page.tsx +16 -60
  154. package/assets/templates/themes/neutral/neutralTheme.ts +4 -3
  155. package/authoring/debug/parse.d.mts +1 -1
  156. package/authoring/doctypes/_schema.d.mts +13 -13
  157. package/authoring/gap-report/parse.d.mts +1 -1
  158. package/clients/cli/build-id.generated.json +1 -1
  159. package/clients/cli/commands/ensure-core-built.mjs +17 -10
  160. package/clients/cli/commands/experimental/icon.mjs +7 -7
  161. package/clients/cli/commands/experimental/theme.mjs +175 -13
  162. package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
  163. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
  164. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +11 -3
  165. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -3
  166. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +15 -5
  167. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  168. package/clients/cli/commands/hook.mjs +7 -0
  169. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  170. package/clients/cli/index.mjs +6 -2
  171. package/clients/cli/lib/hook-format.mjs +41 -1
  172. package/clients/cli/lib/json-shim.mjs +34 -14
  173. package/clients/cli/lib/other-cli-words.mjs +7 -0
  174. package/clients/cli/lib/unknown-command.mjs +345 -46
  175. package/clients/cli/manifest.generated.json +1 -1
  176. package/foundation/agent-docs/agent-docs.d.mts +11 -2
  177. package/foundation/agent-docs/agent-docs.mjs +51 -8
  178. package/foundation/config/project.d.mts +11 -1
  179. package/foundation/config/project.mjs +11 -2
  180. package/foundation/discovery/component-replacement.d.mts +5 -8
  181. package/foundation/discovery/component-replacement.mjs +12 -14
  182. package/foundation/discovery/core-augmentation-points.d.mts +35 -0
  183. package/foundation/discovery/core-augmentation-points.mjs +410 -9
  184. package/foundation/discovery/core-elements.d.mts +6 -0
  185. package/foundation/discovery/core-elements.mjs +10 -2
  186. package/foundation/discovery/core-prop-types.d.mts +5 -0
  187. package/foundation/discovery/core-prop-types.mjs +10 -3
  188. package/foundation/discovery/core-props.d.mts +8 -0
  189. package/foundation/discovery/core-props.mjs +29 -13
  190. package/foundation/discovery/icon-ranking.d.mts +5 -2
  191. package/foundation/discovery/icon-ranking.mjs +101 -18
  192. package/foundation/discovery/icon-set-checks.mjs +1 -1
  193. package/foundation/discovery/icon-set-writer.mjs +1 -1
  194. package/foundation/discovery/official-list.d.mts +17 -0
  195. package/foundation/discovery/official-list.mjs +77 -0
  196. package/foundation/discovery/unknown-core-props.d.mts +130 -0
  197. package/foundation/discovery/unknown-core-props.mjs +601 -0
  198. package/foundation/discovery/written-prop-values.d.mts +35 -0
  199. package/foundation/discovery/written-prop-values.mjs +258 -0
  200. package/foundation/fonts/fontsource-families.generated.d.mts +5 -0
  201. package/foundation/fonts/fontsource-families.generated.mjs +2110 -0
  202. package/foundation/fs/package-name.d.mts +10 -0
  203. package/foundation/fs/package-name.mjs +37 -0
  204. package/foundation/fs/project-source-files.d.mts +27 -0
  205. package/foundation/fs/project-source-files.mjs +115 -0
  206. package/foundation/fs/project-sources.d.mts +25 -0
  207. package/foundation/fs/project-sources.mjs +83 -0
  208. package/foundation/fs/read-record.d.mts +18 -0
  209. package/foundation/fs/read-record.mjs +36 -2
  210. package/foundation/integrations/integration-warnings.d.mts +39 -7
  211. package/foundation/integrations/integration-warnings.mjs +141 -19
  212. package/foundation/integrations/missing-dependency.d.mts +11 -0
  213. package/foundation/integrations/missing-dependency.mjs +20 -5
  214. package/foundation/release/folder-lock.d.mts +5 -2
  215. package/foundation/release/folder-lock.mjs +9 -3
  216. package/foundation/release/notices.mjs +2 -8
  217. package/foundation/render/cut-short.d.mts +8 -2
  218. package/foundation/render/cut-short.mjs +50 -5
  219. package/foundation/render/drawn-contrast.d.mts +40 -0
  220. package/foundation/render/drawn-contrast.mjs +355 -0
  221. package/foundation/render/file-header.mjs +4 -0
  222. package/foundation/render/layers.d.mts +2 -1
  223. package/foundation/render/layers.mjs +22 -1
  224. package/foundation/render/package-resolve-hooks.d.mts +38 -9
  225. package/foundation/render/package-resolve-hooks.mjs +124 -32
  226. package/foundation/render/page-worker.mjs +95 -23
  227. package/foundation/render/part-boxes.d.mts +27 -0
  228. package/foundation/render/part-boxes.mjs +45 -0
  229. package/foundation/render/picture-chrome.mjs +36 -4
  230. package/foundation/render/picture-playwright.mjs +26 -2
  231. package/foundation/render/picture-window.d.mts +29 -2
  232. package/foundation/render/picture-window.mjs +99 -1
  233. package/foundation/render/render-page.d.mts +39 -6
  234. package/foundation/render/render-page.mjs +26 -10
  235. package/foundation/render/ts-paths.mjs +2 -1
  236. package/foundation/response/error-codes.doc.mjs +1 -1
  237. package/foundation/response/error-codes.mjs +1 -1
  238. package/foundation/response/response-types.doc.mjs +9 -5
  239. package/foundation/text/written-string.d.mts +4 -1
  240. package/foundation/text/written-string.mjs +4 -1
  241. package/package.json +8 -7
@@ -189,6 +189,14 @@ export type ThemeEditChangeData = {
189
189
  * - The setting written, or for `undo` the one removed.
190
190
  */
191
191
  setting: ThemeEditSetting;
192
+ /**
193
+ * - On `set` of a box shorthand a part takes one length of (a menu's `padding '5px 0'`): the value typed and the sides written for it in this change, `setting` being the first.
194
+ */
195
+ asSides?: {
196
+ thing: string;
197
+ value: string;
198
+ sides: ThemeEditSetting[];
199
+ } | undefined;
192
200
  /**
193
201
  * - On `undo`: what applies instead of the setting removed: a dial that still writes the token (such as the generated accent color), a whole-theme setting of the same thing, or the base theme's value.
194
202
  */
@@ -222,7 +230,7 @@ export type ThemeEditChangeData = {
222
230
  onlyHint: boolean;
223
231
  } | null;
224
232
  /**
225
- * - Resolved token changes, `name (mode): before -> after`.
233
+ * - Resolved token changes, `name (mode): before -> after`. The category colors (badges, tokens, card tints) and chart colors that moved with the look are counted in one line each.
226
234
  */
227
235
  changedTokens: string[];
228
236
  /**
@@ -252,6 +260,13 @@ export type ThemeEditChangeData = {
252
260
  note: string;
253
261
  run: string[];
254
262
  }>;
263
+ /**
264
+ * - The open fonts this set names whose package is not installed, each with the command that installs it; the previews and the app draw the next font in the stack until then. Left out when every one loads. The text output prints it right under the status line.
265
+ */
266
+ fontNotLoaded?: {
267
+ family: string;
268
+ run: string[];
269
+ }[] | undefined;
255
270
  /**
256
271
  * - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
257
272
  */
@@ -260,6 +275,10 @@ export type ThemeEditChangeData = {
260
275
  * - What this change made unreadable or unseen, each with the command that fixes it: text and borders that read well before it, and the contrast checks the colors it made fail; with `png`, text the sample page's pictures draw cut short, with `flex-shrink 0` on its part when the browser measured that drawing it whole. The text output leads with them, under the status line.
261
276
  */
262
277
  newProblems: ThemeEditProblem[];
278
+ /**
279
+ * - Problems the theme had that this change moved but left failing (a fill made darker, still not dark enough), each with what it was and the command that fixes it; left out when none. The text output says them under the new problems.
280
+ */
281
+ leftProblems?: ThemeEditProblem[] | undefined;
263
282
  /**
264
283
  * - How many misses the theme's own changes left (show --json lists each, with the line that reaches it); the text output counts them near its top.
265
284
  */
@@ -276,6 +295,10 @@ export type ThemeEditChangeData = {
276
295
  * - Where each of those parts keeps the base theme's look: the part, the variant its miss is in when it is one (`type:error`), then the state, or `at rest`; the text output names them.
277
296
  */
278
297
  missedWhere?: string[] | undefined;
298
+ /**
299
+ * - How many of those misses this change brought (not there before it); the text output says the missed line only when it brought one.
300
+ */
301
+ missedNew?: number | undefined;
279
302
  /**
280
303
  * - Warnings from the theme build.
281
304
  */
@@ -326,6 +349,10 @@ export type ThemeEditShowOptions = {
326
349
  * - Also take PNG pictures of the previews.
327
350
  */
328
351
  png?: boolean | undefined;
352
+ /**
353
+ * - Only what one part shows, as a lookup that writes nothing (`themeEdit.showPart`); the theme may then be any theme the project builds.
354
+ */
355
+ on?: string | undefined;
329
356
  };
330
357
  /**
331
358
  * `astryx --json experimental theme editor show <theme>`.
@@ -375,6 +402,65 @@ export type ThemeEditShowResponse = {
375
402
  wiring: string[];
376
403
  };
377
404
  };
405
+ /**
406
+ * `astryx --json experimental theme editor show <theme> --on <part>`: what one
407
+ * part of a theme shows. Nothing is written.
408
+ */
409
+ export type ThemeEditShowPartResponse = {
410
+ type: "themeEdit.showPart";
411
+ data: {
412
+ theme: string;
413
+ kind: "editor" | "local" | "package" | "bundled";
414
+ part: string;
415
+ values: ThemeEditPartValue[];
416
+ };
417
+ };
418
+ /**
419
+ * One property of a part, as `show --on` gives it.
420
+ */
421
+ export type ThemeEditPartValue = {
422
+ /**
423
+ * - The CSS property.
424
+ */
425
+ property: string;
426
+ /**
427
+ * - The variant, as `set` takes `--when` (`variant:outlined`); null at rest. For a condition no flag of `set` reaches, the condition as Core writes it, with `notSettable`.
428
+ */
429
+ when: string | null;
430
+ /**
431
+ * - The state, as `set` takes `--state`; null for none (and for a condition no flag reaches).
432
+ */
433
+ state: string | null;
434
+ /**
435
+ * - Only for a condition no flag of `set` reaches (a CSS selector such as `:first-child`): why, as `how <part>` says it.
436
+ */
437
+ notSettable?: string | undefined;
438
+ /**
439
+ * - The final value, every token written out; per mode when the modes differ; null when a token it reads has no value. A mode is left out where it is not shown yet (the other mode of a property or token a one-mode block sets on the part, with nothing else under that condition).
440
+ */
441
+ value: string | {
442
+ light?: string | null;
443
+ dark?: string | null;
444
+ } | null;
445
+ /**
446
+ * - The declaration that gives it, as written: Core's, or the rule on the part; per mode when a rule sets one mode (a one-mode theme, or a `--mode` setting).
447
+ */
448
+ expression: string | {
449
+ light?: string;
450
+ dark?: string;
451
+ };
452
+ /**
453
+ * - The tokens it reads, and the tokens those read in turn, in order; per mode when the modes read different ones.
454
+ */
455
+ tokens: string[] | {
456
+ light?: string[];
457
+ dark?: string[];
458
+ };
459
+ /**
460
+ * - Who decides the value (not a setting's source, as in `show`'s settings): Core's default, the base theme the theme extends, or the theme's own file, a setting on the part included.
461
+ */
462
+ source: "core" | "base" | "theme";
463
+ };
378
464
  /**
379
465
  * One color of a theme, as `show` reports it.
380
466
  */
@@ -601,6 +687,35 @@ export type ThemeEditHowOptions = {
601
687
  */
602
688
  words?: string[] | undefined;
603
689
  };
690
+ /**
691
+ * One result of a plain-words question (`data.results`, `kind: 'question'`).
692
+ */
693
+ export type ThemeEditHowResult = {
694
+ /**
695
+ * - What the result does, or why it does nothing.
696
+ */
697
+ text: string;
698
+ /**
699
+ * - The commands, each checked as `set` checks it.
700
+ */
701
+ commands: string[];
702
+ /**
703
+ * - Run every command in order.
704
+ */
705
+ sequence?: boolean | undefined;
706
+ /**
707
+ * - Commands left out, with the reason.
708
+ */
709
+ refused?: {
710
+ command: string;
711
+ why: string;
712
+ run?: string[];
713
+ }[] | undefined;
714
+ /**
715
+ * - More than the ask (a colored variant changed too): never first, never the answer itself.
716
+ */
717
+ offer?: boolean | undefined;
718
+ };
604
719
  /**
605
720
  * `astryx --json experimental theme editor how <subject>`. `kind` says which answer it is.
606
721
  */
@@ -609,6 +724,7 @@ export type ThemeEditHowResponse = {
609
724
  data: {
610
725
  kind: "part" | "group" | "setting" | "aspect" | "question" | "picture" | "list";
611
726
  subject: string;
727
+ results?: ThemeEditHowResult[];
612
728
  [key: string]: any;
613
729
  };
614
730
  };
@@ -90,6 +90,7 @@
90
90
  * @property {string} theme
91
91
  * @property {'set' | 'undo'} action
92
92
  * @property {ThemeEditSetting} setting - The setting written, or for `undo` the one removed.
93
+ * @property {{thing: string, value: string, sides: ThemeEditSetting[]}} [asSides] - On `set` of a box shorthand a part takes one length of (a menu's `padding '5px 0'`): the value typed and the sides written for it in this change, `setting` being the first.
93
94
  * @property {string} [now] - On `undo`: what applies instead of the setting removed: a dial that still writes the token (such as the generated accent color), a whole-theme setting of the same thing, or the base theme's value.
94
95
  * @property {ThemeEditSetting} [removed] - On `undo`: the setting removed (the same as `setting`); the value now in effect is the base theme's, and `changedTokens` lists it.
95
96
  * @property {ThemeEditSetting[]} [alsoRemoved] - On `undo` of a setting listed more than once by hand: the other entries, removed with it.
@@ -97,19 +98,22 @@
97
98
  * @property {string | null} was - For `base`, `mode` and a whole-theme dial: the value before.
98
99
  * @property {string[]} parts - The parts it styles (a group's members when it spread).
99
100
  * @property {{name: string, members: string[], onlyHint: boolean} | null} group - The group it spread to; `onlyHint` when `--only` would style one member.
100
- * @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`.
101
+ * @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`. The category colors (badges, tokens, card tints) and chart colors that moved with the look are counted in one line each.
101
102
  * @property {string[]} [changedPartTokens] - Changes to the custom properties the built stylesheet sets on parts, `name on <rule> (mode): before -> after` (a readable text color on a selected row). With `changedTokens`, every custom property whose built value moved.
102
103
  * @property {string[]} styled - Part styles and typography the change wrote.
103
104
  * @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
104
105
  * @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
105
106
  * @property {string[]} notes - What else to know: the shade a color's main token uses and any shade contrast moved, then the generated color files; font loading; what a token feeds; with `png`, the text the sample page's pictures draw cut short and the words they break inside the word, as the browser measured them (one note for each part, with its labels).
106
107
  * @property {Array<{note: string, run: string[]}>} leftOut - What a whole-theme change leaves out, each with the commands that reach it, one per part: the parts drawn as pills that square corners leave round; the surfaces a border width does not reach, and the dividers it moves. The text output prints it right under the status line.
108
+ * @property {Array<{family: string, run: string[]}>} [fontNotLoaded] - The open fonts this set names whose package is not installed, each with the command that installs it; the previews and the app draw the next font in the stack until then. Left out when every one loads. The text output prints it right under the status line.
107
109
  * @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
108
110
  * @property {ThemeEditProblem[]} newProblems - What this change made unreadable or unseen, each with the command that fixes it: text and borders that read well before it, and the contrast checks the colors it made fail; with `png`, text the sample page's pictures draw cut short, with `flex-shrink 0` on its part when the browser measured that drawing it whole. The text output leads with them, under the status line.
111
+ * @property {ThemeEditProblem[]} [leftProblems] - Problems the theme had that this change moved but left failing (a fill made darker, still not dark enough), each with what it was and the command that fixes it; left out when none. The text output says them under the new problems.
109
112
  * @property {number} [missed] - How many misses the theme's own changes left (show --json lists each, with the line that reaches it); the text output counts them near its top.
110
113
  * @property {number} [missedParts] - On how many parts those misses are (a part can miss two ways, its border and its shadow).
111
114
  * @property {string[]} [missedOn] - Those parts, in show's order; the text output names them.
112
115
  * @property {string[]} [missedWhere] - Where each of those parts keeps the base theme's look: the part, the variant its miss is in when it is one (`type:error`), then the state, or `at rest`; the text output names them.
116
+ * @property {number} [missedNew] - How many of those misses this change brought (not there before it); the text output says the missed line only when it brought one.
113
117
  * @property {string[]} warnings - Warnings from the theme build.
114
118
  * @property {string | null} preview
115
119
  * @property {string[]} pictures
@@ -128,6 +132,7 @@
128
132
  * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
129
133
  * @property {string} [section] - Only one section of the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages.
130
134
  * @property {boolean} [png] - Also take PNG pictures of the previews.
135
+ * @property {string} [on] - Only what one part shows, as a lookup that writes nothing (`themeEdit.showPart`); the theme may then be any theme the project builds.
131
136
  */
132
137
 
133
138
  /**
@@ -157,13 +162,40 @@
157
162
  * @property {string[]} data.skipped - Template pages left out, with the install line each needs.
158
163
  * @property {string[]} data.pictures
159
164
  * @property {string | null} data.pictureProblem
160
- * @property {string} [data.look] - With `png`, when the run took them: the pictures to open: with show's full sheet, the picture of each family of components the theme sets a part of (of the buttons when it sets none) first (sheet-<family>.png, or, for a family taller than 1600px, the pictures cut from it in order: sheet-<family>-1.png, -2 …), then the sample page's and the open states' (each control at rest, hovered, focused and pressed at its top, then every menu, tooltip, popover and list drawn open). The text output says it first and last.
165
+ * @property {string} [data.look] - With `png`, when the run took them: the pictures to open: with show's full sheet, the picture of each family of components the theme sets a part of (of the buttons when it sets none) first (sheet-<family>.png, or, for a family taller than 1600px, the pictures cut from it in order: sheet-<family>-1.png, -2 …); with --section pages, the pages pictures (sheet-pages-1.png, -2 … for a tall one); then the sample page's and the open states' (each control at rest, hovered, focused and pressed at its top, then every menu, tooltip, popover and list drawn open). The text output says it first and last.
161
166
  * @property {{config: string, module: string, receipt: string} | null} data.colorFiles - The generated color files: the input (in the shape `theme palette generate` reads), the module the theme imports, and the receipt; null when the theme sets no color.
162
167
  * @property {{wrote: string[]}} [data.appCopy] - Only the first time the theme's app copy is written: the files written in src/themes/<theme>/.
163
168
  * @property {string} [data.appCopyStale] - Set when the app copy was not written: a file, folder or link of yours at one of its names; a link on the way to it (src/, src/themes/ or the copy's folder; the editor writes nothing through one); a file where src/, src/themes/ or the copy's folder goes; or a folder that cannot be written, or a write that failed (with the system's reason, such as not writable or the disk is full).
164
169
  * @property {string[]} data.wiring - The steps that put the theme into this app: the root file, its imports, the Theme around the app, and what builds it (`theme add <theme>`, for the app copy the editor writes in src/themes/<theme>/; the imports by hand when a folder of yours is there).
165
170
  */
166
171
 
172
+ /**
173
+ * `astryx --json experimental theme editor show <theme> --on <part>`: what one
174
+ * part of a theme shows. Nothing is written.
175
+ * @experimental May change or be removed in a patch release.
176
+ * @typedef {object} ThemeEditShowPartResponse
177
+ * @property {'themeEdit.showPart'} type
178
+ * @property {object} data
179
+ * @property {string} data.theme
180
+ * @property {'editor' | 'local' | 'package' | 'bundled'} data.kind - Where the theme comes from: the editor's themes/ folder, a local theme of the app, an installed package's theme, or a bundled theme package. An editor theme is read from its saved settings: what a person adds by hand below them in its theme file is not shown yet.
181
+ * @property {string} data.part
182
+ * @property {ThemeEditPartValue[]} data.values - Each CSS property the part reads, at rest (`when` null) and in each variant. Which setting gives a value (a token, a dial, a rule on the part) is not shown yet; `source` says whose it is.
183
+ */
184
+
185
+ /**
186
+ * One property of a part, as `show --on` gives it.
187
+ * @experimental May change or be removed in a patch release.
188
+ * @typedef {object} ThemeEditPartValue
189
+ * @property {string} property - The CSS property.
190
+ * @property {string | null} when - The variant, as `set` takes `--when` (`variant:outlined`); null at rest. For a condition no flag of `set` reaches, the condition as Core writes it, with `notSettable`.
191
+ * @property {string | null} state - The state, as `set` takes `--state`; null for none (and for a condition no flag reaches).
192
+ * @property {string} [notSettable] - Only for a condition no flag of `set` reaches (a CSS selector such as `:first-child`): why, as `how <part>` says it.
193
+ * @property {string | {light?: string | null, dark?: string | null} | null} value - The final value, every token written out; per mode when the modes differ; null when a token it reads has no value. A mode is left out where it is not shown yet (the other mode of a property or token a one-mode block sets on the part, with nothing else under that condition).
194
+ * @property {string | {light?: string, dark?: string}} expression - The declaration that gives it, as written: Core's, or the rule on the part; per mode when a rule sets one mode (a one-mode theme, or a `--mode` setting).
195
+ * @property {string[] | {light?: string[], dark?: string[]}} tokens - The tokens it reads, and the tokens those read in turn, in order; per mode when the modes read different ones.
196
+ * @property {'core' | 'base' | 'theme'} source - Who decides the value (not a setting's source, as in `show`'s settings): Core's default, the base theme the theme extends, or the theme's own file, a setting on the part included.
197
+ */
198
+
167
199
  /**
168
200
  * One color of a theme, as `show` reports it.
169
201
  * @experimental May change or be removed in a patch release.
@@ -288,12 +320,23 @@
288
320
  * @property {string[]} [words] - The words as typed after `how`: a picture first takes only a count after it (the count is read from the words); anything else is one question. Replaces `subject`.
289
321
  */
290
322
 
323
+ /**
324
+ * One result of a plain-words question (`data.results`, `kind: 'question'`).
325
+ * @experimental May change or be removed in a patch release.
326
+ * @typedef {object} ThemeEditHowResult
327
+ * @property {string} text - What the result does, or why it does nothing.
328
+ * @property {string[]} commands - The commands, each checked as `set` checks it.
329
+ * @property {boolean} [sequence] - Run every command in order.
330
+ * @property {Array<{command: string, why: string, run?: string[]}>} [refused] - Commands left out, with the reason.
331
+ * @property {boolean} [offer] - More than the ask (a colored variant changed too): never first, never the answer itself.
332
+ */
333
+
291
334
  /**
292
335
  * `astryx --json experimental theme editor how <subject>`. `kind` says which answer it is.
293
336
  * @experimental May change or be removed in a patch release.
294
337
  * @typedef {object} ThemeEditHowResponse
295
338
  * @property {'themeEdit.how'} type
296
- * @property {{kind: 'part' | 'group' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, [key: string]: any}} data
339
+ * @property {{kind: 'part' | 'group' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, results?: ThemeEditHowResult[], [key: string]: any}} data
297
340
  */
298
341
 
299
342
  export {};
@@ -11,9 +11,9 @@ export const doc = {
11
11
  stability: 'experimental',
12
12
  displayName: 'themeEditHow()',
13
13
  summary:
14
- "Look up a part, group, setting or aspect; answer a question in plain words; read a picture's colors; or list what you can set.",
14
+ "Look up a part, group, setting or aspect; answer a question in plain words; read a picture's colors and look; or list what you can set.",
15
15
  description:
16
- 'One command for every question. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size), each condition written as the --when and --state flags `set` takes or marked not settable with the reason, its variants, every state `set` accepts, the parts inside it (a token set --on the part reaches them), and its group; a part the part data does not have says so, with commands that still apply. A group (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it (and, when none does, whether Core\'s stylesheet still uses it), or a CSS property and the parts that set it. An aspect (text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. `colors` (or `palette`): how the theme\'s colors are made: one seed per color, light and dark shades generated with the same generator as `theme palette generate`, the shade each token starts from, vibrancy, the Colors preview page and the exact-token escape hatch. A lookup takes any case, a plural, and a token name without its dashes. A question in plain words ("bold white text in the header", "remove shadows from cards", "cards: 8px radius; buttons: 4px"): it reads each clause for the parts (and their variant, size, state or mode), what to change, the values typed (hex, rgb(), lengths, dashed), and whether it asks for more, less or none ("shouldn\'t", "turn off", "never", "too sharp", "everything except X" included), and answers with exact commands; a typed value always wins over a color word, and a hex color with the wrong number of digits is refused by name, never replaced with a sample. "In dark mode" carries --mode dark to every color command; a change that cannot differ by mode, or a dark-mode ask on a light-only theme, says so instead. A question about what something is ("what does --color-accent do") gets the lookup. Several changes in one question come first as one sequence (`sequence: true`: run every command in order, at most 12), with repeated and overwritten steps left out; two asks that contradict each other are offered as choices. Changes come before lookups. Every suggested command names the theme (`theme`: the one named with `theme`, the only one, or the one an editor command changed last, said in `themeNote`; `themeChosenBy` says which: named, only, last-changed or none; with none, my-theme, made first), holds a real value, never a placeholder or a comment, and is checked as `set` checks it: a command `set` would refuse, or that changes nothing, is left out and listed in `refused` with the reason. A question with no answer says why in `hint`, with the next commands in `run`; the command\'s help (`astryx experimental theme editor how --help`) lists the kinds of ask it understands, with examples. A PNG picture (by any file name; other formats are refused by their bytes): its main colors from every pixel (on an even grid past 4 million), biggest share first, with where each sits, see-through pixels skipped, tRNS included (a number after the file sets how many, default 14), or with --at the exact color and alpha at pixel points; a picture over 40 million pixels (20 million at 16 bits), or with pixel data that is damaged or shorter than its header says, is refused before it is decoded. --list <what> lists what a change can name (dials, tokens, parts, groups or properties, in any case, singular or plural; kinds or no word lists those kinds), and the other words filter the list. Experimental: it may change or be removed in a patch release.',
16
+ 'One command for every question. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size), each condition written as the --when and --state flags `set` takes or marked not settable with the reason, its variants, every state `set` accepts, the parts inside it (a token set --on the part reaches them), and its group; a part the part data does not have says so, with commands that still apply. A group (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it (and, when none does, whether Core\'s stylesheet still uses it), or a CSS property and the parts that set it. An aspect (text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. `colors` (or `palette`): how the theme\'s colors are made: one seed per color, light and dark shades generated with the same generator as `theme palette generate`, the shade each token starts from, vibrancy, the Colors preview page and the exact-token escape hatch. A lookup takes any case, a plural, and a token name without its dashes. A question in plain words ("bold white text in the header", "remove shadows from cards", "cards: 8px radius; buttons: 4px"): it reads each clause for the parts (and their variant, size, state or mode), what to change, the values typed (hex, rgb(), lengths, dashed), and whether it asks for more, less or none ("shouldn\'t", "turn off", "never", "too sharp", "everything except X" included), and answers with exact commands; a typed value always wins over a color word, and a hex color with the wrong number of digits is refused by name, never replaced with a sample. "In dark mode" carries --mode dark to every color command; a change that cannot differ by mode, or a dark-mode ask on a light-only theme, says so instead. A question about what something is ("what does --color-accent do") gets the lookup. Several changes in one question come first as one sequence (`sequence: true`: run every command in order, at most 12), with repeated and overwritten steps left out; two asks that contradict each other are offered as choices. Changes come before lookups. A result with `offer: true` is more than the ask (a colored variant changed too): it follows every other result and is never the answer itself, so running the first result\'s commands never runs one; where what the ask writes is in place already, the first result says so with no command. Every suggested command names the theme (`theme`: the one named with `theme`, the only one, or the one an editor command changed last, said in `themeNote`; `themeChosenBy` says which: named, only, last-changed or none; with none, my-theme, made first), holds a real value, never a placeholder or a comment, and is checked as `set` checks it: a command `set` would refuse, or that changes nothing, is left out and listed in `refused` with the reason. A question with no answer says why in `hint`, with the next commands in `run`; the command\'s help (`astryx experimental theme editor how --help`) lists the kinds of ask it understands, with examples. A PNG picture (by any file name; other formats are refused by their bytes): its main colors from every pixel (on an even grid past 4 million), biggest share first, with where each sits, see-through pixels skipped, tRNS included (a number after the file sets how many, default 14), and the look\'s traits measured from its pixels (`look`; never recognized or named: boxes sorted only by shape into button-like, inputs, checks and containers): control height (set on the button and input families, each from its own boxes), the checks\' box (width and height at one size, per size, so a box stays square and a radio round), corners, edge width, how panels sit, the accent fill, line spacing read from a wrapped paragraph, and a heading weight only when it reads clearly regular, each a result with a checked command saying where it was read and from how many boxes, written only where enough boxes agree and, for controls, where more than one kind shows (a crop of badges alone writes none and says why); what too few show, and what no group setting makes yet (gradients, bevels, shadows on controls), or a picture cannot tell exactly (text size, a heading weight heavier than regular, line spacing with no wrapped paragraph, the typeface), is listed in `unsure` with the settings that would make it where one exists, never written; a trait the theme sets itself, for the whole theme or on the same part, a dial for the same aspect included (spacing, text-size, headings, type), keeps its value (`unsure` names the reading); a 144-dpi picture is read at 2x; a picture over 8 million pixels, or too grainy to hold boxes, keeps its colors and names its look as not measured. Or with --at the exact color and alpha at pixel points; a picture over 40 million pixels (20 million at 16 bits), or with pixel data that is damaged or shorter than its header says, is refused before it is decoded. --list <what> lists what a change can name (dials, tokens, parts, groups or properties, in any case, singular or plural; kinds or no word lists those kinds), and the other words filter the list. Experimental: it may change or be removed in a patch release.',
17
17
  importPath: '@astryxdesign/cli/api/experimental',
18
18
  signature:
19
19
  'themeEditHow(subject?: string, options?: object): Promise<object>',
@@ -69,7 +69,7 @@ export const doc = {
69
69
  {
70
70
  type: 'themeEdit.how',
71
71
  description:
72
- '`kind` says which answer it is: part (variants, states, reads per aspect with the flags for each condition, parts inside, group), group (members), setting, aspect or question (answers with checked commands for `theme`), picture (main colors, or the color and alpha at points), or list (the items).',
72
+ '`kind` says which answer it is: part (variants, states, reads per aspect with the flags for each condition, parts inside, group), group (members), setting, aspect or question (answers with checked commands for `theme`), picture (main colors and measured traits with checked commands, or the color and alpha at points), or list (the items).',
73
73
  },
74
74
  ],
75
75
  throws: [
@@ -96,6 +96,10 @@ export const doc = {
96
96
  code: 'ERR_THEME_INVALID',
97
97
  when: 'the theme does not build',
98
98
  },
99
+ {
100
+ code: 'ERR_DEP_MISSING',
101
+ when: "a package the build loads is broken in node_modules (it needs a package it declares, and that package is missing); the suggestion is the app's install command, or, when the run uses a CLI copy of its own (global, one-off or cached) and the app's install does not hold the package that needs it, the message names that copy (a release-cache copy: the folder to remove); nothing was changed",
102
+ },
99
103
  ],
100
104
  examples: [
101
105
  {
@@ -13,7 +13,7 @@ export const doc = {
13
13
  summary:
14
14
  'Change one thing in a theme: checked against what the components read, built, previewed.',
15
15
  description:
16
- "Changes one thing. The thing is a dial (corners, spacing, accent, neutral, success, warning, danger, info, vibrancy, font, headings, surfaces, buttons, type, text-size, base, mode: big moves with named rungs; `more`/`less` step a rung), a design token by name (--color-background-body; `how --list tokens`), or a CSS property on a part (background --on card; needs --on). Every change is CHECKED first against the installed Core: the part, the --when variant and value, the --state, the token's type (color, size, number, font, shadow; only colors may differ by mode; a shadow is one value for both), and whether the part, or a part inside it, actually reads the token for what you mean. A change that cannot take effect is REFUSED: exit 1, an error code, nothing written, and the suggestions lead with the command that works (the token the part really reads, or the property that sets it directly). Groups: --on <group> (inputs, checks, containers, menus) styles every member; styling one member of an always-alike group (inputs, checks) styles the whole group unless --only. A setting on a part beats a whole-theme dial, and a dial never overwrites one. After building, a plain part setting that a more specific base-theme rule would beat (such as a heading level) is repeated on those variant keys, and the result says so. The result lists resolved token changes, part styles written, contrast problems this theme caused versus its base (text below 4.5:1), notes (the shade a color's main token uses, any shade moved so text reads, and the generated color files; font loading: the exact install line when the font package is missing), and writes themes/<theme>/preview.html; when sheet.html (made by `show`) now shows the theme as it was, it says so at its top and the result's sheetStale says so. Values with spaces go in quotes: gradients, several shadows, font stacks. Dials: corners square|small|medium|large|round|pill|more|less|<size>; spacing tight|compact|medium|roomy|spacious|more|less; accent, neutral, success, warning, danger, info <color> (a color: the editor generates its light and dark shades from the one color, with the same generator as `theme palette generate`, and points the color tokens at them; a token moves to a nearby shade when it must read: text at 4.5:1, the focus ring at 3:1; the whole theme only, no --on or --mode; `how colors` explains it and the Colors preview page shows every shade); vibrancy 0-100|more|less (how saturated the generated colors are; 50 is the default; needs a color); font <preset, open font, family or stack>; headings light|regular|medium|semibold|bold|heavy or tight|tighter|normal|wide; surfaces flat|outlined|raised|glass; buttons solid|outline|soft|caps; type compact|standard|editorial|display; text-size small|medium|large|larger|more|less|<number of pixels, 10 to 32>; base <built-in theme>|none; mode both|light-only|dark-only. `astryx experimental theme editor how --list dials` explains each. An exact token always wins over the generated colors: `set <theme> --color-accent <color>` (with --on or --mode if you need them) is the escape hatch, whatever order the settings were made in. Experimental: it may change or be removed in a patch release.",
16
+ "Changes one thing. The thing is a dial (corners, spacing, accent, neutral, success, warning, danger, info, vibrancy, font, headings, surfaces, buttons, badges, type, text-size, base, mode: big moves with named rungs; `more`/`less` step a rung), a design token by name (--color-background-body; `how --list tokens`), or a CSS property on a part (background --on card; needs --on). Every change is CHECKED first against the installed Core: the part, the --when variant and value, the --state, the token's type (color, size, number, font, shadow; only colors may differ by mode; a shadow is one value for both), and whether the part, or a part inside it, actually reads the token for what you mean. A change that cannot take effect is REFUSED: exit 1, an error code, nothing written, and the suggestions lead with the command that works (the token the part really reads, or the property that sets it directly). A text size on a part whose text is drawn by elements inside it that each read a text size token goes into the token its main text reads, the largest (a top nav heading's title, not its supporting line), on that part; the setting is saved as typed and the result names the token. A text size said of a heading's title piece (`top-nav-heading-title` or `side-nav-heading-title`, also `-heading`) goes on that heading, the same way. A text size token said for a part that reads none, where the parts it holds read one size token (a tab list's tabs), goes into that one on the part; the setting is saved as typed and the result names the token. Groups: --on <group> (inputs, checks, containers, menus) styles every member; styling one member of an always-alike group (inputs, checks) styles the whole group unless --only (a height follows the control-height rule below). A height on a control (a button, an input, a selector, an input group, or a group of them) is every control's height at its size: it is written as that size's token (--size-element-sm, -md or -lg; the size --when names, md without one) on controls, and it replaces the other control heights at that size; with --only it stays on its one control; a height written as a size token must be a length (auto is refused there; a height for another variant or a state stays a plain height); a height on a part that is not a control (a text area, which sizes itself by its rows, or a complex selector) stays on that part. A control whose content is taller (a typeahead, a tokenizer) keeps its content's height, and a complex selector keeps its own. A control that grows with its content (a selector, a typeahead, a tokenizer) keeps Core's top and bottom padding, so a padding reaches it at its sides only and never makes it taller than the other controls. A file input's field does too; its drop zone (mode dropzone) pads itself, so a top or bottom padding set for the drop zone reaches it. A height or vertical padding on a bar (the app's header) reaches the one row of items drawn once across it (the top nav; never a menu's or side nav's items, a divider, a trigger or an avatar): the row fills the bar and gives up its own vertical padding, so its items sit in the middle; a value set on the row stays, and a part in the row taller than the bar is a problem with its fixing line. A row that sits in more than one bar takes the reach in every bar that holds it, and none when those bars leave it different heights (different heights, or the same height padded differently, as the app's header pads a safe area). A setting on a part beats a whole-theme dial, and a dial never overwrites one. After building, a plain part setting that a more specific base-theme rule would beat (such as a heading level) is repeated on those variant keys, and the result says so. The result lists resolved token changes, part styles written, contrast problems this theme caused versus its base (text below 4.5:1), notes (the shade a color's main token uses, any shade moved so text reads, and the generated color files; font loading: the exact install line when the font package is missing), and writes themes/<theme>/preview.html; when sheet.html (made by `show`) now shows the theme as it was, it says so at its top and the result's sheetStale says so. Values with spaces go in quotes: gradients, several shadows, font stacks. Dials: corners square|small|medium|large|round|pill|more|less|<size>; spacing tight|compact|medium|roomy|spacious|more|less; accent, neutral, success, warning, danger, info <color> (a color: the editor generates its light and dark shades from the one color, with the same generator as `theme palette generate`, and points the color tokens at them; a token moves to a nearby shade when it must read: text at 4.5:1, the focus ring at 3:1; the whole theme only, no --on or --mode; `how colors` explains it and the Colors preview page shows every shade); vibrancy 0-100|more|less (how saturated the generated colors are; 50 is the default; needs a color); font <preset, open font, family or stack>; headings light|regular|medium|semibold|bold|heavy or tight|tighter|normal|wide; surfaces flat|outlined|raised|glass; buttons solid|outline|soft|caps; badges solid|soft|outline; type compact|standard|editorial|display; text-size small|medium|large|larger|more|less|<number of pixels, 10 to 32>; base <built-in theme>|none; mode both|light-only|dark-only. `astryx experimental theme editor how --list dials` explains each. An exact token always wins over the generated colors: `set <theme> --color-accent <color>` (with --on or --mode if you need them) is the escape hatch, whatever order the settings were made in. Experimental: it may change or be removed in a patch release.",
17
17
  importPath: '@astryxdesign/cli/api/experimental',
18
18
  signature:
19
19
  'themeEditSet(theme: string, thing: string, value: string, options?: object): Promise<object>',
@@ -105,7 +105,7 @@ export const doc = {
105
105
  },
106
106
  {
107
107
  code: 'ERR_THEME_UNKNOWN_STATE',
108
- when: '--state is not a state of the part',
108
+ when: '--state is not a state of the part (a word for exactly one of its states is read as that state)',
109
109
  },
110
110
  {
111
111
  code: 'ERR_THEME_UNKNOWN_TOKEN',
@@ -155,6 +155,10 @@ export const doc = {
155
155
  code: 'ERR_THEME_INVALID',
156
156
  when: 'the theme does not build (the change is undone)',
157
157
  },
158
+ {
159
+ code: 'ERR_DEP_MISSING',
160
+ when: "a package the build loads is broken in node_modules (it needs a package it declares, and that package is missing); the suggestion is the app's install command, or, when the run uses a CLI copy of its own (global, one-off or cached) and the app's install does not hold the package that needs it, the message names that copy (a release-cache copy: the folder to remove); nothing was changed",
161
+ },
158
162
  {
159
163
  code: 'ERR_RENDER_FAILED',
160
164
  when: "the components or the preview do not render with the project's React",
@@ -11,9 +11,9 @@ export const doc = {
11
11
  stability: 'experimental',
12
12
  displayName: 'themeEditShow()',
13
13
  summary:
14
- 'Every setting, key values, problems the theme caused, and the theme-building page with every component.',
14
+ "Every setting, key values, problems the theme caused, and the theme-building page with every component; with options.on, one part's resolved values for any theme.",
15
15
  description:
16
- 'Lists every setting with where it applies and its source (dial, token or property), the resolved value of key tokens in each mode, the colors (the vibrancy; each color with its seed and the shade each token uses in light and dark, marked when an exact token setting wins; any shade moved so text reads), contrast problems this theme caused versus its base, font notes, and last the generated color files. Writes two self-contained HTML files: preview.html (the sample app page) and sheet.html (the theme-building page: every component grouped, each variant side by side, overlays open, and real template pages, with an auto/light/dark switch). A theme with no build is built first, and an in-app preview (`preview add`) of the theme has its route and Colors page rewritten. --section limits the sheet to one section. An own change to <theme>.theme.ts since the last build is built first, and the colors mark where it wins over a generated shade; a theme source that no longer builds, or a token in it that is not text, is refused (ERR_THEME_INVALID, exit 1) and the folder stays as it was. Experimental: it may change or be removed in a patch release.',
16
+ "With `on` set to a part, a lookup that writes nothing: what one part of any theme the project builds shows, each property's final value with its tokens and who sets it. An editor theme is read from its saved settings: what its theme file adds by hand below them is not shown yet. Without it, lists every setting with where it applies and its source (dial, token or property), the resolved value of key tokens in each mode, the colors (the vibrancy; each color with its seed and the shade each token uses in light and dark, marked when an exact token setting wins; any shade moved so text reads), contrast problems this theme caused versus its base, font notes, and last the generated color files. Writes two self-contained HTML files: preview.html (the sample app page) and sheet.html (the theme-building page: every component grouped, each variant side by side, overlays open, and real template pages, with an auto/light/dark switch). A theme with no build is built first, and an in-app preview (`preview add`) of the theme has its route and Colors page rewritten. --section limits the sheet to one section. An own change to <theme>.theme.ts since the last build is built first, and the colors mark where it wins over a generated shade; a theme source that no longer builds, or a token in it that is not text, is refused (ERR_THEME_INVALID, exit 1) and the folder stays as it was. Experimental: it may change or be removed in a patch release.",
17
17
  importPath: '@astryxdesign/cli/api/experimental',
18
18
  signature: 'themeEditShow(theme: string, options?: object): Promise<object>',
19
19
  keywords: [
@@ -40,6 +40,12 @@ export const doc = {
40
40
  type: 'boolean',
41
41
  description: 'Also take PNG pictures.',
42
42
  },
43
+ {
44
+ name: 'options.on',
45
+ type: 'string',
46
+ description:
47
+ 'Only what one part shows, as a lookup that writes nothing; the theme may be any theme the project builds.',
48
+ },
43
49
  {
44
50
  name: 'options.cwd',
45
51
  type: 'string',
@@ -53,11 +59,20 @@ export const doc = {
53
59
  description:
54
60
  'Every setting and the parts it styles, key resolved values per mode, contrast problems, notes, both pages, template pages left out, and any pictures.',
55
61
  },
62
+ {
63
+ type: 'themeEdit.showPart',
64
+ description:
65
+ 'With options.on: each CSS property the part reads, at rest and in each variant, with its final value (per mode when the modes differ), the declaration that gives it, the tokens it reads, and who decides it.',
66
+ },
56
67
  ],
57
68
  throws: [
58
69
  {
59
70
  code: 'ERR_INVALID_ARGUMENT',
60
- when: 'an unknown section',
71
+ when: 'an unknown section; with options.on, a name that is no part or is a group, or options.png or options.section beside it',
72
+ },
73
+ {
74
+ code: 'ERR_AMBIGUOUS_THEME',
75
+ when: 'with options.on, a theme slug two packages provide that the app records none of (the suggestions add one to the app)',
61
76
  },
62
77
  {
63
78
  code: 'ERR_UNKNOWN_THEME',
@@ -75,6 +90,10 @@ export const doc = {
75
90
  code: 'ERR_THEME_INVALID',
76
91
  when: 'the theme does not build, its own <theme>.theme.ts does not parse, or a token in it is not text; the folder stays as it was',
77
92
  },
93
+ {
94
+ code: 'ERR_DEP_MISSING',
95
+ when: "a package the build loads is broken in node_modules (it needs a package it declares, and that package is missing); the suggestion is the app's install command, or, when the run uses a CLI copy of its own (global, one-off or cached) and the app's install does not hold the package that needs it, the message names that copy (a release-cache copy: the folder to remove); nothing was changed",
96
+ },
78
97
  {
79
98
  code: 'ERR_FILE_EXISTS',
80
99
  when: 'a folder sits where the build writes a file (such as themes/<theme>/<theme>.d.ts); the suggestion lists it',
@@ -113,6 +113,10 @@ export const doc = {
113
113
  code: 'ERR_THEME_INVALID',
114
114
  when: 'the theme does not build (the change is undone)',
115
115
  },
116
+ {
117
+ code: 'ERR_DEP_MISSING',
118
+ when: "a package the build loads is broken in node_modules (it needs a package it declares, and that package is missing); the suggestion is the app's install command, or, when the run uses a CLI copy of its own (global, one-off or cached) and the app's install does not hold the package that needs it, the message names that copy (a release-cache copy: the folder to remove); nothing was changed",
119
+ },
116
120
  {
117
121
  code: 'ERR_RENDER_FAILED',
118
122
  when: "the components or the preview do not render with the project's React",