@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
@@ -17,6 +17,11 @@
17
17
  */
18
18
  export const OVERRIDES = [
19
19
  [/\b(?:dividers?|separators?)\b/, {on: 'divider'}],
20
+ // (The page's main panel, the area its content sits in.)
21
+ [
22
+ /\b(?:main\s+)?content\s+(?:area|panel|region|pane)s?\b|\bmain\s+(?:area|panel|pane)s?\b/,
23
+ {on: 'layout-content'},
24
+ ],
20
25
  [
21
26
  /\baccordions? (headers?|triggers?|titles?|headings?)\b/,
22
27
  {on: 'collapsible-trigger'},
@@ -28,7 +33,7 @@ export const OVERRIDES = [
28
33
  [/\b((modal |dialog )?(overlay|scrim|backdrop))\b/, {on: 'overlay'}],
29
34
  [/\bicons?\b/, {on: 'icons'}],
30
35
  [
31
- /\b(table header|column headers?|table headings?)\b/,
36
+ /\b(table headers?|column headers?|table headings?)\b/,
32
37
  {on: 'table-header-cell'},
33
38
  ],
34
39
  [
@@ -53,6 +58,9 @@ export const OVERRIDES = [
53
58
  // A context menu is its own part in Core (its items are the dropdown
54
59
  // menu's items, which it reuses).
55
60
  [/\b(context ?menus?|right[- ]click menus?)\b/, {on: 'context-menu'}],
61
+ // (Menus said plainly are every menu, the menus group; a dropdown menu,
62
+ // or one menu, is the dropdown menu.)
63
+ [/\b(?<!dropdown )menus\b/, {on: 'menus'}],
56
64
  [/\b((dropdown )?menus?)\b/, {on: 'dropdown-menu'}],
57
65
  // A part's own header or footer ("dialog header", "card footer") is that
58
66
  // part's, never the app's top bar or footer.
@@ -80,7 +88,12 @@ export const OVERRIDES = [
80
88
  /\b(danger|destructive|delete) (buttons?|ones?|variant)\b/,
81
89
  {on: 'button', when: 'variant:destructive'},
82
90
  ],
83
- [/\b(panels?|windows?|boxes|tiles?|containers?)\b/, {on: 'containers'}],
91
+ // (Never the operating system, "Windows 11 accent …": a window named
92
+ // with a version is a product.)
93
+ [
94
+ /\b(panels?|windows?(?!\s+(?:\d|xp\b|vista\b))|boxes|tiles?|containers?)\b/,
95
+ {on: 'containers'},
96
+ ],
84
97
  [/\b(banners?|alerts?|notices?|announcements?)\b/, {on: 'banner'}],
85
98
  // A sheet is Core's bottom sheet (never a style sheet).
86
99
  [/(?<!\bstyle[\s-]?)\b(?:bottom[\s-]?)?sheets?\b/, {on: 'bottom-sheet'}],
@@ -117,6 +130,11 @@ export const OVERRIDES = [
117
130
  ],
118
131
  [/\b((table )?cells?)\b/, {on: 'table-cell'}],
119
132
  [/\b(table rows?|rows?|tables?)\b/, {on: 'table-row'}],
133
+ // (A keyboard key, "the key chips", is Core's Kbd, never a badge.)
134
+ [
135
+ /\b(kbds?|keyboard (keys?|shortcuts?|chips?)|key ?(chips?|caps?)|shortcut keys?)\b/,
136
+ {on: 'kbd'},
137
+ ],
120
138
  [/\b(badges?|chips?|tags?)\b/, {on: 'badge'}],
121
139
  [/\bh([1-6])\b/, {on: 'heading'}],
122
140
  [/\b(headings?|titles?)\b/, {on: 'heading'}],
@@ -189,10 +189,20 @@ export type PartRecord = {
189
189
  * - parts rendered inside it
190
190
  */
191
191
  contains: string[];
192
+ /**
193
+ * - for a part rendered inside it, the variants it is drawn in there (a toast's close button: ghost)
194
+ */
195
+ holdsVariants?: Record<string, string[]> | undefined;
192
196
  /**
193
197
  * - the elements it is rendered as (`tr` for a table row)
194
198
  */
195
199
  tags?: string[] | undefined;
200
+ /**
201
+ * - drawn under an invisible native input
202
+ * laid over it (a checkbox's box), which takes its pointer and focus: the
203
+ * part that holds that input (empty when none is themed)
204
+ */
205
+ underInput?: string | undefined;
196
206
  /**
197
207
  * - the radius tokens of the corners Core draws by place on the parts directly inside it (a button group's end buttons)
198
208
  */
@@ -233,9 +243,10 @@ export type TextPair = {
233
243
  bg: PaintSide;
234
244
  sample: string;
235
245
  over?: PaintSide;
246
+ within?: string[];
236
247
  };
237
248
  export type PartData = {
238
- version: number;
249
+ censusKey: string;
239
250
  coreKey: string;
240
251
  map: Record<string, PartRecord>;
241
252
  pairs: TextPair[];
@@ -17,7 +17,9 @@
17
17
 
18
18
  import * as fs from 'node:fs';
19
19
  import * as path from 'node:path';
20
+ import {createHash} from 'node:crypto';
20
21
  import {createRequire} from 'node:module';
22
+ import {fileURLToPath} from 'node:url';
21
23
  import {AstryxError} from '../error.mjs';
22
24
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
23
25
  import {importPathOf, installLine, literals} from './_project.mjs';
@@ -36,8 +38,36 @@ import {
36
38
  } from './_catalog.mjs';
37
39
  import {removeOnStop} from '../../foundation/fs/stop-cleanup.mjs';
38
40
 
39
- /** Bump when the shape of the cached part data, or which parts it reaches, changes. */
40
- const PART_DATA_VERSION = 24;
41
+ /**
42
+ * What the cached part data is built by: a fingerprint of this file and
43
+ * every file it imports by a relative path, read once. Any change to the
44
+ * code that draws and reads the census builds it again, with no number to
45
+ * bump by hand (the installed Core is the cache folder's own key).
46
+ */
47
+ const CENSUS_KEY = (() => {
48
+ const hash = createHash('sha256');
49
+ /** @type {Set<string>} */
50
+ const seen = new Set();
51
+ /** @param {string} file */
52
+ const walk = file => {
53
+ if (seen.has(file)) return;
54
+ seen.add(file);
55
+ /** @type {string} */
56
+ let src;
57
+ try {
58
+ src = fs.readFileSync(file, 'utf8');
59
+ } catch {
60
+ return;
61
+ }
62
+ hash.update(`${path.basename(file)}\0${src}\0`);
63
+ for (const m of src.matchAll(
64
+ /(?:\bfrom|\bimport\s*\(?)\s*['"](\.{1,2}\/[^'"]+)['"]/g,
65
+ ))
66
+ walk(path.resolve(path.dirname(file), m[1]));
67
+ };
68
+ walk(fileURLToPath(import.meta.url));
69
+ return hash.digest('hex').slice(0, 16);
70
+ })();
41
71
 
42
72
  /**
43
73
  * Flags that change what a component does or whether it shows, not how it
@@ -58,7 +88,11 @@ const LIFECYCLE_FLAGS = new Set([
58
88
  * @property {Record<string, string[]>} inside - tokens read by unnamed elements inside the part -> properties
59
89
  * @property {Record<string, string[]>} attrs - data attributes seen on the part
60
90
  * @property {string[]} contains - parts rendered inside it
91
+ * @property {Record<string, string[]>} [holdsVariants] - for a part rendered inside it, the variants it is drawn in there (a toast's close button: ghost)
61
92
  * @property {string[]} [tags] - the elements it is rendered as (`tr` for a table row)
93
+ * @property {string} [underInput] - drawn under an invisible native input
94
+ * laid over it (a checkbox's box), which takes its pointer and focus: the
95
+ * part that holds that input (empty when none is themed)
62
96
  * @property {string[]} [innerCorners] - the radius tokens of the corners Core draws by place on the parts directly inside it (a button group's end buttons)
63
97
  * @property {Record<string, string[]>} [held] - the tokens the parts inside it draw with there, at rest, and the properties they set with each
64
98
  * @property {string[]} [line] - the properties a line inside it with no target of its own draws (a divider's line), recorded as the part's: a setting on the part's own element does not reach them
@@ -69,12 +103,15 @@ const LIFECYCLE_FLAGS = new Set([
69
103
 
70
104
  /**
71
105
  * @typedef {{target: string | null, tokens: string[], raw: string | null}} PaintSide
72
- * @typedef {{text: string, fg: PaintSide, bg: PaintSide, sample: string, over?: PaintSide}} TextPair
106
+ * @typedef {{text: string, fg: PaintSide, bg: PaintSide, sample: string, over?: PaintSide, within?: string[]}} TextPair
73
107
  * `over`: the region the part sits in (a header), whose background shows
74
108
  * through a see-through background of the part's own, else the page
75
- * @typedef {{version: number, coreKey: string, map: Record<string, PartRecord>, pairs: TextPair[], rendered: number, items: number}} PartData
109
+ * @typedef {{censusKey: string, coreKey: string, map: Record<string, PartRecord>, pairs: TextPair[], rendered: number, items: number}} PartData
76
110
  */
77
111
 
112
+ /** The days a sample date and range of days stand on. */
113
+ const SAMPLE_DAYS = {start: '2026-01-12', end: '2026-01-16'};
114
+
78
115
  /**
79
116
  * A sample value for a required prop the doc declares, from its type: the
80
117
  * component's name for text, false for a flag, the first value of a union,
@@ -100,6 +137,10 @@ function sampleOf(name, type) {
100
137
  const words = literals(t);
101
138
  if (words.length) return words[0];
102
139
  if (/^\d+(\s*\|\s*\d+)*$/.test(t)) return Number(t.split('|')[0]);
140
+ // A date, and a range of days (a calendar's in range): fixed days, so
141
+ // the part data reads the same whatever day it is drawn on.
142
+ if (t === 'ISODateString') return SAMPLE_DAYS.start;
143
+ if (t === 'DateRange') return {...SAMPLE_DAYS};
103
144
  // A value the type lets be null (a file input's chosen file): none
104
145
  // chosen, when nothing plainer stands for it.
105
146
  if (/(^|\|)\s*null\s*(\||$)/.test(type)) return null;
@@ -303,7 +344,17 @@ export function catalogVariants(project, name, cap, opts = {}) {
303
344
  info.props?.[k] &&
304
345
  !/^\s*\d+(\s*\|\s*\d+)*\s*$/.test(info.props[k].type ?? ''),
305
346
  ))
306
- for (const v of values[p] ?? [])
347
+ for (const v of values[p] ?? []) {
348
+ // A value kind the look names (a calendar's `range` mode, whose value
349
+ // is a DateRange): a sample of that kind, so what Core draws for it
350
+ // (the days in the range) is read too.
351
+ const kind = String(info.props?.value?.type ?? '')
352
+ .split('|')
353
+ .map(x => x.trim())
354
+ .find(x =>
355
+ new RegExp(`${v[0]?.toUpperCase() ?? ''}${v.slice(1)}$`).test(x),
356
+ );
357
+ const sample = kind ? sampleOf(name, kind) : undefined;
307
358
  variants.push({
308
359
  label: v,
309
360
  // A status like `{type: 'error', message?: string}` takes the
@@ -311,8 +362,10 @@ export function catalogVariants(project, name, cap, opts = {}) {
311
362
  props: {
312
363
  ...base,
313
364
  [p]: info.props?.[p]?.type.startsWith('{') ? {type: v} : v,
365
+ ...(sample != null && /^[a-z]/.test(v) ? {value: sample} : {}),
314
366
  },
315
367
  });
368
+ }
316
369
  // The states the doc names that a prop sets: checked (a boolean value)
317
370
  // and disabled. The label says the state shown.
318
371
  const states = new Set(info.targets.flatMap(t => t.states ?? []));
@@ -629,7 +682,7 @@ export async function partData(project) {
629
682
  // A file that parses but has the wrong shape (a hand edit, a cut-off
630
683
  // write) is built again, as a file that does not parse is.
631
684
  if (
632
- cached.version === PART_DATA_VERSION &&
685
+ cached.censusKey === CENSUS_KEY &&
633
686
  cached.coreKey === project.coreKey &&
634
687
  isRecord(cached.map) &&
635
688
  Object.values(cached.map).every(isRecord) &&
@@ -845,7 +898,7 @@ async function buildPartData(project) {
845
898
  addInlineStatePaint(project, result.map);
846
899
  addIndicatorRings(project, result.map);
847
900
  return {
848
- version: PART_DATA_VERSION,
901
+ censusKey: CENSUS_KEY,
849
902
  coreKey: project.coreKey,
850
903
  ...result,
851
904
  rendered: (markup.match(/<section data-cat=/g) ?? []).length,
@@ -1147,9 +1200,9 @@ function resolvePrivate(v, env, tokens, depth = 0) {
1147
1200
  * @returns {{map: Record<string, PartRecord>, pairs: TextPair[]}}
1148
1201
  */
1149
1202
  export function walkMarkup(html, decls, tokens, targets = new Map()) {
1150
- /** @type {Record<string, {own: Record<string, {tokens: Record<string, Set<string>>, values: Set<string>}>, at: Record<string, Record<string, string>>, inside: Record<string, Set<string>>, attrs: Record<string, Set<string>>, contains: Set<string>, tags: Set<string>, innerCorners: Set<string>, media: boolean, mediaSides?: Set<string>, line?: Set<string>, lineAdded?: Array<[string, string, Set<string>, boolean?]>, held?: Record<string, Set<string>>}>} */
1203
+ /** @type {Record<string, {own: Record<string, {tokens: Record<string, Set<string>>, values: Set<string>}>, at: Record<string, Record<string, string>>, inside: Record<string, Set<string>>, attrs: Record<string, Set<string>>, contains: Set<string>, holdsVariants?: Record<string, Set<string>>, tags: Set<string>, innerCorners: Set<string>, media: boolean, mediaSides?: Set<string>, line?: Set<string>, lineAdded?: Array<[string, string, Set<string>, boolean?]>, held?: Record<string, Set<string>>, underInput?: string}>} */
1151
1204
  const map = {};
1152
- /** @type {Array<{env: Record<string, string>, target: string | null, all?: string[], fg: PaintSide | null, bg: PaintSide | null, cond: string}>} */
1205
+ /** @type {Array<{env: Record<string, string>, target: string | null, all?: string[], fg: PaintSide | null, bg: PaintSide | null, cond: string, kids?: string[], input?: boolean, owns?: boolean}>} */
1153
1206
  const stack = [{env: {}, target: null, fg: null, bg: null, cond: ''}];
1154
1207
  /** @type {Map<string, TextPair>} */
1155
1208
  const pairs = new Map();
@@ -1160,7 +1213,19 @@ export function walkMarkup(html, decls, tokens, targets = new Map()) {
1160
1213
  */
1161
1214
  const addPair = (target, fg, bg, sample) => {
1162
1215
  const k = `${target}|${fg.target}:${fg.tokens.join('+') || fg.raw}|${bg.target}:${bg.tokens.join('+') || bg.raw}`;
1163
- pairs.set(k, {text: target, fg, bg, sample: sample.slice(0, 30)});
1216
+ // (The parts the text sits inside where the census drew it, between
1217
+ // it and its ground and beyond: a side nav's item inside the side nav.)
1218
+ const within = new Set(pairs.get(k)?.within ?? []);
1219
+ for (const anc of stack)
1220
+ for (const at of anc.all ?? (anc.target ? [anc.target] : []))
1221
+ if (at !== target) within.add(at);
1222
+ pairs.set(k, {
1223
+ text: target,
1224
+ fg,
1225
+ bg,
1226
+ sample: sample.slice(0, 30),
1227
+ within: [...within],
1228
+ });
1164
1229
  };
1165
1230
  /** The parts whose paint is a line inside them. @type {Set<string>} */
1166
1231
  const lined = new Set();
@@ -1176,7 +1241,16 @@ export function walkMarkup(html, decls, tokens, targets = new Map()) {
1176
1241
  continue;
1177
1242
  }
1178
1243
  if (close) {
1179
- if (stack.length > 1) stack.pop();
1244
+ if (stack.length > 1) {
1245
+ const done = /** @type {typeof stack[number]} */ (stack.pop());
1246
+ // (A native input laid over its siblings, invisible, takes the
1247
+ // pointer and the focus for them: a checkbox's box draws under
1248
+ // it, so its own :hover or :focus never applies. The part that
1249
+ // holds the input is where those states land.)
1250
+ if (done.input)
1251
+ for (const k of done.kids ?? [])
1252
+ map[k].underInput ??= done.target ?? stack.at(-1)?.target ?? '';
1253
+ }
1180
1254
  continue;
1181
1255
  }
1182
1256
  const cls = (/class="([^"]*)"/.exec(attrs)?.[1] ?? '')
@@ -1381,6 +1455,12 @@ export function walkMarkup(html, decls, tokens, targets = new Map()) {
1381
1455
  for (const at of anc.all ?? (anc.target ? [anc.target] : []))
1382
1456
  if (at !== t) {
1383
1457
  map[at].contains.add(t);
1458
+ // (The variant each holds there: a toast's close button is a
1459
+ // ghost button.)
1460
+ if (dataAttrs.variant)
1461
+ ((map[at].holdsVariants ??= {})[t] ??= new Set()).add(
1462
+ dataAttrs.variant,
1463
+ );
1384
1464
  // What the parts inside it draw with there, at rest (a table
1385
1465
  // row's cells' border color; a toast's ghost button declares
1386
1466
  // none).
@@ -1410,6 +1490,22 @@ export function walkMarkup(html, decls, tokens, targets = new Map()) {
1410
1490
  ...context,
1411
1491
  ].join(',')
1412
1492
  : parent.cond;
1493
+ if (
1494
+ tag.toLowerCase() === 'input' &&
1495
+ own.some(
1496
+ d =>
1497
+ (d.prop === 'opacity' && /^0(?:\.0+)?$/.test(d.value.trim())) ||
1498
+ (d.prop === 'position' && d.value.trim() === 'absolute'),
1499
+ )
1500
+ )
1501
+ parent.input = true;
1502
+ else if (ownsTarget)
1503
+ // (Into each element it sits in, up to the nearest themed one: the
1504
+ // box inside a wrapper with no box of its own, beside the input.)
1505
+ for (let i = stack.length - 1; i >= 1; i--) {
1506
+ (stack[i].kids ??= []).push(...named.map(c => c.slice(7)));
1507
+ if (stack[i].owns) break;
1508
+ }
1413
1509
  if (!selfClose && !VOID.has(tag.toLowerCase()))
1414
1510
  stack.push({
1415
1511
  env,
@@ -1418,6 +1514,7 @@ export function walkMarkup(html, decls, tokens, targets = new Map()) {
1418
1514
  fg,
1419
1515
  bg,
1420
1516
  cond: condHere,
1517
+ owns: ownsTarget,
1421
1518
  });
1422
1519
  }
1423
1520
  // A part that holds other parts (a layout, an outline, a slider's
@@ -1462,7 +1559,15 @@ export function walkMarkup(html, decls, tokens, targets = new Map()) {
1462
1559
  Object.entries(v.attrs).map(([k, s]) => [k, [...s]]),
1463
1560
  ),
1464
1561
  contains: [...v.contains],
1562
+ ...(v.holdsVariants
1563
+ ? {
1564
+ holdsVariants: Object.fromEntries(
1565
+ Object.entries(v.holdsVariants).map(([k, s]) => [k, [...s]]),
1566
+ ),
1567
+ }
1568
+ : {}),
1465
1569
  tags: [...v.tags],
1570
+ ...(v.underInput != null ? {underInput: v.underInput} : {}),
1466
1571
  innerCorners: [...v.innerCorners],
1467
1572
  ...(v.media ? {media: true} : {}),
1468
1573
  ...(v.mediaSides?.size ? {mediaSides: [...v.mediaSides].sort()} : {}),
@@ -1659,6 +1659,15 @@ export default function Home() {
1659
1659
  }
1660
1660
  `;
1661
1661
 
1662
+ /**
1663
+ * The starter's home page once its theme preview is removed: the same page
1664
+ * with no link to the preview.
1665
+ */
1666
+ const STARTER_HOME_BARE = STARTER_HOME.replace(
1667
+ "import {Link} from '@astryxdesign/core/Link';\n",
1668
+ '',
1669
+ ).replace(/\n\s*<Link href="\/theme-preview">[^<]*<\/Link>/, '');
1670
+
1662
1671
  /**
1663
1672
  * The files a new starter app (Next.js app router, Core and the neutral
1664
1673
  * theme) writes into `where`, with `extra` files beside them, checked before
@@ -3565,7 +3574,7 @@ export function seeLine(cwd, slug, focus, notChecked = null, extra = {}) {
3565
3574
  : look
3566
3575
  ? `look without changing your app: ${look}`
3567
3576
  : // The pictures first: the one command that writes the two to open.
3568
- `look without changing your app: ${extra.pictureProblem ? pngNote : `${EDITOR} show ${slug} --png writes ${shown(cwd, f.previewPng)} (the sample page, with a tooltip, a menu and a list drawn open below it) and ${shown(cwd, path.join(f.dir, 'sheet-overlays.png'))} (every menu, tooltip, popover and list, drawn open) to open, with no dev server (it needs a Playwright or a Chrome)`}; or open ${shown(cwd, f.preview)} (one self-contained page, current after this change)`;
3577
+ `look without changing your app: ${extra.pictureProblem ? pngNote : `${EDITOR} show ${slug} --png writes ${shown(cwd, f.previewPng)} (the sample page, with a tooltip, a menu and a list drawn open below it) and ${shown(cwd, path.join(f.dir, 'sheet-overlays.png'))} (each control at rest, hovered, focused and pressed at its top, then every menu, tooltip, popover and list, drawn open) to open, with no dev server (it needs a Playwright or a Chrome)`}; or open ${shown(cwd, f.preview)} (one self-contained page, current after this change)`;
3569
3578
  const edited = handEdited.length
3570
3579
  ? `; the in-app preview in ${handEdited.slice(0, 2).join(', ')}/ ${stale.some(f => /could not be written/.test(f)) && !stale.some(f => /changed by hand/.test(f)) ? 'could not be written' : 'was changed by hand'}, so it does not follow this change (previewStale says what to move out, then ${PREVIEW} add writes it again)`
3571
3580
  : '';
@@ -6298,6 +6307,10 @@ async function removePreview(page, options, box) {
6298
6307
  Number(path.basename(a.file) === PREVIEW_DATA) -
6299
6308
  Number(path.basename(b.file) === PREVIEW_DATA),
6300
6309
  );
6310
+ // Where the app serves the preview, and its routes folder, read while the
6311
+ // preview is there.
6312
+ const url = previewPath(cwd, at);
6313
+ const routes = routesOf(cwd, at);
6301
6314
  /** @type {string[]} */
6302
6315
  const removed = [];
6303
6316
  for (const [i, p] of plan.entries())
@@ -6346,6 +6359,31 @@ async function removePreview(page, options, box) {
6346
6359
  } catch {
6347
6360
  // Not empty: something there is not the preview's.
6348
6361
  }
6362
+ /** @type {string[]} */
6363
+ const rewritten = [];
6364
+ // The app's home page linked to the preview (a starter's does): a home
6365
+ // page as the starter wrote it loses the link; any other is named.
6366
+ if (url != null && routes && !fs.existsSync(at.dir))
6367
+ for (const name of ['page.tsx', 'page.jsx', 'page.js']) {
6368
+ const home = path.join(routes, name);
6369
+ let text;
6370
+ try {
6371
+ text = readRegularFile(home, 'utf8');
6372
+ } catch {
6373
+ continue;
6374
+ }
6375
+ if (text === STARTER_HOME) {
6376
+ writeWhole(home, STARTER_HOME_BARE);
6377
+ rewritten.push(shown(cwd, home));
6378
+ notes.push(
6379
+ `${shown(cwd, home)} no longer links to ${url}: the starter's home page linked to the preview this removed`,
6380
+ );
6381
+ } else if (text.includes(`"${url}"`) || text.includes(`'${url}'`))
6382
+ notes.push(
6383
+ `${shown(cwd, home)} still links to ${url}, which no longer exists: take that link out`,
6384
+ );
6385
+ break;
6386
+ }
6349
6387
  const worn = data.theme;
6350
6388
  if (worn)
6351
6389
  await themeLocked(options, worn, () =>
@@ -6353,6 +6391,6 @@ async function removePreview(page, options, box) {
6353
6391
  );
6354
6392
  return {
6355
6393
  type: 'themeEdit.previewRemove',
6356
- data: {folder, removed, kept, missing, rewritten: [], notes, pages: []},
6394
+ data: {folder, removed, kept, missing, rewritten, notes, pages: []},
6357
6395
  };
6358
6396
  }
@@ -1,6 +1,25 @@
1
1
  // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
+ /**
5
+ * The section of the theme-building page a component sits in; a part with
6
+ * no category of its own sits with its parent.
7
+ * @param {import('./_project.mjs').ThemeProject} project
8
+ * @param {string} name
9
+ * @returns {string | null}
10
+ */
11
+ export function familyOf(project: import("./_project.mjs").ThemeProject, name: string): string | null;
12
+ /**
13
+ * The sections of the theme-building page whose parts the theme's settings
14
+ * set on their own (`--on badge`): the components that part names a class
15
+ * of, each in its section. A setting for the whole theme (a color, the
16
+ * corners) sets no section here: the sample page and the open states show
17
+ * it.
18
+ * @param {import('./_project.mjs').ThemeProject} project
19
+ * @param {import('./_settings.mjs').ThemeData} data
20
+ * @returns {string[]}
21
+ */
22
+ export function touchedFamilies(project: import("./_project.mjs").ThemeProject, data: import("./_settings.mjs").ThemeData): string[];
4
23
  /**
5
24
  * Items of the theme-building page: each component once per variant
6
25
  * (overlays open), the sample page, and template pages
@@ -239,24 +258,43 @@ export function newPictureRun(): PictureRun;
239
258
  * gets its own time bound, and the next one its turn when one fails or
240
259
  * hangs. Not ok with a reason when none is there or every one failed: the
241
260
  * reason then names each one's real error. When a later browser took the
242
- * picture, `note` says why an earlier one did not.
261
+ * picture, `note` says why an earlier one did not. `cutShort` is the text
262
+ * the page draws cut short, measured in it by the browser that took the
263
+ * picture, each with whether its part keeping its width draws it whole;
264
+ * absent when that browser's script measured nothing.
243
265
  * @param {import('./_project.mjs').ThemeProject} project
244
266
  * @param {string} html absolute
245
267
  * @param {string} png absolute
246
268
  * @param {'light' | 'dark'} mode
247
269
  * @param {PictureRun} [run] what earlier pictures of the same run learned:
248
270
  * a browser that failed or hung there is not tried again
249
- * @returns {Promise<{ok: true, file: string, note?: string} | {ok: false, reason: string, stopped?: string}>}
271
+ * @returns {Promise<{ok: true, file: string, notes?: string[], cutShort?: Array<{part: string | null, text: string, whole: boolean}>} | {ok: false, reason: string, stopped?: string}>}
250
272
  */
251
273
  export function screenshot(project: import("./_project.mjs").ThemeProject, html: string, png: string, mode: "light" | "dark", run?: PictureRun): Promise<{
252
274
  ok: true;
253
275
  file: string;
254
- note?: string;
276
+ notes?: string[];
277
+ cutShort?: Array<{
278
+ part: string | null;
279
+ text: string;
280
+ whole: boolean;
281
+ }>;
255
282
  } | {
256
283
  ok: false;
257
284
  reason: string;
258
285
  stopped?: string;
259
286
  }>;
287
+ /**
288
+ * What a picture shows in place of a font stack: a role whose stack ends in
289
+ * a generic of a kind (serif, monospace, cursive) and none of whose named
290
+ * families this machine has is drawn in this machine's font for that
291
+ * generic, which may be of another kind (a system with no serif font draws
292
+ * serif in a sans-serif one). A stack that ends in sans-serif falls back
293
+ * to a font of its own kind, so it is not named.
294
+ * @param {string} stdout what the picture script printed
295
+ * @returns {string[]}
296
+ */
297
+ export function pictureFontNotes(stdout: string): string[];
260
298
  /**
261
299
  * The font stylesheets a theme's app copy imports, from the fonts the theme
262
300
  * loads now (an installed font package, the base theme's fonts).
@@ -363,12 +401,13 @@ export function takeFirstAppCopy(cwd: string, slug: string): string[] | null;
363
401
  * A stop or the bound asks the whole group to close, waits for it (killing
364
402
  * it past a short grace), then removes the temp folder and the `drop` files
365
403
  * (a picture part a stopped run leaves); a run that ends on its own removes
366
- * the temp folder only.
404
+ * the temp folder only, and gives what the script wrote on its standard
405
+ * output (`stdout`: what it measured in the page).
367
406
  * @param {string} script a picture script
368
407
  * @param {string[]} args
369
408
  * @param {number} [bound] milliseconds before the run is stopped
370
409
  * @param {{drop?: string[]}} [opts]
371
- * @returns {Promise<{status: number | null, signal: string | null, stderr: string, error?: Error, stoppedBy?: string, timedOut?: boolean, noTemp?: string}>}
410
+ * @returns {Promise<{status: number | null, signal: string | null, stderr: string, stdout?: string, error?: Error, stoppedBy?: string, timedOut?: boolean, noTemp?: string}>}
372
411
  */
373
412
  export function runBrowser(script: string, args: string[], bound?: number, opts?: {
374
413
  drop?: string[];
@@ -376,6 +415,7 @@ export function runBrowser(script: string, args: string[], bound?: number, opts?
376
415
  status: number | null;
377
416
  signal: string | null;
378
417
  stderr: string;
418
+ stdout?: string;
379
419
  error?: Error;
380
420
  stoppedBy?: string;
381
421
  timedOut?: boolean;