@astryxdesign/cli 0.7.14-canary.gfb823d9 → 0.7.14
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.
- package/CHANGELOG.md +197 -0
- package/api/component/_adapter.d.mts +15 -0
- package/api/component/_adapter.mjs +76 -0
- package/api/component/component.mjs +8 -1
- package/api/search/_named-keywords.d.mts +31 -0
- package/api/search/_named-keywords.mjs +177 -0
- package/api/search/search-index.mjs +8 -1
- package/api/search/search.d.mts +6 -1
- package/api/search/search.mjs +49 -8
- package/api/theme/_adapter.d.mts +33 -0
- package/api/theme/_adapter.mjs +352 -16
- package/api/theme/build/build.mjs +261 -10
- package/api/theme/eject/eject.mjs +13 -1
- package/api/theme/list/list.mjs +11 -2
- package/api/theme/palette/generate/color.d.mts +2 -0
- package/api/theme/palette/generate/color.mjs +1 -1
- package/api/theme/template/template.mjs +139 -6
- package/api/theme/theme.type.d.mts +15 -1
- package/api/theme/theme.type.mjs +9 -3
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeBuild.doc.mjs +10 -2
- package/api/theme/themeEject.doc.mjs +2 -2
- package/api/theme/themeListAvailable.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +8 -0
- package/api/theme/themeUse.doc.mjs +1 -1
- package/api/theme-edit/_adapter.d.mts +36 -2
- package/api/theme-edit/_adapter.mjs +340 -12
- package/api/theme-edit/_check.d.mts +28 -25
- package/api/theme-edit/_check.mjs +876 -308
- package/api/theme-edit/_color.d.mts +53 -4
- package/api/theme-edit/_color.mjs +406 -79
- package/api/theme-edit/_compiler.d.mts +14 -6
- package/api/theme-edit/_compiler.mjs +89 -59
- package/api/theme-edit/_context.d.mts +28 -8
- package/api/theme-edit/_context.mjs +142 -19
- package/api/theme-edit/_edit.d.mts +3 -1
- package/api/theme-edit/_edit.mjs +746 -76
- package/api/theme-edit/_how-commands.d.mts +91 -0
- package/api/theme-edit/_how-commands.mjs +269 -0
- package/api/theme-edit/_how-question.d.mts +57 -0
- package/api/theme-edit/_how-question.mjs +2574 -0
- package/api/theme-edit/_how.d.mts +27 -8
- package/api/theme-edit/_how.mjs +776 -175
- package/api/theme-edit/_overview.d.mts +9 -0
- package/api/theme-edit/_overview.mjs +296 -0
- package/api/theme-edit/_palette.d.mts +155 -15
- package/api/theme-edit/_palette.mjs +1446 -262
- package/api/theme-edit/_parts.mjs +61 -5
- package/api/theme-edit/_png.d.mts +18 -6
- package/api/theme-edit/_png.mjs +135 -25
- package/api/theme-edit/_preview-app.d.mts +32 -11
- package/api/theme-edit/_preview-app.mjs +1976 -285
- package/api/theme-edit/_preview.d.mts +39 -8
- package/api/theme-edit/_preview.mjs +367 -41
- package/api/theme-edit/_settings.d.mts +147 -11
- package/api/theme-edit/_settings.mjs +908 -99
- package/api/theme-edit/_tables.d.mts +4 -16
- package/api/theme-edit/_tables.mjs +51 -117
- package/api/theme-edit/theme-edit.type.d.mts +102 -66
- package/api/theme-edit/theme-edit.type.mjs +58 -40
- package/api/theme-edit/themeEditHow.doc.mjs +17 -6
- package/api/theme-edit/themeEditNew.doc.mjs +21 -5
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +18 -5
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +12 -9
- package/api/theme-edit/themeEditPreviewList.doc.mjs +11 -2
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +29 -3
- package/api/theme-edit/themeEditSet.doc.mjs +14 -8
- package/api/theme-edit/themeEditShow.doc.mjs +10 -5
- package/api/theme-edit/themeEditUndo.doc.mjs +9 -4
- package/assets/discover/official-packages.json +4 -0
- package/assets/docs/tree/icon-sets.doc.mjs +3 -3
- package/assets/docs.generated.json +1 -0
- package/assets/icons/definitions/bookmarkAdd.doc.mjs +9 -0
- package/assets/icons/definitions/documentSearch.doc.mjs +9 -0
- package/assets/icons/definitions/keyboard.doc.mjs +9 -0
- package/assets/icons/definitions/paintBrush.doc.mjs +9 -0
- package/assets/icons/definitions/wallet.doc.mjs +9 -0
- package/assets/preview-app/gitignore +3 -0
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/Lightbox/LightboxGallery.tsx +1 -1
- package/assets/templates/components.generated.json +1 -0
- package/assets/templates/pages/gallery-hero/page.tsx +8 -2
- package/assets/templates/pages/settings-dialog/template.doc.mjs +3 -3
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +2 -2
- package/assets/templates/pages/theme-showcase/template.doc.mjs +1 -1
- package/clients/cli/bin/astryx.mjs +37 -5
- package/clients/cli/commands/experimental/theme.mjs +422 -57
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +22 -9
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +103 -4
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +13 -8
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +5 -5
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -5
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +2 -8
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +3 -4
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-eject.doc.mjs +3 -3
- package/clients/cli/commands/theme-remove.doc.mjs +2 -2
- package/clients/cli/commands/theme-template.doc.mjs +11 -4
- package/clients/cli/commands/theme.mjs +145 -46
- package/clients/cli/commands.generated.json +1 -0
- package/clients/cli/index.mjs +96 -5
- package/clients/cli/lib/json-shim.mjs +29 -1
- package/foundation/config/project.d.mts +16 -2
- package/foundation/config/project.mjs +40 -6
- package/foundation/config/theme-state.d.mts +9 -0
- package/foundation/config/theme-state.mjs +20 -1
- package/foundation/discovery/template-adapter.d.mts +12 -1
- package/foundation/discovery/template-adapter.mjs +29 -4
- package/foundation/discovery/template-icons.d.mts +13 -0
- package/foundation/discovery/template-icons.mjs +76 -0
- package/foundation/discovery/template-needs.d.mts +7 -0
- package/foundation/discovery/template-needs.mjs +117 -8
- package/foundation/discovery/template-source-tree.d.mts +5 -1
- package/foundation/discovery/template-source-tree.mjs +6 -4
- package/foundation/discovery/theme-discovery.d.mts +14 -3
- package/foundation/discovery/theme-discovery.mjs +45 -12
- package/foundation/doc-compiler/import.mjs +68 -3
- package/foundation/doc-compiler/stored-docs.d.mts +27 -0
- package/foundation/doc-compiler/stored-docs.mjs +65 -0
- package/foundation/fs/fs-error.d.mts +17 -0
- package/foundation/fs/fs-error.mjs +34 -0
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.doc.mjs +13 -1
- package/foundation/response/error-codes.mjs +11 -1
- package/foundation/response/response-types.doc.mjs +6 -6
- package/package.json +6 -7
- package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +0 -73
- package/clients/cli/commands/experimental-theme-palette.doc.mjs +0 -37
|
@@ -18,7 +18,7 @@ export type ThemeEditSetting = {
|
|
|
18
18
|
*/
|
|
19
19
|
source: "dial" | "token" | "property";
|
|
20
20
|
/**
|
|
21
|
-
* - The part,
|
|
21
|
+
* - The part, group, or typography role it applies to; absent for the whole theme.
|
|
22
22
|
*/
|
|
23
23
|
on?: string | undefined;
|
|
24
24
|
/**
|
|
@@ -34,7 +34,7 @@ export type ThemeEditSetting = {
|
|
|
34
34
|
*/
|
|
35
35
|
mode?: "light" | "dark" | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* - One member of an always-alike
|
|
37
|
+
* - One member of an always-alike group, not the whole group.
|
|
38
38
|
*/
|
|
39
39
|
only?: boolean | undefined;
|
|
40
40
|
/**
|
|
@@ -48,7 +48,7 @@ export type ThemeEditSetting = {
|
|
|
48
48
|
};
|
|
49
49
|
export type ThemeEditNewOptions = {
|
|
50
50
|
/**
|
|
51
|
-
* - The
|
|
51
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
52
52
|
*/
|
|
53
53
|
cwd?: string | undefined;
|
|
54
54
|
/**
|
|
@@ -59,14 +59,18 @@ export type ThemeEditNewOptions = {
|
|
|
59
59
|
* - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
|
|
60
60
|
*/
|
|
61
61
|
png?: boolean | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* - 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.
|
|
64
|
+
*/
|
|
65
|
+
settings?: Record<string, string | string[] | undefined> | undefined;
|
|
62
66
|
};
|
|
63
67
|
export type ThemeEditChangeOptions = {
|
|
64
68
|
/**
|
|
65
|
-
* - The
|
|
69
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
66
70
|
*/
|
|
67
71
|
cwd?: string | undefined;
|
|
68
72
|
/**
|
|
69
|
-
* - A part (`button`), a
|
|
73
|
+
* - A part (`button`), a group (`inputs`), or for `font` a role (`heading`).
|
|
70
74
|
*/
|
|
71
75
|
on?: string | undefined;
|
|
72
76
|
/**
|
|
@@ -78,11 +82,11 @@ export type ThemeEditChangeOptions = {
|
|
|
78
82
|
*/
|
|
79
83
|
state?: string | undefined;
|
|
80
84
|
/**
|
|
81
|
-
* - `light` or `dark`: only that color mode (colors
|
|
85
|
+
* - `light` or `dark`: only that color mode (colors only; a shadow is one value for both modes).
|
|
82
86
|
*/
|
|
83
87
|
mode?: string | undefined;
|
|
84
88
|
/**
|
|
85
|
-
* - With a member of an always-alike
|
|
89
|
+
* - With a member of an always-alike group (inputs, checks), style just that part.
|
|
86
90
|
*/
|
|
87
91
|
only?: boolean | undefined;
|
|
88
92
|
/**
|
|
@@ -92,9 +96,9 @@ export type ThemeEditChangeOptions = {
|
|
|
92
96
|
};
|
|
93
97
|
export type ThemeEditPreviewFields = {
|
|
94
98
|
/**
|
|
95
|
-
* - The sample app page with the theme, one self-contained HTML file.
|
|
99
|
+
* - The sample app page with the theme, one self-contained HTML file; null when the components could not be rendered.
|
|
96
100
|
*/
|
|
97
|
-
preview: string;
|
|
101
|
+
preview: string | null;
|
|
98
102
|
/**
|
|
99
103
|
* - PNG pictures taken (only with `png`).
|
|
100
104
|
*/
|
|
@@ -103,12 +107,26 @@ export type ThemeEditPreviewFields = {
|
|
|
103
107
|
* - Why no picture was taken, and how to get a browser for it.
|
|
104
108
|
*/
|
|
105
109
|
pictureProblem: string | null;
|
|
110
|
+
/**
|
|
111
|
+
* - 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.
|
|
112
|
+
*/
|
|
113
|
+
notChecked: {
|
|
114
|
+
code: string;
|
|
115
|
+
cause: string;
|
|
116
|
+
} | null;
|
|
117
|
+
/**
|
|
118
|
+
* - Files of the in-app theme preview that were changed by hand, so they were not written again and still show the theme as it was.
|
|
119
|
+
*/
|
|
120
|
+
previewStale?: string[] | undefined;
|
|
106
121
|
};
|
|
107
122
|
/**
|
|
108
123
|
* `astryx --json experimental theme editor new <theme>`.
|
|
109
124
|
*/
|
|
110
125
|
export type ThemeEditNewResponse = {
|
|
111
126
|
type: "themeEdit.new";
|
|
127
|
+
/**
|
|
128
|
+
* - `settings`: the dial settings it started with; `notes`: font loading.
|
|
129
|
+
*/
|
|
112
130
|
data: {
|
|
113
131
|
theme: string;
|
|
114
132
|
like: string | null;
|
|
@@ -118,6 +136,8 @@ export type ThemeEditNewResponse = {
|
|
|
118
136
|
css: string;
|
|
119
137
|
module: string;
|
|
120
138
|
};
|
|
139
|
+
settings: string[];
|
|
140
|
+
notes: string[];
|
|
121
141
|
problems: string[];
|
|
122
142
|
} & ThemeEditPreviewFields;
|
|
123
143
|
};
|
|
@@ -136,22 +156,30 @@ export type ThemeEditChangeData = {
|
|
|
136
156
|
* - The setting written, or for `undo` the one removed.
|
|
137
157
|
*/
|
|
138
158
|
setting: ThemeEditSetting;
|
|
159
|
+
/**
|
|
160
|
+
* - 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.
|
|
161
|
+
*/
|
|
162
|
+
now?: string | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* - On `undo`: the setting removed (the same as `setting`); the value now in effect is the base theme's, and `changedTokens` lists it.
|
|
165
|
+
*/
|
|
166
|
+
removed?: ThemeEditSetting | undefined;
|
|
139
167
|
/**
|
|
140
168
|
* - The setting this one replaced.
|
|
141
169
|
*/
|
|
142
170
|
replaced: ThemeEditSetting | null;
|
|
143
171
|
/**
|
|
144
|
-
* - For `base` and
|
|
172
|
+
* - For `base`, `mode` and a whole-theme dial: the value before.
|
|
145
173
|
*/
|
|
146
174
|
was: string | null;
|
|
147
175
|
/**
|
|
148
|
-
* - The parts it styles (a
|
|
176
|
+
* - The parts it styles (a group's members when it spread).
|
|
149
177
|
*/
|
|
150
178
|
parts: string[];
|
|
151
179
|
/**
|
|
152
|
-
* - The
|
|
180
|
+
* - The group it spread to; `onlyHint` when `--only` would style one member.
|
|
153
181
|
*/
|
|
154
|
-
|
|
182
|
+
group: {
|
|
155
183
|
name: string;
|
|
156
184
|
members: string[];
|
|
157
185
|
onlyHint: boolean;
|
|
@@ -173,7 +201,7 @@ export type ThemeEditChangeData = {
|
|
|
173
201
|
*/
|
|
174
202
|
lifted: string[];
|
|
175
203
|
/**
|
|
176
|
-
* - What else to know: the
|
|
204
|
+
* - 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.
|
|
177
205
|
*/
|
|
178
206
|
notes: string[];
|
|
179
207
|
/**
|
|
@@ -184,19 +212,30 @@ export type ThemeEditChangeData = {
|
|
|
184
212
|
* - Warnings from the theme build.
|
|
185
213
|
*/
|
|
186
214
|
warnings: string[];
|
|
187
|
-
preview: string;
|
|
215
|
+
preview: string | null;
|
|
188
216
|
pictures: string[];
|
|
189
217
|
pictureProblem: string | null;
|
|
218
|
+
/**
|
|
219
|
+
* - Saved but not checked: see ThemeEditPreviewFields.
|
|
220
|
+
*/
|
|
221
|
+
notChecked: {
|
|
222
|
+
code: string;
|
|
223
|
+
cause: string;
|
|
224
|
+
} | null;
|
|
225
|
+
/**
|
|
226
|
+
* - In-app preview files changed by hand: see ThemeEditPreviewFields.
|
|
227
|
+
*/
|
|
228
|
+
previewStale?: string[] | undefined;
|
|
190
229
|
};
|
|
191
230
|
export type ThemeEditShowOptions = {
|
|
192
231
|
/**
|
|
193
|
-
* - The
|
|
232
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
194
233
|
*/
|
|
195
234
|
cwd?: string | undefined;
|
|
196
235
|
/**
|
|
197
|
-
* - Only one
|
|
236
|
+
* - Only one section of the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages.
|
|
198
237
|
*/
|
|
199
|
-
|
|
238
|
+
section?: string | undefined;
|
|
200
239
|
/**
|
|
201
240
|
* - Also take PNG pictures of the previews.
|
|
202
241
|
*/
|
|
@@ -213,64 +252,53 @@ export type ThemeEditShowResponse = {
|
|
|
213
252
|
mode: string;
|
|
214
253
|
settings: Array<ThemeEditSetting & {
|
|
215
254
|
parts: string[];
|
|
255
|
+
masked?: string;
|
|
216
256
|
}>;
|
|
217
|
-
resolved: Record<string, Record<string, string | null
|
|
218
|
-
|
|
257
|
+
resolved: Record<string, Record<string, string | null> | string | null>;
|
|
258
|
+
partValues: string[];
|
|
259
|
+
vibrancy: number | null;
|
|
260
|
+
colors: ThemeEditColor[];
|
|
261
|
+
colorNotes: string[];
|
|
219
262
|
problems: string[];
|
|
220
263
|
notes: string[];
|
|
221
264
|
preview: string;
|
|
265
|
+
previewStale?: string[] | undefined;
|
|
222
266
|
sheet: string;
|
|
223
267
|
sheetComponents: number;
|
|
224
268
|
skipped: string[];
|
|
225
269
|
pictures: string[];
|
|
226
270
|
pictureProblem: string | null;
|
|
271
|
+
colorFiles: {
|
|
272
|
+
config: string;
|
|
273
|
+
module: string;
|
|
274
|
+
receipt: string;
|
|
275
|
+
} | null;
|
|
227
276
|
};
|
|
228
277
|
};
|
|
229
278
|
/**
|
|
230
|
-
*
|
|
279
|
+
* One color of a theme, as `show` reports it.
|
|
231
280
|
*/
|
|
232
|
-
export type
|
|
281
|
+
export type ThemeEditColor = {
|
|
233
282
|
/**
|
|
234
|
-
* - The
|
|
283
|
+
* - The setting that makes it: accent, neutral, success, warning, danger or info.
|
|
235
284
|
*/
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* - The generated palette module the theme imports.
|
|
239
|
-
*/
|
|
240
|
-
file: string;
|
|
241
|
-
/**
|
|
242
|
-
* - The generation receipt beside it.
|
|
243
|
-
*/
|
|
244
|
-
receipt: string;
|
|
245
|
-
/**
|
|
246
|
-
* - Each color dial's family: its seed, the value as set, the token that sets its main color exactly, and the stop that feeds each token in each mode.
|
|
247
|
-
*/
|
|
248
|
-
families: Array<{
|
|
249
|
-
family: string;
|
|
250
|
-
seed: string;
|
|
251
|
-
value: string;
|
|
252
|
-
exactToken: string;
|
|
253
|
-
tokens: Record<string, {
|
|
254
|
-
light: string;
|
|
255
|
-
dark: string;
|
|
256
|
-
}>;
|
|
257
|
-
}>;
|
|
285
|
+
color: string;
|
|
258
286
|
/**
|
|
259
|
-
* -
|
|
287
|
+
* - The color it is generated from, as hex.
|
|
260
288
|
*/
|
|
261
|
-
|
|
289
|
+
seed: string;
|
|
262
290
|
/**
|
|
263
|
-
* -
|
|
291
|
+
* - The shade each token uses: `light <shade> <hex>, dark <shade> <hex>`, and whether an exact token setting wins.
|
|
264
292
|
*/
|
|
265
|
-
|
|
293
|
+
tokens: Record<string, string>;
|
|
266
294
|
};
|
|
267
295
|
export type ThemeEditUndoOptions = {
|
|
268
296
|
/**
|
|
269
|
-
* - The
|
|
297
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
270
298
|
*/
|
|
271
299
|
cwd?: string | undefined;
|
|
272
300
|
/**
|
|
273
|
-
* - Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change;
|
|
301
|
+
* - 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.
|
|
274
302
|
*/
|
|
275
303
|
thing?: string | undefined;
|
|
276
304
|
/**
|
|
@@ -278,7 +306,7 @@ export type ThemeEditUndoOptions = {
|
|
|
278
306
|
*/
|
|
279
307
|
value?: string | undefined;
|
|
280
308
|
/**
|
|
281
|
-
* - With `thing`: the part,
|
|
309
|
+
* - With `thing`: the part, group or role it was set on.
|
|
282
310
|
*/
|
|
283
311
|
on?: string | undefined;
|
|
284
312
|
/**
|
|
@@ -318,7 +346,7 @@ export type ThemeEditUndoResponse = {
|
|
|
318
346
|
};
|
|
319
347
|
export type ThemeEditPreviewAddOptions = {
|
|
320
348
|
/**
|
|
321
|
-
* - The
|
|
349
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
322
350
|
*/
|
|
323
351
|
cwd?: string | undefined;
|
|
324
352
|
/**
|
|
@@ -330,9 +358,9 @@ export type ThemeEditPreviewAddOptions = {
|
|
|
330
358
|
*/
|
|
331
359
|
template?: string | undefined;
|
|
332
360
|
/**
|
|
333
|
-
* - With a description: how many of the best-fitting page templates to add, 1 to 3 (default 1).
|
|
361
|
+
* - 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".
|
|
334
362
|
*/
|
|
335
|
-
top?: number | undefined;
|
|
363
|
+
top?: string | number | undefined;
|
|
336
364
|
/**
|
|
337
365
|
* - The folder of the preview route, inside the project (default: theme-preview/ in the app's routes folder, app/ or src/app/).
|
|
338
366
|
*/
|
|
@@ -347,11 +375,15 @@ export type ThemeEditPreviewAddResponse = {
|
|
|
347
375
|
folder: string;
|
|
348
376
|
theme: string | null;
|
|
349
377
|
added: string[];
|
|
378
|
+
refreshed: string[];
|
|
379
|
+
matched: Array<{
|
|
380
|
+
page: string;
|
|
381
|
+
why: string;
|
|
382
|
+
}>;
|
|
350
383
|
skipped: Array<{
|
|
351
384
|
page: string;
|
|
352
|
-
|
|
385
|
+
reason: string;
|
|
353
386
|
installCommand: string | null;
|
|
354
|
-
stylexCompiler: boolean;
|
|
355
387
|
}>;
|
|
356
388
|
notes: string[];
|
|
357
389
|
pages: string[];
|
|
@@ -368,10 +400,6 @@ export type ThemeEditPreviewAppOptions = {
|
|
|
368
400
|
* - 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).
|
|
369
401
|
*/
|
|
370
402
|
theme?: string | undefined;
|
|
371
|
-
/**
|
|
372
|
-
* - 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.
|
|
373
|
-
*/
|
|
374
|
-
overwrite?: boolean | undefined;
|
|
375
403
|
};
|
|
376
404
|
/**
|
|
377
405
|
* `astryx --json experimental theme preview app <dir>`.
|
|
@@ -389,7 +417,7 @@ export type ThemeEditPreviewAppResponse = {
|
|
|
389
417
|
};
|
|
390
418
|
export type ThemeEditPreviewListOptions = {
|
|
391
419
|
/**
|
|
392
|
-
* - The
|
|
420
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
393
421
|
*/
|
|
394
422
|
cwd?: string | undefined;
|
|
395
423
|
/**
|
|
@@ -419,20 +447,28 @@ export type ThemeEditPreviewRemoveResponse = {
|
|
|
419
447
|
data: {
|
|
420
448
|
folder: string;
|
|
421
449
|
removed: string[];
|
|
450
|
+
kept: string[];
|
|
451
|
+
missing: string[];
|
|
452
|
+
rewritten: string[];
|
|
453
|
+
notes: string[];
|
|
422
454
|
pages: string[];
|
|
423
455
|
};
|
|
424
456
|
};
|
|
425
457
|
export type ThemeEditHowOptions = {
|
|
426
458
|
/**
|
|
427
|
-
* - The
|
|
459
|
+
* - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
428
460
|
*/
|
|
429
461
|
cwd?: string | undefined;
|
|
430
462
|
/**
|
|
431
|
-
* - List what a change can name: dials, tokens, parts,
|
|
463
|
+
* - 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.
|
|
432
464
|
*/
|
|
433
465
|
list?: string | undefined;
|
|
434
466
|
/**
|
|
435
|
-
* -
|
|
467
|
+
* - 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.
|
|
468
|
+
*/
|
|
469
|
+
theme?: string | undefined;
|
|
470
|
+
/**
|
|
471
|
+
* - 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").
|
|
436
472
|
*/
|
|
437
473
|
at?: string[] | undefined;
|
|
438
474
|
/**
|
|
@@ -446,7 +482,7 @@ export type ThemeEditHowOptions = {
|
|
|
446
482
|
export type ThemeEditHowResponse = {
|
|
447
483
|
type: "themeEdit.how";
|
|
448
484
|
data: {
|
|
449
|
-
kind: "part" | "
|
|
485
|
+
kind: "part" | "group" | "setting" | "aspect" | "question" | "picture" | "list";
|
|
450
486
|
subject: string;
|
|
451
487
|
[key: string]: any;
|
|
452
488
|
};
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* @property {string} thing - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
|
|
15
15
|
* @property {string} value - The value as stored (a dial step is stored as the rung it reached).
|
|
16
16
|
* @property {'dial' | 'token' | 'property'} source - What kind of thing it is.
|
|
17
|
-
* @property {string} [on] - The part,
|
|
17
|
+
* @property {string} [on] - The part, group, or typography role it applies to; absent for the whole theme.
|
|
18
18
|
* @property {string} [when] - `<prop>:<value>`: only that variant.
|
|
19
19
|
* @property {string} [state] - Only that state.
|
|
20
20
|
* @property {'light' | 'dark'} [mode] - Only that color mode.
|
|
21
|
-
* @property {boolean} [only] - One member of an always-alike
|
|
21
|
+
* @property {boolean} [only] - One member of an always-alike group, not the whole group.
|
|
22
22
|
* @property {string} [axis] - For the `headings` dial: `weight` or `tracking`.
|
|
23
23
|
* @property {string} [note] - What the check found worth saying (what the token feeds, parts it misses).
|
|
24
24
|
*/
|
|
@@ -26,29 +26,32 @@
|
|
|
26
26
|
/**
|
|
27
27
|
* @experimental May change or be removed in a patch release.
|
|
28
28
|
* @typedef {object} ThemeEditNewOptions
|
|
29
|
-
* @property {string} [cwd] - The
|
|
29
|
+
* @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
30
30
|
* @property {string} [like] - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
|
|
31
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.
|
|
32
33
|
*/
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* @experimental May change or be removed in a patch release.
|
|
36
37
|
* @typedef {object} ThemeEditChangeOptions
|
|
37
|
-
* @property {string} [cwd] - The
|
|
38
|
-
* @property {string} [on] - A part (`button`), a
|
|
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`).
|
|
39
40
|
* @property {string} [when] - `<prop>:<value>`: only that variant, such as `variant:primary`.
|
|
40
41
|
* @property {string} [state] - Only that state, such as `hover`.
|
|
41
|
-
* @property {string} [mode] - `light` or `dark`: only that color mode (colors
|
|
42
|
-
* @property {boolean} [only] - With a member of an always-alike
|
|
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.
|
|
43
44
|
* @property {boolean} [png] - Also take PNG pictures of the preview.
|
|
44
45
|
*/
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
48
|
* @experimental May change or be removed in a patch release.
|
|
48
49
|
* @typedef {object} ThemeEditPreviewFields
|
|
49
|
-
* @property {string} preview - The sample app page with the theme, one self-contained HTML file.
|
|
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.
|
|
50
51
|
* @property {string[]} pictures - PNG pictures taken (only with `png`).
|
|
51
52
|
* @property {string | null} pictureProblem - Why no picture was taken, 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[]} [previewStale] - Files of the in-app theme preview that were changed by hand, so they were not written again and still show the theme as it was.
|
|
52
55
|
*/
|
|
53
56
|
|
|
54
57
|
/**
|
|
@@ -56,7 +59,7 @@
|
|
|
56
59
|
* @experimental May change or be removed in a patch release.
|
|
57
60
|
* @typedef {object} ThemeEditNewResponse
|
|
58
61
|
* @property {'themeEdit.new'} type
|
|
59
|
-
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, problems: string[]} & ThemeEditPreviewFields} data
|
|
62
|
+
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, settings: string[], notes: string[], problems: string[]} & ThemeEditPreviewFields} data - `settings`: the dial settings it started with; `notes`: font loading.
|
|
60
63
|
*/
|
|
61
64
|
|
|
62
65
|
/**
|
|
@@ -74,27 +77,31 @@
|
|
|
74
77
|
* @property {string} theme
|
|
75
78
|
* @property {'set' | 'undo'} action
|
|
76
79
|
* @property {ThemeEditSetting} setting - The setting written, or for `undo` the one removed.
|
|
80
|
+
* @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.
|
|
81
|
+
* @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.
|
|
77
82
|
* @property {ThemeEditSetting | null} replaced - The setting this one replaced.
|
|
78
|
-
* @property {string | null} was - For `base` and
|
|
79
|
-
* @property {string[]} parts - The parts it styles (a
|
|
80
|
-
* @property {{name: string, members: string[], onlyHint: boolean} | null}
|
|
83
|
+
* @property {string | null} was - For `base`, `mode` and a whole-theme dial: the value before.
|
|
84
|
+
* @property {string[]} parts - The parts it styles (a group's members when it spread).
|
|
85
|
+
* @property {{name: string, members: string[], onlyHint: boolean} | null} group - The group it spread to; `onlyHint` when `--only` would style one member.
|
|
81
86
|
* @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`.
|
|
82
87
|
* @property {string[]} styled - Part styles and typography the change wrote.
|
|
83
88
|
* @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
|
|
84
89
|
* @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
|
|
85
|
-
* @property {string[]} notes - What else to know: the
|
|
90
|
+
* @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.
|
|
86
91
|
* @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
|
|
87
92
|
* @property {string[]} warnings - Warnings from the theme build.
|
|
88
|
-
* @property {string} preview
|
|
93
|
+
* @property {string | null} preview
|
|
89
94
|
* @property {string[]} pictures
|
|
90
95
|
* @property {string | null} pictureProblem
|
|
96
|
+
* @property {{code: string, cause: string} | null} notChecked - Saved but not checked: see ThemeEditPreviewFields.
|
|
97
|
+
* @property {string[]} [previewStale] - In-app preview files changed by hand: see ThemeEditPreviewFields.
|
|
91
98
|
*/
|
|
92
99
|
|
|
93
100
|
/**
|
|
94
101
|
* @experimental May change or be removed in a patch release.
|
|
95
102
|
* @typedef {object} ThemeEditShowOptions
|
|
96
|
-
* @property {string} [cwd] - The
|
|
97
|
-
* @property {string} [
|
|
103
|
+
* @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
104
|
+
* @property {string} [section] - Only one section of the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages.
|
|
98
105
|
* @property {boolean} [png] - Also take PNG pictures of the previews.
|
|
99
106
|
*/
|
|
100
107
|
|
|
@@ -107,38 +114,40 @@
|
|
|
107
114
|
* @property {string} data.theme
|
|
108
115
|
* @property {string | null} data.like
|
|
109
116
|
* @property {string} data.mode
|
|
110
|
-
* @property {Array<ThemeEditSetting & {parts: string[]}>} data.settings
|
|
111
|
-
* @property {Record<string, Record<string, string | null
|
|
112
|
-
* @property {
|
|
117
|
+
* @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.
|
|
118
|
+
* @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.
|
|
119
|
+
* @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.
|
|
120
|
+
* @property {number | null} data.vibrancy - How saturated the generated colors are (0 to 100); null when the theme sets no color.
|
|
121
|
+
* @property {ThemeEditColor[]} data.colors - Each color the theme sets, with the shade each token uses.
|
|
122
|
+
* @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.
|
|
113
123
|
* @property {string[]} data.problems
|
|
114
124
|
* @property {string[]} data.notes
|
|
115
125
|
* @property {string} data.preview
|
|
126
|
+
* @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.
|
|
116
127
|
* @property {string} data.sheet - The theme-building page with every component.
|
|
117
128
|
* @property {number} data.sheetComponents
|
|
118
129
|
* @property {string[]} data.skipped - Template pages left out, with the install line each needs.
|
|
119
130
|
* @property {string[]} data.pictures
|
|
120
131
|
* @property {string | null} data.pictureProblem
|
|
132
|
+
* @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.
|
|
121
133
|
*/
|
|
122
134
|
|
|
123
135
|
/**
|
|
124
|
-
*
|
|
136
|
+
* One color of a theme, as `show` reports it.
|
|
125
137
|
* @experimental May change or be removed in a patch release.
|
|
126
|
-
* @typedef {object}
|
|
127
|
-
* @property {string}
|
|
128
|
-
* @property {string}
|
|
129
|
-
* @property {string}
|
|
130
|
-
* @property {Array<{family: string, seed: string, value: string, exactToken: string, tokens: Record<string, {light: string, dark: string}>}>} families - Each color dial's family: its seed, the value as set, the token that sets its main color exactly, and the stop that feeds each token in each mode.
|
|
131
|
-
* @property {string[]} contrast - Each contrast check behind a stop choice, with its ratio and whether it passes.
|
|
132
|
-
* @property {string[]} overridden - Palette-fed tokens an exact token setting replaces.
|
|
138
|
+
* @typedef {object} ThemeEditColor
|
|
139
|
+
* @property {string} color - The setting that makes it: accent, neutral, success, warning, danger or info.
|
|
140
|
+
* @property {string} seed - The color it is generated from, as hex.
|
|
141
|
+
* @property {Record<string, string>} tokens - The shade each token uses: `light <shade> <hex>, dark <shade> <hex>`, and whether an exact token setting wins.
|
|
133
142
|
*/
|
|
134
143
|
|
|
135
144
|
/**
|
|
136
145
|
* @experimental May change or be removed in a patch release.
|
|
137
146
|
* @typedef {object} ThemeEditUndoOptions
|
|
138
|
-
* @property {string} [cwd] - The
|
|
139
|
-
* @property {string} [thing] - Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change;
|
|
147
|
+
* @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
148
|
+
* @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.
|
|
140
149
|
* @property {string} [value] - With `thing` `headings`: which half to remove, `weight` or `tracking`.
|
|
141
|
-
* @property {string} [on] - With `thing`: the part,
|
|
150
|
+
* @property {string} [on] - With `thing`: the part, group or role it was set on.
|
|
142
151
|
* @property {string} [when] - With `thing`: the variant it was set for.
|
|
143
152
|
* @property {string} [state] - With `thing`: the state it was set for.
|
|
144
153
|
* @property {string} [mode] - With `thing`: the mode it was set for.
|
|
@@ -158,10 +167,10 @@
|
|
|
158
167
|
/**
|
|
159
168
|
* @experimental May change or be removed in a patch release.
|
|
160
169
|
* @typedef {object} ThemeEditPreviewAddOptions
|
|
161
|
-
* @property {string} [cwd] - The
|
|
170
|
+
* @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
162
171
|
* @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).
|
|
163
172
|
* @property {string} [template] - Add this page template instead of ranking one from a description.
|
|
164
|
-
* @property {number} [top] - With a description: how many of the best-fitting page templates to add, 1 to 3 (default 1).
|
|
173
|
+
* @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".
|
|
165
174
|
* @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/).
|
|
166
175
|
*/
|
|
167
176
|
|
|
@@ -174,7 +183,9 @@
|
|
|
174
183
|
* @property {string} data.folder - The preview route folder.
|
|
175
184
|
* @property {string | null} data.theme - The theme the pages wear; null for the app's own theme.
|
|
176
185
|
* @property {string[]} data.added - Pages added by this call.
|
|
177
|
-
* @property {
|
|
186
|
+
* @property {string[]} data.refreshed - Pages that were there already and are written again.
|
|
187
|
+
* @property {Array<{page: string, why: string}>} data.matched - Each template page added for a description or --template, and why it was picked.
|
|
188
|
+
* @property {Array<{page: string, reason: string, installCommand: string | null}>} 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.
|
|
178
189
|
* @property {string[]} data.notes - What else to know.
|
|
179
190
|
* @property {string[]} data.pages - Every page of the preview, in order.
|
|
180
191
|
* @property {string[]} data.files - Every file the preview wrote.
|
|
@@ -186,7 +197,6 @@
|
|
|
186
197
|
* @typedef {object} ThemeEditPreviewAppOptions
|
|
187
198
|
* @property {string} [cwd] - The folder the app folder is inside (default: process.cwd()).
|
|
188
199
|
* @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).
|
|
189
|
-
* @property {boolean} [overwrite] - 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.
|
|
190
200
|
*/
|
|
191
201
|
|
|
192
202
|
/**
|
|
@@ -206,7 +216,7 @@
|
|
|
206
216
|
/**
|
|
207
217
|
* @experimental May change or be removed in a patch release.
|
|
208
218
|
* @typedef {object} ThemeEditPreviewListOptions
|
|
209
|
-
* @property {string} [cwd] - The
|
|
219
|
+
* @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
210
220
|
* @property {string} [path] - The folder of the preview route, when it is not in the default place.
|
|
211
221
|
*/
|
|
212
222
|
|
|
@@ -223,15 +233,23 @@
|
|
|
223
233
|
* @experimental May change or be removed in a patch release.
|
|
224
234
|
* @typedef {object} ThemeEditPreviewRemoveResponse
|
|
225
235
|
* @property {'themeEdit.previewRemove'} type
|
|
226
|
-
* @property {
|
|
236
|
+
* @property {object} data
|
|
237
|
+
* @property {string} data.folder - The preview route folder.
|
|
238
|
+
* @property {string[]} data.removed - Files deleted.
|
|
239
|
+
* @property {string[]} data.kept - Files kept: changed by hand after the preview wrote them, or not written by it.
|
|
240
|
+
* @property {string[]} data.missing - Files the preview had written that were gone already.
|
|
241
|
+
* @property {string[]} data.rewritten - Files written again, so the route and the Colors page match the pages left.
|
|
242
|
+
* @property {string[]} data.notes - What else to know.
|
|
243
|
+
* @property {string[]} data.pages - The pages left, in order; empty when the whole preview was removed.
|
|
227
244
|
*/
|
|
228
245
|
|
|
229
246
|
/**
|
|
230
247
|
* @experimental May change or be removed in a patch release.
|
|
231
248
|
* @typedef {object} ThemeEditHowOptions
|
|
232
|
-
* @property {string} [cwd] - The
|
|
233
|
-
* @property {string} [list] - List what a change can name: dials, tokens, parts,
|
|
234
|
-
* @property {string
|
|
249
|
+
* @property {string} [cwd] - The folder to start from (default: process.cwd()); commands act on the Astryx project at or above it.
|
|
250
|
+
* @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.
|
|
251
|
+
* @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.
|
|
252
|
+
* @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").
|
|
235
253
|
* @property {number} [count] - With a PNG picture: how many main colors (default 14).
|
|
236
254
|
*/
|
|
237
255
|
|
|
@@ -240,7 +258,7 @@
|
|
|
240
258
|
* @experimental May change or be removed in a patch release.
|
|
241
259
|
* @typedef {object} ThemeEditHowResponse
|
|
242
260
|
* @property {'themeEdit.how'} type
|
|
243
|
-
* @property {{kind: 'part' | '
|
|
261
|
+
* @property {{kind: 'part' | 'group' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, [key: string]: any}} data
|
|
244
262
|
*/
|
|
245
263
|
|
|
246
264
|
export {};
|