emoji-picker-react 4.2.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,
@@ -16905,8 +16906,8 @@ function usePickerSizeConfig() {
16905
16906
  width = _usePickerConfig12.width;
16906
16907
 
16907
16908
  return {
16908
- height: height,
16909
- width: width
16909
+ height: getDimension(height),
16910
+ width: getDimension(width)
16910
16911
  };
16911
16912
  }
16912
16913
  function useEmojiVersionConfig() {
@@ -16921,6 +16922,16 @@ 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
+ }
16931
+
16932
+ function getDimension(dimensionConfig) {
16933
+ return typeof dimensionConfig === 'number' ? dimensionConfig + "px" : dimensionConfig;
16934
+ }
16924
16935
 
16925
16936
  var alphaNumericEmojiIndex = {};
16926
16937
  setTimeout(function () {
@@ -16965,24 +16976,37 @@ function useDebouncedState(initialValue, delay) {
16965
16976
  return [state, debouncedSetState];
16966
16977
  }
16967
16978
 
16979
+ function isFunction(value) {
16980
+ return typeof value === 'function';
16981
+ }
16982
+
16968
16983
  function useDisallowedEmojis() {
16969
16984
  var DisallowedEmojisRef = useRef({});
16970
16985
  var emojiVersionConfig = useEmojiVersionConfig();
16986
+ var shouldShowEmoji = useShowEmojiConfig();
16971
16987
  return useMemo(function () {
16972
16988
  var emojiVersion = parseFloat("" + emojiVersionConfig);
16973
16989
 
16974
- if (!emojiVersionConfig || Number.isNaN(emojiVersion)) {
16990
+ if ((!emojiVersionConfig || Number.isNaN(emojiVersion)) && !shouldShowEmoji) {
16975
16991
  return DisallowedEmojisRef.current;
16976
16992
  }
16977
16993
 
16978
16994
  return allEmojis.reduce(function (disallowedEmojis, emoji) {
16995
+ if (isFunction(shouldShowEmoji) && !shouldShowEmoji(emoji)) {
16996
+ disallowEmoji();
16997
+ }
16998
+
16979
16999
  if (addedInNewerVersion(emoji, emojiVersion)) {
16980
- disallowedEmojis[emojiUnified(emoji)] = true;
17000
+ disallowEmoji();
16981
17001
  }
16982
17002
 
16983
17003
  return disallowedEmojis;
17004
+
17005
+ function disallowEmoji() {
17006
+ disallowedEmojis[emojiUnified(emoji)] = true;
17007
+ }
16984
17008
  }, DisallowedEmojisRef.current);
16985
- }, [emojiVersionConfig]);
17009
+ }, [emojiVersionConfig, shouldShowEmoji]);
16986
17010
  }
16987
17011
 
16988
17012
  function addedInNewerVersion(emoji, supportedLevel) {
@@ -17989,7 +18013,7 @@ function useFocusCategoryNavigation() {
17989
18013
  function useSetFilterRef() {
17990
18014
  var filterRef = useFilterRef();
17991
18015
  return function setFilter(setter) {
17992
- if (typeof setter === 'function') {
18016
+ if (isFunction(setter)) {
17993
18017
  return setFilter(setter(filterRef.current));
17994
18018
  }
17995
18019
 
@@ -19459,8 +19483,8 @@ function PickerRootElement(_ref2) {
19459
19483
  useKeyboardNavigation();
19460
19484
  useOnFocus();
19461
19485
  var style = {
19462
- height: height + "px",
19463
- width: width + "px"
19486
+ height: height,
19487
+ width: width
19464
19488
  };
19465
19489
  return createElement("aside", {
19466
19490
  className: clsx(ClassNames.emojiPicker, 'epr-main', (_clsx = {}, _clsx[ClassNames.searchActive] = searchModeActive, _clsx['epr-dark-theme'] = theme === Theme.DARK, _clsx)),