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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { PickerConfig } from './config/config';
3
3
  export { ExportedEmoji as Emoji } from './components/emoji/ExportedEmoji';
4
- export { EmojiStyle, SkinTones, Theme, Categories, EmojiClickData } from './types/exposedTypes';
4
+ export { EmojiStyle, SkinTones, Theme, Categories, EmojiClickData, SuggestionMode } from './types/exposedTypes';
5
5
  export interface Props extends PickerConfig {
6
6
  }
7
7
  export default function EmojiPicker(props: Props): JSX.Element;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.4",
2
+ "version": "4.0.6",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -48,6 +48,7 @@ export function Search() {
48
48
  <button
49
49
  className={clsx('epr-btn-clear-search', 'epr-visible-on-search-only')}
50
50
  onClick={clearSearch}
51
+ type="button"
51
52
  />
52
53
  </Relative>
53
54
  );
@@ -56,7 +57,7 @@ export function Search() {
56
57
  function CssSearch({ value }: { value: undefined | string }) {
57
58
  return value ? (
58
59
  <style>{`
59
- .EmojiPickerReact button.epr-emoji:not([data-full-name*="${value}"]) {
60
+ .EmojiPickerReact button.epr-emoji:not([data-full-name*="${value.toLowerCase()}"]) {
60
61
  display: none;
61
62
  }
62
63
  `}</style>
@@ -40,6 +40,7 @@ export function SkinTonePicker() {
40
40
  const active = skinToneVariation === activeSkinTone;
41
41
  return (
42
42
  <button
43
+ type="button"
43
44
  style={{
44
45
  transform: clsx(
45
46
  `translateX(-${i * (isOpen ? 28 : 0)}px)`,
@@ -27,6 +27,7 @@ export function CategoryNavigation() {
27
27
  const category = categoryFromCategoryConfig(categoryConfig);
28
28
  return (
29
29
  <button
30
+ type="button"
30
31
  className={clsx('epr-cat-btn', `epr-icn-${category}`, {
31
32
  [ClassNames.active]: category === activeCategory
32
33
  })}
@@ -14,10 +14,10 @@ type SuggestedItem = {
14
14
  type Suggested = SuggestedItem[];
15
15
 
16
16
  export function getsuggested(mode?: SuggestionMode): Suggested {
17
- if (!window?.localStorage) {
18
- return [];
19
- }
20
17
  try {
18
+ if (!window?.localStorage) {
19
+ return [];
20
+ }
21
21
  const recent = JSON.parse(
22
22
  window?.localStorage.getItem(SUGGESTED_LS_KEY) ?? '[]'
23
23
  ) as Suggested;
@@ -96,7 +96,7 @@ function useApplySearch() {
96
96
 
97
97
  return function applySearch(searchTerm: string) {
98
98
  requestAnimationFrame(() => {
99
- setSearchTerm(searchTerm).then(() => {
99
+ setSearchTerm(searchTerm.toLowerCase()).then(() => {
100
100
  scrollTo(PickerMainRef.current, 0);
101
101
  });
102
102
  });
@@ -128,7 +128,8 @@ export function useIsEmojiFiltered(): (unified: string) => boolean {
128
128
  const { current: filter } = useFilterRef();
129
129
  const [searchTerm] = useSearchTermState();
130
130
 
131
- return unified => isEmojiFilteredBySearchTerm(unified, filter, searchTerm);
131
+ return unified =>
132
+ isEmojiFilteredBySearchTerm(unified, filter, searchTerm.toLowerCase());
132
133
  }
133
134
 
134
135
  function isEmojiFilteredBySearchTerm(
package/src/index.tsx CHANGED
@@ -11,7 +11,8 @@ export {
11
11
  SkinTones,
12
12
  Theme,
13
13
  Categories,
14
- EmojiClickData
14
+ EmojiClickData,
15
+ SuggestionMode
15
16
  } from './types/exposedTypes';
16
17
 
17
18
  export interface Props extends PickerConfig {}