@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,73 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import type { JSX, ReactNode, Ref, UIEventHandler } from "react";
|
|
3
|
+
|
|
4
|
+
export interface ChatPanelViewLabels {
|
|
5
|
+
loadingMore: string;
|
|
6
|
+
noMore: string;
|
|
7
|
+
empty: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ChatPanelViewProps {
|
|
11
|
+
labels: ChatPanelViewLabels;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
loadingMore: boolean;
|
|
14
|
+
hasMore: boolean;
|
|
15
|
+
isEmpty: boolean;
|
|
16
|
+
scrollerRef: Ref<HTMLDivElement>;
|
|
17
|
+
onScroll: UIEventHandler<HTMLDivElement>;
|
|
18
|
+
membersBar: ReactNode;
|
|
19
|
+
messageList: ReactNode;
|
|
20
|
+
composer: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Flowing-chat panel shell: members bar + scroll list + composer slots.
|
|
25
|
+
*/
|
|
26
|
+
export function ChatPanelView({
|
|
27
|
+
labels,
|
|
28
|
+
loading,
|
|
29
|
+
loadingMore,
|
|
30
|
+
hasMore,
|
|
31
|
+
isEmpty,
|
|
32
|
+
scrollerRef,
|
|
33
|
+
onScroll,
|
|
34
|
+
membersBar,
|
|
35
|
+
messageList,
|
|
36
|
+
composer,
|
|
37
|
+
}: ChatPanelViewProps): JSX.Element {
|
|
38
|
+
return (
|
|
39
|
+
<div className="flex h-full min-h-0 flex-col bg-gradient-to-b from-background via-background to-muted/20">
|
|
40
|
+
{membersBar}
|
|
41
|
+
<div
|
|
42
|
+
ref={scrollerRef}
|
|
43
|
+
onScroll={onScroll}
|
|
44
|
+
className={cn(
|
|
45
|
+
"flex-1 overflow-y-auto px-4 py-3 transition-opacity duration-200",
|
|
46
|
+
loading && "opacity-0",
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
{loadingMore && (
|
|
50
|
+
<div className="flex items-center justify-center gap-1.5 py-2 text-[10.5px] text-muted-foreground/60">
|
|
51
|
+
<span className="icon-[mdi--loading] h-3 w-3 animate-spin" />
|
|
52
|
+
{labels.loadingMore}
|
|
53
|
+
</div>
|
|
54
|
+
)}
|
|
55
|
+
{!hasMore && !loading && !isEmpty && (
|
|
56
|
+
<div className="py-2 text-center text-[10px] uppercase tracking-wider text-muted-foreground/40">
|
|
57
|
+
{labels.noMore}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
{!loading && isEmpty && (
|
|
61
|
+
<div className="flex h-full flex-col items-center justify-center gap-3 text-muted-foreground/40">
|
|
62
|
+
<div className="flex h-14 w-14 items-center justify-center rounded-2xl bg-muted/40">
|
|
63
|
+
<span className="icon-[mdi--message-text-outline] text-[24px]" />
|
|
64
|
+
</div>
|
|
65
|
+
<span className="text-[12px]">{labels.empty}</span>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
{messageList}
|
|
69
|
+
</div>
|
|
70
|
+
{composer}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
ChatBubbleReplySnapshot,
|
|
3
|
+
ChatBubbleViewLabels,
|
|
4
|
+
ChatBubbleViewProps,
|
|
5
|
+
} from "./ChatBubbleView";
|
|
6
|
+
export { ChatBubbleView } from "./ChatBubbleView";
|
|
7
|
+
export type {
|
|
8
|
+
ChatComposerMember,
|
|
9
|
+
ChatComposerReplyMessage,
|
|
10
|
+
ChatComposerViewHandle,
|
|
11
|
+
ChatComposerViewProps,
|
|
12
|
+
} from "./ChatComposerView";
|
|
13
|
+
export { ChatComposerView } from "./ChatComposerView";
|
|
14
|
+
export type {
|
|
15
|
+
ChatMembersBarMember,
|
|
16
|
+
ChatMembersBarViewLabels,
|
|
17
|
+
ChatMembersBarViewProps,
|
|
18
|
+
} from "./ChatMembersBarView";
|
|
19
|
+
export { ChatMembersBarView } from "./ChatMembersBarView";
|
|
20
|
+
export type { ChatPanelViewLabels, ChatPanelViewProps } from "./ChatPanelView";
|
|
21
|
+
export { ChatPanelView } from "./ChatPanelView";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./app";
|
|
2
|
+
import "./registry";
|
|
3
|
+
|
|
4
|
+
export * from "./action-approval";
|
|
5
|
+
export * from "./activity";
|
|
6
|
+
export * from "./app-shell";
|
|
7
|
+
export * from "./appearance";
|
|
8
|
+
export * from "./batch-tasks";
|
|
9
|
+
export * from "./chat";
|
|
10
|
+
export * from "./file-explorer";
|
|
11
|
+
export * from "./file-preview";
|
|
12
|
+
export * from "./flowing";
|
|
13
|
+
export * from "./flowing-chat";
|
|
14
|
+
export * from "./knowledge";
|
|
15
|
+
export * from "./layout";
|
|
16
|
+
export * from "./overlays";
|
|
17
|
+
export * from "./project";
|
|
18
|
+
export * from "./scheduler";
|
|
19
|
+
export * from "./settings";
|
|
20
|
+
export * from "./shared";
|
|
21
|
+
export * from "./sidebar";
|
|
22
|
+
export * from "./skills";
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
import { Button, Popover, PopoverContent, PopoverTrigger, cn } from "@vetta-org/ui";
|
|
3
|
+
|
|
4
|
+
export interface KnowledgeBaseSwitcherItemView {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly active: boolean;
|
|
8
|
+
readonly isDefault: boolean;
|
|
9
|
+
readonly fileCountLabel: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface KnowledgeBaseSwitcherViewLabels {
|
|
13
|
+
readonly switchLabel: string;
|
|
14
|
+
readonly renameCurrent: string;
|
|
15
|
+
readonly deleteCurrent: string;
|
|
16
|
+
readonly viewAll: string;
|
|
17
|
+
readonly createBase: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface KnowledgeBaseSwitcherViewProps {
|
|
21
|
+
readonly open: boolean;
|
|
22
|
+
readonly onOpenChange: (open: boolean) => void;
|
|
23
|
+
readonly activeName: string;
|
|
24
|
+
readonly basesCount: number;
|
|
25
|
+
readonly items: readonly KnowledgeBaseSwitcherItemView[];
|
|
26
|
+
readonly showManageCurrent: boolean;
|
|
27
|
+
readonly onSelect: (id: string) => void;
|
|
28
|
+
readonly onStartRename: () => void;
|
|
29
|
+
readonly onConfirmDelete: () => void;
|
|
30
|
+
readonly onViewAll: () => void;
|
|
31
|
+
readonly onCreate: () => void;
|
|
32
|
+
readonly labels: KnowledgeBaseSwitcherViewLabels;
|
|
33
|
+
/** Host owns rename dialog (may still use desktop KnowledgeRenameDialog adapter). */
|
|
34
|
+
readonly renameDialog?: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function KnowledgeBaseSwitcherView({
|
|
38
|
+
open,
|
|
39
|
+
onOpenChange,
|
|
40
|
+
activeName,
|
|
41
|
+
basesCount,
|
|
42
|
+
items,
|
|
43
|
+
showManageCurrent,
|
|
44
|
+
onSelect,
|
|
45
|
+
onStartRename,
|
|
46
|
+
onConfirmDelete,
|
|
47
|
+
onViewAll,
|
|
48
|
+
onCreate,
|
|
49
|
+
labels,
|
|
50
|
+
renameDialog,
|
|
51
|
+
}: KnowledgeBaseSwitcherViewProps): JSX.Element {
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<Popover open={open} onOpenChange={onOpenChange}>
|
|
55
|
+
<PopoverTrigger asChild>
|
|
56
|
+
<button type="button" className="group flex max-w-full items-center gap-2 text-left">
|
|
57
|
+
<h1 className="truncate text-[24px] font-bold tracking-tight text-foreground">
|
|
58
|
+
{activeName}
|
|
59
|
+
</h1>
|
|
60
|
+
<span
|
|
61
|
+
className={cn(
|
|
62
|
+
"icon-[mdi--chevron-down] h-5 w-5 shrink-0 text-muted-foreground transition-transform",
|
|
63
|
+
open && "rotate-180",
|
|
64
|
+
)}
|
|
65
|
+
/>
|
|
66
|
+
{basesCount > 1 && (
|
|
67
|
+
<span className="shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary">
|
|
68
|
+
{basesCount}
|
|
69
|
+
</span>
|
|
70
|
+
)}
|
|
71
|
+
</button>
|
|
72
|
+
</PopoverTrigger>
|
|
73
|
+
<PopoverContent align="start" className="w-80 gap-1 p-1.5">
|
|
74
|
+
<div className="px-2 pb-1 pt-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground/50">
|
|
75
|
+
{labels.switchLabel}
|
|
76
|
+
</div>
|
|
77
|
+
{items.map((item) => (
|
|
78
|
+
<Button
|
|
79
|
+
key={item.id}
|
|
80
|
+
type="button"
|
|
81
|
+
variant="ghost"
|
|
82
|
+
onClick={() => onSelect(item.id)}
|
|
83
|
+
className={cn(
|
|
84
|
+
"h-auto w-full justify-start gap-2.5 px-2 py-2 text-left",
|
|
85
|
+
item.active ? "bg-primary/10" : "hover:bg-accent",
|
|
86
|
+
)}
|
|
87
|
+
>
|
|
88
|
+
<span
|
|
89
|
+
className={cn(
|
|
90
|
+
"h-4 w-4 shrink-0",
|
|
91
|
+
item.isDefault ? "icon-[mdi--account-circle-outline]" : "icon-[mdi--book-outline]",
|
|
92
|
+
item.active ? "text-primary" : "text-muted-foreground",
|
|
93
|
+
)}
|
|
94
|
+
/>
|
|
95
|
+
<div className="min-w-0 flex-1">
|
|
96
|
+
<p className="truncate text-[12px] font-medium text-foreground">{item.name}</p>
|
|
97
|
+
<p className="mt-0.5 text-[10px] text-muted-foreground/55">{item.fileCountLabel}</p>
|
|
98
|
+
</div>
|
|
99
|
+
{item.active && <span className="icon-[mdi--check] h-4 w-4 text-primary" />}
|
|
100
|
+
</Button>
|
|
101
|
+
))}
|
|
102
|
+
|
|
103
|
+
<div className="my-1 h-px bg-border/60" />
|
|
104
|
+
|
|
105
|
+
{showManageCurrent && (
|
|
106
|
+
<>
|
|
107
|
+
<Button
|
|
108
|
+
type="button"
|
|
109
|
+
variant="ghost"
|
|
110
|
+
onClick={onStartRename}
|
|
111
|
+
className="h-8 w-full justify-start gap-2 px-2 text-[12px] text-foreground"
|
|
112
|
+
>
|
|
113
|
+
<span className="icon-[mdi--rename-outline] h-4 w-4 text-muted-foreground" />
|
|
114
|
+
{labels.renameCurrent}
|
|
115
|
+
</Button>
|
|
116
|
+
<Button
|
|
117
|
+
type="button"
|
|
118
|
+
variant="ghost"
|
|
119
|
+
onClick={onConfirmDelete}
|
|
120
|
+
className="h-8 w-full justify-start gap-2 px-2 text-[12px] text-red-600 hover:bg-red-500/10 hover:text-red-600"
|
|
121
|
+
>
|
|
122
|
+
<span className="icon-[mdi--trash-can-outline] h-4 w-4" />
|
|
123
|
+
{labels.deleteCurrent}
|
|
124
|
+
</Button>
|
|
125
|
+
<div className="my-1 h-px bg-border/60" />
|
|
126
|
+
</>
|
|
127
|
+
)}
|
|
128
|
+
|
|
129
|
+
<Button
|
|
130
|
+
type="button"
|
|
131
|
+
variant="ghost"
|
|
132
|
+
onClick={onViewAll}
|
|
133
|
+
className="h-8 w-full justify-start gap-2 px-2 text-[12px] text-foreground"
|
|
134
|
+
>
|
|
135
|
+
<span className="icon-[mdi--view-grid-outline] h-4 w-4 text-muted-foreground" />
|
|
136
|
+
<span className="flex-1 text-left">{labels.viewAll}</span>
|
|
137
|
+
<span className="text-[10px] tabular-nums text-muted-foreground/45">{basesCount}</span>
|
|
138
|
+
</Button>
|
|
139
|
+
<Button
|
|
140
|
+
type="button"
|
|
141
|
+
variant="ghost"
|
|
142
|
+
onClick={onCreate}
|
|
143
|
+
className="h-8 w-full justify-start gap-2 px-2 text-[12px] font-medium text-primary hover:bg-primary/10 hover:text-primary"
|
|
144
|
+
>
|
|
145
|
+
<span className="icon-[mdi--plus] h-4 w-4" />
|
|
146
|
+
{labels.createBase}
|
|
147
|
+
</Button>
|
|
148
|
+
</PopoverContent>
|
|
149
|
+
</Popover>
|
|
150
|
+
|
|
151
|
+
{renameDialog}
|
|
152
|
+
</>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useState, type JSX } from "react";
|
|
2
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@vetta-org/ui";
|
|
3
|
+
import { cn } from "@vetta-org/ui";
|
|
4
|
+
|
|
5
|
+
export interface KnowledgeBreadcrumbViewProps {
|
|
6
|
+
readonly baseName: string;
|
|
7
|
+
readonly path: readonly string[];
|
|
8
|
+
readonly onNavigate: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const MAX_VISIBLE_TAIL = 2;
|
|
12
|
+
|
|
13
|
+
export function KnowledgeBreadcrumbView({
|
|
14
|
+
baseName,
|
|
15
|
+
path,
|
|
16
|
+
onNavigate,
|
|
17
|
+
}: KnowledgeBreadcrumbViewProps): JSX.Element {
|
|
18
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
19
|
+
|
|
20
|
+
const collapsed = path.length > MAX_VISIBLE_TAIL + 1;
|
|
21
|
+
const hiddenCount = collapsed ? path.length - MAX_VISIBLE_TAIL : 0;
|
|
22
|
+
const hidden = collapsed ? path.slice(0, hiddenCount) : [];
|
|
23
|
+
const tail = collapsed ? path.slice(hiddenCount) : path;
|
|
24
|
+
|
|
25
|
+
const chevron = <span className="icon-[mdi--chevron-right] h-3.5 w-3.5 shrink-0 text-muted-foreground/40" />;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex shrink-0 items-center gap-1 py-1.5 text-[12px]">
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
onClick={() => onNavigate(-1)}
|
|
32
|
+
className="flex max-w-[160px] shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent/60"
|
|
33
|
+
>
|
|
34
|
+
<span className="icon-[mdi--folder-home-outline] h-3.5 w-3.5 shrink-0" />
|
|
35
|
+
<span className="truncate">{baseName}</span>
|
|
36
|
+
</button>
|
|
37
|
+
|
|
38
|
+
{collapsed ? (
|
|
39
|
+
<span className="flex items-center gap-1">
|
|
40
|
+
{chevron}
|
|
41
|
+
<Popover open={menuOpen} onOpenChange={setMenuOpen}>
|
|
42
|
+
<PopoverTrigger asChild>
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
className="flex shrink-0 items-center rounded px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent/60"
|
|
46
|
+
>
|
|
47
|
+
<span className="icon-[mdi--dots-horizontal] h-3.5 w-3.5" />
|
|
48
|
+
</button>
|
|
49
|
+
</PopoverTrigger>
|
|
50
|
+
<PopoverContent align="start" className="w-52 gap-0.5 p-1">
|
|
51
|
+
{hidden.map((segment, index) => (
|
|
52
|
+
<button
|
|
53
|
+
key={`${segment}-${index}`}
|
|
54
|
+
type="button"
|
|
55
|
+
onClick={() => {
|
|
56
|
+
setMenuOpen(false);
|
|
57
|
+
onNavigate(index);
|
|
58
|
+
}}
|
|
59
|
+
className="flex h-8 w-full items-center gap-1.5 rounded px-2.5 text-left text-[12px] text-foreground transition-colors hover:bg-accent/60"
|
|
60
|
+
>
|
|
61
|
+
<span className="icon-[mdi--folder-outline] h-3.5 w-3.5 shrink-0 text-muted-foreground" />
|
|
62
|
+
<span className="truncate">{segment}</span>
|
|
63
|
+
</button>
|
|
64
|
+
))}
|
|
65
|
+
</PopoverContent>
|
|
66
|
+
</Popover>
|
|
67
|
+
</span>
|
|
68
|
+
) : null}
|
|
69
|
+
|
|
70
|
+
{tail.map((segment, index) => {
|
|
71
|
+
const realIndex = collapsed ? hiddenCount + index : index;
|
|
72
|
+
const isLast = realIndex === path.length - 1;
|
|
73
|
+
return (
|
|
74
|
+
<span key={`${segment}-${realIndex}`} className="flex items-center gap-1">
|
|
75
|
+
{chevron}
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
onClick={() => onNavigate(realIndex)}
|
|
79
|
+
className={cn(
|
|
80
|
+
"max-w-[200px] truncate rounded px-1.5 py-0.5 transition-colors hover:bg-accent/60",
|
|
81
|
+
isLast ? "text-foreground" : "text-muted-foreground",
|
|
82
|
+
)}
|
|
83
|
+
title={segment}
|
|
84
|
+
>
|
|
85
|
+
{segment}
|
|
86
|
+
</button>
|
|
87
|
+
</span>
|
|
88
|
+
);
|
|
89
|
+
})}
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { motion } from "motion/react";
|
|
2
|
+
import type { JSX, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
const EASE_OUT = [0.22, 1, 0.36, 1] as const;
|
|
5
|
+
|
|
6
|
+
export interface KnowledgeContentsPanelViewProps {
|
|
7
|
+
readonly breadcrumb?: ReactNode;
|
|
8
|
+
readonly content: ReactNode;
|
|
9
|
+
readonly contextMenu?: ReactNode;
|
|
10
|
+
readonly empty?: boolean;
|
|
11
|
+
readonly emptyActions?: ReactNode;
|
|
12
|
+
readonly emptyDescription?: string;
|
|
13
|
+
readonly emptyTitle?: string;
|
|
14
|
+
readonly onBackgroundClick?: (event: { target: EventTarget | null }) => void;
|
|
15
|
+
readonly renameDialog?: ReactNode;
|
|
16
|
+
readonly skeleton?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function KnowledgeContentsPanelView({
|
|
20
|
+
breadcrumb,
|
|
21
|
+
content,
|
|
22
|
+
contextMenu,
|
|
23
|
+
empty,
|
|
24
|
+
emptyActions,
|
|
25
|
+
emptyDescription,
|
|
26
|
+
emptyTitle,
|
|
27
|
+
onBackgroundClick,
|
|
28
|
+
renameDialog,
|
|
29
|
+
skeleton,
|
|
30
|
+
}: KnowledgeContentsPanelViewProps): JSX.Element {
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex min-h-0 flex-1 gap-4 px-8 pb-8">
|
|
33
|
+
<motion.div
|
|
34
|
+
initial={{ opacity: 0, scale: 0.995 }}
|
|
35
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
36
|
+
transition={{ duration: 0.32, delay: 0.04, ease: EASE_OUT }}
|
|
37
|
+
className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden"
|
|
38
|
+
>
|
|
39
|
+
{breadcrumb}
|
|
40
|
+
|
|
41
|
+
{empty ? (
|
|
42
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: background click clears selection; keyboard uses Esc
|
|
43
|
+
<div className="min-h-0 flex-1 overflow-y-auto py-3" onClick={onBackgroundClick}>
|
|
44
|
+
<motion.div
|
|
45
|
+
initial={{ opacity: 0, y: 10 }}
|
|
46
|
+
animate={{ opacity: 1, y: 0 }}
|
|
47
|
+
transition={{ duration: 0.45, ease: EASE_OUT }}
|
|
48
|
+
className="flex h-full min-h-[260px] items-center justify-center"
|
|
49
|
+
>
|
|
50
|
+
<div className="flex max-w-sm flex-col items-center px-8 text-center">
|
|
51
|
+
<div className="relative mb-5 flex h-20 w-20 items-center justify-center">
|
|
52
|
+
<span className="absolute inset-0 rounded-[1.75rem] bg-primary/10" />
|
|
53
|
+
<span className="absolute inset-2 rounded-3xl bg-background/60 ring-1 ring-inset ring-primary/15" />
|
|
54
|
+
<span className="icon-[mdi--folder-open-outline] relative h-9 w-9 text-primary/70" />
|
|
55
|
+
</div>
|
|
56
|
+
{emptyTitle && (
|
|
57
|
+
<h2 className="text-[15px] font-semibold text-foreground">{emptyTitle}</h2>
|
|
58
|
+
)}
|
|
59
|
+
{emptyDescription && (
|
|
60
|
+
<p className="mt-1.5 text-[12px] leading-5 text-muted-foreground/60">{emptyDescription}</p>
|
|
61
|
+
)}
|
|
62
|
+
{emptyActions && <div className="mt-5">{emptyActions}</div>}
|
|
63
|
+
</div>
|
|
64
|
+
</motion.div>
|
|
65
|
+
</div>
|
|
66
|
+
) : skeleton ? (
|
|
67
|
+
<div className="-mx-8 flex min-h-0 flex-1">{skeleton}</div>
|
|
68
|
+
) : (
|
|
69
|
+
content
|
|
70
|
+
)}
|
|
71
|
+
</motion.div>
|
|
72
|
+
|
|
73
|
+
{contextMenu}
|
|
74
|
+
{renameDialog}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useEffect, type JSX } from "react";
|
|
2
|
+
import { cn } from "./cn";
|
|
3
|
+
|
|
4
|
+
export interface KnowledgeContextMenuItem {
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
danger?: boolean;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface KnowledgeContextMenuViewProps {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
items: KnowledgeContextMenuItem[];
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Fixed context menu at cursor; click outside / Esc closes. */
|
|
19
|
+
export function KnowledgeContextMenuView({
|
|
20
|
+
x,
|
|
21
|
+
y,
|
|
22
|
+
items,
|
|
23
|
+
onClose,
|
|
24
|
+
}: KnowledgeContextMenuViewProps): JSX.Element {
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const onKey = (e: KeyboardEvent) => {
|
|
27
|
+
if (e.key === "Escape") onClose();
|
|
28
|
+
};
|
|
29
|
+
window.addEventListener("keydown", onKey);
|
|
30
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
31
|
+
}, [onClose]);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
className="fixed inset-0 z-[120]"
|
|
36
|
+
onClick={onClose}
|
|
37
|
+
onContextMenu={(e) => {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
onClose();
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<div
|
|
43
|
+
style={{
|
|
44
|
+
left: Math.min(x, window.innerWidth - 180),
|
|
45
|
+
top: Math.min(y, window.innerHeight - 12 - items.length * 34),
|
|
46
|
+
}}
|
|
47
|
+
className="absolute min-w-40 rounded-lg border border-border bg-popover p-1 shadow-xl"
|
|
48
|
+
onClick={(e) => e.stopPropagation()}
|
|
49
|
+
>
|
|
50
|
+
{items.map((item) => (
|
|
51
|
+
<button
|
|
52
|
+
key={item.label}
|
|
53
|
+
type="button"
|
|
54
|
+
onClick={() => {
|
|
55
|
+
item.onClick();
|
|
56
|
+
onClose();
|
|
57
|
+
}}
|
|
58
|
+
className={cn(
|
|
59
|
+
"flex h-8 w-full items-center gap-2 rounded-md px-2.5 text-left text-[12px] transition-colors",
|
|
60
|
+
item.danger ? "text-red-600 hover:bg-red-500/10" : "text-foreground hover:bg-accent",
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
<span className={cn(item.icon, "h-4 w-4", item.danger ? "" : "text-muted-foreground")} />
|
|
64
|
+
{item.label}
|
|
65
|
+
</button>
|
|
66
|
+
))}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* First-load skeleton while disk list is pending.
|
|
5
|
+
* Grid columns match KnowledgeGrid (auto-fill / 140px).
|
|
6
|
+
*/
|
|
7
|
+
export function KnowledgeFilesSkeleton(): JSX.Element {
|
|
8
|
+
return (
|
|
9
|
+
<div className="flex min-h-0 flex-1 px-8 pb-8">
|
|
10
|
+
<div className="min-h-0 flex-1 overflow-hidden">
|
|
11
|
+
<div className="grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-1 py-3">
|
|
12
|
+
{Array.from({ length: 18 }, (_, i) => (
|
|
13
|
+
<div key={i} className="flex flex-col items-center gap-2 px-2 py-3">
|
|
14
|
+
<div className="h-[72px] w-[72px] animate-pulse rounded-2xl bg-foreground/[0.06]" />
|
|
15
|
+
<div className="h-2.5 w-16 animate-pulse rounded bg-foreground/[0.06]" />
|
|
16
|
+
</div>
|
|
17
|
+
))}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
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 { knowledgeDirItemCount } from "./types";
|
|
6
|
+
import { useMarqueeSelection } from "./useMarqueeSelection";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Mac Finder-style file grid. Selection, marquee, double-click open, context menu.
|
|
10
|
+
*/
|
|
11
|
+
export function KnowledgeGridView({
|
|
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="grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-1 py-3">
|
|
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="group/cell flex w-full flex-col items-center gap-1.5 rounded-lg px-2 py-3"
|
|
59
|
+
>
|
|
60
|
+
<span
|
|
61
|
+
className={cn(
|
|
62
|
+
"relative flex h-[72px] w-[72px] items-center justify-center rounded-2xl transition-colors",
|
|
63
|
+
selected ? "bg-foreground/10" : "group-hover/cell:bg-foreground/[0.04]",
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
<span
|
|
67
|
+
className={cn(
|
|
68
|
+
getColoredFileIcon(node.name, isDir),
|
|
69
|
+
"h-14 w-14 shrink-0",
|
|
70
|
+
unprocessed && "opacity-40 grayscale",
|
|
71
|
+
)}
|
|
72
|
+
/>
|
|
73
|
+
{status && status !== "processed" && (
|
|
74
|
+
<StatusBadge status={status} labels={labels} />
|
|
75
|
+
)}
|
|
76
|
+
</span>
|
|
77
|
+
<span className="line-clamp-2 w-full text-center text-[12px] leading-[1.55]">
|
|
78
|
+
<span
|
|
79
|
+
className={cn(
|
|
80
|
+
"break-all [-webkit-box-decoration-break:clone] [box-decoration-break:clone]",
|
|
81
|
+
selected
|
|
82
|
+
? "rounded bg-primary px-1.5 py-0.5 text-primary-foreground"
|
|
83
|
+
: "text-foreground",
|
|
84
|
+
)}
|
|
85
|
+
>
|
|
86
|
+
{node.name}
|
|
87
|
+
</span>
|
|
88
|
+
</span>
|
|
89
|
+
{isDir && (
|
|
90
|
+
<span className="text-[10px] tabular-nums text-muted-foreground/45">
|
|
91
|
+
{labels.itemCount(knowledgeDirItemCount(node))}
|
|
92
|
+
</span>
|
|
93
|
+
)}
|
|
94
|
+
</button>
|
|
95
|
+
);
|
|
96
|
+
})}
|
|
97
|
+
</div>
|
|
98
|
+
{marquee && (
|
|
99
|
+
<div
|
|
100
|
+
className="pointer-events-none absolute z-10 rounded-sm border border-primary/50 bg-primary/10"
|
|
101
|
+
style={{
|
|
102
|
+
left: marquee.left,
|
|
103
|
+
top: marquee.top,
|
|
104
|
+
width: marquee.width,
|
|
105
|
+
height: marquee.height,
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
}
|