emoji-picker-react 4.6.4-rc.1 → 4.6.4

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 (87) hide show
  1. package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
  2. package/dist/DomUtils/classNames.d.ts +23 -23
  3. package/dist/DomUtils/elementPositionInRow.d.ts +10 -10
  4. package/dist/DomUtils/focusElement.d.ts +5 -5
  5. package/dist/DomUtils/getActiveElement.d.ts +2 -2
  6. package/dist/DomUtils/keyboardNavigation.d.ts +8 -8
  7. package/dist/DomUtils/scrollTo.d.ts +5 -5
  8. package/dist/DomUtils/selectors.d.ts +31 -31
  9. package/dist/EmojiPickerReact.d.ts +6 -6
  10. package/dist/Stylesheet/stylesheet.d.ts +11 -39
  11. package/dist/components/ErrorBoundary.d.ts +15 -15
  12. package/dist/components/Layout/Absolute.d.ts +8 -8
  13. package/dist/components/Layout/Flex.d.ts +14 -14
  14. package/dist/components/Layout/Relative.d.ts +8 -8
  15. package/dist/components/Layout/Space.d.ts +7 -7
  16. package/dist/components/atoms/Button.d.ts +6 -6
  17. package/dist/components/body/Body.d.ts +2 -2
  18. package/dist/components/body/EmojiCategory.d.ts +11 -11
  19. package/dist/components/body/EmojiList.d.ts +2 -2
  20. package/dist/components/body/EmojiVariationPicker.d.ts +3 -3
  21. package/dist/components/body/Suggested.d.ts +7 -7
  22. package/dist/components/context/ElementRefContext.d.ts +14 -14
  23. package/dist/components/context/PickerConfigContext.d.ts +9 -9
  24. package/dist/components/context/PickerContext.d.ts +22 -25
  25. package/dist/components/emoji/BaseEmojiProps.d.ts +12 -12
  26. package/dist/components/emoji/ClickableEmojiButton.d.ts +13 -13
  27. package/dist/components/emoji/Emoji.d.ts +12 -12
  28. package/dist/components/emoji/EmojiImg.d.ts +10 -10
  29. package/dist/components/emoji/ExportedEmoji.d.ts +11 -11
  30. package/dist/components/emoji/NativeEmoji.d.ts +5 -5
  31. package/dist/components/emoji/ViewOnlyEmoji.d.ts +3 -3
  32. package/dist/components/footer/Preview.d.ts +8 -8
  33. package/dist/components/header/CssSearch.d.ts +4 -4
  34. package/dist/components/header/Header.d.ts +2 -3
  35. package/dist/components/header/Search.d.ts +4 -4
  36. package/dist/components/header/SkinTonePicker.d.ts +12 -12
  37. package/dist/components/main/PickerMain.d.ts +6 -6
  38. package/dist/components/navigation/CategoryNavigation.d.ts +3 -3
  39. package/dist/config/categoryConfig.d.ts +20 -20
  40. package/dist/config/cdnUrls.d.ts +2 -2
  41. package/dist/config/config.d.ts +47 -47
  42. package/dist/config/customEmojiConfig.d.ts +6 -6
  43. package/dist/config/mutableConfig.d.ts +8 -8
  44. package/dist/config/useConfig.d.ts +25 -25
  45. package/dist/data/emojis.d.ts +50 -50
  46. package/dist/data/groups.d.ts +2 -2
  47. package/dist/data/skinToneVariations.d.ts +5 -5
  48. package/dist/dataUtils/DataTypes.d.ts +19 -19
  49. package/dist/dataUtils/alphaNumericEmojiIndex.d.ts +5 -5
  50. package/dist/dataUtils/emojiSelectors.d.ts +18 -18
  51. package/dist/dataUtils/parseNativeEmoji.d.ts +1 -1
  52. package/dist/dataUtils/suggested.d.ts +11 -11
  53. package/dist/emoji-picker-react.cjs.development.css +0 -1
  54. package/dist/emoji-picker-react.cjs.development.js +97 -91
  55. package/dist/emoji-picker-react.cjs.development.js.map +1 -1
  56. package/dist/emoji-picker-react.cjs.production.min.js +1 -1
  57. package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
  58. package/dist/emoji-picker-react.esm.js +100 -97
  59. package/dist/emoji-picker-react.esm.js.map +1 -1
  60. package/dist/hooks/preloadEmoji.d.ts +5 -5
  61. package/dist/hooks/useActiveCategoryScrollDetection.d.ts +1 -1
  62. package/dist/hooks/useCloseAllOpenToggles.d.ts +2 -2
  63. package/dist/hooks/useDebouncedState.d.ts +1 -1
  64. package/dist/hooks/useDisallowMouseMove.d.ts +4 -4
  65. package/dist/hooks/useDisallowedEmojis.d.ts +3 -3
  66. package/dist/hooks/useEmojiPreviewEvents.d.ts +3 -3
  67. package/dist/hooks/useFilter.d.ts +12 -12
  68. package/dist/hooks/useFocus.d.ts +3 -3
  69. package/dist/hooks/useHideEmojisByUniocode.d.ts +1 -1
  70. package/dist/hooks/useInitialLoad.d.ts +2 -2
  71. package/dist/hooks/useIsEmojiHidden.d.ts +8 -8
  72. package/dist/hooks/useIsSearchMode.d.ts +1 -1
  73. package/dist/hooks/useKeyboardNavigation.d.ts +1 -1
  74. package/dist/hooks/useMouseDownHandlers.d.ts +3 -3
  75. package/dist/hooks/useOnFocus.d.ts +1 -1
  76. package/dist/hooks/useOnScroll.d.ts +2 -2
  77. package/dist/hooks/useScrollCategoryIntoView.d.ts +1 -1
  78. package/dist/hooks/useSetVariationPicker.d.ts +2 -2
  79. package/dist/hooks/useShouldHideCustomEmojis.d.ts +1 -1
  80. package/dist/hooks/useShouldShowSkinTonePicker.d.ts +4 -4
  81. package/dist/index.d.ts +7 -7
  82. package/dist/typeRefinements/typeRefinements.d.ts +5 -5
  83. package/dist/types/exposedTypes.d.ts +50 -50
  84. package/package.json +6 -8
  85. package/src/components/header/Header.tsx +0 -1
  86. package/src/components/header/Search.tsx +9 -1
  87. package/src/components/header/Header.css +0 -4
