@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.
- package/README.md +18 -18
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/doctor/doctor.mjs +3 -7
- package/api/experimental.d.mts +2 -0
- package/api/experimental.mjs +12 -0
- package/api/icon/_adapter.d.mts +10 -0
- package/api/icon/_adapter.mjs +31 -2
- package/api/icon/_authoring.d.mts +2 -1
- package/api/icon/_authoring.mjs +91 -6
- package/api/icon/_options.mjs +1 -0
- package/api/icon/_records.d.mts +18 -0
- package/api/icon/_records.mjs +26 -0
- package/api/icon/add/add.mjs +7 -1
- package/api/icon/definitions/definitions.d.mts +12 -0
- package/api/icon/definitions/definitions.mjs +83 -0
- package/api/icon/icon.doc.mjs +5 -4
- package/api/icon/icon.mjs +5 -16
- package/api/icon/icon.type.d.mts +29 -2
- package/api/icon/icon.type.mjs +17 -3
- package/api/icon/iconAdd.doc.mjs +1 -1
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/iconNewSet.doc.mjs +8 -2
- package/api/icon/map/map.mjs +21 -2
- package/api/icon/new-set/new-set.mjs +14 -2
- package/api/icon/search/search.mjs +2 -15
- package/api/icon/use/use.mjs +4 -3
- package/api/integration/validate-integration.mjs +6 -1
- package/api/integration/validate-integration.type.d.mts +12 -0
- package/api/integration/validate-integration.type.mjs +5 -0
- package/api/theme-edit/_adapter.d.mts +116 -0
- package/api/theme-edit/_adapter.mjs +1683 -0
- package/api/theme-edit/_catalog.d.mts +59 -0
- package/api/theme-edit/_catalog.mjs +564 -0
- package/api/theme-edit/_check.d.mts +49 -0
- package/api/theme-edit/_check.mjs +845 -0
- package/api/theme-edit/_color.d.mts +29 -0
- package/api/theme-edit/_color.mjs +300 -0
- package/api/theme-edit/_compiler.d.mts +61 -0
- package/api/theme-edit/_compiler.mjs +522 -0
- package/api/theme-edit/_css-properties.d.mts +10 -0
- package/api/theme-edit/_css-properties.mjs +556 -0
- package/api/theme-edit/_parts.d.mts +111 -0
- package/api/theme-edit/_parts.mjs +409 -0
- package/api/theme-edit/_png.d.mts +40 -0
- package/api/theme-edit/_png.mjs +187 -0
- package/api/theme-edit/_preview.d.mts +121 -0
- package/api/theme-edit/_preview.mjs +720 -0
- package/api/theme-edit/_project.d.mts +83 -0
- package/api/theme-edit/_project.mjs +289 -0
- package/api/theme-edit/_settings.d.mts +222 -0
- package/api/theme-edit/_settings.mjs +861 -0
- package/api/theme-edit/_tables.d.mts +132 -0
- package/api/theme-edit/_tables.mjs +700 -0
- package/api/theme-edit/theme-edit.d.mts +93 -0
- package/api/theme-edit/theme-edit.mjs +145 -0
- package/api/theme-edit/theme-edit.type.d.mts +413 -0
- package/api/theme-edit/theme-edit.type.mjs +233 -0
- package/api/theme-edit/themeEditHow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditHow.doc.mjs +88 -0
- package/api/theme-edit/themeEditNew.doc.d.mts +6 -0
- package/api/theme-edit/themeEditNew.doc.mjs +89 -0
- package/api/theme-edit/themeEditPreviewAdd.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +100 -0
- package/api/theme-edit/themeEditPreviewApp.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +84 -0
- package/api/theme-edit/themeEditPreviewList.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewList.doc.mjs +53 -0
- package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +66 -0
- package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
- package/api/theme-edit/themeEditSet.doc.mjs +165 -0
- package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditShow.doc.mjs +86 -0
- package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
- package/api/theme-edit/themeEditUndo.doc.mjs +124 -0
- package/assets/docs/color.doc.mjs +5 -5
- package/assets/docs/tree/icon-sets.doc.mjs +6 -2
- package/assets/docs/tree/tokens-border.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +2 -2
- package/assets/docs/tree/tokens-data.doc.mjs +2 -2
- package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
- package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
- package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
- package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
- package/assets/docs/tree/tokens-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
- package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
- package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
- package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
- package/assets/icons/definitions/bank.doc.mjs +1 -1
- package/assets/icons/definitions/save.doc.mjs +1 -1
- package/assets/preview-app/README.md +6 -0
- package/assets/preview-app/css.d.ts +5 -0
- package/assets/preview-app/gitignore +1 -0
- package/assets/preview-app/next.config.mjs +6 -0
- package/assets/preview-app/package.json +23 -0
- package/assets/preview-app/src/app/globals.css +5 -0
- package/assets/preview-app/src/app/layout.tsx +21 -0
- package/assets/preview-app/src/app/page.tsx +94 -0
- package/assets/preview-app/src/app/providers.tsx +16 -0
- package/assets/preview-app/tsconfig.json +27 -0
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
- package/authoring/doctypes/_schema.d.mts +1 -0
- package/authoring/doctypes/_schema.mjs +1 -0
- package/authoring/doctypes/command/command.doc.mjs +7 -0
- package/authoring/doctypes/command/type.ts +3 -0
- package/authoring/doctypes/icon-set/parse.d.mts +7 -0
- package/authoring/doctypes/icon-set/parse.mjs +18 -8
- package/clients/cli/commands/doctor.mjs +33 -3
- package/clients/cli/commands/experimental/icon.mjs +67 -14
- package/clients/cli/commands/experimental/index.mjs +2 -0
- package/clients/cli/commands/experimental/theme.mjs +684 -0
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +84 -0
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +121 -0
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +104 -0
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
- package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
- package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +86 -0
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +48 -0
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +59 -0
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +40 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme.doc.mjs +57 -0
- package/clients/cli/commands/experimental.doc.mjs +10 -3
- package/clients/cli/commands/theme.mjs +101 -34
- package/clients/cli/index.mjs +18 -0
- package/clients/cli/lib/define-command.mjs +3 -0
- package/foundation/discovery/icon-set-checks.d.mts +16 -1
- package/foundation/discovery/icon-set-checks.mjs +68 -7
- package/foundation/discovery/icon-set-discovery.d.mts +21 -6
- package/foundation/discovery/icon-set-discovery.mjs +17 -8
- package/foundation/discovery/template-icon-meanings.d.mts +39 -0
- package/foundation/discovery/template-icon-meanings.mjs +95 -0
- package/foundation/discovery/theming-targets.d.mts +6 -0
- package/foundation/discovery/theming-targets.mjs +33 -0
- package/foundation/response/error-codes.d.mts +12 -1
- package/foundation/response/error-codes.doc.mjs +66 -0
- package/foundation/response/error-codes.mjs +55 -0
- package/foundation/response/response-types.doc.mjs +55 -0
- package/foundation/text/template-meanings-line.d.mts +16 -0
- package/foundation/text/template-meanings-line.mjs +37 -0
- package/foundation/xle/browser.d.mts +2 -2
- 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
|
+
};
|