@astryxdesign/cli 0.7.13 → 0.7.14-canary.d08ce65
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 +10 -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 +96 -0
- package/api/theme-edit/_adapter.mjs +1039 -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 +842 -0
- package/api/theme-edit/_color.d.mts +35 -0
- package/api/theme-edit/_color.mjs +125 -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 +86 -0
- package/api/theme-edit/_preview.mjs +564 -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 +848 -0
- package/api/theme-edit/_tables.d.mts +130 -0
- package/api/theme-edit/_tables.mjs +697 -0
- package/api/theme-edit/theme-edit.d.mts +89 -0
- package/api/theme-edit/theme-edit.mjs +119 -0
- package/api/theme-edit/theme-edit.type.d.mts +270 -0
- package/api/theme-edit/theme-edit.type.mjs +155 -0
- package/api/theme-edit/themeEditExplain.doc.d.mts +6 -0
- package/api/theme-edit/themeEditExplain.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/themeEditPreview.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreview.doc.mjs +96 -0
- package/api/theme-edit/themeEditReset.doc.d.mts +6 -0
- package/api/theme-edit/themeEditReset.doc.mjs +161 -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 +80 -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/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 +542 -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-eject.doc.mjs +71 -0
- package/clients/cli/commands/experimental-theme-explain.doc.mjs +84 -0
- package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-new.doc.mjs +66 -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.doc.mjs +76 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-reset.doc.mjs +103 -0
- package/clients/cli/commands/experimental-theme-set.doc.mjs +121 -0
- package/clients/cli/commands/experimental-theme-show.doc.mjs +66 -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-undo.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme.doc.mjs +66 -0
- package/clients/cli/commands/experimental.doc.mjs +10 -3
- package/clients/cli/commands/theme.mjs +101 -34
- package/clients/cli/index.mjs +16 -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 +43 -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,89 @@
|
|
|
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
|
+
* Return one setting to the base theme's value: the setting is removed,
|
|
25
|
+
* and the theme is rebuilt and previewed.
|
|
26
|
+
* @experimental
|
|
27
|
+
* @param {string} theme
|
|
28
|
+
* @param {string} thing
|
|
29
|
+
* @param {ChangeOptions & {value?: string}} [options] `value` names which half of
|
|
30
|
+
* the `headings` dial to reset (`weight` or `tracking`)
|
|
31
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
|
|
32
|
+
*/
|
|
33
|
+
export function themeEditReset(theme: string, thing: string, options?: ChangeOptions & {
|
|
34
|
+
value?: string;
|
|
35
|
+
}): Promise<import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Every setting of a theme, key resolved values, problems it caused, the
|
|
38
|
+
* sample page and the theme-building page with every component.
|
|
39
|
+
* @experimental
|
|
40
|
+
* @param {string} theme
|
|
41
|
+
* @param {{cwd?: string, png?: boolean, group?: string}} [options]
|
|
42
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
|
|
43
|
+
*/
|
|
44
|
+
export function themeEditShow(theme: string, options?: {
|
|
45
|
+
cwd?: string;
|
|
46
|
+
png?: boolean;
|
|
47
|
+
group?: string;
|
|
48
|
+
}): Promise<import("./theme-edit.type.mjs").ThemeEditShowResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Put the theme back as it was before its last change.
|
|
51
|
+
* @experimental
|
|
52
|
+
* @param {string} theme
|
|
53
|
+
* @param {{cwd?: string, png?: boolean}} [options]
|
|
54
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse>}
|
|
55
|
+
*/
|
|
56
|
+
export function themeEditUndo(theme: string, options?: {
|
|
57
|
+
cwd?: string;
|
|
58
|
+
png?: boolean;
|
|
59
|
+
}): Promise<import("./theme-edit.type.mjs").ThemeEditUndoResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* The theme-building page: every component grouped, each variant side by
|
|
62
|
+
* side, overlays open, and full template pages. Rendered to one HTML file,
|
|
63
|
+
* or with `write` written into the app as a page module.
|
|
64
|
+
* @experimental
|
|
65
|
+
* @param {string} theme
|
|
66
|
+
* @param {{cwd?: string, write?: string, group?: string, png?: boolean}} [options]
|
|
67
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewResponse>}
|
|
68
|
+
*/
|
|
69
|
+
export function themeEditPreview(theme: string, options?: {
|
|
70
|
+
cwd?: string;
|
|
71
|
+
write?: string;
|
|
72
|
+
group?: string;
|
|
73
|
+
png?: boolean;
|
|
74
|
+
}): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* Explain anything a theme change can name, or answer a question about one:
|
|
77
|
+
* a part (what it reads for each aspect, its variants, states and the parts
|
|
78
|
+
* inside it), a family (its members), a setting (a dial's rungs, a token's
|
|
79
|
+
* type and readers, a CSS property), an aspect (colors, text, corners...: the
|
|
80
|
+
* whole-theme tokens and dial), a plain-words question (exact commands), a
|
|
81
|
+
* PNG picture (its main colors, or the color at points), or with `list` a
|
|
82
|
+
* list of dials, tokens, parts, families or CSS properties.
|
|
83
|
+
* @experimental
|
|
84
|
+
* @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
|
|
85
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditExplainOptions} [options]
|
|
86
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditExplainResponse>}
|
|
87
|
+
*/
|
|
88
|
+
export function themeEditExplain(subject: string, options?: import("./theme-edit.type.mjs").ThemeEditExplainOptions): Promise<import("./theme-edit.type.mjs").ThemeEditExplainResponse>;
|
|
89
|
+
export type ChangeOptions = import("./theme-edit.type.mjs").ThemeEditChangeOptions;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Programmatic API for `astryx experimental theme`: make and change a
|
|
5
|
+
* theme one checked change at a time.
|
|
6
|
+
*
|
|
7
|
+
* themeEditNew('brand', {like: 'neutral'}) themeEdit.new
|
|
8
|
+
* themeEditSet('brand', 'corners', 'pill') themeEdit.set
|
|
9
|
+
* themeEditReset('brand', 'corners') themeEdit.reset
|
|
10
|
+
* themeEditShow('brand') themeEdit.show
|
|
11
|
+
* themeEditUndo('brand') themeEdit.undo
|
|
12
|
+
* themeEditPreview('brand', {write: 'src/app/theme'}) themeEdit.preview
|
|
13
|
+
* themeEditExplain('banner') themeEdit.explain
|
|
14
|
+
*
|
|
15
|
+
* Every change is checked first against what the installed Core's parts
|
|
16
|
+
* really read; a change that cannot take effect is refused and nothing is
|
|
17
|
+
* written. An accepted change rebuilds the theme with the theme build and
|
|
18
|
+
* writes a preview.
|
|
19
|
+
*
|
|
20
|
+
* @input a theme name and a change, a question, or a picture
|
|
21
|
+
* @output themeEdit.* envelopes
|
|
22
|
+
* @position api/theme-edit — command wrapper in
|
|
23
|
+
* clients/cli/commands/experimental/theme.mjs; the work is in _adapter.mjs
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import * as adapter from './_adapter.mjs';
|
|
27
|
+
|
|
28
|
+
/** @typedef {import('./theme-edit.type.mjs').ThemeEditChangeOptions} ChangeOptions */
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Start a theme in themes/<name>/, optionally on a built-in theme.
|
|
32
|
+
* @experimental
|
|
33
|
+
* @param {string} name
|
|
34
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditNewOptions} [options]
|
|
35
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
|
|
36
|
+
*/
|
|
37
|
+
export async function themeEditNew(name, options = {}) {
|
|
38
|
+
return adapter.themeEditNew(name, options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Change one thing in a theme: checked, built, previewed.
|
|
43
|
+
* @experimental
|
|
44
|
+
* @param {string} theme
|
|
45
|
+
* @param {string} thing a dial, a token, or a CSS property
|
|
46
|
+
* @param {string} value
|
|
47
|
+
* @param {ChangeOptions} [options]
|
|
48
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
|
|
49
|
+
*/
|
|
50
|
+
export async function themeEditSet(theme, thing, value, options = {}) {
|
|
51
|
+
return adapter.themeEditSet(theme, thing, value, options);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Return one setting to the base theme's value: the setting is removed,
|
|
56
|
+
* and the theme is rebuilt and previewed.
|
|
57
|
+
* @experimental
|
|
58
|
+
* @param {string} theme
|
|
59
|
+
* @param {string} thing
|
|
60
|
+
* @param {ChangeOptions & {value?: string}} [options] `value` names which half of
|
|
61
|
+
* the `headings` dial to reset (`weight` or `tracking`)
|
|
62
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
|
|
63
|
+
*/
|
|
64
|
+
export async function themeEditReset(theme, thing, options = {}) {
|
|
65
|
+
return adapter.themeEditReset(theme, thing, options);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Every setting of a theme, key resolved values, problems it caused, the
|
|
70
|
+
* sample page and the theme-building page with every component.
|
|
71
|
+
* @experimental
|
|
72
|
+
* @param {string} theme
|
|
73
|
+
* @param {{cwd?: string, png?: boolean, group?: string}} [options]
|
|
74
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
|
|
75
|
+
*/
|
|
76
|
+
export async function themeEditShow(theme, options = {}) {
|
|
77
|
+
return adapter.themeEditShow(theme, options);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Put the theme back as it was before its last change.
|
|
82
|
+
* @experimental
|
|
83
|
+
* @param {string} theme
|
|
84
|
+
* @param {{cwd?: string, png?: boolean}} [options]
|
|
85
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse>}
|
|
86
|
+
*/
|
|
87
|
+
export async function themeEditUndo(theme, options = {}) {
|
|
88
|
+
return adapter.themeEditUndo(theme, options);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The theme-building page: every component grouped, each variant side by
|
|
93
|
+
* side, overlays open, and full template pages. Rendered to one HTML file,
|
|
94
|
+
* or with `write` written into the app as a page module.
|
|
95
|
+
* @experimental
|
|
96
|
+
* @param {string} theme
|
|
97
|
+
* @param {{cwd?: string, write?: string, group?: string, png?: boolean}} [options]
|
|
98
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewResponse>}
|
|
99
|
+
*/
|
|
100
|
+
export async function themeEditPreview(theme, options = {}) {
|
|
101
|
+
return adapter.themeEditPreview(theme, options);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Explain anything a theme change can name, or answer a question about one:
|
|
106
|
+
* a part (what it reads for each aspect, its variants, states and the parts
|
|
107
|
+
* inside it), a family (its members), a setting (a dial's rungs, a token's
|
|
108
|
+
* type and readers, a CSS property), an aspect (colors, text, corners...: the
|
|
109
|
+
* whole-theme tokens and dial), a plain-words question (exact commands), a
|
|
110
|
+
* PNG picture (its main colors, or the color at points), or with `list` a
|
|
111
|
+
* list of dials, tokens, parts, families or CSS properties.
|
|
112
|
+
* @experimental
|
|
113
|
+
* @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
|
|
114
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditExplainOptions} [options]
|
|
115
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditExplainResponse>}
|
|
116
|
+
*/
|
|
117
|
+
export async function themeEditExplain(subject, options = {}) {
|
|
118
|
+
return adapter.themeEditExplain(subject, options);
|
|
119
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
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` 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 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 set|reset <theme> <thing> ...`.
|
|
126
|
+
*/
|
|
127
|
+
export type ThemeEditChangeResponse = {
|
|
128
|
+
type: "themeEdit.set" | "themeEdit.reset";
|
|
129
|
+
data: ThemeEditChangeData;
|
|
130
|
+
};
|
|
131
|
+
export type ThemeEditChangeData = {
|
|
132
|
+
theme: string;
|
|
133
|
+
action: "set" | "reset";
|
|
134
|
+
/**
|
|
135
|
+
* - The setting written, or for `reset` the one removed.
|
|
136
|
+
*/
|
|
137
|
+
setting: ThemeEditSetting;
|
|
138
|
+
/**
|
|
139
|
+
* - The setting this one replaced.
|
|
140
|
+
*/
|
|
141
|
+
replaced: ThemeEditSetting | null;
|
|
142
|
+
/**
|
|
143
|
+
* - For `base` and `mode`: the value before.
|
|
144
|
+
*/
|
|
145
|
+
was: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* - The parts it styles (a family's members when it spread).
|
|
148
|
+
*/
|
|
149
|
+
parts: string[];
|
|
150
|
+
/**
|
|
151
|
+
* - The family it spread to; `onlyHint` when `--only` would style one member.
|
|
152
|
+
*/
|
|
153
|
+
family: {
|
|
154
|
+
name: string;
|
|
155
|
+
members: string[];
|
|
156
|
+
onlyHint: boolean;
|
|
157
|
+
} | null;
|
|
158
|
+
/**
|
|
159
|
+
* - Resolved token changes, `name (mode): before -> after`.
|
|
160
|
+
*/
|
|
161
|
+
changedTokens: string[];
|
|
162
|
+
/**
|
|
163
|
+
* - Part styles and typography the change wrote.
|
|
164
|
+
*/
|
|
165
|
+
styled: string[];
|
|
166
|
+
/**
|
|
167
|
+
* - Part settings a whole-theme dial left in place (a part setting wins).
|
|
168
|
+
*/
|
|
169
|
+
kept: string[];
|
|
170
|
+
/**
|
|
171
|
+
* - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
|
|
172
|
+
*/
|
|
173
|
+
lifted: string[];
|
|
174
|
+
/**
|
|
175
|
+
* - What else to know: accent text per mode, font loading, what a token feeds.
|
|
176
|
+
*/
|
|
177
|
+
notes: string[];
|
|
178
|
+
/**
|
|
179
|
+
* - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
|
|
180
|
+
*/
|
|
181
|
+
problems: string[];
|
|
182
|
+
/**
|
|
183
|
+
* - Warnings from the theme build.
|
|
184
|
+
*/
|
|
185
|
+
warnings: string[];
|
|
186
|
+
preview: string;
|
|
187
|
+
pictures: string[];
|
|
188
|
+
pictureProblem: string | null;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* `astryx --json experimental theme show <theme>`.
|
|
192
|
+
*/
|
|
193
|
+
export type ThemeEditShowResponse = {
|
|
194
|
+
type: "themeEdit.show";
|
|
195
|
+
data: {
|
|
196
|
+
theme: string;
|
|
197
|
+
like: string | null;
|
|
198
|
+
mode: string;
|
|
199
|
+
settings: Array<ThemeEditSetting & {
|
|
200
|
+
parts: string[];
|
|
201
|
+
}>;
|
|
202
|
+
resolved: Record<string, Record<string, string | null>>;
|
|
203
|
+
problems: string[];
|
|
204
|
+
notes: string[];
|
|
205
|
+
preview: string;
|
|
206
|
+
sheet: string;
|
|
207
|
+
sheetComponents: number;
|
|
208
|
+
skipped: string[];
|
|
209
|
+
pictures: string[];
|
|
210
|
+
pictureProblem: string | null;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* `astryx --json experimental theme undo <theme>`.
|
|
215
|
+
*/
|
|
216
|
+
export type ThemeEditUndoResponse = {
|
|
217
|
+
type: "themeEdit.undo";
|
|
218
|
+
data: {
|
|
219
|
+
theme: string;
|
|
220
|
+
undone: string[];
|
|
221
|
+
settings: number;
|
|
222
|
+
stepsLeft: number;
|
|
223
|
+
} & ThemeEditPreviewFields;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* `astryx --json experimental theme preview <theme>`.
|
|
227
|
+
*/
|
|
228
|
+
export type ThemeEditPreviewResponse = {
|
|
229
|
+
type: "themeEdit.preview";
|
|
230
|
+
data: {
|
|
231
|
+
theme: string;
|
|
232
|
+
group: string | null;
|
|
233
|
+
mode: "html" | "page";
|
|
234
|
+
files: string[];
|
|
235
|
+
html: string | null;
|
|
236
|
+
components: number;
|
|
237
|
+
skipped: string[];
|
|
238
|
+
pictures: string[];
|
|
239
|
+
pictureProblem: string | null;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
export type ThemeEditExplainOptions = {
|
|
243
|
+
/**
|
|
244
|
+
* - The app folder (default: process.cwd()).
|
|
245
|
+
*/
|
|
246
|
+
cwd?: string | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* - List what a change can name: dials, tokens, parts, families, or properties; the subject filters it.
|
|
249
|
+
*/
|
|
250
|
+
list?: string | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* - 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").
|
|
253
|
+
*/
|
|
254
|
+
at?: string[] | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* - With a PNG picture: how many main colors (default 14).
|
|
257
|
+
*/
|
|
258
|
+
count?: number | undefined;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* `astryx --json experimental theme explain ...`. `kind` says which answer it is.
|
|
262
|
+
*/
|
|
263
|
+
export type ThemeEditExplainResponse = {
|
|
264
|
+
type: "themeEdit.explain";
|
|
265
|
+
data: {
|
|
266
|
+
kind: "part" | "family" | "setting" | "aspect" | "question" | "picture" | "list";
|
|
267
|
+
subject: string;
|
|
268
|
+
[key: string]: any;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Colocated types for `astryx experimental theme`: the source of truth
|
|
5
|
+
* for its option and response shapes.
|
|
6
|
+
*
|
|
7
|
+
* @position api/theme-edit — typedefs for api/theme-edit/theme-edit.mjs
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One setting a theme made by `experimental theme` holds.
|
|
12
|
+
* @experimental May change or be removed in a patch release.
|
|
13
|
+
* @typedef {object} ThemeEditSetting
|
|
14
|
+
* @property {string} thing - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
|
|
15
|
+
* @property {string} value - The value as stored (a dial step is stored as the rung it reached).
|
|
16
|
+
* @property {'dial' | 'token' | 'property'} source - What kind of thing it is.
|
|
17
|
+
* @property {string} [on] - The part, family, or typography role it applies to; absent for the whole theme.
|
|
18
|
+
* @property {string} [when] - `<prop>:<value>`: only that variant.
|
|
19
|
+
* @property {string} [state] - Only that state.
|
|
20
|
+
* @property {'light' | 'dark'} [mode] - Only that color mode.
|
|
21
|
+
* @property {boolean} [only] - One member of an always-alike family, not the whole family.
|
|
22
|
+
* @property {string} [axis] - For the `headings` dial: `weight` or `tracking`.
|
|
23
|
+
* @property {string} [note] - What the check found worth saying (what the token feeds, parts it misses).
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @experimental May change or be removed in a patch release.
|
|
28
|
+
* @typedef {object} ThemeEditNewOptions
|
|
29
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
30
|
+
* @property {string} [like] - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
|
|
31
|
+
* @property {boolean} [png] - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @experimental May change or be removed in a patch release.
|
|
36
|
+
* @typedef {object} ThemeEditChangeOptions
|
|
37
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
38
|
+
* @property {string} [on] - A part (`button`), a family (`inputs`), or for `font` a role (`heading`).
|
|
39
|
+
* @property {string} [when] - `<prop>:<value>`: only that variant, such as `variant:primary`.
|
|
40
|
+
* @property {string} [state] - Only that state, such as `hover`.
|
|
41
|
+
* @property {string} [mode] - `light` or `dark`: only that color mode (colors and shadows only).
|
|
42
|
+
* @property {boolean} [only] - With a member of an always-alike family (inputs, checks), style just that part.
|
|
43
|
+
* @property {boolean} [png] - Also take PNG pictures of the preview.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @experimental May change or be removed in a patch release.
|
|
48
|
+
* @typedef {object} ThemeEditPreviewFields
|
|
49
|
+
* @property {string} preview - The sample app page with the theme, one self-contained HTML file.
|
|
50
|
+
* @property {string[]} pictures - PNG pictures taken (only with `png`).
|
|
51
|
+
* @property {string | null} pictureProblem - Why no picture was taken, and how to get a browser for it.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* `astryx --json experimental theme new <theme>`.
|
|
56
|
+
* @experimental May change or be removed in a patch release.
|
|
57
|
+
* @typedef {object} ThemeEditNewResponse
|
|
58
|
+
* @property {'themeEdit.new'} type
|
|
59
|
+
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, problems: string[]} & ThemeEditPreviewFields} data
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* `astryx --json experimental theme set|reset <theme> <thing> ...`.
|
|
64
|
+
* @experimental May change or be removed in a patch release.
|
|
65
|
+
* @typedef {object} ThemeEditChangeResponse
|
|
66
|
+
* @property {'themeEdit.set' | 'themeEdit.reset'} type
|
|
67
|
+
* @property {ThemeEditChangeData} data
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @experimental May change or be removed in a patch release.
|
|
72
|
+
* @typedef {object} ThemeEditChangeData
|
|
73
|
+
* @property {string} theme
|
|
74
|
+
* @property {'set' | 'reset'} action
|
|
75
|
+
* @property {ThemeEditSetting} setting - The setting written, or for `reset` the one removed.
|
|
76
|
+
* @property {ThemeEditSetting | null} replaced - The setting this one replaced.
|
|
77
|
+
* @property {string | null} was - For `base` and `mode`: the value before.
|
|
78
|
+
* @property {string[]} parts - The parts it styles (a family's members when it spread).
|
|
79
|
+
* @property {{name: string, members: string[], onlyHint: boolean} | null} family - The family it spread to; `onlyHint` when `--only` would style one member.
|
|
80
|
+
* @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`.
|
|
81
|
+
* @property {string[]} styled - Part styles and typography the change wrote.
|
|
82
|
+
* @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
|
|
83
|
+
* @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
|
|
84
|
+
* @property {string[]} notes - What else to know: accent text per mode, font loading, what a token feeds.
|
|
85
|
+
* @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
|
|
86
|
+
* @property {string[]} warnings - Warnings from the theme build.
|
|
87
|
+
* @property {string} preview
|
|
88
|
+
* @property {string[]} pictures
|
|
89
|
+
* @property {string | null} pictureProblem
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* `astryx --json experimental theme show <theme>`.
|
|
94
|
+
* @experimental May change or be removed in a patch release.
|
|
95
|
+
* @typedef {object} ThemeEditShowResponse
|
|
96
|
+
* @property {'themeEdit.show'} type
|
|
97
|
+
* @property {object} data
|
|
98
|
+
* @property {string} data.theme
|
|
99
|
+
* @property {string | null} data.like
|
|
100
|
+
* @property {string} data.mode
|
|
101
|
+
* @property {Array<ThemeEditSetting & {parts: string[]}>} data.settings
|
|
102
|
+
* @property {Record<string, Record<string, string | null>>} data.resolved - Key tokens, per mode.
|
|
103
|
+
* @property {string[]} data.problems
|
|
104
|
+
* @property {string[]} data.notes
|
|
105
|
+
* @property {string} data.preview
|
|
106
|
+
* @property {string} data.sheet - The theme-building page with every component.
|
|
107
|
+
* @property {number} data.sheetComponents
|
|
108
|
+
* @property {string[]} data.skipped - Template pages left out, with the install line each needs.
|
|
109
|
+
* @property {string[]} data.pictures
|
|
110
|
+
* @property {string | null} data.pictureProblem
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* `astryx --json experimental theme undo <theme>`.
|
|
115
|
+
* @experimental May change or be removed in a patch release.
|
|
116
|
+
* @typedef {object} ThemeEditUndoResponse
|
|
117
|
+
* @property {'themeEdit.undo'} type
|
|
118
|
+
* @property {{theme: string, undone: string[], settings: number, stepsLeft: number} & ThemeEditPreviewFields} data
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* `astryx --json experimental theme preview <theme>`.
|
|
123
|
+
* @experimental May change or be removed in a patch release.
|
|
124
|
+
* @typedef {object} ThemeEditPreviewResponse
|
|
125
|
+
* @property {'themeEdit.preview'} type
|
|
126
|
+
* @property {object} data
|
|
127
|
+
* @property {string} data.theme
|
|
128
|
+
* @property {string | null} data.group
|
|
129
|
+
* @property {'html' | 'page'} data.mode - `html`: one rendered file; `page`: page modules written into the app.
|
|
130
|
+
* @property {string[]} data.files
|
|
131
|
+
* @property {string | null} data.html
|
|
132
|
+
* @property {number} data.components
|
|
133
|
+
* @property {string[]} data.skipped
|
|
134
|
+
* @property {string[]} data.pictures
|
|
135
|
+
* @property {string | null} data.pictureProblem
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @experimental May change or be removed in a patch release.
|
|
140
|
+
* @typedef {object} ThemeEditExplainOptions
|
|
141
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
142
|
+
* @property {string} [list] - List what a change can name: dials, tokens, parts, families, or properties; the subject filters it.
|
|
143
|
+
* @property {string[]} [at] - 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").
|
|
144
|
+
* @property {number} [count] - With a PNG picture: how many main colors (default 14).
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* `astryx --json experimental theme explain ...`. `kind` says which answer it is.
|
|
149
|
+
* @experimental May change or be removed in a patch release.
|
|
150
|
+
* @typedef {object} ThemeEditExplainResponse
|
|
151
|
+
* @property {'themeEdit.explain'} type
|
|
152
|
+
* @property {{kind: 'part' | 'family' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, [key: string]: any}} data
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditExplain()` / `astryx experimental theme explain`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|