@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69
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 +64 -63
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +122 -6
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +3 -3
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +62 -3
- package/api/build/kit/answer.mjs +2 -3
- package/api/build/kit/signals.d.mts +10 -0
- package/api/build/kit/signals.mjs +15 -2
- package/api/component/detail/blocks/blocks.mjs +2 -1
- package/api/discover/_adapter.d.mts +57 -6
- package/api/discover/_adapter.mjs +278 -49
- package/api/discover/_catalog-view.d.mts +7 -0
- package/api/discover/_catalog-view.mjs +10 -1
- package/api/discover/detail/detail.d.mts +3 -2
- package/api/discover/detail/detail.mjs +3 -2
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/discover.d.mts +24 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +146 -25
- package/api/discover/discover.type.d.mts +6 -4
- package/api/discover/discover.type.mjs +6 -4
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +290 -70
- package/api/docs/_entry-names.mjs +4 -3
- package/api/doctor/_adapter.d.mts +43 -3
- package/api/doctor/_adapter.mjs +142 -18
- package/api/doctor/built-checks.d.mts +30 -3
- package/api/doctor/built-checks.mjs +132 -5
- package/api/doctor/doctor.d.mts +93 -6
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/doctor/doctor.mjs +524 -33
- package/api/doctor/doctor.type.d.mts +2 -1
- package/api/doctor/doctor.type.mjs +2 -1
- package/api/doctor/theme-checks.d.mts +19 -0
- package/api/doctor/theme-checks.mjs +74 -6
- package/api/hook/hook.type.d.mts +1 -1
- package/api/hook/hook.type.mjs +1 -1
- package/api/hook/list/list.mjs +11 -7
- package/api/icon/_adapter.d.mts +2 -1
- package/api/icon/_adapter.mjs +10 -15
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +3 -3
- package/api/icon/icon.type.d.mts +32 -1
- package/api/icon/icon.type.mjs +19 -3
- package/api/icon/list/list.mjs +4 -1
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +18 -8
- package/api/icon/search/search.d.mts +26 -3
- package/api/icon/search/search.mjs +155 -9
- package/api/init/_adapter.d.mts +14 -0
- package/api/init/_adapter.mjs +26 -4
- package/api/init/init.d.mts +1 -1
- package/api/init/init.doc.mjs +2 -2
- package/api/init/init.mjs +1 -1
- package/api/init/init.type.d.mts +29 -1
- package/api/init/init.type.mjs +14 -1
- package/api/init/run/run.d.mts +11 -1
- package/api/init/run/run.mjs +84 -5
- package/api/integration/_adapter.d.mts +5 -4
- package/api/integration/_adapter.mjs +7 -5
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +8 -9
- package/api/integration/validate-integration.d.mts +1 -1
- package/api/integration/validate-integration.mjs +26 -24
- package/api/integration/validate-integration.type.d.mts +5 -2
- package/api/integration/validate-integration.type.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.d.mts +4 -2
- package/api/render/_adapter.mjs +62 -21
- package/api/render/render.doc.mjs +8 -5
- package/api/render/render.mjs +1 -1
- package/api/render/render.type.d.mts +2 -0
- package/api/render/render.type.mjs +2 -0
- package/api/search/ORDERING.md +2 -2
- package/api/search/_candidate-score.d.mts +3 -0
- package/api/search/_candidate-score.mjs +36 -3
- package/api/search/_gather-docs.mjs +29 -2
- package/api/search/_gather-templates.mjs +2 -1
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_named-keywords.d.mts +2 -1
- package/api/search/_named-keywords.mjs +48 -6
- package/api/search/_order.d.mts +36 -1
- package/api/search/_order.mjs +141 -3
- package/api/swizzle/list/list.mjs +8 -1
- package/api/swizzle/swizzle.type.d.mts +1 -1
- package/api/swizzle/swizzle.type.mjs +1 -1
- package/api/template/copy/copy.mjs +3 -4
- package/api/template/list/list.mjs +2 -1
- package/api/template/show/show.mjs +2 -1
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +19 -1
- package/api/template/template.type.d.mts +1 -0
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +1 -0
- package/api/theme/_adapter.mjs +3 -5
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/build/build.d.mts +4 -10
- package/api/theme/build/build.mjs +165 -116
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/generator.mjs +24 -0
- package/api/theme/theme.type.d.mts +4 -2
- package/api/theme/theme.type.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +2 -2
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +100 -22
- package/api/theme-edit/_check.mjs +213 -43
- package/api/theme-edit/_color.d.mts +14 -0
- package/api/theme-edit/_color.mjs +22 -0
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +20 -2
- package/api/theme-edit/_context.mjs +157 -29
- package/api/theme-edit/_edit.mjs +426 -58
- package/api/theme-edit/_how-question.d.mts +14 -0
- package/api/theme-edit/_how-question.mjs +1541 -127
- package/api/theme-edit/_how.mjs +43 -0
- package/api/theme-edit/_missed.mjs +107 -27
- package/api/theme-edit/_normal.d.mts +18 -4
- package/api/theme-edit/_normal.mjs +84 -3
- package/api/theme-edit/_palette.d.mts +9 -0
- package/api/theme-edit/_palette.mjs +158 -33
- package/api/theme-edit/_part-words.mjs +16 -3
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +120 -36
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +255 -67
- package/api/theme-edit/_project.d.mts +12 -1
- package/api/theme-edit/_project.mjs +16 -1
- package/api/theme-edit/_settings.d.mts +116 -0
- package/api/theme-edit/_settings.mjs +1197 -58
- package/api/theme-edit/_tables.d.mts +16 -0
- package/api/theme-edit/_tables.mjs +34 -4
- package/api/theme-edit/theme-edit.type.d.mts +15 -2
- package/api/theme-edit/theme-edit.type.mjs +8 -6
- package/api/upgrade/_adapter.d.mts +46 -7
- package/api/upgrade/_adapter.mjs +110 -15
- package/api/upgrade/registry/registry.d.mts +6 -3
- package/api/upgrade/registry/registry.mjs +21 -6
- package/api/upgrade/run/run.mjs +23 -11
- package/api/upgrade/upgrade.doc.mjs +4 -3
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +6 -6
- package/assets/docs/tree/problems.doc.mjs +3 -3
- package/assets/docs/tree/render-pages.doc.mjs +17 -3
- package/assets/docs/tree/share-a-page.doc.mjs +5 -5
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +40 -5
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +6 -2
- package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +3 -1
- package/assets/templates/pages/centered-hero/page.tsx +1 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +2 -2
- package/assets/templates/pages/course-detail/page.tsx +1 -1
- package/assets/templates/pages/dashboard/page.tsx +24 -8
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
- package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
- package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
- package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
- package/assets/templates/pages/detail-page/page.tsx +22 -5
- package/assets/templates/pages/documentation/page.tsx +4 -2
- package/assets/templates/pages/documentation-design/page.tsx +5 -2
- package/assets/templates/pages/documentation-technical/page.tsx +4 -2
- package/assets/templates/pages/editor/page.tsx +28 -9
- package/assets/templates/pages/file-explorer/page.tsx +3 -1
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
- package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/gallery-hero/page.tsx +1 -1
- package/assets/templates/pages/ide/page.tsx +7 -2
- package/assets/templates/pages/kanban-board/page.tsx +10 -4
- package/assets/templates/pages/library/page.tsx +31 -61
- package/assets/templates/pages/login/page.tsx +4 -2
- package/assets/templates/pages/login-card/page.tsx +4 -2
- package/assets/templates/pages/login-split/page.tsx +3 -2
- package/assets/templates/pages/login-sso/page.tsx +4 -4
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/product-detail/page.tsx +16 -4
- package/assets/templates/pages/product-gallery/page.tsx +1 -1
- package/assets/templates/pages/settings/page.tsx +10 -4
- package/assets/templates/pages/settings-dialog/page.tsx +5 -6
- package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +2 -2
- package/assets/templates/pages/table-filter/page.tsx +21 -6
- package/assets/templates/pages/table-grouped/page.tsx +23 -2
- package/assets/templates/pages/table-inbox/page.tsx +82 -32
- package/assets/templates/pages/theme-showcase/page.tsx +3 -2
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +197 -4
- package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
- package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/stone/stoneTheme.ts +69 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
- package/authoring/codemod/parse.d.mts +0 -36
- package/authoring/codemod/parse.mjs +62 -41
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/config/parse.d.mts +0 -47
- package/authoring/config/parse.mjs +128 -103
- package/authoring/config/type.ts +4 -3
- package/authoring/debug/parse.d.mts +2 -2
- package/authoring/discover/parse.d.mts +2 -2
- package/authoring/discover/parse.mjs +52 -38
- package/authoring/discover/type.ts +2 -1
- package/authoring/doctypes/_schema.d.mts +834 -950
- package/authoring/doctypes/_schema.mjs +863 -825
- package/authoring/doctypes/command/parse.mjs +2 -2
- package/authoring/doctypes/component/parse.mjs +2 -2
- package/authoring/doctypes/enum/parse.mjs +2 -2
- package/authoring/doctypes/hook/parse.mjs +2 -2
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
- package/authoring/doctypes/icon-definition/parse.mjs +59 -43
- package/authoring/doctypes/icon-set/parse.d.mts +0 -75
- package/authoring/doctypes/icon-set/parse.mjs +239 -210
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/namespace/parse.mjs +2 -2
- package/authoring/doctypes/reference/parse.mjs +2 -2
- package/authoring/doctypes/schema/parse.mjs +2 -2
- package/authoring/doctypes/template/parse.d.mts +0 -101
- package/authoring/doctypes/template/parse.mjs +131 -106
- package/authoring/doctypes/theme/parse.d.mts +0 -23
- package/authoring/doctypes/theme/parse.mjs +52 -36
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +20 -2
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +27 -13
- package/clients/cli/commands/component.mjs +14 -3
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +20 -3
- package/clients/cli/commands/docs.doc.mjs +11 -9
- package/clients/cli/commands/docs.mjs +50 -21
- package/clients/cli/commands/experimental/icon.mjs +330 -227
- package/clients/cli/commands/experimental/render.mjs +16 -1
- package/clients/cli/commands/experimental/theme.mjs +42 -17
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-render.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +36 -24
- package/clients/cli/commands/integration-check.doc.mjs +1 -1
- package/clients/cli/commands/mcp.doc.mjs +53 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +46 -9
- package/clients/cli/commands/template.mjs +3 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +12 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +23 -17
- package/clients/cli/lib/base-gate.mjs +37 -5
- package/clients/cli/lib/define-command.mjs +82 -4
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/stray-option.mjs +27 -1
- package/clients/cli/lib/unknown-command.mjs +326 -11
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +49 -1
- package/foundation/agent-docs/agent-docs.mjs +108 -7
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core.d.mts +1 -1
- package/foundation/bases/core.mjs +3 -3
- package/foundation/bases/resolve.d.mts +4 -8
- package/foundation/bases/resolve.mjs +15 -21
- package/foundation/bases/state.d.mts +15 -9
- package/foundation/bases/state.mjs +33 -6
- package/foundation/config/project.d.mts +5 -4
- package/foundation/config/project.mjs +33 -17
- package/foundation/discovery/component-discovery.mjs +15 -28
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +12 -2
- package/foundation/discovery/icon-ranking.mjs +197 -10
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.d.mts +28 -0
- package/foundation/discovery/icon-set-discovery.mjs +42 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -11
- package/foundation/discovery/icon-set-writer.mjs +3 -29
- package/foundation/discovery/module-exports.d.mts +1 -1
- package/foundation/discovery/module-exports.mjs +136 -33
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/template-adapter.d.mts +1 -1
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icons.d.mts +45 -2
- package/foundation/discovery/template-icons.mjs +26 -54
- package/foundation/discovery/template-needs.d.mts +28 -2
- package/foundation/discovery/template-needs.mjs +92 -11
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.mjs +2 -4
- package/foundation/doc-compiler/parse-readable.mjs +4 -3
- package/foundation/doc-compiler/stored-docs.d.mts +13 -0
- package/foundation/doc-compiler/stored-docs.mjs +74 -3
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/fs/gather-cache.d.mts +23 -0
- package/foundation/fs/gather-cache.mjs +94 -2
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/identity/package-names.d.mts +18 -0
- package/foundation/identity/package-names.mjs +19 -0
- package/foundation/identity/providers.mjs +3 -2
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integrations.d.mts +13 -1
- package/foundation/integrations/integrations.mjs +47 -6
- package/foundation/integrations/pack-state.d.mts +21 -0
- package/foundation/integrations/pack-state.mjs +42 -19
- package/foundation/integrations/validate-contributions.d.mts +11 -3
- package/foundation/integrations/validate-contributions.mjs +51 -13
- package/foundation/release/cache.d.mts +13 -1
- package/foundation/release/cache.mjs +94 -14
- package/foundation/release/notices.d.mts +15 -0
- package/foundation/release/notices.mjs +111 -7
- package/foundation/release/project.d.mts +3 -4
- package/foundation/release/project.mjs +5 -6
- package/foundation/render/client-bundle.d.mts +126 -0
- package/foundation/render/client-bundle.mjs +565 -0
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/embedded-imports.d.mts +4 -3
- package/foundation/render/embedded-imports.mjs +13 -8
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.mjs +5 -4
- package/foundation/render/page-worker.mjs +562 -86
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +33 -0
- package/foundation/render/picture-window.mjs +78 -0
- package/foundation/render/render-page.d.mts +55 -4
- package/foundation/render/render-page.mjs +199 -28
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +2 -1
- package/foundation/render/served-packages.mjs +5 -3
- package/foundation/render/ts-paths.d.mts +11 -0
- package/foundation/render/ts-paths.mjs +27 -2
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +7 -1
- package/foundation/response/error-codes.mjs +10 -2
- package/foundation/response/response-types.doc.mjs +12 -12
- package/foundation/runtime/package-root.d.mts +8 -0
- package/foundation/runtime/package-root.mjs +20 -0
- package/foundation/suggest/other-command.d.mts +11 -0
- package/foundation/suggest/other-command.mjs +1 -1
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/foundation/text/icon-set-next.d.mts +25 -0
- package/foundation/text/icon-set-next.mjs +29 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
package/api/theme-edit/_how.mjs
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
resolvedTokens,
|
|
40
40
|
themeSourceParseError,
|
|
41
41
|
themeSourceProblem,
|
|
42
|
+
baseRedraws,
|
|
42
43
|
} from './_settings.mjs';
|
|
43
44
|
import {missedSteps} from './_missed.mjs';
|
|
44
45
|
import {ASPECTS, settableStates} from './_check.mjs';
|
|
@@ -983,6 +984,37 @@ function finish(env, drafts) {
|
|
|
983
984
|
else if (unmet.length)
|
|
984
985
|
d.text = `${d.text} (left out: ${[...new Set(unmet)].join('; ')})`;
|
|
985
986
|
}
|
|
987
|
+
// A joined answer ("all of it, in order") drops each step that alone
|
|
988
|
+
// changes nothing, as its own line says; written, it would pin that
|
|
989
|
+
// setting, so a later dial would not reach it.
|
|
990
|
+
if (d.sequence && d.options.some(o => o.length > 1)) {
|
|
991
|
+
/** @param {import('./_how-commands.mjs').Step} st */
|
|
992
|
+
const noOp = st => {
|
|
993
|
+
const r = env.check([st]);
|
|
994
|
+
return !r.ok && /^it changes nothing/.test(r.why);
|
|
995
|
+
};
|
|
996
|
+
const before = d.options.map(o => o.length);
|
|
997
|
+
d.options = d.options
|
|
998
|
+
.map(o => (o.length > 1 ? o.filter(st => !noOp(st)) : o))
|
|
999
|
+
.filter(o => o.length);
|
|
1000
|
+
// (Left holding what another answer already says: not given twice.)
|
|
1001
|
+
const narrowed = d.options.some((o, i) => o.length < (before[i] ?? 0));
|
|
1002
|
+
if (
|
|
1003
|
+
narrowed &&
|
|
1004
|
+
d.options.every(o =>
|
|
1005
|
+
drafts.some(
|
|
1006
|
+
x =>
|
|
1007
|
+
x !== d &&
|
|
1008
|
+
x.options.some(
|
|
1009
|
+
y =>
|
|
1010
|
+
y.length === o.length &&
|
|
1011
|
+
y.every((st, k) => key(st) === key(o[k])),
|
|
1012
|
+
),
|
|
1013
|
+
),
|
|
1014
|
+
)
|
|
1015
|
+
)
|
|
1016
|
+
continue;
|
|
1017
|
+
}
|
|
986
1018
|
const {commands, refused} = checked(env, d.options);
|
|
987
1019
|
const lookups = d.lookup ? [d.lookup] : [];
|
|
988
1020
|
if (!commands.length && !d.options.length && unmet.length) {
|
|
@@ -1370,6 +1402,9 @@ function tokenAnswer(ctx, env, subject, key, unknown, themeFields) {
|
|
|
1370
1402
|
// a variant it does not render reads (heading level 5, an error toast)
|
|
1371
1403
|
// shows no reader there; Core's stylesheet still names it.
|
|
1372
1404
|
const inSheet = !readers.length && stylesheetReads(ctx, key);
|
|
1405
|
+
// Where the theme's base draws past it: a part and condition whose own
|
|
1406
|
+
// base rule sets the property this token feeds in Core.
|
|
1407
|
+
const redrawn = ctx.unchecked ? [] : baseRedraws(C, env.base, key);
|
|
1373
1408
|
return {
|
|
1374
1409
|
kind: 'setting',
|
|
1375
1410
|
subject,
|
|
@@ -1385,6 +1420,14 @@ function tokenAnswer(ctx, env, subject, key, unknown, themeFields) {
|
|
|
1385
1420
|
? `no part in the part data reads ${key}, but Core's stylesheet does, in a variant or state the part data does not render; so readBy is incomplete`
|
|
1386
1421
|
: `no part reads ${key}, and Core's stylesheet does not use it`,
|
|
1387
1422
|
}),
|
|
1423
|
+
...(redrawn.length
|
|
1424
|
+
? {
|
|
1425
|
+
notIn: redrawn.map(
|
|
1426
|
+
r =>
|
|
1427
|
+
`${r.part}${r.when ? ` (${r.when.replace(':', ' ')})` : ''}: the ${env.data.like ?? 'base'} theme draws its ${r.prop} from ${r.value}, so ${key} does not reach it; set ${r.prop} --on ${r.part}${r.when ? ` --when ${r.when}` : ''} there`,
|
|
1428
|
+
),
|
|
1429
|
+
}
|
|
1430
|
+
: {}),
|
|
1388
1431
|
...unknown,
|
|
1389
1432
|
...themeFields,
|
|
1390
1433
|
examples: commands,
|
|
@@ -10,7 +10,14 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {COMMON_STATES} from './_tables.mjs';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
autoMediaSide,
|
|
15
|
+
baseComponent,
|
|
16
|
+
kebab,
|
|
17
|
+
modesOf,
|
|
18
|
+
partsOf,
|
|
19
|
+
roleReach,
|
|
20
|
+
} from './_settings.mjs';
|
|
14
21
|
import {borderlessSurfaces, pillParts} from './_check.mjs';
|
|
15
22
|
import {parseColor, ratio, splitTop} from './_color.mjs';
|
|
16
23
|
import {blurScaled} from './_how-question.mjs';
|
|
@@ -167,6 +174,33 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
167
174
|
.filter(Boolean)
|
|
168
175
|
.map((/** @type {string} */ when) => ({when, token: r.token})),
|
|
169
176
|
);
|
|
177
|
+
/**
|
|
178
|
+
* Whether a media part's text, which picks its own side from its fill
|
|
179
|
+
* (Core's automatic media mode), already reads on a fill in a mode: its
|
|
180
|
+
* text then needs no step of its own, and the fill is the one line.
|
|
181
|
+
* @param {string} m @param {unknown} fillValue @param {boolean} [error]
|
|
182
|
+
*/
|
|
183
|
+
const textFollows = (m, fillValue, error = false) => {
|
|
184
|
+
if (!C.MAP[p]?.media) return false;
|
|
185
|
+
const tokens = res[m] ?? {};
|
|
186
|
+
const side = autoMediaSide(String(fillValue ?? ''), tokens, {
|
|
187
|
+
mode: m,
|
|
188
|
+
...(error ? {error: true} : {}),
|
|
189
|
+
});
|
|
190
|
+
const text = parseColor(
|
|
191
|
+
String(
|
|
192
|
+
tokens[
|
|
193
|
+
side === 'off'
|
|
194
|
+
? '--color-text-primary'
|
|
195
|
+
: side === 'dark'
|
|
196
|
+
? '--color-on-dark'
|
|
197
|
+
: '--color-on-light'
|
|
198
|
+
] ?? '',
|
|
199
|
+
),
|
|
200
|
+
);
|
|
201
|
+
const g = parseColor(String(fillValue ?? ''));
|
|
202
|
+
return Boolean(text && g && ratio(text, g) >= 4.5);
|
|
203
|
+
};
|
|
170
204
|
/**
|
|
171
205
|
* @param {string[]} ms
|
|
172
206
|
* @param {boolean} [inverse] the theme's own inverted surface: in a
|
|
@@ -197,23 +231,32 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
197
231
|
on: p,
|
|
198
232
|
mode: m,
|
|
199
233
|
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
? otherFills.map((/** @type {any} */ o) => ({
|
|
211
|
-
thing: 'color',
|
|
212
|
-
value: readableOn(m, res[m]?.[o.token]),
|
|
234
|
+
// (A media part whose text picks a side that reads on the new
|
|
235
|
+
// fill takes no text step: the fill is the one line.)
|
|
236
|
+
...(textFollows(m, fill(m))
|
|
237
|
+
? []
|
|
238
|
+
: (C.MAP[p]?.media || !textTokens.length
|
|
239
|
+
? ['color']
|
|
240
|
+
: textTokens
|
|
241
|
+
).map(thing => ({
|
|
242
|
+
thing,
|
|
243
|
+
value: readableOn(m, fill(m)),
|
|
213
244
|
on: p,
|
|
214
245
|
mode: m,
|
|
215
|
-
|
|
216
|
-
|
|
246
|
+
}))),
|
|
247
|
+
...(C.MAP[p]?.media || !textTokens.length
|
|
248
|
+
? otherFills
|
|
249
|
+
.filter(
|
|
250
|
+
(/** @type {any} */ o) =>
|
|
251
|
+
!textFollows(m, res[m]?.[o.token], true),
|
|
252
|
+
)
|
|
253
|
+
.map((/** @type {any} */ o) => ({
|
|
254
|
+
thing: 'color',
|
|
255
|
+
value: readableOn(m, res[m]?.[o.token]),
|
|
256
|
+
on: p,
|
|
257
|
+
mode: m,
|
|
258
|
+
when: o.when,
|
|
259
|
+
}))
|
|
217
260
|
: []),
|
|
218
261
|
])
|
|
219
262
|
: // The surface and the text as the colors they are in that mode (a
|
|
@@ -328,13 +371,26 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
328
371
|
part: p,
|
|
329
372
|
why: `${when ? `${when.replace(':', ' ')}, ` : ''}its fill is still the base's ${st} color (${r.token}), which the theme's ${STATUS[st][0]} color does not reach`,
|
|
330
373
|
aspect: 'background',
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
374
|
+
// (A media part's text picks its side from the new fill: where
|
|
375
|
+
// that side does not read on it, the text that does, in the same
|
|
376
|
+
// condition, so the line makes no problem of its own.)
|
|
377
|
+
steps: ms.flatMap(m => {
|
|
378
|
+
const value = String(res[m]?.[STATUS[st][1]]);
|
|
379
|
+
return [
|
|
380
|
+
{thing: r.token, value, on: p, ...(when ? {when} : {}), mode: m},
|
|
381
|
+
...(C.MAP[p]?.media && !textFollows(m, value, st === 'error')
|
|
382
|
+
? [
|
|
383
|
+
{
|
|
384
|
+
thing: 'color',
|
|
385
|
+
value: readableOn(m, value),
|
|
386
|
+
on: p,
|
|
387
|
+
...(when ? {when} : {}),
|
|
388
|
+
mode: m,
|
|
389
|
+
},
|
|
390
|
+
]
|
|
391
|
+
: []),
|
|
392
|
+
];
|
|
393
|
+
}),
|
|
338
394
|
});
|
|
339
395
|
}
|
|
340
396
|
}
|
|
@@ -750,10 +806,14 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
750
806
|
}
|
|
751
807
|
// A square or outlined look (square corners, or a border width the
|
|
752
808
|
// theme set) beside a soft shadow the base draws (a popover's, a menu's,
|
|
753
|
-
// a dialog's): the shadow with no blur matches it.
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
809
|
+
// a dialog's): the shadow with no blur matches it. Square corners count
|
|
810
|
+
// when the theme's own change made them so: a base square by design
|
|
811
|
+
// (y2k) draws its shadows beside them as it means to.
|
|
812
|
+
const square =
|
|
813
|
+
corners &&
|
|
814
|
+
modes.every(m =>
|
|
815
|
+
/^0(px|rem)?$/.test(String(res[m]?.['--radius-element']).trim()),
|
|
816
|
+
);
|
|
757
817
|
// The same look beside the base's focus ring, drawn outside the part with
|
|
758
818
|
// a gap: a ring drawn inside the part's edge matches it.
|
|
759
819
|
const offsets = modes.map(m =>
|
|
@@ -816,6 +876,26 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
816
876
|
))
|
|
817
877
|
found.push({...x, kind: 5, aspect: 'border'});
|
|
818
878
|
|
|
879
|
+
// What the theme's role colors reach on their own (the compiler writes
|
|
880
|
+
// them onto the parts where the base theme draws the role itself) is
|
|
881
|
+
// not missed.
|
|
882
|
+
const reached = roleReach(ctx, data, base);
|
|
883
|
+
for (let i = found.length - 1; i >= 0; i--) {
|
|
884
|
+
const x = found[i];
|
|
885
|
+
const steps = x.steps.filter(
|
|
886
|
+
st =>
|
|
887
|
+
!reached.some(
|
|
888
|
+
r =>
|
|
889
|
+
r.part === x.part &&
|
|
890
|
+
r.when === (st.when ?? undefined) &&
|
|
891
|
+
kebab(r.prop) === st.thing &&
|
|
892
|
+
(st.on ?? x.part) === x.part,
|
|
893
|
+
),
|
|
894
|
+
);
|
|
895
|
+
if (!steps.length) found.splice(i, 1);
|
|
896
|
+
else if (steps.length < x.steps.length) found[i] = {...x, steps};
|
|
897
|
+
}
|
|
898
|
+
|
|
819
899
|
// One of each kind first, in the order the kinds are missed most (an
|
|
820
900
|
// inverted surface, a disabled part, a selected state, a status fill,
|
|
821
901
|
// pills, borderless surfaces), then the next of each: six lines reach six
|
|
@@ -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
|
+
* An English noun's plural, as a part's name is said in the plural
|
|
6
|
+
* ("switch" → "switches", "body" → "bodies", "card" → "cards").
|
|
7
|
+
* @param {string} word
|
|
8
|
+
* @returns {string}
|
|
9
|
+
*/
|
|
10
|
+
export function pluralOf(word: string): string;
|
|
4
11
|
/**
|
|
5
12
|
* A value as CSS reads it, for every value type: every Unicode space
|
|
6
13
|
* (no-break, thin, ideographic…) a plain space and zero-width and format
|
|
@@ -265,17 +272,24 @@ export function documentRange(things: string[], min: number, max: number): void;
|
|
|
265
272
|
* typo (typoOf); (6) the typed value with each color written as one mode's
|
|
266
273
|
* half of `light-dark()` (a shadow's color for one mode, which no color
|
|
267
274
|
* longhand holds), the other half anything. Several values of one kind typed for a setting that takes
|
|
268
|
-
* one (`1.5 2`) may be read as the first.
|
|
269
|
-
*
|
|
275
|
+
* one (`1.5 2`) may be read as the first. (8) The words of the typed value
|
|
276
|
+
* that name the line's own part or state (`scope`: `card 8px`, `red on
|
|
277
|
+
* button`, `button:hover: red`) are carried by its --on and --state, so the
|
|
278
|
+
* rest is the value read.
|
|
279
|
+
* @param {{offered: string, typed: string, thing?: string, typedThing?: string, saved?: Map<string, string[]>, mode?: string, scope?: {on?: string, state?: string}}} line
|
|
270
280
|
* @returns {true | number[] | {oneOf: number[]} | false}
|
|
271
281
|
*/
|
|
272
|
-
export function readsTyped(
|
|
282
|
+
export function readsTyped(line: {
|
|
273
283
|
offered: string;
|
|
274
284
|
typed: string;
|
|
275
285
|
thing?: string;
|
|
276
286
|
typedThing?: string;
|
|
277
287
|
saved?: Map<string, string[]>;
|
|
278
288
|
mode?: string;
|
|
289
|
+
scope?: {
|
|
290
|
+
on?: string;
|
|
291
|
+
state?: string;
|
|
292
|
+
};
|
|
279
293
|
}): true | number[] | {
|
|
280
294
|
oneOf: number[];
|
|
281
295
|
} | false;
|
|
@@ -332,7 +346,7 @@ export function allowedLine(line: {
|
|
|
332
346
|
saved?: Map<string, string[]>;
|
|
333
347
|
mode?: string;
|
|
334
348
|
}): boolean;
|
|
335
|
-
export function typoLimit(typed: string): 0 |
|
|
349
|
+
export function typoLimit(typed: string): 0 | 2 | 1;
|
|
336
350
|
/**
|
|
337
351
|
* `label`: a pasted line's label that names no mode word (see labelScope)
|
|
338
352
|
*/
|
|
@@ -21,6 +21,19 @@ import {colorProblem, hex, parseColor} from './_color.mjs';
|
|
|
21
21
|
import {sameKindValues, takesWholeNumbersOnly, unitsJoined} from './_css.mjs';
|
|
22
22
|
import {levenshteinDistance} from '../../foundation/text/levenshtein.mjs';
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* An English noun's plural, as a part's name is said in the plural
|
|
26
|
+
* ("switch" → "switches", "body" → "bodies", "card" → "cards").
|
|
27
|
+
* @param {string} word
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
export function pluralOf(word) {
|
|
31
|
+
const w = String(word);
|
|
32
|
+
if (/(?:s|x|z|ch|sh)$/i.test(w)) return `${w}es`;
|
|
33
|
+
if (/[^aeiou]y$/i.test(w)) return `${w.slice(0, -1)}ies`;
|
|
34
|
+
return `${w}s`;
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
/**
|
|
25
38
|
* A value as CSS reads it, for every value type: every Unicode space
|
|
26
39
|
* (no-break, thin, ideographic…) a plain space and zero-width and format
|
|
@@ -237,6 +250,31 @@ export function normalizeEntry(thing, value) {
|
|
|
237
250
|
t = t.slice(1).trim();
|
|
238
251
|
v = v.replace(/\s*\}\s*$/, '');
|
|
239
252
|
}
|
|
253
|
+
// The editor's own result line pasted with its head (`[ok] t: corners =
|
|
254
|
+
// pill (whole theme)`, `t: corners pill -> round`): the head (the status
|
|
255
|
+
// and the theme's name) is no part of the setting.
|
|
256
|
+
// (Typed as one argument, the status may come apart from the rest.)
|
|
257
|
+
const whole =
|
|
258
|
+
v == null || v.trim() === ''
|
|
259
|
+
? t
|
|
260
|
+
: /^\[ok\]$/i.test(t)
|
|
261
|
+
? `${t} ${v.trim()}`
|
|
262
|
+
: null;
|
|
263
|
+
if (whole != null) {
|
|
264
|
+
const head =
|
|
265
|
+
/^(?:\[ok\]\s*)?[a-z][a-z0-9-]*:\s+(\S+\s*(?:=|\S.*?(?:->|\u2192)).*)$/i.exec(
|
|
266
|
+
whole,
|
|
267
|
+
);
|
|
268
|
+
const status = /^\[ok\]\s+(\S.*)$/i.exec(whole);
|
|
269
|
+
if (head || status) v = undefined;
|
|
270
|
+
if (head) {
|
|
271
|
+
t = head[1].trim();
|
|
272
|
+
pasted = true;
|
|
273
|
+
} else if (status) {
|
|
274
|
+
t = status[1].trim();
|
|
275
|
+
pasted = true;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
240
278
|
/** The scope the editor's own printed line names after its value. @type {EntryScope | undefined} */
|
|
241
279
|
let scope;
|
|
242
280
|
// The editor's own change line pasted back (`corners pill -> round`,
|
|
@@ -1372,11 +1410,54 @@ const SCALED_DIALS = Object.keys(DIALS).filter(d =>
|
|
|
1372
1410
|
* typo (typoOf); (6) the typed value with each color written as one mode's
|
|
1373
1411
|
* half of `light-dark()` (a shadow's color for one mode, which no color
|
|
1374
1412
|
* longhand holds), the other half anything. Several values of one kind typed for a setting that takes
|
|
1375
|
-
* one (`1.5 2`) may be read as the first.
|
|
1376
|
-
*
|
|
1413
|
+
* one (`1.5 2`) may be read as the first. (8) The words of the typed value
|
|
1414
|
+
* that name the line's own part or state (`scope`: `card 8px`, `red on
|
|
1415
|
+
* button`, `button:hover: red`) are carried by its --on and --state, so the
|
|
1416
|
+
* rest is the value read.
|
|
1417
|
+
* @param {{offered: string, typed: string, thing?: string, typedThing?: string, saved?: Map<string, string[]>, mode?: string, scope?: {on?: string, state?: string}}} line
|
|
1377
1418
|
* @returns {true | number[] | {oneOf: number[]} | false}
|
|
1378
1419
|
*/
|
|
1379
|
-
export function readsTyped({
|
|
1420
|
+
export function readsTyped(line) {
|
|
1421
|
+
const read = readsTypedValue(line);
|
|
1422
|
+
if (read === true || !line.scope?.on) return read;
|
|
1423
|
+
const rest = withoutScopeWords(String(line.typed), line.scope);
|
|
1424
|
+
return rest != null && rest !== String(line.typed).trim()
|
|
1425
|
+
? readsTypedValue({...line, typed: rest}) === true || read
|
|
1426
|
+
: read;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* The typed value without the words that name a part (or one of its
|
|
1431
|
+
* plurals) and its state, as a label (`card: 8px`, `button = red`,
|
|
1432
|
+
* `button:hover: red`), after `on` (`red on button`), or as the first or
|
|
1433
|
+
* last word (`card 8px`, `8px card`); null when it names neither.
|
|
1434
|
+
* @param {string} typed
|
|
1435
|
+
* @param {{on?: string, state?: string}} scope
|
|
1436
|
+
* @returns {string | null}
|
|
1437
|
+
*/
|
|
1438
|
+
function withoutScopeWords(typed, scope) {
|
|
1439
|
+
const on = String(scope.on ?? '').toLowerCase();
|
|
1440
|
+
if (!on) return null;
|
|
1441
|
+
const esc = (/** @type {string} */ x) =>
|
|
1442
|
+
x.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1443
|
+
const words = on.split('-').map(esc).join('[\\s-]+');
|
|
1444
|
+
const part = `(?:${words})(?:e?s)?`;
|
|
1445
|
+
const state = scope.state ? `(?::+\\s*${esc(scope.state)})?` : '';
|
|
1446
|
+
const t = typed.trim();
|
|
1447
|
+
for (const re of [
|
|
1448
|
+
new RegExp(`^${part}${state}\\s*[:=]\\s*(\\S.*)$`, 'i'),
|
|
1449
|
+
new RegExp(`^(\\S.*?)\\s+on\\s+(?:the\\s+)?${part}$`, 'i'),
|
|
1450
|
+
new RegExp(`^${part}\\s+(\\S.*)$`, 'i'),
|
|
1451
|
+
new RegExp(`^(\\S.*?)\\s+${part}$`, 'i'),
|
|
1452
|
+
]) {
|
|
1453
|
+
const m = re.exec(t);
|
|
1454
|
+
if (m) return m[1].trim();
|
|
1455
|
+
}
|
|
1456
|
+
return null;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/** @param {{offered: string, typed: string, thing?: string, typedThing?: string, saved?: Map<string, string[]>, mode?: string}} line */
|
|
1460
|
+
function readsTypedValue({
|
|
1380
1461
|
offered,
|
|
1381
1462
|
typed,
|
|
1382
1463
|
thing = '',
|
|
@@ -309,6 +309,7 @@ export function isEditorTemp(name: string): boolean;
|
|
|
309
309
|
* @property {boolean} pass
|
|
310
310
|
* @property {string} [note] - The whole sentence to report, when the check is not a plain stop move.
|
|
311
311
|
* @property {string[]} [dials] - The color dials whose notes report it, when its token belongs to none of them.
|
|
312
|
+
* @property {{thing: string, value: string, mode?: Mode}} [fix] - The nearest setting that passes it, when one does: a darker exact color for a pale fill.
|
|
312
313
|
*/
|
|
313
314
|
/**
|
|
314
315
|
* The palette mapping of a theme.
|
|
@@ -414,6 +415,14 @@ export type ContrastCheck = {
|
|
|
414
415
|
* - The color dials whose notes report it, when its token belongs to none of them.
|
|
415
416
|
*/
|
|
416
417
|
dials?: string[] | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* - The nearest setting that passes it, when one does: a darker exact color for a pale fill.
|
|
420
|
+
*/
|
|
421
|
+
fix?: {
|
|
422
|
+
thing: string;
|
|
423
|
+
value: string;
|
|
424
|
+
mode?: Mode;
|
|
425
|
+
} | undefined;
|
|
417
426
|
};
|
|
418
427
|
/**
|
|
419
428
|
* The palette mapping of a theme.
|