@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,85 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogDescription,
|
|
6
|
+
DialogHeader,
|
|
7
|
+
DialogTitle,
|
|
8
|
+
} from "@vetta-org/ui";
|
|
9
|
+
|
|
10
|
+
export interface KnowledgeHowItWorksStepView {
|
|
11
|
+
readonly icon: string;
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface KnowledgeHowItWorksDialogViewLabels {
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly subtitle: string;
|
|
19
|
+
readonly whyTitle: string;
|
|
20
|
+
readonly whyDesc: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface KnowledgeHowItWorksDialogViewProps {
|
|
24
|
+
readonly open: boolean;
|
|
25
|
+
readonly onClose: () => void;
|
|
26
|
+
readonly steps: readonly KnowledgeHowItWorksStepView[];
|
|
27
|
+
readonly labels: KnowledgeHowItWorksDialogViewLabels;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function KnowledgeHowItWorksDialogView({
|
|
31
|
+
open,
|
|
32
|
+
onClose,
|
|
33
|
+
steps,
|
|
34
|
+
labels,
|
|
35
|
+
}: KnowledgeHowItWorksDialogViewProps): JSX.Element {
|
|
36
|
+
return (
|
|
37
|
+
<Dialog open={open} onOpenChange={(next) => !next && onClose()}>
|
|
38
|
+
<DialogContent className="gap-0 p-0 sm:max-w-[560px]">
|
|
39
|
+
<DialogHeader className="gap-3 border-b border-border px-6 pb-5 pt-6">
|
|
40
|
+
<div className="flex items-start gap-3.5">
|
|
41
|
+
<div className="flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary ring-1 ring-inset ring-primary/15">
|
|
42
|
+
<span className="icon-[mdi--lightbulb-on-outline] h-5 w-5" />
|
|
43
|
+
</div>
|
|
44
|
+
<div className="min-w-0">
|
|
45
|
+
<DialogTitle className="text-[16px]">{labels.title}</DialogTitle>
|
|
46
|
+
<DialogDescription className="mt-1 text-[12.5px] leading-relaxed">
|
|
47
|
+
{labels.subtitle}
|
|
48
|
+
</DialogDescription>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</DialogHeader>
|
|
52
|
+
|
|
53
|
+
<div className="px-6 py-5">
|
|
54
|
+
<ol className="relative flex flex-col gap-5">
|
|
55
|
+
{/* 贯穿步骤序号的竖线,连接 1→2→3 */}
|
|
56
|
+
<span aria-hidden className="absolute left-[15px] top-4 bottom-4 w-px bg-border" />
|
|
57
|
+
{steps.map((step, index) => (
|
|
58
|
+
<li key={`${step.title}-${index}`} className="relative flex items-start gap-3.5">
|
|
59
|
+
<span className="relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-[13px] font-semibold text-primary-foreground shadow-sm">
|
|
60
|
+
{index + 1}
|
|
61
|
+
</span>
|
|
62
|
+
<div className="min-w-0 pt-0.5">
|
|
63
|
+
<div className="flex items-center gap-1.5">
|
|
64
|
+
<span className={`${step.icon} h-4 w-4 text-muted-foreground`} />
|
|
65
|
+
<span className="text-[13.5px] font-semibold text-foreground">{step.title}</span>
|
|
66
|
+
</div>
|
|
67
|
+
<p className="mt-1 text-[12.5px] leading-relaxed text-muted-foreground">
|
|
68
|
+
{step.description}
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
</li>
|
|
72
|
+
))}
|
|
73
|
+
</ol>
|
|
74
|
+
|
|
75
|
+
<div className="mt-5 flex items-start gap-2.5 rounded-xl border border-amber-500/20 bg-amber-500/[0.07] p-3.5">
|
|
76
|
+
<span className="icon-[mdi--alert-circle-outline] mt-px h-4 w-4 shrink-0 text-amber-500" />
|
|
77
|
+
<p className="text-[12.5px] leading-relaxed text-muted-foreground">
|
|
78
|
+
<span className="font-semibold text-foreground">{labels.whyTitle}</span> {labels.whyDesc}
|
|
79
|
+
</p>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</DialogContent>
|
|
83
|
+
</Dialog>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { useState, type JSX } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
cn,
|
|
11
|
+
} from "@vetta-org/ui";
|
|
12
|
+
|
|
13
|
+
const NEW_BASE = "__new__";
|
|
14
|
+
|
|
15
|
+
export interface KnowledgeImportBaseOptionView {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface KnowledgeImportDialogViewLabels {
|
|
21
|
+
readonly createTitle: string;
|
|
22
|
+
readonly addTitle: string;
|
|
23
|
+
readonly createDesc: string;
|
|
24
|
+
readonly addDesc: string;
|
|
25
|
+
readonly addTo: string;
|
|
26
|
+
readonly createBase: string;
|
|
27
|
+
readonly nameLabel: string;
|
|
28
|
+
readonly cancel: string;
|
|
29
|
+
readonly createBtn: string;
|
|
30
|
+
readonly startBtn: string;
|
|
31
|
+
readonly newBaseName: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface KnowledgeImportDialogViewProps {
|
|
35
|
+
readonly createOnly: boolean;
|
|
36
|
+
readonly knowledgeBases: readonly KnowledgeImportBaseOptionView[];
|
|
37
|
+
readonly initialTargetId: string;
|
|
38
|
+
readonly onClose: () => void;
|
|
39
|
+
readonly onConfirm: (confirmation: {
|
|
40
|
+
targetId: string | null;
|
|
41
|
+
name: string;
|
|
42
|
+
sourcePaths: string[];
|
|
43
|
+
}) => void;
|
|
44
|
+
readonly sourcePaths: readonly string[];
|
|
45
|
+
readonly labels: KnowledgeImportDialogViewLabels;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function KnowledgeImportDialogView({
|
|
49
|
+
createOnly,
|
|
50
|
+
knowledgeBases,
|
|
51
|
+
initialTargetId,
|
|
52
|
+
onClose,
|
|
53
|
+
onConfirm,
|
|
54
|
+
sourcePaths,
|
|
55
|
+
labels,
|
|
56
|
+
}: KnowledgeImportDialogViewProps): JSX.Element {
|
|
57
|
+
const [target, setTarget] = useState(initialTargetId);
|
|
58
|
+
const [name, setName] = useState(labels.newBaseName);
|
|
59
|
+
|
|
60
|
+
const creatingNew = target === NEW_BASE;
|
|
61
|
+
const validName = name.trim().length > 0 && !/[\\/]/.test(name.trim());
|
|
62
|
+
const canSubmit = creatingNew ? validName : true;
|
|
63
|
+
|
|
64
|
+
const confirm = () => {
|
|
65
|
+
onConfirm({
|
|
66
|
+
targetId: creatingNew ? null : target,
|
|
67
|
+
name: name.trim(),
|
|
68
|
+
sourcePaths: [...sourcePaths],
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Dialog open onOpenChange={(open) => !open && onClose()}>
|
|
74
|
+
<DialogContent className="sm:max-w-[460px]">
|
|
75
|
+
<DialogHeader>
|
|
76
|
+
<div className="flex items-start gap-3">
|
|
77
|
+
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">
|
|
78
|
+
<span className="icon-[mdi--folder-plus-outline] h-5 w-5" />
|
|
79
|
+
</div>
|
|
80
|
+
<div>
|
|
81
|
+
<DialogTitle>{createOnly ? labels.createTitle : labels.addTitle}</DialogTitle>
|
|
82
|
+
<DialogDescription className="mt-1">
|
|
83
|
+
{createOnly ? labels.createDesc : labels.addDesc}
|
|
84
|
+
</DialogDescription>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</DialogHeader>
|
|
88
|
+
|
|
89
|
+
{!createOnly && knowledgeBases.length > 0 && (
|
|
90
|
+
<div className="grid gap-1.5">
|
|
91
|
+
<span className="text-[11px] font-medium text-foreground">{labels.addTo}</span>
|
|
92
|
+
<div className="max-h-44 overflow-y-auto rounded-lg border border-border/60 p-1">
|
|
93
|
+
{knowledgeBases.map((base) => (
|
|
94
|
+
<button
|
|
95
|
+
key={base.id}
|
|
96
|
+
type="button"
|
|
97
|
+
onClick={() => setTarget(base.id)}
|
|
98
|
+
className={cn(
|
|
99
|
+
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px] transition-colors",
|
|
100
|
+
target === base.id ? "bg-primary/10 text-foreground" : "hover:bg-accent",
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
<span className="icon-[mdi--book-outline] h-4 w-4 text-muted-foreground" />
|
|
104
|
+
<span className="min-w-0 flex-1 truncate">{base.name}</span>
|
|
105
|
+
{target === base.id && <span className="icon-[mdi--check] h-4 w-4 text-primary" />}
|
|
106
|
+
</button>
|
|
107
|
+
))}
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
onClick={() => setTarget(NEW_BASE)}
|
|
111
|
+
className={cn(
|
|
112
|
+
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px] font-medium transition-colors",
|
|
113
|
+
creatingNew ? "bg-primary/10 text-primary" : "text-primary hover:bg-primary/10",
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
<span className="icon-[mdi--plus] h-4 w-4" />
|
|
117
|
+
{labels.createBase}
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
|
|
123
|
+
{creatingNew && (
|
|
124
|
+
<label htmlFor="knowledge-base-name" className="text-[11px] font-medium text-foreground">
|
|
125
|
+
{labels.nameLabel}
|
|
126
|
+
<input
|
|
127
|
+
id="knowledge-base-name"
|
|
128
|
+
value={name}
|
|
129
|
+
onChange={(event) => setName(event.target.value)}
|
|
130
|
+
className={cn(
|
|
131
|
+
"mt-1.5 h-9 w-full min-w-0 rounded-lg border border-border/60 bg-background px-2.5 py-1 text-[12px] font-normal shadow-none outline-none focus-visible:border-ring/60",
|
|
132
|
+
)}
|
|
133
|
+
// biome-ignore lint/a11y/noAutofocus: preserve original dialog focus
|
|
134
|
+
autoFocus
|
|
135
|
+
/>
|
|
136
|
+
</label>
|
|
137
|
+
)}
|
|
138
|
+
|
|
139
|
+
<DialogFooter>
|
|
140
|
+
<Button variant="ghost" onClick={onClose}>
|
|
141
|
+
{labels.cancel}
|
|
142
|
+
</Button>
|
|
143
|
+
<Button variant="primary" disabled={!canSubmit} onClick={confirm}>
|
|
144
|
+
<span className="icon-[mdi--folder-check-outline] h-4 w-4" />
|
|
145
|
+
{createOnly ? labels.createBtn : labels.startBtn}
|
|
146
|
+
</Button>
|
|
147
|
+
</DialogFooter>
|
|
148
|
+
</DialogContent>
|
|
149
|
+
</Dialog>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export { NEW_BASE as KNOWLEDGE_IMPORT_NEW_BASE };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { getColoredFileIcon } from "./coloredFileIcons";
|
|
3
|
+
import { cn } from "./cn";
|
|
4
|
+
import { KnowledgeEmptyState, StatusBadge, type KnowledgeViewProps } from "./KnowledgeViewShared";
|
|
5
|
+
import { formatFileSize, knowledgeDirItemCount } from "./types";
|
|
6
|
+
import { useMarqueeSelection } from "./useMarqueeSelection";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Mac Finder-style file list: icon + name + size / item count.
|
|
10
|
+
*/
|
|
11
|
+
export function KnowledgeListView({
|
|
12
|
+
nodes,
|
|
13
|
+
searching,
|
|
14
|
+
selectedIds,
|
|
15
|
+
statusFor,
|
|
16
|
+
onItemClick,
|
|
17
|
+
onOpen,
|
|
18
|
+
onContextMenu,
|
|
19
|
+
onSelectIds,
|
|
20
|
+
onClearSelection,
|
|
21
|
+
labels,
|
|
22
|
+
}: KnowledgeViewProps): JSX.Element {
|
|
23
|
+
const { scrollRef, marquee, onMouseDown } = useMarqueeSelection({
|
|
24
|
+
selectedIds,
|
|
25
|
+
onSelectIds,
|
|
26
|
+
onClearSelection,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: marquee selection; keyboard via Esc/arrows
|
|
31
|
+
<div
|
|
32
|
+
ref={scrollRef}
|
|
33
|
+
className="relative min-h-0 flex-1 overflow-y-auto"
|
|
34
|
+
onMouseDown={onMouseDown}
|
|
35
|
+
>
|
|
36
|
+
{nodes.length === 0 ? (
|
|
37
|
+
<KnowledgeEmptyState searching={searching} labels={labels} />
|
|
38
|
+
) : (
|
|
39
|
+
<div className="relative min-h-full">
|
|
40
|
+
<div className="flex flex-col py-2">
|
|
41
|
+
{nodes.map((node) => {
|
|
42
|
+
const isDir = node.type === "directory";
|
|
43
|
+
const selected = selectedIds.has(node.id);
|
|
44
|
+
const status = statusFor(node);
|
|
45
|
+
const unprocessed = status === "unprocessed";
|
|
46
|
+
return (
|
|
47
|
+
<button
|
|
48
|
+
key={node.id}
|
|
49
|
+
type="button"
|
|
50
|
+
data-knode
|
|
51
|
+
data-knode-id={node.id}
|
|
52
|
+
onClick={(e) => onItemClick(node, e)}
|
|
53
|
+
onDoubleClick={() => onOpen(node)}
|
|
54
|
+
onContextMenu={(e) => {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
onContextMenu(node, e);
|
|
57
|
+
}}
|
|
58
|
+
className={cn(
|
|
59
|
+
"group/row flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left transition-colors",
|
|
60
|
+
selected ? "bg-primary/10" : "hover:bg-foreground/[0.04]",
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
<span className="relative flex h-9 w-9 shrink-0 items-center justify-center">
|
|
64
|
+
<span
|
|
65
|
+
className={cn(
|
|
66
|
+
getColoredFileIcon(node.name, isDir),
|
|
67
|
+
"h-6 w-6 shrink-0",
|
|
68
|
+
unprocessed && "opacity-40 grayscale",
|
|
69
|
+
)}
|
|
70
|
+
/>
|
|
71
|
+
{status && status !== "processed" && (
|
|
72
|
+
<StatusBadge status={status} labels={labels} />
|
|
73
|
+
)}
|
|
74
|
+
</span>
|
|
75
|
+
<span
|
|
76
|
+
className={cn(
|
|
77
|
+
"min-w-0 flex-1 truncate text-[13px] leading-5",
|
|
78
|
+
selected ? "text-foreground" : "text-foreground/90",
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
81
|
+
{node.name}
|
|
82
|
+
</span>
|
|
83
|
+
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground/55">
|
|
84
|
+
{isDir
|
|
85
|
+
? labels.itemCount(knowledgeDirItemCount(node))
|
|
86
|
+
: formatFileSize(node.size)}
|
|
87
|
+
</span>
|
|
88
|
+
</button>
|
|
89
|
+
);
|
|
90
|
+
})}
|
|
91
|
+
</div>
|
|
92
|
+
{marquee && (
|
|
93
|
+
<div
|
|
94
|
+
className="pointer-events-none absolute z-10 rounded-sm border border-primary/50 bg-primary/10"
|
|
95
|
+
style={{
|
|
96
|
+
left: marquee.left,
|
|
97
|
+
top: marquee.top,
|
|
98
|
+
width: marquee.width,
|
|
99
|
+
height: marquee.height,
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
)}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@vetta-org/ui";
|
|
3
|
+
import { getColoredFileIcon } from "./coloredFileIcons";
|
|
4
|
+
|
|
5
|
+
export interface KnowledgePendingFileRowView {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly dir: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface KnowledgePendingFilesDialogViewLabels {
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly empty: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface KnowledgePendingFilesDialogViewProps {
|
|
17
|
+
/** 当前库显示名,根目录文件的目录标签回退到它。 */
|
|
18
|
+
readonly baseName: string;
|
|
19
|
+
readonly files: readonly KnowledgePendingFileRowView[];
|
|
20
|
+
/** 点击某项:跳到其所在目录并高亮。 */
|
|
21
|
+
readonly onPick: (fileId: string) => void;
|
|
22
|
+
readonly onClose: () => void;
|
|
23
|
+
readonly labels: KnowledgePendingFilesDialogViewLabels;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 待加工(未加工)文件平铺清单:图标 + 文件名 + 灰字相对目录;点击跳转到对应目录。 */
|
|
27
|
+
export function KnowledgePendingFilesDialogView({
|
|
28
|
+
baseName,
|
|
29
|
+
files,
|
|
30
|
+
onPick,
|
|
31
|
+
onClose,
|
|
32
|
+
labels,
|
|
33
|
+
}: KnowledgePendingFilesDialogViewProps): JSX.Element {
|
|
34
|
+
return (
|
|
35
|
+
<Dialog open onOpenChange={(open) => !open && onClose()}>
|
|
36
|
+
<DialogContent className="sm:max-w-[560px]">
|
|
37
|
+
<DialogHeader>
|
|
38
|
+
<DialogTitle>{labels.title}</DialogTitle>
|
|
39
|
+
</DialogHeader>
|
|
40
|
+
|
|
41
|
+
{files.length === 0 ? (
|
|
42
|
+
<div className="flex flex-col items-center justify-center gap-2 py-12 text-center">
|
|
43
|
+
<span className="icon-[mdi--check-circle-outline] h-9 w-9 text-primary/70" />
|
|
44
|
+
<p className="text-[13px] text-muted-foreground">{labels.empty}</p>
|
|
45
|
+
</div>
|
|
46
|
+
) : (
|
|
47
|
+
<div className="-mx-1 max-h-[60vh] overflow-y-auto px-1 py-1">
|
|
48
|
+
<div className="flex flex-col">
|
|
49
|
+
{files.map((file) => (
|
|
50
|
+
<button
|
|
51
|
+
key={file.id}
|
|
52
|
+
type="button"
|
|
53
|
+
onClick={() => onPick(file.id)}
|
|
54
|
+
className="group flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-foreground/[0.05]"
|
|
55
|
+
>
|
|
56
|
+
<span
|
|
57
|
+
className={`${getColoredFileIcon(file.name, false)} h-5 w-5 shrink-0 opacity-40 grayscale`}
|
|
58
|
+
/>
|
|
59
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
60
|
+
<span className="truncate text-[13px] leading-5 text-foreground/90">
|
|
61
|
+
{file.name}
|
|
62
|
+
</span>
|
|
63
|
+
<span className="truncate text-[11px] leading-4 text-muted-foreground/55">
|
|
64
|
+
{file.dir || baseName}
|
|
65
|
+
</span>
|
|
66
|
+
</span>
|
|
67
|
+
<span className="icon-[mdi--arrow-top-right] h-4 w-4 shrink-0 text-muted-foreground/30 transition-colors group-hover:text-muted-foreground/70" />
|
|
68
|
+
</button>
|
|
69
|
+
))}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
</DialogContent>
|
|
74
|
+
</Dialog>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
|
|
3
|
+
export interface KnowledgeProcessingBadgeViewProps {
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 顶栏标题右侧徽标:知识库后台加工(建立索引)进行中时显示,带 spin 动画。
|
|
9
|
+
* 空闲时由 host container 渲染 null,本 View 仅负责 badge UI。
|
|
10
|
+
*/
|
|
11
|
+
export function KnowledgeProcessingBadgeView({ label }: KnowledgeProcessingBadgeViewProps): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<span className="no-drag inline-flex shrink-0 items-center gap-1.5 rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-medium text-primary">
|
|
14
|
+
<span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
|
|
15
|
+
{label}
|
|
16
|
+
</span>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useState, type JSX } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogFooter,
|
|
7
|
+
DialogHeader,
|
|
8
|
+
DialogTitle,
|
|
9
|
+
cn,
|
|
10
|
+
} from "@vetta-org/ui";
|
|
11
|
+
|
|
12
|
+
export interface KnowledgeRenameDialogViewLabels {
|
|
13
|
+
readonly cancel: string;
|
|
14
|
+
readonly confirm: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface KnowledgeRenameDialogViewProps {
|
|
18
|
+
readonly title: string;
|
|
19
|
+
readonly initialName: string;
|
|
20
|
+
readonly onClose: () => void;
|
|
21
|
+
readonly onSubmit: (newName: string) => void;
|
|
22
|
+
readonly labels: KnowledgeRenameDialogViewLabels;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function KnowledgeRenameDialogView({
|
|
26
|
+
title,
|
|
27
|
+
initialName,
|
|
28
|
+
onClose,
|
|
29
|
+
onSubmit,
|
|
30
|
+
labels,
|
|
31
|
+
}: KnowledgeRenameDialogViewProps): JSX.Element {
|
|
32
|
+
const [name, setName] = useState(initialName);
|
|
33
|
+
const trimmed = name.trim();
|
|
34
|
+
const canSubmit = trimmed.length > 0 && trimmed !== initialName && !/[\\/]/.test(trimmed);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Dialog open onOpenChange={(open) => !open && onClose()}>
|
|
38
|
+
<DialogContent className="sm:max-w-[420px]">
|
|
39
|
+
<DialogHeader>
|
|
40
|
+
<DialogTitle>{title}</DialogTitle>
|
|
41
|
+
</DialogHeader>
|
|
42
|
+
<input
|
|
43
|
+
value={name}
|
|
44
|
+
onChange={(event) => setName(event.target.value)}
|
|
45
|
+
className={cn(
|
|
46
|
+
"h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-2.5 py-1 text-base shadow-none transition-[border-color,background-color] outline-none placeholder:text-muted-foreground hover:border-border focus-visible:border-ring/60 md:text-sm dark:bg-input/20",
|
|
47
|
+
"h-9 bg-background text-[12px]",
|
|
48
|
+
)}
|
|
49
|
+
// biome-ignore lint/a11y/noAutofocus: preserve original dialog focus behavior
|
|
50
|
+
autoFocus
|
|
51
|
+
onKeyDown={(event) => {
|
|
52
|
+
if (event.key === "Enter" && canSubmit) onSubmit(trimmed);
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
<DialogFooter>
|
|
56
|
+
<Button variant="ghost" onClick={onClose}>
|
|
57
|
+
{labels.cancel}
|
|
58
|
+
</Button>
|
|
59
|
+
<Button variant="primary" disabled={!canSubmit} onClick={() => onSubmit(trimmed)}>
|
|
60
|
+
{labels.confirm}
|
|
61
|
+
</Button>
|
|
62
|
+
</DialogFooter>
|
|
63
|
+
</DialogContent>
|
|
64
|
+
</Dialog>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useState, type JSX } from "react";
|
|
2
|
+
import { Button, Popover, PopoverContent, PopoverTrigger } from "@vetta-org/ui";
|
|
3
|
+
|
|
4
|
+
export interface KnowledgeSourcePickerViewLabels {
|
|
5
|
+
readonly addMaterials: string;
|
|
6
|
+
readonly pickFiles: string;
|
|
7
|
+
readonly pickFolders: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface KnowledgeSourcePickerViewProps {
|
|
11
|
+
readonly onPickFiles: () => void;
|
|
12
|
+
readonly onPickFolders: () => void;
|
|
13
|
+
readonly size?: "sm";
|
|
14
|
+
readonly labels: KnowledgeSourcePickerViewLabels;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function KnowledgeSourcePickerView({
|
|
18
|
+
onPickFiles,
|
|
19
|
+
onPickFolders,
|
|
20
|
+
size,
|
|
21
|
+
labels,
|
|
22
|
+
}: KnowledgeSourcePickerViewProps): JSX.Element {
|
|
23
|
+
const [open, setOpen] = useState(false);
|
|
24
|
+
const runAndClose = (action: () => void) => {
|
|
25
|
+
setOpen(false);
|
|
26
|
+
action();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
31
|
+
<PopoverTrigger asChild>
|
|
32
|
+
<Button variant="outline" size={size}>
|
|
33
|
+
<span className="icon-[mdi--file-plus-outline] h-4 w-4" />
|
|
34
|
+
{labels.addMaterials}
|
|
35
|
+
<span className="icon-[mdi--chevron-down] h-3.5 w-3.5 text-muted-foreground" />
|
|
36
|
+
</Button>
|
|
37
|
+
</PopoverTrigger>
|
|
38
|
+
<PopoverContent align="end" className="w-44 gap-1 p-1">
|
|
39
|
+
<Button
|
|
40
|
+
type="button"
|
|
41
|
+
variant="ghost"
|
|
42
|
+
onClick={() => runAndClose(onPickFiles)}
|
|
43
|
+
className="h-8 w-full justify-start px-2.5 text-[12px] text-foreground"
|
|
44
|
+
>
|
|
45
|
+
<span className="icon-[mdi--file-multiple-outline] h-4 w-4 text-muted-foreground" />
|
|
46
|
+
{labels.pickFiles}
|
|
47
|
+
</Button>
|
|
48
|
+
<Button
|
|
49
|
+
type="button"
|
|
50
|
+
variant="ghost"
|
|
51
|
+
onClick={() => runAndClose(onPickFolders)}
|
|
52
|
+
className="h-8 w-full justify-start px-2.5 text-[12px] text-foreground"
|
|
53
|
+
>
|
|
54
|
+
<span className="icon-[mdi--folder-multiple-outline] h-4 w-4 text-muted-foreground" />
|
|
55
|
+
{labels.pickFolders}
|
|
56
|
+
</Button>
|
|
57
|
+
</PopoverContent>
|
|
58
|
+
</Popover>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { motion } from "motion/react";
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
import { cn } from "./cn";
|
|
4
|
+
import type { KnowledgeProcessStatus, KnowledgeViewNode } from "./types";
|
|
5
|
+
|
|
6
|
+
export type { KnowledgeProcessStatus, KnowledgeViewNode } from "./types";
|
|
7
|
+
export { formatFileSize, knowledgeDirItemCount } from "./types";
|
|
8
|
+
|
|
9
|
+
/** Shared interaction contract for grid / list file views. */
|
|
10
|
+
export interface KnowledgeViewProps {
|
|
11
|
+
nodes: KnowledgeViewNode[];
|
|
12
|
+
searching: boolean;
|
|
13
|
+
selectedIds: Set<string>;
|
|
14
|
+
statusFor: (node: KnowledgeViewNode) => KnowledgeProcessStatus | null;
|
|
15
|
+
onItemClick: (node: KnowledgeViewNode, event: React.MouseEvent) => void;
|
|
16
|
+
onOpen: (node: KnowledgeViewNode) => void;
|
|
17
|
+
onContextMenu: (node: KnowledgeViewNode, event: React.MouseEvent) => void;
|
|
18
|
+
onSelectIds: (ids: Set<string>) => void;
|
|
19
|
+
onClearSelection: () => void;
|
|
20
|
+
labels: KnowledgeViewLabels;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface KnowledgeViewLabels {
|
|
24
|
+
badgeFailed: string;
|
|
25
|
+
badgeStale: string;
|
|
26
|
+
badgeUnprocessed: string;
|
|
27
|
+
emptySearchTitle: string;
|
|
28
|
+
emptySearchDesc: string;
|
|
29
|
+
emptyDirTitle: string;
|
|
30
|
+
emptyDirDesc: string;
|
|
31
|
+
itemCount: (n: number) => string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function StatusBadge({
|
|
35
|
+
status,
|
|
36
|
+
labels,
|
|
37
|
+
}: {
|
|
38
|
+
status: KnowledgeProcessStatus;
|
|
39
|
+
labels: Pick<KnowledgeViewLabels, "badgeFailed" | "badgeStale" | "badgeUnprocessed">;
|
|
40
|
+
}): JSX.Element {
|
|
41
|
+
const config =
|
|
42
|
+
status === "failed"
|
|
43
|
+
? { icon: "icon-[mdi--alert-circle-outline]", title: labels.badgeFailed, tone: "bg-red-500 text-white" }
|
|
44
|
+
: status === "stale"
|
|
45
|
+
? { icon: "icon-[mdi--sync-alert]", title: labels.badgeStale, tone: "bg-amber-500 text-white" }
|
|
46
|
+
: {
|
|
47
|
+
icon: "icon-[mdi--timer-sand]",
|
|
48
|
+
title: labels.badgeUnprocessed,
|
|
49
|
+
tone: "bg-muted-foreground/70 text-white",
|
|
50
|
+
};
|
|
51
|
+
return (
|
|
52
|
+
<span
|
|
53
|
+
title={config.title}
|
|
54
|
+
className={cn(
|
|
55
|
+
"absolute right-0 bottom-0 flex h-4 w-4 items-center justify-center rounded-full shadow-sm ring-2 ring-background",
|
|
56
|
+
config.tone,
|
|
57
|
+
)}
|
|
58
|
+
>
|
|
59
|
+
<span className={cn(config.icon, "h-2.5 w-2.5")} />
|
|
60
|
+
</span>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const EMPTY_EASE = [0.22, 1, 0.36, 1] as const;
|
|
65
|
+
|
|
66
|
+
export function KnowledgeEmptyState({
|
|
67
|
+
searching,
|
|
68
|
+
labels,
|
|
69
|
+
}: {
|
|
70
|
+
searching: boolean;
|
|
71
|
+
labels: Pick<
|
|
72
|
+
KnowledgeViewLabels,
|
|
73
|
+
"emptySearchTitle" | "emptySearchDesc" | "emptyDirTitle" | "emptyDirDesc"
|
|
74
|
+
>;
|
|
75
|
+
}): JSX.Element {
|
|
76
|
+
return (
|
|
77
|
+
<div className="flex h-full items-center justify-center px-8 py-10">
|
|
78
|
+
<motion.div
|
|
79
|
+
initial={{ opacity: 0, y: 8 }}
|
|
80
|
+
animate={{ opacity: 1, y: 0 }}
|
|
81
|
+
transition={{ duration: 0.4, ease: EMPTY_EASE }}
|
|
82
|
+
className="flex max-w-xs flex-col items-center text-center"
|
|
83
|
+
>
|
|
84
|
+
<div className="relative mb-5 flex h-16 w-16 items-center justify-center">
|
|
85
|
+
<span className="absolute inset-0 rounded-3xl bg-muted/40" />
|
|
86
|
+
<span className="absolute inset-1.5 rounded-2xl bg-background/60 ring-1 ring-inset ring-border/50" />
|
|
87
|
+
<span
|
|
88
|
+
className={cn(
|
|
89
|
+
"relative h-7 w-7 text-muted-foreground/40",
|
|
90
|
+
searching ? "icon-[mdi--magnify]" : "icon-[mdi--folder-open-outline]",
|
|
91
|
+
)}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
<p className="text-[13px] font-medium text-foreground/80">
|
|
95
|
+
{searching ? labels.emptySearchTitle : labels.emptyDirTitle}
|
|
96
|
+
</p>
|
|
97
|
+
<p className="mt-1.5 text-[11px] leading-5 text-muted-foreground/50">
|
|
98
|
+
{searching ? labels.emptySearchDesc : labels.emptyDirDesc}
|
|
99
|
+
</p>
|
|
100
|
+
</motion.div>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getFileIcon as getColoredFileIcon } from "../shared/fileIcons";
|