Commit 90d0c62f by HoMeTown

chore: 更新nextui to heroui

parent 941f8201
public-hoist-pattern[]=*@nextui-org/*
public-hoist-pattern[]=*@heroui/*
......@@ -39,8 +39,7 @@
}
},
"dependencies": {
"@heroui/popover": "^2.3.10",
"@nextui-org/react": "^2.4.6",
"@heroui/react": "2.6.14",
"@reduxjs/toolkit": "^2.2.7",
"@rsbuild/plugin-image-compress": "^1.1.0",
"ahooks": "^3.8.0",
......
......@@ -107,7 +107,7 @@ export default defineConfig({
reactJoyride: '/node_modules[\\/].pnpm[\\/]react-joyride/',
reactMarkdown: '/node_modules[\\/]react-markdown/',
reactHotToast: '/node_modules[\\/]react-hot-toast/',
nextUi: /node_modules[\\/]@nextui-org/,
nextUi: /node_modules[\\/]@heroui/,
},
},
},
......
import React, { useEffect, useRef, useState } from 'react'
import { AnimatePresence, motion } from 'framer-motion'
import { Button, Tooltip } from '@nextui-org/react'
import { Button, Tooltip } from '@heroui/react'
import { useLocalStorageState, useToggle } from 'ahooks'
import { LoginModal } from '../LoginModal'
import type { RootState } from '@/store'
......
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, getKeyValue } from '@nextui-org/react'
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, getKeyValue } from '@heroui/react'
import React from 'react'
import { useAppDispatch, useAppSelector } from '@/store/hook'
import { deleteConversations } from '@/store/conversationSlice'
......
import React from 'react'
import { Button, Checkbox, Link, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from '@nextui-org/react'
import { Button, Checkbox, Link, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from '@heroui/react'
import { useNavigate } from 'react-router-dom'
import { useAuth } from '@/auth/AuthContext'
......
......@@ -4,7 +4,7 @@ import rehypeRaw from 'rehype-raw'
import rehypeSanitize from 'rehype-sanitize'
import remarkGfm from 'remark-gfm'
import { PhotoProvider, PhotoView } from 'react-photo-view'
import { Image } from '@nextui-org/react'
import { Image } from '@heroui/react'
interface MarkdownDetailProps {
children: ReactNode
......
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from '@nextui-org/react'
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from '@heroui/react'
import { useEffect, useState } from 'react'
import { fetchGetFeedbackConfig, fetchSubmitFeedback } from '@/api/chat'
import type { Answer } from '@/types/chat'
......@@ -48,6 +48,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
// getConfig()
}, [isOpen])
return (
(
<Modal backdrop="blur" size="2xl" isOpen={isOpen} onClose={onClose}>
<ModalContent>
{onClose => (
......@@ -57,6 +58,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
<div className="flex flex-wrap gap-[6px]">
{feedbackConfig && feedbackConfig.questionList[0].answerList.map((item: any, index: number) => (
// <div className="w-1/2" key={item.answerCode}>{item.answerName}</div>
(
<Button
key={item.answerCode}
color="primary"
......@@ -68,6 +70,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
<span>{item.answerName}</span>
</div>
</Button>
)
))}
{/* <Textarea
value={answerValue}
......@@ -91,4 +94,5 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
</ModalContent>
</Modal>
)
)
}
import type { NextUIPluginConfig } from '@nextui-org/react'
import type { NextUIPluginConfig } from '@heroui/react'
export const theme: NextUIPluginConfig = {
prefix: 'sdream',
......
import React from 'react'
import ReactDOM from 'react-dom/client'
import { NextUIProvider } from '@nextui-org/react'
import { HeroUIProvider } from '@heroui/react'
import App from './App'
import './styles/index.less'
import 'github-markdown-css/github-markdown.css'
......@@ -17,9 +17,9 @@ if (rootEl) {
const root = ReactDOM.createRoot(rootEl)
root.render(
<React.StrictMode>
<NextUIProvider className="h-full">
<HeroUIProvider className="h-full">
<App />
</NextUIProvider>
</HeroUIProvider>
</React.StrictMode>,
)
}
import { AnimatePresence, motion } from 'framer-motion'
import { Button, Input } from '@nextui-org/react'
import { Button, Input } from '@heroui/react'
import React, { useState } from 'react'
import { variants } from './motionAnimate'
import { HistoryBarList } from './components/HistoryBarList'
......
import { motion } from 'framer-motion'
import { Button } from '@nextui-org/react'
import { Button } from '@heroui/react'
import { useNavigate } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { useDebounceFn } from 'ahooks'
......
import React from 'react'
import { motion } from 'framer-motion'
import { Button, Tooltip } from '@nextui-org/react'
import { Button, Tooltip } from '@heroui/react'
import { useLocation, useNavigate } from 'react-router-dom'
import { NavBarDivider } from '../NavBarDivider'
import styles from './NavBarItem.module.less'
......
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Tooltip } from '@nextui-org/react'
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Tooltip } from '@heroui/react'
import { useNavigate } from 'react-router-dom'
import { useSessionStorageState, useTimeout } from 'ahooks'
import { useSessionStorageState } from 'ahooks'
import { useEffect, useState } from 'react'
import { withAuth } from '@/auth/withAuth'
import type { WithAuthProps } from '@/auth/withAuth'
......
import React, { useCallback, useEffect, useRef, useState } from 'react'
import { useParams } from 'react-router-dom'
import { Button } from '@nextui-org/react'
import { Button } from '@heroui/react'
import { motion } from 'framer-motion'
import { useScroll } from 'ahooks'
import { toast } from 'react-hot-toast'
......
import { Button, Link } from '@nextui-org/react'
import { Button, Link } from '@heroui/react'
import { motion } from 'framer-motion'
import type { Answer, Attachment } from '@/types/chat'
import AnswerProDetailIcon from '@/assets/svg/answerProDetail.svg?react'
......@@ -38,10 +38,12 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
}
}
return (
(
<div className="cardList flex flex-col gap-[20px]">
{answer.cardList && answer.cardList.map((attachment, index) => {
if (attachment?.type) {
return (
(
<div key={`${attachment.type}_${index}`}>
{/* 附件:product-detail */}
{attachment.type === 'product-detail' && (
......@@ -53,7 +55,6 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
</div>
</div>
)}
{/* 附件:引用文件 */}
{attachment.type === 'reference' && attachment.content.docList.length !== 0 && (
<div>
......@@ -72,7 +73,6 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
</div>
)}
{/* 附件:选择 box */}
{
attachment.type === 'box' && attachment.content.productList.length !== 0 && (
......@@ -83,6 +83,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
>
{attachment.content.productList.map(product => (
// <div key={product.productCode}>{product.productName}</div>
(
<motion.li
key={product.productCode}
>
......@@ -92,12 +93,12 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
</div>
</Button>
</motion.li>
)
))}
</ul>
</div>
)
}
{
attachment.type?.includes('card-') && (
<div onClick={() => handleClickCard(attachment)}>
......@@ -111,9 +112,11 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
}
</div>
)
)
}
return null
})}
</div>
)
)
}
import { Avatar, Button } from '@nextui-org/react'
import { Avatar, Button } from '@heroui/react'
import { useEffect, useState } from 'react'
import { ChatAnswerShower } from './ChatAnswerShower'
import { ChatAnswerParser } from './ChatAnswerParser'
......
import { Button, Tooltip } from '@nextui-org/react'
import { Button, Tooltip } from '@heroui/react'
import { useState } from 'react'
import { useDebounceFn } from 'ahooks'
import type { Answer } from '@/types/chat'
......
import React, { useEffect, useState } from 'react'
import { Chip } from '@nextui-org/react'
import { Chip } from '@heroui/react'
import { ChatAnswerAttachment } from './ChatAnswerAttchment'
import { ChatAnswerOperate } from './ChatAnswerOperate'
import { formatMarkdown } from './markdownFormatter'
......
import { useEffect, useState } from 'react'
import { Button, Skeleton } from '@nextui-org/react'
import { Button, Skeleton } from '@heroui/react'
import type { Answer } from '@/types/chat'
import { fetchQueryRecommendQuestion } from '@/api/chat'
import SendIcon from '@/assets/svg/sendBlack.svg?react'
......
import { Avatar } from '@nextui-org/react'
import { Avatar } from '@heroui/react'
import AvatarUser from '@/assets/avatarUser.png'
import type { ChatRecord } from '@/types/chat'
......
export const ChatMaxCount: React.FC = () => {
return (
<div>
<div className="flex items-center">
<p className="text-[14px] mr-[12px]">⚠️ 超过最大轮数上限!请您新建对话~</p>
</div>
</div>
)
}
import { Avatar } from '@nextui-org/react'
import { Avatar } from '@heroui/react'
import { motion } from 'framer-motion'
import AvatarBot from '@/assets/avatarBot.png'
......
import { useEffect, useState } from 'react'
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Tooltip } from '@nextui-org/react'
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Tooltip } from '@heroui/react'
import { motion } from 'framer-motion'
import { ChatMaskBar } from '../Chat/components/ChatMaskBar'
import { ChatSlogan } from '../Chat/components/ChatSlogan'
......
import { Button } from '@nextui-org/react'
import { Button } from '@heroui/react'
import type React from 'react'
import { Image } from '@nextui-org/image'
import { Image } from '@heroui/image'
import { motion } from 'framer-motion'
import { useCallback, useEffect, useState } from 'react'
import Refresh from '@/assets/svg/refresh.svg?react'
......
import { Button } from '@nextui-org/react'
import { Button } from '@heroui/react'
import type React from 'react'
import { motion, useAnimation } from 'framer-motion'
import { useEffect } from 'react'
......
......@@ -4,13 +4,13 @@ const {
default: flattenColorPalette,
} = require('tailwindcss/lib/util/flattenColorPalette')
const { nextui } = require ('@nextui-org/react')
const { heroui } = require ('@heroui/react')
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/**/*.{html,js,ts,jsx,tsx}',
'./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}',
'./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}',
],
theme: {
screens: {
......@@ -36,7 +36,7 @@ module.exports = {
},
darkMode: 'class',
plugins: [
nextui(theme),
heroui(theme),
addVariablesForColors,
],
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment