Overview
The@proton/mail package provides Redux state management, hooks, and utility functions for implementing Proton Mail features in web applications. It handles contacts, conversations, messages, labels, filters, and mail settings through a Redux-based architecture.
Installation
Key Features
- Redux stores for mail data management
- Contact and contact email management
- Conversation and message counting
- Label and filter management
- Mail forwarding (incoming and outgoing)
- Mail event loop for real-time updates
- HTML parsing and sanitization utilities
Package Structure
The package is organized into several key areas:Store
Redux slices for contacts, messages, labels, filters, and settings
Helpers
Utilities for DOM manipulation, parsing, and string processing
Hooks
React hooks for accessing mail state and functionality
Features
High-level features like categories view
Store Modules
Contacts Store
Manage contacts and contact emails with Redux.Message Counts
Track conversation and message counts across folders and labels.Labels and Filters
Manage mail labels and filters.Mail Forwarding
Handle incoming and outgoing mail forwarding.Event Loop Integration
Mail Event Loop
Subscribe to real-time mail updates.Contact Event Loop
Helper Functions
DOM Manipulation
HTML Parsing
Message Image Handling
String Utilities
Categories View
Implement category-based mail views.Hooks
Base64 Cache
Auto-Open Contacts
Mail Settings
Constants
Dependencies
Core Dependencies
Core Dependencies
@proton/account- Account management@proton/react-redux-store- Redux store utilities@proton/redux-shared-store-types- Shared Redux types@proton/styles- Styling utilities@reduxjs/toolkit- Redux toolkitreactandreact-redux- React integrationturndown- HTML to Markdown conversion
TypeScript Support
The package is written in TypeScript and provides full type definitions. All exports are strongly typed.Testing
Related Packages
@proton/shared
Shared utilities and helpers
@proton/components
React components
@proton/crypto
Cryptography utilities