emoji-picker-react 4.4.9 → 4.4.10

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.
@@ -0,0 +1 @@
1
+ export declare function useIsUnicodeHidden(): (emojiUnified: string) => boolean;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.4.9",
2
+ "version": "4.4.10",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -8,7 +8,7 @@ export enum ClassNames {
8
8
  category = 'epr-emoji-category',
9
9
  label = 'epr-emoji-category-label',
10
10
  categoryContent = 'epr-emoji-category-content',
11
- emojiHasVariatios = 'epr-emoji-has-variations',
11
+ emojiHasVariations = 'epr-emoji-has-variations',
12
12
  scrollBody = 'epr-body',
13
13
  emojiList = 'epr-emoji-list',
14
14
  external = '__EmojiPicker__',
@@ -113,11 +113,11 @@ export function isEmojiBehindLabel(emoji: NullableElement): boolean {
113
113
  }
114
114
 
115
115
  export function queryScrollBody(root: NullableElement): NullableElement {
116
- return root
117
- ? root.matches(asSelectors(ClassNames.scrollBody))
118
- ? root
119
- : root.querySelector(asSelectors(ClassNames.scrollBody))
120
- : null;
116
+ if (!root) return null;
117
+
118
+ return root.matches(asSelectors(ClassNames.scrollBody))
119
+ ? root
120
+ : root.querySelector(asSelectors(ClassNames.scrollBody));
121
121
  }
122
122
 
123
123
  export function emojiDistanceFromScrollTop(emoji: NullableElement): number {
@@ -53,7 +53,7 @@ export function EmojiVariationPicker() {
53
53
  emoji &&
54
54
  button &&
55
55
  emojiHasVariations(emoji) &&
56
- button.classList.contains(ClassNames.emojiHasVariatios);
56
+ button.classList.contains(ClassNames.emojiHasVariations);
57
57
 
58
58
  useEffect(() => {
59
59
  if (!visible) {
@@ -7,7 +7,7 @@ import {
7
7
  useSuggestedEmojisModeConfig,
8
8
  } from '../../config/useConfig';
9
9
  import { emojiByUnified } from '../../dataUtils/emojiSelectors';
10
- import { getsuggested } from '../../dataUtils/suggested';
10
+ import { getSuggested } from '../../dataUtils/suggested';
11
11
  import { useUpdateSuggested } from '../context/PickerContext';
12
12
  import { ClickableEmoji } from '../emoji/Emoji';
13
13
 
@@ -22,7 +22,7 @@ export function Suggested({ categoryConfig }: Props) {
22
22
  const suggestedEmojisModeConfig = useSuggestedEmojisModeConfig();
23
23
  const getEmojiUrl = useGetEmojiUrlConfig();
24
24
  const suggested = React.useMemo(
25
- () => getsuggested(suggestedEmojisModeConfig) ?? [],
25
+ () => getSuggested(suggestedEmojisModeConfig) ?? [],
26
26
  // eslint-disable-next-line react-hooks/exhaustive-deps
27
27
  [suggestedUpdated, suggestedEmojisModeConfig]
28
28
  );
@@ -53,7 +53,7 @@ export function ClickableEmoji({
53
53
  [ClassNames.hidden]: hidden,
54
54
  [ClassNames.hiddenOnSearch]: hiddenOnSearch,
55
55
  [ClassNames.visible]: !hidden && !hiddenOnSearch,
56
- [ClassNames.emojiHasVariatios]: hasVariations && showVariations,
56
+ [ClassNames.emojiHasVariations]: hasVariations && showVariations,
57
57
  })}
58
58
  data-unified={unified}
59
59
  // @ts-ignore - let's ignore the fact this is not a real react ref, ok?
@@ -69,7 +69,8 @@ export function basePickerConfig(): PickerConfigInternal {
69
69
  skinTonesDisabled: false,
70
70
  suggestedEmojisMode: SuggestionMode.FREQUENT,
71
71
  theme: Theme.LIGHT,
72
- width: 350
72
+ width: 350,
73
+ unicodeToHide: new Set<string>(),
73
74
  };
74
75
  }
75
76
 
@@ -91,6 +92,7 @@ export type PickerConfigInternal = {
91
92
  getEmojiUrl: GetEmojiUrl;
92
93
  searchDisabled: boolean;
93
94
  skinTonePickerLocation: SkinTonePickerLocation;
95
+ unicodeToHide: Set<string>;
94
96
  };
95
97
 
96
98
  export type PreviewConfig = {
@@ -107,7 +109,7 @@ const basePreviewConfig: PreviewConfig = {
107
109
 
108
110
  type ConfigExternal = {
109
111
  previewConfig: Partial<PreviewConfig>;
110
- } & Omit<PickerConfigInternal, 'previewConfig'>;
112
+ } & Omit<PickerConfigInternal, 'previewConfig' | 'unicodeToHide'>;
111
113
 
112
114
  export type PickerConfig = Partial<ConfigExternal>;
113
115
 
@@ -98,6 +98,11 @@ export function useSkinTonePickerLocationConfig(): SkinTonePickerLocation {
98
98
  return skinTonePickerLocation;
99
99
  }
100
100
 
101
+ export function useUnicodeToHide() {
102
+ const { unicodeToHide } = usePickerConfig();
103
+ return unicodeToHide;
104
+ }
105
+
101
106
  export function useGetEmojiUrlConfig(): (
102
107
  unified: string,
103
108
  style: EmojiStyle