@astryxdesign/cli 0.7.16 → 0.7.17-canary.g335a172

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 (339) 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.mjs +69 -16
  13. package/api/build/kit/start.d.mts +5 -4
  14. package/api/build/kit/start.mjs +12 -8
  15. package/api/build/kit/weights.d.mts +16 -3
  16. package/api/build/kit/weights.json +1 -1
  17. package/api/build/kit/weights.mjs +251 -35
  18. package/api/build/kit/word-model.d.mts +23 -0
  19. package/api/build/kit/word-model.mjs +46 -0
  20. package/api/build/kit/words.d.mts +48 -0
  21. package/api/build/kit/words.mjs +90 -1
  22. package/api/component/__fixtures__/resolutions/modules.txt +4 -5
  23. package/api/component/list/list.d.mts +1 -1
  24. package/api/component/list/list.mjs +48 -6
  25. package/api/discover/_adapter.d.mts +1 -1
  26. package/api/discover/search/search.mjs +3 -2
  27. package/api/docs/_adapter.d.mts +26 -2
  28. package/api/docs/_adapter.mjs +219 -6
  29. package/api/docs/docs.d.mts +3 -0
  30. package/api/docs/docs.doc.mjs +7 -1
  31. package/api/docs/docs.mjs +12 -0
  32. package/api/docs/docs.type.d.mts +5 -0
  33. package/api/docs/docs.type.mjs +2 -0
  34. package/api/docs/node/node.mjs +1 -1
  35. package/api/doctor/_adapter.d.mts +27 -5
  36. package/api/doctor/_adapter.mjs +83 -10
  37. package/api/doctor/built-checks.mjs +40 -14
  38. package/api/doctor/doctor.d.mts +4 -3
  39. package/api/doctor/doctor.mjs +14 -7
  40. package/api/doctor/theme-checks.mjs +121 -17
  41. package/api/icon/_records.mjs +2 -1
  42. package/api/index.d.mts +2 -0
  43. package/api/index.mjs +2 -0
  44. package/api/integration/_adapter.d.mts +44 -0
  45. package/api/integration/_adapter.mjs +77 -1
  46. package/api/integration/authoring-checks.mjs +6 -6
  47. package/api/integration/example-scope.d.mts +14 -0
  48. package/api/integration/example-scope.mjs +44 -0
  49. package/api/integration/example-scope.type.d.mts +29 -0
  50. package/api/integration/example-scope.type.mjs +25 -0
  51. package/api/integration/integrationExampleScope.doc.d.mts +11 -0
  52. package/api/integration/integrationExampleScope.doc.mjs +59 -0
  53. package/api/integration/validate-integration.mjs +19 -1
  54. package/api/integration/validate-integration.type.d.mts +9 -0
  55. package/api/integration/validate-integration.type.mjs +1 -1
  56. package/api/integration/validateIntegration.doc.mjs +1 -1
  57. package/api/render/_adapter.mjs +591 -195
  58. package/api/render/render.doc.mjs +11 -3
  59. package/api/render/render.type.d.mts +52 -0
  60. package/api/render/render.type.mjs +31 -1
  61. package/api/search/ORDERING.md +1 -1
  62. package/api/search/_candidate-score.mjs +51 -32
  63. package/api/search/_fit-order.mjs +3 -3
  64. package/api/search/_gather-components.d.mts +3 -2
  65. package/api/search/_gather-components.mjs +12 -3
  66. package/api/search/_lexical.d.mts +5 -0
  67. package/api/search/_lexical.mjs +8 -2
  68. package/api/search/_result.d.mts +11 -9
  69. package/api/search/_result.mjs +4 -4
  70. package/api/search/_score.d.mts +6 -1
  71. package/api/search/_score.mjs +15 -3
  72. package/api/search/search-index.mjs +7 -1
  73. package/api/search/search.d.mts +1 -1
  74. package/api/theme/_adapter.mjs +12 -1
  75. package/api/theme/build/build.d.mts +60 -0
  76. package/api/theme/build/build.mjs +210 -54
  77. package/api/theme/build/font-warning.d.mts +8 -0
  78. package/api/theme/build/font-warning.mjs +19 -0
  79. package/api/theme/theme.type.d.mts +10 -0
  80. package/api/theme/theme.type.mjs +7 -1
  81. package/api/theme-edit/_adapter.d.mts +55 -0
  82. package/api/theme-edit/_adapter.mjs +673 -42
  83. package/api/theme-edit/_check.d.mts +28 -22
  84. package/api/theme-edit/_check.mjs +1858 -312
  85. package/api/theme-edit/_color.d.mts +10 -0
  86. package/api/theme-edit/_color.mjs +49 -1
  87. package/api/theme-edit/_compiler.mjs +9 -0
  88. package/api/theme-edit/_context.mjs +60 -3
  89. package/api/theme-edit/_css.mjs +21 -1
  90. package/api/theme-edit/_edit.d.mts +22 -0
  91. package/api/theme-edit/_edit.mjs +1533 -92
  92. package/api/theme-edit/_how-commands.d.mts +57 -0
  93. package/api/theme-edit/_how-commands.mjs +587 -1
  94. package/api/theme-edit/_how-question.d.mts +78 -0
  95. package/api/theme-edit/_how-question.mjs +4716 -235
  96. package/api/theme-edit/_how.mjs +134 -8
  97. package/api/theme-edit/_marks.d.mts +31 -5
  98. package/api/theme-edit/_marks.mjs +57 -5
  99. package/api/theme-edit/_normal.d.mts +219 -0
  100. package/api/theme-edit/_normal.mjs +1041 -0
  101. package/api/theme-edit/_palette.mjs +10 -4
  102. package/api/theme-edit/_parts.d.mts +8 -0
  103. package/api/theme-edit/_parts.mjs +103 -2
  104. package/api/theme-edit/_playwright-picture.d.mts +4 -0
  105. package/api/theme-edit/_playwright-picture.mjs +34 -0
  106. package/api/theme-edit/_preview-app.d.mts +7 -1
  107. package/api/theme-edit/_preview-app.mjs +394 -74
  108. package/api/theme-edit/_preview.d.mts +69 -8
  109. package/api/theme-edit/_preview.mjs +531 -108
  110. package/api/theme-edit/_settings.d.mts +243 -6
  111. package/api/theme-edit/_settings.mjs +2415 -147
  112. package/api/theme-edit/_tables.d.mts +6 -0
  113. package/api/theme-edit/_tables.mjs +44 -1
  114. package/api/theme-edit/_vet.d.mts +18 -0
  115. package/api/theme-edit/_vet.mjs +32 -0
  116. package/api/theme-edit/theme-edit.type.d.mts +10 -1
  117. package/api/theme-edit/theme-edit.type.mjs +4 -1
  118. package/api/theme-edit/themeEditHow.doc.mjs +1 -1
  119. package/api/theme-edit/themeEditNew.doc.mjs +1 -1
  120. package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
  121. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +2 -2
  122. package/api/upgrade/run/run.mjs +4 -3
  123. package/assets/codemods/integration-discovery.mjs +2 -1
  124. package/assets/codemods/run-codemod.mjs +87 -7
  125. package/assets/codemods/transforms/next/index.mjs +11 -1
  126. package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
  127. package/assets/component-list.generated.json +1 -0
  128. package/assets/docs/author-a-theme.doc.mjs +1 -0
  129. package/assets/docs/theme.doc.dense.mjs +2 -2
  130. package/assets/docs/theme.doc.mjs +1 -1
  131. package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
  132. package/assets/docs/tree/checks.doc.mjs +1 -1
  133. package/assets/docs/tree/cli-command.doc.mjs +2 -3
  134. package/assets/docs/tree/render-pages.doc.mjs +44 -3
  135. package/assets/docs/tree/single-component.doc.mjs +4 -0
  136. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  137. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  138. package/assets/docs/use-a-theme.doc.mjs +1 -1
  139. package/assets/docs.generated.json +2 -2
  140. package/assets/self-audit.generated.json +1 -1
  141. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
  142. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
  143. package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +2 -2
  144. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
  145. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
  146. package/assets/templates/components.generated.json +1 -1
  147. package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
  148. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
  149. package/assets/templates/pages/blank/template.doc.mjs +1 -1
  150. package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
  151. package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
  152. package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
  153. package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
  154. package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
  155. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
  156. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
  157. package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
  158. package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
  159. package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
  160. package/assets/templates/pages/documentation/template.doc.mjs +4 -1
  161. package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
  162. package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
  163. package/assets/templates/pages/editor/template.doc.mjs +2 -8
  164. package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
  165. package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
  166. package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
  167. package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
  168. package/assets/templates/pages/ide/page.tsx +24 -2
  169. package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
  170. package/assets/templates/pages/library/template.doc.mjs +4 -1
  171. package/assets/templates/pages/login/template.doc.mjs +2 -1
  172. package/assets/templates/pages/login-card/template.doc.mjs +2 -1
  173. package/assets/templates/pages/login-split/template.doc.mjs +2 -1
  174. package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
  175. package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
  176. package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
  177. package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
  178. package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
  179. package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
  180. package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
  181. package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
  182. package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
  183. package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
  184. package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
  185. package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
  186. package/assets/templates/pages/table-page/template.doc.mjs +5 -4
  187. package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
  188. package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
  189. package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
  190. package/assets/theme.template.ts +6 -0
  191. package/authoring/debug/parse.d.mts +3 -3
  192. package/authoring/doctypes/_schema.d.mts +3 -3
  193. package/authoring/doctypes/command/command.doc.mjs +1 -1
  194. package/authoring/doctypes/component/categories.d.mts +37 -0
  195. package/authoring/doctypes/component/categories.mjs +54 -0
  196. package/authoring/doctypes/template/template.doc.mjs +1 -1
  197. package/authoring/doctypes/template/type.ts +9 -0
  198. package/authoring/example/example.doc.d.mts +12 -0
  199. package/authoring/example/example.doc.mjs +69 -0
  200. package/authoring/example/preview.d.mts +92 -0
  201. package/authoring/example/preview.mjs +994 -0
  202. package/authoring/example/type.ts +102 -0
  203. package/authoring/index.d.mts +1 -0
  204. package/authoring/index.d.ts +12 -0
  205. package/authoring/index.mjs +3 -1
  206. package/clients/cli/bin/astryx.mjs +6 -9
  207. package/clients/cli/build-id.generated.json +1 -1
  208. package/clients/cli/commands/component.doc.mjs +1 -1
  209. package/clients/cli/commands/component.mjs +22 -3
  210. package/clients/cli/commands/docs.doc.mjs +7 -1
  211. package/clients/cli/commands/docs.mjs +3 -1
  212. package/clients/cli/commands/doctor.mjs +32 -14
  213. package/clients/cli/commands/experimental/render.mjs +42 -1
  214. package/clients/cli/commands/experimental/theme.mjs +145 -16
  215. package/clients/cli/commands/experimental-render.doc.mjs +2 -2
  216. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
  217. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +87 -1
  218. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
  219. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
  220. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  221. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
  222. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  223. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  224. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
  225. package/clients/cli/commands/search.doc.mjs +2 -1
  226. package/clients/cli/commands/search.mjs +6 -1
  227. package/clients/cli/commands/template.mjs +4 -2
  228. package/clients/cli/commands/theme-build.doc.mjs +5 -1
  229. package/clients/cli/commands/theme.doc.mjs +1 -1
  230. package/clients/cli/commands/theme.mjs +183 -6
  231. package/clients/cli/commands/upgrade.mjs +42 -7
  232. package/clients/cli/index.mjs +1 -1
  233. package/clients/cli/lib/cli-error.mjs +2 -1
  234. package/clients/cli/lib/component-format.mjs +205 -98
  235. package/clients/cli/lib/hook-format.mjs +9 -19
  236. package/clients/cli/lib/json-shim.mjs +77 -21
  237. package/clients/cli/lib/manifest.mjs +3 -2
  238. package/clients/cli/manifest.generated.json +1 -1
  239. package/foundation/agent-docs/agent-docs.mjs +1 -1
  240. package/foundation/config/theme-state.d.mts +13 -1
  241. package/foundation/config/theme-state.mjs +47 -7
  242. package/foundation/discovery/authoring-self-docs.mjs +1 -0
  243. package/foundation/discovery/component-discovery.d.mts +11 -0
  244. package/foundation/discovery/component-discovery.mjs +56 -8
  245. package/foundation/discovery/component-replacement.mjs +130 -1
  246. package/foundation/discovery/copied-passages.mjs +2 -1
  247. package/foundation/discovery/doc-types.mjs +4 -3
  248. package/foundation/discovery/entry-name-files.d.mts +43 -0
  249. package/foundation/discovery/entry-name-files.mjs +264 -0
  250. package/foundation/discovery/hook-discovery.d.mts +8 -2
  251. package/foundation/discovery/hook-discovery.mjs +22 -8
  252. package/foundation/discovery/icon-definition-discovery.mjs +2 -1
  253. package/foundation/discovery/icon-set-checks.mjs +2 -1
  254. package/foundation/discovery/icon-set-discovery.mjs +2 -1
  255. package/foundation/discovery/integration-doc-files.mjs +2 -1
  256. package/foundation/discovery/package-exports.d.mts +10 -0
  257. package/foundation/discovery/package-exports.mjs +56 -3
  258. package/foundation/discovery/prop-drift.mjs +9 -9
  259. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  260. package/foundation/discovery/runner-allowlist.mjs +2 -0
  261. package/foundation/discovery/stored-component-list.d.mts +43 -0
  262. package/foundation/discovery/stored-component-list.mjs +90 -0
  263. package/foundation/discovery/stored-self-audit.d.mts +26 -10
  264. package/foundation/discovery/stored-self-audit.mjs +38 -18
  265. package/foundation/discovery/template-adapter.d.mts +52 -0
  266. package/foundation/discovery/template-adapter.mjs +176 -12
  267. package/foundation/discovery/template-icons.mjs +2 -1
  268. package/foundation/discovery/theme-discovery.mjs +3 -2
  269. package/foundation/discovery/theme-imports.d.mts +14 -0
  270. package/foundation/discovery/theme-imports.mjs +43 -1
  271. package/foundation/discovery/theming-targets.mjs +3 -2
  272. package/foundation/doc-compiler/import.mjs +7 -1
  273. package/foundation/doc-compiler/inputs.mjs +3 -2
  274. package/foundation/doc-compiler/parse-readable.mjs +4 -1
  275. package/foundation/doc-compiler/stored-docs.d.mts +22 -0
  276. package/foundation/doc-compiler/stored-docs.mjs +49 -0
  277. package/foundation/env/semver.mjs +3 -1
  278. package/foundation/fonts/font-stylesheet.d.mts +31 -0
  279. package/foundation/fonts/font-stylesheet.mjs +115 -0
  280. package/foundation/fs/cache-eviction.d.mts +21 -0
  281. package/foundation/fs/cache-eviction.mjs +73 -0
  282. package/foundation/fs/file-protection.mjs +4 -3
  283. package/foundation/fs/gather-cache.d.mts +25 -4
  284. package/foundation/fs/gather-cache.mjs +164 -55
  285. package/foundation/fs/jiti-cache.d.mts +19 -1
  286. package/foundation/fs/jiti-cache.mjs +130 -6
  287. package/foundation/fs/kept-tree.d.mts +60 -0
  288. package/foundation/fs/kept-tree.mjs +154 -0
  289. package/foundation/fs/listing-cache.d.mts +7 -0
  290. package/foundation/fs/listing-cache.mjs +10 -0
  291. package/foundation/fs/module-loader.d.mts +24 -2
  292. package/foundation/fs/module-loader.mjs +94 -21
  293. package/foundation/fs/paths.d.mts +18 -0
  294. package/foundation/fs/paths.mjs +15 -2
  295. package/foundation/identity/provider-identity.d.mts +6 -0
  296. package/foundation/identity/provider-identity.mjs +10 -1
  297. package/foundation/integrations/contribution-inventory.mjs +4 -3
  298. package/foundation/integrations/example-code.d.mts +63 -0
  299. package/foundation/integrations/example-code.mjs +416 -0
  300. package/foundation/integrations/public-imports.d.mts +9 -0
  301. package/foundation/integrations/public-imports.mjs +3 -2
  302. package/foundation/integrations/validate-contributions.mjs +17 -45
  303. package/foundation/render/embedded-files.d.mts +6 -0
  304. package/foundation/render/embedded-files.mjs +25 -5
  305. package/foundation/render/embedded-imports.d.mts +39 -7
  306. package/foundation/render/embedded-imports.mjs +66 -27
  307. package/foundation/render/file-header.d.mts +66 -0
  308. package/foundation/render/file-header.mjs +118 -0
  309. package/foundation/render/host-answer.d.mts +18 -0
  310. package/foundation/render/host-answer.mjs +46 -0
  311. package/foundation/render/host-exit.d.mts +1 -0
  312. package/foundation/render/host-exit.mjs +6 -1
  313. package/foundation/render/html-reader.d.mts +55 -2
  314. package/foundation/render/html-reader.mjs +145 -26
  315. package/foundation/render/markup-edits.d.mts +57 -0
  316. package/foundation/render/markup-edits.mjs +182 -0
  317. package/foundation/render/page-host.mjs +29 -12
  318. package/foundation/render/page-worker.mjs +121 -13
  319. package/foundation/render/rebuild.mjs +2 -1
  320. package/foundation/render/render-page.d.mts +35 -3
  321. package/foundation/render/render-page.mjs +316 -42
  322. package/foundation/render/source-block.d.mts +85 -6
  323. package/foundation/render/source-block.mjs +211 -20
  324. package/foundation/render/ts-paths.d.mts +69 -6
  325. package/foundation/render/ts-paths.mjs +326 -40
  326. package/foundation/response/error-codes.d.mts +3 -1
  327. package/foundation/response/error-codes.d.ts +1 -0
  328. package/foundation/response/error-codes.doc.mjs +12 -1
  329. package/foundation/response/error-codes.mjs +11 -1
  330. package/foundation/response/response-types.doc.mjs +2 -2
  331. package/foundation/text/compare-text.d.mts +14 -0
  332. package/foundation/text/compare-text.mjs +68 -0
  333. package/foundation/text/string-utils.d.mts +3 -2
  334. package/foundation/text/string-utils.mjs +18 -4
  335. package/foundation/text/suggest-order.d.mts +9 -0
  336. package/foundation/text/suggest-order.mjs +15 -1
  337. package/foundation/xle/expand.mjs +2 -1
  338. package/host/index.mjs +8 -6
  339. 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
  /**
@@ -51,6 +52,16 @@ export function recordWritten(cwd: string, slug: string, files: string[]): void;
51
52
  * @param {string} file
52
53
  */
