emoji-picker-react 4.9.3 → 4.10.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 CHANGED
@@ -85,6 +85,7 @@ The following props are accepted by them picker:
85
85
  | getEmojiUrl | `Function` | - | Allows to customize the emoji url and provide your own image host. |
86
86
  | categories | `Array` | - | Allows full config over ordering, naming and display of categories. |
87
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. |
88
89
  | reactionsDefaultOpen | `boolean` | `false` | Controls whether the reactions picker is on the initial mount instead of the main picker component. |
89
90
  | reactions | string[] | - | Controls the reactions to display in the reactions picker. Takes unified emoji ids |
90
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. |
@@ -212,13 +213,23 @@ import { SkinTones } from 'emoji-picker-react';
212
213
 
213
214
  - `getEmojiUrl`: `(unified: string, emojiStyle: EmojiStyle) => string` - Allows to customize the emoji url and provide your own image host. The function receives the emoji unified and the emoji style as parameters. The function should return the url of the emoji image.
214
215
 
215
- ## Custom Emojis
216
+ ## customEmojis - Custom Emojis
216
217
 
217
218
  The customEmojis prop allows you to add custom emojis to the picker. The custom emojis prop takes an array of custom emojis, each custom emoji has three keys:
218
219
 
219
- id: Unique identifier for each of the custom emojis
220
- names: an array of string identifiers, will be used both for display, search and indexing.
221
- imgUrl: URL for the emoji image
220
+ - _id_: Unique identifier for each of the custom emojis
221
+ - _names_: an array of string identifiers, will be used both for display, search and indexing.
222
+ - _imgUrl_: URL for the emoji image
223
+
224
+ ## hiddenEmojis - Excluding certain emojis
225
+
226
+ The hiddenEmojis prop allows you to hide emojis from the picker. The hidden emojis prop takes an array of emoji unicode names to hide.
227
+
228
+ For example:
229
+
230
+ ```js
231
+ ['1f600', '1f601', '1f602']; // will remove: 😀, 😁, 😂
232
+ ```
222
233
 
223
234
  ### Usage Example
224
235
 
@@ -1,10 +1,10 @@
1
1
  import { Styles } from 'flairup';
2
2
  import * as React from 'react';
3
3
  export declare const stylesheet: {
4
- create: <K extends string>(styles: Partial<{ [k in K]: Partial<Partial<CSSStyleDeclaration> & Partial<{
4
+ create: <K extends string>(styles: Partial<{ [k in K]: Partial<Partial<CSSStyleDeclaration>> | Partial<{
5
5
  '.'?: string | string[] | undefined;
6
6
  '--'?: any;
7
- }>>; }> | Partial<{}>) => Record<Exclude<Exclude<K, any>, any>, Set<string>> & Record<never, Set<string>>;
7
+ }>; }> | Partial<{}>) => Record<Exclude<Exclude<K, any>, any>, Set<string>> & Record<never, Set<string>>;
8
8
  getStyle: () => string;
9
9
  isApplied: () => boolean;
10
10
  };
@@ -13,17 +13,11 @@ export declare const PickerStyleTag: React.NamedExoticComponent<object>;
13
13
  export declare const commonInteractionStyles: Record<never, Set<string>>;
14
14
  export declare function darkMode(key: string, value: Styles): {
15
15
  '.epr-dark-theme': {
16
- [x: string]: Partial<Partial<CSSStyleDeclaration> & Partial<{
17
- '.'?: string | string[] | undefined;
18
- '--'?: any;
19
- }>>;
16
+ [x: string]: Partial<Partial<CSSStyleDeclaration>>;
20
17
  };
21
18
  '.epr-auto-theme': {
22
19
  [x: string]: {
23
- '@media (prefers-color-scheme: dark)': Partial<Partial<CSSStyleDeclaration> & Partial<{
24
- '.'?: string | string[] | undefined;
25
- '--'?: any;
26
- }>>;
20
+ '@media (prefers-color-scheme: dark)': Partial<Partial<CSSStyleDeclaration>>;
27
21
  };
28
22
  };
29
23
  };
@@ -36,6 +36,7 @@ export declare type PickerConfigInternal = {
36
36
  reactions: string[];
37
37
  open: boolean;
38
38
  allowExpandReactions: boolean;
39
+ hiddenEmojis: string[];
39
40
  };
