@astryxdesign/cli 0.7.13 → 0.7.14-canary.108f354

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 (164) hide show
  1. package/README.md +18 -18
  2. package/api/component/__fixtures__/resolutions/modules.txt +1 -1
  3. package/api/doctor/doctor.mjs +3 -7
  4. package/api/experimental.d.mts +2 -0
  5. package/api/experimental.mjs +12 -0
  6. package/api/icon/_adapter.d.mts +10 -0
  7. package/api/icon/_adapter.mjs +31 -2
  8. package/api/icon/_authoring.d.mts +2 -1
  9. package/api/icon/_authoring.mjs +91 -6
  10. package/api/icon/_options.mjs +1 -0
  11. package/api/icon/_records.d.mts +18 -0
  12. package/api/icon/_records.mjs +26 -0
  13. package/api/icon/add/add.mjs +7 -1
  14. package/api/icon/definitions/definitions.d.mts +12 -0
  15. package/api/icon/definitions/definitions.mjs +83 -0
  16. package/api/icon/icon.doc.mjs +5 -4
  17. package/api/icon/icon.mjs +5 -16
  18. package/api/icon/icon.type.d.mts +29 -2
  19. package/api/icon/icon.type.mjs +17 -3
  20. package/api/icon/iconAdd.doc.mjs +1 -1
  21. package/api/icon/iconMap.doc.mjs +2 -2
  22. package/api/icon/iconNewSet.doc.mjs +8 -2
  23. package/api/icon/map/map.mjs +21 -2
  24. package/api/icon/new-set/new-set.mjs +14 -2
  25. package/api/icon/search/search.mjs +2 -15
  26. package/api/icon/use/use.mjs +4 -3
  27. package/api/integration/validate-integration.mjs +6 -1
  28. package/api/integration/validate-integration.type.d.mts +12 -0
  29. package/api/integration/validate-integration.type.mjs +5 -0
  30. package/api/theme-edit/_adapter.d.mts +116 -0
  31. package/api/theme-edit/_adapter.mjs +1683 -0
  32. package/api/theme-edit/_catalog.d.mts +59 -0
  33. package/api/theme-edit/_catalog.mjs +564 -0
  34. package/api/theme-edit/_check.d.mts +49 -0
  35. package/api/theme-edit/_check.mjs +845 -0
  36. package/api/theme-edit/_color.d.mts +29 -0
  37. package/api/theme-edit/_color.mjs +300 -0
  38. package/api/theme-edit/_compiler.d.mts +61 -0
  39. package/api/theme-edit/_compiler.mjs +522 -0
  40. package/api/theme-edit/_css-properties.d.mts +10 -0
  41. package/api/theme-edit/_css-properties.mjs +556 -0
  42. package/api/theme-edit/_parts.d.mts +111 -0
  43. package/api/theme-edit/_parts.mjs +409 -0
  44. package/api/theme-edit/_png.d.mts +40 -0
  45. package/api/theme-edit/_png.mjs +187 -0
  46. package/api/theme-edit/_preview.d.mts +121 -0
  47. package/api/theme-edit/_preview.mjs +720 -0
  48. package/api/theme-edit/_project.d.mts +83 -0
  49. package/api/theme-edit/_project.mjs +289 -0
  50. package/api/theme-edit/_settings.d.mts +222 -0
  51. package/api/theme-edit/_settings.mjs +861 -0
  52. package/api/theme-edit/_tables.d.mts +132 -0
  53. package/api/theme-edit/_tables.mjs +700 -0
  54. package/api/theme-edit/theme-edit.d.mts +93 -0
  55. package/api/theme-edit/theme-edit.mjs +145 -0
  56. package/api/theme-edit/theme-edit.type.d.mts +413 -0
  57. package/api/theme-edit/theme-edit.type.mjs +233 -0
  58. package/api/theme-edit/themeEditHow.doc.d.mts +6 -0
  59. package/api/theme-edit/themeEditHow.doc.mjs +88 -0
  60. package/api/theme-edit/themeEditNew.doc.d.mts +6 -0
  61. package/api/theme-edit/themeEditNew.doc.mjs +89 -0
  62. package/api/theme-edit/themeEditPreviewAdd.doc.d.mts +6 -0
  63. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +100 -0
  64. package/api/theme-edit/themeEditPreviewApp.doc.d.mts +6 -0
  65. package/api/theme-edit/themeEditPreviewApp.doc.mjs +84 -0
  66. package/api/theme-edit/themeEditPreviewList.doc.d.mts +6 -0
  67. package/api/theme-edit/themeEditPreviewList.doc.mjs +53 -0
  68. package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +6 -0
  69. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +66 -0
  70. package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
  71. package/api/theme-edit/themeEditSet.doc.mjs +165 -0
  72. package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
  73. package/api/theme-edit/themeEditShow.doc.mjs +86 -0
  74. package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
  75. package/api/theme-edit/themeEditUndo.doc.mjs +124 -0
  76. package/assets/docs/color.doc.mjs +5 -5
  77. package/assets/docs/tree/icon-sets.doc.mjs +6 -2
  78. package/assets/docs/tree/tokens-border.doc.mjs +1 -1
  79. package/assets/docs/tree/tokens-color.doc.mjs +2 -2
  80. package/assets/docs/tree/tokens-data.doc.mjs +2 -2
  81. package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
  82. package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
  83. package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
  84. package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
  85. package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
  86. package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
  87. package/assets/docs/tree/tokens-size.doc.mjs +1 -1
  88. package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
  89. package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
  90. package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
  91. package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
  92. package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
  93. package/assets/icons/definitions/bank.doc.mjs +1 -1
  94. package/assets/icons/definitions/save.doc.mjs +1 -1
  95. package/assets/preview-app/README.md +6 -0
  96. package/assets/preview-app/css.d.ts +5 -0
  97. package/assets/preview-app/gitignore +1 -0
  98. package/assets/preview-app/next.config.mjs +6 -0
  99. package/assets/preview-app/package.json +23 -0
  100. package/assets/preview-app/src/app/globals.css +5 -0
  101. package/assets/preview-app/src/app/layout.tsx +21 -0
  102. package/assets/preview-app/src/app/page.tsx +94 -0
  103. package/assets/preview-app/src/app/providers.tsx +16 -0
  104. package/assets/preview-app/tsconfig.json +27 -0
  105. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
  106. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
  107. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
  108. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
  109. package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
  110. package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
  111. package/authoring/doctypes/_schema.d.mts +1 -0
  112. package/authoring/doctypes/_schema.mjs +1 -0
  113. package/authoring/doctypes/command/command.doc.mjs +7 -0
  114. package/authoring/doctypes/command/type.ts +3 -0
  115. package/authoring/doctypes/icon-set/parse.d.mts +7 -0
  116. package/authoring/doctypes/icon-set/parse.mjs +18 -8
  117. package/clients/cli/commands/doctor.mjs +33 -3
  118. package/clients/cli/commands/experimental/icon.mjs +67 -14
  119. package/clients/cli/commands/experimental/index.mjs +2 -0
  120. package/clients/cli/commands/experimental/theme.mjs +684 -0
  121. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
  122. package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
  123. package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
  124. package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
  125. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +84 -0
  126. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +66 -0
  127. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +121 -0
  128. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +66 -0
  129. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +104 -0
  130. package/clients/cli/commands/experimental-theme-editor.doc.mjs +49 -0
  131. package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
  132. package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
  133. package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
  134. package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
  135. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +86 -0
  136. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +66 -0
  137. package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +48 -0
  138. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +59 -0
  139. package/clients/cli/commands/experimental-theme-preview.doc.mjs +40 -0
  140. package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
  141. package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
  142. package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
  143. package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
  144. package/clients/cli/commands/experimental-theme.doc.mjs +57 -0
  145. package/clients/cli/commands/experimental.doc.mjs +10 -3
  146. package/clients/cli/commands/theme.mjs +101 -34
  147. package/clients/cli/index.mjs +18 -0
  148. package/clients/cli/lib/define-command.mjs +3 -0
  149. package/foundation/discovery/icon-set-checks.d.mts +16 -1
  150. package/foundation/discovery/icon-set-checks.mjs +68 -7
  151. package/foundation/discovery/icon-set-discovery.d.mts +21 -6
  152. package/foundation/discovery/icon-set-discovery.mjs +17 -8
  153. package/foundation/discovery/template-icon-meanings.d.mts +39 -0
  154. package/foundation/discovery/template-icon-meanings.mjs +95 -0
  155. package/foundation/discovery/theming-targets.d.mts +6 -0
  156. package/foundation/discovery/theming-targets.mjs +33 -0
  157. package/foundation/response/error-codes.d.mts +12 -1
  158. package/foundation/response/error-codes.doc.mjs +66 -0
  159. package/foundation/response/error-codes.mjs +55 -0
  160. package/foundation/response/response-types.doc.mjs +55 -0
  161. package/foundation/text/template-meanings-line.d.mts +16 -0
  162. package/foundation/text/template-meanings-line.mjs +37 -0
  163. package/foundation/xle/browser.d.mts +2 -2
  164. package/package.json +6 -6