53
54
  export function editorWrote(cwd: string, slug: string, file: string): boolean;
55
+ /**
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.
60
+ * @param {string} cwd
61
+ * @param {string} slug
62
+ * @param {string} file
63
+ */
64
+ export function editorRecorded(cwd: string, slug: string, file: string): boolean;
54
65
  /**
55
66
  * Adopt a picture an older editor took (before it recorded or stamped its
56
67
  * pictures) into the record: only while the theme has no record at all, the
@@ -116,6 +127,12 @@ export function editedThemes(cwd: string, order?: "name" | "changed"): string[];
116
127
  * @param {number} [n]
117
128
  */
118
129
  export function nearest(x: string, list: Iterable<string>, n?: number): string[];
130
+ /**
131
+ * Whether typed words negate what they name (`not round`, `no caps`,
132
+ * `anything but blue`, `unbold`, `non-bold`, `rounded-none`).
133
+ * @param {string} x
134
+ */
135
+ export function negates(x: string): boolean;
119
136
  /**
120
137
  * A refusal: nothing was changed, and the suggestions lead with the command
121
138
  * that does what the person wanted.
@@ -147,6 +164,40 @@ export function unlabeledThemeName(s: unknown): string;
147
164
  * @returns {string}
148
165
  */
149
166
  export function typedThemeName(s: unknown): string;
