evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a lightweight rich text note editor that offers mention-style autocomplete dropdowns with full keyboard navigation and configurable feeds.
@ suggestions once the minimum character count is met, and pressing Enter inserts the highlighted suggestion with a trailing space while closing the dropdown. @test@, #) honor their own minimumCharacters and dropdownLimit settings and only show items belonging to the active marker; typing "#a" never shows @ results and respects the # dropdown limit. @testexport interface MentionItem {
id: string;
label?: string;
text?: string;
[key: string]: unknown;
}
export interface MentionFeed {
marker: string;
minimumCharacters?: number;
dropdownLimit?: number;
fetchItems(query: string): Promise<MentionItem[]>;
renderItemLabel?: (item: MentionItem) => string | HTMLElement;
}
export interface MentionEditorOptions {
commitKeys?: string[];
initialContent?: string;
}
export interface MentionEditorHandles {
destroy(): Promise<void>;
getContent(): string;
isDropdownOpen(): boolean;
}
export async function initMentionEditor(
container: HTMLElement,
feeds: MentionFeed[],
options?: MentionEditorOptions
): Promise<MentionEditorHandles>;Provides mention autocomplete dropdowns with keyboard navigation.