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
|
i18n.ts.defaultReaction
|
||||||
}}</template>
|
}}</template>
|
||||||
<option value="⭐">
|
<option value="⭐">
|
||||||
<MkEmoji
|
<MkEmoji emoji="⭐" style="height: 1.7em" />
|
||||||
emoji="⭐"
|
|
||||||
style="height: 1.7em"
|
|
||||||
/>
|
|
||||||
</option>
|
</option>
|
||||||
<option value="👍">
|
<option value="👍">
|
||||||
<MkEmoji
|
<MkEmoji emoji="👍" style="height: 1.7em" />
|
||||||
emoji="👍"
|
|
||||||
style="height: 1.7em"
|
|
||||||
/>
|
|
||||||
</option>
|
</option>
|
||||||
<option value="❤️">
|
<option value="❤️">
|
||||||
<MkEmoji
|
<MkEmoji emoji="❤️" style="height: 1.7em" />
|
||||||
emoji="❤️"
|
|
||||||
style="height: 1.7em"
|
|
||||||
/>
|
|
||||||
</option>
|
</option>
|
||||||
<option value="custom">
|
<option value="custom">
|
||||||
<FormInput
|
<FormInput
|
||||||
|
|
|
@ -38,6 +38,15 @@ function addSkinTone(emoji: string) {
|
||||||
return emoji;
|
return emoji;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const unicodeFifteenEmojis = [
|
||||||
|
'🫨', '🩷', '🩵', '🩶',
|
||||||
|
'🫷', '🫸', '🫎', '🫏',
|
||||||
|
'🪽', '🐦⬛', '🪿', '🪼',
|
||||||
|
'🪻', '🫚', '🫛', '🪭',
|
||||||
|
'🪮', '🪇', '🪈', '🪯',
|
||||||
|
'🛜'
|
||||||
|
]
|
||||||
|
|
||||||
const newData = {};
|
const newData = {};
|
||||||
|
|
||||||
Object.keys(data).forEach((originalCategory) => {
|
Object.keys(data).forEach((originalCategory) => {
|
||||||
|
@ -46,6 +55,9 @@ Object.keys(data).forEach((originalCategory) => {
|
||||||
newData[newCategory] = newData[newCategory] || [];
|
newData[newCategory] = newData[newCategory] || [];
|
||||||
Object.keys(data[originalCategory]).forEach((emojiIndex) => {
|
Object.keys(data[originalCategory]).forEach((emojiIndex) => {
|
||||||
const emojiObj = { ...data[originalCategory][emojiIndex] };
|
const emojiObj = { ...data[originalCategory][emojiIndex] };
|
||||||
|
if (unicodeFifteenEmojis.includes(emojiObj.emoji)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (emojiObj.skin_tone_support) {
|
if (emojiObj.skin_tone_support) {
|
||||||
emojiObj.emoji = addSkinTone(emojiObj.emoji);
|
emojiObj.emoji = addSkinTone(emojiObj.emoji);
|
||||||
}
|
}
|
||||||
|
@ -65,12 +77,12 @@ export type UnicodeEmojiDef = {
|
||||||
|
|
||||||
export const emojilist: UnicodeEmojiDef[] = Object.keys(newData).reduce((acc, category) => {
|
export const emojilist: UnicodeEmojiDef[] = Object.keys(newData).reduce((acc, category) => {
|
||||||
const categoryItems = newData[category].map((item) => {
|
const categoryItems = newData[category].map((item) => {
|
||||||
return {
|
return {
|
||||||
emoji: item.emoji,
|
emoji: item.emoji,
|
||||||
slug: item.slug,
|
slug: item.slug,
|
||||||
category: item.category,
|
category: item.category,
|
||||||
keywords: item.keywords || [],
|
keywords: item.keywords || [],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return acc.concat(categoryItems);
|
return acc.concat(categoryItems);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
Loading…
Reference in New Issue