@nqhuy/easy-email-extensions
v4.17.3
Published
Fork of easy-email-extensions with Word-like rich-text tools (px font-size, line/paragraph spacing, justify, indent).
Maintainers
Readme
@nqhuy/easy-email-extensions
Fork của easy-email-extensions (v4.17.1) — giữ nguyên API gốc, bổ sung bộ công cụ rich-text giống Word cho block Text.
Điểm khác so với bản gốc
- Font size nhập px tự do (không giới hạn 7 mức của
execCommand), hiển thị đúng cỡ chữ vùng đang chọn. - Font family highlight font đang dùng khi mở dropdown.
- Line spacing (giãn dòng) kiểu Word: bội số
1.0 / 1.15 / 1.5 / 2.0 / 2.5 / 3.0+ nhập tay. - Paragraph spacing (khoảng cách giữa các đoạn) theo px.
- Justify (căn đều 2 bên) + đồng bộ lại bộ icon căn lề.
- Indent tăng/giảm (thụt lề, bước 40px).
- Paste giữ xuống dòng: dòng trống → đoạn mới có khoảng cách, xuống dòng đơn →
<br>(bản gốc gộp mất dòng).
Tất cả thao tác đoạn (line spacing / paragraph spacing / indent) áp theo đoạn con trỏ / vùng bôi đen, giống Word.
Cài đặt
pnpm add @nqhuy/easy-email-extensionsCần các peer dependency (phải cùng minor 4.17.x với core/editor):
pnpm add easy-email-core@^4.17.0 easy-email-editor@^4.17.0 \
react@^18.2 react-dom@^18.2 react-final-form@^6.5 @arco-design/web-react@^2.66Sử dụng
import { StandardLayout } from '@nqhuy/easy-email-extensions';
import '@nqhuy/easy-email-extensions/lib/style.css';API và props giữ nguyên như easy-email-extensions gốc.
License
MIT — dựa trên công trình gốc của m-Ryan (zalify/easy-email).
