/** * Single source of truth for .courier-email-editor .tiptap font styles. * These values are applied via CSS custom properties from EmailEditorContainer * so styles.css can use var(--email-editor-*) and stay in sync. */ export declare const EMAIL_EDITOR_FONT_FAMILY = "Helvetica, Arial, sans-serif"; /** Paragraph and heading styles (non-blockquote) for email editor. */ export declare const EMAIL_EDITOR_TEXT_STYLES: { readonly p: { readonly color: "#000000"; readonly fontSize: "14px"; readonly lineHeight: "18px"; }; readonly h1: { readonly color: "#000000"; readonly fontSize: "32px"; readonly fontWeight: "600"; readonly lineHeight: "40px"; }; readonly h2: { readonly color: "#000000"; readonly fontSize: "24px"; readonly fontWeight: "600"; readonly lineHeight: "32px"; }; readonly h3: { readonly color: "#000000"; readonly fontSize: "18.72px"; readonly fontWeight: "600"; readonly lineHeight: "24px"; }; readonly subtext: { readonly color: "#8F8F8F"; readonly fontSize: "11px"; readonly lineHeight: "15px"; }; }; /** * Text style applied to quote body content. * Matches backend courier-email-text-style quote defaults. */ export declare const QUOTE_TEXT_STYLE: { readonly color: "#696969"; readonly fontSize: "14px"; readonly lineHeight: "18px"; readonly fontStyle: "italic"; }; /** * Quote text style variants when text_style is h1/h2/h3/subtext. * Derives sizing from EMAIL_EDITOR_TEXT_STYLES to stay in sync. */ export declare const QUOTE_TEXT_STYLE_VARIANTS: Record<"h1" | "h2" | "h3" | "subtext" | "quote", { fontSize: string; fontWeight: string; lineHeight: string; }>; /** Text tiers that carry a deliberate size preset the document base never overrides. */ export type PresetSizedTier = "h1" | "h2" | "h3" | "subtext"; /** Every tier the editor can render text in. */ export type TextTier = "text" | PresetSizedTier | "quote"; /** * The tier's preset font size in px. Used to resolve a unitless `line_height` * (a multiplier is only meaningful against a font size) and as the last step of * the font-size fallback chain. */ export declare const getTierFontSizePx: (tier: string | undefined, isQuote?: boolean) => number; /** The tier's preset line height in px. */ export declare const getTierLineHeightPx: (tier: string | undefined, isQuote?: boolean) => number; /** True for the tiers the document-level base font size deliberately skips. */ export declare const isPresetSizedTier: (tier: TextTier) => tier is PresetSizedTier; /** * Ratio the renderer uses to derive a line height when a font size is overridden * without an explicit one, so enlarged text doesn't clip. * Mirrors AUTO_LINE_HEIGHT_RATIO in the backend's `courier-email-text-style` helper. */ export declare const AUTO_LINE_HEIGHT_RATIO = 1.3; /** The renderer's rule: an explicit line height wins, else scale off the font size. */ export declare const resolveLineHeightPx: (fontSize?: number | null, lineHeight?: number | null) => number | undefined; /** * The tier a paragraph/heading block renders in. * * Anything below h3 collapses to h3, the same way the text block's node view * maps its tag: Elemental has no deeper heading tier. */ export declare const tierForTextBlock: (typeName: string, level?: number | null) => TextTier; /** * What a block (or an inline run) would render at if it set nothing itself — * i.e. the next step down the cascade: document base, then the tier preset. * * This is the value the block-level and text-level inputs show as an editable * placeholder. It has to be *derived* rather than stored, because it tracks the * document base: raising the base font size moves every unset block with it. * * Mirrors {@link getEmailEditorDocumentStyleVars} exactly, so what the inputs * claim is what the canvas (and the renderer) actually applies: * - the base font size reaches the body tiers only; headings and subtext keep * their presets; * - the base line height reaches every tier, and on the body tiers a base font * size with no base line height auto-scales the same way the renderer does. */ export declare function resolveInheritedTypography({ tier, isQuote, documentFontSize, documentLineHeight, }: { tier: TextTier; isQuote?: boolean; documentFontSize?: number | null; documentLineHeight?: number | null; }): { fontSize: number; lineHeight: number; }; export type StyleVarTier = "p" | "h1" | "h2" | "h3"; /** * Carries the document-level base font size to action buttons. Kept as a * variable (rather than threading the value through props) so the shared Button * node view works unchanged outside the email editor, where it resolves to the * renderer's 14px default. */ export declare const EMAIL_EDITOR_ACTION_FONT_SIZE_VAR = "--email-editor-action-font-size"; /** Default action label size in the renderer when nothing overrides it. */ export declare const EMAIL_EDITOR_ACTION_FONT_SIZE_FALLBACK = "14px"; /** * CSS custom properties that apply a font-size / line-height override to a * single text tier. * * Overrides are expressed as variables rather than plain `font-size` because the * `.courier-email-editor .tiptap` rules set those properties explicitly on * `p`/`h1`/`h2`/`h3` and would otherwise beat an inherited value. Setting the * variable on an ancestor makes the existing rule resolve to the override, which * keeps the cascade in the same order the renderer uses: * inline mark → block → document → tier preset. */ export declare function getTierStyleVars(tier: StyleVarTier, { fontSize, lineHeight, documentLineHeight, }: { fontSize?: number | null; lineHeight?: number | null; /** * The document-level base line height, when one is set. * * A block that sets a font size but no line height must NOT fall through to * the size-derived value while a document base exists: the renderer resolves * the document base into `lineHeight` *before* it auto-scales, so * `block font_size: 20px` + `document line_height: 40px` renders 40px, not * 26px. Without this the block's derived value — set as the same CSS variable * on a closer ancestor — would beat the document's. */ documentLineHeight?: number | null; }, { quote }?: { quote?: boolean; }): Record; /** * CSS custom properties that apply the document-level base font size and line * height on top of {@link getEmailEditorTiptapCssVars}. Set on the editor * container, which leaves block-level overrides (the same variables on the * individual block wrappers) and inline `font-size` marks free to win. * * Mirrors the renderer's `courier-email-text-style` helper: the base font size * reaches the body tiers only (text, quote, list) while heading and subtext tiers * keep their presets; the base line height applies to every tier. */ export declare function getEmailEditorDocumentStyleVars({ fontSize, lineHeight, }: { fontSize?: number | null; lineHeight?: number | null; }): Record; /** * Returns CSS custom properties to set on .courier-email-editor so that * .courier-email-editor .tiptap rules in styles.css (using var(--email-editor-*)) * resolve from this single source of truth. */ export declare function getEmailEditorTiptapCssVars(): Record;