@vetta-org/theme-ui 0.1.1 → 0.1.2
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 +733 -5
- 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/DebugTabPanelView.tsx +1 -1
- package/src/activity/MarkdownPreviewView.tsx +56 -59
- 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/ExecutionModeSelectorView.tsx +20 -5
- package/src/chat/HeaderActionBarView.tsx +731 -0
- package/src/chat/HeaderActionOverflowMenu.tsx +137 -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 +28 -3
- package/src/chat/MessageFeedView.test.tsx +81 -0
- package/src/chat/MessageFeedView.tsx +72 -152
- package/src/chat/MessageInputView.tsx +1 -1
- 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 +32 -27
- package/src/chat/markdown-link.ts +7 -279
- 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/TextFileEditorView.tsx +2 -1
- 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/InlineTokenChip.tsx +68 -0
- package/src/markdown/MarkdownContent.tsx +411 -0
- package/src/markdown/MarkdownImage.tsx +51 -0
- package/src/markdown/MathFormula.tsx +46 -0
- package/src/markdown/MermaidBlock.tsx +43 -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/index.ts +11 -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.ts +43 -0
- package/src/markdown/rich-labels.ts +49 -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 +38 -9
- package/src/overlays/CommandMenuView.tsx +77 -117
- package/src/overlays/ConfirmDialogView.tsx +25 -20
- package/src/overlays/ReleaseNoteMarkdown.tsx +29 -0
- package/src/overlays/SplashOptionRow.tsx +46 -0
- package/src/overlays/SplashPanel.tsx +85 -0
- package/src/overlays/SplashParts.tsx +213 -0
- package/src/overlays/UpdateCheckerView.tsx +34 -18
- package/src/overlays/UpdateRestartDialogView.tsx +139 -54
- package/src/overlays/command-menu-types.ts +2 -0
- package/src/overlays/command-menu.css +1 -20
- package/src/overlays/index.ts +14 -1
- package/src/plugin-ui/index.ts +8 -0
- package/src/project/ConversationTagDotsView.tsx +1 -1
- package/src/project/ConversationTagEditorDialogView.tsx +4 -1
- package/src/project/DefaultConversationSectionView.tsx +4 -4
- package/src/project/DefaultSessionListView.tsx +5 -31
- package/src/project/DefaultSessionRowView.tsx +106 -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/AchievementSettingsView.tsx +0 -1
- package/src/settings/AppshotSettingsView.tsx +0 -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 +17 -20
- 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/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/PresetProviderModelsListView.tsx +141 -24
- package/src/settings/PresetProviderRowView.tsx +205 -182
- package/src/settings/ProxySettingsSectionView.tsx +182 -0
- package/src/settings/QrBindDialogView.tsx +1 -1
- package/src/settings/QuickPanelSettingsSectionView.tsx +0 -2
- 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 -1
- package/src/settings/SpaceEditorDialogView.tsx +120 -0
- package/src/settings/SpacesSettingsView.tsx +105 -0
- package/src/settings/WebhookEndpointListView.tsx +4 -5
- package/src/settings/index.ts +41 -29
- 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/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.outline.test.tsx +59 -0
- package/src/shared/TabBar.tsx +22 -17
- package/src/shared/VettaKbd.test.tsx +52 -0
- package/src/shared/VettaKbd.tsx +81 -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 +6 -0
- package/src/shared/kbd-keys.test.ts +61 -0
- package/src/shared/kbd-keys.ts +253 -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 +25 -15
- 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 +28 -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/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 +24 -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/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/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
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
2
|
-
import type { JSX } from "react";
|
|
3
|
-
import { cn } from "@vetta-org/ui";
|
|
4
|
-
import { MESSAGE_CENTER_SPRING } from "./ChatMessageListView";
|
|
5
|
-
import { MessageCenterEmptyState } from "./MessageCenterEmptyState";
|
|
6
|
-
import { MessageCenterToolbarButton } from "./MessageCenterToolbarButton";
|
|
7
|
-
|
|
8
|
-
export interface NotificationMessageListItemView {
|
|
9
|
-
readonly id: number;
|
|
10
|
-
readonly title: string;
|
|
11
|
-
readonly body: string | null;
|
|
12
|
-
readonly read: boolean;
|
|
13
|
-
readonly relativeTime: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface NotificationMessageListViewProps {
|
|
17
|
-
readonly emptyText: string;
|
|
18
|
-
readonly emptyIcon: string;
|
|
19
|
-
readonly hasUnread: boolean;
|
|
20
|
-
readonly hasRead: boolean;
|
|
21
|
-
readonly markAllReadLabel: string;
|
|
22
|
-
readonly clearReadLabel: string;
|
|
23
|
-
readonly deleteLabel: string;
|
|
24
|
-
readonly items: readonly NotificationMessageListItemView[];
|
|
25
|
-
readonly onMarkAllRead: () => void;
|
|
26
|
-
readonly onClearRead: () => void;
|
|
27
|
-
readonly onMarkRead: (id: number) => void;
|
|
28
|
-
readonly onDelete: (id: number) => void;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function NotificationMessageListView({
|
|
32
|
-
emptyText,
|
|
33
|
-
emptyIcon,
|
|
34
|
-
hasUnread,
|
|
35
|
-
hasRead,
|
|
36
|
-
markAllReadLabel,
|
|
37
|
-
clearReadLabel,
|
|
38
|
-
deleteLabel,
|
|
39
|
-
items,
|
|
40
|
-
onMarkAllRead,
|
|
41
|
-
onClearRead,
|
|
42
|
-
onMarkRead,
|
|
43
|
-
onDelete,
|
|
44
|
-
}: NotificationMessageListViewProps): JSX.Element {
|
|
45
|
-
if (items.length === 0) {
|
|
46
|
-
return <MessageCenterEmptyState text={emptyText} icon={emptyIcon} />;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className="flex flex-col gap-1.5 p-3">
|
|
51
|
-
{(hasUnread || hasRead) && (
|
|
52
|
-
<div className="flex justify-end gap-1.5 px-0.5">
|
|
53
|
-
{hasUnread && (
|
|
54
|
-
<MessageCenterToolbarButton icon="icon-[solar--check-read-linear]" onClick={onMarkAllRead}>
|
|
55
|
-
{markAllReadLabel}
|
|
56
|
-
</MessageCenterToolbarButton>
|
|
57
|
-
)}
|
|
58
|
-
{hasRead && (
|
|
59
|
-
<MessageCenterToolbarButton
|
|
60
|
-
icon="icon-[solar--notification-lines-remove-linear]"
|
|
61
|
-
onClick={onClearRead}
|
|
62
|
-
>
|
|
63
|
-
{clearReadLabel}
|
|
64
|
-
</MessageCenterToolbarButton>
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
67
|
-
)}
|
|
68
|
-
<AnimatePresence initial={false} mode="popLayout">
|
|
69
|
-
{items.map((notification) => (
|
|
70
|
-
<motion.div
|
|
71
|
-
key={notification.id}
|
|
72
|
-
layout
|
|
73
|
-
initial={{ opacity: 0, y: 8, scale: 0.98 }}
|
|
74
|
-
animate={{ opacity: 1, y: 0, scale: 1 }}
|
|
75
|
-
exit={{ opacity: 0, scale: 0.92, transition: { duration: 0.15 } }}
|
|
76
|
-
transition={MESSAGE_CENTER_SPRING}
|
|
77
|
-
onClick={() => onMarkRead(notification.id)}
|
|
78
|
-
className={cn(
|
|
79
|
-
"group relative cursor-pointer rounded-xl border p-3.5 text-left transition-colors",
|
|
80
|
-
notification.read
|
|
81
|
-
? "border-border/50 bg-background hover:bg-accent/20"
|
|
82
|
-
: "border-primary/30 bg-primary/5 hover:bg-primary/10",
|
|
83
|
-
)}
|
|
84
|
-
>
|
|
85
|
-
<button
|
|
86
|
-
type="button"
|
|
87
|
-
onClick={(event) => {
|
|
88
|
-
event.stopPropagation();
|
|
89
|
-
onDelete(notification.id);
|
|
90
|
-
}}
|
|
91
|
-
className="absolute -right-1.5 -top-1.5 z-10 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 shadow-sm transition-colors hover:border-destructive/40 hover:bg-destructive hover:text-destructive-foreground group-hover:opacity-100"
|
|
92
|
-
title={deleteLabel}
|
|
93
|
-
>
|
|
94
|
-
<span className="icon-[solar--close-circle-linear] h-3 w-3" />
|
|
95
|
-
</button>
|
|
96
|
-
|
|
97
|
-
<div className="flex items-start gap-3">
|
|
98
|
-
<div
|
|
99
|
-
className={cn(
|
|
100
|
-
"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full",
|
|
101
|
-
notification.read ? "bg-muted" : "bg-primary/15",
|
|
102
|
-
)}
|
|
103
|
-
>
|
|
104
|
-
<span
|
|
105
|
-
className={cn(
|
|
106
|
-
"icon-[solar--bell-linear] h-4 w-4",
|
|
107
|
-
notification.read ? "text-muted-foreground" : "text-primary",
|
|
108
|
-
)}
|
|
109
|
-
/>
|
|
110
|
-
{!notification.read && (
|
|
111
|
-
<span className="absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-primary ring-1 ring-popover" />
|
|
112
|
-
)}
|
|
113
|
-
</div>
|
|
114
|
-
<div className="min-w-0 flex-1">
|
|
115
|
-
<p
|
|
116
|
-
className={cn(
|
|
117
|
-
"truncate text-[12px] leading-snug",
|
|
118
|
-
notification.read ? "text-muted-foreground" : "font-semibold text-foreground",
|
|
119
|
-
)}
|
|
120
|
-
>
|
|
121
|
-
{notification.title}
|
|
122
|
-
</p>
|
|
123
|
-
{notification.body && (
|
|
124
|
-
<p className="mt-1 whitespace-pre-line text-[11px] leading-relaxed text-muted-foreground">
|
|
125
|
-
{notification.body}
|
|
126
|
-
</p>
|
|
127
|
-
)}
|
|
128
|
-
<p className="mt-1.5 text-[10px] text-muted-foreground/50">{notification.relativeTime}</p>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
</motion.div>
|
|
132
|
-
))}
|
|
133
|
-
</AnimatePresence>
|
|
134
|
-
</div>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
import { SettingsMenuActionButton } from "./SettingsMenuActionButton";
|
|
3
|
-
|
|
4
|
-
export interface SettingsMenuAccountSectionProps {
|
|
5
|
-
loggedIn: boolean;
|
|
6
|
-
loginLabel: string;
|
|
7
|
-
logoutLabel: string;
|
|
8
|
-
onLogin: () => void;
|
|
9
|
-
onLogout: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function SettingsMenuAccountSection({
|
|
13
|
-
loggedIn,
|
|
14
|
-
loginLabel,
|
|
15
|
-
logoutLabel,
|
|
16
|
-
onLogin,
|
|
17
|
-
onLogout,
|
|
18
|
-
}: SettingsMenuAccountSectionProps): JSX.Element {
|
|
19
|
-
if (loggedIn) {
|
|
20
|
-
return (
|
|
21
|
-
<SettingsMenuActionButton icon="icon-[solar--logout-2-linear]" onClick={onLogout}>
|
|
22
|
-
{logoutLabel}
|
|
23
|
-
</SettingsMenuActionButton>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<SettingsMenuActionButton icon="icon-[solar--login-2-linear]" onClick={onLogin}>
|
|
29
|
-
{loginLabel}
|
|
30
|
-
</SettingsMenuActionButton>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
import { cn } from "@vetta-org/ui";
|
|
3
|
-
import { SettingsMenuDivider } from "./SettingsMenuDivider";
|
|
4
|
-
|
|
5
|
-
export interface SettingsMenuQuotaSectionProps {
|
|
6
|
-
fiveHourRemainingPercent: number;
|
|
7
|
-
/** Fully resolved countdown text from host. */
|
|
8
|
-
resetCountdown: string;
|
|
9
|
-
quotaLabel: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function SettingsMenuQuotaSection({
|
|
13
|
-
fiveHourRemainingPercent,
|
|
14
|
-
resetCountdown,
|
|
15
|
-
quotaLabel,
|
|
16
|
-
}: SettingsMenuQuotaSectionProps): JSX.Element {
|
|
17
|
-
return (
|
|
18
|
-
<div>
|
|
19
|
-
<SettingsMenuDivider />
|
|
20
|
-
<div className="mx-2 my-1.5 rounded-md bg-accent/50 px-2 py-1.5">
|
|
21
|
-
<div className="flex items-center justify-between">
|
|
22
|
-
<div className="flex items-center gap-1.5">
|
|
23
|
-
<span className="icon-[solar--hourglass-linear] h-3.5 w-3.5 text-muted-foreground" />
|
|
24
|
-
<span className="text-[11px] text-muted-foreground">{quotaLabel}</span>
|
|
25
|
-
</div>
|
|
26
|
-
<span
|
|
27
|
-
className={cn(
|
|
28
|
-
"text-[11px] font-semibold tabular-nums",
|
|
29
|
-
fiveHourRemainingPercent <= 0 ? "text-destructive" : "text-foreground",
|
|
30
|
-
)}
|
|
31
|
-
>
|
|
32
|
-
{fiveHourRemainingPercent}%
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
<div className="mt-1.5 h-1 w-full overflow-hidden rounded-full bg-border">
|
|
36
|
-
<div
|
|
37
|
-
className="h-full rounded-full bg-primary/70 transition-all"
|
|
38
|
-
style={{ width: `${fiveHourRemainingPercent}%` }}
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
<div className="mt-1 text-[10px] text-muted-foreground">{resetCountdown}</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
import { motion } from "motion/react";
|
|
3
|
-
import { Button, Popover, PopoverContent, PopoverTrigger } from "@vetta-org/ui";
|
|
4
|
-
import { SkillToggleSwitch } from "./SkillToggleSwitch";
|
|
5
|
-
import type { SkillCardSkillView, SkillCardViewLabels } from "./SkillCardView";
|
|
6
|
-
|
|
7
|
-
export interface SceneCardViewLabels extends SkillCardViewLabels {
|
|
8
|
-
readonly use: string;
|
|
9
|
-
readonly generalReadonly: string;
|
|
10
|
-
readonly localReadonly: string;
|
|
11
|
-
readonly running: string;
|
|
12
|
-
readonly installed: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface SceneCardViewProps {
|
|
16
|
-
readonly scene: SkillCardSkillView & { readonly tags: readonly string[] };
|
|
17
|
-
readonly labels: SceneCardViewLabels;
|
|
18
|
-
readonly isLoading: boolean;
|
|
19
|
-
readonly previewable: boolean;
|
|
20
|
-
readonly onInstall: () => void;
|
|
21
|
-
readonly onToggle: () => void;
|
|
22
|
-
readonly onUninstall: () => void;
|
|
23
|
-
readonly onPreview?: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function SceneCardView({
|
|
27
|
-
scene,
|
|
28
|
-
labels,
|
|
29
|
-
isLoading,
|
|
30
|
-
previewable,
|
|
31
|
-
onInstall,
|
|
32
|
-
onToggle,
|
|
33
|
-
onUninstall,
|
|
34
|
-
onPreview,
|
|
35
|
-
}: SceneCardViewProps): JSX.Element {
|
|
36
|
-
const isReadonly = scene.isAgent || scene.isReadonly;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<motion.div
|
|
40
|
-
variants={{
|
|
41
|
-
hidden: { opacity: 0, y: 10, scale: 0.98 },
|
|
42
|
-
show: { opacity: 1, y: 0, scale: 1 },
|
|
43
|
-
}}
|
|
44
|
-
transition={{ type: "spring", stiffness: 280, damping: 26 }}
|
|
45
|
-
whileHover={{ y: -2 }}
|
|
46
|
-
onClick={previewable ? onPreview : undefined}
|
|
47
|
-
className={`group relative flex flex-col overflow-hidden rounded-xl bg-card transition-colors duration-200 hover:bg-accent ${
|
|
48
|
-
previewable ? "cursor-pointer" : ""
|
|
49
|
-
}`}
|
|
50
|
-
>
|
|
51
|
-
<div className="flex flex-1 flex-col gap-2 px-3.5 pt-3 pb-3">
|
|
52
|
-
<div className="flex items-start gap-2.5">
|
|
53
|
-
<div
|
|
54
|
-
className={`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg transition-colors ${
|
|
55
|
-
scene.installed
|
|
56
|
-
? "bg-primary/10 text-primary ring-1 ring-inset ring-primary/20"
|
|
57
|
-
: "bg-accent/50 text-muted-foreground/70"
|
|
58
|
-
}`}
|
|
59
|
-
>
|
|
60
|
-
<span className="icon-[mdi--movie-open-outline] h-4 w-4" />
|
|
61
|
-
</div>
|
|
62
|
-
<div className="min-w-0 flex-1">
|
|
63
|
-
<div className="flex items-baseline gap-2">
|
|
64
|
-
<h4 className="truncate text-[13px] font-semibold tracking-tight text-foreground">
|
|
65
|
-
{scene.alias || scene.name}
|
|
66
|
-
</h4>
|
|
67
|
-
{scene.installed && scene.localVersion && (
|
|
68
|
-
<span className="shrink-0 text-[10px] tabular-nums text-muted-foreground/45">
|
|
69
|
-
v{scene.localVersion}
|
|
70
|
-
</span>
|
|
71
|
-
)}
|
|
72
|
-
</div>
|
|
73
|
-
<p className="mt-0.5 line-clamp-2 text-[12px] leading-[1.5] text-muted-foreground/65">
|
|
74
|
-
{scene.description || labels.noDescription}
|
|
75
|
-
</p>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<div className="mt-auto flex items-center gap-2 pt-2">
|
|
80
|
-
<div className="flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden">
|
|
81
|
-
{isReadonly ? (
|
|
82
|
-
<span className="inline-flex h-5 shrink-0 items-center gap-1 rounded-full bg-accent/60 px-2 text-[10px] font-semibold text-muted-foreground/80">
|
|
83
|
-
<span
|
|
84
|
-
className={`${scene.isAgent ? "icon-[mdi--earth]" : "icon-[mdi--folder-outline]"} h-2.5 w-2.5`}
|
|
85
|
-
/>
|
|
86
|
-
{scene.isAgent ? labels.generalReadonly : labels.localReadonly}
|
|
87
|
-
</span>
|
|
88
|
-
) : (
|
|
89
|
-
scene.installed && (
|
|
90
|
-
<span
|
|
91
|
-
className={`inline-flex h-5 shrink-0 items-center gap-1 rounded-full px-2 text-[10px] font-semibold ${
|
|
92
|
-
scene.enabled
|
|
93
|
-
? "bg-emerald-500/15 text-emerald-400"
|
|
94
|
-
: "bg-accent/60 text-muted-foreground"
|
|
95
|
-
}`}
|
|
96
|
-
>
|
|
97
|
-
<span
|
|
98
|
-
className={`h-1.5 w-1.5 rounded-full ${
|
|
99
|
-
scene.enabled ? "bg-emerald-400" : "bg-muted-foreground/60"
|
|
100
|
-
}`}
|
|
101
|
-
/>
|
|
102
|
-
{scene.enabled ? labels.running : labels.installed}
|
|
103
|
-
</span>
|
|
104
|
-
)
|
|
105
|
-
)}
|
|
106
|
-
{scene.needsUpdate && (
|
|
107
|
-
<span className="inline-flex h-5 shrink-0 items-center gap-0.5 rounded-full bg-amber-500/15 px-1.5 text-[10px] font-semibold text-amber-400">
|
|
108
|
-
<span className="icon-[mdi--arrow-up-bold] h-2.5 w-2.5" />
|
|
109
|
-
{labels.updatable}
|
|
110
|
-
</span>
|
|
111
|
-
)}
|
|
112
|
-
{scene.tags.slice(0, 2).map((tag) => (
|
|
113
|
-
<span
|
|
114
|
-
key={tag}
|
|
115
|
-
className="shrink-0 truncate rounded-full bg-accent/50 px-2 py-0.5 text-[10px] text-muted-foreground/70"
|
|
116
|
-
>
|
|
117
|
-
{tag}
|
|
118
|
-
</span>
|
|
119
|
-
))}
|
|
120
|
-
</div>
|
|
121
|
-
<div className="ml-auto flex shrink-0 items-center gap-1.5">
|
|
122
|
-
{isReadonly ? (
|
|
123
|
-
<span className="flex h-7 items-center gap-1 px-1.5 text-[11px] text-muted-foreground/50">
|
|
124
|
-
<span className="icon-[mdi--lock-outline] h-3.5 w-3.5" />
|
|
125
|
-
{labels.readonly}
|
|
126
|
-
</span>
|
|
127
|
-
) : scene.installed ? (
|
|
128
|
-
<>
|
|
129
|
-
<Popover>
|
|
130
|
-
<PopoverTrigger asChild>
|
|
131
|
-
<button
|
|
132
|
-
type="button"
|
|
133
|
-
onClick={(e) => e.stopPropagation()}
|
|
134
|
-
className="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/60 opacity-60 transition-all group-hover:opacity-100 hover:bg-primary/10 hover:text-primary"
|
|
135
|
-
>
|
|
136
|
-
<span className="icon-[mdi--dots-horizontal] h-4 w-4" />
|
|
137
|
-
</button>
|
|
138
|
-
</PopoverTrigger>
|
|
139
|
-
<PopoverContent align="end" className="w-36 p-1">
|
|
140
|
-
{scene.needsUpdate && (
|
|
141
|
-
<button
|
|
142
|
-
type="button"
|
|
143
|
-
onClick={(e) => {
|
|
144
|
-
e.stopPropagation();
|
|
145
|
-
onInstall();
|
|
146
|
-
}}
|
|
147
|
-
disabled={isLoading}
|
|
148
|
-
className="flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] text-foreground transition-colors hover:bg-accent disabled:opacity-50"
|
|
149
|
-
>
|
|
150
|
-
<span className="icon-[mdi--update] h-4 w-4 text-primary" />
|
|
151
|
-
{labels.update}
|
|
152
|
-
</button>
|
|
153
|
-
)}
|
|
154
|
-
<button
|
|
155
|
-
type="button"
|
|
156
|
-
onClick={(e) => {
|
|
157
|
-
e.stopPropagation();
|
|
158
|
-
onUninstall();
|
|
159
|
-
}}
|
|
160
|
-
disabled={isLoading}
|
|
161
|
-
className="flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-50"
|
|
162
|
-
>
|
|
163
|
-
<span className="icon-[mdi--delete-outline] h-4 w-4" />
|
|
164
|
-
{labels.uninstall}
|
|
165
|
-
</button>
|
|
166
|
-
</PopoverContent>
|
|
167
|
-
</Popover>
|
|
168
|
-
<SkillToggleSwitch checked={scene.enabled} onChange={onToggle} disabled={isLoading} />
|
|
169
|
-
</>
|
|
170
|
-
) : (
|
|
171
|
-
<Button
|
|
172
|
-
type="button"
|
|
173
|
-
variant="primary"
|
|
174
|
-
size="sm"
|
|
175
|
-
onClick={(e) => {
|
|
176
|
-
e.stopPropagation();
|
|
177
|
-
onInstall();
|
|
178
|
-
}}
|
|
179
|
-
disabled={isLoading}
|
|
180
|
-
>
|
|
181
|
-
{isLoading ? (
|
|
182
|
-
<span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
|
|
183
|
-
) : (
|
|
184
|
-
<span className="icon-[mdi--play] h-3.5 w-3.5" />
|
|
185
|
-
)}
|
|
186
|
-
<span>{labels.use}</span>
|
|
187
|
-
</Button>
|
|
188
|
-
)}
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</motion.div>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
import { motion } from "motion/react";
|
|
3
|
-
import { Button, Popover, PopoverContent, PopoverTrigger } from "@vetta-org/ui";
|
|
4
|
-
import { SkillTypeIcon } from "./skill-icon";
|
|
5
|
-
import { SkillToggleSwitch } from "./SkillToggleSwitch";
|
|
6
|
-
|
|
7
|
-
export interface SkillCardSkillView {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly alias?: string | null;
|
|
10
|
-
readonly type: "skill" | "scene";
|
|
11
|
-
readonly description?: string | null;
|
|
12
|
-
/** 空=默认;solar:xxx-bold;或已解析的图片 URL */
|
|
13
|
-
readonly icon?: string | null;
|
|
14
|
-
readonly installed: boolean;
|
|
15
|
-
readonly enabled: boolean;
|
|
16
|
-
readonly isCustom?: boolean;
|
|
17
|
-
readonly isAgent?: boolean;
|
|
18
|
-
readonly isReadonly?: boolean;
|
|
19
|
-
readonly needsUpdate?: boolean;
|
|
20
|
-
readonly localVersion?: string | null;
|
|
21
|
-
readonly downloadCount: number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface SkillCardViewLabels {
|
|
25
|
-
readonly custom: string;
|
|
26
|
-
readonly general: string;
|
|
27
|
-
readonly updatable: string;
|
|
28
|
-
readonly noDescription: string;
|
|
29
|
-
readonly readonly: string;
|
|
30
|
-
readonly update: string;
|
|
31
|
-
readonly uninstall: string;
|
|
32
|
-
readonly install: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface SkillCardViewProps {
|
|
36
|
-
readonly skill: SkillCardSkillView;
|
|
37
|
-
readonly labels: SkillCardViewLabels;
|
|
38
|
-
readonly isLoading: boolean;
|
|
39
|
-
readonly previewable: boolean;
|
|
40
|
-
readonly onInstall: () => void;
|
|
41
|
-
readonly onToggle: () => void;
|
|
42
|
-
readonly onUninstall: () => void;
|
|
43
|
-
readonly onPreview?: () => void;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function SkillCardView({
|
|
47
|
-
skill,
|
|
48
|
-
labels,
|
|
49
|
-
isLoading,
|
|
50
|
-
previewable,
|
|
51
|
-
onInstall,
|
|
52
|
-
onToggle,
|
|
53
|
-
onUninstall,
|
|
54
|
-
onPreview,
|
|
55
|
-
}: SkillCardViewProps): JSX.Element {
|
|
56
|
-
return (
|
|
57
|
-
<motion.div
|
|
58
|
-
variants={{
|
|
59
|
-
hidden: { opacity: 0, y: 8 },
|
|
60
|
-
show: { opacity: 1, y: 0 },
|
|
61
|
-
}}
|
|
62
|
-
transition={{ type: "spring", stiffness: 320, damping: 26 }}
|
|
63
|
-
onClick={previewable ? onPreview : undefined}
|
|
64
|
-
className={`group relative flex items-center gap-3 rounded-xl bg-card px-3 py-2.5 transition-colors duration-200 hover:bg-accent ${
|
|
65
|
-
previewable ? "cursor-pointer" : ""
|
|
66
|
-
}`}
|
|
67
|
-
>
|
|
68
|
-
<div
|
|
69
|
-
className={`flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg transition-colors ${
|
|
70
|
-
skill.installed ? "bg-primary/10 text-primary" : "bg-accent/50 text-muted-foreground/70"
|
|
71
|
-
}`}
|
|
72
|
-
>
|
|
73
|
-
<SkillTypeIcon type={skill.type} icon={skill.icon} className="h-4 w-4" />
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div className="min-w-0 flex-1">
|
|
77
|
-
<div className="flex items-center gap-2">
|
|
78
|
-
<span className="truncate text-[13px] font-semibold text-foreground">
|
|
79
|
-
{skill.alias || skill.name}
|
|
80
|
-
</span>
|
|
81
|
-
{skill.installed && skill.localVersion && (
|
|
82
|
-
<span className="inline-flex h-4 shrink-0 items-center rounded-full bg-accent/50 px-1.5 text-[10px] font-medium tabular-nums text-muted-foreground/70">
|
|
83
|
-
v{skill.localVersion}
|
|
84
|
-
</span>
|
|
85
|
-
)}
|
|
86
|
-
{!skill.isCustom && skill.downloadCount > 0 && (
|
|
87
|
-
<span className="inline-flex h-4 shrink-0 items-center gap-0.5 rounded-full bg-accent/50 px-1.5 text-[10px] font-medium tabular-nums text-muted-foreground/70">
|
|
88
|
-
<span className="icon-[mdi--download] h-2.5 w-2.5" />
|
|
89
|
-
{skill.downloadCount}
|
|
90
|
-
</span>
|
|
91
|
-
)}
|
|
92
|
-
{skill.isCustom && (
|
|
93
|
-
<span className="inline-flex h-4 shrink-0 items-center rounded-full bg-primary/10 px-1.5 text-[10px] font-medium text-primary">
|
|
94
|
-
{labels.custom}
|
|
95
|
-
</span>
|
|
96
|
-
)}
|
|
97
|
-
{skill.isAgent && (
|
|
98
|
-
<span className="inline-flex h-4 shrink-0 items-center gap-0.5 rounded-full bg-accent/60 px-1.5 text-[10px] font-medium text-muted-foreground/80">
|
|
99
|
-
<span className="icon-[mdi--earth] h-2.5 w-2.5" />
|
|
100
|
-
{labels.general}
|
|
101
|
-
</span>
|
|
102
|
-
)}
|
|
103
|
-
{skill.needsUpdate && (
|
|
104
|
-
<span className="inline-flex h-4 shrink-0 items-center gap-0.5 rounded-full bg-amber-500/15 px-1.5 text-[10px] font-medium text-amber-400">
|
|
105
|
-
<span className="icon-[mdi--arrow-up-bold] h-2.5 w-2.5" />
|
|
106
|
-
{labels.updatable}
|
|
107
|
-
</span>
|
|
108
|
-
)}
|
|
109
|
-
</div>
|
|
110
|
-
<p className="mt-0.5 line-clamp-1 text-[12px] leading-[1.5] text-muted-foreground/60">
|
|
111
|
-
{skill.description || labels.noDescription}
|
|
112
|
-
</p>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
<div className="flex shrink-0 items-center gap-1.5">
|
|
116
|
-
{skill.isAgent ? (
|
|
117
|
-
<span className="flex h-7 items-center gap-1 px-1.5 text-[11px] text-muted-foreground/50">
|
|
118
|
-
<span className="icon-[mdi--lock-outline] h-3.5 w-3.5" />
|
|
119
|
-
{labels.readonly}
|
|
120
|
-
</span>
|
|
121
|
-
) : skill.installed ? (
|
|
122
|
-
<>
|
|
123
|
-
<Popover>
|
|
124
|
-
<PopoverTrigger asChild>
|
|
125
|
-
<button
|
|
126
|
-
type="button"
|
|
127
|
-
onClick={(e) => e.stopPropagation()}
|
|
128
|
-
className="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/60 opacity-60 transition-all group-hover:opacity-100 hover:bg-primary/10 hover:text-primary"
|
|
129
|
-
>
|
|
130
|
-
<span className="icon-[mdi--dots-horizontal] h-4 w-4" />
|
|
131
|
-
</button>
|
|
132
|
-
</PopoverTrigger>
|
|
133
|
-
<PopoverContent align="end" className="w-36 p-1">
|
|
134
|
-
{skill.needsUpdate && (
|
|
135
|
-
<button
|
|
136
|
-
type="button"
|
|
137
|
-
onClick={(e) => {
|
|
138
|
-
e.stopPropagation();
|
|
139
|
-
onInstall();
|
|
140
|
-
}}
|
|
141
|
-
disabled={isLoading}
|
|
142
|
-
className="flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] text-foreground transition-colors hover:bg-accent disabled:opacity-50"
|
|
143
|
-
>
|
|
144
|
-
<span className="icon-[mdi--update] h-4 w-4 text-primary" />
|
|
145
|
-
{labels.update}
|
|
146
|
-
</button>
|
|
147
|
-
)}
|
|
148
|
-
<button
|
|
149
|
-
type="button"
|
|
150
|
-
onClick={(e) => {
|
|
151
|
-
e.stopPropagation();
|
|
152
|
-
onUninstall();
|
|
153
|
-
}}
|
|
154
|
-
disabled={isLoading}
|
|
155
|
-
className="flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-50"
|
|
156
|
-
>
|
|
157
|
-
<span className="icon-[mdi--delete-outline] h-4 w-4" />
|
|
158
|
-
{labels.uninstall}
|
|
159
|
-
</button>
|
|
160
|
-
</PopoverContent>
|
|
161
|
-
</Popover>
|
|
162
|
-
<SkillToggleSwitch checked={skill.enabled} onChange={onToggle} disabled={isLoading} />
|
|
163
|
-
</>
|
|
164
|
-
) : (
|
|
165
|
-
<Button
|
|
166
|
-
type="button"
|
|
167
|
-
variant="primary"
|
|
168
|
-
size="sm"
|
|
169
|
-
onClick={(e) => {
|
|
170
|
-
e.stopPropagation();
|
|
171
|
-
onInstall();
|
|
172
|
-
}}
|
|
173
|
-
disabled={isLoading}
|
|
174
|
-
>
|
|
175
|
-
{isLoading ? (
|
|
176
|
-
<span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
|
|
177
|
-
) : (
|
|
178
|
-
<span className="icon-[mdi--plus] h-3.5 w-3.5" />
|
|
179
|
-
)}
|
|
180
|
-
<span>{labels.install}</span>
|
|
181
|
-
</Button>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
</motion.div>
|
|
185
|
-
);
|
|
186
|
-
}
|