emoji-picker-react 4.17.5 → 4.18.0

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.
Files changed (99) hide show
  1. package/README.md +51 -6
  2. package/dist/components/Layout/Flex.d.ts +1 -1
  3. package/dist/components/body/EmojiCategory.d.ts +1 -1
  4. package/dist/components/context/ElementRefContext.d.ts +1 -1
  5. package/dist/components/emoji/ClickableEmojiButton.d.ts +1 -1
  6. package/dist/components/emoji/Emoji.d.ts +1 -1
  7. package/dist/components/emoji/EmojiImg.d.ts +1 -1
  8. package/dist/components/emoji/ExportedEmoji.d.ts +1 -1
  9. package/dist/components/emoji/NativeEmoji.d.ts +1 -1
  10. package/dist/components/emoji/ViewOnlyEmoji.d.ts +1 -1
  11. package/dist/components/header/SkinTonePicker/BtnSkinToneVariation.d.ts +1 -1
  12. package/dist/components/header/SkinTonePicker/SkinTonePicker.d.ts +1 -1
  13. package/dist/components/navigation/CategoryButton.d.ts +3 -2
  14. package/dist/config/config.d.ts +2 -1
  15. package/dist/config/useConfig.d.ts +1 -0
  16. package/dist/data/groups.js +1 -1
  17. package/dist/data/groups.ts +1 -1
  18. package/dist/data/skinToneVariations.js +2 -2
  19. package/dist/data/skinToneVariations.ts +10 -12
  20. package/dist/emoji-picker-react.cjs.development.js +107 -89
  21. package/dist/emoji-picker-react.cjs.development.js.map +1 -1
  22. package/dist/emoji-picker-react.cjs.production.min.js +1 -1
  23. package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
  24. package/dist/emoji-picker-react.esm.js +107 -89
  25. package/dist/emoji-picker-react.esm.js.map +1 -1
  26. package/dist/hooks/useActiveCategoryScrollDetection.d.ts +1 -1
  27. package/dist/hooks/useEmojiVirtualization.d.ts +1 -1
  28. package/dist/index.d.ts +2 -1
  29. package/dist/typeRefinements/typeRefinements.d.ts +1 -1
  30. package/dist/types/exposedTypes.d.ts +3 -0
  31. package/dist/virtualization/virtualizationHelpers.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/src/DomUtils/classNames.ts +2 -2
  34. package/src/DomUtils/detectEmojyPartiallyBelowFold.ts +1 -1
  35. package/src/DomUtils/elementPositionInRow.ts +3 -3
  36. package/src/DomUtils/keyboardNavigation.ts +2 -2
  37. package/src/DomUtils/scrollTo.ts +2 -2
  38. package/src/DomUtils/selectors.ts +18 -17
  39. package/src/Stylesheet/stylesheet.tsx +22 -22
  40. package/src/components/Layout/Flex.tsx +6 -6
  41. package/src/components/Layout/Space.tsx +0 -1
  42. package/src/components/Reactions/BtnPlus.tsx +8 -8
  43. package/src/components/Reactions/DEFAULT_REACTIONS.ts +1 -1
  44. package/src/components/atoms/Button.tsx +6 -7
  45. package/src/components/body/Body.tsx +3 -3
  46. package/src/components/body/EmojiCategory.tsx +8 -8
  47. package/src/components/body/EmojiList.tsx +9 -9
  48. package/src/components/body/EmojiVariationPicker.tsx +22 -23
  49. package/src/components/body/MeasureEmoji.tsx +10 -11
  50. package/src/components/context/ElementRefContext.tsx +5 -6
  51. package/src/components/context/PickerConfigContext.tsx +5 -6
  52. package/src/components/context/PickerContext.tsx +8 -8
  53. package/src/components/context/PickerDataContext.tsx +2 -3
  54. package/src/components/emoji/ClickableEmojiButton.tsx +15 -14
  55. package/src/components/emoji/Emoji.tsx +1 -1
  56. package/src/components/emoji/EmojiImg.tsx +10 -5
  57. package/src/components/emoji/ExportedEmoji.tsx +1 -1
  58. package/src/components/emoji/NativeEmoji.tsx +4 -4
  59. package/src/components/emoji/ViewOnlyEmoji.tsx +2 -3
  60. package/src/components/emoji/emojiStyles.ts +3 -3
  61. package/src/components/footer/Preview.tsx +10 -10
  62. package/src/components/header/Search/BtnClearSearch.tsx +13 -13
  63. package/src/components/header/Search/IcnSearch.tsx +3 -3
  64. package/src/components/header/Search/Search.tsx +18 -18
  65. package/src/components/header/SkinTonePicker/BtnSkinToneVariation.tsx +15 -14
  66. package/src/components/header/SkinTonePicker/SkinTonePicker.tsx +15 -15
  67. package/src/components/main/PickerMain.tsx +16 -16
  68. package/src/components/navigation/CategoryButton.tsx +41 -26
  69. package/src/components/navigation/CategoryNavigation.tsx +14 -8
  70. package/src/config/config.ts +3 -0
  71. package/src/config/mutableConfig.ts +2 -2
  72. package/src/config/useConfig.ts +15 -10
  73. package/src/data/groups.ts +1 -1
  74. package/src/data/skinToneVariations.ts +10 -12
  75. package/src/dataUtils/DataTypes.ts +1 -1
  76. package/src/dataUtils/alphaNumericEmojiIndex.ts +1 -1
  77. package/src/dataUtils/parseNativeEmoji.ts +1 -1
  78. package/src/dataUtils/suggested.ts +3 -3
  79. package/src/hooks/preloadEmoji.ts +3 -3
  80. package/src/hooks/useActiveCategoryScrollDetection.ts +9 -7
  81. package/src/hooks/useCloseAllOpenToggles.ts +2 -2
  82. package/src/hooks/useDebouncedState.ts +2 -2
  83. package/src/hooks/useDisallowMouseMove.ts +1 -1
  84. package/src/hooks/useDisallowedEmojis.ts +2 -2
  85. package/src/hooks/useEmojiPreviewEvents.ts +8 -8
  86. package/src/hooks/useEmojiVirtualization.tsx +9 -9
  87. package/src/hooks/useFilter.ts +16 -16
  88. package/src/hooks/useFocus.ts +1 -1
  89. package/src/hooks/useHideEmojisByUniocode.ts +4 -4
  90. package/src/hooks/useInitialLoad.ts +1 -1
  91. package/src/hooks/useIsEmojiHidden.ts +1 -1
  92. package/src/hooks/useKeyboardNavigation.ts +18 -18
  93. package/src/hooks/useMouseDownHandlers.ts +18 -18
  94. package/src/hooks/useOnScroll.ts +1 -1
  95. package/src/hooks/useScrollCategoryIntoView.ts +2 -2
  96. package/src/index.tsx +5 -2
  97. package/src/typeRefinements/typeRefinements.ts +2 -2
  98. package/src/types/exposedTypes.ts +11 -6
  99. package/src/virtualization/virtualizationHelpers.ts +2 -2
