evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build helpers that configure an editor with mention support across people and topic markers, including custom rendering, async feeds, and programmatic insertion.
@al surfaces only person suggestions, while #al surfaces only topic suggestions, each limited to its own dropdown size and minimum character rule. @testtype MentionFeedItem = {
id: string;
label?: string;
text?: string;
metadata?: Record<string, unknown>;
};
type FeedConfig = {
marker: '@' | '#';
items: MentionFeedItem[] | ((queryText: string) => Promise<MentionFeedItem[]> | MentionFeedItem[]);
minimumCharacters?: number;
dropdownLimit?: number;
};
export interface MentionEditorSetupOptions {
element: HTMLElement;
feeds: FeedConfig[];
renderer?(item: MentionFeedItem): string | HTMLElement;
commitKeys?: string[];
}
export interface MentionEditor {
element: HTMLElement;
}
export function createMentionEditor(options: MentionEditorSetupOptions): Promise<MentionEditor>;
export function insertMention(
editor: MentionEditor,
mention: { marker: '@' | '#'; id: string; text?: string; metadata?: Record<string, unknown> },
range?: unknown
): void;Mention editing, feed handling, and dropdown UI for the editor.