@orbit-work/ui 0.1.0
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 +110 -0
- package/dist/about-window.cjs +1 -0
- package/dist/about-window.d.cts +12 -0
- package/dist/about-window.d.ts +12 -0
- package/dist/about-window.js +1 -0
- package/dist/appearance-D5uQ53j3.d.cts +210 -0
- package/dist/appearance-D5uQ53j3.d.ts +210 -0
- package/dist/appearance.cjs +1 -0
- package/dist/appearance.d.cts +1 -0
- package/dist/appearance.d.ts +1 -0
- package/dist/appearance.js +1 -0
- package/dist/browser-annotation-popup.cjs +1 -0
- package/dist/browser-annotation-popup.d.cts +48 -0
- package/dist/browser-annotation-popup.d.ts +48 -0
- package/dist/browser-annotation-popup.js +1 -0
- package/dist/chunk-3KT7IU4X.js +13 -0
- package/dist/chunk-5VLBKOG7.cjs +194 -0
- package/dist/chunk-7YJY64LZ.js +82 -0
- package/dist/chunk-EF2BSN3K.cjs +13 -0
- package/dist/chunk-GMMYDILD.cjs +82 -0
- package/dist/chunk-VG7FQQ7K.js +194 -0
- package/dist/fonts/JetBrainsMono-Medium.ttf +0 -0
- package/dist/fonts/JetBrainsMono-Regular.ttf +0 -0
- package/dist/fonts/SpaceGrotesk-500-latin-ext.woff2 +0 -0
- package/dist/fonts/SpaceGrotesk-500-latin.woff2 +0 -0
- package/dist/fonts/SpaceGrotesk-700-latin-ext.woff2 +0 -0
- package/dist/fonts/SpaceGrotesk-700-latin.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500.woff2 +0 -0
- package/dist/index.cjs +32 -0
- package/dist/index.css +1 -0
- package/dist/index.d.cts +10345 -0
- package/dist/index.d.ts +10345 -0
- package/dist/index.js +32 -0
- package/dist/orbitwork.css +22134 -0
- package/package.json +119 -0
- package/src/components/Layout/AppLayout/AppLayout.stories.tsx +246 -0
- package/src/components/Layout/AppLayout/AppLayoutSource.test.mjs +37 -0
- package/src/components/Layout/AppLayout/index.tsx +122 -0
- package/src/components/Layout/Sidebar/index.tsx +13 -0
- package/src/components/Layout/SidebarShell/SidebarShell.stories.tsx +676 -0
- package/src/components/Layout/SidebarShell/SidebarShellSource.test.mjs +161 -0
- package/src/components/Layout/SidebarShell/index.tsx +326 -0
- package/src/components/Layout/index.ts +10 -0
- package/src/components/composite/ActionBar/ActionBar.stories.tsx +26 -0
- package/src/components/composite/ActionBar/index.tsx +31 -0
- package/src/components/composite/ActionStatus/ActionStatus.stories.tsx +60 -0
- package/src/components/composite/ActionStatus/index.tsx +21 -0
- package/src/components/composite/AskQuestionCardView/AskQuestionCardView.stories.tsx +175 -0
- package/src/components/composite/AskQuestionCardView/AskQuestionCardViewSource.test.mjs +92 -0
- package/src/components/composite/AskQuestionCardView/index.tsx +119 -0
- package/src/components/composite/AssistantChannelCard/AssistantChannelCard.stories.tsx +265 -0
- package/src/components/composite/AssistantChannelCard/AssistantChannelCardSource.test.mjs +45 -0
- package/src/components/composite/AssistantChannelCard/index.tsx +102 -0
- package/src/components/composite/AssistantToggleRow/AssistantToggleRow.stories.tsx +197 -0
- package/src/components/composite/AssistantToggleRow/index.tsx +35 -0
- package/src/components/composite/AttachmentCard/AttachmentCard.stories.tsx +125 -0
- package/src/components/composite/AttachmentCard/index.tsx +80 -0
- package/src/components/composite/BackButton/BackButton.stories.tsx +93 -0
- package/src/components/composite/BackButton/BackButtonSource.test.mjs +29 -0
- package/src/components/composite/BackButton/index.tsx +48 -0
- package/src/components/composite/Banner/Banner.stories.tsx +180 -0
- package/src/components/composite/Banner/BannerSource.test.mjs +67 -0
- package/src/components/composite/Banner/index.tsx +125 -0
- package/src/components/composite/BeaconIcons/BeaconIcons.stories.tsx +153 -0
- package/src/components/composite/BeaconIcons/index.tsx +265 -0
- package/src/components/composite/BeaconSpinner/BeaconSpinner.stories.tsx +144 -0
- package/src/components/composite/BeaconSpinner/index.tsx +185 -0
- package/src/components/composite/CatalogStates/CatalogEmptyState.stories.tsx +108 -0
- package/src/components/composite/CatalogStates/CatalogStates.stories.tsx +53 -0
- package/src/components/composite/CatalogStates/CatalogStatesSource.test.mjs +149 -0
- package/src/components/composite/CatalogStates/index.tsx +113 -0
- package/src/components/composite/Charts/Charts.stories.tsx +174 -0
- package/src/components/composite/Charts/ChartsSource.test.mjs +111 -0
- package/src/components/composite/Charts/index.tsx +385 -0
- package/src/components/composite/CodeBlock/CodeBlock.stories.tsx +308 -0
- package/src/components/composite/CodeBlock/CodeFaceSource.test.mjs +89 -0
- package/src/components/composite/CodeBlock/index.tsx +300 -0
- package/src/components/composite/CodeDiff/CodeDiff.stories.tsx +169 -0
- package/src/components/composite/CodeDiff/index.tsx +373 -0
- package/src/components/composite/CodePreview/CodePreview.stories.tsx +127 -0
- package/src/components/composite/CodePreview/CodePreviewSource.test.mjs +43 -0
- package/src/components/composite/CodePreview/index.tsx +98 -0
- package/src/components/composite/CommandPalette/CommandPalette.stories.tsx +89 -0
- package/src/components/composite/CommandPalette/CommandPaletteSource.test.mjs +61 -0
- package/src/components/composite/CommandPalette/index.tsx +310 -0
- package/src/components/composite/ContentRecommendation/ContentRecommendation.stories.tsx +300 -0
- package/src/components/composite/ContentRecommendation/ContentRecommendationSource.test.mjs +48 -0
- package/src/components/composite/ContentRecommendation/index.tsx +116 -0
- package/src/components/composite/ContextChip/ContextChip.stories.tsx +123 -0
- package/src/components/composite/ContextChip/ContextChipSource.test.mjs +24 -0
- package/src/components/composite/ContextChip/index.tsx +25 -0
- package/src/components/composite/ContextUsageIndicatorView/ContextUsageIndicatorSizeSource.test.mjs +15 -0
- package/src/components/composite/ContextUsageIndicatorView/ContextUsageIndicatorView.stories.tsx +110 -0
- package/src/components/composite/ContextUsageIndicatorView/ContextUsageLoadingSource.test.mjs +23 -0
- package/src/components/composite/ContextUsageIndicatorView/index.tsx +139 -0
- package/src/components/composite/Controls/Controls.stories.tsx +227 -0
- package/src/components/composite/Controls/index.tsx +15 -0
- package/src/components/composite/CreateProjectDialog/CreateProjectDialog.stories.tsx +56 -0
- package/src/components/composite/CreateProjectDialog/index.tsx +70 -0
- package/src/components/composite/DataManagementSectionView/DataManagementSectionView.stories.tsx +123 -0
- package/src/components/composite/DataManagementSectionView/DataManagementSectionViewSource.test.mjs +45 -0
- package/src/components/composite/DataManagementSectionView/index.tsx +110 -0
- package/src/components/composite/DataTable/DataTable.stories.tsx +159 -0
- package/src/components/composite/DataTable/DataTableSource.test.mjs +96 -0
- package/src/components/composite/DataTable/index.tsx +373 -0
- package/src/components/composite/DetailChrome/DetailChrome.stories.tsx +61 -0
- package/src/components/composite/DetailChrome/DetailChromeSource.test.mjs +31 -0
- package/src/components/composite/DetailChrome/index.tsx +94 -0
- package/src/components/composite/DetailPanel/DetailPanel.stories.tsx +185 -0
- package/src/components/composite/DetailPanel/DetailPanelSource.test.mjs +49 -0
- package/src/components/composite/DetailPanel/index.tsx +120 -0
- package/src/components/composite/DetailScaffold/DetailScaffold.stories.tsx +203 -0
- package/src/components/composite/DetailScaffold/DetailScaffoldSource.test.mjs +38 -0
- package/src/components/composite/DetailScaffold/index.tsx +114 -0
- package/src/components/composite/Dialog/Dialog.stories.tsx +343 -0
- package/src/components/composite/Dialog/DialogSource.test.mjs +130 -0
- package/src/components/composite/Dialog/index.tsx +333 -0
- package/src/components/composite/DropZone/DropZone.stories.tsx +105 -0
- package/src/components/composite/DropZone/DropZoneSource.test.mjs +68 -0
- package/src/components/composite/DropZone/index.tsx +196 -0
- package/src/components/composite/FSelect/FSelect.stories.tsx +64 -0
- package/src/components/composite/FSelect/index.tsx +29 -0
- package/src/components/composite/FeedbackContextMenuView/FeedbackContextMenuView.stories.tsx +106 -0
- package/src/components/composite/FeedbackContextMenuView/index.tsx +51 -0
- package/src/components/composite/FeedbackDialogView/FeedbackDialogView.stories.tsx +291 -0
- package/src/components/composite/FeedbackDialogView/index.tsx +95 -0
- package/src/components/composite/FileReferenceCard/FileReferenceCard.stories.tsx +364 -0
- package/src/components/composite/FileReferenceCard/FileReferenceCardSource.test.mjs +48 -0
- package/src/components/composite/FileReferenceCard/index.tsx +122 -0
- package/src/components/composite/FilterBar/FilterBar.stories.tsx +167 -0
- package/src/components/composite/FilterBar/FilterBarSource.test.mjs +75 -0
- package/src/components/composite/FilterBar/index.tsx +206 -0
- package/src/components/composite/FormField/FormField.stories.tsx +158 -0
- package/src/components/composite/FormField/FormFieldSource.test.mjs +56 -0
- package/src/components/composite/FormField/index.tsx +219 -0
- package/src/components/composite/HomeBackdrop/HomeBackdrop.stories.tsx +54 -0
- package/src/components/composite/HomeBackdrop/HomeBackdropSource.test.mjs +50 -0
- package/src/components/composite/HomeBackdrop/index.tsx +53 -0
- package/src/components/composite/Icons/Icons.stories.tsx +153 -0
- package/src/components/composite/Icons/IconsSource.test.mjs +23 -0
- package/src/components/composite/Icons/index.tsx +1347 -0
- package/src/components/composite/ImageCard/ImageCard.stories.tsx +54 -0
- package/src/components/composite/ImageCard/index.tsx +33 -0
- package/src/components/composite/ImagePreview/ImagePreview.stories.tsx +172 -0
- package/src/components/composite/ImagePreview/ImagePreviewSource.test.mjs +95 -0
- package/src/components/composite/ImagePreview/index.tsx +339 -0
- package/src/components/composite/ListRow/ListRow.stories.tsx +257 -0
- package/src/components/composite/ListRow/ListRowSource.test.mjs +101 -0
- package/src/components/composite/ListRow/index.tsx +309 -0
- package/src/components/composite/Markdown/Markdown.stories.tsx +192 -0
- package/src/components/composite/Markdown/MarkdownSource.test.mjs +126 -0
- package/src/components/composite/Markdown/MarkdownStyleSource.test.mjs +152 -0
- package/src/components/composite/Markdown/index.tsx +702 -0
- package/src/components/composite/MarkdownPreview/MarkdownPreview.stories.tsx +174 -0
- package/src/components/composite/MarkdownPreview/MarkdownPreviewTabsSource.test.mjs +31 -0
- package/src/components/composite/MarkdownPreview/MarkdownRenderedStyleSource.test.mjs +84 -0
- package/src/components/composite/MarkdownPreview/index.tsx +140 -0
- package/src/components/composite/MarkdownPreviewModalView/MarkdownPreviewModalView.stories.tsx +104 -0
- package/src/components/composite/MarkdownPreviewModalView/index.tsx +85 -0
- package/src/components/composite/MessageFeedbackDialog/MessageFeedbackDialog.stories.tsx +66 -0
- package/src/components/composite/MessageFeedbackDialog/index.tsx +115 -0
- package/src/components/composite/ModelCatalogErrorState/ModelCatalogErrorState.stories.tsx +101 -0
- package/src/components/composite/ModelCatalogErrorState/ModelCatalogRetrySource.test.mjs +86 -0
- package/src/components/composite/ModelCatalogErrorState/index.tsx +59 -0
- package/src/components/composite/ModelModalityFlow/ModelModalityFlow.stories.tsx +224 -0
- package/src/components/composite/ModelModalityFlow/ModelModalityFlowSource.test.mjs +56 -0
- package/src/components/composite/ModelModalityFlow/index.tsx +113 -0
- package/src/components/composite/ModelPickerList/ModelPickerList.stories.tsx +313 -0
- package/src/components/composite/ModelPickerList/index.tsx +142 -0
- package/src/components/composite/ModelSelect/ModelSelect.stories.tsx +90 -0
- package/src/components/composite/ModelSelect/index.tsx +148 -0
- package/src/components/composite/ModelsSettingsSectionView/ModelsSettingsSectionView.stories.tsx +170 -0
- package/src/components/composite/ModelsSettingsSectionView/index.tsx +139 -0
- package/src/components/composite/NativeControls/NativeControls.stories.tsx +386 -0
- package/src/components/composite/NativeControls/NativeControlsStyleSource.test.mjs +63 -0
- package/src/components/composite/NativeControls/index.tsx +97 -0
- package/src/components/composite/NavMenu/NavMenu.stories.tsx +383 -0
- package/src/components/composite/NavMenu/NavMenuSource.test.mjs +56 -0
- package/src/components/composite/NavMenu/index.tsx +142 -0
- package/src/components/composite/NoPlanPanelView/NoPlanPanelView.stories.tsx +344 -0
- package/src/components/composite/NoPlanPanelView/NoPlanPanelViewSource.test.mjs +34 -0
- package/src/components/composite/NoPlanPanelView/index.tsx +97 -0
- package/src/components/composite/OpenWithButton/OpenWithButton.stories.tsx +78 -0
- package/src/components/composite/OpenWithButton/index.tsx +46 -0
- package/src/components/composite/OrbitworkLogo/OrbitworkLogo.stories.tsx +192 -0
- package/src/components/composite/OrbitworkLogo/index.tsx +207 -0
- package/src/components/composite/OrbitworkModal/OrbitworkModal.stories.tsx +58 -0
- package/src/components/composite/OrbitworkModal/index.tsx +31 -0
- package/src/components/composite/PageHead/PageHead.stories.tsx +235 -0
- package/src/components/composite/PageHead/PageHeadSource.test.mjs +76 -0
- package/src/components/composite/PageHead/index.tsx +128 -0
- package/src/components/composite/PlanFeatureIcon/PlanFeatureIcon.stories.tsx +205 -0
- package/src/components/composite/PlanFeatureIcon/PlanFeatureIconSource.test.mjs +38 -0
- package/src/components/composite/PlanFeatureIcon/index.tsx +48 -0
- package/src/components/composite/PlanSettingsSectionView/PlanSettingsSectionView.stories.tsx +231 -0
- package/src/components/composite/PlanSettingsSectionView/PlanSettingsSectionViewSource.test.mjs +85 -0
- package/src/components/composite/PlanSettingsSectionView/index.tsx +264 -0
- package/src/components/composite/Popover/Popover.stories.tsx +175 -0
- package/src/components/composite/Popover/PopoverSource.test.mjs +59 -0
- package/src/components/composite/Popover/index.tsx +176 -0
- package/src/components/composite/PptxRenderer/ElementDispatcher/index.tsx +70 -0
- package/src/components/composite/PptxRenderer/PptxChromeStyleSource.test.mjs +36 -0
- package/src/components/composite/PptxRenderer/PptxRenderer.stories.tsx +128 -0
- package/src/components/composite/PptxRenderer/PptxSlide/index.tsx +48 -0
- package/src/components/composite/PptxRenderer/constants.ts +2 -0
- package/src/components/composite/PptxRenderer/elements/AudioElement/index.tsx +48 -0
- package/src/components/composite/PptxRenderer/elements/ChartElement/index.tsx +172 -0
- package/src/components/composite/PptxRenderer/elements/DiagramElement/index.tsx +46 -0
- package/src/components/composite/PptxRenderer/elements/GroupElement/index.tsx +28 -0
- package/src/components/composite/PptxRenderer/elements/ImageElement/index.tsx +61 -0
- package/src/components/composite/PptxRenderer/elements/MathElement/index.tsx +57 -0
- package/src/components/composite/PptxRenderer/elements/ShapeElement/index.tsx +327 -0
- package/src/components/composite/PptxRenderer/elements/TableElement/index.tsx +90 -0
- package/src/components/composite/PptxRenderer/elements/TextElement/index.tsx +57 -0
- package/src/components/composite/PptxRenderer/elements/VideoElement/index.tsx +43 -0
- package/src/components/composite/PptxRenderer/index.ts +24 -0
- package/src/components/composite/PptxRenderer/types.ts +326 -0
- package/src/components/composite/PptxRenderer/utils.ts +129 -0
- package/src/components/composite/ProjectSelect/ProjectSelect.stories.tsx +112 -0
- package/src/components/composite/ProjectSelect/ProjectSelectSource.test.mjs +34 -0
- package/src/components/composite/ProjectSelect/index.tsx +155 -0
- package/src/components/composite/RadioCard/RadioCard.stories.tsx +130 -0
- package/src/components/composite/RadioCard/RadioCardSource.test.mjs +42 -0
- package/src/components/composite/RadioCard/index.tsx +171 -0
- package/src/components/composite/RowOverflowMenu/RowOverflowMenu.stories.tsx +113 -0
- package/src/components/composite/RowOverflowMenu/RowOverflowMenuSource.test.mjs +59 -0
- package/src/components/composite/RowOverflowMenu/index.tsx +101 -0
- package/src/components/composite/SandboxPermissionPrompt/SandboxPermissionPrompt.stories.tsx +159 -0
- package/src/components/composite/SandboxPermissionPrompt/SandboxPermissionPromptSource.test.mjs +71 -0
- package/src/components/composite/SandboxPermissionPrompt/index.tsx +157 -0
- package/src/components/composite/SearchInput/SearchInput.stories.tsx +127 -0
- package/src/components/composite/SearchInput/index.tsx +91 -0
- package/src/components/composite/SearchResult/SearchResult.stories.tsx +305 -0
- package/src/components/composite/SearchResult/SearchResultSource.test.mjs +45 -0
- package/src/components/composite/SearchResult/index.tsx +148 -0
- package/src/components/composite/Section/Section.stories.tsx +148 -0
- package/src/components/composite/Section/SectionSource.test.mjs +59 -0
- package/src/components/composite/Section/index.tsx +105 -0
- package/src/components/composite/SelectionBulkBar/SelectionBulkBar.stories.tsx +111 -0
- package/src/components/composite/SelectionBulkBar/SelectionBulkBarSource.test.mjs +44 -0
- package/src/components/composite/SelectionBulkBar/index.tsx +99 -0
- package/src/components/composite/ShareStrip/ShareStrip.stories.tsx +123 -0
- package/src/components/composite/ShareStrip/index.tsx +83 -0
- package/src/components/composite/ShortcutSheet/ShortcutSheet.stories.tsx +90 -0
- package/src/components/composite/ShortcutSheet/ShortcutSheetSource.test.mjs +49 -0
- package/src/components/composite/ShortcutSheet/index.tsx +163 -0
- package/src/components/composite/SitesArtifactCardView/SitesArtifactCardView.stories.tsx +328 -0
- package/src/components/composite/SitesArtifactCardView/SitesArtifactCardViewSource.test.mjs +45 -0
- package/src/components/composite/SitesArtifactCardView/index.tsx +100 -0
- package/src/components/composite/Skeleton/Skeleton.stories.tsx +188 -0
- package/src/components/composite/Skeleton/SkeletonSource.test.mjs +25 -0
- package/src/components/composite/Skeleton/index.tsx +152 -0
- package/src/components/composite/Splash/Splash.stories.tsx +150 -0
- package/src/components/composite/Splash/index.tsx +229 -0
- package/src/components/composite/StatusTag/StatusTag.stories.tsx +66 -0
- package/src/components/composite/StatusTag/StatusTagSource.test.mjs +64 -0
- package/src/components/composite/StatusTag/index.tsx +78 -0
- package/src/components/composite/StepList/StepList.stories.tsx +352 -0
- package/src/components/composite/StepList/index.tsx +23 -0
- package/src/components/composite/Tag/Tag.stories.tsx +279 -0
- package/src/components/composite/Tag/TagSource.test.mjs +67 -0
- package/src/components/composite/Tag/index.tsx +229 -0
- package/src/components/composite/TimePicker/TimePicker.stories.tsx +91 -0
- package/src/components/composite/TimePicker/TimePickerSource.test.mjs +98 -0
- package/src/components/composite/TimePicker/index.tsx +208 -0
- package/src/components/composite/TitleBar/TitleBar.stories.tsx +329 -0
- package/src/components/composite/TitleBar/TitleBarSource.test.mjs +140 -0
- package/src/components/composite/TitleBar/index.tsx +350 -0
- package/src/components/composite/Toast/Toast.stories.tsx +304 -0
- package/src/components/composite/Toast/ToastSource.test.mjs +63 -0
- package/src/components/composite/Toast/index.tsx +135 -0
- package/src/components/composite/Tooltip/Tooltip.stories.tsx +304 -0
- package/src/components/composite/Tooltip/TooltipSource.test.mjs +34 -0
- package/src/components/composite/Tooltip/index.tsx +204 -0
- package/src/components/composite/TranscriptDividers/TranscriptDividers.stories.tsx +160 -0
- package/src/components/composite/TranscriptDividers/TranscriptDividersSource.test.mjs +90 -0
- package/src/components/composite/TranscriptDividers/index.tsx +352 -0
- package/src/components/composite/WCardShell/WCardShell.stories.tsx +228 -0
- package/src/components/composite/WCardShell/index.tsx +101 -0
- package/src/components/composite/index.ts +81 -0
- package/src/components/domain/artifacts/ArtifactPreviewSidebarView/ArtifactPreviewSidebarView.stories.tsx +128 -0
- package/src/components/domain/artifacts/ArtifactPreviewSidebarView/ArtifactPreviewSidebarViewSource.test.mjs +69 -0
- package/src/components/domain/artifacts/ArtifactPreviewSidebarView/index.tsx +212 -0
- package/src/components/domain/artifacts/index.ts +1 -0
- package/src/components/domain/browser/BrowserAnnotationPopupView/BrowserAnnotationPopupView.stories.tsx +211 -0
- package/src/components/domain/browser/BrowserAnnotationPopupView/BrowserAnnotationPopupViewSource.test.mjs +82 -0
- package/src/components/domain/browser/BrowserAnnotationPopupView/index.tsx +235 -0
- package/src/components/domain/browser/BrowserDeviceToolbarView/BrowserDeviceToolbarView.stories.tsx +260 -0
- package/src/components/domain/browser/BrowserDeviceToolbarView/BrowserDeviceToolbarViewSource.test.mjs +12 -0
- package/src/components/domain/browser/BrowserDeviceToolbarView/index.tsx +154 -0
- package/src/components/domain/browser/BrowserFindBarView/BrowserFindBarView.stories.tsx +52 -0
- package/src/components/domain/browser/BrowserFindBarView/index.tsx +111 -0
- package/src/components/domain/browser/BrowserImportDialogView/BrowserImportDialogView.stories.tsx +89 -0
- package/src/components/domain/browser/BrowserImportDialogView/index.tsx +155 -0
- package/src/components/domain/browser/BrowserLoadErrorView/BrowserLoadErrorView.stories.tsx +197 -0
- package/src/components/domain/browser/BrowserLoadErrorView/BrowserLoadErrorViewSource.test.mjs +29 -0
- package/src/components/domain/browser/BrowserLoadErrorView/index.tsx +45 -0
- package/src/components/domain/browser/BrowserMoreMenuView/BrowserMoreMenuView.stories.tsx +66 -0
- package/src/components/domain/browser/BrowserMoreMenuView/index.tsx +268 -0
- package/src/components/domain/browser/BrowserNavBarView/BrowserNavBarView.stories.tsx +149 -0
- package/src/components/domain/browser/BrowserNavBarView/index.tsx +156 -0
- package/src/components/domain/browser/BrowserTabBarView/index.tsx +18 -0
- package/src/components/domain/browser/SubAgentPane/SubAgentPane.stories.tsx +96 -0
- package/src/components/domain/browser/SubAgentPane/SubAgentPaneSource.test.mjs +48 -0
- package/src/components/domain/browser/SubAgentPane/index.tsx +121 -0
- package/src/components/domain/browser/TerminalPane/TerminalPane.stories.tsx +95 -0
- package/src/components/domain/browser/TerminalPane/TerminalPaneSource.test.mjs +52 -0
- package/src/components/domain/browser/TerminalPane/index.tsx +75 -0
- package/src/components/domain/browser/WebPreview/WebPreview.stories.tsx +71 -0
- package/src/components/domain/browser/WebPreview/index.tsx +141 -0
- package/src/components/domain/browser/WebPreviewConsole/WebPreviewConsole.stories.tsx +61 -0
- package/src/components/domain/browser/WebPreviewConsole/WebPreviewConsoleSource.test.mjs +66 -0
- package/src/components/domain/browser/WebPreviewConsole/index.tsx +239 -0
- package/src/components/domain/browser/WebPreviewDialog/WebPreviewDialog.stories.tsx +288 -0
- package/src/components/domain/browser/WebPreviewDialog/WebPreviewDialogSource.test.mjs +62 -0
- package/src/components/domain/browser/WebPreviewDialog/index.tsx +82 -0
- package/src/components/domain/browser/WebPreviewNav/WebPreviewNav.stories.tsx +462 -0
- package/src/components/domain/browser/WebPreviewNav/WebPreviewNavSource.test.mjs +353 -0
- package/src/components/domain/browser/WebPreviewNav/index.tsx +351 -0
- package/src/components/domain/browser/WebPreviewShell/WebPreviewShell.stories.tsx +226 -0
- package/src/components/domain/browser/WebPreviewShell/WebPreviewShellSource.test.mjs +172 -0
- package/src/components/domain/browser/WebPreviewShell/index.tsx +324 -0
- package/src/components/domain/browser/index.ts +45 -0
- package/src/components/domain/chat/AgentLoopSegment/AgentLoopSegment.stories.tsx +107 -0
- package/src/components/domain/chat/AgentLoopSegment/AgentLoopSegmentSource.test.mjs +45 -0
- package/src/components/domain/chat/AgentLoopSegment/index.tsx +29 -0
- package/src/components/domain/chat/AgentTurn/AgentTurn.stories.tsx +162 -0
- package/src/components/domain/chat/AgentTurn/AgentTurnSource.test.mjs +98 -0
- package/src/components/domain/chat/AgentTurn/beaconContext.ts +37 -0
- package/src/components/domain/chat/AgentTurn/index.tsx +226 -0
- package/src/components/domain/chat/ArtifactCard/ArtifactCard.stories.tsx +127 -0
- package/src/components/domain/chat/ArtifactCard/index.tsx +249 -0
- package/src/components/domain/chat/Attachment/Attachment.stories.tsx +235 -0
- package/src/components/domain/chat/Attachment/AttachmentSource.test.mjs +160 -0
- package/src/components/domain/chat/Attachment/index.tsx +857 -0
- package/src/components/domain/chat/AuthorizationCard/AuthorizationCard.stories.tsx +53 -0
- package/src/components/domain/chat/AuthorizationCard/AuthorizationCardSource.test.mjs +80 -0
- package/src/components/domain/chat/AuthorizationCard/index.tsx +89 -0
- package/src/components/domain/chat/ChatBubble/ChatBubble.stories.tsx +32 -0
- package/src/components/domain/chat/ChatBubble/index.tsx +24 -0
- package/src/components/domain/chat/ChatMessage/ChatMessage.stories.tsx +31 -0
- package/src/components/domain/chat/ChatMessage/index.tsx +23 -0
- package/src/components/domain/chat/ChatR2ReviewSource.test.mjs +98 -0
- package/src/components/domain/chat/ChatThinking/ChatThinking.stories.tsx +125 -0
- package/src/components/domain/chat/ChatThinking/index.tsx +55 -0
- package/src/components/domain/chat/Chatbot/Chatbot.stories.tsx +49 -0
- package/src/components/domain/chat/Chatbot/index.tsx +37 -0
- package/src/components/domain/chat/Composer/Composer.stories.tsx +227 -0
- package/src/components/domain/chat/Composer/ComposerSource.test.mjs +175 -0
- package/src/components/domain/chat/Composer/index.tsx +450 -0
- package/src/components/domain/chat/Composer/parts/ComposerAudioSpectrum.stories.tsx +203 -0
- package/src/components/domain/chat/Composer/parts/ComposerAudioSpectrum.tsx +110 -0
- package/src/components/domain/chat/Composer/parts/ComposerAudioSpectrumSource.test.mjs +54 -0
- package/src/components/domain/chat/Composer/parts/ComposerAuthorization.stories.tsx +155 -0
- package/src/components/domain/chat/Composer/parts/ComposerAuthorization.tsx +108 -0
- package/src/components/domain/chat/Composer/parts/ComposerMentions.stories.tsx +76 -0
- package/src/components/domain/chat/Composer/parts/ComposerMentions.tsx +83 -0
- package/src/components/domain/chat/Composer/parts/ComposerMentionsSource.test.mjs +85 -0
- package/src/components/domain/chat/Composer/parts/ComposerMenu.stories.tsx +266 -0
- package/src/components/domain/chat/Composer/parts/ComposerMenu.tsx +232 -0
- package/src/components/domain/chat/Composer/parts/ComposerMenuPopover.stories.tsx +166 -0
- package/src/components/domain/chat/Composer/parts/ComposerMenuPopover.tsx +87 -0
- package/src/components/domain/chat/Composer/parts/ComposerMenuPopoverSource.test.mjs +56 -0
- package/src/components/domain/chat/Composer/parts/ComposerPopover.stories.tsx +257 -0
- package/src/components/domain/chat/Composer/parts/ComposerPopover.tsx +221 -0
- package/src/components/domain/chat/Composer/parts/ComposerPopoverSource.test.mjs +71 -0
- package/src/components/domain/chat/Composer/parts/ComposerProjectPicker.stories.tsx +260 -0
- package/src/components/domain/chat/Composer/parts/ComposerProjectPicker.tsx +246 -0
- package/src/components/domain/chat/Composer/parts/ComposerProjectPickerSource.test.mjs +46 -0
- package/src/components/domain/chat/Composer/parts/ComposerQueue.stories.tsx +275 -0
- package/src/components/domain/chat/Composer/parts/ComposerQueue.tsx +155 -0
- package/src/components/domain/chat/Composer/parts/ComposerQueueSource.test.mjs +95 -0
- package/src/components/domain/chat/Composer/parts/ComposerVoiceInput.stories.tsx +77 -0
- package/src/components/domain/chat/Composer/parts/ComposerVoiceInput.tsx +70 -0
- package/src/components/domain/chat/Composer/parts/mountChip.ts +21 -0
- package/src/components/domain/chat/ContextUsage/ContextUsage.stories.tsx +62 -0
- package/src/components/domain/chat/ContextUsage/index.tsx +69 -0
- package/src/components/domain/chat/ExecutionSummary/ExecutionSummary.stories.tsx +238 -0
- package/src/components/domain/chat/ExecutionSummary/ExecutionSummarySource.test.mjs +210 -0
- package/src/components/domain/chat/ExecutionSummary/index.tsx +487 -0
- package/src/components/domain/chat/Message/Message.stories.tsx +264 -0
- package/src/components/domain/chat/Message/index.tsx +44 -0
- package/src/components/domain/chat/MessageActions/MessageActions.stories.tsx +132 -0
- package/src/components/domain/chat/MessageActions/MessageActionsSource.test.mjs +79 -0
- package/src/components/domain/chat/MessageActions/index.tsx +186 -0
- package/src/components/domain/chat/PlanCard/PlanCard.stories.tsx +87 -0
- package/src/components/domain/chat/PlanCard/index.tsx +170 -0
- package/src/components/domain/chat/RichContent/RichContent.stories.tsx +102 -0
- package/src/components/domain/chat/RichContent/RichContentSource.test.mjs +82 -0
- package/src/components/domain/chat/RichContent/index.tsx +465 -0
- package/src/components/domain/chat/SubAgentThread/SubAgentThread.stories.tsx +119 -0
- package/src/components/domain/chat/SubAgentThread/index.tsx +104 -0
- package/src/components/domain/chat/Thinking/Thinking.stories.tsx +196 -0
- package/src/components/domain/chat/Thinking/ThinkingInlineSource.test.mjs +154 -0
- package/src/components/domain/chat/Thinking/index.tsx +237 -0
- package/src/components/domain/chat/ToolCallRow/ToolCallRow.stories.tsx +105 -0
- package/src/components/domain/chat/ToolCallRow/ToolCallRowSource.test.mjs +83 -0
- package/src/components/domain/chat/ToolCallRow/index.tsx +113 -0
- package/src/components/domain/chat/Transcript/Transcript.stories.tsx +296 -0
- package/src/components/domain/chat/Transcript/TranscriptSource.test.mjs +189 -0
- package/src/components/domain/chat/Transcript/index.tsx +187 -0
- package/src/components/domain/chat/TranscriptSpine/TranscriptSpine.stories.tsx +124 -0
- package/src/components/domain/chat/TranscriptSpine/index.tsx +245 -0
- package/src/components/domain/chat/UserTurn/UserTurn.stories.tsx +176 -0
- package/src/components/domain/chat/UserTurn/UserTurnSource.test.mjs +150 -0
- package/src/components/domain/chat/UserTurn/index.tsx +194 -0
- package/src/components/domain/chat/index.ts +22 -0
- package/src/components/domain/desktop/DesktopAccountMenuView/DesktopAccountMenuView.stories.tsx +116 -0
- package/src/components/domain/desktop/DesktopAccountMenuView/DesktopAccountMenuViewSource.test.mjs +80 -0
- package/src/components/domain/desktop/DesktopAccountMenuView/index.tsx +355 -0
- package/src/components/domain/desktop/DesktopAppearanceSettings/DesktopAppearanceSettings.stories.tsx +96 -0
- package/src/components/domain/desktop/DesktopAppearanceSettings/DesktopAppearanceSettingsSource.test.mjs +89 -0
- package/src/components/domain/desktop/DesktopAppearanceSettings/index.tsx +155 -0
- package/src/components/domain/desktop/DesktopAssistantConfigView/DesktopAssistantConfigView.stories.tsx +275 -0
- package/src/components/domain/desktop/DesktopAssistantConfigView/DesktopAssistantConfigViewSource.test.mjs +37 -0
- package/src/components/domain/desktop/DesktopAssistantConfigView/index.tsx +221 -0
- package/src/components/domain/desktop/DesktopCatalogView/DesktopCatalogView.stories.tsx +537 -0
- package/src/components/domain/desktop/DesktopCatalogView/DesktopCatalogViewSource.test.mjs +339 -0
- package/src/components/domain/desktop/DesktopCatalogView/index.tsx +1074 -0
- package/src/components/domain/desktop/DesktopChatBranchDivider/DesktopChatBranchDivider.stories.tsx +58 -0
- package/src/components/domain/desktop/DesktopChatBranchDivider/index.tsx +33 -0
- package/src/components/domain/desktop/DesktopChatEmptyStateView/DesktopChatEmptyStateView.stories.tsx +75 -0
- package/src/components/domain/desktop/DesktopChatEmptyStateView/DesktopChatEmptyStateViewSource.test.mjs +54 -0
- package/src/components/domain/desktop/DesktopChatEmptyStateView/index.tsx +64 -0
- package/src/components/domain/desktop/DesktopChatHeaderView/DesktopChatHeaderView.stories.tsx +83 -0
- package/src/components/domain/desktop/DesktopChatHeaderView/DesktopChatHeaderViewSource.test.mjs +126 -0
- package/src/components/domain/desktop/DesktopChatHeaderView/index.tsx +169 -0
- package/src/components/domain/desktop/DesktopChatMessageView/DesktopChatMessageView.stories.tsx +170 -0
- package/src/components/domain/desktop/DesktopChatMessageView/DesktopChatMessageViewSource.test.mjs +47 -0
- package/src/components/domain/desktop/DesktopChatMessageView/index.tsx +213 -0
- package/src/components/domain/desktop/DesktopChatTurnView/DesktopChatTurnView.stories.tsx +498 -0
- package/src/components/domain/desktop/DesktopChatTurnView/DesktopChatTurnViewSource.test.mjs +187 -0
- package/src/components/domain/desktop/DesktopChatTurnView/index.tsx +490 -0
- package/src/components/domain/desktop/DesktopComposer/DesktopComposer.stories.tsx +195 -0
- package/src/components/domain/desktop/DesktopComposer/DesktopComposerModelPickerSource.test.mjs +132 -0
- package/src/components/domain/desktop/DesktopComposer/DesktopComposerMountChipSource.test.mjs +43 -0
- package/src/components/domain/desktop/DesktopComposer/DesktopComposerResponsiveSource.test.mjs +44 -0
- package/src/components/domain/desktop/DesktopComposer/DesktopMcpFormThemeSource.test.mjs +30 -0
- package/src/components/domain/desktop/DesktopComposer/index.tsx +206 -0
- package/src/components/domain/desktop/DesktopConnectorDetailView/DesktopConnectorDetailView.stories.tsx +72 -0
- package/src/components/domain/desktop/DesktopConnectorDetailView/DesktopConnectorDetailViewSource.test.mjs +81 -0
- package/src/components/domain/desktop/DesktopConnectorDetailView/index.tsx +301 -0
- package/src/components/domain/desktop/DesktopHomeView/DesktopHomeView.stories.tsx +103 -0
- package/src/components/domain/desktop/DesktopHomeView/DesktopHomeViewSource.test.mjs +51 -0
- package/src/components/domain/desktop/DesktopHomeView/index.tsx +122 -0
- package/src/components/domain/desktop/DesktopLibraryAuthorizationDialog/DesktopLibraryAuthorizationDialog.stories.tsx +55 -0
- package/src/components/domain/desktop/DesktopLibraryAuthorizationDialog/index.tsx +156 -0
- package/src/components/domain/desktop/DesktopLibraryPageView/DesktopLibraryPageView.stories.tsx +42 -0
- package/src/components/domain/desktop/DesktopLibraryPageView/index.tsx +35 -0
- package/src/components/domain/desktop/DesktopLoginView/DesktopLoginView.css +75 -0
- package/src/components/domain/desktop/DesktopLoginView/DesktopLoginView.stories.tsx +230 -0
- package/src/components/domain/desktop/DesktopLoginView/DesktopLoginViewSource.test.mjs +149 -0
- package/src/components/domain/desktop/DesktopLoginView/index.tsx +418 -0
- package/src/components/domain/desktop/DesktopOnboardingTourView/DesktopOnboardingTourView.stories.tsx +103 -0
- package/src/components/domain/desktop/DesktopOnboardingTourView/DesktopOnboardingTourViewSource.test.mjs +57 -0
- package/src/components/domain/desktop/DesktopOnboardingTourView/index.tsx +189 -0
- package/src/components/domain/desktop/DesktopPet/DesktopPet.fixture.ts +243 -0
- package/src/components/domain/desktop/DesktopPet/DesktopPet.stories.tsx +337 -0
- package/src/components/domain/desktop/DesktopPet/DesktopPetSource.test.mjs +191 -0
- package/src/components/domain/desktop/DesktopPet/index.tsx +591 -0
- package/src/components/domain/desktop/DesktopPetSettings/DesktopPetSettings.stories.tsx +159 -0
- package/src/components/domain/desktop/DesktopPetSettings/DesktopPetSettingsSource.test.mjs +76 -0
- package/src/components/domain/desktop/DesktopPetSettings/index.tsx +140 -0
- package/src/components/domain/desktop/DesktopRunStatusView/DesktopRunStatusView.stories.tsx +166 -0
- package/src/components/domain/desktop/DesktopRunStatusView/DesktopRunStatusViewSource.test.mjs +51 -0
- package/src/components/domain/desktop/DesktopRunStatusView/index.tsx +34 -0
- package/src/components/domain/desktop/DesktopSelectionCard/DesktopSelectionCard.stories.tsx +122 -0
- package/src/components/domain/desktop/DesktopSelectionCard/DesktopSelectionCardSource.test.mjs +42 -0
- package/src/components/domain/desktop/DesktopSelectionCard/index.tsx +75 -0
- package/src/components/domain/desktop/DesktopSettingsMemorySection/DesktopSettingsMemorySection.stories.tsx +225 -0
- package/src/components/domain/desktop/DesktopSettingsMemorySection/DesktopSettingsMemorySectionSource.test.mjs +105 -0
- package/src/components/domain/desktop/DesktopSettingsMemorySection/index.tsx +340 -0
- package/src/components/domain/desktop/DesktopSettingsView/DesktopSettingsView.stories.tsx +177 -0
- package/src/components/domain/desktop/DesktopSettingsView/DesktopSettingsViewSource.test.mjs +195 -0
- package/src/components/domain/desktop/DesktopSettingsView/index.tsx +176 -0
- package/src/components/domain/desktop/DesktopShareSelectionBarView/DesktopShareSelectionBarView.stories.tsx +77 -0
- package/src/components/domain/desktop/DesktopShareSelectionBarView/DesktopShareSelectionBarViewSource.test.mjs +76 -0
- package/src/components/domain/desktop/DesktopShareSelectionBarView/index.tsx +55 -0
- package/src/components/domain/desktop/DesktopSidebarView/DesktopSidebarView.stories.tsx +454 -0
- package/src/components/domain/desktop/DesktopSidebarView/DesktopSidebarViewSource.test.mjs +386 -0
- package/src/components/domain/desktop/DesktopSidebarView/index.tsx +1072 -0
- package/src/components/domain/desktop/DesktopSiteReleasesView/DesktopSiteReleasesView.stories.tsx +369 -0
- package/src/components/domain/desktop/DesktopSiteReleasesView/DesktopSiteReleasesViewSource.test.mjs +123 -0
- package/src/components/domain/desktop/DesktopSiteReleasesView/index.tsx +392 -0
- package/src/components/domain/desktop/DesktopSitesListView/DesktopSitesListView.stories.tsx +244 -0
- package/src/components/domain/desktop/DesktopSitesListView/DesktopSitesListViewSource.test.mjs +198 -0
- package/src/components/domain/desktop/DesktopSitesListView/index.tsx +417 -0
- package/src/components/domain/desktop/DesktopSkillsPageView/DesktopSkillsPageView.stories.tsx +230 -0
- package/src/components/domain/desktop/DesktopSkillsPageView/DesktopSkillsPageViewSource.test.mjs +149 -0
- package/src/components/domain/desktop/DesktopSkillsPageView/index.tsx +235 -0
- package/src/components/domain/desktop/DesktopTaskDetailView/index.tsx +111 -0
- package/src/components/domain/desktop/DesktopToolCallView/DesktopToolCallListViewSource.test.mjs +302 -0
- package/src/components/domain/desktop/DesktopToolCallView/DesktopToolCallView.stories.tsx +409 -0
- package/src/components/domain/desktop/DesktopToolCallView/index.tsx +388 -0
- package/src/components/domain/desktop/DesktopWorkbenchShell/DesktopWorkbenchShell.stories.tsx +418 -0
- package/src/components/domain/desktop/DesktopWorkbenchShell/DesktopWorkbenchShellSource.test.mjs +151 -0
- package/src/components/domain/desktop/DesktopWorkbenchShell/index.tsx +167 -0
- package/src/components/domain/desktop/DesktopWorkspacePageView/DesktopWorkspacePageView.stories.tsx +135 -0
- package/src/components/domain/desktop/DesktopWorkspacePageView/DesktopWorkspacePageViewSource.test.mjs +57 -0
- package/src/components/domain/desktop/DesktopWorkspacePageView/index.tsx +114 -0
- package/src/components/domain/desktop/DesktopWorkspaceView/DesktopWorkspaceView.stories.tsx +227 -0
- package/src/components/domain/desktop/DesktopWorkspaceView/DesktopWorkspaceViewSource.test.mjs +175 -0
- package/src/components/domain/desktop/DesktopWorkspaceView/index.tsx +580 -0
- package/src/components/domain/desktop/ResourceManagement/ResourceManagement.stories.tsx +19 -0
- package/src/components/domain/desktop/ResourceManagement/ResourceManagementSource.test.mjs +54 -0
- package/src/components/domain/desktop/ResourceManagement/SharesList.tsx +323 -0
- package/src/components/domain/desktop/ResourceManagement/SnapshotViews.tsx +92 -0
- package/src/components/domain/desktop/ResourceManagement/SnapshotViewsSource.test.mjs +15 -0
- package/src/components/domain/desktop/ResourceManagement/index.tsx +246 -0
- package/src/components/domain/desktop/ShareSettingsDialogView/index.tsx +234 -0
- package/src/components/domain/desktop/SidePanelEmpty/SidePanelEmpty.stories.tsx +100 -0
- package/src/components/domain/desktop/SidePanelEmpty/SidePanelEmptySource.test.mjs +67 -0
- package/src/components/domain/desktop/SidePanelEmpty/index.tsx +113 -0
- package/src/components/domain/desktop/StarterCapsules/StarterCapsules.stories.tsx +65 -0
- package/src/components/domain/desktop/StarterCapsules/StarterCapsulesSource.test.mjs +43 -0
- package/src/components/domain/desktop/StarterCapsules/index.tsx +90 -0
- package/src/components/domain/desktop/WorkbenchSidePanel/WorkbenchSidePanel.stories.tsx +59 -0
- package/src/components/domain/desktop/WorkbenchSidePanel/WorkbenchSidePanelSource.test.mjs +51 -0
- package/src/components/domain/desktop/WorkbenchSidePanel/index.tsx +74 -0
- package/src/components/domain/desktop/WorkspaceMigrateConfirm/WorkspaceMigrateConfirm.stories.tsx +79 -0
- package/src/components/domain/desktop/WorkspaceMigrateConfirm/WorkspaceMigrateConfirmSource.test.mjs +34 -0
- package/src/components/domain/desktop/WorkspaceMigrateConfirm/index.tsx +92 -0
- package/src/components/domain/desktop/index.ts +64 -0
- package/src/components/domain/files/FileBrowser/FileBrowser.stories.tsx +397 -0
- package/src/components/domain/files/FileBrowser/FileBrowserSource.test.mjs +75 -0
- package/src/components/domain/files/FileBrowser/index.tsx +221 -0
- package/src/components/domain/files/FileIcon/FileIcon.stories.tsx +207 -0
- package/src/components/domain/files/FileIcon/FileIconSource.test.mjs +39 -0
- package/src/components/domain/files/FileIcon/index.tsx +133 -0
- package/src/components/domain/files/FilePreviewContentView/FilePreviewContentView.stories.tsx +242 -0
- package/src/components/domain/files/FilePreviewContentView/FilePreviewContentViewSource.test.mjs +44 -0
- package/src/components/domain/files/FilePreviewContentView/index.tsx +125 -0
- package/src/components/domain/files/FileTree/FileTree.stories.tsx +204 -0
- package/src/components/domain/files/FileTree/FileTreeSource.test.mjs +18 -0
- package/src/components/domain/files/FileTree/index.tsx +106 -0
- package/src/components/domain/files/PreviewDialog/PreviewDialog.stories.tsx +178 -0
- package/src/components/domain/files/PreviewDialog/PreviewDialogSource.test.mjs +92 -0
- package/src/components/domain/files/PreviewDialog/index.tsx +294 -0
- package/src/components/domain/files/index.ts +5 -0
- package/src/components/domain/index.ts +8 -0
- package/src/components/domain/office/CsvPreview/CsvPreview.stories.tsx +264 -0
- package/src/components/domain/office/CsvPreview/CsvPreviewSource.test.mjs +77 -0
- package/src/components/domain/office/CsvPreview/index.tsx +224 -0
- package/src/components/domain/office/OfficePreview/OfficePreview.stories.tsx +265 -0
- package/src/components/domain/office/OfficePreview/OfficePreviewDialog.stories.tsx +71 -0
- package/src/components/domain/office/OfficePreview/OfficePreviewDialog.tsx +43 -0
- package/src/components/domain/office/OfficePreview/OfficePreviewSource.test.mjs +126 -0
- package/src/components/domain/office/OfficePreview/index.tsx +782 -0
- package/src/components/domain/office/PdfPreview/PdfPreview.stories.tsx +280 -0
- package/src/components/domain/office/PdfPreview/PdfPreviewDialog.stories.tsx +61 -0
- package/src/components/domain/office/PdfPreview/PdfPreviewDialog.tsx +61 -0
- package/src/components/domain/office/PdfPreview/PdfPreviewSource.test.mjs +70 -0
- package/src/components/domain/office/PdfPreview/index.tsx +217 -0
- package/src/components/domain/office/index.ts +5 -0
- package/src/components/domain/skills/McpServerListView/McpServerListView.stories.tsx +510 -0
- package/src/components/domain/skills/McpServerListView/McpServerListViewSource.test.mjs +101 -0
- package/src/components/domain/skills/McpServerListView/index.tsx +250 -0
- package/src/components/domain/skills/SkillAvatarView/SkillAvatarView.stories.tsx +121 -0
- package/src/components/domain/skills/SkillAvatarView/SkillAvatarViewSource.test.mjs +67 -0
- package/src/components/domain/skills/SkillAvatarView/index.tsx +112 -0
- package/src/components/domain/skills/SkillCardView/SkillCardView.stories.tsx +374 -0
- package/src/components/domain/skills/SkillCardView/SkillCardViewSource.test.mjs +35 -0
- package/src/components/domain/skills/SkillCardView/index.tsx +88 -0
- package/src/components/domain/skills/SkillDetailPanelView/SkillDetailPanelView.stories.tsx +113 -0
- package/src/components/domain/skills/SkillDetailPanelView/index.tsx +115 -0
- package/src/components/domain/skills/SkillDetailView/SkillDetailView.stories.tsx +274 -0
- package/src/components/domain/skills/SkillDetailView/index.tsx +121 -0
- package/src/components/domain/skills/SkillImportDialogView/SkillImportDialogView.stories.tsx +128 -0
- package/src/components/domain/skills/SkillImportDialogView/SkillImportDialogViewSource.test.mjs +11 -0
- package/src/components/domain/skills/SkillImportDialogView/index.tsx +147 -0
- package/src/components/domain/skills/ToolDetailModalView/ToolDetailModalView.stories.tsx +160 -0
- package/src/components/domain/skills/ToolDetailModalView/ToolDetailModalViewSource.test.mjs +99 -0
- package/src/components/domain/skills/ToolDetailModalView/index.tsx +160 -0
- package/src/components/domain/skills/index.ts +7 -0
- package/src/components/domain/tasks/ScheduledTaskCardView/ScheduledTaskCardView.stories.tsx +120 -0
- package/src/components/domain/tasks/ScheduledTaskCardView/ScheduledTaskCardViewSource.test.mjs +40 -0
- package/src/components/domain/tasks/ScheduledTaskCardView/index.tsx +135 -0
- package/src/components/domain/tasks/ScheduledTaskDeleteDialog/ScheduledTaskDeleteDialog.stories.tsx +56 -0
- package/src/components/domain/tasks/ScheduledTaskDeleteDialog/ScheduledTaskDeleteDialogSource.test.mjs +35 -0
- package/src/components/domain/tasks/ScheduledTaskDeleteDialog/index.tsx +73 -0
- package/src/components/domain/tasks/ScheduledTaskDetailView/ScheduledTaskDetailView.stories.tsx +121 -0
- package/src/components/domain/tasks/ScheduledTaskDetailView/ScheduledTaskDetailViewSource.test.mjs +115 -0
- package/src/components/domain/tasks/ScheduledTaskDetailView/index.tsx +223 -0
- package/src/components/domain/tasks/ScheduledTasksSpaceView/ScheduledTasksSpaceView.stories.tsx +526 -0
- package/src/components/domain/tasks/ScheduledTasksSpaceView/ScheduledTasksSpaceViewSource.test.mjs +85 -0
- package/src/components/domain/tasks/ScheduledTasksSpaceView/index.tsx +118 -0
- package/src/components/domain/tasks/index.ts +4 -0
- package/src/components/domain/theme/SkinManager.stories.tsx +43 -0
- package/src/components/domain/theme/SkinManagerUI.tsx +382 -0
- package/src/components/domain/theme/ThemeDemo.stories.tsx +12 -0
- package/src/components/domain/theme/ThemeDemo.tsx +224 -0
- package/src/components/index.ts +11 -0
- package/src/components/primitives/Avatar/Avatar.stories.tsx +170 -0
- package/src/components/primitives/Avatar/AvatarSource.test.mjs +37 -0
- package/src/components/primitives/Avatar/index.tsx +180 -0
- package/src/components/primitives/BackTop/BackTop.stories.tsx +122 -0
- package/src/components/primitives/BackTop/BackTopSource.test.mjs +61 -0
- package/src/components/primitives/BackTop/index.tsx +93 -0
- package/src/components/primitives/Badge/Badge.stories.tsx +376 -0
- package/src/components/primitives/Badge/BadgeSource.test.mjs +27 -0
- package/src/components/primitives/Badge/index.tsx +65 -0
- package/src/components/primitives/Button/Button.stories.tsx +287 -0
- package/src/components/primitives/Button/ButtonSource.test.mjs +84 -0
- package/src/components/primitives/Button/index.tsx +216 -0
- package/src/components/primitives/Card/Card.stories.tsx +186 -0
- package/src/components/primitives/Card/CardSource.test.mjs +73 -0
- package/src/components/primitives/Card/index.tsx +137 -0
- package/src/components/primitives/Checkbox/Checkbox.stories.tsx +79 -0
- package/src/components/primitives/Checkbox/CheckboxSource.test.mjs +43 -0
- package/src/components/primitives/Checkbox/index.tsx +87 -0
- package/src/components/primitives/Chip/Chip.stories.tsx +149 -0
- package/src/components/primitives/Chip/ChipSource.test.mjs +73 -0
- package/src/components/primitives/Chip/index.tsx +252 -0
- package/src/components/primitives/Divider/Divider.stories.tsx +68 -0
- package/src/components/primitives/Divider/DividerSource.test.mjs +26 -0
- package/src/components/primitives/Divider/index.tsx +65 -0
- package/src/components/primitives/Dropdown/Dropdown.stories.tsx +38 -0
- package/src/components/primitives/Dropdown/DropdownSource.test.mjs +23 -0
- package/src/components/primitives/Dropdown/index.tsx +29 -0
- package/src/components/primitives/EmptyState/EmptyState.stories.tsx +159 -0
- package/src/components/primitives/EmptyState/EmptyStateSource.test.mjs +169 -0
- package/src/components/primitives/EmptyState/index.tsx +185 -0
- package/src/components/primitives/ErrorCard/ErrorCard.stories.tsx +50 -0
- package/src/components/primitives/ErrorCard/index.tsx +78 -0
- package/src/components/primitives/Field/Field.stories.tsx +208 -0
- package/src/components/primitives/Field/FieldSource.test.mjs +70 -0
- package/src/components/primitives/Field/index.tsx +297 -0
- package/src/components/primitives/InlineMessage/InlineMessage.stories.tsx +137 -0
- package/src/components/primitives/InlineMessage/InlineMessageSource.test.mjs +50 -0
- package/src/components/primitives/InlineMessage/index.tsx +141 -0
- package/src/components/primitives/Input/Input.stories.tsx +30 -0
- package/src/components/primitives/Input/index.tsx +12 -0
- package/src/components/primitives/Keycap/Keycap.stories.tsx +93 -0
- package/src/components/primitives/Keycap/KeycapSource.test.mjs +30 -0
- package/src/components/primitives/Keycap/index.tsx +67 -0
- package/src/components/primitives/Menu/Menu.stories.tsx +416 -0
- package/src/components/primitives/Menu/MenuEmptySource.test.mjs +23 -0
- package/src/components/primitives/Menu/MenuSource.test.mjs +207 -0
- package/src/components/primitives/Menu/index.tsx +922 -0
- package/src/components/primitives/Pagination/Pagination.stories.tsx +77 -0
- package/src/components/primitives/Pagination/PaginationSource.test.mjs +24 -0
- package/src/components/primitives/Pagination/index.tsx +85 -0
- package/src/components/primitives/Pagination/pagination.ts +25 -0
- package/src/components/primitives/Pagination/paginationModel.test.mjs +18 -0
- package/src/components/primitives/ProgressBar/ProgressBar.stories.tsx +103 -0
- package/src/components/primitives/ProgressBar/ProgressBarSource.test.mjs +44 -0
- package/src/components/primitives/ProgressBar/index.tsx +68 -0
- package/src/components/primitives/Radio/Radio.stories.tsx +84 -0
- package/src/components/primitives/Radio/RadioSource.test.mjs +38 -0
- package/src/components/primitives/Radio/index.tsx +161 -0
- package/src/components/primitives/SegmentedControl/SegmentedControl.stories.tsx +110 -0
- package/src/components/primitives/SegmentedControl/SegmentedControlSource.test.mjs +75 -0
- package/src/components/primitives/SegmentedControl/index.tsx +188 -0
- package/src/components/primitives/Select/Select.stories.tsx +158 -0
- package/src/components/primitives/Select/SelectSource.test.mjs +94 -0
- package/src/components/primitives/Select/index.tsx +364 -0
- package/src/components/primitives/Spinner/index.tsx +58 -0
- package/src/components/primitives/Switch/Switch.stories.tsx +64 -0
- package/src/components/primitives/Switch/SwitchSource.test.mjs +38 -0
- package/src/components/primitives/Switch/index.tsx +84 -0
- package/src/components/primitives/Tabs/Tabs.stories.tsx +230 -0
- package/src/components/primitives/Tabs/TabsSource.test.mjs +91 -0
- package/src/components/primitives/Tabs/index.tsx +183 -0
- package/src/components/primitives/index.ts +24 -0
- package/src/examples/ResourceManagementExample.tsx +119 -0
- package/src/examples/SiteWorkbenchExample.tsx +96 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useClickOutside.ts +20 -0
- package/src/hooks/useDragReorder.ts +29 -0
- package/src/hooks/useImeAwareEnter.ts +59 -0
- package/src/hooks/useImeAwareEnterSource.test.mjs +65 -0
- package/src/hooks/useKeyboard.ts +16 -0
- package/src/hooks/usePopover.ts +67 -0
- package/src/hooks/useSelectedOptionLocator.ts +33 -0
- package/src/hooks/useSidebarResize.ts +107 -0
- package/src/hooks/useTenantTheme.ts +53 -0
- package/src/hooks/useUnifiedTheme.ts +85 -0
- package/src/index.ts +6 -0
- package/src/lib/InjectedStyleTokenMirrorSource.test.mjs +67 -0
- package/src/lib/about-window.test.mjs +46 -0
- package/src/lib/about-window.ts +218 -0
- package/src/lib/appearance.test.mjs +283 -0
- package/src/lib/appearance.ts +46 -0
- package/src/lib/browser-annotation-popup.ts +151 -0
- package/src/lib/focusTrap.ts +51 -0
- package/src/lib/index.ts +5 -0
- package/src/lib/shortcut.test.mjs +100 -0
- package/src/lib/shortcut.ts +97 -0
- package/src/lib/twMergeOw.ts +18 -0
- package/src/lib/utils.ts +6 -0
- package/src/screens/Browser.stories.tsx +353 -0
- package/src/screens/Chat.stories.tsx +808 -0
- package/src/screens/Home.stories.tsx +253 -0
- package/src/screens/Login.stories.tsx +134 -0
- package/src/screens/McpManager.stories.tsx +159 -0
- package/src/screens/Onboarding.stories.tsx +155 -0
- package/src/screens/ScheduledTasks.stories.tsx +134 -0
- package/src/screens/ScreenFrameSource.test.mjs +77 -0
- package/src/screens/SettingsAppearance.stories.tsx +117 -0
- package/src/screens/SettingsMemory.stories.tsx +128 -0
- package/src/screens/SettingsModels.stories.tsx +228 -0
- package/src/screens/SettingsSections.stories.tsx +164 -0
- package/src/screens/Share.stories.tsx +202 -0
- package/src/screens/SharePage.stories.tsx +29 -0
- package/src/screens/Sites.stories.tsx +183 -0
- package/src/screens/Skills.stories.tsx +83 -0
- package/src/screens/Workspace.stories.tsx +191 -0
- package/src/screens/_home.tsx +46 -0
- package/src/screens/_screen.tsx +355 -0
- package/src/screens/_settingsNav.ts +27 -0
- package/src/screens/_skillsCatalog.tsx +372 -0
- package/src/theme/SkinDenylistSyncSource.test.mjs +124 -0
- package/src/theme/__tests__/skins.test.mjs +84 -0
- package/src/theme/core/semanticAdapter.ts +116 -0
- package/src/theme/core/skin.ts +605 -0
- package/src/theme/core/skinScoped.ts +289 -0
- package/src/theme/core/tenantTheme.test.mjs +127 -0
- package/src/theme/core/tenantTheme.ts +124 -0
- package/src/theme/core/types.ts +60 -0
- package/src/theme/core/unifiedTheme.ts +157 -0
- package/src/theme/index.ts +33 -0
- package/src/theme/providers/BrandingProvider.tsx +57 -0
- package/src/theme/providers/ThemeProvider.tsx +221 -0
- package/src/theme/skinDs2PropertyGate.test.mjs +109 -0
- package/src/theme/skins/index.ts +107 -0
- package/src/theme/utils/cssSafety.ts +92 -0
- package/src/theme/utils/skinManager.ts +159 -0
- package/src/theme/utils/themeApplier.ts +75 -0
- package/src/tokens/DesktopSurfacesSweep15Source.test.mjs +77 -0
- package/src/tokens/SharedStyleSheetsSource.test.mjs +90 -0
- package/src/tokens/TailwindThemeSupplySource.test.mjs +129 -0
- package/src/tokens/base.ts +199 -0
- package/src/tokens/dark.ts +288 -0
- package/src/tokens/index.ts +4 -0
- package/src/tokens/light.ts +320 -0
- package/src/tokens/tailwind.ts +216 -0
- package/src/types/desktop-pet.ts +100 -0
- package/src/types/file-browser.ts +51 -0
- package/src/types/file-tree.ts +34 -0
- package/src/types/index.ts +3 -0
- package/src/types/xspreadsheet.d.ts +4 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/glyphColor.ts +32 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/localPathInline.test.mjs +45 -0
- package/src/utils/localPathInline.ts +49 -0
- package/src/utils/markdownFileRefs.test.mjs +88 -0
- package/src/utils/markdownFileRefs.ts +140 -0
- package/src/utils/office-excel.ts +452 -0
- package/src/utils/shiki.ts +156 -0
|
@@ -0,0 +1,1072 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from "react"
|
|
4
|
+
import { createPortal } from "react-dom" // ui-imports-guard-disable-line
|
|
5
|
+
import { useImeAwareEnter } from "../../../../hooks/useImeAwareEnter"
|
|
6
|
+
import type { Theme } from "../../../../lib/appearance"
|
|
7
|
+
import { SidebarShell, type SidebarShellPlatform } from "../../../Layout/SidebarShell"
|
|
8
|
+
import { CreateProjectDialog } from "../../../composite/CreateProjectDialog"
|
|
9
|
+
import { Dialog } from "../../../composite/Dialog"
|
|
10
|
+
import {
|
|
11
|
+
Archive,
|
|
12
|
+
Branch,
|
|
13
|
+
ChevDown,
|
|
14
|
+
ChevRight,
|
|
15
|
+
Clock,
|
|
16
|
+
Edit,
|
|
17
|
+
Folder,
|
|
18
|
+
Grid,
|
|
19
|
+
Icon,
|
|
20
|
+
More,
|
|
21
|
+
Package,
|
|
22
|
+
PanelSidebar,
|
|
23
|
+
Plus,
|
|
24
|
+
Refresh,
|
|
25
|
+
Share,
|
|
26
|
+
ThreadDot,
|
|
27
|
+
Trash,
|
|
28
|
+
} from "../../../composite/Icons"
|
|
29
|
+
import { TextField } from "../../../composite/NativeControls"
|
|
30
|
+
import { OrbitworkLockup } from "../../../composite/OrbitworkLogo"
|
|
31
|
+
import { ProjectSelect } from "../../../composite/ProjectSelect"
|
|
32
|
+
import { Avatar, Button } from "../../../primitives"
|
|
33
|
+
import { MenuSurface } from "../../../primitives/Menu"
|
|
34
|
+
import type { MenuItem } from "../../../primitives/Menu"
|
|
35
|
+
import { DesktopAccountMenuView, updateRowText } from "../DesktopAccountMenuView"
|
|
36
|
+
|
|
37
|
+
export type DesktopSidebarNavId = "new" | "skills" | "sites" | "cron" | "files" | "library"
|
|
38
|
+
export type DesktopSidebarSourceIcon = "WeCom" | "DingTalk" | "Feishu"
|
|
39
|
+
|
|
40
|
+
export interface DesktopSidebarThread {
|
|
41
|
+
id: string
|
|
42
|
+
projectId: string
|
|
43
|
+
title: string
|
|
44
|
+
active: boolean
|
|
45
|
+
running: boolean
|
|
46
|
+
/** 运行进度读数(如 "3/7"),mono+tabular-nums 渲染在行尾实心点之后。
|
|
47
|
+
* SidebarCurrent 规格·状态极改形:与位置极(图标内信标点)不得同形,永不荧黄。 */
|
|
48
|
+
runningCount?: string
|
|
49
|
+
unread: boolean
|
|
50
|
+
sourceIcon?: DesktopSidebarSourceIcon
|
|
51
|
+
sourceLabel?: string
|
|
52
|
+
branched?: boolean
|
|
53
|
+
archived?: boolean
|
|
54
|
+
canArchive?: boolean
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface DesktopSidebarProject {
|
|
58
|
+
id: string
|
|
59
|
+
label: string
|
|
60
|
+
open: boolean
|
|
61
|
+
isDefault: boolean
|
|
62
|
+
loadingMore: boolean
|
|
63
|
+
canLoadMore: boolean
|
|
64
|
+
loadError?: string | null
|
|
65
|
+
threads: DesktopSidebarThread[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DesktopSidebarUser {
|
|
69
|
+
name: string
|
|
70
|
+
avatarUrl: string
|
|
71
|
+
/** 账户菜单头部第二行(邮箱优先,没有就出 id)。 */
|
|
72
|
+
email?: string
|
|
73
|
+
/**
|
|
74
|
+
* 身份键:既是头像无图时的配色取模依据(`primitives/Avatar` 的 data-1..6 轮转),
|
|
75
|
+
* 也是账户菜单「复制 ID」复制出去的值。不传=菜单头不出复制钮。
|
|
76
|
+
*/
|
|
77
|
+
id?: string
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type DesktopSidebarUpdateState = "available" | "downloading" | "ready" | "error"
|
|
81
|
+
|
|
82
|
+
export interface DesktopSidebarUpdate {
|
|
83
|
+
state: DesktopSidebarUpdateState
|
|
84
|
+
version: string
|
|
85
|
+
percent?: number
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface DesktopSidebarViewProps {
|
|
89
|
+
collapsed: boolean
|
|
90
|
+
width: number
|
|
91
|
+
/**
|
|
92
|
+
* 平台(受控,权威值来自主进程;库侧不嗅探 userAgent)。R2 起它决定折叠钮住在哪:
|
|
93
|
+
* `windows` 的钮在通栏带里(本栏无顶行、折叠宽 0),其余平台钮住在**侧栏顶行**
|
|
94
|
+
* (mac 顶行带 68 红绿灯让位块,钮落 x=80;linux/web 落 x=8),折叠成 rail(mac 116 / 其余 44)。
|
|
95
|
+
* 宿主两处传同一个值:`App.tsx` 的 `DesktopWorkbenchShell.platform` 与本件。缺省不传=不出顶行。
|
|
96
|
+
*/
|
|
97
|
+
platform?: SidebarShellPlatform
|
|
98
|
+
/** mac 全屏:红绿灯消失 → 顶行让位块收 0、钮回到 x=8、折叠 rail 收到 44。 */
|
|
99
|
+
fullscreen?: boolean
|
|
100
|
+
/**
|
|
101
|
+
* 折叠后宽度(透传 SidebarShell):缺省按 `platform` 派生 rail(mac 116 / 其余 44);
|
|
102
|
+
* **显式传 0=整条卸载**——折叠后不留 rail,顶行折成浮块坐在窗口左上角原坐标供重新展开。
|
|
103
|
+
* 桌面宿主「折叠=全部折叠」走 0 这一档。
|
|
104
|
+
*/
|
|
105
|
+
collapsedWidth?: number
|
|
106
|
+
/**
|
|
107
|
+
* 当前导航项(位置极)。R2 · L1-1-1:原来是 `Exclude<…, "new">`,
|
|
108
|
+
* 从签名上就禁掉了「新任务」这一档,于是主屏整屏零位置极——而原型
|
|
109
|
+
* (模板 L5008–5013,NAV 首项就是「新任务」)在主屏是把这一行点亮的。
|
|
110
|
+
* 宿主 `features/sidebar/Sidebar.tsx` 补 `view === 'home' → 'new'` 即可,见交接单。
|
|
111
|
+
*/
|
|
112
|
+
activeNav?: DesktopSidebarNavId
|
|
113
|
+
/**
|
|
114
|
+
* 是否在导航里出「我的空间」(A11-B1 · 裁决 16)。
|
|
115
|
+
*
|
|
116
|
+
* 缺省 **false**:我的空间正在退役——项目文件搬去右栏文件浏览器、记忆搬去设置·记忆段,
|
|
117
|
+
* 导航因此长成「新任务 / 插件 / 工作台 / 定时任务」四项(原型模板 689–701)。
|
|
118
|
+
* 代码与 `DesktopSidebarNavId` 的 `"files"` 一律保留:宿主路由(apps/desktop
|
|
119
|
+
* `features/sidebar/Sidebar.tsx:291` 的 `view === 'workspace' → 'files'`)还在,
|
|
120
|
+
* 打开本开关即可原样退回五项。宿主路由退役后本 prop 与 `"files"` 分支一起删。
|
|
121
|
+
*/
|
|
122
|
+
showWorkspaceNav?: boolean
|
|
123
|
+
newTaskTitle: string
|
|
124
|
+
projects: DesktopSidebarProject[]
|
|
125
|
+
user: DesktopSidebarUser
|
|
126
|
+
onCollapsedChange: (collapsed: boolean) => void
|
|
127
|
+
onWidthChange: (width: number) => void
|
|
128
|
+
onNavigate: (target: Exclude<DesktopSidebarNavId, "new">) => void
|
|
129
|
+
onOpenSettings: () => void
|
|
130
|
+
petVisible?: boolean
|
|
131
|
+
onPetVisibleChange?: (visible: boolean) => void
|
|
132
|
+
onNewTask: (projectId?: string) => void
|
|
133
|
+
onToggleProject: (projectId: string) => void
|
|
134
|
+
onLoadMore: (projectId: string) => void
|
|
135
|
+
showArchived: boolean
|
|
136
|
+
onRefreshProjects: () => void
|
|
137
|
+
onShowArchivedChange: (showArchived: boolean) => void
|
|
138
|
+
onSelectThread: (threadId: string) => void
|
|
139
|
+
onCreateProject: (name: string) => Promise<void>
|
|
140
|
+
onCreateProjectForSelection?: (name: string) => Promise<string>
|
|
141
|
+
onRenameProject: (projectId: string, name: string) => Promise<void>
|
|
142
|
+
onDeleteProject: (projectId: string) => Promise<void>
|
|
143
|
+
onOpenProjectDirectory: (projectId: string) => void
|
|
144
|
+
onRenameThread: (threadId: string, title: string) => Promise<void>
|
|
145
|
+
onMoveThread: (threadId: string, projectId: string) => Promise<void>
|
|
146
|
+
onDeleteThread: (threadId: string) => Promise<void>
|
|
147
|
+
onArchiveThread: (threadId: string) => Promise<void>
|
|
148
|
+
// Share the whole thread as a one-click, share-everything shortcut (no picker).
|
|
149
|
+
onShareThread: (threadId: string) => void
|
|
150
|
+
onFeedback: () => void
|
|
151
|
+
onLogout: () => void
|
|
152
|
+
update?: DesktopSidebarUpdate
|
|
153
|
+
onUpdateClick?: () => void
|
|
154
|
+
onInstallUpdate?: () => Promise<void> | void
|
|
155
|
+
|
|
156
|
+
/* ── R2 · 账户菜单「常用能力直出」的数据口(全部可选,缺省即该块不出) ───────
|
|
157
|
+
数据来源见交接单第九节:套餐/积分走计费接口、版本号走 app.getVersion()、
|
|
158
|
+
主题走宿主 theme store(与设置·常规段同一个值)。 */
|
|
159
|
+
/** 套餐名 + 行末描边钮(升级 / 充值)。不传=套餐井里不出这一行。 */
|
|
160
|
+
plan?: { name: string; action?: { label: string; onClick: () => void } }
|
|
161
|
+
/** 积分额度读数(used/limit)。不传=不出读数与额度条;plan 与 credits 都没有则整个井不出。 */
|
|
162
|
+
credits?: { used: number; limit: number; label?: string }
|
|
163
|
+
/** 版本号,挂在菜单「检查更新」行尾(mono 读数)。 */
|
|
164
|
+
version?: string
|
|
165
|
+
/** 当前主题(与设置·常规段的三格同一个值)。 */
|
|
166
|
+
theme?: Theme
|
|
167
|
+
onThemeChange?: (theme: Theme) => void
|
|
168
|
+
/** 「记忆」行;不传时回落到 `onOpenSettings()`(宿主再跳记忆段)。 */
|
|
169
|
+
onOpenMemory?: () => void
|
|
170
|
+
/** 「复制 ID」:组件出 2 秒内联反馈,toast 归宿主。不传+没有 user.id =不出复制钮。 */
|
|
171
|
+
onCopyUserId?: (id: string) => void
|
|
172
|
+
/** 「检查更新」行。 */
|
|
173
|
+
onCheckUpdate?: () => void
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
type Anchor = { id: string; left: number; top: number }
|
|
177
|
+
type ProjectAnchor = Anchor & { label: string; isDefault: boolean }
|
|
178
|
+
|
|
179
|
+
export function DesktopSidebarView(props: DesktopSidebarViewProps): React.ReactElement {
|
|
180
|
+
const { projects } = props
|
|
181
|
+
const { isImeEnter, onCompositionStart, onCompositionEnd } = useImeAwareEnter()
|
|
182
|
+
const [creatingProject, setCreatingProject] = useState(false)
|
|
183
|
+
const [userMenu, setUserMenu] = useState<{ left: number; top: number; byKeyboard: boolean } | null>(null)
|
|
184
|
+
/* R2 核对修(T4):账户行按钮是菜单的触发器——Esc / 选中一行关面后焦点回到它
|
|
185
|
+
(WAI-ARIA menu button 口径)。原来关面后焦点掉到 body,键盘用户得从文档头重新 Tab 进来。
|
|
186
|
+
鼠标点遮罩 / 窗口失焦关面不回焦(没有键盘上下文可还)。 */
|
|
187
|
+
const userMenuTrigger = useRef<HTMLButtonElement>(null)
|
|
188
|
+
const closeUserMenu = (restoreFocus: boolean) => {
|
|
189
|
+
setUserMenu(null)
|
|
190
|
+
if (restoreFocus) userMenuTrigger.current?.focus()
|
|
191
|
+
}
|
|
192
|
+
const [threadMenu, setThreadMenu] = useState<Anchor | null>(null)
|
|
193
|
+
const [projectMenu, setProjectMenu] = useState<ProjectAnchor | null>(null)
|
|
194
|
+
const [projectsMenu, setProjectsMenu] = useState<{ left: number; top: number } | null>(null)
|
|
195
|
+
const [renamingThread, setRenamingThread] = useState<{ id: string; value: string } | null>(null)
|
|
196
|
+
const [renamingProject, setRenamingProject] = useState<{ id: string; value: string } | null>(null)
|
|
197
|
+
const [pendingThreadDelete, setPendingThreadDelete] = useState<DesktopSidebarThread | null>(null)
|
|
198
|
+
const [pendingProjectDelete, setPendingProjectDelete] = useState<DesktopSidebarProject | null>(null)
|
|
199
|
+
const [pendingMove, setPendingMove] = useState<DesktopSidebarThread | null>(null)
|
|
200
|
+
const [deletingProject, setDeletingProject] = useState(false)
|
|
201
|
+
const [draggingThreadId, setDraggingThreadId] = useState<string | null>(null)
|
|
202
|
+
const [dragOverProjectId, setDragOverProjectId] = useState<string | null>(null)
|
|
203
|
+
const [showInstallUpdate, setShowInstallUpdate] = useState(false)
|
|
204
|
+
const [installingUpdate, setInstallingUpdate] = useState(false)
|
|
205
|
+
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
if (!threadMenu && !projectMenu && !projectsMenu) return
|
|
208
|
+
const close = () => {
|
|
209
|
+
setThreadMenu(null)
|
|
210
|
+
setProjectMenu(null)
|
|
211
|
+
setProjectsMenu(null)
|
|
212
|
+
}
|
|
213
|
+
const timer = window.setTimeout(() => window.addEventListener("click", close), 0)
|
|
214
|
+
return () => {
|
|
215
|
+
window.clearTimeout(timer)
|
|
216
|
+
window.removeEventListener("click", close)
|
|
217
|
+
}
|
|
218
|
+
}, [threadMenu, projectMenu, projectsMenu])
|
|
219
|
+
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
if (!userMenu) return
|
|
222
|
+
const close = () => setUserMenu(null)
|
|
223
|
+
// 只有 Escape 关面:菜单已换 MenuSurface 基座,方向键/Home/End/首字母都是它的
|
|
224
|
+
// 键盘导航,原来「任意 keydown 就关」会把导航按键一并吃掉。
|
|
225
|
+
const closeOnEscape = (event: KeyboardEvent) => {
|
|
226
|
+
if (event.key === "Escape") closeUserMenu(true)
|
|
227
|
+
}
|
|
228
|
+
window.addEventListener("click", close)
|
|
229
|
+
window.addEventListener("keydown", closeOnEscape)
|
|
230
|
+
window.addEventListener("blur", close)
|
|
231
|
+
return () => {
|
|
232
|
+
window.removeEventListener("click", close)
|
|
233
|
+
window.removeEventListener("keydown", closeOnEscape)
|
|
234
|
+
window.removeEventListener("blur", close)
|
|
235
|
+
}
|
|
236
|
+
}, [userMenu])
|
|
237
|
+
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
if (props.update?.state !== "ready") setShowInstallUpdate(false)
|
|
240
|
+
}, [props.update?.state])
|
|
241
|
+
|
|
242
|
+
const threadById = (id: string) => projects.flatMap((project) => project.threads).find((thread) => thread.id === id)
|
|
243
|
+
const clearDrag = () => {
|
|
244
|
+
setDraggingThreadId(null)
|
|
245
|
+
setDragOverProjectId(null)
|
|
246
|
+
}
|
|
247
|
+
const commitThreadRename = async () => {
|
|
248
|
+
if (!renamingThread) return
|
|
249
|
+
const pending = renamingThread
|
|
250
|
+
const value = pending.value.trim()
|
|
251
|
+
setRenamingThread(null)
|
|
252
|
+
if (!value) return
|
|
253
|
+
try {
|
|
254
|
+
await props.onRenameThread(pending.id, value)
|
|
255
|
+
} catch {
|
|
256
|
+
setRenamingThread(pending)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const commitProjectRename = async () => {
|
|
260
|
+
if (!renamingProject) return
|
|
261
|
+
const pending = renamingProject
|
|
262
|
+
const value = pending.value.trim()
|
|
263
|
+
setRenamingProject(null)
|
|
264
|
+
if (!value) return
|
|
265
|
+
try {
|
|
266
|
+
await props.onRenameProject(pending.id, value)
|
|
267
|
+
} catch {
|
|
268
|
+
setRenamingProject(pending)
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<SidebarShell
|
|
274
|
+
collapsed={props.collapsed}
|
|
275
|
+
onCollapsedChange={props.onCollapsedChange}
|
|
276
|
+
width={props.width}
|
|
277
|
+
onWidthChange={props.onWidthChange}
|
|
278
|
+
minWidth={180}
|
|
279
|
+
maxWidth={400}
|
|
280
|
+
platform={props.platform}
|
|
281
|
+
fullscreen={props.fullscreen}
|
|
282
|
+
collapsedWidth={props.collapsedWidth}
|
|
283
|
+
>
|
|
284
|
+
{/* R2:折叠态本栏整块不渲染(windows 收成 0 宽、其余平台收成只剩顶行的 rail),
|
|
285
|
+
原来这里那枚 `collapsed ? <OrbitworkMark 28/>` 的折叠分支已成死码——rail 宽
|
|
286
|
+
(mac 116 = 8+68+4+28+8 / 其余 44 = 8+28+8)被让位块与折叠钮占满,塞不下 mark,
|
|
287
|
+
故整条删除,栏内只留展开态的 lockup。 */}
|
|
288
|
+
<div className="owbrand">
|
|
289
|
+
<OrbitworkLockup theme="auto" size={20} />
|
|
290
|
+
</div>
|
|
291
|
+
<nav className="ownav">
|
|
292
|
+
{/* R2 · L1-2-1:四枚导航字形逐点照原型(模板 687/692/696/700)——原来是
|
|
293
|
+
NewTask(方框带笔)/ Compass(指南针)/ Globe(地球),与原型对不上,
|
|
294
|
+
且那三枚不带 `.dot` 零件,所以「当前项点亮信标点」这条规则在三屏上空转。
|
|
295
|
+
换成信标化字形后点随字形自带:ThreadDot=tasks · PanelSidebar=workspace ·
|
|
296
|
+
Clock=schedule 三枚有点,Package(插件)按原型 NAV 表 dot:false 无点。 */}
|
|
297
|
+
<NavItem
|
|
298
|
+
id="new"
|
|
299
|
+
label="新任务"
|
|
300
|
+
title={props.newTaskTitle}
|
|
301
|
+
active={props.activeNav === "new"}
|
|
302
|
+
icon={<ThreadDot />}
|
|
303
|
+
onClick={() => props.onNewTask()}
|
|
304
|
+
/>
|
|
305
|
+
{/* A3-B5 命名统一(原型 693/697):「发现」→「插件」、「站点」→「工作台」。
|
|
306
|
+
路由 id(skills / sites)不动,只换面上的字;埋点键 R2 · L3-3-6 起改名
|
|
307
|
+
(discover→plugins、workspace→workbench),见 NavItem 里的锚点注。 */}
|
|
308
|
+
<NavItem
|
|
309
|
+
id="skills"
|
|
310
|
+
label="插件"
|
|
311
|
+
title="插件"
|
|
312
|
+
active={props.activeNav === "skills"}
|
|
313
|
+
icon={<Package />}
|
|
314
|
+
onClick={() => props.onNavigate("skills")}
|
|
315
|
+
/>
|
|
316
|
+
<NavItem
|
|
317
|
+
id="sites"
|
|
318
|
+
label="工作台"
|
|
319
|
+
title="工作台"
|
|
320
|
+
active={props.activeNav === "sites"}
|
|
321
|
+
icon={<PanelSidebar />}
|
|
322
|
+
onClick={() => props.onNavigate("sites")}
|
|
323
|
+
/>
|
|
324
|
+
<NavItem
|
|
325
|
+
id="cron"
|
|
326
|
+
label="定时任务"
|
|
327
|
+
title="定时任务"
|
|
328
|
+
active={props.activeNav === "cron"}
|
|
329
|
+
icon={<Clock />}
|
|
330
|
+
onClick={() => props.onNavigate("cron")}
|
|
331
|
+
/>
|
|
332
|
+
{/* A11-B1:默认不出(showWorkspaceNav 缺省 false),导航长成四项。
|
|
333
|
+
R2 · L1-2-1:workspace 那枚信标字形(PanelSidebar)已归给「工作台」——
|
|
334
|
+
原型里带信标点的 rect 就是工作台那一位;退役中的「我的空间」改用中性 Grid,
|
|
335
|
+
免得开关打开时同一列出现两枚一模一样的图标。
|
|
336
|
+
R2 · L3-3-6:`workspace` 这个引导锚点也随之移交工作台(改名 `workbench`),
|
|
337
|
+
本项不再挂锚点。删除条件见 showWorkspaceNav 的文档注释。 */}
|
|
338
|
+
{props.showWorkspaceNav && (
|
|
339
|
+
<NavItem
|
|
340
|
+
id="files"
|
|
341
|
+
label="我的空间"
|
|
342
|
+
title="我的空间"
|
|
343
|
+
active={props.activeNav === "files"}
|
|
344
|
+
icon={<Grid />}
|
|
345
|
+
onClick={() => props.onNavigate("files")}
|
|
346
|
+
/>
|
|
347
|
+
)}
|
|
348
|
+
</nav>
|
|
349
|
+
|
|
350
|
+
<div className="owrecent-head" data-tour-anchor="projects">
|
|
351
|
+
<div className="t">项目</div>
|
|
352
|
+
<div className="owrecent-actions">
|
|
353
|
+
<Button
|
|
354
|
+
variant="unstyled"
|
|
355
|
+
title="更多项目操作"
|
|
356
|
+
aria-label="更多项目操作"
|
|
357
|
+
onClick={(event) => {
|
|
358
|
+
event.stopPropagation()
|
|
359
|
+
const rect = event.currentTarget.getBoundingClientRect()
|
|
360
|
+
setProjectsMenu({ left: rect.right + 6, top: rect.top })
|
|
361
|
+
}}
|
|
362
|
+
>
|
|
363
|
+
<More />
|
|
364
|
+
</Button>
|
|
365
|
+
<Button variant="unstyled" title="新建项目" aria-label="新建项目" onClick={() => setCreatingProject(true)}>
|
|
366
|
+
<Plus />
|
|
367
|
+
</Button>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
<div className="owprojects">
|
|
371
|
+
{projects.map((project) => (
|
|
372
|
+
<div key={project.id} className="owproject">
|
|
373
|
+
{renamingProject?.id === project.id ? (
|
|
374
|
+
<div className="owproject__head renaming">
|
|
375
|
+
<Folder className="project-icon" />
|
|
376
|
+
<TextField
|
|
377
|
+
unstyled
|
|
378
|
+
autoFocus
|
|
379
|
+
value={renamingProject.value}
|
|
380
|
+
onChange={(event) => setRenamingProject({ id: project.id, value: event.target.value })}
|
|
381
|
+
onBlur={() => {
|
|
382
|
+
void commitProjectRename()
|
|
383
|
+
}}
|
|
384
|
+
onCompositionStart={onCompositionStart}
|
|
385
|
+
onCompositionEnd={onCompositionEnd}
|
|
386
|
+
onKeyDown={(event) => {
|
|
387
|
+
if (isImeEnter(event)) return
|
|
388
|
+
if (event.key === "Enter") void commitProjectRename()
|
|
389
|
+
if (event.key === "Escape") setRenamingProject(null)
|
|
390
|
+
}}
|
|
391
|
+
/>
|
|
392
|
+
</div>
|
|
393
|
+
) : (
|
|
394
|
+
/* DS2 P6-2 口径(同底部账户区 .owuser):行壳只管布局与拖放,行内两枚按钮各拿一个焦点位。
|
|
395
|
+
原来整行是 <Button>,「更多」是它里面的 <span onClick>——键盘够不到,且可点元素套可点元素。 */
|
|
396
|
+
<div
|
|
397
|
+
className={`owproject__head${project.open ? "" : " collapsed"}${dragOverProjectId === project.id ? " drop-target" : ""}`}
|
|
398
|
+
onDragOver={(event) => {
|
|
399
|
+
if (!draggingThreadId) return
|
|
400
|
+
event.preventDefault()
|
|
401
|
+
event.dataTransfer.dropEffect = "move"
|
|
402
|
+
setDragOverProjectId(project.id)
|
|
403
|
+
}}
|
|
404
|
+
onDragLeave={(event) => {
|
|
405
|
+
const related = event.relatedTarget
|
|
406
|
+
if (related instanceof Node && event.currentTarget.contains(related)) return
|
|
407
|
+
setDragOverProjectId((current) => (current === project.id ? null : current))
|
|
408
|
+
}}
|
|
409
|
+
onDrop={(event) => {
|
|
410
|
+
event.preventDefault()
|
|
411
|
+
const threadId = event.dataTransfer.getData("application/x-owthread-id") || draggingThreadId
|
|
412
|
+
clearDrag()
|
|
413
|
+
if (threadId) void props.onMoveThread(threadId, project.id).catch(() => undefined)
|
|
414
|
+
}}
|
|
415
|
+
>
|
|
416
|
+
<Button
|
|
417
|
+
variant="unstyled"
|
|
418
|
+
className="owproject__head-main"
|
|
419
|
+
title={project.label}
|
|
420
|
+
aria-expanded={project.open}
|
|
421
|
+
onClick={() => props.onToggleProject(project.id)}
|
|
422
|
+
>
|
|
423
|
+
{/* R2 · L1-1-2:披露箭头在**行首**(原型模板 L714–720 是
|
|
424
|
+
「chev 14 → folder 16 → 名」,行尾什么都没有)。原来它挂在行尾,
|
|
425
|
+
读起来像行末的一枚操作钮,而不是「这一行能展开」。
|
|
426
|
+
展开 ChevDown / 折叠 ChevRight——原来靠一枚 ChevDown 转 -90°,
|
|
427
|
+
现在两枚字形各画各的,与原型逐点一致。 */}
|
|
428
|
+
{project.open ? <ChevDown className="caret" /> : <ChevRight className="caret" />}
|
|
429
|
+
<Folder className="project-icon" />
|
|
430
|
+
<span className="lbl">{project.label}</span>
|
|
431
|
+
</Button>
|
|
432
|
+
<Button
|
|
433
|
+
variant="unstyled"
|
|
434
|
+
className="more"
|
|
435
|
+
title="项目操作"
|
|
436
|
+
aria-label={`${project.label} 的项目操作`}
|
|
437
|
+
aria-haspopup="menu"
|
|
438
|
+
onClick={(event) => {
|
|
439
|
+
event.stopPropagation()
|
|
440
|
+
const rect = event.currentTarget.getBoundingClientRect()
|
|
441
|
+
setThreadMenu(null)
|
|
442
|
+
setProjectMenu({
|
|
443
|
+
id: project.id,
|
|
444
|
+
label: project.label,
|
|
445
|
+
isDefault: project.isDefault,
|
|
446
|
+
left: rect.right + 6,
|
|
447
|
+
top: rect.top,
|
|
448
|
+
})
|
|
449
|
+
}}
|
|
450
|
+
>
|
|
451
|
+
<More />
|
|
452
|
+
</Button>
|
|
453
|
+
</div>
|
|
454
|
+
)}
|
|
455
|
+
{project.open && (
|
|
456
|
+
<div className="owthreads">
|
|
457
|
+
{project.threads.map((thread) =>
|
|
458
|
+
renamingThread?.id === thread.id ? (
|
|
459
|
+
<div key={thread.id} className="owthread renaming">
|
|
460
|
+
<TextField
|
|
461
|
+
unstyled
|
|
462
|
+
autoFocus
|
|
463
|
+
value={renamingThread.value}
|
|
464
|
+
onChange={(event) => setRenamingThread({ id: thread.id, value: event.target.value })}
|
|
465
|
+
onBlur={() => {
|
|
466
|
+
void commitThreadRename()
|
|
467
|
+
}}
|
|
468
|
+
onCompositionStart={onCompositionStart}
|
|
469
|
+
onCompositionEnd={onCompositionEnd}
|
|
470
|
+
onKeyDown={(event) => {
|
|
471
|
+
if (isImeEnter(event)) return
|
|
472
|
+
if (event.key === "Enter") void commitThreadRename()
|
|
473
|
+
if (event.key === "Escape") setRenamingThread(null)
|
|
474
|
+
}}
|
|
475
|
+
/>
|
|
476
|
+
</div>
|
|
477
|
+
) : (
|
|
478
|
+
/* DS2 P6-2 口径(同 .owuser / .owproject__head):行壳只管布局与拖放,
|
|
479
|
+
行主体与行尾「更多」各是一枚真按钮,键盘都够得到。 */
|
|
480
|
+
<div
|
|
481
|
+
key={thread.id}
|
|
482
|
+
className={`owthread${thread.active ? " active" : ""}${draggingThreadId === thread.id ? " dragging" : ""}`}
|
|
483
|
+
draggable={!thread.running}
|
|
484
|
+
onDragStart={(event) => {
|
|
485
|
+
if (thread.running) return
|
|
486
|
+
setDraggingThreadId(thread.id)
|
|
487
|
+
event.dataTransfer.effectAllowed = "move"
|
|
488
|
+
event.dataTransfer.setData("application/x-owthread-id", thread.id)
|
|
489
|
+
}}
|
|
490
|
+
onDragEnd={clearDrag}
|
|
491
|
+
>
|
|
492
|
+
<Button
|
|
493
|
+
variant="unstyled"
|
|
494
|
+
className="owthread__main"
|
|
495
|
+
title={thread.title}
|
|
496
|
+
onClick={() => props.onSelectThread(thread.id)}
|
|
497
|
+
>
|
|
498
|
+
{/* R2 · L1-1-3:未读点在**行首**、运行点在行尾(原型模板 L727–733
|
|
499
|
+
就是这两个位置)。原来两颗点都堆在行尾,只靠颜色区分含义——
|
|
500
|
+
位置本身才是第一编码,颜色只是第二编码(R1)。 */}
|
|
501
|
+
{thread.unread && <span className="dot" title="未读" aria-label="未读" role="img" />}
|
|
502
|
+
<span className="lbl">{thread.title}</span>
|
|
503
|
+
{/* §9 呼吸退役后运行点静止:形(实点的有无)+文字(title/aria-label)
|
|
504
|
+
承担 R1 双编码。 */}
|
|
505
|
+
{thread.running && (
|
|
506
|
+
<span className="run-dot" title="任务正在执行" aria-label="任务正在执行" role="img" />
|
|
507
|
+
)}
|
|
508
|
+
{thread.running && thread.runningCount && (
|
|
509
|
+
<span className="run-cnt" title="任务进度">
|
|
510
|
+
{thread.runningCount}
|
|
511
|
+
</span>
|
|
512
|
+
)}
|
|
513
|
+
</Button>
|
|
514
|
+
<span
|
|
515
|
+
className={`thread-trailing${thread.sourceIcon || thread.branched || thread.archived ? " has-marks" : ""}`}
|
|
516
|
+
>
|
|
517
|
+
<span className="thread-status-marks">
|
|
518
|
+
{thread.sourceIcon && (
|
|
519
|
+
<span
|
|
520
|
+
className="thread-source-mark"
|
|
521
|
+
title={thread.sourceLabel ? `${thread.sourceLabel}会话` : "IM 会话"}
|
|
522
|
+
>
|
|
523
|
+
<Icon name={thread.sourceIcon} size={16} />
|
|
524
|
+
</span>
|
|
525
|
+
)}
|
|
526
|
+
{thread.branched && (
|
|
527
|
+
<span className="thread-branch-mark" title="分支会话">
|
|
528
|
+
<Branch />
|
|
529
|
+
</span>
|
|
530
|
+
)}
|
|
531
|
+
{thread.archived && (
|
|
532
|
+
<span className="thread-archive-mark" title="已归档">
|
|
533
|
+
<Archive />
|
|
534
|
+
</span>
|
|
535
|
+
)}
|
|
536
|
+
</span>
|
|
537
|
+
<Button
|
|
538
|
+
variant="unstyled"
|
|
539
|
+
className="more"
|
|
540
|
+
title="更多"
|
|
541
|
+
aria-label={`${thread.title} 的更多操作`}
|
|
542
|
+
aria-haspopup="menu"
|
|
543
|
+
onClick={(event) => {
|
|
544
|
+
event.stopPropagation()
|
|
545
|
+
const rect = event.currentTarget.getBoundingClientRect()
|
|
546
|
+
setProjectMenu(null)
|
|
547
|
+
setThreadMenu({ id: thread.id, left: rect.right + 6, top: rect.top })
|
|
548
|
+
}}
|
|
549
|
+
>
|
|
550
|
+
<More />
|
|
551
|
+
</Button>
|
|
552
|
+
</span>
|
|
553
|
+
</div>
|
|
554
|
+
),
|
|
555
|
+
)}
|
|
556
|
+
{project.threads.length === 0 && (
|
|
557
|
+
<Button variant="unstyled" className="owthread-new" onClick={() => props.onNewTask(project.id)}>
|
|
558
|
+
<Plus /> 新建任务
|
|
559
|
+
</Button>
|
|
560
|
+
)}
|
|
561
|
+
{project.canLoadMore && (
|
|
562
|
+
<Button
|
|
563
|
+
variant="unstyled"
|
|
564
|
+
className={`owthread-more${project.loadError ? " error" : ""}`}
|
|
565
|
+
disabled={project.loadingMore}
|
|
566
|
+
onClick={() => props.onLoadMore(project.id)}
|
|
567
|
+
>
|
|
568
|
+
{/* R2 · L2-1-1:「展开显示」原来是一行没有图标、没有 chevron、
|
|
569
|
+
与会话行同缩进同字号的 --ow-text-3 灰字(浅档 2.29:1),读起来像
|
|
570
|
+
一条被禁用的会话。补一枚 14 的 ChevDown 前置图标(与同族
|
|
571
|
+
.owthread-new 的 Plus 同语法),让它读成动作;字色并轨见 CSS。 */}
|
|
572
|
+
<ChevDown className="lead" aria-hidden="true" />
|
|
573
|
+
{project.loadingMore ? "加载中…" : project.loadError ? "加载失败,点击重试" : "展开显示"}
|
|
574
|
+
</Button>
|
|
575
|
+
)}
|
|
576
|
+
</div>
|
|
577
|
+
)}
|
|
578
|
+
</div>
|
|
579
|
+
))}
|
|
580
|
+
</div>
|
|
581
|
+
|
|
582
|
+
{projectsMenu && (
|
|
583
|
+
<FloatingMenu anchor={projectsMenu}>
|
|
584
|
+
<MenuSurface
|
|
585
|
+
width={168}
|
|
586
|
+
autoAdjust
|
|
587
|
+
items={[
|
|
588
|
+
{ key: "refresh", label: "刷新", icon: <Refresh /> },
|
|
589
|
+
{ key: "archived", label: props.showArchived ? "隐藏已归档" : "显示已归档", icon: <Archive /> },
|
|
590
|
+
]}
|
|
591
|
+
onSelect={(key) => {
|
|
592
|
+
setProjectsMenu(null)
|
|
593
|
+
if (key === "refresh") props.onRefreshProjects()
|
|
594
|
+
if (key === "archived") props.onShowArchivedChange(!props.showArchived)
|
|
595
|
+
}}
|
|
596
|
+
/>
|
|
597
|
+
</FloatingMenu>
|
|
598
|
+
)}
|
|
599
|
+
{threadMenu && (
|
|
600
|
+
<FloatingMenu anchor={threadMenu}>
|
|
601
|
+
<MenuSurface
|
|
602
|
+
width={160}
|
|
603
|
+
autoAdjust
|
|
604
|
+
items={[
|
|
605
|
+
{
|
|
606
|
+
key: "rename",
|
|
607
|
+
label: "重命名",
|
|
608
|
+
icon: <Edit />,
|
|
609
|
+
disabled: Boolean(threadById(threadMenu.id)?.archived),
|
|
610
|
+
},
|
|
611
|
+
{ key: "share", label: "分享", icon: <Share /> },
|
|
612
|
+
{
|
|
613
|
+
key: "move",
|
|
614
|
+
label: "移动",
|
|
615
|
+
icon: <Folder />,
|
|
616
|
+
disabled: Boolean(threadById(threadMenu.id)?.running || threadById(threadMenu.id)?.archived),
|
|
617
|
+
},
|
|
618
|
+
...(!threadById(threadMenu.id)?.archived
|
|
619
|
+
? ([
|
|
620
|
+
{
|
|
621
|
+
key: "archive",
|
|
622
|
+
label: "归档",
|
|
623
|
+
icon: <Archive />,
|
|
624
|
+
disabled: threadById(threadMenu.id)?.canArchive === false,
|
|
625
|
+
},
|
|
626
|
+
] as MenuItem[])
|
|
627
|
+
: []),
|
|
628
|
+
{ key: "delete", label: "删除", icon: <Trash />, danger: true },
|
|
629
|
+
]}
|
|
630
|
+
onSelect={(key) => {
|
|
631
|
+
const thread = threadById(threadMenu.id)
|
|
632
|
+
setThreadMenu(null)
|
|
633
|
+
if (!thread) return
|
|
634
|
+
if (key === "rename") setRenamingThread({ id: thread.id, value: thread.title })
|
|
635
|
+
if (key === "share") props.onShareThread(thread.id)
|
|
636
|
+
if (key === "move") setPendingMove(thread)
|
|
637
|
+
if (key === "archive") void props.onArchiveThread(thread.id).catch(() => undefined)
|
|
638
|
+
if (key === "delete") setPendingThreadDelete(thread)
|
|
639
|
+
}}
|
|
640
|
+
/>
|
|
641
|
+
</FloatingMenu>
|
|
642
|
+
)}
|
|
643
|
+
{projectMenu && (
|
|
644
|
+
<FloatingMenu anchor={projectMenu}>
|
|
645
|
+
<MenuSurface
|
|
646
|
+
width={160}
|
|
647
|
+
autoAdjust
|
|
648
|
+
items={projectMenuItems(projectMenu.isDefault)}
|
|
649
|
+
onSelect={(key) => {
|
|
650
|
+
const project = projects.find((item) => item.id === projectMenu.id)
|
|
651
|
+
setProjectMenu(null)
|
|
652
|
+
if (!project) return
|
|
653
|
+
if (key === "new-task") props.onNewTask(project.id)
|
|
654
|
+
if (key === "open-dir") props.onOpenProjectDirectory(project.id)
|
|
655
|
+
if (key === "rename") setRenamingProject({ id: project.id, value: project.label })
|
|
656
|
+
if (key === "delete") setPendingProjectDelete(project)
|
|
657
|
+
}}
|
|
658
|
+
/>
|
|
659
|
+
</FloatingMenu>
|
|
660
|
+
)}
|
|
661
|
+
|
|
662
|
+
{/* DS2 P6-2:底部账户区归 ListRow 语法。原来整行是 <div onClick>,键盘完全够不到,
|
|
663
|
+
且更新胶囊是它内部的 <button>(button 套 button)。按 ListRow 的焦点口径拆开:
|
|
664
|
+
行壳只管布局(.owuser 这个类名同时是 electron-shell.css 的拖拽豁免契约,保留),
|
|
665
|
+
左侧「头像+名字」升为按钮拿一个焦点位,右侧更新胶囊自己是第二个焦点位。 */}
|
|
666
|
+
<div className="owuser">
|
|
667
|
+
<Button
|
|
668
|
+
ref={userMenuTrigger}
|
|
669
|
+
variant="unstyled"
|
|
670
|
+
className="owuser__main"
|
|
671
|
+
aria-haspopup="menu"
|
|
672
|
+
aria-expanded={Boolean(userMenu)}
|
|
673
|
+
title={props.user.name}
|
|
674
|
+
onClick={(event) => {
|
|
675
|
+
event.stopPropagation()
|
|
676
|
+
if (userMenu) return setUserMenu(null)
|
|
677
|
+
const rect = event.currentTarget.getBoundingClientRect()
|
|
678
|
+
// Enter/Space 触发的 click detail=0 → 键盘打开,焦点进首行;指针打开只落面本体(R3)
|
|
679
|
+
setUserMenu({ left: rect.left, top: rect.top, byKeyboard: event.detail === 0 })
|
|
680
|
+
}}
|
|
681
|
+
>
|
|
682
|
+
{/* R2 · L1-1-4 / L2-1-5:无图时原来是一枚与侧栏底几乎同色的空灰圆
|
|
683
|
+
(#EFEEE9 on #F7F6F1);原型 L743 是带首字的 --ow-data-1 实心圆。
|
|
684
|
+
改走 `primitives/Avatar`——它自带 id→data-1..6 的稳定取模与首字回落,
|
|
685
|
+
和账户菜单头部那枚 32 头像同一套实现。行结构(26 头像+名+chevron)不动,
|
|
686
|
+
类名 `av` 保留(CSS 与 electron-shell 的拖拽豁免都按它认)。 */}
|
|
687
|
+
<Avatar className="av" size={26} id={props.user.id ?? props.user.name}>
|
|
688
|
+
{props.user.avatarUrl ? (
|
|
689
|
+
<img
|
|
690
|
+
src={props.user.avatarUrl}
|
|
691
|
+
alt=""
|
|
692
|
+
className="w-full h-full object-cover"
|
|
693
|
+
onError={(event) => event.currentTarget.remove()}
|
|
694
|
+
/>
|
|
695
|
+
) : (
|
|
696
|
+
props.user.name.slice(-1)
|
|
697
|
+
)}
|
|
698
|
+
</Avatar>
|
|
699
|
+
<span className="name">{props.user.name}</span>
|
|
700
|
+
{!props.update && <ChevRight className="chev" />}
|
|
701
|
+
</Button>
|
|
702
|
+
{props.update && (
|
|
703
|
+
<SidebarUpdateButton
|
|
704
|
+
update={props.update}
|
|
705
|
+
onClick={() => {
|
|
706
|
+
if (props.update?.state === "ready") setShowInstallUpdate(true)
|
|
707
|
+
else if (props.update?.state !== "downloading") props.onUpdateClick?.()
|
|
708
|
+
}}
|
|
709
|
+
/>
|
|
710
|
+
)}
|
|
711
|
+
</div>
|
|
712
|
+
|
|
713
|
+
{userMenu &&
|
|
714
|
+
createPortal(
|
|
715
|
+
<>
|
|
716
|
+
<div
|
|
717
|
+
className="owusermenu-backdrop"
|
|
718
|
+
onClick={(event) => {
|
|
719
|
+
event.stopPropagation()
|
|
720
|
+
setUserMenu(null)
|
|
721
|
+
}}
|
|
722
|
+
/>
|
|
723
|
+
{/* DS2 P6-2:账户菜单收敛到 primitives/Menu 的 MenuSurface(与本文件另外三处菜单同基座)。
|
|
724
|
+
手写的 .mi 行原来 :hover 走全局 --ow-surface 档——弹层上该走 -pop 档,正是 §14
|
|
725
|
+
已知坑「暗主题弹层用全局 hover 档」;MenuSurface 自带 hover-pop/press-pop、
|
|
726
|
+
focus-visible、danger 的 error-tint 与键盘导航。.owusermenu 只剩定位+no-drag 壳。
|
|
727
|
+
R2(Terry 意见 4):面体整块搬进 `DesktopAccountMenuView`(280 宽,头部+套餐井
|
|
728
|
+
+七行常用能力),本文件只留「在哪儿弹、几时关」。宽度 179→280:Home 画框实测
|
|
729
|
+
left=38,38+280=318,离 240 侧栏右沿外仍在视口内,不会越出。 */}
|
|
730
|
+
<div
|
|
731
|
+
className="owusermenu"
|
|
732
|
+
style={{ position: "fixed", left: userMenu.left, bottom: window.innerHeight - userMenu.top + 8 }}
|
|
733
|
+
onClick={(event) => event.stopPropagation()}
|
|
734
|
+
>
|
|
735
|
+
<DesktopAccountMenuView
|
|
736
|
+
user={props.user}
|
|
737
|
+
plan={props.plan}
|
|
738
|
+
credits={props.credits}
|
|
739
|
+
version={props.version}
|
|
740
|
+
update={props.update}
|
|
741
|
+
theme={props.theme}
|
|
742
|
+
onThemeChange={props.onThemeChange}
|
|
743
|
+
petVisible={props.petVisible}
|
|
744
|
+
onPetVisibleChange={props.onPetVisibleChange}
|
|
745
|
+
onOpenSettings={props.onOpenSettings}
|
|
746
|
+
onOpenMemory={props.onOpenMemory}
|
|
747
|
+
onCopyUserId={props.onCopyUserId}
|
|
748
|
+
/* R2 核对修(T4):菜单「检查更新」行与账户行的更新胶囊说的是同一件事,
|
|
749
|
+
点下去也得走同一条路——原来一律 `onCheckUpdate ?? onUpdateClick`,
|
|
750
|
+
「重启安装」态点了却去 downloadUpdate(宿主 Sidebar.tsx:324 的 onUpdateClick),
|
|
751
|
+
与行尾文字说的事对不上。按胶囊的分支:ready → 安装确认弹窗(再走 onInstallUpdate);
|
|
752
|
+
downloading → 行已 disabled,这里只兜底;available / error → onUpdateClick(下载 / 重试);
|
|
753
|
+
没有已知更新 → onCheckUpdate(宿主的「检查更新」),未接线时回落 onUpdateClick。 */
|
|
754
|
+
onCheckUpdate={() => {
|
|
755
|
+
const state = props.update?.state
|
|
756
|
+
if (state === "ready") return setShowInstallUpdate(true)
|
|
757
|
+
if (state === "downloading") return
|
|
758
|
+
if (props.update) return props.onUpdateClick?.()
|
|
759
|
+
; (props.onCheckUpdate ?? props.onUpdateClick)?.()
|
|
760
|
+
}}
|
|
761
|
+
onFeedback={props.onFeedback}
|
|
762
|
+
onLogout={props.onLogout}
|
|
763
|
+
autoFocus={userMenu.byKeyboard ? true : "surface"}
|
|
764
|
+
onClose={() => closeUserMenu(true)}
|
|
765
|
+
/>
|
|
766
|
+
</div>
|
|
767
|
+
</>,
|
|
768
|
+
document.body,
|
|
769
|
+
)}
|
|
770
|
+
{pendingThreadDelete && (
|
|
771
|
+
<ConfirmDialog
|
|
772
|
+
title="删除任务"
|
|
773
|
+
description={`确定要删除「${pendingThreadDelete.title}」吗?该任务的对话将被移除,此操作无法撤销。`}
|
|
774
|
+
onCancel={() => setPendingThreadDelete(null)}
|
|
775
|
+
onConfirm={() => {
|
|
776
|
+
const id = pendingThreadDelete.id
|
|
777
|
+
void props
|
|
778
|
+
.onDeleteThread(id)
|
|
779
|
+
.then(() => setPendingThreadDelete(null))
|
|
780
|
+
.catch(() => undefined)
|
|
781
|
+
}}
|
|
782
|
+
/>
|
|
783
|
+
)}
|
|
784
|
+
{pendingProjectDelete && (
|
|
785
|
+
<ConfirmDialog
|
|
786
|
+
title="删除项目"
|
|
787
|
+
description={`确定要删除项目「${pendingProjectDelete.label}」吗?项目下的任务将不再显示,但本地工作目录中的文件会保留。`}
|
|
788
|
+
pending={deletingProject}
|
|
789
|
+
pendingLabel="删除中…"
|
|
790
|
+
onCancel={() => setPendingProjectDelete(null)}
|
|
791
|
+
onConfirm={() => {
|
|
792
|
+
setDeletingProject(true)
|
|
793
|
+
void props
|
|
794
|
+
.onDeleteProject(pendingProjectDelete.id)
|
|
795
|
+
.then(() => setPendingProjectDelete(null))
|
|
796
|
+
.catch(() => undefined)
|
|
797
|
+
.finally(() => setDeletingProject(false))
|
|
798
|
+
}}
|
|
799
|
+
/>
|
|
800
|
+
)}
|
|
801
|
+
{showInstallUpdate && props.update?.state === "ready" && (
|
|
802
|
+
<UpdateInstallDialog
|
|
803
|
+
version={props.update.version}
|
|
804
|
+
pending={installingUpdate}
|
|
805
|
+
onCancel={() => setShowInstallUpdate(false)}
|
|
806
|
+
onConfirm={() => {
|
|
807
|
+
setInstallingUpdate(true)
|
|
808
|
+
Promise.resolve()
|
|
809
|
+
.then(() => props.onInstallUpdate?.())
|
|
810
|
+
.catch(() => setInstallingUpdate(false))
|
|
811
|
+
}}
|
|
812
|
+
/>
|
|
813
|
+
)}
|
|
814
|
+
{creatingProject &&
|
|
815
|
+
createPortal(
|
|
816
|
+
<CreateProjectDialog
|
|
817
|
+
onCancel={() => setCreatingProject(false)}
|
|
818
|
+
onSubmit={(name) => props.onCreateProject(name).then(() => setCreatingProject(false))}
|
|
819
|
+
/>,
|
|
820
|
+
document.body,
|
|
821
|
+
)}
|
|
822
|
+
{/* MoveThreadDialog 内部已走 composite/Dialog(自带 portal),此处不再套一层 createPortal。 */}
|
|
823
|
+
{pendingMove && (
|
|
824
|
+
<MoveThreadDialog
|
|
825
|
+
thread={pendingMove}
|
|
826
|
+
projects={projects}
|
|
827
|
+
onCreateProject={props.onCreateProjectForSelection}
|
|
828
|
+
onCancel={() => setPendingMove(null)}
|
|
829
|
+
onSubmit={(projectId) => props.onMoveThread(pendingMove.id, projectId).then(() => setPendingMove(null))}
|
|
830
|
+
/>
|
|
831
|
+
)}
|
|
832
|
+
</SidebarShell>
|
|
833
|
+
)
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function SidebarUpdateButton({
|
|
837
|
+
update,
|
|
838
|
+
onClick,
|
|
839
|
+
}: { update: DesktopSidebarUpdate; onClick: () => void }): React.ReactElement {
|
|
840
|
+
const percent = Math.round(Math.max(0, Math.min(100, update.percent ?? 0)))
|
|
841
|
+
/* 胶囊不是实心按钮:状态点 + 按态换字,状态说明走 title(与账户菜单「检查更新」行
|
|
842
|
+
同一份 updateRowText)。下载完(ready)点它的动作是重启安装,字还写「更新」会把
|
|
843
|
+
用户骗去等一个不会来的「更新中」——ready 直书「重启安装」;其余态「更新」不变。
|
|
844
|
+
下载中附百分比,点按行为由宿主按态分发。 */
|
|
845
|
+
const { title } = updateRowText(update)
|
|
846
|
+
const label = update.state === "ready" ? "重启安装" : "更新"
|
|
847
|
+
return (
|
|
848
|
+
<button
|
|
849
|
+
type="button"
|
|
850
|
+
className={`owuser-update ${update.state}`}
|
|
851
|
+
title={title}
|
|
852
|
+
aria-label={title}
|
|
853
|
+
disabled={update.state === "downloading"}
|
|
854
|
+
onClick={(event) => {
|
|
855
|
+
event.stopPropagation()
|
|
856
|
+
onClick()
|
|
857
|
+
}}
|
|
858
|
+
>
|
|
859
|
+
<i className="owuser-update-dot" aria-hidden="true" />
|
|
860
|
+
<span>{label}</span>
|
|
861
|
+
{update.state === "downloading" && <em>{percent}%</em>}
|
|
862
|
+
</button>
|
|
863
|
+
)
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
function NavItem({
|
|
867
|
+
id,
|
|
868
|
+
label,
|
|
869
|
+
title,
|
|
870
|
+
active,
|
|
871
|
+
icon,
|
|
872
|
+
onClick,
|
|
873
|
+
}: {
|
|
874
|
+
id: DesktopSidebarNavId
|
|
875
|
+
label: string
|
|
876
|
+
title: string
|
|
877
|
+
active?: boolean
|
|
878
|
+
icon: React.ReactNode
|
|
879
|
+
onClick: () => void
|
|
880
|
+
}): React.ReactElement {
|
|
881
|
+
return (
|
|
882
|
+
<Button
|
|
883
|
+
variant="unstyled"
|
|
884
|
+
className={`ownavitem${active ? " active" : ""}`}
|
|
885
|
+
/* R2 · L1-1-1:当前项除了 `.active` 类还要出 `aria-current="page"`——原型模板
|
|
886
|
+
L687 每个导航钮都写着 `aria-current="{{ navCurN }}"`,我们只画了底色,
|
|
887
|
+
读屏用户听不出「你在哪一屏」。 */
|
|
888
|
+
aria-current={active ? "page" : undefined}
|
|
889
|
+
/* R2 · L3-3-6 锚点契约(与 DesktopOnboardingTourView 件头注同一份):
|
|
890
|
+
new-task / projects / plugins / workbench / composer。
|
|
891
|
+
原来只映射三枚,工作台(id="sites")根本没有锚点,而「我的空间」(id="files")
|
|
892
|
+
缺省不渲染 → `workspace` 锚点也不存在,宿主 `stepsForAvailableAnchors` 便把
|
|
893
|
+
五步静默砍成三步。旧键 discover / workspace 一并改名,宿主步表同批改,见交接单。 */
|
|
894
|
+
data-tour-anchor={
|
|
895
|
+
id === "new" ? "new-task" : id === "skills" ? "plugins" : id === "sites" ? "workbench" : undefined
|
|
896
|
+
}
|
|
897
|
+
onClick={onClick}
|
|
898
|
+
title={title}
|
|
899
|
+
>
|
|
900
|
+
{icon}
|
|
901
|
+
<span className="lbl">{label}</span>
|
|
902
|
+
</Button>
|
|
903
|
+
)
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function FloatingMenu({
|
|
907
|
+
anchor,
|
|
908
|
+
children,
|
|
909
|
+
}: { anchor: { left: number; top: number }; children: React.ReactNode }): React.ReactElement {
|
|
910
|
+
return (
|
|
911
|
+
<div
|
|
912
|
+
style={{ position: "fixed", left: anchor.left, top: anchor.top, zIndex: 1000 }}
|
|
913
|
+
onClick={(event) => event.stopPropagation()}
|
|
914
|
+
>
|
|
915
|
+
{children}
|
|
916
|
+
</div>
|
|
917
|
+
)
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function projectMenuItems(isDefault: boolean): MenuItem[] {
|
|
921
|
+
return [
|
|
922
|
+
{ key: "new-task", label: "新建任务", icon: <Plus /> },
|
|
923
|
+
{ key: "open-dir", label: "打开项目目录", icon: <Folder /> },
|
|
924
|
+
...(!isDefault
|
|
925
|
+
? ([
|
|
926
|
+
{ key: "rename", label: "重命名", icon: <Edit /> },
|
|
927
|
+
{ key: "delete", label: "删除", icon: <Trash />, danger: true },
|
|
928
|
+
] as MenuItem[])
|
|
929
|
+
: []),
|
|
930
|
+
]
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
function ConfirmDialog({
|
|
934
|
+
title,
|
|
935
|
+
description,
|
|
936
|
+
pending = false,
|
|
937
|
+
pendingLabel = "删除中…",
|
|
938
|
+
onCancel,
|
|
939
|
+
onConfirm,
|
|
940
|
+
}: {
|
|
941
|
+
title: string
|
|
942
|
+
description: string
|
|
943
|
+
pending?: boolean
|
|
944
|
+
pendingLabel?: string
|
|
945
|
+
onCancel: () => void
|
|
946
|
+
onConfirm: () => void
|
|
947
|
+
}): React.ReactElement {
|
|
948
|
+
// 归口 composite/Dialog:遮罩 --ow-scrim(无 backdrop-blur)、立面 16 圆角 + --ow-shadow-modal + 1px 边,
|
|
949
|
+
// 头部图标走 danger 变体的 error tint 徽章(8px 行动档,不再是 48px rounded-full 彩底)。
|
|
950
|
+
return (
|
|
951
|
+
<Dialog
|
|
952
|
+
open
|
|
953
|
+
variant="danger"
|
|
954
|
+
icon={<Trash aria-hidden="true" />}
|
|
955
|
+
title={title}
|
|
956
|
+
closable={false}
|
|
957
|
+
closeOnOverlayClick={!pending}
|
|
958
|
+
closeOnEscape={!pending}
|
|
959
|
+
onClose={onCancel}
|
|
960
|
+
actions={
|
|
961
|
+
<>
|
|
962
|
+
<Button variant="secondary" disabled={pending} onClick={onCancel}>
|
|
963
|
+
取消
|
|
964
|
+
</Button>
|
|
965
|
+
<Button variant="danger" disabled={pending} onClick={onConfirm}>
|
|
966
|
+
{pending ? pendingLabel : "删除"}
|
|
967
|
+
</Button>
|
|
968
|
+
</>
|
|
969
|
+
}
|
|
970
|
+
>
|
|
971
|
+
{description}
|
|
972
|
+
</Dialog>
|
|
973
|
+
)
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
function UpdateInstallDialog({
|
|
977
|
+
version,
|
|
978
|
+
pending,
|
|
979
|
+
onCancel,
|
|
980
|
+
onConfirm,
|
|
981
|
+
}: { version: string; pending: boolean; onCancel: () => void; onConfirm: () => void }): React.ReactElement {
|
|
982
|
+
// 归口 composite/Dialog;图标走 plain 裸档(原 bg-ow-primary/10 圆底在暗档是荧黄,会假冒行动极)。
|
|
983
|
+
return (
|
|
984
|
+
<Dialog
|
|
985
|
+
open
|
|
986
|
+
icon={<Refresh aria-hidden="true" />}
|
|
987
|
+
iconTone="plain"
|
|
988
|
+
title="安装更新"
|
|
989
|
+
closable={false}
|
|
990
|
+
closeOnOverlayClick={!pending}
|
|
991
|
+
closeOnEscape={!pending}
|
|
992
|
+
onClose={onCancel}
|
|
993
|
+
actions={
|
|
994
|
+
<>
|
|
995
|
+
<Button variant="secondary" disabled={pending} onClick={onCancel}>
|
|
996
|
+
稍后
|
|
997
|
+
</Button>
|
|
998
|
+
<Button variant="primary" disabled={pending} onClick={onConfirm}>
|
|
999
|
+
{pending ? "正在重启…" : "安装并重启"}
|
|
1000
|
+
</Button>
|
|
1001
|
+
</>
|
|
1002
|
+
}
|
|
1003
|
+
>
|
|
1004
|
+
Orbitwork {version} 已下载完成。安装后应用将自动重启。
|
|
1005
|
+
</Dialog>
|
|
1006
|
+
)
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
function MoveThreadDialog({
|
|
1010
|
+
thread,
|
|
1011
|
+
projects,
|
|
1012
|
+
onCreateProject,
|
|
1013
|
+
onCancel,
|
|
1014
|
+
onSubmit,
|
|
1015
|
+
}: {
|
|
1016
|
+
thread: DesktopSidebarThread
|
|
1017
|
+
projects: DesktopSidebarProject[]
|
|
1018
|
+
onCreateProject?: (name: string) => Promise<string>
|
|
1019
|
+
onCancel: () => void
|
|
1020
|
+
onSubmit: (projectId: string) => Promise<void>
|
|
1021
|
+
}): React.ReactElement {
|
|
1022
|
+
const [selected, setSelected] = useState("")
|
|
1023
|
+
const [submitting, setSubmitting] = useState(false)
|
|
1024
|
+
const [error, setError] = useState<string | null>(null)
|
|
1025
|
+
const submit = () => {
|
|
1026
|
+
if (!selected || submitting) return
|
|
1027
|
+
setSubmitting(true)
|
|
1028
|
+
setError(null)
|
|
1029
|
+
onSubmit(selected)
|
|
1030
|
+
.catch((reason) => setError(reason instanceof Error ? reason.message : "移动失败"))
|
|
1031
|
+
.finally(() => setSubmitting(false))
|
|
1032
|
+
}
|
|
1033
|
+
// 归口 composite/Dialog(原手写 modal-host + backdrop-blur 毛玻璃已下线)。
|
|
1034
|
+
return (
|
|
1035
|
+
<Dialog
|
|
1036
|
+
open
|
|
1037
|
+
title={`移动任务「${thread.title}」`}
|
|
1038
|
+
width={480}
|
|
1039
|
+
closable={false}
|
|
1040
|
+
onClose={onCancel}
|
|
1041
|
+
actions={
|
|
1042
|
+
<>
|
|
1043
|
+
<Button variant="secondary" disabled={submitting} onClick={onCancel}>
|
|
1044
|
+
取消
|
|
1045
|
+
</Button>
|
|
1046
|
+
<Button variant="primary" disabled={!selected || submitting} onClick={submit}>
|
|
1047
|
+
{submitting ? "移动中…" : "确认"}
|
|
1048
|
+
</Button>
|
|
1049
|
+
</>
|
|
1050
|
+
}
|
|
1051
|
+
>
|
|
1052
|
+
<ProjectSelect
|
|
1053
|
+
value={selected}
|
|
1054
|
+
options={projects
|
|
1055
|
+
.filter((project) => project.id !== thread.projectId)
|
|
1056
|
+
.map((project) => ({ value: project.id, label: project.label }))}
|
|
1057
|
+
onChange={setSelected}
|
|
1058
|
+
onCreate={onCreateProject}
|
|
1059
|
+
placeholder="选择目标项目"
|
|
1060
|
+
disabled={submitting}
|
|
1061
|
+
/>
|
|
1062
|
+
{error && (
|
|
1063
|
+
<div
|
|
1064
|
+
data-ow-part="error"
|
|
1065
|
+
className="mt-2 text-ow-error font-normal text-ow-fs-ui leading-[1.4] font-[family-name:var(--ow-font-sans)]"
|
|
1066
|
+
>
|
|
1067
|
+
{error}
|
|
1068
|
+
</div>
|
|
1069
|
+
)}
|
|
1070
|
+
</Dialog>
|
|
1071
|
+
)
|
|
1072
|
+
}
|