移除 react-router-dom 依赖,将导航从 URL 路由切换为事件总线驱动,
新增 Modal / Drawer / FloatingPanel 三种窗口类型支持。
架构变更:
- 删除 src/router/(唯一路由 /* → HomePage,无实际用途)
- App.tsx 移除 HashRouter,直接渲染 Layout > HomePage
- Layout 从 useLocation + Outlet 改为 children prop
- NavBar 移除 useNavigate,所有页面导航改为 emit(OPEN_PAGE)
- NavAction 精简:'navigate'|'spa' 合并为 'page'
新增组件:
- FloatingPanel:纯手写非模态浮动面板(可拖拽、无遮罩、多面板共存、
暗色主题适配、边界约束),对应 QT 非模态窗口的 Web 映射
Modal(居中模态)| Drawer(侧滑)| FloatingPanel(浮动可拖拽)
- 8 个页面占位组件(compliance-assets/account/vip/recharge/
billing/orders/projects/quota),各显示导航栏名称作为占位
配置扩展:
- NavItemConfig 新增 modalType?: 'modal' | 'drawer' | 'floating'
- nav-config 所有 page 项补齐 modalType(支付类→modal,浏览类→floating)
- event-bus 新增 OPEN_PAGE 事件,payload 携带 {target, modalType, label}
- 卸载 react-router-dom@^7.16.0(连带移除 4 个包)
设计原则:
- 页面组件不感知窗口类型(内容与容器分离),切换窗口类型只需改配置
- Modal/Drawer 单实例(模态含义=独占注意力),Floating 多实例共存
- 主页面始终挂载不卸载,所有子页面为叠加层(对应 QT 多窗口模型)
119 lines
4.0 KiB
JSON
119 lines
4.0 KiB
JSON
{
|
|
"name": "ele-heixiu",
|
|
"private": true,
|
|
"version": "0.0.13",
|
|
"description": "船长·HeiXiu — 桌面效率工作台",
|
|
"author": "HeiXiu 杨烨",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "chcp 65001 > null && cross-env ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ vite",
|
|
"build": "node build.mjs --win --personal --build",
|
|
"build:win": "node build.mjs --win --personal --build",
|
|
"build:win:enterprise": "node build.mjs --win --enterprise --build",
|
|
"build:mac": "node build.mjs --mac --personal --build",
|
|
"build:mac:enterprise": "node build.mjs --mac --enterprise --build",
|
|
"build:linux": "node build.mjs --linux --personal --build",
|
|
"build:linux:enterprise": "node build.mjs --linux --enterprise --build",
|
|
"build:clean": "node scripts/clean.mjs",
|
|
"upload:oss": "node scripts/upload-oss.mjs",
|
|
"publish:release": "node scripts/publish-release.mjs",
|
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
"preview": "vite preview",
|
|
"format": "prettier --write \"src/**/*.{ts,tsx,css}\" \"electron/**/*.ts\" \"shared/**/*.ts\"",
|
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,css}\" \"electron/**/*.ts\" \"shared/**/*.ts\"",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:e2e": "playwright test.json"
|
|
},
|
|
"dependencies": {
|
|
"@react-buddy/ide-toolbox": "^2.5.0",
|
|
"antd": "^6.4.3",
|
|
"axios": "^1.16.1",
|
|
"electron-updater": "^6.8.3",
|
|
"react": "^19.2.7",
|
|
"react-dom": "^19.2.7"
|
|
},
|
|
"build": {
|
|
"appId": "com.heixiu.electron",
|
|
"productName": "船长·HeiXiu",
|
|
"asar": true,
|
|
"directories": {
|
|
"output": "release/${version}"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"dist-electron"
|
|
],
|
|
"electronDownload": {
|
|
"mirror": "https://npmmirror.com/mirrors/electron/"
|
|
},
|
|
"publish": {
|
|
"provider": "generic",
|
|
"url": "https://update.heixiu.com"
|
|
},
|
|
"win": {
|
|
"icon": "src/assets/logo/heixiu.ico",
|
|
"target": [
|
|
{
|
|
"target": "NSIS",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
],
|
|
"artifactName": "${productName}-Windows-${version}-${env.EDITION}-Setup.${ext}"
|
|
},
|
|
"mac": {
|
|
"icon": "src/assets/logo/heixiu.icns",
|
|
"target": [
|
|
"dmg"
|
|
],
|
|
"artifactName": "${productName}-Mac-${version}-${env.EDITION}-Installer.${ext}"
|
|
},
|
|
"linux": {
|
|
"icon": "src/assets/logo/HX.png",
|
|
"target": [
|
|
"AppImage"
|
|
],
|
|
"artifactName": "${productName}-Linux-${version}-${env.EDITION}.${ext}"
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"perMachine": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"deleteAppDataOnUninstall": false,
|
|
"differentialPackage": true,
|
|
"installerIcon": "src/assets/logo/heixiu.ico",
|
|
"uninstallerIcon": "src/assets/logo/heixiu.ico"
|
|
}
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.60.0",
|
|
"@tailwindcss/vite": "^4.3.0",
|
|
"@types/electron": "^1.4.38",
|
|
"@types/node": "^25.9.1",
|
|
"@types/react": "^19.2.16",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@typescript-eslint/eslint-plugin": "^8.60.1",
|
|
"@typescript-eslint/parser": "^8.60.1",
|
|
"@vitejs/plugin-react": "^6.0.0",
|
|
"autoprefixer": "^10.5.0",
|
|
"cross-env": "^10.1.0",
|
|
"electron": "42.3.0",
|
|
"electron-builder": "^26.8.1",
|
|
"eslint": "^10.4.1",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
"postcss": "^8.5.15",
|
|
"prettier": "^3.8.3",
|
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
"tailwindcss": "^4.3.0",
|
|
"typescript": "^6.0.3",
|
|
"vite": "8.0.16",
|
|
"vite-plugin-electron": "^1.0.0",
|
|
"vite-plugin-electron-renderer": "^1.0.0"
|
|
},
|
|
"main": "dist-electron/main.js"
|
|
}
|