import * as react_jsx_runtime from 'react/jsx-runtime'; import { Node } from '@tiptap/react'; interface MergeField { key: string; label: string; /** What the field becomes and where its value comes from. Shown when the chip is clicked. */ description?: string; /** Colour group 1–5 (the chip palette), so related fields share a colour. Default brand. */ tone?: 1 | 2 | 3 | 4 | 5; } /** Chip classes, shared by the editor node, menus and details so they cannot drift. */ declare function mergeTagChipClass(tone?: MergeField["tone"]): string; /** @deprecated Use {@link mergeTagChipClass}. Default-tone chip classes. */ declare const MERGE_TAG_CHIP_CLASS: string; /** `{{key}}` → chip markup, for keys the editor knows. Unknown tokens stay as text. */ declare function tokensToHtml(html: string, fields: MergeField[]): string; /** Chip markup → `{{key}}`. */ declare function htmlToTokens(html: string): string; declare function createMergeTagExtension(fields: MergeField[]): Node; interface MergeFieldMenuProps { fields: MergeField[]; onPick: (field: MergeField) => void; disabled?: boolean; /** Icon-only trigger for tight rows. */ iconOnly?: boolean; /** Look of the labelled trigger. Default outline. */ variant?: "outline" | "ghost"; label?: string; className?: string; } /** * "@ Insert merge field" menu: search box, then each field as the badge it becomes in the * text with a one-line description. Same list as the `@` typeahead. */ declare function MergeFieldMenu({ fields, onPick, disabled, iconOnly, variant, label, className, }: MergeFieldMenuProps): react_jsx_runtime.JSX.Element; /** A string with `{{key}}` tokens, drawn as the same badges they become in the editors. */ declare function MergeTagText({ text, fields, className, }: { text: string; fields: MergeField[]; className?: string; }): react_jsx_runtime.JSX.Element; /** What a merge field becomes for the person being previewed. */ interface MergeFieldExample { person: string; value: string; } /** * Enter or Space on a selected chip opens its details, so the card is reachable without a * pointer. Returns the chip when it handled the key. */ declare function chipUnderSelection(view: { state: { selection: unknown; }; nodeDOM: (pos: number) => globalThis.Node | null; }, event: KeyboardEvent): { key: string; el: HTMLElement; pos: number; } | null; interface MergeTagDetailsProps { field: MergeField; /** The chip element the card hangs from. */ anchor: HTMLElement; example?: MergeFieldExample | null; onRemove: () => void; onClose: () => void; } /** * Click a chip to see what it means, what it becomes for one person, and to remove it. * Focus moves into the card and returns to the editor on close; Escape closes it. */ declare function MergeTagDetails({ field, anchor, example, onRemove, onClose }: MergeTagDetailsProps): react_jsx_runtime.JSX.Element; export { MERGE_TAG_CHIP_CLASS, type MergeField, type MergeFieldExample, MergeFieldMenu, type MergeFieldMenuProps, MergeTagDetails, type MergeTagDetailsProps, MergeTagText, chipUnderSelection, createMergeTagExtension, htmlToTokens, mergeTagChipClass, tokensToHtml };