evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build an editor instance that supports mentions with asynchronous suggestions. The mention feed must debounce outgoing queries and ignore stale responses so the dropdown always reflects the most recent user input.
@ then rapidly adding characters triggers a single feed request after 100ms of inactivity; intermediate keystrokes do not fire extra requests. @testexport type MentionItem = {
id: string;
label?: string;
text?: string;
[key: string]: unknown;
};
export type MentionOptions = {
marker?: string;
debounceMs?: number;
dropdownLimit?: number;
};
export async function createMentionEditor(
rootElement: HTMLElement,
fetchSuggestions: (marker: string, query: string) => Promise<MentionItem[]>,
options?: MentionOptions
): Promise<{ destroy(): Promise<void> }>;Provides mention UI with debounced async feeds and stale-response safeguards.