@astryxdesign/cli 0.7.16-canary.ge95b87c → 0.7.16
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 +369 -0
- package/README.md +1 -1
- package/api/build/_adapter.d.mts +9 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/kit/shell.weights.json +1 -0
- package/api/build/kit/shellcall.d.mts +26 -0
- package/api/build/kit/shellcall.mjs +87 -0
- package/api/build/kit/start.mjs +67 -4
- package/api/build/kit/weights.d.mts +15 -0
- package/api/build/kit/weights.mjs +27 -0
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/doctor/_adapter.d.mts +3 -2
- package/api/doctor/_adapter.mjs +7 -1
- package/api/doctor/doctor.d.mts +8 -0
- package/api/doctor/doctor.mjs +53 -8
- package/api/doctor/theme-checks.mjs +157 -8
- package/api/icon/_adapter.d.mts +7 -3
- package/api/icon/_adapter.mjs +12 -3
- package/api/icon/icon.type.d.mts +15 -0
- package/api/icon/icon.type.mjs +10 -3
- package/api/icon/iconUse.doc.mjs +19 -5
- package/api/icon/list/list.mjs +7 -1
- package/api/icon/use/use.d.mts +8 -5
- package/api/icon/use/use.mjs +95 -13
- package/api/init/run/run.mjs +1 -0
- package/api/template/template.type.d.mts +6 -2
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.mjs +16 -2
- package/api/theme/build/build.d.mts +10 -6
- package/api/theme/build/build.mjs +42 -29
- package/api/theme/generateTonalPalette.doc.mjs +2 -2
- package/api/theme/palette/generate/generator.mjs +141 -2
- package/api/theme/theme.type.d.mts +39 -0
- package/api/theme/theme.type.mjs +21 -0
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme-edit/_adapter.d.mts +1 -0
- package/api/theme-edit/_adapter.mjs +79 -21
- package/api/theme-edit/_check.d.mts +25 -2
- package/api/theme-edit/_check.mjs +251 -61
- package/api/theme-edit/_context.d.mts +2 -1
- package/api/theme-edit/_context.mjs +19 -1
- package/api/theme-edit/_edit.d.mts +16 -0
- package/api/theme-edit/_edit.mjs +360 -59
- package/api/theme-edit/_how-question.d.mts +8 -0
- package/api/theme-edit/_how-question.mjs +169 -22
- package/api/theme-edit/_marks.d.mts +13 -0
- package/api/theme-edit/_marks.mjs +15 -0
- package/api/theme-edit/_palette.d.mts +27 -0
- package/api/theme-edit/_palette.mjs +112 -8
- package/api/theme-edit/_preview-app.d.mts +46 -1
- package/api/theme-edit/_preview-app.mjs +367 -36
- package/api/theme-edit/_preview.d.mts +55 -0
- package/api/theme-edit/_preview.mjs +231 -6
- package/api/theme-edit/_project.d.mts +4 -0
- package/api/theme-edit/_project.mjs +27 -6
- package/api/theme-edit/_settings.d.mts +61 -2
- package/api/theme-edit/_settings.mjs +317 -115
- package/api/theme-edit/_tables.mjs +1 -1
- package/api/theme-edit/theme-edit.type.d.mts +30 -2
- package/api/theme-edit/theme-edit.type.mjs +10 -2
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.zh.mjs +4 -3
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +63 -8
- package/assets/docs.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.doc.mjs +21 -0
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.tsx +62 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +20 -2
- package/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json +2 -0
- package/authoring/config/config.doc.mjs +8 -0
- package/authoring/config/parse.d.mts +1 -0
- package/authoring/config/parse.mjs +12 -0
- package/authoring/config/type.ts +8 -0
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +3 -3
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/experimental/icon.mjs +61 -6
- package/clients/cli/commands/experimental/theme.mjs +9 -2
- package/clients/cli/commands/experimental-icon-use.doc.mjs +12 -5
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +41 -18
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/index.mjs +25 -5
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/config-writer.d.mts +23 -0
- package/foundation/config/config-writer.mjs +150 -56
- package/foundation/config/project.mjs +43 -2
- package/foundation/discovery/component-discovery.mjs +6 -5
- package/foundation/discovery/icon-set-checks.mjs +164 -48
- package/foundation/discovery/icon-set-discovery.d.mts +38 -5
- package/foundation/discovery/icon-set-discovery.mjs +50 -6
- package/foundation/discovery/icon-set-theme-maps.d.mts +59 -0
- package/foundation/discovery/icon-set-theme-maps.mjs +95 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -3
- package/foundation/discovery/icon-set-writer.mjs +57 -16
- package/foundation/discovery/template-icons.d.mts +27 -10
- package/foundation/discovery/template-icons.mjs +142 -26
- package/foundation/discovery/theme-discovery.d.mts +25 -0
- package/foundation/discovery/theme-discovery.mjs +48 -7
- package/foundation/fs/gather-cache.mjs +6 -2
- package/foundation/integrations/autolink.d.mts +4 -2
- package/foundation/integrations/autolink.mjs +4 -2
- package/foundation/integrations/cli-requirement.d.mts +16 -5
- package/foundation/integrations/cli-requirement.mjs +27 -6
- package/foundation/integrations/may-have-integrations.mjs +5 -2
- package/foundation/integrations/missing-dependency.d.mts +9 -0
- package/foundation/integrations/missing-dependency.mjs +100 -0
- package/package.json +6 -6
|
@@ -429,7 +429,7 @@ export const DIALS = wordTable({
|
|
|
429
429
|
help:
|
|
430
430
|
'How much room there is: padding, gaps and control heights together. Rungs: ' +
|
|
431
431
|
SPACING.map(([n, f]) => `${n} (x${f})`).join(', ') +
|
|
432
|
-
'. Whole theme: scales every spacing token and control height. With --on <part or group>: only inside it.',
|
|
432
|
+
'. Whole theme: scales every spacing token and control height (a denser theme has shorter controls; the small, medium and large sizes stay apart and in order, none under 24px). With --on <part or group>: only inside it.',
|
|
433
433
|
values: 'tight|compact|medium|roomy|spacious|more|less',
|
|
434
434
|
examples: [
|
|
435
435
|
'set my spacing compact',
|
|
@@ -122,6 +122,16 @@ export type ThemeEditPreviewFields = {
|
|
|
122
122
|
* - 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.
|
|
123
123
|
*/
|
|
124
124
|
previewStale?: string[] | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* - 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), 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.
|
|
127
|
+
*/
|
|
128
|
+
see: string;
|
|
129
|
+
/**
|
|
130
|
+
* - 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.
|
|
131
|
+
*/
|
|
132
|
+
appCopy?: {
|
|
133
|
+
wrote: string[];
|
|
134
|
+
} | undefined;
|
|
125
135
|
};
|
|
126
136
|
/**
|
|
127
137
|
* `astryx --json experimental theme editor new <theme>`.
|
|
@@ -129,7 +139,7 @@ export type ThemeEditPreviewFields = {
|
|
|
129
139
|
export type ThemeEditNewResponse = {
|
|
130
140
|
type: "themeEdit.new";
|
|
131
141
|
/**
|
|
132
|
-
* - `settings`: the dial settings it started with; `notes`: font loading.
|
|
142
|
+
* - `settings`: the dial settings it started with; `notes`: font loading; `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).
|
|
133
143
|
*/
|
|
134
144
|
data: {
|
|
135
145
|
theme: string;
|
|
@@ -143,6 +153,7 @@ export type ThemeEditNewResponse = {
|
|
|
143
153
|
settings: string[];
|
|
144
154
|
notes: string[];
|
|
145
155
|
problems: string[];
|
|
156
|
+
wiring: string[];
|
|
146
157
|
} & ThemeEditPreviewFields;
|
|
147
158
|
};
|
|
148
159
|
/**
|
|
@@ -230,10 +241,20 @@ export type ThemeEditChangeData = {
|
|
|
230
241
|
* - In-app preview files changed by hand: see ThemeEditPreviewFields.
|
|
231
242
|
*/
|
|
232
243
|
previewStale?: string[] | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* - How to see the change: see ThemeEditPreviewFields.
|
|
246
|
+
*/
|
|
247
|
+
see: string;
|
|
233
248
|
/**
|
|
234
249
|
* - Set when sheet.html shows the theme as it was before this change: see ThemeEditPreviewFields.
|
|
235
250
|
*/
|
|
236
251
|
sheetStale?: string | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* - Only the first time the theme's app copy is written: see ThemeEditPreviewFields.
|
|
254
|
+
*/
|
|
255
|
+
appCopy?: {
|
|
256
|
+
wrote: string[];
|
|
257
|
+
} | undefined;
|
|
237
258
|
};
|
|
238
259
|
export type ThemeEditShowOptions = {
|
|
239
260
|
/**
|
|
@@ -281,6 +302,10 @@ export type ThemeEditShowResponse = {
|
|
|
281
302
|
module: string;
|
|
282
303
|
receipt: string;
|
|
283
304
|
} | null;
|
|
305
|
+
appCopy?: {
|
|
306
|
+
wrote: string[];
|
|
307
|
+
} | undefined;
|
|
308
|
+
wiring: string[];
|
|
284
309
|
};
|
|
285
310
|
};
|
|
286
311
|
/**
|
|
@@ -399,6 +424,7 @@ export type ThemeEditPreviewAddResponse = {
|
|
|
399
424
|
pages: string[];
|
|
400
425
|
files: string[];
|
|
401
426
|
open: string;
|
|
427
|
+
urls: Record<string, string>;
|
|
402
428
|
};
|
|
403
429
|
};
|
|
404
430
|
export type ThemeEditPreviewAppOptions = {
|
|
@@ -423,6 +449,7 @@ export type ThemeEditPreviewAppResponse = {
|
|
|
423
449
|
files: string[];
|
|
424
450
|
notes: string[];
|
|
425
451
|
open: string;
|
|
452
|
+
urls: Record<string, string>;
|
|
426
453
|
};
|
|
427
454
|
};
|
|
428
455
|
export type ThemeEditPreviewListOptions = {
|
|
@@ -441,7 +468,7 @@ export type ThemeEditPreviewListOptions = {
|
|
|
441
468
|
export type ThemeEditPreviewListResponse = {
|
|
442
469
|
type: "themeEdit.previewList";
|
|
443
470
|
/**
|
|
444
|
-
* - `themeMissing`: the theme the preview wears is gone, so its route does not build; a page's `missing`: its file is gone; `notes`: what else to know, such as the command that fixes it.
|
|
471
|
+
* - `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.
|
|
445
472
|
*/
|
|
446
473
|
data: {
|
|
447
474
|
folder: string | null;
|
|
@@ -450,6 +477,7 @@ export type ThemeEditPreviewListResponse = {
|
|
|
450
477
|
pages: Array<{
|
|
451
478
|
id: string;
|
|
452
479
|
label: string;
|
|
480
|
+
url?: string;
|
|
453
481
|
missing?: boolean;
|
|
454
482
|
}>;
|
|
455
483
|
notes: string[];
|
|
@@ -53,6 +53,8 @@
|
|
|
53
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
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
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), 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.
|
|
56
58
|
*/
|
|
57
59
|
|
|
58
60
|
/**
|
|
@@ -60,7 +62,7 @@
|
|
|
60
62
|
* @experimental May change or be removed in a patch release.
|
|
61
63
|
* @typedef {object} ThemeEditNewResponse
|
|
62
64
|
* @property {'themeEdit.new'} type
|
|
63
|
-
* @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.
|
|
65
|
+
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, settings: string[], notes: string[], problems: string[], wiring: string[]} & ThemeEditPreviewFields} data - `settings`: the dial settings it started with; `notes`: font loading; `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).
|
|
64
66
|
*/
|
|
65
67
|
|
|
66
68
|
/**
|
|
@@ -96,7 +98,9 @@
|
|
|
96
98
|
* @property {string | null} pictureProblem
|
|
97
99
|
* @property {{code: string, cause: string} | null} notChecked - Saved but not checked: see ThemeEditPreviewFields.
|
|
98
100
|
* @property {string[]} [previewStale] - In-app preview files changed by hand: see ThemeEditPreviewFields.
|
|
101
|
+
* @property {string} see - How to see the change: see ThemeEditPreviewFields.
|
|
99
102
|
* @property {string} [sheetStale] - Set when sheet.html shows the theme as it was before this change: see ThemeEditPreviewFields.
|
|
103
|
+
* @property {{wrote: string[]}} [appCopy] - Only the first time the theme's app copy is written: see ThemeEditPreviewFields.
|
|
100
104
|
*/
|
|
101
105
|
|
|
102
106
|
/**
|
|
@@ -132,6 +136,8 @@
|
|
|
132
136
|
* @property {string[]} data.pictures
|
|
133
137
|
* @property {string | null} data.pictureProblem
|
|
134
138
|
* @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.
|
|
139
|
+
* @property {{wrote: string[]}} [data.appCopy] - Only the first time the theme's app copy is written: the files written in src/themes/<theme>/.
|
|
140
|
+
* @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).
|
|
135
141
|
*/
|
|
136
142
|
|
|
137
143
|
/**
|
|
@@ -192,6 +198,7 @@
|
|
|
192
198
|
* @property {string[]} data.pages - Every page of the preview, in order.
|
|
193
199
|
* @property {string[]} data.files - Every file the preview wrote.
|
|
194
200
|
* @property {string} data.open - How to open the preview.
|
|
201
|
+
* @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.
|
|
195
202
|
*/
|
|
196
203
|
|
|
197
204
|
/**
|
|
@@ -213,6 +220,7 @@
|
|
|
213
220
|
* @property {string[]} data.files - Every file written.
|
|
214
221
|
* @property {string[]} data.notes - What else to know.
|
|
215
222
|
* @property {string} data.open - How to install, run and open the app.
|
|
223
|
+
* @property {Record<string, string>} data.urls - Each page's own URL once the app runs (/theme-preview?page=<id>).
|
|
216
224
|
*/
|
|
217
225
|
|
|
218
226
|
/**
|
|
@@ -227,7 +235,7 @@
|
|
|
227
235
|
* @experimental May change or be removed in a patch release.
|
|
228
236
|
* @typedef {object} ThemeEditPreviewListResponse
|
|
229
237
|
* @property {'themeEdit.previewList'} type
|
|
230
|
-
* @property {{folder: string | null, theme: string | null, themeMissing: boolean, pages: Array<{id: string, label: string, missing?: boolean}>, notes: string[]}} data - `themeMissing`: the theme the preview wears is gone, so its route does not build; a page's `missing`: its file is gone; `notes`: what else to know, such as the command that fixes it.
|
|
238
|
+
* @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.
|
|
231
239
|
*/
|
|
232
240
|
|
|
233
241
|
/**
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'themeEditPreviewApp()',
|
|
13
13
|
summary: 'Make a new starter app with the theme preview inside.',
|
|
14
14
|
description:
|
|
15
|
-
"Writes a new starter app into `dir` (Next.js app router, Core and the neutral theme, with the Astryx packages pinned to this CLI's release), with the theme preview route and its default pages (the sample app page and every component grouped) in src/app/theme-preview/. With `theme`, the theme folder is copied into the app's themes/ and the pages wear it; a base theme or font package it needs is added to package.json. No install runs: the result says how to install, run and open it. `dir` must be new or empty, inside the current folder; a folder that is not empty is refused, with a free folder name to use instead. Every check runs before the first write, so a refusal changes nothing. Every open font the theme names is added to package.json, at the version this project has or a pinned range, and the route imports it; a theme with generated colors gets the Colors page too, and a one-mode theme starts the route in its mode. The app is written into a temp folder beside the folder and moved into place, so a failure leaves nothing behind. A folder holding only .git, .DS_Store or Thumbs.db counts as empty. The folder is refused when it is a file, a dangling link, inside this app's routes folder, themes/, node_modules/ or Next's build folder (.next/, out/ or the distDir next.config names), or written with Windows separators, white space at either end or a name too long. A theme whose build is missing or older than its settings is built first, with a note. The app's home page links to the preview, and its .gitignore leaves out node_modules, next-env.d.ts and *.tsbuildinfo. Inside a project with a tsconfig.json, a note says to exclude the new folder. With a theme, it holds that theme's lock while it builds and copies it, so an `editor set` on the same theme waits for it. A folder given from a subfolder of the project is taken from where it was given. An app is refused in public/ (served as files at the site root) and under a name Windows does not allow; a base theme passed to --theme is named as a package theme, installed or not, with the command that adds it. Experimental: it may change or be removed in a patch release.",
|
|
15
|
+
"Writes a new starter app into `dir` (Next.js app router, Core and the neutral theme, with the Astryx packages pinned to this CLI's release; with `theme`, Core and the base theme are pinned to the versions this project has, the ones the copied build was made on, with a note), with the theme preview route and its default pages (the sample app page and every component grouped) in src/app/theme-preview/. With `theme`, the theme folder is copied into the app's themes/ and the pages wear it; a base theme or font package it needs is added to package.json. No install runs: the result says how to install, run and open it. `dir` must be new or empty, inside the current folder; a folder that is not empty is refused, with a free folder name to use instead. Every check runs before the first write, so a refusal changes nothing. Every open font the theme names is added to package.json, at the version this project has or a pinned range, and the route imports it; a theme with generated colors gets the Colors page too, and a one-mode theme starts the route in its mode. The app is written into a temp folder beside the folder and moved into place, so a failure leaves nothing behind. A folder holding only .git, .DS_Store or Thumbs.db counts as empty. The folder is refused when it is a file, a dangling link, inside this app's routes folder, themes/, node_modules/ or Next's build folder (.next/, out/ or the distDir next.config names), or written with Windows separators, white space at either end or a name too long. A theme whose build is missing or older than its settings is built first, with a note. The app's home page links to the preview, and its .gitignore leaves out node_modules, next-env.d.ts and *.tsbuildinfo. Inside a project with a tsconfig.json, a note says to exclude the new folder. With a theme, it holds that theme's lock while it builds and copies it, so an `editor set` on the same theme waits for it. A folder given from a subfolder of the project is taken from where it was given. An app is refused in public/ (served as files at the site root) and under a name Windows does not allow; a base theme passed to --theme is named as a package theme, installed or not, with the command that adds it. Experimental: it may change or be removed in a patch release.",
|
|
16
16
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
17
|
signature:
|
|
18
18
|
'themeEditPreviewApp(dir: string, options?: object): Promise<object>',
|
|
@@ -7,7 +7,7 @@ export const docs = {
|
|
|
7
7
|
title: 'Author a theme',
|
|
8
8
|
category: 'guide',
|
|
9
9
|
keywords: ['defineTheme', 'create theme', 'custom theme', 'extends', 'component overrides', 'custom variants', 'adaptations', 'breakpoints', 'theme build', 'theme family', 'tokenVar', 'resolveThemeTokens', 'useTheme', 'palette', 'generate palette', 'seed colors', 'color ramp', 'icon registry'],
|
|
10
|
-
description: '
|
|
10
|
+
description: 'Start here: the experimental theme editor makes and changes themes for you (`astryx experimental theme editor new <name> --like neutral`; see the theme doc), checked against what components read. By hand: create, customize, and build a theme: defineTheme, palette generation, token overrides, component style overrides, custom variants, responsive adaptations, and production builds.',
|
|
11
11
|
|
|
12
12
|
sections: [
|
|
13
13
|
{
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @type {import('@astryxdesign/cli/authoring').ReferenceTranslationDoc} */
|
|
4
4
|
|
|
5
5
|
export const docsDense = {
|
|
6
|
-
description: 'use + create themes: see use-a-theme and author-a-theme.',
|
|
6
|
+
description: 'make/change a theme (experimental theme editor): astryx experimental theme editor new <name> --like neutral; editor set|how; theme add <name>; after each change look: experimental theme editor show <name> --png (pictures, changes nothing in the app); not done until you have looked. use + create themes: see use-a-theme and author-a-theme.',
|
|
7
7
|
sections: [
|
|
8
8
|
{
|
|
9
9
|
section: 'Wrap your app in a theme',
|
|
@@ -8,7 +8,7 @@ export const docs = {
|
|
|
8
8
|
category: 'guide',
|
|
9
9
|
keywords: ['theme', 'theming', 'theme system', 'dark mode', 'defineTheme', 'provider'],
|
|
10
10
|
description:
|
|
11
|
-
'How to use and create themes: see Use a theme for applying themes, and Author a theme for creating and customizing them.',
|
|
11
|
+
'To create or change a theme, use the experimental theme editor: `astryx experimental theme editor new <name> --like neutral`, then `editor set` / `editor how "<what you want>"`, wire it with `astryx theme add <name>`, and after each change look at it with `astryx experimental theme editor show <name> --png` (pictures of real components; nothing changes in the app): a theme change is not done until you have looked. How to use and create themes: see Use a theme for applying themes, and Author a theme for creating and customizing them.',
|
|
12
12
|
|
|
13
13
|
sections: [
|
|
14
14
|
{
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/** @type {import('@astryxdesign/cli/authoring').ReferenceTranslationDoc} */
|
|
4
4
|
|
|
5
5
|
export const docsZh = {
|
|
6
|
-
description:
|
|
6
|
+
description:
|
|
7
|
+
'要创建或修改主题,请使用实验性主题编辑器:`astryx experimental theme editor new <name> --like neutral`,然后使用 `editor set` / `editor how "<你想要的效果>"`,用 `astryx theme add <name>` 接入应用,每次修改后用 `astryx experimental theme editor show <name> --png` 查看(生成真实组件的图片,不改动应用):看过图片之前,主题修改不算完成。如何使用和创建主题:请参阅"使用主题"了解如何应用主题,参阅"创作主题"了解如何创建和自定义主题。',
|
|
7
8
|
sections: [
|
|
8
9
|
{
|
|
9
10
|
section: 'Wrap your app in a theme',
|
|
@@ -21,7 +22,7 @@ export const docsZh = {
|
|
|
21
22
|
content: [
|
|
22
23
|
{
|
|
23
24
|
type: 'prose',
|
|
24
|
-
text:
|
|
25
|
+
text: "使用 `defineTheme` 进行令牌覆盖、比例配置和组件样式覆盖。新建完整调色板时,请运行 `astryx theme palette generate palette.config.json --out palette.generated.ts`,审核并提交生成的模块和收据,再使用 `import {palette} from './palette.generated';` 导入调色板,让语义令牌引用稳定的色阶,例如 `palette.neutral.light[100]` 和 `palette.neutral.dark[15]`。重新生成已接受的调色板时,所有保留这些引用的映射令牌会一并更新;生成操作不会自动修改主题。完整指南请参阅 {@link generic:author-a-theme}。",
|
|
25
26
|
},
|
|
26
27
|
],
|
|
27
28
|
},
|
|
@@ -42,7 +43,7 @@ export const docsZh = {
|
|
|
42
43
|
content: [
|
|
43
44
|
{
|
|
44
45
|
type: 'prose',
|
|
45
|
-
text:
|
|
46
|
+
text: "在令牌值中使用 [浅色, 深色] 元组来自动切换模式。在 Theme 上使用 mode='system'(默认)来跟随操作系统偏好。完整指南:{@link generic:use-a-theme}。",
|
|
46
47
|
},
|
|
47
48
|
],
|
|
48
49
|
},
|
|
@@ -90,7 +90,7 @@ export const oceanContrastTheme = defineTheme({
|
|
|
90
90
|
content: [
|
|
91
91
|
{
|
|
92
92
|
type: 'prose',
|
|
93
|
-
text: 'Core private variables start with `--_`, such as `--_field-radius`. They are internals and can change in any Core release, so `theme build`
|
|
93
|
+
text: 'Core private variables start with `--_`, such as `--_field-radius`. They are internals and can change in any Core release, so `theme build` refuses a theme that sets one (`ERR_THEME_INVALID`, naming each) and writes nothing. Set the standard CSS property instead — `borderRadius`, `padding` — and let the build emit the internal variable where Core needs it.',
|
|
94
94
|
},
|
|
95
95
|
],
|
|
96
96
|
},
|
|
@@ -129,17 +129,17 @@ export const docs = {
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
type: 'prose',
|
|
132
|
-
text:
|
|
132
|
+
text: "A library with a module per style supplies variants. Declare them when you create the set, then add a variant for every icon in one run. Name each look by what it draws, `outline` or `filled`, not by the library's word for it (Heroicons calls its filled look `solid`): an app picks one look for all its icons by that name, and the name reaches every set in its list that uses it (see Draw every icon in one look).",
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
type: 'code',
|
|
136
136
|
lang: 'bash',
|
|
137
|
-
code: `astryx experimental icon new-set heroicons --from @heroicons/react/24/outline --variants outline,
|
|
138
|
-
astryx experimental icon add --variant
|
|
137
|
+
code: `astryx experimental icon new-set heroicons --from @heroicons/react/24/outline --variants outline,filled --default-variant outline --description 'Heroicons, outline and filled.'
|
|
138
|
+
astryx experimental icon add --variant filled --from @heroicons/react/24/solid --all`,
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
type: 'prose',
|
|
142
|
-
text: "A library that redraws its artwork for small sizes (Heroicons' 20px mini and 16px micro) ships each of those as its own set in its own package (their export names match the 24px ones), not as variants: a variant's size comes from CSS. `--variants` lists the variants; `--default-variant` names the one each icon's own export draws (when omitted, the look a library that names its looks draws; otherwise the set's current default, else, on a set without icons, the first variant; a set with icons changes it only with `--from`, and only in a library that names its looks). `--all` adds the variant for every icon whose id an export of `--from` has (`TrashIcon` in the solid module becomes `
|
|
142
|
+
text: "A library that redraws its artwork for small sizes (Heroicons' 20px mini and 16px micro) ships each of those as its own set in its own package (their export names match the 24px ones), not as variants: a variant's size comes from CSS. `--variants` lists the variants; `--default-variant` names the one each icon's own export draws (when omitted, the look a library that names its looks draws; otherwise the set's current default, else, on a set without icons, the first variant; a set with icons changes it only with `--from`, and only in a library that names its looks). `--all` adds the variant for every icon whose id an export of `--from` has (`TrashIcon` in the solid module becomes `TrashFilledIcon`, the filled variant of `trash`), and the receipt lists the icons the module has no export for. A library may ship each look as its own package (Font Awesome's solid and regular packages): `--from` may then name the other package, and an icon gains the variant from the export of the same name there; the receipt lists the icons that package has no export for. Running it again changes nothing.",
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
type: 'prose',
|
|
@@ -278,6 +278,10 @@ import {themeIcons} from '@acme/icons';
|
|
|
278
278
|
|
|
279
279
|
export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
|
|
280
280
|
},
|
|
281
|
+
{
|
|
282
|
+
type: 'prose',
|
|
283
|
+
text: "`themeIcons` draws your default look. For each other variant that one of your icons draws, the module also exports a map named after it, `themeIcons<Variant>` (`themeIconsFilled` for `filled`): the same keys, each your icon's export for that variant, or its own export when it has none. An app whose icons draw that look sets `icons: themeIconsFilled` instead. `integration check` holds each of these maps to `map` as well; when an older module lacks one, it names the `experimental icon add --variant <variant> --from <module> --all` run that writes it.",
|
|
284
|
+
},
|
|
281
285
|
],
|
|
282
286
|
},
|
|
283
287
|
{
|
|
@@ -362,7 +366,8 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
|
|
|
362
366
|
astryx experimental icon outline/bin # one icon and every variant
|
|
363
367
|
astryx experimental icon --list # installed sets, their order, and definition coverage
|
|
364
368
|
astryx experimental icon use outline # make it the project's main icon set
|
|
365
|
-
astryx experimental icon use outline --backup brand # a main set, then a backup
|
|
369
|
+
astryx experimental icon use outline --backup brand # a main set, then a backup
|
|
370
|
+
astryx experimental icon use brand --variant filled # every icon in its filled look`,
|
|
366
371
|
},
|
|
367
372
|
{
|
|
368
373
|
type: 'prose',
|
|
@@ -370,7 +375,7 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
370
375
|
},
|
|
371
376
|
{
|
|
372
377
|
type: 'prose',
|
|
373
|
-
text: "Each `icons` key is the name the template imports from its module, not a local alias. When a template imports the same name from two modules, such as `TrashIcon` from a library's outline and solid modules, one key covers both: both draw the same definition. Each then becomes the chosen set's variant of the same name when its module belongs to an installed set that declares the variant (so solid stays solid). When the chosen set's icon has no such variant, it draws the set's default look, and the report names both looks as `variant: {asked, used}`. A missing look never moves an icon to a backup set.",
|
|
378
|
+
text: "Each `icons` key is the name the template imports from its module, not a local alias. When a template imports the same name from two modules, such as `TrashIcon` from a library's outline and solid modules, one key covers both: both draw the same definition. Each then becomes the chosen set's variant of the same name when its module belongs to an installed set that declares the variant (so solid stays solid). When the chosen set's icon has no such variant, it draws the set's default look, and the report names both looks as `variant: {asked, used}`. A missing look never moves an icon to a backup set. When the project picks a look (`experimental.iconVariant`), every icon asks for that look instead.",
|
|
374
379
|
},
|
|
375
380
|
],
|
|
376
381
|
},
|
|
@@ -414,6 +419,52 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
414
419
|
},
|
|
415
420
|
],
|
|
416
421
|
},
|
|
422
|
+
{
|
|
423
|
+
id: 'one-look',
|
|
424
|
+
title: 'Draw every icon in one look',
|
|
425
|
+
content: [
|
|
426
|
+
{
|
|
427
|
+
type: 'prose',
|
|
428
|
+
text: "A set may supply each icon in several looks, its variants: outline and filled, say. A project picks one look for all of its icons with `--variant`, which writes `experimental.iconVariant` next to `experimental.iconSet`. The look must be one of the main set's variants; `experimental icon --list` shows each set's `variants`.",
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
type: 'code',
|
|
432
|
+
lang: 'bash',
|
|
433
|
+
code: `astryx experimental icon use brand --backup lines --variant filled`,
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
type: 'code',
|
|
437
|
+
lang: 'js',
|
|
438
|
+
label: 'astryx.config.mjs',
|
|
439
|
+
code: `export default {
|
|
440
|
+
experimental: {
|
|
441
|
+
iconSet: ['brand', 'lines'],
|
|
442
|
+
iconVariant: 'filled',
|
|
443
|
+
},
|
|
444
|
+
};`,
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
type: 'prose',
|
|
448
|
+
text: "Sets match the look by name. Each set in the list draws its variant called `filled`; a set without one draws its default look, and the receipt shows the look of every listed set (`looks`). A set that calls the same look something else, such as `solid` or `regular`, draws its default look until it renames that variant to `filled`. A copied template imports each icon's `filled` export where the icon has one (`TrashFilledIcon`). Where it has none, the copy keeps the set's default export and reports `variant: {asked, used}`; it never fetches that icon from a backup for its look. With a look picked, an icon taken from the main set's own library becomes the main set's icon in that look: the one `map` names for its meaning, or else the one that re-exports that same library export (reported `by: 'variant'`). An icon already imported from a listed set in another look moves to its `filled` export (also `by: 'variant'`). The copy report names the look as `icons.variant`.",
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
type: 'prose',
|
|
452
|
+
text: "Components take the built-in icons from the theme. Where an icon of the main set draws the look, the set's package exports a theme map for it, `themeIconsFilled`, and the receipt names that export and its module (`themeMap`):",
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
type: 'code',
|
|
456
|
+
lang: 'tsx',
|
|
457
|
+
code: `import {defineTheme} from '@astryxdesign/core/theme';
|
|
458
|
+
import {themeIconsFilled} from '@acme/brand-icons';
|
|
459
|
+
|
|
460
|
+
export const brand = defineTheme({name: 'brand', icons: themeIconsFilled});`,
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
type: 'prose',
|
|
464
|
+
text: "`use` writes the whole choice each time: run it with every set and the look you want, and without `--variant` to go back to each set's default look, which removes `experimental.iconVariant`. `astryx doctor` fails while the main set declares no variant of that name, naming its variants and the command that picks one. A CLI older than 0.7.16 refuses an astryx.config that sets `experimental.iconVariant`, so `use` warns when the project's `@astryxdesign/cli` range admits one.",
|
|
465
|
+
},
|
|
466
|
+
],
|
|
467
|
+
},
|
|
417
468
|
{
|
|
418
469
|
id: 'missing-icons',
|
|
419
470
|
title: 'When no set has an icon',
|
|
@@ -473,13 +524,17 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
473
524
|
'`experimental.iconSet` in astryx.config',
|
|
474
525
|
"The project's main icon set, by set name or as `<package>/<set>`, or a list: the main set first, then backup sets in order. It is the opt-in: templates, discover, and doctor read icon sets only when it is set. `astryx experimental icon` ranks the main set's icons first, and without it treats the only installed set as the project's. `astryx experimental icon use <main> --backup <set>` writes it.",
|
|
475
526
|
],
|
|
527
|
+
[
|
|
528
|
+
'`experimental.iconVariant` in astryx.config',
|
|
529
|
+
"The look every icon of the project draws, one of the main set's variants; it needs `experimental.iconSet`. Copied templates import each icon in that look where its set has one, and `astryx experimental icon use <main> --variant <variant>` writes it.",
|
|
530
|
+
],
|
|
476
531
|
[
|
|
477
532
|
'`experimental.iconSets` in the integration manifest',
|
|
478
533
|
"The folder that holds the package's icon sets, relative to package.json. `astryx experimental icon new-set` declares it.",
|
|
479
534
|
],
|
|
480
535
|
[
|
|
481
536
|
"A template descriptor's `icons`",
|
|
482
|
-
"The icon definition each imported icon draws (`{TrashIcon: 'delete'}`): a named import by the name it imports, a default import by its local name. `astryx template`, shown or copied, then writes the icons from the first set in the list that has each meaning and reports `icons` (status, set, order, mapped, placeholder, kept, sets): every key is mapped, a placeholder when no set has its meaning, or kept with why (a namespace or type-only import, a re-export, an Astryx import or one from a set in the list, an import from the library a set in the list wraps, no import at all, or an icon that draws no definition and has no match). `integration check` notes a key the template's source never imports (`template_icon_not_imported`), never failing, and notes an imported icon the package's templates do not declare (`template_icon_undeclared`), which fails `--strict --next`.",
|
|
537
|
+
"The icon definition each imported icon draws (`{TrashIcon: 'delete'}`): a named import by the name it imports, a default import by its local name. `astryx template`, shown or copied, then writes the icons from the first set in the list that has each meaning and reports `icons` (status, set, order, variant, mapped, placeholder, kept, sets): every key is mapped, a placeholder when no set has its meaning, or kept with why (a namespace or type-only import, a re-export, an Astryx import or one from a set in the list, an import from the library a set in the list wraps, no import at all, or an icon that draws no definition and has no match). `integration check` notes a key the template's source never imports (`template_icon_not_imported`), never failing, and notes an imported icon the package's templates do not declare (`template_icon_undeclared`), which fails `--strict --next`.",
|
|
483
538
|
],
|
|
484
539
|
[
|
|
485
540
|
'`astryx discover`',
|
|
@@ -487,7 +542,7 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
487
542
|
],
|
|
488
543
|
[
|
|
489
544
|
'`astryx doctor`',
|
|
490
|
-
'In an app, the `icon-sets` check: fails when `experimental.iconSet` names a set, main or backup, that is not installed, was withdrawn (an invalid set, or one whose module does not resolve), or that two packages ship by that name, saying why; fails when more than one set is installed and the list leaves one out; and warns when another installed set was withdrawn. The `icon-placeholders` check warns while copied code uses the placeholder for a missing icon, naming each file and meaning. In your icon-set package, check with `astryx integration check` instead: plain `doctor` diagnoses an app.',
|
|
545
|
+
'In an app, the `icon-sets` check: fails when `experimental.iconSet` names a set, main or backup, that is not installed, was withdrawn (an invalid set, or one whose module does not resolve), or that two packages ship by that name, saying why; fails when more than one set is installed and the list leaves one out; fails when `experimental.iconVariant` names a variant the main set does not declare; and warns when another installed set was withdrawn. The `icon-placeholders` check warns while copied code uses the placeholder for a missing icon, naming each file and meaning. In your icon-set package, check with `astryx integration check` instead: plain `doctor` diagnoses an app.',
|
|
491
546
|
],
|
|
492
547
|
[
|
|
493
548
|
'JSON types',
|