167
+ /**
168
+ * The theme names a name typed the way the app shows it may mean, most
169
+ * likely first: a path with doubled slashes or `../` (`themes//t`), a file
170
+ * name with or without its folder (`brand.theme.ts`, `tTheme.ts`), the app
171
+ * copy's export (`tTheme`), camelCase (`brandDark`) and spaces
172
+ * (`Brand Dark`) each read as dashes. The caller picks the first that
173
+ * exists, else the first.
174
+ * @param {string} s
175
+ * @returns {string[]}
176
+ */
177
+ export function themeNameReadings(s: string): string[];
178
+ /**
179
+ * A vibrancy written as set reads typed input: a share of one (0.5) or a
180
+ * percent (50%) is that much of the 0-100 scale, as a whole number. Any
181
+ * other dial's value, or a vibrancy that is no such number, comes back as
182
+ * it was.
183
+ * @param {string} dial
184
+ * @param {string} v
185
+ * @returns {string}
186
+ */
187
+ export function vibrancyMeant(dial: string, v: string): string;
188
+ /**
189
+ * The mode and base a damaged theme file meant, read the way typed input
190
+ * is: other letters, stray spaces, `_` or a space for a dash (`Dark-Only`,
191
+ * ` Neutral`), and a base written as its package name
192
+ * (`@astryxdesign/theme-neutral`). Each is the cleaned text even when it is
193
+ * no value the editor takes; the caller checks it.
194
+ * @param {any} data
195
+ * @returns {{mode: string, like: string}}
196
+ */
197
+ export function fieldsMeant(data: any): {
198
+ mode: string;
199
+ like: string;
200
+ };
150
201
  /**
151
202
  * The settings of a theme, or a refusal naming the command that makes it.
152
203
  * @param {string} cwd
@@ -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.
@@ -202,6 +267,23 @@ export function withoutBadValues(data: ThemeData): {
202
267
  * @returns {string | null}
203
268
  */
