@astryxdesign/cli 0.7.16 → 0.7.17-canary.g0404a74

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 (529) hide show
  1. package/README.md +76 -86
  2. package/api/build/_adapter.d.mts +17 -0
  3. package/api/build/_adapter.mjs +53 -34
  4. package/api/build/blocks/blocks.d.mts +7 -5
  5. package/api/build/blocks/blocks.mjs +113 -26
  6. package/api/build/blocks/blocks.weights.json +1 -1
  7. package/api/build/build.doc.mjs +4 -3
  8. package/api/build/build.type.d.mts +2 -2
  9. package/api/build/build.type.mjs +3 -3
  10. package/api/build/kit/kind.d.mts +2 -1
  11. package/api/build/kit/kind.mjs +199 -10
  12. package/api/build/kit/kit.mjs +6 -4
  13. package/api/build/kit/rank.d.mts +6 -4
  14. package/api/build/kit/rank.mjs +132 -28
  15. package/api/build/kit/signals.d.mts +7 -1
  16. package/api/build/kit/signals.mjs +21 -10
  17. package/api/build/kit/start.d.mts +5 -4
  18. package/api/build/kit/start.mjs +14 -9
  19. package/api/build/kit/weights.d.mts +39 -3
  20. package/api/build/kit/weights.json +1 -1
  21. package/api/build/kit/weights.mjs +351 -46
  22. package/api/build/kit/word-model.d.mts +23 -0
  23. package/api/build/kit/word-model.mjs +46 -0
  24. package/api/build/kit/words.d.mts +86 -0
  25. package/api/build/kit/words.mjs +241 -1
  26. package/api/build/tree.mjs +1 -1
  27. package/api/component/__fixtures__/resolutions/modules.txt +5 -6
  28. package/api/component/_adapter.d.mts +26 -2
  29. package/api/component/_adapter.mjs +135 -8
  30. package/api/component/component.mjs +14 -1
  31. package/api/component/list/list.d.mts +1 -1
  32. package/api/component/list/list.mjs +48 -6
  33. package/api/discover/_adapter.d.mts +11 -1
  34. package/api/discover/_adapter.mjs +95 -1
  35. package/api/discover/detail/item/item.mjs +5 -0
  36. package/api/discover/discover.mjs +12 -3
  37. package/api/discover/discover.type.d.mts +16 -3
  38. package/api/discover/discover.type.mjs +13 -3
  39. package/api/discover/search/search.mjs +3 -2
  40. package/api/docs/_adapter.d.mts +57 -2
  41. package/api/docs/_adapter.mjs +266 -33
  42. package/api/docs/_entry-names-lazily.d.mts +22 -0
  43. package/api/docs/_entry-names-lazily.mjs +25 -0
  44. package/api/docs/_entry-names.d.mts +23 -0
  45. package/api/docs/_entry-names.mjs +105 -0
  46. package/api/docs/docs.d.mts +3 -0
  47. package/api/docs/docs.doc.mjs +7 -1
  48. package/api/docs/docs.mjs +12 -0
  49. package/api/docs/docs.type.d.mts +5 -0
  50. package/api/docs/docs.type.mjs +2 -0
  51. package/api/docs/node/node.mjs +1 -1
  52. package/api/doctor/_adapter.d.mts +54 -5
  53. package/api/doctor/_adapter.mjs +162 -11
  54. package/api/doctor/built-checks.mjs +40 -14
  55. package/api/doctor/doctor.d.mts +15 -3
  56. package/api/doctor/doctor.doc.mjs +1 -1
  57. package/api/doctor/doctor.mjs +31 -7
  58. package/api/doctor/theme-checks.d.mts +35 -3
  59. package/api/doctor/theme-checks.mjs +377 -29
  60. package/api/hook/_adapter.d.mts +10 -4
  61. package/api/hook/_adapter.mjs +41 -5
  62. package/api/hook/detail/detail.mjs +5 -2
  63. package/api/hook/detail/params/params.mjs +10 -3
  64. package/api/icon/_records.mjs +2 -1
  65. package/api/index.d.mts +2 -0
  66. package/api/index.mjs +2 -0
  67. package/api/integration/_adapter.d.mts +44 -0
  68. package/api/integration/_adapter.mjs +77 -1
  69. package/api/integration/add-helpers.mjs +10 -0
  70. package/api/integration/authoring-checks.mjs +11 -8
  71. package/api/integration/example-scope.d.mts +14 -0
  72. package/api/integration/example-scope.mjs +44 -0
  73. package/api/integration/example-scope.type.d.mts +29 -0
  74. package/api/integration/example-scope.type.mjs +25 -0
  75. package/api/integration/integrationExampleScope.doc.d.mts +11 -0
  76. package/api/integration/integrationExampleScope.doc.mjs +59 -0
  77. package/api/integration/pack-check.mjs +16 -1
  78. package/api/integration/validate-integration.d.mts +18 -6
  79. package/api/integration/validate-integration.mjs +129 -15
  80. package/api/integration/validate-integration.type.d.mts +22 -0
  81. package/api/integration/validate-integration.type.mjs +2 -1
  82. package/api/integration/validateIntegration.doc.mjs +1 -1
  83. package/api/render/_adapter.mjs +591 -195
  84. package/api/render/render.doc.mjs +11 -3
  85. package/api/render/render.type.d.mts +53 -1
  86. package/api/render/render.type.mjs +32 -2
  87. package/api/search/ORDERING.md +2 -2
  88. package/api/search/_adapter.d.mts +9 -0
  89. package/api/search/_adapter.mjs +85 -0
  90. package/api/search/_candidate-score.d.mts +9 -4
  91. package/api/search/_candidate-score.mjs +133 -46
  92. package/api/search/_fit-order.mjs +3 -3
  93. package/api/search/_gather-components.d.mts +3 -2
  94. package/api/search/_gather-components.mjs +12 -3
  95. package/api/search/_lexical.d.mts +14 -0
  96. package/api/search/_lexical.mjs +93 -11
  97. package/api/search/_result.d.mts +11 -9
  98. package/api/search/_result.mjs +4 -4
  99. package/api/search/_score.d.mts +6 -1
  100. package/api/search/_score.mjs +15 -3
  101. package/api/search/search-index.mjs +7 -1
  102. package/api/search/search.d.mts +1 -1
  103. package/api/template/_adapter.d.mts +16 -0
  104. package/api/template/_adapter.mjs +39 -2
  105. package/api/template/cdn/cdn.mjs +37 -8
  106. package/api/template/copy/copy.d.mts +6 -3
  107. package/api/template/copy/copy.mjs +40 -8
  108. package/api/template/template.doc.mjs +3 -3
  109. package/api/template/template.mjs +63 -11
  110. package/api/template/template.type.d.mts +1 -0
  111. package/api/template/template.type.mjs +1 -0
  112. package/api/theme/_adapter.d.mts +12 -1
  113. package/api/theme/_adapter.mjs +132 -13
  114. package/api/theme/_app-provider.d.mts +31 -0
  115. package/api/theme/_app-provider.mjs +135 -0
  116. package/api/theme/add/add.mjs +3 -1
  117. package/api/theme/build/build.d.mts +142 -1
  118. package/api/theme/build/build.mjs +692 -284
  119. package/api/theme/build/core-interception.d.mts +10 -0
  120. package/api/theme/build/core-interception.mjs +10 -0
  121. package/api/theme/build/font-warning.d.mts +80 -5
  122. package/api/theme/build/font-warning.mjs +323 -55
  123. package/api/theme/build/icon-imports.mjs +51 -9
  124. package/api/theme/build/null-values.d.mts +28 -0
  125. package/api/theme/build/null-values.mjs +191 -0
  126. package/api/theme/list/list.mjs +17 -1
  127. package/api/theme/remove/remove.d.mts +2 -1
  128. package/api/theme/remove/remove.mjs +7 -3
  129. package/api/theme/theme.type.d.mts +78 -1
  130. package/api/theme/theme.type.mjs +38 -2
  131. package/api/theme/themeAdd.doc.mjs +1 -1
  132. package/api/theme/themeListAvailable.doc.mjs +1 -1
  133. package/api/theme/themeRemove.doc.mjs +8 -5
  134. package/api/theme-edit/_adapter.d.mts +116 -4
  135. package/api/theme-edit/_adapter.mjs +1058 -93
  136. package/api/theme-edit/_catalog.d.mts +46 -2
  137. package/api/theme-edit/_catalog.mjs +115 -14
  138. package/api/theme-edit/_check.d.mts +133 -24
  139. package/api/theme-edit/_check.mjs +3392 -531
  140. package/api/theme-edit/_color.d.mts +26 -0
  141. package/api/theme-edit/_color.mjs +92 -2
  142. package/api/theme-edit/_compiler.d.mts +5 -1
  143. package/api/theme-edit/_compiler.mjs +141 -17
  144. package/api/theme-edit/_context.d.mts +74 -6
  145. package/api/theme-edit/_context.mjs +468 -76
  146. package/api/theme-edit/_css.d.mts +21 -0
  147. package/api/theme-edit/_css.mjs +87 -14
  148. package/api/theme-edit/_edit.d.mts +74 -7
  149. package/api/theme-edit/_edit.mjs +4426 -319
  150. package/api/theme-edit/_how-commands.d.mts +76 -1
  151. package/api/theme-edit/_how-commands.mjs +793 -9
  152. package/api/theme-edit/_how-question.d.mts +97 -6
  153. package/api/theme-edit/_how-question.mjs +9184 -747
  154. package/api/theme-edit/_how.d.mts +5 -2
  155. package/api/theme-edit/_how.mjs +255 -46
  156. package/api/theme-edit/_importers.d.mts +38 -0
  157. package/api/theme-edit/_importers.mjs +188 -0
  158. package/api/theme-edit/_marks.d.mts +31 -5
  159. package/api/theme-edit/_marks.mjs +57 -5
  160. package/api/theme-edit/_name-rule.d.mts +11 -0
  161. package/api/theme-edit/_name-rule.mjs +12 -0
  162. package/api/theme-edit/_normal.d.mts +322 -0
  163. package/api/theme-edit/_normal.mjs +1630 -0
  164. package/api/theme-edit/_palette.d.mts +49 -0
  165. package/api/theme-edit/_palette.mjs +180 -38
  166. package/api/theme-edit/_part-words.d.mts +39 -0
  167. package/api/theme-edit/_part-words.mjs +152 -0
  168. package/api/theme-edit/_parts.d.mts +55 -3
  169. package/api/theme-edit/_parts.mjs +421 -36
  170. package/api/theme-edit/_preview-app.d.mts +7 -13
  171. package/api/theme-edit/_preview-app.mjs +1108 -599
  172. package/api/theme-edit/_preview.d.mts +156 -19
  173. package/api/theme-edit/_preview.mjs +809 -180
  174. package/api/theme-edit/_project.d.mts +61 -1
  175. package/api/theme-edit/_project.mjs +177 -6
  176. package/api/theme-edit/_settings.d.mts +619 -48
  177. package/api/theme-edit/_settings.mjs +4910 -617
  178. package/api/theme-edit/_tables.d.mts +41 -0
  179. package/api/theme-edit/_tables.mjs +261 -41
  180. package/api/theme-edit/_vet.d.mts +31 -0
  181. package/api/theme-edit/_vet.mjs +114 -8
  182. package/api/theme-edit/theme-edit.type.d.mts +34 -2
  183. package/api/theme-edit/theme-edit.type.mjs +18 -3
  184. package/api/theme-edit/themeEditHow.doc.mjs +1 -1
  185. package/api/theme-edit/themeEditNew.doc.d.mts +0 -1
  186. package/api/theme-edit/themeEditNew.doc.mjs +7 -4
  187. package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
  188. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +2 -2
  189. package/api/upgrade/run/run.mjs +4 -3
  190. package/api/upgrade/upgrade.mjs +16 -1
  191. package/assets/codemods/integration-discovery.mjs +2 -1
  192. package/assets/codemods/integration-runner.mjs +1 -1
  193. package/assets/codemods/jscodeshift.d.ts +1 -1
  194. package/assets/codemods/run-codemod.mjs +151 -18
  195. package/assets/codemods/runner.mjs +1 -4
  196. package/assets/codemods/transforms/next/index.mjs +11 -1
  197. package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
  198. package/assets/component-list.generated.json +1 -0
  199. package/assets/docs/author-a-theme.doc.mjs +2 -0
  200. package/assets/docs/theme.doc.dense.mjs +76 -7
  201. package/assets/docs/theme.doc.mjs +66 -2
  202. package/assets/docs/theme.doc.zh.mjs +51 -1
  203. package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
  204. package/assets/docs/tree/checks.doc.mjs +2 -2
  205. package/assets/docs/tree/cli-command.doc.mjs +2 -3
  206. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  207. package/assets/docs/tree/font-setup.doc.mjs +1 -1
  208. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  209. package/assets/docs/tree/render-pages.doc.mjs +46 -5
  210. package/assets/docs/tree/share-a-page.doc.mjs +157 -0
  211. package/assets/docs/tree/single-component.doc.mjs +4 -0
  212. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  213. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  214. package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
  215. package/assets/docs/use-a-theme.doc.mjs +2 -2
  216. package/assets/docs-routes.generated.json +1 -0
  217. package/assets/docs.generated.json +2 -2
  218. package/assets/search-catalog.generated.json +2 -0
  219. package/assets/self-audit.generated.json +1 -1
  220. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
  221. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
  222. package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.doc.mjs +14 -0
  223. package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.tsx +43 -0
  224. package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +2 -2
  225. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
  226. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
  227. package/assets/templates/components.generated.json +1 -1
  228. package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
  229. package/assets/templates/pages/ai-chat-landing/page.tsx +31 -4
  230. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +5 -1
  231. package/assets/templates/pages/blank/template.doc.mjs +1 -1
  232. package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
  233. package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
  234. package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
  235. package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
  236. package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
  237. package/assets/templates/pages/dashboard-alert-rail/page.tsx +1 -1
  238. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
  239. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +1 -1
  240. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
  241. package/assets/templates/pages/dashboard-comparison/page.tsx +2 -2
  242. package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
  243. package/assets/templates/pages/dashboard-progress/page.tsx +1 -1
  244. package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
  245. package/assets/templates/pages/detail-page/page.tsx +60 -7
  246. package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
  247. package/assets/templates/pages/documentation/template.doc.mjs +4 -1
  248. package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
  249. package/assets/templates/pages/documentation-technical/page.tsx +13 -13
  250. package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
  251. package/assets/templates/pages/editor/page.tsx +14 -2
  252. package/assets/templates/pages/editor/template.doc.mjs +2 -8
  253. package/assets/templates/pages/file-explorer/page.tsx +9 -0
  254. package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
  255. package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
  256. package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
  257. package/assets/templates/pages/form-wizard-vertical/page.tsx +23 -3
  258. package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
  259. package/assets/templates/pages/ide/page.tsx +33 -2
  260. package/assets/templates/pages/kanban-board/page.tsx +12 -2
  261. package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
  262. package/assets/templates/pages/library/template.doc.mjs +4 -1
  263. package/assets/templates/pages/login/template.doc.mjs +2 -1
  264. package/assets/templates/pages/login-card/page.tsx +16 -0
  265. package/assets/templates/pages/login-card/template.doc.mjs +2 -1
  266. package/assets/templates/pages/login-split/page.tsx +19 -6
  267. package/assets/templates/pages/login-split/template.doc.mjs +2 -1
  268. package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
  269. package/assets/templates/pages/messaging-shell/template.doc.mjs +6 -0
  270. package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
  271. package/assets/templates/pages/payment-form/page.tsx +30 -4
  272. package/assets/templates/pages/product-detail/page.tsx +26 -2
  273. package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
  274. package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
  275. package/assets/templates/pages/settings-dialog/page.tsx +162 -12
  276. package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
  277. package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
  278. package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
  279. package/assets/templates/pages/shell-side-nav/page.tsx +11 -3
  280. package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
  281. package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
  282. package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
  283. package/assets/templates/pages/table-filter/page.tsx +9 -0
  284. package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
  285. package/assets/templates/pages/table-grouped/page.tsx +161 -133
  286. package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
  287. package/assets/templates/pages/table-page/page.tsx +14 -1
  288. package/assets/templates/pages/table-page/template.doc.mjs +5 -4
  289. package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
  290. package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
  291. package/assets/templates/pages/work-item-detail/page.tsx +47 -7
  292. package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
  293. package/assets/theme.template.ts +9 -2
  294. package/authoring/debug/parse.d.mts +3 -3
  295. package/authoring/doctypes/_schema.d.mts +9 -9
  296. package/authoring/doctypes/command/command.doc.mjs +1 -1
  297. package/authoring/doctypes/component/categories.d.mts +37 -0
  298. package/authoring/doctypes/component/categories.mjs +54 -0
  299. package/authoring/doctypes/template/template.doc.mjs +1 -1
  300. package/authoring/doctypes/template/type.ts +9 -0
  301. package/authoring/example/example.doc.d.mts +12 -0
  302. package/authoring/example/example.doc.mjs +69 -0
  303. package/authoring/example/preview.d.mts +92 -0
  304. package/authoring/example/preview.mjs +994 -0
  305. package/authoring/example/type.ts +102 -0
  306. package/authoring/index.d.mts +1 -0
  307. package/authoring/index.d.ts +12 -0
  308. package/authoring/index.mjs +3 -1
  309. package/authoring/integration/integration.doc.mjs +8 -0
  310. package/authoring/integration/schema.d.mts +24 -1
  311. package/authoring/integration/schema.mjs +126 -4
  312. package/authoring/integration/type.ts +14 -0
  313. package/clients/cli/bin/astryx.mjs +6 -9
  314. package/clients/cli/build-id.generated.json +1 -1
  315. package/clients/cli/commands/component.doc.mjs +1 -1
  316. package/clients/cli/commands/component.mjs +22 -3
  317. package/clients/cli/commands/discover.mjs +70 -3
  318. package/clients/cli/commands/docs.doc.mjs +7 -1
  319. package/clients/cli/commands/docs.mjs +44 -6
  320. package/clients/cli/commands/doctor.mjs +84 -16
  321. package/clients/cli/commands/experimental/render.mjs +42 -1
  322. package/clients/cli/commands/experimental/theme.mjs +1032 -134
  323. package/clients/cli/commands/experimental-render.doc.mjs +2 -2
  324. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
  325. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +87 -1
  326. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +10 -3
  327. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +2 -2
  328. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -2
  329. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
  330. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  331. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +2 -2
  332. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
  333. package/clients/cli/commands/experimental-theme-preview.doc.mjs +2 -1
  334. package/clients/cli/commands/experimental-theme-remove.doc.mjs +4 -4
  335. package/clients/cli/commands/experimental-theme.doc.mjs +5 -1
  336. package/clients/cli/commands/search.doc.mjs +2 -1
  337. package/clients/cli/commands/search.mjs +6 -1
  338. package/clients/cli/commands/template.doc.mjs +1 -1
  339. package/clients/cli/commands/template.mjs +15 -2
  340. package/clients/cli/commands/theme-add.doc.mjs +1 -1
  341. package/clients/cli/commands/theme-build.doc.mjs +5 -1
  342. package/clients/cli/commands/theme-list.doc.mjs +1 -1
  343. package/clients/cli/commands/theme-remove.doc.mjs +13 -5
  344. package/clients/cli/commands/theme.doc.mjs +1 -1
  345. package/clients/cli/commands/theme.mjs +849 -441
  346. package/clients/cli/commands/upgrade.mjs +46 -8
  347. package/clients/cli/index.mjs +9 -19
  348. package/clients/cli/lib/cli-error.mjs +2 -1
  349. package/clients/cli/lib/component-format.mjs +205 -98
  350. package/clients/cli/lib/hook-format.mjs +9 -19
  351. package/clients/cli/lib/json-shim.mjs +265 -29
  352. package/clients/cli/lib/manifest.mjs +3 -2
  353. package/clients/cli/lib/stray-option.mjs +478 -0
  354. package/clients/cli/lib/unknown-command.mjs +353 -0
  355. package/clients/cli/manifest.generated.json +1 -1
  356. package/foundation/agent-docs/agent-docs.mjs +1 -1
  357. package/foundation/config/project.d.mts +8 -0
  358. package/foundation/config/project.mjs +26 -29
  359. package/foundation/config/theme-state.d.mts +31 -2
  360. package/foundation/config/theme-state.mjs +140 -8
  361. package/foundation/discovery/authoring-self-docs.mjs +1 -0
  362. package/foundation/discovery/cli-self-doc-names.d.mts +13 -0
  363. package/foundation/discovery/cli-self-doc-names.mjs +51 -0
  364. package/foundation/discovery/cli-self-docs.d.mts +0 -2
  365. package/foundation/discovery/cli-self-docs.mjs +2 -15
  366. package/foundation/discovery/component-discovery.d.mts +11 -0
  367. package/foundation/discovery/component-discovery.mjs +59 -10
  368. package/foundation/discovery/component-replacement.mjs +130 -1
  369. package/foundation/discovery/copied-passages.mjs +2 -1
  370. package/foundation/discovery/core-component-docs.d.mts +29 -0
  371. package/foundation/discovery/core-component-docs.mjs +83 -0
  372. package/foundation/discovery/core-theme-facts.d.mts +70 -0
  373. package/foundation/discovery/core-theme-facts.mjs +384 -0
  374. package/foundation/discovery/doc-types.mjs +4 -3
  375. package/foundation/discovery/docs-discovery.d.mts +66 -9
  376. package/foundation/discovery/docs-discovery.mjs +126 -60
  377. package/foundation/discovery/entry-name-files.d.mts +106 -0
  378. package/foundation/discovery/entry-name-files.mjs +354 -0
  379. package/foundation/discovery/hook-discovery.d.mts +18 -2
  380. package/foundation/discovery/hook-discovery.mjs +93 -42
  381. package/foundation/discovery/icon-definition-discovery.mjs +2 -1
  382. package/foundation/discovery/icon-set-checks.mjs +2 -1
  383. package/foundation/discovery/icon-set-discovery.mjs +2 -1
  384. package/foundation/discovery/integration-component-views.d.mts +15 -0
  385. package/foundation/discovery/integration-component-views.mjs +91 -0
  386. package/foundation/discovery/integration-doc-files.mjs +2 -1
  387. package/foundation/discovery/module-exports.d.mts +26 -1
  388. package/foundation/discovery/module-exports.mjs +114 -40
  389. package/foundation/discovery/name-roots.d.mts +38 -0
  390. package/foundation/discovery/name-roots.mjs +108 -0
  391. package/foundation/discovery/next-routes.d.mts +48 -0
  392. package/foundation/discovery/next-routes.mjs +181 -0
  393. package/foundation/discovery/package-exports.d.mts +10 -0
  394. package/foundation/discovery/package-exports.mjs +56 -3
  395. package/foundation/discovery/prop-drift.mjs +9 -9
  396. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  397. package/foundation/discovery/runner-allowlist.mjs +2 -0
  398. package/foundation/discovery/stored-component-list.d.mts +43 -0
  399. package/foundation/discovery/stored-component-list.mjs +90 -0
  400. package/foundation/discovery/stored-search-catalog.d.mts +115 -0
  401. package/foundation/discovery/stored-search-catalog.mjs +297 -0
  402. package/foundation/discovery/stored-self-audit.d.mts +26 -10
  403. package/foundation/discovery/stored-self-audit.mjs +40 -18
  404. package/foundation/discovery/template-adapter.d.mts +49 -29
  405. package/foundation/discovery/template-adapter.mjs +89 -99
  406. package/foundation/discovery/template-destination.d.mts +28 -0
  407. package/foundation/discovery/template-destination.mjs +104 -0
  408. package/foundation/discovery/template-icons.mjs +2 -1
  409. package/foundation/discovery/template-ids.d.mts +69 -0
  410. package/foundation/discovery/template-ids.mjs +199 -0
  411. package/foundation/discovery/theme-discovery.d.mts +12 -0
  412. package/foundation/discovery/theme-discovery.mjs +34 -4
  413. package/foundation/discovery/theme-imports.d.mts +24 -0
  414. package/foundation/discovery/theme-imports.mjs +61 -4
  415. package/foundation/discovery/theming-targets.d.mts +13 -5
  416. package/foundation/discovery/theming-targets.mjs +41 -47
  417. package/foundation/doc-compiler/generated-levels.d.mts +43 -0
  418. package/foundation/doc-compiler/generated-levels.mjs +72 -0
  419. package/foundation/doc-compiler/import.mjs +7 -1
  420. package/foundation/doc-compiler/inputs.mjs +3 -2
  421. package/foundation/doc-compiler/literal-doc.d.mts +12 -0
  422. package/foundation/doc-compiler/literal-doc.mjs +322 -0
  423. package/foundation/doc-compiler/parse-readable.mjs +4 -1
  424. package/foundation/doc-compiler/stored-docs.d.mts +29 -0
  425. package/foundation/doc-compiler/stored-docs.mjs +63 -1
  426. package/foundation/doc-compiler/tree.d.mts +4 -84
  427. package/foundation/doc-compiler/tree.mjs +4 -62
  428. package/foundation/env/semver.mjs +3 -1
  429. package/foundation/fonts/font-stylesheet.d.mts +46 -0
  430. package/foundation/fonts/font-stylesheet.mjs +173 -0
  431. package/foundation/fs/cache-eviction.d.mts +21 -0
  432. package/foundation/fs/cache-eviction.mjs +73 -0
  433. package/foundation/fs/exact-codec.d.mts +12 -2
  434. package/foundation/fs/exact-codec.mjs +23 -6
  435. package/foundation/fs/file-protection.mjs +16 -5
  436. package/foundation/fs/gather-cache.d.mts +94 -4
  437. package/foundation/fs/gather-cache.mjs +671 -106
  438. package/foundation/fs/glob.d.mts +16 -0
  439. package/foundation/fs/glob.mjs +105 -0
  440. package/foundation/fs/jiti-cache.d.mts +19 -1
  441. package/foundation/fs/jiti-cache.mjs +130 -6
  442. package/foundation/fs/kept-tree.d.mts +80 -0
  443. package/foundation/fs/kept-tree.mjs +240 -0
  444. package/foundation/fs/listing-cache.d.mts +7 -0
  445. package/foundation/fs/listing-cache.mjs +10 -0
  446. package/foundation/fs/module-loader.d.mts +24 -2
  447. package/foundation/fs/module-loader.mjs +94 -21
  448. package/foundation/fs/path-safety.d.mts +11 -2
  449. package/foundation/fs/path-safety.mjs +108 -18
  450. package/foundation/fs/paths.d.mts +18 -0
  451. package/foundation/fs/paths.mjs +15 -2
  452. package/foundation/fs/read-record.d.mts +56 -7
  453. package/foundation/fs/read-record.mjs +280 -56
  454. package/foundation/fs/regular-file.d.mts +29 -0
  455. package/foundation/fs/regular-file.mjs +77 -0
  456. package/foundation/fs/stop-cleanup.d.mts +12 -0
  457. package/foundation/fs/stop-cleanup.mjs +66 -0
  458. package/foundation/identity/provider-identity.d.mts +6 -0
  459. package/foundation/identity/provider-identity.mjs +10 -1
  460. package/foundation/integrations/contribution-inventory.mjs +4 -3
  461. package/foundation/integrations/example-code.d.mts +63 -0
  462. package/foundation/integrations/example-code.mjs +416 -0
  463. package/foundation/integrations/integrations.d.mts +23 -1
  464. package/foundation/integrations/integrations.mjs +18 -1
  465. package/foundation/integrations/pack-state.d.mts +75 -0
  466. package/foundation/integrations/pack-state.mjs +314 -0
  467. package/foundation/integrations/public-imports.d.mts +9 -0
  468. package/foundation/integrations/public-imports.mjs +3 -2
  469. package/foundation/integrations/shipped-imports.d.mts +122 -0
  470. package/foundation/integrations/shipped-imports.mjs +497 -0
  471. package/foundation/integrations/validate-contributions.d.mts +0 -17
  472. package/foundation/integrations/validate-contributions.mjs +59 -333
  473. package/foundation/render/assets.mjs +52 -7
  474. package/foundation/render/charts.d.mts +78 -27
  475. package/foundation/render/charts.mjs +266 -90
  476. package/foundation/render/embedded-files.d.mts +6 -0
  477. package/foundation/render/embedded-files.mjs +25 -5
  478. package/foundation/render/embedded-imports.d.mts +70 -7
  479. package/foundation/render/embedded-imports.mjs +132 -41
  480. package/foundation/render/file-header.d.mts +66 -0
  481. package/foundation/render/file-header.mjs +118 -0
  482. package/foundation/render/host-answer.d.mts +18 -0
  483. package/foundation/render/host-answer.mjs +46 -0
  484. package/foundation/render/host-exit.d.mts +1 -0
  485. package/foundation/render/host-exit.mjs +6 -1
  486. package/foundation/render/html-reader.d.mts +55 -2
  487. package/foundation/render/html-reader.mjs +145 -26
  488. package/foundation/render/layers.d.mts +30 -0
  489. package/foundation/render/layers.mjs +158 -0
  490. package/foundation/render/markup-edits.d.mts +57 -0
  491. package/foundation/render/markup-edits.mjs +182 -0
  492. package/foundation/render/offline.d.mts +32 -0
  493. package/foundation/render/offline.mjs +56 -0
  494. package/foundation/render/page-host.mjs +29 -12
  495. package/foundation/render/page-worker.mjs +354 -21
  496. package/foundation/render/picture-chrome.d.mts +4 -0
  497. package/foundation/render/picture-chrome.mjs +192 -0
  498. package/foundation/render/picture-playwright.d.mts +4 -0
  499. package/foundation/render/picture-playwright.mjs +46 -0
  500. package/foundation/render/rebuild.mjs +2 -1
  501. package/foundation/render/render-page.d.mts +79 -5
  502. package/foundation/render/render-page.mjs +735 -109
  503. package/foundation/render/source-block.d.mts +85 -6
  504. package/foundation/render/source-block.mjs +211 -20
  505. package/foundation/render/ts-paths.d.mts +69 -6
  506. package/foundation/render/ts-paths.mjs +326 -40
  507. package/foundation/response/error-codes.d.mts +3 -1
  508. package/foundation/response/error-codes.d.ts +1 -0
  509. package/foundation/response/error-codes.doc.mjs +12 -1
  510. package/foundation/response/error-codes.mjs +11 -1
  511. package/foundation/response/response-types.doc.mjs +6 -6
  512. package/foundation/suggest/name-index.d.mts +148 -0
  513. package/foundation/suggest/name-index.mjs +317 -0
  514. package/foundation/suggest/other-command.d.mts +140 -0
  515. package/foundation/suggest/other-command.mjs +756 -0
  516. package/foundation/text/compare-text.d.mts +14 -0
  517. package/foundation/text/compare-text.mjs +68 -0
  518. package/foundation/text/css-escape.d.mts +18 -0
  519. package/foundation/text/css-escape.mjs +35 -0
  520. package/foundation/text/entry-names.d.mts +14 -0
  521. package/foundation/text/entry-names.mjs +14 -0
  522. package/foundation/text/string-utils.d.mts +46 -6
  523. package/foundation/text/string-utils.mjs +118 -20
  524. package/foundation/text/suggest-order.d.mts +47 -4
  525. package/foundation/text/suggest-order.mjs +174 -5
  526. package/foundation/xle/browser.d.mts +2 -2
  527. package/foundation/xle/expand.mjs +2 -1
  528. package/host/index.mjs +8 -6
  529. package/package.json +7 -6
