@astryxdesign/cli 0.7.16 → 0.7.17-canary.g0404a74
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 +17 -0
- package/api/build/_adapter.mjs +53 -34
- package/api/build/blocks/blocks.d.mts +7 -5
- package/api/build/blocks/blocks.mjs +113 -26
- package/api/build/blocks/blocks.weights.json +1 -1
- 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 +6 -4
- package/api/build/kit/rank.mjs +132 -28
- package/api/build/kit/signals.d.mts +7 -1
- package/api/build/kit/signals.mjs +21 -10
- package/api/build/kit/start.d.mts +5 -4
- package/api/build/kit/start.mjs +14 -9
- package/api/build/kit/weights.d.mts +39 -3
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +351 -46
- 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 +86 -0
- package/api/build/kit/words.mjs +241 -1
- package/api/build/tree.mjs +1 -1
- package/api/component/__fixtures__/resolutions/modules.txt +5 -6
- package/api/component/_adapter.d.mts +26 -2
- package/api/component/_adapter.mjs +135 -8
- package/api/component/component.mjs +14 -1
- package/api/component/list/list.d.mts +1 -1
- package/api/component/list/list.mjs +48 -6
- package/api/discover/_adapter.d.mts +11 -1
- package/api/discover/_adapter.mjs +95 -1
- package/api/discover/detail/item/item.mjs +5 -0
- package/api/discover/discover.mjs +12 -3
- package/api/discover/discover.type.d.mts +16 -3
- package/api/discover/discover.type.mjs +13 -3
- package/api/discover/search/search.mjs +3 -2
- package/api/docs/_adapter.d.mts +57 -2
- package/api/docs/_adapter.mjs +266 -33
- package/api/docs/_entry-names-lazily.d.mts +22 -0
- package/api/docs/_entry-names-lazily.mjs +25 -0
- package/api/docs/_entry-names.d.mts +23 -0
- package/api/docs/_entry-names.mjs +105 -0
- 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 +54 -5
- package/api/doctor/_adapter.mjs +162 -11
- package/api/doctor/built-checks.mjs +40 -14
- package/api/doctor/doctor.d.mts +15 -3
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +31 -7
- package/api/doctor/theme-checks.d.mts +35 -3
- package/api/doctor/theme-checks.mjs +377 -29
- package/api/hook/_adapter.d.mts +10 -4
- package/api/hook/_adapter.mjs +41 -5
- package/api/hook/detail/detail.mjs +5 -2
- package/api/hook/detail/params/params.mjs +10 -3
- 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/add-helpers.mjs +10 -0
- package/api/integration/authoring-checks.mjs +11 -8
- 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/pack-check.mjs +16 -1
- package/api/integration/validate-integration.d.mts +18 -6
- package/api/integration/validate-integration.mjs +129 -15
- package/api/integration/validate-integration.type.d.mts +22 -0
- package/api/integration/validate-integration.type.mjs +2 -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 +53 -1
- package/api/render/render.type.mjs +32 -2
- package/api/search/ORDERING.md +2 -2
- package/api/search/_adapter.d.mts +9 -0
- package/api/search/_adapter.mjs +85 -0
- package/api/search/_candidate-score.d.mts +9 -4
- package/api/search/_candidate-score.mjs +133 -46
- 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 +14 -0
- package/api/search/_lexical.mjs +93 -11
- 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/template/_adapter.d.mts +16 -0
- package/api/template/_adapter.mjs +39 -2
- package/api/template/cdn/cdn.mjs +37 -8
- package/api/template/copy/copy.d.mts +6 -3
- package/api/template/copy/copy.mjs +40 -8
- package/api/template/template.doc.mjs +3 -3
- package/api/template/template.mjs +63 -11
- package/api/template/template.type.d.mts +1 -0
- package/api/template/template.type.mjs +1 -0
- package/api/theme/_adapter.d.mts +12 -1
- package/api/theme/_adapter.mjs +132 -13
- package/api/theme/_app-provider.d.mts +31 -0
- package/api/theme/_app-provider.mjs +135 -0
- package/api/theme/add/add.mjs +3 -1
- package/api/theme/build/build.d.mts +142 -1
- package/api/theme/build/build.mjs +692 -284
- 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 +80 -5
- package/api/theme/build/font-warning.mjs +323 -55
- package/api/theme/build/icon-imports.mjs +51 -9
- package/api/theme/build/null-values.d.mts +28 -0
- package/api/theme/build/null-values.mjs +191 -0
- package/api/theme/list/list.mjs +17 -1
- package/api/theme/remove/remove.d.mts +2 -1
- package/api/theme/remove/remove.mjs +7 -3
- package/api/theme/theme.type.d.mts +78 -1
- package/api/theme/theme.type.mjs +38 -2
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +8 -5
- package/api/theme-edit/_adapter.d.mts +116 -4
- package/api/theme-edit/_adapter.mjs +1058 -93
- package/api/theme-edit/_catalog.d.mts +46 -2
- package/api/theme-edit/_catalog.mjs +115 -14
- package/api/theme-edit/_check.d.mts +133 -24
- package/api/theme-edit/_check.mjs +3392 -531
- package/api/theme-edit/_color.d.mts +26 -0
- package/api/theme-edit/_color.mjs +92 -2
- package/api/theme-edit/_compiler.d.mts +5 -1
- package/api/theme-edit/_compiler.mjs +141 -17
- package/api/theme-edit/_context.d.mts +74 -6
- package/api/theme-edit/_context.mjs +468 -76
- package/api/theme-edit/_css.d.mts +21 -0
- package/api/theme-edit/_css.mjs +87 -14
- package/api/theme-edit/_edit.d.mts +74 -7
- package/api/theme-edit/_edit.mjs +4426 -319
- package/api/theme-edit/_how-commands.d.mts +76 -1
- package/api/theme-edit/_how-commands.mjs +793 -9
- package/api/theme-edit/_how-question.d.mts +97 -6
- package/api/theme-edit/_how-question.mjs +9184 -747
- package/api/theme-edit/_how.d.mts +5 -2
- package/api/theme-edit/_how.mjs +255 -46
- 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 +322 -0
- package/api/theme-edit/_normal.mjs +1630 -0
- package/api/theme-edit/_palette.d.mts +49 -0
- package/api/theme-edit/_palette.mjs +180 -38
- package/api/theme-edit/_part-words.d.mts +39 -0
- package/api/theme-edit/_part-words.mjs +152 -0
- package/api/theme-edit/_parts.d.mts +55 -3
- package/api/theme-edit/_parts.mjs +421 -36
- package/api/theme-edit/_preview-app.d.mts +7 -13
- package/api/theme-edit/_preview-app.mjs +1108 -599
- package/api/theme-edit/_preview.d.mts +156 -19
- package/api/theme-edit/_preview.mjs +809 -180
- package/api/theme-edit/_project.d.mts +61 -1
- package/api/theme-edit/_project.mjs +177 -6
- package/api/theme-edit/_settings.d.mts +619 -48
- package/api/theme-edit/_settings.mjs +4910 -617
- package/api/theme-edit/_tables.d.mts +41 -0
- package/api/theme-edit/_tables.mjs +261 -41
- 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 +34 -2
- package/api/theme-edit/theme-edit.type.mjs +18 -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/api/upgrade/upgrade.mjs +16 -1
- package/assets/codemods/integration-discovery.mjs +2 -1
- package/assets/codemods/integration-runner.mjs +1 -1
- package/assets/codemods/jscodeshift.d.ts +1 -1
- package/assets/codemods/run-codemod.mjs +151 -18
- package/assets/codemods/runner.mjs +1 -4
- 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 +2 -0
- package/assets/docs/theme.doc.dense.mjs +76 -7
- package/assets/docs/theme.doc.mjs +66 -2
- package/assets/docs/theme.doc.zh.mjs +51 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/cli-command.doc.mjs +2 -3
- package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/font-setup.doc.mjs +1 -1
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/render-pages.doc.mjs +46 -5
- 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/tree/write-good-templates.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +2 -2
- package/assets/docs-routes.generated.json +1 -0
- 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/ChatComposerInput/useSpeechRecognitionHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.tsx +43 -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/page.tsx +31 -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/page.tsx +1 -1
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +1 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-comparison/page.tsx +2 -2
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-progress/page.tsx +1 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
- package/assets/templates/pages/detail-page/page.tsx +60 -7
- 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/page.tsx +13 -13
- package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
- package/assets/templates/pages/editor/page.tsx +14 -2
- package/assets/templates/pages/editor/template.doc.mjs +2 -8
- package/assets/templates/pages/file-explorer/page.tsx +9 -0
- 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/form-wizard-vertical/page.tsx +23 -3
- package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
- package/assets/templates/pages/ide/page.tsx +33 -2
- package/assets/templates/pages/kanban-board/page.tsx +12 -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/page.tsx +16 -0
- package/assets/templates/pages/login-card/template.doc.mjs +2 -1
- package/assets/templates/pages/login-split/page.tsx +19 -6
- 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/messaging-shell/template.doc.mjs +6 -0
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/payment-form/page.tsx +30 -4
- package/assets/templates/pages/product-detail/page.tsx +26 -2
- 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/page.tsx +162 -12
- 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/page.tsx +11 -3
- 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/page.tsx +9 -0
- package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
- package/assets/templates/pages/table-grouped/page.tsx +161 -133
- package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
- package/assets/templates/pages/table-page/page.tsx +14 -1
- 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/page.tsx +47 -7
- package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
- package/assets/theme.template.ts +9 -2
- package/authoring/debug/parse.d.mts +3 -3
- package/authoring/doctypes/_schema.d.mts +9 -9
- 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/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +24 -1
- package/authoring/integration/schema.mjs +126 -4
- package/authoring/integration/type.ts +14 -0
- 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/discover.mjs +70 -3
- package/clients/cli/commands/docs.doc.mjs +7 -1
- package/clients/cli/commands/docs.mjs +44 -6
- package/clients/cli/commands/doctor.mjs +84 -16
- package/clients/cli/commands/experimental/render.mjs +42 -1
- package/clients/cli/commands/experimental/theme.mjs +1032 -134
- 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 +2 -2
- 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 +2 -2
- 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-remove.doc.mjs +4 -4
- 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.doc.mjs +1 -1
- package/clients/cli/commands/template.mjs +15 -2
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-build.doc.mjs +5 -1
- package/clients/cli/commands/theme-list.doc.mjs +1 -1
- package/clients/cli/commands/theme-remove.doc.mjs +13 -5
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +849 -441
- package/clients/cli/commands/upgrade.mjs +46 -8
- package/clients/cli/index.mjs +9 -19
- 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 +265 -29
- package/clients/cli/lib/manifest.mjs +3 -2
- package/clients/cli/lib/stray-option.mjs +478 -0
- package/clients/cli/lib/unknown-command.mjs +353 -0
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/project.d.mts +8 -0
- package/foundation/config/project.mjs +26 -29
- package/foundation/config/theme-state.d.mts +31 -2
- package/foundation/config/theme-state.mjs +140 -8
- package/foundation/discovery/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/cli-self-doc-names.d.mts +13 -0
- package/foundation/discovery/cli-self-doc-names.mjs +51 -0
- package/foundation/discovery/cli-self-docs.d.mts +0 -2
- package/foundation/discovery/cli-self-docs.mjs +2 -15
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +59 -10
- 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/core-theme-facts.d.mts +70 -0
- package/foundation/discovery/core-theme-facts.mjs +384 -0
- package/foundation/discovery/doc-types.mjs +4 -3
- package/foundation/discovery/docs-discovery.d.mts +66 -9
- package/foundation/discovery/docs-discovery.mjs +126 -60
- package/foundation/discovery/entry-name-files.d.mts +106 -0
- package/foundation/discovery/entry-name-files.mjs +354 -0
- package/foundation/discovery/hook-discovery.d.mts +18 -2
- package/foundation/discovery/hook-discovery.mjs +93 -42
- 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-component-views.d.mts +15 -0
- package/foundation/discovery/integration-component-views.mjs +91 -0
- package/foundation/discovery/integration-doc-files.mjs +2 -1
- package/foundation/discovery/module-exports.d.mts +26 -1
- package/foundation/discovery/module-exports.mjs +114 -40
- package/foundation/discovery/name-roots.d.mts +38 -0
- package/foundation/discovery/name-roots.mjs +108 -0
- package/foundation/discovery/next-routes.d.mts +48 -0
- package/foundation/discovery/next-routes.mjs +181 -0
- 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 +40 -18
- package/foundation/discovery/template-adapter.d.mts +49 -29
- package/foundation/discovery/template-adapter.mjs +89 -99
- package/foundation/discovery/template-destination.d.mts +28 -0
- package/foundation/discovery/template-destination.mjs +104 -0
- package/foundation/discovery/template-icons.mjs +2 -1
- package/foundation/discovery/template-ids.d.mts +69 -0
- package/foundation/discovery/template-ids.mjs +199 -0
- package/foundation/discovery/theme-discovery.d.mts +12 -0
- package/foundation/discovery/theme-discovery.mjs +34 -4
- package/foundation/discovery/theme-imports.d.mts +24 -0
- package/foundation/discovery/theme-imports.mjs +61 -4
- package/foundation/discovery/theming-targets.d.mts +13 -5
- package/foundation/discovery/theming-targets.mjs +41 -47
- package/foundation/doc-compiler/generated-levels.d.mts +43 -0
- package/foundation/doc-compiler/generated-levels.mjs +72 -0
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/inputs.mjs +3 -2
- package/foundation/doc-compiler/literal-doc.d.mts +12 -0
- package/foundation/doc-compiler/literal-doc.mjs +322 -0
- package/foundation/doc-compiler/parse-readable.mjs +4 -1
- package/foundation/doc-compiler/stored-docs.d.mts +29 -0
- package/foundation/doc-compiler/stored-docs.mjs +63 -1
- package/foundation/doc-compiler/tree.d.mts +4 -84
- package/foundation/doc-compiler/tree.mjs +4 -62
- package/foundation/env/semver.mjs +3 -1
- package/foundation/fonts/font-stylesheet.d.mts +46 -0
- package/foundation/fonts/font-stylesheet.mjs +173 -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 +16 -5
- package/foundation/fs/gather-cache.d.mts +94 -4
- package/foundation/fs/gather-cache.mjs +671 -106
- package/foundation/fs/glob.d.mts +16 -0
- package/foundation/fs/glob.mjs +105 -0
- package/foundation/fs/jiti-cache.d.mts +19 -1
- package/foundation/fs/jiti-cache.mjs +130 -6
- package/foundation/fs/kept-tree.d.mts +80 -0
- package/foundation/fs/kept-tree.mjs +240 -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/path-safety.d.mts +11 -2
- package/foundation/fs/path-safety.mjs +108 -18
- package/foundation/fs/paths.d.mts +18 -0
- package/foundation/fs/paths.mjs +15 -2
- package/foundation/fs/read-record.d.mts +56 -7
- package/foundation/fs/read-record.mjs +280 -56
- package/foundation/fs/regular-file.d.mts +29 -0
- package/foundation/fs/regular-file.mjs +77 -0
- 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/integrations.d.mts +23 -1
- package/foundation/integrations/integrations.mjs +18 -1
- package/foundation/integrations/pack-state.d.mts +75 -0
- package/foundation/integrations/pack-state.mjs +314 -0
- package/foundation/integrations/public-imports.d.mts +9 -0
- package/foundation/integrations/public-imports.mjs +3 -2
- package/foundation/integrations/shipped-imports.d.mts +122 -0
- package/foundation/integrations/shipped-imports.mjs +497 -0
- package/foundation/integrations/validate-contributions.d.mts +0 -17
- package/foundation/integrations/validate-contributions.mjs +59 -333
- package/foundation/render/assets.mjs +52 -7
- package/foundation/render/charts.d.mts +78 -27
- package/foundation/render/charts.mjs +266 -90
- package/foundation/render/embedded-files.d.mts +6 -0
- package/foundation/render/embedded-files.mjs +25 -5
- package/foundation/render/embedded-imports.d.mts +70 -7
- package/foundation/render/embedded-imports.mjs +132 -41
- 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/layers.d.mts +30 -0
- package/foundation/render/layers.mjs +158 -0
- package/foundation/render/markup-edits.d.mts +57 -0
- package/foundation/render/markup-edits.mjs +182 -0
- package/foundation/render/offline.d.mts +32 -0
- package/foundation/render/offline.mjs +56 -0
- package/foundation/render/page-host.mjs +29 -12
- package/foundation/render/page-worker.mjs +354 -21
- package/foundation/render/picture-chrome.d.mts +4 -0
- package/foundation/render/picture-chrome.mjs +192 -0
- package/foundation/render/picture-playwright.d.mts +4 -0
- package/foundation/render/picture-playwright.mjs +46 -0
- package/foundation/render/rebuild.mjs +2 -1
- package/foundation/render/render-page.d.mts +79 -5
- package/foundation/render/render-page.mjs +735 -109
- 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 +6 -6
- package/foundation/suggest/name-index.d.mts +148 -0
- package/foundation/suggest/name-index.mjs +317 -0
- package/foundation/suggest/other-command.d.mts +140 -0
- package/foundation/suggest/other-command.mjs +756 -0
- 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/entry-names.d.mts +14 -0
- package/foundation/text/entry-names.mjs +14 -0
- package/foundation/text/string-utils.d.mts +46 -6
- package/foundation/text/string-utils.mjs +118 -20
- package/foundation/text/suggest-order.d.mts +47 -4
- package/foundation/text/suggest-order.mjs +174 -5
- package/foundation/xle/browser.d.mts +2 -2
- package/foundation/xle/expand.mjs +2 -1
- package/host/index.mjs +8 -6
- package/package.json +7 -6
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The colors written inside a value (a shadow's layers, a gradient's
|
|
6
|
+
* stops): each hex color and each color function, in order.
|
|
7
|
+
* @param {string} value
|
|
8
|
+
* @returns {string[]}
|
|
9
|
+
*/
|
|
10
|
+
export function colorsIn(value: string): string[];
|
|
4
11
|
/**
|
|
5
12
|
* The opacity of a CSS color, 0 to 1: the alpha of an 8- or 4-digit hex,
|
|
6
13
|
* `rgba()`/`hsla()`, or a `/ alpha` part; 0 for `transparent`; 1 otherwise.
|
|
@@ -44,6 +51,14 @@ export function parseColor(value: unknown): Rgb | null;
|
|
|
44
51
|
* @param {unknown} value
|
|
45
52
|
*/
|
|
46
53
|
export function isClipped(value: unknown): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A comma (legacy) rgb() or hsl() that CSS does not take as written, in the
|
|
56
|
+
* space-separated syntax CSS reads the same channels in (`hsl(0, 100, 50)`
|
|
57
|
+
* is `hsl(0 100 50)`); null for any other value.
|
|
58
|
+
* @param {unknown} value
|
|
59
|
+
* @returns {string | null}
|
|
60
|
+
*/
|
|
61
|
+
export function colorAsCssReads(value: unknown): string | null;
|
|
47
62
|
/**
|
|
48
63
|
* Why a value cannot seed a color dial, or null when it is one fixed,
|
|
49
64
|
* opaque color: `opaque` is the color without its alpha, for a suggestion.
|
|
@@ -61,6 +76,14 @@ export function colorProblem(value: unknown): {
|
|
|
61
76
|
* @param {number[]} b
|
|
62
77
|
*/
|
|
63
78
|
export function ratio(a: number[], b: number[]): number;
|
|
79
|
+
/**
|
|
80
|
+
* A value with each CSS escape (`Gill\ Sans`, `\5FAE`) as one plain
|
|
81
|
+
* character, as CSS reads it: an escape is part of a name, never a
|
|
82
|
+
* boundary. A backslash that escapes nothing (at the end, or before a line
|
|
83
|
+
* break) could join the next declaration, so it stays.
|
|
84
|
+
* @param {string} v
|
|
85
|
+
*/
|
|
86
|
+
export function withoutCssEscapes(v: string): string;
|
|
64
87
|
/**
|
|
65
88
|
* Whether a value can sit in a CSS declaration as it is: no `<>`, control
|
|
66
89
|
* character, comment or `!important` anywhere; outside a quoted string or a
|
|
@@ -72,6 +95,9 @@ export function isSafeValue(v: string): boolean;
|
|
|
72
95
|
export { splitTop };
|
|
73
96
|
/** The CSS named colors, for suggestions. */
|
|
74
97
|
export const COLOR_NAMES: string[];
|
|
98
|
+
export function namedColorHex(name: string): string | null;
|
|
99
|
+
/** One color written inside a value: a hex color or a color function. */
|
|
100
|
+
export const COLOR_IN_VALUE: RegExp;
|
|
75
101
|
export function hex(rgb: number[]): string;
|
|
76
102
|
export function isColorValue(v: unknown): boolean;
|
|
77
103
|
export function isSize(v: unknown, name?: string): boolean;
|
|
@@ -179,6 +179,14 @@ const NAMED = wordTable(
|
|
|
179
179
|
/** The CSS named colors, for suggestions. */
|
|
180
180
|
export const COLOR_NAMES = Object.keys(NAMED);
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* The hex a CSS color name is, or null.
|
|
184
|
+
* @param {string} name
|
|
185
|
+
* @returns {string | null}
|
|
186
|
+
*/
|
|
187
|
+
export const namedColorHex = name =>
|
|
188
|
+
Object.hasOwn(NAMED, name) ? NAMED[name] : null;
|
|
189
|
+
|
|
182
190
|
/** Color keywords that are valid colors but have no fixed value. */
|
|
183
191
|
const KEYWORDS = ['transparent', 'currentcolor', ...CSS_WIDE];
|
|
184
192
|
|
|
@@ -326,6 +334,19 @@ function args(fn, body) {
|
|
|
326
334
|
if (channels.length !== 3) return null;
|
|
327
335
|
const read = channels.map(x => num(x, !legacy));
|
|
328
336
|
if (read.some(x => !x)) return null;
|
|
337
|
+
// The comma (legacy) syntax as CSS Color 4 takes it: rgb() with all
|
|
338
|
+
// numbers or all percentages, hsl() with a hue and two percentages. Bare
|
|
339
|
+
// numbers for saturation and lightness, or mixed rgb() channels, are the
|
|
340
|
+
// space-separated syntax's only: browsers drop them written with commas.
|
|
341
|
+
if (legacy) {
|
|
342
|
+
const units = /** @type {Num[]} */ (read).map(x => x.unit);
|
|
343
|
+
const ok = /^rgba?$/i.test(fn)
|
|
344
|
+
? units.every(u => u === '') || units.every(u => u === '%')
|
|
345
|
+
: ['', 'deg', 'grad', 'rad', 'turn'].includes(units[0]) &&
|
|
346
|
+
units[1] === '%' &&
|
|
347
|
+
units[2] === '%';
|
|
348
|
+
if (!ok) return null;
|
|
349
|
+
}
|
|
329
350
|
let a = 1;
|
|
330
351
|
if (alpha !== undefined) {
|
|
331
352
|
const v = num(alpha, !legacy);
|
|
@@ -441,6 +462,20 @@ const polar = (c, h) => [
|
|
|
441
462
|
c * Math.sin((h * Math.PI) / 180),
|
|
442
463
|
];
|
|
443
464
|
|
|
465
|
+
/**
|
|
466
|
+
* The colors written inside a value (a shadow's layers, a gradient's
|
|
467
|
+
* stops): each hex color and each color function, in order.
|
|
468
|
+
* @param {string} value
|
|
469
|
+
* @returns {string[]}
|
|
470
|
+
*/
|
|
471
|
+
export function colorsIn(value) {
|
|
472
|
+
return [...String(value ?? '').matchAll(COLOR_IN_VALUE)].map(m => m[0]);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** One color written inside a value: a hex color or a color function. */
|
|
476
|
+
export const COLOR_IN_VALUE =
|
|
477
|
+
/#[0-9a-f]{3,8}\b|\b(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\((?:[^()]|\([^()]*\))*\)/gi;
|
|
478
|
+
|
|
444
479
|
/**
|
|
445
480
|
* The opacity of a CSS color, 0 to 1: the alpha of an 8- or 4-digit hex,
|
|
446
481
|
* `rgba()`/`hsla()`, or a `/ alpha` part; 0 for `transparent`; 1 otherwise.
|
|
@@ -514,7 +549,33 @@ export function mixSide(side) {
|
|
|
514
549
|
if (w == null) return null;
|
|
515
550
|
const plain = /^calc\(\s*(.*?)\s*\)$/i.exec(w)?.[1] ?? w;
|
|
516
551
|
const n = cssNumber(plain);
|
|
517
|
-
return n
|
|
552
|
+
if (n) return n.unit === '%' ? n.value : null;
|
|
553
|
+
// Math of two terms that gives a percentage: percentages added or
|
|
554
|
+
// taken away (`25% + 25%`), a percentage scaled by a number
|
|
555
|
+
// (`50% * 1`, `100% / 2`).
|
|
556
|
+
const m = /^(\S+)\s*([*/+-])\s*(\S+)$/.exec(plain);
|
|
557
|
+
if (!m) return null;
|
|
558
|
+
const [a, b] = [cssNumber(m[1]), cssNumber(m[3])];
|
|
559
|
+
if (!a || !b) return null;
|
|
560
|
+
const pct = (/** @type {{unit: string}} */ x) => x.unit === '%';
|
|
561
|
+
const plainNum = (/** @type {{unit: string}} */ x) => x.unit === '';
|
|
562
|
+
const r =
|
|
563
|
+
m[2] === '+' || m[2] === '-'
|
|
564
|
+
? pct(a) && pct(b)
|
|
565
|
+
? m[2] === '+'
|
|
566
|
+
? a.value + b.value
|
|
567
|
+
: a.value - b.value
|
|
568
|
+
: null
|
|
569
|
+
: m[2] === '*'
|
|
570
|
+
? pct(a) && plainNum(b)
|
|
571
|
+
? a.value * b.value
|
|
572
|
+
: plainNum(a) && pct(b)
|
|
573
|
+
? a.value * b.value
|
|
574
|
+
: null
|
|
575
|
+
: pct(a) && plainNum(b) && b.value !== 0
|
|
576
|
+
? a.value / b.value
|
|
577
|
+
: null;
|
|
578
|
+
return r != null && Number.isFinite(r) ? r : null;
|
|
518
579
|
};
|
|
519
580
|
if (words.length < 2) return {color: side.trim(), pct: null};
|
|
520
581
|
const last = share(words.at(-1));
|
|
@@ -791,6 +852,24 @@ export function isClipped(value) {
|
|
|
791
852
|
return readColor(String(value ?? '').trim()) != null && clipped;
|
|
792
853
|
}
|
|
793
854
|
|
|
855
|
+
/**
|
|
856
|
+
* A comma (legacy) rgb() or hsl() that CSS does not take as written, in the
|
|
857
|
+
* space-separated syntax CSS reads the same channels in (`hsl(0, 100, 50)`
|
|
858
|
+
* is `hsl(0 100 50)`); null for any other value.
|
|
859
|
+
* @param {unknown} value
|
|
860
|
+
* @returns {string | null}
|
|
861
|
+
*/
|
|
862
|
+
export function colorAsCssReads(value) {
|
|
863
|
+
const s = String(value ?? '').trim();
|
|
864
|
+
const fn = /^(rgba?|hsla?)\((.*)\)$/i.exec(s);
|
|
865
|
+
if (!fn || !fn[2].includes(',') || readColor(s)) return null;
|
|
866
|
+
const parts = fn[2].split(',').map(x => x.trim());
|
|
867
|
+
if (parts.length !== 3 && parts.length !== 4) return null;
|
|
868
|
+
const name = fn[1].toLowerCase().replace(/a$/, '');
|
|
869
|
+
const modern = `${name}(${parts.slice(0, 3).join(' ')}${parts[3] ? ` / ${parts[3]}` : ''})`;
|
|
870
|
+
return readColor(modern) ? modern : null;
|
|
871
|
+
}
|
|
872
|
+
|
|
794
873
|
/**
|
|
795
874
|
* Why a value cannot seed a color dial, or null when it is one fixed,
|
|
796
875
|
* opaque color: `opaque` is the color without its alpha, for a suggestion.
|
|
@@ -989,6 +1068,17 @@ export const isNumber = (v, name = '') => {
|
|
|
989
1068
|
return n?.unit === '';
|
|
990
1069
|
};
|
|
991
1070
|
|
|
1071
|
+
/**
|
|
1072
|
+
* A value with each CSS escape (`Gill\ Sans`, `\5FAE`) as one plain
|
|
1073
|
+
* character, as CSS reads it: an escape is part of a name, never a
|
|
1074
|
+
* boundary. A backslash that escapes nothing (at the end, or before a line
|
|
1075
|
+
* break) could join the next declaration, so it stays.
|
|
1076
|
+
* @param {string} v
|
|
1077
|
+
*/
|
|
1078
|
+
export function withoutCssEscapes(v) {
|
|
1079
|
+
return v.replace(/\\(?:[0-9a-fA-F]{1,6}[ \t]?|[^\n\r\f0-9a-fA-F])/g, 'x');
|
|
1080
|
+
}
|
|
1081
|
+
|
|
992
1082
|
/**
|
|
993
1083
|
* Whether a value can sit in a CSS declaration as it is: no `<>`, control
|
|
994
1084
|
* character, comment or `!important` anywhere; outside a quoted string or a
|
|
@@ -1009,7 +1099,7 @@ export function isSafeValue(v) {
|
|
|
1009
1099
|
)
|
|
1010
1100
|
)
|
|
1011
1101
|
return false;
|
|
1012
|
-
const outside = v
|
|
1102
|
+
const outside = withoutCssEscapes(v)
|
|
1013
1103
|
.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g, '""')
|
|
1014
1104
|
.replace(/url\(data:[^\s"'()\\]*\)/gi, 'url()');
|
|
1015
1105
|
if (/[;{}\\<>]/.test(outside)) return false;
|
|
@@ -48,10 +48,14 @@ export function makeCompiler(project: import("./_project.mjs").ThemeProject, par
|
|
|
48
48
|
ratio: number;
|
|
49
49
|
sample: string;
|
|
50
50
|
fg: string;
|
|
51
|
+
fgToken: string | null;
|
|
52
|
+
textPart: string | null;
|
|
53
|
+
when: string | null;
|
|
51
54
|
bgPart: string | null;
|
|
52
55
|
bg: string;
|
|
56
|
+
ground: [number, number, number];
|
|
57
|
+
over: string | null;
|
|
53
58
|
}[];
|
|
54
|
-
more: number;
|
|
55
59
|
unchecked: string[];
|
|
56
60
|
};
|
|
57
61
|
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {DIRECT, GROUPS, HOW} from './_tables.mjs';
|
|
13
|
+
import {splitTop} from './_css.mjs';
|
|
13
14
|
import {quoteCommandArgument} from '../../foundation/env/package-manager.mjs';
|
|
14
15
|
|
|
15
16
|
/** Only these token types may differ between light and dark. */
|
|
@@ -112,13 +113,21 @@ export function makeCompiler(project, parts) {
|
|
|
112
113
|
if (cond === 'always') return '';
|
|
113
114
|
const attrs = MAP[target]?.attrs ?? {};
|
|
114
115
|
const [attrPart, ...css] = cond.split(' ');
|
|
116
|
+
const t = TARGET.get(target);
|
|
115
117
|
const kept = (attrPart.includes('=') ? attrPart.split(',') : []).filter(
|
|
116
118
|
kv => {
|
|
117
119
|
const [k] = kv.split('=');
|
|
120
|
+
// Only the part's own visual props are read down to what a person
|
|
121
|
+
// acts on (a size or an elevation the render happened to use is not
|
|
122
|
+
// a condition). Anything else stays: a runtime state of the part, a
|
|
123
|
+
// prop of another target on the same element (a selectable card's
|
|
124
|
+
// selection on its card), and the place another component puts the
|
|
125
|
+
// part in (the part data's aria context conditions); none is the
|
|
126
|
+
// part at rest.
|
|
127
|
+
if (!t?.props.includes(k) || t.states.includes(k)) return true;
|
|
118
128
|
return (
|
|
119
|
-
|
|
120
|
-
([
|
|
121
|
-
(attrs[k]?.length ?? 0) > 1)
|
|
129
|
+
['variant', 'status', 'tone', 'color'].includes(k) &&
|
|
130
|
+
(attrs[k]?.length ?? 0) > 1
|
|
122
131
|
);
|
|
123
132
|
},
|
|
124
133
|
);
|
|
@@ -384,7 +393,16 @@ export function makeCompiler(project, parts) {
|
|
|
384
393
|
function variantValues(target) {
|
|
385
394
|
const comp = TARGET.get(target)?.component;
|
|
386
395
|
const info = comp ? project.components[comp] : undefined;
|
|
396
|
+
// The component named like the part (Heading for heading) owns its
|
|
397
|
+
// values before any other component whose docs name the same class.
|
|
398
|
+
const pascal = target.replace(/(^|-)([a-z0-9])/g, (_, __, ch) =>
|
|
399
|
+
ch.toUpperCase(),
|
|
400
|
+
);
|
|
401
|
+
const own = project.components?.[pascal]?.targets?.find(
|
|
402
|
+
(/** @type {any} */ x) => x.className === `astryx-${target}`,
|
|
403
|
+
);
|
|
387
404
|
const t =
|
|
405
|
+
own ??
|
|
388
406
|
info?.targets.find(x => x.className === `astryx-${target}`) ??
|
|
389
407
|
info?.targets[0];
|
|
390
408
|
const fromDocs = t?.values ?? {};
|
|
@@ -393,9 +411,55 @@ export function makeCompiler(project, parts) {
|
|
|
393
411
|
const out = {};
|
|
394
412
|
for (const p of TARGET.get(target)?.props ?? [])
|
|
395
413
|
out[p] = fromDocs[p]?.length ? fromDocs[p] : (seen[p] ?? []);
|
|
414
|
+
// A state Core marks with more than one value (a checkbox's checked and
|
|
415
|
+
// indeterminate looks) is a condition --when names by value.
|
|
416
|
+
for (const st of TARGET.get(target)?.states ?? [])
|
|
417
|
+
if ((seen[st] ?? []).some(v => v !== st)) out[st] = seen[st];
|
|
396
418
|
return out;
|
|
397
419
|
}
|
|
398
420
|
|
|
421
|
+
/**
|
|
422
|
+
* The color stops of a background made of gradients, or null when any
|
|
423
|
+
* layer is an image or any stop has no color the editor can name.
|
|
424
|
+
* @param {string} v
|
|
425
|
+
* @returns {string[] | null}
|
|
426
|
+
*/
|
|
427
|
+
function gradientStops(v) {
|
|
428
|
+
/** The parts between commas outside parentheses. @param {string} x */
|
|
429
|
+
const top = x =>
|
|
430
|
+
splitTop(x, ',')
|
|
431
|
+
.map(part => part.trim())
|
|
432
|
+
.filter(Boolean);
|
|
433
|
+
/** @type {string[]} */
|
|
434
|
+
const stops = [];
|
|
435
|
+
for (const layer of top(v)) {
|
|
436
|
+
const m =
|
|
437
|
+
/^(?:repeating-)?(?:linear|radial|conic)-gradient\((.*)\)$/s.exec(
|
|
438
|
+
layer,
|
|
439
|
+
);
|
|
440
|
+
if (!m) {
|
|
441
|
+
// A layer that is one color (the shorthand's last) is a stop too.
|
|
442
|
+
if (/url\(|gradient\(/.test(layer)) return null;
|
|
443
|
+
stops.push(layer);
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
for (const arg of top(m[1])) {
|
|
447
|
+
// The direction, shape or position comes first, with no color.
|
|
448
|
+
if (
|
|
449
|
+
/^(to\b|at\b|from\b|-?[\d.]+(deg|turn|rad|grad)\b|circle\b|ellipse\b|closest|farthest)/.test(
|
|
450
|
+
arg,
|
|
451
|
+
)
|
|
452
|
+
)
|
|
453
|
+
continue;
|
|
454
|
+
// A stop is its color and up to two positions after it.
|
|
455
|
+
const color = arg.replace(/(\s+-?[\d.]+(%|px|rem|em)?)+$/, '').trim();
|
|
456
|
+
if (!color || /^-?[\d.]+(%|px|rem|em)?$/.test(color)) continue;
|
|
457
|
+
stops.push(color);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return stops.length ? stops : null;
|
|
461
|
+
}
|
|
462
|
+
|
|
399
463
|
/**
|
|
400
464
|
* Text that this theme made unreadable: every real text-on-background pair,
|
|
401
465
|
* in each mode, below 4.5:1 now but not as low in the base theme. Also
|
|
@@ -417,13 +481,18 @@ export function makeCompiler(project, parts) {
|
|
|
417
481
|
extra = [],
|
|
418
482
|
) {
|
|
419
483
|
/**
|
|
420
|
-
* The opaque colors the eye sees for a pair, or null with no fixed color
|
|
484
|
+
* The opaque colors the eye sees for a pair, or null with no fixed color:
|
|
485
|
+
* a see-through background is drawn over what is beneath it (the region
|
|
486
|
+
* the part sits in, else the page).
|
|
421
487
|
* @param {unknown} fg @param {unknown} bg @param {string} m
|
|
488
|
+
* @param {unknown} [beneath]
|
|
422
489
|
*/
|
|
423
|
-
const drawn = (fg, bg, m) => {
|
|
490
|
+
const drawn = (fg, bg, m, beneath = page(m)) => {
|
|
424
491
|
/** @type {[number, number, number]} */
|
|
425
492
|
const ground =
|
|
426
|
-
parseColor(
|
|
493
|
+
parseColor(beneath) ??
|
|
494
|
+
parseColor(page(m)) ??
|
|
495
|
+
(m === 'dark' ? [0, 0, 0] : [255, 255, 255]);
|
|
427
496
|
const bgAlpha = alphaOf(bg);
|
|
428
497
|
const back = parseColor(bg);
|
|
429
498
|
const under =
|
|
@@ -432,7 +501,7 @@ export function makeCompiler(project, parts) {
|
|
|
432
501
|
if (!under || !top) return null;
|
|
433
502
|
return [compositeOver(top, alphaOf(fg), under), under];
|
|
434
503
|
};
|
|
435
|
-
/** @type {Array<{part: string, mode: string, ratio: number, sample: string, fg: string, bgPart: string | null, bg: string}>} */
|
|
504
|
+
/** @type {Array<{part: string, mode: string, ratio: number, sample: string, fg: string, fgToken: string | null, textPart: string | null, when: string | null, bgPart: string | null, bg: string, ground: [number, number, number], over: string | null}>} */
|
|
436
505
|
const out = [];
|
|
437
506
|
const seen = new Set();
|
|
438
507
|
/** @type {Set<string>} */
|
|
@@ -446,9 +515,45 @@ export function makeCompiler(project, parts) {
|
|
|
446
515
|
continue;
|
|
447
516
|
for (const m of modes) {
|
|
448
517
|
const fg = value(p, 'fg', m);
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
const
|
|
518
|
+
const whole = value(p, 'bg', m);
|
|
519
|
+
// The region a part sits in shows through its see-through background.
|
|
520
|
+
const region = p.over ? {...p, bg: p.over} : null;
|
|
521
|
+
const beneath = region ? value(region, 'bg', m) : page(m);
|
|
522
|
+
const baseBeneath = region ? baseValue(region, 'bg', m) : page(m);
|
|
523
|
+
// Over a region, only a see-through background shows it: an opaque
|
|
524
|
+
// one is measured as the pair itself already is.
|
|
525
|
+
if (
|
|
526
|
+
region &&
|
|
527
|
+
alphaOf(whole) >= 1 &&
|
|
528
|
+
!/gradient|url\(/.test(String(whole))
|
|
529
|
+
)
|
|
530
|
+
continue;
|
|
531
|
+
// A gradient is measured at each of its color stops, the worst one
|
|
532
|
+
// counting; an image, or a stop with no fixed color, is not checked.
|
|
533
|
+
const stops = /gradient|url\(/.test(String(whole))
|
|
534
|
+
? gradientStops(String(whole))
|
|
535
|
+
: [whole];
|
|
536
|
+
if (!stops) {
|
|
537
|
+
if (whole !== baseValue(p, 'bg', m)) unchecked.add(String(whole));
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
const measured = stops.map(stop => ({
|
|
541
|
+
stop,
|
|
542
|
+
pair: drawn(fg, stop, m, beneath),
|
|
543
|
+
}));
|
|
544
|
+
if (stops.length > 1 && measured.some(x => !x.pair)) {
|
|
545
|
+
if (whole !== baseValue(p, 'bg', m)) unchecked.add(String(whole));
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
const worst = measured.reduce((a, b) =>
|
|
549
|
+
a.pair &&
|
|
550
|
+
b.pair &&
|
|
551
|
+
ratio(b.pair[0], b.pair[1]) < ratio(a.pair[0], a.pair[1])
|
|
552
|
+
? b
|
|
553
|
+
: a,
|
|
554
|
+
);
|
|
555
|
+
const bg = worst.stop;
|
|
556
|
+
const pair = worst.pair;
|
|
452
557
|
if (!pair) {
|
|
453
558
|
for (const [v, side] of /** @type {const} */ ([
|
|
454
559
|
[fg, 'fg'],
|
|
@@ -465,9 +570,14 @@ export function makeCompiler(project, parts) {
|
|
|
465
570
|
}
|
|
466
571
|
const r = ratio(pair[0], pair[1]);
|
|
467
572
|
if (r >= 4.5) continue;
|
|
468
|
-
const was = drawn(
|
|
573
|
+
const was = drawn(
|
|
574
|
+
baseValue(p, 'fg', m),
|
|
575
|
+
baseValue(p, 'bg', m),
|
|
576
|
+
m,
|
|
577
|
+
baseBeneath,
|
|
578
|
+
);
|
|
469
579
|
if (was && ratio(was[0], was[1]) <= r + 0.05) continue;
|
|
470
|
-
const key = `${p.text}|${fg}|${bg}|${m}`;
|
|
580
|
+
const key = `${p.text}|${fg}|${bg}|${beneath}|${m}`;
|
|
471
581
|
if (seen.has(key)) continue;
|
|
472
582
|
seen.add(key);
|
|
473
583
|
out.push({
|
|
@@ -482,16 +592,30 @@ export function makeCompiler(project, parts) {
|
|
|
482
592
|
? String(fg)
|
|
483
593
|
: (p.fg.tokens[0] ?? String(fg)),
|
|
484
594
|
bgPart: p.bg.target,
|
|
595
|
+
// What shows through a see-through background, when it is the
|
|
596
|
+
// region the part sits in.
|
|
597
|
+
over:
|
|
598
|
+
region && alphaOf(bg) < 1
|
|
599
|
+
? `${p.over?.target}'s ${beneath !== baseBeneath ? String(beneath) : (p.over?.tokens[0] ?? String(beneath))}`
|
|
600
|
+
: null,
|
|
485
601
|
bg:
|
|
486
|
-
|
|
487
|
-
?
|
|
488
|
-
:
|
|
602
|
+
stops.length > 1
|
|
603
|
+
? `${bg}, a stop of its gradient`
|
|
604
|
+
: bg !== baseValue(p, 'bg', m)
|
|
605
|
+
? String(bg)
|
|
606
|
+
: (p.bg.tokens[0] ?? String(bg)),
|
|
607
|
+
// What a fix needs: the token the text reads, the part that draws
|
|
608
|
+
// it, the variant it was measured in, and the opaque color the
|
|
609
|
+
// text sits on.
|
|
610
|
+
fgToken: p.fg.tokens[0] ?? null,
|
|
611
|
+
textPart: p.fg.target ?? null,
|
|
612
|
+
when: /** @type {any} */ (p).when ?? null,
|
|
613
|
+
ground: pair[1],
|
|
489
614
|
});
|
|
490
615
|
}
|
|
491
616
|
}
|
|
492
617
|
return {
|
|
493
|
-
problems: out
|
|
494
|
-
more: Math.max(0, out.length - 8),
|
|
618
|
+
problems: out,
|
|
495
619
|
unchecked: [...unchecked],
|
|
496
620
|
};
|
|
497
621
|
}
|
|
@@ -54,10 +54,14 @@ export function context(cwd: string): Promise<{
|
|
|
54
54
|
ratio: number;
|
|
55
55
|
sample: string;
|
|
56
56
|
fg: string;
|
|
57
|
+
fgToken: string | null;
|
|
58
|
+
textPart: string | null;
|
|
59
|
+
when: string | null;
|
|
57
60
|
bgPart: string | null;
|
|
58
61
|
bg: string;
|
|
62
|
+
ground: [number, number, number];
|
|
63
|
+
over: string | null;
|
|
59
64
|
}[];
|
|
60
|
-
more: number;
|
|
61
65
|
unchecked: string[];
|
|
62
66
|
};
|
|
63
67
|
};
|
|
@@ -86,6 +90,16 @@ export function coreApp(cwd: string): string | null;
|
|
|
86
90
|
* @param {string} message
|
|
87
91
|
*/
|
|
88
92
|
export function renderCause(project: import("./_project.mjs").ThemeProject, message: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* The two copies of React a render saw, when the app's and the one Core
|
|
95
|
+
* resolves differ; else null.
|
|
96
|
+
* @param {import('./_project.mjs').ThemeProject} project
|
|
97
|
+
* @returns {{app: string, core: string} | null}
|
|
98
|
+
*/
|
|
99
|
+
export function reactCopies(project: import("./_project.mjs").ThemeProject): {
|
|
100
|
+
app: string;
|
|
101
|
+
core: string;
|
|
102
|
+
} | null;
|
|
89
103
|
/**
|
|
90
104
|
* Pictures of HTML files, on request.
|
|
91
105
|
* @param {import('./_project.mjs').ThemeProject} project
|
|
@@ -101,14 +115,50 @@ export function pictures(project: import("./_project.mjs").ThemeProject, shots:
|
|
|
101
115
|
problem: string | null;
|
|
102
116
|
}>;
|
|
103
117
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
118
|
+
* The families the theme's build writes that no package loads: not a
|
|
119
|
+
* system or desktop font, not loaded by a font stylesheet the app copy
|
|
120
|
+
* imports (the base's fonts included), and none of `packages` (the font
|
|
121
|
+
* packages that load it where the fonts go: the project's, or a new app's).
|
|
122
|
+
* @param {import('./_settings.mjs').Ctx} ctx
|
|
123
|
+
* @param {import('./_settings.mjs').ThemeData} data
|
|
124
|
+
* @param {Array<{family: string}>} packages
|
|
125
|
+
* @returns {string[]}
|
|
126
|
+
*/
|
|
127
|
+
export function familiesNothingLoads(ctx: import("./_settings.mjs").Ctx, data: import("./_settings.mjs").ThemeData, packages: Array<{
|
|
128
|
+
family: string;
|
|
129
|
+
}>): string[];
|
|
130
|
+
/**
|
|
131
|
+
* What the previews (preview.html, sheet.html and their pictures) cannot
|
|
132
|
+
* show of the images and files the theme's built stylesheet names: a
|
|
133
|
+
* remote file (a page opened from disk loads no network), a file that is
|
|
134
|
+
* not there, one that is not a regular file, and one too large to carry.
|
|
135
|
+
* Read from the built stylesheet with the renderer's own reader, so a
|
|
136
|
+
* preview rendered before says it too.
|
|
137
|
+
* @param {import('./_settings.mjs').Ctx} ctx
|
|
138
|
+
* @param {string} slug
|
|
139
|
+
* @returns {string[]}
|
|
140
|
+
*/
|
|
141
|
+
export function themeImageNotes(ctx: import("./_settings.mjs").Ctx, slug: string): string[];
|
|
142
|
+
/**
|
|
143
|
+
* Font notes for the families the theme builds: the import line for an
|
|
144
|
+
* open font, the install line when its package is missing, and a warning
|
|
145
|
+
* for a family no package loads, naming the closest open font.
|
|
107
146
|
* @param {import('./_settings.mjs').Ctx} ctx
|
|
108
147
|
* @param {import('./_settings.mjs').ThemeData} data
|
|
109
148
|
* @returns {string[]}
|
|
110
149
|
*/
|
|
111
150
|
export function fontNotes(ctx: import("./_settings.mjs").Ctx, data: import("./_settings.mjs").ThemeData): string[];
|
|
151
|
+
/**
|
|
152
|
+
* A note for each weight the theme uses that a stylesheet loading one of
|
|
153
|
+
* its families has no face for (it shows as the face CSS font matching
|
|
154
|
+
* picks): the base theme's font stylesheet, unless an installed package
|
|
155
|
+
* loads that family, and each installed font package with a stylesheet per
|
|
156
|
+
* weight.
|
|
157
|
+
* @param {import('./_settings.mjs').Ctx} ctx
|
|
158
|
+
* @param {import('./_settings.mjs').ThemeData} data
|
|
159
|
+
* @returns {string[]}
|
|
160
|
+
*/
|
|
161
|
+
export function baseWeightNotes(ctx: import("./_settings.mjs").Ctx, data: import("./_settings.mjs").ThemeData): string[];
|
|
112
162
|
/**
|
|
113
163
|
* What a change did to part styles (component settings), one line each.
|
|
114
164
|
* @param {any} before
|
|
@@ -118,7 +168,23 @@ export function fontNotes(ctx: import("./_settings.mjs").Ctx, data: import("./_s
|
|
|
118
168
|
*/
|
|
119
169
|
export function styledChanges(before: any, after: any, base?: any): string[];
|
|
120
170
|
/**
|
|
121
|
-
*
|
|
171
|
+
* The page of the theme's open states (every menu, tooltip, popover and
|
|
172
|
+
* list drawn open: the overlays section of the sheet), made and stamped
|
|
173
|
+
* with the build it shows, and where its picture goes. The sample page
|
|
174
|
+
* (preview.png) has no overlay open, and the full sheet is too tall to
|
|
175
|
+
* read whole, so `--png` takes this picture beside the sample page's.
|
|
176
|
+
* @param {import('./_settings.mjs').Ctx} ctx
|
|
177
|
+
* @param {string} slug
|
|
178
|
+
* @param {import('./_settings.mjs').ThemeData} data
|
|
179
|
+
* @returns {Promise<{html: string, png: string}>}
|
|
180
|
+
*/
|
|
181
|
+
export function openStatesPage(ctx: import("./_settings.mjs").Ctx, slug: string, data: import("./_settings.mjs").ThemeData): Promise<{
|
|
182
|
+
html: string;
|
|
183
|
+
png: string;
|
|
184
|
+
}>;
|
|
185
|
+
/**
|
|
186
|
+
* Previews after a change: the sample page always; on request, pictures of
|
|
187
|
+
* it and of the open states ({@link openStatesPage}).
|
|
122
188
|
* @param {import('./_settings.mjs').Ctx} ctx
|
|
123
189
|
* @param {string} slug
|
|
124
190
|
* @param {import('./_settings.mjs').ThemeData} data
|
|
@@ -146,6 +212,8 @@ export function stampSheet(file: string, slug: string, cwd: string): void;
|
|
|
146
212
|
* that is not a section.
|
|
147
213
|
* @param {string | undefined} section
|
|
148
214
|
* @param {string} [theme] the theme the suggestions name
|
|
215
|
+
* @param {string} [rest] the command's other options as typed (` --png`):
|
|
216
|
+
* the offered command keeps them, with only the section fixed
|
|
149
217
|
* @returns {string | undefined}
|
|
150
218
|
*/
|
|
151
|
-
export function checkSection(section: string | undefined, theme?: string): string | undefined;
|
|
219
|
+
export function checkSection(section: string | undefined, theme?: string, rest?: string): string | undefined;
|