40
41
  export declare type PreviewConfig = {
41
42
  defaultEmoji: string;
@@ -166,7 +166,6 @@ var commonInteractionStyles = /*#__PURE__*/stylesheet.create({
166
166
  opacity: '1',
167
167
  backgroundPositionY: 'var(--epr-category-navigation-button-size)'
168
168
  },
169
- // @ts-ignore
170
169
  '&.epr-active': {
171
170
  opacity: '1',
172
171
  backgroundPositionY: 'var(--epr-category-navigation-button-size)'
@@ -16811,6 +16810,9 @@ function mergeConfig(userConfig) {
16811
16810
  var categories = mergeCategoriesConfig(userConfig.categories, {
16812
16811
  suggestionMode: config.suggestedEmojisMode
16813
16812
  });
16813
+ config.hiddenEmojis.forEach(function (emoji) {
16814
+ config.unicodeToHide.add(emoji);
16815
+ });
16814
16816
  setCustomEmojis((_config$customEmojis = config.customEmojis) != null ? _config$customEmojis : []);
16815
16817
  var skinTonePickerLocation = config.searchDisabled ? exports.SkinTonePickerLocation.PREVIEW : config.skinTonePickerLocation;
16816
16818
  return _extends({}, config, {
@@ -16845,7 +16847,8 @@ function basePickerConfig() {
16845
16847
  reactionsDefaultOpen: false,
16846
16848
  reactions: DEFAULT_REACTIONS,
16847
16849
  open: true,
16848
- allowExpandReactions: true
16850
+ allowExpandReactions: true,
16851
+ hiddenEmojis: []
16849
16852
  };
16850
16853
  }
16851
16854
  var basePreviewConfig = {
@@ -18197,7 +18200,6 @@ var styles = /*#__PURE__*/stylesheet.create({
18197
18200
  backgroundColor: 'var(--epr-bg-color)',
18198
18201
  overflow: 'hidden',
18199
18202
  transition: 'all 0.3s ease-in-out, background-color 0.1s ease-in-out',
18200
- // @ts-expect-error - need to work on this
18201
18203
  '*': {
18202
18204
  boxSizing: 'border-box',
18203
18205
  fontFamily: 'sans-serif'
@@ -18297,7 +18299,7 @@ var styles = /*#__PURE__*/stylesheet.create({
18297
18299
  height: '50px',
18298
18300
  display: 'inline-flex',
18299
18301
  backgroundColor: 'var(--epr-reactions-bg-color)',
18300
- // @ts-expect-error - need to work on this
18302
+ // @ts-ignore - backdropFilter is not recognized.
18301
18303
  backdropFilter: 'blur(8px)',
18302
18304
  '--': {
18303
18305
  '--epr-picker-border-radius': '50px'
@@ -19093,7 +19095,6 @@ var styles$5 = /*#__PURE__*/stylesheet.create( /*#__PURE__*/_extends({
19093
19095
  ':hover': {
19094
19096
  color: 'var(--epr-highlight-color)',
19095
19097
  backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
19096
- // @ts-ignore
19097
19098
  ':after': {
19098
19099
  backgroundPositionY: '-20px'
19099
19100
  }
@@ -19101,7 +19102,6 @@ var styles$5 = /*#__PURE__*/stylesheet.create( /*#__PURE__*/_extends({
19101
19102
  ':focus': {
19102
19103
  color: 'var(--epr-highlight-color)',
19103
19104
  backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
19104
- // @ts-ignore
19105
19105
  ':after': {
19106
19106
  backgroundPositionY: '-40px'
19107
19107
  }
@@ -19238,7 +19238,7 @@ var styles$7 = /*#__PURE__*/stylesheet.create({
19238
19238
  label: {
19239
19239
  '.': ClassNames.label,
19240
19240
  alignItems: 'center',
19241
- // @ts-expect-error - backdropFilter is a valid CSS property
19241
+ // @ts-ignore - backdropFilter is not recognized.
19242
19242
  backdropFilter: 'blur(3px)',
19243
19243
  backgroundColor: 'var(--epr-category-label-bg-color)',
19244
19244
  color: 'var(--epr-category-label-text-color)',
@@ -19765,7 +19765,6 @@ var styles$c = /*#__PURE__*/stylesheet.create({
19765
19765
  ':focus': {
19766
19766
  boxShadow: '0 0 0 3px var(--epr-focus-bg-color)'
19767
19767
  },
19768
- // @ts-ignore
19769
19768
  '&.epr-tone-neutral': {
19770
19769
  backgroundColor: '#ffd225'
19771
19770
  },
@@ -19885,10 +19884,9 @@ var styles$d = /*#__PURE__*/stylesheet.create({
19885
19884
  boxShadow: '0px 0 7px var(--epr-picker-border-color)'
19886
19885
  },
19887
19886
  open: {
19888
- // @ts-ignore
19887
+ // @ts-ignore - backdropFilter is not recognized.
19889
19888
  backdropFilter: 'blur(5px)',
19890
19889
  background: 'var(--epr-skin-tone-picker-menu-color)',
19891
- // @ts-ignore
19892
19890
  '.epr-active:after': {
19893
19891
  content: '',
19894
19892
  position: 'absolute',
@@ -19905,7 +19903,6 @@ var styles$d = /*#__PURE__*/stylesheet.create({
19905
19903
  position: 'relative',
19906
19904
  width: 'var(--epr-skin-tone-size)',
19907
19905
  height: 'var(--epr-skin-tone-size)',
19908
- // @ts-ignore
19909
19906
  '> button': {
19910
19907
  width: 'var(--epr-skin-tone-size)',
19911
19908
  display: 'block',
@@ -20112,7 +20109,6 @@ var styles$f = /*#__PURE__*/stylesheet.create( /*#__PURE__*/_extends({
20112
20109
  border: '2px solid var(--epr-category-icon-active-color)',
20113
20110
  borderRadius: '50%'
20114
20111
  },
20115
- // @ts-ignore
20116
20112
  '&.epr-icn-suggested': {
20117
20113
  backgroundPositionX: 'calc(var(--epr-category-navigation-button-size) * -8)'
20118
20114
  },