@astryxdesign/cli 0.7.17-canary.g4ea41ce → 0.7.17-canary.g5a3fd39

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 (409) hide show
  1. package/README.md +7 -2
  2. package/api/build/_adapter.d.mts +7 -6
  3. package/api/build/_adapter.mjs +18 -11
  4. package/api/build/build.type.mjs +1 -1
  5. package/api/build/kit/kind.d.mts +6 -0
  6. package/api/build/kit/kind.mjs +1 -1
  7. package/api/build/kit/rank.d.mts +7 -1
  8. package/api/build/kit/rank.mjs +15 -5
  9. package/api/build/kit/signals.mjs +58 -57
  10. package/api/build/kit/start.d.mts +2 -1
  11. package/api/build/kit/start.mjs +62 -9
  12. package/api/build/kit/words.d.mts +6 -2
  13. package/api/build/kit/words.mjs +7 -3
  14. package/api/component/__fixtures__/resolutions/modules.txt +2 -2
  15. package/api/component/_adapter.d.mts +30 -24
  16. package/api/component/_adapter.mjs +72 -31
  17. package/api/component/component.mjs +4 -4
  18. package/api/component/detail/detail.d.mts +2 -2
  19. package/api/component/detail/detail.mjs +1 -1
  20. package/api/component/list/list.d.mts +2 -2
  21. package/api/component/list/list.mjs +4 -4
  22. package/api/discover/_adapter.mjs +15 -15
  23. package/api/docs/_adapter.d.mts +13 -5
  24. package/api/docs/_adapter.mjs +37 -10
  25. package/api/doctor/_adapter.d.mts +32 -0
  26. package/api/doctor/_adapter.mjs +56 -1
  27. package/api/doctor/doctor.mjs +28 -5
  28. package/api/doctor/theme-checks.mjs +165 -83
  29. package/api/error.d.mts +4 -3
  30. package/api/error.mjs +3 -2
  31. package/api/hook/_adapter.d.mts +5 -4
  32. package/api/hook/_adapter.mjs +6 -5
  33. package/api/icon/_options.d.mts +17 -0
  34. package/api/icon/_options.mjs +54 -0
  35. package/api/icon/exportIconIndex.doc.d.mts +10 -0
  36. package/api/icon/exportIconIndex.doc.mjs +59 -0
  37. package/api/icon/icon.mjs +11 -34
  38. package/api/icon/icon.type.d.mts +49 -0
  39. package/api/icon/icon.type.mjs +24 -0
  40. package/api/icon/rankIconIndex.doc.d.mts +10 -0
  41. package/api/icon/rankIconIndex.doc.mjs +79 -0
  42. package/api/icon/search/icon-index.d.mts +41 -0
  43. package/api/icon/search/icon-index.mjs +139 -0
  44. package/api/icon/search/search.d.mts +18 -0
  45. package/api/icon/search/search.mjs +13 -0
  46. package/api/index.d.mts +1 -0
  47. package/api/index.mjs +1 -0
  48. package/api/search/_adapter.d.mts +8 -5
  49. package/api/search/_adapter.mjs +14 -10
  50. package/api/search/_gather-components.d.mts +4 -4
  51. package/api/search/_gather-components.mjs +4 -3
  52. package/api/search/_gather-hooks.d.mts +2 -2
  53. package/api/search/_gather-hooks.mjs +1 -1
  54. package/api/search/_lexical.mjs +12 -2
  55. package/api/search/_priority.d.mts +10 -2
  56. package/api/search/_priority.mjs +37 -7
  57. package/api/search/_score.d.mts +12 -3
  58. package/api/search/_score.mjs +6 -3
  59. package/api/search/_words.mjs +12 -3
  60. package/api/search/search.d.mts +7 -1
  61. package/api/search/search.mjs +37 -4
  62. package/api/swizzle/_adapter.d.mts +7 -5
  63. package/api/swizzle/_adapter.mjs +7 -3
  64. package/api/swizzle/copy/copy.mjs +5 -4
  65. package/api/theme/build/build.d.mts +5 -0
  66. package/api/theme/build/build.mjs +400 -21
  67. package/api/theme/build/family.mjs +18 -7
  68. package/api/theme/build/font-warning.mjs +5 -4
  69. package/api/theme/build/input-fields.d.mts +21 -6
  70. package/api/theme/build/input-fields.mjs +104 -13
  71. package/api/theme/build/typography-values.d.mts +22 -0
  72. package/api/theme/build/typography-values.mjs +172 -22
  73. package/api/theme/build/written-values.d.mts +7 -0
  74. package/api/theme/build/written-values.mjs +57 -8
  75. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  76. package/api/theme/palette/generate/generator.d.mts +14 -2
  77. package/api/theme/palette/generate/generator.mjs +94 -8
  78. package/api/theme/theme.type.d.mts +21 -4
  79. package/api/theme/theme.type.mjs +14 -5
  80. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  81. package/api/theme/themeTemplate.doc.mjs +18 -3
  82. package/api/theme-edit/_adapter.d.mts +1 -1
  83. package/api/theme-edit/_adapter.mjs +1 -1
  84. package/api/theme-edit/_catalog.d.mts +10 -4
  85. package/api/theme-edit/_catalog.mjs +81 -22
  86. package/api/theme-edit/_check.mjs +402 -88
  87. package/api/theme-edit/_color.d.mts +11 -2
  88. package/api/theme-edit/_color.mjs +23 -7
  89. package/api/theme-edit/_compiler.mjs +11 -3
  90. package/api/theme-edit/_context.d.mts +87 -6
  91. package/api/theme-edit/_context.mjs +224 -17
  92. package/api/theme-edit/_css.mjs +4 -0
  93. package/api/theme-edit/_edit.mjs +331 -58
  94. package/api/theme-edit/_how-question.d.mts +11 -0
  95. package/api/theme-edit/_how-question.mjs +2514 -234
  96. package/api/theme-edit/_how.mjs +79 -14
  97. package/api/theme-edit/_missed.mjs +294 -32
  98. package/api/theme-edit/_normal.d.mts +3 -1
  99. package/api/theme-edit/_normal.mjs +4 -1
  100. package/api/theme-edit/_palette.mjs +36 -5
  101. package/api/theme-edit/_part-words.mjs +20 -2
  102. package/api/theme-edit/_parts.d.mts +12 -1
  103. package/api/theme-edit/_parts.mjs +116 -11
  104. package/api/theme-edit/_preview-app.mjs +40 -2
  105. package/api/theme-edit/_preview.d.mts +45 -5
  106. package/api/theme-edit/_preview.mjs +173 -21
  107. package/api/theme-edit/_settings.d.mts +20 -0
  108. package/api/theme-edit/_settings.mjs +1033 -94
  109. package/api/theme-edit/_tables.mjs +2 -2
  110. package/api/theme-edit/theme-edit.type.d.mts +6 -5
  111. package/api/theme-edit/theme-edit.type.mjs +8 -8
  112. package/api/upgrade/_adapter.mjs +13 -2
  113. package/assets/component-list.generated.json +1 -1
  114. package/assets/docs/tree/authoring.doc.mjs +1 -0
  115. package/assets/docs/tree/cli.doc.mjs +1 -0
  116. package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
  117. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  118. package/assets/docs/tree/global.doc.mjs +1 -0
  119. package/assets/docs/tree/single-component.doc.mjs +40 -2
  120. package/assets/docs/tree/updates.doc.mjs +1 -1
  121. package/assets/docs/tree/who-answers.doc.mjs +2 -2
  122. package/assets/docs-routes.generated.json +1 -1
  123. package/assets/docs.generated.json +2 -2
  124. package/assets/search-catalog.generated.json +2 -2
  125. package/assets/self-audit.generated.json +1 -1
  126. package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
  127. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
  128. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
  129. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
  130. package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
  131. package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
  132. package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
  133. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
  134. package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
  135. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
  136. package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
  137. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
  138. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
  139. package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
  140. package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
  141. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
  142. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
  143. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
  144. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
  145. package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
  146. package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
  147. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
  148. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
  149. package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
  150. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
  151. package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
  152. package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
  153. package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
  154. package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
  155. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
  156. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
  157. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
  158. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
  159. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
  160. package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
  161. package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
  162. package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
  163. package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
  164. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
  165. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
  166. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
  167. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
  168. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
  169. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
  170. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
  171. package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
  172. package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
  173. package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
  174. package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
  175. package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
  176. package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
  177. package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
  178. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
  179. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
  180. package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
  181. package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
  182. package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
  183. package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
  184. package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
  185. package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
  186. package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
  187. package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
  188. package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
  189. package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
  190. package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
  191. package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
  192. package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
  193. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
  194. package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
  195. package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
  196. package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
  197. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
  198. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
  199. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
  200. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
  201. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
  202. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
  203. package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
  204. package/assets/templates/components.generated.json +1 -1
  205. package/assets/templates/pages/ai-chat/page.tsx +102 -6
  206. package/assets/templates/pages/canvas-editor/page.tsx +73 -2
  207. package/assets/templates/pages/centered-hero/page.tsx +10 -4
  208. package/assets/templates/pages/course-detail/page.tsx +46 -2
  209. package/assets/templates/pages/dashboard/page.tsx +45 -16
  210. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +31 -20
  211. package/assets/templates/pages/dashboard-comparison/page.tsx +9 -0
  212. package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
  213. package/assets/templates/pages/dashboard-progress/page.tsx +27 -15
  214. package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
  215. package/assets/templates/pages/detail-page/page.tsx +105 -77
  216. package/assets/templates/pages/documentation/page.tsx +15 -2
  217. package/assets/templates/pages/documentation-design/page.tsx +7 -34
  218. package/assets/templates/pages/documentation-technical/page.tsx +76 -12
  219. package/assets/templates/pages/editor/page.tsx +26 -21
  220. package/assets/templates/pages/file-explorer/page.tsx +35 -1
  221. package/assets/templates/pages/form-two-column/page.tsx +2 -3
  222. package/assets/templates/pages/form-wizard/page.tsx +31 -3
  223. package/assets/templates/pages/form-wizard-vertical/page.tsx +32 -3
  224. package/assets/templates/pages/gallery-hero/page.tsx +2 -1
  225. package/assets/templates/pages/ide/page.tsx +15 -1
  226. package/assets/templates/pages/incident-console/page.tsx +2 -1
  227. package/assets/templates/pages/incident-console/template.doc.mjs +1 -1
  228. package/assets/templates/pages/kanban-board/page.tsx +39 -2
  229. package/assets/templates/pages/payment-form/page.tsx +77 -39
  230. package/assets/templates/pages/product-gallery/page.tsx +16 -14
  231. package/assets/templates/pages/settings/page.tsx +35 -3
  232. package/assets/templates/pages/settings-dialog/page.tsx +34 -5
  233. package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
  234. package/assets/templates/pages/shell-nav/page.tsx +28 -12
  235. package/assets/templates/pages/shell-side-nav/page.tsx +16 -1
  236. package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
  237. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  238. package/assets/templates/pages/table/page.tsx +2 -1
  239. package/assets/templates/pages/table/template.doc.mjs +1 -1
  240. package/assets/templates/pages/table-collapsible/page.tsx +1 -1
  241. package/assets/templates/pages/table-comparison/page.tsx +1 -1
  242. package/assets/templates/pages/table-filter/page.tsx +9 -2
  243. package/assets/templates/pages/table-grouped/page.tsx +16 -6
  244. package/assets/templates/pages/table-inbox/page.tsx +60 -1
  245. package/assets/templates/pages/table-page/page.tsx +10 -2
  246. package/assets/templates/pages/table-tree/page.tsx +95 -13
  247. package/assets/templates/pages/theme-showcase/page.tsx +107 -11
  248. package/assets/templates/pages/work-item-detail/page.tsx +88 -74
  249. package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
  250. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  251. package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
  252. package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
  253. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  254. package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
  255. package/authoring/debug/parse.d.mts +1 -1
  256. package/authoring/doctypes/_schema.d.mts +22 -8
  257. package/authoring/doctypes/_schema.mjs +31 -0
  258. package/authoring/doctypes/command/command.doc.mjs +24 -0
  259. package/authoring/doctypes/command/type.ts +31 -0
  260. package/authoring/doctypes/component/component.doc.mjs +1 -1
  261. package/authoring/doctypes/component/type.ts +8 -5
  262. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
  263. package/authoring/doctypes/namespace/type.ts +4 -0
  264. package/authoring/doctypes/template/type.ts +0 -7
  265. package/authoring/index.d.ts +6 -1
  266. package/authoring/integration/integration.doc.mjs +7 -0
  267. package/authoring/integration/schema.d.mts +6 -0
  268. package/authoring/integration/schema.mjs +3 -0
  269. package/authoring/integration/type.ts +34 -0
  270. package/clients/cli/build-id.generated.json +1 -1
  271. package/clients/cli/commands/component.doc.mjs +1 -0
  272. package/clients/cli/commands/component.mjs +5 -1
  273. package/clients/cli/commands/docs.doc.mjs +1 -1
  274. package/clients/cli/commands/experimental/index.mjs +4 -1
  275. package/clients/cli/commands/experimental/theme.mjs +139 -64
  276. package/clients/cli/commands/experimental-render.doc.mjs +2 -0
  277. package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
  278. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -0
  279. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
  280. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
  281. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -2
  282. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -1
  283. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +3 -2
  284. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
  285. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
  286. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -0
  287. package/clients/cli/commands/experimental-theme-remove.doc.mjs +2 -0
  288. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
  289. package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
  290. package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
  291. package/clients/cli/commands/gap-report.doc.mjs +1 -0
  292. package/clients/cli/commands/hook.doc.mjs +1 -1
  293. package/clients/cli/commands/init.doc.mjs +1 -1
  294. package/clients/cli/commands/integration-add.doc.mjs +1 -0
  295. package/clients/cli/commands/manifest.mjs +10 -3
  296. package/clients/cli/commands/swizzle.doc.mjs +8 -1
  297. package/clients/cli/commands/swizzle.mjs +13 -6
  298. package/clients/cli/commands/template.doc.mjs +3 -0
  299. package/clients/cli/commands/theme-add.doc.mjs +2 -1
  300. package/clients/cli/commands/theme-build.doc.mjs +2 -1
  301. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  302. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
  303. package/clients/cli/commands/theme-remove.doc.mjs +2 -1
  304. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  305. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  306. package/clients/cli/commands/theme-use.doc.mjs +2 -1
  307. package/clients/cli/commands/theme.doc.mjs +7 -2
  308. package/clients/cli/commands/theme.mjs +21 -5
  309. package/clients/cli/index.mjs +167 -59
  310. package/clients/cli/lib/base-gate.mjs +522 -0
  311. package/clients/cli/lib/command-path.mjs +26 -0
  312. package/clients/cli/lib/define-command.mjs +161 -12
  313. package/clients/cli/lib/json-shim.mjs +34 -31
  314. package/clients/cli/lib/manifest.d.ts +14 -0
  315. package/clients/cli/lib/manifest.mjs +78 -22
  316. package/clients/cli/lib/root-args.mjs +79 -0
  317. package/clients/cli/lib/stray-option.mjs +21 -8
  318. package/clients/cli/lib/unknown-command.mjs +27 -6
  319. package/clients/cli/manifest.generated.json +1 -1
  320. package/clients/cli/run.mjs +13 -1
  321. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  322. package/foundation/bases/core-docs.d.mts +10 -0
  323. package/foundation/bases/core-docs.mjs +42 -0
  324. package/foundation/bases/core.d.mts +11 -0
  325. package/foundation/bases/core.mjs +32 -0
  326. package/foundation/bases/requirements.d.mts +128 -0
  327. package/foundation/bases/requirements.mjs +193 -0
  328. package/foundation/bases/resolve.d.mts +134 -0
  329. package/foundation/bases/resolve.mjs +295 -0
  330. package/foundation/bases/state.d.mts +24 -0
  331. package/foundation/bases/state.mjs +46 -0
  332. package/foundation/bases/steps.d.mts +49 -0
  333. package/foundation/bases/steps.mjs +88 -0
  334. package/foundation/config/project.d.mts +14 -0
  335. package/foundation/config/project.mjs +68 -1
  336. package/foundation/discovery/cli-self-docs.mjs +9 -1
  337. package/foundation/discovery/command-pointers.d.mts +28 -0
  338. package/foundation/discovery/command-pointers.mjs +31 -0
  339. package/foundation/discovery/component-discovery.d.mts +9 -8
  340. package/foundation/discovery/component-discovery.mjs +9 -4
  341. package/foundation/discovery/docs-discovery.d.mts +13 -5
  342. package/foundation/discovery/docs-discovery.mjs +25 -6
  343. package/foundation/discovery/hook-discovery.d.mts +6 -6
  344. package/foundation/discovery/hook-discovery.mjs +6 -4
  345. package/foundation/discovery/template-adapter.mjs +5 -0
  346. package/foundation/discovery/template-ids.d.mts +1 -1
  347. package/foundation/discovery/template-ids.mjs +5 -1
  348. package/foundation/discovery/theme-discovery.mjs +3 -0
  349. package/foundation/discovery/theme-imports.mjs +19 -1
  350. package/foundation/doc-compiler/tree.d.mts +4 -2
  351. package/foundation/doc-compiler/tree.mjs +46 -1
  352. package/foundation/env/package-manager.d.mts +7 -0
  353. package/foundation/env/package-manager.mjs +21 -0
  354. package/foundation/fonts/font-stylesheet.d.mts +8 -0
  355. package/foundation/fonts/font-stylesheet.mjs +26 -2
  356. package/foundation/fs/gather-cache.mjs +44 -13
  357. package/foundation/fs/own-modules.d.mts +29 -0
  358. package/foundation/fs/own-modules.mjs +57 -0
  359. package/foundation/fs/paths.d.mts +30 -2
  360. package/foundation/fs/paths.mjs +49 -2
  361. package/foundation/integrations/integrations.d.mts +4 -0
  362. package/foundation/integrations/integrations.mjs +6 -1
  363. package/foundation/release/choose.d.mts +7 -0
  364. package/foundation/release/choose.mjs +16 -2
  365. package/foundation/release/notices.d.mts +26 -0
  366. package/foundation/release/notices.mjs +48 -19
  367. package/foundation/release/project.d.mts +3 -2
  368. package/foundation/release/project.mjs +4 -5
  369. package/foundation/release/run-context.d.mts +7 -2
  370. package/foundation/release/run-context.mjs +6 -2
  371. package/foundation/render/css-cut.mjs +86 -6
  372. package/foundation/render/cut-short.d.mts +35 -0
  373. package/foundation/render/cut-short.mjs +124 -0
  374. package/foundation/render/font-probe.d.mts +27 -0
  375. package/foundation/render/font-probe.mjs +77 -0
  376. package/foundation/render/layers.d.mts +1 -9
  377. package/foundation/render/layers.mjs +2 -111
  378. package/foundation/render/page-worker.mjs +83 -6
  379. package/foundation/render/picture-chrome.mjs +24 -2
  380. package/foundation/render/picture-playwright.mjs +22 -2
  381. package/foundation/render/picture-window.d.mts +20 -4
  382. package/foundation/render/picture-window.mjs +137 -4
  383. package/foundation/response/base.d.ts +25 -0
  384. package/foundation/response/error-codes.d.mts +4 -1
  385. package/foundation/response/error-codes.d.ts +4 -1
  386. package/foundation/response/error-codes.doc.mjs +17 -0
  387. package/foundation/response/error-codes.mjs +21 -0
  388. package/foundation/response/json.d.mts +3 -1
  389. package/foundation/response/json.mjs +7 -2
  390. package/foundation/response/response-types.doc.mjs +2 -2
  391. package/foundation/suggest/name-index.d.mts +2 -1
  392. package/foundation/suggest/name-index.mjs +1 -1
  393. package/foundation/suggest/other-command.d.mts +4 -1
  394. package/foundation/suggest/other-command.mjs +23 -6
  395. package/foundation/text/string-utils.d.mts +7 -2
  396. package/foundation/text/string-utils.mjs +24 -10
  397. package/package.json +6 -6
  398. package/assets/templates/pages/access-denied/page.tsx +0 -101
  399. package/assets/templates/pages/access-denied/template.doc.mjs +0 -24
  400. package/assets/templates/pages/error-page/page.tsx +0 -130
  401. package/assets/templates/pages/error-page/template.doc.mjs +0 -22
  402. package/assets/templates/pages/not-found/page.tsx +0 -124
  403. package/assets/templates/pages/not-found/template.doc.mjs +0 -30
  404. package/assets/templates/pages/review-workspace/page.tsx +0 -551
  405. package/assets/templates/pages/review-workspace/template.doc.mjs +0 -31
  406. package/assets/templates/pages/run-console/page.tsx +0 -945
  407. package/assets/templates/pages/run-console/template.doc.mjs +0 -27
  408. package/assets/templates/pages/welcome-portal/page.tsx +0 -538
  409. package/assets/templates/pages/welcome-portal/template.doc.mjs +0 -38
