emoji-picker-react 4.0.4 → 4.0.6

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.
@@ -163,12 +163,10 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
163
163
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
164
164
  }
165
165
 
166
- var SuggestionMode;
167
-
168
166
  (function (SuggestionMode) {
169
167
  SuggestionMode["RECENT"] = "recent";
170
168
  SuggestionMode["FREQUENT"] = "frequent";
171
- })(SuggestionMode || (SuggestionMode = {}));
169
+ })(exports.SuggestionMode || (exports.SuggestionMode = {}));
172
170
 
173
171
  (function (EmojiStyle) {
174
172
  EmojiStyle["NATIVE"] = "native";
@@ -263,7 +261,7 @@ function mergeCategoriesConfig(userCategoriesConfig, modifiers) {
263
261
 
264
262
  var extra = {};
265
263
 
266
- if (modifiers.suggestionMode === SuggestionMode.RECENT) {
264
+ if (modifiers.suggestionMode === exports.SuggestionMode.RECENT) {
267
265
  extra[exports.Categories.SUGGESTED] = SuggestedRecent;
268
266
  }
269
267
 
@@ -325,7 +323,7 @@ function basePickerConfig() {
325
323
  previewConfig: _extends({}, basePreviewConfig),
326
324
  searchPlaceHolder: 'Search',
327
325
  skinTonesDisabled: false,
328
- suggestedEmojisMode: SuggestionMode.FREQUENT,
326
+ suggestedEmojisMode: exports.SuggestionMode.FREQUENT,
329
327
  theme: exports.Theme.LIGHT
330
328
  };
331
329
  }
@@ -15575,18 +15573,16 @@ function parseNativeEmoji(unified) {
15575
15573
 
15576
15574
  var SUGGESTED_LS_KEY = 'epr_suggested';
15577
15575
  function getsuggested(mode) {
15578
- var _window;
15579
-
15580
- if (!((_window = window) != null && _window.localStorage)) {
15581
- return [];
15582
- }
15583
-
15584
15576
  try {
15585
- var _window$localStorage$, _window2;
15577
+ var _window, _window$localStorage$, _window2;
15578
+
15579
+ if (!((_window = window) != null && _window.localStorage)) {
15580
+ return [];
15581
+ }
15586
15582
 
15587
15583
  var recent = JSON.parse((_window$localStorage$ = (_window2 = window) == null ? void 0 : _window2.localStorage.getItem(SUGGESTED_LS_KEY)) != null ? _window$localStorage$ : '[]');
15588
15584
 
15589
- if (mode === SuggestionMode.FREQUENT) {
15585
+ if (mode === exports.SuggestionMode.FREQUENT) {
15590
15586
  return recent.sort(function (a, b) {
15591
15587
  return b.count - a.count;
15592
15588
  });
@@ -16071,7 +16067,7 @@ function useApplySearch() {
16071
16067
  var PickerMainRef = usePickerMainRef();
16072
16068
  return function applySearch(searchTerm) {
16073
16069
  requestAnimationFrame(function () {
16074
- setSearchTerm(searchTerm).then(function () {
16070
+ setSearchTerm(searchTerm.toLowerCase()).then(function () {
16075
16071
  scrollTo(PickerMainRef.current, 0);
16076
16072
  });
16077
16073
  });
@@ -16106,7 +16102,7 @@ function useIsEmojiFiltered() {
16106
16102
  searchTerm = _useSearchTermState3[0];
16107
16103
 
16108
16104
  return function (unified) {
16109
- return isEmojiFilteredBySearchTerm(unified, filter, searchTerm);
16105
+ return isEmojiFilteredBySearchTerm(unified, filter, searchTerm.toLowerCase());
16110
16106
  };
16111
16107
  }
16112
16108
 
@@ -16756,6 +16752,7 @@ function CategoryNavigation() {
16756
16752
 
16757
16753
  var category = categoryFromCategoryConfig(categoryConfig);
16758
16754
  return React.createElement("button", {
16755
+ type: "button",
16759
16756
  className: clsx('epr-cat-btn', "epr-icn-" + category, (_clsx = {}, _clsx[ClassNames.active] = category === activeCategory, _clsx)),
16760
16757
  key: category,
16761
16758
  onClick: function onClick() {
@@ -16808,13 +16805,14 @@ function Search() {
16808
16805
  className: "epr-icn-search"
16809
16806
  }), React.createElement("button", {
16810
16807
  className: clsx('epr-btn-clear-search', 'epr-visible-on-search-only'),
16811
- onClick: clearSearch
16808
+ onClick: clearSearch,
16809
+ type: "button"
16812
16810
  }));
16813
16811
  }
16814
16812
 
16815
16813
  function CssSearch(_ref) {
16816
16814
  var value = _ref.value;
16817
- return value ? React.createElement("style", null, "\n .EmojiPickerReact button.epr-emoji:not([data-full-name*=\"" + value + "\"]) {\n display: none;\n }\n ") : null;
16815
+ return value ? React.createElement("style", null, "\n .EmojiPickerReact button.epr-emoji:not([data-full-name*=\"" + value.toLowerCase() + "\"]) {\n display: none;\n }\n ") : null;
16818
16816
  }
16819
16817
 
16820
16818
  function useFocusSearchInput() {
@@ -16875,6 +16873,7 @@ function SkinTonePicker() {
16875
16873
 
16876
16874
  var active = skinToneVariation === activeSkinTone;
16877
16875
  return React.createElement("button", {
16876
+ type: "button",
16878
16877
  style: {
16879
16878
  transform: clsx("translateX(-" + i * (isOpen ? 28 : 0) + "px)", isOpen && active && 'scale(1.3)')
16880
16879
  },