/*! * Jodit Editor PRO (https://xdsoft.net/jodit/) * See LICENSE.md in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/ */ import type { IDictionary, IJodit } from "jodit/esm/types/index"; import { UIElement } from "jodit/esm/core/ui/index"; import type { IEmoji, IEmojiList, IShortEmoji } from "../interface"; export declare class Emoji extends UIElement { /** @override */ className(): string; private input; private categories; private list; private data; /** * Recent emojis */ private recent; private map; get defaultList(): IEmojiList; /** * Reset default state */ reset(): void; private setItems; /** @override */ protected createContainer(options?: IDictionary): HTMLElement; /** @override */ constructor(jodit: IJodit); private activeIndex; private setActiveCategory; private generateCategoriesList; private cache; /** * The current list (default or filtered), already normalized */ private items; /** * The list laid out in rows of `columns` cells with a full-width heading * before every category. Only the rows inside the viewport (plus an * overscan) are in the DOM; the rest is represented by two spacers, so a * list of two thousand emoji costs a few dozen nodes instead of two * thousand — on open, on scroll and on every search keystroke. */ private rows; private columns; private cellWidth; private rowHeight; private titleHeight; private paddingTop; /** * Indexes of the rendered rows: `[first, last)` */ private window; /** * Windowing is switched off for good the moment the real layout disagrees * with the row model (a stylesheet adding gaps, changing the wrapping…); * the list is then rendered in full, exactly as before, so a wrong guess * can only cost performance, never emoji. */ private virtual; private readonly spacerTop; private readonly spacerBottom; /** * Sizes of the grid. Taken from a rendered cell and heading whenever the * list is in the document, so any stylesheet override (the size variable, * a custom margin, a taller heading) is picked up; before the first show * the size variable is the only source. */ private measure; /** * Lays the items out in rows. The column count comes from the real width * of the list, so it follows the CSS variables and the scrollbar of the * platform. Nothing is done while the sizes are unchanged. */ private buildRows; /** * Puts the rows around the viewport into the DOM and sizes the spacers * for everything above and below them */ private renderWindow; private renderRows; /** * Compares the model with what the browser actually laid out: the offset * of the first rendered row, and for the first rendered row of emoji that * its cells share one line while the row after it starts where the model * says. Any mismatch disables windowing and re-renders the whole list. */ private verifyLayout; private rowElement; private cellKey; private spacer; private renderRow; /** * Highlights the category whose heading was scrolled past last */ private updateActiveCategory; private static isShortCat; static normalizeEmoji(emoji: IShortEmoji | IEmoji): IEmoji; private onInsertCode; /** * Scroll handler: renders the rows that came into view and moves the * category highlight. Coalesced to one frame; `renderWindow` is a no-op * while the visible row range is unchanged. */ private onScrollList; /** * The container has no width until the popup shows it, so the grid is * measured again once it is open */ protected onAfterOpenPopup(): void; private onClickCategory; private onClickItem; private onInputFilter; private clearFilter; protected onReady(): void; /** @override */ destruct(): any; }