- Implemented biometric-util.js for handling biometric capabilities and authentication prompts.
- Added discord-rpc-util.js for integrating Discord Rich Presence features.
- Created network-util.js for proxy URL building and cloud URL checking.
- Developed ocr-util.js for OCR functionality using Windows and macOS specific implementations.
- Introduced powershell-util.js for executing PowerShell scripts and handling errors.
- Added tar-index.js for efficient tar file indexing and extraction based on offsets.
- Implemented backupToPath function to create zip archives of specified directories and files.
- Added restoreFromPath function to extract files from zip archives, handling both asset and config files.
- Introduced error handling and progress reporting for backup and restore processes.
feat: create biometric authentication utilities
- Developed getBiometricCapability function to check for biometric support on macOS and Windows.
- Implemented promptBiometricAuth function to prompt users for biometric authentication using Touch ID or Windows Hello.
feat: integrate Discord Rich Presence functionality
- Added initDiscordRPC function to initialize Discord RPC client.
- Implemented setDiscordActivity function to update user activity with book reading progress.
- Created clearDiscordActivity function to clear the current Discord activity.
feat: implement network utilities for proxy and URL checks
- Added buildProxyUrl function to construct proxy URLs from configuration.
- Implemented checkCloudUrl function to validate cloud URLs with HTTP HEAD requests.
- Created testProxyConnection function to test proxy connections against Google.
feat: add OCR utilities for image text recognition
- Developed functions to handle OCR image input parsing and temporary image storage.
- Implemented runWindowsOcr and runMacosOcr functions for OCR processing on respective platforms.
feat: create PowerShell utility for script execution
- Added runPowerShellScript function to execute PowerShell scripts with error handling and output extraction.
- Added `tar-index.js` to handle tar file indexing and extraction.
- Implemented functions to normalize entry names, ensure entries are within a specified directory, and parse tar headers.
- Introduced caching for tar index to optimize repeated access.
- Added support for reading tar data blocks and extracting files based on their offsets.
- Included error handling for invalid entries and extraction paths.
- Implemented `streamProcessBookContent` method to handle streaming imports for CBZ and CBT file types.
- Added error handling for non-Electron environments.
- Updated dependencies in yarn.lock to include new packages and versions for improved functionality.
- Implemented new translation plugins: ollamaTranslate, potTranslate, reversoEmbedTranslate, sogouEmbedTranslate, tencentTranslate, transmartEmbedTranslate, volcengineTranslate, yandexEmbedTranslate, youdaoGeneralTranslate, and youdaoLlmTranslate.
- Created a centralized rendererRegistry to manage translation plugins.
- Defined types for plugin configuration and translation functionality in types.ts.
- Updated file handling in coverUtil, dictUtil, export, fontUtil, restore, sqlUtil, and other utility files to use window.electronAPI for accessing Electron modules.
- Refactored IPC calls to utilize the new context bridge for better security and maintainability.
- Introduced a preload script to expose necessary APIs to the renderer process, enhancing the overall architecture.
- Ensured compatibility with Electron's security model by removing direct access to Node.js modules from the renderer.
- Introduced proxy settings in the MoreSetting component, allowing users to enable/disable proxy, and configure proxy type, host, port, username, and password.
- Implemented connection testing for the configured proxy settings with user feedback through toast notifications.
- Updated English and Chinese localization files to include new proxy-related strings.
- Enhanced state management to handle proxy configuration and testing states.
- Replaced jsPDF with @cantoo/pdf-lib for generating PDFs from HTML content.
- Updated the PDF export logic to create a PDF document with proper dimensions and margins.
- Adjusted image embedding and page handling to accommodate the new library.
- Removed dependency on jsPDF and ensured fallback to HTML Blob when necessary.
- Updated yarn.lock to include @cantoo/pdf-lib and its dependencies.
- Introduced the @mozilla/readability library to improve HTML content extraction from URLs.
- Enhanced the importHtmlFromURL method to fetch, parse, and sanitize HTML content, ensuring relative URLs are converted to absolute.
- Added utility functions for escaping HTML and making URLs absolute within the imported content.
- Updated type definitions to include Readability class for TypeScript support.
- Implemented Stats component to display reading statistics including total books read, total reading time, longest streak, and daily averages.
- Added heatmap visualization for reading activity over the last 52 weeks.
- Included bar and line chart options for displaying reading data over the last 30 days.
- Created responsive layout with styled cards for displaying key statistics.
- Integrated i18n for translation support.
- Added CSS for styling the stats page, cards, heatmap, and charts.