@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
|
@@ -29,21 +29,40 @@ import {
|
|
|
29
29
|
RenderError,
|
|
30
30
|
} from '../../foundation/render/render-page.mjs';
|
|
31
31
|
import {SAMPLE_PAGE, elementNames, pageSource} from './_catalog.mjs';
|
|
32
|
+
import {removeOnStop} from '../../foundation/fs/stop-cleanup.mjs';
|
|
32
33
|
|
|
33
34
|
/** Bump when the shape of the cached part data changes. */
|
|
34
|
-
const PART_DATA_VERSION =
|
|
35
|
+
const PART_DATA_VERSION = 12;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Flags that change what a component does or whether it shows, not how it
|
|
39
|
+
* looks: the catalog never turns them on (disabled has its own entry).
|
|
40
|
+
*/
|
|
41
|
+
const LIFECYCLE_FLAGS = new Set([
|
|
42
|
+
'isDisabled',
|
|
43
|
+
'isOpen',
|
|
44
|
+
'isDefaultOpen',
|
|
45
|
+
'hasAutoFocus',
|
|
46
|
+
'isHidden',
|
|
47
|
+
]);
|
|
35
48
|
|
|
36
49
|
/**
|
|
37
50
|
* @typedef {object} PartRecord
|
|
38
51
|
* @property {Record<string, {tokens: Record<string, string[]>, values: string[]}>} own - property -> tokens (with conditions) and raw values
|
|
52
|
+
* @property {Record<string, Record<string, string>>} [at] - property -> the value under each condition, private variables resolved
|
|
39
53
|
* @property {Record<string, string[]>} inside - tokens read by unnamed elements inside the part -> properties
|
|
40
54
|
* @property {Record<string, string[]>} attrs - data attributes seen on the part
|
|
41
55
|
* @property {string[]} contains - parts rendered inside it
|
|
56
|
+
* @property {string[]} [tags] - the elements it is rendered as (`tr` for a table row)
|
|
57
|
+
* @property {string[]} [innerCorners] - the radius tokens of the corners Core draws by place on the parts directly inside it (a button group's end buttons)
|
|
58
|
+
* @property {Record<string, Record<string, string>>} [inline] - state ('' for always) -> property -> the token Core paints it with as an inline style, which no theme rule can replace
|
|
42
59
|
*/
|
|
43
60
|
|
|
44
61
|
/**
|
|
45
62
|
* @typedef {{target: string | null, tokens: string[], raw: string | null}} PaintSide
|
|
46
|
-
* @typedef {{text: string, fg: PaintSide, bg: PaintSide, sample: string}} TextPair
|
|
63
|
+
* @typedef {{text: string, fg: PaintSide, bg: PaintSide, sample: string, over?: PaintSide}} TextPair
|
|
64
|
+
* `over`: the region the part sits in (a header), whose background shows
|
|
65
|
+
* through a see-through background of the part's own, else the page
|
|
47
66
|
* @typedef {{version: number, coreKey: string, map: Record<string, PartRecord>, pairs: TextPair[], rendered: number, items: number}} PartData
|
|
48
67
|
*/
|
|
49
68
|
|
|
@@ -177,7 +196,8 @@ export function isItemOf(project, name) {
|
|
|
177
196
|
* A component's catalog entries, all from its doc: its demo props
|
|
178
197
|
* ({@link demoProps}), then once per value of each visual prop with a
|
|
179
198
|
* closed set of values (`variant`, `status`, `color`, and a number union
|
|
180
|
-
* such as a heading's level),
|
|
199
|
+
* such as a heading's level), its checked and disabled states, and each look
|
|
200
|
+
* flag (`isStriped`) turned on. An
|
|
181
201
|
* overlay the playground shows in place renders open; on a page people
|
|
182
202
|
* see, once, as some of its variants size the window, not the card.
|
|
183
203
|
* @param {import('./_project.mjs').ThemeProject} project
|
|
@@ -223,6 +243,12 @@ export function catalogVariants(project, name, cap, opts = {}) {
|
|
|
223
243
|
// The states the doc names that a prop sets: checked (a boolean value)
|
|
224
244
|
// and disabled. The label says the state shown.
|
|
225
245
|
const states = new Set(info.targets.flatMap(t => t.states ?? []));
|
|
246
|
+
// A value the doc lists beside true and false (a checkbox's
|
|
247
|
+
// 'indeterminate'): rendered too, so the look Core gives it is read.
|
|
248
|
+
if (states.has('checked'))
|
|
249
|
+
for (const word of literals(info.props?.value?.type ?? ''))
|
|
250
|
+
if (word !== 'true' && word !== 'false')
|
|
251
|
+
variants.push({label: word, props: {...base, value: word}});
|
|
226
252
|
if (states.has('checked') && info.props?.value?.type.startsWith('boolean')) {
|
|
227
253
|
const on = base.value !== true;
|
|
228
254
|
variants.push({
|
|
@@ -243,6 +269,17 @@ export function catalogVariants(project, name, cap, opts = {}) {
|
|
|
243
269
|
if (n !== base[p])
|
|
244
270
|
variants.push({label: `${p} ${n}`, props: {...base, [p]: n}});
|
|
245
271
|
}
|
|
272
|
+
// Each look flag the doc names (`isStriped`, `hasHover`), turned on, so
|
|
273
|
+
// the styles Core gives only under it are read too: a table row's hover
|
|
274
|
+
// and stripes come from its table's flags.
|
|
275
|
+
for (const [p, doc] of Object.entries(info.props ?? {}))
|
|
276
|
+
if (
|
|
277
|
+
/^(is|has)[A-Z]/.test(p) &&
|
|
278
|
+
!LIFECYCLE_FLAGS.has(p) &&
|
|
279
|
+
String(/** @type {any} */ (doc)?.type ?? '').trim() === 'boolean' &&
|
|
280
|
+
base[p] !== true
|
|
281
|
+
)
|
|
282
|
+
variants.push({label: p, props: {...base, [p]: true}});
|
|
246
283
|
return variants.slice(0, cap);
|
|
247
284
|
}
|
|
248
285
|
|
|
@@ -367,14 +404,9 @@ export async function renderGenerated(project, file, source, extra = []) {
|
|
|
367
404
|
);
|
|
368
405
|
})();
|
|
369
406
|
fs.mkdirSync(dir, {recursive: true});
|
|
370
|
-
// Stopped by a signal, the render folder
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
cleanup();
|
|
374
|
-
process.kill(process.pid, sig);
|
|
375
|
-
};
|
|
376
|
-
process.once('SIGINT', onSignal);
|
|
377
|
-
process.once('SIGTERM', onSignal);
|
|
407
|
+
// Stopped by a signal (the terminal closing too), the render folder
|
|
408
|
+
// still goes.
|
|
409
|
+
const untrack = removeOnStop(dir);
|
|
378
410
|
const entry = path.join(dir, file);
|
|
379
411
|
// Demo images point at the docs site's own folder (`/template-assets/…`),
|
|
380
412
|
// which a page opened from disk cannot reach: the inline placeholder
|
|
@@ -430,8 +462,7 @@ export async function renderGenerated(project, file, source, extra = []) {
|
|
|
430
462
|
fs.rmSync(f, {force: true});
|
|
431
463
|
// Another render may still use it: a folder with a file in it stays.
|
|
432
464
|
removeEmptyFolder(madeThemes ? themes : dir, {deep: true});
|
|
433
|
-
|
|
434
|
-
process.removeListener('SIGTERM', onSignal);
|
|
465
|
+
untrack();
|
|
435
466
|
}
|
|
436
467
|
}
|
|
437
468
|
|
|
@@ -473,6 +504,141 @@ export async function partData(project) {
|
|
|
473
504
|
return data;
|
|
474
505
|
}
|
|
475
506
|
|
|
507
|
+
/** The tokens Core's indicator focus ring is drawn from, per property. */
|
|
508
|
+
const RING_TOKENS = {
|
|
509
|
+
'outline-width': '--focus-outline-width',
|
|
510
|
+
'outline-style': '--focus-outline-style',
|
|
511
|
+
'outline-color': '--focus-outline-color',
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Add the focus ring a control draws on its indicator at focus time (Core's
|
|
516
|
+
* `useIndicatorFocusRing`, used by a control whose input is visually
|
|
517
|
+
* hidden): an inline style the server render never shows, read from the
|
|
518
|
+
* focus outline tokens. The tokens are read by the indicator always (it
|
|
519
|
+
* never takes focus itself, so no state reaches the ring), and the outline
|
|
520
|
+
* properties are painted inline, which no theme rule can replace. The
|
|
521
|
+
* indicator is the control's own `-indicator` target, or for a part of
|
|
522
|
+
* another component (a radio list's item), that component's.
|
|
523
|
+
* @param {import('./_project.mjs').ThemeProject} project
|
|
524
|
+
* @param {Record<string, PartRecord>} map
|
|
525
|
+
*/
|
|
526
|
+
function addIndicatorRings(project, map) {
|
|
527
|
+
for (const [name, info] of Object.entries(project.components)) {
|
|
528
|
+
const at = info.importPath?.split('/').pop();
|
|
529
|
+
let source;
|
|
530
|
+
try {
|
|
531
|
+
source = at
|
|
532
|
+
? fs.readFileSync(
|
|
533
|
+
path.join(project.coreDir, 'dist', at, `${name}.js`),
|
|
534
|
+
'utf8',
|
|
535
|
+
)
|
|
536
|
+
: '';
|
|
537
|
+
} catch {
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
if (!source.includes('useIndicatorFocusRing')) continue;
|
|
541
|
+
/** @param {import('./_project.mjs').ComponentInfo | undefined} c */
|
|
542
|
+
const indicators = c =>
|
|
543
|
+
(c?.targets ?? [])
|
|
544
|
+
.map(t => t.className.replace(/^astryx-/, ''))
|
|
545
|
+
.filter(k => k.endsWith('-indicator'));
|
|
546
|
+
const own = indicators(info);
|
|
547
|
+
const keys = own.length
|
|
548
|
+
? own
|
|
549
|
+
: indicators(
|
|
550
|
+
info.subComponentOf
|
|
551
|
+
? project.components[info.subComponentOf]
|
|
552
|
+
: undefined,
|
|
553
|
+
);
|
|
554
|
+
for (const key of keys) {
|
|
555
|
+
const rec = (map[key] ??= {
|
|
556
|
+
own: {},
|
|
557
|
+
inside: {},
|
|
558
|
+
attrs: {},
|
|
559
|
+
contains: [],
|
|
560
|
+
});
|
|
561
|
+
for (const [prop, token] of Object.entries(RING_TOKENS)) {
|
|
562
|
+
rec.inside[token] = [...new Set([...(rec.inside[token] ?? []), prop])];
|
|
563
|
+
(rec.inline ??= {})[''] = {...rec.inline?.[''], [prop]: token};
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Add the paint Core writes as an inline style when it sets a theme state
|
|
571
|
+
* at run time (a table row's selection wash, set by the selection plugin
|
|
572
|
+
* beside the row's `selected` state): something the server render never
|
|
573
|
+
* shows. A built module under a component's folder that writes a state's
|
|
574
|
+
* attribute (`themeDataAttributes({selected: 'selected'})`) and an inline
|
|
575
|
+
* property from a color token (`el.style.backgroundColor = …` with
|
|
576
|
+
* `colorVars['--color-accent-muted']`) paints that state with it, on each
|
|
577
|
+
* of the component's targets that lists the state.
|
|
578
|
+
* @param {import('./_project.mjs').ThemeProject} project
|
|
579
|
+
* @param {Record<string, PartRecord>} map
|
|
580
|
+
*/
|
|
581
|
+
function addInlineStatePaint(project, map) {
|
|
582
|
+
const dist = path.join(project.coreDir, 'dist');
|
|
583
|
+
/** @param {string} dir @returns {string[]} */
|
|
584
|
+
const modules = dir => {
|
|
585
|
+
let entries;
|
|
586
|
+
try {
|
|
587
|
+
entries = fs.readdirSync(dir, {withFileTypes: true});
|
|
588
|
+
} catch {
|
|
589
|
+
return [];
|
|
590
|
+
}
|
|
591
|
+
return entries.flatMap(e =>
|
|
592
|
+
e.isDirectory()
|
|
593
|
+
? modules(path.join(dir, e.name))
|
|
594
|
+
: e.name.endsWith('.js')
|
|
595
|
+
? [path.join(dir, e.name)]
|
|
596
|
+
: [],
|
|
597
|
+
);
|
|
598
|
+
};
|
|
599
|
+
for (const [name, info] of Object.entries(project.components)) {
|
|
600
|
+
const folder = info.importPath?.split('/').pop();
|
|
601
|
+
if (!folder || folder !== name) continue;
|
|
602
|
+
const withStates = info.targets.filter(t => t.states.length);
|
|
603
|
+
if (!withStates.length) continue;
|
|
604
|
+
for (const file of modules(path.join(dist, folder))) {
|
|
605
|
+
const source = fs.readFileSync(file, 'utf8');
|
|
606
|
+
const states = [
|
|
607
|
+
...source.matchAll(
|
|
608
|
+
/themeDataAttributes\(\{\s*([\w-]+):\s*'\1'\s*\}\)/g,
|
|
609
|
+
),
|
|
610
|
+
].map(m => m[1]);
|
|
611
|
+
if (!states.length) continue;
|
|
612
|
+
const props = [
|
|
613
|
+
...source.matchAll(/\.style\.([a-z][A-Za-z]*)\s*=(?!=)/g),
|
|
614
|
+
].map(m => m[1].replace(/[A-Z]/g, c => `-${c.toLowerCase()}`));
|
|
615
|
+
const colorTokens = [
|
|
616
|
+
...source.matchAll(/colorVars\[['"](--color-[\w-]+)['"]\]/g),
|
|
617
|
+
].map(m => m[1]);
|
|
618
|
+
if (!props.length || colorTokens.length !== 1) continue;
|
|
619
|
+
for (const t of withStates) {
|
|
620
|
+
const key = t.className.replace(/^astryx-/, '');
|
|
621
|
+
const rec = map[key];
|
|
622
|
+
if (!rec) continue;
|
|
623
|
+
for (const state of states.filter(st => t.states.includes(st)))
|
|
624
|
+
for (const prop of props) {
|
|
625
|
+
(rec.inline ??= {})[state] = {
|
|
626
|
+
...rec.inline?.[state],
|
|
627
|
+
[prop]: colorTokens[0],
|
|
628
|
+
};
|
|
629
|
+
const own = (rec.own[prop] ??= {tokens: {}, values: []});
|
|
630
|
+
own.tokens[colorTokens[0]] = [
|
|
631
|
+
...new Set([
|
|
632
|
+
...(own.tokens[colorTokens[0]] ?? []),
|
|
633
|
+
`${state}=${state}`,
|
|
634
|
+
]),
|
|
635
|
+
];
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
476
642
|
/**
|
|
477
643
|
* Build the part data: render the catalog, then walk its markup.
|
|
478
644
|
* @param {import('./_project.mjs').ThemeProject} project
|
|
@@ -496,7 +662,9 @@ async function buildPartData(project) {
|
|
|
496
662
|
// No stylesheet: every part reads nothing.
|
|
497
663
|
}
|
|
498
664
|
const tokens = new Set(Object.keys(project.core.tokenDefaults ?? {}));
|
|
499
|
-
const result = walkMarkup(markup, declarations(css), tokens);
|
|
665
|
+
const result = walkMarkup(markup, declarations(css), tokens, project.target);
|
|
666
|
+
addInlineStatePaint(project, result.map);
|
|
667
|
+
addIndicatorRings(project, result.map);
|
|
500
668
|
return {
|
|
501
669
|
version: PART_DATA_VERSION,
|
|
502
670
|
coreKey: project.coreKey,
|
|
@@ -666,16 +834,35 @@ function expand(v, env, tokens, seen = new Set(), depth = 0) {
|
|
|
666
834
|
return out;
|
|
667
835
|
}
|
|
668
836
|
|
|
837
|
+
/**
|
|
838
|
+
* A value with the private variables set on the element or its ancestors
|
|
839
|
+
* put in (a variable with no fallback only), so it reads public tokens and
|
|
840
|
+
* literal values alone where it can.
|
|
841
|
+
* @param {string} v
|
|
842
|
+
* @param {Record<string, string>} env
|
|
843
|
+
* @param {Set<string>} tokens
|
|
844
|
+
* @param {number} [depth]
|
|
845
|
+
* @returns {string}
|
|
846
|
+
*/
|
|
847
|
+
function resolvePrivate(v, env, tokens, depth = 0) {
|
|
848
|
+
if (depth > 8) return v;
|
|
849
|
+
const out = v.replace(/var\((--[a-zA-Z0-9_-]+)\)/g, (m, name) =>
|
|
850
|
+
!tokens.has(name) && env[name] != null ? env[name] : m,
|
|
851
|
+
);
|
|
852
|
+
return out === v ? v : resolvePrivate(out, env, tokens, depth + 1);
|
|
853
|
+
}
|
|
854
|
+
|
|
669
855
|
/**
|
|
670
856
|
* Walk server-rendered markup: for each element, its classes' declarations
|
|
671
857
|
* become what its part reads; text records the color pair it sits on.
|
|
672
858
|
* @param {string} html
|
|
673
859
|
* @param {ReturnType<typeof declarations>} decls
|
|
674
860
|
* @param {Set<string>} tokens
|
|
861
|
+
* @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
|
|
675
862
|
* @returns {{map: Record<string, PartRecord>, pairs: TextPair[]}}
|
|
676
863
|
*/
|
|
677
|
-
export function walkMarkup(html, decls, tokens) {
|
|
678
|
-
/** @type {Record<string, {own: Record<string, {tokens: Record<string, Set<string>>, values: Set<string>}>, inside: Record<string, Set<string>>, attrs: Record<string, Set<string>>, contains: Set<string>}>} */
|
|
864
|
+
export function walkMarkup(html, decls, tokens, targets = new Map()) {
|
|
865
|
+
/** @type {Record<string, {own: Record<string, {tokens: Record<string, Set<string>>, values: Set<string>}>, at: Record<string, Record<string, string>>, inside: Record<string, Set<string>>, attrs: Record<string, Set<string>>, contains: Set<string>, tags: Set<string>, innerCorners: Set<string>}>} */
|
|
679
866
|
const map = {};
|
|
680
867
|
/** @type {Array<{env: Record<string, string>, target: string | null, fg: PaintSide | null, bg: PaintSide | null}>} */
|
|
681
868
|
const stack = [{env: {}, target: null, fg: null, bg: null}];
|
|
@@ -706,14 +893,35 @@ export function walkMarkup(html, decls, tokens) {
|
|
|
706
893
|
const cls = (/class="([^"]*)"/.exec(attrs)?.[1] ?? '')
|
|
707
894
|
.split(/\s+/)
|
|
708
895
|
.filter(Boolean);
|
|
896
|
+
const parent = stack[stack.length - 1];
|
|
897
|
+
// The theming targets the element carries (else the one it sits in).
|
|
898
|
+
const keys = cls
|
|
899
|
+
.filter(c => c.startsWith('astryx-') && !c.startsWith('astryx-theme'))
|
|
900
|
+
.map(c => c.slice(7));
|
|
901
|
+
const declaredBy = (keys.length ? keys : [parent.target])
|
|
902
|
+
.map(k => (k ? targets.get(k) : undefined))
|
|
903
|
+
.filter(t => t != null);
|
|
904
|
+
const props = new Set(declaredBy.flatMap(t => t.props));
|
|
905
|
+
const states = new Set(declaredBy.flatMap(t => t.states));
|
|
906
|
+
// A data attribute the element's target declares (a visual prop or a
|
|
907
|
+
// runtime state, written by `themeProps` as `data-<name>`) is a
|
|
908
|
+
// condition of what the part reads.
|
|
709
909
|
const dataAttrs = Object.fromEntries(
|
|
710
|
-
[
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
),
|
|
714
|
-
].map(x => [x[1], x[2]]),
|
|
910
|
+
[...attrs.matchAll(/\bdata-([a-z][\w-]*)="([^"]*)"/g)]
|
|
911
|
+
.filter(x => props.has(x[1]) || states.has(x[1]))
|
|
912
|
+
.map(x => [x[1], x[2]]),
|
|
715
913
|
);
|
|
716
|
-
|
|
914
|
+
// The place another component puts a part in (the current page's
|
|
915
|
+
// button in a pagination, a pressed toggle) is a condition of what that
|
|
916
|
+
// component styles it with there, never the part's look at rest. A part
|
|
917
|
+
// that marks the place with a runtime state of its own (a selected tab)
|
|
918
|
+
// is conditioned by that state already.
|
|
919
|
+
const ownState = Object.keys(dataAttrs).some(k => states.has(k));
|
|
920
|
+
const context = ownState
|
|
921
|
+
? []
|
|
922
|
+
: [...attrs.matchAll(/\b(aria-(?:current|pressed))="([^"]*)"/g)]
|
|
923
|
+
.filter(x => x[2] !== 'false')
|
|
924
|
+
.map(x => `${x[1]}=${x[2]}`);
|
|
717
925
|
const env = {...parent.env};
|
|
718
926
|
const own = cls.flatMap(c => decls.get(c) ?? []);
|
|
719
927
|
for (const d of own)
|
|
@@ -723,25 +931,39 @@ export function walkMarkup(html, decls, tokens) {
|
|
|
723
931
|
);
|
|
724
932
|
const target = named[0]?.slice(7) ?? parent.target;
|
|
725
933
|
const ownsTarget = named.length > 0;
|
|
726
|
-
|
|
727
|
-
|
|
934
|
+
// An element can carry several targets (a shell's side nav region is a
|
|
935
|
+
// layout panel too): its declarations are each one's own.
|
|
936
|
+
for (const t of ownsTarget ? named.map(c => c.slice(7)) : [target]) {
|
|
937
|
+
if (!t) continue;
|
|
938
|
+
const T = (map[t] ??= {
|
|
728
939
|
own: {},
|
|
940
|
+
at: {},
|
|
729
941
|
inside: {},
|
|
730
942
|
attrs: {},
|
|
731
943
|
contains: new Set(),
|
|
944
|
+
tags: new Set(),
|
|
945
|
+
innerCorners: new Set(),
|
|
732
946
|
});
|
|
733
947
|
if (ownsTarget)
|
|
734
948
|
for (const [k, v] of Object.entries(dataAttrs))
|
|
735
949
|
(T.attrs[k] ??= new Set()).add(v);
|
|
736
|
-
const cond0 =
|
|
737
|
-
.map(([k, v]) => `${k}=${v}`)
|
|
738
|
-
|
|
950
|
+
const cond0 = [
|
|
951
|
+
...Object.entries(dataAttrs).map(([k, v]) => `${k}=${v}`),
|
|
952
|
+
...context,
|
|
953
|
+
].join(',');
|
|
739
954
|
for (const d of own) {
|
|
740
955
|
if (d.prop.startsWith('--')) continue;
|
|
956
|
+
// (An inherited background paints nothing of its own: it reads no
|
|
957
|
+
// token, and what shows is its parent's.)
|
|
741
958
|
const toks = expand(d.value, env, tokens);
|
|
742
959
|
const cond = [cond0, d.cond].filter(Boolean).join(' ');
|
|
743
960
|
if (ownsTarget) {
|
|
744
961
|
const P = (T.own[d.prop] ??= {tokens: {}, values: new Set()});
|
|
962
|
+
(T.at[d.prop] ??= {})[cond || 'always'] ??= resolvePrivate(
|
|
963
|
+
d.value,
|
|
964
|
+
env,
|
|
965
|
+
tokens,
|
|
966
|
+
);
|
|
745
967
|
P.values.add(
|
|
746
968
|
d.value.length > 80 ? `${d.value.slice(0, 80)}...` : d.value,
|
|
747
969
|
);
|
|
@@ -763,14 +985,25 @@ export function walkMarkup(html, decls, tokens) {
|
|
|
763
985
|
}
|
|
764
986
|
if (d.prop === 'background-color') {
|
|
765
987
|
const t = [...expand(d.value, env, tokens)];
|
|
766
|
-
if (t.length || !/transparent
|
|
988
|
+
if (t.length || !/transparent|^\s*inherit\s*$/i.test(d.value))
|
|
767
989
|
bg = {target, tokens: t, raw: t.length ? null : d.value};
|
|
768
990
|
}
|
|
769
991
|
}
|
|
770
|
-
|
|
992
|
+
for (const t of ownsTarget ? named.map(c => c.slice(7)) : [])
|
|
771
993
|
for (const anc of stack)
|
|
772
|
-
if (anc.target && anc.target !== target)
|
|
773
|
-
|
|
994
|
+
if (anc.target && anc.target !== t) map[anc.target].contains.add(t);
|
|
995
|
+
if (ownsTarget) {
|
|
996
|
+
for (const t of named) map[t.slice(7)].tags.add(tag.toLowerCase());
|
|
997
|
+
// Corners Core draws on a part by its place among its siblings (a
|
|
998
|
+
// button group's first and last buttons): the radius token they read
|
|
999
|
+
// is the enclosing part's corners.
|
|
1000
|
+
if (parent.target && !named.includes(`astryx-${parent.target}`))
|
|
1001
|
+
for (const d of own)
|
|
1002
|
+
if (/^border-(start|end)-(start|end)-radius$/.test(d.prop))
|
|
1003
|
+
for (const tok of expand(d.value, env, tokens))
|
|
1004
|
+
if (/^--radius-/.test(tok))
|
|
1005
|
+
map[parent.target].innerCorners.add(tok);
|
|
1006
|
+
}
|
|
774
1007
|
if (!selfClose && !VOID.has(tag.toLowerCase()))
|
|
775
1008
|
stack.push({env, target, fg, bg});
|
|
776
1009
|
}
|
|
@@ -792,6 +1025,7 @@ export function walkMarkup(html, decls, tokens) {
|
|
|
792
1025
|
},
|
|
793
1026
|
]),
|
|
794
1027
|
),
|
|
1028
|
+
at: v.at,
|
|
795
1029
|
inside: Object.fromEntries(
|
|
796
1030
|
Object.entries(v.inside).map(([k, s]) => [k, [...s]]),
|
|
797
1031
|
),
|
|
@@ -799,6 +1033,8 @@ export function walkMarkup(html, decls, tokens) {
|
|
|
799
1033
|
Object.entries(v.attrs).map(([k, s]) => [k, [...s]]),
|
|
800
1034
|
),
|
|
801
1035
|
contains: [...v.contains],
|
|
1036
|
+
tags: [...v.tags],
|
|
1037
|
+
innerCorners: [...v.innerCorners],
|
|
802
1038
|
};
|
|
803
1039
|
}
|
|
804
1040
|
return {map: out, pairs: [...pairs.values()]};
|
|
@@ -26,18 +26,6 @@ export function addWiring(cwd: string, slug: string, mode?: "light" | "dark" | "
|
|
|
26
26
|
* @returns {string[]}
|
|
27
27
|
*/
|
|
28
28
|
export function appWiring(ctx: import("./_settings.mjs").Ctx, slug: string, data: import("./_settings.mjs").ThemeData): string[];
|
|
29
|
-
/**
|
|
30
|
-
* For tests: stop the next preview changes at the step where `when`
|
|
31
|
-
* returns true, as a kill would, with nothing put back. Null clears it.
|
|
32
|
-
* @param {((step: string) => boolean) | null} when
|
|
33
|
-
*/
|
|
34
|
-
export function stopPreviewCommitAt(when: ((step: string) => boolean) | null): void;
|
|
35
|
-
/**
|
|
36
|
-
* For tests: read at most `n` source files when checking for importers
|
|
37
|
-
* (null: the default).
|
|
38
|
-
* @param {number | null} n
|
|
39
|
-
*/
|
|
40
|
-
export function setImporterScanMax(n: number | null): void;
|
|
41
29
|
/**
|
|
42
30
|
* Rewrite the in-app preview routes of a theme when their imports changed, so
|
|
43
31
|
* a font package installed after `set` loads on the next change or `show`,
|
|
@@ -68,12 +56,18 @@ export function refreshPreviewRoute(cwd: string, slug: string): Promise<{
|
|
|
68
56
|
* @param {'colors' | 'components' | 'overview'} focus
|
|
69
57
|
* @param {{code: string, cause: string} | null} [notChecked] why the change
|
|
70
58
|
* could not be rendered
|
|
59
|
+
* @param {{pictureProblem?: string | null, stale?: string[]}} [extra] this
|
|
60
|
+
* result's picture problem (what kept --png from taking pictures) and its
|
|
61
|
+
* previewStale entries (an in-app preview changed by hand)
|
|
71
62
|
* @returns {string}
|
|
72
63
|
*/
|
|
73
64
|
export function seeLine(cwd: string, slug: string, focus: "colors" | "components" | "overview", notChecked?: {
|
|
74
65
|
code: string;
|
|
75
66
|
cause: string;
|
|
76
|
-
} | null
|
|
67
|
+
} | null, extra?: {
|
|
68
|
+
pictureProblem?: string | null;
|
|
69
|
+
stale?: string[];
|
|
70
|
+
}): string;
|
|
77
71
|
/**
|
|
78
72
|
* Add pages to the in-app theme preview, and write the preview route the
|
|
79
73
|
* first time. With a description, the build ranking picks the template
|