emoji-picker-react 4.4.10 → 4.4.12

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.4.10",
2
+ "version": "4.4.12",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -15,6 +15,10 @@ import {
15
15
  mergeCategoriesConfig
16
16
  } from './categoryConfig';
17
17
 
18
+ const KNOWN_FAILING_EMOJIS = ['2640-fe0f', '2642-fe0f', '2695-fe0f'];
19
+
20
+ export const DEFAULT_SEARCH_PLACEHOLDER = 'Search';
21
+
18
22
  export function mergeConfig(
19
23
  userConfig: PickerConfig = {}
20
24
  ): PickerConfigInternal {
@@ -64,19 +68,21 @@ export function basePickerConfig(): PickerConfigInternal {
64
68
  ...basePreviewConfig
65
69
  },
66
70
  searchDisabled: false,
67
- searchPlaceHolder: 'Search',
71
+ searchPlaceHolder: DEFAULT_SEARCH_PLACEHOLDER,
72
+ searchPlaceholder: DEFAULT_SEARCH_PLACEHOLDER,
68
73
  skinTonePickerLocation: SkinTonePickerLocation.SEARCH,
69
74
  skinTonesDisabled: false,
70
75
  suggestedEmojisMode: SuggestionMode.FREQUENT,
71
76
  theme: Theme.LIGHT,
72
- width: 350,
73
- unicodeToHide: new Set<string>(),
77
+ unicodeToHide: new Set<string>(KNOWN_FAILING_EMOJIS),
78
+ width: 350
74
79
  };
75
80
  }
76
81
 
77
82
  export type PickerConfigInternal = {
78
83
  emojiVersion: string | null;
79
84
  searchPlaceHolder: string;
85
+ searchPlaceholder: string;
80
86
  defaultSkinTone: SkinTones;
81
87
  skinTonesDisabled: boolean;
82
88
  autoFocusSearch: boolean;
@@ -10,11 +10,19 @@ import {
10
10
  } from '../types/exposedTypes';
11
11
 
12
12
  import { CategoriesConfig } from './categoryConfig';
13
- import { PickerDimensions, PreviewConfig } from './config';
13
+ import {
14
+ DEFAULT_SEARCH_PLACEHOLDER,
15
+ PickerDimensions,
16
+ PreviewConfig,
17
+ } from './config';
14
18
 
15
19
  export function useSearchPlaceHolderConfig(): string {
16
- const { searchPlaceHolder } = usePickerConfig();
17
- return searchPlaceHolder;
20
+ const { searchPlaceHolder, searchPlaceholder } = usePickerConfig();
21
+ return (
22
+ [searchPlaceHolder, searchPlaceholder].find(
23
+ (p) => p !== DEFAULT_SEARCH_PLACEHOLDER
24
+ ) ?? DEFAULT_SEARCH_PLACEHOLDER
25
+ );
18
26
  }
19
27
 
20
28
  export function useDefaultSkinToneConfig(): SkinTones {
@@ -8,6 +8,7 @@ import {
8
8
  emojiUnified,
9
9
  unifiedWithoutSkinTone
10
10
  } from '../dataUtils/emojiSelectors';
11
+
11
12
  import { useIsUnicodeHidden } from './useHideEmojisByUniocode';
12
13
 
13
14
  export function useDisallowedEmojis() {
@@ -48,4 +49,3 @@ function addedInNewerVersion(
48
49
  ): boolean {
49
50
  return addedIn(emoji) > supportedLevel;
50
51
  }
51
-