@astryxdesign/cli 0.7.17-canary.g4ea41ce → 0.7.17-canary.g5a3fd39
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 +7 -2
- package/api/build/_adapter.d.mts +7 -6
- package/api/build/_adapter.mjs +18 -11
- package/api/build/build.type.mjs +1 -1
- package/api/build/kit/kind.d.mts +6 -0
- package/api/build/kit/kind.mjs +1 -1
- package/api/build/kit/rank.d.mts +7 -1
- package/api/build/kit/rank.mjs +15 -5
- package/api/build/kit/signals.mjs +58 -57
- package/api/build/kit/start.d.mts +2 -1
- package/api/build/kit/start.mjs +62 -9
- package/api/build/kit/words.d.mts +6 -2
- package/api/build/kit/words.mjs +7 -3
- package/api/component/__fixtures__/resolutions/modules.txt +2 -2
- package/api/component/_adapter.d.mts +30 -24
- package/api/component/_adapter.mjs +72 -31
- package/api/component/component.mjs +4 -4
- package/api/component/detail/detail.d.mts +2 -2
- package/api/component/detail/detail.mjs +1 -1
- package/api/component/list/list.d.mts +2 -2
- package/api/component/list/list.mjs +4 -4
- package/api/discover/_adapter.mjs +15 -15
- package/api/docs/_adapter.d.mts +13 -5
- package/api/docs/_adapter.mjs +37 -10
- package/api/doctor/_adapter.d.mts +32 -0
- package/api/doctor/_adapter.mjs +56 -1
- package/api/doctor/doctor.mjs +28 -5
- package/api/doctor/theme-checks.mjs +165 -83
- package/api/error.d.mts +4 -3
- package/api/error.mjs +3 -2
- package/api/hook/_adapter.d.mts +5 -4
- package/api/hook/_adapter.mjs +6 -5
- package/api/icon/_options.d.mts +17 -0
- package/api/icon/_options.mjs +54 -0
- package/api/icon/exportIconIndex.doc.d.mts +10 -0
- package/api/icon/exportIconIndex.doc.mjs +59 -0
- package/api/icon/icon.mjs +11 -34
- package/api/icon/icon.type.d.mts +49 -0
- package/api/icon/icon.type.mjs +24 -0
- package/api/icon/rankIconIndex.doc.d.mts +10 -0
- package/api/icon/rankIconIndex.doc.mjs +79 -0
- package/api/icon/search/icon-index.d.mts +41 -0
- package/api/icon/search/icon-index.mjs +139 -0
- package/api/icon/search/search.d.mts +18 -0
- package/api/icon/search/search.mjs +13 -0
- package/api/index.d.mts +1 -0
- package/api/index.mjs +1 -0
- package/api/search/_adapter.d.mts +8 -5
- package/api/search/_adapter.mjs +14 -10
- package/api/search/_gather-components.d.mts +4 -4
- package/api/search/_gather-components.mjs +4 -3
- package/api/search/_gather-hooks.d.mts +2 -2
- package/api/search/_gather-hooks.mjs +1 -1
- package/api/search/_lexical.mjs +12 -2
- package/api/search/_priority.d.mts +10 -2
- package/api/search/_priority.mjs +37 -7
- package/api/search/_score.d.mts +12 -3
- package/api/search/_score.mjs +6 -3
- package/api/search/_words.mjs +12 -3
- package/api/search/search.d.mts +7 -1
- package/api/search/search.mjs +37 -4
- package/api/swizzle/_adapter.d.mts +7 -5
- package/api/swizzle/_adapter.mjs +7 -3
- package/api/swizzle/copy/copy.mjs +5 -4
- package/api/theme/build/build.d.mts +5 -0
- package/api/theme/build/build.mjs +400 -21
- package/api/theme/build/family.mjs +18 -7
- package/api/theme/build/font-warning.mjs +5 -4
- package/api/theme/build/input-fields.d.mts +21 -6
- package/api/theme/build/input-fields.mjs +104 -13
- package/api/theme/build/typography-values.d.mts +22 -0
- package/api/theme/build/typography-values.mjs +172 -22
- package/api/theme/build/written-values.d.mts +7 -0
- package/api/theme/build/written-values.mjs +57 -8
- package/api/theme/generateTonalPalette.doc.mjs +1 -1
- package/api/theme/palette/generate/generator.d.mts +14 -2
- package/api/theme/palette/generate/generator.mjs +94 -8
- package/api/theme/theme.type.d.mts +21 -4
- package/api/theme/theme.type.mjs +14 -5
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +18 -3
- package/api/theme-edit/_adapter.d.mts +1 -1
- package/api/theme-edit/_adapter.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +10 -4
- package/api/theme-edit/_catalog.mjs +81 -22
- package/api/theme-edit/_check.mjs +402 -88
- package/api/theme-edit/_color.d.mts +11 -2
- package/api/theme-edit/_color.mjs +23 -7
- package/api/theme-edit/_compiler.mjs +11 -3
- package/api/theme-edit/_context.d.mts +87 -6
- package/api/theme-edit/_context.mjs +224 -17
- package/api/theme-edit/_css.mjs +4 -0
- package/api/theme-edit/_edit.mjs +331 -58
- package/api/theme-edit/_how-question.d.mts +11 -0
- package/api/theme-edit/_how-question.mjs +2514 -234
- package/api/theme-edit/_how.mjs +79 -14
- package/api/theme-edit/_missed.mjs +294 -32
- package/api/theme-edit/_normal.d.mts +3 -1
- package/api/theme-edit/_normal.mjs +4 -1
- package/api/theme-edit/_palette.mjs +36 -5
- package/api/theme-edit/_part-words.mjs +20 -2
- package/api/theme-edit/_parts.d.mts +12 -1
- package/api/theme-edit/_parts.mjs +116 -11
- package/api/theme-edit/_preview-app.mjs +40 -2
- package/api/theme-edit/_preview.d.mts +45 -5
- package/api/theme-edit/_preview.mjs +173 -21
- package/api/theme-edit/_settings.d.mts +20 -0
- package/api/theme-edit/_settings.mjs +1033 -94
- package/api/theme-edit/_tables.mjs +2 -2
- package/api/theme-edit/theme-edit.type.d.mts +6 -5
- package/api/theme-edit/theme-edit.type.mjs +8 -8
- package/api/upgrade/_adapter.mjs +13 -2
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/authoring.doc.mjs +1 -0
- package/assets/docs/tree/cli.doc.mjs +1 -0
- package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
- package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
- package/assets/docs/tree/global.doc.mjs +1 -0
- package/assets/docs/tree/single-component.doc.mjs +40 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/who-answers.doc.mjs +2 -2
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
- package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
- package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
- package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
- package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
- package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
- package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
- package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
- package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
- package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
- package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
- package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
- package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
- package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
- package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
- package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
- package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
- package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
- package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
- package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
- package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
- package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
- package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
- package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
- package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
- package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
- package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
- package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
- package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
- package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
- package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
- package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
- package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
- package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
- package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
- package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
- package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
- package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
- package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
- package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
- package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
- package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +102 -6
- package/assets/templates/pages/canvas-editor/page.tsx +73 -2
- package/assets/templates/pages/centered-hero/page.tsx +10 -4
- package/assets/templates/pages/course-detail/page.tsx +46 -2
- package/assets/templates/pages/dashboard/page.tsx +45 -16
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +31 -20
- package/assets/templates/pages/dashboard-comparison/page.tsx +9 -0
- package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
- package/assets/templates/pages/dashboard-progress/page.tsx +27 -15
- package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
- package/assets/templates/pages/detail-page/page.tsx +105 -77
- package/assets/templates/pages/documentation/page.tsx +15 -2
- package/assets/templates/pages/documentation-design/page.tsx +7 -34
- package/assets/templates/pages/documentation-technical/page.tsx +76 -12
- package/assets/templates/pages/editor/page.tsx +26 -21
- package/assets/templates/pages/file-explorer/page.tsx +35 -1
- package/assets/templates/pages/form-two-column/page.tsx +2 -3
- package/assets/templates/pages/form-wizard/page.tsx +31 -3
- package/assets/templates/pages/form-wizard-vertical/page.tsx +32 -3
- package/assets/templates/pages/gallery-hero/page.tsx +2 -1
- package/assets/templates/pages/ide/page.tsx +15 -1
- package/assets/templates/pages/incident-console/page.tsx +2 -1
- package/assets/templates/pages/incident-console/template.doc.mjs +1 -1
- package/assets/templates/pages/kanban-board/page.tsx +39 -2
- package/assets/templates/pages/payment-form/page.tsx +77 -39
- package/assets/templates/pages/product-gallery/page.tsx +16 -14
- package/assets/templates/pages/settings/page.tsx +35 -3
- package/assets/templates/pages/settings-dialog/page.tsx +34 -5
- package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
- package/assets/templates/pages/shell-nav/page.tsx +28 -12
- package/assets/templates/pages/shell-side-nav/page.tsx +16 -1
- package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +2 -1
- package/assets/templates/pages/table/template.doc.mjs +1 -1
- package/assets/templates/pages/table-collapsible/page.tsx +1 -1
- package/assets/templates/pages/table-comparison/page.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +9 -2
- package/assets/templates/pages/table-grouped/page.tsx +16 -6
- package/assets/templates/pages/table-inbox/page.tsx +60 -1
- package/assets/templates/pages/table-page/page.tsx +10 -2
- package/assets/templates/pages/table-tree/page.tsx +95 -13
- package/assets/templates/pages/theme-showcase/page.tsx +107 -11
- package/assets/templates/pages/work-item-detail/page.tsx +88 -74
- package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
- package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +22 -8
- package/authoring/doctypes/_schema.mjs +31 -0
- package/authoring/doctypes/command/command.doc.mjs +24 -0
- package/authoring/doctypes/command/type.ts +31 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/component/type.ts +8 -5
- package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
- package/authoring/doctypes/namespace/type.ts +4 -0
- package/authoring/doctypes/template/type.ts +0 -7
- package/authoring/index.d.ts +6 -1
- package/authoring/integration/integration.doc.mjs +7 -0
- package/authoring/integration/schema.d.mts +6 -0
- package/authoring/integration/schema.mjs +3 -0
- package/authoring/integration/type.ts +34 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -0
- package/clients/cli/commands/component.mjs +5 -1
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/experimental/index.mjs +4 -1
- package/clients/cli/commands/experimental/theme.mjs +139 -64
- package/clients/cli/commands/experimental-render.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
- package/clients/cli/commands/gap-report.doc.mjs +1 -0
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +1 -1
- package/clients/cli/commands/integration-add.doc.mjs +1 -0
- package/clients/cli/commands/manifest.mjs +10 -3
- package/clients/cli/commands/swizzle.doc.mjs +8 -1
- package/clients/cli/commands/swizzle.mjs +13 -6
- package/clients/cli/commands/template.doc.mjs +3 -0
- package/clients/cli/commands/theme-add.doc.mjs +2 -1
- package/clients/cli/commands/theme-build.doc.mjs +2 -1
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-remove.doc.mjs +2 -1
- package/clients/cli/commands/theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/theme-template.doc.mjs +1 -0
- package/clients/cli/commands/theme-use.doc.mjs +2 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +21 -5
- package/clients/cli/index.mjs +167 -59
- package/clients/cli/lib/base-gate.mjs +522 -0
- package/clients/cli/lib/command-path.mjs +26 -0
- package/clients/cli/lib/define-command.mjs +161 -12
- package/clients/cli/lib/json-shim.mjs +34 -31
- package/clients/cli/lib/manifest.d.ts +14 -0
- package/clients/cli/lib/manifest.mjs +78 -22
- package/clients/cli/lib/root-args.mjs +79 -0
- package/clients/cli/lib/stray-option.mjs +21 -8
- package/clients/cli/lib/unknown-command.mjs +27 -6
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +13 -1
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core-docs.d.mts +10 -0
- package/foundation/bases/core-docs.mjs +42 -0
- package/foundation/bases/core.d.mts +11 -0
- package/foundation/bases/core.mjs +32 -0
- package/foundation/bases/requirements.d.mts +128 -0
- package/foundation/bases/requirements.mjs +193 -0
- package/foundation/bases/resolve.d.mts +134 -0
- package/foundation/bases/resolve.mjs +295 -0
- package/foundation/bases/state.d.mts +24 -0
- package/foundation/bases/state.mjs +46 -0
- package/foundation/bases/steps.d.mts +49 -0
- package/foundation/bases/steps.mjs +88 -0
- package/foundation/config/project.d.mts +14 -0
- package/foundation/config/project.mjs +68 -1
- package/foundation/discovery/cli-self-docs.mjs +9 -1
- package/foundation/discovery/command-pointers.d.mts +28 -0
- package/foundation/discovery/command-pointers.mjs +31 -0
- package/foundation/discovery/component-discovery.d.mts +9 -8
- package/foundation/discovery/component-discovery.mjs +9 -4
- package/foundation/discovery/docs-discovery.d.mts +13 -5
- package/foundation/discovery/docs-discovery.mjs +25 -6
- package/foundation/discovery/hook-discovery.d.mts +6 -6
- package/foundation/discovery/hook-discovery.mjs +6 -4
- package/foundation/discovery/template-adapter.mjs +5 -0
- package/foundation/discovery/template-ids.d.mts +1 -1
- package/foundation/discovery/template-ids.mjs +5 -1
- package/foundation/discovery/theme-discovery.mjs +3 -0
- package/foundation/discovery/theme-imports.mjs +19 -1
- package/foundation/doc-compiler/tree.d.mts +4 -2
- package/foundation/doc-compiler/tree.mjs +46 -1
- package/foundation/env/package-manager.d.mts +7 -0
- package/foundation/env/package-manager.mjs +21 -0
- package/foundation/fonts/font-stylesheet.d.mts +8 -0
- package/foundation/fonts/font-stylesheet.mjs +26 -2
- package/foundation/fs/gather-cache.mjs +44 -13
- package/foundation/fs/own-modules.d.mts +29 -0
- package/foundation/fs/own-modules.mjs +57 -0
- package/foundation/fs/paths.d.mts +30 -2
- package/foundation/fs/paths.mjs +49 -2
- package/foundation/integrations/integrations.d.mts +4 -0
- package/foundation/integrations/integrations.mjs +6 -1
- package/foundation/release/choose.d.mts +7 -0
- package/foundation/release/choose.mjs +16 -2
- package/foundation/release/notices.d.mts +26 -0
- package/foundation/release/notices.mjs +48 -19
- package/foundation/release/project.d.mts +3 -2
- package/foundation/release/project.mjs +4 -5
- package/foundation/release/run-context.d.mts +7 -2
- package/foundation/release/run-context.mjs +6 -2
- package/foundation/render/css-cut.mjs +86 -6
- package/foundation/render/cut-short.d.mts +35 -0
- package/foundation/render/cut-short.mjs +124 -0
- package/foundation/render/font-probe.d.mts +27 -0
- package/foundation/render/font-probe.mjs +77 -0
- package/foundation/render/layers.d.mts +1 -9
- package/foundation/render/layers.mjs +2 -111
- package/foundation/render/page-worker.mjs +83 -6
- package/foundation/render/picture-chrome.mjs +24 -2
- package/foundation/render/picture-playwright.mjs +22 -2
- package/foundation/render/picture-window.d.mts +20 -4
- package/foundation/render/picture-window.mjs +137 -4
- package/foundation/response/base.d.ts +25 -0
- package/foundation/response/error-codes.d.mts +4 -1
- package/foundation/response/error-codes.d.ts +4 -1
- package/foundation/response/error-codes.doc.mjs +17 -0
- package/foundation/response/error-codes.mjs +21 -0
- package/foundation/response/json.d.mts +3 -1
- package/foundation/response/json.mjs +7 -2
- package/foundation/response/response-types.doc.mjs +2 -2
- package/foundation/suggest/name-index.d.mts +2 -1
- package/foundation/suggest/name-index.mjs +1 -1
- package/foundation/suggest/other-command.d.mts +4 -1
- package/foundation/suggest/other-command.mjs +23 -6
- package/foundation/text/string-utils.d.mts +7 -2
- package/foundation/text/string-utils.mjs +24 -10
- package/package.json +6 -6
- package/assets/templates/pages/access-denied/page.tsx +0 -101
- package/assets/templates/pages/access-denied/template.doc.mjs +0 -24
- package/assets/templates/pages/error-page/page.tsx +0 -130
- package/assets/templates/pages/error-page/template.doc.mjs +0 -22
- package/assets/templates/pages/not-found/page.tsx +0 -124
- package/assets/templates/pages/not-found/template.doc.mjs +0 -30
- package/assets/templates/pages/review-workspace/page.tsx +0 -551
- package/assets/templates/pages/review-workspace/template.doc.mjs +0 -31
- package/assets/templates/pages/run-console/page.tsx +0 -945
- package/assets/templates/pages/run-console/template.doc.mjs +0 -27
- package/assets/templates/pages/welcome-portal/page.tsx +0 -538
- package/assets/templates/pages/welcome-portal/template.doc.mjs +0 -38
package/api/theme-edit/_how.mjs
CHANGED
|
@@ -715,18 +715,52 @@ async function answer(subject, options, cwd) {
|
|
|
715
715
|
FAMILIES[p] ? FAMILIES[p] : ctx.project.target.has(p) ? [p] : [],
|
|
716
716
|
);
|
|
717
717
|
const res = await resolvedTokens(ctx, env.slug).catch(() => null);
|
|
718
|
+
// (A missed entry never says otherwise than the question: where the
|
|
719
|
+
// question gives the part a fill or a text color, the missed list's
|
|
720
|
+
// fill or text for it is not offered, "tooltips #1f2328 with white
|
|
721
|
+
// text"; and where the question writes the part at all, its own
|
|
722
|
+
// answer leads and the missed list follows, "secondary buttons white
|
|
723
|
+
// …" before a disabled-primary entry.)
|
|
724
|
+
const asked = h.drafts.flatMap(d => d.options.flat());
|
|
725
|
+
/** @param {any} st */
|
|
726
|
+
const family = st =>
|
|
727
|
+
/^background(?:-color)?$|^--color-background-|^--color-[a-z]+-muted$/.test(
|
|
728
|
+
String(st.thing),
|
|
729
|
+
)
|
|
730
|
+
? 'fill'
|
|
731
|
+
: st.thing === 'color' || /^--color-(?:text|on)-/.test(String(st.thing))
|
|
732
|
+
? 'text'
|
|
733
|
+
: null;
|
|
734
|
+
// (An ask to match the rest, "tooltips grey like the rest", is the
|
|
735
|
+
// missed list's own ask: it leads.)
|
|
736
|
+
const matching =
|
|
737
|
+
/\b(?:like the rest|like everything else|match(?:es|ing)? the (?:theme|rest)|same as the rest)\b/i.test(
|
|
738
|
+
t,
|
|
739
|
+
);
|
|
718
740
|
const mine = (res ? missedSteps(ctx, env.data, res, env.base) : []).filter(
|
|
719
|
-
x =>
|
|
741
|
+
x =>
|
|
742
|
+
parts.includes(x.part) &&
|
|
743
|
+
x.steps.length &&
|
|
744
|
+
(matching ||
|
|
745
|
+
!x.steps.some(st => {
|
|
746
|
+
const f = family(st);
|
|
747
|
+
return (
|
|
748
|
+
f != null && asked.some(a => a.on === x.part && family(a) === f)
|
|
749
|
+
);
|
|
750
|
+
})),
|
|
720
751
|
);
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}))
|
|
728
|
-
),
|
|
752
|
+
const entries = /** @type {any[]} */ (
|
|
753
|
+
mine.map(x => ({
|
|
754
|
+
text: `${x.part}${x.state ? ` (${x.state})` : ''}: ${x.why} (show's missed list)`,
|
|
755
|
+
options: [x.steps.map(st => ({verb: 'set', ...st}))],
|
|
756
|
+
...(x.steps.length > 1 ? {sequence: true} : {}),
|
|
757
|
+
}))
|
|
729
758
|
);
|
|
759
|
+
const written = new Set(
|
|
760
|
+
matching ? [] : asked.map(a => a.on).filter(Boolean),
|
|
761
|
+
);
|
|
762
|
+
h.drafts.unshift(...entries.filter((_, k) => !written.has(mine[k].part)));
|
|
763
|
+
h.drafts.push(...entries.filter((_, k) => written.has(mine[k].part)));
|
|
730
764
|
}
|
|
731
765
|
const results = finish(env, h.drafts);
|
|
732
766
|
const empty = !results.some(r => r.commands.length);
|
|
@@ -1038,14 +1072,45 @@ function partAnswer(ctx, env, subject, key, unknown, themeFields) {
|
|
|
1038
1072
|
);
|
|
1039
1073
|
const group = familyOf(key);
|
|
1040
1074
|
const states = settableStates(ctx, env.slug, env.data, key);
|
|
1075
|
+
// A token the base theme points at another one on the part or a part
|
|
1076
|
+
// around it (neutral's progress track reads the muted fill, which it
|
|
1077
|
+
// points at the emphasized border there): that token is what it shows.
|
|
1078
|
+
const blocks =
|
|
1079
|
+
/** @type {{components?: Record<string, Record<string, Record<string, unknown>>>}} */ (
|
|
1080
|
+
env.base
|
|
1081
|
+
).components ?? {};
|
|
1082
|
+
const around = [
|
|
1083
|
+
key,
|
|
1084
|
+
...Object.keys(C.MAP).filter(t => C.MAP[t]?.contains?.includes(key)),
|
|
1085
|
+
];
|
|
1086
|
+
/** @param {string} token */
|
|
1087
|
+
const pointedAt = token => {
|
|
1088
|
+
for (const t of around) {
|
|
1089
|
+
const v = blocks[t]?.base?.[token];
|
|
1090
|
+
const to =
|
|
1091
|
+
typeof v === 'string'
|
|
1092
|
+
? /^var\((--[\w-]+)\)$/.exec(v.trim())?.[1]
|
|
1093
|
+
: null;
|
|
1094
|
+
if (to) return {token: to, on: t};
|
|
1095
|
+
}
|
|
1096
|
+
return null;
|
|
1097
|
+
};
|
|
1041
1098
|
const reads = Object.fromEntries(
|
|
1042
1099
|
Object.keys(GROUPS).map(g => [
|
|
1043
1100
|
g,
|
|
1044
|
-
C.partReads(key, g).map(r =>
|
|
1045
|
-
token
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1101
|
+
C.partReads(key, g).map(r => {
|
|
1102
|
+
const to = r.token ? pointedAt(r.token) : null;
|
|
1103
|
+
return {
|
|
1104
|
+
token: r.token,
|
|
1105
|
+
...(to
|
|
1106
|
+
? {
|
|
1107
|
+
shows: `${to.token} (the ${env.data.like ?? 'base'} theme points ${r.token} at it on ${to.on})`,
|
|
1108
|
+
}
|
|
1109
|
+
: {}),
|
|
1110
|
+
props: r.props,
|
|
1111
|
+
when: [...new Set(r.when.map(w => condition(ctx, key, w, states)))],
|
|
1112
|
+
};
|
|
1113
|
+
}),
|
|
1049
1114
|
]),
|
|
1050
1115
|
);
|
|
1051
1116
|
const components = [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import {COMMON_STATES} from './_tables.mjs';
|
|
13
13
|
import {baseComponent, modesOf, partsOf} from './_settings.mjs';
|
|
14
14
|
import {borderlessSurfaces, pillParts} from './_check.mjs';
|
|
15
|
-
import {parseColor, ratio} from './_color.mjs';
|
|
15
|
+
import {parseColor, ratio, splitTop} from './_color.mjs';
|
|
16
16
|
import {blurScaled} from './_how-question.mjs';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -140,10 +140,10 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
140
140
|
* does (a theme whose surface stays light in dark mode).
|
|
141
141
|
* @param {string} m @param {string} [ground] the token the text sits on
|
|
142
142
|
*/
|
|
143
|
-
const readableOn = (m, ground
|
|
143
|
+
const readableOn = (m, ground) => {
|
|
144
144
|
const text = String(res[m]?.['--color-text-primary']);
|
|
145
145
|
const t = parseColor(text);
|
|
146
|
-
const g = parseColor(String(
|
|
146
|
+
const g = parseColor(String(ground));
|
|
147
147
|
if (!t || !g || ratio(t, g) >= 4.5) return text;
|
|
148
148
|
return ratio([0, 0, 0], g) >= ratio([255, 255, 255], g)
|
|
149
149
|
? '#000000'
|
|
@@ -167,9 +167,24 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
167
167
|
.filter(Boolean)
|
|
168
168
|
.map((/** @type {string} */ when) => ({when, token: r.token})),
|
|
169
169
|
);
|
|
170
|
-
/**
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @param {string[]} ms
|
|
172
|
+
* @param {boolean} [inverse] the theme's own inverted surface: in a
|
|
173
|
+
* theme that draws both modes, the surface it draws in the other mode
|
|
174
|
+
* (dark in light, light in dark), as Core's inverted surface is; in a
|
|
175
|
+
* one-mode theme, its surface
|
|
176
|
+
*/
|
|
177
|
+
const surfaceSteps = (ms, inverse = false) => {
|
|
178
|
+
/** @param {string} m */
|
|
179
|
+
const fill = m =>
|
|
180
|
+
String(
|
|
181
|
+
res[
|
|
182
|
+
inverse && modes.length > 1
|
|
183
|
+
? /** @type {string} */ (modes.find(x => x !== m))
|
|
184
|
+
: m
|
|
185
|
+
]?.['--color-background-surface'],
|
|
186
|
+
);
|
|
187
|
+
return inverted === '--color-background-inverted'
|
|
173
188
|
? // The inverted surface turns to the theme's surface on this part
|
|
174
189
|
// alone (as the color it is: a part may read the surface token
|
|
175
190
|
// for its text; the lightbox and the scrim keep theirs), with its
|
|
@@ -178,7 +193,7 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
178
193
|
ms.flatMap(m => [
|
|
179
194
|
{
|
|
180
195
|
thing: '--color-background-inverted',
|
|
181
|
-
value:
|
|
196
|
+
value: fill(m),
|
|
182
197
|
on: p,
|
|
183
198
|
mode: m,
|
|
184
199
|
},
|
|
@@ -187,14 +202,14 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
187
202
|
: textTokens
|
|
188
203
|
).map(thing => ({
|
|
189
204
|
thing,
|
|
190
|
-
value: readableOn(m),
|
|
205
|
+
value: readableOn(m, fill(m)),
|
|
191
206
|
on: p,
|
|
192
207
|
mode: m,
|
|
193
208
|
})),
|
|
194
209
|
...(C.MAP[p]?.media || !textTokens.length
|
|
195
210
|
? otherFills.map((/** @type {any} */ o) => ({
|
|
196
211
|
thing: 'color',
|
|
197
|
-
value: readableOn(m, o.token),
|
|
212
|
+
value: readableOn(m, res[m]?.[o.token]),
|
|
198
213
|
on: p,
|
|
199
214
|
mode: m,
|
|
200
215
|
when: o.when,
|
|
@@ -208,21 +223,24 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
208
223
|
ms.flatMap(m => [
|
|
209
224
|
{
|
|
210
225
|
thing: 'background-color',
|
|
211
|
-
value:
|
|
226
|
+
value: fill(m),
|
|
212
227
|
on: p,
|
|
213
228
|
mode: m,
|
|
214
229
|
},
|
|
215
230
|
...(textTokens.length ? textTokens : ['color']).map(thing => ({
|
|
216
231
|
thing,
|
|
217
|
-
value: readableOn(m),
|
|
232
|
+
value: readableOn(m, fill(m)),
|
|
218
233
|
on: p,
|
|
219
234
|
mode: m,
|
|
220
235
|
})),
|
|
221
236
|
]);
|
|
237
|
+
};
|
|
222
238
|
// The theme's own surfaces changed (its neutral, surface, card or page
|
|
223
239
|
// color), while the part still paints the base's inverted surface: it
|
|
224
240
|
// keeps the base's dark look beside the theme's (a Win98 theme's grey
|
|
225
|
-
// tooltips). Its line gives it the theme's
|
|
241
|
+
// tooltips). Its line gives it the theme's own inverted surface: the
|
|
242
|
+
// surface the theme draws in the other mode (a cream theme's warm dark
|
|
243
|
+
// in light), or its surface in a one-mode theme.
|
|
226
244
|
const ownSurfaces = any(
|
|
227
245
|
/^--color-(neutral|background-(body|surface|card))$/,
|
|
228
246
|
);
|
|
@@ -246,21 +264,266 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
246
264
|
const swap = lost.filter(m =>
|
|
247
265
|
standsOut(res[m]?.['--color-background-surface'], m),
|
|
248
266
|
);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
267
|
+
// (With the surfaces changed, only the modes where the theme's own
|
|
268
|
+
// inverted surface looks different from the base's: the same side,
|
|
269
|
+
// dark or light, at nearly the same lightness (under 1.5:1 apart) is
|
|
270
|
+
// the same look, and a line there changes nothing you see.)
|
|
271
|
+
const looksNew = modes.filter(m => {
|
|
272
|
+
const now = parseColor(String(res[m]?.[inverted] ?? ''));
|
|
273
|
+
const other = modes.length > 1 ? modes.find(x => x !== m) : m;
|
|
274
|
+
const next = parseColor(
|
|
275
|
+
String(
|
|
276
|
+
res[/** @type {string} */ (other)]?.[
|
|
277
|
+
'--color-background-surface'
|
|
278
|
+
] ?? '',
|
|
279
|
+
),
|
|
280
|
+
);
|
|
281
|
+
if (!now || !next) return true;
|
|
282
|
+
const side = (/** @type {[number, number, number]} */ c) =>
|
|
283
|
+
ratio([255, 255, 255], c) >= ratio([0, 0, 0], c);
|
|
284
|
+
return side(now) !== side(next) || ratio(now, next) >= 1.5;
|
|
261
285
|
});
|
|
286
|
+
if (lost.length || looksNew.length)
|
|
287
|
+
found.push({
|
|
288
|
+
kind: 0,
|
|
289
|
+
part: p,
|
|
290
|
+
why: lost.length
|
|
291
|
+
? `still the base's inverted surface (${inverted}), which no longer stands out from the page in ${lost.join(' and ')}`
|
|
292
|
+
: `still the base's dark inverted surface (${inverted}); the theme's surfaces changed`,
|
|
293
|
+
aspect: 'background',
|
|
294
|
+
steps: lost.length
|
|
295
|
+
? swap.length !== lost.length
|
|
296
|
+
? []
|
|
297
|
+
: surfaceSteps(lost)
|
|
298
|
+
: surfaceSteps(looksNew, true),
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
// A fill made from a status token the theme's own status color does
|
|
302
|
+
// not reach (an error toast's inverted red, after the danger color is
|
|
303
|
+
// set): still the base's red beside the theme's. Its line gives it the
|
|
304
|
+
// theme's status color in each mode, in the condition it is drawn in.
|
|
305
|
+
for (const st of Object.keys(STATUS)) {
|
|
306
|
+
if (
|
|
307
|
+
!data.settings.some(
|
|
308
|
+
x => x.source === 'dial' && x.thing === STATUS[st][0] && !x.on,
|
|
309
|
+
)
|
|
310
|
+
)
|
|
311
|
+
continue;
|
|
312
|
+
const own = new RegExp(`^--color-background-${st}-[\\w-]+$`);
|
|
313
|
+
for (const r of reads.filter(
|
|
314
|
+
(/** @type {any} */ r) => own.test(r.token) && !changed(r.token),
|
|
315
|
+
)) {
|
|
316
|
+
const cond = r.when
|
|
317
|
+
.map((/** @type {string} */ w) => /^([\w-]+)=([\w-]+)$/.exec(w))
|
|
318
|
+
.find(Boolean);
|
|
319
|
+
const when = cond ? `${cond[1]}:${cond[2]}` : undefined;
|
|
320
|
+
if (!r.when.includes('') && !when) continue;
|
|
321
|
+
if (covers(p, FILL)) continue;
|
|
322
|
+
const ms = modes.filter(
|
|
323
|
+
m => String(res[m]?.[STATUS[st][1]]) !== String(res[m]?.[r.token]),
|
|
324
|
+
);
|
|
325
|
+
if (!ms.length) continue;
|
|
326
|
+
found.push({
|
|
327
|
+
kind: 3,
|
|
328
|
+
part: p,
|
|
329
|
+
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
|
+
aspect: 'background',
|
|
331
|
+
steps: ms.map(m => ({
|
|
332
|
+
thing: r.token,
|
|
333
|
+
value: String(res[m]?.[STATUS[st][1]]),
|
|
334
|
+
on: p,
|
|
335
|
+
...(when ? {when} : {}),
|
|
336
|
+
mode: m,
|
|
337
|
+
})),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
/** A base literal in a mode: its half of light-dark(). @param {string} v @param {string} m */
|
|
342
|
+
const literal = (v, m) => {
|
|
343
|
+
const pair = /^light-dark\((.*)\)$/is.exec(String(v).trim());
|
|
344
|
+
const halves = pair ? splitTop(pair[1], ',') : null;
|
|
345
|
+
const x = (
|
|
346
|
+
halves?.length === 2 ? halves[m === 'light' ? 0 : 1] : String(v)
|
|
347
|
+
).trim();
|
|
348
|
+
return /^var\(/.test(x) ? null : parseColor(x);
|
|
349
|
+
};
|
|
350
|
+
// A role color (the accent, a status color) the base theme takes away
|
|
351
|
+
// from the part on its own, so the theme's role color never reaches it:
|
|
352
|
+
// the base points the role token at another one there (stone's and
|
|
353
|
+
// gothic's info banner reads the categorical blue), or a variant named
|
|
354
|
+
// for the role draws a color of the base's palette written out (stone's
|
|
355
|
+
// accent progress fill in its pale blue). Listed once the theme moved
|
|
356
|
+
// that role, in each mode where it looks different, with a line that
|
|
357
|
+
// gives the part the theme's role color there.
|
|
358
|
+
for (const [key, look] of Object.entries(
|
|
359
|
+
/** @type {Record<string, Record<string, unknown>>} */ (
|
|
360
|
+
base.components?.[p] ?? {}
|
|
361
|
+
),
|
|
362
|
+
)) {
|
|
363
|
+
if (key !== 'base' && !/^[\w-]+:[\w-]+$/.test(key)) continue;
|
|
364
|
+
if (!look || typeof look !== 'object') continue;
|
|
365
|
+
const when = key === 'base' ? undefined : key;
|
|
366
|
+
/** @param {string} thing */
|
|
367
|
+
const covered = thing =>
|
|
368
|
+
data.settings.some(
|
|
369
|
+
x =>
|
|
370
|
+
x.on &&
|
|
371
|
+
!x.state &&
|
|
372
|
+
(x.when ?? undefined) === when &&
|
|
373
|
+
partsOf(ctx, x).includes(p) &&
|
|
374
|
+
x.thing === thing,
|
|
375
|
+
);
|
|
376
|
+
// The role tokens pointed at other tokens on the part, in one line
|
|
377
|
+
// (a banner's fill and its text).
|
|
378
|
+
/** @type {Step[]} */
|
|
379
|
+
const pointed = [];
|
|
380
|
+
/** @type {string[]} */
|
|
381
|
+
const names = [];
|
|
382
|
+
for (const [prop, v] of Object.entries(look)) {
|
|
383
|
+
if (typeof v !== 'string') continue;
|
|
384
|
+
const role =
|
|
385
|
+
/^--color-(on-)?(accent|info|success|warning|error)(-[\w-]+)?$/.exec(
|
|
386
|
+
prop,
|
|
387
|
+
);
|
|
388
|
+
const to = /^var\(\s*(--[\w-]+)\s*\)$/.exec(v.trim())?.[1];
|
|
389
|
+
if (!role || !to || to === prop || !changed(prop) || covered(prop))
|
|
390
|
+
continue;
|
|
391
|
+
const ms = modes.filter(
|
|
392
|
+
m => String(res[m]?.[to]) !== String(res[m]?.[prop]),
|
|
393
|
+
);
|
|
394
|
+
if (!ms.length) continue;
|
|
395
|
+
names.push(`${prop} at ${to}`);
|
|
396
|
+
pointed.push(
|
|
397
|
+
...ms.map(m => ({
|
|
398
|
+
thing: prop,
|
|
399
|
+
value: String(res[m]?.[prop]),
|
|
400
|
+
on: p,
|
|
401
|
+
...(when ? {when} : {}),
|
|
402
|
+
mode: m,
|
|
403
|
+
})),
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
if (pointed.length)
|
|
407
|
+
found.push({
|
|
408
|
+
kind: 8,
|
|
409
|
+
part: p,
|
|
410
|
+
why: `${when ? `${when.replace(':', ' ')}, ` : ''}the base theme points ${names.join(' and ')} there, so the theme's own color does not reach it`,
|
|
411
|
+
aspect: 'background',
|
|
412
|
+
steps: pointed,
|
|
413
|
+
});
|
|
414
|
+
// A variant named for a role, drawn in a color written out.
|
|
415
|
+
const named = /^variant:(accent|info|success|warning|error)$/.exec(
|
|
416
|
+
String(when ?? ''),
|
|
417
|
+
)?.[1];
|
|
418
|
+
if (!named) continue;
|
|
419
|
+
const moved = named === 'accent' ? accent : changed(`--color-${named}`);
|
|
420
|
+
if (!moved) continue;
|
|
421
|
+
for (const [prop, thing, side] of /** @type {const} */ ([
|
|
422
|
+
['backgroundColor', 'background-color', 'background'],
|
|
423
|
+
['color', 'color', 'text'],
|
|
424
|
+
])) {
|
|
425
|
+
const v = look[prop];
|
|
426
|
+
if (typeof v !== 'string' || /var\(/.test(v) || covered(thing))
|
|
427
|
+
continue;
|
|
428
|
+
if (!modes.every(m => literal(v, m) != null)) continue;
|
|
429
|
+
// Core's own color for that variant, else the role's own token.
|
|
430
|
+
const core = (ctx.C.partReads(p, side) ?? []).find(
|
|
431
|
+
(/** @type {any} */ r) => r.when.includes(`variant=${named}`),
|
|
432
|
+
)?.token;
|
|
433
|
+
const token =
|
|
434
|
+
core ??
|
|
435
|
+
(side === 'text' ? `--color-text-${named}` : `--color-${named}`);
|
|
436
|
+
if (
|
|
437
|
+
found.some(
|
|
438
|
+
x =>
|
|
439
|
+
x.part === p &&
|
|
440
|
+
x.steps.some(st => st.thing === thing && st.when === when),
|
|
441
|
+
)
|
|
442
|
+
)
|
|
443
|
+
continue;
|
|
444
|
+
found.push({
|
|
445
|
+
kind: 8,
|
|
446
|
+
part: p,
|
|
447
|
+
why: `${String(when).replace(':', ' ')}, its ${side === 'text' ? 'text' : 'fill'} is a color of the base theme's palette written out (${v}), which the theme's ${named} color does not reach`,
|
|
448
|
+
aspect: side === 'text' ? 'text' : 'background',
|
|
449
|
+
steps: [{thing, value: `var(${token})`, on: p, when}],
|
|
450
|
+
});
|
|
451
|
+
}
|
|
262
452
|
}
|
|
263
453
|
if (!accent) continue;
|
|
454
|
+
// A color the base theme gives the part as its own accent, written as
|
|
455
|
+
// the color itself rather than the accent token (butter's nav links
|
|
456
|
+
// and outline buttons in its blue): the accent dial never reaches it.
|
|
457
|
+
// Listed for each variant (or at rest) whose color, in every mode the
|
|
458
|
+
// theme draws, is the base's accent there, with a line that points it
|
|
459
|
+
// at the accent token, where that changes the color built.
|
|
460
|
+
const baseParts = /** @type {Record<string, Record<string, any>>} */ (
|
|
461
|
+
base.components?.[p] ?? {}
|
|
462
|
+
);
|
|
463
|
+
const ACCENTS = [
|
|
464
|
+
'--color-accent',
|
|
465
|
+
'--color-text-accent',
|
|
466
|
+
'--color-icon-accent',
|
|
467
|
+
];
|
|
468
|
+
for (const [key, look] of Object.entries(baseParts)) {
|
|
469
|
+
if (key !== 'base' && !/^[\w-]+:[\w-]+$/.test(key)) continue;
|
|
470
|
+
if (!look || typeof look !== 'object') continue;
|
|
471
|
+
for (const [prop, thing, token] of /** @type {const} */ ([
|
|
472
|
+
['color', 'color', '--color-text-accent'],
|
|
473
|
+
['backgroundColor', 'background-color', '--color-accent'],
|
|
474
|
+
['borderColor', 'border-color', '--color-accent'],
|
|
475
|
+
])) {
|
|
476
|
+
const v = look[prop];
|
|
477
|
+
if (typeof v !== 'string') continue;
|
|
478
|
+
const when = key === 'base' ? undefined : key;
|
|
479
|
+
const isBaseAccent = modes.every(m => {
|
|
480
|
+
const c = literal(v, m);
|
|
481
|
+
return (
|
|
482
|
+
c != null &&
|
|
483
|
+
ACCENTS.some(a => {
|
|
484
|
+
const b = parseColor(String(base[m]?.[a] ?? ''));
|
|
485
|
+
return b != null && b.every((x, k) => x === c[k]);
|
|
486
|
+
})
|
|
487
|
+
);
|
|
488
|
+
});
|
|
489
|
+
const moves = modes.some(
|
|
490
|
+
m => String(res[m]?.[token]) !== String(base[m]?.[token]),
|
|
491
|
+
);
|
|
492
|
+
if (
|
|
493
|
+
!isBaseAccent ||
|
|
494
|
+
!moves ||
|
|
495
|
+
data.settings.some(
|
|
496
|
+
x =>
|
|
497
|
+
x.on &&
|
|
498
|
+
!x.state &&
|
|
499
|
+
(x.when ?? undefined) === when &&
|
|
500
|
+
partsOf(ctx, x).includes(p) &&
|
|
501
|
+
(x.thing === thing ||
|
|
502
|
+
(thing === 'border-color' && /^border$/.test(x.thing))),
|
|
503
|
+
)
|
|
504
|
+
)
|
|
505
|
+
continue;
|
|
506
|
+
found.push({
|
|
507
|
+
kind: 8,
|
|
508
|
+
part: p,
|
|
509
|
+
why: `${when ? `${when.replace(':', ' ')}, ` : ''}its ${thing === 'color' ? 'text' : thing.replace('-color', '')} is the base theme's own accent (${String(v)}), written as a color, which the accent leaves as it is`,
|
|
510
|
+
aspect:
|
|
511
|
+
thing === 'color'
|
|
512
|
+
? 'text'
|
|
513
|
+
: thing === 'border-color'
|
|
514
|
+
? 'border'
|
|
515
|
+
: 'background',
|
|
516
|
+
steps: [
|
|
517
|
+
{
|
|
518
|
+
thing,
|
|
519
|
+
value: `var(${token})`,
|
|
520
|
+
on: p,
|
|
521
|
+
...(when ? {when} : {}),
|
|
522
|
+
},
|
|
523
|
+
],
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
}
|
|
264
527
|
// A status fill still the base's (a banner's, a badge's status
|
|
265
528
|
// variants): the status color generated at the theme's vibrancy (its
|
|
266
529
|
// dial), with the text that reads on it. Only where that changes the
|
|
@@ -414,15 +677,14 @@ export function missedSteps(ctx, data, res, base) {
|
|
|
414
677
|
});
|
|
415
678
|
}
|
|
416
679
|
}
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
String(res[m]?.['--radius-full']),
|
|
680
|
+
// A pill part (a switch, an avatar, a badge) stays round under rounded
|
|
681
|
+
// corners by design, as nearly every look wants: it is missed only when
|
|
682
|
+
// the theme's corners go square (its element corners at 0), where a
|
|
683
|
+
// round pill keeps the base's look beside the theme's square one.
|
|
684
|
+
const squareCorners = modes.every(
|
|
685
|
+
m => Number.parseFloat(String(res[m]?.['--radius-element'] ?? '')) === 0,
|
|
424
686
|
);
|
|
425
|
-
if (corners &&
|
|
687
|
+
if (corners && squareCorners)
|
|
426
688
|
for (const p of pillParts(C).filter(
|
|
427
689
|
x => has(x) && !covers(x, /^(border-radius|corners|--radius-[\w-]+)$/),
|
|
428
690
|
))
|
|
@@ -122,7 +122,9 @@ export function colorPair(value: string): {
|
|
|
122
122
|
} | null;
|
|
123
123
|
/**
|
|
124
124
|
* A value without the debris a copy brings along: a trailing `;`, a
|
|
125
|
-
* `!important`, a comment
|
|
125
|
+
* `!important`, a comment, an old browser hack's escape at its end (`\9`,
|
|
126
|
+
* `\0`, which browsers read as part of the last word, so they drop the
|
|
127
|
+
* value). One of the exact cleanups a repair may offer.
|
|
126
128
|
* @param {string} v
|
|
127
129
|
* @returns {string}
|
|
128
130
|
*/
|
|
@@ -686,7 +686,9 @@ export function colorPair(value) {
|
|
|
686
686
|
|
|
687
687
|
/**
|
|
688
688
|
* A value without the debris a copy brings along: a trailing `;`, a
|
|
689
|
-
* `!important`, a comment
|
|
689
|
+
* `!important`, a comment, an old browser hack's escape at its end (`\9`,
|
|
690
|
+
* `\0`, which browsers read as part of the last word, so they drop the
|
|
691
|
+
* value). One of the exact cleanups a repair may offer.
|
|
690
692
|
* @param {string} v
|
|
691
693
|
* @returns {string}
|
|
692
694
|
*/
|
|
@@ -695,6 +697,7 @@ export function withoutCopyDebris(v) {
|
|
|
695
697
|
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
696
698
|
.replace(/\s*!\s*important\b/gi, '')
|
|
697
699
|
.replace(/[\s;]+$/, '')
|
|
700
|
+
.replace(/\s*\\[09]$/, '')
|
|
698
701
|
.trim();
|
|
699
702
|
}
|
|
700
703
|
|
|
@@ -34,6 +34,8 @@ import {
|
|
|
34
34
|
GENERATION_INPUT_KEYS,
|
|
35
35
|
PALETTE_BLACK,
|
|
36
36
|
PALETTE_GENERATOR_VERSION,
|
|
37
|
+
PALETTE_RECIPE,
|
|
38
|
+
PALETTE_RECIPE_V2,
|
|
37
39
|
PALETTE_WHITE,
|
|
38
40
|
generateTonalPalette,
|
|
39
41
|
modesForStrategy,
|
|
@@ -1146,10 +1148,13 @@ function planPalette(cwd, slug, data, base) {
|
|
|
1146
1148
|
if (!existing && !fams.length) return null;
|
|
1147
1149
|
/** @type {string[]} */
|
|
1148
1150
|
const notes = [];
|
|
1149
|
-
const
|
|
1150
|
-
existing && typeof existing === 'object' && !Array.isArray(existing)
|
|
1151
|
-
|
|
1152
|
-
|
|
1151
|
+
const own =
|
|
1152
|
+
existing && typeof existing === 'object' && !Array.isArray(existing);
|
|
1153
|
+
// A new palette is made with the newest recipe; a palette the theme
|
|
1154
|
+
// already has keeps the one it was made with (none named is the first),
|
|
1155
|
+
// so its colors never move with a CLI upgrade. Moving it is a choice
|
|
1156
|
+
// made in its config.
|
|
1157
|
+
const config = own ? {...existing} : {recipe: PALETTE_RECIPE_V2};
|
|
1153
1158
|
const {settings: saved, mode: savedMode} = savedSettings(cwd, slug);
|
|
1154
1159
|
// Every theme's palette has both modes: a one-mode theme keeps both
|
|
1155
1160
|
// halves of its colors (its mode is the one the app's <Theme> is given),
|
|
@@ -1336,6 +1341,24 @@ function planPalette(cwd, slug, data, base) {
|
|
|
1336
1341
|
if (inOrder.length === slots.length)
|
|
1337
1342
|
slots.forEach((i, k) => (families[i] = inOrder[k]));
|
|
1338
1343
|
config.families = families;
|
|
1344
|
+
// A color change on a palette made with the first recipe says what the
|
|
1345
|
+
// newer one does, and how to choose it.
|
|
1346
|
+
/** @param {any} c */
|
|
1347
|
+
const colorsOf = c =>
|
|
1348
|
+
JSON.stringify([
|
|
1349
|
+
c?.vibrancy ?? null,
|
|
1350
|
+
(Array.isArray(c?.families) ? c.families : []).map(
|
|
1351
|
+
(/** @type {any} */ f) => [f?.id, String(f?.seed ?? '').toLowerCase()],
|
|
1352
|
+
),
|
|
1353
|
+
]);
|
|
1354
|
+
if (
|
|
1355
|
+
own &&
|
|
1356
|
+
(config.recipe ?? PALETTE_RECIPE) === PALETTE_RECIPE &&
|
|
1357
|
+
colorsOf(existing) !== colorsOf(config)
|
|
1358
|
+
)
|
|
1359
|
+
notes.push(
|
|
1360
|
+
`${file} makes its colors with the ${PALETTE_RECIPE} recipe it was made with, whose pale shades stay at the edge of what a screen shows whatever the vibrancy; "recipe": "${PALETTE_RECIPE_V2}" there makes them follow the vibrancy and each color's own strength (its colors change once)`,
|
|
1361
|
+
);
|
|
1339
1362
|
const dead = deadKeys(config);
|
|
1340
1363
|
if (dead.length)
|
|
1341
1364
|
notes.push(
|
|
@@ -1603,6 +1626,8 @@ const writtenRecordFile = (cwd, slug) =>
|
|
|
1603
1626
|
*/
|
|
1604
1627
|
export function writeWrittenRecord(cwd, slug, map) {
|
|
1605
1628
|
const file = writtenRecordFile(cwd, slug);
|
|
1629
|
+
// A link of the user's at the record's name is left as it is.
|
|
1630
|
+
if (fs.lstatSync(file, {throwIfNoEntry: false})?.isSymbolicLink()) return;
|
|
1606
1631
|
try {
|
|
1607
1632
|
if (!Object.keys(map).length) fs.rmSync(file, {force: true});
|
|
1608
1633
|
else {
|
|
@@ -2433,7 +2458,13 @@ export function paletteMapping(cwd, slug, data, base, tokenDefaults) {
|
|
|
2433
2458
|
const moved = pick(names.text, f.id, m, S, grounds, TEXT);
|
|
2434
2459
|
const last = checks.length > before ? checks[checks.length - 1] : null;
|
|
2435
2460
|
if (last && moved.stop !== S)
|
|
2436
|
-
last.note = `${names.text} ${m}: your exact color (${own.color}) reads at only ${
|
|
2461
|
+
last.note = `${names.text} ${m}: your exact color (${own.color}) reads at only ${grounds
|
|
2462
|
+
.map(([n, bg]) => [n, contrast(own.color, bg)])
|
|
2463
|
+
.filter(([, x]) => Number(x) < TEXT)
|
|
2464
|
+
.map(([n, x]) => `${round(Number(x))}:1 on ${n}`)
|
|
2465
|
+
.join(
|
|
2466
|
+
', ',
|
|
2467
|
+
)} (text needs ${TEXT}:1), so links and accent text use shade ${shade(moved.stop)} (${moved.color}), the nearest that reads; the fill keeps your color, and an exact ${names.text} keeps any color you give it`;
|
|
2437
2468
|
return moved;
|
|
2438
2469
|
}
|
|
2439
2470
|
return pick(names.text, f.id, m, at(TEXT_STOP[side(m)]), grounds, TEXT);
|