@astryxdesign/cli 0.7.16 → 0.7.17-canary.g49a475f
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 +76 -86
- package/api/build/_adapter.d.mts +12 -0
- package/api/build/_adapter.mjs +51 -34
- package/api/build/blocks/blocks.d.mts +7 -5
- package/api/build/blocks/blocks.mjs +113 -26
- package/api/build/build.doc.mjs +4 -3
- package/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +3 -3
- package/api/build/kit/kind.d.mts +2 -1
- package/api/build/kit/kind.mjs +199 -10
- package/api/build/kit/kit.mjs +6 -4
- package/api/build/kit/rank.d.mts +4 -2
- package/api/build/kit/rank.mjs +125 -24
- package/api/build/kit/start.d.mts +5 -4
- package/api/build/kit/start.mjs +12 -8
- package/api/build/kit/weights.d.mts +39 -3
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +340 -43
- package/api/build/kit/word-model.d.mts +23 -0
- package/api/build/kit/word-model.mjs +46 -0
- package/api/build/kit/words.d.mts +48 -0
- package/api/build/kit/words.mjs +90 -1
- package/api/component/__fixtures__/resolutions/modules.txt +4 -5
- package/api/component/list/list.d.mts +1 -1
- package/api/component/list/list.mjs +48 -6
- package/api/discover/_adapter.d.mts +1 -1
- package/api/discover/search/search.mjs +3 -2
- package/api/docs/_adapter.d.mts +26 -2
- package/api/docs/_adapter.mjs +219 -6
- package/api/docs/docs.d.mts +3 -0
- package/api/docs/docs.doc.mjs +7 -1
- package/api/docs/docs.mjs +12 -0
- package/api/docs/docs.type.d.mts +5 -0
- package/api/docs/docs.type.mjs +2 -0
- package/api/docs/node/node.mjs +1 -1
- package/api/doctor/_adapter.d.mts +27 -5
- package/api/doctor/_adapter.mjs +83 -10
- package/api/doctor/built-checks.mjs +40 -14
- package/api/doctor/doctor.d.mts +4 -3
- package/api/doctor/doctor.mjs +14 -7
- package/api/doctor/theme-checks.mjs +121 -17
- package/api/icon/_records.mjs +2 -1
- package/api/index.d.mts +2 -0
- package/api/index.mjs +2 -0
- package/api/integration/_adapter.d.mts +44 -0
- package/api/integration/_adapter.mjs +77 -1
- package/api/integration/authoring-checks.mjs +6 -6
- package/api/integration/example-scope.d.mts +14 -0
- package/api/integration/example-scope.mjs +44 -0
- package/api/integration/example-scope.type.d.mts +29 -0
- package/api/integration/example-scope.type.mjs +25 -0
- package/api/integration/integrationExampleScope.doc.d.mts +11 -0
- package/api/integration/integrationExampleScope.doc.mjs +59 -0
- package/api/integration/validate-integration.mjs +19 -1
- package/api/integration/validate-integration.type.d.mts +9 -0
- package/api/integration/validate-integration.type.mjs +1 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.mjs +591 -195
- package/api/render/render.doc.mjs +11 -3
- package/api/render/render.type.d.mts +52 -0
- package/api/render/render.type.mjs +31 -1
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +9 -0
- package/api/search/_adapter.mjs +85 -0
- package/api/search/_candidate-score.mjs +51 -32
- package/api/search/_fit-order.mjs +3 -3
- package/api/search/_gather-components.d.mts +3 -2
- package/api/search/_gather-components.mjs +12 -3
- package/api/search/_lexical.d.mts +5 -0
- package/api/search/_lexical.mjs +8 -2
- package/api/search/_result.d.mts +11 -9
- package/api/search/_result.mjs +4 -4
- package/api/search/_score.d.mts +6 -1
- package/api/search/_score.mjs +15 -3
- package/api/search/search-index.mjs +7 -1
- package/api/search/search.d.mts +1 -1
- package/api/theme/_adapter.mjs +12 -1
- package/api/theme/build/build.d.mts +75 -0
- package/api/theme/build/build.mjs +243 -58
- package/api/theme/build/font-warning.d.mts +7 -0
- package/api/theme/build/font-warning.mjs +17 -0
- package/api/theme/theme.type.d.mts +10 -0
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme-edit/_adapter.d.mts +63 -2
- package/api/theme-edit/_adapter.mjs +771 -57
- package/api/theme-edit/_check.d.mts +40 -22
- package/api/theme-edit/_check.mjs +2029 -336
- package/api/theme-edit/_color.d.mts +10 -0
- package/api/theme-edit/_color.mjs +49 -1
- package/api/theme-edit/_compiler.mjs +9 -0
- package/api/theme-edit/_context.d.mts +3 -3
- package/api/theme-edit/_context.mjs +111 -48
- package/api/theme-edit/_css.d.mts +14 -0
- package/api/theme-edit/_css.mjs +46 -1
- package/api/theme-edit/_edit.d.mts +18 -4
- package/api/theme-edit/_edit.mjs +1685 -155
- package/api/theme-edit/_how-commands.d.mts +65 -0
- package/api/theme-edit/_how-commands.mjs +633 -1
- package/api/theme-edit/_how-question.d.mts +84 -0
- package/api/theme-edit/_how-question.mjs +5124 -281
- package/api/theme-edit/_how.mjs +140 -29
- package/api/theme-edit/_marks.d.mts +31 -5
- package/api/theme-edit/_marks.mjs +57 -5
- package/api/theme-edit/_name-rule.d.mts +11 -0
- package/api/theme-edit/_name-rule.mjs +12 -0
- package/api/theme-edit/_normal.d.mts +257 -0
- package/api/theme-edit/_normal.mjs +1252 -0
- package/api/theme-edit/_palette.mjs +10 -4
- package/api/theme-edit/_parts.d.mts +10 -1
- package/api/theme-edit/_parts.mjs +179 -3
- package/api/theme-edit/_preview-app.d.mts +7 -1
- package/api/theme-edit/_preview-app.mjs +515 -148
- package/api/theme-edit/_preview.d.mts +100 -14
- package/api/theme-edit/_preview.mjs +549 -137
- package/api/theme-edit/_settings.d.mts +347 -30
- package/api/theme-edit/_settings.mjs +2971 -327
- package/api/theme-edit/_tables.d.mts +6 -0
- package/api/theme-edit/_tables.mjs +44 -1
- package/api/theme-edit/_vet.d.mts +18 -0
- package/api/theme-edit/_vet.mjs +32 -0
- package/api/theme-edit/theme-edit.type.d.mts +10 -1
- package/api/theme-edit/theme-edit.type.mjs +4 -1
- package/api/theme-edit/themeEditHow.doc.mjs +1 -1
- package/api/theme-edit/themeEditNew.doc.d.mts +0 -1
- package/api/theme-edit/themeEditNew.doc.mjs +7 -4
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +2 -2
- package/api/upgrade/run/run.mjs +4 -3
- package/assets/codemods/integration-discovery.mjs +2 -1
- package/assets/codemods/run-codemod.mjs +87 -7
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
- package/assets/component-list.generated.json +1 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -0
- package/assets/docs/theme.doc.dense.mjs +2 -2
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +2 -3
- package/assets/docs/tree/render-pages.doc.mjs +44 -3
- package/assets/docs/tree/single-component.doc.mjs +4 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/search-catalog.generated.json +2 -0
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +2 -2
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
- package/assets/templates/pages/blank/template.doc.mjs +1 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
- package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
- package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
- package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
- package/assets/templates/pages/documentation/template.doc.mjs +4 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
- package/assets/templates/pages/editor/template.doc.mjs +2 -8
- package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
- package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
- package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
- package/assets/templates/pages/ide/page.tsx +24 -2
- package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
- package/assets/templates/pages/library/template.doc.mjs +4 -1
- package/assets/templates/pages/login/template.doc.mjs +2 -1
- package/assets/templates/pages/login-card/template.doc.mjs +2 -1
- package/assets/templates/pages/login-split/template.doc.mjs +2 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
- package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
- package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
- package/assets/templates/pages/table-page/template.doc.mjs +5 -4
- package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
- package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
- package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
- package/assets/theme.template.ts +6 -0
- package/authoring/debug/parse.d.mts +3 -3
- package/authoring/doctypes/_schema.d.mts +3 -3
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/component/categories.d.mts +37 -0
- package/authoring/doctypes/component/categories.mjs +54 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +9 -0
- package/authoring/example/example.doc.d.mts +12 -0
- package/authoring/example/example.doc.mjs +69 -0
- package/authoring/example/preview.d.mts +92 -0
- package/authoring/example/preview.mjs +994 -0
- package/authoring/example/type.ts +102 -0
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +12 -0
- package/authoring/index.mjs +3 -1
- package/clients/cli/bin/astryx.mjs +6 -9
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/component.mjs +22 -3
- package/clients/cli/commands/docs.doc.mjs +7 -1
- package/clients/cli/commands/docs.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +32 -14
- package/clients/cli/commands/experimental/render.mjs +42 -1
- package/clients/cli/commands/experimental/theme.mjs +163 -28
- package/clients/cli/commands/experimental-render.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +87 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +10 -3
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +2 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +5 -1
- package/clients/cli/commands/search.doc.mjs +2 -1
- package/clients/cli/commands/search.mjs +6 -1
- package/clients/cli/commands/template.mjs +4 -2
- package/clients/cli/commands/theme-build.doc.mjs +5 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +209 -8
- package/clients/cli/commands/upgrade.mjs +42 -7
- package/clients/cli/index.mjs +1 -1
- package/clients/cli/lib/cli-error.mjs +2 -1
- package/clients/cli/lib/component-format.mjs +205 -98
- package/clients/cli/lib/hook-format.mjs +9 -19
- package/clients/cli/lib/json-shim.mjs +77 -21
- package/clients/cli/lib/manifest.mjs +3 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/theme-state.d.mts +13 -1
- package/foundation/config/theme-state.mjs +47 -7
- package/foundation/discovery/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +56 -8
- package/foundation/discovery/component-replacement.mjs +130 -1
- package/foundation/discovery/copied-passages.mjs +2 -1
- package/foundation/discovery/doc-types.mjs +4 -3
- package/foundation/discovery/entry-name-files.d.mts +43 -0
- package/foundation/discovery/entry-name-files.mjs +264 -0
- package/foundation/discovery/hook-discovery.d.mts +8 -2
- package/foundation/discovery/hook-discovery.mjs +22 -8
- package/foundation/discovery/icon-definition-discovery.mjs +2 -1
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.mjs +2 -1
- package/foundation/discovery/integration-doc-files.mjs +2 -1
- package/foundation/discovery/package-exports.d.mts +10 -0
- package/foundation/discovery/package-exports.mjs +56 -3
- package/foundation/discovery/prop-drift.mjs +9 -9
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/stored-component-list.d.mts +43 -0
- package/foundation/discovery/stored-component-list.mjs +90 -0
- package/foundation/discovery/stored-search-catalog.d.mts +115 -0
- package/foundation/discovery/stored-search-catalog.mjs +297 -0
- package/foundation/discovery/stored-self-audit.d.mts +26 -10
- package/foundation/discovery/stored-self-audit.mjs +38 -18
- package/foundation/discovery/template-adapter.d.mts +52 -0
- package/foundation/discovery/template-adapter.mjs +176 -12
- package/foundation/discovery/template-icons.mjs +2 -1
- package/foundation/discovery/theme-discovery.mjs +3 -2
- package/foundation/discovery/theme-imports.d.mts +14 -0
- package/foundation/discovery/theme-imports.mjs +43 -1
- package/foundation/discovery/theming-targets.mjs +3 -2
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/inputs.mjs +3 -2
- package/foundation/doc-compiler/parse-readable.mjs +4 -1
- package/foundation/doc-compiler/stored-docs.d.mts +22 -0
- package/foundation/doc-compiler/stored-docs.mjs +49 -0
- package/foundation/env/semver.mjs +3 -1
- package/foundation/fonts/font-stylesheet.d.mts +31 -0
- package/foundation/fonts/font-stylesheet.mjs +115 -0
- package/foundation/fs/cache-eviction.d.mts +21 -0
- package/foundation/fs/cache-eviction.mjs +73 -0
- package/foundation/fs/file-protection.mjs +4 -3
- package/foundation/fs/gather-cache.d.mts +25 -4
- package/foundation/fs/gather-cache.mjs +164 -55
- package/foundation/fs/jiti-cache.d.mts +19 -1
- package/foundation/fs/jiti-cache.mjs +130 -6
- package/foundation/fs/kept-tree.d.mts +60 -0
- package/foundation/fs/kept-tree.mjs +154 -0
- package/foundation/fs/listing-cache.d.mts +7 -0
- package/foundation/fs/listing-cache.mjs +10 -0
- package/foundation/fs/module-loader.d.mts +24 -2
- package/foundation/fs/module-loader.mjs +94 -21
- package/foundation/fs/paths.d.mts +18 -0
- package/foundation/fs/paths.mjs +15 -2
- package/foundation/identity/provider-identity.d.mts +6 -0
- package/foundation/identity/provider-identity.mjs +10 -1
- package/foundation/integrations/contribution-inventory.mjs +4 -3
- package/foundation/integrations/example-code.d.mts +63 -0
- package/foundation/integrations/example-code.mjs +416 -0
- package/foundation/integrations/public-imports.d.mts +9 -0
- package/foundation/integrations/public-imports.mjs +3 -2
- package/foundation/integrations/validate-contributions.mjs +17 -45
- package/foundation/render/embedded-files.d.mts +6 -0
- package/foundation/render/embedded-files.mjs +25 -5
- package/foundation/render/embedded-imports.d.mts +39 -7
- package/foundation/render/embedded-imports.mjs +66 -27
- package/foundation/render/file-header.d.mts +66 -0
- package/foundation/render/file-header.mjs +118 -0
- package/foundation/render/host-answer.d.mts +18 -0
- package/foundation/render/host-answer.mjs +46 -0
- package/foundation/render/host-exit.d.mts +1 -0
- package/foundation/render/host-exit.mjs +6 -1
- package/foundation/render/html-reader.d.mts +55 -2
- package/foundation/render/html-reader.mjs +145 -26
- package/foundation/render/markup-edits.d.mts +57 -0
- package/foundation/render/markup-edits.mjs +182 -0
- package/foundation/render/page-host.mjs +29 -12
- package/foundation/render/page-worker.mjs +121 -13
- package/foundation/render/picture-chrome.d.mts +4 -0
- package/foundation/render/picture-chrome.mjs +185 -0
- package/foundation/render/picture-playwright.d.mts +4 -0
- package/foundation/render/picture-playwright.mjs +34 -0
- package/foundation/render/rebuild.mjs +2 -1
- package/foundation/render/render-page.d.mts +35 -3
- package/foundation/render/render-page.mjs +316 -42
- package/foundation/render/source-block.d.mts +85 -6
- package/foundation/render/source-block.mjs +211 -20
- package/foundation/render/ts-paths.d.mts +69 -6
- package/foundation/render/ts-paths.mjs +326 -40
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +12 -1
- package/foundation/response/error-codes.mjs +11 -1
- package/foundation/response/response-types.doc.mjs +2 -2
- package/foundation/text/compare-text.d.mts +14 -0
- package/foundation/text/compare-text.mjs +68 -0
- package/foundation/text/string-utils.d.mts +3 -2
- package/foundation/text/string-utils.mjs +18 -4
- package/foundation/text/suggest-order.d.mts +9 -0
- package/foundation/text/suggest-order.mjs +15 -1
- package/foundation/xle/expand.mjs +2 -1
- package/host/index.mjs +8 -6
- package/package.json +7 -6
|
@@ -26,6 +26,7 @@ export function themeFiles(cwd: string, slug: string): {
|
|
|
26
26
|
* files (what `git rm -r` or a branch switch leaves). A path that is not a
|
|
27
27
|
* folder, or one that does not read, is not empty.
|
|
28
28
|
* @param {string} dir
|
|
29
|
+
* @returns {boolean}
|
|
29
30
|
*/
|
|
30
31
|
export function folderIsEmpty(dir: string): boolean;
|
|
31
32
|
/**
|
|
@@ -52,15 +53,15 @@ export function recordWritten(cwd: string, slug: string, files: string[]): void;
|
|
|
52
53
|
*/
|
|
53
54
|
export function editorWrote(cwd: string, slug: string, file: string): boolean;
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* Whether the pictures record names this file and it is unchanged since the
|
|
57
|
+
* editor wrote it. Only such a file is ever deleted: a stamp alone is not
|
|
58
|
+
* enough, since a byte copy of a picture (preview-before.png) carries the
|
|
59
|
+
* same stamp and is the person's.
|
|
59
60
|
* @param {string} cwd
|
|
60
61
|
* @param {string} slug
|
|
61
62
|
* @param {string} file
|
|
62
63
|
*/
|
|
63
|
-
export function
|
|
64
|
+
export function editorRecorded(cwd: string, slug: string, file: string): boolean;
|
|
64
65
|
/**
|
|
65
66
|
* A name `new` takes, for a suggestion: `name` itself when it is valid, not a
|
|
66
67
|
* built-in theme and its folder is free; `my-<name>` for a built-in theme's
|
|
@@ -116,6 +117,12 @@ export function editedThemes(cwd: string, order?: "name" | "changed"): string[];
|
|
|
116
117
|
* @param {number} [n]
|
|
117
118
|
*/
|
|
118
119
|
export function nearest(x: string, list: Iterable<string>, n?: number): string[];
|
|
120
|
+
/**
|
|
121
|
+
* Whether typed words negate what they name (`not round`, `no caps`,
|
|
122
|
+
* `anything but blue`, `unbold`, `non-bold`, `rounded-none`).
|
|
123
|
+
* @param {string} x
|
|
124
|
+
*/
|
|
125
|
+
export function negates(x: string): boolean;
|
|
119
126
|
/**
|
|
120
127
|
* A refusal: nothing was changed, and the suggestions lead with the command
|
|
121
128
|
* that does what the person wanted.
|
|
@@ -147,6 +154,40 @@ export function unlabeledThemeName(s: unknown): string;
|
|
|
147
154
|
* @returns {string}
|
|
148
155
|
*/
|
|
149
156
|
export function typedThemeName(s: unknown): string;
|
|
157
|
+
/**
|
|
158
|
+
* The theme names a name typed the way the app shows it may mean, most
|
|
159
|
+
* likely first: a path with doubled slashes or `../` (`themes//t`), a file
|
|
160
|
+
* name with or without its folder (`brand.theme.ts`, `tTheme.ts`), the app
|
|
161
|
+
* copy's export (`tTheme`), camelCase (`brandDark`) and spaces
|
|
162
|
+
* (`Brand Dark`) each read as dashes. The caller picks the first that
|
|
163
|
+
* exists, else the first.
|
|
164
|
+
* @param {string} s
|
|
165
|
+
* @returns {string[]}
|
|
166
|
+
*/
|
|
167
|
+
export function themeNameReadings(s: string): string[];
|
|
168
|
+
/**
|
|
169
|
+
* A vibrancy written as set reads typed input: a share of one (0.5) or a
|
|
170
|
+
* percent (50%) is that much of the 0-100 scale, as a whole number. Any
|
|
171
|
+
* other dial's value, or a vibrancy that is no such number, comes back as
|
|
172
|
+
* it was.
|
|
173
|
+
* @param {string} dial
|
|
174
|
+
* @param {string} v
|
|
175
|
+
* @returns {string}
|
|
176
|
+
*/
|
|
177
|
+
export function vibrancyMeant(dial: string, v: string): string;
|
|
178
|
+
/**
|
|
179
|
+
* The mode and base a damaged theme file meant, read the way typed input
|
|
180
|
+
* is: other letters, stray spaces, `_` or a space for a dash (`Dark-Only`,
|
|
181
|
+
* ` Neutral`), and a base written as its package name
|
|
182
|
+
* (`@astryxdesign/theme-neutral`). Each is the cleaned text even when it is
|
|
183
|
+
* no value the editor takes; the caller checks it.
|
|
184
|
+
* @param {any} data
|
|
185
|
+
* @returns {{mode: string, like: string}}
|
|
186
|
+
*/
|
|
187
|
+
export function fieldsMeant(data: any): {
|
|
188
|
+
mode: string;
|
|
189
|
+
like: string;
|
|
190
|
+
};
|
|
150
191
|
/**
|
|
151
192
|
* The settings of a theme, or a refusal naming the command that makes it.
|
|
152
193
|
* @param {string} cwd
|
|
@@ -157,6 +198,16 @@ export function typedThemeName(s: unknown): string;
|
|
|
157
198
|
* @returns {ThemeData}
|
|
158
199
|
*/
|
|
159
200
|
export function loadTheme(cwd: string, slug: string, skip?: string | Partial<Setting>): ThemeData;
|
|
201
|
+
/**
|
|
202
|
+
* A command that builds on a built-in theme, as it runs here: after the
|
|
203
|
+
* line that installs that theme's package when the project does not have
|
|
204
|
+
* it, so the first line offered always works.
|
|
205
|
+
* @param {string} cwd
|
|
206
|
+
* @param {string} base a built-in theme
|
|
207
|
+
* @param {string} line the command on that base
|
|
208
|
+
* @returns {string[]}
|
|
209
|
+
*/
|
|
210
|
+
export function onBuiltIn(cwd: string, base: string, line: string): string[];
|
|
160
211
|
/**
|
|
161
212
|
* What is wrong with settings data, or null: its shape, and each value with
|
|
162
213
|
* the same rules `set` checks it by (without the installed Core), so a value
|
|
@@ -167,6 +218,20 @@ export function loadTheme(cwd: string, slug: string, skip?: string | Partial<Set
|
|
|
167
218
|
* @returns {string | null}
|
|
168
219
|
*/
|
|
169
220
|
export function settingsProblem(data: any, skip?: string | Partial<Setting>): string | null;
|
|
221
|
+
/**
|
|
222
|
+
* What loading read differently from the file in the theme's entries (a
|
|
223
|
+
* mode or source in other letters, a missing source): one note each.
|
|
224
|
+
* @param {object} data the theme as {@link loadTheme} returned it
|
|
225
|
+
* @returns {string[]}
|
|
226
|
+
*/
|
|
227
|
+
export function entryNotes(data: object): string[];
|
|
228
|
+
/**
|
|
229
|
+
* Which part of an entry means nothing after reading: its source, mode or
|
|
230
|
+
* `only`, or null.
|
|
231
|
+
* @param {any} s
|
|
232
|
+
* @returns {'mode' | 'source' | 'only' | null}
|
|
233
|
+
*/
|
|
234
|
+
export function entryDamage(s: any): "mode" | "source" | "only" | null;
|
|
170
235
|
/**
|
|
171
236
|
* Every setting whose only problem is its value or scope, each with the
|
|
172
237
|
* command that removes it.
|
|
@@ -179,6 +244,13 @@ export function badSettings(data: any): Setting[];
|
|
|
179
244
|
* @param {import('./_settings.mjs').Setting} x
|
|
180
245
|
*/
|
|
181
246
|
export function undoArgs(x: import("./_settings.mjs").Setting): string;
|
|
247
|
+
/**
|
|
248
|
+
* The words of a `set` that gives a setting's scope a value: set reads a
|
|
249
|
+
* headings half from its word, so no half is named.
|
|
250
|
+
* @param {import('./_settings.mjs').Setting} x
|
|
251
|
+
* @param {string} value
|
|
252
|
+
*/
|
|
253
|
+
export function setArgs(x: import("./_settings.mjs").Setting, value: string): string;
|
|
182
254
|
/**
|
|
183
255
|
* The first setting whose only problem is its value (made under looser
|
|
184
256
|
* rules): `undo <theme> <undoArgs>` removes it.
|
|
@@ -202,6 +274,23 @@ export function withoutBadValues(data: ThemeData): {
|
|
|
202
274
|
* @returns {string | null}
|
|
203
275
|
*/
|
|
204
276
|
export function valueProblem(s: any): string | null;
|
|
277
|
+
/**
|
|
278
|
+
* One entry of the top-level `tokens` map in a theme's own source, as
|
|
279
|
+
* written: its token (null for a computed key no read of the file can
|
|
280
|
+
* resolve), the key as typed, the line that sets it, and its value's shape.
|
|
281
|
+
* A `duplicate` entry names a second `tokens` key (with every line); a
|
|
282
|
+
* `typography` entry is one typography field (its dotted key and value);
|
|
283
|
+
* an `unresolved` entry says the map holds something only a build reads.
|
|
284
|
+
* @typedef {{token: string | null, key: string, line: number | null, kind: 'text' | 'number' | 'pair' | 'object' | 'other' | 'duplicate' | 'typography' | 'unresolved', value?: any, halves?: Array<string | number | undefined>, lines?: Array<number | null>, file?: string, overridden?: boolean, expression?: boolean, notToken?: boolean}} OwnTokenEntry
|
|
285
|
+
*/
|
|
286
|
+
/**
|
|
287
|
+
* The entries of the top-level `tokens` map in a theme's own source, read
|
|
288
|
+
* from its syntax tree, each with the line that sets it.
|
|
289
|
+
* @param {string} cwd
|
|
290
|
+
* @param {string} slug
|
|
291
|
+
* @returns {OwnTokenEntry[]}
|
|
292
|
+
*/
|
|
293
|
+
export function ownTokenEntries(cwd: string, slug: string): OwnTokenEntry[];
|
|
205
294
|
/**
|
|
206
295
|
* The tokens a base theme's own component rules for a part read through
|
|
207
296
|
* var() (neutral's progress-bar reads --color-border-emphasized), from its
|
|
@@ -232,6 +321,17 @@ export function baseTopTokens(cwd: string, like: string | null | undefined): Map
|
|
|
232
321
|
* @returns {Map<string, string | null>}
|
|
233
322
|
*/
|
|
234
323
|
export function partRuleTokens(cwd: string, slug: string, like: string | null | undefined, part: string): Map<string, string | null>;
|
|
324
|
+
/**
|
|
325
|
+
* Whether the base theme's own source gives a part's rule a property, in a
|
|
326
|
+
* state (`:hover`) or at rest, read from its module as written.
|
|
327
|
+
* @param {string} cwd
|
|
328
|
+
* @param {string | undefined} like
|
|
329
|
+
* @param {string} part
|
|
330
|
+
* @param {string} scope `base` or a variant such as `variant:secondary`
|
|
331
|
+
* @param {string | null} state a state block (`:hover`), or null
|
|
332
|
+
* @param {string} prop camelCase
|
|
333
|
+
*/
|
|
334
|
+
export function baseRuleHas(cwd: string, like: string | undefined, part: string, scope: string, state: string | null, prop: string): boolean;
|
|
235
335
|
/**
|
|
236
336
|
* The tokens and properties a theme's own source sets on a part's plain
|
|
237
337
|
* rule, read from the build as ownTokens reads page-wide ones: what the
|
|
@@ -279,6 +379,14 @@ export function partsOf(ctx: Ctx, s: Pick<Setting, "on" | "only" | "thing">): st
|
|
|
279
379
|
* @returns {number | null}
|
|
280
380
|
*/
|
|
281
381
|
export function lengthPx(v: string): number | null;
|
|
382
|
+
/**
|
|
383
|
+
* The base theme's body text size in px, read back from its built base
|
|
384
|
+
* size (14 when it writes none).
|
|
385
|
+
* @param {{light: Record<string, string>}} base
|
|
386
|
+
*/
|
|
387
|
+
export function baseTextPx(base: {
|
|
388
|
+
light: Record<string, string>;
|
|
389
|
+
}): number;
|
|
282
390
|
/**
|
|
283
391
|
* The family and fallbacks a font value means: a preset, an open font, a
|
|
284
392
|
* whole stack with commas, or one family name.
|
|
@@ -342,6 +450,27 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
|
|
|
342
450
|
stop: number;
|
|
343
451
|
alpha?: string;
|
|
344
452
|
}>>;
|
|
453
|
+
/**
|
|
454
|
+
* A size in px: px, rem (16px each), or a calc() of those added and
|
|
455
|
+
* subtracted; null for anything else.
|
|
456
|
+
* @param {string} v
|
|
457
|
+
* @param {Record<string, string>} [vars] values for the tokens a var() may name
|
|
458
|
+
* @returns {number | null}
|
|
459
|
+
*/
|
|
460
|
+
export function sizePx(v: string, vars?: Record<string, string>): number | null;
|
|
461
|
+
/**
|
|
462
|
+
* Spacing steps scaled with the spacing dial, kept in order around the
|
|
463
|
+
* steps the theme keeps exact: each the plain scaled value unless it would
|
|
464
|
+
* meet or pass a kept one; those are spread evenly between the kept one and
|
|
465
|
+
* the nearest step that keeps its place. A step with no room below a kept
|
|
466
|
+
* one takes the value of the one below it.
|
|
467
|
+
* @param {Array<[string, number]>} steps token name and the base value, in px
|
|
468
|
+
* @param {number} f the rung's factor
|
|
469
|
+
* @param {Record<string, number>} kept exact steps the theme keeps, in px
|
|
470
|
+
* @param {string[]} [noRoom] filled with the steps left no room
|
|
471
|
+
* @returns {Array<[string, number]>} every step's new value in px, kept ones as kept
|
|
472
|
+
*/
|
|
473
|
+
export function spacingSteps(steps: Array<[string, number]>, f: number, kept: Record<string, number>, noRoom?: string[]): Array<[string, number]>;
|
|
345
474
|
/**
|
|
346
475
|
* Control heights scaled with the spacing dial (a denser theme has shorter
|
|
347
476
|
* controls), each kept distinct and in order: smallest to largest, a
|
|
@@ -351,9 +480,13 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
|
|
|
351
480
|
* scaled above it.
|
|
352
481
|
* @param {Array<[string, string]>} sizes token name and the theme's value
|
|
353
482
|
* @param {number} f the spacing rung's factor
|
|
483
|
+
* @param {Record<string, number>} [kept] exact sizes the theme keeps, in px,
|
|
484
|
+
* which the others stay in order around
|
|
485
|
+
* @param {string[]} [noRoom] filled with the sizes left no room between
|
|
486
|
+
* two kept ones (each then equals the one below it)
|
|
354
487
|
* @returns {Array<[string, string]>} the tokens it writes, in px
|
|
355
488
|
*/
|
|
356
|
-
export function controlSizes(sizes: Array<[string, string]>, f: number): Array<[string, string]>;
|
|
489
|
+
export function controlSizes(sizes: Array<[string, string]>, f: number, kept?: Record<string, number>, noRoom?: string[]): Array<[string, string]>;
|
|
357
490
|
/**
|
|
358
491
|
* The settings, as a `defineTheme` object.
|
|
359
492
|
* @param {Ctx} ctx
|
|
@@ -365,6 +498,27 @@ export function compileTheme(ctx: Ctx, data: ThemeData, base: {
|
|
|
365
498
|
light: Record<string, string>;
|
|
366
499
|
dark: Record<string, string>;
|
|
367
500
|
}): any;
|
|
501
|
+
/**
|
|
502
|
+
* A background's layers with each color painted in one mode only: a color
|
|
503
|
+
* stop becomes light-dark(<color>, transparent) for light (the reverse for
|
|
504
|
+
* dark), and a layer that is a color alone becomes a gradient of it, so
|
|
505
|
+
* every layer is an image the other mode does not show.
|
|
506
|
+
* @param {string} value
|
|
507
|
+
* @param {'light' | 'dark'} mode
|
|
508
|
+
* @returns {string[]}
|
|
509
|
+
*/
|
|
510
|
+
export function maskLayers(value: string, mode: "light" | "dark"): string[];
|
|
511
|
+
/**
|
|
512
|
+
* A background shorthand split into its image layers and the color its
|
|
513
|
+
* last layer may carry (the color under every image): a color word beside
|
|
514
|
+
* the last image, or a last layer that is a color alone.
|
|
515
|
+
* @param {string} value
|
|
516
|
+
* @returns {{images: string, color: string | null}}
|
|
517
|
+
*/
|
|
518
|
+
export function backgroundColorLayer(value: string): {
|
|
519
|
+
images: string;
|
|
520
|
+
color: string | null;
|
|
521
|
+
};
|
|
368
522
|
/**
|
|
369
523
|
* Settings whose effect a later or stronger setting hides, with why: `type`
|
|
370
524
|
* loses heading weight and tracking to `headings`.
|
|
@@ -379,23 +533,26 @@ export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting,
|
|
|
379
533
|
* {font-weight}`. Find those rules in the built stylesheet.
|
|
380
534
|
* @param {string} cssText
|
|
381
535
|
* @param {any} theme
|
|
382
|
-
* @returns {Array<{target: string, key: string, prop: string, value: string}>}
|
|
536
|
+
* @returns {Array<{target: string, key: string, prop: string, value: string, state?: string}>}
|
|
383
537
|
*/
|
|
384
538
|
export function findOverrides(cssText: string, theme: any): Array<{
|
|
385
539
|
target: string;
|
|
386
540
|
key: string;
|
|
387
541
|
prop: string;
|
|
388
542
|
value: string;
|
|
543
|
+
state?: string;
|
|
389
544
|
}>;
|
|
390
545
|
/**
|
|
391
|
-
* Why
|
|
392
|
-
*
|
|
393
|
-
*
|
|
546
|
+
* Why a theme's source cannot carry its settings, or null when it carries
|
|
547
|
+
* them. The theme is the export a build of the source reads, loaded as the
|
|
548
|
+
* build loads it: it must be named for the theme, and its definition must
|
|
549
|
+
* extend the settings imported from ./<slug>.settings. Null for a source
|
|
550
|
+
* that does not parse: its parse error is its own finding.
|
|
394
551
|
* @param {string} cwd
|
|
395
552
|
* @param {string} slug
|
|
396
|
-
* @returns {string | null}
|
|
553
|
+
* @returns {Promise<string | null>}
|
|
397
554
|
*/
|
|
398
|
-
export function themeSourceProblem(cwd: string, slug: string): string | null
|
|
555
|
+
export function themeSourceProblem(cwd: string, slug: string): Promise<string | null>;
|
|
399
556
|
/**
|
|
400
557
|
* Why the person's own theme source does not parse (its line and the
|
|
401
558
|
* parser's message), or null when it parses or is not there.
|
|
@@ -418,24 +575,45 @@ export function refuseThemeParse(cwd: string, slug: string): void;
|
|
|
418
575
|
* @param {string} cwd
|
|
419
576
|
* @param {string} slug
|
|
420
577
|
*/
|
|
421
|
-
export function refuseThemeSource(cwd: string, slug: string): void
|
|
578
|
+
export function refuseThemeSource(cwd: string, slug: string): Promise<void>;
|
|
422
579
|
/**
|
|
423
|
-
* The
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
580
|
+
* The refusal for a theme source that cannot carry the settings (it no
|
|
581
|
+
* longer imports or extends them, or names another theme), naming the
|
|
582
|
+
* lines that put it back; null when it carries them. Every command that
|
|
583
|
+
* builds the theme refuses with it.
|
|
584
|
+
* @param {string} cwd
|
|
585
|
+
* @param {string} slug
|
|
586
|
+
* @returns {Promise<AstryxError | null>}
|
|
587
|
+
*/
|
|
588
|
+
export function themeSourceRefusal(cwd: string, slug: string): Promise<AstryxError | null>;
|
|
589
|
+
/**
|
|
590
|
+
* What a build made now writes for a theme: its own page-wide tokens (see
|
|
591
|
+
* builtOwnTokens), every top-level token, and the typography it was given
|
|
592
|
+
* (evaluated: an import or an expression is its value). Null when it does
|
|
593
|
+
* not build in the project's cache folder.
|
|
428
594
|
* @param {Ctx} ctx
|
|
429
595
|
* @param {string} slug
|
|
430
|
-
* @
|
|
596
|
+
* @param {string | null} like the base theme, whose built tokens are `base`
|
|
597
|
+
* @returns {Promise<{own: Map<string, string | null>, tops: Map<string, string | null>, base: Map<string, string | null>, shapes: Map<string, BuiltShape>, typography: any} | null>}
|
|
431
598
|
*/
|
|
432
|
-
export function
|
|
599
|
+
export function evaluatedTheme(ctx: Ctx, slug: string, like: string | null): Promise<{
|
|
600
|
+
own: Map<string, string | null>;
|
|
601
|
+
tops: Map<string, string | null>;
|
|
602
|
+
base: Map<string, string | null>;
|
|
603
|
+
shapes: Map<string, BuiltShape>;
|
|
604
|
+
typography: any;
|
|
605
|
+
} | null>;
|
|
433
606
|
/**
|
|
434
607
|
* The refusal of a [light, dark] pair on tokens that are not colors.
|
|
435
608
|
* @param {string} slug
|
|
436
609
|
* @param {string[]} names
|
|
437
610
|
*/
|
|
438
611
|
export function ownPairMessage(slug: string, names: string[]): string;
|
|
612
|
+
/**
|
|
613
|
+
* Set the check of a theme's own token values run before every build.
|
|
614
|
+
* @param {((ctx: Ctx, slug: string, data: ThemeData) => Promise<void>) | null} fn
|
|
615
|
+
*/
|
|
616
|
+
export function setOwnTokenCheck(fn: ((ctx: Ctx, slug: string, data: ThemeData) => Promise<void>) | null): void;
|
|
439
617
|
/**
|
|
440
618
|
* Set what runs after every build of a theme.
|
|
441
619
|
* @param {((ctx: Ctx, slug: string, data: ThemeData) => void) | null} fn
|
|
@@ -460,6 +638,15 @@ export function buildTheme(ctx: Ctx, slug: string, data: ThemeData): Promise<{
|
|
|
460
638
|
lifted: string[];
|
|
461
639
|
notes: string[];
|
|
462
640
|
}>;
|
|
641
|
+
/**
|
|
642
|
+
* The one color mode of a light-only or dark-only theme, from its settings,
|
|
643
|
+
* for the build to write into the built module (`colorModes`); null for a
|
|
644
|
+
* theme with both modes.
|
|
645
|
+
* @param {string} cwd
|
|
646
|
+
* @param {string} slug
|
|
647
|
+
* @returns {['light'] | ['dark'] | null}
|
|
648
|
+
*/
|
|
649
|
+
export function buildColorModes(cwd: string, slug: string): ["light"] | ["dark"] | null;
|
|
463
650
|
/**
|
|
464
651
|
* Why the built outputs differ from what the theme builds now: one that is
|
|
465
652
|
* missing or changed by hand, found the way `compile --check` finds it
|
|
@@ -479,6 +666,14 @@ export function resolvedTokens(ctx: Ctx, slug: string): Promise<{
|
|
|
479
666
|
light: Record<string, string>;
|
|
480
667
|
dark: Record<string, string>;
|
|
481
668
|
}>;
|
|
669
|
+
/**
|
|
670
|
+
* Why a token value is not one, with a value of the token's own type to
|
|
671
|
+
* write instead (a size in px, a weight as a number in quotes), or none.
|
|
672
|
+
* @param {Ctx} ctx
|
|
673
|
+
* @param {string} slug
|
|
674
|
+
* @param {[string, unknown, ('object' | 'pair' | 'unit' | 'value' | 'mode')?]} bad
|
|
675
|
+
*/
|
|
676
|
+
export function nonTextMessage(ctx: Ctx, slug: string, [name, value, kind]: [string, unknown, ("object" | "pair" | "unit" | "value" | "mode")?]): string;
|
|
482
677
|
/**
|
|
483
678
|
* Contrast problems this theme caused: text below 4.5:1 that was not as low
|
|
484
679
|
* in the base theme. A part's own color or background setting, or a token
|
|
@@ -493,8 +688,52 @@ export function contrastProblems(ctx: Ctx, data: ThemeData, res: {
|
|
|
493
688
|
dark: Record<string, string>;
|
|
494
689
|
}): Promise<string[]>;
|
|
495
690
|
/**
|
|
496
|
-
*
|
|
497
|
-
*
|
|
691
|
+
* A settings file's or an undo step's text as JSON, a byte-order mark
|
|
692
|
+
* aside; undefined when there is no text or it does not parse. Every reader
|
|
693
|
+
* of settings text reads it here.
|
|
694
|
+
* @param {string | null | undefined} text
|
|
695
|
+
* @returns {any}
|
|
696
|
+
*/
|
|
697
|
+
export function settingsJson(text: string | null | undefined): any;
|
|
698
|
+
/**
|
|
699
|
+
* Whether settings data has its shape and every entry is an object with a
|
|
700
|
+
* thing name: what a reader may go through entry by entry. Any other entry
|
|
701
|
+
* (null, a number, text) is damage the file check names.
|
|
702
|
+
* @param {any} data
|
|
703
|
+
*/
|
|
704
|
+
export function entriesReadable(data: any): any;
|
|
705
|
+
/**
|
|
706
|
+
* Read a damaged mode or base the way a change reads it, in place: one
|
|
707
|
+
* written in other letters or as a package name (`Dark-Only`,
|
|
708
|
+
* `@astryxdesign/theme-neutral`) is the value meant; any other goes back to
|
|
709
|
+
* its default. `like: "none"` is no base. The field a command sets itself
|
|
710
|
+
* is left to that command.
|
|
711
|
+
* @param {any} data
|
|
712
|
+
* @param {string} cwd
|
|
713
|
+
* @param {string} [fixing] `mode` or `base` when the command sets it
|
|
714
|
+
* @returns {string[]} a note for each field read differently from the file
|
|
715
|
+
*/
|
|
716
|
+
export function readFields(data: any, cwd: string, fixing?: string): string[];
|
|
717
|
+
/**
|
|
718
|
+
* Read settings data as a change reads it, in place: entry modes and
|
|
719
|
+
* sources in other words, and a damaged mode or base (see
|
|
720
|
+
* {@link readFields}). The settings file and every undo step are read
|
|
721
|
+
* through here.
|
|
722
|
+
* @param {any} data
|
|
723
|
+
* @param {string} cwd
|
|
724
|
+
* @param {string} [fixing] `mode` or `base` when the command sets it
|
|
725
|
+
* @returns {string[]} a note for each thing read differently from the text
|
|
726
|
+
*/
|
|
727
|
+
export function readAsMeant(data: any, cwd: string, fixing?: string): string[];
|
|
728
|
+
/**
|
|
729
|
+
* Whether every settings entry has the parts the editor reads (a thing, a
|
|
730
|
+
* value and a source); one without is damage `new` keeps aside.
|
|
731
|
+
* @param {any} data
|
|
732
|
+
*/
|
|
733
|
+
export function settingsEntriesOk(data: any): any;
|
|
734
|
+
/**
|
|
735
|
+
* Whether settings data has the shape the editor reads: an object with a
|
|
736
|
+
* settings list.
|
|
498
737
|
* @param {any} data
|
|
499
738
|
*/
|
|
500
739
|
export function settingsShapeOk(data: any): boolean;
|
|
@@ -525,6 +764,15 @@ export function baseComponent(base: {
|
|
|
525
764
|
* @returns {string | null}
|
|
526
765
|
*/
|
|
527
766
|
export function focusStateOf(ctx: Ctx, part: string): string | null;
|
|
767
|
+
/**
|
|
768
|
+
* The parts that draw a part's corners: the part itself, or, when Core gives
|
|
769
|
+
* it no radius of its own, the parts inside it that it has (a date-time
|
|
770
|
+
* input's date and time boxes).
|
|
771
|
+
* @param {Ctx} ctx
|
|
772
|
+
* @param {string} part
|
|
773
|
+
* @returns {string[]}
|
|
774
|
+
*/
|
|
775
|
+
export function cornerParts(ctx: Ctx, part: string): string[];
|
|
528
776
|
/**
|
|
529
777
|
* The radius token a part's resting corners read. A part the census saw
|
|
530
778
|
* closed (a menu, a popover) has none recorded: a container or menu reads
|
|
@@ -555,6 +803,21 @@ export function clearNewMarker(dir: string): void;
|
|
|
555
803
|
* @returns {string}
|
|
556
804
|
*/
|
|
557
805
|
export function stateKey(state: string, wrapsControl?: boolean): string;
|
|
806
|
+
/**
|
|
807
|
+
* The text color tokens Core's elements inside a part read for their own
|
|
808
|
+
* color (a top nav heading's title span reads --color-text-primary itself),
|
|
809
|
+
* so a color set on the part never reaches that text. Only the main and
|
|
810
|
+
* supporting text colors count: the disabled, placeholder and accent ones
|
|
811
|
+
* mark a state or a role, not the part's text. With `deep`, the parts inside
|
|
812
|
+
* it count too (a top nav's heading and items).
|
|
813
|
+
* @param {{MAP: Record<string, any>}} C
|
|
814
|
+
* @param {string} part
|
|
815
|
+
* @param {boolean} [deep]
|
|
816
|
+
* @returns {string[]}
|
|
817
|
+
*/
|
|
818
|
+
export function innerTextTokens(C: {
|
|
819
|
+
MAP: Record<string, any>;
|
|
820
|
+
}, part: string, deep?: boolean): string[];
|
|
558
821
|
/**
|
|
559
822
|
* The component docs of a part: its own component's, and the one named like
|
|
560
823
|
* the part (tab is Tab, under TabList), each with its name, for the ones the
|
|
@@ -676,18 +939,36 @@ export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history,
|
|
|
676
939
|
notes: string[];
|
|
677
940
|
unchanged: boolean;
|
|
678
941
|
}>;
|
|
679
|
-
/**
|
|
942
|
+
/**
|
|
943
|
+
* The @fontsource package named for a font family (`Open Sans` is
|
|
944
|
+
* `@fontsource/open-sans`).
|
|
945
|
+
* @param {string} family
|
|
946
|
+
* @returns {string}
|
|
947
|
+
*/
|
|
948
|
+
export function fontsourcePackageOf(family: string): string;
|
|
949
|
+
/**
|
|
950
|
+
* The font families the theme's last build names (its
|
|
951
|
+
* `--font-family-*` declarations), by lowercase name; null before the
|
|
952
|
+
* theme has been built.
|
|
953
|
+
* @param {Ctx} ctx
|
|
954
|
+
* @param {string} slug
|
|
955
|
+
* @returns {Map<string, string> | null}
|
|
956
|
+
*/
|
|
957
|
+
export function builtFontFamilies(ctx: Ctx, slug: string): Map<string, string> | null;
|
|
958
|
+
/**
|
|
959
|
+
* The font packages that load the families the theme builds: a font
|
|
960
|
+
* setting's package while the build still uses its family, and the
|
|
961
|
+
* installed @fontsource package of a family the theme's own source sets.
|
|
962
|
+
* Font notes, the previews and the app copy all load fonts from this list.
|
|
963
|
+
* @param {Ctx} ctx
|
|
964
|
+
* @param {ThemeData} data
|
|
965
|
+
*/
|
|
680
966
|
export function fontPackages(ctx: Ctx, data: ThemeData): {
|
|
681
967
|
pkg: string;
|
|
682
968
|
family: string;
|
|
683
969
|
installed: boolean;
|
|
684
|
-
of: Setting;
|
|
970
|
+
of: Setting | null;
|
|
685
971
|
}[];
|
|
686
|
-
/** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null, derived?: Record<string, Array<{property: string, vars?: string[], replaces?: boolean, expand?: string}>>}} Ctx */
|
|
687
|
-
/** @typedef {import('./_parts.mjs').PaintSide} PaintSide */
|
|
688
|
-
/** @typedef {import('./_parts.mjs').TextPair} TextPair */
|
|
689
|
-
/** What a theme name may be, in words. */
|
|
690
|
-
export const NAME_RULE: "lowercase letters, digits and dashes, starting with a letter, 64 characters at most, and not a name Windows reserves (con, prn, aux, nul, com1-com9, lpt1-lpt9)";
|
|
691
972
|
export function slugOk(s: string): boolean;
|
|
692
973
|
export function windowsReserved(s: string): boolean;
|
|
693
974
|
export function slugFor(name: unknown): string;
|
|
@@ -702,6 +983,8 @@ export function textPx(v: string): number;
|
|
|
702
983
|
/** The type tokens base themes set again for phones: families and weights. */
|
|
703
984
|
export const PHONE_TYPE: RegExp;
|
|
704
985
|
export function themeSource(slug: string): string;
|
|
986
|
+
/** The radius tokens the corners dial moves. */
|
|
987
|
+
export const DIAL_RADII: string[];
|
|
705
988
|
/** The file a `new` keeps beside the files it writes until it is done. */
|
|
706
989
|
export const NEW_MARKER: ".astryx-new.json";
|
|
707
990
|
/**
|
|
@@ -713,6 +996,36 @@ export const EDITOR_SUFFIXES: string[];
|
|
|
713
996
|
export function isEditorFile(slug: string, n: string): boolean;
|
|
714
997
|
/** The undo steps a theme keeps; older ones are dropped. */
|
|
715
998
|
export const HISTORY_STEPS: 80;
|
|
999
|
+
/**
|
|
1000
|
+
* One entry of the top-level `tokens` map in a theme's own source, as
|
|
1001
|
+
* written: its token (null for a computed key no read of the file can
|
|
1002
|
+
* resolve), the key as typed, the line that sets it, and its value's shape.
|
|
1003
|
+
* A `duplicate` entry names a second `tokens` key (with every line); a
|
|
1004
|
+
* `typography` entry is one typography field (its dotted key and value);
|
|
1005
|
+
* an `unresolved` entry says the map holds something only a build reads.
|
|
1006
|
+
*/
|
|
1007
|
+
export type OwnTokenEntry = {
|
|
1008
|
+
token: string | null;
|
|
1009
|
+
key: string;
|
|
1010
|
+
line: number | null;
|
|
1011
|
+
kind: "text" | "number" | "pair" | "object" | "other" | "duplicate" | "typography" | "unresolved";
|
|
1012
|
+
value?: any;
|
|
1013
|
+
halves?: Array<string | number | undefined>;
|
|
1014
|
+
lines?: Array<number | null>;
|
|
1015
|
+
file?: string;
|
|
1016
|
+
overridden?: boolean;
|
|
1017
|
+
expression?: boolean;
|
|
1018
|
+
notToken?: boolean;
|
|
1019
|
+
};
|
|
1020
|
+
/**
|
|
1021
|
+
* What a built module writes for a top-level token: text, a number, an
|
|
1022
|
+
* object, a pair (each half), or something else.
|
|
1023
|
+
*/
|
|
1024
|
+
export type BuiltShape = {
|
|
1025
|
+
kind: "text" | "number" | "object" | "pair" | "other";
|
|
1026
|
+
value?: any;
|
|
1027
|
+
halves?: unknown[];
|
|
1028
|
+
};
|
|
716
1029
|
/**
|
|
717
1030
|
* One setting the CLI owns.
|
|
718
1031
|
*/
|
|
@@ -777,6 +1090,8 @@ export type Ctx = {
|
|
|
777
1090
|
alpha?: string;
|
|
778
1091
|
}>> | null;
|
|
779
1092
|
keepRadii?: Record<string, string> | null;
|
|
1093
|
+
sizeNotes?: string[];
|
|
1094
|
+
compileNotes?: string[];
|
|
780
1095
|
derived?: Record<string, Array<{
|
|
781
1096
|
property: string;
|
|
782
1097
|
vars?: string[];
|
|
@@ -786,6 +1101,8 @@ export type Ctx = {
|
|
|
786
1101
|
};
|
|
787
1102
|
export type PaintSide = import("./_parts.mjs").PaintSide;
|
|
788
1103
|
export type TextPair = import("./_parts.mjs").TextPair;
|
|
1104
|
+
import { AstryxError } from '../error.mjs';
|
|
1105
|
+
import { NAME_RULE } from './_name-rule.mjs';
|
|
789
1106
|
import { modesOf } from './_palette.mjs';
|
|
790
1107
|
/**
|
|
791
1108
|
* What a part reads for a property when the theme does not set it, so a
|
|
@@ -797,4 +1114,4 @@ import { modesOf } from './_palette.mjs';
|
|
|
797
1114
|
* @param {string} [state] a state (hover): that state's own value
|
|
798
1115
|
*/
|
|
799
1116
|
export function partDefault(ctx: Ctx, target: string, prop: string, when: string | undefined, state?: string): string | null;
|
|
800
|
-
export { modesOf };
|
|
1117
|
+
export { NAME_RULE, modesOf };
|