@@ -145,6 +145,7 @@ import {
145
145
  dialSettingsInText,
146
146
  skips,
147
147
  OPEN_SECTION,
148
+ FOLLOWS,
148
149
  } from './_settings.mjs';
149
150
  import {
150
151
  checkSetting,
@@ -164,7 +165,10 @@ import {MODAL, isColorToken} from './_compiler.mjs';
164
165
  import {fontShorthandFamilyList} from '../theme/build/font-warning.mjs';
165
166
  import {
166
167
  isHeadingLevel,
168
+ levelDuplicates,
169
+ missingScaleFieldWhy,
167
170
  noLevelWhy,
171
+ typographyBlockWhy,
168
172
  noScaleWeightWhy,
169
173
  roleWeightTokens,
170
174
  typographyValueProblem,
@@ -175,6 +179,7 @@ import {
175
179
  } from '../../foundation/config/theme-private-vars.mjs';
176
180
  import {innerBlock, partKeyProblem} from '../theme/build/style-keys.mjs';
177
181
  import {
182
+ CUSTOM_PROPERTY,
178
183
  customPropertyCycle,
179
184
  cycleProblem,
180
185
  } from '../theme/build/written-values.mjs';
@@ -206,6 +211,7 @@ import {
206
211
  appCopyStale,
207
212
  copyFontsCss,
208
213
  writeAppCopy,
214
+ touchedFamilies,
209
215
  } from './_preview.mjs';
210
216
  import {appWiring, refreshPreviewRoute, seeLine} from './_preview-app.mjs';
211
217
  /** The preview command, as a person runs it. */
@@ -226,6 +232,9 @@ import {
226
232
  requireProject,
227
233
  context,
228
234
  pictures,
235
+ SAMPLE_PAGE_NAME,
236
+ cutShortNote,
237
+ cutShortProblem,
229
238
  openStatesPage,
230
239
  fontNotes,
231
240
  themeImageNotes,
@@ -234,6 +243,9 @@ import {
234
243
  checkSection,
235
244
  stampSheet,
236
245
  lookAtPictures,
246
+ familyPages,
247
+ FAMILY_SECTIONS,
248
+ FAMILY_OVERVIEW,
237
249
  } from './_context.mjs';
238
250
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
239
251
  import {readThemeState} from '../../foundation/config/theme-state.mjs';
@@ -1228,7 +1240,14 @@ async function newTheme(
1228
1240
  }
1229
1241
  refuseIfLockLost();
1230
1242
  fs.rmSync(marker, {force: true});
1231
- const p = await previewAndRoute(ctx, name, data, png, 'overview', 'new');
1243
+ const {cutShort, ...p} = await previewAndRoute(
1244
+ ctx,
1245
+ name,
1246
+ data,
1247
+ png,
1248
+ 'overview',
1249
+ 'new',
1250
+ );
1232
1251
  /** @type {string[]} */
1233
1252
  const notes = [
1234
1253
  ...keptNotes,
@@ -1236,6 +1255,7 @@ async function newTheme(
1236
1255
  ...(data.settings.some(s => s.thing === 'font')
1237
1256
  ? fontNotes(ctx, data)
1238
1257
  : []),
1258
+ ...cutShort.map(cutShortNote),
1239
1259
  ];
1240
1260
  return {
1241
1261
  type: 'themeEdit.new',
@@ -3230,7 +3250,9 @@ async function ownTokenProblems(ctx, slug, data) {
3230
3250
  // A var() of a custom property the theme's own page sets reads the
3231
3251
  // text it gives: the property must take that text there.
3232
3252
  if (typeof value === 'string')
3233
- for (const m of value.matchAll(/var\(\s*(--[a-z0-9-]+)\s*\)/gi)) {
3253
+ for (const m of value.matchAll(
3254
+ new RegExp(String.raw`var\(\s*(${CUSTOM_PROPERTY})\s*\)`, 'gi'),
3255
+ )) {
3234
3256
  const text = ownText.get(m[1]);
3235
3257
  if (
3236
3258
  text === undefined ||
@@ -3287,7 +3309,9 @@ async function ownTokenProblems(ctx, slug, data) {
3287
3309
  /** @param {unknown} node @param {number} depth */
3288
3310
  const collectReads = (node, depth) => {
3289
3311
  if (typeof node === 'string')
3290
- for (const m of node.matchAll(/var\(\s*(--[A-Za-z0-9_-]+)/g))
3312
+ for (const m of node.matchAll(
3313
+ new RegExp(String.raw`var\(\s*(${CUSTOM_PROPERTY})`, 'g'),
3314
+ ))
3291
3315
  readVars.add(m[1]);
3292
3316
  else if (node && typeof node === 'object' && depth < 24)
3293
3317
  for (const v of Object.values(node)) collectReads(v, depth + 1);
@@ -3641,7 +3665,10 @@ async function ownTokenProblems(ctx, slug, data) {
3641
3665
  // A part variable that defaults to a design token takes what
3642
3666
  // that token takes.
3643
3667
  const reads = own
3644
- ? /^var\(\s*(--[a-z0-9-]+)\s*\)$/i.exec(own.default)?.[1]
3668
+ ? new RegExp(
3669
+ String.raw`^var\(\s*(${CUSTOM_PROPERTY})\s*\)$`,
3670
+ 'i',
3671
+ ).exec(own.default)?.[1]
3645
3672
  : undefined;
3646
3673
  if (reads && reads in known) {
3647
3674
  const loc = where(at.join('.'), k);
@@ -3870,7 +3897,41 @@ async function ownTokenProblems(ctx, slug, data) {
3870
3897
  }
3871
3898
  }
3872
3899
  };
3900
+ if (
3901
+ input.typography != null &&
3902
+ (typeof input.typography !== 'object' || Array.isArray(input.typography))
3903
+ ) {
3904
+ const e = typo[0];
3905
+ out.push({
3906
+ token: 'typography',
3907
+ value: typeof input.typography === 'string' ? input.typography : '',
3908
+ why: typographyBlockWhy(input.typography),
3909
+ ...(e ? atOf(e) : {line: null, file: null}),
3910
+ });
3911
+ }
3873
3912
  fields(input.typography, []);
3913
+ // Two keys for one heading level ('01' and 1): Core keeps one.
3914
+ if (input.typography && typeof input.typography === 'object')
3915
+ for (const [role, r] of Object.entries(input.typography)) {
3916
+ const weights = r && typeof r === 'object' ? r.weights : undefined;
3917
+ if (!weights || typeof weights !== 'object' || Array.isArray(weights))
3918
+ continue;
3919
+ for (const d of levelDuplicates(
3920
+ role,
3921
+ weights,
3922
+ typeFields?.levels ?? [],
3923
+ )) {
3924
+ const key = `${role}.weights.${d.key}`;
3925
+ const e = typo.find(x => x.key === key) ?? typo[0];
3926
+ flagged.add(role);
3927
+ out.push({
3928
+ token: `typography.${key}`,
3929
+ value: typeof weights[d.key] === 'string' ? weights[d.key] : '',
3930
+ why: d.why,
3931
+ ...(e ? atOf(e) : {line: null, file: null}),
3932
+ });
3933
+ }
3934
+ }
3874
3935
  // Core builds a role's font list from its family, with the fallbacks
3875
3936
  // after it: fallbacks with no family in that role build nothing.
3876
3937
  if (input.typography && typeof input.typography === 'object')
@@ -3951,10 +4012,7 @@ async function ownTokenProblems(ctx, slug, data) {
3951
4012
  }
3952
4013
  }
3953
4014
  const scale = input.typography?.scale;
3954
- for (const [field, add] of /** @type {const} */ ([
3955
- ['base', 'the body size in pixels, such as scale: {base: 16, ratio: …}'],
3956
- ['ratio', 'the step between sizes, such as scale: {base: …, ratio: 1.2}'],
3957
- ]))
4015
+ for (const field of /** @type {const} */ (['base', 'ratio']))
3958
4016
  if (
3959
4017
  scale &&
3960
4018
  typeof scale === 'object' &&
@@ -3969,7 +4027,7 @@ async function ownTokenProblems(ctx, slug, data) {
3969
4027
  out.push({
3970
4028
  token: 'typography.scale',
3971
4029
  value: '',
3972
- why: `the type scale is given no ${field}, and Core reads the sizes from the base and the ratio together: add ${add}`,
4030
+ why: missingScaleFieldWhy(field),
3973
4031
  ...(e ? atOf(e) : {line: null, file: null}),
3974
4032
  });
3975
4033
  }
@@ -5558,10 +5616,32 @@ async function changeOnce(
5558
5616
  (x.when ?? null) === (meant.when ?? null) &&
5559
5617
  stateKeyOf(x.state) === stateKeyOf(meant.state) &&
5560
5618
  (x.mode ?? null) === (meant.mode ?? null);
5561
- const ordered = [
5562
- ...matches.filter(sameScope),
5563
- ...matches.filter(x => !sameScope(x)),
5564
- ];
5619
+ /**
5620
+ * How near a saved setting is to the scope typed, read as `m`: its
5621
+ * whole scope (the most), else how many of the flags typed it
5622
+ * shares (`--on card` with a card setting in a state leads ahead
5623
+ * of a whole-theme one).
5624
+ * @param {any} x
5625
+ * @param {Record<string, string | undefined>} m
5626
+ */
5627
+ const nearness = (x, m) => {
5628
+ const same = (/** @type {string} */ k) =>
5629
+ k === 'state'
5630
+ ? stateKeyOf(x.state) === stateKeyOf(m.state)
5631
+ : (x[k] ?? null) === (m[k] ?? null);
5632
+ const keys = /** @type {const} */ (['on', 'when', 'state', 'mode']);
5633
+ if (keys.every(same)) return 10;
5634
+ return keys.filter(
5635
+ k => /** @type {any} */ (flags)[k] != null && same(k),
5636
+ ).length;
5637
+ };
5638
+ /** Stable, nearest first. @param {any[]} list @param {(x: any) => number} by */
5639
+ const nearestFirst = (list, by) =>
5640
+ list
5641
+ .map((x, i) => ({x, i, n: by(x)}))
5642
+ .sort((a, b) => b.n - a.n || a.i - b.i)
5643
+ .map(e => e.x);
5644
+ const ordered = nearestFirst(matches, x => nearness(x, meant));
5565
5645
  const scoped = flags.on || flags.when || flags.state || flags.mode;
5566
5646
  // A word that is a value the theme holds (`undo t red`) names the
5567
5647
  // setting that holds it: its undo, never a step back that takes back
@@ -5591,19 +5671,9 @@ async function changeOnce(
5591
5671
  : data.settings.filter(x => valueIs(x.value, typed));
5592
5672
  // The one in the scope typed (read as set reads it for that
5593
5673
  // setting) leads.
5594
- const inScope = (/** @type {any} */ x) => {
5595
- const m = scopeAsRead(x.thing, String(x.value));
5596
- return (
5597
- (x.on ?? null) === (m.on ?? null) &&
5598
- (x.when ?? null) === (m.when ?? null) &&
5599
- stateKeyOf(x.state) === stateKeyOf(m.state) &&
5600
- (x.mode ?? null) === (m.mode ?? null)
5601
- );
5602
- };
5603
- const byValue = [
5604
- ...holding.filter(inScope),
5605
- ...holding.filter(x => !inScope(x)),
5606
- ];
5674
+ const byValue = nearestFirst(holding, x =>
5675
+ nearness(x, scopeAsRead(x.thing, String(x.value))),
5676
+ );
5607
5677
  if (byValue.length)
5608
5678
  throw new AstryxError(
5609
5679
  `"${thing}" is no setting; ${slug} holds it as the value of ${byValue.map(x => describe(x)).join(', ')}. Nothing was changed.`,
@@ -5654,6 +5724,35 @@ async function changeOnce(
5654
5724
  }
5655
5725
  s = stored;
5656
5726
  }
5727
+ // A color set with no --mode in a one-mode theme is that mode's color, as
5728
+ // the build reads it (it fills that mode's half): saved with the mode, so
5729
+ // the theme going back to both modes keeps it there, and a color saved
5730
+ // for the other mode (the half a toast or a lightbox reads) stays. An
5731
+ // undo with no --mode names that entry too.
5732
+ const ownMode =
5733
+ data.mode === 'dark-only'
5734
+ ? 'dark'
5735
+ : data.mode === 'light-only'
5736
+ ? 'light'
5737
+ : null;
5738
+ if (
5739
+ ownMode &&
5740
+ sub === 'set' &&
5741
+ !s.mode &&
5742
+ s.source !== 'dial' &&
5743
+ typeof s.value === 'string' &&
5744
+ parseColor(s.value.trim()) != null &&
5745
+ (s.source === 'property' || MODAL.has(ctx.C.typeOf(s.thing)))
5746
+ )
5747
+ s = {...s, mode: ownMode};
5748
+ if (
5749
+ ownMode &&
5750
+ sub === 'undo' &&
5751
+ !s.mode &&
5752
+ !data.settings.some(x => keyOf(x) === keyOf(s)) &&
5753
+ data.settings.some(x => keyOf(x) === keyOf({...s, mode: ownMode}))
5754
+ )
5755
+ s = {...s, mode: ownMode};
5657
5756
  let k = keyOf(s);
5658
5757
  let prevIdx =
5659
5758
  rawIdx >= 0
@@ -5839,7 +5938,14 @@ async function changeOnce(
5839
5938
  } else
5840
5939
  data.mode = /** @type {'both' | 'light-only' | 'dark-only'} */ (s.value);
5841
5940
  const r = await commitTheme(ctx, slug, data, {history: true});
5842
- const p = await previewAndRoute(ctx, slug, data, png, 'overview', sub);
5941
+ const {cutShort, ...p} = await previewAndRoute(
5942
+ ctx,
5943
+ slug,
5944
+ data,
5945
+ png,
5946
+ 'overview',
5947
+ sub,
5948
+ );
5843
5949
  const after = await baseResolved(ctx.project, data.like).catch(() => base);
5844
5950
  return {
5845
5951
  type: 'themeEdit.set',
@@ -5919,9 +6025,13 @@ async function changeOnce(
5919
6025
  modesOf(data),
5920
6026
  ).slice(0, -1),
5921
6027
  ),
6028
+ ...cutShort.map(cutShortNote),
5922
6029
  ],
5923
6030
  problems: r.problems,
5924
- newProblems: problemLines(r.newProblems),
6031
+ newProblems: [
6032
+ ...problemLines(r.newProblems),
6033
+ ...cutShort.map(c => cutShortProblem(ctx, slug, c)),
6034
+ ],
5925
6035
  warnings: r.warnings,
5926
6036
  ...p,
5927
6037
  },
@@ -6356,6 +6466,33 @@ async function changeOnce(
6356
6466
  break;
6357
6467
  }
6358
6468
  }
6469
+ // A radius the own source sets on a part wins over a radius setting
6470
+ // there, which the editor writes as the part's radius token (a button's
6471
+ // --radius-element): the own border-radius does not read it.
6472
+ if (
6473
+ sub === 'set' &&
6474
+ s.source === 'property' &&
6475
+ s.on &&
6476
+ /^border(-[a-z]+)*-radius$/.test(s.thing)
6477
+ )
6478
+ for (const target of partsOf(ctx, s)) {
6479
+ const state = s.state ? `:${s.state}` : null;
6480
+ for (const [prop, value] of ownPartTokens(
6481
+ cwd,
6482
+ slug,
6483
+ target,
6484
+ s.when ?? 'base',
6485
+ state,
6486
+ ))
6487
+ if (
6488
+ /^border(-[a-z]+)*-radius$/.test(prop) &&
6489
+ !String(value ?? '').includes('var(--radius-') &&
6490
+ !ownPartHits.some(h => h.target === target && h.prop === prop)
6491
+ ) {
6492
+ ownPartHits.push({target, key: s.when ?? 'base', state, prop, value});
6493
+ break;
6494
+ }
6495
+ }
6359
6496
  // A direct setting on exactly the rule the own source sets: its undo
6360
6497
  // takes it back (anything else the file wins over either way).
6361
6498
  const ownHitDirect =
@@ -6494,6 +6631,29 @@ async function changeOnce(
6494
6631
  !ctx.unchecked
6495
6632
  ? [
6496
6633
  `this changes nothing you see: the theme already shows ${describe(s)} (it is saved, and stays when the base theme changes)`,
6634
+ // A mode's own setting under one the theme sets for every mode:
6635
+ // that one still draws the other modes, which this does not
6636
+ // change.
6637
+ ...(() => {
6638
+ if (!s.mode) return [];
6639
+ const whole = data.settings.find(
6640
+ x =>
6641
+ x !== s &&
6642
+ !x.mode &&
6643
+ x.source === s.source &&
6644
+ x.thing === s.thing &&
6645
+ (x.on ?? null) === (s.on ?? null) &&
6646
+ (x.when ?? null) === (s.when ?? null) &&
6647
+ (x.state ?? null) === (s.state ?? null),
6648
+ );
6649
+ if (!whole) return [];
6650
+ const others = modesOf(data).filter(m => m !== s.mode);
6651
+ return others.length
6652
+ ? [
6653
+ `your setting for every mode (${describe(whole)}) still draws ${others.join(' and ')}; to keep it for ${s.mode} only, take that one back (this one stays): ${P} undo ${slug} ${undoArgs(whole)}`,
6654
+ ]
6655
+ : [];
6656
+ })(),
6497
6657
  ]
6498
6658
  : []),
6499
6659
  // A card's content takes one radius from Core, whatever its corners.
@@ -6721,18 +6881,60 @@ async function changeOnce(
6721
6881
  ]
6722
6882
  : []),
6723
6883
  );
6884
+ // A token another one follows (the surface's fills, the emphasized
6885
+ // border) says what moved with it.
6886
+ if (sub === 'set' && s.source === 'token' && !s.on && !s.when && !s.state) {
6887
+ const followers = Object.keys(FOLLOWS).filter(
6888
+ k =>
6889
+ FOLLOWS[k] === s.thing &&
6890
+ r.changed.some(
6891
+ (/** @type {unknown} */ c) => String(c).split(/[\s:]/)[0] === k,
6892
+ ),
6893
+ );
6894
+ // The parts the base theme draws from a follower besides its own
6895
+ // token (neutral's progress and switch tracks, from the emphasized
6896
+ // border) move with it too.
6897
+ /** @param {string} token */
6898
+ const drawnFrom = token =>
6899
+ Object.entries(
6900
+ /** @type {{components?: Record<string, Record<string, unknown>>}} */ (
6901
+ base
6902
+ ).components ?? {},
6903
+ )
6904
+ .filter(([, keys]) =>
6905
+ Object.values(keys).some(
6906
+ b =>
6907
+ b &&
6908
+ typeof b === 'object' &&
6909
+ Object.values(b).some(
6910
+ v => typeof v === 'string' && v.includes(`var(${token})`),
6911
+ ),
6912
+ ),
6913
+ )
6914
+ .map(([t]) => t);
6915
+ if (followers.length) {
6916
+ const also = [...new Set(followers.flatMap(drawnFrom))];
6917
+ notes.push(
6918
+ `${followers.join(', ')} ${followers.length === 1 ? 'follows' : 'follow'} it (${s.thing === '--color-border' ? 'the frames of inputs and selectors, never fainter than the border' : "the fills made from the surface, at the base theme's step from it"})${also.length ? `, and so do the parts the base theme draws from ${followers.length === 1 ? 'it' : 'them'}: ${also.join(', ')}` : ''}; an exact setting of ${followers.length === 1 ? 'it' : 'one'} keeps its own color`,
6919
+ );
6920
+ }
6921
+ }
6724
6922
  if (s.thing === 'neutral' && sub === 'set') {
6725
6923
  // Only the theme's own modes; a dark theme gets no white-page offer.
6726
6924
  const modes = modesOf(data);
6727
- const pages = modes
6728
- .map(m => [m, base[m]['--color-background-body']])
6729
- .filter(([, v]) => v)
6730
- .map(([m, v]) => `${v} in ${m}`);
6925
+ const pinned = data.settings.some(
6926
+ x =>
6927
+ x.source === 'token' &&
6928
+ x.thing === '--color-background-body' &&
6929
+ !x.on &&
6930
+ !x.when &&
6931
+ !x.state,
6932
+ );
6731
6933
  notes.push(
6732
- `the page background stays the base theme's${pages.length ? ` (${pages.join(', ')})` : ''}${
6934
+ `${pinned ? 'the page background keeps the color you set for it' : "the page background follows it too, at the official theme's page shade of this gray"}${
6733
6935
  modes.includes('light')
6734
6936
  ? `; for a white or off-white page: ${P} set ${slug} --color-background-body ${quoteCommandArgument('#ffffff')}${modes.length > 1 ? ' --mode light' : ''}`
6735
- : `; for another page color: ${P} set ${slug} --color-background-body ${quoteCommandArgument('#f8fafc')}`
6937
+ : `; for another page color: ${P} set ${slug} --color-background-body ${quoteCommandArgument('#111111')}`
6736
6938
  }`,
6737
6939
  );
6738
6940
  }
@@ -6775,7 +6977,7 @@ async function changeOnce(
6775
6977
  // package installed or removed since).
6776
6978
  if (r.unchanged && appCopyBehind(cwd, slug, copyFontsCss(ctx, slug, data)))
6777
6979
  writeAppCopy(ctx, slug, data);
6778
- const p =
6980
+ const {cutShort, ...p} =
6779
6981
  r.unchanged &&
6780
6982
  !png &&
6781
6983
  fs.existsSync(f0.preview) &&
@@ -6784,6 +6986,8 @@ async function changeOnce(
6784
6986
  preview: shown(cwd, f0.preview),
6785
6987
  pictures: [],
6786
6988
  pictureProblem: null,
6989
+ // No pictures: nothing measured.
6990
+ cutShort: [],
6787
6991
  notChecked: null,
6788
6992
  previewStale: [],
6789
6993
  see: seeLine(cwd, slug, changeFocus(s)),
@@ -6819,7 +7023,9 @@ async function changeOnce(
6819
7023
  sub === 'set' && prev && prev.source === 'dial' && !prev.on
6820
7024
  ? prev.value
6821
7025
  : null,
6822
- notes,
7026
+ // What else to know, then the text the sample page's pictures draw
7027
+ // cut short.
7028
+ notes: [...notes, ...cutShort.map(cutShortNote)],
6823
7029
  // What the whole-theme change leaves out, with the lines that reach
6824
7030
  // it; the text output prints it right under the status line.
6825
7031
  leftOut: leftOutParts(ctx, slug, data, sub, s),
@@ -6842,6 +7048,9 @@ async function changeOnce(
6842
7048
  newProblems: [
6843
7049
  ...problemLines(r.newProblems),
6844
7050
  ...colorFails.map(problem => ({problem, fix: null})),
7051
+ // Text the sample page's pictures draw cut short, with the line
7052
+ // the browser measured as keeping it whole.
7053
+ ...cutShort.map(c => cutShortProblem(ctx, slug, c)),
6845
7054
  ],
6846
7055
  // How many misses the theme's own changes left (show lists each with
6847
7056
  // the line that reaches it), and on how many parts (a part can miss
@@ -7003,9 +7212,7 @@ export async function themeEditShow(theme, options = {}) {
7003
7212
  }
7004
7213
  const ctx = await context(cwd);
7005
7214
  // show --png takes its sheet too, after any build it makes.
7006
- ctx.takesPictures = png
7007
- ? {sheet: section ? `sheet-${section}` : 'sheet'}
7008
- : null;
7215
+ ctx.takesPictures = png ? {sheet: section ? `sheet-${section}` : null} : null;
7009
7216
  // The app copy is written once show succeeds (at its end), never by a
7010
7217
  // build a later refusal puts back.
7011
7218
  holdAfterBuild(ctx);
@@ -7177,7 +7384,20 @@ export async function themeEditShow(theme, options = {}) {
7177
7384
  await baseResolved(ctx.project, data.like),
7178
7385
  ctx.project.core.tokenDefaults,
7179
7386
  );
7180
- const {colorProblems, ...colorPart} = colorsReport(pal, data, res, theme);
7387
+ /** @type {Record<string, string>} */
7388
+ let ownTokens = {};
7389
+ try {
7390
+ ownTokens = ownSourceTokenValues(cwd, theme);
7391
+ } catch {
7392
+ // A source that cannot be read sets nothing here.
7393
+ }
7394
+ const {colorProblems, ...colorPart} = colorsReport(
7395
+ pal,
7396
+ data,
7397
+ res,
7398
+ theme,
7399
+ ownTokens,
7400
+ );
7181
7401
  // A render that fails here (two copies of React, a component that
7182
7402
  // throws) is refused as the one above: what this show built goes back,
7183
7403
  // and the result says so.
@@ -7211,14 +7431,15 @@ export async function themeEditShow(theme, options = {}) {
7211
7431
  const sheetFile = section
7212
7432
  ? path.join(f.dir, `sheet-${section}.html`)
7213
7433
  : f.sheet;
7214
- /** @type {Array<{html: string, png: string, kind: 'link' | 'file' | 'other', page: string}>} */
7434
+ /** @type {Array<{html: string, png: string | null, kind: 'link' | 'file' | 'other', page: string}>} */
7215
7435
  const leftPages = noPages
7216
7436
  ? []
7217
7437
  : [
7218
7438
  {html: f.preview, png: f.previewPng, page: 'the sample page'},
7219
7439
  {
7220
7440
  html: sheetFile,
7221
- png: section ? path.join(f.dir, `sheet-${section}.png`) : f.sheetPng,
7441
+ // The full sheet is not photographed.
7442
+ png: section ? path.join(f.dir, `sheet-${section}.png`) : null,
7222
7443
  page: section ? `the ${section} sheet` : 'the sheet',
7223
7444
  },
7224
7445
  ].flatMap(x => {
@@ -7246,9 +7467,26 @@ export async function themeEditShow(theme, options = {}) {
7246
7467
  // The full sheet records the build it shows, so a later change tells a
7247
7468
  // sheet that still matches (after an undo) from one that does not.
7248
7469
  if (!noPages && !left(sheetFile)) stampSheet(sheetFile, theme, cwd);
7470
+ // The full sheet is too tall to read whole: --png also takes each family
7471
+ // of components on a page of its own, cut from it.
7472
+ // Each takes a browser run, so --png pictures the families the theme sets
7473
+ // a part of (the buttons when it sets none); --section <family> takes any
7474
+ // other, and sheet.html holds every component.
7475
+ const touched = touchedFamilies(ctx.project, data).filter(f =>
7476
+ FAMILY_SECTIONS.includes(f),
7477
+ );
7478
+ const families =
7479
+ png && !noPages && !section && !left(sheetFile)
7480
+ ? familyPages(
7481
+ sheetFile,
7482
+ theme,
7483
+ cwd,
7484
+ touched.length ? touched : [FAMILY_OVERVIEW],
7485
+ )
7486
+ : {pages: [], problems: []};
7249
7487
  const leftWords = leftPages.map(
7250
7488
  x =>
7251
- `${inTheWayPhrase(shown(cwd, x.html), x.kind, x.page)}, so ${x.page} was not made${png ? ` and ${shown(cwd, x.png)} was not taken` : ''}; move ${x.kind === 'link' ? 'the link' : 'it'}, then run ${P} show ${theme}${section ? ` --section ${section}` : ''}${png ? ' --png' : ''}`,
7489
+ `${inTheWayPhrase(shown(cwd, x.html), x.kind, x.page)}, so ${x.page} was not made${png && x.png ? ` and ${shown(cwd, x.png)} was not taken` : ''}; move ${x.kind === 'link' ? 'the link' : 'it'}, then run ${P} show ${theme}${section ? ` --section ${section}` : ''}${png ? ' --png' : ''}`,
7252
7490
  );
7253
7491
  const modes = modesOf(data);
7254
7492
  // The open states (every overlay drawn open) beside the sample page: the
@@ -7274,27 +7512,33 @@ export async function themeEditShow(theme, options = {}) {
7274
7512
  }
7275
7513
  })
7276
7514
  : null;
7277
- /** @type {{files: string[], problem: string | null}} */
7515
+ /** @type {{files: string[], problem: string | null, cutShort: import('./_context.mjs').CutShort[]}} */
7278
7516
  const shots =
7279
7517
  png && !noPages
7280
7518
  ? await pictures(
7281
7519
  ctx.project,
7282
7520
  [
7283
- {html: f.preview, png: f.previewPng},
7521
+ {html: f.preview, png: f.previewPng, name: SAMPLE_PAGE_NAME},
7284
7522
  ...(open && !('problem' in open) ? [open] : []),
7285
- // A section is photographed from its own sheet.
7286
- section
7287
- ? {
7288
- html: path.join(f.dir, `sheet-${section}.html`),
7289
- png: path.join(f.dir, `sheet-${section}.png`),
7290
- }
7291
- : {html: f.sheet, png: f.sheetPng},
7523
+ ...families.pages.map(({html, png: out}) => ({html, png: out})),
7524
+ // A section is photographed from its own sheet. The full sheet,
7525
+ // every component, is too tall to read whole and slow to take:
7526
+ // it is not photographed.
7527
+ ...(section
7528
+ ? [
7529
+ {
7530
+ html: path.join(f.dir, `sheet-${section}.html`),
7531
+ png: path.join(f.dir, `sheet-${section}.png`),
7532
+ },
7533
+ ]
7534
+ : []),
7292
7535
  ].filter(x => !left(x.html)),
7293
7536
  modes,
7294
7537
  )
7295
7538
  : // Pictures asked for but not taken: said, never a quiet none.
7296
7539
  {
7297
7540
  files: [],
7541
+ cutShort: [],
7298
7542
  problem: png
7299
7543
  ? readOnly
7300
7544
  ? 'no picture was taken: show ran read-only (the project or its install cannot be written, so it could not hold the theme lock), and the pages the pictures are taken of were not made; run show --png where the project can be written'
@@ -7307,6 +7551,10 @@ export async function themeEditShow(theme, options = {}) {
7307
7551
  shots.problem = [open.problem, shots.problem].filter(Boolean).join('; ');
7308
7552
  if (png && leftWords.length)
7309
7553
  shots.problem = [...leftWords, shots.problem].filter(Boolean).join('; ');
7554
+ if (families.problems.length)
7555
+ shots.problem = [...families.problems, shots.problem]
7556
+ .filter(Boolean)
7557
+ .join('; ');
7310
7558
  const look = lookAtPictures(shots.files);
7311
7559
  // The app copy follows the build there now, also when the build was
7312
7560
  // current and only the copy is missing (a theme made before it existed).
@@ -7358,6 +7606,8 @@ export async function themeEditShow(theme, options = {}) {
7358
7606
  ...rebuiltNotes,
7359
7607
  ...(png ? [] : leftWords),
7360
7608
  ...sheet.notes,
7609
+ // Text the sample page's pictures draw cut short.
7610
+ ...shots.cutShort.map(cutShortNote),
7361
7611
  ...misplacedNotes(theme, data),
7362
7612
  ...(noReact
7363
7613
  ? [
@@ -7440,6 +7690,9 @@ export async function themeEditShow(theme, options = {}) {
7440
7690
  openProblems: [
7441
7691
  ...problemLines(shownChecks),
7442
7692
  ...colorProblems.map(problem => ({problem, fix: null})),
7693
+ // Text the sample page's pictures draw cut short, with the line
7694
+ // the browser measured as keeping it whole.
7695
+ ...shots.cutShort.map(c => cutShortProblem(ctx, theme, c)),
7443
7696
  ],
7444
7697
  preview,
7445
7698
  previewStale,
@@ -8188,10 +8441,11 @@ function partValues(ctx, data, res, mode) {
8188
8441
  * built theme's resolved values: where one differs from the generated
8189
8442
  * shade with no exact setting, the theme's own source changed it
8190
8443
  * @param {string} [slug]
8444
+ * @param {Record<string, string>} [own] the tokens the theme's own source sets
8191
8445
  * @returns {{vibrancy: number | null, colors: import('./theme-edit.type.mjs').ThemeEditColor[], colorNotes: string[], colorProblems: string[]}}
8192
8446
  * `colorProblems`: the color notes of pairings that fail their contrast
8193
8447
  */
8194
- function colorsReport(pal, data, built, slug = '') {
8448
+ function colorsReport(pal, data, built, slug = '', own = {}) {
8195
8449
  if (!pal)
8196
8450
  return {vibrancy: null, colors: [], colorNotes: [], colorProblems: []};
8197
8451
  /** What the user set for each token exactly, in each mode. */
@@ -8205,6 +8459,9 @@ function colorsReport(pal, data, built, slug = '') {
8205
8459
  /** Tokens the theme's own source sets to another value than generated. */
8206
8460
  const ownBy =
8207
8461
  /** @type {Record<string, {light?: string, dark?: string}>} */ ({});
8462
+ /** Tokens that follow another the theme sets exactly ({@link FOLLOWS}). */
8463
+ const followBy =
8464
+ /** @type {Record<string, {light?: string, dark?: string}>} */ ({});
8208
8465
  for (const [k, v] of Object.entries(pal.tokens))
8209
8466
  for (const m of /** @type {const} */ (['light', 'dark'])) {
8210
8467
  const now = built?.[m]?.[k];
@@ -8213,7 +8470,9 @@ function colorsReport(pal, data, built, slug = '') {
8213
8470
  !exactBy[k]?.[m] &&
8214
8471
  now.trim().toLowerCase() !== String(v[m].color).trim().toLowerCase()
8215
8472
  )
8216
- (ownBy[k] ??= {})[m] = now;
8473
+ (FOLLOWS[k] && exactBy[FOLLOWS[k]]?.[m] != null && !(k in own)
8474
+ ? (followBy[k] ??= {})
8475
+ : (ownBy[k] ??= {}))[m] = now;
8217
8476
  }
8218
8477
  /** @param {import('./_palette.mjs').StopRef} r */
8219
8478
  const shade = r =>
@@ -8252,14 +8511,16 @@ function colorsReport(pal, data, built, slug = '') {
8252
8511
  k,
8253
8512
  // Each mode says what it shows: the exact setting where one is
8254
8513
  // made for it, else the generated shade.
8255
- exactBy[k] || ownBy[k]
8514
+ exactBy[k] || ownBy[k] || followBy[k]
8256
8515
  ? modes
8257
8516
  .map(m =>
8258
8517
  exactBy[k]?.[m] != null
8259
8518
  ? `${m} ${exactBy[k][m]} (your exact setting wins over the generated ${shade(v[m])})`
8260
8519
  : ownBy[k]?.[m] != null
8261
8520
  ? `${m} ${ownBy[k][m]} (your change in ${slug}.theme.ts wins over the generated ${shade(v[m])})`
8262
- : `${m} ${shade(v[m])}`,
8521
+ : followBy[k]?.[m] != null
8522
+ ? `${m} ${followBy[k][m]} (follows your ${FOLLOWS[k]}, over the generated ${shade(v[m])})`
8523
+ : `${m} ${shade(v[m])}`,
8263
8524
  )
8264
8525
  .join(', ')
8265
8526
  : shades(v),
@@ -8953,7 +9214,14 @@ async function undoTheme(theme, options) {
8953
9214
  : touched.includes('components')
8954
9215
  ? 'components'
8955
9216
  : 'overview';
8956
- const p = await previewAndRoute(ctx, theme, prev, png, focus, 'undo');
9217
+ const {cutShort, ...p} = await previewAndRoute(
9218
+ ctx,
9219
+ theme,
9220
+ prev,
9221
+ png,
9222
+ focus,
9223
+ 'undo',
9224
+ );
8957
9225
  // What the step took back, for the headline: each setting, base and mode
8958
9226
  // it changed, in one line.
8959
9227
  const took = current ? stepTakesBack(current, prev) : [];
@@ -9000,7 +9268,12 @@ async function undoTheme(theme, options) {
9000
9268
  // What the step back changed, as a change reports it.
9001
9269
  changedTokens: committed.changed,
9002
9270
  problems: committed.problems,
9003
- newProblems: problemLines(committed.newProblems),
9271
+ newProblems: [
9272
+ ...problemLines(committed.newProblems),
9273
+ ...cutShort.map(c => cutShortProblem(ctx, theme, c)),
9274
+ ],
9275
+ // Text the sample page's pictures draw cut short.
9276
+ ...(cutShort.length ? {notes: cutShort.map(cutShortNote)} : {}),
9004
9277
  ...p,
9005
9278
  },
9006
9279
  };