@@ -1,5 +1,5 @@
1
- import { GetEmojiUrl } from '../components/emoji/BaseEmojiProps';
2
- import { DataEmoji } from '../dataUtils/DataTypes';
3
- import { EmojiStyle } from '../types/exposedTypes';
4
- export declare function preloadEmoji(getEmojiUrl: GetEmojiUrl, emoji: undefined | DataEmoji, emojiStyle: EmojiStyle): void;
5
- export declare const preloadedEmojs: Set<string>;
1
+ import { GetEmojiUrl } from '../components/emoji/BaseEmojiProps';
2
+ import { DataEmoji } from '../dataUtils/DataTypes';
3
+ import { EmojiStyle } from '../types/exposedTypes';
4
+ export declare function preloadEmoji(getEmojiUrl: GetEmojiUrl, emoji: undefined | DataEmoji, emojiStyle: EmojiStyle): void;
5
+ export declare const preloadedEmojs: Set<string>;
@@ -1 +1 @@
1
- export declare function useActiveCategoryScrollDetection(setActiveCategory: (category: string) => void): void;
1
+ export declare function useActiveCategoryScrollDetection(setActiveCategory: (category: string) => void): void;
@@ -1,2 +1,2 @@
1
- export declare function useCloseAllOpenToggles(): () => void;
2
- export declare function useHasOpenToggles(): () => boolean;
1
+ export declare function useCloseAllOpenToggles(): () => void;
2
+ export declare function useHasOpenToggles(): () => boolean;
@@ -1 +1 @@
1
- export declare function useDebouncedState<T>(initialValue: T, delay?: number): [T, (value: T) => Promise<T>];
1
+ export declare function useDebouncedState<T>(initialValue: T, delay?: number): [T, (value: T) => Promise<T>];
@@ -1,4 +1,4 @@
1
- export declare function useDisallowMouseMove(): () => void;
2
- export declare function useAllowMouseMove(): () => void;
3
- export declare function useIsMouseDisallowed(): () => boolean;
4
- export declare function useOnMouseMove(): void;
1
+ export declare function useDisallowMouseMove(): () => void;
2
+ export declare function useAllowMouseMove(): () => void;
3
+ export declare function useIsMouseDisallowed(): () => boolean;
4
+ export declare function useOnMouseMove(): void;
@@ -1,3 +1,3 @@
1
- import { DataEmoji } from '../dataUtils/DataTypes';
2
- export declare function useDisallowedEmojis(): Record<string, boolean>;
3
- export declare function useIsEmojiDisallowed(): (emoji: DataEmoji) => boolean;
1
+ import { DataEmoji } from '../dataUtils/DataTypes';
2
+ export declare function useDisallowedEmojis(): Record<string, boolean>;
3
+ export declare function useIsEmojiDisallowed(): (emoji: DataEmoji) => boolean;
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
2
- import { PreviewEmoji } from '../components/footer/Preview';
3
- export declare function useEmojiPreviewEvents(allow: boolean, setPreviewEmoji: React.Dispatch<React.SetStateAction<PreviewEmoji>>): void;
1
+ import * as React from 'react';
2
+ import { PreviewEmoji } from '../components/footer/Preview';
3
+ export declare function useEmojiPreviewEvents(allow: boolean, setPreviewEmoji: React.Dispatch<React.SetStateAction<PreviewEmoji>>): void;
@@ -1,12 +1,12 @@
1
- import { DataEmoji } from '../dataUtils/DataTypes';
2
- export declare function useClearSearch(): () => void;
3
- export declare function useAppendSearch(): (str: string) => void;
4
- export declare function useFilter(): {
5
- onChange: (inputValue: string) => void;
6
- searchTerm: string;
7
- SearchInputRef: import("../components/context/ElementRefContext").ElementRef<HTMLInputElement>;
8
- statusSearchResults: string;
9
- };
10
- export declare function useIsEmojiFiltered(): (unified: string) => boolean;
11
- export type FilterDict = Record<string, DataEmoji>;
12
- export declare function getNormalizedSearchTerm(str: string): string;
1
+ import { DataEmoji } from '../dataUtils/DataTypes';
2
+ export declare function useClearSearch(): () => void;
3
+ export declare function useAppendSearch(): (str: string) => void;
4
+ export declare function useFilter(): {
5
+ onChange: (inputValue: string) => void;
6
+ searchTerm: string;
7
+ SearchInputRef: import("../components/context/ElementRefContext").ElementRef<HTMLInputElement>;
8
+ statusSearchResults: string;
9
+ };
10
+ export declare function useIsEmojiFiltered(): (unified: string) => boolean;
11
+ export declare type FilterDict = Record<string, DataEmoji>;
12
+ export declare function getNormalizedSearchTerm(str: string): string;
@@ -1,3 +1,3 @@
1
- export declare function useFocusSearchInput(): () => void;
2
- export declare function useFocusSkinTonePicker(): () => void;
3
- export declare function useFocusCategoryNavigation(): () => void;
1
+ export declare function useFocusSearchInput(): () => void;
2
+ export declare function useFocusSkinTonePicker(): () => void;
3
+ export declare function useFocusCategoryNavigation(): () => void;
@@ -1 +1 @@
1
- export declare function useIsUnicodeHidden(): (emojiUnified: string) => boolean;
1
+ export declare function useIsUnicodeHidden(): (emojiUnified: string) => boolean;
@@ -1,2 +1,2 @@
1
- import * as React from 'react';
2
- export declare function useMarkInitialLoad(dispatch: React.Dispatch<React.SetStateAction<boolean>>): void;
1
+ import * as React from 'react';
2
+ export declare function useMarkInitialLoad(dispatch: React.Dispatch<React.SetStateAction<boolean>>): void;
@@ -1,8 +1,8 @@
1
- import { DataEmoji } from '../dataUtils/DataTypes';
2
- export declare function useIsEmojiHidden(): (emoji: DataEmoji) => IsHiddenReturn;
3
- type IsHiddenReturn = {
4
- failedToLoad: boolean;
5
- filteredOut: boolean;
6
- hidden: boolean;
7
- };
8
- export {};
1
+ import { DataEmoji } from '../dataUtils/DataTypes';
2
+ export declare function useIsEmojiHidden(): (emoji: DataEmoji) => IsHiddenReturn;
3
+ declare type IsHiddenReturn = {
4
+ failedToLoad: boolean;
5
+ filteredOut: boolean;
6
+ hidden: boolean;
7
+ };
8
+ export {};
@@ -1 +1 @@
1
- export default function useIsSearchMode(): boolean;
1
+ export default function useIsSearchMode(): boolean;
@@ -1 +1 @@
1
- export declare function useKeyboardNavigation(): void;
1
+ export declare function useKeyboardNavigation(): void;
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
2
- import { NullableElement } from '../DomUtils/selectors';
3
- export declare function useMouseDownHandlers(BodyRef: React.MutableRefObject<NullableElement>): void;
1
+ import * as React from 'react';
2
+ import { NullableElement } from '../DomUtils/selectors';
3
+ export declare function useMouseDownHandlers(BodyRef: React.MutableRefObject<NullableElement>): void;
@@ -1 +1 @@
1
- export declare function useOnFocus(): void;
1
+ export declare function useOnFocus(): void;
@@ -1,2 +1,2 @@
1
- import { ElementRef } from '../components/context/ElementRefContext';
2
- export declare function useOnScroll(BodyRef: ElementRef): void;
1
+ import { ElementRef } from '../components/context/ElementRefContext';
2
+ export declare function useOnScroll(BodyRef: ElementRef): void;
@@ -1 +1 @@
1
- export declare function useScrollCategoryIntoView(): (category: string) => void;
1
+ export declare function useScrollCategoryIntoView(): (category: string) => void;
@@ -1,2 +1,2 @@
1
- import { NullableElement } from '../DomUtils/selectors';
2
- export default function useSetVariationPicker(): (element: NullableElement) => void;
1
+ import { NullableElement } from '../DomUtils/selectors';
2
+ export default function useSetVariationPicker(): (element: NullableElement) => void;
@@ -1 +1 @@
1
- export declare function useShouldHideCustomEmojis(): boolean;
1
+ export declare function useShouldHideCustomEmojis(): boolean;
@@ -1,4 +1,4 @@
1
- import { SkinTonePickerLocation } from '../types/exposedTypes';
2
- export declare function useShouldShowSkinTonePicker(): (location: SkinTonePickerLocation) => boolean;
3
- export declare function useIsSkinToneInSearch(): boolean;
4
- export declare function useIsSkinToneInPreview(): boolean;
1
+ import { SkinTonePickerLocation } from '../types/exposedTypes';
2
+ export declare function useShouldShowSkinTonePicker(): (location: SkinTonePickerLocation) => boolean;
3
+ export declare function useIsSkinToneInSearch(): boolean;
4
+ export declare function useIsSkinToneInPreview(): boolean;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
- import { PickerConfig } from './config/config';
3
- export { ExportedEmoji as Emoji } from './components/emoji/ExportedEmoji';
4
- export { EmojiStyle, SkinTones, Theme, Categories, EmojiClickData, SuggestionMode, SkinTonePickerLocation } from './types/exposedTypes';
5
- export interface PickerProps extends PickerConfig {
6
- }
7
- export default function EmojiPicker(props: PickerProps): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { PickerConfig } from './config/config';
3
+ export { ExportedEmoji as Emoji } from './components/emoji/ExportedEmoji';
4
+ export { EmojiStyle, SkinTones, Theme, Categories, EmojiClickData, SuggestionMode, SkinTonePickerLocation } from './types/exposedTypes';
5
+ export interface PickerProps extends PickerConfig {
6
+ }
7
+ export default function EmojiPicker(props: PickerProps): JSX.Element;
@@ -1,5 +1,5 @@
1
- import { CategoryConfig, CustomCategoryConfig } from '../config/categoryConfig';
2
- import { CustomEmoji } from '../config/customEmojiConfig';
3
- import { DataEmoji } from '../dataUtils/DataTypes';
4
- export declare function isCustomCategory(category: CategoryConfig | CustomCategoryConfig): category is CustomCategoryConfig;
5
- export declare function isCustomEmoji(emoji: Partial<DataEmoji>): emoji is CustomEmoji;
1
+ import { CategoryConfig, CustomCategoryConfig } from '../config/categoryConfig';
2
+ import { CustomEmoji } from '../config/customEmojiConfig';
3
+ import { DataEmoji } from '../dataUtils/DataTypes';
4
+ export declare function isCustomCategory(category: CategoryConfig | CustomCategoryConfig): category is CustomCategoryConfig;
5
+ export declare function isCustomEmoji(emoji: Partial<DataEmoji>): emoji is CustomEmoji;
@@ -1,50 +1,50 @@
1
- export type EmojiClickData = {
2
- activeSkinTone: SkinTones;
3
- unified: string;
4
- unifiedWithoutSkinTone: string;
5
- emoji: string;
6
- names: string[];
7
- imageUrl: string;
8
- getImageUrl: (emojiStyle?: EmojiStyle) => string;
9
- isCustom: boolean;
10
- };
11
- export declare enum SuggestionMode {
12
- RECENT = "recent",
13
- FREQUENT = "frequent"
14
- }
15
- export declare enum EmojiStyle {
16
- NATIVE = "native",
17
- APPLE = "apple",
18
- TWITTER = "twitter",
19
- GOOGLE = "google",
20
- FACEBOOK = "facebook"
21
- }
22
- export declare enum Theme {
23
- DARK = "dark",
24
- LIGHT = "light",
25
- AUTO = "auto"
26
- }
27
- export declare enum SkinTones {
28
- NEUTRAL = "neutral",
29
- LIGHT = "1f3fb",
30
- MEDIUM_LIGHT = "1f3fc",
31
- MEDIUM = "1f3fd",
32
- MEDIUM_DARK = "1f3fe",
33
- DARK = "1f3ff"
34
- }
35
- export declare enum Categories {
36
- SUGGESTED = "suggested",
37
- CUSTOM = "custom",
38
- SMILEYS_PEOPLE = "smileys_people",
39
- ANIMALS_NATURE = "animals_nature",
40
- FOOD_DRINK = "food_drink",
41
- TRAVEL_PLACES = "travel_places",
42
- ACTIVITIES = "activities",
43
- OBJECTS = "objects",
44
- SYMBOLS = "symbols",
45
- FLAGS = "flags"
46
- }
47
- export declare enum SkinTonePickerLocation {
48
- SEARCH = "SEARCH",
49
- PREVIEW = "PREVIEW"
50
- }
1
+ export declare type EmojiClickData = {
2
+ activeSkinTone: SkinTones;
3
+ unified: string;
4
+ unifiedWithoutSkinTone: string;
5
+ emoji: string;
6
+ names: string[];
7
+ imageUrl: string;
8
+ getImageUrl: (emojiStyle?: EmojiStyle) => string;
9
+ isCustom: boolean;
10
+ };
11
+ export declare enum SuggestionMode {
12
+ RECENT = "recent",
13
+ FREQUENT = "frequent"
14
+ }
15
+ export declare enum EmojiStyle {
16
+ NATIVE = "native",
17
+ APPLE = "apple",
18
+ TWITTER = "twitter",
19
+ GOOGLE = "google",
20
+ FACEBOOK = "facebook"
21
+ }
22
+ export declare enum Theme {
23
+ DARK = "dark",
24
+ LIGHT = "light",
25
+ AUTO = "auto"
26
+ }
27
+ export declare enum SkinTones {
28
+ NEUTRAL = "neutral",
29
+ LIGHT = "1f3fb",
30
+ MEDIUM_LIGHT = "1f3fc",
31
+ MEDIUM = "1f3fd",
32
+ MEDIUM_DARK = "1f3fe",
33
+ DARK = "1f3ff"
34
+ }
35
+ export declare enum Categories {
36
+ SUGGESTED = "suggested",
37
+ CUSTOM = "custom",
38
+ SMILEYS_PEOPLE = "smileys_people",
39
+ ANIMALS_NATURE = "animals_nature",
40
+ FOOD_DRINK = "food_drink",
41
+ TRAVEL_PLACES = "travel_places",
42
+ ACTIVITIES = "activities",
43
+ OBJECTS = "objects",
44
+ SYMBOLS = "symbols",
45
+ FLAGS = "flags"
46
+ }
47
+ export declare enum SkinTonePickerLocation {
48
+ SEARCH = "SEARCH",
49
+ PREVIEW = "PREVIEW"
50
+ }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.6.4-rc.1",
2
+ "version": "4.6.4",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -23,10 +23,11 @@
23
23
  },
