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