@astryxdesign/cli 0.7.16 → 0.7.17-canary.g49a475f

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 (354) hide show
  1. package/README.md +76 -86
  2. package/api/build/_adapter.d.mts +12 -0
  3. package/api/build/_adapter.mjs +51 -34
  4. package/api/build/blocks/blocks.d.mts +7 -5
  5. package/api/build/blocks/blocks.mjs +113 -26
  6. package/api/build/build.doc.mjs +4 -3
  7. package/api/build/build.type.d.mts +2 -2
  8. package/api/build/build.type.mjs +3 -3
  9. package/api/build/kit/kind.d.mts +2 -1
  10. package/api/build/kit/kind.mjs +199 -10
  11. package/api/build/kit/kit.mjs +6 -4
  12. package/api/build/kit/rank.d.mts +4 -2
  13. package/api/build/kit/rank.mjs +125 -24
  14. package/api/build/kit/start.d.mts +5 -4
  15. package/api/build/kit/start.mjs +12 -8
  16. package/api/build/kit/weights.d.mts +39 -3
  17. package/api/build/kit/weights.json +1 -1
  18. package/api/build/kit/weights.mjs +340 -43
  19. package/api/build/kit/word-model.d.mts +23 -0
  20. package/api/build/kit/word-model.mjs +46 -0
  21. package/api/build/kit/words.d.mts +48 -0
  22. package/api/build/kit/words.mjs +90 -1
  23. package/api/component/__fixtures__/resolutions/modules.txt +4 -5
  24. package/api/component/list/list.d.mts +1 -1
  25. package/api/component/list/list.mjs +48 -6
  26. package/api/discover/_adapter.d.mts +1 -1
  27. package/api/discover/search/search.mjs +3 -2
  28. package/api/docs/_adapter.d.mts +26 -2
  29. package/api/docs/_adapter.mjs +219 -6
  30. package/api/docs/docs.d.mts +3 -0
  31. package/api/docs/docs.doc.mjs +7 -1
  32. package/api/docs/docs.mjs +12 -0
  33. package/api/docs/docs.type.d.mts +5 -0
  34. package/api/docs/docs.type.mjs +2 -0
  35. package/api/docs/node/node.mjs +1 -1
  36. package/api/doctor/_adapter.d.mts +27 -5
  37. package/api/doctor/_adapter.mjs +83 -10
  38. package/api/doctor/built-checks.mjs +40 -14
  39. package/api/doctor/doctor.d.mts +4 -3
  40. package/api/doctor/doctor.mjs +14 -7
  41. package/api/doctor/theme-checks.mjs +121 -17
  42. package/api/icon/_records.mjs +2 -1
  43. package/api/index.d.mts +2 -0
  44. package/api/index.mjs +2 -0
  45. package/api/integration/_adapter.d.mts +44 -0
  46. package/api/integration/_adapter.mjs +77 -1
  47. package/api/integration/authoring-checks.mjs +6 -6
  48. package/api/integration/example-scope.d.mts +14 -0
  49. package/api/integration/example-scope.mjs +44 -0
  50. package/api/integration/example-scope.type.d.mts +29 -0
  51. package/api/integration/example-scope.type.mjs +25 -0
  52. package/api/integration/integrationExampleScope.doc.d.mts +11 -0
  53. package/api/integration/integrationExampleScope.doc.mjs +59 -0
  54. package/api/integration/validate-integration.mjs +19 -1
  55. package/api/integration/validate-integration.type.d.mts +9 -0
  56. package/api/integration/validate-integration.type.mjs +1 -1
  57. package/api/integration/validateIntegration.doc.mjs +1 -1
  58. package/api/render/_adapter.mjs +591 -195
  59. package/api/render/render.doc.mjs +11 -3
  60. package/api/render/render.type.d.mts +52 -0
  61. package/api/render/render.type.mjs +31 -1
  62. package/api/search/ORDERING.md +1 -1
  63. package/api/search/_adapter.d.mts +9 -0
  64. package/api/search/_adapter.mjs +85 -0
  65. package/api/search/_candidate-score.mjs +51 -32
  66. package/api/search/_fit-order.mjs +3 -3
  67. package/api/search/_gather-components.d.mts +3 -2
  68. package/api/search/_gather-components.mjs +12 -3
  69. package/api/search/_lexical.d.mts +5 -0
  70. package/api/search/_lexical.mjs +8 -2
  71. package/api/search/_result.d.mts +11 -9
  72. package/api/search/_result.mjs +4 -4
  73. package/api/search/_score.d.mts +6 -1
  74. package/api/search/_score.mjs +15 -3
  75. package/api/search/search-index.mjs +7 -1
  76. package/api/search/search.d.mts +1 -1
  77. package/api/theme/_adapter.mjs +12 -1
  78. package/api/theme/build/build.d.mts +75 -0
  79. package/api/theme/build/build.mjs +243 -58
  80. package/api/theme/build/font-warning.d.mts +7 -0
  81. package/api/theme/build/font-warning.mjs +17 -0
  82. package/api/theme/theme.type.d.mts +10 -0
  83. package/api/theme/theme.type.mjs +7 -1
  84. package/api/theme-edit/_adapter.d.mts +63 -2
  85. package/api/theme-edit/_adapter.mjs +771 -57
  86. package/api/theme-edit/_check.d.mts +40 -22
  87. package/api/theme-edit/_check.mjs +2029 -336
  88. package/api/theme-edit/_color.d.mts +10 -0
  89. package/api/theme-edit/_color.mjs +49 -1
  90. package/api/theme-edit/_compiler.mjs +9 -0
  91. package/api/theme-edit/_context.d.mts +3 -3
  92. package/api/theme-edit/_context.mjs +111 -48
  93. package/api/theme-edit/_css.d.mts +14 -0
  94. package/api/theme-edit/_css.mjs +46 -1
  95. package/api/theme-edit/_edit.d.mts +18 -4
  96. package/api/theme-edit/_edit.mjs +1685 -155
  97. package/api/theme-edit/_how-commands.d.mts +65 -0
  98. package/api/theme-edit/_how-commands.mjs +633 -1
  99. package/api/theme-edit/_how-question.d.mts +84 -0
  100. package/api/theme-edit/_how-question.mjs +5124 -281
  101. package/api/theme-edit/_how.mjs +140 -29
  102. package/api/theme-edit/_marks.d.mts +31 -5
  103. package/api/theme-edit/_marks.mjs +57 -5
  104. package/api/theme-edit/_name-rule.d.mts +11 -0
  105. package/api/theme-edit/_name-rule.mjs +12 -0
  106. package/api/theme-edit/_normal.d.mts +257 -0
  107. package/api/theme-edit/_normal.mjs +1252 -0
  108. package/api/theme-edit/_palette.mjs +10 -4
  109. package/api/theme-edit/_parts.d.mts +10 -1
  110. package/api/theme-edit/_parts.mjs +179 -3
  111. package/api/theme-edit/_preview-app.d.mts +7 -1
  112. package/api/theme-edit/_preview-app.mjs +515 -148
  113. package/api/theme-edit/_preview.d.mts +100 -14
  114. package/api/theme-edit/_preview.mjs +549 -137
  115. package/api/theme-edit/_settings.d.mts +347 -30
  116. package/api/theme-edit/_settings.mjs +2971 -327
  117. package/api/theme-edit/_tables.d.mts +6 -0
  118. package/api/theme-edit/_tables.mjs +44 -1
  119. package/api/theme-edit/_vet.d.mts +18 -0
  120. package/api/theme-edit/_vet.mjs +32 -0
  121. package/api/theme-edit/theme-edit.type.d.mts +10 -1
  122. package/api/theme-edit/theme-edit.type.mjs +4 -1
  123. package/api/theme-edit/themeEditHow.doc.mjs +1 -1
  124. package/api/theme-edit/themeEditNew.doc.d.mts +0 -1
  125. package/api/theme-edit/themeEditNew.doc.mjs +7 -4
  126. package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
  127. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +2 -2
  128. package/api/upgrade/run/run.mjs +4 -3
  129. package/assets/codemods/integration-discovery.mjs +2 -1
  130. package/assets/codemods/run-codemod.mjs +87 -7
  131. package/assets/codemods/transforms/next/index.mjs +11 -1
  132. package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
  133. package/assets/component-list.generated.json +1 -0
  134. package/assets/docs/author-a-theme.doc.mjs +1 -0
  135. package/assets/docs/theme.doc.dense.mjs +2 -2
  136. package/assets/docs/theme.doc.mjs +1 -1
  137. package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
  138. package/assets/docs/tree/checks.doc.mjs +1 -1
  139. package/assets/docs/tree/cli-command.doc.mjs +2 -3
  140. package/assets/docs/tree/render-pages.doc.mjs +44 -3
  141. package/assets/docs/tree/single-component.doc.mjs +4 -0
  142. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  143. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  144. package/assets/docs/use-a-theme.doc.mjs +1 -1
  145. package/assets/docs.generated.json +2 -2
  146. package/assets/search-catalog.generated.json +2 -0
  147. package/assets/self-audit.generated.json +1 -1
  148. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
  149. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
  150. package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +2 -2
  151. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
  152. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
  153. package/assets/templates/components.generated.json +1 -1
  154. package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
  155. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
  156. package/assets/templates/pages/blank/template.doc.mjs +1 -1
  157. package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
  158. package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
  159. package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
  160. package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
  161. package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
  162. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
  163. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
  164. package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
  165. package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
  166. package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
  167. package/assets/templates/pages/documentation/template.doc.mjs +4 -1
  168. package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
  169. package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
  170. package/assets/templates/pages/editor/template.doc.mjs +2 -8
  171. package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
  172. package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
  173. package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
  174. package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
  175. package/assets/templates/pages/ide/page.tsx +24 -2
  176. package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
  177. package/assets/templates/pages/library/template.doc.mjs +4 -1
  178. package/assets/templates/pages/login/template.doc.mjs +2 -1
  179. package/assets/templates/pages/login-card/template.doc.mjs +2 -1
  180. package/assets/templates/pages/login-split/template.doc.mjs +2 -1
  181. package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
  182. package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
  183. package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
  184. package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
  185. package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
  186. package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
  187. package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
  188. package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
  189. package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
  190. package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
  191. package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
  192. package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
  193. package/assets/templates/pages/table-page/template.doc.mjs +5 -4
  194. package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
  195. package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
  196. package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
  197. package/assets/theme.template.ts +6 -0
  198. package/authoring/debug/parse.d.mts +3 -3
  199. package/authoring/doctypes/_schema.d.mts +3 -3
  200. package/authoring/doctypes/command/command.doc.mjs +1 -1
  201. package/authoring/doctypes/component/categories.d.mts +37 -0
  202. package/authoring/doctypes/component/categories.mjs +54 -0
  203. package/authoring/doctypes/template/template.doc.mjs +1 -1
  204. package/authoring/doctypes/template/type.ts +9 -0
  205. package/authoring/example/example.doc.d.mts +12 -0
  206. package/authoring/example/example.doc.mjs +69 -0
  207. package/authoring/example/preview.d.mts +92 -0
  208. package/authoring/example/preview.mjs +994 -0
  209. package/authoring/example/type.ts +102 -0
  210. package/authoring/index.d.mts +1 -0
  211. package/authoring/index.d.ts +12 -0
  212. package/authoring/index.mjs +3 -1
  213. package/clients/cli/bin/astryx.mjs +6 -9
  214. package/clients/cli/build-id.generated.json +1 -1
  215. package/clients/cli/commands/component.doc.mjs +1 -1
  216. package/clients/cli/commands/component.mjs +22 -3
  217. package/clients/cli/commands/docs.doc.mjs +7 -1
  218. package/clients/cli/commands/docs.mjs +3 -1
  219. package/clients/cli/commands/doctor.mjs +32 -14
  220. package/clients/cli/commands/experimental/render.mjs +42 -1
  221. package/clients/cli/commands/experimental/theme.mjs +163 -28
  222. package/clients/cli/commands/experimental-render.doc.mjs +2 -2
  223. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
  224. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +87 -1
  225. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +10 -3
  226. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
  227. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  228. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
  229. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  230. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  231. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
  232. package/clients/cli/commands/experimental-theme-preview.doc.mjs +2 -1
  233. package/clients/cli/commands/experimental-theme.doc.mjs +5 -1
  234. package/clients/cli/commands/search.doc.mjs +2 -1
  235. package/clients/cli/commands/search.mjs +6 -1
  236. package/clients/cli/commands/template.mjs +4 -2
  237. package/clients/cli/commands/theme-build.doc.mjs +5 -1
  238. package/clients/cli/commands/theme.doc.mjs +1 -1
  239. package/clients/cli/commands/theme.mjs +209 -8
  240. package/clients/cli/commands/upgrade.mjs +42 -7
  241. package/clients/cli/index.mjs +1 -1
  242. package/clients/cli/lib/cli-error.mjs +2 -1
  243. package/clients/cli/lib/component-format.mjs +205 -98
  244. package/clients/cli/lib/hook-format.mjs +9 -19
  245. package/clients/cli/lib/json-shim.mjs +77 -21
  246. package/clients/cli/lib/manifest.mjs +3 -2
  247. package/clients/cli/manifest.generated.json +1 -1
  248. package/foundation/agent-docs/agent-docs.mjs +1 -1
  249. package/foundation/config/theme-state.d.mts +13 -1
  250. package/foundation/config/theme-state.mjs +47 -7
  251. package/foundation/discovery/authoring-self-docs.mjs +1 -0
  252. package/foundation/discovery/component-discovery.d.mts +11 -0
  253. package/foundation/discovery/component-discovery.mjs +56 -8
  254. package/foundation/discovery/component-replacement.mjs +130 -1
  255. package/foundation/discovery/copied-passages.mjs +2 -1
  256. package/foundation/discovery/doc-types.mjs +4 -3
  257. package/foundation/discovery/entry-name-files.d.mts +43 -0
  258. package/foundation/discovery/entry-name-files.mjs +264 -0
  259. package/foundation/discovery/hook-discovery.d.mts +8 -2
  260. package/foundation/discovery/hook-discovery.mjs +22 -8
  261. package/foundation/discovery/icon-definition-discovery.mjs +2 -1
  262. package/foundation/discovery/icon-set-checks.mjs +2 -1
  263. package/foundation/discovery/icon-set-discovery.mjs +2 -1
  264. package/foundation/discovery/integration-doc-files.mjs +2 -1
  265. package/foundation/discovery/package-exports.d.mts +10 -0
  266. package/foundation/discovery/package-exports.mjs +56 -3
  267. package/foundation/discovery/prop-drift.mjs +9 -9
  268. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  269. package/foundation/discovery/runner-allowlist.mjs +2 -0
  270. package/foundation/discovery/stored-component-list.d.mts +43 -0
  271. package/foundation/discovery/stored-component-list.mjs +90 -0
  272. package/foundation/discovery/stored-search-catalog.d.mts +115 -0
  273. package/foundation/discovery/stored-search-catalog.mjs +297 -0
  274. package/foundation/discovery/stored-self-audit.d.mts +26 -10
  275. package/foundation/discovery/stored-self-audit.mjs +38 -18
  276. package/foundation/discovery/template-adapter.d.mts +52 -0
  277. package/foundation/discovery/template-adapter.mjs +176 -12
  278. package/foundation/discovery/template-icons.mjs +2 -1
  279. package/foundation/discovery/theme-discovery.mjs +3 -2
  280. package/foundation/discovery/theme-imports.d.mts +14 -0
  281. package/foundation/discovery/theme-imports.mjs +43 -1
  282. package/foundation/discovery/theming-targets.mjs +3 -2
  283. package/foundation/doc-compiler/import.mjs +7 -1
  284. package/foundation/doc-compiler/inputs.mjs +3 -2
  285. package/foundation/doc-compiler/parse-readable.mjs +4 -1
  286. package/foundation/doc-compiler/stored-docs.d.mts +22 -0
  287. package/foundation/doc-compiler/stored-docs.mjs +49 -0
  288. package/foundation/env/semver.mjs +3 -1
  289. package/foundation/fonts/font-stylesheet.d.mts +31 -0
  290. package/foundation/fonts/font-stylesheet.mjs +115 -0
  291. package/foundation/fs/cache-eviction.d.mts +21 -0
  292. package/foundation/fs/cache-eviction.mjs +73 -0
  293. package/foundation/fs/file-protection.mjs +4 -3
  294. package/foundation/fs/gather-cache.d.mts +25 -4
  295. package/foundation/fs/gather-cache.mjs +164 -55
  296. package/foundation/fs/jiti-cache.d.mts +19 -1
  297. package/foundation/fs/jiti-cache.mjs +130 -6
  298. package/foundation/fs/kept-tree.d.mts +60 -0
  299. package/foundation/fs/kept-tree.mjs +154 -0
  300. package/foundation/fs/listing-cache.d.mts +7 -0
  301. package/foundation/fs/listing-cache.mjs +10 -0
  302. package/foundation/fs/module-loader.d.mts +24 -2
  303. package/foundation/fs/module-loader.mjs +94 -21
  304. package/foundation/fs/paths.d.mts +18 -0
  305. package/foundation/fs/paths.mjs +15 -2
  306. package/foundation/identity/provider-identity.d.mts +6 -0
  307. package/foundation/identity/provider-identity.mjs +10 -1
  308. package/foundation/integrations/contribution-inventory.mjs +4 -3
  309. package/foundation/integrations/example-code.d.mts +63 -0
  310. package/foundation/integrations/example-code.mjs +416 -0
  311. package/foundation/integrations/public-imports.d.mts +9 -0
  312. package/foundation/integrations/public-imports.mjs +3 -2
  313. package/foundation/integrations/validate-contributions.mjs +17 -45
  314. package/foundation/render/embedded-files.d.mts +6 -0
  315. package/foundation/render/embedded-files.mjs +25 -5
  316. package/foundation/render/embedded-imports.d.mts +39 -7
  317. package/foundation/render/embedded-imports.mjs +66 -27
  318. package/foundation/render/file-header.d.mts +66 -0
  319. package/foundation/render/file-header.mjs +118 -0
  320. package/foundation/render/host-answer.d.mts +18 -0
  321. package/foundation/render/host-answer.mjs +46 -0
  322. package/foundation/render/host-exit.d.mts +1 -0
  323. package/foundation/render/host-exit.mjs +6 -1
  324. package/foundation/render/html-reader.d.mts +55 -2
  325. package/foundation/render/html-reader.mjs +145 -26
  326. package/foundation/render/markup-edits.d.mts +57 -0
  327. package/foundation/render/markup-edits.mjs +182 -0
  328. package/foundation/render/page-host.mjs +29 -12
  329. package/foundation/render/page-worker.mjs +121 -13
  330. package/foundation/render/picture-chrome.d.mts +4 -0
  331. package/foundation/render/picture-chrome.mjs +185 -0
  332. package/foundation/render/picture-playwright.d.mts +4 -0
  333. package/foundation/render/picture-playwright.mjs +34 -0
  334. package/foundation/render/rebuild.mjs +2 -1
  335. package/foundation/render/render-page.d.mts +35 -3
  336. package/foundation/render/render-page.mjs +316 -42
  337. package/foundation/render/source-block.d.mts +85 -6
  338. package/foundation/render/source-block.mjs +211 -20
  339. package/foundation/render/ts-paths.d.mts +69 -6
  340. package/foundation/render/ts-paths.mjs +326 -40
  341. package/foundation/response/error-codes.d.mts +3 -1
  342. package/foundation/response/error-codes.d.ts +1 -0
  343. package/foundation/response/error-codes.doc.mjs +12 -1
  344. package/foundation/response/error-codes.mjs +11 -1
  345. package/foundation/response/response-types.doc.mjs +2 -2
  346. package/foundation/text/compare-text.d.mts +14 -0
  347. package/foundation/text/compare-text.mjs +68 -0
  348. package/foundation/text/string-utils.d.mts +3 -2
  349. package/foundation/text/string-utils.mjs +18 -4
  350. package/foundation/text/suggest-order.d.mts +9 -0
  351. package/foundation/text/suggest-order.mjs +15 -1
  352. package/foundation/xle/expand.mjs +2 -1
  353. package/host/index.mjs +8 -6
  354. package/package.json +7 -6
