@astryxdesign/cli 0.7.16 → 0.7.17-canary.g16fe6a8
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 +28 -2
- package/api/docs/_adapter.mjs +249 -10
- 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 +132 -1
- package/api/theme/build/build.mjs +482 -157
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +10 -0
- package/api/theme/build/font-warning.d.mts +44 -5
- package/api/theme/build/font-warning.mjs +118 -10
- package/api/theme/build/icon-imports.mjs +51 -9
- package/api/theme/theme.type.d.mts +10 -0
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme-edit/_adapter.d.mts +115 -4
- package/api/theme-edit/_adapter.mjs +997 -83
- package/api/theme-edit/_catalog.d.mts +20 -2
- package/api/theme-edit/_catalog.mjs +50 -10
- package/api/theme-edit/_check.d.mts +75 -24
- package/api/theme-edit/_check.mjs +2672 -422
- package/api/theme-edit/_color.d.mts +10 -0
- package/api/theme-edit/_color.mjs +54 -1
- package/api/theme-edit/_compiler.d.mts +1 -0
- package/api/theme-edit/_compiler.mjs +133 -15
- package/api/theme-edit/_context.d.mts +14 -3
- package/api/theme-edit/_context.mjs +225 -65
- package/api/theme-edit/_css.d.mts +14 -0
- package/api/theme-edit/_css.mjs +46 -1
- package/api/theme-edit/_edit.d.mts +54 -4
- package/api/theme-edit/_edit.mjs +2966 -286
- package/api/theme-edit/_how-commands.d.mts +72 -1
- package/api/theme-edit/_how-commands.mjs +770 -9
- package/api/theme-edit/_how-question.d.mts +82 -5
- package/api/theme-edit/_how-question.mjs +6983 -701
- package/api/theme-edit/_how.d.mts +2 -1
- package/api/theme-edit/_how.mjs +237 -41
- package/api/theme-edit/_importers.d.mts +38 -0
- package/api/theme-edit/_importers.mjs +188 -0
- 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 +303 -0
- package/api/theme-edit/_normal.mjs +1517 -0
- package/api/theme-edit/_palette.d.mts +12 -0
- package/api/theme-edit/_palette.mjs +37 -4
- package/api/theme-edit/_part-words.d.mts +31 -0
- package/api/theme-edit/_part-words.mjs +126 -0
- package/api/theme-edit/_parts.d.mts +28 -2
- package/api/theme-edit/_parts.mjs +267 -31
- package/api/theme-edit/_preview-app.d.mts +7 -13
- package/api/theme-edit/_preview-app.mjs +814 -406
- package/api/theme-edit/_preview.d.mts +116 -16
- package/api/theme-edit/_preview.mjs +649 -152
- package/api/theme-edit/_project.d.mts +22 -1
- package/api/theme-edit/_project.mjs +83 -3
- package/api/theme-edit/_settings.d.mts +467 -42
- package/api/theme-edit/_settings.mjs +3527 -468
- package/api/theme-edit/_tables.d.mts +21 -0
- package/api/theme-edit/_tables.mjs +97 -3
- package/api/theme-edit/_vet.d.mts +31 -0
- package/api/theme-edit/_vet.mjs +114 -8
- package/api/theme-edit/theme-edit.type.d.mts +16 -2
- package/api/theme-edit/theme-edit.type.mjs +6 -3
- 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/share-a-page.doc.mjs +157 -0
- 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 +5 -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 +573 -119
- 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 +2 -2
- 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 +718 -438
- 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 +132 -24
- 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/core-component-docs.d.mts +29 -0
- package/foundation/discovery/core-component-docs.mjs +83 -0
- 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 +53 -1
- package/foundation/discovery/template-adapter.mjs +176 -12
- package/foundation/discovery/template-icons.mjs +2 -1
- package/foundation/discovery/theme-discovery.mjs +31 -4
- package/foundation/discovery/theme-imports.d.mts +14 -0
- package/foundation/discovery/theme-imports.mjs +43 -1
- package/foundation/discovery/theming-targets.d.mts +6 -5
- package/foundation/discovery/theming-targets.mjs +31 -47
- 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 +38 -0
- package/foundation/fonts/font-stylesheet.mjs +141 -0
- package/foundation/fs/cache-eviction.d.mts +21 -0
- package/foundation/fs/cache-eviction.mjs +73 -0
- package/foundation/fs/exact-codec.d.mts +12 -2
- package/foundation/fs/exact-codec.mjs +23 -6
- package/foundation/fs/file-protection.mjs +4 -3
- package/foundation/fs/gather-cache.d.mts +62 -4
- package/foundation/fs/gather-cache.mjs +517 -91
- 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/fs/read-record.d.mts +9 -0
- package/foundation/fs/read-record.mjs +19 -11
- package/foundation/fs/stop-cleanup.d.mts +12 -0
- package/foundation/fs/stop-cleanup.mjs +66 -0
- 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 +641 -96
- 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/css-escape.d.mts +18 -0
- package/foundation/text/css-escape.mjs +35 -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
|
@@ -53,6 +53,18 @@ export function paletteFiles(slug: string): {
|
|
|
53
53
|
* @param {string} value
|
|
54
54
|
*/
|
|
55
55
|
export function seedOf(value: string): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Whether a color dial's seed comes out different at two vibrancies: the
|
|
58
|
+
* ramp the generator grows from it, light and dark, compared shade by
|
|
59
|
+
* shade. A seed with no saturation to change (a pure gray) gives the same
|
|
60
|
+
* ramp at every vibrancy. A gray-ish seed is grown as the editor grows it
|
|
61
|
+
* (a neutral), so a warm or cool gray counts by what it shows.
|
|
62
|
+
* @param {string} dial
|
|
63
|
+
* @param {string | null} seed
|
|
64
|
+
* @param {number} from
|
|
65
|
+
* @param {number} to
|
|
66
|
+
*/
|
|
67
|
+
export function vibrancyMoves(dial: string, seed: string | null, from: number, to: number): boolean;
|
|
56
68
|
/**
|
|
57
69
|
* The modes a theme has: one for a one-mode theme, else light and dark.
|
|
58
70
|
* @param {{mode?: string}} data
|
|
@@ -156,7 +156,11 @@ function sweepTemps(dir) {
|
|
|
156
156
|
}
|
|
157
157
|
continue;
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
// A picture taken under its own name (`.<picture>.part-<pid>.png`) by a
|
|
160
|
+
// run stopped while the browser ran.
|
|
161
|
+
const m =
|
|
162
|
+
/^\..+\.astryx-(\d+)-[a-z0-9]+\.tmp$/.exec(n) ??
|
|
163
|
+
/^\.[\w-]+\.part-(\d+)\.png$/.exec(n);
|
|
160
164
|
if (!m) continue;
|
|
161
165
|
const p = path.join(dir, n);
|
|
162
166
|
try {
|
|
@@ -203,12 +207,14 @@ export function removeEmptyFolder(dir, opts = {}) {
|
|
|
203
207
|
|
|
204
208
|
/**
|
|
205
209
|
* Whether a file name is one of the editor's own temp files: a whole-file
|
|
206
|
-
* write's `.<name>.astryx-<pid>-<random>.tmp`,
|
|
207
|
-
* `.<
|
|
210
|
+
* write's `.<name>.astryx-<pid>-<random>.tmp`, a build's `.<name>.tmp-<id>`,
|
|
211
|
+
* or a picture's `.<picture>.part-<pid>.png`. A command stopped part way can
|
|
212
|
+
* leave one behind.
|
|
208
213
|
* @param {string} name
|
|
209
214
|
*/
|
|
210
215
|
export const isEditorTemp = name =>
|
|
211
|
-
/^\..+\.(astryx-\d+-[a-z0-9]+\.tmp|tmp-[\w-]+)$/.test(name)
|
|
216
|
+
/^\..+\.(astryx-\d+-[a-z0-9]+\.tmp|tmp-[\w-]+)$/.test(name) ||
|
|
217
|
+
/^\.[\w-]+\.part-\d+\.png$/.test(name);
|
|
212
218
|
|
|
213
219
|
/**
|
|
214
220
|
* A temp file beside `file` for a whole write, named so only the editor
|
|
@@ -536,6 +542,33 @@ const isGray = seed => hexToOklch(seed).C < GRAY_CHROMA;
|
|
|
536
542
|
/** Whether a seed (or no seed) has no color to saturate. @param {string | null} seed */
|
|
537
543
|
export const isGraySeed = seed => !seed || isGray(seed);
|
|
538
544
|
|
|
545
|
+
/**
|
|
546
|
+
* Whether a color dial's seed comes out different at two vibrancies: the
|
|
547
|
+
* ramp the generator grows from it, light and dark, compared shade by
|
|
548
|
+
* shade. A seed with no saturation to change (a pure gray) gives the same
|
|
549
|
+
* ramp at every vibrancy. A gray-ish seed is grown as the editor grows it
|
|
550
|
+
* (a neutral), so a warm or cool gray counts by what it shows.
|
|
551
|
+
* @param {string} dial
|
|
552
|
+
* @param {string | null} seed
|
|
553
|
+
* @param {number} from
|
|
554
|
+
* @param {number} to
|
|
555
|
+
*/
|
|
556
|
+
export function vibrancyMoves(dial, seed, from, to) {
|
|
557
|
+
if (!seed || from === to) return false;
|
|
558
|
+
const kind = dial === 'neutral' || isGray(seed) ? 'neutral' : 'chromatic';
|
|
559
|
+
const ramp = (/** @type {number} */ vibrancy) =>
|
|
560
|
+
JSON.stringify(
|
|
561
|
+
/** @type {any} */ (
|
|
562
|
+
generate({
|
|
563
|
+
vibrancy,
|
|
564
|
+
...(kind === 'neutral' ? {neutralProfile: 'custom'} : {}),
|
|
565
|
+
families: [{id: 'seed', seed, kind}],
|
|
566
|
+
}).palette.seed
|
|
567
|
+
),
|
|
568
|
+
);
|
|
569
|
+
return ramp(from) !== ramp(to);
|
|
570
|
+
}
|
|
571
|
+
|
|
539
572
|
/** @param {unknown} a @param {unknown} b */
|
|
540
573
|
function sameColor(a, b) {
|
|
541
574
|
try {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The part or group a plain word names, as how reads it (`checkboxes` is
|
|
6
|
+
* the checks group, `panels` the containers), or null.
|
|
7
|
+
* @param {string} word
|
|
8
|
+
* @returns {string | null}
|
|
9
|
+
*/
|
|
10
|
+
export function partForWord(word: string): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* @file The plain words for parts that Core's catalog cannot give (groups,
|
|
13
|
+
* variants, font roles, phrases of several words, and words two components
|
|
14
|
+
* share), and the part or group one plain word names.
|
|
15
|
+
* @position api/theme-edit — a leaf with no imports, read by _how-question.mjs
|
|
16
|
+
* and _check.mjs
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Phrases for parts that Core's catalog cannot give: groups, variants,
|
|
20
|
+
* font roles, phrases of several words, and words two components share.
|
|
21
|
+
* They are read before the catalog's names and doc keywords
|
|
22
|
+
* (partLexicon), longest phrase first.
|
|
23
|
+
* @type {Array<[RegExp, {on: string, when?: string, role?: string, level?: string, missing?: string}]>}
|
|
24
|
+
*/
|
|
25
|
+
export const OVERRIDES: Array<[RegExp, {
|
|
26
|
+
on: string;
|
|
27
|
+
when?: string;
|
|
28
|
+
role?: string;
|
|
29
|
+
level?: string;
|
|
30
|
+
missing?: string;
|
|
31
|
+
}]>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The plain words for parts that Core's catalog cannot give (groups,
|
|
5
|
+
* variants, font roles, phrases of several words, and words two components
|
|
6
|
+
* share), and the part or group one plain word names.
|
|
7
|
+
* @position api/theme-edit — a leaf with no imports, read by _how-question.mjs
|
|
8
|
+
* and _check.mjs
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Phrases for parts that Core's catalog cannot give: groups, variants,
|
|
13
|
+
* font roles, phrases of several words, and words two components share.
|
|
14
|
+
* They are read before the catalog's names and doc keywords
|
|
15
|
+
* (partLexicon), longest phrase first.
|
|
16
|
+
* @type {Array<[RegExp, {on: string, when?: string, role?: string, level?: string, missing?: string}]>}
|
|
17
|
+
*/
|
|
18
|
+
export const OVERRIDES = [
|
|
19
|
+
[/\bdividers?\b/, {on: 'divider'}],
|
|
20
|
+
[
|
|
21
|
+
/\baccordions? (headers?|triggers?|titles?|headings?)\b/,
|
|
22
|
+
{on: 'collapsible-trigger'},
|
|
23
|
+
],
|
|
24
|
+
[/\baccordions?\b/, {on: 'collapsible'}],
|
|
25
|
+
[/\bcombo ?box(es)?\b/, {on: 'complex-selector'}],
|
|
26
|
+
[/\bnotifications?\b/, {on: 'toast'}],
|
|
27
|
+
[/\b(focus (ring|outline)s?)\b/, {on: 'focus-ring'}],
|
|
28
|
+
[/\b((modal |dialog )?(overlay|scrim|backdrop))\b/, {on: 'overlay'}],
|
|
29
|
+
[/\bicons?\b/, {on: 'icons'}],
|
|
30
|
+
[
|
|
31
|
+
/\b(table header|column headers?|table headings?)\b/,
|
|
32
|
+
{on: 'table-header-cell'},
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
/\b(tabs? (underline|indicator)s?|underline (of|on|under) (the )?tabs?)\b/,
|
|
36
|
+
{on: 'tab-indicator'},
|
|
37
|
+
],
|
|
38
|
+
[/\b(status dots?)\b/, {on: 'status-dot'}],
|
|
39
|
+
[/\b(progress( bar)?( fill)?|loading bar)\b/, {on: 'progress-bar-fill'}],
|
|
40
|
+
[
|
|
41
|
+
/\b((side ?nav|sidebar)( nav(igation)?)? (links?|items?))\b/,
|
|
42
|
+
{on: 'side-nav-item'},
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
/\b((dropdown |context )?menu (items?|options?|entries)|dropdown items?)\b/,
|
|
46
|
+
{on: 'dropdown-menu-item'},
|
|
47
|
+
],
|
|
48
|
+
[/\b(nav(igation)? (links?|items?))\b/, {on: 'top-nav-item'}],
|
|
49
|
+
// A context menu is its own part in Core (its items are the dropdown
|
|
50
|
+
// menu's items, which it reuses).
|
|
51
|
+
[/\b(context ?menus?|right[- ]click menus?)\b/, {on: 'context-menu'}],
|
|
52
|
+
[/\b((dropdown )?menus?)\b/, {on: 'dropdown-menu'}],
|
|
53
|
+
// A part's own header or footer ("dialog header", "card footer") is that
|
|
54
|
+
// part's, never the app's top bar or footer.
|
|
55
|
+
[
|
|
56
|
+
/(?<!\b(?:dialog|modal|card|drawer|sheet|popover|panel|section|table|menu)s? )\bfooters?\b/,
|
|
57
|
+
{on: 'layout-footer'},
|
|
58
|
+
],
|
|
59
|
+
[/\b(side ?nav|sidebar|side ?panel)\b/, {on: 'side-nav'}],
|
|
60
|
+
[
|
|
61
|
+
/\b(app (name|title)|logo|site title|product name)\b/,
|
|
62
|
+
{on: 'top-nav-heading'},
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
/(?<!\b(?:dialog|modal|card|drawer|sheet|popover|panel|section|table|menu)s? )\b(header|top ?bar|title ?bar|nav ?bar|app ?bar|masthead)\b/,
|
|
66
|
+
{on: 'app-shell-header'},
|
|
67
|
+
],
|
|
68
|
+
[/\b(page|app background|whole background|body background)\b/, {on: 'page'}],
|
|
69
|
+
[/\b(radio( buttons?)?|radios)\b/, {on: 'radio-indicator'}],
|
|
70
|
+
[/\b(primary|main) buttons?\b/, {on: 'button', when: 'variant:primary'}],
|
|
71
|
+
[/\bsecondary buttons?\b/, {on: 'button', when: 'variant:secondary'}],
|
|
72
|
+
[/\bghost buttons?\b/, {on: 'button', when: 'variant:ghost'}],
|
|
73
|
+
[
|
|
74
|
+
/\b(danger|destructive|delete) (buttons?|ones?|variant)\b/,
|
|
75
|
+
{on: 'button', when: 'variant:destructive'},
|
|
76
|
+
],
|
|
77
|
+
[/\b(panels?|windows?|boxes|tiles?|containers?)\b/, {on: 'containers'}],
|
|
78
|
+
[/\b(banners?|alerts?|notices?|announcements?)\b/, {on: 'banner'}],
|
|
79
|
+
[/\b(text ?areas?|multi-?line (inputs?|fields?))\b/, {on: 'text-area'}],
|
|
80
|
+
[
|
|
81
|
+
/\b(select (dropdowns?|menus?|box(es)?|inputs?)|selects|dropdowns?|pickers?|select(?! (the|a|an|all|any|one|which|what|it|them)\b))\b/,
|
|
82
|
+
{on: 'selector'},
|
|
83
|
+
],
|
|
84
|
+
[/\b(skeletons?( loaders?)?|loading placeholders?)\b/, {on: 'skeleton'}],
|
|
85
|
+
[
|
|
86
|
+
/\b(inputs?|text ?box(es)?|text ?fields?|form fields?|fields?)\b/,
|
|
87
|
+
{on: 'inputs'},
|
|
88
|
+
],
|
|
89
|
+
[/\b(checkbox(es)?|check ?marks?)\b/, {on: 'checks'}],
|
|
90
|
+
// "switch off", "switch the buttons to" are the verb, not the part.
|
|
91
|
+
[
|
|
92
|
+
/\b(toggles?|switch(?:e?s)?(?! (off|on|to|the|out|it|them|over|back|from)\b))\b/,
|
|
93
|
+
{on: 'switch'},
|
|
94
|
+
],
|
|
95
|
+
[/\b((table )?cells?)\b/, {on: 'table-cell'}],
|
|
96
|
+
[/\b(table rows?|rows?|tables?)\b/, {on: 'table-row'}],
|
|
97
|
+
[/\b(badges?|chips?|tags?)\b/, {on: 'badge'}],
|
|
98
|
+
[/\bh([1-6])\b/, {on: 'heading'}],
|
|
99
|
+
[/\b(headings?|titles?)\b/, {on: 'heading'}],
|
|
100
|
+
[/\b(modals?|popups?)\b/, {on: 'dialog'}],
|
|
101
|
+
[/\bcode\b/, {on: 'code', role: 'code'}],
|
|
102
|
+
// Small, secondary and supporting text, captions and fine print: the
|
|
103
|
+
// supporting text style, not the base size.
|
|
104
|
+
[
|
|
105
|
+
/\b((?:small|secondary|supporting|helper|hint|caption|muted) (?:text|copy)|fine print|captions?)\b/,
|
|
106
|
+
{on: 'body', role: 'supporting'},
|
|
107
|
+
],
|
|
108
|
+
[/\bbody( text)?\b/, {on: 'body', role: 'body'}],
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The part or group a plain word names, as how reads it (`checkboxes` is
|
|
113
|
+
* the checks group, `panels` the containers), or null.
|
|
114
|
+
* @param {string} word
|
|
115
|
+
* @returns {string | null}
|
|
116
|
+
*/
|
|
117
|
+
export function partForWord(word) {
|
|
118
|
+
const w = String(word ?? '')
|
|
119
|
+
.trim()
|
|
120
|
+
.toLowerCase();
|
|
121
|
+
if (!w) return null;
|
|
122
|
+
for (const [re, hit] of OVERRIDES)
|
|
123
|
+
if (/** @type {RegExp} */ (re).test(w))
|
|
124
|
+
return /** @type {{on: string}} */ (hit).on;
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
@@ -31,7 +31,8 @@ export function isItemOf(project: import("./_project.mjs").ThemeProject, name: s
|
|
|
31
31
|
* A component's catalog entries, all from its doc: its demo props
|
|
32
32
|
* ({@link demoProps}), then once per value of each visual prop with a
|
|
33
33
|
* closed set of values (`variant`, `status`, `color`, and a number union
|
|
34
|
-
* such as a heading's level),
|
|
34
|
+
* such as a heading's level), its checked and disabled states, and each look
|
|
35
|
+
* flag (`isStriped`) turned on. An
|
|
35
36
|
* overlay the playground shows in place renders open; on a page people
|
|
36
37
|
* see, once, as some of its variants size the window, not the card.
|
|
37
38
|
* @param {import('./_project.mjs').ThemeProject} project
|
|
@@ -127,9 +128,13 @@ export function declarations(css: string): Map<string, Array<{
|
|
|
127
128
|
* @param {string} html
|
|
128
129
|
* @param {ReturnType<typeof declarations>} decls
|
|
129
130
|
* @param {Set<string>} tokens
|
|
131
|
+
* @param {Map<string, {props: string[], states: string[]}>} [targets] the theming targets by key: the visual props and runtime states each declares are the data attributes read as its conditions
|
|
130
132
|
* @returns {{map: Record<string, PartRecord>, pairs: TextPair[]}}
|
|
131
133
|
*/
|
|
132
|
-
export function walkMarkup(html: string, decls: ReturnType<typeof declarations>, tokens: Set<string
|
|
134
|
+
export function walkMarkup(html: string, decls: ReturnType<typeof declarations>, tokens: Set<string>, targets?: Map<string, {
|
|
135
|
+
props: string[];
|
|
136
|
+
states: string[];
|
|
137
|
+
}>): {
|
|
133
138
|
map: Record<string, PartRecord>;
|
|
134
139
|
pairs: TextPair[];
|
|
135
140
|
};
|
|
@@ -142,6 +147,10 @@ export type PartRecord = {
|
|
|
142
147
|
tokens: Record<string, string[]>;
|
|
143
148
|
values: string[];
|
|
144
149
|
}>;
|
|
150
|
+
/**
|
|
151
|
+
* - property -> the value under each condition, private variables resolved
|
|
152
|
+
*/
|
|
153
|
+
at?: Record<string, Record<string, string>> | undefined;
|
|
145
154
|
/**
|
|
146
155
|
* - tokens read by unnamed elements inside the part -> properties
|
|
147
156
|
*/
|
|
@@ -154,17 +163,34 @@ export type PartRecord = {
|
|
|
154
163
|
* - parts rendered inside it
|
|
155
164
|
*/
|
|
156
165
|
contains: string[];
|
|
166
|
+
/**
|
|
167
|
+
* - the elements it is rendered as (`tr` for a table row)
|
|
168
|
+
*/
|
|
169
|
+
tags?: string[] | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* - the radius tokens of the corners Core draws by place on the parts directly inside it (a button group's end buttons)
|
|
172
|
+
*/
|
|
173
|
+
innerCorners?: string[] | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* - state ('' for always) -> property -> the token Core paints it with as an inline style, which no theme rule can replace
|
|
176
|
+
*/
|
|
177
|
+
inline?: Record<string, Record<string, string>> | undefined;
|
|
157
178
|
};
|
|
158
179
|
export type PaintSide = {
|
|
159
180
|
target: string | null;
|
|
160
181
|
tokens: string[];
|
|
161
182
|
raw: string | null;
|
|
162
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* `over`: the region the part sits in (a header), whose background shows
|
|
186
|
+
* through a see-through background of the part's own, else the page
|
|
187
|
+
*/
|
|
163
188
|
export type TextPair = {
|
|
164
189
|
text: string;
|
|
165
190
|
fg: PaintSide;
|
|
166
191
|
bg: PaintSide;
|
|
167
192
|
sample: string;
|
|
193
|
+
over?: PaintSide;
|
|
168
194
|
};
|
|
169
195
|
export type PartData = {
|
|
170
196
|
version: number;
|