feat: pluggable reply/forward quote header #295
This commit is contained in:
@@ -645,6 +645,52 @@ export interface ReplyContext {
|
||||
mode: 'reply' | 'reply-all' | 'forward';
|
||||
}
|
||||
|
||||
/**
|
||||
* Second argument to onBuildQuoteHeader transform handlers. Describes the
|
||||
* original message and how the host plans to render the quote header so
|
||||
* plugins can produce a replacement block (e.g. an Outlook-style
|
||||
* From/Sent/To/Cc/Subject section).
|
||||
*/
|
||||
export interface QuoteHeaderContext {
|
||||
mode: 'reply' | 'replyAll' | 'forward';
|
||||
/** Recipients of the new outgoing message (already resolved by the host). */
|
||||
newTo: string[];
|
||||
newCc: string[];
|
||||
/** Original message metadata. */
|
||||
from: { name?: string; email: string } | null;
|
||||
to: { name?: string; email: string }[];
|
||||
cc: { name?: string; email: string }[];
|
||||
subject: string;
|
||||
/** Pre-formatted date string the host already produced (locale-aware). */
|
||||
date: string;
|
||||
/** Raw ISO datetime, in case the plugin wants to reformat. */
|
||||
receivedAt?: string;
|
||||
/** Active UI locale (BCP-47), useful for Intl.DateTimeFormat in plugins. */
|
||||
locale: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial value for the onBuildQuoteHeader transform hook. Plugins return a
|
||||
* replacement; returning undefined falls through to the next handler or the
|
||||
* default. The composer splices `html` into HTML drafts and `text` into
|
||||
* plain-text drafts.
|
||||
*
|
||||
* For HTML, returning a header that includes its own surrounding wrapper
|
||||
* (`<div>...</div>`) is fine; the composer does not add extra wrappers.
|
||||
* For text, the host appends the quoted body after the header.
|
||||
*/
|
||||
export interface QuoteHeader {
|
||||
html: string;
|
||||
text: string;
|
||||
/**
|
||||
* When false, the composer skips its default blockquote wrapping around the
|
||||
* quoted body (HTML mode only). Use this for the Outlook style where the
|
||||
* quoted message is intended to follow the header without indentation.
|
||||
* Defaults to true (preserve the existing blockquote wrapping).
|
||||
*/
|
||||
wrapInBlockquote?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes an attachment crossing an attachment hook (upload, download, preview).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user