@exegia/corpora-ui 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/blocks/layout.d.ts +5 -0
- package/dist-lib/components/{agents → blocks/nav/sidebar}/ai-sidebar.d.ts +1 -1
- package/dist-lib/components/{agents → blocks/nav/sidebar}/index.d.ts +1 -0
- package/dist-lib/components/{agents → blocks/nav/sidebar}/sidebar-row.d.ts +1 -1
- package/dist-lib/components/blocks/shell/index.d.ts +4 -1
- package/dist-lib/components/blocks/shell/type.d.ts +1 -0
- package/dist-lib/index.d.ts +4 -1
- package/dist-lib/index.js +1363 -644
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/blocks/layout.ts +7 -0
- package/src/components/{agents → blocks/nav/sidebar}/ai-sidebar.tsx +13 -17
- package/src/components/{agents → blocks/nav/sidebar}/index.ts +2 -1
- package/src/components/{agents → blocks/nav/sidebar}/marquee-label.tsx +1 -1
- package/src/components/{agents → blocks/nav/sidebar}/sidebar-icon.tsx +1 -1
- package/src/components/{agents → blocks/nav/sidebar}/sidebar-row.tsx +4 -4
- package/src/components/{agents → blocks/nav/sidebar}/use-ai-sidebar.ts +2 -2
- package/src/components/{agents → blocks/nav/sidebar}/utils.ts +1 -1
- package/src/components/blocks/shell/index.ts +6 -1
- package/src/components/blocks/shell/type.ts +2 -22
- package/src/index.ts +4 -1
- /package/dist-lib/components/{agents → blocks/nav/sidebar}/__tests__/ai-sidebar.test.d.ts +0 -0
- /package/dist-lib/components/{agents → blocks/nav/sidebar}/marquee-label.d.ts +0 -0
- /package/dist-lib/components/{agents → blocks/nav/sidebar}/sidebar-icon.d.ts +0 -0
- /package/dist-lib/components/{agents → blocks/nav/sidebar}/type.d.ts +0 -0
- /package/dist-lib/components/{agents → blocks/nav/sidebar}/use-ai-sidebar.d.ts +0 -0
- /package/dist-lib/components/{agents → blocks/nav/sidebar}/utils.d.ts +0 -0
- /package/src/components/{agents → blocks/nav/sidebar}/__tests__/ai-sidebar.test.tsx +0 -0
- /package/src/components/{agents → blocks/nav/sidebar}/type.ts +0 -0
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { AnimatePresence } from "motion/react";
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
|
-
import type { AISidebarProps } from "
|
|
6
|
-
import { useAISidebar } from "
|
|
7
|
-
import { ResourceRow } from "
|
|
5
|
+
import type { AISidebarProps, FlatResource } from "./type"
|
|
6
|
+
import { useAISidebar, type UseAISidebarOptions } from "./use-ai-sidebar"
|
|
7
|
+
import { ResourceRow } from "./sidebar-row"
|
|
8
8
|
|
|
9
9
|
export function AISidebar({
|
|
10
10
|
renderIcon,
|
|
@@ -41,7 +41,7 @@ export function AISidebar({
|
|
|
41
41
|
commitRename,
|
|
42
42
|
handleMenuOpenChange,
|
|
43
43
|
setRowRef,
|
|
44
|
-
} = useAISidebar(options);
|
|
44
|
+
} = useAISidebar(options as UseAISidebarOptions);
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<>
|
|
@@ -53,13 +53,13 @@ export function AISidebar({
|
|
|
53
53
|
onDrop={handleDrop}
|
|
54
54
|
onMouseLeave={clearHover}
|
|
55
55
|
className={cn(
|
|
56
|
-
"relative
|
|
57
|
-
draggingId && "select-none
|
|
58
|
-
className
|
|
56
|
+
"relative min-w-0 flex-col gap-0.5 [overflow-anchor:none] group-data-[state=collapsed]/sidebar:hidden",
|
|
57
|
+
draggingId && "pb-9 select-none",
|
|
58
|
+
className
|
|
59
59
|
)}
|
|
60
60
|
>
|
|
61
61
|
<AnimatePresence initial={false}>
|
|
62
|
-
{flat.map((row) => (
|
|
62
|
+
{flat.map((row: FlatResource) => (
|
|
63
63
|
<ResourceRow
|
|
64
64
|
key={row.item.id}
|
|
65
65
|
row={row}
|
|
@@ -72,14 +72,10 @@ export function AISidebar({
|
|
|
72
72
|
renaming={renamingId === row.item.id}
|
|
73
73
|
hoverActive={hoveredId !== null && !draggingId}
|
|
74
74
|
hoverPill={
|
|
75
|
-
hoveredId === row.item.id &&
|
|
76
|
-
!draggingId &&
|
|
77
|
-
!row.item.disabled
|
|
75
|
+
hoveredId === row.item.id && !draggingId && !row.item.disabled
|
|
78
76
|
}
|
|
79
77
|
hoverLayoutId={hoverLayoutId}
|
|
80
|
-
onHoverChange={(hovered) =>
|
|
81
|
-
handleRowHover(row.item.id, hovered)
|
|
82
|
-
}
|
|
78
|
+
onHoverChange={(hovered) => handleRowHover(row.item.id, hovered)}
|
|
83
79
|
onFocus={() => setFocusedId(row.item.id)}
|
|
84
80
|
onSelect={() => select(row.item.id)}
|
|
85
81
|
onToggle={() => toggle(row.item.id)}
|
|
@@ -100,7 +96,7 @@ export function AISidebar({
|
|
|
100
96
|
))}
|
|
101
97
|
</AnimatePresence>
|
|
102
98
|
|
|
103
|
-
{draggingId
|
|
99
|
+
{draggingId && (
|
|
104
100
|
<div
|
|
105
101
|
aria-hidden="true"
|
|
106
102
|
data-active={dropTarget?.id === null || undefined}
|
|
@@ -108,11 +104,11 @@ export function AISidebar({
|
|
|
108
104
|
>
|
|
109
105
|
Move to top level
|
|
110
106
|
</div>
|
|
111
|
-
)
|
|
107
|
+
)}
|
|
112
108
|
</div>
|
|
113
109
|
<span className="sr-only" aria-live="polite">
|
|
114
110
|
{announcement}
|
|
115
111
|
</span>
|
|
116
112
|
</>
|
|
117
|
-
)
|
|
113
|
+
)
|
|
118
114
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { AISidebar } from "./ai-sidebar"
|
|
3
2
|
import { MarqueeLabel } from "./marquee-label.tsx"
|
|
4
3
|
import { ResourceRow } from "./sidebar-row.tsx"
|
|
@@ -6,6 +5,8 @@ import { SidebarIcon } from "./sidebar-icon.tsx"
|
|
|
6
5
|
export { useAISidebar, type UseAISidebarOptions } from "./use-ai-sidebar.ts"
|
|
7
6
|
export type * from "./type.ts"
|
|
8
7
|
|
|
8
|
+
export { AISidebar, MarqueeLabel, ResourceRow, SidebarIcon }
|
|
9
|
+
|
|
9
10
|
export const Sidebar = {
|
|
10
11
|
Wrapper: AISidebar,
|
|
11
12
|
MarqueeLabel,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useState,
|
|
6
6
|
type MouseEvent,
|
|
7
7
|
} from "react"
|
|
8
|
-
import type { ResourceRowProps } from "
|
|
8
|
+
import type { ResourceRowProps } from "./type"
|
|
9
9
|
import {
|
|
10
10
|
AnimatePresence,
|
|
11
11
|
motion,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
import { ChevronRight, MoreHorizontal, Pencil } from "lucide-react"
|
|
16
16
|
import { SPRING_LAYOUT } from "@/lib/ease.ts"
|
|
17
17
|
import { cn } from "@/lib/utils.ts"
|
|
18
|
-
import { canContain } from "
|
|
19
|
-
import { SidebarIcon } from "
|
|
20
|
-
import { MarqueeLabel } from "
|
|
18
|
+
import { canContain } from "./utils"
|
|
19
|
+
import { SidebarIcon } from "./sidebar-icon"
|
|
20
|
+
import { MarqueeLabel } from "./marquee-label"
|
|
21
21
|
import {
|
|
22
22
|
MorphPopover,
|
|
23
23
|
MorphPopoverContent,
|
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
FlatResource,
|
|
17
17
|
SidebarResource,
|
|
18
18
|
SidebarResourceMove,
|
|
19
|
-
} from "
|
|
19
|
+
} from "./type.ts"
|
|
20
20
|
import {
|
|
21
21
|
canContain,
|
|
22
22
|
containsResource,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
flattenResources,
|
|
25
25
|
moveResource,
|
|
26
26
|
renameResource,
|
|
27
|
-
} from "
|
|
27
|
+
} from "./utils.ts"
|
|
28
28
|
|
|
29
29
|
export type UseAISidebarOptions = Pick<
|
|
30
30
|
AISidebarProps,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EASE_OUT } from "@/lib/ease.ts"
|
|
2
|
-
import type { FlatResource, SidebarResource, SidebarResourceDropPosition, SidebarResourceMove } from "
|
|
2
|
+
import type { FlatResource, SidebarResource, SidebarResourceDropPosition, SidebarResourceMove } from "./type.ts"
|
|
3
3
|
|
|
4
4
|
export const ROW_REVEAL = {
|
|
5
5
|
duration: 0.16,
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// ISidebarNavItem,
|
|
3
|
-
// ISidebarNavSection,
|
|
4
|
-
// ISidebarNavSubItem,
|
|
5
|
-
// } from "@/components/blocks/nav/types"
|
|
6
|
-
|
|
1
|
+
import React from "react"
|
|
7
2
|
|
|
8
3
|
export interface ShellAction {
|
|
9
4
|
id: string
|
|
@@ -21,16 +16,6 @@ export interface ShellWorkspace {
|
|
|
21
16
|
|
|
22
17
|
export interface ShellLayoutProps {
|
|
23
18
|
children?: React.ReactNode
|
|
24
|
-
// sections?: ISidebarNavSection[]
|
|
25
|
-
//activeId?: string
|
|
26
|
-
// onNavigate?: (item: ISidebarNavItem | ISidebarNavSubItem) => void
|
|
27
|
-
// workspace?: ShellWorkspace
|
|
28
|
-
//sidebarFooter?: React.ReactNode
|
|
29
|
-
// topActions?: ShellAction[]
|
|
30
|
-
//title?: React.ReactNode
|
|
31
|
-
//eyebrow?: React.ReactNode
|
|
32
|
-
//searchPlaceholder?: string
|
|
33
|
-
//searchShortcut?: React.ReactNode
|
|
34
19
|
open?: boolean
|
|
35
20
|
defaultOpen?: boolean
|
|
36
21
|
onOpenChange?: (open: boolean) => void
|
|
@@ -40,11 +25,6 @@ export interface ShellLayoutProps {
|
|
|
40
25
|
rightOpen?: boolean
|
|
41
26
|
defaultRightOpen?: boolean
|
|
42
27
|
onRightOpenChange?: (open: boolean) => void
|
|
43
|
-
// openMobile?: boolean
|
|
44
|
-
//defaultOpenMobile?: boolean
|
|
45
|
-
//onOpenMobileChange?: (open: boolean) => void
|
|
46
28
|
className?: string
|
|
47
|
-
|
|
48
|
-
//sidebarClassName?: string
|
|
49
|
-
//contentClassName?: string
|
|
29
|
+
variant: 'web' | 'desktop'
|
|
50
30
|
}
|
package/src/index.ts
CHANGED
|
@@ -40,7 +40,10 @@ export * from "./components/blocks/auth/passkey-sign-in-block"
|
|
|
40
40
|
export * from "./components/blocks/auth/signup-block"
|
|
41
41
|
export * from "./components/blocks/auth/update-password-block"
|
|
42
42
|
export * from "./components/blocks/nav/sidebar-block"
|
|
43
|
-
export * from "./components/blocks/
|
|
43
|
+
export * from "./components/blocks/nav/sidebar"
|
|
44
|
+
export * from "./components/blocks/shell"
|
|
45
|
+
export { default as ShellLayout } from "./components/blocks/shell"
|
|
46
|
+
export { default as Layout } from "./components/blocks/layout"
|
|
44
47
|
export * from "./components/blocks/profile/profile-card-block"
|
|
45
48
|
|
|
46
49
|
// motion primitives
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|