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.
Files changed (217) hide show
  1. package/README.md +99 -42
  2. package/dist/components/body/EmojiCategory.d.ts +1 -1
  3. package/dist/components/context/PickerDataContext.d.ts +16 -0
  4. package/dist/components/navigation/CategoryButton.d.ts +1 -1
  5. package/dist/config/categoryConfig.d.ts +2 -6
  6. package/dist/config/config.d.ts +2 -1
  7. package/dist/data/emojis-bn.d.ts +3 -0
  8. package/dist/data/emojis-bn.js +2 -0
  9. package/dist/data/emojis-bn.json +1 -0
  10. package/dist/data/emojis-bn.ts +3 -0
  11. package/dist/data/emojis-da.d.ts +3 -0
  12. package/dist/data/emojis-da.js +2 -0
  13. package/dist/data/emojis-da.json +1 -0
  14. package/dist/data/emojis-da.ts +3 -0
  15. package/dist/data/emojis-de.d.ts +3 -0
  16. package/dist/data/emojis-de.js +2 -0
  17. package/dist/data/emojis-de.json +1 -0
  18. package/dist/data/emojis-de.ts +3 -0
  19. package/dist/data/emojis-en-gb.d.ts +3 -0
  20. package/dist/data/emojis-en-gb.js +2 -0
  21. package/dist/data/emojis-en-gb.json +1 -0
  22. package/dist/data/emojis-en-gb.ts +3 -0
  23. package/dist/data/emojis-en.d.ts +3 -0
  24. package/dist/data/emojis-en.js +2 -0
  25. package/dist/data/emojis-en.json +1 -0
  26. package/dist/data/emojis-en.ts +3 -0
  27. package/dist/data/emojis-es-mx.d.ts +3 -0
  28. package/dist/data/emojis-es-mx.js +2 -0
  29. package/dist/data/emojis-es-mx.json +1 -0
  30. package/dist/data/emojis-es-mx.ts +3 -0
  31. package/dist/data/emojis-es.d.ts +3 -0
  32. package/dist/data/emojis-es.js +2 -0
  33. package/dist/data/emojis-es.json +1 -0
  34. package/dist/data/emojis-es.ts +3 -0
  35. package/dist/data/emojis-et.d.ts +3 -0
  36. package/dist/data/emojis-et.js +2 -0
  37. package/dist/data/emojis-et.json +1 -0
  38. package/dist/data/emojis-et.ts +3 -0
  39. package/dist/data/emojis-fi.d.ts +3 -0
  40. package/dist/data/emojis-fi.js +2 -0
  41. package/dist/data/emojis-fi.json +1 -0
  42. package/dist/data/emojis-fi.ts +3 -0
  43. package/dist/data/emojis-fr.d.ts +3 -0
  44. package/dist/data/emojis-fr.js +2 -0
  45. package/dist/data/emojis-fr.json +1 -0
  46. package/dist/data/emojis-fr.ts +3 -0
  47. package/dist/data/emojis-hi.d.ts +3 -0
  48. package/dist/data/emojis-hi.js +2 -0
  49. package/dist/data/emojis-hi.json +1 -0
  50. package/dist/data/emojis-hi.ts +3 -0
  51. package/dist/data/emojis-hu.d.ts +3 -0
  52. package/dist/data/emojis-hu.js +2 -0
  53. package/dist/data/emojis-hu.json +1 -0
  54. package/dist/data/emojis-hu.ts +3 -0
  55. package/dist/data/emojis-it.d.ts +3 -0
  56. package/dist/data/emojis-it.js +2 -0
  57. package/dist/data/emojis-it.json +1 -0
  58. package/dist/data/emojis-it.ts +3 -0
  59. package/dist/data/emojis-ja.d.ts +3 -0
  60. package/dist/data/emojis-ja.js +2 -0
  61. package/dist/data/emojis-ja.json +1 -0
  62. package/dist/data/emojis-ja.ts +3 -0
  63. package/dist/data/emojis-ko.d.ts +3 -0
  64. package/dist/data/emojis-ko.js +2 -0
  65. package/dist/data/emojis-ko.json +1 -0
  66. package/dist/data/emojis-ko.ts +3 -0
  67. package/dist/data/emojis-lt.d.ts +3 -0
  68. package/dist/data/emojis-lt.js +2 -0
  69. package/dist/data/emojis-lt.json +1 -0
  70. package/dist/data/emojis-lt.ts +3 -0
  71. package/dist/data/emojis-ms.d.ts +3 -0
  72. package/dist/data/emojis-ms.js +2 -0
  73. package/dist/data/emojis-ms.json +1 -0
  74. package/dist/data/emojis-ms.ts +3 -0
  75. package/dist/data/emojis-nb.d.ts +3 -0
  76. package/dist/data/emojis-nb.js +2 -0
  77. package/dist/data/emojis-nb.json +1 -0
  78. package/dist/data/emojis-nb.ts +3 -0
  79. package/dist/data/emojis-nl.d.ts +3 -0
  80. package/dist/data/emojis-nl.js +2 -0
  81. package/dist/data/emojis-nl.json +1 -0
  82. package/dist/data/emojis-nl.ts +3 -0
  83. package/dist/data/emojis-pl.d.ts +3 -0
  84. package/dist/data/emojis-pl.js +2 -0
  85. package/dist/data/emojis-pl.json +1 -0
  86. package/dist/data/emojis-pl.ts +3 -0
  87. package/dist/data/emojis-pt.d.ts +3 -0
  88. package/dist/data/emojis-pt.js +2 -0
  89. package/dist/data/emojis-pt.json +1 -0
  90. package/dist/data/emojis-pt.ts +3 -0
  91. package/dist/data/emojis-ru.d.ts +3 -0
  92. package/dist/data/emojis-ru.js +2 -0
  93. package/dist/data/emojis-ru.json +1 -0
  94. package/dist/data/emojis-ru.ts +3 -0
  95. package/dist/data/emojis-sv.d.ts +3 -0
  96. package/dist/data/emojis-sv.js +2 -0
  97. package/dist/data/emojis-sv.json +1 -0
  98. package/dist/data/emojis-sv.ts +3 -0
  99. package/dist/data/emojis-th.d.ts +3 -0
  100. package/dist/data/emojis-th.js +2 -0
  101. package/dist/data/emojis-th.json +1 -0
  102. package/dist/data/emojis-th.ts +3 -0
  103. package/dist/data/emojis-uk.d.ts +3 -0
  104. package/dist/data/emojis-uk.js +2 -0
  105. package/dist/data/emojis-uk.json +1 -0
  106. package/dist/data/emojis-uk.ts +3 -0
  107. package/dist/data/emojis-zh-hant.d.ts +3 -0
  108. package/dist/data/emojis-zh-hant.js +2 -0
  109. package/dist/data/emojis-zh-hant.json +1 -0
  110. package/dist/data/emojis-zh-hant.ts +3 -0
  111. package/dist/data/emojis-zh.d.ts +3 -0
  112. package/dist/data/emojis-zh.js +2 -0
  113. package/dist/data/emojis-zh.json +1 -0
  114. package/dist/data/emojis-zh.ts +3 -0
  115. package/dist/data/emojis.d.ts +102 -50
  116. package/dist/data/emojis.js +1 -0
  117. package/dist/data/emojis.json +1 -0
  118. package/dist/data/emojis.ts +1 -0
  119. package/dist/data/groups.d.ts +2 -2
  120. package/dist/data/groups.js +11 -0
  121. package/dist/data/groups.ts +12 -0
  122. package/dist/data/skinToneVariations.d.ts +5 -5
  123. package/dist/data/skinToneVariations.js +17 -0
  124. package/dist/data/skinToneVariations.ts +31 -0
  125. package/dist/dataUtils/DataTypes.d.ts +2 -2
  126. package/dist/dataUtils/emojiUtils.d.ts +12 -0
  127. package/dist/emoji-picker-react.cjs.development.js +20120 -17359
  128. package/dist/emoji-picker-react.cjs.development.js.map +1 -1
  129. package/dist/emoji-picker-react.cjs.production.min.js +1 -1
  130. package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
  131. package/dist/emoji-picker-react.esm.js +20121 -17360
  132. package/dist/emoji-picker-react.esm.js.map +1 -1
  133. package/dist/typeRefinements/typeRefinements.d.ts +2 -1
  134. package/dist/types/exposedTypes.d.ts +64 -50
  135. package/dist/types/exposedTypes.js +46 -0
  136. package/package.json +9 -5
  137. package/src/EmojiPickerReact.tsx +4 -1
  138. package/src/components/Reactions/Reactions.tsx +28 -20
  139. package/src/components/body/EmojiCategory.tsx +1 -1
  140. package/src/components/body/EmojiList.tsx +3 -5
  141. package/src/components/context/PickerConfigContext.tsx +2 -1
  142. package/src/components/context/PickerContext.tsx +7 -2
  143. package/src/components/context/PickerDataContext.tsx +157 -0
  144. package/src/components/emoji/ClickableEmojiButton.tsx +1 -3
  145. package/src/components/emoji/ViewOnlyEmoji.tsx +4 -5
  146. package/src/components/footer/Preview.tsx +6 -6
  147. package/src/components/navigation/CategoryButton.tsx +2 -4
  148. package/src/config/categoryConfig.ts +47 -30
  149. package/src/config/compareConfig.ts +3 -2
  150. package/src/config/config.ts +31 -15
  151. package/src/data/emojis-bn.json +1 -0
  152. package/src/data/emojis-bn.ts +3 -0
  153. package/src/data/emojis-da.json +1 -0
  154. package/src/data/emojis-da.ts +3 -0
  155. package/src/data/emojis-de.json +1 -0
  156. package/src/data/emojis-de.ts +3 -0
  157. package/src/data/emojis-en-gb.json +1 -0
  158. package/src/data/emojis-en-gb.ts +3 -0
  159. package/src/data/emojis-en.json +1 -0
  160. package/src/data/emojis-en.ts +3 -0
  161. package/src/data/emojis-es-mx.json +1 -0
  162. package/src/data/emojis-es-mx.ts +3 -0
  163. package/src/data/emojis-es.json +1 -0
  164. package/src/data/emojis-es.ts +3 -0
  165. package/src/data/emojis-et.json +1 -0
  166. package/src/data/emojis-et.ts +3 -0
  167. package/src/data/emojis-fi.json +1 -0
  168. package/src/data/emojis-fi.ts +3 -0
  169. package/src/data/emojis-fr.json +1 -0
  170. package/src/data/emojis-fr.ts +3 -0
  171. package/src/data/emojis-hi.json +1 -0
  172. package/src/data/emojis-hi.ts +3 -0
  173. package/src/data/emojis-hu.json +1 -0
  174. package/src/data/emojis-hu.ts +3 -0
  175. package/src/data/emojis-it.json +1 -0
  176. package/src/data/emojis-it.ts +3 -0
  177. package/src/data/emojis-ja.json +1 -0
  178. package/src/data/emojis-ja.ts +3 -0
  179. package/src/data/emojis-ko.json +1 -0
  180. package/src/data/emojis-ko.ts +3 -0
  181. package/src/data/emojis-lt.json +1 -0
  182. package/src/data/emojis-lt.ts +3 -0
  183. package/src/data/emojis-ms.json +1 -0
  184. package/src/data/emojis-ms.ts +3 -0
  185. package/src/data/emojis-nb.json +1 -0
  186. package/src/data/emojis-nb.ts +3 -0
  187. package/src/data/emojis-nl.json +1 -0
  188. package/src/data/emojis-nl.ts +3 -0
  189. package/src/data/emojis-pl.json +1 -0
  190. package/src/data/emojis-pl.ts +3 -0
  191. package/src/data/emojis-pt.json +1 -0
  192. package/src/data/emojis-pt.ts +3 -0
  193. package/src/data/emojis-ru.json +1 -0
  194. package/src/data/emojis-ru.ts +3 -0
  195. package/src/data/emojis-sv.json +1 -0
  196. package/src/data/emojis-sv.ts +3 -0
  197. package/src/data/emojis-th.json +1 -0
  198. package/src/data/emojis-th.ts +3 -0
  199. package/src/data/emojis-uk.json +1 -0
  200. package/src/data/emojis-uk.ts +3 -0
  201. package/src/data/emojis-zh-hant.json +1 -0
  202. package/src/data/emojis-zh-hant.ts +3 -0
  203. package/src/data/emojis-zh.json +1 -0
  204. package/src/data/emojis-zh.ts +3 -0
  205. package/src/data/emojis.json +1 -1
  206. package/src/data/emojis.ts +1 -1
  207. package/src/dataUtils/DataTypes.ts +2 -2
  208. package/src/dataUtils/alphaNumericEmojiIndex.ts +1 -8
  209. package/src/dataUtils/emojiSelectors.ts +24 -25
  210. package/src/dataUtils/emojiUtils.ts +74 -0
  211. package/src/hooks/preloadEmoji.ts +1 -1
  212. package/src/hooks/useDisallowedEmojis.ts +4 -3
  213. package/src/hooks/useEmojiVirtualization.tsx +2 -3
  214. package/src/hooks/useFilter.ts +1 -1
  215. package/src/hooks/useIsEmojiHidden.ts +1 -1
  216. package/src/typeRefinements/typeRefinements.ts +2 -5
  217. 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 | Default | Description |