24
24
  "scripts": {
25
25
  "start": "tsdx watch",
26
- "build": "node ./scripts/prepare.js && tsdx build && node ./scripts/copyData.js",
26
+ "build": "node ./scripts/prepare.js && yarn type-check && tsdx build --transpileOnly && node ./scripts/copyData.js",
27
+ "type-check": "tsc --noEmit --incremental --pretty --project tsconfig.json",
27
28
  "test": "tsdx test --passWithNoTests",
28
29
  "lint": "eslint ./src --ext .ts,.tsx",
29
- "prepare": "tsdx build",
30
+ "prepare": "yarn type-check && tsdx build --transpileOnly",
30
31
  "size": "size-limit",
31
32
  "analyze": "size-limit --why",
32
33
  "storybook": "start-storybook -p 6006",
@@ -95,12 +96,9 @@
95
96
  "tiny-invariant": "^1.2.0",
96
97
  "tsdx": "^0.14.1",
97
98
  "tslib": "^2.4.0",
98
- "typescript": "^5.0.0"
99
+ "typescript": "^4.7.4"
99
100
  },
100
101
  "dependencies": {
101
- "flairup": "0.0.12"
102
- },
103
- "resolutions": {
104
- "typescript": "^5.0.0"
102
+ "flairup": "0.0.15"
105
103
  }