@@ -26,8 +26,17 @@ export function themeFiles(cwd: string, slug: string): {
26
26
  * files (what `git rm -r` or a branch switch leaves). A path that is not a
27
27
  * folder, or one that does not read, is not empty.
28
28
  * @param {string} dir
29
+ * @returns {boolean}
29
30
  */
30
31
  export function folderIsEmpty(dir: string): boolean;
32
+ /**
33
+ * Whether a dial takes a value of its own kind beside its named words (a
34
+ * size, a color, a family, a number: its list of values holds a `<…>`), so
35
+ * a value of several words can be one value of it (`Open Sans`, `dark
36
+ * blue`). A dial of named words only (mode, spacing) takes one word.
37
+ * @param {string} dial
38
+ */
39
+ export function dialTakesText(dial: string): boolean;
31
40
  /**
32
41
  * Whether a value fits what a dial takes, read from the dial's own list of
33
42
  * values: a named rung in any case, or a value of the kind it names (a size,
@@ -52,15 +61,15 @@ export function recordWritten(cwd: string, slug: string, files: string[]): void;
52
61
  */
53
62
  export function editorWrote(cwd: string, slug: string, file: string): boolean;
54
63
  /**
55
- * Adopt a picture an older editor took (before it recorded or stamped its
56
- * pictures) into the record: only while the theme has no record at all, the
57
- * name is one the editor writes, and the picture is the editor's 1280-pixel
58
- * wide window. Returns whether it was adopted.
64
+ * Whether the pictures record names this file and it is unchanged since the
65
+ * editor wrote it. Only such a file is ever deleted: a stamp alone is not
66
+ * enough, since a byte copy of a picture (preview-before.png) carries the
67
+ * same stamp and is the person's.
59
68
  * @param {string} cwd
60
69
  * @param {string} slug
61
70
  * @param {string} file
62
71
  */
63
- export function adoptOlderPicture(cwd: string, slug: string, file: string): boolean;
72
+ export function editorRecorded(cwd: string, slug: string, file: string): boolean;
64
73
  /**
65
74
  * A name `new` takes, for a suggestion: `name` itself when it is valid, not a
66
75
  * built-in theme and its folder is free; `my-<name>` for a built-in theme's
@@ -84,6 +93,12 @@ export function freeThemeName(cwd: string, name: string): string;
84
93
  * @returns {string | null}
85
94
  */
86
95
  export function unreadableReason(file: string): string | null;
96
+ /**
97
+ * The names of a theme's app copy files.
98
+ * @param {string} slug
99
+ * @returns {Set<string>}
100
+ */
101
+ export function appCopyNames(slug: string): Set<string>;
87
102
  /**
88
103
  * Refuse, by name, when a file of the theme is a folder or cannot be read:
89
104
  * every command reads them, and none should crash on one. The fix is to
@@ -116,16 +131,35 @@ export function editedThemes(cwd: string, order?: "name" | "changed"): string[];
116
131
  * @param {number} [n]
117
132
  */
118
133
  export function nearest(x: string, list: Iterable<string>, n?: number): string[];
134
+ /**
135
+ * The readings of a typo among `list`: every name at the smallest edit
136
+ * distance, within the one typo limit (nearest's rule). One name is the
137
+ * reading; two or more equally near (`tightr`: tight and tighter) are each
138
+ * a reading, and none of them is chosen over the others.
139
+ * @param {string} x
140
+ * @param {Iterable<string>} list
141
+ * @returns {string[]}
142
+ */
143
+ export function closestOf(x: string, list: Iterable<string>): string[];
144
+ /**
145
+ * Whether typed words negate what they name (`not round`, `no caps`,
146
+ * `anything but blue`, `unbold`, `non-bold`, `rounded-none`).
147
+ * @param {string} x
148
+ */
149
+ export function negates(x: string): boolean;
119
150
  /**
120
151
  * A refusal: nothing was changed, and the suggestions lead with the command
121
152
  * that does what the person wanted.
122
153
  * @param {string} code
123
154
  * @param {string} message
124
- * @param {{run?: string[], didYouMean?: string[], fix?: string, also?: string[]}} [extra]
155
+ * @param {{run?: Array<string | {name: string, reason: string}>, didYouMean?: string[], fix?: string, also?: string[]}} [extra]
125
156
  * @returns {never}
126
157
  */
127
158
  export function refuse(code: string, message: string, extra?: {
128
- run?: string[];
159
+ run?: Array<string | {
160
+ name: string;
161
+ reason: string;
162
+ }>;
129
163
  didYouMean?: string[];
130
164
  fix?: string;
131
165
  also?: string[];
@@ -147,6 +181,40 @@ export function unlabeledThemeName(s: unknown): string;
147
181
  * @returns {string}
148
182
  */
149
183
  export function typedThemeName(s: unknown): string;
184
+ /**
185
+ * The theme names a name typed the way the app shows it may mean, most
186
+ * likely first: a path with doubled slashes or `../` (`themes//t`), a file
187
+ * name with or without its folder (`brand.theme.ts`, `tTheme.ts`), the app
188
+ * copy's export (`tTheme`), camelCase (`brandDark`) and spaces
189
+ * (`Brand Dark`) each read as dashes. The caller picks the first that
190
+ * exists, else the first.
191
+ * @param {string} s
192
+ * @returns {string[]}
193
+ */
194
+ export function themeNameReadings(s: string): string[];
195
+ /**
196
+ * A vibrancy written as set reads typed input: a share of one (0.5) or a
197
+ * percent (50%) is that much of the 0-100 scale, as a whole number. Any
198
+ * other dial's value, or a vibrancy that is no such number, comes back as
199
+ * it was.
200
+ * @param {string} dial
201
+ * @param {string} v
202
+ * @returns {string}
203
+ */
204
+ export function vibrancyMeant(dial: string, v: string): string;
205
+ /**
206
+ * The mode and base a damaged theme file meant, read the way typed input
207
+ * is: other letters, stray spaces, `_` or a space for a dash (`Dark-Only`,
208
+ * ` Neutral`), and a base written as its package name
209
+ * (`@astryxdesign/theme-neutral`). Each is the cleaned text even when it is
210
+ * no value the editor takes; the caller checks it.
211
+ * @param {any} data
212
+ * @returns {{mode: string, like: string}}
213
+ */
214
+ export function fieldsMeant(data: any): {
215
+ mode: string;
216
+ like: string;
217
+ };
150
218
  /**
151
219
  * The settings of a theme, or a refusal naming the command that makes it.
152
220
  * @param {string} cwd
@@ -157,6 +225,29 @@ export function typedThemeName(s: unknown): string;
157
225
  * @returns {ThemeData}
158
226
  */
159
227
  export function loadTheme(cwd: string, slug: string, skip?: string | Partial<Setting>): ThemeData;
228
+ /**
229
+ * A command that builds on a built-in theme, as it runs here: after the
230
+ * line that installs that theme's package when the project does not have
231
+ * it, so the first line offered always works.
232
+ * @param {string} cwd
233
+ * @param {string} base a built-in theme
234
+ * @param {string} line the command on that base
235
+ * @returns {string[]}
236
+ */
237
+ export function onBuiltIn(cwd: string, base: string, line: string): string[];
238
+ /**
239
+ * {@link onBuiltIn} with what each line is for: the install first, then
240
+ * the line, which works once it is installed (never offered as working
241
+ * now).
242
+ * @param {string} cwd
243
+ * @param {string} base
244
+ * @param {string} line
245
+ * @returns {Array<{name: string, reason: string}>}
246
+ */
247
+ export function onBuiltInSteps(cwd: string, base: string, line: string): Array<{
248
+ name: string;
249
+ reason: string;
250
+ }>;
160
251
  /**
161
252
  * What is wrong with settings data, or null: its shape, and each value with
162
253
  * the same rules `set` checks it by (without the installed Core), so a value
@@ -167,6 +258,53 @@ export function loadTheme(cwd: string, slug: string, skip?: string | Partial<Set
167
258
  * @returns {string | null}
168
259
  */
169
260
  export function settingsProblem(data: any, skip?: string | Partial<Setting>): string | null;
261
+ /**
262
+ * The built-in base the editor last built a theme on, read from the
263
+ * generated module's header (`// Built on @astryxdesign/theme-neutral …`),
264
+ * else from the newest undo step, or null when neither can be read. What a damaged base in
265
+ * the settings file is put back to, and what a theme made again keeps.
266
+ * @param {string} cwd
267
+ * @param {string} slug
268
+ * @returns {string | null}
269
+ */
270
+ export function builtOnBase(cwd: string, slug: string): string | null;
271
+ /**
272
+ * The `new` that makes a theme again in place, on the base it was built on
273
+ * as far as can still be read: the settings file's base (in any case), else
274
+ * the base the generated module was built on. With none, it says the theme
275
+ * starts on no base.
276
+ * @param {string} cwd
277
+ * @param {string} slug
278
+ * @returns {{lines: string[], base: string | null}}
279
+ */
280
+ export function remakeLines(cwd: string, slug: string): {
281
+ lines: string[];
282
+ base: string | null;
283
+ };
284
+ /**
285
+ * A dial's own word typed in any case (ROOMY, MORE, Both, NONE): the word,
286
+ * or null when the value is no word of that dial. The one case rule for
287
+ * every dial, typed or saved. On the font dial several words are a family
288
+ * list, whose names keep their letters; one word is the preset.
289
+ * @param {string} thing
290
+ * @param {string} value
291
+ * @returns {string | null}
292
+ */
293
+ export function dialWordOf(thing: string, value: string): string | null;
294
+ /**
295
+ * What loading read differently from the file in the theme's entries (a
296
+ * mode or source in other letters, a missing source): one note each.
297
+ * @param {object} data the theme as {@link loadTheme} returned it
298
+ * @returns {string[]}
299
+ */
300
+ export function entryNotes(data: object): string[];
301
+ /**
302
+ * Which part of an entry means nothing after reading: its source, mode or
303
+ * `only`, or null.
304
+ * @param {any} s
305
+ * @returns {'mode' | 'source' | 'only' | null}
306
+ */
307
+ export function entryDamage(s: any): "mode" | "source" | "only" | null;
170
308
  /**
171
309
  * Every setting whose only problem is its value or scope, each with the
172
310
  * command that removes it.
@@ -174,11 +312,28 @@ export function settingsProblem(data: any, skip?: string | Partial<Setting>): st
174
312
  * @returns {Setting[]}
175
313
  */
176
314
  export function badSettings(data: any): Setting[];
315
+ /**
316
+ * What is wrong with one saved setting among the others, or null: its
317
+ * value (valueProblem), or a rule set checks against the theme's other
318
+ * settings: a vibrancy saturates the colors the color dials make, so with
319
+ * no color dial set it does nothing, and set refuses it.
320
+ * @param {any} s
321
+ * @param {any} data
322
+ * @returns {string | null}
323
+ */
324
+ export function entryProblem(s: any, data: any): string | null;
177
325
  /**
178
326
  * The words that name a setting for `undo`.
179
327
  * @param {import('./_settings.mjs').Setting} x
180
328
  */
181
329
  export function undoArgs(x: import("./_settings.mjs").Setting): string;
330
+ /**
331
+ * The words of a `set` that gives a setting's scope a value: set reads a
332
+ * headings half from its word, so no half is named.
333
+ * @param {import('./_settings.mjs').Setting} x
334
+ * @param {string} value
335
+ */
336
+ export function setArgs(x: import("./_settings.mjs").Setting, value: string): string;
182
337
  /**
183
338
  * The first setting whose only problem is its value (made under looser
184
339
  * rules): `undo <theme> <undoArgs>` removes it.
@@ -202,6 +357,33 @@ export function withoutBadValues(data: ThemeData): {
202
357
  * @returns {string | null}
203
358
  */
204
359
  export function valueProblem(s: any): string | null;
360
+ /**
361
+ * One entry of the top-level `tokens` map in a theme's own source, as
362
+ * written: its token (null for a computed key no read of the file can
363
+ * resolve), the key as typed, the line that sets it, and its value's shape.
364
+ * A `chain` entry is another theme the file defines (`theme`, its name):
365
+ * its call, or a token its literal tokens map sets. A `scope` entry names
366
+ * where a scope (`components`, `onDark`, `onLight`, `adaptations`,
367
+ * `localTokens`) starts; a `scoped` entry is a token one sets, with its
368
+ * scope path (`components.button.base`). A `duplicate` entry names a
369
+ * second `tokens` key (with every line); a
370
+ * `typography` entry is one typography field (its dotted key and value;
371
+ * `block` when it holds fields); a `field` entry is a field the theme
372
+ * gives defineTheme; a `key` entry is a block's own key in a scope (a
373
+ * style key, a pseudo-class, a surface's tokens), with its scope path;
374
+ * an `unresolved` entry says the map holds something only a build reads.
375
+ * A chain theme defined in another file carries that `file`.
376
+ * @typedef {{token: string | null, key: string, line: number | null, kind: 'text' | 'number' | 'pair' | 'object' | 'other' | 'duplicate' | 'typography' | 'unresolved' | 'scope' | 'scoped' | 'chain' | 'field' | 'key', scope?: string, theme?: string, value?: any, halves?: Array<string | number | undefined>, lines?: Array<number | null>, file?: string, overridden?: boolean, expression?: boolean, notToken?: boolean, block?: boolean}} OwnTokenEntry
377
+ */
378
+ /**
379
+ * The entries of the top-level `tokens` map in a theme's own source, read
380
+ * from its syntax tree, each with the line that sets it. Entries read from
381
+ * the file the source re-exports its theme from name that file.
382
+ * @param {string} cwd
383
+ * @param {string} slug
384
+ * @returns {OwnTokenEntry[]}
385
+ */
386
+ export function ownTokenEntries(cwd: string, slug: string): OwnTokenEntry[];
205
387
  /**
206
388
  * The tokens a base theme's own component rules for a part read through
207
389
  * var() (neutral's progress-bar reads --color-border-emphasized), from its
@@ -272,6 +454,15 @@ export function describe(s: Setting): string;
272
454
  * @returns {string[]}
273
455
  */
274
456
  export function partsOf(ctx: Ctx, s: Pick<Setting, "on" | "only" | "thing">): string[];
457
+ /**
458
+ * A corners value in the plain form the editor saves, typed or saved: a
459
+ * rung in any case is that rung; a size in px or rem, any way a CSS number
460
+ * is written, is that many px (a rem is 16px; 1000px and more is pill).
461
+ * Null for any other value.
462
+ * @param {string} v
463
+ * @returns {string | null}
464
+ */
465
+ export function cornersPlain(v: string): string | null;
275
466
  /**
276
467
  * A length in pixels: px as given, rem and em at 16px; null for anything
277
468
  * else (a percentage, calc(), a word).
@@ -279,6 +470,14 @@ export function partsOf(ctx: Ctx, s: Pick<Setting, "on" | "only" | "thing">): st
279
470
  * @returns {number | null}
280
471
  */
281
472
  export function lengthPx(v: string): number | null;
473
+ /**
474
+ * The base theme's body text size in px, read back from its built base
475
+ * size (14 when it writes none).
476
+ * @param {{light: Record<string, string>}} base
477
+ */
478
+ export function baseTextPx(base: {
479
+ light: Record<string, string>;
480
+ }): number;
282
481
  /**
283
482
  * The family and fallbacks a font value means: a preset, an open font, a
284
483
  * whole stack with commas, or one family name.
@@ -313,6 +512,14 @@ export function cssFamily(name: string, spaced?: boolean): string;
313
512
  * @param {string} slug
314
513
  */
315
514
  export function sourceChangedReason(slug: string): string;
515
+ /**
516
+ * The tokens the theme's last build sets for touch screens (in its rules
517
+ * for a coarse pointer), each with the last value it is given there.
518
+ * @param {string} cwd
519
+ * @param {string} slug
520
+ * @returns {Map<string, string>}
521
+ */
522
+ export function builtTouchTokens(cwd: string, slug: string): Map<string, string>;
316
523
  /**
317
524
  * Record in an editor theme's generated settings that they were built with
318
525
  * its own source as it is now, after `compile` built that source (the
@@ -342,6 +549,27 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
342
549
  stop: number;
343
550
  alpha?: string;
344
551
  }>>;
552
+ /**
553
+ * A size in px: px, rem (16px each), or a calc() of those added and
554
+ * subtracted; null for anything else.
555
+ * @param {string} v
556
+ * @param {Record<string, string>} [vars] values for the tokens a var() may name
557
+ * @returns {number | null}
558
+ */
559
+ export function sizePx(v: string, vars?: Record<string, string>): number | null;
560
+ /**
561
+ * Spacing steps scaled with the spacing dial, kept in order around the
562
+ * steps the theme keeps exact: each the plain scaled value unless it would
563
+ * meet or pass a kept one; those are spread evenly between the kept one and
564
+ * the nearest step that keeps its place. A step with no room below a kept
565
+ * one takes the value of the one below it.
566
+ * @param {Array<[string, number]>} steps token name and the base value, in px
567
+ * @param {number} f the rung's factor
568
+ * @param {Record<string, number>} kept exact steps the theme keeps, in px
569
+ * @param {string[]} [noRoom] filled with the steps left no room
570
+ * @returns {Array<[string, number]>} every step's new value in px, kept ones as kept
571
+ */
572
+ export function spacingSteps(steps: Array<[string, number]>, f: number, kept: Record<string, number>, noRoom?: string[]): Array<[string, number]>;
345
573
  /**
346
574
  * Control heights scaled with the spacing dial (a denser theme has shorter
347
575
  * controls), each kept distinct and in order: smallest to largest, a
@@ -351,9 +579,13 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
351
579
  * scaled above it.
352
580
  * @param {Array<[string, string]>} sizes token name and the theme's value
353
581
  * @param {number} f the spacing rung's factor
582
+ * @param {Record<string, number>} [kept] exact sizes the theme keeps, in px,
583
+ * which the others stay in order around
584
+ * @param {string[]} [noRoom] filled with the sizes left no room between
585
+ * two kept ones (each then equals the one below it)
354
586
  * @returns {Array<[string, string]>} the tokens it writes, in px
355
587
  */
356
- export function controlSizes(sizes: Array<[string, string]>, f: number): Array<[string, string]>;
588
+ export function controlSizes(sizes: Array<[string, string]>, f: number, kept?: Record<string, number>, noRoom?: string[]): Array<[string, string]>;
357
589
  /**
358
590
  * The settings, as a `defineTheme` object.
359
591
  * @param {Ctx} ctx
@@ -365,6 +597,17 @@ export function compileTheme(ctx: Ctx, data: ThemeData, base: {
365
597
  light: Record<string, string>;
366
598
  dark: Record<string, string>;
367
599
  }): any;
600
+ /**
601
+ * A background shorthand split into its image layers and the color its
602
+ * last layer may carry (the color under every image): a color word beside
603
+ * the last image, or a last layer that is a color alone.
604
+ * @param {string} value
605
+ * @returns {{images: string, color: string | null}}
606
+ */
607
+ export function backgroundColorLayer(value: string): {
608
+ images: string;
609
+ color: string | null;
610
+ };
368
611
  /**
369
612
  * Settings whose effect a later or stronger setting hides, with why: `type`
370
613
  * loses heading weight and tracking to `headings`.
@@ -379,23 +622,32 @@ export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting,
379
622
  * {font-weight}`. Find those rules in the built stylesheet.
380
623
  * @param {string} cssText
381
624
  * @param {any} theme
382
- * @returns {Array<{target: string, key: string, prop: string, value: string}>}
625
+ * @returns {Array<{target: string, key: string, prop: string, value: string, state?: string}>}
383
626
  */
384
627
  export function findOverrides(cssText: string, theme: any): Array<{
385
628
  target: string;
386
629
  key: string;
387
630
  prop: string;
388
631
  value: string;
632
+ state?: string;
389
633
  }>;
390
634
  /**
391
- * Why `<slug>.theme.ts` cannot carry the settings, or null: it must import
392
- * `./<slug>.settings`, extend `<camel>Settings` and keep the name, or no
393
- * setting takes effect.
635
+ * Why a theme's source cannot carry its settings, with the step that puts
636
+ * it right; null when it carries them. The theme is the export a build of
637
+ * the source reads, loaded as the build loads it: it must be named for the
638
+ * theme, and the settings module's own export must be in the chain of
639
+ * themes it extends (after every spread and repeated key), the very object,
640
+ * not a theme named like it. Null for a source that does not parse (its
641
+ * parse error is its own finding), and for one that imports the settings
642
+ * but does not load (outputsDrift and the build report that).
394
643
  * @param {string} cwd
395
644
  * @param {string} slug
396
- * @returns {string | null}
645
+ * @returns {Promise<{problem: string, fix: string} | null>}
397
646
  */
398
- export function themeSourceProblem(cwd: string, slug: string): string | null;
647
+ export function themeSourceProblem(cwd: string, slug: string): Promise<{
648
+ problem: string;
649
+ fix: string;
650
+ } | null>;
399
651
  /**
400
652
  * Why the person's own theme source does not parse (its line and the
401
653
  * parser's message), or null when it parses or is not there.
@@ -418,24 +670,44 @@ export function refuseThemeParse(cwd: string, slug: string): void;
418
670
  * @param {string} cwd
419
671
  * @param {string} slug
420
672
  */
421
- export function refuseThemeSource(cwd: string, slug: string): void;
673
+ export function refuseThemeSource(cwd: string, slug: string): Promise<void>;
674
+ /**
675
+ * The refusal for a theme source that cannot carry the settings (it no
676
+ * longer imports or extends them, or names another theme), naming the
677
+ * lines that put it back; null when it carries them. Every command that
678
+ * builds the theme refuses with it.
679
+ * @param {string} cwd
680
+ * @param {string} slug
681
+ * @returns {Promise<AstryxError | null>}
682
+ */
683
+ export function themeSourceRefusal(cwd: string, slug: string): Promise<AstryxError | null>;
422
684
  /**
423
- * The tokens that are not colors the theme as it builds now gives a
424
- * [light, dark] pair (light-dark()), however its file writes them (a
425
- * constant, `as const`, `satisfies`, a spread from an imported module):
426
- * read from a build made into the project's cache folder, never beside the
427
- * theme. Empty when it does not build there (the build names that itself).
685
+ * The input the theme's own source gives `defineTheme()`, evaluated as a
686
+ * build evaluates it, with the theme Core made of it (or Core's error when
687
+ * it refuses the input); null when the source does not load.
428
688
  * @param {Ctx} ctx
429
689
  * @param {string} slug
430
- * @returns {Promise<string[]>}
690
+ * @param {string | null} like the base theme, whose built tokens are `base`
691
+ * @returns {Promise<{input: any, theme: any, error: Error | null, chain: any[], base: Map<string, string | null>} | null>}
431
692
  */
432
- export function builtPairs(ctx: Ctx, slug: string): Promise<string[]>;
693
+ export function ownThemeInput(ctx: Ctx, slug: string, like: string | null): Promise<{
694
+ input: any;
695
+ theme: any;
696
+ error: Error | null;
697
+ chain: any[];
698
+ base: Map<string, string | null>;
699
+ } | null>;
433
700
  /**
434
701
  * The refusal of a [light, dark] pair on tokens that are not colors.
435
702
  * @param {string} slug
436
703
  * @param {string[]} names
437
704
  */
438
705
  export function ownPairMessage(slug: string, names: string[]): string;
706
+ /**
707
+ * Set the check of a theme's own token values run before every build.
708
+ * @param {((ctx: Ctx, slug: string, data: ThemeData) => Promise<void>) | null} fn
709
+ */
710
+ export function setOwnTokenCheck(fn: ((ctx: Ctx, slug: string, data: ThemeData) => Promise<void>) | null): void;
439
711
  /**
440
712
  * Set what runs after every build of a theme.
441
713
  * @param {((ctx: Ctx, slug: string, data: ThemeData) => void) | null} fn
@@ -453,13 +725,23 @@ export function holdAfterBuild(ctx: Ctx): void;
453
725
  * @param {Ctx} ctx
454
726
  * @param {string} slug
455
727
  * @param {ThemeData} data
456
- * @returns {Promise<{warnings: string[], lifted: string[], notes: string[]}>} `notes`: what the color config kept or replaced of a hand edit
728
+ * @returns {Promise<{warnings: string[], lifted: string[], notes: string[], removedPictures: string[]}>} `notes`: what the color config kept or replaced of a hand edit; `removedPictures`: the editor's pictures of the look before, removed
457
729
  */
458
730
  export function buildTheme(ctx: Ctx, slug: string, data: ThemeData): Promise<{
459
731
  warnings: string[];
460
732
  lifted: string[];
461
733
  notes: string[];
734
+ removedPictures: string[];
462
735
  }>;
736
+ /**
737
+ * The one color mode of a light-only or dark-only theme, from its settings,
738
+ * for the build to write into the built module (`colorModes`); null for a
739
+ * theme with both modes.
740
+ * @param {string} cwd
741
+ * @param {string} slug
742
+ * @returns {['light'] | ['dark'] | null}
743
+ */
744
+ export function buildColorModes(cwd: string, slug: string): ["light"] | ["dark"] | null;
463
745
  /**
464
746
  * Why the built outputs differ from what the theme builds now: one that is
465
747
  * missing or changed by hand, found the way `compile --check` finds it
@@ -479,22 +761,117 @@ export function resolvedTokens(ctx: Ctx, slug: string): Promise<{
479
761
  light: Record<string, string>;
480
762
  dark: Record<string, string>;
481
763
  }>;
764
+ /**
765
+ * A value as a message names it, whatever it is: text in quotes, a number,
766
+ * a BigInt with its `n`, a symbol, a function, an array or an object as
767
+ * JSON where it has one. Never throws.
768
+ * @param {unknown} value
769
+ * @returns {string}
770
+ */
771
+ export function describeValue(value: unknown): string;
772
+ /**
773
+ * Why a token value is not one, with a value of the token's own type to
774
+ * write instead (a size in px, a weight as a number in quotes), or none.
775
+ * @param {Ctx} ctx
776
+ * @param {string} slug
777
+ * @param {[string, unknown, ('object' | 'pair' | 'unit' | 'value' | 'mode')?]} bad
778
+ */
779
+ export function nonTextMessage(ctx: Ctx, slug: string, [name, value, kind]: [string, unknown, ("object" | "pair" | "unit" | "value" | "mode")?]): string;
482
780
  /**
483
781
  * Contrast problems this theme caused: text below 4.5:1 that was not as low
484
782
  * in the base theme. A part's own color or background setting, or a token
485
- * set on that part, counts for that part.
783
+ * set on that part or on the part the text sits on, counts for that part.
784
+ * Each comes with the set line that fixes it, when one color does: the text
785
+ * token set where the text sits, for its mode, to the black or white that
786
+ * reads on what it sits on.
486
787
  * @param {Ctx} ctx
487
788
  * @param {ThemeData} data
488
789
  * @param {{light: Record<string, string>, dark: Record<string, string>}} res
489
- * @returns {Promise<string[]>}
790
+ * @returns {Promise<ThemeProblem[]>}
490
791
  */
491
792
  export function contrastProblems(ctx: Ctx, data: ThemeData, res: {
492
793
  light: Record<string, string>;
493
794
  dark: Record<string, string>;
494
- }): Promise<string[]>;
795
+ }): Promise<ThemeProblem[]>;
796
+ /**
797
+ * A settings file's or an undo step's text as JSON, a byte-order mark
798
+ * aside; undefined when there is no text or it does not parse. Every reader
799
+ * of settings text reads it here.
800
+ * @param {string | null | undefined} text
801
+ * @returns {any}
802
+ */
803
+ export function settingsJson(text: string | null | undefined): any;
804
+ /**
805
+ * Whether settings data has its shape and every entry is an object with a
806
+ * thing name: what a reader may go through entry by entry. Any other entry
807
+ * (null, a number, text) is damage the file check names.
808
+ * @param {any} data
809
+ */
810
+ export function entriesReadable(data: any): any;
811
+ /**
812
+ * The lines that set a damaged saved mode or base again: the one repair
813
+ * every command gives that damage (show, compile and each change). The
814
+ * value it reads as when there is one, else each value it can be (each
815
+ * mode; the base the theme was built on, when its module or history still
816
+ * says it, else each installed base), never a default that would drop what
817
+ * the file held. A built-in base not installed comes after its install.
818
+ * @param {any} data
819
+ * @param {string} cwd
820
+ * @param {string} slug
821
+ * @param {'mode' | 'base'} field
822
+ * @returns {{values: string[], uninstalled: string | null, run: Array<{name: string, reason: string}>}}
823
+ */
824
+ export function savedFieldRepairs(data: any, cwd: string, slug: string, field: "mode" | "base"): {
825
+ values: string[];
826
+ uninstalled: string | null;
827
+ run: Array<{
828
+ name: string;
829
+ reason: string;
830
+ }>;
831
+ };
832
+ /**
833
+ * Read a damaged mode or base the way a change reads it, in place: one
834
+ * written in other letters, as a package name, as a mode word or with a
835
+ * typo (`Dark-Only`, `@astryxdesign/theme-neutral`, `light`, `neutrl`) is
836
+ * the value meant, as `set` reads it. Any other is refused for a change
837
+ * (slug given), with the line that sets it; read for an undo step, it goes
838
+ * back to its default. `like: "none"` is no base. The field a command sets
839
+ * itself is left to that command.
840
+ * @param {any} data
841
+ * @param {string} cwd
842
+ * @param {string} [fixing] `mode` or `base` when the command sets it
843
+ * @param {string} [slug] the theme a change is made to
844
+ * @returns {string[]} a note for each field read differently from the file
845
+ */
846
+ export function readFields(data: any, cwd: string, fixing?: string, slug?: string): string[];
847
+ /**
848
+ * Read settings data as a change reads it, in place: entry modes and
849
+ * sources in other words, and a damaged mode or base (see
850
+ * {@link readFields}). The settings file and every undo step are read
851
+ * through here.
852
+ * @param {any} data
853
+ * @param {string} cwd
854
+ * @param {string} [fixing] `mode` or `base` when the command sets it
855
+ * @returns {string[]} a note for each thing read differently from the text
856
+ */
857
+ export function readAsMeant(data: any, cwd: string, fixing?: string): string[];
495
858
  /**
496
- * Whether parsed settings have the shape the editor reads: an object with a
497
- * list of settings.
859
+ * Whether `new` makes a theme again over these settings, keeping the file
860
+ * aside: text that does not parse, or entries it cannot read (no thing, no
861
+ * value, no source). The one rule both `new` and the refusals that offer
862
+ * it read; any other damage is repaired by the lines its refusal names.
863
+ * @param {unknown} data the parsed file (undefined when it does not parse)
864
+ */
865
+ export function settingsRemade(data: unknown): boolean;
866
+ /**
867
+ * Whether every settings entry has the parts the editor reads (a thing, a
868
+ * value and a source); one without is damage `new` keeps aside.
869
+ * @param {any} data
870
+ */
871
+ export function settingsEntriesOk(data: any): any;
872
+ /**
873
+ * Whether settings data has the shape the editor reads: an object with a
874
+ * settings list.
498
875
  * @param {any} data
499
876
  */
500
877
  export function settingsShapeOk(data: any): boolean;
@@ -525,6 +902,46 @@ export function baseComponent(base: {
525
902
  * @returns {string | null}
526
903
  */
527
904
  export function focusStateOf(ctx: Ctx, part: string): string | null;
905
+ /**
906
+ * The radius token a part's corners follow when Core draws its corners one
907
+ * by one from that token by position (a button squares the joins inside a
908
+ * button group; a button group's outer corners are its end buttons'), or
909
+ * null. A radius for such a part is written as that
910
+ * token on the part, so every position keeps its own corner; a radius
911
+ * written on the part would override Core's per-corner rules.
912
+ * @param {Ctx} ctx
913
+ * @param {string} part
914
+ * @returns {string | null}
915
+ */
916
+ export function positionalCornerToken(ctx: Ctx, part: string): string | null;
917
+ /**
918
+ * The parts that draw a part's corners: the part itself, or, when Core gives
919
+ * it no radius of its own, the parts inside it that it has (a date-time
920
+ * input's date and time boxes).
921
+ * @param {Ctx} ctx
922
+ * @param {string} part
923
+ * @returns {string[]}
924
+ */
925
+ export function cornerParts(ctx: Ctx, part: string): string[];
926
+ /**
927
+ * The parts that take a part's padding: the part itself, or, when Core
928
+ * renders it as a box CSS draws no padding on (a table row) and gives it no
929
+ * other display, the parts inside it with padding of their own (its cells).
930
+ * @param {Ctx} ctx
931
+ * @param {string} part
932
+ * @returns {string[]}
933
+ */
934
+ export function paddedParts(ctx: Ctx, part: string): string[];
935
+ /**
936
+ * Whether a part is a radio's circle, as the part data records it: a part
937
+ * with a checked state, a square box of a fixed size, and corners at 50%
938
+ * that no token reaches, in it and in every part inside it (its dot). The
939
+ * circle marks a radio; it is no corner, so the corners dial leaves it.
940
+ * @param {any} C the part census
941
+ * @param {string} part
942
+ * @returns {boolean}
943
+ */
944
+ export function radioCircle(C: any, part: string): boolean;
528
945
  /**
529
946
  * The radius token a part's resting corners read. A part the census saw
530
947
  * closed (a menu, a popover) has none recorded: a container or menu reads
@@ -555,6 +972,21 @@ export function clearNewMarker(dir: string): void;
555
972
  * @returns {string}
556
973
  */
557
974
  export function stateKey(state: string, wrapsControl?: boolean): string;
975
+ /**
976
+ * The text color tokens Core's elements inside a part read for their own
977
+ * color (a top nav heading's title span reads --color-text-primary itself),
978
+ * so a color set on the part never reaches that text. Only the main and
979
+ * supporting text colors count: the disabled, placeholder and accent ones
980
+ * mark a state or a role, not the part's text. With `deep`, the parts inside
981
+ * it count too (a top nav's heading and items).
982
+ * @param {{MAP: Record<string, any>}} C
983
+ * @param {string} part
984
+ * @param {boolean} [deep]
985
+ * @returns {string[]}
986
+ */
987
+ export function innerTextTokens(C: {
988
+ MAP: Record<string, any>;
989
+ }, part: string, deep?: boolean): string[];
558
990
  /**
559
991
  * The component docs of a part: its own component's, and the one named like
560
992
  * the part (tab is Tab, under TabList), each with its name, for the ones the
@@ -604,6 +1036,19 @@ export function radiusAt(base: {
604
1036
  * editor's header).
605
1037
  * @param {string} file
606
1038
  */
1039
+ /**
1040
+ * Whether the editor made a theme's folder, though its settings may be
1041
+ * gone: a stopped `new` left its marker, or the folder holds what only the
1042
+ * editor writes (the generated settings module, an undo history, the theme
1043
+ * source with the header the editor wrote it with).
1044
+ * @param {string} cwd
1045
+ * @param {string} slug
1046
+ */
1047
+ export function editorMadeFolder(cwd: string, slug: string): boolean;
1048
+ /**
1049
+ * Whether a file carries the editor's generated header.
1050
+ * @param {string} file
1051
+ */
607
1052
  export function madeByEditor(file: string): boolean;
608
1053
  /**
609
1054
  * Refuse a link anywhere the editor reads or writes a theme: `themes/`, the
@@ -671,23 +1116,87 @@ export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history,
671
1116
  changed: string[];
672
1117
  res: Record<"light" | "dark", Record<string, string>>;
673
1118
  problems: string[];
1119
+ problemList: ThemeProblem[];
1120
+ newProblems: ThemeProblem[];
674
1121
  warnings: string[];
675
1122
  lifted: string[];
676
1123
  notes: string[];
677
1124
  unchanged: boolean;
678
1125
  }>;
679
- /** @param {Ctx} ctx @param {ThemeData} data */
680
- export function fontPackages(ctx: Ctx, data: ThemeData): {
1126
+ /**
1127
+ * The Fontsource package for a font family, in Fontsource's own naming: an
1128
+ * open font's own package as the editor's font table names it (Geist is
1129
+ * `@fontsource/geist-sans`); a variable family, which Fontsource names
1130
+ * `<Name> Variable`, from `@fontsource-variable/<name>`; else the family's
1131
+ * name with every run of other characters as one dash (`Open Sans` is
1132
+ * `@fontsource/open-sans`, `Mrs. Sheppards` is `@fontsource/mrs-sheppards`).
1133
+ * Null when the name gives no such package name (a name with no Latin
1134
+ * letters or digits).
1135
+ * @param {string} family
1136
+ * @returns {string | null}
1137
+ */
1138
+ export function fontsourcePackageOf(family: string): string | null;
1139
+ /**
1140
+ * The Fontsource package to suggest installing for a family: an open
1141
+ * font's own package (the editor's font table knows it is published); none
1142
+ * for a font a system ships (on any platform), which Fontsource does not
1143
+ * publish; else the family's package in Fontsource's naming, which
1144
+ * Fontsource may or may not publish (`known` false).
1145
+ * @param {string} family
1146
+ * @returns {{pkg: string, known: boolean} | null}
1147
+ */
1148
+ export function fontsourceSuggestion(family: string): {
1149
+ pkg: string;
1150
+ known: boolean;
1151
+ } | null;
1152
+ /**
1153
+ * The custom properties Core's stylesheet sets on a component's own
1154
+ * element (not on the page root), once per project: a value a theme gives
1155
+ * one of them on the page never reaches the part.
1156
+ * @param {Ctx} ctx
1157
+ * @returns {Set<string>}
1158
+ */
1159
+ export function coreElementVars(ctx: Ctx): Set<string>;
1160
+ /**
1161
+ * The font weights the app's text takes with the theme: Core's weight
1162
+ * tokens (`--font-weight-*`, which its components' text reads) as the
1163
+ * theme sets them, every `font-weight` and weight token the theme's build
1164
+ * writes, each var() read through the theme's own values and then Core's
1165
+ * stylesheet, and the normal weight (400). Null before the theme has been
1166
+ * built.
1167
+ * @param {Ctx} ctx
1168
+ * @param {string} slug
1169
+ * @returns {number[] | null}
1170
+ */
1171
+ export function builtFontWeights(ctx: Ctx, slug: string): number[] | null;
1172
+ /**
1173
+ * The font families the theme's last build names (its `--font-family-*`
1174
+ * tokens, every part's `font-family`, and a `font` shorthand's families), by lowercase name; null before the
1175
+ * theme has been built.
1176
+ * @param {Ctx} ctx
1177
+ * @param {string} slug
1178
+ * @returns {Map<string, string> | null}
1179
+ */
1180
+ export function builtFontFamilies(ctx: Ctx, slug: string): Map<string, string> | null;
1181
+ /**
1182
+ * The font packages that load the families the theme builds: a font
1183
+ * setting's package while the build still uses its family, and the
1184
+ * installed @fontsource package of a family the theme's own source sets.
1185
+ * Font notes, the previews and the app copy all load fonts from this list.
1186
+ * For a new app that installs its own packages (`forNewApp`), every built
1187
+ * family that is an open font comes too, installed here or not.
1188
+ * @param {Ctx} ctx
1189
+ * @param {ThemeData} data
1190
+ * @param {{forNewApp?: boolean}} [opts]
1191
+ */
1192
+ export function fontPackages(ctx: Ctx, data: ThemeData, { forNewApp }?: {
1193
+ forNewApp?: boolean;
1194
+ }): {
681
1195
  pkg: string;
682
1196
  family: string;
683
1197
  installed: boolean;
684
- of: Setting;
1198
+ of: Setting | null;
685
1199
  }[];
686
- /** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null, derived?: Record<string, Array<{property: string, vars?: string[], replaces?: boolean, expand?: string}>>}} Ctx */
687
- /** @typedef {import('./_parts.mjs').PaintSide} PaintSide */
688
- /** @typedef {import('./_parts.mjs').TextPair} TextPair */
689
- /** What a theme name may be, in words. */
690
- export const NAME_RULE: "lowercase letters, digits and dashes, starting with a letter, 64 characters at most, and not a name Windows reserves (con, prn, aux, nul, com1-com9, lpt1-lpt9)";
691
1200
  export function slugOk(s: string): boolean;
692
1201
  export function windowsReserved(s: string): boolean;
693
1202
  export function slugFor(name: unknown): string;
@@ -695,13 +1204,29 @@ export function kebab(s: string): string;
695
1204
  export function camel(s: string): string;
696
1205
  /** Files a system or a tool puts in any folder; a folder of only these is empty. */
697
1206
  export const FOLDER_JUNK: Set<string>;
1207
+ /** The build outputs of a theme, by their ending after `<theme>`. */
1208
+ export const APP_COPY_BUILT: string[];
698
1209
  export function shown(cwd: string, f: string): string;
699
1210
  export function keyOf(s: Setting): string;
700
1211
  export function cornerPx(v: string): number;
701
1212
  export function textPx(v: string): number;
702
1213
  /** The type tokens base themes set again for phones: families and weights. */
703
1214
  export const PHONE_TYPE: RegExp;
1215
+ export namespace PHONE_RULE_WHEN {
1216
+ let pointer: string;
1217
+ namespace width {
1218
+ let below: string;
1219
+ }
1220
+ }
704
1221
  export function themeSource(slug: string): string;
1222
+ export function settingsThemeName(slug: string): string;
1223
+ /**
1224
+ * The section sheet whose picture shows every overlay open: `--png` takes
1225
+ * it beside the sample page's, so plain `show --png` takes it again.
1226
+ */
1227
+ export const OPEN_SECTION: "overlays";
1228
+ /** The radius tokens the corners dial moves. */
1229
+ export const DIAL_RADII: string[];
705
1230
  /** The file a `new` keeps beside the files it writes until it is done. */
706
1231
  export const NEW_MARKER: ".astryx-new.json";
707
1232
  /**
@@ -710,9 +1235,61 @@ export const NEW_MARKER: ".astryx-new.json";
710
1235
  * leaves (a designer's `<slug>.design.psd` beside them is never touched).
711
1236
  */
712
1237
  export const EDITOR_SUFFIXES: string[];
713
- export function isEditorFile(slug: string, n: string): boolean;
1238
+ /**
1239
+ * The pages and pictures the editor writes in a theme folder, by exact
1240
+ * name: the preview and the sheet, each section's sheet, and a picture of
1241
+ * each in each mode. A file of the user's named like one (`sheet-old.png`,
1242
+ * `preview-v.html`) is not one of them.
1243
+ */
1244
+ export const EDITOR_PAGES: Set<string>;
1245
+ export function isEditorPage(n: string, recorded?: Record<string, unknown>): boolean;
1246
+ export function isEditorFile(slug: string, n: string, recorded?: Record<string, unknown>): boolean;
714
1247
  /** The undo steps a theme keeps; older ones are dropped. */
715
1248
  export const HISTORY_STEPS: 80;
1249
+ /**
1250
+ * One entry of the top-level `tokens` map in a theme's own source, as
1251
+ * written: its token (null for a computed key no read of the file can
1252
+ * resolve), the key as typed, the line that sets it, and its value's shape.
1253
+ * A `chain` entry is another theme the file defines (`theme`, its name):
1254
+ * its call, or a token its literal tokens map sets. A `scope` entry names
1255
+ * where a scope (`components`, `onDark`, `onLight`, `adaptations`,
1256
+ * `localTokens`) starts; a `scoped` entry is a token one sets, with its
1257
+ * scope path (`components.button.base`). A `duplicate` entry names a
1258
+ * second `tokens` key (with every line); a
1259
+ * `typography` entry is one typography field (its dotted key and value;
1260
+ * `block` when it holds fields); a `field` entry is a field the theme
1261
+ * gives defineTheme; a `key` entry is a block's own key in a scope (a
1262
+ * style key, a pseudo-class, a surface's tokens), with its scope path;
1263
+ * an `unresolved` entry says the map holds something only a build reads.
1264
+ * A chain theme defined in another file carries that `file`.
1265
+ */
1266
+ export type OwnTokenEntry = {
1267
+ token: string | null;
1268
+ key: string;
1269
+ line: number | null;
1270
+ kind: "text" | "number" | "pair" | "object" | "other" | "duplicate" | "typography" | "unresolved" | "scope" | "scoped" | "chain" | "field" | "key";
1271
+ scope?: string;
1272
+ theme?: string;
1273
+ value?: any;
1274
+ halves?: Array<string | number | undefined>;
1275
+ lines?: Array<number | null>;
1276
+ file?: string;
1277
+ overridden?: boolean;
1278
+ expression?: boolean;
1279
+ notToken?: boolean;
1280
+ block?: boolean;
1281
+ };
1282
+ /**
1283
+ * One problem the theme has, with the command that fixes it, or null when
1284
+ * no one command does. `key` names the problem whatever its ratio (what
1285
+ * is drawn, on what, in which variant and mode), so a change that only
1286
+ * moves a ratio makes no new problem.
1287
+ */
1288
+ export type ThemeProblem = {
1289
+ text: string;
1290
+ fix: string | null;
1291
+ key: string;
1292
+ };
716
1293
  /**
717
1294
  * One setting the CLI owns.
718
1295
  */
@@ -777,6 +1354,8 @@ export type Ctx = {
777
1354
  alpha?: string;
778
1355
  }>> | null;
779
1356
  keepRadii?: Record<string, string> | null;
1357
+ sizeNotes?: string[];
1358
+ compileNotes?: string[];
780
1359
  derived?: Record<string, Array<{
781
1360
  property: string;
782
1361
  vars?: string[];
@@ -786,15 +1365,7 @@ export type Ctx = {
786
1365
  };
787
1366
  export type PaintSide = import("./_parts.mjs").PaintSide;
788
1367
  export type TextPair = import("./_parts.mjs").TextPair;
1368
+ import { AstryxError } from '../error.mjs';
1369
+ import { NAME_RULE } from './_name-rule.mjs';
789
1370
  import { modesOf } from './_palette.mjs';
790
- /**
791
- * What a part reads for a property when the theme does not set it, so a
792
- * one-mode component setting keeps the other mode as it was.
793
- * @param {Ctx} ctx
794
- * @param {string} target
795
- * @param {string} prop camelCase or kebab-case
796
- * @param {string | undefined} when
797
- * @param {string} [state] a state (hover): that state's own value
798
- */
799
- export function partDefault(ctx: Ctx, target: string, prop: string, when: string | undefined, state?: string): string | null;
800
- export { modesOf };
1371
+ export { NAME_RULE, modesOf };