@@ -26,6 +26,7 @@ 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;
31
32
  /**
@@ -52,15 +53,15 @@ export function recordWritten(cwd: string, slug: string, files: string[]): void;
52
53
  */
53
54
  export function editorWrote(cwd: string, slug: string, file: string): boolean;
54
55
  /**
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.
56
+ * Whether the pictures record names this file and it is unchanged since the
57
+ * editor wrote it. Only such a file is ever deleted: a stamp alone is not
58
+ * enough, since a byte copy of a picture (preview-before.png) carries the
59
+ * same stamp and is the person's.
59
60
  * @param {string} cwd
60
61
  * @param {string} slug
61
62
  * @param {string} file
62
63
  */
63
- export function adoptOlderPicture(cwd: string, slug: string, file: string): boolean;
64
+ export function editorRecorded(cwd: string, slug: string, file: string): boolean;
64
65
  /**
65
66
  * A name `new` takes, for a suggestion: `name` itself when it is valid, not a
66
67
  * built-in theme and its folder is free; `my-<name>` for a built-in theme's
@@ -116,6 +117,12 @@ export function editedThemes(cwd: string, order?: "name" | "changed"): string[];
116
117
  * @param {number} [n]
117
118
  */
118
119
  export function nearest(x: string, list: Iterable<string>, n?: number): string[];