106
104
  }
@@ -3,7 +3,6 @@ import * as React from 'react';
3
3
  import Relative from '../Layout/Relative';
4
4
  import { CategoryNavigation } from '../navigation/CategoryNavigation';
5
5
 
6
- import './Header.css';
7
6
  import { SearchContainer } from './Search';
8
7
 
9
8
  export function Header() {
@@ -2,6 +2,7 @@ import { cx } from 'flairup';
2
2
  import * as React from 'react';
3
3
  import { useState } from 'react';
4
4
 
5
+ import { stylesheet } from '../../Stylesheet/stylesheet';
5
6
  import {
6
7
  useAutoFocusSearchConfig,
7
8
  useSearchDisabledConfig,
@@ -29,7 +30,7 @@ export function SearchContainer() {
29
30
  }
30
31
 
31
32
  return (
32
- <Flex className="epr-header-overlay">
33
+ <Flex className={cx(styles.overlay)}>
33
34
  <Search />
34
35
 
35
36
  {isSkinToneInSearch ? <SkinTonePicker /> : null}
@@ -37,6 +38,13 @@ export function SearchContainer() {
37
38
  );
38
39
  }
39
40
 
41
+ const styles = stylesheet.create({
42
+ overlay: {
43
+ padding: 'var(--epr-header-padding)',
44
+ zIndex: 'var(--epr-header-overlay-z-index)'
45
+ }
46
+ });
47
+
40
48
  export function Search() {
41
49
  const [inc, setInc] = useState(0);
42
50
  const closeAllOpenToggles = useCloseAllOpenToggles();
@@ -1,4 +0,0 @@
1
- .EmojiPickerReact .epr-header .epr-header-overlay {
2
- padding: var(--epr-header-padding);
3
- z-index: var(--epr-header-overlay-z-index);
4
- }