mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
chore: update dependencies, migrate from NextUI to HeroUI
This commit is contained in:
parent
8210b477ab
commit
0c1d259332
2
.npmrc
2
.npmrc
@ -1,3 +1,3 @@
|
||||
shamefully-hoist=true
|
||||
virtual-store-dir-max-length=80
|
||||
public-hoist-pattern[]=*@nextui-org/*
|
||||
public-hoist-pattern[]=*@heroui/*
|
||||
@ -16,6 +16,7 @@
|
||||
"checksum": "node scripts/checksum.mjs",
|
||||
"telegram": "node scripts/telegram.mjs",
|
||||
"artifact": "node scripts/artifact.mjs",
|
||||
"migrate-ui": "tsx scripts/migrate-to-heroui.ts",
|
||||
"dev": "electron-vite dev",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"build:win": "electron-vite build && electron-builder --publish never --win",
|
||||
@ -25,9 +26,9 @@
|
||||
"dependencies": {
|
||||
"@electron-toolkit/preload": "^3.0.1",
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"@heroui/react": "^2.6.14",
|
||||
"@mihomo-party/sysproxy": "^2.0.7",
|
||||
"@mihomo-party/sysproxy-darwin-arm64": "^2.0.7",
|
||||
"@nextui-org/react": "2.6.10",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"adm-zip": "^0.5.16",
|
||||
"axios": "^1.7.7",
|
||||
@ -51,7 +52,7 @@
|
||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||
"@types/adm-zip": "^0.5.6",
|
||||
"@types/express": "^5.0.0",
|
||||
"@types/node": "^22.9.0",
|
||||
"@types/node": "^22.13.0",
|
||||
"@types/pubsub-js": "^1.8.6",
|
||||
"@types/react": "^19.0.4",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
@ -59,7 +60,7 @@
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"cron-validator": "^1.3.1",
|
||||
"driver.js": "^1.3.1",
|
||||
"driver.js": "^1.3.5",
|
||||
"electron": "^33.3.2",
|
||||
"electron-builder": "25.0.4",
|
||||
"electron-vite": "^2.3.0",
|
||||
@ -82,7 +83,7 @@
|
||||
"react-icons": "^5.3.0",
|
||||
"react-markdown": "^9.0.1",
|
||||
"react-monaco-editor": "^0.56.2",
|
||||
"react-router-dom": "^7.1.1",
|
||||
"react-router-dom": "^7.1.5",
|
||||
"react-virtuoso": "^4.12.0",
|
||||
"recharts": "^2.13.3",
|
||||
"swr": "^2.2.5",
|
||||
|
||||
3251
pnpm-lock.yaml
generated
3251
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
44
scripts/migrate-to-heroui.mjs
Normal file
44
scripts/migrate-to-heroui.mjs
Normal file
@ -0,0 +1,44 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
|
||||
const srcDir = path.join(__dirname, '..', 'src')
|
||||
|
||||
function replaceInFile(filePath: string): void {
|
||||
let content = fs.readFileSync(filePath, 'utf8')
|
||||
|
||||
// 替换导入语句
|
||||
content = content.replace(
|
||||
/@nextui-org\/react/g,
|
||||
'@heroui/react'
|
||||
)
|
||||
|
||||
// 替换 NextUIProvider
|
||||
content = content.replace(
|
||||
/NextUIProvider/g,
|
||||
'HeroUIProvider'
|
||||
)
|
||||
|
||||
fs.writeFileSync(filePath, content)
|
||||
}
|
||||
|
||||
function walkDir(dir: string): void {
|
||||
const files = fs.readdirSync(dir)
|
||||
|
||||
files.forEach(file => {
|
||||
const filePath = path.join(dir, file)
|
||||
const stat = fs.statSync(filePath)
|
||||
|
||||
if (stat.isDirectory()) {
|
||||
walkDir(filePath)
|
||||
} else if (file.endsWith('.tsx') || file.endsWith('.ts')) {
|
||||
replaceInFile(filePath)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
walkDir(srcDir)
|
||||
console.log('Migration completed!')
|
||||
44
scripts/migrate-to-heroui.ts
Normal file
44
scripts/migrate-to-heroui.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
|
||||
const srcDir = path.join(__dirname, '..', 'src')
|
||||
|
||||
function replaceInFile(filePath: string): void {
|
||||
let content = fs.readFileSync(filePath, 'utf8')
|
||||
|
||||
// 替换导入语句
|
||||
content = content.replace(
|
||||
/@nextui-org\/react/g,
|
||||
'@heroui/react'
|
||||
)
|
||||
|
||||
// 替换 NextUIProvider
|
||||
content = content.replace(
|
||||
/NextUIProvider/g,
|
||||
'HeroUIProvider'
|
||||
)
|
||||
|
||||
fs.writeFileSync(filePath, content)
|
||||
}
|
||||
|
||||
function walkDir(dir: string): void {
|
||||
const files = fs.readdirSync(dir)
|
||||
|
||||
files.forEach(file => {
|
||||
const filePath = path.join(dir, file)
|
||||
const stat = fs.statSync(filePath)
|
||||
|
||||
if (stat.isDirectory()) {
|
||||
walkDir(filePath)
|
||||
} else if (file.endsWith('.tsx') || file.endsWith('.ts')) {
|
||||
replaceInFile(filePath)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
walkDir(srcDir)
|
||||
console.log('Migration completed!')
|
||||
@ -4,7 +4,7 @@ import { NavigateFunction, useLocation, useNavigate, useRoutes } from 'react-rou
|
||||
import OutboundModeSwitcher from '@renderer/components/sider/outbound-mode-switcher'
|
||||
import SysproxySwitcher from '@renderer/components/sider/sysproxy-switcher'
|
||||
import TunSwitcher from '@renderer/components/sider/tun-switcher'
|
||||
import { Button, Divider } from '@nextui-org/react'
|
||||
import { Button, Divider } from '@heroui/react'
|
||||
import { IoSettings } from 'react-icons/io5'
|
||||
import routes from '@renderer/routes'
|
||||
import {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button } from '@nextui-org/react'
|
||||
import { Button } from '@heroui/react'
|
||||
import { ReactNode } from 'react'
|
||||
import { ErrorBoundary, FallbackProps } from 'react-error-boundary'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Divider } from '@nextui-org/react'
|
||||
import { Button, Divider } from '@heroui/react'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import { platform } from '@renderer/utils/init'
|
||||
import { isAlwaysOnTop, setAlwaysOnTop } from '@renderer/utils/ipc'
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
ModalFooter,
|
||||
Button,
|
||||
Input
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import React, { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { Accordion, AccordionItem, Card, CardBody } from '@nextui-org/react'
|
||||
import { Accordion, AccordionItem, Card, CardBody } from '@heroui/react'
|
||||
|
||||
interface Props {
|
||||
title?: string
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Divider } from '@nextui-org/react'
|
||||
import { Divider } from '@heroui/react'
|
||||
|
||||
import React from 'react'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { cn, Switch, SwitchProps } from '@nextui-org/react'
|
||||
import { cn, Switch, SwitchProps } from '@heroui/react'
|
||||
import './border-switch.css'
|
||||
|
||||
interface SiderSwitchProps extends SwitchProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React, { useRef } from 'react'
|
||||
import { Input, InputProps } from '@nextui-org/react'
|
||||
import { Input, InputProps } from '@heroui/react'
|
||||
import { FaSearch } from 'react-icons/fa'
|
||||
|
||||
interface CollapseInputProps extends InputProps {
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
DropdownTrigger,
|
||||
DropdownMenu,
|
||||
DropdownItem
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import React from 'react'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { calcTraffic } from '@renderer/utils/calc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardFooter, CardHeader, Chip } from '@nextui-org/react'
|
||||
import { Button, Card, CardFooter, CardHeader, Chip } from '@heroui/react'
|
||||
import { calcTraffic } from '@renderer/utils/calc'
|
||||
import dayjs from '@renderer/utils/dayjs'
|
||||
import React, { useEffect } from 'react'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Card, CardBody, CardHeader } from '@nextui-org/react'
|
||||
import { Card, CardBody, CardHeader } from '@heroui/react'
|
||||
import React from 'react'
|
||||
|
||||
const colorMap = {
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
ModalFooter,
|
||||
Button,
|
||||
Snippet
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { getInterfaces } from '@renderer/utils/ipc'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { BaseEditor } from '../base/base-editor'
|
||||
import { getOverride, restartCore, setOverride } from '@renderer/utils/ipc'
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
Button,
|
||||
Input,
|
||||
Switch
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import React, { useState } from 'react'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { restartCore } from '@renderer/utils/ipc'
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
ModalFooter,
|
||||
Button,
|
||||
Divider
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { getOverride } from '@renderer/utils/ipc'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
DropdownItem,
|
||||
DropdownMenu,
|
||||
DropdownTrigger
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import { IoMdMore, IoMdRefresh } from 'react-icons/io'
|
||||
import dayjs from '@renderer/utils/dayjs'
|
||||
import React, { Key, useEffect, useMemo, useState } from 'react'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { BaseEditor } from '../base/base-editor'
|
||||
import { getProfileStr, setProfileStr } from '@renderer/utils/ipc'
|
||||
|
||||
@ -12,7 +12,7 @@ import {
|
||||
DropdownTrigger,
|
||||
DropdownMenu,
|
||||
DropdownItem
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import React, { useState } from 'react'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { useOverrideConfig } from '@renderer/hooks/use-override-config'
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
DropdownTrigger,
|
||||
Progress,
|
||||
Tooltip
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import { calcPercent, calcTraffic } from '@renderer/utils/calc'
|
||||
import { IoMdMore, IoMdRefresh } from 'react-icons/io'
|
||||
import dayjs from '@renderer/utils/dayjs'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody } from '@heroui/react'
|
||||
import { mihomoUnfixedProxy } from '@renderer/utils/ipc'
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import { FaMapPin } from 'react-icons/fa6'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Input, Switch, Tab, Tabs } from '@nextui-org/react'
|
||||
import { Button, Input, Switch, Tab, Tabs } from '@heroui/react'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-config'
|
||||
|
||||
@ -8,7 +8,7 @@ import Viewer from './viewer'
|
||||
import useSWR from 'swr'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { Button, Chip } from '@nextui-org/react'
|
||||
import { Button, Chip } from '@heroui/react'
|
||||
import { IoMdRefresh } from 'react-icons/io'
|
||||
import { CgLoadbarDoc } from 'react-icons/cg'
|
||||
import { MdEditDocument } from 'react-icons/md'
|
||||
|
||||
@ -9,7 +9,7 @@ import { Fragment, useEffect, useMemo, useState } from 'react'
|
||||
import useSWR from 'swr'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { Button, Chip } from '@nextui-org/react'
|
||||
import { Button, Chip } from '@heroui/react'
|
||||
import { IoMdRefresh } from 'react-icons/io'
|
||||
import { CgLoadbarDoc } from 'react-icons/cg'
|
||||
import { MdEditDocument } from 'react-icons/md'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { BaseEditor } from '../base/base-editor'
|
||||
import { getFileStr, setFileStr } from '@renderer/utils/ipc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Card, CardBody } from '@nextui-org/react'
|
||||
import { Card, CardBody } from '@heroui/react'
|
||||
import React from 'react'
|
||||
|
||||
const RuleItem: React.FC<IMihomoRulesDetail & { index: number }> = (props) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Tooltip } from '@heroui/react'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import { BaseEditor } from '@renderer/components/base/base-editor'
|
||||
import { readTheme } from '@renderer/utils/ipc'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { Button, Input, Select, SelectItem, Switch, Tab, Tabs, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Input, Select, SelectItem, Switch, Tab, Tabs, Tooltip } from '@heroui/react'
|
||||
import { BiCopy, BiSolidFileImport } from 'react-icons/bi'
|
||||
import useSWR from 'swr'
|
||||
import {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { Button, Input, Select, SelectItem, Switch, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Input, Select, SelectItem, Switch, Tooltip } from '@heroui/react'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import debounce from '@renderer/utils/debounce'
|
||||
import { getGistUrl, patchControledMihomoConfig, restartCore } from '@renderer/utils/ipc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Input } from '@nextui-org/react'
|
||||
import { Button, Input } from '@heroui/react'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import { Radio, RadioGroup } from '@nextui-org/react'
|
||||
import { Radio, RadioGroup } from '@heroui/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { FC } from 'react'
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
import { Button, Input, Switch } from '@nextui-org/react'
|
||||
import { Button, Input, Switch } from '@heroui/react'
|
||||
import {
|
||||
startSubStoreFrontendServer,
|
||||
startSubStoreBackendServer,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react'
|
||||
import SettingCard from '../base/base-setting-card'
|
||||
import SettingItem from '../base/base-setting-item'
|
||||
import { Button, Input } from '@nextui-org/react'
|
||||
import { Button, Input } from '@heroui/react'
|
||||
import { listWebdavBackups, webdavBackup } from '@renderer/utils/ipc'
|
||||
import WebdavRestoreModal from './webdav-restore-modal'
|
||||
import debounce from '@renderer/utils/debounce'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import { relaunchApp, webdavDelete, webdavRestore } from '@renderer/utils/ipc'
|
||||
import React, { useState } from 'react'
|
||||
import { MdDeleteForever } from 'react-icons/md'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { BaseEditor } from '../base/base-editor'
|
||||
import { getRuntimeConfigStr } from '@renderer/utils/ipc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import { FaCircleArrowDown, FaCircleArrowUp } from 'react-icons/fa6'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { calcTraffic } from '@renderer/utils/calc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-config'
|
||||
import BorderSwitch from '@renderer/components/base/border-swtich'
|
||||
import { LuServer } from 'react-icons/lu'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import { IoJournalOutline } from 'react-icons/io5'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import { calcTraffic } from '@renderer/utils/calc'
|
||||
import { mihomoVersion, restartCore } from '@renderer/utils/ipc'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Tabs, Tab } from '@nextui-org/react'
|
||||
import { Tabs, Tab } from '@heroui/react'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-config'
|
||||
import { useGroups } from '@renderer/hooks/use-groups'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import React from 'react'
|
||||
import { MdFormatOverline } from 'react-icons/md'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Chip, Progress, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Chip, Progress, Tooltip } from '@heroui/react'
|
||||
import { useProfileConfig } from '@renderer/hooks/use-profile-config'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { calcTraffic, calcPercent } from '@renderer/utils/calc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Chip, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Chip, Tooltip } from '@heroui/react'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
import { CSS } from '@dnd-kit/utilities'
|
||||
import { LuGroup } from 'react-icons/lu'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import React from 'react'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Chip, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Chip, Tooltip } from '@heroui/react'
|
||||
import { MdOutlineAltRoute } from 'react-icons/md'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import BorderSwitch from '@renderer/components/base/border-swtich'
|
||||
import { RiScan2Fill } from 'react-icons/ri'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
import { CSS } from '@dnd-kit/utilities'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import BorderSwitch from '@renderer/components/base/border-swtich'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, CardFooter, Tooltip } from '@heroui/react'
|
||||
import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-config'
|
||||
import BorderSwitch from '@renderer/components/base/border-swtich'
|
||||
import { TbDeviceIpadHorizontalBolt } from 'react-icons/tb'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@nextui-org/react'
|
||||
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button } from '@heroui/react'
|
||||
import { BaseEditor } from '@renderer/components/base/base-editor'
|
||||
import React, { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button } from '@nextui-org/react'
|
||||
import { Button } from '@heroui/react'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import { checkUpdate } from '@renderer/utils/ipc'
|
||||
import React, { useState } from 'react'
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
ModalFooter,
|
||||
Button,
|
||||
Code
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import React, { useState } from 'react'
|
||||
import { downloadAndInstallUpdate } from '@renderer/utils/ipc'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
||||
import { NextUIProvider } from '@nextui-org/react'
|
||||
import { HeroUIProvider } from '@heroui/react'
|
||||
import '@renderer/assets/floating.css'
|
||||
import FloatingApp from '@renderer/FloatingApp'
|
||||
import BaseErrorBoundary from './components/base/base-error-boundary'
|
||||
@ -10,7 +10,7 @@ import { ControledMihomoConfigProvider } from './hooks/use-controled-mihomo-conf
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<NextUIProvider>
|
||||
<HeroUIProvider>
|
||||
<NextThemesProvider attribute="class" enableSystem defaultTheme="dark">
|
||||
<BaseErrorBoundary>
|
||||
<AppConfigProvider>
|
||||
@ -20,6 +20,6 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
</AppConfigProvider>
|
||||
</BaseErrorBoundary>
|
||||
</NextThemesProvider>
|
||||
</NextUIProvider>
|
||||
</HeroUIProvider>
|
||||
</React.StrictMode>
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { HashRouter } from 'react-router-dom'
|
||||
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
||||
import { NextUIProvider } from '@nextui-org/react'
|
||||
import { HeroUIProvider } from '@heroui/react'
|
||||
import { init, platform } from '@renderer/utils/init'
|
||||
import '@renderer/assets/main.css'
|
||||
import App from '@renderer/App'
|
||||
@ -43,7 +43,7 @@ init().then(() => {
|
||||
})
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<NextUIProvider>
|
||||
<HeroUIProvider>
|
||||
<NextThemesProvider attribute="class" enableSystem defaultTheme="dark">
|
||||
<BaseErrorBoundary>
|
||||
<HashRouter>
|
||||
@ -63,7 +63,7 @@ init().then(() => {
|
||||
</HashRouter>
|
||||
</BaseErrorBoundary>
|
||||
</NextThemesProvider>
|
||||
</NextUIProvider>
|
||||
</HeroUIProvider>
|
||||
</React.StrictMode>
|
||||
)
|
||||
})
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import { mihomoCloseAllConnections, mihomoCloseConnection } from '@renderer/utils/ipc'
|
||||
import { Key, useEffect, useMemo, useState } from 'react'
|
||||
import { Badge, Button, Divider, Input, Select, SelectItem, Tab, Tabs } from '@nextui-org/react'
|
||||
import { Badge, Button, Divider, Input, Select, SelectItem, Tab, Tabs } from '@heroui/react'
|
||||
import { calcTraffic } from '@renderer/utils/calc'
|
||||
import ConnectionItem from '@renderer/components/connections/connection-item'
|
||||
import { Virtuoso } from 'react-virtuoso'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Tab, Input, Switch, Tabs, Divider } from '@nextui-org/react'
|
||||
import { Button, Tab, Input, Switch, Tabs, Divider } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import { MdDeleteForever } from 'react-icons/md'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import LogItem from '@renderer/components/logs/log-item'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { Button, Divider, Input } from '@nextui-org/react'
|
||||
import { Button, Divider, Input } from '@heroui/react'
|
||||
import { Virtuoso, VirtuosoHandle } from 'react-virtuoso'
|
||||
import { IoLocationSharp } from 'react-icons/io5'
|
||||
import { CgTrash } from 'react-icons/cg'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Divider, Input, Select, SelectItem, Switch } from '@nextui-org/react'
|
||||
import { Button, Divider, Input, Select, SelectItem, Switch } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
DropdownMenu,
|
||||
DropdownTrigger,
|
||||
Input
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import { getFilePath, readTextFile } from '@renderer/utils/ipc'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
DropdownMenu,
|
||||
DropdownTrigger,
|
||||
Input
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import ProfileItem from '@renderer/components/profiles/profile-item'
|
||||
import { useProfileConfig } from '@renderer/hooks/use-profile-config'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Avatar, Button, Card, CardBody, Chip } from '@nextui-org/react'
|
||||
import { Avatar, Button, Card, CardBody, Chip } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import {
|
||||
|
||||
@ -2,7 +2,7 @@ import BasePage from '@renderer/components/base/base-page'
|
||||
import RuleItem from '@renderer/components/rules/rule-item'
|
||||
import { Virtuoso } from 'react-virtuoso'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { Divider, Input } from '@nextui-org/react'
|
||||
import { Divider, Input } from '@heroui/react'
|
||||
import { useRules } from '@renderer/hooks/use-rules'
|
||||
import { includesIgnoreCase } from '@renderer/utils/includes'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button } from '@nextui-org/react'
|
||||
import { Button } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import { CgWebsite } from 'react-icons/cg'
|
||||
import { IoLogoGithub } from 'react-icons/io5'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Divider, Input, Switch } from '@nextui-org/react'
|
||||
import { Button, Divider, Input, Switch } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button } from '@nextui-org/react'
|
||||
import { Button } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import { useAppConfig } from '@renderer/hooks/use-app-config'
|
||||
import { subStoreFrontendPort, subStorePort } from '@renderer/utils/ipc'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Input, Tab, Tabs } from '@nextui-org/react'
|
||||
import { Button, Input, Tab, Tabs } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Button, Input, Switch, Tab, Tabs } from '@nextui-org/react'
|
||||
import { Button, Input, Switch, Tab, Tabs } from '@heroui/react'
|
||||
import BasePage from '@renderer/components/base/base-page'
|
||||
import SettingCard from '@renderer/components/base/base-setting-card'
|
||||
import SettingItem from '@renderer/components/base/base-setting-item'
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
const { nextui } = require('@nextui-org/react')
|
||||
const { heroui } = require('@heroui/react')
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
'./src/renderer/src/**/*.{js,ts,jsx,tsx}',
|
||||
'./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}'
|
||||
'./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}'
|
||||
],
|
||||
theme: {
|
||||
extend: {}
|
||||
},
|
||||
darkMode: 'class',
|
||||
plugins: [nextui()]
|
||||
plugins: [heroui()]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user