Skip to content

Commit

Permalink
chore: take over the ownership of emoji-mart-data
Browse files Browse the repository at this point in the history
All language packages are in the @emoji-mart/data package. Since we are
adding multilingual a11y, it makes sense to take the ownership of that
package.
  • Loading branch information
daelmaak committed Jul 2, 2024
1 parent 17e15b8 commit 15007cc
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Data required for the picker to work has been completely decoupled from the libr
- **Cons:** Slower initial page load (bigger file to load)

```sh
yarn add @emoji-mart/data
yarn add @slidoapp/emoji-mart-data
```

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({ data })
Expand All @@ -46,7 +46,7 @@ import { Picker } from '@slidoapp/emoji-mart'
new Picker({
data: async () => {
const response = await fetch(
'https://cdn.jsdelivr.net/npm/@emoji-mart/data',
'https://cdn.jsdelivr.net/npm/@slidoapp/emoji-mart-data',
)

return response.json()
Expand All @@ -59,11 +59,11 @@ In this example data is fetched from a content delivery network, but it could al
## 🏪 Picker
### React
```sh
npm install --save @slidoapp/emoji-mart @emoji-mart/data @slidoapp/emoji-mart-react
npm install --save @slidoapp/emoji-mart @slidoapp/emoji-mart-data @slidoapp/emoji-mart-react
```

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import Picker from '@slidoapp/emoji-mart-react'

function App() {
Expand Down Expand Up @@ -101,7 +101,7 @@ function App() {
| **emojiButtonRadius** | `100%` | i.e. `6px`, `1em`, `100%` | The radius of the emoji buttons |
| **emojiButtonSize** | `36` | | The size of the emoji buttons |
| **emojiSize** | `24` | | The size of the emojis (inside the buttons) |
| **emojiVersion** | `14` | `1`, `2`, `3`, `4`, `5`, `11`, `12`, `12.1`, `13`, `13.1`, `14` | The version of the emoji data to use. Latest version supported in `@emoji-mart/data` is currently [14](https://emojipedia.org/emoji-14.0) |
| **emojiVersion** | `14` | `1`, `2`, `3`, `4`, `5`, `11`, `12`, `12.1`, `13`, `13.1`, `14` | The version of the emoji data to use. Latest version supported in `@slidoapp/emoji-mart-data` is currently [14](https://emojipedia.org/emoji-14.0) |
| **exceptEmojis** | `[]` | | List of emoji IDs that will be excluded from the picker |
| **icons** | `auto` | `auto`, `outline`, `solid` | The type of icons to use for the picker. `outline` with light theme and `solid` with dark theme. |
| **locale** | `en` | `en`, `ar`, `be`, `cs`, `de`, `es`, `fa`, `fi`, `fr`, `hi`, `it`, `ja`, `ko`, `nl`, `pl`, `pt`, `ru`, `sa`, `tr`, `uk`, `vi`, `zh` | The locale to use for the picker |
Expand All @@ -123,7 +123,7 @@ function App() {
You can use custom emojis by providing an array of categories and their emojis. Emojis also support multiple skin tones and can be GIFs or SVGs.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import Picker from '@slidoapp/emoji-mart-react'

const custom = [
Expand Down Expand Up @@ -191,7 +191,7 @@ The emoji web component usage is the same no matter what library you use.
First, you need to make sure data has been initialized. You need to call this only once per page load. Note that if you call `init` like this, you don’t necessarily need to include data in your Picker props. It doesn’t hurt either, it will noop.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init } from '@slidoapp/emoji-mart'

init({ data })
Expand Down Expand Up @@ -221,7 +221,7 @@ Then you can use the emoji component in your HTML / JSX.
You can search without the Picker. Just like the emoji component, `data` needs to be initialized first in order to use the search index.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init, SearchIndex } from '@slidoapp/emoji-mart'

init({ data })
Expand All @@ -242,7 +242,7 @@ search('christmas') // => ['🎄', '🇨🇽', '🧑‍🎄', '🔔', '🤶', '
You can get emoji data from a native emoji. This is useful if you want to get the emoji ID from a native emoji. Just like the emoji component, `data` needs to be initialized first in order to retrieve the emoji data.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init, getEmojiDataFromNative } from '@slidoapp/emoji-mart'

init({ data })
Expand All @@ -264,7 +264,7 @@ getEmojiDataFromNative('🤞🏿').then(console.log)
EmojiMart UI supports [multiple languages](https://github.com/slidoapp/emoji-mart/tree/main/packages/emoji-mart-data/i18n), feel free to open a PR if yours is missing.

```js
import i18n from '@emoji-mart/data/i18n/fr.json'
import i18n from '@slidoapp/emoji-mart-data/i18n/fr.json'
i18n.search_no_results_1 = 'Aucun emoji'

new Picker({ i18n })
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"dev": "yarn workspace @emoji-mart/website dev",
"build": "yarn workspace @slidoapp/emoji-mart build",
"build:data": "yarn workspace @emoji-mart/data build",
"build:data": "yarn workspace @slidoapp/emoji-mart-data build",
"build:react": "yarn workspace @slidoapp/emoji-mart-react build",
"build:website": "yarn workspace @emoji-mart/website build",
"check:types": "tsc",
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-data/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `@emoji-mart/data`
# `@slidoapp/emoji-mart-data`

This package contains the data used by [EmojiMart](https://missiveapp.com/open/emoji-mart).
4 changes: 2 additions & 2 deletions packages/emoji-mart-data/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@emoji-mart/data",
"name": "@slidoapp/emoji-mart-data",
"version": "1.2.1",
"description": "Data for Emoji Mart; the emoji picker for the web.",
"license": "MIT",
"homepage": "https://missiveapp.com/open/emoji-mart",
"repository": {
"type": "git",
"url": "https://github.com/missive/emoji-mart",
"url": "https://github.com/slidoapp/emoji-mart",
"directory": "packages/emoji-mart-data"
},
"main": "sets/15/native.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/emoji-mart-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ This is a fork of Emoji Mart, done by [slidoapp](https://github.com/slidoapp/emo

## 🧑‍💻 Usage
```sh
npm install --save @slidoapp/emoji-mart @emoji-mart/data @slidoapp/emoji-mart-react
npm install --save @slidoapp/emoji-mart @slidoapp/emoji-mart-data @slidoapp/emoji-mart-react
```

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import Picker from '@slidoapp/emoji-mart-react'

function App() {
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img id="img-indeed" src="./assets/indeed.png" />
</div>
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-custom-font.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<block name="script">
<script type="module">
import data from '@emoji-mart/data/sets/13.1/native.json'
import data from '@slidoapp/emoji-mart-data/sets/13.1/native.json'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-custom-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<block name="script">
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-dynamic-width.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
</style>
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-emoji-component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<img id="img-parrot" src="./assets/parrot.gif" />
</div>
<script type="module">
import data from '@emoji-mart/data/sets/15/twitter.json'
import data from '@slidoapp/emoji-mart-data/sets/15/twitter.json'
import { init } from '@slidoapp/emoji-mart'

init({
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-headless-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<block name="script">
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init, SearchIndex } from '@slidoapp/emoji-mart'

init({ data })
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/example-slack-colors.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>
<block name="script">
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</block>
<block name="script">
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init } from '@slidoapp/emoji-mart'

init({ data })
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart-website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<img id="img-parrot" src="./assets/parrot.gif" />
</div>
<script type="module">
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import * as EmojiMart from '@slidoapp/emoji-mart'
window.EmojiMart = EmojiMart

Expand Down
22 changes: 11 additions & 11 deletions packages/emoji-mart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Data required for the picker to work has been completely decoupled from the libr
- **Cons:** Slower initial page load (bigger file to load)

```sh
yarn add @emoji-mart/data
yarn add @slidoapp/emoji-mart-data
```

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { Picker } from '@slidoapp/emoji-mart'

new Picker({ data })
Expand All @@ -46,7 +46,7 @@ import { Picker } from '@slidoapp/emoji-mart'
new Picker({
data: async () => {
const response = await fetch(
'https://cdn.jsdelivr.net/npm/@emoji-mart/data',
'https://cdn.jsdelivr.net/npm/@slidoapp/emoji-mart-data',
)

return response.json()
Expand All @@ -59,11 +59,11 @@ In this example data is fetched from a content delivery network, but it could al
## 🏪 Picker
### React
```sh
npm install --save @slidoapp/emoji-mart @emoji-mart/data @slidoapp/emoji-mart-react
npm install --save @slidoapp/emoji-mart @slidoapp/emoji-mart-data @slidoapp/emoji-mart-react
```

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import Picker from '@slidoapp/emoji-mart-react'

function App() {
Expand Down Expand Up @@ -101,7 +101,7 @@ function App() {
| **emojiButtonRadius** | `100%` | i.e. `6px`, `1em`, `100%` | The radius of the emoji buttons |
| **emojiButtonSize** | `36` | | The size of the emoji buttons |
| **emojiSize** | `24` | | The size of the emojis (inside the buttons) |
| **emojiVersion** | `14` | `1`, `2`, `3`, `4`, `5`, `11`, `12`, `12.1`, `13`, `13.1`, `14` | The version of the emoji data to use. Latest version supported in `@emoji-mart/data` is currently [14](https://emojipedia.org/emoji-14.0) |
| **emojiVersion** | `14` | `1`, `2`, `3`, `4`, `5`, `11`, `12`, `12.1`, `13`, `13.1`, `14` | The version of the emoji data to use. Latest version supported in `@slidoapp/emoji-mart-data` is currently [14](https://emojipedia.org/emoji-14.0) |
| **exceptEmojis** | `[]` | | List of emoji IDs that will be excluded from the picker |
| **icons** | `auto` | `auto`, `outline`, `solid` | The type of icons to use for the picker. `outline` with light theme and `solid` with dark theme. |
| **locale** | `en` | `en`, `ar`, `be`, `cs`, `de`, `es`, `fa`, `fi`, `fr`, `hi`, `it`, `ja`, `ko`, `nl`, `pl`, `pt`, `ru`, `sa`, `tr`, `uk`, `vi`, `zh` | The locale to use for the picker |
Expand All @@ -123,7 +123,7 @@ function App() {
You can use custom emojis by providing an array of categories and their emojis. Emojis also support multiple skin tones and can be GIFs or SVGs.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import Picker from '@slidoapp/emoji-mart-react'

const custom = [
Expand Down Expand Up @@ -191,7 +191,7 @@ The emoji web component usage is the same no matter what library you use.
First, you need to make sure data has been initialized. You need to call this only once per page load. Note that if you call `init` like this, you don’t necessarily need to include data in your Picker props. It doesn’t hurt either, it will noop.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init } from '@slidoapp/emoji-mart'

init({ data })
Expand Down Expand Up @@ -221,7 +221,7 @@ Then you can use the emoji component in your HTML / JSX.
You can search without the Picker. Just like the emoji component, `data` needs to be initialized first in order to use the search index.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init, SearchIndex } from '@slidoapp/emoji-mart'

init({ data })
Expand All @@ -242,7 +242,7 @@ search('christmas') // => ['🎄', '🇨🇽', '🧑‍🎄', '🔔', '🤶', '
You can get emoji data from a native emoji. This is useful if you want to get the emoji ID from a native emoji. Just like the emoji component, `data` needs to be initialized first in order to retrieve the emoji data.

```js
import data from '@emoji-mart/data'
import data from '@slidoapp/emoji-mart-data'
import { init, getEmojiDataFromNative } from '@slidoapp/emoji-mart'

init({ data })
Expand All @@ -264,7 +264,7 @@ getEmojiDataFromNative('🤞🏿').then(console.log)
EmojiMart UI supports [multiple languages](https://github.com/slidoapp/emoji-mart/tree/main/packages/emoji-mart-data/i18n), feel free to open a PR if yours is missing.

```js
import i18n from '@emoji-mart/data/i18n/fr.json'
import i18n from '@slidoapp/emoji-mart-data/i18n/fr.json'
i18n.search_no_results_1 = 'Aucun emoji'

new Picker({ i18n })
Expand Down
2 changes: 1 addition & 1 deletion packages/emoji-mart/src/components/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FrequentlyUsed, SearchIndex, Store } from '../../helpers'
import Icons from '../../icons'
import { deepEqual, getEmojiData, sleep } from '../../utils'

import type { Category } from '@emoji-mart/data'
import type { Category } from '@slidoapp/emoji-mart-data'
import { Emoji } from '../Emoji'
import { PureInlineComponent } from '../HOCs'
import { Navigation } from '../Navigation'
Expand Down
6 changes: 3 additions & 3 deletions packages/emoji-mart/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
import i18n_en from '@emoji-mart/data/i18n/en.json'
import i18n_en from '@slidoapp/emoji-mart-data/i18n/en.json'
import PickerProps from './components/Picker/PickerProps'
import {
FrequentlyUsed,
Expand Down Expand Up @@ -58,7 +58,7 @@ async function _init(props) {
Data =
(typeof props.data === 'function' ? await props.data() : props.data) ||
(await fetchJSON(
`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${emojiVersion}/${set}.json`,
`https://cdn.jsdelivr.net/npm/@slidoapp/emoji-mart-data@latest/sets/${emojiVersion}/${set}.json`,
))

Data.emoticons = {}
Expand Down Expand Up @@ -93,7 +93,7 @@ async function _init(props) {
(locale == 'en'
? i18n_en
: await fetchJSON(
`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${locale}.json`,
`https://cdn.jsdelivr.net/npm/@slidoapp/emoji-mart-data@latest/i18n/${locale}.json`,
))

if (props.custom) {
Expand Down

0 comments on commit 15007cc

Please sign in to comment.