@astryxdesign/cli 0.7.17 → 0.7.18-canary.g32556bb
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/blocks/components/SideNav/SideNavShowcase.tsx +9 -1
- package/assets/templates/blocks/components/SideNavCollapseButton/SideNavCollapseButtonShowcase.doc.mjs +9 -2
- package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.doc.mjs +3 -2
- package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -1
- package/assets/templates/blocks/components/SideNavItem/SideNavItemShowcase.doc.mjs +3 -2
- package/assets/templates/blocks/components/SideNavSection/SideNavSectionShowcase.doc.mjs +2 -1
- 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
|
@@ -389,6 +389,26 @@ export function entryNotes(data: object): string[];
|
|
|
389
389
|
* @returns {'mode' | 'source' | 'only' | 'on' | 'when' | 'state' | null}
|
|
390
390
|
*/
|
|
391
391
|
export function entryDamage(s: any): "mode" | "source" | "only" | "on" | "when" | "state" | null;
|
|
392
|
+
/**
|
|
393
|
+
* Whether `only` fits a setting, as `set --only` takes it and the settings
|
|
394
|
+
* reader keeps it ({@link onlyMeans}): it names one member of a group that
|
|
395
|
+
* spreads (a text input of inputs), or it keeps a control's height on that
|
|
396
|
+
* one control, where a height is every control's height at its size. A
|
|
397
|
+
* bar's height or padding spreads through no group, so `only` changes
|
|
398
|
+
* nothing there.
|
|
399
|
+
* @param {any} s
|
|
400
|
+
* @param {Ctx} [ctx]
|
|
401
|
+
*/
|
|
402
|
+
export function onlyFits(s: any, ctx?: Ctx): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Whether a setting has the shape of a control's own height, the part of
|
|
405
|
+
* {@link onlyFits} that needs no Core: a height (or min-height) on a part,
|
|
406
|
+
* in no state, at the default size or one size. The settings reader, which
|
|
407
|
+
* runs before Core is read, keeps a saved `only` of this shape, as `set`
|
|
408
|
+
* keeps it on a control; `set` and the checks hold the rest of the rule.
|
|
409
|
+
* @param {any} s
|
|
410
|
+
*/
|
|
411
|
+
export function onlyHeightShape(s: any): boolean;
|
|
392
412
|
/**
|
|
393
413
|
* Whether a setting is the one a command changes or removes: by thing, or
|
|
394
414
|
* by the whole identity (part, variant, state, mode) when one is given.
|
|
@@ -524,6 +544,12 @@ export function baseComponentReads(cwd: string, like: string | null | undefined,
|
|
|
524
544
|
* @returns {Map<string, string | null>}
|
|
525
545
|
*/
|
|
526
546
|
export function baseTopTokens(cwd: string, like: string | null | undefined): Map<string, string | null>;
|
|
547
|
+
/**
|
|
548
|
+
* A module's syntax tree, parsed once for each text.
|
|
549
|
+
* @param {string} source
|
|
550
|
+
* @returns {any}
|
|
551
|
+
*/
|
|
552
|
+
export function parsedModule(source: string): any;
|
|
527
553
|
/**
|
|
528
554
|
* What a part's plain rule (its `base` block) holds in the theme as built
|
|
529
555
|
* (the base theme's, the settings' and the own source's together), else in
|
|
@@ -568,18 +594,203 @@ export function ownSourceTokens(cwd: string, slug: string): string[];
|
|
|
568
594
|
export function ownSourceTokenValues(cwd: string, slug: string): Record<string, string>;
|
|
569
595
|
/** One line for a setting. @param {Setting} s */
|
|
570
596
|
export function describe(s: Setting): string;
|
|
597
|
+
/**
|
|
598
|
+
* Every group `--on` takes, by name: the editor's own groups (inputs,
|
|
599
|
+
* menus, …) and the family roles the census shows (button-like, overlays,
|
|
600
|
+
* option-rows, selected-items, accent-fills, inset-fields, status-surfaces,
|
|
601
|
+
* overlay-headers, controls), each read from the parts' structure.
|
|
602
|
+
* Without a census (no context), the editor's own groups alone.
|
|
603
|
+
* @param {{project?: any, C?: any} | null | undefined} ctx
|
|
604
|
+
* @returns {Record<string, string[]>}
|
|
605
|
+
*/
|
|
606
|
+
export function groupsOf(ctx: {
|
|
607
|
+
project?: any;
|
|
608
|
+
C?: any;
|
|
609
|
+
} | null | undefined): Record<string, string[]>;
|
|
610
|
+
/**
|
|
611
|
+
* What each Badge variant draws in a badge style, as the badge's own rule
|
|
612
|
+
* for that variant, in the theme's status and category colors. Each
|
|
613
|
+
* variant takes the first pair of colors that reads in every mode, measured
|
|
614
|
+
* on the colors given (the base theme's); a pair that reads nowhere is the
|
|
615
|
+
* preferred one, and `show` names it. The neutral badge keeps Core's look.
|
|
616
|
+
* (A badge without a solid fill takes a filled button's colors inside that
|
|
617
|
+
* button: {@link BADGE_IN_BUTTON}.)
|
|
618
|
+
* @param {string} style solid, soft or outline
|
|
619
|
+
* @param {{light: Record<string, string>, dark: Record<string, string>} | null} [colors]
|
|
620
|
+
* @returns {Record<string, Record<string, string>>}
|
|
621
|
+
*/
|
|
622
|
+
export function badgeLooks(style: string, colors?: {
|
|
623
|
+
light: Record<string, string>;
|
|
624
|
+
dark: Record<string, string>;
|
|
625
|
+
} | null): Record<string, Record<string, string>>;
|
|
626
|
+
/**
|
|
627
|
+
* The variants a badge style cannot draw in its own colors on these colors,
|
|
628
|
+
* each drawn in its fallback pair instead: a solid one keeps Core's tint, an
|
|
629
|
+
* outline one draws the primary text inside a line of its hue.
|
|
630
|
+
* @param {string} style solid, soft or outline
|
|
631
|
+
* @param {{light: Record<string, string>, dark: Record<string, string>} | null} [colors]
|
|
632
|
+
* @returns {string[]}
|
|
633
|
+
*/
|
|
634
|
+
export function badgeKept(style: string, colors?: {
|
|
635
|
+
light: Record<string, string>;
|
|
636
|
+
dark: Record<string, string>;
|
|
637
|
+
} | null): string[];
|
|
638
|
+
/**
|
|
639
|
+
* A part name or a group's members.
|
|
640
|
+
* @param {{project: any, C?: any}} ctx
|
|
641
|
+
* @param {string} name
|
|
642
|
+
*/
|
|
643
|
+
export function membersOf(ctx: {
|
|
644
|
+
project: any;
|
|
645
|
+
C?: any;
|
|
646
|
+
}, name: string): string[];
|
|
647
|
+
/**
|
|
648
|
+
* Whether a control grows with its content: its height is a least height
|
|
649
|
+
* read from a size token (a selector, whose box holds its chosen values),
|
|
650
|
+
* where a fixed height (a text input) holds whatever pads it.
|
|
651
|
+
* @param {Ctx} ctx
|
|
652
|
+
* @param {string} part
|
|
653
|
+
* @param {string | null} [when] the variant a setting is for (`mode:dropzone`)
|
|
654
|
+
*/
|
|
655
|
+
export function growsWithContent(ctx: Ctx, part: string, when?: string | null): boolean;
|
|
656
|
+
/**
|
|
657
|
+
* The variants of a control that grows with its content in which it is
|
|
658
|
+
* drawn without growing (a file input's drop zone, which pads itself), when
|
|
659
|
+
* it is drawn both ways; none otherwise. A padding set on the whole part
|
|
660
|
+
* keeps its top and bottom sides there.
|
|
661
|
+
* @param {Ctx} ctx
|
|
662
|
+
* @param {string} part
|
|
663
|
+
* @returns {string[]} each as a `--when` names it (`mode:dropzone`)
|
|
664
|
+
*/
|
|
665
|
+
export function variantsNotGrowing(ctx: Ctx, part: string): string[];
|
|
666
|
+
/**
|
|
667
|
+
* The `--when` values under which a padding set with `when` reaches a part
|
|
668
|
+
* drawn without growing: each variant `variantsNotGrowing` names, joined to
|
|
669
|
+
* `when` when it names another axis (`status:error+mode:dropzone`).
|
|
670
|
+
* @param {Ctx} ctx
|
|
671
|
+
* @param {string} part
|
|
672
|
+
* @param {string} [when]
|
|
673
|
+
* @returns {string[]}
|
|
674
|
+
*/
|
|
675
|
+
export function notGrowingWhens(ctx: Ctx, part: string, when?: string): string[];
|
|
676
|
+
/**
|
|
677
|
+
* Whether a setting's property is the height of the controls it is set on:
|
|
678
|
+
* a height or a block size, or a least height on controls that grow with
|
|
679
|
+
* their content, whose least height is their height. A least height on a
|
|
680
|
+
* control of fixed height (a button) only floors it, so it stays that
|
|
681
|
+
* part's own property.
|
|
682
|
+
* @param {Ctx} ctx
|
|
683
|
+
* @param {{thing?: unknown, on?: unknown, when?: unknown}} s
|
|
684
|
+
*/
|
|
685
|
+
export function isControlHeight(ctx: Ctx, s: {
|
|
686
|
+
thing?: unknown;
|
|
687
|
+
on?: unknown;
|
|
688
|
+
when?: unknown;
|
|
689
|
+
}): boolean;
|
|
690
|
+
/**
|
|
691
|
+
* A height set on a control is the height every control takes at that
|
|
692
|
+
* size: buttons, inputs, selectors and input groups share one height at
|
|
693
|
+
* each size. So the setting a `set` of a height on controls writes is the
|
|
694
|
+
* size's token on the controls group, at the size its `--when` names (the
|
|
695
|
+
* default size without one). Null for any other setting: one with
|
|
696
|
+
* `--only` or a state, on a part that is not a control, or with a variant
|
|
697
|
+
* that is not a size.
|
|
698
|
+
* @param {Ctx} ctx
|
|
699
|
+
* @param {Setting} s
|
|
700
|
+
* @returns {{setting: Setting, size: 'sm' | 'md' | 'lg', token: string, own: boolean} | null}
|
|
701
|
+
*/
|
|
702
|
+
export function sharedControlHeight(ctx: Ctx, s: Setting): {
|
|
703
|
+
setting: Setting;
|
|
704
|
+
size: "sm" | "md" | "lg";
|
|
705
|
+
token: string;
|
|
706
|
+
own: boolean;
|
|
707
|
+
} | null;
|
|
708
|
+
/**
|
|
709
|
+
* Whether a value can be a control's height: a size as every size token
|
|
710
|
+
* takes it (isSize: a length in any CSS unit, a variable, env(), or a CSS
|
|
711
|
+
* function that gives a length), with no percentage. A word (auto,
|
|
712
|
+
* fit-content) or a percentage cannot be a size token, which Core reads
|
|
713
|
+
* inside its own sums.
|
|
714
|
+
* @param {string} v
|
|
715
|
+
*/
|
|
716
|
+
export function controlHeightValue(v: string): boolean;
|
|
717
|
+
/**
|
|
718
|
+
* Whether `--on` names controls: a control, the controls group, or a group
|
|
719
|
+
* whose members are controls (inputs, whose text area sizes itself by its
|
|
720
|
+
* rows, holds controls too).
|
|
721
|
+
* @param {Ctx} ctx
|
|
722
|
+
* @param {string} on
|
|
723
|
+
*/
|
|
724
|
+
export function namesControls(ctx: Ctx, on: string): boolean;
|
|
725
|
+
/**
|
|
726
|
+
* Whether a height saved with --only on one control of a group is the
|
|
727
|
+
* group's plain height, narrowed off a control kept apart: the narrowing
|
|
728
|
+
* marks each copy it writes on the group's other members (`narrowed`). A
|
|
729
|
+
* height kept on one control, with --only, carries no mark.
|
|
730
|
+
* @param {Setting} x
|
|
731
|
+
*/
|
|
732
|
+
export function narrowedGroupHeight(x: Setting): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Whether a saved setting sets the height of some controls at a size:
|
|
735
|
+
* a height (not in a state, and with `--only` only as a group's narrowed
|
|
736
|
+
* height) that reaches a control, for that
|
|
737
|
+
* size or for every size, or that size's token on controls. A height on
|
|
738
|
+
* another part reaches controls when it spreads to them (a text area's
|
|
739
|
+
* height reaches the inputs drawn alike).
|
|
740
|
+
* @param {Ctx} ctx
|
|
741
|
+
* @param {Setting} x
|
|
742
|
+
* @param {'sm' | 'md' | 'lg'} size
|
|
743
|
+
*/
|
|
744
|
+
export function setsControlHeight(ctx: Ctx, x: Setting, size: "sm" | "md" | "lg"): boolean;
|
|
745
|
+
/**
|
|
746
|
+
* The saved settings that give some controls a height at a size the other
|
|
747
|
+
* controls do not take: a height on one control (a button 31px tall at
|
|
748
|
+
* every size while the inputs follow the size tokens), or a size token on
|
|
749
|
+
* some controls only. Each with its controls' height at each size it
|
|
750
|
+
* splits and the other controls' heights there, and the line that makes it
|
|
751
|
+
* every control's height at its size.
|
|
752
|
+
* @param {Ctx} ctx
|
|
753
|
+
* @param {ThemeData} data
|
|
754
|
+
* @param {Record<string, string>} resolved the theme's resolved tokens (one mode)
|
|
755
|
+
* @returns {Array<{setting: Setting, part: string, reaches: string[], at: Array<{size: string, value: string, others: string[]}>, line: Setting}>}
|
|
756
|
+
*/
|
|
757
|
+
export function controlHeightSplits(ctx: Ctx, data: ThemeData, resolved: Record<string, string>): Array<{
|
|
758
|
+
setting: Setting;
|
|
759
|
+
part: string;
|
|
760
|
+
reaches: string[];
|
|
761
|
+
at: Array<{
|
|
762
|
+
size: string;
|
|
763
|
+
value: string;
|
|
764
|
+
others: string[];
|
|
765
|
+
}>;
|
|
766
|
+
line: Setting;
|
|
767
|
+
}>;
|
|
768
|
+
/**
|
|
769
|
+
* Whether a part has the variant values a `--when` names: every term of it
|
|
770
|
+
* (`variant:secondary`, joined with `+`) is a value of that part's axis.
|
|
771
|
+
* No `--when` fits every part.
|
|
772
|
+
* @param {Ctx} ctx
|
|
773
|
+
* @param {string} part
|
|
774
|
+
* @param {string | null | undefined} when
|
|
775
|
+
* @param {RegExp} [sep] what joins the terms (a comma list or + by default)
|
|
776
|
+
*/
|
|
777
|
+
export function partHasWhen(ctx: Ctx, part: string, when: string | null | undefined, sep?: RegExp): boolean;
|
|
571
778
|
/**
|
|
572
779
|
* The parts a setting styles: the group when `--on` names one, the whole
|
|
573
780
|
* group of an always-alike member unless `--only`, else the one part.
|
|
574
781
|
* @param {Ctx} ctx
|
|
575
|
-
* @param {Pick<Setting, 'on' | 'only' | 'thing'>} s
|
|
782
|
+
* @param {Pick<Setting, 'on' | 'only' | 'thing'> & {when?: string | null}} s
|
|
576
783
|
* @returns {string[]}
|
|
577
784
|
*/
|
|
578
|
-
export function partsOf(ctx: Ctx, s: Pick<Setting, "on" | "only" | "thing">
|
|
785
|
+
export function partsOf(ctx: Ctx, s: Pick<Setting, "on" | "only" | "thing"> & {
|
|
786
|
+
when?: string | null;
|
|
787
|
+
}): string[];
|
|
579
788
|
/**
|
|
580
789
|
* The parts that draw a part's border: the part itself, or, when it draws
|
|
581
790
|
* none of its own and its edges are the borders of parts inside it (a date
|
|
582
|
-
* and time field's date and time boxes), those parts.
|
|
791
|
+
* and time field's date and time boxes), those parts. Only pieces that draw
|
|
792
|
+
* a border of their own are its edges: a top nav's items are rounded but
|
|
793
|
+
* draw none, so the top nav's border is the bar's own.
|
|
583
794
|
* @param {Ctx} ctx
|
|
584
795
|
* @param {string} part
|
|
585
796
|
* @returns {string[]}
|
|
@@ -676,18 +887,46 @@ export function refreshSourceStamp(cwd: string, slug: string): boolean;
|
|
|
676
887
|
* @returns {boolean | null}
|
|
677
888
|
*/
|
|
678
889
|
export function moduleUnedited(text: string): boolean | null;
|
|
890
|
+
/**
|
|
891
|
+
* One half of a palette token in a generated settings module: a palette
|
|
892
|
+
* stop (`family` and `stop`, with `alpha` for a see-through one), white or
|
|
893
|
+
* black, a color written out (`family: 'literal'`), or the base theme's
|
|
894
|
+
* own value (`family: 'literal', base: true`).
|
|
895
|
+
* @typedef {{family: string, stop: number, alpha?: string, color?: string, base?: true}} KeptHalf
|
|
896
|
+
*/
|
|
679
897
|
/**
|
|
680
898
|
* The palette stops each token reads in a generated settings module, as
|
|
681
899
|
* written there (`palette.accent.light[85]`, with ` + 'aa'` for a
|
|
682
|
-
* see-through one): `[light, dark]` per token.
|
|
900
|
+
* see-through one): `[light, dark]` per token. A token with one mode drawn
|
|
901
|
+
* from the palette keeps its other half as written: a color, or the base
|
|
902
|
+
* theme's value (`baseIn(...)`). A token drawn from the palette in neither
|
|
903
|
+
* mode is not a palette token, except for a palette kept as saved
|
|
904
|
+
* (`literals`), whose module's tokens are the whole mapping.
|
|
683
905
|
* @param {string} source
|
|
684
|
-
* @
|
|
906
|
+
* @param {boolean} [literals] keep a token written as colors in both modes
|
|
907
|
+
* @returns {Record<string, Record<'light' | 'dark', KeptHalf>>}
|
|
685
908
|
*/
|
|
686
|
-
export function stopsIn(source: string): Record<string, Record<"light" | "dark",
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
909
|
+
export function stopsIn(source: string, literals?: boolean): Record<string, Record<"light" | "dark", KeptHalf>>;
|
|
910
|
+
/**
|
|
911
|
+
* The edges the fields draw: for each token the census reads for an input
|
|
912
|
+
* group member's border color at rest, with the token it reads for its fill
|
|
913
|
+
* there (the ground the edge must read on). Read from the census, so a Core
|
|
914
|
+
* that moves the field edge to another token is followed.
|
|
915
|
+
* @param {Ctx} ctx
|
|
916
|
+
* @returns {Array<{token: string, fill: string}>}
|
|
917
|
+
*/
|
|
918
|
+
export function fieldEdgeTokens(ctx: Ctx): Array<{
|
|
919
|
+
token: string;
|
|
920
|
+
fill: string;
|
|
921
|
+
}>;
|
|
922
|
+
/**
|
|
923
|
+
* A color itself where it reads at `min` on the ground, else the nearest
|
|
924
|
+
* shade of it (its hue and chroma, its lightness stepped away from the
|
|
925
|
+
* ground) that does; null when none does.
|
|
926
|
+
* @param {string} color @param {string} ground @param {number} min
|
|
927
|
+
* @returns {string | null}
|
|
928
|
+
*/
|
|
929
|
+
export function shadeAt(color: string, ground: string, min: number): string | null;
|
|
691
930
|
/**
|
|
692
931
|
* A size in px: px, rem (16px each), or a calc() of those added and
|
|
693
932
|
* subtracted; null for anything else.
|
|
@@ -784,10 +1023,13 @@ export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting,
|
|
|
784
1023
|
/**
|
|
785
1024
|
* A plain part setting can lose to a more specific rule for the same part
|
|
786
1025
|
* and property, such as a base theme's `.astryx-heading[data-level="1"]
|
|
787
|
-
* {font-weight}
|
|
1026
|
+
* {font-weight}` or the theme's own fill on a selected tab. Find those rules
|
|
1027
|
+
* in the built stylesheet. A setting made for one mode (`@light`) is found
|
|
1028
|
+
* with its mode, and only where a rule holds in that mode: a fill a variant
|
|
1029
|
+
* has in dark mode only beats nothing in light.
|
|
788
1030
|
* @param {string} cssText
|
|
789
1031
|
* @param {any} theme
|
|
790
|
-
* @returns {Array<{target: string, key: string, prop: string, value: string, state?: string}>}
|
|
1032
|
+
* @returns {Array<{target: string, key: string, prop: string, value: string, state?: string, mode?: 'light' | 'dark'}>}
|
|
791
1033
|
*/
|
|
792
1034
|
export function findOverrides(cssText: string, theme: any): Array<{
|
|
793
1035
|
target: string;
|
|
@@ -795,6 +1037,7 @@ export function findOverrides(cssText: string, theme: any): Array<{
|
|
|
795
1037
|
prop: string;
|
|
796
1038
|
value: string;
|
|
797
1039
|
state?: string;
|
|
1040
|
+
mode?: "light" | "dark";
|
|
798
1041
|
}>;
|
|
799
1042
|
/**
|
|
800
1043
|
* The file a relative import names, resolved as TypeScript resolves it: a
|
|
@@ -936,9 +1179,10 @@ export function buildColorModes(cwd: string, slug: string): ["light"] | ["dark"]
|
|
|
936
1179
|
* (the same build, compared and not written), or null when they match.
|
|
937
1180
|
* @param {Ctx} ctx
|
|
938
1181
|
* @param {string} slug
|
|
1182
|
+
* @param {string[]} [warnings] takes the warnings of that build
|
|
939
1183
|
* @returns {Promise<string | null>}
|
|
940
1184
|
*/
|
|
941
|
-
export function outputsDrift(ctx: Ctx, slug: string): Promise<string | null>;
|
|
1185
|
+
export function outputsDrift(ctx: Ctx, slug: string, warnings?: string[]): Promise<string | null>;
|
|
942
1186
|
/**
|
|
943
1187
|
* Whether Core's media surface inside a part follows what is painted behind
|
|
944
1188
|
* it (`MediaTheme mode="auto"`): a part that paints the inverted surface
|
|
@@ -1139,6 +1383,14 @@ export function settingsEntriesOk(data: any): any;
|
|
|
1139
1383
|
* @param {any} data
|
|
1140
1384
|
*/
|
|
1141
1385
|
export function settingsShapeOk(data: any): boolean;
|
|
1386
|
+
/**
|
|
1387
|
+
* A setting as the file keeps it: its `note` and `stateNote` are what the
|
|
1388
|
+
* command that made it says in its result, not part of the setting.
|
|
1389
|
+
* @template {Record<string, any> | null | undefined} S
|
|
1390
|
+
* @param {S} s
|
|
1391
|
+
* @returns {S}
|
|
1392
|
+
*/
|
|
1393
|
+
export function savedSetting<S extends Record<string, any> | null | undefined>(s: S): S;
|
|
1142
1394
|
/**
|
|
1143
1395
|
* The value the base theme itself gives a part's property where a setting
|
|
1144
1396
|
* applies (its variant and state), as the build keys part styles; null
|
|
@@ -1196,6 +1448,88 @@ export function cornerParts(ctx: Ctx, part: string): string[];
|
|
|
1196
1448
|
* @returns {string[]}
|
|
1197
1449
|
*/
|
|
1198
1450
|
export function paddedParts(ctx: Ctx, part: string): string[];
|
|
1451
|
+
/**
|
|
1452
|
+
* The square a member of the checks group sizes itself (a checkbox's box, a
|
|
1453
|
+
* radio's circle), at a size: its width and height in px, from the theme's
|
|
1454
|
+
* latest plain setting of each on the part or a group it is in (a setting
|
|
1455
|
+
* for that size counts too), else what the part data records Core drawing at
|
|
1456
|
+
* that size. Null for a part outside the checks group, one that reads a size
|
|
1457
|
+
* token or sets no width and height of its own, and for a size neither the
|
|
1458
|
+
* theme nor the part data gives in px.
|
|
1459
|
+
* @param {Ctx} ctx the editor's context (its part census, ctx.C)
|
|
1460
|
+
* @param {Setting[]} settings the theme's settings, in order
|
|
1461
|
+
* @param {string} part
|
|
1462
|
+
* @param {string} [size] the size value (`md`); none: the size drawn
|
|
1463
|
+
* @returns {{w: number, h: number} | null}
|
|
1464
|
+
*/
|
|
1465
|
+
export function selfSizedBox(ctx: Ctx, settings: Setting[], part: string, size?: string): {
|
|
1466
|
+
w: number;
|
|
1467
|
+
h: number;
|
|
1468
|
+
} | null;
|
|
1469
|
+
/**
|
|
1470
|
+
* Why a part that sizes its own square ({@link sizesItsOwnBox}) has no box
|
|
1471
|
+
* the editor can step at a size: the theme's own width or height is not in
|
|
1472
|
+
* px, or neither the theme nor the part data gives one at that size. Null
|
|
1473
|
+
* when it has one.
|
|
1474
|
+
* @param {Ctx} ctx the editor's context (its part census, ctx.C)
|
|
1475
|
+
* @param {Setting[]} settings the theme's settings, in order
|
|
1476
|
+
* @param {string} part
|
|
1477
|
+
* @param {string} [size]
|
|
1478
|
+
* @returns {string | null}
|
|
1479
|
+
*/
|
|
1480
|
+
export function selfSizedWhy(ctx: Ctx, settings: Setting[], part: string, size?: string): string | null;
|
|
1481
|
+
/**
|
|
1482
|
+
* The width and height lines that give a part or group its new box, from
|
|
1483
|
+
* each member's own box (selfSizedBox) at each size: one line for the
|
|
1484
|
+
* group where its members agree, else a line per member (with only, where
|
|
1485
|
+
* the member's group spreads), and a size condition when `bySize`. A size
|
|
1486
|
+
* a member has no box for is named in `unknown`, never given another's.
|
|
1487
|
+
* @param {Ctx} ctx
|
|
1488
|
+
* @param {Setting[]} settings the theme's settings, in order
|
|
1489
|
+
* @param {string} on the part or group asked
|
|
1490
|
+
* @param {Array<string | undefined>} sizes the sizes to write
|
|
1491
|
+
* @param {(box: {w: number, h: number}) => {w: number, h: number} | null} next
|
|
1492
|
+
* the new box for an old one; null skips it
|
|
1493
|
+
* @param {boolean} bySize whether each line names its size
|
|
1494
|
+
*/
|
|
1495
|
+
export function selfSizedBoxLines(ctx: Ctx, settings: Setting[], on: string, sizes: Array<string | undefined>, next: (box: {
|
|
1496
|
+
w: number;
|
|
1497
|
+
h: number;
|
|
1498
|
+
}) => {
|
|
1499
|
+
w: number;
|
|
1500
|
+
h: number;
|
|
1501
|
+
} | null, bySize: boolean): {
|
|
1502
|
+
lines: {
|
|
1503
|
+
sz: string | undefined;
|
|
1504
|
+
m: string;
|
|
1505
|
+
box: {
|
|
1506
|
+
w: number;
|
|
1507
|
+
h: number;
|
|
1508
|
+
};
|
|
1509
|
+
next: {
|
|
1510
|
+
w: number;
|
|
1511
|
+
h: number;
|
|
1512
|
+
};
|
|
1513
|
+
flags: {
|
|
1514
|
+
on: string;
|
|
1515
|
+
only?: true;
|
|
1516
|
+
when?: string;
|
|
1517
|
+
};
|
|
1518
|
+
}[];
|
|
1519
|
+
unknown: {
|
|
1520
|
+
sz: string | undefined;
|
|
1521
|
+
why: string;
|
|
1522
|
+
}[];
|
|
1523
|
+
members: string[];
|
|
1524
|
+
};
|
|
1525
|
+
/**
|
|
1526
|
+
* Whether a part sizes its own square, the way a member of the checks group
|
|
1527
|
+
* does: it sets its own width and height and reads no size token.
|
|
1528
|
+
* @param {any} C the part census
|
|
1529
|
+
* @param {string} part
|
|
1530
|
+
* @returns {boolean}
|
|
1531
|
+
*/
|
|
1532
|
+
export function sizesItsOwnBox(C: any, part: string): boolean;
|
|
1199
1533
|
/**
|
|
1200
1534
|
* Whether a part is drawn as a radio's mark, as the part data records it:
|
|
1201
1535
|
* a part with a checked state and a square box of a fixed size.
|
|
@@ -1214,6 +1548,25 @@ export function radioMark(C: any, part: string): boolean;
|
|
|
1214
1548
|
* @returns {boolean}
|
|
1215
1549
|
*/
|
|
1216
1550
|
export function radioCircle(C: any, part: string): boolean;
|
|
1551
|
+
/**
|
|
1552
|
+
* The parts drawn round with the pill token (--radius-full) as a styling
|
|
1553
|
+
* choice: a pill whose box follows its content or its track (a badge, a
|
|
1554
|
+
* progress track, a switch's track, an indicator line), never a circle.
|
|
1555
|
+
* A part is a circle, and keeps its round shape, where in a rule its corners
|
|
1556
|
+
* read the pill token its box is square (its width and height, or its
|
|
1557
|
+
* minimum width and height or height, are one value: a switch's thumb, a
|
|
1558
|
+
* calendar day, a numbered citation) or a visual prop names its shape a
|
|
1559
|
+
* circle (an avatar's shape=circle), and so is a radio's mark. By the
|
|
1560
|
+
* census, never by name.
|
|
1561
|
+
* @param {{MAP: Record<string, any>}} C
|
|
1562
|
+
* @returns {{pills: string[], circles: string[]}}
|
|
1563
|
+
*/
|
|
1564
|
+
export function pillShapes(C: {
|
|
1565
|
+
MAP: Record<string, any>;
|
|
1566
|
+
}): {
|
|
1567
|
+
pills: string[];
|
|
1568
|
+
circles: string[];
|
|
1569
|
+
};
|
|
1217
1570
|
/**
|
|
1218
1571
|
* The radius token a part's resting corners read. A part the census saw
|
|
1219
1572
|
* closed (a menu, a popover) has none recorded: a container or menu reads
|
|
@@ -1239,11 +1592,21 @@ export function clearNewMarker(dir: string): void;
|
|
|
1239
1592
|
* control inside it (never a list row); an action part that holds
|
|
1240
1593
|
* children (a button group, a segmented control) never does, so one
|
|
1241
1594
|
* disabled child never makes the whole part look disabled.
|
|
1595
|
+
* A moment state on a part drawn under an invisible input lands on the
|
|
1596
|
+
* part holding that input, and the part shows it from there.
|
|
1242
1597
|
* @param {string} state
|
|
1243
|
-
* @param {boolean} [
|
|
1598
|
+
* @param {boolean | Control} [control] whether it wraps one control, or
|
|
1599
|
+
* its control (`controlOf`)
|
|
1244
1600
|
* @returns {string}
|
|
1245
1601
|
*/
|
|
1246
|
-
export function stateKey(state: string,
|
|
1602
|
+
export function stateKey(state: string, control?: boolean | Control): string;
|
|
1603
|
+
/**
|
|
1604
|
+
* A part's control, as `stateSlot` takes it.
|
|
1605
|
+
* @param {Ctx} ctx
|
|
1606
|
+
* @param {string} target
|
|
1607
|
+
* @returns {Control}
|
|
1608
|
+
*/
|
|
1609
|
+
export function controlOf(ctx: Ctx, target: string): Control;
|
|
1247
1610
|
/**
|
|
1248
1611
|
* The ARIA states a part is painted in (any condition the part data holds
|
|
1249
1612
|
* for it names the attribute).
|
|
@@ -1290,7 +1653,8 @@ export function savedStateRead(ctx: Ctx, s: any): string | null;
|
|
|
1290
1653
|
/**
|
|
1291
1654
|
* Read each saved entry's state on a part in place, as savedStateRead
|
|
1292
1655
|
* reads it, with a note: what a change does before it saves the settings,
|
|
1293
|
-
* so the file then holds the part's own spelling.
|
|
1656
|
+
* so the file then holds the part's own spelling. A saved `only` is read
|
|
1657
|
+
* by the whole --only rule first (readSavedOnly).
|
|
1294
1658
|
* @param {Ctx} ctx
|
|
1295
1659
|
* @param {ThemeData} data
|
|
1296
1660
|
*/
|
|
@@ -1303,12 +1667,14 @@ export function readSavedStates(ctx: Ctx, data: ThemeData): void;
|
|
|
1303
1667
|
* @param {string[]} own the states Core writes as keys on the part
|
|
1304
1668
|
* @param {string | undefined} state
|
|
1305
1669
|
* @param {string | undefined} when
|
|
1306
|
-
* @param {boolean} [wrapsControl]
|
|
1670
|
+
* @param {boolean | Control} [wrapsControl] whether it wraps one control,
|
|
1671
|
+
* or its control (`controlOf`)
|
|
1307
1672
|
* @param {Record<string, string>} [values] the value Core writes for each
|
|
1308
1673
|
* own state: a state that names a boolean prop is written `state:true`
|
|
1674
|
+
* @param {string[]} [census] the part's states from the census alone
|
|
1309
1675
|
* @returns {{key: string, pseudo: string | null}}
|
|
1310
1676
|
*/
|
|
1311
|
-
export function stateSlot(own: string[], state: string | undefined, when: string | undefined, wrapsControl?: boolean, values?: Record<string, string
|
|
1677
|
+
export function stateSlot(own: string[], state: string | undefined, when: string | undefined, wrapsControl?: boolean | Control, values?: Record<string, string>, census?: string[]): {
|
|
1312
1678
|
key: string;
|
|
1313
1679
|
pseudo: string | null;
|
|
1314
1680
|
};
|
|
@@ -1322,11 +1688,122 @@ export function stateSlot(own: string[], state: string | undefined, when: string
|
|
|
1322
1688
|
* @param {{MAP: Record<string, any>}} C
|
|
1323
1689
|
* @param {string} part
|
|
1324
1690
|
* @param {boolean} [deep]
|
|
1691
|
+
* @param {(part: string) => boolean} [keep] which contained parts count, when deep
|
|
1325
1692
|
* @returns {string[]}
|
|
1326
1693
|
*/
|
|
1327
1694
|
export function innerTextTokens(C: {
|
|
1328
1695
|
MAP: Record<string, any>;
|
|
1329
|
-
}, part: string, deep?: boolean): string[];
|
|
1696
|
+
}, part: string, deep?: boolean, keep?: (part: string) => boolean): string[];
|
|
1697
|
+
/**
|
|
1698
|
+
* The text color tokens a text, heading or link part's color prop reads, so a
|
|
1699
|
+
* color set on that part goes into them there: the token of the color named
|
|
1700
|
+
* with --when color:<name>; a heading's main and supporting text tokens; else
|
|
1701
|
+
* the tokens of the colors the prop shows by default (colorPropDefaults: a
|
|
1702
|
+
* link's accent). Empty for any other part.
|
|
1703
|
+
* @param {Ctx} ctx
|
|
1704
|
+
* @param {string} part
|
|
1705
|
+
* @param {string | null} [when]
|
|
1706
|
+
* @returns {string[]}
|
|
1707
|
+
*/
|
|
1708
|
+
export function colorPropTokens(ctx: Ctx, part: string, when?: string | null): string[];
|
|
1709
|
+
/**
|
|
1710
|
+
* The tokens elements inside a part read for a text property the part does
|
|
1711
|
+
* not set itself (a top nav heading's title size, --text-large-size), so
|
|
1712
|
+
* the property set on the part never reaches that text; or, for a part
|
|
1713
|
+
* whose own box reads no tokens and holds only parts that each set the
|
|
1714
|
+
* property, the tokens those parts read (a dialog's title block). Empty
|
|
1715
|
+
* when the part sets the property itself.
|
|
1716
|
+
* @param {{MAP: Record<string, any>}} C
|
|
1717
|
+
* @param {string} part
|
|
1718
|
+
* @param {string} prop
|
|
1719
|
+
* @returns {string[]}
|
|
1720
|
+
*/
|
|
1721
|
+
export function innerPropTokens(C: {
|
|
1722
|
+
MAP: Record<string, any>;
|
|
1723
|
+
}, part: string, prop: string): string[];
|
|
1724
|
+
/**
|
|
1725
|
+
* The size token of a part's main text, when the part draws no size of its
|
|
1726
|
+
* own and the elements inside it read several text size tokens: the
|
|
1727
|
+
* largest as the sizes resolve (a top nav heading's title, --text-large-size,
|
|
1728
|
+
* over its supporting line). Null for a text column, whose lines each take a
|
|
1729
|
+
* size said for the part, for a tie or a size that cannot be read, and when
|
|
1730
|
+
* the sizes come from the parts it holds (a heading drawn at any level, an
|
|
1731
|
+
* icon sized by spacing): no one main text can be told there.
|
|
1732
|
+
* @param {{MAP: Record<string, any>}} C
|
|
1733
|
+
* @param {string} part
|
|
1734
|
+
* @param {Record<string, string>} tokens Core's token defaults
|
|
1735
|
+
* @returns {string | null}
|
|
1736
|
+
*/
|
|
1737
|
+
export function mainTextSizeToken(C: {
|
|
1738
|
+
MAP: Record<string, any>;
|
|
1739
|
+
}, part: string, tokens: Record<string, string>): string | null;
|
|
1740
|
+
/**
|
|
1741
|
+
* Whether a value names a token (written into that token, it would read
|
|
1742
|
+
* itself).
|
|
1743
|
+
* @param {unknown} value @param {string} token
|
|
1744
|
+
*/
|
|
1745
|
+
export function namesToken(value: unknown, token: string): boolean;
|
|
1746
|
+
/**
|
|
1747
|
+
* The one text size token the parts a part holds read (a tab list's tabs,
|
|
1748
|
+
* --text-label-size), for a text size token said of that part alone, with
|
|
1749
|
+
* no state, that set's token check refused: the part reads none and draws
|
|
1750
|
+
* no text of its own (no element inside it sets a text property). Read from that refusal's own list, so the
|
|
1751
|
+
* refusal and the accept never differ. Null otherwise, and for a value that
|
|
1752
|
+
* names that token (it would read itself).
|
|
1753
|
+
* @param {{MAP: Record<string, any>}} C
|
|
1754
|
+
* @param {{state?: string}} s
|
|
1755
|
+
* @param {string} part
|
|
1756
|
+
* @param {string} thing
|
|
1757
|
+
* @param {unknown} value
|
|
1758
|
+
* @param {{held?: string[], soft?: boolean} | null | undefined} refused
|
|
1759
|
+
* @returns {string | null}
|
|
1760
|
+
*/
|
|
1761
|
+
export function heldSizeTokenFor(C: {
|
|
1762
|
+
MAP: Record<string, any>;
|
|
1763
|
+
}, s: {
|
|
1764
|
+
state?: string;
|
|
1765
|
+
}, part: string, thing: string, value: unknown, refused: {
|
|
1766
|
+
held?: string[];
|
|
1767
|
+
soft?: boolean;
|
|
1768
|
+
} | null | undefined): string | null;
|
|
1769
|
+
/**
|
|
1770
|
+
* The tokens of the lines in a part's text column, when its text sits in one
|
|
1771
|
+
* column part of its own that holds no text itself (a banner's message
|
|
1772
|
+
* column: its title, --text-label-size, and description,
|
|
1773
|
+
* --text-supporting-size), each line a leaf part of its own that sets the
|
|
1774
|
+
* property. A text property set on the part goes into each of them there:
|
|
1775
|
+
* it means all of the part's text. Empty for any other part.
|
|
1776
|
+
* @param {{MAP: Record<string, any>}} C
|
|
1777
|
+
* @param {string} part
|
|
1778
|
+
* @param {string} prop
|
|
1779
|
+
* @returns {string[]}
|
|
1780
|
+
*/
|
|
1781
|
+
export function columnLineTokens(C: {
|
|
1782
|
+
MAP: Record<string, any>;
|
|
1783
|
+
}, part: string, prop: string): string[];
|
|
1784
|
+
/**
|
|
1785
|
+
* The text color tokens a color set on a part also goes into, so the text
|
|
1786
|
+
* it means shows that color: the tokens Core's elements inside the part read
|
|
1787
|
+
* (innerTextTokens). A part that draws no text of its own (an app shell
|
|
1788
|
+
* header, a top nav) holds only parts with their own text, which read these
|
|
1789
|
+
* tokens and not the inherited color; there the tokens of the parts inside
|
|
1790
|
+
* it count, on the part alone.
|
|
1791
|
+
* @param {{MAP: Record<string, any>}} C
|
|
1792
|
+
* @param {string} part
|
|
1793
|
+
* @param {{target?: Map<string, {component?: string}>}} [project]
|
|
1794
|
+
* @param {Array<{text: string, within?: string[]}>} [pairs] the census's text pairs
|
|
1795
|
+
* @returns {string[]}
|
|
1796
|
+
*/
|
|
1797
|
+
export function colorTokensReached(C: {
|
|
1798
|
+
MAP: Record<string, any>;
|
|
1799
|
+
}, part: string, project?: {
|
|
1800
|
+
target?: Map<string, {
|
|
1801
|
+
component?: string;
|
|
1802
|
+
}>;
|
|
1803
|
+
}, pairs?: Array<{
|
|
1804
|
+
text: string;
|
|
1805
|
+
within?: string[];
|
|
1806
|
+
}>): string[];
|
|
1330
1807
|
/**
|
|
1331
1808
|
* The component docs of a part: its own component's, and the one named like
|
|
1332
1809
|
* the part (tab is Tab, under TabList), each with its name, for the ones the
|
|
@@ -1371,6 +1848,36 @@ export function radiiIn(source: string): Record<string, string> | null;
|
|
|
1371
1848
|
export function radiusAt(base: {
|
|
1372
1849
|
light: Record<string, string>;
|
|
1373
1850
|
}, value: string, token: string): number;
|
|
1851
|
+
/**
|
|
1852
|
+
* The base theme's chat and container radii in px, when the base pins a
|
|
1853
|
+
* chat radius other than its container radius. Null when the base sets no
|
|
1854
|
+
* length for either, has square containers, or gives both the same radius:
|
|
1855
|
+
* then the chat radius is the container radius. (The two stay a fraction,
|
|
1856
|
+
* so the base's own corners give its chat radius exactly.)
|
|
1857
|
+
* @param {{light: Record<string, string>}} base
|
|
1858
|
+
* @returns {{chat: number, container: number, cap: number} | null}
|
|
1859
|
+
*/
|
|
1860
|
+
export function chatRatio(base: {
|
|
1861
|
+
light: Record<string, string>;
|
|
1862
|
+
}): {
|
|
1863
|
+
chat: number;
|
|
1864
|
+
container: number;
|
|
1865
|
+
cap: number;
|
|
1866
|
+
} | null;
|
|
1867
|
+
/**
|
|
1868
|
+
* The chat radius the corners dial writes: the container radius at the
|
|
1869
|
+
* base's ratio of the two, up to the cap {@link chatRatio} names, or the
|
|
1870
|
+
* container radius when the base pins no other. A bound (`at most 8px`)
|
|
1871
|
+
* holds it there too, still read from the container radius.
|
|
1872
|
+
* @param {{light: Record<string, string>}} base
|
|
1873
|
+
* @param {{limit: number, up: boolean} | null} [bound]
|
|
1874
|
+
*/
|
|
1875
|
+
export function chatRadiusValue(base: {
|
|
1876
|
+
light: Record<string, string>;
|
|
1877
|
+
}, bound?: {
|
|
1878
|
+
limit: number;
|
|
1879
|
+
up: boolean;
|
|
1880
|
+
} | null): string;
|
|
1374
1881
|
/**
|
|
1375
1882
|
* Whether a file is a module the editor generated (its first line is the
|
|
1376
1883
|
* editor's header).
|
|
@@ -1404,6 +1911,25 @@ export function refuseLinks(cwd: string, slug: string): void;
|
|
|
1404
1911
|
* @param {ThemeData} data
|
|
1405
1912
|
*/
|
|
1406
1913
|
export function settingsStamp(data: ThemeData): string;
|
|
1914
|
+
/**
|
|
1915
|
+
* The stamp of a theme's whole-theme color-token settings, as the file
|
|
1916
|
+
* keeps them: a module records it, so a hand edit that leaves them as they
|
|
1917
|
+
* were is told from one that changes a color the module wrote out.
|
|
1918
|
+
* @param {ThemeData} data
|
|
1919
|
+
*/
|
|
1920
|
+
export function colorsStamp(data: ThemeData): string;
|
|
1921
|
+
/**
|
|
1922
|
+
* Whether the theme's settings module is one a newer CLI wrote for a
|
|
1923
|
+
* palette recipe this CLI does not know, and still current: built from
|
|
1924
|
+
* these same settings, on the base version installed, by a CLI no older
|
|
1925
|
+
* than this one, and not edited by hand. Such a module is kept as written
|
|
1926
|
+
* (building it again could only lose what that CLI knows), and a build
|
|
1927
|
+
* that keeps it is current.
|
|
1928
|
+
* @param {string} cwd
|
|
1929
|
+
* @param {string} slug
|
|
1930
|
+
* @param {ThemeData} data
|
|
1931
|
+
*/
|
|
1932
|
+
export function moduleKeptAsSaved(cwd: string, slug: string, data: ThemeData): boolean;
|
|
1407
1933
|
/**
|
|
1408
1934
|
* Why the theme's build does not match its settings, in words, or null when
|
|
1409
1935
|
* it does: a file missing, another CLI version, settings changed since the
|
|
@@ -1444,14 +1970,17 @@ export function readHistory(file: string): {
|
|
|
1444
1970
|
* @param {Ctx} ctx
|
|
1445
1971
|
* @param {string} slug
|
|
1446
1972
|
* @param {ThemeData} data
|
|
1447
|
-
* @param {{history: boolean, historyAfter?: string[], radii?: Record<string, string> | null}} options
|
|
1973
|
+
* @param {{history: boolean, historyAfter?: string[], radii?: Record<string, string> | null, stops?: Record<string, any> | null}} options
|
|
1448
1974
|
* `historyAfter`: the history to write with the change (a step back pops it);
|
|
1449
|
-
* `radii`: the whole-theme radii the step being restored was built with
|
|
1975
|
+
* `radii`: the whole-theme radii the step being restored was built with;
|
|
1976
|
+
* `stops`: the shades the step being restored showed, for a palette kept
|
|
1977
|
+
* as saved
|
|
1450
1978
|
*/
|
|
1451
|
-
export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history, historyAfter, radii }: {
|
|
1979
|
+
export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history, historyAfter, radii, stops }: {
|
|
1452
1980
|
history: boolean;
|
|
1453
1981
|
historyAfter?: string[];
|
|
1454
1982
|
radii?: Record<string, string> | null;
|
|
1983
|
+
stops?: Record<string, any> | null;
|
|
1455
1984
|
}): Promise<{
|
|
1456
1985
|
changed: never[];
|
|
1457
1986
|
changedParts: never[];
|
|
@@ -1466,6 +1995,7 @@ export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history,
|
|
|
1466
1995
|
lifted: never[];
|
|
1467
1996
|
notes: string[];
|
|
1468
1997
|
unchanged: boolean;
|
|
1998
|
+
leftProblems?: undefined;
|
|
1469
1999
|
before?: undefined;
|
|
1470
2000
|
resBefore?: undefined;
|
|
1471
2001
|
} | {
|
|
@@ -1475,6 +2005,7 @@ export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history,
|
|
|
1475
2005
|
problems: string[];
|
|
1476
2006
|
problemList: ThemeProblem[];
|
|
1477
2007
|
newProblems: ThemeProblem[];
|
|
2008
|
+
leftProblems: ThemeProblem[];
|
|
1478
2009
|
warnings: string[];
|
|
1479
2010
|
lifted: string[];
|
|
1480
2011
|
notes: string[];
|
|
@@ -1593,6 +2124,26 @@ export const FOLDER_JUNK: Set<string>;
|
|
|
1593
2124
|
export const APP_COPY_BUILT: string[];
|
|
1594
2125
|
export function shown(cwd: string, f: string): string;
|
|
1595
2126
|
export function keyOf(s: Setting): string;
|
|
2127
|
+
/**
|
|
2128
|
+
* The colors a badge without a solid fill takes inside a filled button, by
|
|
2129
|
+
* the button's variant: its fill color as text on its text color, as Core's
|
|
2130
|
+
* neutral badge takes them, so the badge reads on the button. The rule
|
|
2131
|
+
* selects the badge inside that button.
|
|
2132
|
+
*/
|
|
2133
|
+
/** Where a badge sits inside a secondary button (Button's default). */
|
|
2134
|
+
export const BADGE_IN_SECONDARY_BUTTON: ":is(.astryx-button[data-variant=\"secondary\"] *)";
|
|
2135
|
+
export const BADGE_IN_BUTTON: {
|
|
2136
|
+
readonly ':is(.astryx-button[data-variant="primary"] *)': {
|
|
2137
|
+
readonly backgroundColor: "var(--color-on-accent)";
|
|
2138
|
+
readonly color: "var(--color-accent)";
|
|
2139
|
+
};
|
|
2140
|
+
readonly ':is(.astryx-button[data-variant="destructive"] *)': {
|
|
2141
|
+
readonly backgroundColor: "var(--color-on-error)";
|
|
2142
|
+
readonly color: "var(--color-error)";
|
|
2143
|
+
};
|
|
2144
|
+
};
|
|
2145
|
+
/** The sizes a control has, each with its own height token. */
|
|
2146
|
+
export const CONTROL_SIZES: readonly ["sm", "md", "lg"];
|
|
1596
2147
|
export function cornerPx(v: string): number;
|
|
1597
2148
|
export function textPx(v: string): number;
|
|
1598
2149
|
/** The type tokens base themes set again for phones: families and weights. */
|
|
@@ -1702,6 +2253,33 @@ export type OwnTokenEntry = {
|
|
|
1702
2253
|
notToken?: boolean;
|
|
1703
2254
|
block?: boolean;
|
|
1704
2255
|
};
|
|
2256
|
+
/**
|
|
2257
|
+
* The colors a badge style draws a status or category variant in, from the
|
|
2258
|
+
* first pair that reads in every mode: text at 4.5:1 on its fill, the fill
|
|
2259
|
+
* over the page. The fill is null where the badge has no fill of its own.
|
|
2260
|
+
* `kept` marks the pair a variant falls back to when no color of the style
|
|
2261
|
+
* reads: Core's own tint (solid), or the primary text inside a line of its
|
|
2262
|
+
* hue (outline).
|
|
2263
|
+
*/
|
|
2264
|
+
export type BadgePair = {
|
|
2265
|
+
fill: string | null;
|
|
2266
|
+
text: string;
|
|
2267
|
+
line?: boolean;
|
|
2268
|
+
kept?: boolean;
|
|
2269
|
+
};
|
|
2270
|
+
/**
|
|
2271
|
+
* One half of a palette token in a generated settings module: a palette
|
|
2272
|
+
* stop (`family` and `stop`, with `alpha` for a see-through one), white or
|
|
2273
|
+
* black, a color written out (`family: 'literal'`), or the base theme's
|
|
2274
|
+
* own value (`family: 'literal', base: true`).
|
|
2275
|
+
*/
|
|
2276
|
+
export type KeptHalf = {
|
|
2277
|
+
family: string;
|
|
2278
|
+
stop: number;
|
|
2279
|
+
alpha?: string;
|
|
2280
|
+
color?: string;
|
|
2281
|
+
base?: true;
|
|
2282
|
+
};
|
|
1705
2283
|
/**
|
|
1706
2284
|
* One problem the theme has, with the command that fixes it, or null when
|
|
1707
2285
|
* no one command does. `key` names the problem whatever its ratio (what
|
|
@@ -1714,6 +2292,15 @@ export type ThemeProblem = {
|
|
|
1714
2292
|
key: string;
|
|
1715
2293
|
note?: boolean;
|
|
1716
2294
|
};
|
|
2295
|
+
/**
|
|
2296
|
+
* A part's control: whether it wraps one control (its disabled state is
|
|
2297
|
+
* the control's too), and the part holding the invisible input it is drawn
|
|
2298
|
+
* under, if any.
|
|
2299
|
+
*/
|
|
2300
|
+
export type Control = {
|
|
2301
|
+
wraps: boolean;
|
|
2302
|
+
under: string | null;
|
|
2303
|
+
};
|
|
1717
2304
|
export type DirSnapshot = {
|
|
1718
2305
|
/**
|
|
1719
2306
|
* each regular file, with its bytes and times (ms)
|
|
@@ -1753,11 +2340,24 @@ export type Setting = {
|
|
|
1753
2340
|
state?: string | undefined;
|
|
1754
2341
|
mode?: "light" | "dark" | undefined;
|
|
1755
2342
|
only?: boolean | undefined;
|
|
2343
|
+
/**
|
|
2344
|
+
* - A group's height the narrowing copied onto
|
|
2345
|
+
* this member, with only, when one control of the group took its own.
|
|
2346
|
+
*/
|
|
2347
|
+
narrowed?: boolean | undefined;
|
|
1756
2348
|
/**
|
|
1757
2349
|
* - For the `headings` dial: `weight` or `tracking`.
|
|
1758
2350
|
*/
|
|
1759
2351
|
axis?: string | undefined;
|
|
1760
2352
|
note?: string | undefined;
|
|
2353
|
+
/**
|
|
2354
|
+
* - The state word a command wrote as another state, said in its result.
|
|
2355
|
+
*/
|
|
2356
|
+
stateNote?: string | undefined;
|
|
2357
|
+
/**
|
|
2358
|
+
* - A box shorthand's sides, each checked, which set writes in its place (never saved).
|
|
2359
|
+
*/
|
|
2360
|
+
sides?: Setting[] | undefined;
|
|
1761
2361
|
};
|
|
1762
2362
|
/**
|
|
1763
2363
|
* The settings file.
|
|
@@ -1790,11 +2390,7 @@ export type Ctx = {
|
|
|
1790
2390
|
dark: Record<string, string>;
|
|
1791
2391
|
components?: Record<string, any>;
|
|
1792
2392
|
};
|
|
1793
|
-
keepStops?:
|
|
1794
|
-
family: string;
|
|
1795
|
-
stop: number;
|
|
1796
|
-
alpha?: string;
|
|
1797
|
-
}>> | null;
|
|
2393
|
+
keepStops?: ReturnType<typeof stopsIn> | null;
|
|
1798
2394
|
keepRadii?: Record<string, string> | null;
|
|
1799
2395
|
sizeNotes?: string[];
|
|
1800
2396
|
compileNotes?: string[];
|
|
@@ -1825,5 +2421,6 @@ declare function buildThemeSteps(ctx: Ctx, slug: string, data: ThemeData): Promi
|
|
|
1825
2421
|
removedPictures: string[];
|
|
1826
2422
|
}>;
|
|
1827
2423
|
import { NAME_RULE } from './_name-rule.mjs';
|
|
2424
|
+
import { GROUP_ROLES } from './_tables.mjs';
|
|
1828
2425
|
import { modesOf } from './_palette.mjs';
|
|
1829
|
-
export { NAME_RULE, modesOf };
|
|
2426
|
+
export { NAME_RULE, GROUP_ROLES, modesOf };
|