fix: 🩹 disable Unicode 15 emojis

https://github.com/jdecked/twemoji/pull/43
This commit is contained in:
ThatOneCalculator 2023-06-22 22:39:52 -07:00
parent d198ede6ec
commit a6cd9a6367
2 changed files with 21 additions and 18 deletions

View File

@ -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

View File

@ -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);
}, []);