@astryxdesign/cli 0.7.17 → 0.7.18-canary.g170df15
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 +1 -1
- package/api/discover/_adapter.d.mts +7 -5
- package/api/discover/_adapter.mjs +12 -11
- package/api/docs/_adapter.d.mts +19 -2
- package/api/docs/_adapter.mjs +66 -5
- package/api/doctor/_adapter.d.mts +11 -62
- package/api/doctor/_adapter.mjs +242 -472
- package/api/doctor/doctor.d.mts +1 -1
- package/api/doctor/doctor.mjs +3 -3
- package/api/doctor/theme-checks.mjs +37 -45
- package/api/error.d.mts +21 -0
- package/api/error.mjs +89 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/icon/_adapter.d.mts +8 -0
- package/api/icon/_adapter.mjs +17 -0
- package/api/icon/_authoring.mjs +6 -6
- package/api/icon/_default-look.mjs +16 -16
- package/api/icon/add/add.mjs +3 -3
- package/api/icon/exportIconIndex.doc.mjs +2 -2
- package/api/icon/icon.doc.mjs +2 -2
- package/api/icon/icon.type.d.mts +4 -0
- package/api/icon/icon.type.mjs +2 -1
- package/api/icon/search/icon-index.mjs +16 -3
- package/api/icon/search/search.d.mts +15 -5
- package/api/icon/search/search.mjs +74 -16
- package/api/icon/use/use.mjs +4 -4
- package/api/render/_adapter.mjs +233 -40
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +2 -2
- package/api/search/_adapter.mjs +4 -0
- package/api/search/_candidate-score.mjs +32 -8
- package/api/search/_cards.json +1 -1
- package/api/search/_compound.d.mts +0 -1
- package/api/search/_compound.mjs +93 -2
- package/api/search/_icons.d.mts +4 -2
- package/api/search/_icons.mjs +4 -2
- package/api/search/_lexical.mjs +177 -17
- package/api/search/_order.d.mts +3 -1
- package/api/search/_order.mjs +16 -5
- package/api/search/_result.d.mts +9 -0
- package/api/search/_result.mjs +10 -0
- package/api/search/_score.mjs +21 -3
- package/api/swizzle/_moduleGraph.d.mts +8 -0
- package/api/swizzle/_moduleGraph.mjs +61 -3
- package/api/template/copy/copy.mjs +5 -3
- package/api/template/template.type.d.mts +3 -3
- package/api/template/template.type.mjs +3 -3
- package/api/theme/_adapter.mjs +48 -12
- package/api/theme/build/build.d.mts +4 -0
- package/api/theme/build/build.mjs +69 -18
- package/api/theme/build/style-keys.mjs +4 -5
- package/api/theme/build/theme-object.mjs +5 -0
- package/api/theme/palette/generate/color.d.mts +47 -0
- package/api/theme/palette/generate/color.mjs +58 -1
- package/api/theme/palette/generate/derive-look.d.mts +293 -0
- package/api/theme/palette/generate/derive-look.mjs +1362 -0
- package/api/theme/palette/generate/editor-look.d.mts +62 -0
- package/api/theme/palette/generate/editor-look.mjs +550 -0
- package/api/theme/palette/generate/mapping.d.mts +94 -9
- package/api/theme/palette/generate/mapping.mjs +94 -22
- package/api/theme-edit/_adapter.mjs +13 -2
- package/api/theme-edit/_catalog.d.mts +13 -13
- package/api/theme-edit/_catalog.mjs +66 -28
- package/api/theme-edit/_check.d.mts +82 -6
- package/api/theme-edit/_check.mjs +1270 -238
- package/api/theme-edit/_color.d.mts +74 -0
- package/api/theme-edit/_color.mjs +168 -3
- package/api/theme-edit/_compiler.d.mts +3 -5
- package/api/theme-edit/_compiler.mjs +122 -23
- package/api/theme-edit/_context.d.mts +55 -12
- package/api/theme-edit/_context.mjs +114 -60
- package/api/theme-edit/_css.d.mts +11 -0
- package/api/theme-edit/_css.mjs +40 -0
- package/api/theme-edit/_edit.d.mts +15 -2
- package/api/theme-edit/_edit.mjs +1469 -133
- package/api/theme-edit/_how-commands.d.mts +116 -0
- package/api/theme-edit/_how-commands.mjs +227 -115
- package/api/theme-edit/_how-question.d.mts +74 -29
- package/api/theme-edit/_how-question.mjs +8514 -1256
- package/api/theme-edit/_how-sides.d.mts +22 -0
- package/api/theme-edit/_how-sides.mjs +173 -0
- package/api/theme-edit/_how-steps.d.mts +42 -0
- package/api/theme-edit/_how-steps.mjs +208 -0
- package/api/theme-edit/_how-values.d.mts +29 -0
- package/api/theme-edit/_how-values.mjs +111 -0
- package/api/theme-edit/_how-words.d.mts +15 -0
- package/api/theme-edit/_how-words.mjs +239 -0
- package/api/theme-edit/_how.d.mts +1 -1
- package/api/theme-edit/_how.mjs +422 -37
- package/api/theme-edit/_missed.d.mts +2 -1
- package/api/theme-edit/_missed.mjs +125 -13
- package/api/theme-edit/_normal.d.mts +5 -3
- package/api/theme-edit/_normal.mjs +54 -14
- package/api/theme-edit/_palette.d.mts +204 -4
- package/api/theme-edit/_palette.mjs +901 -25
- package/api/theme-edit/_part-pieces.d.mts +54 -0
- package/api/theme-edit/_part-pieces.mjs +179 -0
- package/api/theme-edit/_part-words.mjs +33 -5
- package/api/theme-edit/_parts.d.mts +133 -0
- package/api/theme-edit/_parts.mjs +599 -10
- package/api/theme-edit/_picture-traits.d.mts +259 -0
- package/api/theme-edit/_picture-traits.mjs +1030 -0
- package/api/theme-edit/_preview.d.mts +95 -4
- package/api/theme-edit/_preview.mjs +284 -31
- package/api/theme-edit/_project.d.mts +14 -4
- package/api/theme-edit/_project.mjs +95 -26
- package/api/theme-edit/_resolved.d.mts +46 -0
- package/api/theme-edit/_resolved.mjs +800 -0
- package/api/theme-edit/_set-line.d.mts +29 -0
- package/api/theme-edit/_set-line.mjs +100 -0
- package/api/theme-edit/_settings.d.mts +625 -28
- package/api/theme-edit/_settings.mjs +4867 -888
- package/api/theme-edit/_tables.d.mts +25 -1
- package/api/theme-edit/_tables.mjs +115 -11
- package/api/theme-edit/_text-looks.d.mts +78 -0
- package/api/theme-edit/_text-looks.mjs +376 -0
- package/api/theme-edit/_vet.d.mts +3 -26
- package/api/theme-edit/_vet.mjs +5 -89
- package/api/theme-edit/how/how.d.mts +1 -1
- package/api/theme-edit/how/how.mjs +1 -1
- package/api/theme-edit/show/show.d.mts +4 -3
- package/api/theme-edit/show/show.mjs +3 -2
- package/api/theme-edit/theme-edit.type.d.mts +117 -1
- package/api/theme-edit/theme-edit.type.mjs +46 -3
- package/api/theme-edit/themeEditHow.doc.mjs +3 -3
- package/api/theme-edit/themeEditNew.doc.mjs +4 -0
- package/api/theme-edit/themeEditSet.doc.mjs +6 -2
- package/api/theme-edit/themeEditShow.doc.mjs +22 -3
- package/api/theme-edit/themeEditUndo.doc.mjs +4 -0
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/author-a-theme.doc.mjs +7 -4
- package/assets/docs/icons.doc.mjs +7 -6
- package/assets/docs/theme.doc.dense.mjs +10 -0
- package/assets/docs/theme.doc.mjs +10 -0
- package/assets/docs/theme.doc.zh.mjs +10 -0
- package/assets/docs/tree/export-pages.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +89 -17
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/definitions/article.doc.mjs +9 -0
- package/assets/icons/template-icons.json +5 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Citation/CitationInlineText.doc.mjs +1 -1
- package/assets/templates/blocks/components/Citation/CitationInlineText.tsx +3 -1
- package/assets/templates/blocks/components/Citation/CitationShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/Citation/CitationShowcase.tsx +3 -1
- package/assets/templates/blocks/components/Citation/CitationSourceList.doc.mjs +1 -1
- package/assets/templates/blocks/components/Citation/CitationSourceList.tsx +7 -3
- package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.doc.mjs +1 -1
- package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.tsx +5 -2
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ide/page.tsx +5 -10
- package/assets/templates/pages/payment-form/page.tsx +16 -60
- package/assets/templates/themes/neutral/neutralTheme.ts +4 -3
- package/authoring/config/parse.mjs +1 -1
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +13 -13
- package/authoring/doctypes/icon-definition/parse.mjs +2 -2
- package/authoring/doctypes/icon-set/parse.mjs +1 -1
- package/authoring/doctypes/template/parse.mjs +1 -4
- package/authoring/gap-report/parse.d.mts +1 -1
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/ensure-core-built.mjs +17 -10
- package/clients/cli/commands/experimental/icon.mjs +7 -7
- package/clients/cli/commands/experimental/theme.mjs +175 -13
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +11 -3
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +15 -5
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/hook.mjs +7 -0
- package/clients/cli/commands/template.mjs +1 -1
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/index.mjs +6 -2
- package/clients/cli/lib/hook-format.mjs +41 -1
- package/clients/cli/lib/json-shim.mjs +34 -14
- package/clients/cli/lib/other-cli-words.mjs +7 -0
- package/clients/cli/lib/unknown-command.mjs +345 -46
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +11 -2
- package/foundation/agent-docs/agent-docs.mjs +51 -8
- package/foundation/config/project.d.mts +11 -1
- package/foundation/config/project.mjs +11 -2
- package/foundation/discovery/component-replacement.d.mts +5 -8
- package/foundation/discovery/component-replacement.mjs +12 -14
- package/foundation/discovery/core-augmentation-points.d.mts +35 -0
- package/foundation/discovery/core-augmentation-points.mjs +410 -9
- package/foundation/discovery/core-elements.d.mts +6 -0
- package/foundation/discovery/core-elements.mjs +10 -2
- package/foundation/discovery/core-prop-types.d.mts +5 -0
- package/foundation/discovery/core-prop-types.mjs +10 -3
- package/foundation/discovery/core-props.d.mts +8 -0
- package/foundation/discovery/core-props.mjs +29 -13
- package/foundation/discovery/icon-ranking.d.mts +5 -2
- package/foundation/discovery/icon-ranking.mjs +101 -18
- package/foundation/discovery/icon-set-checks.mjs +1 -1
- package/foundation/discovery/icon-set-writer.mjs +1 -1
- package/foundation/discovery/official-list.d.mts +17 -0
- package/foundation/discovery/official-list.mjs +77 -0
- package/foundation/discovery/template-icon-notes.mjs +3 -3
- package/foundation/discovery/template-icons.mjs +2 -2
- package/foundation/discovery/template-placeholders.mjs +1 -1
- package/foundation/discovery/unknown-core-props.d.mts +130 -0
- package/foundation/discovery/unknown-core-props.mjs +601 -0
- package/foundation/discovery/written-prop-values.d.mts +35 -0
- package/foundation/discovery/written-prop-values.mjs +258 -0
- package/foundation/fonts/fontsource-families.generated.d.mts +5 -0
- package/foundation/fonts/fontsource-families.generated.mjs +2110 -0
- package/foundation/fs/package-name.d.mts +10 -0
- package/foundation/fs/package-name.mjs +37 -0
- package/foundation/fs/project-source-files.d.mts +27 -0
- package/foundation/fs/project-source-files.mjs +115 -0
- package/foundation/fs/project-sources.d.mts +25 -0
- package/foundation/fs/project-sources.mjs +83 -0
- package/foundation/fs/read-record.d.mts +18 -0
- package/foundation/fs/read-record.mjs +36 -2
- package/foundation/integrations/integration-warnings.d.mts +39 -7
- package/foundation/integrations/integration-warnings.mjs +141 -19
- package/foundation/integrations/missing-dependency.d.mts +11 -0
- package/foundation/integrations/missing-dependency.mjs +20 -5
- package/foundation/release/folder-lock.d.mts +5 -2
- package/foundation/release/folder-lock.mjs +9 -3
- package/foundation/release/notices.mjs +2 -8
- package/foundation/render/cut-short.d.mts +8 -2
- package/foundation/render/cut-short.mjs +50 -5
- package/foundation/render/drawn-contrast.d.mts +40 -0
- package/foundation/render/drawn-contrast.mjs +355 -0
- package/foundation/render/file-header.mjs +4 -0
- package/foundation/render/layers.d.mts +2 -1
- package/foundation/render/layers.mjs +22 -1
- package/foundation/render/package-resolve-hooks.d.mts +38 -9
- package/foundation/render/package-resolve-hooks.mjs +124 -32
- package/foundation/render/page-worker.mjs +95 -23
- package/foundation/render/part-boxes.d.mts +27 -0
- package/foundation/render/part-boxes.mjs +45 -0
- package/foundation/render/picture-chrome.mjs +36 -4
- package/foundation/render/picture-playwright.mjs +26 -2
- package/foundation/render/picture-window.d.mts +29 -2
- package/foundation/render/picture-window.mjs +99 -1
- package/foundation/render/render-page.d.mts +39 -6
- package/foundation/render/render-page.mjs +26 -10
- package/foundation/render/ts-paths.mjs +2 -1
- package/foundation/response/error-codes.doc.mjs +1 -1
- package/foundation/response/error-codes.mjs +1 -1
- package/foundation/response/response-types.doc.mjs +9 -5
- package/foundation/suggest/other-command.mjs +25 -1
- package/foundation/text/icon-set-next.d.mts +1 -1
- package/foundation/text/icon-set-next.mjs +2 -2
- package/foundation/text/written-string.d.mts +4 -1
- package/foundation/text/written-string.mjs +4 -1
- package/package.json +8 -7
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Hand the editor the built-in themes the adapter found; they are listed
|
|
6
|
+
* neutral first, and the base dial names them.
|
|
7
|
+
* @param {string[]} slugs
|
|
8
|
+
*/
|
|
9
|
+
export function knowBuiltInThemes(slugs: string[]): void;
|
|
4
10
|
/**
|
|
5
11
|
* The CSS font-family stack a font dial word stands for (a preset such as
|
|
6
12
|
* mono, or an open font such as inter): its family, quoted when it holds a
|
|
@@ -20,7 +26,15 @@ export const P: "astryx experimental theme editor";
|
|
|
20
26
|
export const COLOR_PROP_PARTS: string[];
|
|
21
27
|
/** The lookup command: what a part reads, a setting, a question, a picture. */
|
|
22
28
|
export const HOW: "astryx experimental theme editor how";
|
|
23
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* The built-in themes a theme can build on (`new --like`, `set base`),
|
|
31
|
+
* neutral first. Finding them reads the installed packages, which is the
|
|
32
|
+
* adapter's to do: the adapter hands them in once, as it loads
|
|
33
|
+
* (knowBuiltInThemes), and this table stays pure. Read before then (code
|
|
34
|
+
* that runs the editor around its adapter), it says so rather than act as
|
|
35
|
+
* if no built-in theme were installed.
|
|
36
|
+
* @type {string[]}
|
|
37
|
+
*/
|
|
24
38
|
export const LIKE: string[];
|
|
25
39
|
/**
|
|
26
40
|
* Groups of parts that should look alike. `--on <group>` styles every member.
|
|
@@ -33,6 +47,8 @@ export const FAMILIES: Record<string, string[]>;
|
|
|
33
47
|
* names the group itself.
|
|
34
48
|
*/
|
|
35
49
|
export const AUTO_SPREAD: string[];
|
|
50
|
+
/** The family roles `--on` takes as groups. */
|
|
51
|
+
export const GROUP_ROLES: readonly ["button-like", "overlays", "option-rows", "selected-items", "accent-fills", "inset-fields", "status-surfaces", "overlay-headers", "controls"];
|
|
36
52
|
export function familyOf(target: string): string | null;
|
|
37
53
|
export function onlyMeans(on: string | undefined): "member" | "own" | "group";
|
|
38
54
|
/** @type {Array<[string, number]>} */
|
|
@@ -84,6 +100,12 @@ export const OPEN_FONTS: Record<string, {
|
|
|
84
100
|
*/
|
|
85
101
|
export const CLOSEST_OPEN_FONT: Record<string, string>;
|
|
86
102
|
/** Heading weights (`headings` dial): rung -> font-weight. */
|
|
103
|
+
/**
|
|
104
|
+
* Where the theme's page color shows, said by every answer that sets or
|
|
105
|
+
* names it: `--color-background-body` paints inside AppShell only.
|
|
106
|
+
*/
|
|
107
|
+
export const PAGE_COLOR_NOTE: "Your theme's page color shows inside AppShell. Wrap the page in AppShell; if you can't, add `body { background: var(--color-background-body) }` to global CSS (doctor's purity check flags any stylesheet, so prefer AppShell). An Astryx area embedded in a page another app owns adds no body rule: that page is not its own.";
|
|
108
|
+
export function pageColorNote(mode: string | undefined): string;
|
|
87
109
|
export const HEADING_WEIGHTS: Record<string, string>;
|
|
88
110
|
/** Heading letter spacing (`headings` dial): rung -> letter-spacing. */
|
|
89
111
|
export const HEADING_TRACKING: Record<string, string>;
|
|
@@ -165,6 +187,8 @@ export const CSS_PSEUDO_CLASSES: Set<string>;
|
|
|
165
187
|
export const CSS_PSEUDO_ELEMENTS: Set<string>;
|
|
166
188
|
/** The pseudo-elements CSS 2 wrote with one colon, which browsers still read. */
|
|
167
189
|
export const ONE_COLON_PSEUDO_ELEMENTS: Set<string>;
|
|
190
|
+
/** Other words for a state, each read as the first of these there is. */
|
|
191
|
+
export const STATE_SYNONYMS: Record<string, string[]>;
|
|
168
192
|
/** States every part takes, beyond the ones its doc lists. */
|
|
169
193
|
export const COMMON_STATES: string[];
|
|
170
194
|
/**
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* @position api/theme-edit — data read by the engine and the help text
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {discoverBundledThemes} from '../../foundation/discovery/theme-discovery.mjs';
|
|
13
12
|
import {
|
|
14
13
|
SYSTEM_FONTS_BY_PLATFORM,
|
|
15
14
|
appleFaceGeneric,
|
|
@@ -34,10 +33,51 @@ export const COLOR_PROP_PARTS = ['text', 'heading', 'link'];
|
|
|
34
33
|
/** The lookup command: what a part reads, a setting, a question, a picture. */
|
|
35
34
|
export const HOW = `${P} how`;
|
|
36
35
|
|
|
37
|
-
/** The built-in themes
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
/** The built-in themes, once the adapter has found them. @type {string[] | null} */
|
|
37
|
+
let builtIn = null;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The built-in themes a theme can build on (`new --like`, `set base`),
|
|
41
|
+
* neutral first. Finding them reads the installed packages, which is the
|
|
42
|
+
* adapter's to do: the adapter hands them in once, as it loads
|
|
43
|
+
* (knowBuiltInThemes), and this table stays pure. Read before then (code
|
|
44
|
+
* that runs the editor around its adapter), it says so rather than act as
|
|
45
|
+
* if no built-in theme were installed.
|
|
46
|
+
* @type {string[]}
|
|
47
|
+
*/
|
|
48
|
+
export const LIKE = /** @type {string[]} */ (
|
|
49
|
+
new Proxy([], {
|
|
50
|
+
get(_empty, key) {
|
|
51
|
+
if (!builtIn)
|
|
52
|
+
throw new Error(
|
|
53
|
+
'the built-in themes are not known yet: the theme editor runs through its adapter (api/theme-edit/_adapter.mjs), which finds them',
|
|
54
|
+
);
|
|
55
|
+
const v = Reflect.get(builtIn, key);
|
|
56
|
+
return typeof v === 'function' ? v.bind(builtIn) : v;
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Hand the editor the built-in themes the adapter found; they are listed
|
|
63
|
+
* neutral first, and the base dial names them.
|
|
64
|
+
* @param {string[]} slugs
|
|
65
|
+
*/
|
|
66
|
+
export function knowBuiltInThemes(slugs) {
|
|
67
|
+
builtIn = [...slugs].sort(
|
|
68
|
+
(a, b) => Number(b === 'neutral') - Number(a === 'neutral'),
|
|
69
|
+
);
|
|
70
|
+
Object.assign(DIALS.base, baseDialWords());
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** What the base dial's help and values say: the built-in themes, or none. */
|
|
74
|
+
function baseDialWords() {
|
|
75
|
+
const names = builtIn ?? [];
|
|
76
|
+
return {
|
|
77
|
+
help: `The built-in theme this theme builds on: ${names.join(', ')}, or none. Changing it keeps all your settings.`,
|
|
78
|
+
values: `${[...names, 'none'].join('|')}`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
41
81
|
|
|
42
82
|
/**
|
|
43
83
|
* Groups of parts that should look alike. `--on <group>` styles every member.
|
|
@@ -57,6 +97,7 @@ export const FAMILIES = wordTable({
|
|
|
57
97
|
'complex-selector',
|
|
58
98
|
'typeahead',
|
|
59
99
|
'tokenizer',
|
|
100
|
+
'file-input',
|
|
60
101
|
],
|
|
61
102
|
containers: [
|
|
62
103
|
'card',
|
|
@@ -85,6 +126,19 @@ export const FAMILIES = wordTable({
|
|
|
85
126
|
*/
|
|
86
127
|
export const AUTO_SPREAD = ['inputs', 'checks'];
|
|
87
128
|
|
|
129
|
+
/** The family roles `--on` takes as groups. */
|
|
130
|
+
export const GROUP_ROLES = /** @type {const} */ ([
|
|
131
|
+
'button-like',
|
|
132
|
+
'overlays',
|
|
133
|
+
'option-rows',
|
|
134
|
+
'selected-items',
|
|
135
|
+
'accent-fills',
|
|
136
|
+
'inset-fields',
|
|
137
|
+
'status-surfaces',
|
|
138
|
+
'overlay-headers',
|
|
139
|
+
'controls',
|
|
140
|
+
]);
|
|
141
|
+
|
|
88
142
|
/** @param {string} target @returns {string | null} */
|
|
89
143
|
export const familyOf = target =>
|
|
90
144
|
Object.entries(FAMILIES).find(([, members]) =>
|
|
@@ -96,13 +150,20 @@ export const familyOf = target =>
|
|
|
96
150
|
* settings reader share: on a member of a group that spreads (a text input
|
|
97
151
|
* of inputs) it keeps the change on that member (`member`); on any other
|
|
98
152
|
* part it changes nothing, as the part is styled on its own already
|
|
99
|
-
* (`own`)
|
|
100
|
-
* (
|
|
153
|
+
* (`own`), except on a control's own height, which keeps the height on
|
|
154
|
+
* that control (onlyFits, and onlyHeightShape for the settings reader);
|
|
155
|
+
* on a group itself, the editor's own (inputs) or a family role
|
|
156
|
+
* (button-like), or with no part, it means nothing at all (`group`).
|
|
101
157
|
* @param {string | undefined} on
|
|
102
158
|
* @returns {'member' | 'own' | 'group'}
|
|
103
159
|
*/
|
|
104
160
|
export const onlyMeans = on => {
|
|
105
|
-
if (
|
|
161
|
+
if (
|
|
162
|
+
!on ||
|
|
163
|
+
Object.hasOwn(FAMILIES, on) ||
|
|
164
|
+
GROUP_ROLES.includes(/** @type {any} */ (on))
|
|
165
|
+
)
|
|
166
|
+
return 'group';
|
|
106
167
|
const fam = familyOf(on);
|
|
107
168
|
return fam && AUTO_SPREAD.includes(fam) ? 'member' : 'own';
|
|
108
169
|
};
|
|
@@ -353,6 +414,25 @@ export const CLOSEST_OPEN_FONT = wordTable({
|
|
|
353
414
|
});
|
|
354
415
|
|
|
355
416
|
/** Heading weights (`headings` dial): rung -> font-weight. */
|
|
417
|
+
/**
|
|
418
|
+
* Where the theme's page color shows, said by every answer that sets or
|
|
419
|
+
* names it: `--color-background-body` paints inside AppShell only.
|
|
420
|
+
*/
|
|
421
|
+
export const PAGE_COLOR_NOTE =
|
|
422
|
+
"Your theme's page color shows inside AppShell. Wrap the page in AppShell; if you can't, add `body { background: var(--color-background-body) }` to global CSS (doctor's purity check flags any stylesheet, so prefer AppShell). An Astryx area embedded in a page another app owns adds no body rule: that page is not its own.";
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* The page color note for a theme in its mode: a theme that ships one mode
|
|
426
|
+
* draws its text for that mode's page, so the host page must take the
|
|
427
|
+
* theme's page color in every OS mode too.
|
|
428
|
+
* @param {string | undefined} mode the theme's mode setting
|
|
429
|
+
* @returns {string}
|
|
430
|
+
*/
|
|
431
|
+
export const pageColorNote = mode =>
|
|
432
|
+
/^(?:dark|light)-only$/.test(String(mode ?? ''))
|
|
433
|
+
? `${PAGE_COLOR_NOTE} This theme has one mode (${mode}): its text is drawn for its own page, so the page must take the theme's page color in every OS mode, or its text lands on the browser's own page color in the other OS mode.`
|
|
434
|
+
: PAGE_COLOR_NOTE;
|
|
435
|
+
|
|
356
436
|
export const HEADING_WEIGHTS = wordTable(
|
|
357
437
|
/** @type {Record<string, string>} */ ({
|
|
358
438
|
light: '300',
|
|
@@ -468,7 +548,7 @@ export const DIALS = wordTable({
|
|
|
468
548
|
: []),
|
|
469
549
|
`${n} (${v === 9999 ? 'fully round' : `${v}px`})`,
|
|
470
550
|
]).join(', ') +
|
|
471
|
-
`, or a size like 6px. more and less step through them in that order, ${ROUND_TO_PILL_STEP} included. Whole theme: sets the 4 corner tokens in the base theme's proportions (containers and pages at most as round as at pill; inner corners at most as round as at round), and gives the chat radius (--radius-chat: a composer, its drawer, message bubbles)
|
|
551
|
+
`, or a size like 6px. more and less step through them in that order, ${ROUND_TO_PILL_STEP} included. Whole theme: sets the 4 corner tokens in the base theme's proportions (containers and pages at most as round as at pill; inner corners at most as round as at round), and gives the chat radius (--radius-chat: a composer, its drawer, message bubbles) from the container radius, at the base theme's ratio of the two and at most one and a half times the base's chat radius, so it follows it and moves the way the corners move. With --on <part or group>: that part's border-radius. Corners are a size, so they are the same in light and dark.`,
|
|
472
552
|
values: 'square|small|medium|large|round|pill|more|less|<size like 6px>',
|
|
473
553
|
examples: [
|
|
474
554
|
'set my corners pill',
|
|
@@ -585,6 +665,13 @@ export const DIALS = wordTable({
|
|
|
585
665
|
examples: ['set my buttons outline', 'set my buttons caps'],
|
|
586
666
|
words: 'cta solid outline outlined soft tint caps uppercase filled',
|
|
587
667
|
},
|
|
668
|
+
badges: {
|
|
669
|
+
help: "The badge style, the status and category badges together, in the theme's own status and category colors; the neutral badge keeps its look. solid: each status badge filled with its status color, its text in that color's on-color; each category badge filled with a strong color of its hue, its text in the page color or the primary text color. soft: each status badge a light tint of its color with text in that tint's on-color; the category badges keep their look. outline: each status and category badge a thin line in its own text color, with that text, on the surface it sits on. Each badge takes the first of its colors that reads at 4.5:1. A badge none of whose own colors read on the base falls back to a pair that reads, where one exists, and the set result names it: in solid it keeps its tint; in outline it draws the primary text inside a line of its color. show names a badge that still does not read. A property the theme sets on the badge itself stays, in the modes it is set for. Corners come from the corners dial (corners <value> --on badge).",
|
|
670
|
+
values: 'solid|soft|outline',
|
|
671
|
+
examples: ['set my badges soft', 'set my badges outline'],
|
|
672
|
+
words:
|
|
673
|
+
'badge badges tag tags label labels chip chips status solid filled soft tint tinted outline outlined',
|
|
674
|
+
},
|
|
588
675
|
type: {
|
|
589
676
|
help: 'The type personality: how far headings step up from body text and how they are set. compact: small steps (x1.15), semibold. standard: the default (x1.2). editorial: bigger steps (x1.3), tight tracking, semibold. display: big steps (x1.4), heavy weight, tighter tracking (a marketing feel). Text below the base size keeps its standard sizes, so small text stays readable. Works with text-size; a headings setting keeps its weight or tracking whatever the order. Phones (touch screens below 1024px wide) keep the base theme reading sizes.',
|
|
590
677
|
values: Object.keys(TYPE_STYLES).join('|'),
|
|
@@ -603,8 +690,7 @@ export const DIALS = wordTable({
|
|
|
603
690
|
words: 'text size font size small big large scale',
|
|
604
691
|
},
|
|
605
692
|
base: {
|
|
606
|
-
|
|
607
|
-
values: `${LIKE.join('|')}|none`,
|
|
693
|
+
...baseDialWords(),
|
|
608
694
|
examples: ['set my base neutral', 'set my base none'],
|
|
609
695
|
words: 'base start starting built-in extends foundation',
|
|
610
696
|
},
|
|
@@ -968,6 +1054,24 @@ export const ONE_COLON_PSEUDO_ELEMENTS = new Set([
|
|
|
968
1054
|
'first-line',
|
|
969
1055
|
]);
|
|
970
1056
|
|
|
1057
|
+
/** Other words for a state, each read as the first of these there is. */
|
|
1058
|
+
export const STATE_SYNONYMS = wordTable(
|
|
1059
|
+
/** @type {Record<string, string[]>} */ ({
|
|
1060
|
+
pressed: ['isPressed', 'active'],
|
|
1061
|
+
press: ['isPressed', 'active'],
|
|
1062
|
+
on: ['isPressed', 'checked', 'selected'],
|
|
1063
|
+
down: ['active'],
|
|
1064
|
+
clicked: ['active'],
|
|
1065
|
+
hovered: ['hover'],
|
|
1066
|
+
focused: ['focus-visible', 'focus-within', 'focus'],
|
|
1067
|
+
checked: ['checked', 'selected'],
|
|
1068
|
+
selected: ['selected', 'checked'],
|
|
1069
|
+
open: ['open', 'expanded'],
|
|
1070
|
+
expanded: ['expanded', 'open'],
|
|
1071
|
+
inactive: ['disabled'],
|
|
1072
|
+
}),
|
|
1073
|
+
);
|
|
1074
|
+
|
|
971
1075
|
/** States every part takes, beyond the ones its doc lists. */
|
|
972
1076
|
export const COMMON_STATES = [
|
|
973
1077
|
'hover',
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
* A font weight written in a clause: a number from 100 to 900, or a weight
|
|
6
|
+
* word ("semibold").
|
|
7
|
+
* @param {{text: string}} c
|
|
8
|
+
*/
|
|
9
|
+
export function weightIn(c: {
|
|
10
|
+
text: string;
|
|
11
|
+
}): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* A draft for a run of looks read whole ("bold 13px #3b5998 text") writes
|
|
14
|
+
* one of its looks, and the run's color is its color ask's, so a typed
|
|
15
|
+
* color of that run is no word the draft failed to read; any other typed
|
|
16
|
+
* color still is.
|
|
17
|
+
* @param {{text: string, parts: Array<{on: string}>}} c the clause
|
|
18
|
+
* @param {Array<{thing: string}>} steps this draft's steps
|
|
19
|
+
* @param {string[]} hues the hue words a question can say
|
|
20
|
+
* @param {string[]} literals the typed colors the draft would report
|
|
21
|
+
*/
|
|
22
|
+
export function colorInOtherDraft(c: {
|
|
23
|
+
text: string;
|
|
24
|
+
parts: Array<{
|
|
25
|
+
on: string;
|
|
26
|
+
}>;
|
|
27
|
+
}, steps: Array<{
|
|
28
|
+
thing: string;
|
|
29
|
+
}>, hues: string[], literals: string[]): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* A run of looks said for a part's text or the top bar's links asks for
|
|
32
|
+
* each of its looks: its color ("tabs: bold 13px #3b5998 text") and a size
|
|
33
|
+
* said for links ("white bold 11px links"), each an ask of its own beside
|
|
34
|
+
* the weight and size the clause reader already gives, when every ask the
|
|
35
|
+
* clause makes is a look of that text.
|
|
36
|
+
* @param {Array<{text: string, aspects: string[], parts: Array<{on: string}>, container?: string, placeStrict?: unknown, state?: string | null}>} clauses
|
|
37
|
+
* @param {string[]} hues the hue words a question can say
|
|
38
|
+
*/
|
|
39
|
+
export function addRunLooks(clauses: Array<{
|
|
40
|
+
text: string;
|
|
41
|
+
aspects: string[];
|
|
42
|
+
parts: Array<{
|
|
43
|
+
on: string;
|
|
44
|
+
}>;
|
|
45
|
+
container?: string;
|
|
46
|
+
placeStrict?: unknown;
|
|
47
|
+
state?: string | null;
|
|
48
|
+
}>, hues: string[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Links said with the top bar are its nav items, never every link in the
|
|
51
|
+
* app: in the clause after the bar's, joined by "with" ("top bar #3b5998
|
|
52
|
+
* with white links"), or in a clause that holds the bar only as the place
|
|
53
|
+
* of its links and asks only for the links' text ("top bar with white bold
|
|
54
|
+
* links"), more links said after them with "and" for a mode or a state,
|
|
55
|
+
* and a look said for them again ("and underline them on hover"). A
|
|
56
|
+
* clause that also asks for a look of the bar, never says links, or places
|
|
57
|
+
* its links elsewhere ("links on cards") keeps its reading.
|
|
58
|
+
* @param {Array<{joint?: string, text: string, aspects: string[], parts: Array<{on: string}>, container?: string, within?: unknown, placeStrict?: unknown}>} clauses
|
|
59
|
+
* @param {(text: string) => boolean} namesBar whether words name the bar,
|
|
60
|
+
* by the part words
|
|
61
|
+
* @param {(clause: object) => void} release drops the notes that a
|
|
62
|
+
* clause's links could not be kept to the bar
|
|
63
|
+
*/
|
|
64
|
+
export function barLinksAreNavItems(clauses: Array<{
|
|
65
|
+
joint?: string;
|
|
66
|
+
text: string;
|
|
67
|
+
aspects: string[];
|
|
68
|
+
parts: Array<{
|
|
69
|
+
on: string;
|
|
70
|
+
}>;
|
|
71
|
+
container?: string;
|
|
72
|
+
within?: unknown;
|
|
73
|
+
placeStrict?: unknown;
|
|
74
|
+
}>, namesBar: (text: string) => boolean, release: (clause: object) => void): void;
|
|
75
|
+
/** The looks of a part's text said together, each an ask of its own. */
|
|
76
|
+
export const TEXT_LOOKS: string[];
|
|
77
|
+
/** The parts that are the top bar. */
|
|
78
|
+
export const BAR_PARTS: Set<string>;
|