@astryxdesign/cli 0.7.18-canary.gfca8508 → 0.7.18

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 (341) hide show
  1. package/CHANGELOG.md +185 -19
  2. package/README.md +19 -19
  3. package/api/component/_adapter.d.mts +2 -1
  4. package/api/component/_adapter.mjs +2 -1
  5. package/api/docs/_adapter.d.mts +6 -5
  6. package/api/docs/_adapter.mjs +36 -5
  7. package/api/doctor/_adapter.d.mts +6 -3
  8. package/api/doctor/_adapter.mjs +13 -5
  9. package/api/doctor/doctor.mjs +2 -2
  10. package/api/doctor/font-packages.d.mts +36 -0
  11. package/api/doctor/font-packages.mjs +124 -0
  12. package/api/doctor/theme-checks.mjs +110 -49
  13. package/api/experimental.d.mts +0 -2
  14. package/api/experimental.mjs +0 -12
  15. package/api/icon/_adapter.d.mts +1 -1
  16. package/api/icon/_adapter.mjs +1 -0
  17. package/api/icon/_authoring.mjs +17 -8
  18. package/api/icon/_default-look.mjs +15 -15
  19. package/api/icon/add/add.mjs +9 -4
  20. package/api/icon/exportIconIndex.doc.mjs +1 -1
  21. package/api/icon/icon.doc.mjs +1 -1
  22. package/api/icon/icon.type.d.mts +33 -33
  23. package/api/icon/icon.type.mjs +45 -45
  24. package/api/icon/iconAdd.doc.mjs +1 -1
  25. package/api/icon/iconNewSet.doc.mjs +3 -3
  26. package/api/icon/iconUse.doc.mjs +5 -5
  27. package/api/icon/rankIconIndex.doc.mjs +1 -1
  28. package/api/icon/use/use.mjs +4 -4
  29. package/api/init/run/run.mjs +0 -1
  30. package/api/integration/add-helpers.mjs +1 -1
  31. package/api/render/_adapter.mjs +7 -1
  32. package/api/search/ORDERING.md +1 -1
  33. package/api/search/_candidate-score.mjs +20 -0
  34. package/api/search/_words.d.mts +8 -0
  35. package/api/search/_words.mjs +15 -0
  36. package/api/template/template.type.d.mts +2 -2
  37. package/api/template/template.type.mjs +2 -2
  38. package/api/theme/_adapter.mjs +19 -11
  39. package/api/theme/build/build.d.mts +19 -51
  40. package/api/theme/build/build.mjs +195 -189
  41. package/api/theme/build/font-warning.d.mts +19 -2
  42. package/api/theme/build/font-warning.mjs +46 -5
  43. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  44. package/api/theme/palette/generate/derive-look.mjs +108 -37
  45. package/api/theme/palette/generate/mapping.mjs +2 -0
  46. package/api/theme/template/template.d.mts +0 -17
  47. package/api/theme/template/template.mjs +1 -42
  48. package/api/theme/theme.type.d.mts +5 -4
  49. package/api/theme/theme.type.mjs +5 -4
  50. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  51. package/api/theme/themeRemove.doc.mjs +1 -1
  52. package/assets/codemods/transforms/v0.7.0/preserve-bottom-sheet-content-padding.mjs +3 -1
  53. package/assets/component-list.generated.json +1 -1
  54. package/assets/discover/official-packages.json +26 -2
  55. package/assets/docs/author-a-theme.doc.mjs +6 -5
  56. package/assets/docs/browser-support.doc.mjs +1 -0
  57. package/assets/docs/icons.doc.mjs +8 -7
  58. package/assets/docs/motion.doc.mjs +46 -0
  59. package/assets/docs/theme.doc.dense.mjs +6 -17
  60. package/assets/docs/theme.doc.mjs +6 -16
  61. package/assets/docs/theme.doc.zh.mjs +6 -16
  62. package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
  63. package/assets/docs/tree/font-setup.doc.mjs +30 -0
  64. package/assets/docs/tree/icon-sets.doc.mjs +1 -1
  65. package/assets/docs/tree/template-icons.doc.mjs +3 -3
  66. package/assets/docs/tree/tokens-color.doc.mjs +5 -0
  67. package/assets/docs/tree/tokens.doc.mjs +4 -3
  68. package/assets/docs/tree/updates.doc.mjs +1 -1
  69. package/assets/docs-routes.generated.json +1 -1
  70. package/assets/docs.generated.json +2 -2
  71. package/assets/icons/definitions/drag.doc.mjs +1 -0
  72. package/assets/search-catalog.generated.json +2 -2
  73. package/assets/self-audit.generated.json +1 -1
  74. package/assets/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +1 -1
  75. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +20 -10
  76. package/assets/templates/blocks/components/Card/SelectableCardShowcase.doc.mjs +1 -1
  77. package/assets/templates/blocks/components/Card/SelectableCardShowcase.tsx +36 -16
  78. package/assets/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsx +6 -0
  79. package/assets/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsx +6 -0
  80. package/assets/templates/blocks/components/Hooks/useIndicatorFocusRingHookUsage.doc.mjs +14 -0
  81. package/assets/templates/blocks/components/Hooks/useIndicatorFocusRingHookUsage.tsx +63 -0
  82. package/assets/templates/blocks/components/Hooks/useLongPressHookUsage.doc.mjs +29 -0
  83. package/assets/templates/blocks/components/Hooks/useLongPressHookUsage.tsx +237 -0
  84. package/assets/templates/blocks/components/SideNav/SideNavShowcase.tsx +10 -72
  85. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.doc.mjs +1 -1
  86. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +7 -7
  87. package/assets/templates/blocks/components/Table/TableCustomRowTable.doc.mjs +14 -0
  88. package/assets/templates/blocks/components/Table/TableCustomRowTable.tsx +96 -0
  89. package/assets/templates/components.generated.json +1 -1
  90. package/assets/templates/pages/ai-chat-landing/page.tsx +4 -0
  91. package/assets/templates/pages/dashboard-scorecard/page.tsx +26 -7
  92. package/assets/templates/pages/editor/page.tsx +13 -3
  93. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +2 -2
  94. package/assets/templates/themes/butter/butterTheme.ts +12 -10
  95. package/assets/templates/themes/butter/icons.tsx +2 -0
  96. package/assets/templates/themes/chocolate/chocolateTheme.ts +1 -0
  97. package/assets/templates/themes/chocolate/icons.tsx +2 -0
  98. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  99. package/assets/templates/themes/gothic/gothicTheme.ts +1 -0
  100. package/assets/templates/themes/gothic/icons.tsx +2 -0
  101. package/assets/templates/themes/matcha/icons.tsx +2 -0
  102. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +2 -2
  103. package/assets/templates/themes/matcha/matchaTheme.ts +1 -0
  104. package/assets/templates/themes/neutral/icons.tsx +2 -0
  105. package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +2 -2
  106. package/assets/templates/themes/neutral/neutralTheme.ts +1 -0
  107. package/assets/templates/themes/stone/icons.tsx +2 -0
  108. package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +1 -1
  109. package/assets/templates/themes/stone/stoneTheme.ts +1 -0
  110. package/assets/templates/themes/y2k/icons.tsx +2 -0
  111. package/assets/templates/themes/y2k/y2kTheme.ts +1 -0
  112. package/assets/theme.template.ts +9 -5
  113. package/authoring/config/parse.mjs +1 -1
  114. package/authoring/doctypes/base/type.ts +2 -3
  115. package/authoring/doctypes/component/component.doc.mjs +1 -1
  116. package/authoring/doctypes/icon-set/icon-names.mjs +1 -0
  117. package/authoring/integration/integration.doc.mjs +1 -1
  118. package/authoring/integration/type.ts +1 -1
  119. package/clients/cli/build-id.generated.json +1 -1
  120. package/clients/cli/commands/experimental/icon.mjs +7 -7
  121. package/clients/cli/commands/experimental/index.mjs +0 -5
  122. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +2 -2
  123. package/clients/cli/commands/experimental-icon-use.doc.mjs +4 -4
  124. package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
  125. package/clients/cli/commands/experimental.doc.mjs +2 -6
  126. package/clients/cli/commands/template.mjs +1 -1
  127. package/clients/cli/commands/theme-build.doc.mjs +8 -1
  128. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -1
  129. package/clients/cli/commands/theme-remove.doc.mjs +1 -1
  130. package/clients/cli/commands/theme.doc.mjs +1 -11
  131. package/clients/cli/commands/theme.mjs +110 -475
  132. package/clients/cli/commands.generated.json +1 -1
  133. package/clients/cli/index.mjs +4 -34
  134. package/clients/cli/lib/base-gate.mjs +2 -3
  135. package/clients/cli/lib/cli-error.mjs +8 -72
  136. package/clients/cli/lib/define-command.mjs +0 -19
  137. package/clients/cli/lib/json-shim.mjs +11 -633
  138. package/clients/cli/lib/manifest.mjs +0 -4
  139. package/clients/cli/lib/stray-option.mjs +1 -2
  140. package/clients/cli/manifest.generated.json +1 -1
  141. package/foundation/agent-docs/agent-docs.mjs +1 -1
  142. package/foundation/color/css-color.mjs +2 -3
  143. package/foundation/discovery/app-layout.d.mts +13 -0
  144. package/foundation/discovery/app-layout.mjs +35 -0
  145. package/foundation/discovery/fixture-refs.d.mts +51 -0
  146. package/foundation/discovery/fixture-refs.mjs +351 -0
  147. package/foundation/discovery/icon-definition-discovery.mjs +1 -1
  148. package/foundation/discovery/icon-ranking.mjs +2 -2
  149. package/foundation/discovery/icon-set-checks.mjs +1 -1
  150. package/foundation/discovery/icon-set-discovery.mjs +1 -1
  151. package/foundation/discovery/icon-set-writer.d.mts +24 -7
  152. package/foundation/discovery/icon-set-writer.mjs +66 -22
  153. package/foundation/discovery/static-descriptor.d.mts +49 -0
  154. package/foundation/discovery/static-descriptor.mjs +548 -0
  155. package/foundation/discovery/template-adapter.d.mts +0 -47
  156. package/foundation/discovery/template-adapter.mjs +1 -333
  157. package/foundation/discovery/theme-discovery.d.mts +6 -47
  158. package/foundation/discovery/theme-discovery.mjs +15 -537
  159. package/foundation/doc-compiler/import.mjs +1 -1
  160. package/foundation/env/user-dirs.d.mts +5 -2
  161. package/foundation/env/user-dirs.mjs +12 -5
  162. package/foundation/fonts/next-font.d.mts +26 -0
  163. package/foundation/fonts/next-font.mjs +149 -0
  164. package/foundation/fs/empty-folder.mjs +2 -2
  165. package/foundation/fs/read-record.mjs +11 -4
  166. package/foundation/pictures/pictures.d.mts +1 -45
  167. package/foundation/pictures/pictures.mjs +8 -8
  168. package/foundation/release/folder-lock.mjs +3 -2
  169. package/foundation/render/cut-short.d.mts +2 -2
  170. package/foundation/render/cut-short.mjs +2 -2
  171. package/foundation/render/drawn-contrast.d.mts +2 -2
  172. package/foundation/render/drawn-contrast.mjs +2 -2
  173. package/foundation/render/font-probe.d.mts +2 -2
  174. package/foundation/render/font-probe.mjs +2 -2
  175. package/foundation/render/layers.mjs +1 -2
  176. package/foundation/render/package-resolve-hooks.d.mts +25 -5
  177. package/foundation/render/package-resolve-hooks.mjs +77 -14
  178. package/foundation/render/page-worker.mjs +24 -12
  179. package/foundation/render/part-boxes.d.mts +2 -3
  180. package/foundation/render/part-boxes.mjs +2 -3
  181. package/foundation/render/picture-chrome.mjs +5 -0
  182. package/foundation/render/render-page.d.mts +1 -1
  183. package/foundation/render/render-page.mjs +4 -5
  184. package/foundation/render/single-copy-hooks.d.mts +2 -0
  185. package/foundation/render/single-copy-hooks.mjs +2 -0
  186. package/foundation/response/error-codes.doc.mjs +14 -14
  187. package/foundation/response/error-codes.mjs +13 -13
  188. package/foundation/response/response-types.doc.mjs +7 -68
  189. package/foundation/runtime/css-tree.mjs +2 -2
  190. package/foundation/runtime/word-table.d.mts +1 -1
  191. package/foundation/runtime/word-table.mjs +1 -1
  192. package/foundation/suggest/other-command.d.mts +52 -15
  193. package/foundation/suggest/other-command.mjs +168 -45
  194. package/foundation/text/suggest-order.d.mts +7 -0
  195. package/foundation/text/suggest-order.mjs +1 -1
  196. package/package.json +7 -8
  197. package/api/theme-edit/_adapter.d.mts +0 -228
  198. package/api/theme-edit/_adapter.mjs +0 -2025
  199. package/api/theme-edit/_catalog.d.mts +0 -172
  200. package/api/theme-edit/_catalog.mjs +0 -806
  201. package/api/theme-edit/_check.d.mts +0 -391
  202. package/api/theme-edit/_check.mjs +0 -9370
  203. package/api/theme-edit/_color.d.mts +0 -135
  204. package/api/theme-edit/_color.mjs +0 -480
  205. package/api/theme-edit/_compiler.d.mts +0 -77
  206. package/api/theme-edit/_compiler.mjs +0 -1053
  207. package/api/theme-edit/_context.d.mts +0 -399
  208. package/api/theme-edit/_context.mjs +0 -1778
  209. package/api/theme-edit/_css.d.mts +0 -169
  210. package/api/theme-edit/_css.mjs +0 -1167
  211. package/api/theme-edit/_edit.d.mts +0 -167
  212. package/api/theme-edit/_edit.mjs +0 -11220
  213. package/api/theme-edit/_how-commands.d.mts +0 -315
  214. package/api/theme-edit/_how-commands.mjs +0 -1664
  215. package/api/theme-edit/_how-question.d.mts +0 -341
  216. package/api/theme-edit/_how-question.mjs +0 -33339
  217. package/api/theme-edit/_how-sides.d.mts +0 -22
  218. package/api/theme-edit/_how-sides.mjs +0 -173
  219. package/api/theme-edit/_how-steps.d.mts +0 -42
  220. package/api/theme-edit/_how-steps.mjs +0 -208
  221. package/api/theme-edit/_how-values.d.mts +0 -29
  222. package/api/theme-edit/_how-values.mjs +0 -111
  223. package/api/theme-edit/_how-words.d.mts +0 -15
  224. package/api/theme-edit/_how-words.mjs +0 -239
  225. package/api/theme-edit/_how.d.mts +0 -55
  226. package/api/theme-edit/_how.mjs +0 -2388
  227. package/api/theme-edit/_importers.d.mts +0 -38
  228. package/api/theme-edit/_importers.mjs +0 -188
  229. package/api/theme-edit/_marks.d.mts +0 -39
  230. package/api/theme-edit/_marks.mjs +0 -67
  231. package/api/theme-edit/_missed.d.mts +0 -56
  232. package/api/theme-edit/_missed.mjs +0 -1128
  233. package/api/theme-edit/_name-rule.d.mts +0 -11
  234. package/api/theme-edit/_name-rule.mjs +0 -12
  235. package/api/theme-edit/_normal.d.mts +0 -365
  236. package/api/theme-edit/_normal.mjs +0 -1978
  237. package/api/theme-edit/_overview.d.mts +0 -9
  238. package/api/theme-edit/_overview.mjs +0 -293
  239. package/api/theme-edit/_palette.d.mts +0 -616
  240. package/api/theme-edit/_palette.mjs +0 -2776
  241. package/api/theme-edit/_part-pieces.d.mts +0 -54
  242. package/api/theme-edit/_part-pieces.mjs +0 -179
  243. package/api/theme-edit/_part-words.d.mts +0 -39
  244. package/api/theme-edit/_part-words.mjs +0 -242
  245. package/api/theme-edit/_parts.d.mts +0 -402
  246. package/api/theme-edit/_parts.mjs +0 -2322
  247. package/api/theme-edit/_picture-traits.d.mts +0 -259
  248. package/api/theme-edit/_picture-traits.mjs +0 -1030
  249. package/api/theme-edit/_png.d.mts +0 -94
  250. package/api/theme-edit/_png.mjs +0 -479
  251. package/api/theme-edit/_preview-app.d.mts +0 -172
  252. package/api/theme-edit/_preview-app.mjs +0 -6430
  253. package/api/theme-edit/_preview.d.mts +0 -484
  254. package/api/theme-edit/_preview.mjs +0 -2775
  255. package/api/theme-edit/_project.d.mts +0 -207
  256. package/api/theme-edit/_project.mjs +0 -643
  257. package/api/theme-edit/_resolved.d.mts +0 -46
  258. package/api/theme-edit/_resolved.mjs +0 -800
  259. package/api/theme-edit/_set-line.d.mts +0 -29
  260. package/api/theme-edit/_set-line.mjs +0 -100
  261. package/api/theme-edit/_settings.d.mts +0 -2426
  262. package/api/theme-edit/_settings.mjs +0 -18449
  263. package/api/theme-edit/_tables.d.mts +0 -227
  264. package/api/theme-edit/_tables.mjs +0 -1128
  265. package/api/theme-edit/_text-looks.d.mts +0 -78
  266. package/api/theme-edit/_text-looks.mjs +0 -376
  267. package/api/theme-edit/_vet.d.mts +0 -50
  268. package/api/theme-edit/_vet.mjs +0 -166
  269. package/api/theme-edit/how/how.d.mts +0 -17
  270. package/api/theme-edit/how/how.mjs +0 -28
  271. package/api/theme-edit/new/new.d.mts +0 -11
  272. package/api/theme-edit/new/new.mjs +0 -22
  273. package/api/theme-edit/preview-add/preview-add.d.mts +0 -14
  274. package/api/theme-edit/preview-add/preview-add.mjs +0 -25
  275. package/api/theme-edit/preview-app/preview-app.d.mts +0 -13
  276. package/api/theme-edit/preview-app/preview-app.mjs +0 -24
  277. package/api/theme-edit/preview-list/preview-list.d.mts +0 -10
  278. package/api/theme-edit/preview-list/preview-list.mjs +0 -21
  279. package/api/theme-edit/preview-remove/preview-remove.d.mts +0 -12
  280. package/api/theme-edit/preview-remove/preview-remove.mjs +0 -23
  281. package/api/theme-edit/set/set.d.mts +0 -13
  282. package/api/theme-edit/set/set.mjs +0 -24
  283. package/api/theme-edit/show/show.d.mts +0 -13
  284. package/api/theme-edit/show/show.mjs +0 -24
  285. package/api/theme-edit/theme-edit.d.mts +0 -12
  286. package/api/theme-edit/theme-edit.mjs +0 -36
  287. package/api/theme-edit/theme-edit.type.d.mts +0 -730
  288. package/api/theme-edit/theme-edit.type.mjs +0 -342
  289. package/api/theme-edit/themeEditHow.doc.d.mts +0 -6
  290. package/api/theme-edit/themeEditHow.doc.mjs +0 -105
  291. package/api/theme-edit/themeEditNew.doc.d.mts +0 -5
  292. package/api/theme-edit/themeEditNew.doc.mjs +0 -112
  293. package/api/theme-edit/themeEditPreviewAdd.doc.d.mts +0 -6
  294. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +0 -121
  295. package/api/theme-edit/themeEditPreviewApp.doc.d.mts +0 -6
  296. package/api/theme-edit/themeEditPreviewApp.doc.mjs +0 -87
  297. package/api/theme-edit/themeEditPreviewList.doc.d.mts +0 -6
  298. package/api/theme-edit/themeEditPreviewList.doc.mjs +0 -62
  299. package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +0 -6
  300. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +0 -96
  301. package/api/theme-edit/themeEditSet.doc.d.mts +0 -6
  302. package/api/theme-edit/themeEditSet.doc.mjs +0 -175
  303. package/api/theme-edit/themeEditShow.doc.d.mts +0 -6
  304. package/api/theme-edit/themeEditShow.doc.mjs +0 -118
  305. package/api/theme-edit/themeEditUndo.doc.d.mts +0 -6
  306. package/api/theme-edit/themeEditUndo.doc.mjs +0 -133
  307. package/api/theme-edit/undo/undo.d.mts +0 -13
  308. package/api/theme-edit/undo/undo.mjs +0 -24
  309. package/assets/preview-app/README.md +0 -6
  310. package/assets/preview-app/css.d.ts +0 -5
  311. package/assets/preview-app/gitignore +0 -4
  312. package/assets/preview-app/next.config.mjs +0 -12
  313. package/assets/preview-app/package.json +0 -24
  314. package/assets/preview-app/src/app/globals.css +0 -6
  315. package/assets/preview-app/src/app/layout.tsx +0 -21
  316. package/assets/preview-app/src/app/page.tsx +0 -94
  317. package/assets/preview-app/src/app/providers.tsx +0 -16
  318. package/assets/preview-app/tsconfig.json +0 -27
  319. package/clients/cli/commands/experimental/theme.mjs +0 -2990
  320. package/clients/cli/commands/experimental-theme-add.doc.mjs +0 -80
  321. package/clients/cli/commands/experimental-theme-compile.doc.mjs +0 -98
  322. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +0 -196
  323. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +0 -174
  324. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +0 -139
  325. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +0 -77
  326. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +0 -105
  327. package/clients/cli/commands/experimental-theme-editor.doc.mjs +0 -49
  328. package/clients/cli/commands/experimental-theme-eject.doc.mjs +0 -72
  329. package/clients/cli/commands/experimental-theme-list.doc.mjs +0 -49
  330. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +0 -88
  331. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +0 -61
  332. package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +0 -48
  333. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +0 -59
  334. package/clients/cli/commands/experimental-theme-preview.doc.mjs +0 -41
  335. package/clients/cli/commands/experimental-theme-remove.doc.mjs +0 -57
  336. package/clients/cli/commands/experimental-theme-targets.doc.mjs +0 -62
  337. package/clients/cli/commands/experimental-theme-template.doc.mjs +0 -63
  338. package/clients/cli/commands/experimental-theme-use.doc.mjs +0 -57
  339. package/clients/cli/commands/experimental-theme.doc.mjs +0 -60
  340. package/foundation/fonts/fontsource-families.generated.d.mts +0 -5
  341. package/foundation/fonts/fontsource-families.generated.mjs +0 -2110
