@vetta-org/theme-ui 0.1.1 → 0.2.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 +740 -20
- package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
- package/src/action-approval/GenericActionApprovalView.tsx +2 -9
- package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
- package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
- package/src/action-approval/index.ts +0 -1
- package/src/activity/ActivityPanel.tsx +13 -10
- package/src/activity/ActivityPanelFrame.test.tsx +32 -0
- package/src/activity/ActivityPanelFrame.tsx +3 -2
- package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
- package/src/activity/BrowserPanelView.tsx +48 -49
- package/src/activity/CodePreview.tsx +15 -1
- package/src/activity/DebugTabPanelView.tsx +1 -1
- package/src/activity/MarkdownPreviewView.test.tsx +53 -0
- package/src/activity/MarkdownPreviewView.tsx +135 -62
- package/src/activity/PluginTabPickerView.tsx +5 -3
- package/src/activity/PortsTabPanelView.tsx +911 -0
- package/src/activity/ToolCallsSubTabView.tsx +1 -1
- package/src/activity/WorkflowTabPanelView.tsx +1 -1
- package/src/activity/index.ts +9 -0
- package/src/app/AppBackground.tsx +1 -1
- package/src/app/AppBootLoadingView.tsx +4 -2
- package/src/app-shell/DefaultWindowControls.tsx +1 -1
- package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
- package/src/app-shell/PageHeaderContent.tsx +36 -7
- package/src/app-shell/PageHeaderFrame.tsx +15 -3
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
- package/src/app-shell/PageHeaderTitle.tsx +1 -1
- package/src/app-shell/WindowControlButton.tsx +1 -1
- package/src/app-shell/header-crowding.test.ts +62 -0
- package/src/app-shell/header-crowding.tsx +137 -0
- package/src/appearance/BackgroundImageFrame.tsx +1 -1
- package/src/appearance/CenterSliceImageFrame.tsx +1 -1
- package/src/appearance/CornerImageFrame.tsx +1 -1
- package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
- package/src/appearance/NineSliceImageFrame.tsx +1 -1
- package/src/appearance/ThemeSurface.tsx +1 -1
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
- package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
- package/src/batch-tasks/batchTaskUi.tsx +0 -29
- package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
- package/src/bottom-panel/BottomPanelView.tsx +222 -0
- package/src/bottom-panel/index.ts +26 -0
- package/src/chat/AgentAvatarView.tsx +1 -1
- package/src/chat/AnnotationViews.tsx +107 -0
- package/src/chat/AskUserQuestionView.tsx +18 -11
- package/src/chat/AssistantMessageView.tsx +48 -13
- package/src/chat/AtPanelView.test.tsx +61 -0
- package/src/chat/AtPanelView.tsx +63 -38
- package/src/chat/BashTerminalCard.tsx +1 -2
- package/src/chat/ChatHeaderActionsView.tsx +74 -18
- package/src/chat/CompactionStepView.test.tsx +34 -0
- package/src/chat/CompactionStepView.tsx +85 -0
- package/src/chat/ContextRingView.test.tsx +81 -0
- package/src/chat/ContextRingView.tsx +78 -62
- package/src/chat/ExecutionModeSelectorView.tsx +20 -5
- package/src/chat/HeaderActionBarView.tsx +806 -0
- package/src/chat/HeaderActionOverflowMenu.tsx +128 -0
- package/src/chat/InlineModelPicker.test.tsx +81 -0
- package/src/chat/InlineModelPicker.tsx +201 -0
- package/src/chat/InlineTokenChip.tsx +2 -68
- package/src/chat/InputBarBackground.tsx +1 -1
- package/src/chat/InputBarPlaceholder.tsx +26 -3
- package/src/chat/LiveThinkingView.tsx +51 -37
- package/src/chat/MessageBoundaryViews.tsx +21 -0
- package/src/chat/MessageFeedContext.tsx +13 -5
- package/src/chat/MessageFeedLayoutView.tsx +29 -3
- package/src/chat/MessageFeedView.test.tsx +81 -0
- package/src/chat/MessageFeedView.tsx +72 -152
- package/src/chat/MessageInputView.tsx +6 -2
- package/src/chat/MessageLayoutView.tsx +1 -1
- package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
- package/src/chat/MessageTimelineView.tsx +1 -1
- package/src/chat/MessageView.tsx +1 -1
- package/src/chat/MessageVisualView.tsx +1 -1
- package/src/chat/ModelConfiguration.tsx +283 -0
- package/src/chat/ModelSelectorTrigger.tsx +63 -0
- package/src/chat/ModelSelectorView.tsx +1037 -223
- package/src/chat/NewSession.ts +1 -37
- package/src/chat/NewSessionPicker.tsx +3 -2
- package/src/chat/ProjectSelectorView.tsx +3 -2
- package/src/chat/ReasoningStepSlider.tsx +61 -0
- package/src/chat/RemoteSessionBadgeView.tsx +24 -0
- package/src/chat/SkillPromptAreaView.tsx +5 -19
- package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
- package/src/chat/TeamMemberReplyCardView.tsx +133 -0
- package/src/chat/TextBlockView.tsx +7 -770
- package/src/chat/TodoProgress.tsx +25 -53
- package/src/chat/TodoStatusBarView.tsx +14 -5
- package/src/chat/UserMessageView.tsx +113 -33
- package/src/chat/header-action-narrow.test.ts +21 -0
- package/src/chat/header-action-narrow.ts +38 -0
- package/src/chat/index.ts +33 -27
- package/src/chat/markdown-link.ts +7 -279
- package/src/chat/message-feed-fade.css +80 -0
- package/src/chat/message-feed-fade.test.tsx +75 -0
- package/src/chat/send-button.css +4 -22
- package/src/chat/streaming-reveal.test.ts +218 -0
- package/src/chat/streaming-reveal.ts +13 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
- package/src/file-explorer/FileContextMenuView.tsx +44 -11
- package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
- package/src/file-explorer/FileTreeNodeView.tsx +59 -18
- package/src/file-explorer/FileTreeView.tsx +236 -129
- package/src/file-explorer/file-tree-dom.ts +23 -0
- package/src/file-explorer/file-tree-rows.test.ts +74 -0
- package/src/file-explorer/file-tree-rows.ts +168 -0
- package/src/file-explorer/index.ts +17 -0
- package/src/file-explorer/types.ts +3 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
- package/src/file-preview/FilePreviewDialogView.tsx +2 -2
- package/src/file-preview/FilePreviewView.tsx +12 -2
- package/src/file-preview/ReadonlyCodeView.tsx +46 -0
- package/src/file-preview/TextFileEditorView.tsx +2 -1
- package/src/file-preview/syntax-tokens.css +1 -1
- package/src/image-assets.d.ts +4 -0
- package/src/index.ts +1 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
- package/src/layout/AppFrame.tsx +3 -2
- package/src/layout/MainContentFrame.tsx +7 -2
- package/src/layout/ResizeHandle.tsx +68 -17
- package/src/layout/SidebarDock.tsx +75 -19
- package/src/layout/SidebarOverlay.tsx +1 -1
- package/src/layout/index.ts +1 -1
- package/src/layout/resize-handle-axis.test.ts +51 -0
- package/src/live-indicators.test.ts +43 -0
- package/src/markdown/CodeBlock.tsx +123 -0
- package/src/markdown/FileLinkBadge.tsx +77 -0
- package/src/markdown/InlineTokenChip.tsx +68 -0
- package/src/markdown/MarkdownContent.tsx +418 -0
- package/src/markdown/MarkdownImage.tsx +41 -0
- package/src/markdown/MathFormula.tsx +46 -0
- package/src/markdown/MermaidBlock.tsx +82 -0
- package/src/markdown/RichCodeBlock.tsx +127 -0
- package/src/markdown/SvgPreview.tsx +45 -0
- package/src/markdown/WebsiteIcon.tsx +94 -0
- package/src/markdown/builtin-renderers.tsx +43 -0
- package/src/markdown/definition.tsx +49 -0
- package/src/markdown/host.tsx +18 -0
- package/src/markdown/image-actions.ts +29 -0
- package/src/markdown/index.ts +12 -0
- package/src/markdown/inline-tokens.ts +187 -0
- package/src/markdown/markdown-link.ts +279 -0
- package/src/markdown/math-client.ts +116 -0
- package/src/markdown/math-render.ts +23 -0
- package/src/markdown/math-syntax.ts +80 -0
- package/src/markdown/math.worker.ts +16 -0
- package/src/markdown/nodes.ts +15 -0
- package/src/markdown/preview-policy.test.ts +31 -0
- package/src/markdown/preview-policy.ts +76 -0
- package/src/markdown/progressive-chunks.test.ts +43 -0
- package/src/markdown/progressive-chunks.ts +58 -0
- package/src/markdown/rich-labels.ts +55 -0
- package/src/markdown/rich-syntax.ts +93 -0
- package/src/markdown/stable-blocks.test.ts +90 -0
- package/src/markdown/stable-blocks.ts +124 -0
- package/src/markdown/streaming-reveal.ts +297 -0
- package/src/markdown/streaming.test.ts +57 -0
- package/src/markdown/streaming.ts +211 -0
- package/src/markdown/use-render-snapshot.ts +24 -0
- package/src/markdown/use-rich-visibility.ts +24 -0
- package/src/overlays/CommandMenuRow.tsx +77 -17
- package/src/overlays/CommandMenuView.tsx +163 -118
- package/src/overlays/ConfirmDialogView.tsx +25 -20
- package/src/overlays/DiagnosticsExportDialogView.tsx +236 -0
- package/src/overlays/MagpieHandoverDialogView.tsx +217 -0
- package/src/overlays/ReleaseNoteMarkdown.test.tsx +24 -0
- package/src/overlays/ReleaseNoteMarkdown.tsx +55 -0
- package/src/overlays/SplashOptionRow.tsx +46 -0
- package/src/overlays/SplashPanel.tsx +85 -0
- package/src/overlays/SplashParts.tsx +217 -0
- package/src/overlays/UpdateCheckerView.tsx +34 -18
- package/src/overlays/UpdateRestartDialogView.tsx +203 -53
- package/src/overlays/assets/diagnostics-banner.webp +0 -0
- package/src/overlays/command-menu-types.ts +15 -1
- package/src/overlays/command-menu.css +1 -20
- package/src/overlays/index.ts +26 -1
- package/src/plugin-ui/index.ts +10 -0
- package/src/project/ConversationTagDotsView.tsx +1 -1
- package/src/project/ConversationTagEditorDialogView.tsx +4 -1
- package/src/project/DefaultConversationSectionView.tsx +15 -24
- package/src/project/DefaultSessionListView.tsx +5 -31
- package/src/project/DefaultSessionRowView.tsx +114 -55
- package/src/project/ManageSessionsSplashView.tsx +439 -0
- package/src/project/NewProjectDialogView.tsx +3 -10
- package/src/project/ProjectContextMenuView.tsx +30 -139
- package/src/project/ProjectDetailPageView.test.tsx +140 -0
- package/src/project/ProjectDetailPageView.tsx +372 -165
- package/src/project/ProjectGroupView.tsx +1 -1
- package/src/project/ProjectRowView.tsx +29 -12
- package/src/project/ProjectSessionsView.tsx +25 -47
- package/src/project/QuickScrollOverlay.tsx +1 -1
- package/src/project/SessionContextMenuView.tsx +15 -7
- package/src/project/SessionRowMoreButton.tsx +50 -0
- package/src/project/SessionRowView.tsx +106 -63
- package/src/project/SessionTitleMarquee.tsx +54 -0
- package/src/project/SidebarProjectDisclosure.tsx +60 -0
- package/src/project/SidebarProjectsSectionView.tsx +6 -1
- package/src/project/index.ts +12 -0
- package/src/project/session-row-transition.ts +9 -0
- package/src/project/types.ts +4 -2
- package/src/project/useActiveSessionAutoScroll.ts +10 -4
- package/src/registry.ts +0 -2
- package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
- package/src/scheduler/AutomationPageView.tsx +118 -121
- package/src/scheduler/ExecutionHistoryView.tsx +7 -5
- package/src/scheduler/TaskListView.tsx +52 -201
- package/src/scheduler/index.ts +7 -12
- package/src/settings/AppshotSettingsView.tsx +0 -1
- package/src/settings/ArchivedProjectsSettingsView.tsx +122 -1
- package/src/settings/BuiltinMcpSectionView.tsx +1 -1
- package/src/settings/EnvironmentGitRowView.tsx +156 -0
- package/src/settings/EnvironmentSettingsView.tsx +25 -3
- package/src/settings/GeneralSettingsView.tsx +18 -24
- package/src/settings/ImChannelGuideDialogView.tsx +2 -2
- package/src/settings/ImFeishuDialogView.tsx +1 -1
- package/src/settings/ImLegacyImportBannerView.tsx +1 -1
- package/src/settings/ImLogDrawerView.tsx +2 -1
- package/src/settings/JsonConfigInputView.tsx +171 -0
- package/src/settings/LauncherSettingsView.test.tsx +95 -0
- package/src/settings/LauncherSettingsView.tsx +273 -0
- package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
- package/src/settings/ModelsProvidersSectionView.tsx +26 -23
- package/src/settings/MotionSelect.tsx +9 -7
- package/src/settings/NotificationSettingsView.tsx +79 -0
- package/src/settings/PermissionsSettingsView.tsx +3 -7
- package/src/settings/PetActionGalleryView.test.tsx +163 -0
- package/src/settings/PetActionGalleryView.tsx +216 -0
- package/src/settings/PetSettingsView.test.tsx +117 -0
- package/src/settings/PetSettingsView.tsx +86 -22
- package/src/settings/PresetProviderModelsListView.tsx +141 -24
- package/src/settings/PresetProviderRowView.tsx +147 -185
- package/src/settings/ProxySettingsSectionView.tsx +182 -0
- package/src/settings/QrBindDialogView.tsx +1 -1
- package/src/settings/RemoteMcpSectionView.tsx +1 -1
- package/src/settings/SettingChrome.tsx +2 -2
- package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
- package/src/settings/SettingsFormFields.tsx +4 -7
- package/src/settings/SettingsSidebarView.tsx +64 -3
- package/src/settings/ShortcutRecorderView.test.tsx +108 -0
- package/src/settings/ShortcutRecorderView.tsx +15 -9
- package/src/settings/ShortcutsSettingsView.tsx +1 -5
- package/src/settings/SpaceEditorDialogView.tsx +158 -0
- package/src/settings/SpacesSettingsView.tsx +150 -0
- package/src/settings/WebhookEndpointListView.tsx +4 -5
- package/src/settings/assets/space-editor-illustration.webp +0 -0
- package/src/settings/index.ts +59 -68
- package/src/shared/ActivityStatusDot.tsx +69 -0
- package/src/shared/AvatarStackView.tsx +13 -13
- package/src/shared/BotAvatar.tsx +11 -9
- package/src/shared/CodeBlockCopyButton.tsx +1 -1
- package/src/shared/ContextMenuView.tsx +4 -11
- package/src/shared/MarkdownTable.tsx +2 -2
- package/src/shared/SegmentedControl.test.tsx +68 -0
- package/src/shared/SegmentedControl.tsx +10 -2
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.outline.test.tsx +59 -0
- package/src/shared/TabBar.tsx +23 -18
- package/src/shared/VettaKbd.test.tsx +52 -0
- package/src/shared/VettaKbd.tsx +100 -0
- package/src/shared/connected-tab-outline.test.ts +2 -2
- package/src/shared/connected-tab-outline.ts +2 -1
- package/src/shared/index.ts +7 -0
- package/src/shared/kbd-keys.test.ts +61 -0
- package/src/shared/kbd-keys.ts +253 -0
- package/src/shared/platform.ts +9 -0
- package/src/shared/provider-icon/icons.ts +4 -2
- package/src/shared/provider-icon/index.tsx +1 -1
- package/src/shared/provider-icon/magpie.svg +1 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +33 -24
- package/src/sidebar/DefaultSidebar.tsx +3 -1
- package/src/sidebar/MessageCenterDialogView.tsx +3 -2
- package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
- package/src/sidebar/MessageCenterTabs.tsx +1 -1
- package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
- package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
- package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
- package/src/sidebar/SessionStatusIcon.tsx +16 -1
- package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
- package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +29 -50
- package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
- package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
- package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
- package/src/sidebar/SidebarNavIcon.tsx +1 -1
- package/src/sidebar/SidebarNavItemButton.tsx +1 -1
- package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
- package/src/sidebar/SidebarNavigation.tsx +24 -15
- package/src/sidebar/SidebarPanel.tsx +11 -2
- package/src/sidebar/SidebarSectionActionButton.test.tsx +91 -0
- package/src/sidebar/SidebarSectionActionButton.tsx +52 -0
- package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
- package/src/sidebar/SidebarTopBar.tsx +10 -7
- package/src/sidebar/WaitingPulseBadge.tsx +19 -0
- package/src/sidebar/index.ts +1 -16
- package/src/skills/index.ts +0 -19
- package/src/skills/skill-icon.tsx +4 -8
- package/src/styles.css +26 -6
- package/src/chat/DefaultSceneCarousel.tsx +0 -113
- package/src/chat/SceneCard.tsx +0 -138
- package/src/scheduler/HistoryDrawerView.tsx +0 -149
- package/src/scheduler/TaskFormDialogView.tsx +0 -60
- package/src/settings/AchievementNavigationButtonView.tsx +0 -90
- package/src/settings/AchievementPromotionDialogView.tsx +0 -91
- package/src/settings/AchievementSettingsView.tsx +0 -44
- package/src/settings/PetBubbleStylePreviewView.tsx +0 -44
- package/src/settings/QuickPanelSettingsSectionView.tsx +0 -66
- package/src/settings/SubscriptionActionsView.tsx +0 -63
- package/src/settings/SubscriptionCardsView.tsx +0 -212
- package/src/settings/TeamDetailView.tsx +0 -148
- package/src/settings/TeamDialogsView.tsx +0 -151
- package/src/settings/TeamListView.tsx +0 -57
- package/src/settings/TeamSettingsView.tsx +0 -51
- package/src/settings/TokenActivityChartView.tsx +0 -286
- package/src/settings/UsageStatsView.tsx +0 -101
- package/src/settings/achievements/AchievementCurtains.tsx +0 -50
- package/src/settings/achievements/AchievementPromotionBadge3D.tsx +0 -350
- package/src/settings/achievements/AchievementPromotionConfetti.tsx +0 -71
- package/src/settings/achievements/AchievementTitle.tsx +0 -52
- package/src/settings/achievements/index.ts +0 -13
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
- package/src/settings/token-activity.test.ts +0 -195
- package/src/settings/token-activity.ts +0 -320
- package/src/sidebar/AddProjectMenuItem.tsx +0 -21
- package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
- package/src/sidebar/NotificationMessageListView.tsx +0 -136
- package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
- package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
- package/src/skills/SceneCardView.tsx +0 -194
- package/src/skills/SkillCardView.tsx +0 -186
- package/src/skills/SkillDetailDialogView.tsx +0 -138
- package/src/skills/SkillTagGroupView.tsx +0 -56
- package/src/skills/SkillToggleSwitch.tsx +0 -31
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
import { Button, cn } from "@vetta-org/ui";
|
|
3
|
+
import { SettingSection, type SettingSectionMeta } from "./SettingChrome";
|
|
4
|
+
|
|
5
|
+
export interface SpacesFeatureView {
|
|
6
|
+
readonly icon: string;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
readonly description: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SpacesSettingsViewItem {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly icon: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SpacesSettingsViewLabels {
|
|
18
|
+
readonly title: string;
|
|
19
|
+
/** 标题下的一句话:工作空间是什么。 */
|
|
20
|
+
readonly subtitle: string;
|
|
21
|
+
readonly featuresTitle: string;
|
|
22
|
+
readonly listTitle: string;
|
|
23
|
+
readonly newSpace: string;
|
|
24
|
+
readonly edit: (name: string) => string;
|
|
25
|
+
readonly remove: (name: string) => string;
|
|
26
|
+
/** 主工作空间固定存在,只有名称与图标,没有移动、编辑和移除动作。 */
|
|
27
|
+
readonly main: SpacesSettingsViewItem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SpacesSettingsViewProps {
|
|
31
|
+
readonly labels: SpacesSettingsViewLabels;
|
|
32
|
+
readonly section: SettingSectionMeta;
|
|
33
|
+
/** 顶部讲解:工作空间怎么用、会影响什么。 */
|
|
34
|
+
readonly features: readonly SpacesFeatureView[];
|
|
35
|
+
readonly spaces: readonly SpacesSettingsViewItem[];
|
|
36
|
+
readonly onCreate: () => void;
|
|
37
|
+
readonly onEdit: (id: string) => void;
|
|
38
|
+
readonly onRemove: (id: string) => void;
|
|
39
|
+
readonly onReorder: (sourceId: string, targetId: string) => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function SpaceIconBadge({ children }: { children: ReactNode }): JSX.Element {
|
|
43
|
+
return (
|
|
44
|
+
<span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground">
|
|
45
|
+
{children}
|
|
46
|
+
</span>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 设置 → 工作空间。
|
|
52
|
+
*
|
|
53
|
+
* 只看列表的话,用户不知道工作空间是「侧栏分组」还是会挪动磁盘上的目录,也找不到切换入口;
|
|
54
|
+
* 所以和「启动器」页一样,先用一句话 + 分行讲解交代清楚,再给管理列表。
|
|
55
|
+
*/
|
|
56
|
+
export function SpacesSettingsView({
|
|
57
|
+
labels,
|
|
58
|
+
section,
|
|
59
|
+
features,
|
|
60
|
+
spaces,
|
|
61
|
+
onCreate,
|
|
62
|
+
onEdit,
|
|
63
|
+
onRemove,
|
|
64
|
+
onReorder,
|
|
65
|
+
}: SpacesSettingsViewProps): JSX.Element {
|
|
66
|
+
return (
|
|
67
|
+
<div className="mx-auto w-full max-w-[680px] px-8 pt-2 pb-4">
|
|
68
|
+
<h1 className="mb-1.5 text-[20px] font-bold text-foreground">{labels.title}</h1>
|
|
69
|
+
<p className="mb-6 text-[13px] leading-relaxed text-muted-foreground">{labels.subtitle}</p>
|
|
70
|
+
|
|
71
|
+
<div className="mb-8">
|
|
72
|
+
<h2 className="mb-3 text-[15px] font-semibold text-foreground">{labels.featuresTitle}</h2>
|
|
73
|
+
<ul className="overflow-hidden rounded-xl border border-border bg-card">
|
|
74
|
+
{features.map((feature) => (
|
|
75
|
+
<li
|
|
76
|
+
key={feature.title}
|
|
77
|
+
className="flex items-center gap-3 border-b border-border px-4 py-3 last:border-b-0"
|
|
78
|
+
>
|
|
79
|
+
<span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary">
|
|
80
|
+
<span aria-hidden="true" className={cn(feature.icon, "h-4 w-4")} />
|
|
81
|
+
</span>
|
|
82
|
+
<div className="min-w-0 flex-1">
|
|
83
|
+
<div className="text-[13px] font-medium text-foreground">{feature.title}</div>
|
|
84
|
+
<p className="mt-0.5 text-[12px] text-muted-foreground">{feature.description}</p>
|
|
85
|
+
</div>
|
|
86
|
+
</li>
|
|
87
|
+
))}
|
|
88
|
+
</ul>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<SettingSection
|
|
92
|
+
section={section}
|
|
93
|
+
title={
|
|
94
|
+
<div className="flex items-center justify-between gap-3">
|
|
95
|
+
<span>{labels.listTitle}</span>
|
|
96
|
+
<Button size="sm" onClick={onCreate}>
|
|
97
|
+
<span className="icon-[solar--add-circle-linear] size-4" aria-hidden="true" />
|
|
98
|
+
{labels.newSpace}
|
|
99
|
+
</Button>
|
|
100
|
+
</div>
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
<div className="flex items-center gap-3 border-b border-border px-5 py-3.5">
|
|
104
|
+
<SpaceIconBadge>{labels.main.icon}</SpaceIconBadge>
|
|
105
|
+
<div className="min-w-0 flex-1 text-[13px] font-medium text-foreground">{labels.main.name}</div>
|
|
106
|
+
</div>
|
|
107
|
+
{spaces.map((space) => (
|
|
108
|
+
<div
|
|
109
|
+
key={space.id}
|
|
110
|
+
className="flex items-center gap-2 border-b border-border px-5 py-3 last:border-b-0"
|
|
111
|
+
draggable
|
|
112
|
+
onDragStart={(event) => event.dataTransfer.setData("application/x-vetta-space", space.id)}
|
|
113
|
+
onDragOver={(event) => event.preventDefault()}
|
|
114
|
+
onDrop={(event) => {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
onReorder(event.dataTransfer.getData("application/x-vetta-space"), space.id);
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
<span
|
|
120
|
+
aria-hidden="true"
|
|
121
|
+
className="icon-[tabler--grip-vertical] size-4 shrink-0 cursor-grab text-muted-foreground/60"
|
|
122
|
+
/>
|
|
123
|
+
<SpaceIconBadge>{space.icon}</SpaceIconBadge>
|
|
124
|
+
<div className="min-w-0 flex-1 truncate text-[13px] font-medium text-foreground">{space.name}</div>
|
|
125
|
+
<div className="flex shrink-0 items-center gap-0.5">
|
|
126
|
+
<Button
|
|
127
|
+
variant="ghost"
|
|
128
|
+
size="icon-xs"
|
|
129
|
+
aria-label={labels.edit(space.name)}
|
|
130
|
+
title={labels.edit(space.name)}
|
|
131
|
+
onClick={() => onEdit(space.id)}
|
|
132
|
+
>
|
|
133
|
+
<span className="icon-[solar--pen-2-linear] size-3.5" aria-hidden="true" />
|
|
134
|
+
</Button>
|
|
135
|
+
<Button
|
|
136
|
+
variant="ghost"
|
|
137
|
+
size="icon-xs"
|
|
138
|
+
aria-label={labels.remove(space.name)}
|
|
139
|
+
title={labels.remove(space.name)}
|
|
140
|
+
onClick={() => onRemove(space.id)}
|
|
141
|
+
>
|
|
142
|
+
<span className="icon-[solar--trash-bin-minimalistic-linear] size-3.5" aria-hidden="true" />
|
|
143
|
+
</Button>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
))}
|
|
147
|
+
</SettingSection>
|
|
148
|
+
</div>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSX } from "react";
|
|
2
|
-
import { Switch } from "@vetta-org/ui";
|
|
2
|
+
import { Button, Switch } from "@vetta-org/ui";
|
|
3
3
|
import { cn } from "@vetta-org/ui";
|
|
4
4
|
|
|
5
5
|
export interface WebhookEndpointRowView {
|
|
@@ -59,15 +59,14 @@ export function WebhookEndpointListView({
|
|
|
59
59
|
checked={endpoint.enabled}
|
|
60
60
|
onCheckedChange={(value) => onToggle(endpoint.id, value)}
|
|
61
61
|
/>
|
|
62
|
-
<
|
|
63
|
-
|
|
62
|
+
<Button
|
|
63
|
+
variant="field"
|
|
64
64
|
onClick={() => onTest(endpoint.id)}
|
|
65
65
|
disabled={testingId === endpoint.id}
|
|
66
|
-
className="whitespace-nowrap rounded-md border border-input bg-secondary px-2.5 py-1 text-[11px] text-foreground transition-colors hover:bg-accent disabled:opacity-50"
|
|
67
66
|
title={labels.test}
|
|
68
67
|
>
|
|
69
68
|
{testingId === endpoint.id ? labels.testing : labels.test}
|
|
70
|
-
</
|
|
69
|
+
</Button>
|
|
71
70
|
<button
|
|
72
71
|
type="button"
|
|
73
72
|
onClick={() => onEdit(endpoint.id)}
|
|
Binary file
|
package/src/settings/index.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
AchievementNavigationAssets,
|
|
3
|
-
AchievementNavigationButtonViewProps,
|
|
4
|
-
} from "./AchievementNavigationButtonView";
|
|
5
|
-
export { AchievementNavigationButtonView } from "./AchievementNavigationButtonView";
|
|
6
|
-
export type {
|
|
7
|
-
AchievementPromotionDialogViewLabels,
|
|
8
|
-
AchievementPromotionDialogViewProps,
|
|
9
|
-
} from "./AchievementPromotionDialogView";
|
|
10
|
-
export { AchievementPromotionDialogView } from "./AchievementPromotionDialogView";
|
|
11
|
-
export type {
|
|
12
|
-
AchievementSetOptionView,
|
|
13
|
-
AchievementSettingsViewProps,
|
|
14
|
-
} from "./AchievementSettingsView";
|
|
15
|
-
export { AchievementSettingsView } from "./AchievementSettingsView";
|
|
16
1
|
export type {
|
|
17
2
|
AppshotPermissionStatusView,
|
|
18
3
|
AppshotSettingsViewLabels,
|
|
@@ -25,22 +10,6 @@ export type {
|
|
|
25
10
|
ArchivedProjectsSettingsViewProps,
|
|
26
11
|
} from "./ArchivedProjectsSettingsView";
|
|
27
12
|
export { ArchivedProjectsSettingsView } from "./ArchivedProjectsSettingsView";
|
|
28
|
-
export type {
|
|
29
|
-
AchievementCurtainSideLayout,
|
|
30
|
-
AchievementCurtainsAssets,
|
|
31
|
-
AchievementCurtainsLayout,
|
|
32
|
-
AchievementCurtainsProps,
|
|
33
|
-
AchievementPromotionBadge3DProps,
|
|
34
|
-
AchievementPromotionConfettiProps,
|
|
35
|
-
AchievementTitleLayout,
|
|
36
|
-
AchievementTitleProps,
|
|
37
|
-
} from "./achievements";
|
|
38
|
-
export {
|
|
39
|
-
AchievementCurtains,
|
|
40
|
-
AchievementPromotionBadge3D,
|
|
41
|
-
AchievementPromotionConfetti,
|
|
42
|
-
AchievementTitle,
|
|
43
|
-
} from "./achievements";
|
|
44
13
|
export type {
|
|
45
14
|
BuiltinMcpSecretFieldView,
|
|
46
15
|
BuiltinMcpSecretsDialogViewLabels,
|
|
@@ -53,6 +22,13 @@ export type {
|
|
|
53
22
|
BuiltinMcpSectionViewProps,
|
|
54
23
|
} from "./BuiltinMcpSectionView";
|
|
55
24
|
export { BuiltinMcpSectionView } from "./BuiltinMcpSectionView";
|
|
25
|
+
export type {
|
|
26
|
+
EnvironmentGitInstallGuideView,
|
|
27
|
+
EnvironmentGitRowViewProps,
|
|
28
|
+
EnvironmentGitStatusView,
|
|
29
|
+
EnvironmentGitViewLabels,
|
|
30
|
+
} from "./EnvironmentGitRowView";
|
|
31
|
+
export { EnvironmentGitRowView } from "./EnvironmentGitRowView";
|
|
56
32
|
export type {
|
|
57
33
|
EnvironmentRuntimeKindView,
|
|
58
34
|
EnvironmentRuntimeStatusView,
|
|
@@ -90,9 +66,27 @@ export type {
|
|
|
90
66
|
export { ImLogDrawerView } from "./ImLogDrawerView";
|
|
91
67
|
export type { ImStatusBadgeStatus, ImStatusBadgeViewProps } from "./ImStatusBadgeView";
|
|
92
68
|
export { ImStatusBadgeView } from "./ImStatusBadgeView";
|
|
69
|
+
export type { JsonConfigInputViewProps } from "./JsonConfigInputView";
|
|
70
|
+
export { JsonConfigInputView } from "./JsonConfigInputView";
|
|
71
|
+
export type {
|
|
72
|
+
LauncherFeatureView,
|
|
73
|
+
LauncherPreviewGroupView,
|
|
74
|
+
LauncherPreviewRowView,
|
|
75
|
+
LauncherPreviewStatusView,
|
|
76
|
+
LauncherSettingsViewLabels,
|
|
77
|
+
LauncherSettingsViewProps,
|
|
78
|
+
} from "./LauncherSettingsView";
|
|
79
|
+
export { LauncherSettingsView } from "./LauncherSettingsView";
|
|
93
80
|
export { McpDefaultIcon } from "./McpDefaultIcon";
|
|
94
81
|
export type { McpJsonEditorViewProps } from "./McpJsonEditorView";
|
|
95
82
|
export { McpJsonEditorView } from "./McpJsonEditorView";
|
|
83
|
+
export type {
|
|
84
|
+
FetchedModelRowView,
|
|
85
|
+
FetchedModelTestView,
|
|
86
|
+
ModelsFetchedModelsDrawerViewLabels,
|
|
87
|
+
ModelsFetchedModelsDrawerViewProps,
|
|
88
|
+
} from "./ModelsFetchedModelsDrawerView";
|
|
89
|
+
export { ModelsFetchedModelsDrawerView } from "./ModelsFetchedModelsDrawerView";
|
|
96
90
|
export type {
|
|
97
91
|
ModelsProviderFormStateView,
|
|
98
92
|
ModelsProviderFormViewLabels,
|
|
@@ -106,6 +100,12 @@ export type {
|
|
|
106
100
|
export { ModelsProvidersSectionView } from "./ModelsProvidersSectionView";
|
|
107
101
|
export type { MotionSelectOption, MotionSelectProps } from "./MotionSelect";
|
|
108
102
|
export { MotionSelect } from "./MotionSelect";
|
|
103
|
+
export type {
|
|
104
|
+
NotificationScopeView,
|
|
105
|
+
NotificationSettingsViewLabels,
|
|
106
|
+
NotificationSettingsViewProps,
|
|
107
|
+
} from "./NotificationSettingsView";
|
|
108
|
+
export { NotificationSettingsView } from "./NotificationSettingsView";
|
|
109
109
|
export type {
|
|
110
110
|
PermissionItemView,
|
|
111
111
|
PermissionStatusView,
|
|
@@ -113,19 +113,25 @@ export type {
|
|
|
113
113
|
PermissionsSettingsViewProps,
|
|
114
114
|
} from "./PermissionsSettingsView";
|
|
115
115
|
export { PermissionsSettingsView } from "./PermissionsSettingsView";
|
|
116
|
-
export type { PetBubbleStylePreviewViewProps } from "./PetBubbleStylePreviewView";
|
|
117
|
-
export { PetBubbleStylePreviewView } from "./PetBubbleStylePreviewView";
|
|
118
116
|
export type {
|
|
119
|
-
|
|
117
|
+
PetActionGalleryViewLabels,
|
|
118
|
+
PetActionGalleryViewProps,
|
|
119
|
+
PetActionGroupView,
|
|
120
|
+
PetActionView,
|
|
121
|
+
} from "./PetActionGalleryView";
|
|
122
|
+
export { PetActionGalleryView } from "./PetActionGalleryView";
|
|
123
|
+
export type {
|
|
120
124
|
PetDecorationView,
|
|
121
125
|
PetSettingsViewLabels,
|
|
122
126
|
PetSettingsViewProps,
|
|
127
|
+
PetSizeControlView,
|
|
123
128
|
} from "./PetSettingsView";
|
|
124
129
|
export { PetSettingsView } from "./PetSettingsView";
|
|
125
130
|
export type {
|
|
126
131
|
PresetProviderModelRowView,
|
|
127
132
|
PresetProviderModelsListViewLabels,
|
|
128
133
|
PresetProviderModelsListViewProps,
|
|
134
|
+
PresetProviderModelTestView,
|
|
129
135
|
} from "./PresetProviderModelsListView";
|
|
130
136
|
export { PresetProviderModelsListView } from "./PresetProviderModelsListView";
|
|
131
137
|
export type {
|
|
@@ -139,6 +145,12 @@ export type {
|
|
|
139
145
|
PresetProvidersSectionViewProps,
|
|
140
146
|
} from "./PresetProvidersSectionView";
|
|
141
147
|
export { PresetProvidersSectionView } from "./PresetProvidersSectionView";
|
|
148
|
+
export type {
|
|
149
|
+
ProxyProviderRowView,
|
|
150
|
+
ProxySettingsSectionViewLabels,
|
|
151
|
+
ProxySettingsSectionViewProps,
|
|
152
|
+
} from "./ProxySettingsSectionView";
|
|
153
|
+
export { ProxySettingsSectionView } from "./ProxySettingsSectionView";
|
|
142
154
|
export type {
|
|
143
155
|
QrBindDialogBodyKind,
|
|
144
156
|
QrBindDialogDetail,
|
|
@@ -146,11 +158,6 @@ export type {
|
|
|
146
158
|
QrBindDialogViewProps,
|
|
147
159
|
} from "./QrBindDialogView";
|
|
148
160
|
export { QrBindDialogView } from "./QrBindDialogView";
|
|
149
|
-
export type {
|
|
150
|
-
QuickPanelOptionView,
|
|
151
|
-
QuickPanelSettingsSectionViewProps,
|
|
152
|
-
} from "./QuickPanelSettingsSectionView";
|
|
153
|
-
export { QuickPanelSettingsSectionView } from "./QuickPanelSettingsSectionView";
|
|
154
161
|
export type {
|
|
155
162
|
RemoteMcpSectionViewLabels,
|
|
156
163
|
RemoteMcpSectionViewModel,
|
|
@@ -183,35 +190,19 @@ export type { ShortcutRecorderViewProps } from "./ShortcutRecorderView";
|
|
|
183
190
|
export { ShortcutRecorderView } from "./ShortcutRecorderView";
|
|
184
191
|
export type { ShortcutActionRowView, ShortcutsSettingsViewProps } from "./ShortcutsSettingsView";
|
|
185
192
|
export { ShortcutsSettingsView } from "./ShortcutsSettingsView";
|
|
186
|
-
export {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
} from "./
|
|
192
|
-
export {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
} from "./
|
|
199
|
-
export { TeamDetailView } from "./TeamDetailView";
|
|
200
|
-
export type {
|
|
201
|
-
CreateTeamDialogViewProps,
|
|
202
|
-
JoinTeamDialogViewProps,
|
|
203
|
-
TeamDialogLabelsView,
|
|
204
|
-
} from "./TeamDialogsView";
|
|
205
|
-
export { CreateTeamDialogView, JoinTeamDialogView } from "./TeamDialogsView";
|
|
206
|
-
export type { TeamListItemView, TeamListViewProps } from "./TeamListView";
|
|
207
|
-
export { TeamListView } from "./TeamListView";
|
|
208
|
-
export type { TeamSettingsViewProps } from "./TeamSettingsView";
|
|
209
|
-
export { TeamSettingsView } from "./TeamSettingsView";
|
|
210
|
-
export type { TokenActivityChartViewProps } from "./TokenActivityChartView";
|
|
211
|
-
export { TokenActivityChartView } from "./TokenActivityChartView";
|
|
212
|
-
export * from "./token-activity";
|
|
213
|
-
export type { UsageStatsMetric, UsageStatsRange, UsageStatsViewProps } from "./UsageStatsView";
|
|
214
|
-
export { USAGE_STATS_RANGES, UsageStatsView } from "./UsageStatsView";
|
|
193
|
+
export type {
|
|
194
|
+
SpaceEditorDialogViewLabels,
|
|
195
|
+
SpaceEditorDialogViewProps,
|
|
196
|
+
SpaceEditorIconOption,
|
|
197
|
+
} from "./SpaceEditorDialogView";
|
|
198
|
+
export { SpaceEditorDialogView } from "./SpaceEditorDialogView";
|
|
199
|
+
export type {
|
|
200
|
+
SpacesFeatureView,
|
|
201
|
+
SpacesSettingsViewItem,
|
|
202
|
+
SpacesSettingsViewLabels,
|
|
203
|
+
SpacesSettingsViewProps,
|
|
204
|
+
} from "./SpacesSettingsView";
|
|
205
|
+
export { SpacesSettingsView } from "./SpacesSettingsView";
|
|
215
206
|
export type {
|
|
216
207
|
WebhookEndpointListViewLabels,
|
|
217
208
|
WebhookEndpointListViewProps,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 「有事在跑 / 没事」的状态点,待办条与底部面板 tab、折叠 pill 共用一个实现。
|
|
6
|
+
*
|
|
7
|
+
* 之前这套呼吸动画只存在于 `TodoProgress.tsx`,底部面板要同样的视觉,复制一份就会
|
|
8
|
+
* 出现两个事实源——改一处闪法两边不一致。抽到这里后两者同源,只靠 tone 区分语义色。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type ActivityStatusDotTone = "primary" | "emerald" | "muted";
|
|
12
|
+
|
|
13
|
+
export interface ActivityStatusDotProps {
|
|
14
|
+
/** true = 呼吸脉冲(运行中 / 未完成);false = 静止点(空闲 / 已完成)。 */
|
|
15
|
+
readonly pulse: boolean;
|
|
16
|
+
readonly tone: ActivityStatusDotTone;
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Tailwind 只认字面量类名,所以 tone 映射写成常量表而不是拼串。 */
|
|
21
|
+
const TONE_BACKGROUND: Record<ActivityStatusDotTone, string> = {
|
|
22
|
+
primary: "bg-primary",
|
|
23
|
+
emerald: "bg-emerald-500",
|
|
24
|
+
muted: "bg-muted-foreground/60",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const TONE_COLOR: Record<ActivityStatusDotTone, string> = {
|
|
28
|
+
primary: "var(--primary)",
|
|
29
|
+
emerald: "var(--color-emerald-500)",
|
|
30
|
+
muted: "var(--muted-foreground)",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 光晕(.activity-dot-halo)扩散淡出、核心点(.activity-dot-core)同拍呼吸——动画不写在 CSS 里:
|
|
35
|
+
* 毛玻璃窗口每出一帧都要整窗重合成,一个 6px 的点 60fps 逐帧插值就足以让 GPU 常年不闲。
|
|
36
|
+
* 由宿主(desktop 的 live-animations)按类名挂 steps(16) 的合成器动画并与其它指示器锁同一相位;
|
|
37
|
+
* 没有宿主动画时光晕保持不可见、核心点全亮。
|
|
38
|
+
*/
|
|
39
|
+
export const ACTIVITY_STATUS_DOT_CSS = `
|
|
40
|
+
.activity-dot-halo { opacity: 0; }
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
/** 关键帧注入点:每个用到状态点的根节点渲染一次,内容相同不会互相干扰。 */
|
|
44
|
+
export function ActivityStatusDotStyles(): JSX.Element {
|
|
45
|
+
return <style>{ACTIVITY_STATUS_DOT_CSS}</style>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function ActivityStatusDot({ pulse, tone, className }: ActivityStatusDotProps): JSX.Element {
|
|
49
|
+
const background = TONE_BACKGROUND[tone];
|
|
50
|
+
return (
|
|
51
|
+
<span
|
|
52
|
+
aria-hidden
|
|
53
|
+
data-status={pulse ? "active" : "idle"}
|
|
54
|
+
className={cn("relative flex h-2 w-2 shrink-0 items-center justify-center", className)}
|
|
55
|
+
>
|
|
56
|
+
{pulse ? (
|
|
57
|
+
<>
|
|
58
|
+
<span className={cn("activity-dot-halo absolute h-1.5 w-1.5 rounded-full", background)} />
|
|
59
|
+
<span className={cn("activity-dot-core relative h-1.5 w-1.5 rounded-full", background)} />
|
|
60
|
+
</>
|
|
61
|
+
) : (
|
|
62
|
+
<span
|
|
63
|
+
className={cn("h-1.5 w-1.5 rounded-full", background)}
|
|
64
|
+
style={{ boxShadow: `0 0 0 2px color-mix(in srgb, ${TONE_COLOR[tone]} 18%, transparent)` }}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</span>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from "@vetta-org/ui";
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
2
|
import type { JSX } from "react";
|
|
3
3
|
|
|
4
4
|
export interface AvatarStackViewProps {
|
|
@@ -22,24 +22,24 @@ export function AvatarStackView({
|
|
|
22
22
|
data-avatar-stack="true"
|
|
23
23
|
>
|
|
24
24
|
{visibleAvatarUrls.map((avatarUrl, index) => (
|
|
25
|
-
<
|
|
25
|
+
<span
|
|
26
26
|
key={`${avatarUrl}:${index}`}
|
|
27
|
-
src={avatarUrl}
|
|
28
|
-
alt=""
|
|
29
27
|
className={cn(
|
|
30
|
-
"h-4 w-4 shrink-0 rounded-full
|
|
28
|
+
"relative h-4 w-4 shrink-0 rounded-full ring-1 ring-border",
|
|
31
29
|
index > 0 && "-ml-1.5",
|
|
32
30
|
)}
|
|
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
31
|
>
|
|
40
|
-
|
|
32
|
+
<img src={avatarUrl} alt="" className="h-4 w-4 rounded-full object-cover" />
|
|
33
|
+
{index === MAX_VISIBLE_AVATARS - 1 && hiddenAvatarCount > 0 ? (
|
|
34
|
+
<span
|
|
35
|
+
className="absolute inset-0 inline-flex items-center justify-center rounded-full bg-background/60 text-[9px] tabular-nums text-foreground"
|
|
36
|
+
data-avatar-overflow={hiddenAvatarCount}
|
|
37
|
+
>
|
|
38
|
+
+{hiddenAvatarCount}
|
|
39
|
+
</span>
|
|
40
|
+
) : null}
|
|
41
41
|
</span>
|
|
42
|
-
)
|
|
42
|
+
))}
|
|
43
43
|
</span>
|
|
44
44
|
);
|
|
45
45
|
}
|
package/src/shared/BotAvatar.tsx
CHANGED
|
@@ -120,7 +120,9 @@ export const BotAvatar = memo(function BotAvatar({
|
|
|
120
120
|
ro.observe(parent);
|
|
121
121
|
}, []);
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
// 流式中(active)不再自动做小动作:每个动作都是 motion 逐帧改写 transform,毛玻璃窗口每帧都要
|
|
124
|
+
// 整窗重合成;「还在进行」由静态光晕表达。autoplay 仍用于欢迎页这类本就该活泼的场景。
|
|
125
|
+
const shouldSchedule = !pacing && autoplay;
|
|
124
126
|
|
|
125
127
|
const pickRandomMood = useCallback((): AvatarMood => {
|
|
126
128
|
const choices = ACTIVE_MOODS.filter((m) => m !== lastPlayedRef.current);
|
|
@@ -139,11 +141,13 @@ export const BotAvatar = memo(function BotAvatar({
|
|
|
139
141
|
return () => clearTimeout(id);
|
|
140
142
|
}, [mood]);
|
|
141
143
|
|
|
144
|
+
// 自动小动作(仅 autoplay)之间留 1.4~3s 的空档:每个动作都是 motion 逐帧改写 transform,
|
|
145
|
+
// 毛玻璃窗口每帧都要整窗重合成。
|
|
142
146
|
useEffect(() => {
|
|
143
147
|
if (!shouldSchedule || mood !== "idle") return;
|
|
144
148
|
const id = setTimeout(
|
|
145
149
|
() => triggerMood(pickRandomMood()),
|
|
146
|
-
|
|
150
|
+
1400 + Math.random() * 1600,
|
|
147
151
|
);
|
|
148
152
|
return () => clearTimeout(id);
|
|
149
153
|
}, [shouldSchedule, mood, triggerMood, pickRandomMood]);
|
|
@@ -273,12 +277,8 @@ export const BotAvatar = memo(function BotAvatar({
|
|
|
273
277
|
className={`no-drag relative flex shrink-0 items-center justify-center focus:outline-none ${cfg.wrapper} ${className}`}
|
|
274
278
|
>
|
|
275
279
|
{active && (
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
className={`absolute ${cfg.glowInset} rounded-[20px] bg-primary/30 ${cfg.glowBlur}`}
|
|
279
|
-
animate={{ opacity: [0.35, 0.65, 0.35], scale: [0.95, 1.05, 0.95] }}
|
|
280
|
-
transition={{ duration: 1.6, repeat: Infinity, ease: "easeInOut" }}
|
|
281
|
-
/>
|
|
280
|
+
// 光晕是静态的:模糊层一旦跟着无限动画缩放/变透明,流式全程每帧都要重新模糊一遍。
|
|
281
|
+
<span aria-hidden className={`absolute ${cfg.glowInset} rounded-[20px] bg-primary/30 opacity-50 ${cfg.glowBlur}`} />
|
|
282
282
|
)}
|
|
283
283
|
<motion.div
|
|
284
284
|
className={`relative flex items-center justify-center ${cfg.body} bg-gradient-to-br from-primary to-primary/85 text-primary-foreground ${cfg.shadow}`}
|
|
@@ -366,7 +366,9 @@ export const BotAvatar = memo(function BotAvatar({
|
|
|
366
366
|
y: [0, -3 * f, -7 * f, -11 * f],
|
|
367
367
|
x: [0, 1 * f, -1 * f, 1 * f],
|
|
368
368
|
}}
|
|
369
|
-
|
|
369
|
+
// 退场必须自带有限 transition:否则会继承下方的 repeat: Infinity,
|
|
370
|
+
// 退场永远结束不了,「z」不卸载并一直以 60fps 驱动整窗重绘。
|
|
371
|
+
exit={{ opacity: 0, transition: { duration: 0.2 } }}
|
|
370
372
|
transition={{
|
|
371
373
|
duration: 1.4,
|
|
372
374
|
ease: "easeOut",
|
|
@@ -38,7 +38,7 @@ export function CodeBlockCopyButtonView({
|
|
|
38
38
|
onClick={handleCopy}
|
|
39
39
|
aria-label={copied ? labels.copied : labels.copy}
|
|
40
40
|
title={copied ? labels.copied : labels.copy}
|
|
41
|
-
className="absolute right-2 top-2 z-20 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border border-
|
|
41
|
+
className="absolute right-2 top-2 z-20 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border border-border/60 bg-background/90 text-muted-foreground opacity-0 shadow-sm transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-hover/code-block:opacity-100"
|
|
42
42
|
>
|
|
43
43
|
<span className={copied ? "icon-[mdi--check] h-4 w-4" : "icon-[solar--copy-linear] h-4 w-4"} />
|
|
44
44
|
</button>
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
DropdownMenu,
|
|
4
|
-
DropdownMenuContent,
|
|
5
|
-
DropdownMenuItem,
|
|
6
|
-
DropdownMenuSeparator,
|
|
7
|
-
DropdownMenuSub,
|
|
8
|
-
DropdownMenuSubContent,
|
|
9
|
-
DropdownMenuSubTrigger,
|
|
10
|
-
DropdownMenuTrigger,
|
|
11
|
-
} from "@vetta-org/ui";
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@vetta-org/ui/dropdown-menu";
|
|
12
3
|
import type { JSX } from "react";
|
|
13
4
|
|
|
14
5
|
/**
|
|
@@ -28,6 +19,7 @@ export type ContextMenuNode =
|
|
|
28
19
|
checked?: boolean;
|
|
29
20
|
danger?: boolean;
|
|
30
21
|
disabled?: boolean;
|
|
22
|
+
title?: string;
|
|
31
23
|
onSelect: () => void;
|
|
32
24
|
}
|
|
33
25
|
| {
|
|
@@ -91,6 +83,7 @@ function renderNodes(nodes: readonly ContextMenuNode[]): JSX.Element[] {
|
|
|
91
83
|
<DropdownMenuItem
|
|
92
84
|
key={node.id}
|
|
93
85
|
disabled={node.disabled}
|
|
86
|
+
title={node.title}
|
|
94
87
|
onSelect={node.onSelect}
|
|
95
88
|
className={cn("px-2 py-[5px]", node.danger && "text-destructive")}
|
|
96
89
|
>
|
|
@@ -118,7 +118,7 @@ export const MarkdownTable = memo(function MarkdownTable({
|
|
|
118
118
|
<div className="md-table-shadow-host relative" data-md-table-frame="">
|
|
119
119
|
<div
|
|
120
120
|
ref={scrollRef}
|
|
121
|
-
className="max-h-[70vh] overflow-auto overscroll-x-contain rounded-xl border border-border/60 bg-muted p-[3px]"
|
|
121
|
+
className="max-h-[70vh] overflow-auto overscroll-x-contain rounded-xl border border-border/60 bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))] dark:bg-muted p-[3px]"
|
|
122
122
|
style={{ boxShadow: overflowShadow(overflow) }}
|
|
123
123
|
>
|
|
124
124
|
<table
|
|
@@ -187,7 +187,7 @@ export function MarkdownTableHeaderCell({
|
|
|
187
187
|
CELL_CLASS,
|
|
188
188
|
// -top-[3px] 抵消容器的 3px 内边距:表头吸顶时要贴住外框上边缘,
|
|
189
189
|
// 否则滚动内容会从它上方那条缝里穿过去。
|
|
190
|
-
"sticky -top-[3px] z-[1] whitespace-nowrap bg-muted py-2.5 text-[12px] font-medium text-muted-foreground/80",
|
|
190
|
+
"sticky -top-[3px] z-[1] whitespace-nowrap bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))] dark:bg-muted py-2.5 text-[12px] font-medium text-muted-foreground/80",
|
|
191
191
|
)}
|
|
192
192
|
>
|
|
193
193
|
{children}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
|
|
3
|
+
import { act } from "react";
|
|
4
|
+
import { createRoot, type Root } from "react-dom/client";
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
6
|
+
import { SegmentedControl } from "./SegmentedControl";
|
|
7
|
+
|
|
8
|
+
type Scope = "all" | "mine" | "empty";
|
|
9
|
+
|
|
10
|
+
describe("SegmentedControl", () => {
|
|
11
|
+
let root: Root;
|
|
12
|
+
let host: HTMLDivElement;
|
|
13
|
+
|
|
14
|
+
function renderControl(value: Scope, onChange: (next: Scope) => void): HTMLElement {
|
|
15
|
+
const items = [
|
|
16
|
+
{ key: "all" as Scope, label: "All", count: 12 },
|
|
17
|
+
{ key: "mine" as Scope, label: "Mine" },
|
|
18
|
+
// 0 不该显示:计数为 0 的标签栏和没有计数长得一样,免得读成一枚空徽标。
|
|
19
|
+
{ key: "empty" as Scope, label: "Empty", count: 0 },
|
|
20
|
+
];
|
|
21
|
+
act(() => root.render(<SegmentedControl items={items} value={value} onChange={onChange} />));
|
|
22
|
+
return host;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
27
|
+
host = document.createElement("div");
|
|
28
|
+
document.body.append(host);
|
|
29
|
+
root = createRoot(host);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
act(() => root.unmount());
|
|
34
|
+
host.remove();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("renders a per-item count as muted trailing text and skips zero", () => {
|
|
38
|
+
const container = renderControl("all", () => {});
|
|
39
|
+
|
|
40
|
+
const allTab = container.querySelector("button") as HTMLElement;
|
|
41
|
+
expect(allTab.textContent).toBe("All12");
|
|
42
|
+
// 计数是中性量,不能借用未读徽标的告警配色。
|
|
43
|
+
const count = allTab.querySelector("span > span") as HTMLElement;
|
|
44
|
+
expect(count.textContent).toBe("12");
|
|
45
|
+
expect(count.className).toContain("text-muted-foreground");
|
|
46
|
+
|
|
47
|
+
const buttons = container.querySelectorAll("button");
|
|
48
|
+
expect(buttons[1]?.textContent).toBe("Mine");
|
|
49
|
+
expect(buttons[2]?.textContent).toBe("Empty");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("reports the clicked key and highlights the current one", () => {
|
|
53
|
+
const picks: Scope[] = [];
|
|
54
|
+
const container = renderControl("all", (next) => picks.push(next));
|
|
55
|
+
const buttons = container.querySelectorAll("button");
|
|
56
|
+
|
|
57
|
+
expect(buttons[0]?.className).toContain("text-foreground");
|
|
58
|
+
expect(buttons[1]?.className).toContain("text-muted-foreground");
|
|
59
|
+
|
|
60
|
+
act(() => (buttons[1] as HTMLButtonElement).click());
|
|
61
|
+
expect(picks).toEqual(["mine"]);
|
|
62
|
+
|
|
63
|
+
renderControl("mine", () => {});
|
|
64
|
+
const afterSwitch = container.querySelectorAll("button");
|
|
65
|
+
expect(afterSwitch[1]?.className).toContain("text-foreground");
|
|
66
|
+
expect(afterSwitch[0]?.className).toContain("text-muted-foreground");
|
|
67
|
+
});
|
|
68
|
+
});
|