Consume @matrix-org/emojibase-bindings (#11433)
This commit is contained in:
parent
4e4016dffc
commit
d4571aef68
11 changed files with 22 additions and 136 deletions
|
@ -22,6 +22,7 @@ import React from "react";
|
|||
import { uniq, sortBy, uniqBy, ListIteratee } from "lodash";
|
||||
import EMOTICON_REGEX from "emojibase-regex/emoticon";
|
||||
import { Room } from "matrix-js-sdk/src/matrix";
|
||||
import { EMOJI, Emoji, getEmojiFromUnicode } from "@matrix-org/emojibase-bindings";
|
||||
|
||||
import { _t } from "../languageHandler";
|
||||
import AutocompleteProvider from "./AutocompleteProvider";
|
||||
|
@ -29,7 +30,6 @@ import QueryMatcher from "./QueryMatcher";
|
|||
import { PillCompletion } from "./Components";
|
||||
import { ICompletion, ISelectionRange } from "./Autocompleter";
|
||||
import SettingsStore from "../settings/SettingsStore";
|
||||
import { EMOJI, IEmoji, getEmojiFromUnicode } from "../emoji";
|
||||
import { TimelineRenderingType } from "../contexts/RoomContext";
|
||||
import * as recent from "../emojipicker/recent";
|
||||
import { filterBoolean } from "../utils/arrays";
|
||||
|
@ -41,7 +41,7 @@ const LIMIT = 20;
|
|||
const EMOJI_REGEX = new RegExp("(" + EMOTICON_REGEX.source + "|(?:^|\\s):[+-\\w]*:?)$", "g");
|
||||
|
||||
interface ISortedEmoji {
|
||||
emoji: IEmoji;
|
||||
emoji: Emoji;
|
||||
_orderBy: number;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ function colonsTrimmed(str: string): string {
|
|||
export default class EmojiProvider extends AutocompleteProvider {
|
||||
public matcher: QueryMatcher<ISortedEmoji>;
|
||||
public nameMatcher: QueryMatcher<ISortedEmoji>;
|
||||
private readonly recentlyUsed: IEmoji[];
|
||||
private readonly recentlyUsed: Emoji[];
|
||||
|
||||
public constructor(room: Room, renderingType?: TimelineRenderingType) {
|
||||
super({ commandRegex: EMOJI_REGEX, renderingType });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue