@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/_edit.mjs
CHANGED
|
@@ -145,6 +145,7 @@ import {
|
|
|
145
145
|
dialSettingsInText,
|
|
146
146
|
skips,
|
|
147
147
|
OPEN_SECTION,
|
|
148
|
+
FOLLOWS,
|
|
148
149
|
} from './_settings.mjs';
|
|
149
150
|
import {
|
|
150
151
|
checkSetting,
|
|
@@ -164,7 +165,10 @@ import {MODAL, isColorToken} from './_compiler.mjs';
|
|
|
164
165
|
import {fontShorthandFamilyList} from '../theme/build/font-warning.mjs';
|
|
165
166
|
import {
|
|
166
167
|
isHeadingLevel,
|
|
168
|
+
levelDuplicates,
|
|
169
|
+
missingScaleFieldWhy,
|
|
167
170
|
noLevelWhy,
|
|
171
|
+
typographyBlockWhy,
|
|
168
172
|
noScaleWeightWhy,
|
|
169
173
|
roleWeightTokens,
|
|
170
174
|
typographyValueProblem,
|
|
@@ -175,6 +179,7 @@ import {
|
|
|
175
179
|
} from '../../foundation/config/theme-private-vars.mjs';
|
|
176
180
|
import {innerBlock, partKeyProblem} from '../theme/build/style-keys.mjs';
|
|
177
181
|
import {
|
|
182
|
+
CUSTOM_PROPERTY,
|
|
178
183
|
customPropertyCycle,
|
|
179
184
|
cycleProblem,
|
|
180
185
|
} from '../theme/build/written-values.mjs';
|
|
@@ -206,6 +211,7 @@ import {
|
|
|
206
211
|
appCopyStale,
|
|
207
212
|
copyFontsCss,
|
|
208
213
|
writeAppCopy,
|
|
214
|
+
touchedFamilies,
|
|
209
215
|
} from './_preview.mjs';
|
|
210
216
|
import {appWiring, refreshPreviewRoute, seeLine} from './_preview-app.mjs';
|
|
211
217
|
/** The preview command, as a person runs it. */
|
|
@@ -226,6 +232,9 @@ import {
|
|
|
226
232
|
requireProject,
|
|
227
233
|
context,
|
|
228
234
|
pictures,
|
|
235
|
+
SAMPLE_PAGE_NAME,
|
|
236
|
+
cutShortNote,
|
|
237
|
+
cutShortProblem,
|
|
229
238
|
openStatesPage,
|
|
230
239
|
fontNotes,
|
|
231
240
|
themeImageNotes,
|
|
@@ -234,6 +243,9 @@ import {
|
|
|
234
243
|
checkSection,
|
|
235
244
|
stampSheet,
|
|
236
245
|
lookAtPictures,
|
|
246
|
+
familyPages,
|
|
247
|
+
FAMILY_SECTIONS,
|
|
248
|
+
FAMILY_OVERVIEW,
|
|
237
249
|
} from './_context.mjs';
|
|
238
250
|
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
239
251
|
import {readThemeState} from '../../foundation/config/theme-state.mjs';
|
|
@@ -1228,7 +1240,14 @@ async function newTheme(
|
|
|
1228
1240
|
}
|
|
1229
1241
|
refuseIfLockLost();
|
|
1230
1242
|
fs.rmSync(marker, {force: true});
|
|
1231
|
-
const p = await previewAndRoute(
|
|
1243
|
+
const {cutShort, ...p} = await previewAndRoute(
|
|
1244
|
+
ctx,
|
|
1245
|
+
name,
|
|
1246
|
+
data,
|
|
1247
|
+
png,
|
|
1248
|
+
'overview',
|
|
1249
|
+
'new',
|
|
1250
|
+
);
|
|
1232
1251
|
/** @type {string[]} */
|
|
1233
1252
|
const notes = [
|
|
1234
1253
|
...keptNotes,
|
|
@@ -1236,6 +1255,7 @@ async function newTheme(
|
|
|
1236
1255
|
...(data.settings.some(s => s.thing === 'font')
|
|
1237
1256
|
? fontNotes(ctx, data)
|
|
1238
1257
|
: []),
|
|
1258
|
+
...cutShort.map(cutShortNote),
|
|
1239
1259
|
];
|
|
1240
1260
|
return {
|
|
1241
1261
|
type: 'themeEdit.new',
|
|
@@ -3230,7 +3250,9 @@ async function ownTokenProblems(ctx, slug, data) {
|
|
|
3230
3250
|
// A var() of a custom property the theme's own page sets reads the
|
|
3231
3251
|
// text it gives: the property must take that text there.
|
|
3232
3252
|
if (typeof value === 'string')
|
|
3233
|
-
for (const m of value.matchAll(
|
|
3253
|
+
for (const m of value.matchAll(
|
|
3254
|
+
new RegExp(String.raw`var\(\s*(${CUSTOM_PROPERTY})\s*\)`, 'gi'),
|
|
3255
|
+
)) {
|
|
3234
3256
|
const text = ownText.get(m[1]);
|
|
3235
3257
|
if (
|
|
3236
3258
|
text === undefined ||
|
|
@@ -3287,7 +3309,9 @@ async function ownTokenProblems(ctx, slug, data) {
|
|
|
3287
3309
|
/** @param {unknown} node @param {number} depth */
|
|
3288
3310
|
const collectReads = (node, depth) => {
|
|
3289
3311
|
if (typeof node === 'string')
|
|
3290
|
-
for (const m of node.matchAll(
|
|
3312
|
+
for (const m of node.matchAll(
|
|
3313
|
+
new RegExp(String.raw`var\(\s*(${CUSTOM_PROPERTY})`, 'g'),
|
|
3314
|
+
))
|
|
3291
3315
|
readVars.add(m[1]);
|
|
3292
3316
|
else if (node && typeof node === 'object' && depth < 24)
|
|
3293
3317
|
for (const v of Object.values(node)) collectReads(v, depth + 1);
|
|
@@ -3641,7 +3665,10 @@ async function ownTokenProblems(ctx, slug, data) {
|
|
|
3641
3665
|
// A part variable that defaults to a design token takes what
|
|
3642
3666
|
// that token takes.
|
|
3643
3667
|
const reads = own
|
|
3644
|
-
?
|
|
3668
|
+
? new RegExp(
|
|
3669
|
+
String.raw`^var\(\s*(${CUSTOM_PROPERTY})\s*\)$`,
|
|
3670
|
+
'i',
|
|
3671
|
+
).exec(own.default)?.[1]
|
|
3645
3672
|
: undefined;
|
|
3646
3673
|
if (reads && reads in known) {
|
|
3647
3674
|
const loc = where(at.join('.'), k);
|
|
@@ -3870,7 +3897,41 @@ async function ownTokenProblems(ctx, slug, data) {
|
|
|
3870
3897
|
}
|
|
3871
3898
|
}
|
|
3872
3899
|
};
|
|
3900
|
+
if (
|
|
3901
|
+
input.typography != null &&
|
|
3902
|
+
(typeof input.typography !== 'object' || Array.isArray(input.typography))
|
|
3903
|
+
) {
|
|
3904
|
+
const e = typo[0];
|
|
3905
|
+
out.push({
|
|
3906
|
+
token: 'typography',
|
|
3907
|
+
value: typeof input.typography === 'string' ? input.typography : '',
|
|
3908
|
+
why: typographyBlockWhy(input.typography),
|
|
3909
|
+
...(e ? atOf(e) : {line: null, file: null}),
|
|
3910
|
+
});
|
|
3911
|
+
}
|
|
3873
3912
|
fields(input.typography, []);
|
|
3913
|
+
// Two keys for one heading level ('01' and 1): Core keeps one.
|
|
3914
|
+
if (input.typography && typeof input.typography === 'object')
|
|
3915
|
+
for (const [role, r] of Object.entries(input.typography)) {
|
|
3916
|
+
const weights = r && typeof r === 'object' ? r.weights : undefined;
|
|
3917
|
+
if (!weights || typeof weights !== 'object' || Array.isArray(weights))
|
|
3918
|
+
continue;
|
|
3919
|
+
for (const d of levelDuplicates(
|
|
3920
|
+
role,
|
|
3921
|
+
weights,
|
|
3922
|
+
typeFields?.levels ?? [],
|
|
3923
|
+
)) {
|
|
3924
|
+
const key = `${role}.weights.${d.key}`;
|
|
3925
|
+
const e = typo.find(x => x.key === key) ?? typo[0];
|
|
3926
|
+
flagged.add(role);
|
|
3927
|
+
out.push({
|
|
3928
|
+
token: `typography.${key}`,
|
|
3929
|
+
value: typeof weights[d.key] === 'string' ? weights[d.key] : '',
|
|
3930
|
+
why: d.why,
|
|
3931
|
+
...(e ? atOf(e) : {line: null, file: null}),
|
|
3932
|
+
});
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3874
3935
|
// Core builds a role's font list from its family, with the fallbacks
|
|
3875
3936
|
// after it: fallbacks with no family in that role build nothing.
|
|
3876
3937
|
if (input.typography && typeof input.typography === 'object')
|
|
@@ -3951,10 +4012,7 @@ async function ownTokenProblems(ctx, slug, data) {
|
|
|
3951
4012
|
}
|
|
3952
4013
|
}
|
|
3953
4014
|
const scale = input.typography?.scale;
|
|
3954
|
-
for (const
|
|
3955
|
-
['base', 'the body size in pixels, such as scale: {base: 16, ratio: …}'],
|
|
3956
|
-
['ratio', 'the step between sizes, such as scale: {base: …, ratio: 1.2}'],
|
|
3957
|
-
]))
|
|
4015
|
+
for (const field of /** @type {const} */ (['base', 'ratio']))
|
|
3958
4016
|
if (
|
|
3959
4017
|
scale &&
|
|
3960
4018
|
typeof scale === 'object' &&
|
|
@@ -3969,7 +4027,7 @@ async function ownTokenProblems(ctx, slug, data) {
|
|
|
3969
4027
|
out.push({
|
|
3970
4028
|
token: 'typography.scale',
|
|
3971
4029
|
value: '',
|
|
3972
|
-
why:
|
|
4030
|
+
why: missingScaleFieldWhy(field),
|
|
3973
4031
|
...(e ? atOf(e) : {line: null, file: null}),
|
|
3974
4032
|
});
|
|
3975
4033
|
}
|
|
@@ -5558,10 +5616,32 @@ async function changeOnce(
|
|
|
5558
5616
|
(x.when ?? null) === (meant.when ?? null) &&
|
|
5559
5617
|
stateKeyOf(x.state) === stateKeyOf(meant.state) &&
|
|
5560
5618
|
(x.mode ?? null) === (meant.mode ?? null);
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5619
|
+
/**
|
|
5620
|
+
* How near a saved setting is to the scope typed, read as `m`: its
|
|
5621
|
+
* whole scope (the most), else how many of the flags typed it
|
|
5622
|
+
* shares (`--on card` with a card setting in a state leads ahead
|
|
5623
|
+
* of a whole-theme one).
|
|
5624
|
+
* @param {any} x
|
|
5625
|
+
* @param {Record<string, string | undefined>} m
|
|
5626
|
+
*/
|
|
5627
|
+
const nearness = (x, m) => {
|
|
5628
|
+
const same = (/** @type {string} */ k) =>
|
|
5629
|
+
k === 'state'
|
|
5630
|
+
? stateKeyOf(x.state) === stateKeyOf(m.state)
|
|
5631
|
+
: (x[k] ?? null) === (m[k] ?? null);
|
|
5632
|
+
const keys = /** @type {const} */ (['on', 'when', 'state', 'mode']);
|
|
5633
|
+
if (keys.every(same)) return 10;
|
|
5634
|
+
return keys.filter(
|
|
5635
|
+
k => /** @type {any} */ (flags)[k] != null && same(k),
|
|
5636
|
+
).length;
|
|
5637
|
+
};
|
|
5638
|
+
/** Stable, nearest first. @param {any[]} list @param {(x: any) => number} by */
|
|
5639
|
+
const nearestFirst = (list, by) =>
|
|
5640
|
+
list
|
|
5641
|
+
.map((x, i) => ({x, i, n: by(x)}))
|
|
5642
|
+
.sort((a, b) => b.n - a.n || a.i - b.i)
|
|
5643
|
+
.map(e => e.x);
|
|
5644
|
+
const ordered = nearestFirst(matches, x => nearness(x, meant));
|
|
5565
5645
|
const scoped = flags.on || flags.when || flags.state || flags.mode;
|
|
5566
5646
|
// A word that is a value the theme holds (`undo t red`) names the
|
|
5567
5647
|
// setting that holds it: its undo, never a step back that takes back
|
|
@@ -5591,19 +5671,9 @@ async function changeOnce(
|
|
|
5591
5671
|
: data.settings.filter(x => valueIs(x.value, typed));
|
|
5592
5672
|
// The one in the scope typed (read as set reads it for that
|
|
5593
5673
|
// setting) leads.
|
|
5594
|
-
const
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
(x.on ?? null) === (m.on ?? null) &&
|
|
5598
|
-
(x.when ?? null) === (m.when ?? null) &&
|
|
5599
|
-
stateKeyOf(x.state) === stateKeyOf(m.state) &&
|
|
5600
|
-
(x.mode ?? null) === (m.mode ?? null)
|
|
5601
|
-
);
|
|
5602
|
-
};
|
|
5603
|
-
const byValue = [
|
|
5604
|
-
...holding.filter(inScope),
|
|
5605
|
-
...holding.filter(x => !inScope(x)),
|
|
5606
|
-
];
|
|
5674
|
+
const byValue = nearestFirst(holding, x =>
|
|
5675
|
+
nearness(x, scopeAsRead(x.thing, String(x.value))),
|
|
5676
|
+
);
|
|
5607
5677
|
if (byValue.length)
|
|
5608
5678
|
throw new AstryxError(
|
|
5609
5679
|
`"${thing}" is no setting; ${slug} holds it as the value of ${byValue.map(x => describe(x)).join(', ')}. Nothing was changed.`,
|
|
@@ -5654,6 +5724,35 @@ async function changeOnce(
|
|
|
5654
5724
|
}
|
|
5655
5725
|
s = stored;
|
|
5656
5726
|
}
|
|
5727
|
+
// A color set with no --mode in a one-mode theme is that mode's color, as
|
|
5728
|
+
// the build reads it (it fills that mode's half): saved with the mode, so
|
|
5729
|
+
// the theme going back to both modes keeps it there, and a color saved
|
|
5730
|
+
// for the other mode (the half a toast or a lightbox reads) stays. An
|
|
5731
|
+
// undo with no --mode names that entry too.
|
|
5732
|
+
const ownMode =
|
|
5733
|
+
data.mode === 'dark-only'
|
|
5734
|
+
? 'dark'
|
|
5735
|
+
: data.mode === 'light-only'
|
|
5736
|
+
? 'light'
|
|
5737
|
+
: null;
|
|
5738
|
+
if (
|
|
5739
|
+
ownMode &&
|
|
5740
|
+
sub === 'set' &&
|
|
5741
|
+
!s.mode &&
|
|
5742
|
+
s.source !== 'dial' &&
|
|
5743
|
+
typeof s.value === 'string' &&
|
|
5744
|
+
parseColor(s.value.trim()) != null &&
|
|
5745
|
+
(s.source === 'property' || MODAL.has(ctx.C.typeOf(s.thing)))
|
|
5746
|
+
)
|
|
5747
|
+
s = {...s, mode: ownMode};
|
|
5748
|
+
if (
|
|
5749
|
+
ownMode &&
|
|
5750
|
+
sub === 'undo' &&
|
|
5751
|
+
!s.mode &&
|
|
5752
|
+
!data.settings.some(x => keyOf(x) === keyOf(s)) &&
|
|
5753
|
+
data.settings.some(x => keyOf(x) === keyOf({...s, mode: ownMode}))
|
|
5754
|
+
)
|
|
5755
|
+
s = {...s, mode: ownMode};
|
|
5657
5756
|
let k = keyOf(s);
|
|
5658
5757
|
let prevIdx =
|
|
5659
5758
|
rawIdx >= 0
|
|
@@ -5839,7 +5938,14 @@ async function changeOnce(
|
|
|
5839
5938
|
} else
|
|
5840
5939
|
data.mode = /** @type {'both' | 'light-only' | 'dark-only'} */ (s.value);
|
|
5841
5940
|
const r = await commitTheme(ctx, slug, data, {history: true});
|
|
5842
|
-
const p = await previewAndRoute(
|
|
5941
|
+
const {cutShort, ...p} = await previewAndRoute(
|
|
5942
|
+
ctx,
|
|
5943
|
+
slug,
|
|
5944
|
+
data,
|
|
5945
|
+
png,
|
|
5946
|
+
'overview',
|
|
5947
|
+
sub,
|
|
5948
|
+
);
|
|
5843
5949
|
const after = await baseResolved(ctx.project, data.like).catch(() => base);
|
|
5844
5950
|
return {
|
|
5845
5951
|
type: 'themeEdit.set',
|
|
@@ -5919,9 +6025,13 @@ async function changeOnce(
|
|
|
5919
6025
|
modesOf(data),
|
|
5920
6026
|
).slice(0, -1),
|
|
5921
6027
|
),
|
|
6028
|
+
...cutShort.map(cutShortNote),
|
|
5922
6029
|
],
|
|
5923
6030
|
problems: r.problems,
|
|
5924
|
-
newProblems:
|
|
6031
|
+
newProblems: [
|
|
6032
|
+
...problemLines(r.newProblems),
|
|
6033
|
+
...cutShort.map(c => cutShortProblem(ctx, slug, c)),
|
|
6034
|
+
],
|
|
5925
6035
|
warnings: r.warnings,
|
|
5926
6036
|
...p,
|
|
5927
6037
|
},
|
|
@@ -6356,6 +6466,33 @@ async function changeOnce(
|
|
|
6356
6466
|
break;
|
|
6357
6467
|
}
|
|
6358
6468
|
}
|
|
6469
|
+
// A radius the own source sets on a part wins over a radius setting
|
|
6470
|
+
// there, which the editor writes as the part's radius token (a button's
|
|
6471
|
+
// --radius-element): the own border-radius does not read it.
|
|
6472
|
+
if (
|
|
6473
|
+
sub === 'set' &&
|
|
6474
|
+
s.source === 'property' &&
|
|
6475
|
+
s.on &&
|
|
6476
|
+
/^border(-[a-z]+)*-radius$/.test(s.thing)
|
|
6477
|
+
)
|
|
6478
|
+
for (const target of partsOf(ctx, s)) {
|
|
6479
|
+
const state = s.state ? `:${s.state}` : null;
|
|
6480
|
+
for (const [prop, value] of ownPartTokens(
|
|
6481
|
+
cwd,
|
|
6482
|
+
slug,
|
|
6483
|
+
target,
|
|
6484
|
+
s.when ?? 'base',
|
|
6485
|
+
state,
|
|
6486
|
+
))
|
|
6487
|
+
if (
|
|
6488
|
+
/^border(-[a-z]+)*-radius$/.test(prop) &&
|
|
6489
|
+
!String(value ?? '').includes('var(--radius-') &&
|
|
6490
|
+
!ownPartHits.some(h => h.target === target && h.prop === prop)
|
|
6491
|
+
) {
|
|
6492
|
+
ownPartHits.push({target, key: s.when ?? 'base', state, prop, value});
|
|
6493
|
+
break;
|
|
6494
|
+
}
|
|
6495
|
+
}
|
|
6359
6496
|
// A direct setting on exactly the rule the own source sets: its undo
|
|
6360
6497
|
// takes it back (anything else the file wins over either way).
|
|
6361
6498
|
const ownHitDirect =
|
|
@@ -6494,6 +6631,29 @@ async function changeOnce(
|
|
|
6494
6631
|
!ctx.unchecked
|
|
6495
6632
|
? [
|
|
6496
6633
|
`this changes nothing you see: the theme already shows ${describe(s)} (it is saved, and stays when the base theme changes)`,
|
|
6634
|
+
// A mode's own setting under one the theme sets for every mode:
|
|
6635
|
+
// that one still draws the other modes, which this does not
|
|
6636
|
+
// change.
|
|
6637
|
+
...(() => {
|
|
6638
|
+
if (!s.mode) return [];
|
|
6639
|
+
const whole = data.settings.find(
|
|
6640
|
+
x =>
|
|
6641
|
+
x !== s &&
|
|
6642
|
+
!x.mode &&
|
|
6643
|
+
x.source === s.source &&
|
|
6644
|
+
x.thing === s.thing &&
|
|
6645
|
+
(x.on ?? null) === (s.on ?? null) &&
|
|
6646
|
+
(x.when ?? null) === (s.when ?? null) &&
|
|
6647
|
+
(x.state ?? null) === (s.state ?? null),
|
|
6648
|
+
);
|
|
6649
|
+
if (!whole) return [];
|
|
6650
|
+
const others = modesOf(data).filter(m => m !== s.mode);
|
|
6651
|
+
return others.length
|
|
6652
|
+
? [
|
|
6653
|
+
`your setting for every mode (${describe(whole)}) still draws ${others.join(' and ')}; to keep it for ${s.mode} only, take that one back (this one stays): ${P} undo ${slug} ${undoArgs(whole)}`,
|
|
6654
|
+
]
|
|
6655
|
+
: [];
|
|
6656
|
+
})(),
|
|
6497
6657
|
]
|
|
6498
6658
|
: []),
|
|
6499
6659
|
// A card's content takes one radius from Core, whatever its corners.
|
|
@@ -6721,18 +6881,60 @@ async function changeOnce(
|
|
|
6721
6881
|
]
|
|
6722
6882
|
: []),
|
|
6723
6883
|
);
|
|
6884
|
+
// A token another one follows (the surface's fills, the emphasized
|
|
6885
|
+
// border) says what moved with it.
|
|
6886
|
+
if (sub === 'set' && s.source === 'token' && !s.on && !s.when && !s.state) {
|
|
6887
|
+
const followers = Object.keys(FOLLOWS).filter(
|
|
6888
|
+
k =>
|
|
6889
|
+
FOLLOWS[k] === s.thing &&
|
|
6890
|
+
r.changed.some(
|
|
6891
|
+
(/** @type {unknown} */ c) => String(c).split(/[\s:]/)[0] === k,
|
|
6892
|
+
),
|
|
6893
|
+
);
|
|
6894
|
+
// The parts the base theme draws from a follower besides its own
|
|
6895
|
+
// token (neutral's progress and switch tracks, from the emphasized
|
|
6896
|
+
// border) move with it too.
|
|
6897
|
+
/** @param {string} token */
|
|
6898
|
+
const drawnFrom = token =>
|
|
6899
|
+
Object.entries(
|
|
6900
|
+
/** @type {{components?: Record<string, Record<string, unknown>>}} */ (
|
|
6901
|
+
base
|
|
6902
|
+
).components ?? {},
|
|
6903
|
+
)
|
|
6904
|
+
.filter(([, keys]) =>
|
|
6905
|
+
Object.values(keys).some(
|
|
6906
|
+
b =>
|
|
6907
|
+
b &&
|
|
6908
|
+
typeof b === 'object' &&
|
|
6909
|
+
Object.values(b).some(
|
|
6910
|
+
v => typeof v === 'string' && v.includes(`var(${token})`),
|
|
6911
|
+
),
|
|
6912
|
+
),
|
|
6913
|
+
)
|
|
6914
|
+
.map(([t]) => t);
|
|
6915
|
+
if (followers.length) {
|
|
6916
|
+
const also = [...new Set(followers.flatMap(drawnFrom))];
|
|
6917
|
+
notes.push(
|
|
6918
|
+
`${followers.join(', ')} ${followers.length === 1 ? 'follows' : 'follow'} it (${s.thing === '--color-border' ? 'the frames of inputs and selectors, never fainter than the border' : "the fills made from the surface, at the base theme's step from it"})${also.length ? `, and so do the parts the base theme draws from ${followers.length === 1 ? 'it' : 'them'}: ${also.join(', ')}` : ''}; an exact setting of ${followers.length === 1 ? 'it' : 'one'} keeps its own color`,
|
|
6919
|
+
);
|
|
6920
|
+
}
|
|
6921
|
+
}
|
|
6724
6922
|
if (s.thing === 'neutral' && sub === 'set') {
|
|
6725
6923
|
// Only the theme's own modes; a dark theme gets no white-page offer.
|
|
6726
6924
|
const modes = modesOf(data);
|
|
6727
|
-
const
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6925
|
+
const pinned = data.settings.some(
|
|
6926
|
+
x =>
|
|
6927
|
+
x.source === 'token' &&
|
|
6928
|
+
x.thing === '--color-background-body' &&
|
|
6929
|
+
!x.on &&
|
|
6930
|
+
!x.when &&
|
|
6931
|
+
!x.state,
|
|
6932
|
+
);
|
|
6731
6933
|
notes.push(
|
|
6732
|
-
|
|
6934
|
+
`${pinned ? 'the page background keeps the color you set for it' : "the page background follows it too, at the official theme's page shade of this gray"}${
|
|
6733
6935
|
modes.includes('light')
|
|
6734
6936
|
? `; for a white or off-white page: ${P} set ${slug} --color-background-body ${quoteCommandArgument('#ffffff')}${modes.length > 1 ? ' --mode light' : ''}`
|
|
6735
|
-
: `; for another page color: ${P} set ${slug} --color-background-body ${quoteCommandArgument('#
|
|
6937
|
+
: `; for another page color: ${P} set ${slug} --color-background-body ${quoteCommandArgument('#111111')}`
|
|
6736
6938
|
}`,
|
|
6737
6939
|
);
|
|
6738
6940
|
}
|
|
@@ -6775,7 +6977,7 @@ async function changeOnce(
|
|
|
6775
6977
|
// package installed or removed since).
|
|
6776
6978
|
if (r.unchanged && appCopyBehind(cwd, slug, copyFontsCss(ctx, slug, data)))
|
|
6777
6979
|
writeAppCopy(ctx, slug, data);
|
|
6778
|
-
const p =
|
|
6980
|
+
const {cutShort, ...p} =
|
|
6779
6981
|
r.unchanged &&
|
|
6780
6982
|
!png &&
|
|
6781
6983
|
fs.existsSync(f0.preview) &&
|
|
@@ -6784,6 +6986,8 @@ async function changeOnce(
|
|
|
6784
6986
|
preview: shown(cwd, f0.preview),
|
|
6785
6987
|
pictures: [],
|
|
6786
6988
|
pictureProblem: null,
|
|
6989
|
+
// No pictures: nothing measured.
|
|
6990
|
+
cutShort: [],
|
|
6787
6991
|
notChecked: null,
|
|
6788
6992
|
previewStale: [],
|
|
6789
6993
|
see: seeLine(cwd, slug, changeFocus(s)),
|
|
@@ -6819,7 +7023,9 @@ async function changeOnce(
|
|
|
6819
7023
|
sub === 'set' && prev && prev.source === 'dial' && !prev.on
|
|
6820
7024
|
? prev.value
|
|
6821
7025
|
: null,
|
|
6822
|
-
|
|
7026
|
+
// What else to know, then the text the sample page's pictures draw
|
|
7027
|
+
// cut short.
|
|
7028
|
+
notes: [...notes, ...cutShort.map(cutShortNote)],
|
|
6823
7029
|
// What the whole-theme change leaves out, with the lines that reach
|
|
6824
7030
|
// it; the text output prints it right under the status line.
|
|
6825
7031
|
leftOut: leftOutParts(ctx, slug, data, sub, s),
|
|
@@ -6842,6 +7048,9 @@ async function changeOnce(
|
|
|
6842
7048
|
newProblems: [
|
|
6843
7049
|
...problemLines(r.newProblems),
|
|
6844
7050
|
...colorFails.map(problem => ({problem, fix: null})),
|
|
7051
|
+
// Text the sample page's pictures draw cut short, with the line
|
|
7052
|
+
// the browser measured as keeping it whole.
|
|
7053
|
+
...cutShort.map(c => cutShortProblem(ctx, slug, c)),
|
|
6845
7054
|
],
|
|
6846
7055
|
// How many misses the theme's own changes left (show lists each with
|
|
6847
7056
|
// the line that reaches it), and on how many parts (a part can miss
|
|
@@ -7003,9 +7212,7 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7003
7212
|
}
|
|
7004
7213
|
const ctx = await context(cwd);
|
|
7005
7214
|
// show --png takes its sheet too, after any build it makes.
|
|
7006
|
-
ctx.takesPictures = png
|
|
7007
|
-
? {sheet: section ? `sheet-${section}` : 'sheet'}
|
|
7008
|
-
: null;
|
|
7215
|
+
ctx.takesPictures = png ? {sheet: section ? `sheet-${section}` : null} : null;
|
|
7009
7216
|
// The app copy is written once show succeeds (at its end), never by a
|
|
7010
7217
|
// build a later refusal puts back.
|
|
7011
7218
|
holdAfterBuild(ctx);
|
|
@@ -7177,7 +7384,20 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7177
7384
|
await baseResolved(ctx.project, data.like),
|
|
7178
7385
|
ctx.project.core.tokenDefaults,
|
|
7179
7386
|
);
|
|
7180
|
-
|
|
7387
|
+
/** @type {Record<string, string>} */
|
|
7388
|
+
let ownTokens = {};
|
|
7389
|
+
try {
|
|
7390
|
+
ownTokens = ownSourceTokenValues(cwd, theme);
|
|
7391
|
+
} catch {
|
|
7392
|
+
// A source that cannot be read sets nothing here.
|
|
7393
|
+
}
|
|
7394
|
+
const {colorProblems, ...colorPart} = colorsReport(
|
|
7395
|
+
pal,
|
|
7396
|
+
data,
|
|
7397
|
+
res,
|
|
7398
|
+
theme,
|
|
7399
|
+
ownTokens,
|
|
7400
|
+
);
|
|
7181
7401
|
// A render that fails here (two copies of React, a component that
|
|
7182
7402
|
// throws) is refused as the one above: what this show built goes back,
|
|
7183
7403
|
// and the result says so.
|
|
@@ -7211,14 +7431,15 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7211
7431
|
const sheetFile = section
|
|
7212
7432
|
? path.join(f.dir, `sheet-${section}.html`)
|
|
7213
7433
|
: f.sheet;
|
|
7214
|
-
/** @type {Array<{html: string, png: string, kind: 'link' | 'file' | 'other', page: string}>} */
|
|
7434
|
+
/** @type {Array<{html: string, png: string | null, kind: 'link' | 'file' | 'other', page: string}>} */
|
|
7215
7435
|
const leftPages = noPages
|
|
7216
7436
|
? []
|
|
7217
7437
|
: [
|
|
7218
7438
|
{html: f.preview, png: f.previewPng, page: 'the sample page'},
|
|
7219
7439
|
{
|
|
7220
7440
|
html: sheetFile,
|
|
7221
|
-
|
|
7441
|
+
// The full sheet is not photographed.
|
|
7442
|
+
png: section ? path.join(f.dir, `sheet-${section}.png`) : null,
|
|
7222
7443
|
page: section ? `the ${section} sheet` : 'the sheet',
|
|
7223
7444
|
},
|
|
7224
7445
|
].flatMap(x => {
|
|
@@ -7246,9 +7467,26 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7246
7467
|
// The full sheet records the build it shows, so a later change tells a
|
|
7247
7468
|
// sheet that still matches (after an undo) from one that does not.
|
|
7248
7469
|
if (!noPages && !left(sheetFile)) stampSheet(sheetFile, theme, cwd);
|
|
7470
|
+
// The full sheet is too tall to read whole: --png also takes each family
|
|
7471
|
+
// of components on a page of its own, cut from it.
|
|
7472
|
+
// Each takes a browser run, so --png pictures the families the theme sets
|
|
7473
|
+
// a part of (the buttons when it sets none); --section <family> takes any
|
|
7474
|
+
// other, and sheet.html holds every component.
|
|
7475
|
+
const touched = touchedFamilies(ctx.project, data).filter(f =>
|
|
7476
|
+
FAMILY_SECTIONS.includes(f),
|
|
7477
|
+
);
|
|
7478
|
+
const families =
|
|
7479
|
+
png && !noPages && !section && !left(sheetFile)
|
|
7480
|
+
? familyPages(
|
|
7481
|
+
sheetFile,
|
|
7482
|
+
theme,
|
|
7483
|
+
cwd,
|
|
7484
|
+
touched.length ? touched : [FAMILY_OVERVIEW],
|
|
7485
|
+
)
|
|
7486
|
+
: {pages: [], problems: []};
|
|
7249
7487
|
const leftWords = leftPages.map(
|
|
7250
7488
|
x =>
|
|
7251
|
-
`${inTheWayPhrase(shown(cwd, x.html), x.kind, x.page)}, so ${x.page} was not made${png ? ` and ${shown(cwd, x.png)} was not taken` : ''}; move ${x.kind === 'link' ? 'the link' : 'it'}, then run ${P} show ${theme}${section ? ` --section ${section}` : ''}${png ? ' --png' : ''}`,
|
|
7489
|
+
`${inTheWayPhrase(shown(cwd, x.html), x.kind, x.page)}, so ${x.page} was not made${png && x.png ? ` and ${shown(cwd, x.png)} was not taken` : ''}; move ${x.kind === 'link' ? 'the link' : 'it'}, then run ${P} show ${theme}${section ? ` --section ${section}` : ''}${png ? ' --png' : ''}`,
|
|
7252
7490
|
);
|
|
7253
7491
|
const modes = modesOf(data);
|
|
7254
7492
|
// The open states (every overlay drawn open) beside the sample page: the
|
|
@@ -7274,27 +7512,33 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7274
7512
|
}
|
|
7275
7513
|
})
|
|
7276
7514
|
: null;
|
|
7277
|
-
/** @type {{files: string[], problem: string | null}} */
|
|
7515
|
+
/** @type {{files: string[], problem: string | null, cutShort: import('./_context.mjs').CutShort[]}} */
|
|
7278
7516
|
const shots =
|
|
7279
7517
|
png && !noPages
|
|
7280
7518
|
? await pictures(
|
|
7281
7519
|
ctx.project,
|
|
7282
7520
|
[
|
|
7283
|
-
{html: f.preview, png: f.previewPng},
|
|
7521
|
+
{html: f.preview, png: f.previewPng, name: SAMPLE_PAGE_NAME},
|
|
7284
7522
|
...(open && !('problem' in open) ? [open] : []),
|
|
7285
|
-
|
|
7286
|
-
section
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7523
|
+
...families.pages.map(({html, png: out}) => ({html, png: out})),
|
|
7524
|
+
// A section is photographed from its own sheet. The full sheet,
|
|
7525
|
+
// every component, is too tall to read whole and slow to take:
|
|
7526
|
+
// it is not photographed.
|
|
7527
|
+
...(section
|
|
7528
|
+
? [
|
|
7529
|
+
{
|
|
7530
|
+
html: path.join(f.dir, `sheet-${section}.html`),
|
|
7531
|
+
png: path.join(f.dir, `sheet-${section}.png`),
|
|
7532
|
+
},
|
|
7533
|
+
]
|
|
7534
|
+
: []),
|
|
7292
7535
|
].filter(x => !left(x.html)),
|
|
7293
7536
|
modes,
|
|
7294
7537
|
)
|
|
7295
7538
|
: // Pictures asked for but not taken: said, never a quiet none.
|
|
7296
7539
|
{
|
|
7297
7540
|
files: [],
|
|
7541
|
+
cutShort: [],
|
|
7298
7542
|
problem: png
|
|
7299
7543
|
? readOnly
|
|
7300
7544
|
? 'no picture was taken: show ran read-only (the project or its install cannot be written, so it could not hold the theme lock), and the pages the pictures are taken of were not made; run show --png where the project can be written'
|
|
@@ -7307,6 +7551,10 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7307
7551
|
shots.problem = [open.problem, shots.problem].filter(Boolean).join('; ');
|
|
7308
7552
|
if (png && leftWords.length)
|
|
7309
7553
|
shots.problem = [...leftWords, shots.problem].filter(Boolean).join('; ');
|
|
7554
|
+
if (families.problems.length)
|
|
7555
|
+
shots.problem = [...families.problems, shots.problem]
|
|
7556
|
+
.filter(Boolean)
|
|
7557
|
+
.join('; ');
|
|
7310
7558
|
const look = lookAtPictures(shots.files);
|
|
7311
7559
|
// The app copy follows the build there now, also when the build was
|
|
7312
7560
|
// current and only the copy is missing (a theme made before it existed).
|
|
@@ -7358,6 +7606,8 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7358
7606
|
...rebuiltNotes,
|
|
7359
7607
|
...(png ? [] : leftWords),
|
|
7360
7608
|
...sheet.notes,
|
|
7609
|
+
// Text the sample page's pictures draw cut short.
|
|
7610
|
+
...shots.cutShort.map(cutShortNote),
|
|
7361
7611
|
...misplacedNotes(theme, data),
|
|
7362
7612
|
...(noReact
|
|
7363
7613
|
? [
|
|
@@ -7440,6 +7690,9 @@ export async function themeEditShow(theme, options = {}) {
|
|
|
7440
7690
|
openProblems: [
|
|
7441
7691
|
...problemLines(shownChecks),
|
|
7442
7692
|
...colorProblems.map(problem => ({problem, fix: null})),
|
|
7693
|
+
// Text the sample page's pictures draw cut short, with the line
|
|
7694
|
+
// the browser measured as keeping it whole.
|
|
7695
|
+
...shots.cutShort.map(c => cutShortProblem(ctx, theme, c)),
|
|
7443
7696
|
],
|
|
7444
7697
|
preview,
|
|
7445
7698
|
previewStale,
|
|
@@ -8188,10 +8441,11 @@ function partValues(ctx, data, res, mode) {
|
|
|
8188
8441
|
* built theme's resolved values: where one differs from the generated
|
|
8189
8442
|
* shade with no exact setting, the theme's own source changed it
|
|
8190
8443
|
* @param {string} [slug]
|
|
8444
|
+
* @param {Record<string, string>} [own] the tokens the theme's own source sets
|
|
8191
8445
|
* @returns {{vibrancy: number | null, colors: import('./theme-edit.type.mjs').ThemeEditColor[], colorNotes: string[], colorProblems: string[]}}
|
|
8192
8446
|
* `colorProblems`: the color notes of pairings that fail their contrast
|
|
8193
8447
|
*/
|
|
8194
|
-
function colorsReport(pal, data, built, slug = '') {
|
|
8448
|
+
function colorsReport(pal, data, built, slug = '', own = {}) {
|
|
8195
8449
|
if (!pal)
|
|
8196
8450
|
return {vibrancy: null, colors: [], colorNotes: [], colorProblems: []};
|
|
8197
8451
|
/** What the user set for each token exactly, in each mode. */
|
|
@@ -8205,6 +8459,9 @@ function colorsReport(pal, data, built, slug = '') {
|
|
|
8205
8459
|
/** Tokens the theme's own source sets to another value than generated. */
|
|
8206
8460
|
const ownBy =
|
|
8207
8461
|
/** @type {Record<string, {light?: string, dark?: string}>} */ ({});
|
|
8462
|
+
/** Tokens that follow another the theme sets exactly ({@link FOLLOWS}). */
|
|
8463
|
+
const followBy =
|
|
8464
|
+
/** @type {Record<string, {light?: string, dark?: string}>} */ ({});
|
|
8208
8465
|
for (const [k, v] of Object.entries(pal.tokens))
|
|
8209
8466
|
for (const m of /** @type {const} */ (['light', 'dark'])) {
|
|
8210
8467
|
const now = built?.[m]?.[k];
|
|
@@ -8213,7 +8470,9 @@ function colorsReport(pal, data, built, slug = '') {
|
|
|
8213
8470
|
!exactBy[k]?.[m] &&
|
|
8214
8471
|
now.trim().toLowerCase() !== String(v[m].color).trim().toLowerCase()
|
|
8215
8472
|
)
|
|
8216
|
-
(
|
|
8473
|
+
(FOLLOWS[k] && exactBy[FOLLOWS[k]]?.[m] != null && !(k in own)
|
|
8474
|
+
? (followBy[k] ??= {})
|
|
8475
|
+
: (ownBy[k] ??= {}))[m] = now;
|
|
8217
8476
|
}
|
|
8218
8477
|
/** @param {import('./_palette.mjs').StopRef} r */
|
|
8219
8478
|
const shade = r =>
|
|
@@ -8252,14 +8511,16 @@ function colorsReport(pal, data, built, slug = '') {
|
|
|
8252
8511
|
k,
|
|
8253
8512
|
// Each mode says what it shows: the exact setting where one is
|
|
8254
8513
|
// made for it, else the generated shade.
|
|
8255
|
-
exactBy[k] || ownBy[k]
|
|
8514
|
+
exactBy[k] || ownBy[k] || followBy[k]
|
|
8256
8515
|
? modes
|
|
8257
8516
|
.map(m =>
|
|
8258
8517
|
exactBy[k]?.[m] != null
|
|
8259
8518
|
? `${m} ${exactBy[k][m]} (your exact setting wins over the generated ${shade(v[m])})`
|
|
8260
8519
|
: ownBy[k]?.[m] != null
|
|
8261
8520
|
? `${m} ${ownBy[k][m]} (your change in ${slug}.theme.ts wins over the generated ${shade(v[m])})`
|
|
8262
|
-
:
|
|
8521
|
+
: followBy[k]?.[m] != null
|
|
8522
|
+
? `${m} ${followBy[k][m]} (follows your ${FOLLOWS[k]}, over the generated ${shade(v[m])})`
|
|
8523
|
+
: `${m} ${shade(v[m])}`,
|
|
8263
8524
|
)
|
|
8264
8525
|
.join(', ')
|
|
8265
8526
|
: shades(v),
|
|
@@ -8953,7 +9214,14 @@ async function undoTheme(theme, options) {
|
|
|
8953
9214
|
: touched.includes('components')
|
|
8954
9215
|
? 'components'
|
|
8955
9216
|
: 'overview';
|
|
8956
|
-
const p = await previewAndRoute(
|
|
9217
|
+
const {cutShort, ...p} = await previewAndRoute(
|
|
9218
|
+
ctx,
|
|
9219
|
+
theme,
|
|
9220
|
+
prev,
|
|
9221
|
+
png,
|
|
9222
|
+
focus,
|
|
9223
|
+
'undo',
|
|
9224
|
+
);
|
|
8957
9225
|
// What the step took back, for the headline: each setting, base and mode
|
|
8958
9226
|
// it changed, in one line.
|
|
8959
9227
|
const took = current ? stepTakesBack(current, prev) : [];
|
|
@@ -9000,7 +9268,12 @@ async function undoTheme(theme, options) {
|
|
|
9000
9268
|
// What the step back changed, as a change reports it.
|
|
9001
9269
|
changedTokens: committed.changed,
|
|
9002
9270
|
problems: committed.problems,
|
|
9003
|
-
newProblems:
|
|
9271
|
+
newProblems: [
|
|
9272
|
+
...problemLines(committed.newProblems),
|
|
9273
|
+
...cutShort.map(c => cutShortProblem(ctx, theme, c)),
|
|
9274
|
+
],
|
|
9275
|
+
// Text the sample page's pictures draw cut short.
|
|
9276
|
+
...(cutShort.length ? {notes: cutShort.map(cutShortNote)} : {}),
|
|
9004
9277
|
...p,
|
|
9005
9278
|
},
|
|
9006
9279
|
};
|