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.
- package/dist/DomUtils/classNames.d.ts +1 -1
- package/dist/config/config.d.ts +2 -1
- package/dist/config/useConfig.d.ts +1 -0
- package/dist/data/emojis.d.ts +49 -2
- package/dist/dataUtils/suggested.d.ts +2 -2
- package/dist/emoji-picker-react.cjs.development.js +30 -14
- 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 +30 -14
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/hooks/useHideEmojisByUniocode.d.ts +1 -0
- package/package.json +1 -1
- package/src/DomUtils/classNames.ts +1 -1
- package/src/DomUtils/selectors.ts +5 -5
- package/src/components/body/EmojiVariationPicker.tsx +1 -1
- package/src/components/body/Suggested.tsx +2 -2
- package/src/components/emoji/Emoji.tsx +1 -1
- package/src/config/config.ts +4 -2
- package/src/config/useConfig.ts +5 -0
- package/src/data/emojis.ts +1 -3
- package/src/dataUtils/suggested.ts +3 -3
- package/src/hooks/useDisallowedEmojis.ts +4 -1
- package/src/hooks/useHideEmojisByUniocode.ts +6 -0
- package/src/hooks/useMouseDownHandlers.ts +2 -2
|
@@ -8,7 +8,7 @@ export declare enum ClassNames {
|
|
|
8
8
|
category = "epr-emoji-category",
|
|
9
9
|
label = "epr-emoji-category-label",
|
|
10
10
|
categoryContent = "epr-emoji-category-content",
|
|
11
|
-
|
|
11
|
+
emojiHasVariations = "epr-emoji-has-variations",
|
|
12
12
|
scrollBody = "epr-body",
|
|
13
13
|
emojiList = "epr-emoji-list",
|
|
14
14
|
external = "__EmojiPicker__",
|
package/dist/config/config.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare type PickerConfigInternal = {
|
|
|
21
21
|
getEmojiUrl: GetEmojiUrl;
|
|
22
22
|
searchDisabled: boolean;
|
|
23
23
|
skinTonePickerLocation: SkinTonePickerLocation;
|
|
24
|
+
unicodeToHide: Set<string>;
|
|
24
25
|
};
|
|
25
26
|
export declare type PreviewConfig = {
|
|
26
27
|
defaultEmoji: string;
|
|
@@ -29,7 +30,7 @@ export declare type PreviewConfig = {
|
|
|
29
30
|
};
|
|
30
31
|
declare type ConfigExternal = {
|
|
31
32
|
previewConfig: Partial<PreviewConfig>;
|
|
32
|
-
} & Omit<PickerConfigInternal, 'previewConfig'>;
|
|
33
|
+
} & Omit<PickerConfigInternal, 'previewConfig' | 'unicodeToHide'>;
|
|
33
34
|
export declare type PickerConfig = Partial<ConfigExternal>;
|
|
34
35
|
export declare type PickerDimensions = string | number;
|
|
35
36
|
export {};
|
|
@@ -19,4 +19,5 @@ export declare function usePickerSizeConfig(): {
|
|
|
19
19
|
export declare function useEmojiVersionConfig(): string | null;
|
|
20
20
|
export declare function useSearchDisabledConfig(): boolean;
|
|
21
21
|
export declare function useSkinTonePickerLocationConfig(): SkinTonePickerLocation;
|
|
22
|
+
export declare function useUnicodeToHide(): Set<string>;
|
|
22
23
|
export declare function useGetEmojiUrlConfig(): (unified: string, style: EmojiStyle) => string;
|
package/dist/data/emojis.d.ts
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
smileys_people: ({
|
|
3
|
+
n: string[];
|
|
4
|
+
u: string;
|
|
5
|
+
a: string;
|
|
6
|
+
v?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
n: string[];
|
|
9
|
+
u: string;
|
|
10
|
+
v: string[];
|
|
11
|
+
a: string;
|
|
12
|
+
})[];
|
|
13
|
+
animals_nature: {
|
|
14
|
+
n: string[];
|
|
15
|
+
u: string;
|
|
16
|
+
a: string;
|
|
17
|
+
}[];
|
|
18
|
+
food_drink: {
|
|
19
|
+
n: string[];
|
|
20
|
+
u: string;
|
|
21
|
+
a: string;
|
|
22
|
+
}[];
|
|
23
|
+
travel_places: {
|
|
24
|
+
n: string[];
|
|
25
|
+
u: string;
|
|
26
|
+
a: string;
|
|
27
|
+
}[];
|
|
28
|
+
activities: {
|
|
29
|
+
n: string[];
|
|
30
|
+
u: string;
|
|
31
|
+
a: string;
|
|
32
|
+
}[];
|
|
33
|
+
objects: {
|
|
34
|
+
n: string[];
|
|
35
|
+
u: string;
|
|
36
|
+
a: string;
|
|
37
|
+
}[];
|
|
38
|
+
symbols: {
|
|
39
|
+
n: string[];
|
|
40
|
+
u: string;
|
|
41
|
+
a: string;
|
|
42
|
+
}[];
|
|
43
|
+
flags: {
|
|
44
|
+
n: string[];
|
|
45
|
+
u: string;
|
|
46
|
+
a: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
@@ -6,6 +6,6 @@ declare type SuggestedItem = {
|
|
|
6
6
|
count: number;
|
|
7
7
|
};
|
|
8
8
|
declare type Suggested = SuggestedItem[];
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
9
|
+
export declare function getSuggested(mode?: SuggestionMode): Suggested;
|
|
10
|
+
export declare function setSuggested(emoji: DataEmoji, skinTone: SkinTones): void;
|
|
11
11
|
export {};
|
|
@@ -19,7 +19,7 @@ var ClassNames;
|
|
|
19
19
|
ClassNames["category"] = "epr-emoji-category";
|
|
20
20
|
ClassNames["label"] = "epr-emoji-category-label";
|
|
21
21
|
ClassNames["categoryContent"] = "epr-emoji-category-content";
|
|
22
|
-
ClassNames["
|
|
22
|
+
ClassNames["emojiHasVariations"] = "epr-emoji-has-variations";
|
|
23
23
|
ClassNames["scrollBody"] = "epr-body";
|
|
24
24
|
ClassNames["emojiList"] = "epr-emoji-list";
|
|
25
25
|
ClassNames["external"] = "__EmojiPicker__";
|
|
@@ -16848,7 +16848,8 @@ function basePickerConfig() {
|
|
|
16848
16848
|
skinTonesDisabled: false,
|
|
16849
16849
|
suggestedEmojisMode: exports.SuggestionMode.FREQUENT,
|
|
16850
16850
|
theme: exports.Theme.LIGHT,
|
|
16851
|
-
width: 350
|
|
16851
|
+
width: 350,
|
|
16852
|
+
unicodeToHide: new Set()
|
|
16852
16853
|
};
|
|
16853
16854
|
}
|
|
16854
16855
|
var basePreviewConfig = {
|
|
@@ -16969,9 +16970,15 @@ function useSkinTonePickerLocationConfig() {
|
|
|
16969
16970
|
|
|
16970
16971
|
return skinTonePickerLocation;
|
|
16971
16972
|
}
|
|
16972
|
-
function
|
|
16973
|
+
function useUnicodeToHide() {
|
|
16973
16974
|
var _usePickerConfig16 = usePickerConfig(),
|
|
16974
|
-
|
|
16975
|
+
unicodeToHide = _usePickerConfig16.unicodeToHide;
|
|
16976
|
+
|
|
16977
|
+
return unicodeToHide;
|
|
16978
|
+
}
|
|
16979
|
+
function useGetEmojiUrlConfig() {
|
|
16980
|
+
var _usePickerConfig17 = usePickerConfig(),
|
|
16981
|
+
getEmojiUrl = _usePickerConfig17.getEmojiUrl;
|
|
16975
16982
|
|
|
16976
16983
|
return getEmojiUrl;
|
|
16977
16984
|
}
|
|
@@ -17023,6 +17030,13 @@ function useDebouncedState(initialValue, delay) {
|
|
|
17023
17030
|
return [state, debouncedSetState];
|
|
17024
17031
|
}
|
|
17025
17032
|
|
|
17033
|
+
function useIsUnicodeHidden() {
|
|
17034
|
+
var unicodeToHide = useUnicodeToHide();
|
|
17035
|
+
return function (emojiUnified) {
|
|
17036
|
+
return unicodeToHide.has(emojiUnified);
|
|
17037
|
+
};
|
|
17038
|
+
}
|
|
17039
|
+
|
|
17026
17040
|
function useDisallowedEmojis() {
|
|
17027
17041
|
var DisallowedEmojisRef = React.useRef({});
|
|
17028
17042
|
var emojiVersionConfig = useEmojiVersionConfig();
|
|
@@ -17044,9 +17058,10 @@ function useDisallowedEmojis() {
|
|
|
17044
17058
|
}
|
|
17045
17059
|
function useIsEmojiDisallowed() {
|
|
17046
17060
|
var disallowedEmojis = useDisallowedEmojis();
|
|
17061
|
+
var isUnicodeHidden = useIsUnicodeHidden();
|
|
17047
17062
|
return function isEmojiDisallowed(emoji) {
|
|
17048
17063
|
var unified = unifiedWithoutSkinTone(emojiUnified(emoji));
|
|
17049
|
-
return Boolean(disallowedEmojis[unified]);
|
|
17064
|
+
return Boolean(disallowedEmojis[unified] || isUnicodeHidden(unified));
|
|
17050
17065
|
};
|
|
17051
17066
|
}
|
|
17052
17067
|
|
|
@@ -17387,7 +17402,8 @@ function isEmojiBehindLabel(emoji) {
|
|
|
17387
17402
|
return emojiDistanceFromScrollTop(emoji) < categoryLabelHeight(closestCategory(emoji));
|
|
17388
17403
|
}
|
|
17389
17404
|
function queryScrollBody(root) {
|
|
17390
|
-
|
|
17405
|
+
if (!root) return null;
|
|
17406
|
+
return root.matches(asSelectors(ClassNames.scrollBody)) ? root : root.querySelector(asSelectors(ClassNames.scrollBody));
|
|
17391
17407
|
}
|
|
17392
17408
|
function emojiDistanceFromScrollTop(emoji) {
|
|
17393
17409
|
var _closestScrollBody$sc, _closestScrollBody;
|
|
@@ -17577,7 +17593,7 @@ function parseNativeEmoji(unified) {
|
|
|
17577
17593
|
}
|
|
17578
17594
|
|
|
17579
17595
|
var SUGGESTED_LS_KEY = 'epr_suggested';
|
|
17580
|
-
function
|
|
17596
|
+
function getSuggested(mode) {
|
|
17581
17597
|
try {
|
|
17582
17598
|
var _window, _window$localStorage$, _window2;
|
|
17583
17599
|
|
|
@@ -17598,8 +17614,8 @@ function getsuggested(mode) {
|
|
|
17598
17614
|
return [];
|
|
17599
17615
|
}
|
|
17600
17616
|
}
|
|
17601
|
-
function
|
|
17602
|
-
var recent =
|
|
17617
|
+
function setSuggested(emoji, skinTone) {
|
|
17618
|
+
var recent = getSuggested();
|
|
17603
17619
|
var unified = emojiUnified(emoji, skinTone);
|
|
17604
17620
|
var originalUnified = emojiUnified(emoji);
|
|
17605
17621
|
var existing = recent.find(function (_ref) {
|
|
@@ -17717,7 +17733,7 @@ function useMouseDownHandlers(BodyRef) {
|
|
|
17717
17733
|
|
|
17718
17734
|
var skinToneToUse = activeVariationFromUnified(unified) || activeSkinTone;
|
|
17719
17735
|
updateSuggested();
|
|
17720
|
-
|
|
17736
|
+
setSuggested(emoji, skinToneToUse);
|
|
17721
17737
|
onEmojiClick(emojiClickOutput(emoji, skinToneToUse, getEmojiUrl), event);
|
|
17722
17738
|
}, [activeSkinTone, closeAllOpenToggles, disallowClickRef, onEmojiClick, updateSuggested, getEmojiUrl]);
|
|
17723
17739
|
var onMouseDown = React.useCallback(function onMouseDown(event) {
|
|
@@ -18106,7 +18122,7 @@ function ClickableEmoji(_ref) {
|
|
|
18106
18122
|
getEmojiUrl = _ref.getEmojiUrl;
|
|
18107
18123
|
var hasVariations = emojiHasVariations(emoji);
|
|
18108
18124
|
return React.createElement(Button, {
|
|
18109
|
-
className: clsx(ClassNames.emoji, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _clsx[ClassNames.visible] = !hidden && !hiddenOnSearch, _clsx[ClassNames.
|
|
18125
|
+
className: clsx(ClassNames.emoji, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _clsx[ClassNames.visible] = !hidden && !hiddenOnSearch, _clsx[ClassNames.emojiHasVariations] = hasVariations && showVariations, _clsx)),
|
|
18110
18126
|
"data-unified": unified,
|
|
18111
18127
|
"aria-label": emojiName(emoji),
|
|
18112
18128
|
"data-full-name": emojiNames(emoji)
|
|
@@ -18219,9 +18235,9 @@ function Suggested(_ref) {
|
|
|
18219
18235
|
var suggestedEmojisModeConfig = useSuggestedEmojisModeConfig();
|
|
18220
18236
|
var getEmojiUrl = useGetEmojiUrlConfig();
|
|
18221
18237
|
var suggested = React.useMemo(function () {
|
|
18222
|
-
var
|
|
18238
|
+
var _getSuggested;
|
|
18223
18239
|
|
|
18224
|
-
return (
|
|
18240
|
+
return (_getSuggested = getSuggested(suggestedEmojisModeConfig)) != null ? _getSuggested : [];
|
|
18225
18241
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18226
18242
|
[suggestedUpdated, suggestedEmojisModeConfig]);
|
|
18227
18243
|
var emojiStyle = useEmojiStyleConfig();
|
|
@@ -18465,7 +18481,7 @@ function EmojiVariationPicker() {
|
|
|
18465
18481
|
var getPointerStyle = usePointerStyle(VariationPickerRef);
|
|
18466
18482
|
var getEmojiUrl = useGetEmojiUrlConfig();
|
|
18467
18483
|
var button = buttonFromTarget(AnchoredEmojiRef.current);
|
|
18468
|
-
var visible = emoji && button && emojiHasVariations(emoji) && button.classList.contains(ClassNames.
|
|
18484
|
+
var visible = emoji && button && emojiHasVariations(emoji) && button.classList.contains(ClassNames.emojiHasVariations);
|
|
18469
18485
|
React.useEffect(function () {
|
|
18470
18486
|
if (!visible) {
|
|
18471
18487
|
return;
|