204
269
  export function valueProblem(s: any): string | null;
270
+ /**
271
+ * One entry of the top-level `tokens` map in a theme's own source, as
272
+ * written: its token (null for a computed key no read of the file can
273
+ * resolve), the key as typed, the line that sets it, and its value's shape.
274
+ * A `duplicate` entry names a second `tokens` key (with every line); a
275
+ * `typography` entry is one typography field (its dotted key and value);
276
+ * an `unresolved` entry says the map holds something only a build reads.
277
+ * @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}} OwnTokenEntry
278
+ */
279
+ /**
280
+ * The entries of the top-level `tokens` map in a theme's own source, read
281
+ * from its syntax tree, each with the line that sets it.
282
+ * @param {string} cwd
283
+ * @param {string} slug
284
+ * @returns {OwnTokenEntry[]}
285
+ */
286
+ export function ownTokenEntries(cwd: string, slug: string): OwnTokenEntry[];
205
287
  /**
206
288
  * The tokens a base theme's own component rules for a part read through
207
289
  * var() (neutral's progress-bar reads --color-border-emphasized), from its
@@ -232,6 +314,17 @@ export function baseTopTokens(cwd: string, like: string | null | undefined): Map
232
314
  * @returns {Map<string, string | null>}
233
315
  */
234
316
  export function partRuleTokens(cwd: string, slug: string, like: string | null | undefined, part: string): Map<string, string | null>;