@@ -1,4 +1,4 @@
1
- export declare function useActiveCategoryScrollDetection({ setActiveCategory, setVisibleCategories }: {
1
+ export declare function useActiveCategoryScrollDetection({ setActiveCategory, setVisibleCategories, }: {
2
2
  setActiveCategory: (category: string) => void;
3
3
  setVisibleCategories: (categories: string[]) => void;
4
4
  }): void;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DataEmojis } from '../dataUtils/DataTypes';
3
- export declare function useEmojiVirtualization({ categoryEmojis, topOffset, onHeightReady, scrollTop, isCategoryVisible }: {
3
+ export declare function useEmojiVirtualization({ categoryEmojis, topOffset, onHeightReady, scrollTop, isCategoryVisible, }: {
4
4
  categoryEmojis: DataEmojis;
5
5
  topOffset: number;
6
6
  onHeightReady: (height: number) => void;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
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, SuggestionMode, SkinTonePickerLocation } from './types/exposedTypes';
4
+ export { EmojiStyle, SkinTones, Theme, Categories, EmojiClickData, SuggestionMode, SkinTonePickerLocation, CategoryIcons, CategoryConfig, } from './types/exposedTypes';
5
5
  export { emojiByUnified } from './dataUtils/emojiSelectors';
6
6
  export interface PickerProps extends PickerConfig {
7
7
  }
8
+ export declare type Props = PickerProps;
8
9
  export default function EmojiPicker(props: PickerProps): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { CustomCategoryConfig } from '../config/categoryConfig';
2
2
  import { CustomEmoji } from '../config/customEmojiConfig';
3
- import { CategoryConfig } from '../types/exposedTypes';
4
3
  import { DataEmoji } from '../dataUtils/DataTypes';
4
+ import { CategoryConfig } from '../types/exposedTypes';
5
5
  export declare function isCustomCategory(category: CategoryConfig | CustomCategoryConfig): category is CustomCategoryConfig;
6
6
  export declare function isCustomEmoji(emoji: Partial<DataEmoji>): emoji is CustomEmoji;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  export declare type EmojiClickData = {
2
3
  activeSkinTone: SkinTones;
3
4
  unified: string;
@@ -11,7 +12,9 @@ export declare type EmojiClickData = {
11
12
  export declare type CategoryConfig = {
12
13
  category: Categories;
13
14
  name: string;
15
+ icon?: React.ReactNode;
14
16
  };
17
+ export declare type CategoryIcons = Partial<Record<Categories, React.ReactNode>>;
15
18
  export declare type EmojiData = {
16
19
  categories: Partial<Record<Categories, CategoryConfig>>;
17
20
  emojis: Record<string, DataEmoji[]>;
@@ -1,4 +1,4 @@
1
- export declare function shouldVirtualize({ scrollTop, clientHeight, topOffset, style, dimensions }: {
1
+ export declare function shouldVirtualize({ scrollTop, clientHeight, topOffset, style, dimensions, }: {
2
2
  scrollTop: number;
3
3
  clientHeight: number;
4
4
  topOffset: number;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.17.5",
2
+ "version": "4.18.0",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -18,9 +18,9 @@ export enum ClassNames {
18
18
  horizontal = 'epr-horizontal',
19
19
  variationPicker = 'epr-emoji-variation-picker',
20
20
  darkTheme = 'epr-dark-theme',
21
- autoTheme = 'epr-auto-theme'
21
+ autoTheme = 'epr-auto-theme',
22
22
  }
23
23
 
24
24
  export function asSelectors(...classNames: ClassNames[]): string {
25
- return classNames.map(c => `.${c}`).join('');
25
+ return classNames.map((c) => `.${c}`).join('');
26
26
  }
@@ -2,7 +2,7 @@ import { NullableElement } from './selectors';
2
2
 
3
3
  export function detectEmojyPartiallyBelowFold(
4
4
  button: HTMLButtonElement,
5
- bodyRef: NullableElement
5
+ bodyRef: NullableElement,
6
6
  ): number {
7
7
  if (!button || !bodyRef) {
8
8
  return 0;
@@ -5,7 +5,7 @@ import { NullableElement } from './selectors';
5
5
 
6
6
  export function elementCountInRow(
7
7
  parent: NullableElement,
8
- element: NullableElement
8
+ element: NullableElement,
9
9
  ): number {
10
10
  if (!parent || !element) {
11
11
  return 0;
@@ -19,7 +19,7 @@ export function elementCountInRow(
19
19
  export function firstVisibleElementInContainer(
20
20
  parent: NullableElement,
21
21
  elements: HTMLElement[],
22
- maxVisibilityDiffThreshold = 0
22
+ maxVisibilityDiffThreshold = 0,
23
23
  ): NullableElement {
24
24
  if (!parent || !elements.length) {
25
25
  return null;
@@ -29,7 +29,7 @@ export function firstVisibleElementInContainer(
29
29
  const parentBottom = parent.getBoundingClientRect().bottom;
30
30
  const parentTopWithLabel = parentTop + getLabelHeight(parent);
31
31
 
32
- const visibleElements = elements.find(element => {
32
+ const visibleElements = elements.find((element) => {
33
33
  const elementTop = element.getBoundingClientRect().top;
34
34
  const elementBottom = element.getBoundingClientRect().bottom;
35
35
  const maxVisibilityDiffPixels =
@@ -11,7 +11,7 @@ import {
11
11
  NullableElement,
12
12
  prevCategory,
13
13
  prevVisibleEmoji,
14
- closestCategoryContent
14
+ closestCategoryContent,
15
15
  } from './selectors';
16
16
 
17
17
  export function focusFirstVisibleEmoji(parent: NullableElement) {
@@ -63,7 +63,7 @@ export function focusPrevVisibleEmoji(element: NullableElement) {
63
63
 
64
64
  export function focusVisibleEmojiOneRowUp(
65
65
  element: NullableElement,
66
- exitUp: () => void
66
+ exitUp: () => void,
67
67
  ) {
68
68
  if (!element) {
69
69
  return;
@@ -10,7 +10,7 @@ import {
10
10
  emojiDistanceFromScrollTop,
11
11
  isEmojiBehindLabel,
12
12
  NullableElement,
13
- queryScrollBody
13
+ queryScrollBody,
14
14
  } from './selectors';
15
15
 
16
16
  export function scrollTo(root: NullableElement, top: number = 0) {
@@ -48,7 +48,7 @@ export function useScrollTo() {
48
48
  }
49
49
  });
50
50
  },
51
- [BodyRef]
51
+ [BodyRef],
52
52
  );
53
53
  }
54
54
 
@@ -1,7 +1,7 @@
1
1
  import { DataEmoji } from '../dataUtils/DataTypes';
2
2
  import {
3
3
  emojiByUnified,
4
- unifiedWithoutSkinTone
4
+ unifiedWithoutSkinTone,
5
5
  } from '../dataUtils/emojiSelectors';
6
6
 
7
7
  import { asSelectors, ClassNames } from './classNames';
@@ -13,11 +13,11 @@ export const EmojiButtonSelector = `button${asSelectors(ClassNames.emoji)}`;
13
13
  export const VisibleEmojiSelector = [
14
14
  EmojiButtonSelector,
15
15
  asSelectors(ClassNames.visible),
16
- `:not(${asSelectors(ClassNames.hidden)})`
16
+ `:not(${asSelectors(ClassNames.hidden)})`,
17
17
  ].join('');
18
18
 
19
19
  export function buttonFromTarget(
20
- emojiElement: NullableElement
20
+ emojiElement: NullableElement,
21
21
  ): HTMLButtonElement | null {
22
22
  return emojiElement?.closest(EmojiButtonSelector) ?? null;
23
23
  }
@@ -31,7 +31,7 @@ export function isEmojiButton(element: NullableElement): boolean {
31
31
  }
32
32
 
33
33
  export function emojiFromElement(
34
- element: NullableElement
34
+ element: NullableElement,
35
35
  ): [DataEmoji, string] | [] {
36
36
  const originalUnified = originalUnifiedFromEmojiElement(element);
37
37
  const unified = unifiedFromEmojiElement(element);
@@ -52,18 +52,18 @@ export function emojiFromElement(
52
52
  export function isEmojiElement(element: NullableElement): boolean {
53
53
  return Boolean(
54
54
  element?.matches(EmojiButtonSelector) ||
55
- element?.parentElement?.matches(EmojiButtonSelector)
55
+ element?.parentElement?.matches(EmojiButtonSelector),
56
56
  );
57
57
  }
58
58
 
59
59
  export function categoryLabelFromCategory(
60
- category: NullableElement
60
+ category: NullableElement,
61
61
  ): NullableElement {
62
62
  return category?.querySelector(asSelectors(ClassNames.label)) ?? null;
63
63
  }
64
64
 
65
65
  export function closestCategoryLabel(
66
- element: NullableElement
66
+ element: NullableElement,
67
67
  ): NullableElement {
68
68
  const category = closestCategory(element);
69
69
  return categoryLabelFromCategory(category);
@@ -93,7 +93,7 @@ export function categoryLabelHeight(category: NullableElement): number {
93
93
  }
94
94
 
95
95
  const categoryWithoutLabel = category.querySelector(
96
- asSelectors(ClassNames.categoryContent)
96
+ asSelectors(ClassNames.categoryContent),
97
97
  );
98
98
 
99
99
  return (
@@ -156,7 +156,7 @@ export function unifiedFromEmojiElement(emoji: NullableElement): string | null {
156
156
  }
157
157
 
158
158
  export function originalUnifiedFromEmojiElement(
159
- emoji: NullableElement
159
+ emoji: NullableElement,
160
160
  ): string | null {
161
161
  const unified = unifiedFromEmojiElement(emoji);
162
162
 
@@ -166,25 +166,26 @@ export function originalUnifiedFromEmojiElement(
166
166
  return null;
167
167
  }
168
168
 
169
- export function allUnifiedFromEmojiElement(
170
- emoji: NullableElement
171
- ): { unified: string | null; originalUnified: string | null } {
169
+ export function allUnifiedFromEmojiElement(emoji: NullableElement): {
170
+ unified: string | null;
171
+ originalUnified: string | null;
172
+ } {
172
173
  if (!emoji) {
173
174
  return {
174
175
  unified: null,
175
- originalUnified: null
176
+ originalUnified: null,
176
177
  };
177
178
  }
178
179
 
179
180
  return {
180
181
  unified: unifiedFromEmojiElement(emoji),
181
- originalUnified: originalUnifiedFromEmojiElement(emoji)
182
+ originalUnified: originalUnifiedFromEmojiElement(emoji),
182
183
  };
183
184
  }
184
185
 
185
186
  function elementDataSetKey(
186
187
  element: NullableElement,
187
- key: string
188
+ key: string,
188
189
  ): string | null {
189
190
  return elementDataSet(element)[key] ?? null;
190
191
  }
@@ -209,7 +210,7 @@ export function allVisibleEmojis(parent: NullableElement) {
209
210
  }
210
211
 
211
212
  return Array.from(
212
- parent.querySelectorAll(VisibleEmojiSelector)
213
+ parent.querySelectorAll(VisibleEmojiSelector),
213
214
  ) as HTMLElement[];
214
215
  }
215
216
 
@@ -319,6 +320,6 @@ export function closestCategoryContent(element: NullableElement) {
319
320
  return null;
320
321
  }
321
322
  return element.closest(
322
- asSelectors(ClassNames.categoryContent)
323
+ asSelectors(ClassNames.categoryContent),
323
324
  ) as HTMLElement;
324
325
  }
@@ -10,14 +10,14 @@ const hidden = {
10
10
  opacity: '0',
11
11
  pointerEvents: 'none',
12
12
  visibility: 'hidden',
13
- overflow: 'hidden'
13
+ overflow: 'hidden',
14
14
  };
15
15
 
16
16
  export const commonStyles = stylesheet.create({
17
17
  hidden: {
18
18
  '.': ClassNames.hidden,
19
- ...hidden
20
- }
19
+ ...hidden,
20
+ },
21
21
  });
22
22
 
23
23
  export const PickerStyleTag = React.memo(function PickerStyleTag() {
@@ -35,20 +35,20 @@ export const commonInteractionStyles = stylesheet.create({
35
35
  categoryBtn: {
36
36
  ':hover': {
37
37
  opacity: '1',
38
- backgroundPositionY: 'var(--epr-category-navigation-button-size)'
39
- }
38
+ backgroundPositionY: 'var(--epr-category-navigation-button-size)',
39
+ },
40
40
  },
41
41
  hiddenOnSearch: {
42
42
  '.': ClassNames.hiddenOnSearch,
43
- ...hidden
44
- }
43
+ ...hidden,
44
+ },
45
45
  },
46
46
  ':has(input:placeholder-shown)': {
47
- visibleOnSearchOnly: hidden
48
- }
47
+ visibleOnSearchOnly: hidden,
48
+ },
49
49
  },
50
50
  hiddenOnReactions: {
51
- transition: 'all 0.5s ease-in-out'
51
+ transition: 'all 0.5s ease-in-out',
52
52
  },
53
53
  '.epr-reactions': {
54
54
  hiddenOnReactions: {
@@ -56,36 +56,36 @@ export const commonInteractionStyles = stylesheet.create({
56
56
  width: '0px',
57
57
  opacity: '0',
58
58
  pointerEvents: 'none',
59
- overflow: 'hidden'
60
- }
59
+ overflow: 'hidden',
60
+ },
61
61
  },
62
62
  '.EmojiPickerReact:not(.epr-search-active)': {
63
63
  categoryBtn: {
64
64
  ':hover': {
65
65
  opacity: '1',
66
- backgroundPositionY: 'var(--epr-category-navigation-button-size)'
66
+ backgroundPositionY: 'var(--epr-category-navigation-button-size)',
67
67
  },
68
68
  '&.epr-active': {
69
69
  opacity: '1',
70
- backgroundPositionY: 'var(--epr-category-navigation-button-size)'
71
- }
70
+ backgroundPositionY: 'var(--epr-category-navigation-button-size)',
71
+ },
72
72
  },
73
73
  visibleOnSearchOnly: {
74
74
  '.': 'epr-visible-on-search-only',
75
- ...hidden
76
- }
77
- }
75
+ ...hidden,
76
+ },
77
+ },
78
78
  });
79
79
 
80
80
  export function darkMode(key: string, value: Styles) {
81
81
  return {
82
82
  '.epr-dark-theme': {
83
- [key]: value
83
+ [key]: value,
84
84
  },
85
85
  '.epr-auto-theme': {
86
86
  [key]: {
87
- '@media (prefers-color-scheme: dark)': value
88
- }
89
- }
87
+ '@media (prefers-color-scheme: dark)': value,
88
+ },
89
+ },
90
90
  };
91
91
  }
@@ -5,7 +5,7 @@ import { stylesheet } from '../../Stylesheet/stylesheet';
5
5
 
6
6
  export enum FlexDirection {
7
7
  ROW = 'FlexRow',
8
- COLUMN = 'FlexColumn'
8
+ COLUMN = 'FlexColumn',
9
9
  }
10
10
 
11
11
  type Props = Readonly<{
@@ -19,7 +19,7 @@ export default function Flex({
19
19
  children,
20
20
  className,
21
21
  style = {},
22
- direction = FlexDirection.ROW
22
+ direction = FlexDirection.ROW,
23
23
  }: Props) {
24
24
  return (
25
25
  <div
@@ -33,12 +33,12 @@ export default function Flex({
33
33
 
34
34
  const styles = stylesheet.create({
35
35
  flex: {
36
- display: 'flex'
36
+ display: 'flex',
37
37
  },
38
38
  [FlexDirection.ROW]: {
39
- flexDirection: 'row'
39
+ flexDirection: 'row',
40
40
  },
41
41
  [FlexDirection.COLUMN]: {
42
- flexDirection: 'column'
43
- }
42
+ flexDirection: 'column',
43
+ },
44
44
  });
@@ -1,7 +1,6 @@
1
1
  import { cx } from 'flairup';
2
2
  import * as React from 'react';
3
3
 
4
-
5
4
  type Props = Readonly<{
6
5
  className?: string;
7
6
  style?: React.CSSProperties;
@@ -42,25 +42,25 @@ const styles = stylesheet.create({
42
42
  backgroundColor: 'transparent',
43
43
  backgroundRepeat: 'no-repeat',
44
44
  backgroundSize: '20px',
45
- backgroundPositionY: '0'
45
+ backgroundPositionY: '0',
46
46
  },
47
47
  ':hover': {
48
48
  color: 'var(--epr-highlight-color)',
49
49
  backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
50
50
  ':after': {
51
- backgroundPositionY: '-20px'
52
- }
51
+ backgroundPositionY: '-20px',
52
+ },
53
53
  },
54
54
  ':focus': {
55
55
  color: 'var(--epr-highlight-color)',
56
56
  backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
57
57
  ':after': {
58
- backgroundPositionY: '-40px'
59
- }
60
- }
58
+ backgroundPositionY: '-40px',
59
+ },
60
+ },
61
61
  },
62
62
  ...darkMode('plusSign', {
63
63
  ':after': { backgroundPositionY: '-40px' },
64
- ':hover:after': { backgroundPositionY: '-60px' }
65
- })
64
+ ':hover:after': { backgroundPositionY: '-60px' },
65
+ }),
66
66
  });
@@ -5,5 +5,5 @@ export const DEFAULT_REACTIONS = [
5
5
  '1f622', // 😢
6
6
  '1f64f', // 🙏
7
7
  '1f44e', // 👎
8
- '1f621' // 😡
8
+ '1f621', // 😡
9
9
  ];
@@ -3,11 +3,10 @@ import * as React from 'react';
3
3
 
4
4
  import { stylesheet } from '../../Stylesheet/stylesheet';
5
5
 
6
- interface Props
7
- extends React.DetailedHTMLProps<
8
- React.ButtonHTMLAttributes<HTMLButtonElement>,
9
- HTMLButtonElement
10
- > {
6
+ interface Props extends React.DetailedHTMLProps<
7
+ React.ButtonHTMLAttributes<HTMLButtonElement>,
8
+ HTMLButtonElement
9
+ > {
11
10
  className?: string;
12
11
  }
13
12
 
@@ -29,6 +28,6 @@ const styles = stylesheet.create({
29
28
  cursor: 'pointer',
30
29
  border: '0',
31
30
  background: 'none',
32
- outline: 'none'
33
- }
31
+ outline: 'none',
32
+ },
34
33
  });
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { ClassNames } from '../../DomUtils/classNames';
5
5
  import {
6
6
  commonInteractionStyles,
7
- stylesheet
7
+ stylesheet,
8
8
  } from '../../Stylesheet/stylesheet';
9
9
  import { MOUSE_EVENT_SOURCE } from '../../config/useConfig';
10
10
  import { useOnMouseMove } from '../../hooks/useDisallowMouseMove';
@@ -38,6 +38,6 @@ const styles = stylesheet.create({
38
38
  flex: '1',
39
39
  overflowY: 'scroll',
40
40
  overflowX: 'hidden',
41
- position: 'relative'
42
- }
41
+ position: 'relative',
42
+ },
43
43
  });
@@ -5,11 +5,11 @@ import { ClassNames } from '../../DomUtils/classNames';
5
5
  import {
6
6
  commonInteractionStyles,
7
7
  commonStyles,
8
- stylesheet
8
+ stylesheet,
9
9
  } from '../../Stylesheet/stylesheet';
10
10
  import {
11
11
  categoryFromCategoryConfig,
12
- categoryNameFromCategoryConfig
12
+ categoryNameFromCategoryConfig,
13
13
  } from '../../config/categoryConfig';
14
14
  import { CategoryConfig } from '../../types/exposedTypes';
15
15
 
@@ -26,7 +26,7 @@ export function EmojiCategory({
26
26
  children,
27
27
  hidden,
28
28
  hiddenOnSearch,
29
- height
29
+ height,
30
30
  }: Props) {
31
31
  const category = categoryFromCategoryConfig(categoryConfig);
32
32
  const categoryName = categoryNameFromCategoryConfig(categoryConfig);
@@ -36,7 +36,7 @@ export function EmojiCategory({
36
36
  className={cx(
37
37
  styles.category,
38
38
  hidden && commonStyles.hidden,
39
- hiddenOnSearch && commonInteractionStyles.hiddenOnSearch
39
+ hiddenOnSearch && commonInteractionStyles.hiddenOnSearch,
40
40
  )}
41
41
  data-name={category}
42
42
  aria-label={categoryName}
@@ -54,7 +54,7 @@ const styles = stylesheet.create({
54
54
  '.': ClassNames.category,
55
55
  minHeight:
56
56
  'calc(var(--epr-emoji-fullsize) + var(--epr-category-label-height))',
57
- position: 'relative'
57
+ position: 'relative',
58
58
  },
59
59
  categoryContent: {
60
60
  '.': ClassNames.categoryContent,
@@ -63,7 +63,7 @@ const styles = stylesheet.create({
63
63
  gridTemplateColumns: 'repeat(auto-fill, var(--epr-emoji-fullsize))',
64
64
  justifyContent: 'space-between',
65
65
  margin: 'var(--epr-category-padding)',
66
- position: 'relative'
66
+ position: 'relative',
67
67
  },
68
68
  label: {
69
69
  '.': ClassNames.label,
@@ -82,6 +82,6 @@ const styles = stylesheet.create({
82
82
  textTransform: 'capitalize',
83
83
  top: '0',
84
84
  width: '100%',
85
- zIndex: 'var(--epr-category-label-z-index)'
86
- }
85
+ zIndex: 'var(--epr-category-label-z-index)',
86
+ },
87
87
  });
@@ -5,10 +5,10 @@ import { ClassNames } from '../../DomUtils/classNames';
5
5
  import { getLabelHeight } from '../../DomUtils/elementPositionInRow';
6
6
  import { stylesheet } from '../../Stylesheet/stylesheet';
7
7
  import { categoryFromCategoryConfig } from '../../config/categoryConfig';
8
- import { CategoryConfig } from '../../types/exposedTypes';
9
8
  import { useCategoriesConfig } from '../../config/useConfig';
10
9
  import { DataEmojis } from '../../dataUtils/DataTypes';
11
10
  import { useEmojiVirtualization } from '../../hooks/useEmojiVirtualization';
11
+ import { CategoryConfig } from '../../types/exposedTypes';
12
12
  import { useEmojiListRef } from '../context/ElementRefContext';
13
13
  import { useVisibleCategoriesState } from '../context/PickerContext';
14
14
  import { useGetEmojisByCategory } from '../context/PickerDataContext';
@@ -30,7 +30,7 @@ export function EmojiList({ scrollTop }: { scrollTop: number }) {
30
30
  return (
31
31
  <ul className={cx(styles.emojiList)} ref={EmojiListRef}>
32
32
  <MeasureEmoji />
33
- {categories.map(categoryConfig => {
33
+ {categories.map((categoryConfig) => {
34
34
  const category = categoryFromCategoryConfig(categoryConfig);
35
35
 
36
36
  const currentOffset = topOffset;
@@ -45,11 +45,11 @@ export function EmojiList({ scrollTop }: { scrollTop: number }) {
45
45
  categoryEmojis={getEmojisByCategory(category)}
46
46
  categoryConfig={categoryConfig}
47
47
  topOffset={currentOffset}
48
- onHeightReady={height => {
48
+ onHeightReady={(height) => {
49
49
  if (categoryHeights[category] !== height) {
50
- setCategoryHeights(prev => ({
50
+ setCategoryHeights((prev) => ({
51
51
  ...prev,
52
- [category]: height
52
+ [category]: height,
53
53
  }));
54
54
  }
55
55
  }}
@@ -67,7 +67,7 @@ function RenderCategory({
67
67
  categoryConfig,
68
68
  topOffset,
69
69
  onHeightReady,
70
- scrollTop
70
+ scrollTop,
71
71
  }: {
72
72
  categoryEmojis: DataEmojis;
73
73
  categoryConfig: CategoryConfig;
@@ -82,7 +82,7 @@ function RenderCategory({
82
82
  topOffset,
83
83
  onHeightReady,
84
84
  scrollTop,
85
- isCategoryVisible: visibleCategories.includes(categoryConfig.category)
85
+ isCategoryVisible: visibleCategories.includes(categoryConfig.category),
86
86
  });
87
87
 
88
88
  return (
@@ -103,6 +103,6 @@ const styles = stylesheet.create({
103
103
  '.': ClassNames.emojiList,
104
104
  listStyle: 'none',
105
105
  margin: '0',
106
- padding: '0'
107
- }
106
+ padding: '0',
107
+ },
108
108
  });