@@ -0,0 +1,93 @@
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
+ /** @typedef {import('./theme-edit.type.mjs').ThemeEditChangeOptions} ChangeOptions */
5
+ /**
6
+ * Start a theme in themes/<name>/, optionally on a built-in theme.
7
+ * @experimental
8
+ * @param {string} name
9
+ * @param {import('./theme-edit.type.mjs').ThemeEditNewOptions} [options]
10
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
11
+ */
12
+ export function themeEditNew(name: string, options?: import("./theme-edit.type.mjs").ThemeEditNewOptions): Promise<import("./theme-edit.type.mjs").ThemeEditNewResponse>;
13
+ /**
14
+ * Change one thing in a theme: checked, built, previewed.
15
+ * @experimental
16
+ * @param {string} theme
17
+ * @param {string} thing a dial, a token, or a CSS property
18
+ * @param {string} value
19
+ * @param {ChangeOptions} [options]
20
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
21
+ */
22
+ export function themeEditSet(theme: string, thing: string, value: string, options?: ChangeOptions): Promise<import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
23
+ /**
24
+ * Every setting of a theme, key resolved values, problems it caused, the
25
+ * sample page and the theme-building page with every component.
26
+ * @experimental
27
+ * @param {string} theme
28
+ * @param {import('./theme-edit.type.mjs').ThemeEditShowOptions} [options]
29
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
30
+ */
31
+ export function themeEditShow(theme: string, options?: import("./theme-edit.type.mjs").ThemeEditShowOptions): Promise<import("./theme-edit.type.mjs").ThemeEditShowResponse>;
32
+ /**
33
+ * Put the theme back as it was before its last change. With `thing`, remove
34
+ * that one setting instead, wherever it is in the settings: it goes back to
35
+ * the base theme's value.
36
+ * @experimental
37
+ * @param {string} theme
38
+ * @param {import('./theme-edit.type.mjs').ThemeEditUndoOptions} [options]
39
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse | import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
40
+ */
41
+ export function themeEditUndo(theme: string, options?: import("./theme-edit.type.mjs").ThemeEditUndoOptions): Promise<import("./theme-edit.type.mjs").ThemeEditUndoResponse | import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
42
+ /**
43
+ * Add pages to the in-app theme preview, and write the preview route the
44
+ * first time. With a description, the build ranking picks the template
45
+ * pages that fit it best (`top` of them); `template` names one instead.
46
+ * With neither, the default pages: the sample app page and every component.
47
+ * @experimental
48
+ * @param {string} [description]
49
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewAddOptions} [options]
50
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewAddResponse>}
51
+ */
52
+ export function themeEditPreviewAdd(description?: string, options?: import("./theme-edit.type.mjs").ThemeEditPreviewAddOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewAddResponse>;
53
+ /**
54
+ * Make a new starter app with the theme preview route and its default pages
55
+ * inside. With `theme`, the theme is copied into the app and the pages wear
56
+ * it. No install runs.
57
+ * @experimental
58
+ * @param {string} dir
59
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewAppOptions} [options]
60
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewAppResponse>}
61
+ */
62
+ export function themeEditPreviewApp(dir: string, options?: import("./theme-edit.type.mjs").ThemeEditPreviewAppOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewAppResponse>;
63
+ /**
64
+ * The pages of the in-app theme preview.
65
+ * @experimental
66
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewListOptions} [options]
67
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewListResponse>}
68
+ */
69
+ export function themeEditPreviewList(options?: import("./theme-edit.type.mjs").ThemeEditPreviewListOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewListResponse>;
70
+ /**
71
+ * Remove one page from the in-app theme preview, or with no page the whole
72
+ * preview: only the files it wrote are deleted.
73
+ * @experimental
74
+ * @param {string} [page]
75
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewListOptions} [options]
76
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewRemoveResponse>}
77
+ */
78
+ export function themeEditPreviewRemove(page?: string, options?: import("./theme-edit.type.mjs").ThemeEditPreviewListOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewRemoveResponse>;
79
+ /**
80
+ * Explain anything a theme change can name, or answer a question about one:
81
+ * a part (what it reads for each aspect, its variants, states and the parts
82
+ * inside it), a family (its members), a setting (a dial's rungs, a token's
83
+ * type and readers, a CSS property), an aspect (colors, text, corners...: the
84
+ * whole-theme tokens and dial), a plain-words question (exact commands), a
85
+ * PNG picture (its main colors, or the color at points), or with `list` a
86
+ * list of dials, tokens, parts, families or CSS properties.
87
+ * @experimental
88
+ * @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
89
+ * @param {import('./theme-edit.type.mjs').ThemeEditHowOptions} [options]
90
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditHowResponse>}
91
+ */
92
+ export function themeEditHow(subject: string, options?: import("./theme-edit.type.mjs").ThemeEditHowOptions): Promise<import("./theme-edit.type.mjs").ThemeEditHowResponse>;
93
+ export type ChangeOptions = import("./theme-edit.type.mjs").ThemeEditChangeOptions;
@@ -0,0 +1,145 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file Programmatic API for `astryx experimental theme editor` (make and
5
+ * change a theme one checked change at a time) and `theme preview` (show it
6
+ * on pages in the app).
7
+ *
8
+ * themeEditNew('brand', {like: 'neutral'}) themeEdit.new
9
+ * themeEditSet('brand', 'corners', 'pill') themeEdit.set
10
+ * themeEditUndo('brand') themeEdit.undo (one step)
11
+ * themeEditUndo('brand', {thing: 'corners'}) themeEdit.undo (one setting)
12
+ * themeEditShow('brand') themeEdit.show
13
+ * themeEditPreviewAdd('a sales dashboard') themeEdit.previewAdd
14
+ * themeEditPreviewApp('theme-app') themeEdit.previewApp
15
+ * themeEditHow('banner') themeEdit.how
16
+ *
17
+ * Every change is checked first against what the installed Core's parts
18
+ * really read; a change that cannot take effect is refused and nothing is
19
+ * written. An accepted change rebuilds the theme with the theme build and
20
+ * writes a preview.
21
+ *
22
+ * @input a theme name and a change, a question, or a picture
23
+ * @output themeEdit.* envelopes
24
+ * @position api/theme-edit — command wrapper in
25
+ * clients/cli/commands/experimental/theme.mjs; the work is in _adapter.mjs
26
+ */
27
+
28
+ import * as adapter from './_adapter.mjs';
29
+
30
+ /** @typedef {import('./theme-edit.type.mjs').ThemeEditChangeOptions} ChangeOptions */
31
+
32
+ /**
33
+ * Start a theme in themes/<name>/, optionally on a built-in theme.
34
+ * @experimental
35
+ * @param {string} name
36
+ * @param {import('./theme-edit.type.mjs').ThemeEditNewOptions} [options]
37
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
38
+ */
39
+ export async function themeEditNew(name, options = {}) {
40
+ return adapter.themeEditNew(name, options);
41
+ }
42
+
43
+ /**
44
+ * Change one thing in a theme: checked, built, previewed.
45
+ * @experimental
46
+ * @param {string} theme
47
+ * @param {string} thing a dial, a token, or a CSS property
48
+ * @param {string} value
49
+ * @param {ChangeOptions} [options]
50
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
51
+ */
52
+ export async function themeEditSet(theme, thing, value, options = {}) {
53
+ return adapter.themeEditSet(theme, thing, value, options);
54
+ }
55
+
56
+ /**
57
+ * Every setting of a theme, key resolved values, problems it caused, the
58
+ * sample page and the theme-building page with every component.
59
+ * @experimental
60
+ * @param {string} theme
61
+ * @param {import('./theme-edit.type.mjs').ThemeEditShowOptions} [options]
62
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
63
+ */
64
+ export async function themeEditShow(theme, options = {}) {
65
+ return adapter.themeEditShow(theme, options);
66
+ }
67
+
68
+ /**
69
+ * Put the theme back as it was before its last change. With `thing`, remove
70
+ * that one setting instead, wherever it is in the settings: it goes back to
71
+ * the base theme's value.
72
+ * @experimental
73
+ * @param {string} theme
74
+ * @param {import('./theme-edit.type.mjs').ThemeEditUndoOptions} [options]
75
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse | import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
76
+ */
77
+ export async function themeEditUndo(theme, options = {}) {
78
+ return adapter.themeEditUndo(theme, options);
79
+ }
80
+
81
+ /**
82
+ * Add pages to the in-app theme preview, and write the preview route the
83
+ * first time. With a description, the build ranking picks the template
84
+ * pages that fit it best (`top` of them); `template` names one instead.
85
+ * With neither, the default pages: the sample app page and every component.
86
+ * @experimental
87
+ * @param {string} [description]
88
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewAddOptions} [options]
89
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewAddResponse>}
90
+ */
91
+ export async function themeEditPreviewAdd(description, options = {}) {
92
+ return adapter.themeEditPreviewAdd(description, options);
93
+ }
94
+
95
+ /**
96
+ * Make a new starter app with the theme preview route and its default pages
97
+ * inside. With `theme`, the theme is copied into the app and the pages wear
98
+ * it. No install runs.
99
+ * @experimental
100
+ * @param {string} dir
101
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewAppOptions} [options]
102
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewAppResponse>}
103
+ */
104
+ export async function themeEditPreviewApp(dir, options = {}) {
105
+ return adapter.themeEditPreviewApp(dir, options);
106
+ }
107
+
108
+ /**
109
+ * The pages of the in-app theme preview.
110
+ * @experimental
111
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewListOptions} [options]
112
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewListResponse>}
113
+ */
114
+ export async function themeEditPreviewList(options = {}) {
115
+ return adapter.themeEditPreviewList(options);
116
+ }
117
+
118
+ /**
119
+ * Remove one page from the in-app theme preview, or with no page the whole
120
+ * preview: only the files it wrote are deleted.
121
+ * @experimental
122
+ * @param {string} [page]
123
+ * @param {import('./theme-edit.type.mjs').ThemeEditPreviewListOptions} [options]
124
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewRemoveResponse>}
125
+ */
126
+ export async function themeEditPreviewRemove(page, options = {}) {
127
+ return adapter.themeEditPreviewRemove(page, options);
128
+ }
129
+
130
+ /**
131
+ * Explain anything a theme change can name, or answer a question about one:
132
+ * a part (what it reads for each aspect, its variants, states and the parts
133
+ * inside it), a family (its members), a setting (a dial's rungs, a token's
134
+ * type and readers, a CSS property), an aspect (colors, text, corners...: the
135
+ * whole-theme tokens and dial), a plain-words question (exact commands), a
136
+ * PNG picture (its main colors, or the color at points), or with `list` a
137
+ * list of dials, tokens, parts, families or CSS properties.
138
+ * @experimental
139
+ * @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
140
+ * @param {import('./theme-edit.type.mjs').ThemeEditHowOptions} [options]
141
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditHowResponse>}
142
+ */
143
+ export async function themeEditHow(subject, options = {}) {
144
+ return adapter.themeEditHow(subject, options);
145
+ }
@@ -0,0 +1,413 @@
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
+ /**
5
+ * One setting a theme made by `experimental theme editor` holds.
6
+ */
7
+ export type ThemeEditSetting = {
8
+ /**
9
+ * - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
10
+ */
11
+ thing: string;
12
+ /**
13
+ * - The value as stored (a dial step is stored as the rung it reached).
14
+ */
15
+ value: string;
16
+ /**
17
+ * - What kind of thing it is.
18
+ */
19
+ source: "dial" | "token" | "property";
20
+ /**
21
+ * - The part, family, or typography role it applies to; absent for the whole theme.
22
+ */
23
+ on?: string | undefined;
24
+ /**
25
+ * - `<prop>:<value>`: only that variant.
26
+ */
27
+ when?: string | undefined;
28
+ /**
29
+ * - Only that state.
30
+ */
31
+ state?: string | undefined;
32
+ /**
33
+ * - Only that color mode.
34
+ */
35
+ mode?: "light" | "dark" | undefined;
36
+ /**
37
+ * - One member of an always-alike family, not the whole family.
38
+ */
39
+ only?: boolean | undefined;
40
+ /**
41
+ * - For the `headings` dial: `weight` or `tracking`.
42
+ */
43
+ axis?: string | undefined;
44
+ /**
45
+ * - What the check found worth saying (what the token feeds, parts it misses).
46
+ */
47
+ note?: string | undefined;
48
+ };
49
+ export type ThemeEditNewOptions = {
50
+ /**
51
+ * - The app folder (default: process.cwd()).
52
+ */
53
+ cwd?: string | undefined;
54
+ /**
55
+ * - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
56
+ */
57
+ like?: string | undefined;
58
+ /**
59
+ * - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
60
+ */
61
+ png?: boolean | undefined;
62
+ };
63
+ export type ThemeEditChangeOptions = {
64
+ /**
65
+ * - The app folder (default: process.cwd()).
66
+ */
67
+ cwd?: string | undefined;
68
+ /**
69
+ * - A part (`button`), a family (`inputs`), or for `font` a role (`heading`).
70
+ */
71
+ on?: string | undefined;
72
+ /**
73
+ * - `<prop>:<value>`: only that variant, such as `variant:primary`.
74
+ */
75
+ when?: string | undefined;
76
+ /**
77
+ * - Only that state, such as `hover`.
78
+ */
79
+ state?: string | undefined;
80
+ /**
81
+ * - `light` or `dark`: only that color mode (colors and shadows only).
82
+ */
83
+ mode?: string | undefined;
84
+ /**
85
+ * - With a member of an always-alike family (inputs, checks), style just that part.
86
+ */
87
+ only?: boolean | undefined;
88
+ /**
89
+ * - Also take PNG pictures of the preview.
90
+ */
91
+ png?: boolean | undefined;
92
+ };
93
+ export type ThemeEditPreviewFields = {
94
+ /**
95
+ * - The sample app page with the theme, one self-contained HTML file.
96
+ */
97
+ preview: string;
98
+ /**
99
+ * - PNG pictures taken (only with `png`).
100
+ */
101
+ pictures: string[];
102
+ /**
103
+ * - Why no picture was taken, and how to get a browser for it.
104
+ */
105
+ pictureProblem: string | null;
106
+ };
107
+ /**
108
+ * `astryx --json experimental theme editor new <theme>`.
109
+ */
110
+ export type ThemeEditNewResponse = {
111
+ type: "themeEdit.new";
112
+ data: {
113
+ theme: string;
114
+ like: string | null;
115
+ files: {
116
+ settings: string;
117
+ source: string;
118
+ css: string;
119
+ module: string;
120
+ };
121
+ problems: string[];
122
+ } & ThemeEditPreviewFields;
123
+ };
124
+ /**
125
+ * `astryx --json experimental theme editor set <theme> <thing> <value>`, and
126
+ * `undo <theme> <thing>`, which removes one setting.
127
+ */
128
+ export type ThemeEditChangeResponse = {
129
+ type: "themeEdit.set" | "themeEdit.undo";
130
+ data: ThemeEditChangeData;
131
+ };
132
+ export type ThemeEditChangeData = {
133
+ theme: string;
134
+ action: "set" | "undo";
135
+ /**
136
+ * - The setting written, or for `undo` the one removed.
137
+ */
138
+ setting: ThemeEditSetting;
139
+ /**
140
+ * - The setting this one replaced.
141
+ */
142
+ replaced: ThemeEditSetting | null;
143
+ /**
144
+ * - For `base` and `mode`: the value before.
145
+ */
146
+ was: string | null;
147
+ /**
148
+ * - The parts it styles (a family's members when it spread).
149
+ */
150
+ parts: string[];
151
+ /**
152
+ * - The family it spread to; `onlyHint` when `--only` would style one member.
153
+ */
154
+ family: {
155
+ name: string;
156
+ members: string[];
157
+ onlyHint: boolean;
158
+ } | null;
159
+ /**
160
+ * - Resolved token changes, `name (mode): before -> after`.
161
+ */
162
+ changedTokens: string[];
163
+ /**
164
+ * - Part styles and typography the change wrote.
165
+ */
166
+ styled: string[];
167
+ /**
168
+ * - Part settings a whole-theme dial left in place (a part setting wins).
169
+ */
170
+ kept: string[];
171
+ /**
172
+ * - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
173
+ */
174
+ lifted: string[];
175
+ /**
176
+ * - What else to know: accent text per mode, font loading, what a token feeds.
177
+ */
178
+ notes: string[];
179
+ /**
180
+ * - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
181
+ */
182
+ problems: string[];
183
+ /**
184
+ * - Warnings from the theme build.
185
+ */
186
+ warnings: string[];
187
+ preview: string;
188
+ pictures: string[];
189
+ pictureProblem: string | null;
190
+ };
191
+ export type ThemeEditShowOptions = {
192
+ /**
193
+ * - The app folder (default: process.cwd()).
194
+ */
195
+ cwd?: string | undefined;
196
+ /**
197
+ * - Only one group on the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages.
198
+ */
199
+ group?: string | undefined;
200
+ /**
201
+ * - Also take PNG pictures of the previews.
202
+ */
203
+ png?: boolean | undefined;
204
+ };
205
+ /**
206
+ * `astryx --json experimental theme editor show <theme>`.
207
+ */
208
+ export type ThemeEditShowResponse = {
209
+ type: "themeEdit.show";
210
+ data: {
211
+ theme: string;
212
+ like: string | null;
213
+ mode: string;
214
+ settings: Array<ThemeEditSetting & {
215
+ parts: string[];
216
+ }>;
217
+ resolved: Record<string, Record<string, string | null>>;
218
+ problems: string[];
219
+ notes: string[];
220
+ preview: string;
221
+ sheet: string;
222
+ sheetComponents: number;
223
+ skipped: string[];
224
+ pictures: string[];
225
+ pictureProblem: string | null;
226
+ };
227
+ };
228
+ export type ThemeEditUndoOptions = {
229
+ /**
230
+ * - The app folder (default: process.cwd()).
231
+ */
232
+ cwd?: string | undefined;
233
+ /**
234
+ * - Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change; it goes back to the base theme's value.
235
+ */
236
+ thing?: string | undefined;
237
+ /**
238
+ * - With `thing` `headings`: which half to remove, `weight` or `tracking`.
239
+ */
240
+ value?: string | undefined;
241
+ /**
242
+ * - With `thing`: the part, family or role it was set on.
243
+ */
244
+ on?: string | undefined;
245
+ /**
246
+ * - With `thing`: the variant it was set for.
247
+ */
248
+ when?: string | undefined;
249
+ /**
250
+ * - With `thing`: the state it was set for.
251
+ */
252
+ state?: string | undefined;
253
+ /**
254
+ * - With `thing`: the mode it was set for.
255
+ */
256
+ mode?: string | undefined;
257
+ /**
258
+ * - With `thing`: whether it was set with `--only`.
259
+ */
260
+ only?: boolean | undefined;
261
+ /**
262
+ * - Also take PNG pictures of the preview.
263
+ */
264
+ png?: boolean | undefined;
265
+ };
266
+ /**
267
+ * `astryx --json experimental theme editor undo <theme>`: one step back.
268
+ * With a thing, undo returns a {@link ThemeEditChangeResponse} instead.
269
+ */
270
+ export type ThemeEditUndoResponse = {
271
+ type: "themeEdit.undo";
272
+ data: {
273
+ theme: string;
274
+ action: "step";
275
+ undone: string[];
276
+ settings: number;
277
+ stepsLeft: number;
278
+ } & ThemeEditPreviewFields;
279
+ };
280
+ export type ThemeEditPreviewAddOptions = {
281
+ /**
282
+ * - The project folder (default: process.cwd()).
283
+ */
284
+ cwd?: string | undefined;
285
+ /**
286
+ * - 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).
287
+ */
288
+ theme?: string | undefined;
289
+ /**
290
+ * - Add this page template instead of ranking one from a description.
291
+ */
292
+ template?: string | undefined;
293
+ /**
294
+ * - With a description: how many of the best-fitting page templates to add, 1 to 3 (default 1).
295
+ */
296
+ top?: number | undefined;
297
+ /**
298
+ * - The folder of the preview route, inside the project (default: theme-preview/ in the app's routes folder, app/ or src/app/).
299
+ */
300
+ path?: string | undefined;
301
+ };
302
+ /**
303
+ * `astryx --json experimental theme preview add [<description>]`.
304
+ */
305
+ export type ThemeEditPreviewAddResponse = {
306
+ type: "themeEdit.previewAdd";
307
+ data: {
308
+ folder: string;
309
+ theme: string | null;
310
+ added: string[];
311
+ skipped: Array<{
312
+ page: string;
313
+ missingPackages: string[];
314
+ installCommand: string | null;
315
+ }>;
316
+ notes: string[];
317
+ pages: string[];
318
+ files: string[];
319
+ open: string;
320
+ };
321
+ };
322
+ export type ThemeEditPreviewAppOptions = {
323
+ /**
324
+ * - The folder the app folder is inside (default: process.cwd()).
325
+ */
326
+ cwd?: string | undefined;
327
+ /**
328
+ * - 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).
329
+ */
330
+ theme?: string | undefined;
331
+ /**
332
+ * - Write into a folder that is not empty. A protected file there is never replaced, and the folder's own package.json and .gitignore are kept.
333
+ */
334
+ overwrite?: boolean | undefined;
335
+ };
336
+ /**
337
+ * `astryx --json experimental theme preview app <dir>`.
338
+ */
339
+ export type ThemeEditPreviewAppResponse = {
340
+ type: "themeEdit.previewApp";
341
+ data: {
342
+ folder: string;
343
+ theme: string | null;
344
+ pages: string[];
345
+ files: string[];
346
+ notes: string[];
347
+ open: string;
348
+ };
349
+ };
350
+ export type ThemeEditPreviewListOptions = {
351
+ /**
352
+ * - The project folder (default: process.cwd()).
353
+ */
354
+ cwd?: string | undefined;
355
+ /**
356
+ * - The folder of the preview route, when it is not in the default place.
357
+ */
358
+ path?: string | undefined;
359
+ };
360
+ /**
361
+ * `astryx --json experimental theme preview list`.
362
+ */
363
+ export type ThemeEditPreviewListResponse = {
364
+ type: "themeEdit.previewList";
365
+ data: {
366
+ folder: string | null;
367
+ theme: string | null;
368
+ pages: Array<{
369
+ id: string;
370
+ label: string;
371
+ }>;
372
+ };
373
+ };
374
+ /**
375
+ * `astryx --json experimental theme preview remove [<page>]`.
376
+ */
377
+ export type ThemeEditPreviewRemoveResponse = {
378
+ type: "themeEdit.previewRemove";
379
+ data: {
380
+ folder: string;
381
+ removed: string[];
382
+ pages: string[];
383
+ };
384
+ };
385
+ export type ThemeEditHowOptions = {
386
+ /**
387
+ * - The app folder (default: process.cwd()).
388
+ */
389
+ cwd?: string | undefined;
390
+ /**
391
+ * - List what a change can name: dials, tokens, parts, families, or properties; the subject filters it.
392
+ */
393
+ list?: string | undefined;
394
+ /**
395
+ * - With a PNG picture: pixel points x,y ("40,20;300,180", "40,20 300,180", several entries, or a flat "40,20,300,180").
396
+ */
397
+ at?: string[] | undefined;
398
+ /**
399
+ * - With a PNG picture: how many main colors (default 14).
400
+ */
401
+ count?: number | undefined;
402
+ };
403
+ /**
404
+ * `astryx --json experimental theme editor how <subject>`. `kind` says which answer it is.
405
+ */
406
+ export type ThemeEditHowResponse = {
407
+ type: "themeEdit.how";
408
+ data: {
409
+ kind: "part" | "family" | "setting" | "aspect" | "question" | "picture" | "list";
410
+ subject: string;
411
+ [key: string]: any;
412
+ };
413
+ };