emoji-picker-react 4.13.2 → 4.13.3
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 +15 -15
- package/dist/emoji-picker-react.cjs.development.js +34 -18
- 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 +34 -18
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/globals/doesBrowserSupportCssHas.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/header/Search/Search.tsx +1 -3
- package/src/globals/doesBrowserSupportCssHas.ts +16 -0
- package/src/hooks/useFilter.ts +24 -17
|
@@ -18065,6 +18065,19 @@ function useOnMouseMove() {
|
|
|
18065
18065
|
}, [BodyRef, allowMouseMove, isMouseDisallowed]);
|
|
18066
18066
|
}
|
|
18067
18067
|
|
|
18068
|
+
function doesBrowserSupportCssHas() {
|
|
18069
|
+
// if env is not browser:
|
|
18070
|
+
if (typeof window === 'undefined' || typeof window.CSS === 'undefined') {
|
|
18071
|
+
return false;
|
|
18072
|
+
}
|
|
18073
|
+
try {
|
|
18074
|
+
return CSS.supports('selector(:has(*))');
|
|
18075
|
+
} catch (e) {
|
|
18076
|
+
return false;
|
|
18077
|
+
}
|
|
18078
|
+
}
|
|
18079
|
+
var browserSupportsCssHas = /*#__PURE__*/doesBrowserSupportCssHas();
|
|
18080
|
+
|
|
18068
18081
|
function useFocusSearchInput() {
|
|
18069
18082
|
var SearchInputRef = useSearchInputRef();
|
|
18070
18083
|
return useCallback(function () {
|
|
@@ -18138,22 +18151,27 @@ function useFilter() {
|
|
|
18138
18151
|
statusSearchResults: statusSearchResults
|
|
18139
18152
|
};
|
|
18140
18153
|
function onChange(inputValue) {
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
if (filter != null && filter[nextValue] || nextValue.length <= 1) {
|
|
18144
|
-
return applySearch(nextValue);
|
|
18145
|
-
}
|
|
18146
|
-
var longestMatch = findLongestMatch(nextValue, filter);
|
|
18147
|
-
if (!longestMatch) {
|
|
18148
|
-
// Can we even get here?
|
|
18149
|
-
// If so, we need to search among all emojis
|
|
18150
|
-
return applySearch(nextValue);
|
|
18154
|
+
if (browserSupportsCssHas) {
|
|
18155
|
+
return;
|
|
18151
18156
|
}
|
|
18152
|
-
|
|
18153
|
-
var
|
|
18154
|
-
|
|
18157
|
+
setTimeout(function () {
|
|
18158
|
+
var filter = filterRef.current;
|
|
18159
|
+
var nextValue = inputValue.toLowerCase();
|
|
18160
|
+
if (filter != null && filter[nextValue] || nextValue.length <= 1) {
|
|
18161
|
+
return applySearch(nextValue);
|
|
18162
|
+
}
|
|
18163
|
+
var longestMatch = findLongestMatch(nextValue, filter);
|
|
18164
|
+
if (!longestMatch) {
|
|
18165
|
+
// Can we even get here?
|
|
18166
|
+
// If so, we need to search among all emojis
|
|
18167
|
+
return applySearch(nextValue);
|
|
18168
|
+
}
|
|
18169
|
+
setFilterRef(function (current) {
|
|
18170
|
+
var _Object$assign;
|
|
18171
|
+
return Object.assign(current, (_Object$assign = {}, _Object$assign[nextValue] = filterEmojiObjectByKeyword(longestMatch, nextValue), _Object$assign));
|
|
18172
|
+
});
|
|
18173
|
+
applySearch(nextValue);
|
|
18155
18174
|
});
|
|
18156
|
-
applySearch(nextValue);
|
|
18157
18175
|
}
|
|
18158
18176
|
}
|
|
18159
18177
|
function useApplySearch() {
|
|
@@ -20867,11 +20885,9 @@ function Search() {
|
|
|
20867
20885
|
"aria-controls": "epr-search-id",
|
|
20868
20886
|
placeholder: placeholder,
|
|
20869
20887
|
onChange: function onChange(event) {
|
|
20888
|
+
var _event$target$value, _event$target;
|
|
20870
20889
|
setInc(inc + 1);
|
|
20871
|
-
|
|
20872
|
-
var _event$target$value, _event$target;
|
|
20873
|
-
_onChange((_event$target$value = event == null ? void 0 : (_event$target = event.target) == null ? void 0 : _event$target.value) != null ? _event$target$value : value);
|
|
20874
|
-
});
|
|
20890
|
+
_onChange((_event$target$value = event == null ? void 0 : (_event$target = event.target) == null ? void 0 : _event$target.value) != null ? _event$target$value : value);
|
|
20875
20891
|
},
|
|
20876
20892
|
ref: SearchInputRef
|
|
20877
20893
|
}), searchTerm ? createElement("div", {
|