emoji-picker-react 4.3.0 → 4.4.0-rc.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.
@@ -16803,6 +16803,7 @@ function basePickerConfig() {
16803
16803
  event) {},
16804
16804
  previewConfig: _extends({}, basePreviewConfig),
16805
16805
  searchPlaceHolder: 'Search',
16806
+ showEmoji: undefined,
16806
16807
  skinTonesDisabled: false,
16807
16808
  suggestedEmojisMode: SuggestionMode.FREQUENT,
16808
16809
  theme: Theme.LIGHT,
@@ -16921,6 +16922,12 @@ function useGetEmojiUrlConfig() {
16921
16922
 
16922
16923
  return getEmojiUrl;
16923
16924
  }
16925
+ function useShowEmojiConfig() {
16926
+ var _usePickerConfig15 = usePickerConfig(),
16927
+ showEmoji = _usePickerConfig15.showEmoji;
16928
+
16929
+ return showEmoji;
16930
+ }
16924
16931
 
16925
16932
  function getDimension(dimensionConfig) {
16926
16933
  return typeof dimensionConfig === 'number' ? dimensionConfig + "px" : dimensionConfig;
@@ -16969,24 +16976,37 @@ function useDebouncedState(initialValue, delay) {
16969
16976
  return [state, debouncedSetState];
16970
16977
  }
16971
16978
 
16979
+ function isFunction(value) {
16980
+ return typeof value === 'function';
16981
+ }
16982
+
16972
16983
  function useDisallowedEmojis() {
16973
16984
  var DisallowedEmojisRef = useRef({});
16974
16985
  var emojiVersionConfig = useEmojiVersionConfig();
16986
+ var shouldShowEmoji = useShowEmojiConfig();
16975
16987
  return useMemo(function () {
16976
16988
  var emojiVersion = parseFloat("" + emojiVersionConfig);
16977
16989
 
16978
- if (!emojiVersionConfig || Number.isNaN(emojiVersion)) {
16990
+ if ((!emojiVersionConfig || Number.isNaN(emojiVersion)) && !shouldShowEmoji) {
16979
16991
  return DisallowedEmojisRef.current;
16980
16992
  }
16981
16993
 
16982
16994
  return allEmojis.reduce(function (disallowedEmojis, emoji) {
16995
+ if (isFunction(shouldShowEmoji) && !shouldShowEmoji(emoji)) {
16996
+ disallowEmoji();
16997
+ }
16998
+
16983
16999
  if (addedInNewerVersion(emoji, emojiVersion)) {
16984
- disallowedEmojis[emojiUnified(emoji)] = true;
17000
+ disallowEmoji();
16985
17001
  }
16986
17002
 
16987
17003
  return disallowedEmojis;
17004
+
17005
+ function disallowEmoji() {
17006
+ disallowedEmojis[emojiUnified(emoji)] = true;
17007
+ }
16988
17008
  }, DisallowedEmojisRef.current);
16989
- }, [emojiVersionConfig]);
17009
+ }, [emojiVersionConfig, shouldShowEmoji]);
16990
17010
  }
16991
17011
 
16992
17012
  function addedInNewerVersion(emoji, supportedLevel) {
@@ -17993,7 +18013,7 @@ function useFocusCategoryNavigation() {
17993
18013
  function useSetFilterRef() {
17994
18014
  var filterRef = useFilterRef();
17995
18015
  return function setFilter(setter) {
17996
- if (typeof setter === 'function') {
18016
+ if (isFunction(setter)) {
17997
18017
  return setFilter(setter(filterRef.current));
17998
18018
  }
17999
18019