@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
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Not found: the screen an app shows for an address that matches no page.
|
|
7
|
-
* A centered message with a search over the app's main destinations, so the
|
|
8
|
-
* reader can get where they meant to go, and a way home.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {useState} from 'react';
|
|
12
|
-
|
|
13
|
-
import {Center} from '@astryxdesign/core/Center';
|
|
14
|
-
import {VStack} from '@astryxdesign/core/Layout';
|
|
15
|
-
import {EmptyState} from '@astryxdesign/core/EmptyState';
|
|
16
|
-
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
17
|
-
import {List, ListItem} from '@astryxdesign/core/List';
|
|
18
|
-
import {Text} from '@astryxdesign/core/Text';
|
|
19
|
-
import {Button} from '@astryxdesign/core/Button';
|
|
20
|
-
import {Icon} from '@astryxdesign/core/Icon';
|
|
21
|
-
import {useToast} from '@astryxdesign/core/Toast';
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
ChartBarIcon,
|
|
25
|
-
Cog6ToothIcon,
|
|
26
|
-
FolderIcon,
|
|
27
|
-
MagnifyingGlassIcon,
|
|
28
|
-
MapIcon,
|
|
29
|
-
QuestionMarkCircleIcon,
|
|
30
|
-
UsersIcon,
|
|
31
|
-
} from '@heroicons/react/24/outline';
|
|
32
|
-
|
|
33
|
-
const DESTINATIONS = [
|
|
34
|
-
{
|
|
35
|
-
id: 'projects',
|
|
36
|
-
label: 'Projects',
|
|
37
|
-
description: 'Every project you own or follow',
|
|
38
|
-
icon: FolderIcon,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: 'reports',
|
|
42
|
-
label: 'Reports',
|
|
43
|
-
description: 'Weekly and monthly summaries',
|
|
44
|
-
icon: ChartBarIcon,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 'people',
|
|
48
|
-
label: 'People',
|
|
49
|
-
description: 'Teammates and their roles',
|
|
50
|
-
icon: UsersIcon,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: 'settings',
|
|
54
|
-
label: 'Settings',
|
|
55
|
-
description: 'Your account and workspace preferences',
|
|
56
|
-
icon: Cog6ToothIcon,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: 'help',
|
|
60
|
-
label: 'Help center',
|
|
61
|
-
description: 'Guides and answers to common questions',
|
|
62
|
-
icon: QuestionMarkCircleIcon,
|
|
63
|
-
},
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
export default function NotFoundPage() {
|
|
67
|
-
const showToast = useToast();
|
|
68
|
-
const [query, setQuery] = useState('');
|
|
69
|
-
|
|
70
|
-
const normalized = query.trim().toLowerCase();
|
|
71
|
-
const matches = DESTINATIONS.filter(
|
|
72
|
-
destination =>
|
|
73
|
-
destination.label.toLowerCase().includes(normalized) ||
|
|
74
|
-
destination.description.toLowerCase().includes(normalized),
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Demo only: replace this toast with navigation to the destination's route.
|
|
78
|
-
const open = (label: string) =>
|
|
79
|
-
showToast({body: `Demo: ${label} would open here`, uniqueID: label});
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<Center height="100%" padding={6}>
|
|
83
|
-
<VStack gap={6} width="100%" maxWidth={480}>
|
|
84
|
-
<EmptyState
|
|
85
|
-
icon={<Icon icon={MapIcon} size="lg" />}
|
|
86
|
-
headingLevel={1}
|
|
87
|
-
title="Page not found"
|
|
88
|
-
description="The page you're looking for doesn't exist or has moved. Check the address, or find what you need below."
|
|
89
|
-
actions={<Button label="Go to home" variant="primary" href="/" />}
|
|
90
|
-
/>
|
|
91
|
-
<VStack gap={3}>
|
|
92
|
-
<TextInput
|
|
93
|
-
label="Search pages"
|
|
94
|
-
isLabelHidden
|
|
95
|
-
placeholder="Search pages"
|
|
96
|
-
value={query}
|
|
97
|
-
onChange={setQuery}
|
|
98
|
-
startIcon={MagnifyingGlassIcon}
|
|
99
|
-
hasClear
|
|
100
|
-
/>
|
|
101
|
-
{matches.length > 0 ? (
|
|
102
|
-
<List hasDividers>
|
|
103
|
-
{matches.map(destination => (
|
|
104
|
-
<ListItem
|
|
105
|
-
key={destination.id}
|
|
106
|
-
label={destination.label}
|
|
107
|
-
description={destination.description}
|
|
108
|
-
startContent={
|
|
109
|
-
<Icon icon={destination.icon} size="sm" color="secondary" />
|
|
110
|
-
}
|
|
111
|
-
onClick={() => open(destination.label)}
|
|
112
|
-
/>
|
|
113
|
-
))}
|
|
114
|
-
</List>
|
|
115
|
-
) : (
|
|
116
|
-
<Text type="body" color="secondary">
|
|
117
|
-
No pages match “{query.trim()}”.
|
|
118
|
-
</Text>
|
|
119
|
-
)}
|
|
120
|
-
</VStack>
|
|
121
|
-
</VStack>
|
|
122
|
-
</Center>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'page',
|
|
6
|
-
name: 'Not Found',
|
|
7
|
-
displayName: 'Not Found',
|
|
8
|
-
description:
|
|
9
|
-
'Recovery page for a broken or mistyped link that matches no route: a centered message with a "Go to home" button, plus a live search box that filters a list of the app\'s main destinations by name or description and shows a no-match line when nothing fits.',
|
|
10
|
-
keywords: [
|
|
11
|
-
'404',
|
|
12
|
-
'dead link recovery',
|
|
13
|
-
'missing route',
|
|
14
|
-
'dead link',
|
|
15
|
-
'search destinations',
|
|
16
|
-
'filter destinations',
|
|
17
|
-
'back to home',
|
|
18
|
-
],
|
|
19
|
-
isReady: false,
|
|
20
|
-
category: 'Status - Not Found',
|
|
21
|
-
icons: {
|
|
22
|
-
ChartBarIcon: 'chart',
|
|
23
|
-
Cog6ToothIcon: 'settings',
|
|
24
|
-
FolderIcon: 'folder',
|
|
25
|
-
MagnifyingGlassIcon: 'search',
|
|
26
|
-
MapIcon: 'location',
|
|
27
|
-
QuestionMarkCircleIcon: 'info',
|
|
28
|
-
UsersIcon: 'users',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
@@ -1,551 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {useState} from 'react';
|
|
6
|
-
import {
|
|
7
|
-
Layout,
|
|
8
|
-
LayoutContent,
|
|
9
|
-
LayoutFooter,
|
|
10
|
-
LayoutHeader,
|
|
11
|
-
LayoutPanel,
|
|
12
|
-
VStack,
|
|
13
|
-
HStack,
|
|
14
|
-
StackItem,
|
|
15
|
-
} from '@astryxdesign/core/Layout';
|
|
16
|
-
import {Text, Heading} from '@astryxdesign/core/Text';
|
|
17
|
-
import {Button} from '@astryxdesign/core/Button';
|
|
18
|
-
import {Card} from '@astryxdesign/core/Card';
|
|
19
|
-
import {Divider} from '@astryxdesign/core/Divider';
|
|
20
|
-
import {Icon} from '@astryxdesign/core/Icon';
|
|
21
|
-
import {Markdown} from '@astryxdesign/core/Markdown';
|
|
22
|
-
import {MetadataList, MetadataListItem} from '@astryxdesign/core/MetadataList';
|
|
23
|
-
import {ProgressBar} from '@astryxdesign/core/ProgressBar';
|
|
24
|
-
import {List, ListItem} from '@astryxdesign/core/List';
|
|
25
|
-
import {StatusDot} from '@astryxdesign/core/StatusDot';
|
|
26
|
-
import type {StatusDotVariant} from '@astryxdesign/core/StatusDot';
|
|
27
|
-
import {
|
|
28
|
-
SegmentedControl,
|
|
29
|
-
SegmentedControlItem,
|
|
30
|
-
} from '@astryxdesign/core/SegmentedControl';
|
|
31
|
-
import {RadioList, RadioListItem} from '@astryxdesign/core/RadioList';
|
|
32
|
-
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
|
|
33
|
-
import {TextArea} from '@astryxdesign/core/TextArea';
|
|
34
|
-
import {EmptyState} from '@astryxdesign/core/EmptyState';
|
|
35
|
-
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
36
|
-
import {MoreMenu} from '@astryxdesign/core/MoreMenu';
|
|
37
|
-
import {useToast} from '@astryxdesign/core/Toast';
|
|
38
|
-
import {rtlStyles} from '@astryxdesign/core/utils';
|
|
39
|
-
import {useMediaQuery} from '@astryxdesign/core/hooks';
|
|
40
|
-
import {
|
|
41
|
-
ArrowDownTrayIcon,
|
|
42
|
-
ArrowLeftIcon,
|
|
43
|
-
ArrowRightIcon,
|
|
44
|
-
ArrowUturnLeftIcon,
|
|
45
|
-
CheckCircleIcon,
|
|
46
|
-
QueueListIcon,
|
|
47
|
-
} from '@heroicons/react/24/outline';
|
|
48
|
-
|
|
49
|
-
// Types
|
|
50
|
-
type Decision = 'approve' | 'revise' | 'reject';
|
|
51
|
-
|
|
52
|
-
interface ReviewItem {
|
|
53
|
-
id: string;
|
|
54
|
-
title: string;
|
|
55
|
-
channel: string;
|
|
56
|
-
customer: string;
|
|
57
|
-
submitted: string;
|
|
58
|
-
body: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface Verdict {
|
|
62
|
-
score: string;
|
|
63
|
-
decision: Decision;
|
|
64
|
-
issues: string[];
|
|
65
|
-
note: string;
|
|
66
|
-
status: 'reviewed' | 'skipped';
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const DECISION_LABEL: Record<Decision, string> = {
|
|
70
|
-
approve: 'Approve',
|
|
71
|
-
revise: 'Needs changes',
|
|
72
|
-
reject: 'Reject',
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const ISSUES = [
|
|
76
|
-
{id: 'accuracy', label: 'Inaccurate', description: 'States something wrong'},
|
|
77
|
-
{id: 'tone', label: 'Tone', description: 'Too curt or too casual'},
|
|
78
|
-
{
|
|
79
|
-
id: 'incomplete',
|
|
80
|
-
label: 'Incomplete',
|
|
81
|
-
description: 'Misses part of the question',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: 'policy',
|
|
85
|
-
label: 'Policy',
|
|
86
|
-
description: 'Promises what policy does not allow',
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
// Mock data: support replies waiting for a quality review
|
|
91
|
-
const ITEMS: ReviewItem[] = [
|
|
92
|
-
{
|
|
93
|
-
id: 'R-1041',
|
|
94
|
-
title: 'Refund for a late delivery',
|
|
95
|
-
channel: 'Email',
|
|
96
|
-
customer: 'Priya S.',
|
|
97
|
-
submitted: 'Today, 09:12',
|
|
98
|
-
body: "Hi Priya,\n\nI'm sorry your order arrived four days late. I've refunded the shipping fee to your original card; it should show within 5 business days.\n\nIf anything else went wrong with the order, reply here and I'll take care of it.\n\nBest,\nSam",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 'R-1042',
|
|
102
|
-
title: 'Password reset link expired',
|
|
103
|
-
channel: 'Chat',
|
|
104
|
-
customer: 'Daniel K.',
|
|
105
|
-
submitted: 'Today, 09:20',
|
|
106
|
-
body: 'Reset links expire after 15 minutes for security. I just sent a new one to the email on your account. Open it on the same device you request it from.',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: 'R-1043',
|
|
110
|
-
title: 'Change of billing address',
|
|
111
|
-
channel: 'Email',
|
|
112
|
-
customer: 'Maria L.',
|
|
113
|
-
submitted: 'Today, 09:41',
|
|
114
|
-
body: 'Done. Your billing address is updated, and the next invoice will use it.',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
id: 'R-1044',
|
|
118
|
-
title: 'Cancel before renewal',
|
|
119
|
-
channel: 'Phone summary',
|
|
120
|
-
customer: 'Tom B.',
|
|
121
|
-
submitted: 'Today, 10:02',
|
|
122
|
-
body: 'Customer asked to cancel before the annual renewal on the 18th. I cancelled the renewal; access continues until then. Offered a pause instead, declined.',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
id: 'R-1045',
|
|
126
|
-
title: 'Damaged item, wants a replacement',
|
|
127
|
-
channel: 'Email',
|
|
128
|
-
customer: 'Aisha N.',
|
|
129
|
-
submitted: 'Today, 10:15',
|
|
130
|
-
body: "Hi Aisha,\n\nThanks for the photos. A replacement ships today with express delivery, and you don't need to return the damaged one.\n\nSam",
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: 'R-1046',
|
|
134
|
-
title: 'Question about data export',
|
|
135
|
-
channel: 'Chat',
|
|
136
|
-
customer: 'Leo M.',
|
|
137
|
-
submitted: 'Today, 10:31',
|
|
138
|
-
body: 'You can export everything from Settings > Data > Export. The file is a ZIP of CSVs, one per table.',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: 'R-1047',
|
|
142
|
-
title: 'Discount code not applying',
|
|
143
|
-
channel: 'Email',
|
|
144
|
-
customer: 'Grace H.',
|
|
145
|
-
submitted: 'Today, 10:48',
|
|
146
|
-
body: "That code is for first orders only, so it can't be used on this one. I've added a 10% credit to your account for the trouble.",
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
id: 'R-1048',
|
|
150
|
-
title: 'Two charges on one order',
|
|
151
|
-
channel: 'Phone summary',
|
|
152
|
-
customer: 'Omar R.',
|
|
153
|
-
submitted: 'Today, 11:05',
|
|
154
|
-
body: 'One charge was a card authorisation that drops off on its own in 3-5 days. Explained and sent a written summary.',
|
|
155
|
-
},
|
|
156
|
-
];
|
|
157
|
-
|
|
158
|
-
const STATUS_DOT: Record<'pending' | 'reviewed' | 'skipped', StatusDotVariant> =
|
|
159
|
-
{
|
|
160
|
-
pending: 'neutral',
|
|
161
|
-
reviewed: 'success',
|
|
162
|
-
skipped: 'warning',
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const STATUS_LABEL = {
|
|
166
|
-
pending: 'Not reviewed',
|
|
167
|
-
reviewed: 'Reviewed',
|
|
168
|
-
skipped: 'Skipped',
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
const EMPTY_DRAFT = {
|
|
172
|
-
score: '',
|
|
173
|
-
decision: 'approve' as Decision,
|
|
174
|
-
issues: [] as string[],
|
|
175
|
-
note: '',
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
function pluralize(count: number, noun: string): string {
|
|
179
|
-
return `${count} ${noun}${count !== 1 ? 's' : ''}`;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export default function ReviewWorkspaceTemplate() {
|
|
183
|
-
const showToast = useToast();
|
|
184
|
-
const isNarrow = useMediaQuery('(max-width: 1024px)');
|
|
185
|
-
const [index, setIndex] = useState(0);
|
|
186
|
-
const [verdicts, setVerdicts] = useState<Record<string, Verdict>>({});
|
|
187
|
-
const [draft, setDraft] = useState(EMPTY_DRAFT);
|
|
188
|
-
// Unsaved forms by item, so moving away and back keeps what was entered.
|
|
189
|
-
const [drafts, setDrafts] = useState<Record<string, typeof EMPTY_DRAFT>>({});
|
|
190
|
-
const [isDone, setIsDone] = useState(false);
|
|
191
|
-
const [isRailOpen, setIsRailOpen] = useState(false);
|
|
192
|
-
|
|
193
|
-
const item = ITEMS[index];
|
|
194
|
-
const handled = Object.keys(verdicts).length;
|
|
195
|
-
const reviewed = Object.values(verdicts).filter(
|
|
196
|
-
v => v.status === 'reviewed',
|
|
197
|
-
).length;
|
|
198
|
-
|
|
199
|
-
// Opens an item with its unsaved form, its saved review, or an empty form,
|
|
200
|
-
// and keeps the current item's unsaved form for later.
|
|
201
|
-
const openItem = (
|
|
202
|
-
next: number,
|
|
203
|
-
keep: Record<string, typeof EMPTY_DRAFT> = {...drafts, [item.id]: draft},
|
|
204
|
-
) => {
|
|
205
|
-
const id = ITEMS[next].id;
|
|
206
|
-
const saved = verdicts[id];
|
|
207
|
-
setDrafts(keep);
|
|
208
|
-
setDraft(
|
|
209
|
-
keep[id] ??
|
|
210
|
-
(saved?.status === 'reviewed'
|
|
211
|
-
? {
|
|
212
|
-
score: saved.score,
|
|
213
|
-
decision: saved.decision,
|
|
214
|
-
issues: saved.issues,
|
|
215
|
-
note: saved.note,
|
|
216
|
-
}
|
|
217
|
-
: EMPTY_DRAFT),
|
|
218
|
-
);
|
|
219
|
-
setIndex(next);
|
|
220
|
-
setIsDone(false);
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
// The next item after the current one that `isOpen` accepts, wrapping
|
|
224
|
-
// around; the done screen when there is none.
|
|
225
|
-
const moveOn = (
|
|
226
|
-
record: Record<string, Verdict>,
|
|
227
|
-
isOpen: (verdict: Verdict | undefined) => boolean,
|
|
228
|
-
keep: Record<string, typeof EMPTY_DRAFT>,
|
|
229
|
-
) => {
|
|
230
|
-
const order = ITEMS.map((_, i) => (index + 1 + i) % ITEMS.length).filter(
|
|
231
|
-
i => i !== index,
|
|
232
|
-
);
|
|
233
|
-
const next = order.find(i => isOpen(record[ITEMS[i].id]));
|
|
234
|
-
if (next === undefined) {
|
|
235
|
-
setDrafts(keep);
|
|
236
|
-
setIsDone(true);
|
|
237
|
-
} else {
|
|
238
|
-
openItem(next, keep);
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const saveAndNext = () => {
|
|
243
|
-
const record = {
|
|
244
|
-
...verdicts,
|
|
245
|
-
[item.id]: {...draft, status: 'reviewed' as const},
|
|
246
|
-
};
|
|
247
|
-
const keep = {...drafts};
|
|
248
|
-
delete keep[item.id];
|
|
249
|
-
setVerdicts(record);
|
|
250
|
-
// After a save, skipped items come back until each has a review.
|
|
251
|
-
moveOn(record, verdict => verdict?.status !== 'reviewed', keep);
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
const skip = () => {
|
|
255
|
-
// Skipping a reviewed item keeps its review.
|
|
256
|
-
const record =
|
|
257
|
-
verdicts[item.id]?.status === 'reviewed'
|
|
258
|
-
? verdicts
|
|
259
|
-
: {
|
|
260
|
-
...verdicts,
|
|
261
|
-
[item.id]: {...EMPTY_DRAFT, status: 'skipped' as const},
|
|
262
|
-
};
|
|
263
|
-
setVerdicts(record);
|
|
264
|
-
moveOn(record, verdict => verdict === undefined, {
|
|
265
|
-
...drafts,
|
|
266
|
-
[item.id]: draft,
|
|
267
|
-
});
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
const previous = () => {
|
|
271
|
-
if (index > 0) {
|
|
272
|
-
openItem(index - 1);
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
const startOver = () => {
|
|
277
|
-
setVerdicts({});
|
|
278
|
-
setDrafts({});
|
|
279
|
-
setDraft(EMPTY_DRAFT);
|
|
280
|
-
setIndex(0);
|
|
281
|
-
setIsDone(false);
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
const counts = {
|
|
285
|
-
approve: Object.values(verdicts).filter(
|
|
286
|
-
v => v.status === 'reviewed' && v.decision === 'approve',
|
|
287
|
-
).length,
|
|
288
|
-
revise: Object.values(verdicts).filter(
|
|
289
|
-
v => v.status === 'reviewed' && v.decision === 'revise',
|
|
290
|
-
).length,
|
|
291
|
-
reject: Object.values(verdicts).filter(
|
|
292
|
-
v => v.status === 'reviewed' && v.decision === 'reject',
|
|
293
|
-
).length,
|
|
294
|
-
skipped: Object.values(verdicts).filter(v => v.status === 'skipped').length,
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
const rail = (
|
|
298
|
-
<List header="Batch" density="compact">
|
|
299
|
-
{ITEMS.map((candidate, i) => {
|
|
300
|
-
const status = verdicts[candidate.id]?.status ?? 'pending';
|
|
301
|
-
return (
|
|
302
|
-
<ListItem
|
|
303
|
-
key={candidate.id}
|
|
304
|
-
itemKey={candidate.id}
|
|
305
|
-
label={candidate.title}
|
|
306
|
-
description={candidate.id}
|
|
307
|
-
isSelected={!isDone && i === index}
|
|
308
|
-
startContent={
|
|
309
|
-
<StatusDot
|
|
310
|
-
variant={STATUS_DOT[status]}
|
|
311
|
-
label={STATUS_LABEL[status]}
|
|
312
|
-
/>
|
|
313
|
-
}
|
|
314
|
-
onClick={() => {
|
|
315
|
-
openItem(i);
|
|
316
|
-
setIsRailOpen(false);
|
|
317
|
-
}}
|
|
318
|
-
/>
|
|
319
|
-
);
|
|
320
|
-
})}
|
|
321
|
-
</List>
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
const scoring = (
|
|
325
|
-
<VStack gap={5}>
|
|
326
|
-
<SegmentedControl
|
|
327
|
-
label="Overall quality (1 to 5)"
|
|
328
|
-
value={draft.score}
|
|
329
|
-
onChange={value => setDraft(d => ({...d, score: value}))}>
|
|
330
|
-
{['1', '2', '3', '4', '5'].map(score => (
|
|
331
|
-
<SegmentedControlItem key={score} label={score} value={score} />
|
|
332
|
-
))}
|
|
333
|
-
</SegmentedControl>
|
|
334
|
-
<RadioList
|
|
335
|
-
label="Decision"
|
|
336
|
-
value={draft.decision}
|
|
337
|
-
onChange={value =>
|
|
338
|
-
setDraft(d => ({...d, decision: value as Decision}))
|
|
339
|
-
}>
|
|
340
|
-
{(Object.keys(DECISION_LABEL) as Decision[]).map(decision => (
|
|
341
|
-
<RadioListItem
|
|
342
|
-
key={decision}
|
|
343
|
-
value={decision}
|
|
344
|
-
label={DECISION_LABEL[decision]}
|
|
345
|
-
/>
|
|
346
|
-
))}
|
|
347
|
-
</RadioList>
|
|
348
|
-
<CheckboxList
|
|
349
|
-
label="Issues"
|
|
350
|
-
value={draft.issues}
|
|
351
|
-
onChange={issues => setDraft(d => ({...d, issues}))}>
|
|
352
|
-
{ISSUES.map(issue => (
|
|
353
|
-
<CheckboxListItem
|
|
354
|
-
key={issue.id}
|
|
355
|
-
value={issue.id}
|
|
356
|
-
label={issue.label}
|
|
357
|
-
description={issue.description}
|
|
358
|
-
/>
|
|
359
|
-
))}
|
|
360
|
-
</CheckboxList>
|
|
361
|
-
<TextArea
|
|
362
|
-
label="Note"
|
|
363
|
-
placeholder="What should the writer change?"
|
|
364
|
-
value={draft.note}
|
|
365
|
-
onChange={note => setDraft(d => ({...d, note}))}
|
|
366
|
-
/>
|
|
367
|
-
</VStack>
|
|
368
|
-
);
|
|
369
|
-
|
|
370
|
-
const actions = (
|
|
371
|
-
<HStack gap={2} vAlign="center">
|
|
372
|
-
<Button
|
|
373
|
-
label="Previous"
|
|
374
|
-
variant="ghost"
|
|
375
|
-
icon={<Icon icon={ArrowLeftIcon} xstyle={rtlStyles.mirror} />}
|
|
376
|
-
isIconOnly={isNarrow}
|
|
377
|
-
isDisabled={index === 0}
|
|
378
|
-
onClick={previous}
|
|
379
|
-
/>
|
|
380
|
-
<StackItem size="fill" />
|
|
381
|
-
<Button label="Skip" variant="secondary" onClick={skip} />
|
|
382
|
-
<Button
|
|
383
|
-
label="Save & next"
|
|
384
|
-
variant="primary"
|
|
385
|
-
icon={<Icon icon={ArrowRightIcon} xstyle={rtlStyles.mirror} />}
|
|
386
|
-
isDisabled={draft.score === ''}
|
|
387
|
-
onClick={saveAndNext}
|
|
388
|
-
/>
|
|
389
|
-
</HStack>
|
|
390
|
-
);
|
|
391
|
-
|
|
392
|
-
const content = isDone ? (
|
|
393
|
-
<EmptyState
|
|
394
|
-
icon={<Icon icon={CheckCircleIcon} size="lg" />}
|
|
395
|
-
title={reviewed === ITEMS.length ? 'Batch reviewed' : 'Pass complete'}
|
|
396
|
-
description={`${counts.approve} approved, ${counts.revise} need changes, ${counts.reject} rejected, ${counts.skipped} skipped.`}
|
|
397
|
-
actions={
|
|
398
|
-
<>
|
|
399
|
-
<Button
|
|
400
|
-
label="Start over"
|
|
401
|
-
variant="secondary"
|
|
402
|
-
icon={<Icon icon={ArrowUturnLeftIcon} />}
|
|
403
|
-
onClick={startOver}
|
|
404
|
-
/>
|
|
405
|
-
<Button
|
|
406
|
-
label="Review skipped"
|
|
407
|
-
variant="primary"
|
|
408
|
-
isDisabled={counts.skipped === 0}
|
|
409
|
-
onClick={() =>
|
|
410
|
-
openItem(
|
|
411
|
-
ITEMS.findIndex(c => verdicts[c.id]?.status === 'skipped'),
|
|
412
|
-
drafts,
|
|
413
|
-
)
|
|
414
|
-
}
|
|
415
|
-
/>
|
|
416
|
-
</>
|
|
417
|
-
}
|
|
418
|
-
/>
|
|
419
|
-
) : (
|
|
420
|
-
<VStack gap={6}>
|
|
421
|
-
<Card padding={5}>
|
|
422
|
-
<VStack gap={4}>
|
|
423
|
-
<VStack gap={1}>
|
|
424
|
-
<Text type="supporting" color="secondary">
|
|
425
|
-
{item.id} · {item.channel}
|
|
426
|
-
</Text>
|
|
427
|
-
<Heading level={2}>{item.title}</Heading>
|
|
428
|
-
</VStack>
|
|
429
|
-
<Markdown headingLevelStart={3}>{item.body}</Markdown>
|
|
430
|
-
<Divider />
|
|
431
|
-
<MetadataList columns={isNarrow ? 'single' : 'multi'}>
|
|
432
|
-
<MetadataListItem label="Customer">
|
|
433
|
-
{item.customer}
|
|
434
|
-
</MetadataListItem>
|
|
435
|
-
<MetadataListItem label="Channel">{item.channel}</MetadataListItem>
|
|
436
|
-
<MetadataListItem label="Submitted">
|
|
437
|
-
{item.submitted}
|
|
438
|
-
</MetadataListItem>
|
|
439
|
-
</MetadataList>
|
|
440
|
-
</VStack>
|
|
441
|
-
</Card>
|
|
442
|
-
{isNarrow && (
|
|
443
|
-
<Card padding={5}>
|
|
444
|
-
<VStack gap={5}>
|
|
445
|
-
<Heading level={3}>Your review</Heading>
|
|
446
|
-
{scoring}
|
|
447
|
-
</VStack>
|
|
448
|
-
</Card>
|
|
449
|
-
)}
|
|
450
|
-
</VStack>
|
|
451
|
-
);
|
|
452
|
-
|
|
453
|
-
return (
|
|
454
|
-
<>
|
|
455
|
-
<Layout
|
|
456
|
-
height="fill"
|
|
457
|
-
header={
|
|
458
|
-
<LayoutHeader hasDivider padding={4}>
|
|
459
|
-
<VStack gap={3}>
|
|
460
|
-
<HStack gap={3} vAlign="center">
|
|
461
|
-
<StackItem size="fill">
|
|
462
|
-
<Heading level={1}>Reply quality review</Heading>
|
|
463
|
-
</StackItem>
|
|
464
|
-
{isNarrow && (
|
|
465
|
-
<StackItem size="static">
|
|
466
|
-
<Button
|
|
467
|
-
label={`${index + 1} of ${ITEMS.length}`}
|
|
468
|
-
variant="secondary"
|
|
469
|
-
icon={<Icon icon={QueueListIcon} />}
|
|
470
|
-
onClick={() => setIsRailOpen(true)}
|
|
471
|
-
/>
|
|
472
|
-
</StackItem>
|
|
473
|
-
)}
|
|
474
|
-
<MoreMenu
|
|
475
|
-
label="Batch actions"
|
|
476
|
-
items={[
|
|
477
|
-
{
|
|
478
|
-
label: 'Export reviews',
|
|
479
|
-
icon: ArrowDownTrayIcon,
|
|
480
|
-
onClick: () =>
|
|
481
|
-
// Demo only: replace this toast with the export call.
|
|
482
|
-
showToast({
|
|
483
|
-
body: `Demo: exporting ${pluralize(reviewed, 'review')} would start here`,
|
|
484
|
-
uniqueID: 'export-reviews',
|
|
485
|
-
}),
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
label: 'Start over',
|
|
489
|
-
icon: ArrowUturnLeftIcon,
|
|
490
|
-
onClick: startOver,
|
|
491
|
-
},
|
|
492
|
-
]}
|
|
493
|
-
/>
|
|
494
|
-
</HStack>
|
|
495
|
-
<ProgressBar
|
|
496
|
-
label={`${handled} of ${ITEMS.length} handled`}
|
|
497
|
-
value={handled}
|
|
498
|
-
max={ITEMS.length}
|
|
499
|
-
hasValueLabel
|
|
500
|
-
/>
|
|
501
|
-
</VStack>
|
|
502
|
-
</LayoutHeader>
|
|
503
|
-
}
|
|
504
|
-
start={
|
|
505
|
-
isNarrow ? undefined : (
|
|
506
|
-
<LayoutPanel
|
|
507
|
-
width={280}
|
|
508
|
-
hasDivider
|
|
509
|
-
role="navigation"
|
|
510
|
-
label="Items in this batch">
|
|
511
|
-
{rail}
|
|
512
|
-
</LayoutPanel>
|
|
513
|
-
)
|
|
514
|
-
}
|
|
515
|
-
content={
|
|
516
|
-
<LayoutContent role="main" padding={isNarrow ? 4 : 6}>
|
|
517
|
-
{content}
|
|
518
|
-
</LayoutContent>
|
|
519
|
-
}
|
|
520
|
-
end={
|
|
521
|
-
isNarrow || isDone ? undefined : (
|
|
522
|
-
<LayoutPanel
|
|
523
|
-
width={340}
|
|
524
|
-
hasDivider
|
|
525
|
-
padding={5}
|
|
526
|
-
role="complementary"
|
|
527
|
-
label="Your review">
|
|
528
|
-
<VStack gap={5}>
|
|
529
|
-
<Heading level={3}>Your review</Heading>
|
|
530
|
-
{scoring}
|
|
531
|
-
</VStack>
|
|
532
|
-
</LayoutPanel>
|
|
533
|
-
)
|
|
534
|
-
}
|
|
535
|
-
footer={
|
|
536
|
-
isDone ? undefined : (
|
|
537
|
-
<LayoutFooter hasDivider padding={3} label="Review actions">
|
|
538
|
-
{actions}
|
|
539
|
-
</LayoutFooter>
|
|
540
|
-
)
|
|
541
|
-
}
|
|
542
|
-
/>
|
|
543
|
-
<BottomSheet
|
|
544
|
-
isOpen={isRailOpen}
|
|
545
|
-
onOpenChange={setIsRailOpen}
|
|
546
|
-
label="Items in this batch">
|
|
547
|
-
{rail}
|
|
548
|
-
</BottomSheet>
|
|
549
|
-
</>
|
|
550
|
-
);
|
|
551
|
-
}
|