diff --git a/src/app/edit/layout.tsx b/src/app/edit/layout.tsx index 9817fbf..7e6604a 100644 --- a/src/app/edit/layout.tsx +++ b/src/app/edit/layout.tsx @@ -23,7 +23,7 @@ import { useSplitStore, } from '@/store/editorStore'; import { useDragIconStore } from '@/store/dragIconStore'; -import { addNewModel } from '@/components/editor/utils'; +import { addNewModel } from '@/utils'; const MockUserInfo = { name: 'xiaoming', diff --git a/src/components/avatarPopover/index.tsx b/src/components/avatarPopover/index.tsx index 83f46d4..ffaa1cf 100644 --- a/src/components/avatarPopover/index.tsx +++ b/src/components/avatarPopover/index.tsx @@ -10,8 +10,8 @@ import { AiOutlinePoweroff, } from 'react-icons/ai'; -import { Avatar } from '../common/Avatar'; -import { Menu, MenuItem } from './menu/index'; +import { Avatar } from '@/components/common/Avatar'; +import { Menu, MenuItem } from '@/components/avatarPopover/menu'; const AvatarPopoverContent: FC = () => { const menuItemTwStyle = `flex items-center`; @@ -54,9 +54,9 @@ const AvatarPopoverContent: FC = () => { const AvatarPopover: FC<{ children: ReactNode }> = ({ children }) => { const twAnimation = ` - data-[state=open]:data-[side=top]:animate-slideDownAndFade - data-[state=open]:data-[side=right]:animate-slideLeftAndFade - data-[state=open]:data-[side=bottom]:animate-slideUpAndFade + data-[state=open]:data-[side=top]:animate-slideDownAndFade + data-[state=open]:data-[side=right]:animate-slideLeftAndFade + data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade `; const twShadow = ` @@ -70,7 +70,7 @@ const AvatarPopover: FC<{ children: ReactNode }> = ({ children }) => { {children} diff --git a/src/components/extension/tree-view-api/index.tsx b/src/components/extension/tree-view-api/index.tsx index f075791..ef82a55 100644 --- a/src/components/extension/tree-view-api/index.tsx +++ b/src/components/extension/tree-view-api/index.tsx @@ -15,7 +15,7 @@ import { RiDeleteBin6Line } from 'react-icons/ri'; import { Button } from '@/components/ui/button'; import { ScrollArea } from '@/components/ui/scroll-area'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; import { useUploadFileDataStore } from '@/store/uploadFileDataStore'; type TreeViewElement = { diff --git a/src/components/file/fileItem/index.tsx b/src/components/file/fileItem/index.tsx index f204f6c..7c8db80 100644 --- a/src/components/file/fileItem/index.tsx +++ b/src/components/file/fileItem/index.tsx @@ -13,7 +13,7 @@ import { } from '@/store/editorStore'; import { useDragIconStore } from '@/store/dragIconStore'; import { useUploadFileDataStore } from '@/store/uploadFileDataStore'; -import { addNewModel } from '@/components/editor/utils'; +import { addNewModel } from '@/utils'; interface FileItemProps { file: any; onMouseupFn?: () => void; diff --git a/src/components/modals/create-project-modal/index.tsx b/src/components/modals/create-project-modal/index.tsx index 9c46070..9aed7de 100644 --- a/src/components/modals/create-project-modal/index.tsx +++ b/src/components/modals/create-project-modal/index.tsx @@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation'; import { AiOutlineLoading3Quarters } from 'react-icons/ai'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; -import { getDirectory } from '@/utils/getLocalDirectory'; +import { getDirectory } from '@/utils'; import { useModal } from '@/hooks/useModal'; import { useUploadFileDataStore } from '@/store/uploadFileDataStore'; diff --git a/src/components/resize-handle/index.tsx b/src/components/resize-handle/index.tsx index 435a381..2073fe4 100644 --- a/src/components/resize-handle/index.tsx +++ b/src/components/resize-handle/index.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react'; import { PanelResizeHandle } from 'react-resizable-panels'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; interface ResizeHandleType { direction?: 'vertical' | 'horizontal'; diff --git a/src/components/ui/avatar/index.tsx b/src/components/ui/avatar/index.tsx index db83d3b..af95255 100644 --- a/src/components/ui/avatar/index.tsx +++ b/src/components/ui/avatar/index.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as AvatarPrimitive from '@radix-ui/react-avatar'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; type AvatarProps = React.ComponentPropsWithoutRef; type AvatarImageProps = React.ComponentPropsWithoutRef; diff --git a/src/components/ui/badge/index.tsx b/src/components/ui/badge/index.tsx index 357710e..1c25185 100644 --- a/src/components/ui/badge/index.tsx +++ b/src/components/ui/badge/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; const badgeVariants = cva( 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index f008c43..88af196 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.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 '@/utils/cn'; +import { cn } from '@/utils'; const buttonVariants = cva( 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', diff --git a/src/components/ui/dialog/index.tsx b/src/components/ui/dialog/index.tsx index 12fc6f9..55e9f42 100644 --- a/src/components/ui/dialog/index.tsx +++ b/src/components/ui/dialog/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { Cross2Icon } from '@radix-ui/react-icons'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; const Dialog = DialogPrimitive.Root; const DialogTrigger = DialogPrimitive.Trigger; diff --git a/src/components/ui/dropdown-menu/index.tsx b/src/components/ui/dropdown-menu/index.tsx index 4d0c7a6..42430af 100644 --- a/src/components/ui/dropdown-menu/index.tsx +++ b/src/components/ui/dropdown-menu/index.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 '@/utils/cn'; +import { cn } from '@/utils'; const DropdownMenu = DropdownMenuPrimitive.Root; const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger; diff --git a/src/components/ui/input/index.tsx b/src/components/ui/input/index.tsx index a61b59c..7e8d853 100644 --- a/src/components/ui/input/index.tsx +++ b/src/components/ui/input/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; export interface InputProps extends React.InputHTMLAttributes {} diff --git a/src/components/ui/scroll-area/index.tsx b/src/components/ui/scroll-area/index.tsx index 9a36011..b682af9 100644 --- a/src/components/ui/scroll-area/index.tsx +++ b/src/components/ui/scroll-area/index.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'; -import { cn } from '@/utils/cn'; +import { cn } from '@/utils'; const ScrollArea = React.forwardRef< React.ElementRef, diff --git a/src/components/editor/utils.ts b/src/utils/editor.ts similarity index 100% rename from src/components/editor/utils.ts rename to src/utils/editor.ts diff --git a/src/utils/index.ts b/src/utils/index.ts index af78bd6..e3159d7 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,2 +1,4 @@ export * from './cn'; export * from './constants'; +export * from './editor'; +export * from './getLocalDirectory';