317
+ /**
318
+ * Whether the base theme's own source gives a part's rule a property, in a
319
+ * state (`:hover`) or at rest, read from its module as written.
320
+ * @param {string} cwd
321
+ * @param {string | undefined} like
322
+ * @param {string} part
323
+ * @param {string} scope `base` or a variant such as `variant:secondary`
324
+ * @param {string | null} state a state block (`:hover`), or null
325
+ * @param {string} prop camelCase
326
+ */
327
+ export function baseRuleHas(cwd: string, like: string | undefined, part: string, scope: string, state: string | null, prop: string): boolean;
235
328
  /**
236
329
  * The tokens and properties a theme's own source sets on a part's plain
237
330
  * rule, read from the build as ownTokens reads page-wide ones: what the
@@ -342,6 +435,27 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
342
435
  stop: number;
343
436
  alpha?: string;
344
437
  }>>;
438
+ /**
439
+ * A size in px: px, rem (16px each), or a calc() of those added and
440
+ * subtracted; null for anything else.
441
+ * @param {string} v
442
+ * @param {Record<string, string>} [vars] values for the tokens a var() may name
443
+ * @returns {number | null}
444
+ */
445
+ export function sizePx(v: string, vars?: Record<string, string>): number | null;
446
+ /**
447
+ * Spacing steps scaled with the spacing dial, kept in order around the
448
+ * steps the theme keeps exact: each the plain scaled value unless it would
449
+ * meet or pass a kept one; those are spread evenly between the kept one and
450
+ * the nearest step that keeps its place. A step with no room below a kept
451
+ * one takes the value of the one below it.
452
+ * @param {Array<[string, number]>} steps token name and the base value, in px
453
+ * @param {number} f the rung's factor
454
+ * @param {Record<string, number>} kept exact steps the theme keeps, in px
455
+ * @param {string[]} [noRoom] filled with the steps left no room
456
+ * @returns {Array<[string, number]>} every step's new value in px, kept ones as kept
457
+ */
458
+ export function spacingSteps(steps: Array<[string, number]>, f: number, kept: Record<string, number>, noRoom?: string[]): Array<[string, number]>;
345
459
  /**
346
460
  * Control heights scaled with the spacing dial (a denser theme has shorter
347
461
  * controls), each kept distinct and in order: smallest to largest, a
@@ -351,9 +465,13 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
351
465
  * scaled above it.
352
466
  * @param {Array<[string, string]>} sizes token name and the theme's value
353
467
  * @param {number} f the spacing rung's factor
468
+ * @param {Record<string, number>} [kept] exact sizes the theme keeps, in px,
469
+ * which the others stay in order around
470
+ * @param {string[]} [noRoom] filled with the sizes left no room between
471
+ * two kept ones (each then equals the one below it)
354
472
  * @returns {Array<[string, string]>} the tokens it writes, in px
355
473
  */