66
- | ---------------------- | ------------------------------------------------------ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
67
- | open | boolean | `true` | Controls whether the picker is open or not. |
68
- | onEmojiClick | function | | Callback function that is called when an emoji is clicked. The function receives the emoji object as a parameter. |
69
- | autoFocusSearch | boolean | `true` | Controls the auto focus of the search input. |
70
- | theme | string | `light` | Controls the theme of the picker. Possible values are `light`, `dark` and `auto`. |
71
- | emojiStyle | string | `apple` | Controls the emoji style. Possible values are `google`, `apple`, `facebook`, `twitter` and `native`. |
72
- | defaultSkinTone | string | `neutral` | Controls the default skin tone. |
73
- | lazyLoadEmojis | boolean | `false` | Controls whether the emojis are loaded lazily or not. |
74
- | previewConfig | object | `{}` | Controls the preview of the emoji. See below for more information. |
75
- | searchPlaceholder | string | `Search` | Controls the placeholder of the search input. |
76
- | searchClearButtonLabel | string | 'Clear' | Controls the `aria-label` and `title` of the Clear button of the search input. |
77
- | suggestedEmojisMode | string | `frequent` | Controls the suggested emojis mode. Possible values are `frequent` and `recent`. |
78
- | skinTonesDisabled | boolean | `false` | Controls whether the skin tones are disabled or not. |
79
- | searchDisabled | boolean | `false` | Controls whether the search is disabled or not. When disabled, the skin tone picker will be shown in the preview component. |
80
- | skinTonePickerLocation | string | `SEARCH` | Controls the location of the skin tone picker. Possible values are `SEARCH` and `PREVIEW`. |
81
- | emojiVersion | string | - | Allows displaying emojis up to a certain version for compatibility. |
82
- | className | string | - | Adds a class name to the root element of the picker. |
83
- | 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. |
84
- | 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. |
85
- | style | React.CSSProperties | `{}` | Adds inline style to the root element of the picker. |
86
- | getEmojiUrl | Function | - | Allows to customize the emoji url and provide your own image host. |
87
- | categories | Array | - | Allows full config over ordering, naming and display of categories. |
88
- | customEmojis | Array<{names: string[], imgUrl: string, id: string}> | - | Allows adding custom emojis to the picker. |
89
- | hiddenEmojis | string[] | - | Controls the emojis that are hidden from the picker. |
90
- | reactionsDefaultOpen | boolean | `false` | Controls whether the reactions picker is on the initial mount instead of the main picker component. |
91
- | reactions | string[] | - | Controls the reactions to display in the reactions picker. Takes unified emoji ids |
92
- | 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. |
93
- | allowExpandReactions | boolean | `true` | Controls whether the reactions picker can be expanded to the main picker. |
94
- | onSkinToneChange | Function | - | Callback function that is called when a skin tone is changed. The function receives new picked skin tone as a parameter. |
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
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { CategoryConfig } from '../../config/categoryConfig';
2
+ import { CategoryConfig } from '../../types/exposedTypes';
3
3
  declare type Props = Readonly<{
4
4
  categoryConfig: CategoryConfig;
5
5
  children?: React.ReactNode;
@@ -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,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CategoryConfig } from '../../config/categoryConfig';
2
+ import { CategoryConfig } from '../../types/exposedTypes';
3
3
  declare type Props = {
4
4
  isActiveCategory: boolean;
5
5
  category: string;
@@ -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
  };
@@ -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;
@@ -0,0 +1,3 @@
1
+ import { EmojiData } from '../types/exposedTypes';
2
+ declare const data: EmojiData;
3
+ export default data;