Enhance form recognition, optimize UI, and unify components (#19)
- **docs**: 完善组件注释、README 目录结构及 AGENTS.md 文档。 - **refactor**: - 提取通用 `PageHeader`、`Button`、`DashboardCard` 及 `ErrorBoundary` 组件。 - 重构消息通信机制,采用 `@webext-core/messaging` 实现类型安全。 - 将全局通知系统重构为 `SnackbarProvider` (后合并至 `GlobalSnackbar`)。 - 迁移样式系统至 MUI 主题,移除冗余 CSS。 - 优化路由配置,支持独立标签页模式及页面懒加载。 - 移除未使用文件、URL 工具及表单映射相关功能。 - **feat**: - 新增配置导出功能(JSON)及状态提示。 - 新增侧边栏状态变化通知机制。 - 新增文本统计及 JWT 解析工具。 - 优化二维码生成与解析逻辑,换用更轻量的 `qrious` 和 `qr-scanner`。 - 增强高亮器功能,支持闪烁效果及 Shadow DOM 穿透。 - **style**: 优化仪表盘响应式网格布局及 UI 细节。 - **fix**: 修复 `useStorageState` 依赖缺失及路由初始化性能问题。 - **test**: 更新单元测试以覆盖新增的工具函数及功能特性。
This commit is contained in:
+35
-51
@@ -43,6 +43,12 @@ export const THEME_COLORS = {
|
||||
purpleDark: '#4a148c',
|
||||
purpleLight: '#9c27b0',
|
||||
|
||||
// 靛蓝色系
|
||||
// #303f9f 在白底对比度 7.01:1 ✓
|
||||
indigo: '#303f9f',
|
||||
indigoDark: '#1a237e',
|
||||
indigoLight: '#7986cb',
|
||||
|
||||
// 中性色
|
||||
white: '#FFFFFF',
|
||||
black: '#000000',
|
||||
@@ -107,57 +113,6 @@ export const timestampPageStyles = {
|
||||
buttonHover: `0 8px 24px ${alpha(THEME_COLORS.primary, 0.2)}`,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* 打开 URL 页面样式
|
||||
*/
|
||||
export const openUrlPageStyles = {
|
||||
primaryColor: THEME_COLORS.purple,
|
||||
primaryDark: THEME_COLORS.purpleDark,
|
||||
INPUT_STYLE: {
|
||||
'& .MuiOutlinedInput-root': {
|
||||
bgcolor: 'background.paper',
|
||||
borderRadius: 4,
|
||||
transition: 'all 0.25s cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
'&:hover fieldset': {
|
||||
borderColor: 'grey.300',
|
||||
},
|
||||
'&:hover': { bgcolor: 'grey.50' },
|
||||
'&.Mui-focused fieldset': {
|
||||
borderColor: THEME_COLORS.purple,
|
||||
},
|
||||
'&.Mui-focused': {
|
||||
bgcolor: '#fff',
|
||||
},
|
||||
},
|
||||
'& .MuiInputBase-input': {
|
||||
py: '14px',
|
||||
px: 2,
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
lineHeight: 1.4,
|
||||
},
|
||||
'& .MuiInputLabel-root': {
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 700,
|
||||
color: 'text.secondary',
|
||||
'&.Mui-focused': { color: THEME_COLORS.purple },
|
||||
},
|
||||
},
|
||||
themeColor: THEME_COLORS.purple,
|
||||
themeBg: alpha(THEME_COLORS.purple, 0.1),
|
||||
buttonBg: alpha(THEME_COLORS.purple, 0.85),
|
||||
buttonHover: `0 8px 24px ${alpha(THEME_COLORS.purple, 0.2)}`,
|
||||
errorColor: THEME_COLORS.error,
|
||||
errorBg: alpha(THEME_COLORS.error, 0.05),
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* 查看 URL 页面样式
|
||||
*/
|
||||
export const openUrlViewerPageStyles = {
|
||||
backgroundColor: '#ffffff',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* 存储清理页面样式
|
||||
*/
|
||||
@@ -219,3 +174,32 @@ export const formRecognizerPageStyles = {
|
||||
export const formMappingPageStyles = {
|
||||
secondaryColor: THEME_COLORS.purple,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* 文本统计页面样式
|
||||
*/
|
||||
export const textStatisticsPageStyles = {
|
||||
primaryColor: THEME_COLORS.purple,
|
||||
cardBg: alpha(THEME_COLORS.purple, 0.04),
|
||||
cardBorder: alpha(THEME_COLORS.purple, 0.1),
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* JWT 解析工具页面样式
|
||||
*/
|
||||
export const jwtPageStyles = {
|
||||
primaryColor: THEME_COLORS.indigo,
|
||||
cardBg: alpha(THEME_COLORS.indigo, 0.04),
|
||||
cardBorder: alpha(THEME_COLORS.indigo, 0.1),
|
||||
INPUT_STYLE: {
|
||||
'& .MuiOutlinedInput-root': {
|
||||
bgcolor: 'background.paper',
|
||||
borderRadius: 4,
|
||||
fontSize: '0.85rem',
|
||||
fontFamily: 'monospace',
|
||||
transition: 'all 0.2s',
|
||||
'&:hover': { bgcolor: 'grey.50' },
|
||||
'&.Mui-focused': { bgcolor: '#fff' },
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user