emoji-picker-react 4.4.0 → 4.4.2

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.
@@ -235,12 +235,10 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
235
235
  Categories["FLAGS"] = "flags";
236
236
  })(exports.Categories || (exports.Categories = {}));
237
237
 
238
- var SkinTonePickerLocation;
239
-
240
238
  (function (SkinTonePickerLocation) {
241
239
  SkinTonePickerLocation["SEARCH"] = "SEARCH";
242
240
  SkinTonePickerLocation["PREVIEW"] = "PREVIEW";
243
- })(SkinTonePickerLocation || (SkinTonePickerLocation = {}));
241
+ })(exports.SkinTonePickerLocation || (exports.SkinTonePickerLocation = {}));
244
242
 
245
243
  var CDN_URL_APPLE = 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/';
246
244
  var CDN_URL_FACEBOOK = 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook/img/facebook/64/';
@@ -16787,7 +16785,7 @@ function mergeConfig(userConfig) {
16787
16785
  var categories = mergeCategoriesConfig(userConfig.categories, {
16788
16786
  suggestionMode: config.suggestedEmojisMode
16789
16787
  });
16790
- var skinTonePickerLocation = config.searchDisabled ? SkinTonePickerLocation.PREVIEW : config.skinTonePickerLocation;
16788
+ var skinTonePickerLocation = config.searchDisabled ? exports.SkinTonePickerLocation.PREVIEW : config.skinTonePickerLocation;
16791
16789
  return _extends({}, config, {
16792
16790
  categories: categories,
16793
16791
  previewConfig: previewConfig,
@@ -16812,7 +16810,7 @@ function basePickerConfig() {
16812
16810
  previewConfig: _extends({}, basePreviewConfig),
16813
16811
  searchDisabled: false,
16814
16812
  searchPlaceHolder: 'Search',
16815
- skinTonePickerLocation: SkinTonePickerLocation.SEARCH,
16813
+ skinTonePickerLocation: exports.SkinTonePickerLocation.SEARCH,
16816
16814
  skinTonesDisabled: false,
16817
16815
  suggestedEmojisMode: exports.SuggestionMode.FREQUENT,
16818
16816
  theme: exports.Theme.LIGHT,
@@ -17010,6 +17008,13 @@ function useDisallowedEmojis() {
17010
17008
  }, DisallowedEmojisRef.current);
17011
17009
  }, [emojiVersionConfig]);
17012
17010
  }
17011
+ function useIsEmojiDisallowed() {
17012
+ var disallowedEmojis = useDisallowedEmojis();
17013
+ return function isEmojiDisallowed(emoji) {
17014
+ var unified = unifiedWithoutSkinTone(emojiUnified(emoji));
17015
+ return Boolean(disallowedEmojis[unified]);
17016
+ };
17017
+ }
17013
17018
 
17014
17019
  function addedInNewerVersion(emoji, supportedLevel) {
17015
17020
  return addedIn(emoji) > supportedLevel;
@@ -17140,12 +17145,6 @@ function useSkinToneFanOpenState() {
17140
17145
 
17141
17146
  return skinToneFanOpenState;
17142
17147
  }
17143
- function useDisallowedEmojisRef() {
17144
- var _React$useContext10 = React.useContext(PickerContext),
17145
- disallowedEmojisRef = _React$useContext10.disallowedEmojisRef;
17146
-
17147
- return disallowedEmojisRef;
17148
- }
17149
17148
  function useUpdateSuggested() {
17150
17149
  var _React$useContext11 = React.useContext(PickerContext),
17151
17150
  suggestedUpdateState = _React$useContext11.suggestedUpdateState;
@@ -18389,7 +18388,7 @@ function RenderCategory(_ref) {
18389
18388
  var _useActiveSkinToneSta = useActiveSkinToneState(),
18390
18389
  activeSkinTone = _useActiveSkinToneSta[0];
18391
18390
 
18392
- var disallowedEmojisRef = useDisallowedEmojisRef();
18391
+ var isEmojiDisallowed = useIsEmojiDisallowed();
18393
18392
  var getEmojiUrl = useGetEmojiUrlConfig(); // Small trick to defer the rendering of all emoji categories until the first category is visible
18394
18393
  // This way the user gets to actually see something and not wait for the whole picker to render.
18395
18394
 
@@ -18403,7 +18402,7 @@ function RenderCategory(_ref) {
18403
18402
  filteredOut = _isEmojiHidden.filteredOut,
18404
18403
  hidden = _isEmojiHidden.hidden;
18405
18404
 
18406
- var isDisallowed = !!disallowedEmojisRef.current[unified];
18405
+ var isDisallowed = isEmojiDisallowed(emoji);
18407
18406
 
18408
18407
  if (hidden || isDisallowed) {
18409
18408
  hiddenCounter++;
@@ -18652,11 +18651,11 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
18652
18651
 
18653
18652
  function useIsSkinToneInSearch() {
18654
18653
  var skinTonePickerLocationConfig = useSkinTonePickerLocationConfig();
18655
- return skinTonePickerLocationConfig === SkinTonePickerLocation.SEARCH;
18654
+ return skinTonePickerLocationConfig === exports.SkinTonePickerLocation.SEARCH;
18656
18655
  }
18657
18656
  function useIsSkinToneInPreview() {
18658
18657
  var skinTonePickerLocationConfig = useSkinTonePickerLocationConfig();
18659
- return skinTonePickerLocationConfig === SkinTonePickerLocation.PREVIEW;
18658
+ return skinTonePickerLocationConfig === exports.SkinTonePickerLocation.PREVIEW;
18660
18659
  }
18661
18660
 
18662
18661
  var FlexDirection;