@agent-native/core 0.120.2 → 0.120.4
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/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +28 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/context-xray-local.ts +1 -1
- package/corpus/core/src/cli/index.ts +63 -18
- package/corpus/core/src/cli/skills.ts +5 -0
- package/corpus/core/src/cli/telemetry.ts +118 -1
- package/corpus/core/src/client/AgentPanel.tsx +10 -0
- package/corpus/core/src/client/CommandMenu.tsx +13 -1
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +39 -4
- package/corpus/core/src/client/analytics.ts +13 -0
- package/corpus/core/src/client/error-capture.ts +6 -1
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -5
- package/corpus/core/src/client/extensions/agent-native-extension-runtime.ts +1 -1
- package/corpus/core/src/client/navigation/index.ts +2 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +14 -32
- package/corpus/core/src/client/settings/ExtensionsSettingsContent.tsx +1 -1
- package/corpus/core/src/extensions/theme.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +2 -0
- package/corpus/core/src/server/core-routes-plugin.ts +10 -1
- package/corpus/core/src/server/framework-request-handler.ts +17 -26
- package/corpus/core/src/styles/agent-native.css +13 -0
- package/corpus/core/src/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/corpus/core/src/templates/chat/app/global.css +1 -1
- package/corpus/core/src/templates/default/app/global.css +1 -1
- package/corpus/core/src/tracking/error-capture.ts +151 -0
- package/corpus/core/src/tracking/index.ts +5 -0
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +1 -4
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -2
- package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +41 -9
- package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +2 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +28 -14
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +152 -124
- package/corpus/templates/analytics/app/global.css +5 -5
- package/corpus/templates/analytics/app/lib/dashboard-report-capture.ts +42 -0
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +162 -51
- package/corpus/templates/analytics/app/root.tsx +28 -0
- package/corpus/templates/analytics/changelog/2026-07-24-analytics-charts-now-explain-slow-loads-and-offer-a-direct-r.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-daily-dashboard-emails-now-load-signed-reports-more-reliably.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-manage-agent-is-clearly-marked-as-a-link-to-its-dedicated-pa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +1 -1
- package/corpus/templates/analytics/server/db/schema.ts +5 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +21 -0
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +11 -0
- package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +54 -0
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +235 -26
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +4 -1
- package/corpus/templates/analytics/server/plugins/db.ts +9 -0
- package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +1 -1
- package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +376 -0
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +14 -4
- package/corpus/templates/assets/app/components/layout/Layout.tsx +5 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +118 -74
- package/corpus/templates/assets/app/global.css +1 -1
- package/corpus/templates/assets/app/i18n-data.ts +10 -0
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +99 -10
- package/corpus/templates/assets/app/routes/library.tsx +21 -198
- package/corpus/templates/assets/changelog/2026-07-21-unified-asset-preview-click-any-asset-to-open-one-preview-wi.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +76 -43
- package/corpus/templates/brain/app/global.css +1 -1
- package/corpus/templates/brain/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +67 -52
- package/corpus/templates/calendar/app/global.css +1 -1
- package/corpus/templates/calendar/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/corpus/templates/chat/app/global.css +1 -1
- package/corpus/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +65 -31
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +2 -2
- package/corpus/templates/clips/app/components/player/video-player.tsx +16 -1
- package/corpus/templates/clips/app/global.css +1 -1
- package/corpus/templates/clips/app/hooks/use-view-tracking.ts +55 -12
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +6 -5
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -7
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -5
- package/corpus/templates/clips/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/clips/server/plugins/db.ts +113 -68
- package/corpus/templates/content/actions/update-document.ts +145 -91
- package/corpus/templates/content/app/components/editor/CommentComposer.tsx +4 -1
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +366 -164
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +51 -28
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +19 -8
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +66 -42
- package/corpus/templates/content/app/global.css +1 -1
- package/corpus/templates/content/app/i18n-data.ts +15 -0
- package/corpus/templates/content/changelog/2026-07-23-shared-pages-now-keep-durable-content-visible-and-comment-th.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-comment-drafts-now-stay-open-when-saving-fails-and-long-live.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/design/actions/update-file.ts +85 -18
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +65 -30
- package/corpus/templates/design/app/entry.client.tsx +14 -1
- package/corpus/templates/design/app/global.css +1 -1
- package/corpus/templates/design/app/lib/design-save-outbox.ts +39 -0
- package/corpus/templates/design/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/design/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/dispatch/app/global.css +1 -1
- package/corpus/templates/dispatch/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +72 -37
- package/corpus/templates/forms/app/global.css +1 -1
- package/corpus/templates/forms/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-forms-sidebar-actions-now-keep-search-language-feedback-and-.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/macros/app/components/DailyProgress.tsx +5 -5
- package/corpus/templates/macros/app/components/ExerciseCard.tsx +2 -2
- package/corpus/templates/macros/app/components/MealCard.tsx +2 -2
- package/corpus/templates/macros/app/components/WeightCard.tsx +2 -2
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +56 -29
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -2
- package/corpus/templates/macros/app/components/ui/card.tsx +1 -1
- package/corpus/templates/macros/app/global.css +1 -1
- package/corpus/templates/macros/app/routes/_index.tsx +1 -1
- package/corpus/templates/macros/app/routes/analytics.tsx +4 -7
- package/corpus/templates/macros/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +125 -37
- package/corpus/templates/mail/app/global.css +1 -1
- package/corpus/templates/mail/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +90 -60
- package/corpus/templates/plan/app/global.css +1 -1
- package/corpus/templates/plan/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +69 -32
- package/corpus/templates/slides/app/global.css +1 -1
- package/corpus/templates/slides/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/tasks/app/global.css +1 -1
- package/corpus/templates/tasks/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +14 -0
- package/corpus/toolkit/README.md +8 -1
- package/corpus/toolkit/agent-native.eject.json +1 -1
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/app-shell/index.ts +1 -0
- package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +48 -0
- package/corpus/toolkit/src/chat-history.css +52 -1
- package/corpus/toolkit/src/design-system/default-adapter.tsx +1 -1
- package/corpus/toolkit/src/editor/useCollabReconcile.ts +83 -15
- package/corpus/toolkit/src/ui/button.tsx +1 -2
- package/corpus/toolkit/src/ui/card.tsx +1 -1
- package/corpus/toolkit/src/ui/table.tsx +4 -11
- package/dist/cli/context-xray-local.js +1 -1
- package/dist/cli/context-xray-local.js.map +1 -1
- package/dist/cli/index.js +56 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +5 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/telemetry.d.ts +7 -0
- package/dist/cli/telemetry.d.ts.map +1 -1
- package/dist/cli/telemetry.js +91 -1
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +7 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +2 -0
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +12 -1
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.d.ts +4 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +8 -4
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +7 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/error-capture.d.ts.map +1 -1
- package/dist/client/error-capture.js +8 -1
- package/dist/client/error-capture.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +2 -2
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/agent-native-extension-runtime.js +1 -1
- package/dist/client/extensions/agent-native-extension-runtime.js.map +1 -1
- package/dist/client/navigation/index.d.ts +1 -1
- package/dist/client/navigation/index.d.ts.map +1 -1
- package/dist/client/navigation/index.js +1 -1
- package/dist/client/navigation/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +9 -13
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/settings/ExtensionsSettingsContent.js +1 -1
- package/dist/client/settings/ExtensionsSettingsContent.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/extensions/theme.js +1 -1
- package/dist/extensions/theme.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/localization/default-messages.d.ts +2 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +2 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +8 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +17 -27
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/styles/agent-native.css +13 -0
- package/dist/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/dist/templates/chat/app/global.css +1 -1
- package/dist/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/dist/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/dist/templates/default/app/global.css +1 -1
- package/dist/tracking/error-capture.d.ts +14 -0
- package/dist/tracking/error-capture.d.ts.map +1 -0
- package/dist/tracking/error-capture.js +113 -0
- package/dist/tracking/error-capture.js.map +1 -0
- package/dist/tracking/index.d.ts +1 -0
- package/dist/tracking/index.d.ts.map +1 -1
- package/dist/tracking/index.js +1 -0
- package/dist/tracking/index.js.map +1 -1
- package/package.json +2 -2
- package/src/cli/context-xray-local.ts +1 -1
- package/src/cli/index.ts +63 -18
- package/src/cli/skills.ts +5 -0
- package/src/cli/telemetry.ts +118 -1
- package/src/client/AgentPanel.tsx +10 -0
- package/src/client/CommandMenu.tsx +13 -1
- package/src/client/agent-page/AgentTabsPage.tsx +39 -4
- package/src/client/analytics.ts +13 -0
- package/src/client/error-capture.ts +6 -1
- package/src/client/extensions/ExtensionsListPage.tsx +12 -5
- package/src/client/extensions/agent-native-extension-runtime.ts +1 -1
- package/src/client/navigation/index.ts +2 -0
- package/src/client/org/OrgSwitcher.tsx +14 -32
- package/src/client/settings/ExtensionsSettingsContent.tsx +1 -1
- package/src/extensions/theme.ts +1 -1
- package/src/localization/default-messages.ts +2 -0
- package/src/server/core-routes-plugin.ts +10 -1
- package/src/server/framework-request-handler.ts +17 -26
- package/src/styles/agent-native.css +13 -0
- package/src/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/src/templates/chat/app/global.css +1 -1
- package/src/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/src/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/src/templates/default/app/global.css +1 -1
- package/src/tracking/error-capture.ts +151 -0
- package/src/tracking/index.ts +5 -0
|
@@ -7,9 +7,11 @@ import {
|
|
|
7
7
|
import { appPath } from "@agent-native/core/client/api-path";
|
|
8
8
|
import { DevDatabaseLink } from "@agent-native/core/client/db-admin";
|
|
9
9
|
import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
10
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
10
|
+
import { LanguagePicker, useT } from "@agent-native/core/client/i18n";
|
|
11
|
+
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
11
12
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
12
13
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
14
|
+
import { SidebarFooterActions } from "@agent-native/toolkit/app-shell";
|
|
13
15
|
import {
|
|
14
16
|
ChatHistoryRail,
|
|
15
17
|
type ChatHistoryItem,
|
|
@@ -21,6 +23,7 @@ import {
|
|
|
21
23
|
IconLayoutSidebarLeftExpand,
|
|
22
24
|
IconLayoutGrid,
|
|
23
25
|
IconPhotoPlus,
|
|
26
|
+
IconSearch,
|
|
24
27
|
IconSettings,
|
|
25
28
|
IconShare3,
|
|
26
29
|
} from "@tabler/icons-react";
|
|
@@ -118,7 +121,7 @@ function chatThreadPath(threadId: string) {
|
|
|
118
121
|
return `/chat/${encodeURIComponent(threadId)}`;
|
|
119
122
|
}
|
|
120
123
|
|
|
121
|
-
function AssetsChatsSection() {
|
|
124
|
+
function AssetsChatsSection({ open }: { open: boolean }) {
|
|
122
125
|
const navigate = useNavigate();
|
|
123
126
|
const location = useLocation();
|
|
124
127
|
const t = useT();
|
|
@@ -242,51 +245,57 @@ function AssetsChatsSection() {
|
|
|
242
245
|
}
|
|
243
246
|
|
|
244
247
|
return (
|
|
245
|
-
<div
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
248
|
+
<div
|
|
249
|
+
className="an-chat-history-rail__collapse"
|
|
250
|
+
data-state={open ? "open" : "closed"}
|
|
251
|
+
aria-hidden={!open}
|
|
252
|
+
>
|
|
253
|
+
<div className="ms-4">
|
|
254
|
+
<ChatHistoryRail
|
|
255
|
+
items={chatItems}
|
|
256
|
+
activeId={displayedActiveThreadId}
|
|
257
|
+
onSelect={openThread}
|
|
258
|
+
onNewChat={() => void handleNewChat()}
|
|
259
|
+
railLabels={{
|
|
260
|
+
newChat: t("chat.newChat"),
|
|
261
|
+
showMore: t("chat.chats"),
|
|
262
|
+
showLess: t("chat.chats"),
|
|
263
|
+
}}
|
|
264
|
+
previewCount={5}
|
|
265
|
+
expandedCount={15}
|
|
266
|
+
onTogglePin={(threadId) => {
|
|
267
|
+
const thread = visibleThreads.find((item) => item.id === threadId);
|
|
268
|
+
if (thread) void pinThread(threadId, !thread.pinnedAt);
|
|
269
|
+
}}
|
|
270
|
+
onRename={handleRenameThread}
|
|
271
|
+
renameMaxLength={160}
|
|
272
|
+
onDelete={(threadId) => void handleArchiveThread(threadId)}
|
|
273
|
+
renderAdditionalRowActions={(item, closeMenu) => (
|
|
274
|
+
<button
|
|
275
|
+
type="button"
|
|
276
|
+
role="menuitem"
|
|
277
|
+
className="an-chat-history-row__menu-item"
|
|
278
|
+
onClick={() => {
|
|
279
|
+
closeMenu();
|
|
280
|
+
void handleCopyShareLink(item.id);
|
|
281
|
+
}}
|
|
282
|
+
>
|
|
283
|
+
<IconShare3 size={13} strokeWidth={1.8} />
|
|
284
|
+
<span>{t("chat.copyShareLink")}</span>
|
|
285
|
+
</button>
|
|
286
|
+
)}
|
|
287
|
+
labels={{
|
|
288
|
+
options: (item) =>
|
|
289
|
+
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
290
|
+
renameInput: (item) => `Rename ${item.titleText ?? ""}`,
|
|
291
|
+
rename: t("chat.renameChat"),
|
|
292
|
+
pin: t("chat.pinChat"),
|
|
293
|
+
unpin: t("chat.unpinChat"),
|
|
294
|
+
delete: t("chat.archiveChat"),
|
|
295
|
+
}}
|
|
296
|
+
className="min-w-0 [&_.an-chat-history-rail__new-chat]:justify-start"
|
|
297
|
+
/>
|
|
298
|
+
</div>
|
|
290
299
|
</div>
|
|
291
300
|
);
|
|
292
301
|
}
|
|
@@ -321,6 +330,59 @@ export function Sidebar() {
|
|
|
321
330
|
}
|
|
322
331
|
}, [collapsed]);
|
|
323
332
|
|
|
333
|
+
const collapseButton = (
|
|
334
|
+
<Tooltip delayDuration={0}>
|
|
335
|
+
<TooltipTrigger asChild>
|
|
336
|
+
<button
|
|
337
|
+
type="button"
|
|
338
|
+
onClick={() => setCollapsed((value) => !value)}
|
|
339
|
+
className="flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
340
|
+
aria-label={
|
|
341
|
+
collapsed
|
|
342
|
+
? t("navigation.expandSidebar")
|
|
343
|
+
: t("navigation.collapseSidebar")
|
|
344
|
+
}
|
|
345
|
+
>
|
|
346
|
+
{collapsed ? (
|
|
347
|
+
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
348
|
+
) : (
|
|
349
|
+
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
350
|
+
)}
|
|
351
|
+
</button>
|
|
352
|
+
</TooltipTrigger>
|
|
353
|
+
<TooltipContent side="right">
|
|
354
|
+
{collapsed
|
|
355
|
+
? t("navigation.expandSidebar")
|
|
356
|
+
: t("navigation.collapseSidebar")}
|
|
357
|
+
</TooltipContent>
|
|
358
|
+
</Tooltip>
|
|
359
|
+
);
|
|
360
|
+
const searchButton = (
|
|
361
|
+
<Tooltip delayDuration={0}>
|
|
362
|
+
<TooltipTrigger asChild>
|
|
363
|
+
<button
|
|
364
|
+
type="button"
|
|
365
|
+
onClick={openCommandMenu}
|
|
366
|
+
className="flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
367
|
+
aria-label={t("root.commandSearch")}
|
|
368
|
+
>
|
|
369
|
+
<IconSearch className="h-4 w-4" />
|
|
370
|
+
</button>
|
|
371
|
+
</TooltipTrigger>
|
|
372
|
+
<TooltipContent side="right">{t("root.commandSearch")}</TooltipContent>
|
|
373
|
+
</Tooltip>
|
|
374
|
+
);
|
|
375
|
+
const translateButton = (
|
|
376
|
+
<LanguagePicker variant="ghost-icon" label={t("settings.languageLabel")} />
|
|
377
|
+
);
|
|
378
|
+
const feedbackButton = (
|
|
379
|
+
<FeedbackButton
|
|
380
|
+
variant={collapsed ? "icon" : "sidebar"}
|
|
381
|
+
side="right"
|
|
382
|
+
className={collapsed ? "h-8 w-8" : "min-w-0"}
|
|
383
|
+
/>
|
|
384
|
+
);
|
|
385
|
+
|
|
324
386
|
return (
|
|
325
387
|
<aside
|
|
326
388
|
className={cn(
|
|
@@ -353,30 +415,6 @@ export function Sidebar() {
|
|
|
353
415
|
</span>
|
|
354
416
|
</div>
|
|
355
417
|
)}
|
|
356
|
-
<Tooltip delayDuration={0}>
|
|
357
|
-
<TooltipTrigger asChild>
|
|
358
|
-
<button
|
|
359
|
-
onClick={() => setCollapsed((c) => !c)}
|
|
360
|
-
className="flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
361
|
-
aria-label={
|
|
362
|
-
collapsed
|
|
363
|
-
? t("navigation.expandSidebar")
|
|
364
|
-
: t("navigation.collapseSidebar")
|
|
365
|
-
}
|
|
366
|
-
>
|
|
367
|
-
{collapsed ? (
|
|
368
|
-
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
369
|
-
) : (
|
|
370
|
-
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
371
|
-
)}
|
|
372
|
-
</button>
|
|
373
|
-
</TooltipTrigger>
|
|
374
|
-
<TooltipContent side="right">
|
|
375
|
-
{collapsed
|
|
376
|
-
? t("navigation.expandSidebar")
|
|
377
|
-
: t("navigation.collapseSidebar")}
|
|
378
|
-
</TooltipContent>
|
|
379
|
-
</Tooltip>
|
|
380
418
|
</div>
|
|
381
419
|
|
|
382
420
|
<div className="flex min-h-0 flex-1 flex-col overflow-y-auto">
|
|
@@ -443,7 +481,7 @@ export function Sidebar() {
|
|
|
443
481
|
<div key={item.href}>
|
|
444
482
|
{link}
|
|
445
483
|
{item.href === "/" && isCreateRoute ? (
|
|
446
|
-
<AssetsChatsSection />
|
|
484
|
+
<AssetsChatsSection open />
|
|
447
485
|
) : null}
|
|
448
486
|
</div>
|
|
449
487
|
);
|
|
@@ -496,13 +534,19 @@ export function Sidebar() {
|
|
|
496
534
|
)}
|
|
497
535
|
|
|
498
536
|
{!collapsed && (
|
|
499
|
-
<div className="px-3 py-2
|
|
537
|
+
<div className="px-3 py-2">
|
|
500
538
|
<DevDatabaseLink />
|
|
501
|
-
<FeedbackButton />
|
|
502
539
|
</div>
|
|
503
540
|
)}
|
|
504
541
|
</div>
|
|
505
542
|
</div>
|
|
543
|
+
<SidebarFooterActions
|
|
544
|
+
collapsed={collapsed}
|
|
545
|
+
feedback={feedbackButton}
|
|
546
|
+
translate={translateButton}
|
|
547
|
+
search={searchButton}
|
|
548
|
+
collapse={collapseButton}
|
|
549
|
+
/>
|
|
506
550
|
</aside>
|
|
507
551
|
);
|
|
508
552
|
}
|
|
@@ -749,6 +749,7 @@ const enUS = {
|
|
|
749
749
|
makeVariations: "Make variations",
|
|
750
750
|
handoff: "Handoff",
|
|
751
751
|
download: "Download",
|
|
752
|
+
downloadFailed: "Could not download asset.",
|
|
752
753
|
copyUrl: "Copy URL",
|
|
753
754
|
delete: "Delete",
|
|
754
755
|
deleteTitle: "Delete asset?",
|
|
@@ -3229,6 +3230,7 @@ const assetDetailDeDE = {
|
|
|
3229
3230
|
copiedUrl: "URL kopiert",
|
|
3230
3231
|
copyFailed: "Konnte nicht in die Zwischenablage kopieren.",
|
|
3231
3232
|
previewUnavailable: "Vorschau nicht verfügbar",
|
|
3233
|
+
downloadFailed: "Asset konnte nicht heruntergeladen werden.",
|
|
3232
3234
|
} satisfies Partial<Messages["assetDetail"]>;
|
|
3233
3235
|
|
|
3234
3236
|
const assetPickerDeDE = {
|
|
@@ -3339,6 +3341,7 @@ const assetDetailJaJP = {
|
|
|
3339
3341
|
copiedUrl: "URL をコピーしました",
|
|
3340
3342
|
copyFailed: "クリップボードにコピーできませんでした。",
|
|
3341
3343
|
previewUnavailable: "プレビューを利用できません",
|
|
3344
|
+
downloadFailed: "アセットをダウンロードできませんでした。",
|
|
3342
3345
|
} satisfies Partial<Messages["assetDetail"]>;
|
|
3343
3346
|
|
|
3344
3347
|
const assetPickerJaJP = {
|
|
@@ -3444,6 +3447,7 @@ const assetDetailKoKR = {
|
|
|
3444
3447
|
copiedUrl: "URL이 복사되었습니다",
|
|
3445
3448
|
copyFailed: "클립보드에 복사할 수 없습니다.",
|
|
3446
3449
|
previewUnavailable: "미리보기를 사용할 수 없습니다",
|
|
3450
|
+
downloadFailed: "자산을 다운로드할 수 없습니다.",
|
|
3447
3451
|
} satisfies Partial<Messages["assetDetail"]>;
|
|
3448
3452
|
|
|
3449
3453
|
const assetPickerKoKR = {
|
|
@@ -3548,6 +3552,7 @@ const assetDetailHiIN = {
|
|
|
3548
3552
|
copiedUrl: "URL कॉपी हुआ",
|
|
3549
3553
|
copyFailed: "Clipboard पर कॉपी नहीं कर सके।",
|
|
3550
3554
|
previewUnavailable: "Preview उपलब्ध नहीं है",
|
|
3555
|
+
downloadFailed: "एसेट डाउनलोड नहीं किया जा सका।",
|
|
3551
3556
|
} satisfies Partial<Messages["assetDetail"]>;
|
|
3552
3557
|
|
|
3553
3558
|
const assetPickerHiIN = {
|
|
@@ -4041,6 +4046,7 @@ export const messagesByLocale = {
|
|
|
4041
4046
|
deleteDescription:
|
|
4042
4047
|
"这会从库中删除该资源。已使用此 URL 的现有导出可能会停止渲染。",
|
|
4043
4048
|
deleteTitle: "删除资产?",
|
|
4049
|
+
downloadFailed: "无法下载资产。",
|
|
4044
4050
|
loading: "正在加载资源...",
|
|
4045
4051
|
makeVariations: "做出变化",
|
|
4046
4052
|
makeVideoVariation: "制作视频变体",
|
|
@@ -4911,6 +4917,7 @@ export const messagesByLocale = {
|
|
|
4911
4917
|
deleteDescription:
|
|
4912
4918
|
"Esto elimina el activo de la biblioteca. Las exportaciones existentes que ya utilizan este URL pueden dejar de procesarse.",
|
|
4913
4919
|
deleteTitle: "¿Eliminar activo?",
|
|
4920
|
+
downloadFailed: "No se pudo descargar el activo.",
|
|
4914
4921
|
loading: "Cargando activo...",
|
|
4915
4922
|
makeVariations: "hacer variaciones",
|
|
4916
4923
|
makeVideoVariation: "Hacer variación de video",
|
|
@@ -5359,6 +5366,7 @@ export const messagesByLocale = {
|
|
|
5359
5366
|
deleteDescription:
|
|
5360
5367
|
"Cela supprime l'actif de la bibliothèque. Les exportations existantes qui utilisent déjà ce URL peuvent arrêter le rendu.",
|
|
5361
5368
|
deleteTitle: "Supprimer l'élément ?",
|
|
5369
|
+
downloadFailed: "Impossible de télécharger l'élément.",
|
|
5362
5370
|
loading: "Chargement de l'élément...",
|
|
5363
5371
|
makeVariations: "Faire des variantes",
|
|
5364
5372
|
makeVideoVariation: "Faire une variation vidéo",
|
|
@@ -6853,6 +6861,7 @@ export const messagesByLocale = {
|
|
|
6853
6861
|
deleteDescription:
|
|
6854
6862
|
"Isso remove o ativo da biblioteca. As exportações existentes que já usam este URL podem parar de renderizar.",
|
|
6855
6863
|
deleteTitle: "Excluir recurso?",
|
|
6864
|
+
downloadFailed: "Não foi possível baixar o recurso.",
|
|
6856
6865
|
loading: "Carregando recurso...",
|
|
6857
6866
|
makeVariations: "Faça variações",
|
|
6858
6867
|
makeVideoVariation: "Faça variação de vídeo",
|
|
@@ -7646,6 +7655,7 @@ export const messagesByLocale = {
|
|
|
7646
7655
|
deleteDescription:
|
|
7647
7656
|
"يؤدي هذا إلى إزالة الأصل من المكتبة. قد تتوقف عمليات التصدير الحالية التي تستخدم URL بالفعل عن العرض.",
|
|
7648
7657
|
deleteTitle: "هل تريد حذف مادة العرض؟",
|
|
7658
|
+
downloadFailed: "تعذّر تنزيل الأصل.",
|
|
7649
7659
|
loading: "جارٍ تحميل الأصل...",
|
|
7650
7660
|
makeVariations: "قم بإجراء الاختلافات",
|
|
7651
7661
|
makeVideoVariation: "جعل الاختلاف في الفيديو",
|
|
@@ -62,6 +62,10 @@ import {
|
|
|
62
62
|
} from "react-router";
|
|
63
63
|
import { toast } from "sonner";
|
|
64
64
|
|
|
65
|
+
import {
|
|
66
|
+
AssetPreviewDialog,
|
|
67
|
+
type PreviewAsset,
|
|
68
|
+
} from "@/components/asset/AssetPreviewDialog";
|
|
65
69
|
import {
|
|
66
70
|
AlertDialog,
|
|
67
71
|
AlertDialogAction,
|
|
@@ -1508,6 +1512,7 @@ type LaneGalleryItem = {
|
|
|
1508
1512
|
asset?: any;
|
|
1509
1513
|
mediaType?: "image" | "video";
|
|
1510
1514
|
href?: string;
|
|
1515
|
+
onOpen?: () => void;
|
|
1511
1516
|
selected?: boolean;
|
|
1512
1517
|
busy?: boolean;
|
|
1513
1518
|
showBusyOverlay?: boolean;
|
|
@@ -2105,6 +2110,7 @@ function AssetSwimlaneBoard({
|
|
|
2105
2110
|
}) {
|
|
2106
2111
|
const t = useT();
|
|
2107
2112
|
const [bulkContextOpen, setBulkContextOpen] = useState(false);
|
|
2113
|
+
const [previewAsset, setPreviewAsset] = useState<any | null>(null);
|
|
2108
2114
|
const deleteAsset = useActionMutation("delete-asset");
|
|
2109
2115
|
const deleteAssets = useActionMutation("delete-assets");
|
|
2110
2116
|
const updateAsset = useActionMutation("update-asset");
|
|
@@ -2367,6 +2373,7 @@ function AssetSwimlaneBoard({
|
|
|
2367
2373
|
status: isReference ? t("library.reference") : t("library.saved"),
|
|
2368
2374
|
mediaType: asset.mediaType === "video" ? "video" : "image",
|
|
2369
2375
|
href: `/asset/${asset.id}`,
|
|
2376
|
+
onOpen: () => setPreviewAsset(asset),
|
|
2370
2377
|
selected: selectedIds.has(asset.id),
|
|
2371
2378
|
deleting: deletingIds.has(asset.id),
|
|
2372
2379
|
busy,
|
|
@@ -2382,6 +2389,7 @@ function AssetSwimlaneBoard({
|
|
|
2382
2389
|
onDelete={() => confirmDelete([asset.id])}
|
|
2383
2390
|
onMoveToReferences={onMoveToReferences}
|
|
2384
2391
|
onRemoveFromReferences={onRemoveFromReferences}
|
|
2392
|
+
onOpenPreview={() => setPreviewAsset(asset)}
|
|
2385
2393
|
/>
|
|
2386
2394
|
),
|
|
2387
2395
|
primaryActions:
|
|
@@ -2753,6 +2761,12 @@ function AssetSwimlaneBoard({
|
|
|
2753
2761
|
}
|
|
2754
2762
|
/>
|
|
2755
2763
|
)}
|
|
2764
|
+
|
|
2765
|
+
<AssetPreviewDialog
|
|
2766
|
+
asset={previewAsset}
|
|
2767
|
+
assets={boardAssets as PreviewAsset[]}
|
|
2768
|
+
onAssetChange={setPreviewAsset}
|
|
2769
|
+
/>
|
|
2756
2770
|
</>
|
|
2757
2771
|
);
|
|
2758
2772
|
}
|
|
@@ -2933,7 +2947,15 @@ function AssetCardsView({ items }: { items: LaneGalleryItem[] }) {
|
|
|
2933
2947
|
aria-busy={item.busy}
|
|
2934
2948
|
>
|
|
2935
2949
|
<div className="relative aspect-4/3 bg-muted/30">
|
|
2936
|
-
{item.
|
|
2950
|
+
{item.onOpen ? (
|
|
2951
|
+
<button
|
|
2952
|
+
type="button"
|
|
2953
|
+
onClick={item.onOpen}
|
|
2954
|
+
className="block h-full w-full text-left"
|
|
2955
|
+
>
|
|
2956
|
+
{item.thumbnail}
|
|
2957
|
+
</button>
|
|
2958
|
+
) : item.href ? (
|
|
2937
2959
|
<Link to={item.href} className="block h-full w-full">
|
|
2938
2960
|
{item.thumbnail}
|
|
2939
2961
|
</Link>
|
|
@@ -3075,7 +3097,15 @@ function SwimLane({
|
|
|
3075
3097
|
aria-busy={activeItem?.busy}
|
|
3076
3098
|
>
|
|
3077
3099
|
<div className="aspect-16/10 bg-muted/30">
|
|
3078
|
-
{activeItem?.
|
|
3100
|
+
{activeItem?.onOpen ? (
|
|
3101
|
+
<button
|
|
3102
|
+
type="button"
|
|
3103
|
+
onClick={activeItem.onOpen}
|
|
3104
|
+
className="block h-full w-full text-left"
|
|
3105
|
+
>
|
|
3106
|
+
{activeItem.preview}
|
|
3107
|
+
</button>
|
|
3108
|
+
) : activeItem?.href ? (
|
|
3079
3109
|
<Link
|
|
3080
3110
|
to={activeItem.href}
|
|
3081
3111
|
className="block h-full w-full"
|
|
@@ -3198,7 +3228,16 @@ function SwimLane({
|
|
|
3198
3228
|
) : null}
|
|
3199
3229
|
</div>
|
|
3200
3230
|
<div className="flex shrink-0 items-center gap-2">
|
|
3201
|
-
{activeItem?.
|
|
3231
|
+
{activeItem?.onOpen ? (
|
|
3232
|
+
<Button
|
|
3233
|
+
variant="outline"
|
|
3234
|
+
size="sm"
|
|
3235
|
+
className="flex-1"
|
|
3236
|
+
onClick={activeItem.onOpen}
|
|
3237
|
+
>
|
|
3238
|
+
{t("brandKitDetail.open")}
|
|
3239
|
+
</Button>
|
|
3240
|
+
) : activeItem?.href ? (
|
|
3202
3241
|
<Button asChild variant="outline" size="sm" className="flex-1">
|
|
3203
3242
|
<Link to={activeItem.href}>{t("brandKitDetail.open")}</Link>
|
|
3204
3243
|
</Button>
|
|
@@ -3303,6 +3342,7 @@ function AssetActionsMenu({
|
|
|
3303
3342
|
onDelete,
|
|
3304
3343
|
onMoveToReferences,
|
|
3305
3344
|
onRemoveFromReferences,
|
|
3345
|
+
onOpenPreview,
|
|
3306
3346
|
}: {
|
|
3307
3347
|
asset: any;
|
|
3308
3348
|
folders: any[];
|
|
@@ -3311,6 +3351,7 @@ function AssetActionsMenu({
|
|
|
3311
3351
|
onDelete: () => void;
|
|
3312
3352
|
onMoveToReferences?: () => void;
|
|
3313
3353
|
onRemoveFromReferences?: () => void;
|
|
3354
|
+
onOpenPreview?: () => void;
|
|
3314
3355
|
}) {
|
|
3315
3356
|
const t = useT();
|
|
3316
3357
|
const [contextOpen, setContextOpen] = useState(false);
|
|
@@ -3330,12 +3371,24 @@ function AssetActionsMenu({
|
|
|
3330
3371
|
</Button>
|
|
3331
3372
|
</DropdownMenuTrigger>
|
|
3332
3373
|
<DropdownMenuContent align="end">
|
|
3333
|
-
|
|
3334
|
-
<
|
|
3374
|
+
{onOpenPreview ? (
|
|
3375
|
+
<DropdownMenuItem
|
|
3376
|
+
onSelect={(event) => {
|
|
3377
|
+
event.preventDefault();
|
|
3378
|
+
onOpenPreview();
|
|
3379
|
+
}}
|
|
3380
|
+
>
|
|
3335
3381
|
<IconArrowUpRight className="mr-2 h-4 w-4 shrink-0" />
|
|
3336
3382
|
{t("library.viewDetails")}
|
|
3337
|
-
</
|
|
3338
|
-
|
|
3383
|
+
</DropdownMenuItem>
|
|
3384
|
+
) : (
|
|
3385
|
+
<DropdownMenuItem asChild>
|
|
3386
|
+
<Link to={`/asset/${asset.id}`}>
|
|
3387
|
+
<IconArrowUpRight className="mr-2 h-4 w-4 shrink-0" />
|
|
3388
|
+
{t("library.viewDetails")}
|
|
3389
|
+
</Link>
|
|
3390
|
+
</DropdownMenuItem>
|
|
3391
|
+
)}
|
|
3339
3392
|
<DropdownMenuItem
|
|
3340
3393
|
onSelect={(event) => {
|
|
3341
3394
|
event.preventDefault();
|
|
@@ -3925,6 +3978,7 @@ export function LiveCandidatesStage({
|
|
|
3925
3978
|
status: "draft",
|
|
3926
3979
|
mediaType: asset.mediaType === "video" ? "video" : "image",
|
|
3927
3980
|
href: `/asset/${asset.id}`,
|
|
3981
|
+
onOpen: () => setPreviewAsset(asset),
|
|
3928
3982
|
busy,
|
|
3929
3983
|
preview: <AssetPreview asset={asset} fit="contain" />, // i18n-ignore structural preview slot name
|
|
3930
3984
|
thumbnail: <AssetPreview asset={asset} />,
|
|
@@ -3946,6 +4000,7 @@ export function LiveCandidatesStage({
|
|
|
3946
4000
|
};
|
|
3947
4001
|
}
|
|
3948
4002
|
|
|
4003
|
+
const [previewAsset, setPreviewAsset] = useState(null as any);
|
|
3949
4004
|
const items = [...slots.map(slotItem), ...draftAssets.map(draftItem)];
|
|
3950
4005
|
const itemIds = items.map((item) => item.id).join("\n");
|
|
3951
4006
|
const activeItem =
|
|
@@ -4032,7 +4087,15 @@ export function LiveCandidatesStage({
|
|
|
4032
4087
|
aria-busy={activeItem?.busy}
|
|
4033
4088
|
>
|
|
4034
4089
|
<div className="h-36 bg-muted/30 sm:h-44 lg:h-56 2xl:h-64">
|
|
4035
|
-
{activeItem?.
|
|
4090
|
+
{activeItem?.onOpen ? (
|
|
4091
|
+
<button
|
|
4092
|
+
type="button"
|
|
4093
|
+
onClick={activeItem.onOpen}
|
|
4094
|
+
className="block h-full w-full text-left"
|
|
4095
|
+
>
|
|
4096
|
+
{activeItem.preview}
|
|
4097
|
+
</button>
|
|
4098
|
+
) : activeItem?.href ? (
|
|
4036
4099
|
<Link to={activeItem.href} className="block h-full w-full">
|
|
4037
4100
|
{activeItem.preview}
|
|
4038
4101
|
</Link>
|
|
@@ -4045,7 +4108,17 @@ export function LiveCandidatesStage({
|
|
|
4045
4108
|
<Spinner className="h-5 w-5" />
|
|
4046
4109
|
</div>
|
|
4047
4110
|
) : null}
|
|
4048
|
-
{activeItem?.
|
|
4111
|
+
{activeItem?.onOpen ? (
|
|
4112
|
+
<Button
|
|
4113
|
+
variant="secondary"
|
|
4114
|
+
size="sm"
|
|
4115
|
+
className="absolute right-2 top-2 h-8 gap-1.5 bg-background/85 px-2.5 text-xs opacity-0 shadow-sm backdrop-blur transition group-hover:opacity-100 focus-within:opacity-100"
|
|
4116
|
+
onClick={activeItem.onOpen}
|
|
4117
|
+
>
|
|
4118
|
+
<IconArrowUpRight className="h-3.5 w-3.5" />
|
|
4119
|
+
{t("library.details")}
|
|
4120
|
+
</Button>
|
|
4121
|
+
) : activeItem?.href ? (
|
|
4049
4122
|
<Button
|
|
4050
4123
|
asChild
|
|
4051
4124
|
variant="secondary"
|
|
@@ -4119,7 +4192,17 @@ export function LiveCandidatesStage({
|
|
|
4119
4192
|
<div>{activeItem.primaryActions}</div>
|
|
4120
4193
|
) : null}
|
|
4121
4194
|
</div>
|
|
4122
|
-
{activeItem?.
|
|
4195
|
+
{activeItem?.onOpen ? (
|
|
4196
|
+
<Button
|
|
4197
|
+
variant="ghost"
|
|
4198
|
+
size="sm"
|
|
4199
|
+
className="gap-1.5"
|
|
4200
|
+
onClick={activeItem.onOpen}
|
|
4201
|
+
>
|
|
4202
|
+
<IconArrowUpRight className="h-3.5 w-3.5" />
|
|
4203
|
+
{t("library.openDetails")}
|
|
4204
|
+
</Button>
|
|
4205
|
+
) : activeItem?.href ? (
|
|
4123
4206
|
<Button asChild variant="ghost" size="sm" className="gap-1.5">
|
|
4124
4207
|
<Link to={activeItem.href}>
|
|
4125
4208
|
<IconArrowUpRight className="h-3.5 w-3.5" />
|
|
@@ -4130,6 +4213,12 @@ export function LiveCandidatesStage({
|
|
|
4130
4213
|
</aside>
|
|
4131
4214
|
</div>
|
|
4132
4215
|
</section>
|
|
4216
|
+
|
|
4217
|
+
<AssetPreviewDialog
|
|
4218
|
+
asset={previewAsset}
|
|
4219
|
+
assets={draftAssets as PreviewAsset[]}
|
|
4220
|
+
onAssetChange={setPreviewAsset}
|
|
4221
|
+
/>
|
|
4133
4222
|
</>
|
|
4134
4223
|
);
|
|
4135
4224
|
}
|