356
- export function controlSizes(sizes: Array<[string, string]>, f: number): Array<[string, string]>;
474
+ export function controlSizes(sizes: Array<[string, string]>, f: number, kept?: Record<string, number>, noRoom?: string[]): Array<[string, string]>;
357
475
  /**
358
476
  * The settings, as a `defineTheme` object.
359
477
  * @param {Ctx} ctx
@@ -365,6 +483,27 @@ export function compileTheme(ctx: Ctx, data: ThemeData, base: {
365
483
  light: Record<string, string>;
366
484
  dark: Record<string, string>;
367
485
  }): any;
486
+ /**
487
+ * A background's layers with each color painted in one mode only: a color
488
+ * stop becomes light-dark(<color>, transparent) for light (the reverse for
489
+ * dark), and a layer that is a color alone becomes a gradient of it, so
490
+ * every layer is an image the other mode does not show.
491
+ * @param {string} value
492
+ * @param {'light' | 'dark'} mode
493
+ * @returns {string[]}
494
+ */
495
+ export function maskLayers(value: string, mode: "light" | "dark"): string[];
496
+ /**
497
+ * A background shorthand split into its image layers and the color its
498
+ * last layer may carry (the color under every image): a color word beside
499
+ * the last image, or a last layer that is a color alone.
500
+ * @param {string} value
501
+ * @returns {{images: string, color: string | null}}
502
+ */
503
+ export function backgroundColorLayer(value: string): {
504
+ images: string;
505
+ color: string | null;
506
+ };
368
507
  /**
369
508
  * Settings whose effect a later or stronger setting hides, with why: `type`
370
509
  * loses heading weight and tracking to `headings`.
@@ -379,13 +518,14 @@ export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting,
379
518
  * {font-weight}`. Find those rules in the built stylesheet.
380
519
  * @param {string} cssText
381
520
  * @param {any} theme
382
- * @returns {Array<{target: string, key: string, prop: string, value: string}>}
521
+ * @returns {Array<{target: string, key: string, prop: string, value: string, state?: string}>}
383
522
  */
