emoji-picker-react 4.4.11 → 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.11",
2
+ "version": "4.4.12",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -17,6 +17,8 @@ import {
17
17
 
18
18
  const KNOWN_FAILING_EMOJIS = ['2640-fe0f', '2642-fe0f', '2695-fe0f'];
19
19
 
20
+ export const DEFAULT_SEARCH_PLACEHOLDER = 'Search';
21
+
20
22
  export function mergeConfig(
21
23
  userConfig: PickerConfig = {}
22
24
  ): PickerConfigInternal {
@@ -66,7 +68,8 @@ export function basePickerConfig(): PickerConfigInternal {
66
68
  ...basePreviewConfig
67
69
  },
68
70
  searchDisabled: false,
69
- searchPlaceHolder: 'Search',
71
+ searchPlaceHolder: DEFAULT_SEARCH_PLACEHOLDER,
72
+ searchPlaceholder: DEFAULT_SEARCH_PLACEHOLDER,
70
73
  skinTonePickerLocation: SkinTonePickerLocation.SEARCH,
71
74
  skinTonesDisabled: false,
72
75
  suggestedEmojisMode: SuggestionMode.FREQUENT,
@@ -79,6 +82,7 @@ export function basePickerConfig(): PickerConfigInternal {
79
82
  export type PickerConfigInternal = {
80
83
  emojiVersion: string | null;
81
84
  searchPlaceHolder: string;
85
+ searchPlaceholder: string;
82
86
  defaultSkinTone: SkinTones;
83
87
  skinTonesDisabled: boolean;
84
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 {