@vetta-org/theme-ui 0.1.0 → 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 +735 -7
- 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,5 +1,5 @@
|
|
|
1
1
|
import type { JSX, ReactNode } from "react";
|
|
2
|
-
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
3
3
|
import { isMac } from "../utils/platform";
|
|
4
4
|
|
|
5
5
|
export interface SidebarTopBarClassNames {
|
|
@@ -45,10 +45,12 @@ export function SidebarTopBar({
|
|
|
45
45
|
<div
|
|
46
46
|
className={cn(
|
|
47
47
|
"flex h-11 min-w-0 shrink-0 items-center justify-between gap-1",
|
|
48
|
+
// macOS:内容整体上提 2px,与红绿灯的视觉中线对齐(同 PageHeaderFrame)。
|
|
49
|
+
isMac && "relative top-[-2px]",
|
|
48
50
|
!floating && "drag-region",
|
|
49
51
|
className,
|
|
50
52
|
)}
|
|
51
|
-
style={{ paddingLeft: isMac ?
|
|
53
|
+
style={{ paddingLeft: isMac ? "calc(78px / var(--ui-zoom, 1))" : 16, paddingRight: 6 }}
|
|
52
54
|
>
|
|
53
55
|
{/* brand 只占内容宽;Mac 常为空,避免 flex-1 吃掉 actions 的测量空间 */}
|
|
54
56
|
{isMac ? (
|
|
@@ -65,7 +67,10 @@ export function SidebarTopBar({
|
|
|
65
67
|
{/*
|
|
66
68
|
* flex-1:actions 始终吃掉剩余宽度,宿主放进来的自适应按钮才能随侧栏拉宽恢复完整文案。
|
|
67
69
|
*/}
|
|
68
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
className={cn("flex min-w-0 flex-1 items-center justify-end gap-1", classNames?.actions)}
|
|
72
|
+
data-titlebar-anchor=""
|
|
73
|
+
>
|
|
69
74
|
{actions}
|
|
70
75
|
{imOnline && (
|
|
71
76
|
<button
|
|
@@ -77,10 +82,8 @@ export function SidebarTopBar({
|
|
|
77
82
|
classNames?.clawButton,
|
|
78
83
|
)}
|
|
79
84
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<span className="relative inline-flex h-1 w-1 rounded-full bg-secondary-foreground" />
|
|
83
|
-
</span>
|
|
85
|
+
{/* 在线是常驻状态:用静态圆点,不要 animate-ping(无限动画会让空闲窗口持续重绘)。 */}
|
|
86
|
+
<span className="inline-flex h-1 w-1 shrink-0 rounded-full bg-secondary-foreground" />
|
|
84
87
|
Claw
|
|
85
88
|
</button>
|
|
86
89
|
)}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 「有会话在等你」的角标:琥珀色小圆点里一个问号,轻微呼吸。
|
|
5
|
+
*
|
|
6
|
+
* 比 `RunningPulseDot` 大一号、且用琥珀色:运行中只是忙,可以等;停下来等回答才是要人动手的,
|
|
7
|
+
* 余光里必须能一眼区分。呼吸用 opacity 而不是向外扩散的 ping——等待可能持续几分钟,
|
|
8
|
+
* 常驻的无限扩散动画会让空闲窗口持续重绘。
|
|
9
|
+
*/
|
|
10
|
+
export function WaitingPulseBadge(): JSX.Element {
|
|
11
|
+
return (
|
|
12
|
+
<span
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
className="pointer-events-none absolute -top-1 -right-1 flex h-3 w-3 items-center justify-center rounded-full bg-amber-500 text-[8px] font-bold leading-none text-white motion-safe:animate-pulse"
|
|
15
|
+
>
|
|
16
|
+
?
|
|
17
|
+
</span>
|
|
18
|
+
);
|
|
19
|
+
}
|
package/src/sidebar/index.ts
CHANGED
|
@@ -20,13 +20,6 @@ export type {
|
|
|
20
20
|
SidebarProps,
|
|
21
21
|
SidebarRegionProps,
|
|
22
22
|
} from "@vetta-org/theme-sdk/sidebar";
|
|
23
|
-
export type { AddProjectMenuItemProps } from "./AddProjectMenuItem";
|
|
24
|
-
export { AddProjectMenuItem } from "./AddProjectMenuItem";
|
|
25
|
-
export type {
|
|
26
|
-
AddProjectMenuPopoverItem,
|
|
27
|
-
AddProjectMenuPopoverViewProps,
|
|
28
|
-
} from "./AddProjectMenuPopoverView";
|
|
29
|
-
export { AddProjectMenuPopoverView } from "./AddProjectMenuPopoverView";
|
|
30
23
|
export type { AddProjectMenuTriggerViewProps } from "./AddProjectMenuTriggerView";
|
|
31
24
|
export { AddProjectMenuTriggerView } from "./AddProjectMenuTriggerView";
|
|
32
25
|
export type {
|
|
@@ -59,23 +52,14 @@ export type { MessageCenterToolbarButtonProps } from "./MessageCenterToolbarButt
|
|
|
59
52
|
export { MessageCenterToolbarButton } from "./MessageCenterToolbarButton";
|
|
60
53
|
export type { MessageCenterTriggerViewProps } from "./MessageCenterTriggerView";
|
|
61
54
|
export { MessageCenterTriggerView } from "./MessageCenterTriggerView";
|
|
62
|
-
export type {
|
|
63
|
-
NotificationMessageListItemView,
|
|
64
|
-
NotificationMessageListViewProps,
|
|
65
|
-
} from "./NotificationMessageListView";
|
|
66
|
-
export { NotificationMessageListView } from "./NotificationMessageListView";
|
|
67
55
|
export type { ProjectsPanelEmptyStateLabels, ProjectsPanelEmptyStateProps } from "./ProjectsPanelEmptyState";
|
|
68
56
|
export { ProjectsPanelEmptyState } from "./ProjectsPanelEmptyState";
|
|
69
57
|
export { RunningPulseDot } from "./RunningPulseDot";
|
|
70
58
|
export type { SessionStatusIconProps } from "./SessionStatusIcon";
|
|
71
59
|
export { SessionStatusIcon } from "./SessionStatusIcon";
|
|
72
|
-
export type { SettingsMenuAccountSectionProps } from "./SettingsMenuAccountSection";
|
|
73
|
-
export { SettingsMenuAccountSection } from "./SettingsMenuAccountSection";
|
|
74
60
|
export type { SettingsMenuActionButtonProps } from "./SettingsMenuActionButton";
|
|
75
61
|
export { SettingsMenuActionButton } from "./SettingsMenuActionButton";
|
|
76
62
|
export { SettingsMenuDivider } from "./SettingsMenuDivider";
|
|
77
|
-
export type { SettingsMenuQuotaSectionProps } from "./SettingsMenuQuotaSection";
|
|
78
|
-
export { SettingsMenuQuotaSection } from "./SettingsMenuQuotaSection";
|
|
79
63
|
export type { SettingsMenuSettingsItemProps } from "./SettingsMenuSettingsItem";
|
|
80
64
|
export { SettingsMenuSettingsItem } from "./SettingsMenuSettingsItem";
|
|
81
65
|
export type { SettingsMenuThemeOption, SettingsMenuThemeSectionProps } from "./SettingsMenuThemeSection";
|
|
@@ -116,3 +100,4 @@ export type {
|
|
|
116
100
|
SidebarNavRegion,
|
|
117
101
|
} from "./useSidebarNavDrag";
|
|
118
102
|
export { SIDEBAR_NAV_DRAG_MIME, useSidebarNavDrag } from "./useSidebarNavDrag";
|
|
103
|
+
export { WaitingPulseBadge } from "./WaitingPulseBadge";
|
package/src/skills/index.ts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
export type { PluginCardViewModel, PluginCardViewProps } from "./PluginCardView";
|
|
2
2
|
export { PluginCardView } from "./PluginCardView";
|
|
3
|
-
export type { SceneCardViewLabels, SceneCardViewProps } from "./SceneCardView";
|
|
4
|
-
export { SceneCardView } from "./SceneCardView";
|
|
5
|
-
export type {
|
|
6
|
-
SkillCardSkillView,
|
|
7
|
-
SkillCardViewLabels,
|
|
8
|
-
SkillCardViewProps,
|
|
9
|
-
} from "./SkillCardView";
|
|
10
|
-
export { SkillCardView } from "./SkillCardView";
|
|
11
|
-
export type {
|
|
12
|
-
SkillDetailDialogSkillView,
|
|
13
|
-
SkillDetailDialogViewLabels,
|
|
14
|
-
SkillDetailDialogViewProps,
|
|
15
|
-
SkillDetailTypeView,
|
|
16
|
-
} from "./SkillDetailDialogView";
|
|
17
|
-
export { SkillDetailDialogView } from "./SkillDetailDialogView";
|
|
18
|
-
export type { SkillTagGroupViewProps } from "./SkillTagGroupView";
|
|
19
|
-
export { SkillTagGroupView } from "./SkillTagGroupView";
|
|
20
|
-
export type { SkillToggleSwitchProps } from "./SkillToggleSwitch";
|
|
21
|
-
export { SkillToggleSwitch } from "./SkillToggleSwitch";
|
|
22
3
|
export type { SkillTypeIconProps } from "./skill-icon";
|
|
23
4
|
export {
|
|
24
5
|
isImageSkillIcon,
|
|
@@ -65,8 +65,7 @@ export function isImageSkillIcon(icon: string | null | undefined): boolean {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface SkillTypeIconProps {
|
|
68
|
-
|
|
69
|
-
/** 空 / 未识别 → 按 type 显示默认图标 */
|
|
68
|
+
/** 空 / 未识别 → 显示默认图标 */
|
|
70
69
|
readonly icon?: string | null;
|
|
71
70
|
readonly className?: string;
|
|
72
71
|
}
|
|
@@ -104,11 +103,11 @@ export function SkillDefaultIcon({ className = "h-4 w-4" }: { className?: string
|
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
/**
|
|
107
|
-
* 技能卡片图标:自定义图 → Solar 实心 →
|
|
106
|
+
* 技能卡片图标:自定义图 → Solar 实心 → 默认图标。
|
|
108
107
|
* 图片铺满父容器(h-full w-full);字体/Solar/默认 SVG 使用 className 尺寸。
|
|
109
|
-
*
|
|
108
|
+
* 默认:3D 方块(浅色 `#1C274C` / 深色白)。
|
|
110
109
|
*/
|
|
111
|
-
export function SkillTypeIcon({
|
|
110
|
+
export function SkillTypeIcon({ icon, className = "h-4 w-4" }: SkillTypeIconProps): JSX.Element {
|
|
112
111
|
const trimmed = icon?.trim() ?? "";
|
|
113
112
|
if (trimmed && isImageSkillIcon(trimmed)) {
|
|
114
113
|
return <img src={trimmed} alt="" className="h-full w-full object-contain" />;
|
|
@@ -119,8 +118,5 @@ export function SkillTypeIcon({ type, icon, className = "h-4 w-4" }: SkillTypeIc
|
|
|
119
118
|
return <span className={`${className} ${cls}`} />;
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
|
-
if (type === "scene") {
|
|
123
|
-
return <span className={`${className} icon-[mdi--movie-open-outline]`} />;
|
|
124
|
-
}
|
|
125
121
|
return <SkillDefaultIcon className={className} />;
|
|
126
122
|
}
|
package/src/styles.css
CHANGED
|
@@ -25,20 +25,38 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
@keyframes
|
|
28
|
+
@keyframes session-title-marquee {
|
|
29
29
|
0%,
|
|
30
|
+
15% {
|
|
31
|
+
transform: translateX(0);
|
|
32
|
+
}
|
|
33
|
+
85%,
|
|
30
34
|
100% {
|
|
31
|
-
|
|
35
|
+
transform: translateX(var(--session-title-marquee-distance));
|
|
32
36
|
}
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.session-title-marquee-track {
|
|
40
|
+
animation: session-title-marquee var(--session-title-marquee-duration) linear infinite alternate;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media (prefers-reduced-motion: reduce) {
|
|
44
|
+
.session-title-marquee-track {
|
|
45
|
+
animation: none;
|
|
46
|
+
transform: none;
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
49
|
|
|
50
|
+
/* ─── 「进行中」指示器 ───
|
|
51
|
+
.processing-shimmer / .vetta-live-dot / .tool-call-shimmer-text / .send-button-ripple-* /
|
|
52
|
+
.todo-label-sheen / .todo-marker-spin / .activity-dot-* 这些类在 CSS 里只写静止态,
|
|
53
|
+
不写 infinite 关键帧:macOS 主窗口带毛玻璃,页面每出一帧系统都要整窗重合成,各自 60fps 的
|
|
54
|
+
呼吸/波纹叠在一起足以把 GPU 顶到几成。呼吸由宿主(apps/desktop shared/lib/live-animations.ts)
|
|
55
|
+
用 Web Animations API 挂上 steps(16) 的合成器动画,并把所有指示器的 startTime 锁到同一相位,
|
|
56
|
+
整页每秒最多多出 10 帧(实测 4 个指示器合计约 20 帧/秒,主线程每步一次极轻的样式同步)。
|
|
57
|
+
没有宿主动画时它们就是静止的正常外观。 */
|
|
38
58
|
.processing-shimmer {
|
|
39
59
|
color: var(--foreground);
|
|
40
|
-
animation: processing-shimmer 1.6s ease-in-out infinite;
|
|
41
|
-
will-change: opacity;
|
|
42
60
|
}
|
|
43
61
|
|
|
44
62
|
textarea::placeholder {
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState, type JSX } from "react";
|
|
2
|
-
import { motion } from "motion/react";
|
|
3
|
-
import { useThemeComponent } from "@vetta-org/theme-sdk";
|
|
4
|
-
import { cn } from "@vetta-org/ui";
|
|
5
|
-
import type { NewSessionSceneCarouselProps } from "./NewSession";
|
|
6
|
-
import { SceneCard } from "./SceneCard";
|
|
7
|
-
|
|
8
|
-
const easeOut = [0.16, 1, 0.3, 1] as const;
|
|
9
|
-
|
|
10
|
-
/** 场景卡常见高度(标题 + 两行描述 + meta)占位,与 DefaultNewSessionHero 预留槽对齐。 */
|
|
11
|
-
export const NEW_SESSION_SCENE_SLOT_MIN_H_CLASS = "min-h-[5.75rem]";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Props-driven scene carousel (3 cards per view). Host resolves i18n labels.
|
|
15
|
-
* Width follows outer left-aligned column (max-w-2xl); horizontal scroll + hover arrows.
|
|
16
|
-
*/
|
|
17
|
-
export function DefaultSceneCarousel({
|
|
18
|
-
actions,
|
|
19
|
-
className,
|
|
20
|
-
labels,
|
|
21
|
-
onSceneClick,
|
|
22
|
-
scenes,
|
|
23
|
-
selected,
|
|
24
|
-
...props
|
|
25
|
-
}: NewSessionSceneCarouselProps): JSX.Element {
|
|
26
|
-
const ThemedSceneCard = useThemeComponent("chat.newSessionSceneCard", SceneCard);
|
|
27
|
-
const scrollRef = useRef<HTMLDivElement>(null);
|
|
28
|
-
const [canPrev, setCanPrev] = useState(false);
|
|
29
|
-
const [canNext, setCanNext] = useState(false);
|
|
30
|
-
|
|
31
|
-
const updateEdges = useCallback(() => {
|
|
32
|
-
const el = scrollRef.current;
|
|
33
|
-
if (!el) return;
|
|
34
|
-
setCanPrev(el.scrollLeft > 1);
|
|
35
|
-
setCanNext(el.scrollLeft < el.scrollWidth - el.clientWidth - 1);
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
updateEdges();
|
|
40
|
-
const el = scrollRef.current;
|
|
41
|
-
if (!el) return;
|
|
42
|
-
const ro = new ResizeObserver(updateEdges);
|
|
43
|
-
ro.observe(el);
|
|
44
|
-
return () => ro.disconnect();
|
|
45
|
-
}, [updateEdges, scenes.length]);
|
|
46
|
-
|
|
47
|
-
const scrollByView = useCallback((dir: -1 | 1) => {
|
|
48
|
-
const el = scrollRef.current;
|
|
49
|
-
if (!el) return;
|
|
50
|
-
el.scrollBy({ left: dir * el.clientWidth, behavior: "smooth" });
|
|
51
|
-
}, []);
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className={cn("group relative mt-6 w-full", className)} {...props}>
|
|
55
|
-
<motion.div
|
|
56
|
-
initial={{ opacity: 0, y: 8 }}
|
|
57
|
-
animate={{ opacity: 1, y: 0 }}
|
|
58
|
-
transition={{ duration: 0.5, delay: 0.25, ease: easeOut }}
|
|
59
|
-
>
|
|
60
|
-
<div
|
|
61
|
-
ref={scrollRef}
|
|
62
|
-
onScroll={updateEdges}
|
|
63
|
-
className={`no-scrollbar flex snap-x snap-mandatory gap-2 overflow-x-auto py-1 ${NEW_SESSION_SCENE_SLOT_MIN_H_CLASS}`}
|
|
64
|
-
>
|
|
65
|
-
{scenes.map((s) => {
|
|
66
|
-
const action = actions[s.name] ?? "idle";
|
|
67
|
-
return (
|
|
68
|
-
<ThemedSceneCard
|
|
69
|
-
key={s.name}
|
|
70
|
-
action={action}
|
|
71
|
-
item={s}
|
|
72
|
-
selected={selected?.name === s.name && selected?.type === "scene"}
|
|
73
|
-
onClick={() => onSceneClick(s)}
|
|
74
|
-
title={s.state === "uninstalled" ? labels.installPrompt : s.description || s.name}
|
|
75
|
-
/>
|
|
76
|
-
);
|
|
77
|
-
})}
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
{canPrev && (
|
|
81
|
-
<>
|
|
82
|
-
<div className="pointer-events-none absolute inset-y-0 left-0 w-10 bg-gradient-to-r from-background to-transparent" />
|
|
83
|
-
<motion.button
|
|
84
|
-
type="button"
|
|
85
|
-
onClick={() => scrollByView(-1)}
|
|
86
|
-
whileHover={{ scale: 1.08 }}
|
|
87
|
-
whileTap={{ scale: 0.92 }}
|
|
88
|
-
className="absolute -left-3 top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full border border-border/60 bg-card text-muted-foreground opacity-0 shadow-md transition-opacity group-hover:opacity-100 hover:border-primary/40 hover:text-primary"
|
|
89
|
-
title={labels.previous}
|
|
90
|
-
>
|
|
91
|
-
<span className="icon-[mdi--chevron-left] h-4 w-4" />
|
|
92
|
-
</motion.button>
|
|
93
|
-
</>
|
|
94
|
-
)}
|
|
95
|
-
{canNext && (
|
|
96
|
-
<>
|
|
97
|
-
<div className="pointer-events-none absolute inset-y-0 right-0 w-10 bg-gradient-to-l from-background to-transparent" />
|
|
98
|
-
<motion.button
|
|
99
|
-
type="button"
|
|
100
|
-
onClick={() => scrollByView(1)}
|
|
101
|
-
whileHover={{ scale: 1.08 }}
|
|
102
|
-
whileTap={{ scale: 0.92 }}
|
|
103
|
-
className="absolute -right-3 top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full border border-border/60 bg-card text-muted-foreground opacity-0 shadow-md transition-opacity group-hover:opacity-100 hover:border-primary/40 hover:text-primary"
|
|
104
|
-
title={labels.next}
|
|
105
|
-
>
|
|
106
|
-
<span className="icon-[mdi--chevron-right] h-4 w-4" />
|
|
107
|
-
</motion.button>
|
|
108
|
-
</>
|
|
109
|
-
)}
|
|
110
|
-
</motion.div>
|
|
111
|
-
</div>
|
|
112
|
-
);
|
|
113
|
-
}
|
package/src/chat/SceneCard.tsx
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { forwardRef, type ComponentPropsWithoutRef, type JSX } from "react";
|
|
2
|
-
import { motion } from "motion/react";
|
|
3
|
-
import { useThemeSurface } from "@vetta-org/theme-sdk/appearance";
|
|
4
|
-
import { cn } from "@vetta-org/ui";
|
|
5
|
-
import { ThemeSurface } from "../appearance/ThemeSurface";
|
|
6
|
-
import type { NewSessionSceneActionState, NewSessionSceneItem } from "./NewSession";
|
|
7
|
-
|
|
8
|
-
const SPRING = { type: "spring" as const, stiffness: 460, damping: 32 };
|
|
9
|
-
|
|
10
|
-
export type SceneCardState = NewSessionSceneItem["state"];
|
|
11
|
-
export type SceneCardActionState = NewSessionSceneActionState;
|
|
12
|
-
export type SceneCardModel = NewSessionSceneItem;
|
|
13
|
-
|
|
14
|
-
export interface SceneCardClassNames {
|
|
15
|
-
content?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
meta?: string;
|
|
18
|
-
status?: string;
|
|
19
|
-
title?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface SceneCardProps extends Omit<ComponentPropsWithoutRef<typeof motion.button>, "children"> {
|
|
23
|
-
action: SceneCardActionState;
|
|
24
|
-
classNames?: SceneCardClassNames;
|
|
25
|
-
item: SceneCardModel;
|
|
26
|
-
selected: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const SceneCard = forwardRef<HTMLButtonElement, SceneCardProps>(function SceneCard(
|
|
30
|
-
{ action, className, classNames, item, selected, ...props },
|
|
31
|
-
ref,
|
|
32
|
-
): JSX.Element {
|
|
33
|
-
const surface = useThemeSurface("chat.newSessionSceneCard");
|
|
34
|
-
const muted = item.state !== "active";
|
|
35
|
-
const selectedActive = item.state === "active" && selected;
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<motion.button
|
|
39
|
-
ref={ref}
|
|
40
|
-
type="button"
|
|
41
|
-
disabled={action === "loading"}
|
|
42
|
-
whileHover={{ y: -2 }}
|
|
43
|
-
whileTap={{ scale: 0.98 }}
|
|
44
|
-
transition={SPRING}
|
|
45
|
-
className={cn(
|
|
46
|
-
"relative min-w-0 w-[calc((100%-1rem)/3)] shrink-0 snap-start overflow-visible rounded-xl border text-left transition-colors disabled:cursor-wait",
|
|
47
|
-
selectedActive
|
|
48
|
-
? "border-primary/60 bg-card shadow-[0_10px_24px_-18px_var(--primary)]"
|
|
49
|
-
: muted
|
|
50
|
-
? "border-dashed border-border/50 bg-card/60 hover:border-primary/40"
|
|
51
|
-
: "border-border/60 bg-card hover:border-primary/40",
|
|
52
|
-
surface?.rootClassName,
|
|
53
|
-
className,
|
|
54
|
-
)}
|
|
55
|
-
data-theme-surface-root="chat.newSessionSceneCard"
|
|
56
|
-
{...props}
|
|
57
|
-
>
|
|
58
|
-
<ThemeSurface slot="chat.newSessionSceneCard" />
|
|
59
|
-
<span
|
|
60
|
-
className={cn(
|
|
61
|
-
"relative z-10 flex w-full min-w-0 items-start gap-2.5 overflow-hidden rounded-[inherit] p-3",
|
|
62
|
-
classNames?.content,
|
|
63
|
-
)}
|
|
64
|
-
>
|
|
65
|
-
<span className="block min-w-0 flex-1 overflow-hidden">
|
|
66
|
-
<span
|
|
67
|
-
className={cn(
|
|
68
|
-
"block truncate text-[13px] font-semibold",
|
|
69
|
-
muted ? "text-muted-foreground" : "text-foreground",
|
|
70
|
-
classNames?.title,
|
|
71
|
-
)}
|
|
72
|
-
>
|
|
73
|
-
{item.alias || item.name}
|
|
74
|
-
</span>
|
|
75
|
-
{item.description && (
|
|
76
|
-
<span
|
|
77
|
-
className={cn(
|
|
78
|
-
"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted-foreground/70",
|
|
79
|
-
classNames?.description,
|
|
80
|
-
)}
|
|
81
|
-
>
|
|
82
|
-
{item.description}
|
|
83
|
-
</span>
|
|
84
|
-
)}
|
|
85
|
-
{(item.version || (item.downloadCount ?? 0) > 0) && (
|
|
86
|
-
<span
|
|
87
|
-
className={cn(
|
|
88
|
-
"mt-1.5 flex items-center gap-1.5 text-[10px] tabular-nums text-muted-foreground/60",
|
|
89
|
-
classNames?.meta,
|
|
90
|
-
)}
|
|
91
|
-
>
|
|
92
|
-
{item.version && (
|
|
93
|
-
<span className="inline-flex h-4 items-center rounded-full bg-accent/50 px-1.5 font-medium">
|
|
94
|
-
v{item.version}
|
|
95
|
-
</span>
|
|
96
|
-
)}
|
|
97
|
-
{(item.downloadCount ?? 0) > 0 && (
|
|
98
|
-
<span className="inline-flex h-4 items-center gap-0.5 rounded-full bg-accent/50 px-1.5 font-medium">
|
|
99
|
-
<span className="icon-[mdi--download] h-2.5 w-2.5" />
|
|
100
|
-
{item.downloadCount}
|
|
101
|
-
</span>
|
|
102
|
-
)}
|
|
103
|
-
</span>
|
|
104
|
-
)}
|
|
105
|
-
</span>
|
|
106
|
-
{action === "loading" ? (
|
|
107
|
-
<span
|
|
108
|
-
className={cn(
|
|
109
|
-
"icon-[mdi--loading] h-3.5 w-3.5 shrink-0 animate-spin text-primary",
|
|
110
|
-
classNames?.status,
|
|
111
|
-
)}
|
|
112
|
-
/>
|
|
113
|
-
) : action === "error" ? (
|
|
114
|
-
<span
|
|
115
|
-
className={cn(
|
|
116
|
-
"icon-[mdi--alert-circle] h-3.5 w-3.5 shrink-0 text-destructive",
|
|
117
|
-
classNames?.status,
|
|
118
|
-
)}
|
|
119
|
-
/>
|
|
120
|
-
) : muted ? (
|
|
121
|
-
<span
|
|
122
|
-
className={cn(
|
|
123
|
-
"icon-[mdi--download] h-3.5 w-3.5 shrink-0 text-muted-foreground/60",
|
|
124
|
-
classNames?.status,
|
|
125
|
-
)}
|
|
126
|
-
/>
|
|
127
|
-
) : selectedActive ? (
|
|
128
|
-
<span
|
|
129
|
-
className={cn(
|
|
130
|
-
"icon-[mdi--check-circle] h-3.5 w-3.5 shrink-0 text-primary",
|
|
131
|
-
classNames?.status,
|
|
132
|
-
)}
|
|
133
|
-
/>
|
|
134
|
-
) : null}
|
|
135
|
-
</span>
|
|
136
|
-
</motion.button>
|
|
137
|
-
);
|
|
138
|
-
});
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
2
|
-
import type { JSX, ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
const easeOut = [0.22, 1, 0.36, 1] as const;
|
|
5
|
-
|
|
6
|
-
export interface HistoryDrawerTaskView {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly enabled: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface HistoryDrawerViewLabels {
|
|
13
|
-
readonly close: string;
|
|
14
|
-
readonly edit: string;
|
|
15
|
-
readonly enable: string;
|
|
16
|
-
readonly pause: string;
|
|
17
|
-
readonly runNow: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface HistoryDrawerViewProps {
|
|
21
|
-
readonly history: ReactNode;
|
|
22
|
-
readonly labels: HistoryDrawerViewLabels;
|
|
23
|
-
readonly projectLabel: string | null;
|
|
24
|
-
readonly scheduleLabel: string;
|
|
25
|
-
readonly task: HistoryDrawerTaskView | null;
|
|
26
|
-
readonly onClose: () => void;
|
|
27
|
-
readonly onEdit: () => void;
|
|
28
|
-
readonly onRunNow: () => void;
|
|
29
|
-
readonly onToggleTask: () => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function HistoryDrawerView({
|
|
33
|
-
history,
|
|
34
|
-
labels,
|
|
35
|
-
projectLabel,
|
|
36
|
-
scheduleLabel,
|
|
37
|
-
task,
|
|
38
|
-
onClose,
|
|
39
|
-
onEdit,
|
|
40
|
-
onRunNow,
|
|
41
|
-
onToggleTask,
|
|
42
|
-
}: HistoryDrawerViewProps): JSX.Element {
|
|
43
|
-
return (
|
|
44
|
-
<AnimatePresence>
|
|
45
|
-
{task && (
|
|
46
|
-
<>
|
|
47
|
-
<motion.div
|
|
48
|
-
initial={{ opacity: 0 }}
|
|
49
|
-
animate={{ opacity: 1 }}
|
|
50
|
-
exit={{ opacity: 0 }}
|
|
51
|
-
transition={{ duration: 0.2 }}
|
|
52
|
-
onClick={onClose}
|
|
53
|
-
className="absolute inset-0 z-40 bg-background/40 backdrop-blur-[2px]"
|
|
54
|
-
/>
|
|
55
|
-
|
|
56
|
-
<motion.div
|
|
57
|
-
initial={{ x: "100%" }}
|
|
58
|
-
animate={{ x: 0 }}
|
|
59
|
-
exit={{ x: "100%" }}
|
|
60
|
-
transition={{ duration: 0.32, ease: easeOut }}
|
|
61
|
-
className="absolute inset-y-0 right-0 z-50 flex w-[420px] max-w-[88%] flex-col border-l border-border bg-background shadow-[-16px_0_40px_-20px_rgba(0,0,0,0.5)]"
|
|
62
|
-
>
|
|
63
|
-
<div className="shrink-0 border-b border-border/60 px-5 pb-4 pt-5">
|
|
64
|
-
<div className="flex items-start gap-2.5">
|
|
65
|
-
<span className="mt-1 flex h-2 w-2 shrink-0">
|
|
66
|
-
<span className="relative inline-flex h-2 w-2">
|
|
67
|
-
{task.enabled && (
|
|
68
|
-
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-60" />
|
|
69
|
-
)}
|
|
70
|
-
<span
|
|
71
|
-
className={`relative inline-flex h-2 w-2 rounded-full ${
|
|
72
|
-
task.enabled ? "bg-emerald-500" : "bg-muted-foreground/40"
|
|
73
|
-
}`}
|
|
74
|
-
/>
|
|
75
|
-
</span>
|
|
76
|
-
</span>
|
|
77
|
-
<div className="min-w-0 flex-1">
|
|
78
|
-
<h2 className="truncate text-[15px] font-semibold tracking-tight text-foreground">
|
|
79
|
-
{task.name}
|
|
80
|
-
</h2>
|
|
81
|
-
<p className="mt-0.5 truncate text-[11px] text-muted-foreground/50">
|
|
82
|
-
{scheduleLabel}
|
|
83
|
-
{projectLabel && ` · ${projectLabel}`}
|
|
84
|
-
</p>
|
|
85
|
-
</div>
|
|
86
|
-
<button
|
|
87
|
-
type="button"
|
|
88
|
-
onClick={onClose}
|
|
89
|
-
title={labels.close}
|
|
90
|
-
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg text-muted-foreground/60 transition-colors duration-150 hover:bg-accent hover:text-foreground"
|
|
91
|
-
>
|
|
92
|
-
<span className="icon-[mdi--close] text-[16px]" />
|
|
93
|
-
</button>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<div className="mt-3.5 flex items-center gap-2">
|
|
97
|
-
<DrawerAction
|
|
98
|
-
icon="icon-[mdi--play]"
|
|
99
|
-
label={labels.runNow}
|
|
100
|
-
primary
|
|
101
|
-
onClick={onRunNow}
|
|
102
|
-
/>
|
|
103
|
-
<DrawerAction
|
|
104
|
-
icon={task.enabled ? "icon-[mdi--pause]" : "icon-[mdi--play-outline]"}
|
|
105
|
-
label={task.enabled ? labels.pause : labels.enable}
|
|
106
|
-
onClick={onToggleTask}
|
|
107
|
-
/>
|
|
108
|
-
<DrawerAction
|
|
109
|
-
icon="icon-[mdi--pencil-outline]"
|
|
110
|
-
label={labels.edit}
|
|
111
|
-
onClick={onEdit}
|
|
112
|
-
/>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
{history}
|
|
117
|
-
</motion.div>
|
|
118
|
-
</>
|
|
119
|
-
)}
|
|
120
|
-
</AnimatePresence>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function DrawerAction({
|
|
125
|
-
icon,
|
|
126
|
-
label,
|
|
127
|
-
primary,
|
|
128
|
-
onClick,
|
|
129
|
-
}: {
|
|
130
|
-
readonly icon: string;
|
|
131
|
-
readonly label: string;
|
|
132
|
-
readonly primary?: boolean;
|
|
133
|
-
readonly onClick: () => void;
|
|
134
|
-
}): JSX.Element {
|
|
135
|
-
return (
|
|
136
|
-
<button
|
|
137
|
-
type="button"
|
|
138
|
-
onClick={onClick}
|
|
139
|
-
className={`flex h-8 items-center gap-1.5 rounded-lg px-3 text-[12px] font-medium transition-colors duration-150 ${
|
|
140
|
-
primary
|
|
141
|
-
? "bg-primary/90 text-primary-foreground hover:bg-primary"
|
|
142
|
-
: "border border-border/60 text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
143
|
-
}`}
|
|
144
|
-
>
|
|
145
|
-
<span className={`${icon} text-[14px]`} />
|
|
146
|
-
{label}
|
|
147
|
-
</button>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { JSX, ReactNode } from "react";
|
|
2
|
-
import { Button, Dialog, DialogContent } from "@vetta-org/ui";
|
|
3
|
-
|
|
4
|
-
export interface TaskFormDialogViewLabels {
|
|
5
|
-
readonly cancel: string;
|
|
6
|
-
readonly create: string;
|
|
7
|
-
readonly save: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface TaskFormDialogViewProps {
|
|
11
|
-
readonly canSubmit: boolean;
|
|
12
|
-
readonly isEdit: boolean;
|
|
13
|
-
readonly labels: TaskFormDialogViewLabels;
|
|
14
|
-
readonly open: boolean;
|
|
15
|
-
readonly onClose: () => void;
|
|
16
|
-
readonly onSubmit: () => void;
|
|
17
|
-
/** SchedulerTaskFields stays host-owned until that view migrates. */
|
|
18
|
-
readonly fields: ReactNode;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function TaskFormDialogView({
|
|
22
|
-
canSubmit,
|
|
23
|
-
isEdit,
|
|
24
|
-
labels,
|
|
25
|
-
open,
|
|
26
|
-
onClose,
|
|
27
|
-
onSubmit,
|
|
28
|
-
fields,
|
|
29
|
-
}: TaskFormDialogViewProps): JSX.Element {
|
|
30
|
-
return (
|
|
31
|
-
<Dialog open={open} onOpenChange={(value) => !value && onClose()}>
|
|
32
|
-
<DialogContent
|
|
33
|
-
className="flex max-h-[88vh] flex-col gap-0 overflow-hidden rounded-xl border border-border/60 bg-card/95 p-0 backdrop-blur-md max-w-[min(52rem,calc(100%-2rem))]"
|
|
34
|
-
showCloseButton={false}
|
|
35
|
-
>
|
|
36
|
-
<div className="flex-1 overflow-y-auto px-7 py-6">{fields}</div>
|
|
37
|
-
|
|
38
|
-
<div className="flex items-center justify-end gap-2 border-t border-border/40 px-5 py-3">
|
|
39
|
-
<Button
|
|
40
|
-
type="button"
|
|
41
|
-
variant="ghost"
|
|
42
|
-
onClick={onClose}
|
|
43
|
-
className="h-9 rounded-lg px-3 text-[13px] text-muted-foreground hover:text-foreground"
|
|
44
|
-
>
|
|
45
|
-
<span className="icon-[mdi--close] h-4 w-4" />
|
|
46
|
-
<span>{labels.cancel}</span>
|
|
47
|
-
</Button>
|
|
48
|
-
<Button
|
|
49
|
-
onClick={onSubmit}
|
|
50
|
-
disabled={!canSubmit}
|
|
51
|
-
className="h-9 rounded-lg bg-primary px-4 text-[13px] text-primary-foreground hover:bg-primary/90"
|
|
52
|
-
>
|
|
53
|
-
<span className="icon-[mdi--check] h-4 w-4" />
|
|
54
|
-
<span>{isEdit ? labels.save : labels.create}</span>
|
|
55
|
-
</Button>
|
|
56
|
-
</div>
|
|
57
|
-
</DialogContent>
|
|
58
|
-
</Dialog>
|
|
59
|
-
);
|
|
60
|
-
}
|