120
+ /**
121
+ * Whether typed words negate what they name (`not round`, `no caps`,
122
+ * `anything but blue`, `unbold`, `non-bold`, `rounded-none`).
123
+ * @param {string} x
124
+ */
125
+ export function negates(x: string): boolean;
119
126
  /**
120
127
  * A refusal: nothing was changed, and the suggestions lead with the command
121
128
  * that does what the person wanted.
@@ -147,6 +154,40 @@ export function unlabeledThemeName(s: unknown): string;
147
154
  * @returns {string}
148
155
  */
149
156
  export function typedThemeName(s: unknown): string;
157
+ /**
158
+ * The theme names a name typed the way the app shows it may mean, most
159
+ * likely first: a path with doubled slashes or `../` (`themes//t`), a file
160
+ * name with or without its folder (`brand.theme.ts`, `tTheme.ts`), the app
161
+ * copy's export (`tTheme`), camelCase (`brandDark`) and spaces
162
+ * (`Brand Dark`) each read as dashes. The caller picks the first that
163
+ * exists, else the first.
164
+ * @param {string} s
165
+ * @returns {string[]}
166
+ */
167
+ export function themeNameReadings(s: string): string[];
168
+ /**
169
+ * A vibrancy written as set reads typed input: a share of one (0.5) or a
170
+ * percent (50%) is that much of the 0-100 scale, as a whole number. Any
171
+ * other dial's value, or a vibrancy that is no such number, comes back as
172
+ * it was.
173
+ * @param {string} dial
174
+ * @param {string} v
175
+ * @returns {string}
176
+ */
177
+ export function vibrancyMeant(dial: string, v: string): string;
178
+ /**
179
+ * The mode and base a damaged theme file meant, read the way typed input
180
+ * is: other letters, stray spaces, `_` or a space for a dash (`Dark-Only`,
181
+ * ` Neutral`), and a base written as its package name
182
+ * (`@astryxdesign/theme-neutral`). Each is the cleaned text even when it is
183
+ * no value the editor takes; the caller checks it.
184
+ * @param {any} data
185
+ * @returns {{mode: string, like: string}}
186
+ */
187
+ export function fieldsMeant(data: any): {
188
+ mode: string;
189
+ like: string;
190
+ };
150
191
  /**
151
192
  * The settings of a theme, or a refusal naming the command that makes it.
152
193
  * @param {string} cwd
@@ -157,6 +198,16 @@ export function typedThemeName(s: unknown): string;
157
198
  * @returns {ThemeData}
158
199
  */
