diff --git a/apps/readest-app/components.json b/apps/readest-app/components.json index 6ddc6beb..be276bba 100644 --- a/apps/readest-app/components.json +++ b/apps/readest-app/components.json @@ -13,9 +13,9 @@ "iconLibrary": "lucide", "aliases": { "components": "@/components", - "utils": "@/lib/utils", + "utils": "@/utils", "ui": "@/components/ui", - "lib": "@/lib", + "lib": "@/libs", "hooks": "@/hooks" }, "registries": {} diff --git a/apps/readest-app/src/app/reader/components/sidebar/AIAssistant.tsx b/apps/readest-app/src/app/reader/components/notebook/AIAssistant.tsx similarity index 99% rename from apps/readest-app/src/app/reader/components/sidebar/AIAssistant.tsx rename to apps/readest-app/src/app/reader/components/notebook/AIAssistant.tsx index 4df402eb..95265d18 100644 --- a/apps/readest-app/src/app/reader/components/sidebar/AIAssistant.tsx +++ b/apps/readest-app/src/app/reader/components/notebook/AIAssistant.tsx @@ -26,9 +26,9 @@ import { import type { EmbeddingProgress, AISettings, AIMessage } from '@/services/ai/types'; import { useEnv } from '@/context/EnvContext'; -import { Thread } from '@/components/assistant-ui/thread'; import { Button } from '@/components/ui/button'; import { Loader2Icon, BookOpenIcon } from 'lucide-react'; +import { Thread } from '@/components/assistant/Thread'; // Helper function to convert AIMessage array to ExportedMessageRepository format // Each message needs to be wrapped with { message, parentId } structure diff --git a/apps/readest-app/src/app/reader/components/notebook/Notebook.tsx b/apps/readest-app/src/app/reader/components/notebook/Notebook.tsx index 7b5b6d05..7f9dd2a7 100644 --- a/apps/readest-app/src/app/reader/components/notebook/Notebook.tsx +++ b/apps/readest-app/src/app/reader/components/notebook/Notebook.tsx @@ -21,7 +21,7 @@ import { saveSysSettings } from '@/helpers/settings'; import { NOTE_PREFIX } from '@/types/view'; import useShortcuts from '@/hooks/useShortcuts'; import BooknoteItem from '../sidebar/BooknoteItem'; -import AIAssistant from '../sidebar/AIAssistant'; +import AIAssistant from './AIAssistant'; import NotebookHeader from './Header'; import NoteEditor from './NoteEditor'; import SearchBar from './SearchBar'; diff --git a/apps/readest-app/src/components/assistant-ui/markdown-text.tsx b/apps/readest-app/src/components/assistant/MarkdownText.tsx similarity index 97% rename from apps/readest-app/src/components/assistant-ui/markdown-text.tsx rename to apps/readest-app/src/components/assistant/MarkdownText.tsx index 3551f8bc..e8fad978 100644 --- a/apps/readest-app/src/components/assistant-ui/markdown-text.tsx +++ b/apps/readest-app/src/components/assistant/MarkdownText.tsx @@ -12,8 +12,8 @@ import remarkGfm from 'remark-gfm'; import { type FC, memo, useState } from 'react'; import { CheckIcon, CopyIcon } from 'lucide-react'; -import { TooltipIconButton } from '@/components/assistant-ui/tooltip-icon-button'; -import { cn } from '@/lib/utils'; +import { TooltipIconButton } from './TooltipIconButton'; +import { cn } from '@/utils/tailwind'; const MarkdownTextImpl = () => { return ( diff --git a/apps/readest-app/src/components/assistant-ui/thread.tsx b/apps/readest-app/src/components/assistant/Thread.tsx similarity index 99% rename from apps/readest-app/src/components/assistant-ui/thread.tsx rename to apps/readest-app/src/components/assistant/Thread.tsx index 49f35b4d..0e8e2ea0 100644 --- a/apps/readest-app/src/components/assistant-ui/thread.tsx +++ b/apps/readest-app/src/components/assistant/Thread.tsx @@ -26,14 +26,14 @@ import { Trash2Icon, } from 'lucide-react'; -import { MarkdownText } from '@/components/assistant-ui/markdown-text'; +import { MarkdownText } from './MarkdownText'; import { Button } from '@/components/ui/button'; import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; import type { ScoredChunk } from '@/services/ai/types'; interface ThreadProps { diff --git a/apps/readest-app/src/components/assistant-ui/tooltip-icon-button.tsx b/apps/readest-app/src/components/assistant/TooltipIconButton.tsx similarity index 96% rename from apps/readest-app/src/components/assistant-ui/tooltip-icon-button.tsx rename to apps/readest-app/src/components/assistant/TooltipIconButton.tsx index 4442f169..1c696a92 100644 --- a/apps/readest-app/src/components/assistant-ui/tooltip-icon-button.tsx +++ b/apps/readest-app/src/components/assistant/TooltipIconButton.tsx @@ -4,7 +4,7 @@ import { forwardRef, type ComponentPropsWithRef } from 'react'; import { Slottable } from '@radix-ui/react-slot'; import { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from '@/components/ui/tooltip'; import { Button } from '@/components/ui/button'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; export type TooltipIconButtonProps = ComponentPropsWithRef & { tooltip: string; diff --git a/apps/readest-app/src/components/ui/button-group.tsx b/apps/readest-app/src/components/primitives/button-group.tsx similarity index 98% rename from apps/readest-app/src/components/ui/button-group.tsx rename to apps/readest-app/src/components/primitives/button-group.tsx index 25330e5d..ffac9107 100644 --- a/apps/readest-app/src/components/ui/button-group.tsx +++ b/apps/readest-app/src/components/primitives/button-group.tsx @@ -1,7 +1,7 @@ import { Slot } from '@radix-ui/react-slot'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; import { Separator } from '@/components/ui/separator'; const buttonGroupVariants = cva( diff --git a/apps/readest-app/src/components/ui/button.tsx b/apps/readest-app/src/components/primitives/button.tsx similarity index 97% rename from apps/readest-app/src/components/ui/button.tsx rename to apps/readest-app/src/components/primitives/button.tsx index 815935ec..fc744165 100644 --- a/apps/readest-app/src/components/ui/button.tsx +++ b/apps/readest-app/src/components/primitives/button.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { Slot } from '@radix-ui/react-slot'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const buttonVariants = cva( 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', diff --git a/apps/readest-app/src/components/ui/collapsible.tsx b/apps/readest-app/src/components/primitives/collapsible.tsx similarity index 100% rename from apps/readest-app/src/components/ui/collapsible.tsx rename to apps/readest-app/src/components/primitives/collapsible.tsx diff --git a/apps/readest-app/src/components/ui/command.tsx b/apps/readest-app/src/components/primitives/command.tsx similarity index 99% rename from apps/readest-app/src/components/ui/command.tsx rename to apps/readest-app/src/components/primitives/command.tsx index 3bfc4dd1..a9a4f14b 100644 --- a/apps/readest-app/src/components/ui/command.tsx +++ b/apps/readest-app/src/components/primitives/command.tsx @@ -5,7 +5,7 @@ import { type DialogProps } from '@radix-ui/react-dialog'; import { Command as CommandPrimitive } from 'cmdk'; import { Search } from 'lucide-react'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; import { Dialog, DialogContent } from '@/components/ui/dialog'; const Command = React.forwardRef< diff --git a/apps/readest-app/src/components/ui/dialog.tsx b/apps/readest-app/src/components/primitives/dialog.tsx similarity index 98% rename from apps/readest-app/src/components/ui/dialog.tsx rename to apps/readest-app/src/components/primitives/dialog.tsx index cb77ffed..25bc17c3 100644 --- a/apps/readest-app/src/components/ui/dialog.tsx +++ b/apps/readest-app/src/components/primitives/dialog.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { X } from 'lucide-react'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const Dialog = DialogPrimitive.Root; diff --git a/apps/readest-app/src/components/ui/dropdown-menu.tsx b/apps/readest-app/src/components/primitives/dropdown-menu.tsx similarity index 99% rename from apps/readest-app/src/components/ui/dropdown-menu.tsx rename to apps/readest-app/src/components/primitives/dropdown-menu.tsx index fda4c4e8..e9abc531 100644 --- a/apps/readest-app/src/components/ui/dropdown-menu.tsx +++ b/apps/readest-app/src/components/primitives/dropdown-menu.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'; import { Check, ChevronRight, Circle } from 'lucide-react'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const DropdownMenu = DropdownMenuPrimitive.Root; diff --git a/apps/readest-app/src/components/ui/hover-card.tsx b/apps/readest-app/src/components/primitives/hover-card.tsx similarity index 96% rename from apps/readest-app/src/components/ui/hover-card.tsx rename to apps/readest-app/src/components/primitives/hover-card.tsx index 066205f3..9a054b07 100644 --- a/apps/readest-app/src/components/ui/hover-card.tsx +++ b/apps/readest-app/src/components/primitives/hover-card.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as HoverCardPrimitive from '@radix-ui/react-hover-card'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const HoverCard = HoverCardPrimitive.Root; diff --git a/apps/readest-app/src/components/ui/input-group.tsx b/apps/readest-app/src/components/primitives/input-group.tsx similarity index 99% rename from apps/readest-app/src/components/ui/input-group.tsx rename to apps/readest-app/src/components/primitives/input-group.tsx index d929c46a..e33fa293 100644 --- a/apps/readest-app/src/components/ui/input-group.tsx +++ b/apps/readest-app/src/components/primitives/input-group.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Textarea } from '@/components/ui/textarea'; diff --git a/apps/readest-app/src/components/ui/input.tsx b/apps/readest-app/src/components/primitives/input.tsx similarity index 95% rename from apps/readest-app/src/components/ui/input.tsx rename to apps/readest-app/src/components/primitives/input.tsx index b14be7d5..ead7eb5c 100644 --- a/apps/readest-app/src/components/ui/input.tsx +++ b/apps/readest-app/src/components/primitives/input.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const Input = React.forwardRef>( ({ className, type, ...props }, ref) => { diff --git a/apps/readest-app/src/components/ui/select.tsx b/apps/readest-app/src/components/primitives/select.tsx similarity index 99% rename from apps/readest-app/src/components/ui/select.tsx rename to apps/readest-app/src/components/primitives/select.tsx index d9ef705e..30aba04e 100644 --- a/apps/readest-app/src/components/ui/select.tsx +++ b/apps/readest-app/src/components/primitives/select.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as SelectPrimitive from '@radix-ui/react-select'; import { Check, ChevronDown, ChevronUp } from 'lucide-react'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const Select = SelectPrimitive.Root; diff --git a/apps/readest-app/src/components/ui/separator.tsx b/apps/readest-app/src/components/primitives/separator.tsx similarity index 94% rename from apps/readest-app/src/components/ui/separator.tsx rename to apps/readest-app/src/components/primitives/separator.tsx index 97d71cfe..9f4face0 100644 --- a/apps/readest-app/src/components/ui/separator.tsx +++ b/apps/readest-app/src/components/primitives/separator.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as SeparatorPrimitive from '@radix-ui/react-separator'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const Separator = React.forwardRef< React.ElementRef, diff --git a/apps/readest-app/src/components/ui/textarea.tsx b/apps/readest-app/src/components/primitives/textarea.tsx similarity index 94% rename from apps/readest-app/src/components/ui/textarea.tsx rename to apps/readest-app/src/components/primitives/textarea.tsx index 4f28d2a0..546f6003 100644 --- a/apps/readest-app/src/components/ui/textarea.tsx +++ b/apps/readest-app/src/components/primitives/textarea.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const Textarea = React.forwardRef>( ({ className, ...props }, ref) => { diff --git a/apps/readest-app/src/components/ui/tooltip.tsx b/apps/readest-app/src/components/primitives/tooltip.tsx similarity index 97% rename from apps/readest-app/src/components/ui/tooltip.tsx rename to apps/readest-app/src/components/primitives/tooltip.tsx index fec90205..c4893c42 100644 --- a/apps/readest-app/src/components/ui/tooltip.tsx +++ b/apps/readest-app/src/components/primitives/tooltip.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as TooltipPrimitive from '@radix-ui/react-tooltip'; -import { cn } from '@/lib/utils'; +import { cn } from '@/utils/tailwind'; const TooltipProvider = ({ children, diff --git a/apps/readest-app/src/lib/utils.ts b/apps/readest-app/src/utils/tailwind.ts similarity index 100% rename from apps/readest-app/src/lib/utils.ts rename to apps/readest-app/src/utils/tailwind.ts diff --git a/apps/readest-app/tsconfig.json b/apps/readest-app/tsconfig.json index aee1067d..956653ff 100644 --- a/apps/readest-app/tsconfig.json +++ b/apps/readest-app/tsconfig.json @@ -21,6 +21,7 @@ ], "paths": { "@/*": ["./src/*"], + "@/components/ui/*": ["./src/components/primitives/*"], "@pdfjs/*": ["./public/vendor/pdfjs/*"], "@simplecc/*": ["./public/vendor/simplecc/*"] }