@agent-native/core 0.178.1 → 0.178.2-nightly-20260910195009
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/templates/analytics/app/components/layout/Sidebar.tsx +108 -121
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +87 -220
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +83 -221
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +324 -460
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +57 -247
- package/corpus/templates/clips/app/components/library/library-layout.tsx +15 -48
- package/corpus/templates/clips/changelog/2026-09-10-open-mcp-connections-in-new-tabs.md +1 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +84 -94
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +1 -1
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +108 -296
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +55 -212
- package/corpus/templates/factory/app/components/layout/Sidebar.tsx +72 -260
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +143 -362
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +64 -159
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +152 -165
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +82 -207
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +61 -234
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +73 -225
- package/dist/automation/index.d.ts +1 -1
- package/dist/client/EnvironmentBadge.d.ts +7 -4
- package/dist/client/EnvironmentBadge.js +26 -18
- package/dist/client/FeedbackButton.js +23 -8
- package/dist/client/app-providers.js +1 -1
- package/dist/client/auth/AuthPage.js +0 -38
- package/dist/client/components/icons/AgentNativeIcon.js +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/ui/AppSidebar.d.ts +15 -0
- package/dist/client/ui/AppSidebar.js +34 -0
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/index.js +1 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +19 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
- package/dist/provider-api/actions/provider-api.d.ts +15 -15
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/beta-opt-out-html.js +2 -2
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +57 -247
- package/dist/vite/client.js +4 -1
- package/docs/content/template-clips-anonymous-intake.mdx +7 -5
- package/docs/content/template-clips-developers.mdx +1 -1
- package/package.json +3 -3
- package/src/templates/chat/app/components/layout/Sidebar.tsx +57 -247
|
@@ -9,16 +9,18 @@ import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
|
9
9
|
import { useT } from "@agent-native/core/client/i18n";
|
|
10
10
|
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
11
11
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import {
|
|
13
|
+
AppSidebar,
|
|
14
|
+
AppSidebarNavItem,
|
|
15
|
+
FeedbackButton,
|
|
16
|
+
type AppSidebarItemDefinition,
|
|
17
|
+
} from "@agent-native/core/client/ui";
|
|
14
18
|
import {
|
|
15
19
|
ChatHistoryRail,
|
|
16
20
|
type ChatHistoryItem,
|
|
17
21
|
} from "@agent-native/toolkit/chat-history";
|
|
18
22
|
import {
|
|
19
23
|
IconClipboardList,
|
|
20
|
-
IconLayoutSidebarLeftCollapse,
|
|
21
|
-
IconLayoutSidebarLeftExpand,
|
|
22
24
|
IconLayoutGrid,
|
|
23
25
|
IconPhotoPlus,
|
|
24
26
|
IconSearch,
|
|
@@ -27,16 +29,16 @@ import {
|
|
|
27
29
|
IconTemplate,
|
|
28
30
|
} from "@tabler/icons-react";
|
|
29
31
|
import { useEffect, useMemo, useState } from "react";
|
|
30
|
-
import {
|
|
32
|
+
import { useLocation, useNavigate } from "react-router";
|
|
31
33
|
import { toast } from "sonner";
|
|
32
34
|
|
|
35
|
+
import { Button } from "@/components/ui/button";
|
|
33
36
|
import {
|
|
34
37
|
Tooltip,
|
|
35
38
|
TooltipContent,
|
|
36
39
|
TooltipTrigger,
|
|
37
40
|
} from "@/components/ui/tooltip";
|
|
38
41
|
import { ASSETS_CHAT_STORAGE_KEY } from "@/lib/chat";
|
|
39
|
-
import { cn } from "@/lib/utils";
|
|
40
42
|
|
|
41
43
|
const baseNavItems = [
|
|
42
44
|
{ icon: IconPhotoPlus, labelKey: "navigation.create", href: "/home" },
|
|
@@ -44,10 +46,6 @@ const baseNavItems = [
|
|
|
44
46
|
{ icon: IconTemplate, labelKey: "navigation.templates", href: "/templates" },
|
|
45
47
|
];
|
|
46
48
|
|
|
47
|
-
const bottomNavItems = [
|
|
48
|
-
{ icon: IconSettings, labelKey: "navigation.settings", href: "/settings" },
|
|
49
|
-
];
|
|
50
|
-
|
|
51
49
|
const auditNavItem = {
|
|
52
50
|
icon: IconClipboardList,
|
|
53
51
|
labelKey: "navigation.auditLog",
|
|
@@ -329,230 +327,99 @@ export function Sidebar() {
|
|
|
329
327
|
}
|
|
330
328
|
}, [collapsed]);
|
|
331
329
|
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
>
|
|
345
|
-
{collapsed ? (
|
|
346
|
-
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
347
|
-
) : (
|
|
348
|
-
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
349
|
-
)}
|
|
350
|
-
</button>
|
|
351
|
-
</TooltipTrigger>
|
|
352
|
-
<TooltipContent side="right">
|
|
353
|
-
{collapsed
|
|
354
|
-
? t("navigation.expandSidebar")
|
|
355
|
-
: t("navigation.collapseSidebar")}
|
|
356
|
-
</TooltipContent>
|
|
357
|
-
</Tooltip>
|
|
330
|
+
const secondaryItems: AppSidebarItemDefinition[] = [
|
|
331
|
+
{
|
|
332
|
+
to: "/settings",
|
|
333
|
+
label: t("navigation.settings"),
|
|
334
|
+
icon: IconSettings,
|
|
335
|
+
active: location.pathname.startsWith("/settings"),
|
|
336
|
+
},
|
|
337
|
+
];
|
|
338
|
+
|
|
339
|
+
const feedbackButton = (
|
|
340
|
+
<FeedbackButton variant={collapsed ? "icon" : "sidebar"} side="right" />
|
|
358
341
|
);
|
|
342
|
+
|
|
343
|
+
const orgSwitcher = <OrgSwitcher compact={collapsed} />;
|
|
344
|
+
|
|
359
345
|
const searchButton = (
|
|
360
|
-
<Tooltip
|
|
346
|
+
<Tooltip>
|
|
361
347
|
<TooltipTrigger asChild>
|
|
362
|
-
<
|
|
348
|
+
<Button
|
|
363
349
|
type="button"
|
|
350
|
+
variant="ghost"
|
|
351
|
+
size="icon"
|
|
352
|
+
className="size-9 shrink-0 text-primary hover:bg-accent/60 hover:text-primary"
|
|
364
353
|
onClick={openCommandMenu}
|
|
365
|
-
className="flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
366
354
|
aria-label={t("root.commandSearch")}
|
|
367
355
|
>
|
|
368
|
-
<IconSearch className="
|
|
369
|
-
</
|
|
356
|
+
<IconSearch className="size-4" />
|
|
357
|
+
</Button>
|
|
370
358
|
</TooltipTrigger>
|
|
371
359
|
<TooltipContent side="right">{t("root.commandSearch")}</TooltipContent>
|
|
372
360
|
</Tooltip>
|
|
373
361
|
);
|
|
374
|
-
const feedbackButton = (
|
|
375
|
-
<FeedbackButton
|
|
376
|
-
variant={collapsed ? "icon" : "sidebar"}
|
|
377
|
-
side="right"
|
|
378
|
-
className={collapsed ? "h-8 w-8" : "min-w-0"}
|
|
379
|
-
/>
|
|
380
|
-
);
|
|
381
|
-
const brandControl = (
|
|
382
|
-
<button
|
|
383
|
-
type="button"
|
|
384
|
-
onClick={() => setCollapsed((value) => !value)}
|
|
385
|
-
aria-label={
|
|
386
|
-
collapsed
|
|
387
|
-
? t("navigation.expandSidebar")
|
|
388
|
-
: t("navigation.collapseSidebar")
|
|
389
|
-
}
|
|
390
|
-
className={cn(
|
|
391
|
-
"flex items-center gap-2 rounded outline-none transition-colors hover:bg-sidebar-accent/50 focus-visible:ring-2 focus-visible:ring-ring",
|
|
392
|
-
collapsed ? "size-8 justify-center" : "text-start",
|
|
393
|
-
)}
|
|
394
|
-
data-sidebar-brand-toggle
|
|
395
|
-
>
|
|
396
|
-
<AgentNativeIcon
|
|
397
|
-
aria-hidden="true"
|
|
398
|
-
className="h-3.5 w-6 shrink-0 text-sidebar-foreground"
|
|
399
|
-
/>
|
|
400
|
-
{!collapsed && (
|
|
401
|
-
<span className="text-sm font-semibold tracking-tight">
|
|
402
|
-
{t("navigation.brand")}
|
|
403
|
-
</span>
|
|
404
|
-
)}
|
|
405
|
-
</button>
|
|
406
|
-
);
|
|
407
362
|
|
|
408
363
|
return (
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
364
|
+
<AppSidebar
|
|
365
|
+
collapsed={collapsed}
|
|
366
|
+
onCollapsedChange={setCollapsed}
|
|
367
|
+
brandName={t("navigation.brand")}
|
|
368
|
+
brandHref="/home"
|
|
369
|
+
secondaryItems={secondaryItems}
|
|
370
|
+
feedback={feedbackButton}
|
|
371
|
+
orgSwitcher={orgSwitcher}
|
|
372
|
+
footerExtras={
|
|
373
|
+
<>
|
|
374
|
+
{searchButton}
|
|
375
|
+
<DevDatabaseLink />
|
|
376
|
+
</>
|
|
377
|
+
}
|
|
414
378
|
>
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
item.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
to={item.href}
|
|
450
|
-
onClick={(event) => {
|
|
451
|
-
if (
|
|
452
|
-
item.href === "/home" &&
|
|
453
|
-
!event.metaKey &&
|
|
454
|
-
!event.ctrlKey &&
|
|
455
|
-
!event.shiftKey &&
|
|
456
|
-
!event.altKey
|
|
457
|
-
) {
|
|
458
|
-
event.preventDefault();
|
|
459
|
-
focusAgentChat();
|
|
460
|
-
if (!isCreateRoute || location.pathname !== "/home") {
|
|
461
|
-
navigateWithAgentChatViewTransition(navigate, "/home");
|
|
462
|
-
}
|
|
379
|
+
{navItems.map((item) => {
|
|
380
|
+
const isActive =
|
|
381
|
+
item.href === "/home"
|
|
382
|
+
? isCreateRoute
|
|
383
|
+
: item.href === "/library"
|
|
384
|
+
? location.pathname === "/library" ||
|
|
385
|
+
location.pathname.startsWith("/library/") ||
|
|
386
|
+
location.pathname.startsWith("/brand-kits/") ||
|
|
387
|
+
location.pathname.startsWith("/image/") ||
|
|
388
|
+
location.pathname.startsWith("/asset/")
|
|
389
|
+
: item.href === "/templates"
|
|
390
|
+
? location.pathname === "/templates" ||
|
|
391
|
+
location.pathname.startsWith("/templates/")
|
|
392
|
+
: location.pathname.startsWith(item.href);
|
|
393
|
+
|
|
394
|
+
return (
|
|
395
|
+
<div key={item.href}>
|
|
396
|
+
<AppSidebarNavItem
|
|
397
|
+
to={item.href}
|
|
398
|
+
label={t(item.labelKey)}
|
|
399
|
+
icon={item.icon}
|
|
400
|
+
active={isActive}
|
|
401
|
+
onClick={(event) => {
|
|
402
|
+
if (
|
|
403
|
+
item.href === "/home" &&
|
|
404
|
+
!event.metaKey &&
|
|
405
|
+
!event.ctrlKey &&
|
|
406
|
+
!event.shiftKey &&
|
|
407
|
+
!event.altKey
|
|
408
|
+
) {
|
|
409
|
+
event.preventDefault();
|
|
410
|
+
focusAgentChat();
|
|
411
|
+
if (!isCreateRoute || location.pathname !== "/home") {
|
|
412
|
+
navigateWithAgentChatViewTransition(navigate, "/home");
|
|
463
413
|
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
{!collapsed && t(item.labelKey)}
|
|
475
|
-
</Link>
|
|
476
|
-
);
|
|
477
|
-
if (collapsed) {
|
|
478
|
-
return (
|
|
479
|
-
<Tooltip key={item.href} delayDuration={0}>
|
|
480
|
-
<TooltipTrigger asChild>{link}</TooltipTrigger>
|
|
481
|
-
<TooltipContent side="right">
|
|
482
|
-
{t(item.labelKey)}
|
|
483
|
-
</TooltipContent>
|
|
484
|
-
</Tooltip>
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
return (
|
|
488
|
-
<div key={item.href}>
|
|
489
|
-
{link}
|
|
490
|
-
{item.href === "/home" ? (
|
|
491
|
-
<AssetsChatsSection open={isCreateRoute} />
|
|
492
|
-
) : null}
|
|
493
|
-
</div>
|
|
494
|
-
);
|
|
495
|
-
})}
|
|
496
|
-
</nav>
|
|
497
|
-
|
|
498
|
-
<div className="mt-auto shrink-0">
|
|
499
|
-
<nav
|
|
500
|
-
className={cn(
|
|
501
|
-
"grid gap-1",
|
|
502
|
-
collapsed ? "justify-items-center px-1.5 py-1" : "px-2 py-1",
|
|
503
|
-
)}
|
|
504
|
-
>
|
|
505
|
-
{bottomNavItems.map((item) => {
|
|
506
|
-
const Icon = item.icon;
|
|
507
|
-
const isActive = location.pathname.startsWith(item.href);
|
|
508
|
-
const link = (
|
|
509
|
-
<Link
|
|
510
|
-
to={item.href}
|
|
511
|
-
className={cn(
|
|
512
|
-
"flex items-center rounded-lg text-sm",
|
|
513
|
-
collapsed ? "h-9 w-9 justify-center" : "gap-3 px-3 py-2",
|
|
514
|
-
isActive
|
|
515
|
-
? "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
516
|
-
: "text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground",
|
|
517
|
-
)}
|
|
518
|
-
aria-label={collapsed ? t(item.labelKey) : undefined}
|
|
519
|
-
>
|
|
520
|
-
<Icon className="h-4 w-4 shrink-0" />
|
|
521
|
-
{!collapsed && t(item.labelKey)}
|
|
522
|
-
</Link>
|
|
523
|
-
);
|
|
524
|
-
return collapsed ? (
|
|
525
|
-
<Tooltip key={item.href} delayDuration={0}>
|
|
526
|
-
<TooltipTrigger asChild>{link}</TooltipTrigger>
|
|
527
|
-
<TooltipContent side="right">
|
|
528
|
-
{t(item.labelKey)}
|
|
529
|
-
</TooltipContent>
|
|
530
|
-
</Tooltip>
|
|
531
|
-
) : (
|
|
532
|
-
<div key={item.href}>{link}</div>
|
|
533
|
-
);
|
|
534
|
-
})}
|
|
535
|
-
</nav>
|
|
536
|
-
|
|
537
|
-
{!collapsed && (
|
|
538
|
-
<div className="px-3 py-2 empty:hidden">
|
|
539
|
-
<OrgSwitcher />
|
|
540
|
-
</div>
|
|
541
|
-
)}
|
|
542
|
-
|
|
543
|
-
{!collapsed && (
|
|
544
|
-
<div className="px-3 py-2 empty:hidden">
|
|
545
|
-
<DevDatabaseLink />
|
|
546
|
-
</div>
|
|
547
|
-
)}
|
|
548
|
-
</div>
|
|
549
|
-
</div>
|
|
550
|
-
<SidebarFooterActions
|
|
551
|
-
collapsed={collapsed}
|
|
552
|
-
feedback={feedbackButton}
|
|
553
|
-
search={searchButton}
|
|
554
|
-
collapse={collapseButton}
|
|
555
|
-
/>
|
|
556
|
-
</aside>
|
|
414
|
+
}
|
|
415
|
+
}}
|
|
416
|
+
/>
|
|
417
|
+
{!collapsed && item.href === "/home" ? (
|
|
418
|
+
<AssetsChatsSection open={isCreateRoute} />
|
|
419
|
+
) : null}
|
|
420
|
+
</div>
|
|
421
|
+
);
|
|
422
|
+
})}
|
|
423
|
+
</AppSidebar>
|
|
557
424
|
);
|
|
558
425
|
}
|