@vetta-org/theme-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/package.json +195 -0
- package/src/action-approval/AppearanceActionPickerView.tsx +291 -0
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +69 -0
- package/src/action-approval/AppearancePickerApprovalView.tsx +31 -0
- package/src/action-approval/ApprovalParts.tsx +376 -0
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +138 -0
- package/src/action-approval/BatchTasksExecutionApprovalView.tsx +158 -0
- package/src/action-approval/BatchTasksTaskApprovalView.tsx +152 -0
- package/src/action-approval/GeneralSetExecutionModeApprovalView.tsx +76 -0
- package/src/action-approval/GenericActionApprovalView.tsx +127 -0
- package/src/action-approval/ManageActionApprovalFrameTypes.ts +27 -0
- package/src/action-approval/ManageActionApprovalFrameView.tsx +136 -0
- package/src/action-approval/NavigationOpenApprovalView.tsx +119 -0
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +191 -0
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +113 -0
- package/src/action-approval/SchedulerUpdateApprovalView.tsx +14 -0
- package/src/action-approval/ThemeChangeApprovalView.tsx +30 -0
- package/src/action-approval/WebhookDeleteApprovalView.tsx +56 -0
- package/src/action-approval/WebhookTestApprovalView.tsx +51 -0
- package/src/action-approval/cn.ts +4 -0
- package/src/action-approval/index.ts +88 -0
- package/src/activity/ActivityPanel.tsx +269 -0
- package/src/activity/ActivityPanelFrame.tsx +36 -0
- package/src/activity/BackgroundTasksTabPanelView.tsx +382 -0
- package/src/activity/BatchProgressTabPanelView.tsx +22 -0
- package/src/activity/BrowserPanelView.tsx +169 -0
- package/src/activity/ChatTabPanelView.tsx +36 -0
- package/src/activity/CodePreview.tsx +57 -0
- package/src/activity/DebugTabPanelView.tsx +67 -0
- package/src/activity/FileTabContentView.tsx +46 -0
- package/src/activity/FloatingActivityTabView.tsx +107 -0
- package/src/activity/HtmlPreviewView.tsx +135 -0
- package/src/activity/JourneyPanelView.tsx +327 -0
- package/src/activity/KnowledgeHistoryPanelView.tsx +93 -0
- package/src/activity/MarkdownPreviewView.tsx +217 -0
- package/src/activity/PluginTabPickerView.tsx +182 -0
- package/src/activity/RequestHistorySubTabView.tsx +102 -0
- package/src/activity/ScheduleExecutionTabPanelView.tsx +162 -0
- package/src/activity/TodoTabPanelView.tsx +66 -0
- package/src/activity/ToolCallsSubTabView.tsx +184 -0
- package/src/activity/WorkflowTabPanelView.tsx +129 -0
- package/src/activity/index.ts +110 -0
- package/src/app/AppBackground.tsx +24 -0
- package/src/app/AppBootLoadingView.tsx +51 -0
- package/src/app/RouteContentLoadingView.tsx +20 -0
- package/src/app/index.ts +13 -0
- package/src/app-boot.ts +1 -0
- package/src/app-shell/DefaultPageHeader.tsx +46 -0
- package/src/app-shell/DefaultWindowControls.tsx +32 -0
- package/src/app-shell/PageHeaderActionGroup.tsx +15 -0
- package/src/app-shell/PageHeaderContent.tsx +70 -0
- package/src/app-shell/PageHeaderFrame.tsx +53 -0
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +21 -0
- package/src/app-shell/PageHeaderTitle.tsx +25 -0
- package/src/app-shell/PageHeaderWindowActions.tsx +22 -0
- package/src/app-shell/WindowControlButton.tsx +35 -0
- package/src/app-shell/index.ts +49 -0
- package/src/appearance/BackgroundImageFrame.tsx +57 -0
- package/src/appearance/CenterSliceImageFrame.tsx +64 -0
- package/src/appearance/CornerImageFrame.tsx +63 -0
- package/src/appearance/HorizontalSliceImageFrame.tsx +97 -0
- package/src/appearance/NineSliceImageFrame.tsx +65 -0
- package/src/appearance/ThemeSurface.tsx +91 -0
- package/src/appearance/index.ts +12 -0
- package/src/batch-tasks/BatchProjectArtifactFieldView.tsx +36 -0
- package/src/batch-tasks/BatchProjectDialogView.tsx +61 -0
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +108 -0
- package/src/batch-tasks/BatchProjectGroupView.tsx +77 -0
- package/src/batch-tasks/BatchProjectNameFieldView.tsx +29 -0
- package/src/batch-tasks/BatchProjectNotificationFieldView.tsx +42 -0
- package/src/batch-tasks/BatchProjectRuntimeFieldsView.tsx +67 -0
- package/src/batch-tasks/BatchTaskActionButtonsView.tsx +67 -0
- package/src/batch-tasks/BatchTaskCardView.tsx +142 -0
- package/src/batch-tasks/BatchTaskGridView.tsx +95 -0
- package/src/batch-tasks/BatchTaskListView.tsx +10 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +73 -0
- package/src/batch-tasks/BatchTaskProjectBlockView.tsx +117 -0
- package/src/batch-tasks/BatchTaskProjectHeaderView.tsx +74 -0
- package/src/batch-tasks/BatchTasksPageView.tsx +126 -0
- package/src/batch-tasks/batchTaskUi.tsx +101 -0
- package/src/batch-tasks/index.ts +70 -0
- package/src/batch-tasks/types.ts +120 -0
- package/src/chat/ActionButtonBarView.tsx +45 -0
- package/src/chat/AgentAvatarView.tsx +59 -0
- package/src/chat/AppshotCardView.tsx +89 -0
- package/src/chat/AskUserQuestionView.tsx +177 -0
- package/src/chat/AssistantMessageView.tsx +147 -0
- package/src/chat/AtPanelView.tsx +220 -0
- package/src/chat/BackgroundTasksBadgeView.tsx +28 -0
- package/src/chat/BashTerminalCard.tsx +225 -0
- package/src/chat/ChatExportHostView.tsx +17 -0
- package/src/chat/ChatHeaderActionsView.tsx +75 -0
- package/src/chat/ContextRingView.tsx +100 -0
- package/src/chat/CopyIconButton.tsx +61 -0
- package/src/chat/DefaultGuidingWords.tsx +75 -0
- package/src/chat/DefaultSceneCarousel.tsx +113 -0
- package/src/chat/DefaultSkillBadgeRow.tsx +103 -0
- package/src/chat/DrawerCard.tsx +149 -0
- package/src/chat/EditDiffView.tsx +137 -0
- package/src/chat/ExecutionModeSelectorView.tsx +124 -0
- package/src/chat/ExportMessageListView.tsx +20 -0
- package/src/chat/GuideBadgeSwiperView.tsx +79 -0
- package/src/chat/InlineTokenChip.tsx +68 -0
- package/src/chat/InputActionBarView.tsx +112 -0
- package/src/chat/InputBarBackground.tsx +25 -0
- package/src/chat/InputBarCapsule.tsx +56 -0
- package/src/chat/InputBarContextMenuView.tsx +79 -0
- package/src/chat/InputBarPlaceholder.tsx +84 -0
- package/src/chat/InputBarToolbarButton.tsx +42 -0
- package/src/chat/KnowledgeToolViews.tsx +119 -0
- package/src/chat/LiveThinkingView.tsx +102 -0
- package/src/chat/MessageActions.tsx +109 -0
- package/src/chat/MessageBlockSegmentsView.tsx +203 -0
- package/src/chat/MessageBoundaryViews.tsx +93 -0
- package/src/chat/MessageCardsView.tsx +126 -0
- package/src/chat/MessageFeedContext.tsx +14 -0
- package/src/chat/MessageFeedLayoutView.tsx +97 -0
- package/src/chat/MessageFeedView.tsx +228 -0
- package/src/chat/MessageInputView.tsx +193 -0
- package/src/chat/MessageLayoutView.tsx +156 -0
- package/src/chat/MessageListFooterView.tsx +127 -0
- package/src/chat/MessageSelectionContextMenuView.tsx +66 -0
- package/src/chat/MessageTimelineView.tsx +261 -0
- package/src/chat/MessageView.tsx +82 -0
- package/src/chat/MessageVisualView.tsx +43 -0
- package/src/chat/ModelSelectorView.tsx +407 -0
- package/src/chat/NewSession.ts +107 -0
- package/src/chat/NewSessionBackground.tsx +54 -0
- package/src/chat/NewSessionPageLayoutView.tsx +96 -0
- package/src/chat/NewSessionPicker.tsx +270 -0
- package/src/chat/ProgressGroupView.tsx +323 -0
- package/src/chat/ProjectSelectorView.tsx +253 -0
- package/src/chat/QueueCardView.tsx +151 -0
- package/src/chat/ReadImageView.tsx +73 -0
- package/src/chat/SandboxGrantsBadgeView.tsx +101 -0
- package/src/chat/SandboxPermissionCard.tsx +64 -0
- package/src/chat/SceneCard.tsx +138 -0
- package/src/chat/SendButton.tsx +135 -0
- package/src/chat/SessionDropZoneView.tsx +85 -0
- package/src/chat/SessionViewerPageView.tsx +56 -0
- package/src/chat/SkillCard.tsx +56 -0
- package/src/chat/SkillPromptAreaView.tsx +129 -0
- package/src/chat/SuggestionBubblesView.tsx +58 -0
- package/src/chat/TextBlockView.tsx +770 -0
- package/src/chat/TextPreview.tsx +37 -0
- package/src/chat/ThinkingBlockView.tsx +183 -0
- package/src/chat/TodoCard.tsx +243 -0
- package/src/chat/TodoProgress.tsx +205 -0
- package/src/chat/TodoStatusBarView.tsx +140 -0
- package/src/chat/ToolCallBlockView.tsx +188 -0
- package/src/chat/UsageBarView.tsx +19 -0
- package/src/chat/UserMessageContextMenuView.tsx +87 -0
- package/src/chat/UserMessageView.tsx +241 -0
- package/src/chat/WorkflowFooterItemsView.tsx +170 -0
- package/src/chat/WriteContentView.tsx +12 -0
- package/src/chat/index.ts +524 -0
- package/src/chat/markdown-link.test.ts +238 -0
- package/src/chat/markdown-link.ts +279 -0
- package/src/chat/send-button.css +318 -0
- package/src/chat/useHorizontalDragScroll.ts +146 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +62 -0
- package/src/file-explorer/FileContextMenuView.tsx +209 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +82 -0
- package/src/file-explorer/FileTreeNodeView.tsx +274 -0
- package/src/file-explorer/FileTreeView.tsx +301 -0
- package/src/file-explorer/FilesPanelView.tsx +91 -0
- package/src/file-explorer/drag-target.test.ts +34 -0
- package/src/file-explorer/drag-target.ts +26 -0
- package/src/file-explorer/fileIcons.ts +1 -0
- package/src/file-explorer/index.ts +28 -0
- package/src/file-explorer/nativeFileDrag.test.ts +30 -0
- package/src/file-explorer/nativeFileDrag.ts +14 -0
- package/src/file-explorer/types.ts +40 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +115 -0
- package/src/file-preview/FilePreviewDialogView.tsx +241 -0
- package/src/file-preview/FilePreviewView.tsx +162 -0
- package/src/file-preview/LightboxImageView.tsx +131 -0
- package/src/file-preview/PluginFilePreviewView.tsx +24 -0
- package/src/file-preview/PreviewBodyView.tsx +99 -0
- package/src/file-preview/PreviewErrorBoundary.tsx +51 -0
- package/src/file-preview/TextCodeEditorView.tsx +72 -0
- package/src/file-preview/TextFileEditorView.tsx +213 -0
- package/src/file-preview/index.ts +56 -0
- package/src/file-preview/keyboard-target.test.ts +49 -0
- package/src/file-preview/keyboard-target.ts +33 -0
- package/src/file-preview/syntax-tokens.css +77 -0
- package/src/file-preview/syntax-tokens.test.ts +31 -0
- package/src/file-preview/syntax-tokens.ts +155 -0
- package/src/file-preview/text-code-editor-theme.ts +321 -0
- package/src/file-preview/text-editor-language.test.ts +58 -0
- package/src/file-preview/text-editor-language.ts +182 -0
- package/src/file-preview/types.ts +29 -0
- package/src/flowing/FlowingPanelView.tsx +79 -0
- package/src/flowing/FlowingWorkflowView.tsx +54 -0
- package/src/flowing/UserNodeView.tsx +148 -0
- package/src/flowing/WorkflowBindDialogView.tsx +145 -0
- package/src/flowing/WorkflowProgressView.tsx +149 -0
- package/src/flowing/index.ts +27 -0
- package/src/flowing-chat/ChatBubbleView.tsx +219 -0
- package/src/flowing-chat/ChatComposerView.tsx +362 -0
- package/src/flowing-chat/ChatMembersBarView.tsx +86 -0
- package/src/flowing-chat/ChatPanelView.tsx +73 -0
- package/src/flowing-chat/index.ts +21 -0
- package/src/index.ts +22 -0
- package/src/knowledge/KnowledgeBaseSwitcherView.tsx +154 -0
- package/src/knowledge/KnowledgeBreadcrumbView.tsx +92 -0
- package/src/knowledge/KnowledgeContentsPanelView.tsx +77 -0
- package/src/knowledge/KnowledgeContextMenuView.tsx +70 -0
- package/src/knowledge/KnowledgeFilesSkeleton.tsx +22 -0
- package/src/knowledge/KnowledgeGridView.tsx +113 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +85 -0
- package/src/knowledge/KnowledgeImportDialogView.tsx +153 -0
- package/src/knowledge/KnowledgeListView.tsx +107 -0
- package/src/knowledge/KnowledgePendingFilesDialogView.tsx +76 -0
- package/src/knowledge/KnowledgeProcessingBadgeView.tsx +18 -0
- package/src/knowledge/KnowledgeRenameDialogView.tsx +66 -0
- package/src/knowledge/KnowledgeSourcePickerView.tsx +60 -0
- package/src/knowledge/KnowledgeViewShared.tsx +103 -0
- package/src/knowledge/cn.ts +4 -0
- package/src/knowledge/coloredFileIcons.ts +1 -0
- package/src/knowledge/index.ts +66 -0
- package/src/knowledge/types.ts +31 -0
- package/src/knowledge/useMarqueeSelection.ts +95 -0
- package/src/layout/AppFrame.tsx +34 -0
- package/src/layout/MainContentFrame.tsx +54 -0
- package/src/layout/ResizeHandle.tsx +91 -0
- package/src/layout/SidebarDock.tsx +33 -0
- package/src/layout/SidebarOverlay.tsx +36 -0
- package/src/layout/index.ts +10 -0
- package/src/overlays/CommandMenuRow.tsx +119 -0
- package/src/overlays/CommandMenuView.tsx +183 -0
- package/src/overlays/ConfirmDialogView.tsx +109 -0
- package/src/overlays/DetailDrawer.tsx +63 -0
- package/src/overlays/DetailDrawerEnter.tsx +37 -0
- package/src/overlays/KnowledgeDropOverlayView.tsx +43 -0
- package/src/overlays/RouteErrorPageView.tsx +72 -0
- package/src/overlays/ToasterView.tsx +76 -0
- package/src/overlays/UpdateCheckerView.tsx +206 -0
- package/src/overlays/UpdateRestartDialogView.tsx +107 -0
- package/src/overlays/command-menu-types.ts +47 -0
- package/src/overlays/command-menu.css +69 -0
- package/src/overlays/detail-drawer-guard.test.ts +16 -0
- package/src/overlays/detail-drawer-guard.ts +13 -0
- package/src/overlays/index.ts +44 -0
- package/src/plugin-ui/index.ts +26 -0
- package/src/project/BatchQueueStatusView.tsx +352 -0
- package/src/project/ConversationTagDotsView.tsx +130 -0
- package/src/project/ConversationTagEditorDialogView.tsx +273 -0
- package/src/project/DefaultConversationSectionView.tsx +74 -0
- package/src/project/DefaultSessionListView.tsx +128 -0
- package/src/project/DefaultSessionRowView.tsx +125 -0
- package/src/project/NewProjectDialogView.tsx +140 -0
- package/src/project/ProjectContextMenuView.tsx +187 -0
- package/src/project/ProjectDetailPageView.tsx +351 -0
- package/src/project/ProjectGroupView.tsx +37 -0
- package/src/project/ProjectRowView.tsx +111 -0
- package/src/project/ProjectSessionsLoadingView.tsx +14 -0
- package/src/project/ProjectSessionsView.tsx +96 -0
- package/src/project/ProjectsLoadingView.tsx +15 -0
- package/src/project/ProjectsPanelMenusView.tsx +23 -0
- package/src/project/ProjectsPanelView.tsx +56 -0
- package/src/project/QuickScrollOverlay.tsx +188 -0
- package/src/project/ScheduleStatusView.tsx +110 -0
- package/src/project/SessionContextMenuView.tsx +71 -0
- package/src/project/SessionRenameInputView.tsx +49 -0
- package/src/project/SessionRowView.tsx +119 -0
- package/src/project/SidebarProjectsSectionView.tsx +35 -0
- package/src/project/index.ts +87 -0
- package/src/project/types.ts +21 -0
- package/src/project/useActiveSessionAutoScroll.ts +171 -0
- package/src/registry.ts +62 -0
- package/src/scheduler/AutomationPageView.tsx +159 -0
- package/src/scheduler/ExecutionHistoryView.tsx +179 -0
- package/src/scheduler/HistoryDrawerView.tsx +149 -0
- package/src/scheduler/TaskFormDialogView.tsx +60 -0
- package/src/scheduler/TaskListView.tsx +219 -0
- package/src/scheduler/index.ts +30 -0
- package/src/settings/AchievementNavigationButtonView.tsx +90 -0
- package/src/settings/AchievementPromotionDialogView.tsx +91 -0
- package/src/settings/AchievementSettingsView.tsx +44 -0
- package/src/settings/AppshotSettingsView.tsx +132 -0
- package/src/settings/ArchivedProjectsSettingsView.tsx +80 -0
- package/src/settings/BuiltinMcpSecretsDialogView.tsx +278 -0
- package/src/settings/BuiltinMcpSectionView.tsx +164 -0
- package/src/settings/EnvironmentSettingsView.tsx +176 -0
- package/src/settings/GeneralSettingsView.tsx +174 -0
- package/src/settings/ImChannelCardView.tsx +152 -0
- package/src/settings/ImChannelGuideDialogView.tsx +126 -0
- package/src/settings/ImFeishuDialogView.tsx +156 -0
- package/src/settings/ImLegacyImportBannerView.tsx +44 -0
- package/src/settings/ImLogDrawerView.tsx +75 -0
- package/src/settings/ImStatusBadgeView.tsx +39 -0
- package/src/settings/McpDefaultIcon.tsx +27 -0
- package/src/settings/McpJsonEditorView.tsx +56 -0
- package/src/settings/ModelsProviderFormView.tsx +128 -0
- package/src/settings/ModelsProvidersSectionView.tsx +52 -0
- package/src/settings/MotionSelect.tsx +125 -0
- package/src/settings/PermissionsSettingsView.tsx +106 -0
- package/src/settings/PetBubbleStylePreviewView.tsx +44 -0
- package/src/settings/PetSettingsView.tsx +165 -0
- package/src/settings/PresetProviderModelsListView.tsx +58 -0
- package/src/settings/PresetProviderRowView.tsx +302 -0
- package/src/settings/PresetProvidersSectionView.tsx +70 -0
- package/src/settings/QrBindDialogView.tsx +165 -0
- package/src/settings/QuickPanelSettingsSectionView.tsx +66 -0
- package/src/settings/RemoteMcpSectionView.tsx +192 -0
- package/src/settings/SettingChrome.tsx +104 -0
- package/src/settings/SettingsAiAssistButtonView.tsx +150 -0
- package/src/settings/SettingsAiAssistDialogView.tsx +251 -0
- package/src/settings/SettingsFormFields.tsx +121 -0
- package/src/settings/SettingsPageShellView.tsx +84 -0
- package/src/settings/SettingsSidebarView.tsx +133 -0
- package/src/settings/ShortcutRecorderView.tsx +88 -0
- package/src/settings/ShortcutsSettingsView.tsx +66 -0
- package/src/settings/SubscriptionActionsView.tsx +63 -0
- package/src/settings/SubscriptionCardsView.tsx +212 -0
- package/src/settings/TeamDetailView.tsx +148 -0
- package/src/settings/TeamDialogsView.tsx +151 -0
- package/src/settings/TeamListView.tsx +57 -0
- package/src/settings/TeamSettingsView.tsx +51 -0
- package/src/settings/TokenActivityChartView.tsx +286 -0
- package/src/settings/UsageStatsView.tsx +101 -0
- package/src/settings/WebhookEndpointListView.tsx +123 -0
- package/src/settings/WechatBindDialogView.tsx +45 -0
- package/src/settings/achievements/AchievementCurtains.tsx +50 -0
- package/src/settings/achievements/AchievementPromotionBadge3D.tsx +350 -0
- package/src/settings/achievements/AchievementPromotionConfetti.tsx +71 -0
- package/src/settings/achievements/AchievementTitle.tsx +52 -0
- package/src/settings/achievements/index.ts +13 -0
- package/src/settings/index.ts +226 -0
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +135 -0
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +40 -0
- package/src/settings/token-activity.test.ts +195 -0
- package/src/settings/token-activity.ts +320 -0
- package/src/shared/AvatarStackView.tsx +45 -0
- package/src/shared/BotAvatar.tsx +395 -0
- package/src/shared/CodeBlockCopyButton.tsx +48 -0
- package/src/shared/CollapsePanel.tsx +125 -0
- package/src/shared/ContextMenuView.tsx +134 -0
- package/src/shared/MacKeyboardPreview.tsx +260 -0
- package/src/shared/MarkdownTable.tsx +216 -0
- package/src/shared/MultiplierTag.tsx +15 -0
- package/src/shared/ScrollFade.tsx +114 -0
- package/src/shared/SegmentedControl.tsx +82 -0
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.tsx +696 -0
- package/src/shared/TimePicker.tsx +96 -0
- package/src/shared/connected-tab-outline.test.ts +22 -0
- package/src/shared/connected-tab-outline.ts +39 -0
- package/src/shared/fileIcons.test.ts +28 -0
- package/src/shared/fileIcons.ts +322 -0
- package/src/shared/index.ts +38 -0
- package/src/shared/markdown-table-clipboard.ts +31 -0
- package/src/shared/provider-icon/icons.ts +56 -0
- package/src/shared/provider-icon/index.tsx +42 -0
- package/src/shared/provider-icon/svg-url.d.ts +4 -0
- package/src/shared/tab-drag.test.ts +14 -0
- package/src/shared/tab-drag.ts +15 -0
- package/src/shared/useDelayedUnmount.ts +36 -0
- package/src/sidebar/AddProjectMenuItem.tsx +21 -0
- package/src/sidebar/AddProjectMenuPopoverView.tsx +52 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +50 -0
- package/src/sidebar/ChatMessageListView.tsx +66 -0
- package/src/sidebar/DefaultSidebar.tsx +91 -0
- package/src/sidebar/FlowingMessageListView.tsx +111 -0
- package/src/sidebar/MessageCenterDialogView.tsx +81 -0
- package/src/sidebar/MessageCenterEmptyState.tsx +24 -0
- package/src/sidebar/MessageCenterTabs.tsx +86 -0
- package/src/sidebar/MessageCenterToolbarButton.tsx +25 -0
- package/src/sidebar/MessageCenterTriggerView.tsx +39 -0
- package/src/sidebar/NotificationMessageListView.tsx +136 -0
- package/src/sidebar/ProjectsPanelEmptyState.tsx +20 -0
- package/src/sidebar/RunningPulseDot.tsx +10 -0
- package/src/sidebar/SessionStatusIcon.tsx +43 -0
- package/src/sidebar/SettingsMenuAccountSection.tsx +32 -0
- package/src/sidebar/SettingsMenuActionButton.tsx +24 -0
- package/src/sidebar/SettingsMenuDivider.tsx +5 -0
- package/src/sidebar/SettingsMenuQuotaSection.tsx +45 -0
- package/src/sidebar/SettingsMenuSettingsItem.tsx +18 -0
- package/src/sidebar/SettingsMenuThemeSection.tsx +51 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +65 -0
- package/src/sidebar/ShowMoreSessionsButton.tsx +37 -0
- package/src/sidebar/SidebarFilterSelectView.tsx +95 -0
- package/src/sidebar/SidebarNavBadgeView.tsx +58 -0
- package/src/sidebar/SidebarNavIcon.tsx +33 -0
- package/src/sidebar/SidebarNavItemButton.tsx +59 -0
- package/src/sidebar/SidebarNavMorePanel.tsx +199 -0
- package/src/sidebar/SidebarNavigation.tsx +223 -0
- package/src/sidebar/SidebarPanel.tsx +48 -0
- package/src/sidebar/SidebarTopBar.tsx +103 -0
- package/src/sidebar/SidebarUpdateIcon.tsx +79 -0
- package/src/sidebar/index.ts +118 -0
- package/src/sidebar/nav-badge-text.test.ts +23 -0
- package/src/sidebar/nav-badge-text.ts +19 -0
- package/src/sidebar/useSidebarNavDrag.ts +139 -0
- package/src/skills/PluginCardView.tsx +150 -0
- package/src/skills/SceneCardView.tsx +194 -0
- package/src/skills/SkillCardView.tsx +186 -0
- package/src/skills/SkillDetailDialogView.tsx +138 -0
- package/src/skills/SkillTagGroupView.tsx +56 -0
- package/src/skills/SkillToggleSwitch.tsx +31 -0
- package/src/skills/index.ts +29 -0
- package/src/skills/skill-icon.test.ts +38 -0
- package/src/skills/skill-icon.tsx +126 -0
- package/src/styles.css +75 -0
- package/src/utils/platform.ts +2 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, type JSX } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
Input,
|
|
11
|
+
} from "@vetta-org/ui";
|
|
12
|
+
|
|
13
|
+
export interface NewProjectDialogViewLabels {
|
|
14
|
+
readonly title: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly placeholder: string;
|
|
17
|
+
readonly cancel: string;
|
|
18
|
+
readonly create: string;
|
|
19
|
+
readonly emptyError: string;
|
|
20
|
+
readonly invalidError: string;
|
|
21
|
+
readonly duplicateError: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface NewProjectDialogViewProps {
|
|
25
|
+
readonly onConfirm: (name: string) => void;
|
|
26
|
+
readonly onCancel: () => void;
|
|
27
|
+
readonly labels: NewProjectDialogViewLabels;
|
|
28
|
+
/**
|
|
29
|
+
* 已被占用的项目名。命中时在确认那一刻就拦下来——否则重名会一路走到落盘,
|
|
30
|
+
* 静默复用同名项目,用户以为新建了一个却发现会话进了旧项目。
|
|
31
|
+
*/
|
|
32
|
+
readonly isNameTaken?: (name: string) => boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function NewProjectDialogView({
|
|
36
|
+
onConfirm,
|
|
37
|
+
onCancel,
|
|
38
|
+
labels,
|
|
39
|
+
isNameTaken,
|
|
40
|
+
}: NewProjectDialogViewProps): JSX.Element {
|
|
41
|
+
const [name, setName] = useState("");
|
|
42
|
+
const [error, setError] = useState("");
|
|
43
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
44
|
+
/**
|
|
45
|
+
* 输入法组合中。中文/日文输入时 Enter 是「上屏第一个候选词」,不该走到创建——
|
|
46
|
+
* 否则用户名字还没打完,项目就按半成品建出去了。
|
|
47
|
+
*
|
|
48
|
+
* 两道判断都要:`isComposing` 是标准信号,但 compositionend 与随后那次 keydown
|
|
49
|
+
* 的先后顺序各引擎不一致(确认候选词的那一下就落在这个缝里),所以再用
|
|
50
|
+
* compositionend 之后的一小段时间兜底。
|
|
51
|
+
*/
|
|
52
|
+
const composingRef = useRef(false);
|
|
53
|
+
const composedAtRef = useRef(0);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
inputRef.current?.focus();
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
const handleSubmit = useCallback(() => {
|
|
60
|
+
const trimmed = name.trim();
|
|
61
|
+
if (!trimmed) {
|
|
62
|
+
setError(labels.emptyError);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (/[/\\:*?"<>|]/.test(trimmed)) {
|
|
66
|
+
setError(labels.invalidError);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (isNameTaken?.(trimmed)) {
|
|
70
|
+
setError(labels.duplicateError);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
onConfirm(trimmed);
|
|
74
|
+
}, [name, onConfirm, isNameTaken, labels.emptyError, labels.invalidError, labels.duplicateError]);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Dialog
|
|
78
|
+
open
|
|
79
|
+
onOpenChange={(open) => {
|
|
80
|
+
if (!open) onCancel();
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
<DialogContent
|
|
84
|
+
showCloseButton={false}
|
|
85
|
+
onEscapeKeyDown={(e) => {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
onCancel();
|
|
88
|
+
}}
|
|
89
|
+
onInteractOutside={(e) => e.preventDefault()}
|
|
90
|
+
>
|
|
91
|
+
<DialogHeader className="gap-1.5">
|
|
92
|
+
<DialogTitle>{labels.title}</DialogTitle>
|
|
93
|
+
<DialogDescription>{labels.description}</DialogDescription>
|
|
94
|
+
</DialogHeader>
|
|
95
|
+
<div className="flex flex-col gap-1.5">
|
|
96
|
+
<Input
|
|
97
|
+
ref={inputRef}
|
|
98
|
+
type="text"
|
|
99
|
+
value={name}
|
|
100
|
+
// 有错时借 Input 自带的 aria-invalid 样式染边框,不用再写一套红框。
|
|
101
|
+
aria-invalid={error ? true : undefined}
|
|
102
|
+
onChange={(e) => {
|
|
103
|
+
setName(e.target.value);
|
|
104
|
+
setError("");
|
|
105
|
+
}}
|
|
106
|
+
onKeyDown={(e) => {
|
|
107
|
+
if (e.key !== "Enter") return;
|
|
108
|
+
if (composingRef.current || e.nativeEvent.isComposing || Date.now() - composedAtRef.current < 80) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
handleSubmit();
|
|
112
|
+
}}
|
|
113
|
+
onCompositionStart={() => {
|
|
114
|
+
composingRef.current = true;
|
|
115
|
+
}}
|
|
116
|
+
onCompositionEnd={() => {
|
|
117
|
+
composingRef.current = false;
|
|
118
|
+
composedAtRef.current = Date.now();
|
|
119
|
+
}}
|
|
120
|
+
placeholder={labels.placeholder}
|
|
121
|
+
className="h-9"
|
|
122
|
+
/>
|
|
123
|
+
{error && (
|
|
124
|
+
<p role="alert" className="text-[12px] leading-snug text-destructive">
|
|
125
|
+
{error}
|
|
126
|
+
</p>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
<DialogFooter>
|
|
130
|
+
<Button variant="outline" onClick={onCancel}>
|
|
131
|
+
{labels.cancel}
|
|
132
|
+
</Button>
|
|
133
|
+
<Button variant="primary" onClick={handleSubmit}>
|
|
134
|
+
{labels.create}
|
|
135
|
+
</Button>
|
|
136
|
+
</DialogFooter>
|
|
137
|
+
</DialogContent>
|
|
138
|
+
</Dialog>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState, type JSX } from "react";
|
|
3
|
+
|
|
4
|
+
export type ProjectContextMenuScope = "conversation" | "claw";
|
|
5
|
+
|
|
6
|
+
export interface ProjectContextMenuViewLabels {
|
|
7
|
+
openInFolder: string;
|
|
8
|
+
archiveProject: string;
|
|
9
|
+
removeFromList: string;
|
|
10
|
+
deleteProject: string;
|
|
11
|
+
clearConversation: string;
|
|
12
|
+
clearConversationDisabled: string;
|
|
13
|
+
clearClaw: string;
|
|
14
|
+
clearClawDisabled: string;
|
|
15
|
+
clawSettings: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ProjectContextMenuViewProps {
|
|
19
|
+
clearClawDisabled?: boolean;
|
|
20
|
+
clearConversationDisabled?: boolean;
|
|
21
|
+
defaultScope?: ProjectContextMenuScope;
|
|
22
|
+
isDefault: boolean;
|
|
23
|
+
labels: ProjectContextMenuViewLabels;
|
|
24
|
+
onArchive: () => void;
|
|
25
|
+
onClearClaw?: () => void;
|
|
26
|
+
onClearConversation?: () => void;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
onDelete: () => void;
|
|
29
|
+
onOpenClawSettings?: () => void;
|
|
30
|
+
onOpenInFolder: () => void;
|
|
31
|
+
onRemove: () => void;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function ProjectContextMenuView({
|
|
37
|
+
clearClawDisabled,
|
|
38
|
+
clearConversationDisabled,
|
|
39
|
+
defaultScope,
|
|
40
|
+
isDefault,
|
|
41
|
+
labels,
|
|
42
|
+
onArchive,
|
|
43
|
+
onClearClaw,
|
|
44
|
+
onClearConversation,
|
|
45
|
+
onClose,
|
|
46
|
+
onDelete,
|
|
47
|
+
onOpenClawSettings,
|
|
48
|
+
onOpenInFolder,
|
|
49
|
+
onRemove,
|
|
50
|
+
x,
|
|
51
|
+
y,
|
|
52
|
+
}: ProjectContextMenuViewProps): JSX.Element {
|
|
53
|
+
const menuRef = useRef<HTMLDivElement>(null);
|
|
54
|
+
const [adjustedPos, setAdjustedPos] = useState({ x, y });
|
|
55
|
+
|
|
56
|
+
useLayoutEffect(() => {
|
|
57
|
+
const el = menuRef.current;
|
|
58
|
+
if (!el) return;
|
|
59
|
+
const rect = el.getBoundingClientRect();
|
|
60
|
+
const vw = window.innerWidth;
|
|
61
|
+
const vh = window.innerHeight;
|
|
62
|
+
setAdjustedPos({
|
|
63
|
+
x: x + rect.width > vw ? vw - rect.width - 4 : x,
|
|
64
|
+
y: y + rect.height > vh ? vh - rect.height - 4 : y,
|
|
65
|
+
});
|
|
66
|
+
}, [x, y]);
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
function handleClick(e: MouseEvent) {
|
|
70
|
+
if (menuRef.current && !menuRef.current.contains(e.target as Node)) {
|
|
71
|
+
onClose();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
document.addEventListener("mousedown", handleClick);
|
|
75
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
76
|
+
}, [onClose]);
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
function handleKey(e: KeyboardEvent) {
|
|
80
|
+
if (e.key === "Escape") onClose();
|
|
81
|
+
}
|
|
82
|
+
document.addEventListener("keydown", handleKey);
|
|
83
|
+
return () => document.removeEventListener("keydown", handleKey);
|
|
84
|
+
}, [onClose]);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<AnimatePresence>
|
|
88
|
+
<motion.div
|
|
89
|
+
ref={menuRef}
|
|
90
|
+
initial={{ opacity: 0, scale: 0.95 }}
|
|
91
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
92
|
+
exit={{ opacity: 0, scale: 0.95 }}
|
|
93
|
+
transition={{ duration: 0.12, ease: [0.25, 0.1, 0.25, 1] }}
|
|
94
|
+
className="fixed z-[1000] w-[160px] overflow-hidden rounded-lg border border-border bg-popover p-1 shadow-xl"
|
|
95
|
+
style={{ left: `${adjustedPos.x}px`, top: `${adjustedPos.y}px` }}
|
|
96
|
+
>
|
|
97
|
+
{!isDefault && (
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
onClick={onOpenInFolder}
|
|
101
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-foreground transition-colors hover:bg-accent"
|
|
102
|
+
>
|
|
103
|
+
<span className="icon-[solar--folder-open-linear] h-3.5 w-3.5" />
|
|
104
|
+
{labels.openInFolder}
|
|
105
|
+
</button>
|
|
106
|
+
)}
|
|
107
|
+
{isDefault && defaultScope === "conversation" && onClearConversation && (
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
disabled={clearConversationDisabled}
|
|
111
|
+
title={clearConversationDisabled ? labels.clearConversationDisabled : undefined}
|
|
112
|
+
onClick={() => {
|
|
113
|
+
if (clearConversationDisabled) return;
|
|
114
|
+
onClearConversation();
|
|
115
|
+
}}
|
|
116
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-destructive transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:text-muted-foreground/50 disabled:hover:bg-transparent"
|
|
117
|
+
>
|
|
118
|
+
<span className="icon-[solar--broom-linear] h-3.5 w-3.5" />
|
|
119
|
+
{labels.clearConversation}
|
|
120
|
+
</button>
|
|
121
|
+
)}
|
|
122
|
+
{isDefault && defaultScope === "claw" && (
|
|
123
|
+
<>
|
|
124
|
+
{onClearClaw && (
|
|
125
|
+
<button
|
|
126
|
+
type="button"
|
|
127
|
+
disabled={clearClawDisabled}
|
|
128
|
+
title={clearClawDisabled ? labels.clearClawDisabled : undefined}
|
|
129
|
+
onClick={() => {
|
|
130
|
+
if (clearClawDisabled) return;
|
|
131
|
+
onClearClaw();
|
|
132
|
+
}}
|
|
133
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-destructive transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:text-muted-foreground/50 disabled:hover:bg-transparent"
|
|
134
|
+
>
|
|
135
|
+
<span className="icon-[solar--broom-linear] h-3.5 w-3.5" />
|
|
136
|
+
{labels.clearClaw}
|
|
137
|
+
</button>
|
|
138
|
+
)}
|
|
139
|
+
{onOpenClawSettings && (
|
|
140
|
+
<button
|
|
141
|
+
type="button"
|
|
142
|
+
onClick={onOpenClawSettings}
|
|
143
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-foreground transition-colors hover:bg-accent"
|
|
144
|
+
>
|
|
145
|
+
<span className="icon-[solar--settings-linear] h-3.5 w-3.5" />
|
|
146
|
+
{labels.clawSettings}
|
|
147
|
+
</button>
|
|
148
|
+
)}
|
|
149
|
+
</>
|
|
150
|
+
)}
|
|
151
|
+
{!isDefault && (
|
|
152
|
+
<button
|
|
153
|
+
type="button"
|
|
154
|
+
onClick={onArchive}
|
|
155
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-foreground transition-colors hover:bg-accent"
|
|
156
|
+
>
|
|
157
|
+
<span className="icon-[solar--archive-minimalistic-linear] h-3.5 w-3.5" />
|
|
158
|
+
{labels.archiveProject}
|
|
159
|
+
</button>
|
|
160
|
+
)}
|
|
161
|
+
{!isDefault && (
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
onClick={onRemove}
|
|
165
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-foreground transition-colors hover:bg-accent"
|
|
166
|
+
>
|
|
167
|
+
<span className="icon-[solar--list-cross-minimalistic-linear] h-3.5 w-3.5" />
|
|
168
|
+
{labels.removeFromList}
|
|
169
|
+
</button>
|
|
170
|
+
)}
|
|
171
|
+
{!isDefault && (
|
|
172
|
+
<>
|
|
173
|
+
<div className="mx-1.5 my-1 h-px bg-border" />
|
|
174
|
+
<button
|
|
175
|
+
type="button"
|
|
176
|
+
onClick={onDelete}
|
|
177
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-[12px] font-medium text-destructive transition-colors hover:bg-accent"
|
|
178
|
+
>
|
|
179
|
+
<span className="icon-[solar--trash-bin-trash-linear] h-3.5 w-3.5" />
|
|
180
|
+
{labels.deleteProject}
|
|
181
|
+
</button>
|
|
182
|
+
</>
|
|
183
|
+
)}
|
|
184
|
+
</motion.div>
|
|
185
|
+
</AnimatePresence>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { Button, cn } from "@vetta-org/ui";
|
|
2
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
3
|
+
import type { JSX, ReactNode, RefObject } from "react";
|
|
4
|
+
|
|
5
|
+
const easeOut = [0.22, 1, 0.36, 1] as const;
|
|
6
|
+
|
|
7
|
+
export type ProjectDetailSaveStatus = "idle" | "saving" | "saved" | "error";
|
|
8
|
+
|
|
9
|
+
export interface ProjectDetailPageViewLabels {
|
|
10
|
+
showInFolderTitle: string;
|
|
11
|
+
showInFolder: string;
|
|
12
|
+
exportTitle: string;
|
|
13
|
+
export: string;
|
|
14
|
+
newSession: string;
|
|
15
|
+
closeActivityPanel: string;
|
|
16
|
+
openActivityPanel: string;
|
|
17
|
+
persona: string;
|
|
18
|
+
unsavedChanges: string;
|
|
19
|
+
saved: string;
|
|
20
|
+
saveFailed: string;
|
|
21
|
+
save: string;
|
|
22
|
+
editorPlaceholder: string;
|
|
23
|
+
agentsMdHint: string;
|
|
24
|
+
quickSave: string;
|
|
25
|
+
saveShortcut: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ProjectDetailPageViewProps {
|
|
29
|
+
activityOpen: boolean;
|
|
30
|
+
/** Host ActivityPanel. */
|
|
31
|
+
activityPanel: ReactNode;
|
|
32
|
+
/** Host BatchQueueStatus section body (already wrapped or raw). */
|
|
33
|
+
batchSection: ReactNode | null;
|
|
34
|
+
content: string;
|
|
35
|
+
createdAtLabel: string | null;
|
|
36
|
+
cwd: string;
|
|
37
|
+
displayName: string;
|
|
38
|
+
editorFocused: boolean;
|
|
39
|
+
exportable: boolean;
|
|
40
|
+
isDirty: boolean;
|
|
41
|
+
labels: ProjectDetailPageViewLabels;
|
|
42
|
+
loading: boolean;
|
|
43
|
+
onContentChange: (value: string) => void;
|
|
44
|
+
onEditorBlur: () => void;
|
|
45
|
+
onEditorFocus: () => void;
|
|
46
|
+
onExport: () => void;
|
|
47
|
+
onNewSession: () => void;
|
|
48
|
+
onSave: () => void;
|
|
49
|
+
onShowInFolder: () => void;
|
|
50
|
+
onToggleActivity: () => void;
|
|
51
|
+
projectTypeLabel: string | null;
|
|
52
|
+
saveStatus: ProjectDetailSaveStatus;
|
|
53
|
+
sessionCountLabel: string;
|
|
54
|
+
taskCountLabel: string | null;
|
|
55
|
+
textareaRef: RefObject<HTMLTextAreaElement | null>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function ProjectDetailPageView({
|
|
59
|
+
activityOpen,
|
|
60
|
+
activityPanel,
|
|
61
|
+
batchSection,
|
|
62
|
+
content,
|
|
63
|
+
createdAtLabel,
|
|
64
|
+
cwd,
|
|
65
|
+
displayName,
|
|
66
|
+
editorFocused,
|
|
67
|
+
exportable,
|
|
68
|
+
isDirty,
|
|
69
|
+
labels,
|
|
70
|
+
loading,
|
|
71
|
+
onContentChange,
|
|
72
|
+
onEditorBlur,
|
|
73
|
+
onEditorFocus,
|
|
74
|
+
onExport,
|
|
75
|
+
onNewSession,
|
|
76
|
+
onSave,
|
|
77
|
+
onShowInFolder,
|
|
78
|
+
onToggleActivity,
|
|
79
|
+
projectTypeLabel,
|
|
80
|
+
saveStatus,
|
|
81
|
+
sessionCountLabel,
|
|
82
|
+
taskCountLabel,
|
|
83
|
+
textareaRef,
|
|
84
|
+
}: ProjectDetailPageViewProps): JSX.Element {
|
|
85
|
+
const metrics = [
|
|
86
|
+
{ icon: "icon-[mdi--chat-outline]", value: sessionCountLabel },
|
|
87
|
+
createdAtLabel ? { icon: "icon-[mdi--calendar-outline]", value: createdAtLabel } : null,
|
|
88
|
+
taskCountLabel ? { icon: "icon-[mdi--layers-outline]", value: taskCountLabel } : null,
|
|
89
|
+
].filter((item): item is { icon: string; value: string } => item != null);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div className="flex h-full w-full flex-col overflow-hidden">
|
|
93
|
+
<div className="flex min-h-0 flex-1">
|
|
94
|
+
{/* @container:按主栏宽度(非视口)响应,Activity 挤窄时也能正确折叠 */}
|
|
95
|
+
<div className="@container flex min-w-0 flex-1 flex-col">
|
|
96
|
+
{/* ── Identity header ─────────────────────────────────── */}
|
|
97
|
+
<motion.header
|
|
98
|
+
className="shrink-0 px-4 pb-4 pt-1 @md:px-8 @md:pb-5"
|
|
99
|
+
initial={{ opacity: 0, y: -10 }}
|
|
100
|
+
animate={{ opacity: 1, y: 0 }}
|
|
101
|
+
transition={{ duration: 0.45, ease: easeOut }}
|
|
102
|
+
>
|
|
103
|
+
<div className="flex min-w-0 flex-col gap-3">
|
|
104
|
+
{/* 标题行:窄宽时允许操作条整行换行,避免挤爆标题 */}
|
|
105
|
+
<div className="flex min-w-0 flex-wrap items-start justify-between gap-x-2 gap-y-2">
|
|
106
|
+
<div className="min-w-0 flex-1 basis-[8rem]">
|
|
107
|
+
<div className="mb-1 flex min-w-0 items-center gap-2">
|
|
108
|
+
<h1
|
|
109
|
+
className="min-w-0 truncate text-[20px] font-bold leading-tight tracking-tight text-foreground @md:text-[26px]"
|
|
110
|
+
title={displayName}
|
|
111
|
+
>
|
|
112
|
+
{displayName}
|
|
113
|
+
</h1>
|
|
114
|
+
<AnimatePresence mode="popLayout">
|
|
115
|
+
{projectTypeLabel && (
|
|
116
|
+
<motion.span
|
|
117
|
+
key={projectTypeLabel}
|
|
118
|
+
initial={{ opacity: 0, scale: 0.9 }}
|
|
119
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
120
|
+
exit={{ opacity: 0, scale: 0.9 }}
|
|
121
|
+
transition={{ type: "spring", stiffness: 400, damping: 28 }}
|
|
122
|
+
className="inline-flex shrink-0 items-center gap-1.5 rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-primary"
|
|
123
|
+
>
|
|
124
|
+
<span className="h-1 w-1 rounded-full bg-primary" />
|
|
125
|
+
{projectTypeLabel}
|
|
126
|
+
</motion.span>
|
|
127
|
+
)}
|
|
128
|
+
</AnimatePresence>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<button
|
|
132
|
+
type="button"
|
|
133
|
+
onClick={onShowInFolder}
|
|
134
|
+
title={labels.showInFolderTitle}
|
|
135
|
+
className="group inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-md px-0.5 py-0.5 font-mono text-[11px] text-muted-foreground/55 transition-colors hover:bg-accent/60 hover:text-foreground"
|
|
136
|
+
>
|
|
137
|
+
<span className="icon-[solar--folder-open-linear] h-3 w-3 shrink-0 opacity-70 group-hover:opacity-100" />
|
|
138
|
+
<span className="min-w-0 truncate">{cwd}</span>
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div className="flex shrink-0 flex-wrap items-center justify-end gap-1">
|
|
143
|
+
<Button
|
|
144
|
+
type="button"
|
|
145
|
+
variant="ghost"
|
|
146
|
+
size="icon-sm"
|
|
147
|
+
onClick={onShowInFolder}
|
|
148
|
+
title={labels.showInFolderTitle}
|
|
149
|
+
aria-label={labels.showInFolder}
|
|
150
|
+
>
|
|
151
|
+
<span className="icon-[solar--folder-open-linear] h-3.5 w-3.5" />
|
|
152
|
+
</Button>
|
|
153
|
+
{exportable && (
|
|
154
|
+
<Button
|
|
155
|
+
type="button"
|
|
156
|
+
variant="outline"
|
|
157
|
+
size="icon-sm"
|
|
158
|
+
onClick={onExport}
|
|
159
|
+
title={labels.exportTitle}
|
|
160
|
+
aria-label={labels.export}
|
|
161
|
+
>
|
|
162
|
+
<span className="icon-[solar--export-linear] h-3.5 w-3.5" />
|
|
163
|
+
</Button>
|
|
164
|
+
)}
|
|
165
|
+
<Button
|
|
166
|
+
type="button"
|
|
167
|
+
variant="primary"
|
|
168
|
+
size="sm"
|
|
169
|
+
onClick={onNewSession}
|
|
170
|
+
title={labels.newSession}
|
|
171
|
+
aria-label={labels.newSession}
|
|
172
|
+
>
|
|
173
|
+
<span className="icon-[solar--add-circle-linear] h-4 w-4" />
|
|
174
|
+
<span className="hidden text-[12px] font-medium @min-[22rem]:inline">
|
|
175
|
+
{labels.newSession}
|
|
176
|
+
</span>
|
|
177
|
+
</Button>
|
|
178
|
+
<Button
|
|
179
|
+
type="button"
|
|
180
|
+
variant={activityOpen ? "secondary" : "ghost"}
|
|
181
|
+
size="icon-sm"
|
|
182
|
+
title={activityOpen ? labels.closeActivityPanel : labels.openActivityPanel}
|
|
183
|
+
onClick={onToggleActivity}
|
|
184
|
+
aria-pressed={activityOpen}
|
|
185
|
+
>
|
|
186
|
+
<span className="icon-[solar--sidebar-minimalistic-linear] -scale-x-100 text-[14px]" />
|
|
187
|
+
</Button>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
{metrics.length > 0 && (
|
|
192
|
+
<div className="flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1">
|
|
193
|
+
{metrics.map((item, index) => (
|
|
194
|
+
<span
|
|
195
|
+
key={item.value}
|
|
196
|
+
className="inline-flex max-w-full items-center gap-1.5 text-[11.5px] text-muted-foreground/70"
|
|
197
|
+
>
|
|
198
|
+
{index > 0 && (
|
|
199
|
+
<span className="mr-0.5 h-3 w-px shrink-0 bg-border/50" aria-hidden />
|
|
200
|
+
)}
|
|
201
|
+
<span className={cn(item.icon, "h-3.5 w-3.5 shrink-0 opacity-60")} />
|
|
202
|
+
<span className="min-w-0 truncate whitespace-nowrap tabular-nums">
|
|
203
|
+
{item.value}
|
|
204
|
+
</span>
|
|
205
|
+
</span>
|
|
206
|
+
))}
|
|
207
|
+
</div>
|
|
208
|
+
)}
|
|
209
|
+
</div>
|
|
210
|
+
</motion.header>
|
|
211
|
+
|
|
212
|
+
{/* ── Body ────────────────────────────────────────────── */}
|
|
213
|
+
<div className="flex min-h-0 flex-1 flex-col overflow-y-auto">
|
|
214
|
+
{batchSection}
|
|
215
|
+
|
|
216
|
+
<motion.section
|
|
217
|
+
className="flex min-h-[280px] flex-1 flex-col px-4 pb-5 @md:min-h-[360px] @md:px-8 @md:pb-6"
|
|
218
|
+
initial={{ opacity: 0, y: 14 }}
|
|
219
|
+
animate={{ opacity: 1, y: 0 }}
|
|
220
|
+
transition={{ duration: 0.5, delay: 0.08, ease: easeOut }}
|
|
221
|
+
>
|
|
222
|
+
{/* Document shell */}
|
|
223
|
+
<div
|
|
224
|
+
className={cn(
|
|
225
|
+
"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-card/50 shadow-[0_1px_2px_rgba(15,23,42,0.04)] backdrop-blur-sm transition-[border-color,box-shadow] duration-300",
|
|
226
|
+
editorFocused
|
|
227
|
+
? "border-primary/40 shadow-[0_0_0_1px_color-mix(in_oklab,var(--primary)_18%,transparent),0_8px_24px_-12px_color-mix(in_oklab,var(--primary)_25%,transparent)]"
|
|
228
|
+
: "border-border/50",
|
|
229
|
+
)}
|
|
230
|
+
>
|
|
231
|
+
{/* Editor chrome */}
|
|
232
|
+
<div className="flex shrink-0 flex-wrap items-center justify-between gap-x-2 gap-y-2 border-b border-border/40 px-3 py-2 @md:px-4 @md:py-2.5">
|
|
233
|
+
<div className="flex min-w-0 flex-1 items-center gap-2">
|
|
234
|
+
<h2 className="min-w-0 truncate text-[13px] font-semibold tracking-tight text-foreground">
|
|
235
|
+
{labels.persona}
|
|
236
|
+
</h2>
|
|
237
|
+
<span className="hidden shrink-0 rounded-md border border-border/40 bg-background/60 px-1.5 py-px font-mono text-[10px] text-muted-foreground/55 @min-[22rem]:inline">
|
|
238
|
+
AGENTS.md
|
|
239
|
+
</span>
|
|
240
|
+
<AnimatePresence>
|
|
241
|
+
{isDirty && (
|
|
242
|
+
<motion.span
|
|
243
|
+
key="dirty"
|
|
244
|
+
initial={{ opacity: 0, scale: 0.6 }}
|
|
245
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
246
|
+
exit={{ opacity: 0, scale: 0.6 }}
|
|
247
|
+
className="inline-flex shrink-0 items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500"
|
|
248
|
+
title={labels.unsavedChanges}
|
|
249
|
+
>
|
|
250
|
+
<span className="relative flex h-1.5 w-1.5">
|
|
251
|
+
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-500 opacity-60" />
|
|
252
|
+
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500" />
|
|
253
|
+
</span>
|
|
254
|
+
<span className="hidden @min-[28rem]:inline">{labels.unsavedChanges}</span>
|
|
255
|
+
</motion.span>
|
|
256
|
+
)}
|
|
257
|
+
</AnimatePresence>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<div className="flex shrink-0 items-center gap-1.5">
|
|
261
|
+
<AnimatePresence mode="popLayout">
|
|
262
|
+
{saveStatus === "saved" && (
|
|
263
|
+
<motion.span
|
|
264
|
+
key="saved"
|
|
265
|
+
initial={{ opacity: 0, x: 6 }}
|
|
266
|
+
animate={{ opacity: 1, x: 0 }}
|
|
267
|
+
exit={{ opacity: 0, x: 6 }}
|
|
268
|
+
className="hidden items-center gap-1 text-[11px] font-medium text-emerald-500 @min-[22rem]:flex"
|
|
269
|
+
>
|
|
270
|
+
<span className="icon-[mdi--check-circle] h-3.5 w-3.5" />
|
|
271
|
+
{labels.saved}
|
|
272
|
+
</motion.span>
|
|
273
|
+
)}
|
|
274
|
+
{saveStatus === "error" && (
|
|
275
|
+
<motion.span
|
|
276
|
+
key="error"
|
|
277
|
+
initial={{ opacity: 0, x: 6 }}
|
|
278
|
+
animate={{ opacity: 1, x: 0 }}
|
|
279
|
+
exit={{ opacity: 0, x: 6 }}
|
|
280
|
+
className="flex items-center gap-1 text-[11px] font-medium text-destructive"
|
|
281
|
+
title={labels.saveFailed}
|
|
282
|
+
>
|
|
283
|
+
<span className="icon-[mdi--alert-circle-outline] h-3.5 w-3.5" />
|
|
284
|
+
<span className="hidden @min-[22rem]:inline">{labels.saveFailed}</span>
|
|
285
|
+
</motion.span>
|
|
286
|
+
)}
|
|
287
|
+
</AnimatePresence>
|
|
288
|
+
<Button
|
|
289
|
+
type="button"
|
|
290
|
+
variant={isDirty ? "primary" : "outline"}
|
|
291
|
+
size="sm"
|
|
292
|
+
onClick={onSave}
|
|
293
|
+
disabled={!isDirty || saveStatus === "saving"}
|
|
294
|
+
title={labels.save}
|
|
295
|
+
aria-label={labels.save}
|
|
296
|
+
>
|
|
297
|
+
{saveStatus === "saving" ? (
|
|
298
|
+
<span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
|
|
299
|
+
) : (
|
|
300
|
+
<span className="icon-[mdi--content-save-outline] h-3.5 w-3.5" />
|
|
301
|
+
)}
|
|
302
|
+
<span className="hidden @min-[18rem]:inline">{labels.save}</span>
|
|
303
|
+
</Button>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
{/* Editor body */}
|
|
308
|
+
{loading ? (
|
|
309
|
+
<div className="flex flex-1 items-center justify-center py-16">
|
|
310
|
+
<span className="icon-[mdi--loading] h-5 w-5 animate-spin text-primary/50" />
|
|
311
|
+
</div>
|
|
312
|
+
) : (
|
|
313
|
+
<div className="relative flex min-h-0 min-w-0 flex-1 flex-col">
|
|
314
|
+
<div
|
|
315
|
+
aria-hidden
|
|
316
|
+
className={cn(
|
|
317
|
+
"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-primary/50 to-transparent transition-opacity duration-300",
|
|
318
|
+
editorFocused ? "opacity-100" : "opacity-0",
|
|
319
|
+
)}
|
|
320
|
+
/>
|
|
321
|
+
<textarea
|
|
322
|
+
ref={textareaRef}
|
|
323
|
+
value={content}
|
|
324
|
+
onChange={(e) => onContentChange(e.target.value)}
|
|
325
|
+
onFocus={onEditorFocus}
|
|
326
|
+
onBlur={onEditorBlur}
|
|
327
|
+
placeholder={labels.editorPlaceholder}
|
|
328
|
+
spellCheck={false}
|
|
329
|
+
className="min-h-0 min-w-0 flex-1 resize-none bg-transparent px-3 py-3 font-mono text-[13px] leading-[1.7] text-foreground placeholder:text-muted-foreground/30 focus:outline-none @md:px-5 @md:py-4"
|
|
330
|
+
/>
|
|
331
|
+
</div>
|
|
332
|
+
)}
|
|
333
|
+
|
|
334
|
+
{/* Footer hint */}
|
|
335
|
+
<div className="flex shrink-0 items-center gap-1.5 overflow-hidden border-t border-border/30 bg-accent/10 px-3 py-2 text-[11px] text-muted-foreground/50 @md:px-4">
|
|
336
|
+
<span className="icon-[mdi--information-outline] h-3 w-3 shrink-0 opacity-60" />
|
|
337
|
+
<span className="min-w-0 flex-1 truncate">{labels.agentsMdHint}</span>
|
|
338
|
+
<kbd className="shrink-0 rounded-md border border-border/40 bg-background/70 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground/70">
|
|
339
|
+
{labels.saveShortcut}
|
|
340
|
+
</kbd>
|
|
341
|
+
<span className="hidden shrink-0 @min-[22rem]:inline">{labels.quickSave}</span>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
</motion.section>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
{activityPanel}
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
);
|
|
351
|
+
}
|