159
200
  export function loadTheme(cwd: string, slug: string, skip?: string | Partial<Setting>): ThemeData;
201
+ /**
202
+ * A command that builds on a built-in theme, as it runs here: after the
203
+ * line that installs that theme's package when the project does not have
204
+ * it, so the first line offered always works.
205
+ * @param {string} cwd
206
+ * @param {string} base a built-in theme
207
+ * @param {string} line the command on that base
208
+ * @returns {string[]}
209
+ */
210
+ export function onBuiltIn(cwd: string, base: string, line: string): string[];
160
211
  /**
161
212
  * What is wrong with settings data, or null: its shape, and each value with
162
213
  * the same rules `set` checks it by (without the installed Core), so a value
@@ -167,6 +218,20 @@ export function loadTheme(cwd: string, slug: string, skip?: string | Partial<Set
167
218
  * @returns {string | null}
168
219
  */
169
220
  export function settingsProblem(data: any, skip?: string | Partial<Setting>): string | null;
221
+ /**
222
+ * What loading read differently from the file in the theme's entries (a
223
+ * mode or source in other letters, a missing source): one note each.
224
+ * @param {object} data the theme as {@link loadTheme} returned it
225
+ * @returns {string[]}
226
+ */
227
+ export function entryNotes(data: object): string[];
228
+ /**
229
+ * Which part of an entry means nothing after reading: its source, mode or
230
+ * `only`, or null.
231
+ * @param {any} s
232
+ * @returns {'mode' | 'source' | 'only' | null}
233
+ */
234
+ export function entryDamage(s: any): "mode" | "source" | "only" | null;
170
235
  /**
171
236
  * Every setting whose only problem is its value or scope, each with the
172
237
  * command that removes it.
@@ -179,6 +244,13 @@ export function badSettings(data: any): Setting[];
179
244
  * @param {import('./_settings.mjs').Setting} x
180
245
  */
