统一简化多个页面里的CopyButton调用,删除不再需要的空回调参数

* feat: 添加clearCookies函数的单元测试并修复cookie域名处理逻辑

* feat: 增强 data URI 处理,支持带参数的前缀并更新相关测试

* fix: 修正 AGENTS.md 中 TypeScript 类型检查命令的描述

* feat: 添加 settings.local.json 文件以配置 Bash 权限

* perf: 预设背景色避免 Popup 弹窗白屏闪烁

* perf: 避免图标过早实例化,传递组件引用而非 JSX 节点

* feat: 添加 useLazyTranslation 和 preloadNamespaces 函数以支持动态加载 i18n 命名空间

* feat: 使用 useLazyTranslation 替换 useTranslation 以支持懒加载翻译

* feat: 添加 PageSkeleton 组件及其测试用例以支持页面加载骨架屏

* feat: 使用骨架屏替换加载状态指示器,优化用户体验

* feat: 优化 CopyButton 组件的复制功能,添加定时器管理复制状态

* feat: 调整 chunk 大小警告阈值以优化构建性能
This commit is contained in:
LingandRX
2026-05-20 20:07:44 +08:00
committed by GitHub
parent 7167a43763
commit 373fc0496c
24 changed files with 535 additions and 153 deletions
+2 -55
View File
@@ -4,60 +4,20 @@ import LanguageDetector from 'i18next-browser-languagedetector';
import { storageUtil } from '@/utils/chromeStorage';
import dayjs from 'dayjs';
// 导入语言文件
// 同步加载全局命名空间(所有页面都需要)
import commonZh from './locales/zh/common.json';
import featuresZh from './locales/zh/features.json';
import commonEn from './locales/en/common.json';
import featuresEn from './locales/en/features.json';
import timestampZh from './locales/zh/timestamp.json';
import timestampEn from './locales/en/timestamp.json';
import storageCleanerZh from './locales/zh/storageCleaner.json';
import storageCleanerEn from './locales/en/storageCleaner.json';
import qrCodeZh from './locales/zh/qrCode.json';
import qrCodeEn from './locales/en/qrCode.json';
import textStatisticsZh from './locales/zh/textStatistics.json';
import textStatisticsEn from './locales/en/textStatistics.json';
import jwtZh from './locales/zh/jwt.json';
import jwtEn from './locales/en/jwt.json';
import jsonDiffZh from './locales/zh/jsonDiff.json';
import jsonDiffEn from './locales/en/jsonDiff.json';
import jsonFormatZh from './locales/zh/jsonFormat.json';
import jsonFormatEn from './locales/en/jsonFormat.json';
import base64ConverterZh from './locales/zh/base64Converter.json';
import base64ConverterEn from './locales/en/base64Converter.json';
import markdownToHtmlZh from './locales/zh/markdownToHtml.json';
import markdownToHtmlEn from './locales/en/markdownToHtml.json';
import htmlToMarkdownZh from './locales/zh/htmlToMarkdown.json';
import htmlToMarkdownEn from './locales/en/htmlToMarkdown.json';
const resources = {
zh: {
common: commonZh,
features: featuresZh,
timestamp: timestampZh,
storageCleaner: storageCleanerZh,
qrCode: qrCodeZh,
textStatistics: textStatisticsZh,
jwt: jwtZh,
jsonDiff: jsonDiffZh,
jsonFormat: jsonFormatZh,
base64Converter: base64ConverterZh,
markdownToHtml: markdownToHtmlZh,
htmlToMarkdown: htmlToMarkdownZh,
},
en: {
common: commonEn,
features: featuresEn,
timestamp: timestampEn,
storageCleaner: storageCleanerEn,
qrCode: qrCodeEn,
textStatistics: textStatisticsEn,
jwt: jwtEn,
jsonDiff: jsonDiffEn,
jsonFormat: jsonFormatEn,
base64Converter: base64ConverterEn,
markdownToHtml: markdownToHtmlEn,
htmlToMarkdown: htmlToMarkdownEn,
},
};
@@ -120,20 +80,7 @@ i18n
resources,
fallbackLng: 'en',
lng: syncLng || undefined,
ns: [
'common',
'features',
'timestamp',
'storageCleaner',
'qrCode',
'textStatistics',
'jwt',
'jsonDiff',
'jsonFormat',
'base64Converter',
'markdownToHtml',
'htmlToMarkdown',
],
ns: ['common', 'features'],
defaultNS: 'common',
debug: false,
interpolation: {