@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,320 @@
|
|
|
1
|
+
export type TokenActivityMode = "daily" | "weekly" | "rolling";
|
|
2
|
+
|
|
3
|
+
export interface UsageSeriesPointLike {
|
|
4
|
+
date: string;
|
|
5
|
+
tokens: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ActivityColumn {
|
|
9
|
+
key: string;
|
|
10
|
+
date: string;
|
|
11
|
+
endDate: string;
|
|
12
|
+
tokens: number;
|
|
13
|
+
/** Month axis label for first column of each month; null otherwise */
|
|
14
|
+
monthKey: string | null;
|
|
15
|
+
/** Left-side filler when history is shorter than the visible capacity */
|
|
16
|
+
isPad?: boolean;
|
|
17
|
+
/** 滚动窗口的起始日;仅 rolling 模式有值,供提示条展示区间 */
|
|
18
|
+
windowStart?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const TOKEN_ACTIVITY_MAX_ROWS = 10;
|
|
22
|
+
/** 滚动窗口跨度(自然日)。 */
|
|
23
|
+
export const ROLLING_WINDOW_DAYS = 30;
|
|
24
|
+
/** Preferred square size used only to decide how many columns fit the width. */
|
|
25
|
+
export const TOKEN_ACTIVITY_TARGET_CELL_PX = 8;
|
|
26
|
+
export const TOKEN_ACTIVITY_GAP_PX = 2;
|
|
27
|
+
|
|
28
|
+
function parseLocalDate(iso: string): Date {
|
|
29
|
+
const [y, m, d] = iso.split("-").map(Number);
|
|
30
|
+
return new Date(y!, m! - 1, d!);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function formatYmd(d: Date): string {
|
|
34
|
+
const y = d.getFullYear();
|
|
35
|
+
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
36
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
37
|
+
return `${y}-${m}-${day}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function addDays(iso: string, delta: number): string {
|
|
41
|
+
const d = parseLocalDate(iso);
|
|
42
|
+
d.setDate(d.getDate() + delta);
|
|
43
|
+
return formatYmd(d);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Monday-start week key (YYYY-MM-DD of week start) */
|
|
47
|
+
function weekStartKey(iso: string): string {
|
|
48
|
+
const d = parseLocalDate(iso);
|
|
49
|
+
const day = d.getDay();
|
|
50
|
+
const diff = day === 0 ? -6 : 1 - day;
|
|
51
|
+
d.setDate(d.getDate() + diff);
|
|
52
|
+
return formatYmd(d);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function withMonthKeys(columns: ActivityColumn[]): ActivityColumn[] {
|
|
56
|
+
let lastMonth = "";
|
|
57
|
+
return columns.map((c) => {
|
|
58
|
+
if (!c.date) return { ...c, monthKey: null };
|
|
59
|
+
const m = c.date.slice(0, 7);
|
|
60
|
+
const monthKey = m !== lastMonth ? m : null;
|
|
61
|
+
lastMonth = m;
|
|
62
|
+
return { ...c, monthKey };
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 滚动窗口按自然日计量,序列里缺失的日期必须当作 0 参与进出窗,
|
|
68
|
+
* 否则「过去 30 天」会在数据稀疏时退化成「最近 30 个有记录的日子」。
|
|
69
|
+
*/
|
|
70
|
+
function densifyDaily(points: UsageSeriesPointLike[]): { date: string; tokens: number }[] {
|
|
71
|
+
const totals = new Map<string, number>();
|
|
72
|
+
for (const p of points) totals.set(p.date, (totals.get(p.date) ?? 0) + p.tokens);
|
|
73
|
+
const dates = [...totals.keys()].sort((a, b) => a.localeCompare(b));
|
|
74
|
+
const last = dates[dates.length - 1]!;
|
|
75
|
+
const out: { date: string; tokens: number }[] = [];
|
|
76
|
+
for (let cur = dates[0]!; cur <= last; cur = addDays(cur, 1)) {
|
|
77
|
+
out.push({ date: cur, tokens: totals.get(cur) ?? 0 });
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function buildActivityColumns(points: UsageSeriesPointLike[], mode: TokenActivityMode): ActivityColumn[] {
|
|
83
|
+
if (points.length === 0) return [];
|
|
84
|
+
|
|
85
|
+
let base: { date: string; endDate: string; tokens: number; windowStart?: string }[];
|
|
86
|
+
|
|
87
|
+
if (mode === "rolling") {
|
|
88
|
+
const daily = densifyDaily(points);
|
|
89
|
+
let sum = 0;
|
|
90
|
+
base = daily.map((p, i) => {
|
|
91
|
+
sum += p.tokens;
|
|
92
|
+
const expired = i - ROLLING_WINDOW_DAYS;
|
|
93
|
+
if (expired >= 0) sum -= daily[expired]!.tokens;
|
|
94
|
+
return {
|
|
95
|
+
date: p.date,
|
|
96
|
+
endDate: p.date,
|
|
97
|
+
tokens: sum,
|
|
98
|
+
windowStart: daily[Math.max(0, i - ROLLING_WINDOW_DAYS + 1)]!.date,
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
} else if (mode === "weekly") {
|
|
102
|
+
const map = new Map<string, { date: string; endDate: string; tokens: number }>();
|
|
103
|
+
for (const p of points) {
|
|
104
|
+
const start = weekStartKey(p.date);
|
|
105
|
+
const existing = map.get(start);
|
|
106
|
+
if (existing) {
|
|
107
|
+
existing.tokens += p.tokens;
|
|
108
|
+
if (p.date > existing.endDate) existing.endDate = p.date;
|
|
109
|
+
} else {
|
|
110
|
+
map.set(start, { date: start, endDate: p.date, tokens: p.tokens });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
base = [...map.values()].sort((a, b) => a.date.localeCompare(b.date));
|
|
114
|
+
} else {
|
|
115
|
+
base = points.map((p) => ({ date: p.date, endDate: p.date, tokens: p.tokens }));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return withMonthKeys(
|
|
119
|
+
base.map((p) => ({
|
|
120
|
+
key: p.date,
|
|
121
|
+
date: p.date,
|
|
122
|
+
endDate: p.endDate,
|
|
123
|
+
tokens: p.tokens,
|
|
124
|
+
monthKey: null,
|
|
125
|
+
...(p.windowStart ? { windowStart: p.windowStart } : {}),
|
|
126
|
+
})),
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Fit columns to a fixed capacity so the chart exactly fills the container:
|
|
132
|
+
* - too many → drop oldest (left)
|
|
133
|
+
* - too few → pad empty columns on the left
|
|
134
|
+
*/
|
|
135
|
+
export function fitActivityColumns(columns: ActivityColumn[], capacity: number): ActivityColumn[] {
|
|
136
|
+
if (capacity <= 0) return [];
|
|
137
|
+
if (columns.length >= capacity) {
|
|
138
|
+
return withMonthKeys(columns.slice(columns.length - capacity));
|
|
139
|
+
}
|
|
140
|
+
const pad = capacity - columns.length;
|
|
141
|
+
const empties: ActivityColumn[] = Array.from({ length: pad }, (_, i) => ({
|
|
142
|
+
key: `__pad-${i}`,
|
|
143
|
+
date: "",
|
|
144
|
+
endDate: "",
|
|
145
|
+
tokens: 0,
|
|
146
|
+
monthKey: null,
|
|
147
|
+
isPad: true,
|
|
148
|
+
}));
|
|
149
|
+
return withMonthKeys([...empties, ...columns]);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function columnCapacity(
|
|
153
|
+
widthPx: number,
|
|
154
|
+
cellPx = TOKEN_ACTIVITY_TARGET_CELL_PX,
|
|
155
|
+
gapPx = TOKEN_ACTIVITY_GAP_PX,
|
|
156
|
+
): number {
|
|
157
|
+
if (widthPx <= 0) return 0;
|
|
158
|
+
return Math.max(1, Math.floor((widthPx + gapPx) / (cellPx + gapPx)));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function activityBlockCount(tokens: number, maxTokens: number, maxRows = TOKEN_ACTIVITY_MAX_ROWS): number {
|
|
162
|
+
if (tokens <= 0 || maxTokens <= 0) return 0;
|
|
163
|
+
return Math.max(1, Math.round((tokens / maxTokens) * maxRows));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Discrete intensity levels (excluding empty). Higher = more tokens. */
|
|
167
|
+
export const TOKEN_ACTIVITY_INTENSITY_LEVELS = 4;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Map a token amount to 0..levels (0 = empty, 1 light … levels darkest).
|
|
171
|
+
* Relative to the max in the visible window.
|
|
172
|
+
*/
|
|
173
|
+
export function activityIntensityLevel(
|
|
174
|
+
tokens: number,
|
|
175
|
+
maxTokens: number,
|
|
176
|
+
levels = TOKEN_ACTIVITY_INTENSITY_LEVELS,
|
|
177
|
+
): number {
|
|
178
|
+
if (tokens <= 0 || maxTokens <= 0) return 0;
|
|
179
|
+
return Math.min(levels, Math.max(1, Math.ceil((tokens / maxTokens) * levels)));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function formatTokenCount(n: number): string {
|
|
183
|
+
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
184
|
+
if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
|
|
185
|
+
return n.toLocaleString();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 曲线只关心「有数据之后」的部分:服务端固定返回一整年,首次请求之前全是 0,
|
|
190
|
+
* 补在左边只会画出一条无信息的平线。保留紧邻的最后一个空档作为 0 基线锚点,
|
|
191
|
+
* 让曲线从底部起笔而不是凭空出现在半空。
|
|
192
|
+
*/
|
|
193
|
+
export function trimLeadingIdleColumns(columns: ActivityColumn[]): ActivityColumn[] {
|
|
194
|
+
const first = columns.findIndex((c) => !c.isPad && c.tokens > 0);
|
|
195
|
+
if (first < 0) return [];
|
|
196
|
+
return withMonthKeys(columns.slice(Math.max(0, first - 1)));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 滚动窗口是逐日平滑变化的序列,用方块矩阵只会画成一片高度相近的柱子,
|
|
201
|
+
* 因此改用面积曲线。曲线不需要一天一列,超出容量时按等距采样降采样;
|
|
202
|
+
* 列数少于容量时直接铺满宽度,不像矩阵那样在左侧补空列。
|
|
203
|
+
*/
|
|
204
|
+
export function fitCurveColumns(columns: ActivityColumn[], capacity: number): ActivityColumn[] {
|
|
205
|
+
if (capacity <= 0) return [];
|
|
206
|
+
if (columns.length <= capacity) return columns;
|
|
207
|
+
if (capacity === 1) return withMonthKeys([columns[columns.length - 1]!]);
|
|
208
|
+
const sampled = Array.from({ length: capacity }, (_, i) => {
|
|
209
|
+
const idx = Math.round((i * (columns.length - 1)) / (capacity - 1));
|
|
210
|
+
return columns[idx]!;
|
|
211
|
+
});
|
|
212
|
+
return withMonthKeys(sampled);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface AreaGeometryPoint {
|
|
216
|
+
key: string;
|
|
217
|
+
/** 0..100,viewBox 内的水平位置 */
|
|
218
|
+
x: number;
|
|
219
|
+
/** 0..100,viewBox 内的垂直位置,0 在顶部 */
|
|
220
|
+
y: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface AreaGeometry {
|
|
224
|
+
points: AreaGeometryPoint[];
|
|
225
|
+
/** 平滑折线路径;点数不足 2 时为空串 */
|
|
226
|
+
linePath: string;
|
|
227
|
+
/** 闭合到底边的填充路径;点数不足 2 时为空串 */
|
|
228
|
+
areaPath: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const round = (v: number): string => (Math.round(v * 100) / 100).toFixed(2);
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Fritsch–Carlson 单调三次插值的切线。普通 Catmull-Rom 会在陡升/陡降段前后过冲,
|
|
235
|
+
* 画出数据里并不存在的假回落或假反弹,这里必须用保单调的版本。
|
|
236
|
+
*/
|
|
237
|
+
function monotoneTangents(points: AreaGeometryPoint[]): number[] {
|
|
238
|
+
const n = points.length;
|
|
239
|
+
const slopes: number[] = [];
|
|
240
|
+
for (let i = 0; i < n - 1; i++) {
|
|
241
|
+
const dx = points[i + 1]!.x - points[i]!.x;
|
|
242
|
+
slopes.push(dx === 0 ? 0 : (points[i + 1]!.y - points[i]!.y) / dx);
|
|
243
|
+
}
|
|
244
|
+
const m = points.map((_, i) => {
|
|
245
|
+
if (i === 0) return slopes[0] ?? 0;
|
|
246
|
+
if (i === n - 1) return slopes[n - 2] ?? 0;
|
|
247
|
+
return ((slopes[i - 1] ?? 0) + (slopes[i] ?? 0)) / 2;
|
|
248
|
+
});
|
|
249
|
+
for (let i = 0; i < n - 1; i++) {
|
|
250
|
+
const d = slopes[i]!;
|
|
251
|
+
if (d === 0) {
|
|
252
|
+
m[i] = 0;
|
|
253
|
+
m[i + 1] = 0;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
const a = m[i]! / d;
|
|
257
|
+
const b = m[i + 1]! / d;
|
|
258
|
+
const sum = a * a + b * b;
|
|
259
|
+
if (sum > 9) {
|
|
260
|
+
const t = 3 / Math.sqrt(sum);
|
|
261
|
+
m[i] = t * a * d;
|
|
262
|
+
m[i + 1] = t * b * d;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return m;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** 把数据点连成保单调的三次贝塞尔路径。 */
|
|
269
|
+
export function buildSmoothPath(points: AreaGeometryPoint[]): string {
|
|
270
|
+
if (points.length < 2) return "";
|
|
271
|
+
const m = monotoneTangents(points);
|
|
272
|
+
let d = `M${round(points[0]!.x)} ${round(points[0]!.y)}`;
|
|
273
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
274
|
+
const p0 = points[i]!;
|
|
275
|
+
const p1 = points[i + 1]!;
|
|
276
|
+
const dx = (p1.x - p0.x) / 3;
|
|
277
|
+
d += ` C${round(p0.x + dx)} ${round(p0.y + m[i]! * dx)} ${round(p1.x - dx)} ${round(p1.y - m[i + 1]! * dx)} ${round(p1.x)} ${round(p1.y)}`;
|
|
278
|
+
}
|
|
279
|
+
return d;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** 悬停命中区:以每个数据点为中心、延伸到与相邻点的中点,保证指针位置和圆点落在同一列。 */
|
|
283
|
+
export function buildHoverZones(points: AreaGeometryPoint[]): Array<{ key: string; left: number; width: number }> {
|
|
284
|
+
const n = points.length;
|
|
285
|
+
if (n === 0) return [];
|
|
286
|
+
if (n === 1) return [{ key: points[0]!.key, left: 0, width: 100 }];
|
|
287
|
+
return points.map((p, i) => {
|
|
288
|
+
const left = i === 0 ? 0 : (points[i - 1]!.x + p.x) / 2;
|
|
289
|
+
const right = i === n - 1 ? 100 : (p.x + points[i + 1]!.x) / 2;
|
|
290
|
+
return { key: p.key, left, width: right - left };
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** 把列序列映射成 100x100 viewBox 内的面积曲线几何,供 SVG 以 `preserveAspectRatio="none"` 拉伸。 */
|
|
295
|
+
export function buildAreaGeometry(columns: ActivityColumn[], maxTokens: number): AreaGeometry {
|
|
296
|
+
const n = columns.length;
|
|
297
|
+
if (n === 0) return { points: [], linePath: "", areaPath: "" };
|
|
298
|
+
const max = maxTokens > 0 ? maxTokens : 1;
|
|
299
|
+
const points = columns.map((col, i) => ({
|
|
300
|
+
key: col.key,
|
|
301
|
+
x: n === 1 ? 0 : (i / (n - 1)) * 100,
|
|
302
|
+
y: 100 - Math.min(100, Math.max(0, (col.tokens / max) * 100)),
|
|
303
|
+
}));
|
|
304
|
+
const linePath = buildSmoothPath(points);
|
|
305
|
+
const areaPath = linePath ? `${linePath} L100.00 100.00 L0.00 100.00 Z` : "";
|
|
306
|
+
return { points, linePath, areaPath };
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** 方块矩阵的实际像素高度,曲线模式复用它以避免切换 tab 时高度跳动。 */
|
|
310
|
+
export function activityMatrixHeightPx(
|
|
311
|
+
widthPx: number,
|
|
312
|
+
capacity: number,
|
|
313
|
+
gapPx = TOKEN_ACTIVITY_GAP_PX,
|
|
314
|
+
rows = TOKEN_ACTIVITY_MAX_ROWS,
|
|
315
|
+
): number {
|
|
316
|
+
if (widthPx <= 0 || capacity <= 0) return 0;
|
|
317
|
+
const cell = (widthPx - (capacity - 1) * gapPx) / capacity;
|
|
318
|
+
if (cell <= 0) return 0;
|
|
319
|
+
return rows * cell + (rows - 1) * gapPx;
|
|
320
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
|
|
4
|
+
export interface AvatarStackViewProps {
|
|
5
|
+
readonly avatarUrls: readonly string[];
|
|
6
|
+
readonly className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const MAX_VISIBLE_AVATARS = 3;
|
|
10
|
+
|
|
11
|
+
/** Compact, decorative avatar stack for places where the adjacent label names the group. */
|
|
12
|
+
export function AvatarStackView({
|
|
13
|
+
avatarUrls,
|
|
14
|
+
className,
|
|
15
|
+
}: AvatarStackViewProps): JSX.Element {
|
|
16
|
+
const visibleAvatarUrls = avatarUrls.slice(0, MAX_VISIBLE_AVATARS);
|
|
17
|
+
const hiddenAvatarCount = avatarUrls.length - visibleAvatarUrls.length;
|
|
18
|
+
return (
|
|
19
|
+
<span
|
|
20
|
+
className={cn("inline-flex shrink-0 items-center pl-0.5", className)}
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
data-avatar-stack="true"
|
|
23
|
+
>
|
|
24
|
+
{visibleAvatarUrls.map((avatarUrl, index) => (
|
|
25
|
+
<img
|
|
26
|
+
key={`${avatarUrl}:${index}`}
|
|
27
|
+
src={avatarUrl}
|
|
28
|
+
alt=""
|
|
29
|
+
className={cn(
|
|
30
|
+
"h-4 w-4 shrink-0 rounded-full object-cover ring-1 ring-border",
|
|
31
|
+
index > 0 && "-ml-1.5",
|
|
32
|
+
)}
|
|
33
|
+
/>
|
|
34
|
+
))}
|
|
35
|
+
{hiddenAvatarCount > 0 ? (
|
|
36
|
+
<span
|
|
37
|
+
className="-ml-1.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-muted px-1 text-[9px] tabular-nums text-muted-foreground ring-1 ring-background"
|
|
38
|
+
data-avatar-overflow={hiddenAvatarCount}
|
|
39
|
+
>
|
|
40
|
+
+{hiddenAvatarCount}
|
|
41
|
+
</span>
|
|
42
|
+
) : null}
|
|
43
|
+
</span>
|
|
44
|
+
);
|
|
45
|
+
}
|