181
246
  export function undoArgs(x: import("./_settings.mjs").Setting): string;
247
+ /**
248
+ * The words of a `set` that gives a setting's scope a value: set reads a
249
+ * headings half from its word, so no half is named.
250
+ * @param {import('./_settings.mjs').Setting} x
251
+ * @param {string} value
252
+ */
253
+ export function setArgs(x: import("./_settings.mjs").Setting, value: string): string;
182
254
  /**
183
255
  * The first setting whose only problem is its value (made under looser
184
256
  * rules): `undo <theme> <undoArgs>` removes it.
@@ -202,6 +274,23 @@ export function withoutBadValues(data: ThemeData): {
202
274
  * @returns {string | null}
203
275
  */
204
276
  export function valueProblem(s: any): string | null;
277
+ /**
278
+ * One entry of the top-level `tokens` map in a theme's own source, as
279
+ * written: its token (null for a computed key no read of the file can
280
+ * resolve), the key as typed, the line that sets it, and its value's shape.
281
+ * A `duplicate` entry names a second `tokens` key (with every line); a
282
+ * `typography` entry is one typography field (its dotted key and value);
283
+ * an `unresolved` entry says the map holds something only a build reads.
284
+ * @typedef {{token: string | null, key: string, line: number | null, kind: 'text' | 'number' | 'pair' | 'object' | 'other' | 'duplicate' | 'typography' | 'unresolved', value?: any, halves?: Array<string | number | undefined>, lines?: Array<number | null>, file?: string, overridden?: boolean, expression?: boolean, notToken?: boolean}} OwnTokenEntry
285
+ */
286
+ /**
287
+ * The entries of the top-level `tokens` map in a theme's own source, read
288
+ * from its syntax tree, each with the line that sets it.
289
+ * @param {string} cwd
290
+ * @param {string} slug
291
+ * @returns {OwnTokenEntry[]}
292
+ */
293
+ export function ownTokenEntries(cwd: string, slug: string): OwnTokenEntry[];
205
294
  /**
206
295
  * The tokens a base theme's own component rules for a part read through
207
296
  * var() (neutral's progress-bar reads --color-border-emphasized), from its
@@ -232,6 +321,17 @@ export function baseTopTokens(cwd: string, like: string | null | undefined): Map
232
321
  * @returns {Map<string, string | null>}
233
322
  */
234
323
  export function partRuleTokens(cwd: string, slug: string, like: string | null | undefined, part: string): Map<string, string | null>;
324
+ /**
325
+ * Whether the base theme's own source gives a part's rule a property, in a
326
+ * state (`:hover`) or at rest, read from its module as written.
327
+ * @param {string} cwd
328
+ * @param {string | undefined} like
329
+ * @param {string} part
330
+ * @param {string} scope `base` or a variant such as `variant:secondary`
331
+ * @param {string | null} state a state block (`:hover`), or null
332
+ * @param {string} prop camelCase
333
+ */
334
+ export function baseRuleHas(cwd: string, like: string | undefined, part: string, scope: string, state: string | null, prop: string): boolean;
235
335
  /**
236
336
  * The tokens and properties a theme's own source sets on a part's plain
237
337
  * rule, read from the build as ownTokens reads page-wide ones: what the
@@ -279,6 +379,14 @@ export function partsOf(ctx: Ctx, s: Pick<Setting, "on" | "only" | "thing">): st
279
379
  * @returns {number | null}
280
380
  */
281
381
  export function lengthPx(v: string): number | null;
