emoji-picker-react 4.4.7 → 4.4.9
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 +9 -0
- package/dist/emoji-picker-react.cjs.development.js +5 -2
- 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 +5 -2
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/body/EmojiList.tsx +4 -1
- package/src/dataUtils/emojiSelectors.ts +1 -1
- package/src/hooks/useKeyboardNavigation.ts +3 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.4.
|
|
2
|
+
"version": "4.4.9",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"start": "tsdx watch",
|
|
26
|
-
"build": "node ./scripts/prepare.js && tsdx build",
|
|
26
|
+
"build": "node ./scripts/prepare.js && tsdx build && node ./scripts/copyData.js",
|
|
27
27
|
"test": "tsdx test --passWithNoTests",
|
|
28
28
|
"lint": "eslint ./src --ext .ts,.tsx",
|
|
29
29
|
"prepare": "tsdx build",
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
useCategoriesConfig,
|
|
11
11
|
useEmojiStyleConfig,
|
|
12
12
|
useGetEmojiUrlConfig,
|
|
13
|
-
useLazyLoadEmojisConfig
|
|
13
|
+
useLazyLoadEmojisConfig,
|
|
14
|
+
useSkinTonesDisabledConfig
|
|
14
15
|
} from '../../config/useConfig';
|
|
15
16
|
import { emojisByCategory, emojiUnified } from '../../dataUtils/emojiSelectors';
|
|
16
17
|
import { useIsEmojiDisallowed } from '../../hooks/useDisallowedEmojis';
|
|
@@ -67,6 +68,7 @@ function RenderCategory({
|
|
|
67
68
|
const [activeSkinTone] = useActiveSkinToneState();
|
|
68
69
|
const isEmojiDisallowed = useIsEmojiDisallowed();
|
|
69
70
|
const getEmojiUrl = useGetEmojiUrlConfig();
|
|
71
|
+
const showVariations = !useSkinTonesDisabledConfig();
|
|
70
72
|
|
|
71
73
|
// Small trick to defer the rendering of all emoji categories until the first category is visible
|
|
72
74
|
// This way the user gets to actually see something and not wait for the whole picker to render.
|
|
@@ -91,6 +93,7 @@ function RenderCategory({
|
|
|
91
93
|
|
|
92
94
|
return (
|
|
93
95
|
<ClickableEmoji
|
|
96
|
+
showVariations={showVariations}
|
|
94
97
|
key={unified}
|
|
95
98
|
emoji={emoji}
|
|
96
99
|
unified={unified}
|
|
@@ -4,7 +4,7 @@ import emojis from '../data/emojis';
|
|
|
4
4
|
import skinToneVariations, {
|
|
5
5
|
skinTonesMapped
|
|
6
6
|
} from '../data/skinToneVariations';
|
|
7
|
-
import { EmojiStyle, SkinTones } from '../types/exposedTypes';
|
|
7
|
+
import { EmojiStyle, SkinTones } from '../types/exposedTypes';
|
|
8
8
|
|
|
9
9
|
import { DataEmoji, DataEmojis } from './DataTypes';
|
|
10
10
|
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
useIsSkinToneInPreview,
|
|
43
43
|
useIsSkinToneInSearch
|
|
44
44
|
} from './useShouldShowSkinTonePicker';
|
|
45
|
+
import { useSearchDisabledConfig } from '../config/useConfig';
|
|
45
46
|
|
|
46
47
|
enum KeyboardEvents {
|
|
47
48
|
ArrowDown = 'ArrowDown',
|
|
@@ -452,12 +453,13 @@ function focusPrevSkinTone() {
|
|
|
452
453
|
function useOnType() {
|
|
453
454
|
const appendSearch = useAppendSearch();
|
|
454
455
|
const focusSearchInput = useFocusSearchInput();
|
|
456
|
+
const searchDisabled = useSearchDisabledConfig();
|
|
455
457
|
const closeAllOpenToggles = useCloseAllOpenToggles();
|
|
456
458
|
|
|
457
459
|
return function onType(event: KeyboardEvent) {
|
|
458
460
|
const { key } = event;
|
|
459
461
|
|
|
460
|
-
if (hasModifier(event)) {
|
|
462
|
+
if (hasModifier(event) || searchDisabled) {
|
|
461
463
|
return;
|
|
462
464
|
}
|
|
463
465
|
|