384
523
  export function findOverrides(cssText: string, theme: any): Array<{
385
524
  target: string;
386
525
  key: string;
387
526
  prop: string;
388
527
  value: string;
528
+ state?: string;
389
529
  }>;
390
530
  /**
391
531
  * Why `<slug>.theme.ts` cannot carry the settings, or null: it must import
@@ -419,6 +559,16 @@ export function refuseThemeParse(cwd: string, slug: string): void;
419
559
  * @param {string} slug
420
560
  */
421
561
  export function refuseThemeSource(cwd: string, slug: string): void;
562
+ /**
563
+ * The refusal for a theme source that cannot carry the settings (it no
564
+ * longer imports or extends them, or names another theme), naming the
565
+ * lines that put it back; null when it carries them. Every command that
566
+ * builds the theme refuses with it.
567
+ * @param {string} cwd
568
+ * @param {string} slug
569
+ * @returns {AstryxError | null}
570
+ */
571
+ export function themeSourceRefusal(cwd: string, slug: string): AstryxError | null;
422
572
  /**
423
573
  * The tokens that are not colors the theme as it builds now gives a
424
574
  * [light, dark] pair (light-dark()), however its file writes them (a
@@ -430,6 +580,31 @@ export function refuseThemeSource(cwd: string, slug: string): void;
430
580
  * @returns {Promise<string[]>}
431
581
  */
432
582
  export function builtPairs(ctx: Ctx, slug: string): Promise<string[]>;
583
+ /**
584
+ * The page-wide tokens the theme's own source gives, as a build made now
585
+ * evaluates them (an imported module, an expression, a template): read
586
+ * from a build into the project's cache folder, never beside the theme.
587
+ * Null when it does not build there.
588
+ * @param {Ctx} ctx
589
+ * @param {string} slug
590
+ * @returns {Promise<Map<string, string | null> | null>}
591
+ */
592
+ export function evaluatedOwnTokens(ctx: Ctx, slug: string): Promise<Map<string, string | null> | null>;
593
+ /**
594
+ * What a build made now writes for a theme: its own page-wide tokens (see
595
+ * builtOwnTokens), every top-level token, and the typography it was given
596
+ * (evaluated: an import or an expression is its value). Null when it does
597
+ * not build in the project's cache folder.
598
+ * @param {Ctx} ctx
599
+ * @param {string} slug
600
+ * @returns {Promise<{own: Map<string, string | null>, tops: Map<string, string | null>, shapes: Map<string, BuiltShape>, typography: any} | null>}
601
+ */
602
+ export function evaluatedTheme(ctx: Ctx, slug: string): Promise<{
603
+ own: Map<string, string | null>;
604
+ tops: Map<string, string | null>;
605
+ shapes: Map<string, BuiltShape>;
606
+ typography: any;
607
+ } | null>;
433
608
  /**
434
609
  * The refusal of a [light, dark] pair on tokens that are not colors.
435
610
  * @param {string} slug
@@ -460,6 +635,15 @@ export function buildTheme(ctx: Ctx, slug: string, data: ThemeData): Promise<{
460
635
  lifted: string[];
461
636
  notes: string[];
462
637
  }>;
638
+ /**
639
+ * The one color mode of a light-only or dark-only theme, from its settings,
640
+ * for the build to write into the built module (`colorModes`); null for a
641
+ * theme with both modes.
642
+ * @param {string} cwd
643
+ * @param {string} slug
644
+ * @returns {['light'] | ['dark'] | null}
645
+ */
646
+ export function buildColorModes(cwd: string, slug: string): ["light"] | ["dark"] | null;
463
647
  /**
464
648
  * Why the built outputs differ from what the theme builds now: one that is
465
649
  * missing or changed by hand, found the way `compile --check` finds it
@@ -479,6 +663,14 @@ export function resolvedTokens(ctx: Ctx, slug: string): Promise<{
479
663
  light: Record<string, string>;
480
664
  dark: Record<string, string>;
481
665
  }>;
666
+ /**
667
+ * Why a token value is not one, with a value of the token's own type to
668
+ * write instead (a size in px, a weight as a number in quotes), or none.
669
+ * @param {Ctx} ctx
670
+ * @param {string} slug
671
+ * @param {[string, unknown, ('object' | 'pair' | 'unit' | 'value' | 'mode')?]} bad
672
+ */
673
+ export function nonTextMessage(ctx: Ctx, slug: string, [name, value, kind]: [string, unknown, ("object" | "pair" | "unit" | "value" | "mode")?]): string;
482
674
  /**
483
675
  * Contrast problems this theme caused: text below 4.5:1 that was not as low
484
676
  * in the base theme. A part's own color or background setting, or a token
@@ -493,8 +685,14 @@ export function contrastProblems(ctx: Ctx, data: ThemeData, res: {
493
685
  dark: Record<string, string>;
494
686
  }): Promise<string[]>;
495
687
  /**
496
- * Whether parsed settings have the shape the editor reads: an object with a
497
- * list of settings.
688
+ * Whether every settings entry has the parts the editor reads (a thing, a
689
+ * value and a source); one without is damage `new` keeps aside.
690
+ * @param {any} data
691
+ */
692
+ export function settingsEntriesOk(data: any): any;
693
+ /**
694
+ * Whether settings data has the shape the editor reads: an object with a
695
+ * settings list.
498
696
  * @param {any} data
499
697
  */
