emoji-picker-react 4.16.0 → 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 +101 -41
- 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 +4 -1
- package/dist/config/useConfig.d.ts +1 -0
- 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 +20142 -17373
- 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 +20143 -17374
- 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 +3 -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/header/Search/BtnClearSearch.tsx +4 -2
- package/src/components/navigation/CategoryButton.tsx +2 -4
- package/src/config/categoryConfig.ts +47 -30
- package/src/config/compareConfig.ts +4 -2
- package/src/config/config.ts +34 -15
- package/src/config/useConfig.ts +6 -0
- 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,40 +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
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
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>`. |
|
|
94
155
|
|
|
95
156
|
## Full details
|
|
96
157
|
|
|
@@ -128,7 +189,6 @@ The following props are accepted by the picker:
|
|
|
128
189
|
- `lazyLoadEmojis`: `boolean` - Whether to lazy load the emojis. Defaults to `false`.
|
|
129
190
|
|
|
130
191
|
- `defaultSkinTone`: `SkinTones` - The default skin tone to use when an emoji is clicked. Defaults to `SkinTones.Neutral`. Possible skin tones are:
|
|
131
|
-
|
|
132
192
|
- ✋ 'neutral'
|
|
133
193
|
- ✋🏻 '1f3fb'
|
|
134
194
|
- ✋🏼 '1f3fc'
|
|
@@ -166,9 +226,10 @@ import { SkinTones } from 'emoji-picker-react';
|
|
|
166
226
|
|
|
167
227
|
- `searchPlaceholder`: `string` - The placeholder text for the search input. Defaults to `Search`.
|
|
168
228
|
|
|
229
|
+
- `searchClearButtonLabel`: `string` - The `aria-label` and `title` text for the search input clear button. Defaults to `Clear`.
|
|
230
|
+
|
|
169
231
|
- categories: Allows full config over ordering, naming and display of categories.
|
|
170
232
|
To only sort/omit categories, you can simply pass an array of category names to display:
|
|
171
|
-
|
|
172
233
|
- 'suggested',
|
|
173
234
|
- 'custom', - Hidden by default
|
|
174
235
|
- 'smileys_people',
|
|
@@ -186,12 +247,12 @@ import { SkinTones } from 'emoji-picker-react';
|
|
|
186
247
|
[
|
|
187
248
|
{
|
|
188
249
|
category: 'suggested',
|
|
189
|
-
name: 'Recently Used'
|
|
250
|
+
name: 'Recently Used',
|
|
190
251
|
},
|
|
191
252
|
{
|
|
192
253
|
category: 'smileys_people',
|
|
193
|
-
name: 'Faces...'
|
|
194
|
-
}
|
|
254
|
+
name: 'Faces...',
|
|
255
|
+
},
|
|
195
256
|
];
|
|
196
257
|
```
|
|
197
258
|
|
|
@@ -203,7 +264,6 @@ import { SkinTones } from 'emoji-picker-react';
|
|
|
203
264
|
```
|
|
204
265
|
|
|
205
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:
|
|
206
|
-
|
|
207
267
|
- `"0.6"`
|
|
208
268
|
- `"1.0"`
|
|
209
269
|
- `"2.0"`
|
|
@@ -240,26 +300,26 @@ For example:
|
|
|
240
300
|
names: ['Alice', 'alice in wonderland'],
|
|
241
301
|
imgUrl:
|
|
242
302
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/alice.png',
|
|
243
|
-
id: 'alice'
|
|
303
|
+
id: 'alice',
|
|
244
304
|
},
|
|
245
305
|
{
|
|
246
306
|
names: ['Dog'],
|
|
247
307
|
imgUrl:
|
|
248
308
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/dog.png',
|
|
249
|
-
id: 'dog'
|
|
309
|
+
id: 'dog',
|
|
250
310
|
},
|
|
251
311
|
{
|
|
252
312
|
names: ['Hat'],
|
|
253
313
|
imgUrl:
|
|
254
314
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/hat.png',
|
|
255
|
-
id: 'hat'
|
|
315
|
+
id: 'hat',
|
|
256
316
|
},
|
|
257
317
|
{
|
|
258
318
|
names: ['Vest'],
|
|
259
319
|
imgUrl:
|
|
260
320
|
'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/vest.png',
|
|
261
|
-
id: 'vest'
|
|
262
|
-
}
|
|
321
|
+
id: 'vest',
|
|
322
|
+
},
|
|
263
323
|
]}
|
|
264
324
|
/>
|
|
265
325
|
```
|
|
@@ -364,7 +424,7 @@ const Picker = dynamic(
|
|
|
364
424
|
() => {
|
|
365
425
|
return import('emoji-picker-react');
|
|
366
426
|
},
|
|
367
|
-
{ ssr: false }
|
|
427
|
+
{ ssr: false },
|
|
368
428
|
);
|
|
369
429
|
```
|
|
370
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,9 +1,10 @@
|
|
|
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";
|
|
7
|
+
export declare const DEFAULT_SEARCH_CLEAR_BUTTON_LABEL = "Clear";
|
|
7
8
|
export declare const SEARCH_RESULTS_NO_RESULTS_FOUND = "No results found";
|
|
8
9
|
export declare const SEARCH_RESULTS_SUFFIX = " found. Use up and down arrow keys to navigate.";
|
|
9
10
|
export declare const SEARCH_RESULTS_ONE_RESULT_FOUND: string;
|
|
@@ -14,6 +15,7 @@ export declare type PickerConfigInternal = {
|
|
|
14
15
|
emojiVersion: string | null;
|
|
15
16
|
searchPlaceHolder: string;
|
|
16
17
|
searchPlaceholder: string;
|
|
18
|
+
searchClearButtonLabel: string;
|
|
17
19
|
defaultSkinTone: SkinTones;
|
|
18
20
|
skinTonesDisabled: boolean;
|
|
19
21
|
autoFocusSearch: boolean;
|
|
@@ -37,6 +39,7 @@ export declare type PickerConfigInternal = {
|
|
|
37
39
|
open: boolean;
|
|
38
40
|
allowExpandReactions: boolean;
|
|
39
41
|
hiddenEmojis: string[];
|
|
42
|
+
emojiData?: EmojiData;
|
|
40
43
|
};
|
|
41
44
|
export declare type PreviewConfig = {
|
|
42
45
|
defaultEmoji: string;
|
|
@@ -8,6 +8,7 @@ export declare enum MOUSE_EVENT_SOURCE {
|
|
|
8
8
|
PICKER = "picker"
|
|
9
9
|
}
|
|
10
10
|
export declare function useSearchPlaceHolderConfig(): string;
|
|
11
|
+
export declare function useSearchClearButtonLabelConfig(): string;
|
|
11
12
|
export declare function useDefaultSkinToneConfig(): SkinTones;
|
|
12
13
|
export declare function useAllowExpandReactions(): boolean;
|
|
13
14
|
export declare function useSkinTonesDisabledConfig(): boolean;
|