Bump emoji-datasource to 5.*, remove emojione and messenger support

release
Thomas Piard 2020-01-26 18:29:46 +01:00 committed by Etienne Lemay
parent 113b07abcf
commit cdb74f28c7
12 changed files with 58 additions and 35 deletions

View File

@ -186,7 +186,7 @@
} }
.emoji-mart-emoji-native { .emoji-mart-emoji-native {
font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji"; font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji";
} }
.emoji-mart-no-results { .emoji-mart-no-results {

View File

@ -41,7 +41,7 @@
"babel-jest": "^24.9.0", "babel-jest": "^24.9.0",
"babel-loader": "^8.0.0", "babel-loader": "^8.0.0",
"babel-plugin-transform-define": "^2.0.0", "babel-plugin-transform-define": "^2.0.0",
"emoji-datasource": "4.0.4", "emoji-datasource": "5.0.1",
"emojilib": "^2.2.1", "emojilib": "^2.2.1",
"enzyme": "^3.9.0", "enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.11.2", "enzyme-adapter-react-16": "^1.11.2",

View File

@ -1,5 +1,5 @@
const build = require('./build') const build = require('./build')
const sets = ['apple', 'emojione', 'facebook', 'google', 'messenger', 'twitter'] const sets = ['apple', 'facebook', 'google', 'twitter']
build({ output: 'data/all.json' }) build({ output: 'data/all.json' })

View File

@ -6,7 +6,8 @@ var fs = require('fs'),
var { compress } = require('../dist/utils/data') var { compress } = require('../dist/utils/data')
var categories = [ var categories = [
['Smileys & People', 'people'], ['Smileys & Emotion', 'people'],
['People & Body', 'people'],
['Animals & Nature', 'nature'], ['Animals & Nature', 'nature'],
['Food & Drink', 'foods'], ['Food & Drink', 'foods'],
['Activities', 'activity'], ['Activities', 'activity'],
@ -16,7 +17,7 @@ var categories = [
['Flags', 'flags'], ['Flags', 'flags'],
] ]
var sets = ['apple', 'emojione', 'facebook', 'google', 'messenger', 'twitter'] var sets = ['apple', 'facebook', 'google', 'twitter']
module.exports = (options) => { module.exports = (options) => {
delete require.cache[require.resolve('emoji-datasource')] delete require.cache[require.resolve('emoji-datasource')]
@ -84,7 +85,7 @@ module.exports = (options) => {
datum.keywords = emojiLib.lib[datum.short_name].keywords datum.keywords = emojiLib.lib[datum.short_name].keywords
} }
if (datum.category != 'Skin Tones') { if (datum.category && datum.category != 'Skin Tones') {
categoryIndex = categoriesIndex[category] categoryIndex = categoriesIndex[category]
data.categories[categoryIndex].emojis.push(datum.short_name) data.categories[categoryIndex].emojis.push(datum.short_name)
data.emojis[datum.short_name] = datum data.emojis[datum.short_name] = datum

View File

@ -22,7 +22,8 @@ const I18N = {
categories: { categories: {
search: 'Search Results', search: 'Search Results',
recent: 'Frequently Used', recent: 'Frequently Used',
people: 'Smileys & People', smileys: 'Smileys & Emotion',
people: 'People & People',
nature: 'Animals & Nature', nature: 'Animals & Nature',
foods: 'Food & Drink', foods: 'Food & Drink',
activity: 'Activity', activity: 'Activity',

View File

@ -101,6 +101,18 @@ const categories = {
</svg> </svg>
), ),
smileys: () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="24"
height="24"
>
<path d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10" />
<path d="M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0" />
</svg>
),
places: () => ( places: () => (
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

View File

@ -5,9 +5,7 @@ const mapping = {
has_img_apple: 'd', has_img_apple: 'd',
has_img_google: 'e', has_img_google: 'e',
has_img_twitter: 'f', has_img_twitter: 'f',
has_img_emojione: 'g',
has_img_facebook: 'h', has_img_facebook: 'h',
has_img_messenger: 'i',
keywords: 'j', keywords: 'j',
sheet: 'k', sheet: 'k',
emoticons: 'l', emoticons: 'l',

View File

@ -109,8 +109,9 @@ function getData(emoji, skin, set, data) {
if (emojiData.skin_variations && skin > 1) { if (emojiData.skin_variations && skin > 1) {
emojiData = JSON.parse(JSON.stringify(emojiData)) emojiData = JSON.parse(JSON.stringify(emojiData))
var skinKey = SKINS[skin - 1], var skinKey = SKINS[skin - 1]
variationData = emojiData.skin_variations[skinKey] if (emojiData.skin_variations[skinKey] !== undefined) {
var variationData = emojiData.skin_variations[skinKey]
if (!variationData.variations && emojiData.variations) { if (!variationData.variations && emojiData.variations) {
delete emojiData.variations delete emojiData.variations
@ -130,6 +131,7 @@ function getData(emoji, skin, set, data) {
} }
} }
} }
}
if (emojiData.variations && emojiData.variations.length) { if (emojiData.variations && emojiData.variations.length) {
emojiData = JSON.parse(JSON.stringify(emojiData)) emojiData = JSON.parse(JSON.stringify(emojiData))

View File

@ -2,8 +2,8 @@ const EmojiDefaultProps = {
skin: 1, skin: 1,
set: 'apple', set: 'apple',
sheetSize: 64, sheetSize: 64,
sheetColumns: 52, sheetColumns: 57,
sheetRows: 52, sheetRows: 57,
native: false, native: false,
forceSize: false, forceSize: false,
tooltip: false, tooltip: false,

View File

@ -18,8 +18,6 @@ const EmojiPropTypes = {
'apple', 'apple',
'google', 'google',
'twitter', 'twitter',
'emojione',
'messenger',
'facebook', 'facebook',
]), ]),
size: PropTypes.number.isRequired, size: PropTypes.number.isRequired,

View File

@ -15,7 +15,7 @@ import { Picker, Emoji, emojiIndex, NimbleEmojiIndex, getEmojiDataFromNative } f
import data from '../data/all.json' import data from '../data/all.json'
import '../css/emoji-mart.css' import '../css/emoji-mart.css'
const SETS = ['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook'] const SETS = ['apple', 'google', 'twitter', 'facebook']
const CUSTOM_EMOJIS = [ const CUSTOM_EMOJIS = [
{ {
name: 'Octocat', name: 'Octocat',
@ -93,6 +93,17 @@ storiesOf('Picker', module)
<path d="M2.204 14.049c-.06.276-.091.56-.091.847 0 3.443 4.402 6.249 9.814 6.249 5.41 0 9.812-2.804 9.812-6.249 0-.274-.029-.546-.082-.809l-.015-.032c-.021-.055-.029-.11-.029-.165-.302-1.175-1.117-2.241-2.296-3.103-.045-.016-.088-.039-.126-.07-.026-.02-.045-.042-.067-.064-1.792-1.234-4.356-2.008-7.196-2.008-2.815 0-5.354.759-7.146 1.971-.014.018-.029.033-.049.049-.039.033-.084.06-.13.075-1.206.862-2.042 1.937-2.354 3.123 0 .058-.014.114-.037.171l-.008.015zm9.773 5.441c-1.794 0-3.057-.389-3.863-1.197-.173-.174-.173-.457 0-.632.176-.165.46-.165.635 0 .63.629 1.685.943 3.228.943 1.542 0 2.591-.3 3.219-.929.165-.164.45-.164.629 0 .165.18.165.465 0 .645-.809.808-2.065 1.198-3.862 1.198l.014-.028zm-3.606-7.573c-.914 0-1.677.765-1.677 1.677 0 .91.763 1.65 1.677 1.65s1.651-.74 1.651-1.65c0-.912-.739-1.677-1.651-1.677zm7.233 0c-.914 0-1.678.765-1.678 1.677 0 .91.764 1.65 1.678 1.65s1.651-.74 1.651-1.65c0-.912-.739-1.677-1.651-1.677zm4.548-1.595c1.037.833 1.8 1.821 2.189 2.904.45-.336.719-.864.719-1.449 0-1.002-.815-1.816-1.818-1.816-.399 0-.778.129-1.09.363v-.002zM2.711 9.963c-1.003 0-1.817.816-1.817 1.818 0 .543.239 1.048.644 1.389.401-1.079 1.172-2.053 2.213-2.876-.302-.21-.663-.329-1.039-.329v-.002zm9.217 12.079c-5.906 0-10.709-3.205-10.709-7.142 0-.275.023-.544.068-.809C.494 13.598 0 12.729 0 11.777c0-1.496 1.227-2.713 2.725-2.713.674 0 1.303.246 1.797.682 1.856-1.191 4.357-1.941 7.112-1.992l1.812-5.524.404.095s.016 0 .016.002l4.223.993c.344-.798 1.138-1.36 2.065-1.36 1.229 0 2.231 1.004 2.231 2.234 0 1.232-1.003 2.234-2.231 2.234s-2.23-1.004-2.23-2.23l-3.851-.912-1.467 4.477c2.65.105 5.047.854 6.844 2.021.494-.464 1.144-.719 1.833-.719 1.498 0 2.718 1.213 2.718 2.711 0 .987-.54 1.886-1.378 2.365.029.255.059.494.059.749-.015 3.938-4.806 7.143-10.72 7.143l-.034.009zm8.179-19.187c-.74 0-1.34.599-1.34 1.338 0 .738.6 1.34 1.34 1.34.732 0 1.33-.6 1.33-1.334 0-.733-.598-1.332-1.347-1.332l.017-.012z" /> <path d="M2.204 14.049c-.06.276-.091.56-.091.847 0 3.443 4.402 6.249 9.814 6.249 5.41 0 9.812-2.804 9.812-6.249 0-.274-.029-.546-.082-.809l-.015-.032c-.021-.055-.029-.11-.029-.165-.302-1.175-1.117-2.241-2.296-3.103-.045-.016-.088-.039-.126-.07-.026-.02-.045-.042-.067-.064-1.792-1.234-4.356-2.008-7.196-2.008-2.815 0-5.354.759-7.146 1.971-.014.018-.029.033-.049.049-.039.033-.084.06-.13.075-1.206.862-2.042 1.937-2.354 3.123 0 .058-.014.114-.037.171l-.008.015zm9.773 5.441c-1.794 0-3.057-.389-3.863-1.197-.173-.174-.173-.457 0-.632.176-.165.46-.165.635 0 .63.629 1.685.943 3.228.943 1.542 0 2.591-.3 3.219-.929.165-.164.45-.164.629 0 .165.18.165.465 0 .645-.809.808-2.065 1.198-3.862 1.198l.014-.028zm-3.606-7.573c-.914 0-1.677.765-1.677 1.677 0 .91.763 1.65 1.677 1.65s1.651-.74 1.651-1.65c0-.912-.739-1.677-1.651-1.677zm7.233 0c-.914 0-1.678.765-1.678 1.677 0 .91.764 1.65 1.678 1.65s1.651-.74 1.651-1.65c0-.912-.739-1.677-1.651-1.677zm4.548-1.595c1.037.833 1.8 1.821 2.189 2.904.45-.336.719-.864.719-1.449 0-1.002-.815-1.816-1.818-1.816-.399 0-.778.129-1.09.363v-.002zM2.711 9.963c-1.003 0-1.817.816-1.817 1.818 0 .543.239 1.048.644 1.389.401-1.079 1.172-2.053 2.213-2.876-.302-.21-.663-.329-1.039-.329v-.002zm9.217 12.079c-5.906 0-10.709-3.205-10.709-7.142 0-.275.023-.544.068-.809C.494 13.598 0 12.729 0 11.777c0-1.496 1.227-2.713 2.725-2.713.674 0 1.303.246 1.797.682 1.856-1.191 4.357-1.941 7.112-1.992l1.812-5.524.404.095s.016 0 .016.002l4.223.993c.344-.798 1.138-1.36 2.065-1.36 1.229 0 2.231 1.004 2.231 2.234 0 1.232-1.003 2.234-2.231 2.234s-2.23-1.004-2.23-2.23l-3.851-.912-1.467 4.477c2.65.105 5.047.854 6.844 2.021.494-.464 1.144-.719 1.833-.719 1.498 0 2.718 1.213 2.718 2.711 0 .987-.54 1.886-1.378 2.365.029.255.059.494.059.749-.015 3.938-4.806 7.143-10.72 7.143l-.034.009zm8.179-19.187c-.74 0-1.34.599-1.34 1.338 0 .738.6 1.34 1.34 1.34.732 0 1.33-.6 1.33-1.334 0-.733-.598-1.332-1.347-1.332l.017-.012z" />
</svg> </svg>
), ),
people: () => (
<svg
aria-labelledby="simpleicons-reddit-icon"
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<title id="simpleicons-reddit-icon">Reddit icon</title>
<path d="M2.204 14.049c-.06.276-.091.56-.091.847 0 3.443 4.402 6.249 9.814 6.249 5.41 0 9.812-2.804 9.812-6.249 0-.274-.029-.546-.082-.809l-.015-.032c-.021-.055-.029-.11-.029-.165-.302-1.175-1.117-2.241-2.296-3.103-.045-.016-.088-.039-.126-.07-.026-.02-.045-.042-.067-.064-1.792-1.234-4.356-2.008-7.196-2.008-2.815 0-5.354.759-7.146 1.971-.014.018-.029.033-.049.049-.039.033-.084.06-.13.075-1.206.862-2.042 1.937-2.354 3.123 0 .058-.014.114-.037.171l-.008.015zm9.773 5.441c-1.794 0-3.057-.389-3.863-1.197-.173-.174-.173-.457 0-.632.176-.165.46-.165.635 0 .63.629 1.685.943 3.228.943 1.542 0 2.591-.3 3.219-.929.165-.164.45-.164.629 0 .165.18.165.465 0 .645-.809.808-2.065 1.198-3.862 1.198l.014-.028zm-3.606-7.573c-.914 0-1.677.765-1.677 1.677 0 .91.763 1.65 1.677 1.65s1.651-.74 1.651-1.65c0-.912-.739-1.677-1.651-1.677zm7.233 0c-.914 0-1.678.765-1.678 1.677 0 .91.764 1.65 1.678 1.65s1.651-.74 1.651-1.65c0-.912-.739-1.677-1.651-1.677zm4.548-1.595c1.037.833 1.8 1.821 2.189 2.904.45-.336.719-.864.719-1.449 0-1.002-.815-1.816-1.818-1.816-.399 0-.778.129-1.09.363v-.002zM2.711 9.963c-1.003 0-1.817.816-1.817 1.818 0 .543.239 1.048.644 1.389.401-1.079 1.172-2.053 2.213-2.876-.302-.21-.663-.329-1.039-.329v-.002zm9.217 12.079c-5.906 0-10.709-3.205-10.709-7.142 0-.275.023-.544.068-.809C.494 13.598 0 12.729 0 11.777c0-1.496 1.227-2.713 2.725-2.713.674 0 1.303.246 1.797.682 1.856-1.191 4.357-1.941 7.112-1.992l1.812-5.524.404.095s.016 0 .016.002l4.223.993c.344-.798 1.138-1.36 2.065-1.36 1.229 0 2.231 1.004 2.231 2.234 0 1.232-1.003 2.234-2.231 2.234s-2.23-1.004-2.23-2.23l-3.851-.912-1.467 4.477c2.65.105 5.047.854 6.844 2.021.494-.464 1.144-.719 1.833-.719 1.498 0 2.718 1.213 2.718 2.711 0 .987-.54 1.886-1.378 2.365.029.255.059.494.059.749-.015 3.938-4.806 7.143-10.72 7.143l-.034.009zm8.179-19.187c-.74 0-1.34.599-1.34 1.338 0 .738.6 1.34 1.34 1.34.732 0 1.33-.6 1.33-1.334 0-.733-.598-1.332-1.347-1.332l.017-.012z" />
</svg>
),
nature: () => ( nature: () => (
<svg <svg
version="1.1" version="1.1"

View File

@ -4012,10 +4012,10 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0" minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0" minimalistic-crypto-utils "^1.0.0"
emoji-datasource@4.0.4: emoji-datasource@5.0.1:
version "4.0.4" version "5.0.1"
resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-4.0.4.tgz#516b9ab2f34569e468e4e3753a34a47a0b2b5aa3" resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-5.0.1.tgz#31eaaff7caa6640929327b4f4ff66f2bf313df0a"
integrity sha1-UWuasvNFaeRo5ON1OjSkegsrWqM= integrity sha512-RXokuCv4o8RFLiigN1skAdZwJuJWqtBvcK3GVKpvAL/7BeH95enmKsli7cG8YZ85RTjyEe3+GAdpJJOV43KLKQ==
emoji-regex@^7.0.1: emoji-regex@^7.0.1:
version "7.0.3" version "7.0.3"