import { o as EmailNode } from "../index-BCfDYVR7.cjs"; import { a as KnownThemeComponents, c as PanelSectionId, d as ThemeComponentStyles, f as ThemeConfig, i as KnownCssProperties, l as ResetTheme, n as EditorTheme, o as PanelGroup, p as ThemeableComponent, r as EditorThemeInput, s as PanelInputProperty, t as CssJs, u as SupportedCssProperties } from "../types-DUTo2zJ5.cjs"; import { n as SlashCommandItem } from "../types-ALwc36ll.cjs"; import { Editor, Extension, JSONContent } from "@tiptap/core"; import * as React$2 from "react"; //#region src/core/serializer/serializer-plugin.d.ts interface SerializerPlugin { getNodeStyles(node: JSONContent, depth: number, editor: Editor): React.CSSProperties; BaseTemplate(props: { previewText?: string; children: React.ReactNode; editor: Editor; previewMode?: boolean; }): React.ReactNode; } //#endregion //#region src/plugins/email-theming/extension.d.ts /** * Maps a document node (type + attrs) to the theme component key used for style lookup. * Centralizes all node-type → theme-component knowledge. */ declare function getThemeComponentKey(nodeType: string, depth: number, attrs?: Record): KnownThemeComponents | null; /** * Returns merged theme styles (reset + panel styles) for the given editor. * Use when you have editor access and need the full CssJs map. */ declare function getMergedCssJs(theme: EditorTheme, panelStyles: PanelGroup[] | undefined): CssJs; /** * Node types and theme component keys that should receive the universal * `reset` CSS (e.g. `margin: 0; padding: 0`) layered underneath their own * theme styles. Shared between `getResolvedNodeStyles` (email serializer) * and `injectThemeCss` (editor preview) so both surfaces stay in sync. * * Includes both raw tiptap node names (e.g. `tableCell`) and theme * component keys (e.g. `list`) because the serializer matches against both. * * `bulletList` and `orderedList` are intentionally omitted: their elements * already carry the shared `node-list` class, so the `list` reset rule * covers them without forcing the dedicated `.node-bulletList` / * `.node-orderedList` rules to redundantly emit `margin: 0; padding: 0`. */ declare const RESET_NODE_TYPES: Set; /** * Returns resolved React.CSSProperties for a node when you already have merged CssJs * (e.g. in the serializer where there is no editor). Centralizes which theme keys * apply to which node type. */ declare function getResolvedNodeStyles(node: JSONContent, depth: number, mergedCssJs: CssJs): React$2.CSSProperties; declare function stylesToCss(styles: PanelGroup[], theme: EditorTheme): Record; declare function getEmailTheming(editor: Editor): { styles: PanelGroup[]; theme: EditorTheme; css: string | null; }; declare function useEmailTheming(editor: Editor | null): { styles: PanelGroup[]; theme: EditorTheme; css: string | null; } | null; /** * Sets the global panel styles on the editor document. * Persists into the `GlobalContent` node under the `'styles'` key. */ declare function setGlobalStyles(editor: Editor, styles: PanelGroup[]): boolean; /** * Sets the current email theme on the editor document. * Persists into the `GlobalContent` node under the `'theme'` key. */ declare function setCurrentTheme(editor: Editor, theme: EditorTheme): boolean; /** * Sets the global CSS string injected into the email ``. * Persists into the `GlobalContent` node under the `'css'` key. */ declare function setGlobalCssInjected(editor: Editor, css: string): boolean; declare const EmailTheming: Extension<{ theme?: EditorThemeInput; serializerPlugin: SerializerPlugin; }, any>; //#endregion //#region src/plugins/email-theming/theme-config.d.ts declare function parseCssValue(value: string | number): { value: string | number; unit?: 'px' | '%'; }; declare function isThemeConfig(theme: EditorThemeInput | undefined): theme is ThemeConfig; declare function themeStylesToPanelOverrides(styles: ThemeComponentStyles, basePanels: PanelGroup[]): PanelGroup[]; declare function createTheme(styles: ThemeComponentStyles): ThemeConfig; declare function extendTheme(base: EditorTheme, overrides: ThemeComponentStyles): ThemeConfig; //#endregion //#region src/plugins/email-theming/themes.d.ts /** * Resolves the display title for a panel group. * Uses the `id` lookup when available, falls back to the * DB-persisted `title` for backwards compatibility. */ declare function getPanelTitle(group: PanelGroup): string; declare const RESET_THEMES: Record; declare function resolveResetValue(value: string | number | undefined, targetUnit: 'px' | '%', bodyFontSizePx: number): number | undefined; declare const EDITOR_THEMES: Record; declare function getThemeBodyFontSizePx(theme: EditorTheme): number; /** * Use to make the preview nicer once the theme might miss some * important properties to make layout accurate */ declare const DEFAULT_INBOX_FONT_SIZE_PX = 14; declare const INBOX_EMAIL_DEFAULTS: Partial; declare const SUPPORTED_CSS_PROPERTIES: SupportedCssProperties; //#endregion //#region src/plugins/image/types.d.ts interface UploadImageResult { url: string; } interface UseEditorImageOptions { uploadImage: (file: File) => Promise; } //#endregion //#region src/plugins/image/slash-command.d.ts declare const imageSlashCommand: SlashCommandItem; //#endregion //#region src/plugins/image/index.d.ts declare module '@tiptap/core' { interface Commands { image: { setImage: (attrs: { src: string; alt?: string; width?: string; height?: string; alignment?: string; href?: string; }) => ReturnType; uploadImage: () => ReturnType; }; } } declare function useEditorImage(options: UseEditorImageOptions): EmailNode, Record>; //#endregion export { CssJs, DEFAULT_INBOX_FONT_SIZE_PX, EDITOR_THEMES, EditorTheme, EditorThemeInput, EmailTheming, INBOX_EMAIL_DEFAULTS, KnownCssProperties, KnownThemeComponents, PanelGroup, PanelInputProperty, PanelSectionId, RESET_NODE_TYPES, RESET_THEMES, ResetTheme, SUPPORTED_CSS_PROPERTIES, SupportedCssProperties, ThemeComponentStyles, ThemeConfig, ThemeableComponent, type UploadImageResult, type UseEditorImageOptions, createTheme, extendTheme, getEmailTheming, getMergedCssJs, getPanelTitle, getResolvedNodeStyles, getThemeBodyFontSizePx, getThemeComponentKey, imageSlashCommand, isThemeConfig, parseCssValue, resolveResetValue, setCurrentTheme, setGlobalCssInjected, setGlobalStyles, stylesToCss, themeStylesToPanelOverrides, useEditorImage, useEmailTheming }; //# sourceMappingURL=index.d.cts.map