382
+ /**
383
+ * The base theme's body text size in px, read back from its built base
384
+ * size (14 when it writes none).
385
+ * @param {{light: Record<string, string>}} base
386
+ */
387
+ export function baseTextPx(base: {
388
+ light: Record<string, string>;
389
+ }): number;
282
390
  /**
283
391
  * The family and fallbacks a font value means: a preset, an open font, a
284
392
  * whole stack with commas, or one family name.
@@ -342,6 +450,27 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
342
450
  stop: number;
343
451
  alpha?: string;
344
452
  }>>;
453
+ /**
454
+ * A size in px: px, rem (16px each), or a calc() of those added and
455
+ * subtracted; null for anything else.
456
+ * @param {string} v
457
+ * @param {Record<string, string>} [vars] values for the tokens a var() may name
458
+ * @returns {number | null}
459
+ */
460
+ export function sizePx(v: string, vars?: Record<string, string>): number | null;
461
+ /**
462
+ * Spacing steps scaled with the spacing dial, kept in order around the
463
+ * steps the theme keeps exact: each the plain scaled value unless it would
464
+ * meet or pass a kept one; those are spread evenly between the kept one and
465
+ * the nearest step that keeps its place. A step with no room below a kept
466
+ * one takes the value of the one below it.
467
+ * @param {Array<[string, number]>} steps token name and the base value, in px
468
+ * @param {number} f the rung's factor
469
+ * @param {Record<string, number>} kept exact steps the theme keeps, in px
470
+ * @param {string[]} [noRoom] filled with the steps left no room
471
+ * @returns {Array<[string, number]>} every step's new value in px, kept ones as kept
472
+ */
473
+ export function spacingSteps(steps: Array<[string, number]>, f: number, kept: Record<string, number>, noRoom?: string[]): Array<[string, number]>;
345
474
  /**
346
475
  * Control heights scaled with the spacing dial (a denser theme has shorter
347
476
  * controls), each kept distinct and in order: smallest to largest, a
@@ -351,9 +480,13 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
351
480
  * scaled above it.
352
481
  * @param {Array<[string, string]>} sizes token name and the theme's value
353
482
  * @param {number} f the spacing rung's factor
483
+ * @param {Record<string, number>} [kept] exact sizes the theme keeps, in px,
484
+ * which the others stay in order around
485
+ * @param {string[]} [noRoom] filled with the sizes left no room between
486
+ * two kept ones (each then equals the one below it)
354
487
  * @returns {Array<[string, string]>} the tokens it writes, in px
355
488
  */
356
- export function controlSizes(sizes: Array<[string, string]>, f: number): Array<[string, string]>;
489
+ export function controlSizes(sizes: Array<[string, string]>, f: number, kept?: Record<string, number>, noRoom?: string[]): Array<[string, string]>;
357
490
  /**
358
491
  * The settings, as a `defineTheme` object.
359
492
  * @param {Ctx} ctx
@@ -365,6 +498,27 @@ export function compileTheme(ctx: Ctx, data: ThemeData, base: {
365
498
  light: Record<string, string>;
366
499
  dark: Record<string, string>;
367
500
  }): any;
501
+ /**
502
+ * A background's layers with each color painted in one mode only: a color
503
+ * stop becomes light-dark(<color>, transparent) for light (the reverse for
504
+ * dark), and a layer that is a color alone becomes a gradient of it, so
505
+ * every layer is an image the other mode does not show.
506
+ * @param {string} value
507
+ * @param {'light' | 'dark'} mode
508
+ * @returns {string[]}
509
+ */
510
+ export function maskLayers(value: string, mode: "light" | "dark"): string[];
511
+ /**
512
+ * A background shorthand split into its image layers and the color its
513
+ * last layer may carry (the color under every image): a color word beside
514
+ * the last image, or a last layer that is a color alone.
515
+ * @param {string} value
516
+ * @returns {{images: string, color: string | null}}
517
+ */
518
+ export function backgroundColorLayer(value: string): {
519
+ images: string;
520
+ color: string | null;
521
+ };
368
522
  /**
369
523
  * Settings whose effect a later or stronger setting hides, with why: `type`
370
524
  * loses heading weight and tracking to `headings`.
@@ -379,23 +533,26 @@ export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting,
379
533
  * {font-weight}`. Find those rules in the built stylesheet.
380
534
  * @param {string} cssText
381
535
  * @param {any} theme
382
- * @returns {Array<{target: string, key: string, prop: string, value: string}>}
536
+ * @returns {Array<{target: string, key: string, prop: string, value: string, state?: string}>}
383
537
  */
384
538
  export function findOverrides(cssText: string, theme: any): Array<{
385
539
  target: string;
386
540
  key: string;
387
541
  prop: string;
388
542
  value: string;
543
+ state?: string;
389
544
  }>;
390
545
  /**
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.
546
+ * Why a theme's source cannot carry its settings, or null when it carries
547
+ * them. The theme is the export a build of the source reads, loaded as the
548
+ * build loads it: it must be named for the theme, and its definition must
549
+ * extend the settings imported from ./<slug>.settings. Null for a source
550
+ * that does not parse: its parse error is its own finding.
394
551
  * @param {string} cwd
395
552
  * @param {string} slug
396
- * @returns {string | null}
553
+ * @returns {Promise<string | null>}
397
554
  */
398
- export function themeSourceProblem(cwd: string, slug: string): string | null;
555
+ export function themeSourceProblem(cwd: string, slug: string): Promise<string | null>;
399
556
  /**
400
557
  * Why the person's own theme source does not parse (its line and the
401
558
  * parser's message), or null when it parses or is not there.
@@ -418,24 +575,45 @@ export function refuseThemeParse(cwd: string, slug: string): void;
418
575
  * @param {string} cwd
419
576
  * @param {string} slug
420
577
  */
421
- export function refuseThemeSource(cwd: string, slug: string): void;
578
+ export function refuseThemeSource(cwd: string, slug: string): Promise<void>;
422
579
  /**
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).
580
+ * The refusal for a theme source that cannot carry the settings (it no
581
+ * longer imports or extends them, or names another theme), naming the
582
+ * lines that put it back; null when it carries them. Every command that
583
+ * builds the theme refuses with it.
584
+ * @param {string} cwd
585
+ * @param {string} slug
586
+ * @returns {Promise<AstryxError | null>}
587
+ */
588
+ export function themeSourceRefusal(cwd: string, slug: string): Promise<AstryxError | null>;
589
+ /**
590
+ * What a build made now writes for a theme: its own page-wide tokens (see
591
+ * builtOwnTokens), every top-level token, and the typography it was given
592
+ * (evaluated: an import or an expression is its value). Null when it does
593
+ * not build in the project's cache folder.
428
594
  * @param {Ctx} ctx
429
595
  * @param {string} slug
430
- * @returns {Promise<string[]>}
596
+ * @param {string | null} like the base theme, whose built tokens are `base`
597
+ * @returns {Promise<{own: Map<string, string | null>, tops: Map<string, string | null>, base: Map<string, string | null>, shapes: Map<string, BuiltShape>, typography: any} | null>}
431
598
  */
