emoji-picker-react 4.16.1 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -42
- package/dist/components/body/EmojiCategory.d.ts +1 -1
- package/dist/components/context/PickerDataContext.d.ts +16 -0
- package/dist/components/navigation/CategoryButton.d.ts +1 -1
- package/dist/config/categoryConfig.d.ts +2 -6
- package/dist/config/config.d.ts +2 -1
- package/dist/data/emojis-bn.d.ts +3 -0
- package/dist/data/emojis-bn.js +2 -0
- package/dist/data/emojis-bn.json +1 -0
- package/dist/data/emojis-bn.ts +3 -0
- package/dist/data/emojis-da.d.ts +3 -0
- package/dist/data/emojis-da.js +2 -0
- package/dist/data/emojis-da.json +1 -0
- package/dist/data/emojis-da.ts +3 -0
- package/dist/data/emojis-de.d.ts +3 -0
- package/dist/data/emojis-de.js +2 -0
- package/dist/data/emojis-de.json +1 -0
- package/dist/data/emojis-de.ts +3 -0
- package/dist/data/emojis-en-gb.d.ts +3 -0
- package/dist/data/emojis-en-gb.js +2 -0
- package/dist/data/emojis-en-gb.json +1 -0
- package/dist/data/emojis-en-gb.ts +3 -0
- package/dist/data/emojis-en.d.ts +3 -0
- package/dist/data/emojis-en.js +2 -0
- package/dist/data/emojis-en.json +1 -0
- package/dist/data/emojis-en.ts +3 -0
- package/dist/data/emojis-es-mx.d.ts +3 -0
- package/dist/data/emojis-es-mx.js +2 -0
- package/dist/data/emojis-es-mx.json +1 -0
- package/dist/data/emojis-es-mx.ts +3 -0
- package/dist/data/emojis-es.d.ts +3 -0
- package/dist/data/emojis-es.js +2 -0
- package/dist/data/emojis-es.json +1 -0
- package/dist/data/emojis-es.ts +3 -0
- package/dist/data/emojis-et.d.ts +3 -0
- package/dist/data/emojis-et.js +2 -0
- package/dist/data/emojis-et.json +1 -0
- package/dist/data/emojis-et.ts +3 -0
- package/dist/data/emojis-fi.d.ts +3 -0
- package/dist/data/emojis-fi.js +2 -0
- package/dist/data/emojis-fi.json +1 -0
- package/dist/data/emojis-fi.ts +3 -0
- package/dist/data/emojis-fr.d.ts +3 -0
- package/dist/data/emojis-fr.js +2 -0
- package/dist/data/emojis-fr.json +1 -0
- package/dist/data/emojis-fr.ts +3 -0
- package/dist/data/emojis-hi.d.ts +3 -0
- package/dist/data/emojis-hi.js +2 -0
- package/dist/data/emojis-hi.json +1 -0
- package/dist/data/emojis-hi.ts +3 -0
- package/dist/data/emojis-hu.d.ts +3 -0
- package/dist/data/emojis-hu.js +2 -0
- package/dist/data/emojis-hu.json +1 -0
- package/dist/data/emojis-hu.ts +3 -0
- package/dist/data/emojis-it.d.ts +3 -0
- package/dist/data/emojis-it.js +2 -0
- package/dist/data/emojis-it.json +1 -0
- package/dist/data/emojis-it.ts +3 -0
- package/dist/data/emojis-ja.d.ts +3 -0
- package/dist/data/emojis-ja.js +2 -0
- package/dist/data/emojis-ja.json +1 -0
- package/dist/data/emojis-ja.ts +3 -0
- package/dist/data/emojis-ko.d.ts +3 -0
- package/dist/data/emojis-ko.js +2 -0
- package/dist/data/emojis-ko.json +1 -0
- package/dist/data/emojis-ko.ts +3 -0
- package/dist/data/emojis-lt.d.ts +3 -0
- package/dist/data/emojis-lt.js +2 -0
- package/dist/data/emojis-lt.json +1 -0
- package/dist/data/emojis-lt.ts +3 -0
- package/dist/data/emojis-ms.d.ts +3 -0
- package/dist/data/emojis-ms.js +2 -0
- package/dist/data/emojis-ms.json +1 -0
- package/dist/data/emojis-ms.ts +3 -0
- package/dist/data/emojis-nb.d.ts +3 -0
- package/dist/data/emojis-nb.js +2 -0
- package/dist/data/emojis-nb.json +1 -0
- package/dist/data/emojis-nb.ts +3 -0
- package/dist/data/emojis-nl.d.ts +3 -0
- package/dist/data/emojis-nl.js +2 -0
- package/dist/data/emojis-nl.json +1 -0
- package/dist/data/emojis-nl.ts +3 -0
- package/dist/data/emojis-pl.d.ts +3 -0
- package/dist/data/emojis-pl.js +2 -0
- package/dist/data/emojis-pl.json +1 -0
- package/dist/data/emojis-pl.ts +3 -0
- package/dist/data/emojis-pt.d.ts +3 -0
- package/dist/data/emojis-pt.js +2 -0
- package/dist/data/emojis-pt.json +1 -0
- package/dist/data/emojis-pt.ts +3 -0
- package/dist/data/emojis-ru.d.ts +3 -0
- package/dist/data/emojis-ru.js +2 -0
- package/dist/data/emojis-ru.json +1 -0
- package/dist/data/emojis-ru.ts +3 -0
- package/dist/data/emojis-sv.d.ts +3 -0
- package/dist/data/emojis-sv.js +2 -0
- package/dist/data/emojis-sv.json +1 -0
- package/dist/data/emojis-sv.ts +3 -0
- package/dist/data/emojis-th.d.ts +3 -0
- package/dist/data/emojis-th.js +2 -0
- package/dist/data/emojis-th.json +1 -0
- package/dist/data/emojis-th.ts +3 -0
- package/dist/data/emojis-uk.d.ts +3 -0
- package/dist/data/emojis-uk.js +2 -0
- package/dist/data/emojis-uk.json +1 -0
- package/dist/data/emojis-uk.ts +3 -0
- package/dist/data/emojis-zh-hant.d.ts +3 -0
- package/dist/data/emojis-zh-hant.js +2 -0
- package/dist/data/emojis-zh-hant.json +1 -0
- package/dist/data/emojis-zh-hant.ts +3 -0
- package/dist/data/emojis-zh.d.ts +3 -0
- package/dist/data/emojis-zh.js +2 -0
- package/dist/data/emojis-zh.json +1 -0
- package/dist/data/emojis-zh.ts +3 -0
- package/dist/data/emojis.d.ts +102 -50
- package/dist/data/emojis.js +1 -0
- package/dist/data/emojis.json +1 -0
- package/dist/data/emojis.ts +1 -0
- package/dist/data/groups.d.ts +2 -2
- package/dist/data/groups.js +11 -0
- package/dist/data/groups.ts +12 -0
- package/dist/data/skinToneVariations.d.ts +5 -5
- package/dist/data/skinToneVariations.js +17 -0
- package/dist/data/skinToneVariations.ts +31 -0
- package/dist/dataUtils/DataTypes.d.ts +2 -2
- package/dist/dataUtils/emojiUtils.d.ts +12 -0
- package/dist/emoji-picker-react.cjs.development.js +20120 -17359
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +20121 -17360
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/typeRefinements/typeRefinements.d.ts +2 -1
- package/dist/types/exposedTypes.d.ts +64 -50
- package/dist/types/exposedTypes.js +46 -0
- package/package.json +9 -5
- package/src/EmojiPickerReact.tsx +4 -1
- package/src/components/Reactions/Reactions.tsx +28 -20
- package/src/components/body/EmojiCategory.tsx +1 -1
- package/src/components/body/EmojiList.tsx +3 -5
- package/src/components/context/PickerConfigContext.tsx +2 -1
- package/src/components/context/PickerContext.tsx +7 -2
- package/src/components/context/PickerDataContext.tsx +157 -0
- package/src/components/emoji/ClickableEmojiButton.tsx +1 -3
- package/src/components/emoji/ViewOnlyEmoji.tsx +4 -5
- package/src/components/footer/Preview.tsx +6 -6
- package/src/components/navigation/CategoryButton.tsx +2 -4
- package/src/config/categoryConfig.ts +47 -30
- package/src/config/compareConfig.ts +3 -2
- package/src/config/config.ts +31 -15
- package/src/data/emojis-bn.json +1 -0
- package/src/data/emojis-bn.ts +3 -0
- package/src/data/emojis-da.json +1 -0
- package/src/data/emojis-da.ts +3 -0
- package/src/data/emojis-de.json +1 -0
- package/src/data/emojis-de.ts +3 -0
- package/src/data/emojis-en-gb.json +1 -0
- package/src/data/emojis-en-gb.ts +3 -0
- package/src/data/emojis-en.json +1 -0
- package/src/data/emojis-en.ts +3 -0
- package/src/data/emojis-es-mx.json +1 -0
- package/src/data/emojis-es-mx.ts +3 -0
- package/src/data/emojis-es.json +1 -0
- package/src/data/emojis-es.ts +3 -0
- package/src/data/emojis-et.json +1 -0
- package/src/data/emojis-et.ts +3 -0
- package/src/data/emojis-fi.json +1 -0
- package/src/data/emojis-fi.ts +3 -0
- package/src/data/emojis-fr.json +1 -0
- package/src/data/emojis-fr.ts +3 -0
- package/src/data/emojis-hi.json +1 -0
- package/src/data/emojis-hi.ts +3 -0
- package/src/data/emojis-hu.json +1 -0
- package/src/data/emojis-hu.ts +3 -0
- package/src/data/emojis-it.json +1 -0
- package/src/data/emojis-it.ts +3 -0
- package/src/data/emojis-ja.json +1 -0
- package/src/data/emojis-ja.ts +3 -0
- package/src/data/emojis-ko.json +1 -0
- package/src/data/emojis-ko.ts +3 -0
- package/src/data/emojis-lt.json +1 -0
- package/src/data/emojis-lt.ts +3 -0
- package/src/data/emojis-ms.json +1 -0
- package/src/data/emojis-ms.ts +3 -0
- package/src/data/emojis-nb.json +1 -0
- package/src/data/emojis-nb.ts +3 -0
- package/src/data/emojis-nl.json +1 -0
- package/src/data/emojis-nl.ts +3 -0
- package/src/data/emojis-pl.json +1 -0
- package/src/data/emojis-pl.ts +3 -0
- package/src/data/emojis-pt.json +1 -0
- package/src/data/emojis-pt.ts +3 -0
- package/src/data/emojis-ru.json +1 -0
- package/src/data/emojis-ru.ts +3 -0
- package/src/data/emojis-sv.json +1 -0
- package/src/data/emojis-sv.ts +3 -0
- package/src/data/emojis-th.json +1 -0
- package/src/data/emojis-th.ts +3 -0
- package/src/data/emojis-uk.json +1 -0
- package/src/data/emojis-uk.ts +3 -0
- package/src/data/emojis-zh-hant.json +1 -0
- package/src/data/emojis-zh-hant.ts +3 -0
- package/src/data/emojis-zh.json +1 -0
- package/src/data/emojis-zh.ts +3 -0
- package/src/data/emojis.json +1 -1
- package/src/data/emojis.ts +1 -1
- package/src/dataUtils/DataTypes.ts +2 -2
- package/src/dataUtils/alphaNumericEmojiIndex.ts +1 -8
- package/src/dataUtils/emojiSelectors.ts +24 -25
- package/src/dataUtils/emojiUtils.ts +74 -0
- package/src/hooks/preloadEmoji.ts +1 -1
- package/src/hooks/useDisallowedEmojis.ts +4 -3
- package/src/hooks/useEmojiVirtualization.tsx +2 -3
- package/src/hooks/useFilter.ts +1 -1
- package/src/hooks/useIsEmojiHidden.ts +1 -1
- package/src/typeRefinements/typeRefinements.ts +2 -5
- package/src/types/exposedTypes.ts +17 -0
package/README.md
CHANGED
|
@@ -57,41 +57,101 @@ function App() {
|
|
|
57
57
|
- Native Emoji support
|
|
58
58
|
- Emoji Component To Render Emojis in your app
|
|
59
59
|
- Reactions Picker
|
|
60
|
+
- Internationalization / Language Support (via )
|
|
61
|
+
|
|
62
|
+
## Internationalization / Localization
|
|
63
|
+
|
|
64
|
+
The emoji picker supports multiple languages (originally via `emojibase-data`). Import the desired language file and pass it to the `EmojiPicker` component via the `emojiData` prop to translate category names and other UI elements.
|
|
65
|
+
|
|
66
|
+
**Keywords**: translation, localization, internationalization, languages, i18n, l10n.
|
|
67
|
+
|
|
68
|
+
### Supported Languages
|
|
69
|
+
|
|
70
|
+
We support a wide range of languages. All data files are available in `dist/data` in the following formats:
|
|
71
|
+
|
|
72
|
+
- **JS (ESM)**: `emojis-en.js` (Export default object)
|
|
73
|
+
- **JSON**: `emojis-en.json`
|
|
74
|
+
- **TypeScript**: `emojis-en.ts`
|
|
75
|
+
|
|
76
|
+
**Available Files:**
|
|
77
|
+
|
|
78
|
+
- `emojis-bn` (Bengali)
|
|
79
|
+
- `emojis-da` (Danish)
|
|
80
|
+
- `emojis-de` (German)
|
|
81
|
+
- `emojis-en-gb` (English, Great Britain)
|
|
82
|
+
- `emojis-en` (English)
|
|
83
|
+
- `emojis-es-mx` (Spanish, Mexico)
|
|
84
|
+
- `emojis-es` (Spanish)
|
|
85
|
+
- `emojis-et` (Estonian)
|
|
86
|
+
- `emojis-fi` (Finnish)
|
|
87
|
+
- `emojis-fr` (French)
|
|
88
|
+
- `emojis-hi` (Hindi)
|
|
89
|
+
- `emojis-hu` (Hungarian)
|
|
90
|
+
- `emojis-it` (Italian)
|
|
91
|
+
- `emojis-ja` (Japanese)
|
|
92
|
+
- `emojis-ko` (Korean)
|
|
93
|
+
- `emojis-lt` (Lithuanian)
|
|
94
|
+
- `emojis-ms` (Malay)
|
|
95
|
+
- `emojis-nb` (Norwegian Bokmål)
|
|
96
|
+
- `emojis-nl` (Dutch)
|
|
97
|
+
- `emojis-pl` (Polish)
|
|
98
|
+
- `emojis-pt` (Portuguese)
|
|
99
|
+
- `emojis-ru` (Russian)
|
|
100
|
+
- `emojis-sv` (Swedish)
|
|
101
|
+
- `emojis-th` (Thai)
|
|
102
|
+
- `emojis-uk` (Ukrainian)
|
|
103
|
+
- `emojis-zh-hant` (Traditional Chinese)
|
|
104
|
+
- `emojis-zh` (Simplified Chinese)
|
|
105
|
+
|
|
106
|
+
### Usage
|
|
107
|
+
|
|
108
|
+
1. Import the emoji data for your language (e.g., Spanish):
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
import EmojiPicker from 'emoji-picker-react';
|
|
112
|
+
// Import the data file for your language
|
|
113
|
+
import es from 'emoji-picker-react/dist/data/emojis-es';
|
|
114
|
+
|
|
115
|
+
function App() {
|
|
116
|
+
return <EmojiPicker emojiData={es} />;
|
|
117
|
+
}
|
|
118
|
+
```
|
|
60
119
|
|
|
61
120
|
# Props
|
|
62
121
|
|
|
63
122
|
The following props are accepted by the picker:
|
|
64
123
|
|
|
65
|
-
| Prop | Type
|
|
66
|
-
| ---------------------- |
|
|
67
|
-
| open | boolean
|
|
68
|
-
| onEmojiClick | function
|
|
69
|
-
| autoFocusSearch | boolean
|
|
70
|
-
| theme | string
|
|
71
|
-
| emojiStyle | string
|
|
72
|
-
| defaultSkinTone | string
|
|
73
|
-
| lazyLoadEmojis | boolean
|
|
74
|
-
| previewConfig | object
|
|
75
|
-
| searchPlaceholder | string
|
|
76
|
-
| searchClearButtonLabel | string
|
|
77
|
-
| suggestedEmojisMode | string
|
|
78
|
-
| skinTonesDisabled | boolean
|
|
79
|
-
| searchDisabled | boolean
|
|
80
|
-
| skinTonePickerLocation | string
|
|
81
|
-
| emojiVersion | string
|
|
82
|
-
| className | string
|
|
83
|
-
| width | number/string
|
|
84
|
-
| height | number/string
|
|
85
|
-
| style | React.CSSProperties
|
|
86
|
-
| getEmojiUrl | Function
|
|
87
|
-
| categories | Array
|
|
88
|
-
| customEmojis | Array<{names: string[], imgUrl: string, id: string}>
|
|
89
|
-
| hiddenEmojis | string[]
|
|
90
|
-
| reactionsDefaultOpen | boolean
|
|
91
|
-
| reactions | string[]
|
|
92
|
-
| onReactionClick | Function
|
|
93
|
-
| allowExpandReactions | boolean
|
|
94
|
-
| onSkinToneChange | Function
|
|
124
|
+
| Prop | Type | Default | Description |
|
|
125
|
+
| ---------------------- | ---------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
126
|
+
| open | boolean | `true` | Controls whether the picker is open or not. |
|
|
127
|
+
| onEmojiClick | function | | Callback function that is called when an emoji is clicked. The function receives the emoji object as a parameter. |
|
|
128
|
+
| autoFocusSearch | boolean | `true` | Controls the auto focus of the search input. |
|
|
129
|
+
| theme | string | `light` | Controls the theme of the picker. Possible values are `light`, `dark` and `auto`. |
|
|
130
|
+
| emojiStyle | string | `apple` | Controls the emoji style. Possible values are `google`, `apple`, `facebook`, `twitter` and `native`. |
|
|
131
|
+
| defaultSkinTone | string | `neutral` | Controls the default skin tone. |
|
|
132
|
+
| lazyLoadEmojis | boolean | `false` | Controls whether the emojis are loaded lazily or not. |
|
|
133
|
+
| previewConfig | object | `{}` | Controls the preview of the emoji. See below for more information. |
|
|
134
|
+
| searchPlaceholder | string | `Search` | Controls the placeholder of the search input. |
|
|
135
|
+
| searchClearButtonLabel | string | 'Clear' | Controls the `aria-label` and `title` of the Clear button of the search input. |
|
|
136
|
+
| suggestedEmojisMode | string | `frequent` | Controls the suggested emojis mode. Possible values are `frequent` and `recent`. |
|
|
137
|
+
| skinTonesDisabled | boolean | `false` | Controls whether the skin tones are disabled or not. |
|
|
138
|
+
| searchDisabled | boolean | `false` | Controls whether the search is disabled or not. When disabled, the skin tone picker will be shown in the preview component. |
|
|
139
|
+
| skinTonePickerLocation | string | `SEARCH` | Controls the location of the skin tone picker. Possible values are `SEARCH` and `PREVIEW`. |
|
|
140
|
+
| emojiVersion | string | - | Allows displaying emojis up to a certain version for compatibility. |
|
|
141
|
+
| className | string | - | Adds a class name to the root element of the picker. |
|
|
142
|
+
| width | number/string | `350` | Controls the width of the picker. You can provide a number that will be treated as pixel size, or your any accepted css width as string. |
|
|
143
|
+
| height | number/string | `450` | Controls the height of the picker. You can provide a number that will be treated as pixel size, or your any accepted css height as string. |
|
|
144
|
+
| style | React.CSSProperties | `{}` | Adds inline style to the root element of the picker. |
|
|
145
|
+
| getEmojiUrl | Function | - | Allows to customize the emoji url and provide your own image host. |
|
|
146
|
+
| categories | Array | - | Allows full config over ordering, naming and display of categories. |
|
|
147
|
+
| customEmojis | Array<{names: string[], imgUrl: string, id: string}> | - | Allows adding custom emojis to the picker. |
|
|
148
|
+
| hiddenEmojis | string[] | - | Controls the emojis that are hidden from the picker. |
|
|
149
|
+
| reactionsDefaultOpen | boolean | `false` | Controls whether the reactions picker is on the initial mount instead of the main picker component. |
|
|
150
|
+
| reactions | string[] | - | Controls the reactions to display in the reactions picker. Takes unified emoji ids |
|
|
151
|
+
| onReactionClick | Function | - | Callback function that is called when a reaction is clicked. The function receives the emoji object as a parameter. If not passed, onEmojiClicked is used. |
|
|
152
|
+
| allowExpandReactions | boolean | `true` | Controls whether the reactions picker can be expanded to the main picker. |
|
|
153
|
+
| onSkinToneChange | Function | - | Callback function that is called when a skin tone is changed. The function receives new picked skin tone as a parameter. |
|
|
154
|
+
| emojiData | object | - | Allows passing a language-specific emoji data object imported from `emoji-picker-react/dist/data/emojis-<lang>`. |
|
|
95
155
|
|
|
96
156
|
## Full details
|
|
97
157
|
|
|
@@ -129,7 +189,6 @@ The following props are accepted by the picker:
|
|
|
129
189
|
- `lazyLoadEmojis`: `boolean` - Whether to lazy load the emojis. Defaults to `false`.
|
|
130
190
|
|
|
131
191
|
- `defaultSkinTone`: `SkinTones` - The default skin tone to use when an emoji is clicked. Defaults to `SkinTones.Neutral`. Possible skin tones are:
|
|
132
|
-
|
|
133
192
|
- ✋ 'neutral'
|
|
134
193
|
- ✋🏻 '1f3fb'
|
|
135
194
|
- ✋🏼 '1f3fc'
|
|
@@ -171,7 +230,6 @@ import { SkinTones } from 'emoji-picker-react';
|
|
|
171
230
|
|
|
172
231
|
- categories: Allows full config over ordering, naming and display of categories.
|
|
173
232
|
To only sort/omit categories, you can simply pass an array of category names to display:
|
|
174
|
-
|
|
175
233
|
- 'suggested',
|
|
176
234
|
- 'custom', - Hidden by default
|
|
177
235
|
- 'smileys_people',
|
|
@@ -189,12 +247,12 @@ import { SkinTones } from 'emoji-picker-react';
|
|
|
189
247
|
[
|
|
190
248
|
{
|
|
191
249
|
category: 'suggested',
|
|
192
|
-
name: 'Recently Used'
|
|
250
|
+
name: 'Recently Used',
|
|
193
251
|
},
|
|
194
252
|
{
|
|
195
253
|
category: 'smileys_people',
|
|
196
|
-
name: 'Faces...'
|
|
197
|
-
}
|
|
254
|
+
name: 'Faces...',
|
|
255
|
+
},
|
|
198
256
|
];
|
|
199
257
|
```
|
|
200
258
|
|
|
@@ -206,7 +264,6 @@ import { SkinTones } from 'emoji-picker-react';
|
|
|
206
264
|
```
|
|
207
265
|
|
|
208
266
|
- `emojiVersion`: `string` - Allows displaying emojis up to a certain version for compatibility. The passed version will be parsed as a float and each emoji will be tested against it. Common values are:
|
|
209
|
-
|
|
210
267
|
- `"0.6"`
|
|
211
268
|
- `"1.0"`
|
|
212
269
|
- `"2.0"`
|
|
@@ -243,26 +300,26 @@ For example:
|
|
|
243
300
|
names: ['Alice', 'alice in wonderland'],
|
|
244
301
|
imgUrl:
|
|
245
302
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/alice.png',
|
|
246
|
-
id: 'alice'
|
|
303
|
+
id: 'alice',
|
|
247
304
|
},
|
|
248
305
|
{
|
|
249
306
|
names: ['Dog'],
|
|
250
307
|
imgUrl:
|
|
251
308
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/dog.png',
|
|
252
|
-
id: 'dog'
|
|
309
|
+
id: 'dog',
|
|
253
310
|
},
|
|
254
311
|
{
|
|
255
312
|
names: ['Hat'],
|
|
256
313
|
imgUrl:
|
|
257
314
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/hat.png',
|
|
258
|
-
id: 'hat'
|
|
315
|
+
id: 'hat',
|
|
259
316
|
},
|
|
260
317
|
{
|
|
261
318
|
names: ['Vest'],
|
|
262
319
|
imgUrl:
|
|
263
320
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/vest.png',
|
|
264
|
-
id: 'vest'
|
|
265
|
-
}
|
|
321
|
+
id: 'vest',
|
|
322
|
+
},
|
|
266
323
|
]}
|
|
267
324
|
/>
|
|
268
325
|
```
|
|
@@ -367,7 +424,7 @@ const Picker = dynamic(
|
|
|
367
424
|
() => {
|
|
368
425
|
return import('emoji-picker-react');
|
|
369
426
|
},
|
|
370
|
-
{ ssr: false }
|
|
427
|
+
{ ssr: false },
|
|
371
428
|
);
|
|
372
429
|
```
|
|
373
430
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataEmoji, DataEmojis } from '../../dataUtils/DataTypes';
|
|
3
|
+
import { Categories, EmojiData, SkinTones } from '../../types/exposedTypes';
|
|
4
|
+
export interface PickerDataContextValue {
|
|
5
|
+
emojiData: EmojiData;
|
|
6
|
+
allEmojis: DataEmojis;
|
|
7
|
+
allEmojisByUnified: Record<string, DataEmoji>;
|
|
8
|
+
searchIndex: Record<string, Record<string, DataEmoji>>;
|
|
9
|
+
emojiByUnified: (unified?: string) => DataEmoji | undefined;
|
|
10
|
+
activeVariationFromUnified: (unified: string) => SkinTones | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function PickerDataProvider({ children, }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
export declare function usePickerDataContext(): PickerDataContextValue;
|
|
16
|
+
export declare function useGetEmojisByCategory(): (category: Categories) => DataEmojis;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Categories, SuggestionMode } from '../types/exposedTypes';
|
|
1
|
+
import { Categories, CategoryConfig, EmojiData, SuggestionMode } from '../types/exposedTypes';
|
|
2
2
|
export { Categories };
|
|
3
3
|
export declare const SuggestedRecent: CategoryConfig;
|
|
4
4
|
export declare type CustomCategoryConfig = {
|
|
@@ -9,12 +9,8 @@ export declare function baseCategoriesConfig(modifiers?: Record<Categories, Cate
|
|
|
9
9
|
export declare function categoryFromCategoryConfig(category: CategoryConfig): Categories;
|
|
10
10
|
export declare function categoryNameFromCategoryConfig(category: CategoryConfig): string;
|
|
11
11
|
export declare type CategoriesConfig = CategoryConfig[];
|
|
12
|
-
export declare type CategoryConfig = {
|
|
13
|
-
category: Categories;
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
12
|
export declare type UserCategoryConfig = Array<Categories | CategoryConfig>;
|
|
17
|
-
export declare function mergeCategoriesConfig(userCategoriesConfig?: UserCategoryConfig, modifiers?: CategoryConfigModifiers): CategoriesConfig;
|
|
13
|
+
export declare function mergeCategoriesConfig(userCategoriesConfig?: UserCategoryConfig, modifiers?: CategoryConfigModifiers, emojiData?: EmojiData): CategoriesConfig;
|
|
18
14
|
declare type CategoryConfigModifiers = {
|
|
19
15
|
suggestionMode?: SuggestionMode;
|
|
20
16
|
};
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GetEmojiUrl } from '../components/emoji/BaseEmojiProps';
|
|
3
|
-
import { EmojiClickData, EmojiStyle, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme } from '../types/exposedTypes';
|
|
3
|
+
import { EmojiClickData, EmojiData, EmojiStyle, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme } from '../types/exposedTypes';
|
|
4
4
|
import { CategoriesConfig } from './categoryConfig';
|
|
5
5
|
import { CustomEmoji } from './customEmojiConfig';
|
|
6
6
|
export declare const DEFAULT_SEARCH_PLACEHOLDER = "Search";
|
|
@@ -39,6 +39,7 @@ export declare type PickerConfigInternal = {
|
|
|
39
39
|
open: boolean;
|
|
40
40
|
allowExpandReactions: boolean;
|
|
41
41
|
hiddenEmojis: string[];
|
|
42
|
+
emojiData?: EmojiData;
|
|
42
43
|
};
|
|
43
44
|
export declare type PreviewConfig = {
|
|
44
45
|
defaultEmoji: string;
|