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/dist/config/config.d.ts +2 -0
- package/dist/emoji-picker-react.cjs.development.js +13 -5
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +13 -5
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/config/config.ts +9 -3
- package/src/config/useConfig.ts +11 -3
- package/src/hooks/useDisallowedEmojis.ts +1 -1
package/package.json
CHANGED
package/src/config/config.ts
CHANGED
|
@@ -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:
|
|
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
|
-
|
|
73
|
-
|
|
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;
|
package/src/config/useConfig.ts
CHANGED
|
@@ -10,11 +10,19 @@ import {
|
|
|
10
10
|
} from '../types/exposedTypes';
|
|
11
11
|
|
|
12
12
|
import { CategoriesConfig } from './categoryConfig';
|
|
13
|
-
import {
|
|
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
|
|
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
|
-
|