432
- export function builtPairs(ctx: Ctx, slug: string): Promise<string[]>;
599
+ export function evaluatedTheme(ctx: Ctx, slug: string, like: string | null): Promise<{
600
+ own: Map<string, string | null>;
601
+ tops: Map<string, string | null>;
602
+ base: Map<string, string | null>;
603
+ shapes: Map<string, BuiltShape>;
604
+ typography: any;
605
+ } | null>;
433
606
  /**
434
607
  * The refusal of a [light, dark] pair on tokens that are not colors.
435
608
  * @param {string} slug
436
609
  * @param {string[]} names
437
610
  */
438
611
  export function ownPairMessage(slug: string, names: string[]): string;
612
+ /**
613
+ * Set the check of a theme's own token values run before every build.
614
+ * @param {((ctx: Ctx, slug: string, data: ThemeData) => Promise<void>) | null} fn
615
+ */
616
+ export function setOwnTokenCheck(fn: ((ctx: Ctx, slug: string, data: ThemeData) => Promise<void>) | null): void;
439
617
  /**
440
618
  * Set what runs after every build of a theme.
441
619
  * @param {((ctx: Ctx, slug: string, data: ThemeData) => void) | null} fn
@@ -460,6 +638,15 @@ export function buildTheme(ctx: Ctx, slug: string, data: ThemeData): Promise<{
460
638
  lifted: string[];
461
639
  notes: string[];
462
640
  }>;
641
+ /**
642
+ * The one color mode of a light-only or dark-only theme, from its settings,
643
+ * for the build to write into the built module (`colorModes`); null for a
644
+ * theme with both modes.
645
+ * @param {string} cwd
646
+ * @param {string} slug
647
+ * @returns {['light'] | ['dark'] | null}
648
+ */
649
+ export function buildColorModes(cwd: string, slug: string): ["light"] | ["dark"] | null;
463
650
  /**
464
651
  * Why the built outputs differ from what the theme builds now: one that is
465
652
  * missing or changed by hand, found the way `compile --check` finds it
@@ -479,6 +666,14 @@ export function resolvedTokens(ctx: Ctx, slug: string): Promise<{
479
666
  light: Record<string, string>;
480
667
  dark: Record<string, string>;
481
668
  }>;
669
+ /**
670
+ * Why a token value is not one, with a value of the token's own type to
671
+ * write instead (a size in px, a weight as a number in quotes), or none.
672
+ * @param {Ctx} ctx
673
+ * @param {string} slug
674
+ * @param {[string, unknown, ('object' | 'pair' | 'unit' | 'value' | 'mode')?]} bad
675
+ */
676
+ export function nonTextMessage(ctx: Ctx, slug: string, [name, value, kind]: [string, unknown, ("object" | "pair" | "unit" | "value" | "mode")?]): string;
482
677
  /**
483
678
  * Contrast problems this theme caused: text below 4.5:1 that was not as low
484
679
  * in the base theme. A part's own color or background setting, or a token
@@ -493,8 +688,52 @@ export function contrastProblems(ctx: Ctx, data: ThemeData, res: {
493
688
  dark: Record<string, string>;
494
689
  }): Promise<string[]>;
495
690
  /**
496
- * Whether parsed settings have the shape the editor reads: an object with a
497
- * list of settings.
691
+ * A settings file's or an undo step's text as JSON, a byte-order mark
692
+ * aside; undefined when there is no text or it does not parse. Every reader
693
+ * of settings text reads it here.
694
+ * @param {string | null | undefined} text
695
+ * @returns {any}
696
+ */
697
+ export function settingsJson(text: string | null | undefined): any;
698
+ /**
699
+ * Whether settings data has its shape and every entry is an object with a
700
+ * thing name: what a reader may go through entry by entry. Any other entry
701
+ * (null, a number, text) is damage the file check names.
702
+ * @param {any} data
703
+ */
704
+ export function entriesReadable(data: any): any;
705
+ /**
706
+ * Read a damaged mode or base the way a change reads it, in place: one
707
+ * written in other letters or as a package name (`Dark-Only`,
708
+ * `@astryxdesign/theme-neutral`) is the value meant; any other goes back to
709
+ * its default. `like: "none"` is no base. The field a command sets itself
710
+ * is left to that command.
711
+ * @param {any} data
712
+ * @param {string} cwd
713
+ * @param {string} [fixing] `mode` or `base` when the command sets it
714
+ * @returns {string[]} a note for each field read differently from the file
715
+ */
716
+ export function readFields(data: any, cwd: string, fixing?: string): string[];
717
+ /**
718
+ * Read settings data as a change reads it, in place: entry modes and
719
+ * sources in other words, and a damaged mode or base (see
720
+ * {@link readFields}). The settings file and every undo step are read
721
+ * through here.
722
+ * @param {any} data
723
+ * @param {string} cwd
724
+ * @param {string} [fixing] `mode` or `base` when the command sets it
725
+ * @returns {string[]} a note for each thing read differently from the text
726
+ */
727
+ export function readAsMeant(data: any, cwd: string, fixing?: string): string[];
728
+ /**
729
+ * Whether every settings entry has the parts the editor reads (a thing, a
730
+ * value and a source); one without is damage `new` keeps aside.
731
+ * @param {any} data
732
+ */
733
+ export function settingsEntriesOk(data: any): any;
734
+ /**
735
+ * Whether settings data has the shape the editor reads: an object with a
736
+ * settings list.
498
737
  * @param {any} data
499
738
  */
500
739
  export function settingsShapeOk(data: any): boolean;