500
698
  export function settingsShapeOk(data: any): boolean;
@@ -676,6 +874,13 @@ export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history,
676
874
  notes: string[];
677
875
  unchanged: boolean;
678
876
  }>;
877
+ /**
878
+ * The @fontsource package named for a font family (`Open Sans` is
879
+ * `@fontsource/open-sans`).
880
+ * @param {string} family
881
+ * @returns {string}
882
+ */
883
+ export function fontsourcePackageOf(family: string): string;
679
884
  /** @param {Ctx} ctx @param {ThemeData} data */
680
885
  export function fontPackages(ctx: Ctx, data: ThemeData): {
681
886
  pkg: string;
@@ -683,11 +888,11 @@ export function fontPackages(ctx: Ctx, data: ThemeData): {
683
888
  installed: boolean;
684
889
  of: Setting;
685
890
  }[];
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 */
891
+ /** @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, sizeNotes?: string[], compileNotes?: string[], derived?: Record<string, Array<{property: string, vars?: string[], replaces?: boolean, expand?: string}>>}} Ctx */
687
892
  /** @typedef {import('./_parts.mjs').PaintSide} PaintSide */
688
893
  /** @typedef {import('./_parts.mjs').TextPair} TextPair */
689
894
  /** 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)";
895
+ 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, com0-com9, lpt0-lpt9, and com\u00B9-com\u00B3, lpt\u00B9-lpt\u00B3)";
691
896
  export function slugOk(s: string): boolean;
692
897
  export function windowsReserved(s: string): boolean;
693
898
  export function slugFor(name: unknown): string;
@@ -713,6 +918,35 @@ export const EDITOR_SUFFIXES: string[];
713
918
  export function isEditorFile(slug: string, n: string): boolean;
714
919
  /** The undo steps a theme keeps; older ones are dropped. */
715
920
  export const HISTORY_STEPS: 80;
921
+ /**
922
+ * One entry of the top-level `tokens` map in a theme's own source, as
923
+ * written: its token (null for a computed key no read of the file can
924
+ * resolve), the key as typed, the line that sets it, and its value's shape.
925
+ * A `duplicate` entry names a second `tokens` key (with every line); a
926
+ * `typography` entry is one typography field (its dotted key and value);
927
+ * an `unresolved` entry says the map holds something only a build reads.
928
+ */
929
+ export type OwnTokenEntry = {
930
+ token: string | null;
931
+ key: string;
932
+ line: number | null;
933
+ kind: "text" | "number" | "pair" | "object" | "other" | "duplicate" | "typography" | "unresolved";
934
+ value?: any;
935
+ halves?: Array<string | number | undefined>;
936
+ lines?: Array<number | null>;
937
+ file?: string;
938
+ overridden?: boolean;
939
+ expression?: boolean;
940
+ };
941
+ /**
942
+ * What a built module writes for a top-level token: text, a number, an
943
+ * object, a pair (each half), or something else.
944
+ */
945
+ export type BuiltShape = {
946
+ kind: "text" | "number" | "object" | "pair" | "other";
947
+ value?: any;
948
+ halves?: unknown[];
949
+ };
716
950
  /**
717
951
  * One setting the CLI owns.
718
952
  */
@@ -777,6 +1011,8 @@ export type Ctx = {
777
1011
  alpha?: string;
778
1012
  }>> | null;
779
1013
  keepRadii?: Record<string, string> | null;
1014
+ sizeNotes?: string[];
1015
+ compileNotes?: string[];
780
1016
  derived?: Record<string, Array<{
781
1017
  property: string;
782
1018
  vars?: string[];
@@ -786,6 +1022,7 @@ export type Ctx = {
786
1022
  };
787
1023
  export type PaintSide = import("./_parts.mjs").PaintSide;
788
1024
  export type TextPair = import("./_parts.mjs").TextPair;
1025
+ import { AstryxError } from '../error.mjs';
789
1026
  import { modesOf } from './_palette.mjs';
790
1027
  /**
791
1028
  * What a part reads for a property when the theme does not set it, so a