fix: 🩹 disable Unicode 15 emojis
https://github.com/jdecked/twemoji/pull/43
This commit is contained in:
parent
11dbe898d9
commit
a7dd8bffe5
|
@ -130,22 +130,13 @@
|
|||
i18n.ts.defaultReaction
|
||||
}}</template>
|
||||
<option value="⭐">
|
||||
<MkEmoji
|
||||
emoji="⭐"
|
||||
style="height: 1.7em"
|
||||
/>
|
||||
<MkEmoji emoji="⭐" style="height: 1.7em" />
|
||||
</option>
|
||||
<option value="👍">
|
||||
<MkEmoji
|
||||
emoji="👍"
|
||||
style="height: 1.7em"
|
||||
/>
|
||||
<MkEmoji emoji="👍" style="height: 1.7em" />
|
||||
</option>
|
||||
<option value="❤️">
|
||||
<MkEmoji
|
||||
emoji="❤️"
|
||||
style="height: 1.7em"
|
||||
/>
|
||||
<MkEmoji emoji="❤️" style="height: 1.7em" />
|
||||
</option>
|
||||
<option value="custom">
|
||||
<FormInput
|
||||
|
|
|
@ -38,6 +38,15 @@ function addSkinTone(emoji: string) {
|
|||
return emoji;
|
||||
}
|
||||
|
||||
const unicodeFifteenEmojis = [
|
||||
'🫨', '🩷', '🩵', '🩶',
|
||||
'🫷', '🫸', '🫎', '🫏',
|
||||
'🪽', '🐦⬛', '🪿', '🪼',
|
||||
'🪻', '🫚', '🫛', '🪭',
|
||||
'🪮', '🪇', '🪈', '🪯',
|
||||
'🛜'
|
||||
]
|
||||
|
||||
const newData = {};
|
||||
|
||||
Object.keys(data).forEach((originalCategory) => {
|
||||
|
@ -46,6 +55,9 @@ Object.keys(data).forEach((originalCategory) => {
|
|||
newData[newCategory] = newData[newCategory] || [];
|
||||
Object.keys(data[originalCategory]).forEach((emojiIndex) => {
|
||||
const emojiObj = { ...data[originalCategory][emojiIndex] };
|
||||
if (unicodeFifteenEmojis.includes(emojiObj.emoji)) {
|
||||
return;
|
||||
}
|
||||
if (emojiObj.skin_tone_support) {
|
||||
emojiObj.emoji = addSkinTone(emojiObj.emoji);
|
||||
}
|
||||
|
@ -65,12 +77,12 @@ export type UnicodeEmojiDef = {
|
|||
|
||||
export const emojilist: UnicodeEmojiDef[] = Object.keys(newData).reduce((acc, category) => {
|
||||
const categoryItems = newData[category].map((item) => {
|
||||
return {
|
||||
emoji: item.emoji,
|
||||
slug: item.slug,
|
||||
category: item.category,
|
||||
keywords: item.keywords || [],
|
||||
};
|
||||
return {
|
||||
emoji: item.emoji,
|
||||
slug: item.slug,
|
||||
category: item.category,
|
||||
keywords: item.keywords || [],
|
||||
};
|
||||
});
|
||||
return acc.concat(categoryItems);
|
||||
}, []);
|
||||
|
|
Loading…
Reference in New Issue