@@ -525,6 +764,15 @@ export function baseComponent(base: {
525
764
  * @returns {string | null}
526
765
  */
527
766
  export function focusStateOf(ctx: Ctx, part: string): string | null;
767
+ /**
768
+ * The parts that draw a part's corners: the part itself, or, when Core gives
769
+ * it no radius of its own, the parts inside it that it has (a date-time
770
+ * input's date and time boxes).
771
+ * @param {Ctx} ctx
772
+ * @param {string} part
773
+ * @returns {string[]}
774
+ */
775
+ export function cornerParts(ctx: Ctx, part: string): string[];
528
776
  /**
529
777
  * The radius token a part's resting corners read. A part the census saw
530
778
  * closed (a menu, a popover) has none recorded: a container or menu reads
@@ -555,6 +803,21 @@ export function clearNewMarker(dir: string): void;
555
803
  * @returns {string}
556
804
  */
557
805
  export function stateKey(state: string, wrapsControl?: boolean): string;
806
+ /**
807
+ * The text color tokens Core's elements inside a part read for their own
808
+ * color (a top nav heading's title span reads --color-text-primary itself),
809
+ * so a color set on the part never reaches that text. Only the main and
810
+ * supporting text colors count: the disabled, placeholder and accent ones
811
+ * mark a state or a role, not the part's text. With `deep`, the parts inside
812
+ * it count too (a top nav's heading and items).
813
+ * @param {{MAP: Record<string, any>}} C
814
+ * @param {string} part
815
+ * @param {boolean} [deep]
816
+ * @returns {string[]}
817
+ */
818
+ export function innerTextTokens(C: {
819
+ MAP: Record<string, any>;
820
+ }, part: string, deep?: boolean): string[];
558
821
  /**
559
822
  * The component docs of a part: its own component's, and the one named like
560
823
  * the part (tab is Tab, under TabList), each with its name, for the ones the
@@ -676,18 +939,36 @@ export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history,
676
939
  notes: string[];
677
940
  unchanged: boolean;
678
941
  }>;
679
- /** @param {Ctx} ctx @param {ThemeData} data */
942
+ /**
943
+ * The @fontsource package named for a font family (`Open Sans` is
944
+ * `@fontsource/open-sans`).
945
+ * @param {string} family
946
+ * @returns {string}
947
+ */
948
+ export function fontsourcePackageOf(family: string): string;
949
+ /**
950
+ * The font families the theme's last build names (its
951
+ * `--font-family-*` declarations), by lowercase name; null before the
952
+ * theme has been built.
953
+ * @param {Ctx} ctx
954
+ * @param {string} slug
955
+ * @returns {Map<string, string> | null}
956
+ */
957
+ export function builtFontFamilies(ctx: Ctx, slug: string): Map<string, string> | null;
958
+ /**
959
+ * The font packages that load the families the theme builds: a font
960
+ * setting's package while the build still uses its family, and the
961
+ * installed @fontsource package of a family the theme's own source sets.
962
+ * Font notes, the previews and the app copy all load fonts from this list.
963
+ * @param {Ctx} ctx
964
+ * @param {ThemeData} data
965
+ */
680
966
  export function fontPackages(ctx: Ctx, data: ThemeData): {
681
967
  pkg: string;
682
968
  family: string;
683
969
  installed: boolean;
684
- of: Setting;
970
+ of: Setting | null;
685
971
  }[];
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
972
  export function slugOk(s: string): boolean;
692
973
  export function windowsReserved(s: string): boolean;
693
974
  export function slugFor(name: unknown): string;
@@ -702,6 +983,8 @@ export function textPx(v: string): number;
702
983
  /** The type tokens base themes set again for phones: families and weights. */
703
984
  export const PHONE_TYPE: RegExp;
704
985
  export function themeSource(slug: string): string;
986
+ /** The radius tokens the corners dial moves. */
987
+ export const DIAL_RADII: string[];
705
988
  /** The file a `new` keeps beside the files it writes until it is done. */
706
989
  export const NEW_MARKER: ".astryx-new.json";
707
990
  /**
@@ -713,6 +996,36 @@ export const EDITOR_SUFFIXES: string[];
713
996
  export function isEditorFile(slug: string, n: string): boolean;
714
997
  /** The undo steps a theme keeps; older ones are dropped. */
715
998
  export const HISTORY_STEPS: 80;
999
+ /**
1000
+ * One entry of the top-level `tokens` map in a theme's own source, as
1001
+ * written: its token (null for a computed key no read of the file can
1002
+ * resolve), the key as typed, the line that sets it, and its value's shape.
1003
+ * A `duplicate` entry names a second `tokens` key (with every line); a
1004
+ * `typography` entry is one typography field (its dotted key and value);
1005
+ * an `unresolved` entry says the map holds something only a build reads.
1006
+ */
1007
+ export type OwnTokenEntry = {
1008
+ token: string | null;
1009
+ key: string;
1010
+ line: number | null;
1011
+ kind: "text" | "number" | "pair" | "object" | "other" | "duplicate" | "typography" | "unresolved";
1012
+ value?: any;
1013
+ halves?: Array<string | number | undefined>;
1014
+ lines?: Array<number | null>;
1015
+ file?: string;
1016
+ overridden?: boolean;
1017
+ expression?: boolean;
1018
+ notToken?: boolean;
1019
+ };
1020
+ /**
1021
+ * What a built module writes for a top-level token: text, a number, an
1022
+ * object, a pair (each half), or something else.
1023
+ */
1024
+ export type BuiltShape = {
1025
+ kind: "text" | "number" | "object" | "pair" | "other";
1026
+ value?: any;
1027
+ halves?: unknown[];
1028
+ };
716
1029
  /**
717
1030
  * One setting the CLI owns.
718
1031
  */
@@ -777,6 +1090,8 @@ export type Ctx = {
777
1090
  alpha?: string;
778
1091
  }>> | null;
779
1092
  keepRadii?: Record<string, string> | null;
1093
+ sizeNotes?: string[];
1094
+ compileNotes?: string[];
780
1095
  derived?: Record<string, Array<{
781
1096
  property: string;
782
1097
  vars?: string[];
@@ -786,6 +1101,8 @@ export type Ctx = {
786
1101
  };
787
1102
  export type PaintSide = import("./_parts.mjs").PaintSide;
788
1103
  export type TextPair = import("./_parts.mjs").TextPair;
1104
+ import { AstryxError } from '../error.mjs';
1105
+ import { NAME_RULE } from './_name-rule.mjs';
789
1106
  import { modesOf } from './_palette.mjs';
790
1107
  /**
791
1108
  * What a part reads for a property when the theme does not set it, so a
@@ -797,4 +1114,4 @@ import { modesOf } from './_palette.mjs';
797
1114
  * @param {string} [state] a state (hover): that state's own value
798
1115
  */
799
1116
  export function partDefault(ctx: Ctx, target: string, prop: string, when: string | undefined, state?: string): string | null;
800
- export { modesOf };
1117
+ export { NAME_RULE, modesOf };