New composition area with emoji typeahead
This commit is contained in:
parent
e62a1a7812
commit
7b645011c2
95 changed files with 1740 additions and 1293 deletions
|
@ -9,6 +9,7 @@ import {
|
|||
map,
|
||||
mapValues,
|
||||
sortBy,
|
||||
take,
|
||||
} from 'lodash';
|
||||
import Fuse from 'fuse.js';
|
||||
import PQueue from 'p-queue';
|
||||
|
@ -194,8 +195,14 @@ const fuse = new Fuse(data, {
|
|||
keys: ['name', 'short_name', 'short_names'],
|
||||
});
|
||||
|
||||
export function search(query: string) {
|
||||
return fuse.search(query.substr(0, 32));
|
||||
export function search(query: string, count: number = 0) {
|
||||
const results = fuse.search(query.substr(0, 32));
|
||||
|
||||
if (count) {
|
||||
return take(results, count);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
const shortNames = new Set([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue