emoji-picker-react 4.5.0 → 4.5.1
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 +66 -12
- package/dist/components/emoji/ExportedEmoji.d.ts +2 -1
- package/dist/emoji-picker-react.cjs.development.js +44 -15
- 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 +44 -15
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/types/exposedTypes.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/emoji/ExportedEmoji.tsx +5 -3
- package/src/components/emoji/ViewOnlyEmoji.tsx +1 -1
- package/src/hooks/useMouseDownHandlers.ts +42 -14
- package/src/types/exposedTypes.ts +3 -1
|
@@ -17709,6 +17709,13 @@ function setSuggested(emoji, skinTone) {
|
|
|
17709
17709
|
}
|
|
17710
17710
|
}
|
|
17711
17711
|
|
|
17712
|
+
function isCustomCategory(category) {
|
|
17713
|
+
return category.category === Categories.CUSTOM;
|
|
17714
|
+
}
|
|
17715
|
+
function isCustomEmoji(emoji) {
|
|
17716
|
+
return emoji.imgUrl !== undefined;
|
|
17717
|
+
}
|
|
17718
|
+
|
|
17712
17719
|
function useCloseAllOpenToggles() {
|
|
17713
17720
|
var _useEmojiVariationPic = useEmojiVariationPickerState(),
|
|
17714
17721
|
variationPicker = _useEmojiVariationPic[0],
|
|
@@ -17777,6 +17784,7 @@ function useMouseDownHandlers(BodyRef) {
|
|
|
17777
17784
|
updateSuggested = _useUpdateSuggested[1];
|
|
17778
17785
|
|
|
17779
17786
|
var getEmojiUrl = useGetEmojiUrlConfig();
|
|
17787
|
+
var activeEmojiStyle = useEmojiStyleConfig();
|
|
17780
17788
|
var onClick = useCallback(function onClick(event) {
|
|
17781
17789
|
if (disallowClickRef.current) {
|
|
17782
17790
|
return;
|
|
@@ -17795,8 +17803,8 @@ function useMouseDownHandlers(BodyRef) {
|
|
|
17795
17803
|
var skinToneToUse = activeVariationFromUnified(unified) || activeSkinTone;
|
|
17796
17804
|
updateSuggested();
|
|
17797
17805
|
setSuggested(emoji, skinToneToUse);
|
|
17798
|
-
onEmojiClick(emojiClickOutput(emoji, skinToneToUse, getEmojiUrl), event);
|
|
17799
|
-
}, [activeSkinTone, closeAllOpenToggles, disallowClickRef, onEmojiClick, updateSuggested, getEmojiUrl]);
|
|
17806
|
+
onEmojiClick(emojiClickOutput(emoji, skinToneToUse, activeEmojiStyle, getEmojiUrl), event);
|
|
17807
|
+
}, [activeSkinTone, closeAllOpenToggles, disallowClickRef, onEmojiClick, updateSuggested, getEmojiUrl, activeEmojiStyle]);
|
|
17800
17808
|
var onMouseDown = useCallback(function onMouseDown(event) {
|
|
17801
17809
|
var _window;
|
|
17802
17810
|
|
|
@@ -17867,15 +17875,40 @@ function emojiFromEvent(event) {
|
|
|
17867
17875
|
return emojiFromElement(target);
|
|
17868
17876
|
}
|
|
17869
17877
|
|
|
17870
|
-
function emojiClickOutput(emoji, activeSkinTone, getEmojiUrl) {
|
|
17878
|
+
function emojiClickOutput(emoji, activeSkinTone, activeEmojiStyle, getEmojiUrl) {
|
|
17879
|
+
var names = emojiNames(emoji);
|
|
17880
|
+
|
|
17881
|
+
if (isCustomEmoji(emoji)) {
|
|
17882
|
+
var _unified = emojiUnified(emoji);
|
|
17883
|
+
|
|
17884
|
+
return {
|
|
17885
|
+
activeSkinTone: activeSkinTone,
|
|
17886
|
+
emoji: _unified,
|
|
17887
|
+
getImageUrl: function getImageUrl() {
|
|
17888
|
+
return emoji.imgUrl;
|
|
17889
|
+
},
|
|
17890
|
+
imageUrl: emoji.imgUrl,
|
|
17891
|
+
isCustom: true,
|
|
17892
|
+
names: names,
|
|
17893
|
+
unified: _unified,
|
|
17894
|
+
unifiedWithoutSkinTone: _unified
|
|
17895
|
+
};
|
|
17896
|
+
}
|
|
17897
|
+
|
|
17871
17898
|
var unified = emojiUnified(emoji, activeSkinTone);
|
|
17872
17899
|
return {
|
|
17873
17900
|
activeSkinTone: activeSkinTone,
|
|
17874
17901
|
emoji: parseNativeEmoji(unified),
|
|
17875
17902
|
getImageUrl: function getImageUrl(emojiStyle) {
|
|
17903
|
+
if (emojiStyle === void 0) {
|
|
17904
|
+
emojiStyle = activeEmojiStyle != null ? activeEmojiStyle : EmojiStyle.APPLE;
|
|
17905
|
+
}
|
|
17906
|
+
|
|
17876
17907
|
return getEmojiUrl(unified, emojiStyle);
|
|
17877
17908
|
},
|
|
17878
|
-
|
|
17909
|
+
imageUrl: getEmojiUrl(unified, activeEmojiStyle != null ? activeEmojiStyle : EmojiStyle.APPLE),
|
|
17910
|
+
isCustom: false,
|
|
17911
|
+
names: names,
|
|
17879
17912
|
unified: unified,
|
|
17880
17913
|
unifiedWithoutSkinTone: emojiUnified(emoji)
|
|
17881
17914
|
};
|
|
@@ -18217,13 +18250,6 @@ function ClickableEmojiButton(_ref) {
|
|
|
18217
18250
|
}, children);
|
|
18218
18251
|
}
|
|
18219
18252
|
|
|
18220
|
-
function isCustomCategory(category) {
|
|
18221
|
-
return category.category === Categories.CUSTOM;
|
|
18222
|
-
}
|
|
18223
|
-
function isCustomEmoji(emoji) {
|
|
18224
|
-
return emoji.imgUrl !== undefined;
|
|
18225
|
-
}
|
|
18226
|
-
|
|
18227
18253
|
function EmojiImg(_ref) {
|
|
18228
18254
|
var emojiName = _ref.emojiName,
|
|
18229
18255
|
style = _ref.style,
|
|
@@ -18279,7 +18305,7 @@ function ViewOnlyEmoji(_ref) {
|
|
|
18279
18305
|
return createElement(EmojiImg, {
|
|
18280
18306
|
style: style,
|
|
18281
18307
|
emojiName: unified,
|
|
18282
|
-
emojiStyle:
|
|
18308
|
+
emojiStyle: EmojiStyle.NATIVE,
|
|
18283
18309
|
lazyLoad: lazyLoad,
|
|
18284
18310
|
imgUrl: emojiToRender.imgUrl,
|
|
18285
18311
|
onError: onError
|
|
@@ -19817,9 +19843,10 @@ function ExportedEmoji(_ref) {
|
|
|
19817
19843
|
emojiStyle = _ref$emojiStyle === void 0 ? EmojiStyle.APPLE : _ref$emojiStyle,
|
|
19818
19844
|
_ref$lazyLoad = _ref.lazyLoad,
|
|
19819
19845
|
lazyLoad = _ref$lazyLoad === void 0 ? false : _ref$lazyLoad,
|
|
19820
|
-
getEmojiUrl = _ref.getEmojiUrl
|
|
19846
|
+
getEmojiUrl = _ref.getEmojiUrl,
|
|
19847
|
+
emojiUrl = _ref.emojiUrl;
|
|
19821
19848
|
|
|
19822
|
-
if (!unified) {
|
|
19849
|
+
if (!unified && !emojiUrl && !getEmojiUrl) {
|
|
19823
19850
|
return null;
|
|
19824
19851
|
}
|
|
19825
19852
|
|
|
@@ -19828,7 +19855,9 @@ function ExportedEmoji(_ref) {
|
|
|
19828
19855
|
size: size,
|
|
19829
19856
|
emojiStyle: emojiStyle,
|
|
19830
19857
|
lazyLoad: lazyLoad,
|
|
19831
|
-
getEmojiUrl:
|
|
19858
|
+
getEmojiUrl: emojiUrl ? function () {
|
|
19859
|
+
return emojiUrl;
|
|
19860
|
+
} : getEmojiUrl
|
|
19832
19861
|
});
|
|
19833
19862
|
}
|
|
19834
19863
|
|