@@ -1,342 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Colocated types for `astryx experimental theme editor`: the source of truth
5
- * for its option and response shapes.
6
- *
7
- * @position api/theme-edit — typedefs for api/theme-edit/theme-edit.mjs
8
- */
9
-
10
- /**
11
- * One setting a theme made by `experimental theme editor` holds.
12
- * @experimental May change or be removed in a patch release.
13
- * @typedef {object} ThemeEditSetting
14
- * @property {string} thing - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
15
- * @property {string} value - The value as stored (a dial step is stored as the rung it reached).
16
- * @property {'dial' | 'token' | 'property'} source - What kind of thing it is.
17
- * @property {string} [on] - The part, group, or typography role it applies to; absent for the whole theme.
18
- * @property {string} [when] - `<prop>:<value>`: only that variant.
19
- * @property {string} [state] - Only that state.
20
- * @property {'light' | 'dark'} [mode] - Only that color mode.
21
- * @property {boolean} [only] - One member of an always-alike group, not the whole group.
22
- * @property {string} [axis] - For the `headings` dial: `weight` or `tracking`.
23
- * @property {string} [note] - What the check found worth saying (what the token feeds, parts it misses).
24
- */
25
-
26
- /**
27
- * @experimental May change or be removed in a patch release.
28
- * @typedef {object} ThemeEditNewOptions
29
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
30
- * @property {string} [like] - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
31
- * @property {boolean} [png] - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
32
- * @property {Record<string, string | string[] | undefined>} [settings] - Dial settings to start with, by dial name (`{accent: '#7c3aed', corners: 'round', vibrancy: '60'}`), each checked as `set` checks it; every dial but `base` (use `like`). `headings` takes a list for a weight and a tracking.
33
- */
34
-
35
- /**
36
- * @experimental May change or be removed in a patch release.
37
- * @typedef {object} ThemeEditChangeOptions
38
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
39
- * @property {string} [on] - A part (`button`), a group (`inputs`), or for `font` a role (`heading`).
40
- * @property {string} [when] - `<prop>:<value>`: only that variant, such as `variant:primary`.
41
- * @property {string} [state] - Only that state, such as `hover`.
42
- * @property {string} [mode] - `light` or `dark`: only that color mode (colors only; a shadow is one value for both modes).
43
- * @property {boolean} [only] - With a member of an always-alike group (inputs, checks), style just that part.
44
- * @property {boolean} [png] - Also take PNG pictures of the preview.
45
- */
46
-
47
- /**
48
- * @experimental May change or be removed in a patch release.
49
- * @typedef {object} ThemeEditPreviewFields
50
- * @property {string | null} preview - The sample app page with the theme, one self-contained HTML file; null when the components could not be rendered.
51
- * @property {string[]} pictures - PNG pictures taken (only with `png`).
52
- * @property {string | null} pictureProblem - Why a picture was not taken (when some were, which were and which were not), and how to get a browser for it.
53
- * @property {{code: string, cause: string} | null} notChecked - Set when the change is saved but the components could not be rendered, so it was not checked and has no preview: the cause, such as two copies of React.
54
- * @property {string} [sheetStale] - Set when sheet.html (the sheet of every component, made by `show`) shows the theme as it was before this change: it says so at its top until `show` makes it again.
55
- * @property {string[]} [previewStale] - Files of the in-app theme preview that were not written again and still show the theme as it was: changed by hand, or a preview folder where a stopped preview change waits for the next preview command.
56
- * @property {string} see - One line on how to see the change: first a look that changes nothing in the app (the editor's preview.html, current after the change, and `png`, which takes pictures with no dev server; when this result's own picture run was blocked, what blocked it instead), then the in-app preview page most about it (Colors for a color, Components for a part, else Overview) at its own URL when there is a preview, and adding one to the app last, as an option. When the change could not be rendered, it names why instead of the editor's page.
57
- * @property {{wrote: string[]}} [appCopy] - Only the first time the theme's app copy is written (src/themes/<theme>/, a standard local theme `astryx theme add <theme>` takes, written again after every build): the files written.
58
- * @property {string} [appCopyStale] - Set when the app copy (src/themes/<theme>/) was not written: a file, folder or link of yours at one of its names; a link on the way to it (src/, src/themes/ or the copy's folder; the editor writes nothing through one); a file where src/, src/themes/ or the copy's folder goes; or a folder that cannot be written, or a write that failed (with the system's reason, such as not writable or the disk is full). The app keeps the theme as it was, and this says what is in the way and why.
59
- */
60
-
61
- /**
62
- * `astryx --json experimental theme editor new <theme>`.
63
- * @experimental May change or be removed in a patch release.
64
- * @typedef {object} ThemeEditNewResponse
65
- * @property {'themeEdit.new'} type
66
- * @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, settings: string[], notes: string[], problems: string[], wiring: string[], missed?: number, missedParts?: number, missedOn?: string[], missedWhere?: string[]} & ThemeEditPreviewFields} data - `settings`: the dial settings it started with; `missed`, `missedParts`, `missedOn`, `missedWhere`: what those settings did not reach, as a change reports it (left out when none); `notes`: font loading, and with `png` the text the sample page's pictures draw cut short; `wiring`: the steps that put the theme into this app (`theme add <theme>` for its app copy in src/themes/<theme>/, else the root file, its imports and the Theme around the app; what builds it).
67
- */
68
-
69
- /**
70
- * `astryx --json experimental theme editor set <theme> <thing> <value>`, and
71
- * `undo <theme> <thing>`, which removes one setting.
72
- * @experimental May change or be removed in a patch release.
73
- * @typedef {object} ThemeEditChangeResponse
74
- * @property {'themeEdit.set' | 'themeEdit.undo'} type
75
- * @property {ThemeEditChangeData} data
76
- */
77
-
78
- /**
79
- * One problem a theme has, with the command that fixes it: the text token
80
- * set where the text sits, or the border color, for the mode, to the black
81
- * or white that reads there. `fix` is null when no one command does (a
82
- * color the palette cannot make read: its note says what to change).
83
- * @experimental May change or be removed in a patch release.
84
- * @typedef {{problem: string, fix: string | null}} ThemeEditProblem
85
- */
86
-
87
- /**
88
- * @experimental May change or be removed in a patch release.
89
- * @typedef {object} ThemeEditChangeData
90
- * @property {string} theme
91
- * @property {'set' | 'undo'} action
92
- * @property {ThemeEditSetting} setting - The setting written, or for `undo` the one removed.
93
- * @property {{thing: string, value: string, sides: ThemeEditSetting[]}} [asSides] - On `set` of a box shorthand a part takes one length of (a menu's `padding '5px 0'`): the value typed and the sides written for it in this change, `setting` being the first.
94
- * @property {string} [now] - On `undo`: what applies instead of the setting removed: a dial that still writes the token (such as the generated accent color), a whole-theme setting of the same thing, or the base theme's value.
95
- * @property {ThemeEditSetting} [removed] - On `undo`: the setting removed (the same as `setting`); the value now in effect is the base theme's, and `changedTokens` lists it.
96
- * @property {ThemeEditSetting[]} [alsoRemoved] - On `undo` of a setting listed more than once by hand: the other entries, removed with it.
97
- * @property {ThemeEditSetting | null} replaced - The setting this one replaced.
98
- * @property {string | null} was - For `base`, `mode` and a whole-theme dial: the value before.
99
- * @property {string[]} parts - The parts it styles (a group's members when it spread).
100
- * @property {{name: string, members: string[], onlyHint: boolean} | null} group - The group it spread to; `onlyHint` when `--only` would style one member.
101
- * @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`. The category colors (badges, tokens, card tints) and chart colors that moved with the look are counted in one line each.
102
- * @property {string[]} [changedPartTokens] - Changes to the custom properties the built stylesheet sets on parts, `name on <rule> (mode): before -> after` (a readable text color on a selected row). With `changedTokens`, every custom property whose built value moved.
103
- * @property {string[]} styled - Part styles and typography the change wrote.
104
- * @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
105
- * @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
106
- * @property {string[]} notes - What else to know: the shade a color's main token uses and any shade contrast moved, then the generated color files; font loading; what a token feeds; with `png`, the text the sample page's pictures draw cut short and the words they break inside the word, as the browser measured them (one note for each part, with its labels).
107
- * @property {Array<{note: string, run: string[]}>} leftOut - What a whole-theme change leaves out, each with the commands that reach it, one per part: the parts drawn as pills that square corners leave round; the surfaces a border width does not reach, and the dividers it moves. The text output prints it right under the status line.
108
- * @property {Array<{family: string, run: string[]}>} [fontNotLoaded] - The open fonts this set names whose package is not installed, each with the command that installs it; the previews and the app draw the next font in the stack until then. Left out when every one loads. The text output prints it right under the status line.
109
- * @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
110
- * @property {ThemeEditProblem[]} newProblems - What this change made unreadable or unseen, each with the command that fixes it: text and borders that read well before it, and the contrast checks the colors it made fail; with `png`, text the sample page's pictures draw cut short, with `flex-shrink 0` on its part when the browser measured that drawing it whole. The text output leads with them, under the status line.
111
- * @property {ThemeEditProblem[]} [leftProblems] - Problems the theme had that this change moved but left failing (a fill made darker, still not dark enough), each with what it was and the command that fixes it; left out when none. The text output says them under the new problems.
112
- * @property {number} [missed] - How many misses the theme's own changes left (show --json lists each, with the line that reaches it); the text output counts them near its top.
113
- * @property {number} [missedParts] - On how many parts those misses are (a part can miss two ways, its border and its shadow).
114
- * @property {string[]} [missedOn] - Those parts, in show's order; the text output names them.
115
- * @property {string[]} [missedWhere] - Where each of those parts keeps the base theme's look: the part, the variant its miss is in when it is one (`type:error`), then the state, or `at rest`; the text output names them.
116
- * @property {number} [missedNew] - How many of those misses this change brought (not there before it); the text output says the missed line only when it brought one.
117
- * @property {string[]} warnings - Warnings from the theme build.
118
- * @property {string | null} preview
119
- * @property {string[]} pictures
120
- * @property {string | null} pictureProblem
121
- * @property {{code: string, cause: string} | null} notChecked - Saved but not checked: see ThemeEditPreviewFields.
122
- * @property {string[]} [previewStale] - In-app preview files changed by hand: see ThemeEditPreviewFields.
123
- * @property {string} see - How to see the change: see ThemeEditPreviewFields.
124
- * @property {string} [sheetStale] - Set when sheet.html shows the theme as it was before this change: see ThemeEditPreviewFields.
125
- * @property {string} [appCopyStale] - Set when the app copy could not be written (something of yours at a copy name or on the way, or a write that failed): see ThemeEditPreviewFields.
126
- * @property {{wrote: string[]}} [appCopy] - Only the first time the theme's app copy is written: see ThemeEditPreviewFields.
127
- */
128
-
129
- /**
130
- * @experimental May change or be removed in a patch release.
131
- * @typedef {object} ThemeEditShowOptions
132
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
133
- * @property {string} [section] - Only one section of the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages.
134
- * @property {boolean} [png] - Also take PNG pictures of the previews.
135
- * @property {string} [on] - Only what one part shows, as a lookup that writes nothing (`themeEdit.showPart`); the theme may then be any theme the project builds.
136
- */
137
-
138
- /**
139
- * `astryx --json experimental theme editor show <theme>`.
140
- * @experimental May change or be removed in a patch release.
141
- * @typedef {object} ThemeEditShowResponse
142
- * @property {'themeEdit.show'} type
143
- * @property {object} data
144
- * @property {string} data.theme
145
- * @property {string | null} data.like
146
- * @property {string} data.mode
147
- * @property {Array<ThemeEditSetting & {parts: string[], masked?: string}>} data.settings - Each setting with the parts it styles; `masked` says what a later or stronger setting hides of it.
148
- * @property {Record<string, Record<string, string | null> | string | null>} data.resolved - Key tokens: colors and shadows per mode; sizes, numbers and fonts, which are the same in both modes, as one value.
149
- * @property {string[]} data.partValues - Each corners or spacing setting on a part or group, with what its parts get and the whole-theme value beside it.
150
- * @property {Array<{part: string, state?: string, why: string, line: string}>} data.missed - The parts the theme's own changes should have reached and did not, most flagged first, each with why and the line that reaches it (its steps joined with &&, the text on a fill changed with it): with the accent changed, a disabled variant drawn as the accent at reduced opacity, a selected look on the base's fill, a status fill whose color is not generated; with the page surfaces changed, an inverted surface that no longer stands out from the page; with the corners changed, a pill; with the border width changed, a borderless surface. A setting that covers the aspect takes a part off.
151
- * @property {string[]} data.unreached - The parts with a fill of their own the theme leaves on its base's look, most visible first: no setting is on them, and their fill or text color is still the base's (empty for a theme with no settings).
152
- * @property {number | null} data.vibrancy - How saturated the generated colors are (0 to 100); null when the theme sets no color.
153
- * @property {ThemeEditColor[]} data.colors - Each color the theme sets, with the shade each token uses.
154
- * @property {string[]} data.colorNotes - What the color config keeps or replaced of a hand edit, tokens that use another shade than usual so they read, and any that still do not.
155
- * @property {string[]} data.problems
156
- * @property {ThemeEditProblem[]} data.openProblems - Every contrast problem the theme has now: its text, its borders, and the checks its colors fail, each with the command that fixes it; with `png`, text the sample page's pictures draw cut short, with `flex-shrink 0` on its part when the browser measured that drawing it whole. The text output ends with them.
157
- * @property {string[]} data.notes - What else to know; with `png`, the text the sample page's pictures draw cut short and the words they break inside the word, as the browser measured them (one note for each part, with its labels).
158
- * @property {string} data.preview
159
- * @property {string[]} [data.previewStale] - In-app preview files changed by hand, so they were not written again and still show the theme as it was.
160
- * @property {string} data.sheet - The theme-building page with every component.
161
- * @property {number} data.sheetComponents
162
- * @property {string[]} data.skipped - Template pages left out, with the install line each needs.
163
- * @property {string[]} data.pictures
164
- * @property {string | null} data.pictureProblem
165
- * @property {string} [data.look] - With `png`, when the run took them: the pictures to open: with show's full sheet, the picture of each family of components the theme sets a part of (of the buttons when it sets none) first (sheet-<family>.png, or, for a family taller than 1600px, the pictures cut from it in order: sheet-<family>-1.png, -2 …); with --section pages, the pages pictures (sheet-pages-1.png, -2 … for a tall one); then the sample page's and the open states' (each control at rest, hovered, focused and pressed at its top, then every menu, tooltip, popover and list drawn open). The text output says it first and last.
166
- * @property {{config: string, module: string, receipt: string} | null} data.colorFiles - The generated color files: the input (in the shape `theme palette generate` reads), the module the theme imports, and the receipt; null when the theme sets no color.
167
- * @property {{wrote: string[]}} [data.appCopy] - Only the first time the theme's app copy is written: the files written in src/themes/<theme>/.
168
- * @property {string} [data.appCopyStale] - Set when the app copy was not written: a file, folder or link of yours at one of its names; a link on the way to it (src/, src/themes/ or the copy's folder; the editor writes nothing through one); a file where src/, src/themes/ or the copy's folder goes; or a folder that cannot be written, or a write that failed (with the system's reason, such as not writable or the disk is full).
169
- * @property {string[]} data.wiring - The steps that put the theme into this app: the root file, its imports, the Theme around the app, and what builds it (`theme add <theme>`, for the app copy the editor writes in src/themes/<theme>/; the imports by hand when a folder of yours is there).
170
- */
171
-
172
- /**
173
- * `astryx --json experimental theme editor show <theme> --on <part>`: what one
174
- * part of a theme shows. Nothing is written.
175
- * @experimental May change or be removed in a patch release.
176
- * @typedef {object} ThemeEditShowPartResponse
177
- * @property {'themeEdit.showPart'} type
178
- * @property {object} data
179
- * @property {string} data.theme
180
- * @property {'editor' | 'local' | 'package' | 'bundled'} data.kind - Where the theme comes from: the editor's themes/ folder, a local theme of the app, an installed package's theme, or a bundled theme package. An editor theme is read from its saved settings: what a person adds by hand below them in its theme file is not shown yet.
181
- * @property {string} data.part
182
- * @property {ThemeEditPartValue[]} data.values - Each CSS property the part reads, at rest (`when` null) and in each variant. Which setting gives a value (a token, a dial, a rule on the part) is not shown yet; `source` says whose it is.
183
- */
184
-
185
- /**
186
- * One property of a part, as `show --on` gives it.
187
- * @experimental May change or be removed in a patch release.
188
- * @typedef {object} ThemeEditPartValue
189
- * @property {string} property - The CSS property.
190
- * @property {string | null} when - The variant, as `set` takes `--when` (`variant:outlined`); null at rest. For a condition no flag of `set` reaches, the condition as Core writes it, with `notSettable`.
191
- * @property {string | null} state - The state, as `set` takes `--state`; null for none (and for a condition no flag reaches).
192
- * @property {string} [notSettable] - Only for a condition no flag of `set` reaches (a CSS selector such as `:first-child`): why, as `how <part>` says it.
193
- * @property {string | {light?: string | null, dark?: string | null} | null} value - The final value, every token written out; per mode when the modes differ; null when a token it reads has no value. A mode is left out where it is not shown yet (the other mode of a property or token a one-mode block sets on the part, with nothing else under that condition).
194
- * @property {string | {light?: string, dark?: string}} expression - The declaration that gives it, as written: Core's, or the rule on the part; per mode when a rule sets one mode (a one-mode theme, or a `--mode` setting).
195
- * @property {string[] | {light?: string[], dark?: string[]}} tokens - The tokens it reads, and the tokens those read in turn, in order; per mode when the modes read different ones.
196
- * @property {'core' | 'base' | 'theme'} source - Who decides the value (not a setting's source, as in `show`'s settings): Core's default, the base theme the theme extends, or the theme's own file, a setting on the part included.
197
- */
198
-
199
- /**
200
- * One color of a theme, as `show` reports it.
201
- * @experimental May change or be removed in a patch release.
202
- * @typedef {object} ThemeEditColor
203
- * @property {string} color - The setting that makes it: accent, neutral, success, warning, danger or info.
204
- * @property {string} seed - The color it is generated from, as hex.
205
- * @property {Record<string, string>} tokens - The shade each token uses: `light <shade> <hex>, dark <shade> <hex>`, and whether an exact token setting wins.
206
- */
207
-
208
- /**
209
- * @experimental May change or be removed in a patch release.
210
- * @typedef {object} ThemeEditUndoOptions
211
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
212
- * @property {string} [thing] - Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change; the result's `now` says what applies instead.
213
- * @property {string} [value] - With `thing` `headings`: which half to remove, `weight` or `tracking`.
214
- * @property {string} [on] - With `thing`: the part, group or role it was set on.
215
- * @property {string} [when] - With `thing`: the variant it was set for.
216
- * @property {string} [state] - With `thing`: the state it was set for.
217
- * @property {string} [mode] - With `thing`: the mode it was set for.
218
- * @property {boolean} [only] - With `thing`: whether it was set with `--only`.
219
- * @property {boolean} [png] - Also take PNG pictures of the preview.
220
- */
221
-
222
- /**
223
- * `astryx --json experimental theme editor undo <theme>`: one step back.
224
- * With a thing, undo returns a {@link ThemeEditChangeResponse} instead.
225
- * @experimental May change or be removed in a patch release.
226
- * @typedef {object} ThemeEditUndoResponse
227
- * @property {'themeEdit.undo'} type
228
- * @property {{theme: string, action: 'step', undid: string, refusedBefore?: string, undone: string[], next?: string, settings: number, stepsLeft: number, changedTokens: string[], changedPartTokens?: string[], problems: string[], newProblems: ThemeEditProblem[], notes?: string[]} & ThemeEditPreviewFields} data - `undid` names what the step took back (each setting, base and mode, in one line); `refusedBefore` says a change command refused since the last change changed nothing, so the step took back the change before it; `next` names the change now on top, which the next undo takes back; `notes`, with `png`, the text the sample page's pictures draw cut short.
229
- */
230
-
231
- /**
232
- * @experimental May change or be removed in a patch release.
233
- * @typedef {object} ThemeEditPreviewAddOptions
234
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
235
- * @property {string} [theme] - The theme the pages wear: a theme made by `experimental theme editor` (default: the only one under themes/; with none or several, the app's own theme).
236
- * @property {string} [template] - Add this page template instead of ranking one from a description.
237
- * @property {number | string} [top] - With a description: how many of the best-fitting page templates to add, 1 to 3 (default 1). A string is taken as typed: only "1", "2" or "3".
238
- * @property {string} [path] - The folder of the preview route, inside the project (default: theme-preview/ in the app's routes folder, app/ or src/app/).
239
- */
240
-
241
- /**
242
- * `astryx --json experimental theme preview add [<description>]`.
243
- * @experimental May change or be removed in a patch release.
244
- * @typedef {object} ThemeEditPreviewAddResponse
245
- * @property {'themeEdit.previewAdd'} type
246
- * @property {object} data
247
- * @property {string} data.folder - The preview route folder.
248
- * @property {string | null} data.theme - The theme the pages wear; null for the app's own theme.
249
- * @property {string[]} data.added - Pages added by this call.
250
- * @property {string[]} data.refreshed - Pages that were there already and are written again.
251
- * @property {Array<{page: string, why: string}>} data.matched - Each template page added for a description or --template, and why it was picked.
252
- * @property {Array<{page: string, reason: string, installCommand: string | null, installGuidance?: string}>} data.skipped - Template pages not added: why (packages the app lacks, or a StyleX compiler it does not have), with the command that installs what is missing, and `installGuidance`, the line a loaded integration gives for adding them, when one is given.
253
- * @property {string[]} data.notes - What else to know.
254
- * @property {string[]} data.pages - Every page of the preview, in order.
255
- * @property {string[]} data.files - Every file the preview wrote.
256
- * @property {string} data.open - How to open the preview.
257
- * @property {Record<string, string>} data.urls - Each page's own URL in the running app (the preview's path with ?page=<id>), so any page can be opened or pictured; empty when no URL can be told.
258
- */
259
-
260
- /**
261
- * @experimental May change or be removed in a patch release.
262
- * @typedef {object} ThemeEditPreviewAppOptions
263
- * @property {string} [cwd] - The folder the app folder is inside (default: process.cwd()).
264
- * @property {string} [theme] - A theme made by `experimental theme editor` here: it is copied into the app, and the preview pages wear it (default: the app's own neutral theme).
265
- */
266
-
267
- /**
268
- * `astryx --json experimental theme preview app <dir>`.
269
- * @experimental May change or be removed in a patch release.
270
- * @typedef {object} ThemeEditPreviewAppResponse
271
- * @property {'themeEdit.previewApp'} type
272
- * @property {object} data
273
- * @property {string} data.folder - The new app folder.
274
- * @property {string | null} data.theme - The theme copied into the app, which the pages wear; null for the app's own neutral theme.
275
- * @property {string[]} data.pages - The preview pages.
276
- * @property {string[]} data.files - Every file written.
277
- * @property {string[]} data.notes - What else to know.
278
- * @property {string} data.open - How to install, run and open the app.
279
- * @property {Record<string, string>} data.urls - Each page's own URL once the app runs (/theme-preview?page=<id>).
280
- */
281
-
282
- /**
283
- * @experimental May change or be removed in a patch release.
284
- * @typedef {object} ThemeEditPreviewListOptions
285
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
286
- * @property {string} [path] - The folder of the preview route, when it is not in the default place.
287
- */
288
-
289
- /**
290
- * `astryx --json experimental theme preview list`.
291
- * @experimental May change or be removed in a patch release.
292
- * @typedef {object} ThemeEditPreviewListResponse
293
- * @property {'themeEdit.previewList'} type
294
- * @property {{folder: string | null, theme: string | null, themeMissing: boolean, pages: Array<{id: string, label: string, url?: string, missing?: boolean}>, notes: string[]}} data - `themeMissing`: the theme the preview wears is gone, so its route does not build; a page's `url`: its own URL in the running app; a page's `missing`: its file is gone; `notes`: what else to know, such as the command that fixes it.
295
- */
296
-
297
- /**
298
- * `astryx --json experimental theme preview remove [<page>]`.
299
- * @experimental May change or be removed in a patch release.
300
- * @typedef {object} ThemeEditPreviewRemoveResponse
301
- * @property {'themeEdit.previewRemove'} type
302
- * @property {object} data
303
- * @property {string} data.folder - The preview route folder.
304
- * @property {string[]} data.removed - Files deleted.
305
- * @property {string[]} data.kept - Files kept: changed by hand after the preview wrote them, or not written by it.
306
- * @property {string[]} data.missing - Files the preview had written that were gone already.
307
- * @property {string[]} data.rewritten - Files written again, so the route and the Colors page match the pages left.
308
- * @property {string[]} data.notes - What else to know.
309
- * @property {string[]} data.pages - The pages left, in order; empty when the whole preview was removed.
310
- */
311
-
312
- /**
313
- * @experimental May change or be removed in a patch release.
314
- * @typedef {object} ThemeEditHowOptions
315
- * @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
316
- * @property {string} [list] - List what a change can name: dials, tokens, parts, groups, or properties (any case, singular or plural); the subject filters it. An empty string or `kinds` lists the kinds.
317
- * @property {string} [theme] - The theme the suggested commands are for, checked against its settings (default: the only theme the editor made in the app; with several, the one an editor command changed last; with none, `my-theme`, which the answer makes first). An empty name is refused.
318
- * @property {string[]} [at] - With a PNG picture: pixel points x,y, whole numbers inside the picture ("40,20;300,180", "40,20 300,180", several entries, or a flat "40,20,300,180").
319
- * @property {number} [count] - With a PNG picture: how many main colors (default 14).
320
- * @property {string[]} [words] - The words as typed after `how`: a picture first takes only a count after it (the count is read from the words); anything else is one question. Replaces `subject`.
321
- */
322
-
323
- /**
324
- * One result of a plain-words question (`data.results`, `kind: 'question'`).
325
- * @experimental May change or be removed in a patch release.
326
- * @typedef {object} ThemeEditHowResult
327
- * @property {string} text - What the result does, or why it does nothing.
328
- * @property {string[]} commands - The commands, each checked as `set` checks it.
329
- * @property {boolean} [sequence] - Run every command in order.
330
- * @property {Array<{command: string, why: string, run?: string[]}>} [refused] - Commands left out, with the reason.
331
- * @property {boolean} [offer] - More than the ask (a colored variant changed too): never first, never the answer itself.
332
- */
333
-
334
- /**
335
- * `astryx --json experimental theme editor how <subject>`. `kind` says which answer it is.
336
- * @experimental May change or be removed in a patch release.
337
- * @typedef {object} ThemeEditHowResponse
338
- * @property {'themeEdit.how'} type
339
- * @property {{kind: 'part' | 'group' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, results?: ThemeEditHowResult[], [key: string]: any}} data
340
- */
341
-
342
- export {};
@@ -1,6 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /** @file FunctionDoc for `themeEditHow()` / `astryx experimental theme editor how`. */
5
- /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
- export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -1,105 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @file FunctionDoc for `themeEditHow()` / `astryx experimental theme editor how`. */
4
-
5
- /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
- export const doc = {
7
- type: 'function',
8
- kind: 'api',
9
- name: 'themeEditHow',
10
- namespace: 'cli/api',
11
- stability: 'experimental',
12
- displayName: 'themeEditHow()',
13
- summary:
14
- "Look up a part, group, setting or aspect; answer a question in plain words; read a picture's colors and look; or list what you can set.",
15
- description:
16
- 'One command for every question. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size), each condition written as the --when and --state flags `set` takes or marked not settable with the reason, its variants, every state `set` accepts, the parts inside it (a token set --on the part reaches them), and its group; a part the part data does not have says so, with commands that still apply. A group (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it (and, when none does, whether Core\'s stylesheet still uses it), or a CSS property and the parts that set it. An aspect (text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. `colors` (or `palette`): how the theme\'s colors are made: one seed per color, light and dark shades generated with the same generator as `theme palette generate`, the shade each token starts from, vibrancy, the Colors preview page and the exact-token escape hatch. A lookup takes any case, a plural, and a token name without its dashes. A question in plain words ("bold white text in the header", "remove shadows from cards", "cards: 8px radius; buttons: 4px"): it reads each clause for the parts (and their variant, size, state or mode), what to change, the values typed (hex, rgb(), lengths, dashed), and whether it asks for more, less or none ("shouldn\'t", "turn off", "never", "too sharp", "everything except X" included), and answers with exact commands; a typed value always wins over a color word, and a hex color with the wrong number of digits is refused by name, never replaced with a sample. "In dark mode" carries --mode dark to every color command; a change that cannot differ by mode, or a dark-mode ask on a light-only theme, says so instead. A question about what something is ("what does --color-accent do") gets the lookup. Several changes in one question come first as one sequence (`sequence: true`: run every command in order, at most 12), with repeated and overwritten steps left out; two asks that contradict each other are offered as choices. Changes come before lookups. A result with `offer: true` is more than the ask (a colored variant changed too): it follows every other result and is never the answer itself, so running the first result\'s commands never runs one; where what the ask writes is in place already, the first result says so with no command. Every suggested command names the theme (`theme`: the one named with `theme`, the only one, or the one an editor command changed last, said in `themeNote`; `themeChosenBy` says which: named, only, last-changed or none; with none, my-theme, made first), holds a real value, never a placeholder or a comment, and is checked as `set` checks it: a command `set` would refuse, or that changes nothing, is left out and listed in `refused` with the reason. A question with no answer says why in `hint`, with the next commands in `run`; the command\'s help (`astryx experimental theme editor how --help`) lists the kinds of ask it understands, with examples. A PNG picture (by any file name; other formats are refused by their bytes): its main colors from every pixel (on an even grid past 4 million), biggest share first, with where each sits, see-through pixels skipped, tRNS included (a number after the file sets how many, default 14), and the look\'s traits measured from its pixels (`look`; never recognized or named: boxes sorted only by shape into button-like, inputs, checks and containers): control height (set on the button and input families, each from its own boxes), the checks\' box (width and height at one size, per size, so a box stays square and a radio round), corners, edge width, how panels sit, the accent fill, line spacing read from a wrapped paragraph, and a heading weight only when it reads clearly regular, each a result with a checked command saying where it was read and from how many boxes, written only where enough boxes agree and, for controls, where more than one kind shows (a crop of badges alone writes none and says why); what too few show, and what no group setting makes yet (gradients, bevels, shadows on controls), or a picture cannot tell exactly (text size, a heading weight heavier than regular, line spacing with no wrapped paragraph, the typeface), is listed in `unsure` with the settings that would make it where one exists, never written; a trait the theme sets itself, for the whole theme or on the same part, a dial for the same aspect included (spacing, text-size, headings, type), keeps its value (`unsure` names the reading); a 144-dpi picture is read at 2x; a picture over 8 million pixels, or too grainy to hold boxes, keeps its colors and names its look as not measured. Or with --at the exact color and alpha at pixel points; a picture over 40 million pixels (20 million at 16 bits), or with pixel data that is damaged or shorter than its header says, is refused before it is decoded. --list <what> lists what a change can name (dials, tokens, parts, groups or properties, in any case, singular or plural; kinds or no word lists those kinds), and the other words filter the list. Experimental: it may change or be removed in a patch release.',
17
- importPath: '@astryxdesign/cli/api/experimental',
18
- signature:
19
- 'themeEditHow(subject?: string, options?: object): Promise<object>',
20
- keywords: [
21
- 'theme',
22
- 'experimental theme',
23
- 'help',
24
- 'design tokens',
25
- 'type-checked',
26
- ],
27
- params: [
28
- {
29
- name: 'subject',
30
- type: 'string',
31
- description:
32
- 'A part, group, setting, aspect, question, or PNG file; with `list`, a filter.',
33
- },
34
- {
35
- name: 'options.list',
36
- type: 'string',
37
- description:
38
- 'dials, tokens, parts, groups, or properties; an empty string lists the kinds.',
39
- },
40
- {
41
- name: 'options.theme',
42
- type: 'string',
43
- description:
44
- 'The theme the suggested commands are for (default: the only theme, the one an editor command changed last, or my-theme when there is none); an empty name is refused.',
45
- },
46
- {
47
- name: 'options.at',
48
- type: 'string[]',
49
- description: 'With a picture: pixel points x,y.',
50
- },
51
- {
52
- name: 'options.count',
53
- type: 'number',
54
- description: 'With a picture: how many main colors (default 14).',
55
- },
56
- {
57
- name: 'options.words',
58
- type: 'string[]',
59
- description:
60
- 'The words as typed: a picture first takes only a count after it; anything else is one question. Replaces the subject.',
61
- },
62
- {
63
- name: 'options.cwd',
64
- type: 'string',
65
- description: 'The app folder.',
66
- },
67
- ],
68
- returns: [
69
- {
70
- type: 'themeEdit.how',
71
- description:
72
- '`kind` says which answer it is: part (variants, states, reads per aspect with the flags for each condition, parts inside, group), group (members), setting, aspect or question (answers with checked commands for `theme`), picture (main colors and measured traits with checked commands, or the color and alpha at points), or list (the items).',
73
- },
74
- ],
75
- throws: [
76
- {
77
- code: 'ERR_MISSING_ARGUMENT',
78
- when: 'nothing named',
79
- },
80
- {
81
- code: 'ERR_INVALID_ARGUMENT',
82
- when: 'an empty `theme`, an unknown --list kind, --at without a picture, a picture that is not a PNG or is damaged or too big, an --at point that is not whole pixel numbers or falls outside the picture, a count beside --at, or a count that is not a positive whole number',
83
- },
84
- {
85
- code: 'ERR_FILE_NOT_FOUND',
86
- when: 'the picture does not exist',
87
- },
88
- {
89
- code: 'ERR_UNKNOWN_THEME',
90
- when: '`theme` names a theme the editor did not make',
91
- },
92
- {
93
- code: 'ERR_PROJECT_REQUIRED',
94
- when: '@astryxdesign/core is not installed in the folder',
95
- },
96
- ],
97
- examples: [
98
- {
99
- label: 'A part',
100
- code: 'await themeEditHow(...)',
101
- },
102
- ],
103
- command: 'experimental theme editor how',
104
- related: ['themeBuild'],
105
- };
@@ -1,5 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
5
- export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -1,112 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @file FunctionDoc for `themeEditNew()` / `astryx experimental theme editor new`. */
4
-
5
- import {NAME_RULE} from './_name-rule.mjs';
6
-
7
- /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
8
- export const doc = {
9
- type: 'function',
10
- kind: 'api',
11
- name: 'themeEditNew',
12
- namespace: 'cli/api',
13
- stability: 'experimental',
14
- displayName: 'themeEditNew()',
15
- summary: 'Start a theme in themes/<theme>/, optionally on a built-in theme.',
16
- description:
17
- 'Makes themes/<theme>/ with <theme>.settings.json (the settings this command owns), the generated <theme>.settings.ts, <theme>.theme.ts (which extends it and is yours), and the built <theme>.css and <theme>.js (build them again with `astryx experimental theme compile themes/<theme>/<theme>.theme.ts`, which checks the editor settings first), then writes preview.html, the sample app page with the theme. --like builds on a built-in theme (neutral, stone, matcha, y2k, gothic, chocolate, butter; its package must be installed); without it the theme starts from Astryx defaults. `settings` takes any `set` dial by name ({accent: "#7c3aed", font: "inter", corners: "round", vibrancy: "60"}): the same names, values and checks as `set`, all applied in the one build, with one result that lists them. Change the base later with `astryx experimental theme editor set <theme> base <theme|none>`. Afterwards, <theme>.theme.ts is yours: it extends the generated <theme>.settings.ts, and every later change rewrites only the settings files, so your own edits in <theme>.theme.ts survive. A theme name is ' +
18
- NAME_RULE +
19
- '. Experimental: it may change or be removed in a patch release.',
20
- importPath: '@astryxdesign/cli/api/experimental',
21
- signature: 'themeEditNew(theme: string, options?: object): Promise<object>',
22
- keywords: [
23
- 'theme',
24
- 'experimental theme',
25
- 'new',
26
- 'design tokens',
27
- 'type-checked',
28
- ],
29
- params: [
30
- {
31
- name: 'theme',
32
- type: 'string',
33
- description: `The theme name: ${NAME_RULE}.`,
34
- required: true,
35
- },
36
- {
37
- name: 'options.like',
38
- type: 'string',
39
- description: 'A built-in theme to build on.',
40
- },
41
- {
42
- name: 'options.png',
43
- type: 'boolean',
44
- description: 'Also take PNG pictures of the preview.',
45
- },
46
- {
47
- name: 'options.settings',
48
- type: 'Record<string, string>',
49
- description:
50
- 'Dial settings to start with, by dial name, each checked as `set` checks it: every dial but base (use `like`).',
51
- },
52
- {
53
- name: 'options.cwd',
54
- type: 'string',
55
- description:
56
- 'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
57
- },
58
- ],
59
- returns: [
60
- {
61
- type: 'themeEdit.new',
62
- description:
63
- 'The theme, its base, the files written, contrast problems, and the preview.',
64
- },
65
- ],
66
- throws: [
67
- {
68
- code: 'ERR_INVALID_ARGUMENT',
69
- when: `the name breaks the theme-name rule (${NAME_RULE}), or \`settings\` names something that is not a dial`,
70
- },
71
- {
72
- code: 'ERR_FILE_EXISTS',
73
- when: 'the theme, or files in its folder, already exist',
74
- },
75
- {
76
- code: 'ERR_THEME_BAD_VALUE',
77
- when: '`like` is not a built-in theme, or a setting has a value `set` refuses',
78
- },
79
- {
80
- code: 'ERR_THEME_NO_EFFECT',
81
- when: '`settings` has vibrancy and no color',
82
- },
83
- {
84
- code: 'ERR_UNKNOWN_THEME',
85
- when: 'the built-in theme is not installed; the suggestion is its install line',
86
- },
87
- {
88
- code: 'ERR_PROJECT_REQUIRED',
89
- when: '@astryxdesign/core is not installed in the folder',
90
- },
91
- {
92
- code: 'ERR_THEME_BUSY',
93
- when: 'another command is changing the same theme and did not finish within 30 seconds; nothing was changed',
94
- },
95
- {
96
- code: 'ERR_THEME_INVALID',
97
- when: 'the theme does not build',
98
- },
99
- {
100
- code: 'ERR_DEP_MISSING',
101
- when: "a package the build loads is broken in node_modules (it needs a package it declares, and that package is missing); the suggestion is the app's install command, or, when the run uses a CLI copy of its own (global, one-off or cached) and the app's install does not hold the package that needs it, the message names that copy (a release-cache copy: the folder to remove); nothing was changed",
102
- },
103
- ],
104
- examples: [
105
- {
106
- label: 'Start on a built-in theme',
107
- code: 'await themeEditNew(...)',
108
- },
109
- ],
110
- command: 'experimental theme editor new',
111
- related: ['themeBuild'],
112
- };
@@ -1,6 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /** @file FunctionDoc for `themeEditPreviewAdd()` / `astryx experimental theme preview add`. */
5
- /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
- export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;