emoji-picker-react 4.22.3 → 5.0.1
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 +331 -49
- package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
- package/dist/DomUtils/classNames.d.ts +23 -23
- package/dist/DomUtils/detectEmojyPartiallyBelowFold.d.ts +2 -2
- package/dist/DomUtils/elementPositionInRow.d.ts +5 -5
- package/dist/DomUtils/eventBelongsToPicker.d.ts +2 -0
- package/dist/DomUtils/focusElement.d.ts +5 -5
- package/dist/DomUtils/getActiveElement.d.ts +2 -2
- package/dist/DomUtils/isJsdom.d.ts +1 -0
- package/dist/DomUtils/isRtl.d.ts +1 -0
- package/dist/DomUtils/keyboardNavigation.d.ts +15 -8
- package/dist/DomUtils/scrollTo.d.ts +4 -5
- package/dist/DomUtils/selectors.d.ts +31 -35
- package/dist/EmojiPickerReact.d.ts +5 -5
- package/dist/Stylesheet/DedupedStyle.d.ts +13 -0
- package/dist/Stylesheet/stylesheet.d.ts +40 -37
- package/dist/components/ErrorBoundary.d.ts +15 -15
- package/dist/components/Layout/Absolute.d.ts +8 -8
- package/dist/components/Layout/Flex.d.ts +13 -13
- package/dist/components/Layout/Relative.d.ts +8 -8
- package/dist/components/Layout/Space.d.ts +7 -7
- package/dist/components/Reactions/BtnPlus.d.ts +2 -2
- package/dist/components/Reactions/DEFAULT_REACTIONS.d.ts +1 -1
- package/dist/components/Reactions/Reactions.d.ts +3 -2
- package/dist/components/atoms/Button.d.ts +11 -6
- package/dist/components/body/EmojiCategory.d.ts +13 -12
- package/dist/components/body/EmojiList.d.ts +7 -4
- package/dist/components/body/EmojiVariationPicker.d.ts +2 -2
- package/dist/components/body/MeasureEmoji.d.ts +2 -2
- package/dist/components/body/listComponents.d.ts +47 -0
- package/dist/components/context/ElementRefContext.d.ts +18 -16
- package/dist/components/context/PickerConfigContext.d.ts +14 -9
- package/dist/components/context/PickerContext.d.ts +57 -25
- package/dist/components/context/PickerDataContext.d.ts +23 -17
- package/dist/components/emoji/BaseEmojiProps.d.ts +14 -13
- package/dist/components/emoji/ClickableEmojiButton.d.ts +23 -15
- package/dist/components/emoji/Emoji.d.ts +18 -15
- package/dist/components/emoji/EmojiImg.d.ts +11 -11
- package/dist/components/emoji/ExportedEmoji.d.ts +11 -11
- package/dist/components/emoji/NativeEmoji.d.ts +6 -6
- package/dist/components/emoji/ViewOnlyEmoji.d.ts +3 -3
- package/dist/components/emoji/emojiStyles.d.ts +6 -1
- package/dist/components/footer/Preview.d.ts +7 -7
- package/dist/components/header/Header.d.ts +2 -2
- package/dist/components/header/Search/BtnClearSearch.d.ts +2 -2
- package/dist/components/header/Search/IcnSearch.d.ts +2 -2
- package/dist/components/header/Search/Search.d.ts +11 -3
- package/dist/components/header/SkinTonePicker/BtnSkinToneVariation.d.ts +12 -12
- package/dist/components/header/SkinTonePicker/SkinTonePicker.d.ts +11 -11
- package/dist/components/icons/svgIcons.d.ts +4 -0
- package/dist/components/main/PickerMainBehaviors.d.ts +4 -0
- package/dist/components/main/defaultAppearance.d.ts +12 -0
- package/dist/components/main/labelHeight.d.ts +1 -0
- package/dist/components/navigation/CategoryButton.d.ts +12 -12
- package/dist/components/navigation/CategoryNavIcon.d.ts +4 -4
- package/dist/components/navigation/CategoryNavigation.d.ts +19 -2
- package/dist/config/categoryConfig.d.ts +34 -34
- package/dist/config/cdnUrls.d.ts +2 -2
- package/dist/config/compareConfig.d.ts +10 -2
- package/dist/config/config.d.ts +166 -64
- package/dist/config/customEmojiConfig.d.ts +14 -14
- package/dist/config/defaultPickerConfiguration.d.ts +10 -0
- package/dist/config/mutableConfig.d.ts +32 -10
- package/dist/config/useConfig.d.ts +48 -36
- package/dist/data/defaultEmojiData.d.ts +9 -0
- package/dist/data/defaultEmojiData.js +40 -0
- package/dist/data/emojis-bn.d.mts +39 -0
- package/dist/data/emojis-bn.d.ts +38 -2
- package/dist/data/emojis-bn.js +25 -2
- package/dist/data/emojis-bn.mjs +2 -0
- package/dist/data/emojis-da.d.mts +39 -0
- package/dist/data/emojis-da.d.ts +38 -2
- package/dist/data/emojis-da.js +25 -2
- package/dist/data/emojis-da.mjs +2 -0
- package/dist/data/emojis-de.d.mts +39 -0
- package/dist/data/emojis-de.d.ts +38 -2
- package/dist/data/emojis-de.js +25 -2
- package/dist/data/emojis-de.mjs +2 -0
- package/dist/data/emojis-en-gb.d.mts +39 -0
- package/dist/data/emojis-en-gb.d.ts +38 -2
- package/dist/data/emojis-en-gb.js +25 -2
- package/dist/data/emojis-en-gb.mjs +2 -0
- package/dist/data/emojis-en.d.mts +39 -0
- package/dist/data/emojis-en.d.ts +38 -2
- package/dist/data/emojis-en.js +25 -2
- package/dist/data/emojis-en.mjs +2 -0
- package/dist/data/emojis-es-mx.d.mts +39 -0
- package/dist/data/emojis-es-mx.d.ts +38 -2
- package/dist/data/emojis-es-mx.js +25 -2
- package/dist/data/emojis-es-mx.mjs +2 -0
- package/dist/data/emojis-es.d.mts +39 -0
- package/dist/data/emojis-es.d.ts +38 -2
- package/dist/data/emojis-es.js +25 -2
- package/dist/data/emojis-es.mjs +2 -0
- package/dist/data/emojis-et.d.mts +39 -0
- package/dist/data/emojis-et.d.ts +38 -2
- package/dist/data/emojis-et.js +25 -2
- package/dist/data/emojis-et.mjs +2 -0
- package/dist/data/emojis-fi.d.mts +39 -0
- package/dist/data/emojis-fi.d.ts +38 -2
- package/dist/data/emojis-fi.js +25 -2
- package/dist/data/emojis-fi.mjs +2 -0
- package/dist/data/emojis-fr.d.mts +39 -0
- package/dist/data/emojis-fr.d.ts +38 -2
- package/dist/data/emojis-fr.js +25 -2
- package/dist/data/emojis-fr.mjs +2 -0
- package/dist/data/emojis-hi.d.mts +39 -0
- package/dist/data/emojis-hi.d.ts +38 -2
- package/dist/data/emojis-hi.js +25 -2
- package/dist/data/emojis-hi.mjs +2 -0
- package/dist/data/emojis-hu.d.mts +39 -0
- package/dist/data/emojis-hu.d.ts +38 -2
- package/dist/data/emojis-hu.js +25 -2
- package/dist/data/emojis-hu.mjs +2 -0
- package/dist/data/emojis-it.d.mts +39 -0
- package/dist/data/emojis-it.d.ts +38 -2
- package/dist/data/emojis-it.js +25 -2
- package/dist/data/emojis-it.mjs +2 -0
- package/dist/data/emojis-ja.d.mts +39 -0
- package/dist/data/emojis-ja.d.ts +38 -2
- package/dist/data/emojis-ja.js +25 -2
- package/dist/data/emojis-ja.mjs +2 -0
- package/dist/data/emojis-ko.d.mts +39 -0
- package/dist/data/emojis-ko.d.ts +38 -2
- package/dist/data/emojis-ko.js +25 -2
- package/dist/data/emojis-ko.mjs +2 -0
- package/dist/data/emojis-lt.d.mts +39 -0
- package/dist/data/emojis-lt.d.ts +38 -2
- package/dist/data/emojis-lt.js +25 -2
- package/dist/data/emojis-lt.mjs +2 -0
- package/dist/data/emojis-ms.d.mts +39 -0
- package/dist/data/emojis-ms.d.ts +38 -2
- package/dist/data/emojis-ms.js +25 -2
- package/dist/data/emojis-ms.mjs +2 -0
- package/dist/data/emojis-nb.d.mts +39 -0
- package/dist/data/emojis-nb.d.ts +38 -2
- package/dist/data/emojis-nb.js +25 -2
- package/dist/data/emojis-nb.mjs +2 -0
- package/dist/data/emojis-nl.d.mts +39 -0
- package/dist/data/emojis-nl.d.ts +38 -2
- package/dist/data/emojis-nl.js +25 -2
- package/dist/data/emojis-nl.mjs +2 -0
- package/dist/data/emojis-pl.d.mts +39 -0
- package/dist/data/emojis-pl.d.ts +38 -2
- package/dist/data/emojis-pl.js +25 -2
- package/dist/data/emojis-pl.mjs +2 -0
- package/dist/data/emojis-pt.d.mts +39 -0
- package/dist/data/emojis-pt.d.ts +38 -2
- package/dist/data/emojis-pt.js +25 -2
- package/dist/data/emojis-pt.mjs +2 -0
- package/dist/data/emojis-ru.d.mts +39 -0
- package/dist/data/emojis-ru.d.ts +38 -2
- package/dist/data/emojis-ru.js +25 -2
- package/dist/data/emojis-ru.mjs +2 -0
- package/dist/data/emojis-sv.d.mts +39 -0
- package/dist/data/emojis-sv.d.ts +38 -2
- package/dist/data/emojis-sv.js +25 -2
- package/dist/data/emojis-sv.mjs +2 -0
- package/dist/data/emojis-th.d.mts +39 -0
- package/dist/data/emojis-th.d.ts +38 -2
- package/dist/data/emojis-th.js +25 -2
- package/dist/data/emojis-th.mjs +2 -0
- package/dist/data/emojis-uk.d.mts +39 -0
- package/dist/data/emojis-uk.d.ts +38 -2
- package/dist/data/emojis-uk.js +25 -2
- package/dist/data/emojis-uk.mjs +2 -0
- package/dist/data/emojis-vi.d.mts +39 -0
- package/dist/data/emojis-vi.d.ts +38 -2
- package/dist/data/emojis-vi.js +25 -2
- package/dist/data/emojis-vi.mjs +2 -0
- package/dist/data/emojis-zh-hant.d.mts +39 -0
- package/dist/data/emojis-zh-hant.d.ts +38 -2
- package/dist/data/emojis-zh-hant.js +25 -2
- package/dist/data/emojis-zh-hant.mjs +2 -0
- package/dist/data/emojis-zh.d.mts +39 -0
- package/dist/data/emojis-zh.d.ts +38 -2
- package/dist/data/emojis-zh.js +25 -2
- package/dist/data/emojis-zh.mjs +2 -0
- package/dist/data/index.js +1 -0
- package/dist/data/registerDefaultEmojiData.d.ts +1 -0
- package/dist/data/registerDefaultEmojiData.js +3 -0
- package/dist/data/skinToneVariations.js +2 -2
- package/dist/data/skinToneVariations.ts +8 -7
- package/dist/data-core/pickerData.d.ts +12 -0
- package/dist/data-core/prepare.d.ts +23 -0
- package/dist/data-core/search.d.ts +13 -0
- package/dist/data-core/types.d.ts +23 -0
- package/dist/data.d.mts +72 -0
- package/dist/data.d.ts +72 -0
- package/dist/dataUtils/DataTypes.d.ts +23 -19
- package/dist/dataUtils/emojiSelectors.d.ts +15 -16
- package/dist/dataUtils/emojiUtils.d.ts +1 -12
- package/dist/dataUtils/nativeEmojiSequenceSupport.d.ts +10 -0
- package/dist/dataUtils/nativeEmojiSupport.d.ts +40 -0
- package/dist/dataUtils/parseNativeEmoji.d.ts +1 -1
- package/dist/dataUtils/suggested.d.ts +11 -11
- package/dist/dataUtils/suggestedEmojis.d.ts +7 -0
- package/dist/esm/chunks/chunk-7ZGTUZFB.mjs +8025 -0
- package/dist/esm/chunks/chunk-ACXAQEKG.mjs +149 -0
- package/dist/esm/chunks/chunk-F2KS7DCA.mjs +6735 -0
- package/dist/esm/chunks/chunk-L5W4PFRJ.mjs +14 -0
- package/dist/esm/chunks/chunk-LO4TPPLH.mjs +33 -0
- package/dist/esm/chunks/emojis-6L3GRBAP.mjs +7 -0
- package/dist/esm/data.mjs +11 -0
- package/dist/esm/index.mjs +279 -0
- package/dist/esm/primitives/index.mjs +8 -0
- package/dist/hooks/preloadEmoji.d.ts +5 -9
- package/dist/hooks/useActiveCategoryScrollDetection.d.ts +11 -11
- package/dist/hooks/useCategoryHeight.d.ts +7 -5
- package/dist/hooks/useCloseAllOpenToggles.d.ts +2 -2
- package/dist/hooks/useDataIdentityStabilityWarning.d.ts +13 -0
- package/dist/hooks/useDebouncedState.d.ts +1 -1
- package/dist/hooks/useDisallowMouseMove.d.ts +4 -4
- package/dist/hooks/useDisallowedEmojis.d.ts +2 -3
- package/dist/hooks/useEmojiPreviewEvents.d.ts +3 -3
- package/dist/hooks/useEmojiVirtualization.d.ts +22 -17
- package/dist/hooks/useFilter.d.ts +10 -16
- package/dist/hooks/useFocus.d.ts +3 -3
- package/dist/hooks/useInitialLoad.d.ts +2 -2
- package/dist/hooks/useIsEmojiHidden.d.ts +8 -8
- package/dist/hooks/useIsMounted.d.ts +1 -1
- package/dist/hooks/useIsSearchMode.d.ts +1 -1
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/hooks/useKeyboardNavigation.d.ts +3 -1
- package/dist/hooks/useMouseDownHandlers.d.ts +8 -4
- package/dist/hooks/useOnFocus.d.ts +1 -1
- package/dist/hooks/useOnScroll.d.ts +2 -2
- package/dist/hooks/useReactionsFocus.d.ts +1 -0
- package/dist/hooks/useRegisterRegion.d.ts +24 -0
- package/dist/hooks/useResolvedEmojiData.d.ts +37 -0
- package/dist/hooks/useScrollCategoryIntoView.d.ts +1 -1
- package/dist/hooks/useSearchController.d.ts +17 -0
- package/dist/hooks/useSearchResults.d.ts +8 -0
- package/dist/hooks/useSetVariationPicker.d.ts +2 -2
- package/dist/hooks/useShouldHideCustomEmojis.d.ts +1 -1
- package/dist/hooks/useShouldShowSkinTonePicker.d.ts +4 -4
- package/dist/index.d.mts +376 -0
- package/dist/index.d.ts +376 -9
- package/dist/index.js +2 -8
- package/dist/primitives/CategoryNav.d.ts +4 -0
- package/dist/primitives/Empty.d.ts +6 -0
- package/dist/primitives/List.d.ts +4 -0
- package/dist/primitives/LoadError.d.ts +8 -0
- package/dist/primitives/Loading.d.ts +4 -0
- package/dist/primitives/Panel.d.ts +3 -0
- package/dist/primitives/Preview.d.ts +3 -0
- package/dist/primitives/Reactions.d.ts +2 -0
- package/dist/primitives/Root.d.ts +26 -0
- package/dist/primitives/Search.d.ts +5 -0
- package/dist/primitives/SearchInput.d.ts +3 -0
- package/dist/primitives/SkinTone.d.ts +4 -0
- package/dist/primitives/Viewport.d.ts +19 -0
- package/dist/primitives/appearance.d.ts +3 -0
- package/dist/primitives/components.d.ts +27 -0
- package/dist/primitives/hooks.d.ts +48 -0
- package/dist/primitives/index.d.mts +561 -0
- package/dist/primitives/index.d.ts +561 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/nativeProps.d.ts +15 -0
- package/dist/primitives/scope.d.ts +13 -0
- package/dist/primitives/structuralStyles.d.ts +16 -0
- package/dist/primitives/tokens.d.ts +18 -0
- package/dist/primitives/types.d.ts +85 -0
- package/dist/state/activeEmojiStore.d.ts +7 -0
- package/dist/state/navigationRegistry.d.ts +61 -0
- package/dist/state/regionTraversal.d.ts +20 -0
- package/dist/typeRefinements/typeRefinements.d.ts +6 -6
- package/dist/types/exposedTypes.d.ts +16 -6
- package/dist/types/exposedTypes.js +5 -0
- package/dist/virtualization/virtualizationHelpers.d.ts +22 -18
- package/llms-full.txt +3683 -0
- package/llms.txt +66 -480
- package/package.json +180 -66
- package/src/DomUtils/categoryNameFromDom.ts +1 -1
- package/src/DomUtils/classNames.ts +1 -4
- package/src/DomUtils/elementPositionInRow.ts +28 -6
- package/src/DomUtils/eventBelongsToPicker.ts +17 -0
- package/src/DomUtils/getActiveElement.ts +7 -1
- package/src/DomUtils/isJsdom.ts +12 -0
- package/src/DomUtils/isRtl.ts +5 -0
- package/src/DomUtils/keyboardNavigation.ts +164 -144
- package/src/DomUtils/scrollTo.ts +20 -18
- package/src/DomUtils/selectors.ts +30 -127
- package/src/EmojiPickerReact.tsx +155 -48
- package/src/Stylesheet/DedupedStyle.tsx +80 -0
- package/src/Stylesheet/stylesheet.tsx +128 -59
- package/src/components/Layout/Flex.tsx +12 -11
- package/src/components/Reactions/BtnPlus.tsx +61 -51
- package/src/components/Reactions/Reactions.tsx +113 -55
- package/src/components/atoms/Button.tsx +18 -15
- package/src/components/body/EmojiCategory.tsx +77 -40
- package/src/components/body/EmojiList.tsx +107 -44
- package/src/components/body/EmojiVariationPicker.tsx +113 -66
- package/src/components/body/MeasureEmoji.tsx +9 -2
- package/src/components/body/listComponents.tsx +79 -0
- package/src/components/context/ElementRefContext.tsx +46 -35
- package/src/components/context/PickerConfigContext.tsx +55 -40
- package/src/components/context/PickerContext.tsx +567 -92
- package/src/components/context/PickerDataContext.tsx +114 -99
- package/src/components/emoji/BaseEmojiProps.ts +5 -4
- package/src/components/emoji/ClickableEmojiButton.tsx +148 -63
- package/src/components/emoji/Emoji.tsx +24 -2
- package/src/components/emoji/EmojiImg.tsx +13 -12
- package/src/components/emoji/ExportedEmoji.tsx +5 -4
- package/src/components/emoji/NativeEmoji.tsx +19 -16
- package/src/components/emoji/ViewOnlyEmoji.tsx +55 -30
- package/src/components/emoji/emojiStyles.ts +12 -11
- package/src/components/footer/Preview.tsx +86 -91
- package/src/components/header/Header.tsx +21 -6
- package/src/components/header/Search/BtnClearSearch.tsx +69 -55
- package/src/components/header/Search/IcnSearch.tsx +21 -21
- package/src/components/header/Search/Search.tsx +79 -137
- package/src/components/header/SkinTonePicker/BtnSkinToneVariation.tsx +99 -62
- package/src/components/header/SkinTonePicker/SkinTonePicker.tsx +84 -46
- package/src/components/icons/svgIcons.ts +17 -0
- package/src/components/main/PickerMainBehaviors.tsx +163 -0
- package/src/components/main/defaultAppearance.tsx +189 -0
- package/src/components/main/labelHeight.ts +5 -0
- package/src/components/navigation/CategoryButton.tsx +83 -57
- package/src/components/navigation/CategoryNavIcon.tsx +73 -194
- package/src/components/navigation/CategoryNavigation.tsx +118 -46
- package/src/config/categoryConfig.ts +7 -3
- package/src/config/cdnUrls.ts +11 -21
- package/src/config/compareConfig.ts +128 -30
- package/src/config/config.ts +228 -24
- package/src/config/defaultPickerConfiguration.ts +7 -0
- package/src/config/mutableConfig.ts +44 -20
- package/src/config/useConfig.ts +130 -37
- package/src/data/defaultEmojiData.ts +49 -0
- package/src/data/registerDefaultEmojiData.ts +8 -0
- package/src/data/skinToneVariations.ts +8 -7
- package/src/data-core/pickerData.ts +171 -0
- package/src/data-core/prepare.ts +163 -0
- package/src/data-core/search.ts +122 -0
- package/src/data-core/types.ts +36 -0
- package/src/data.ts +10 -0
- package/src/dataUtils/DataTypes.ts +4 -0
- package/src/dataUtils/emojiSelectors.ts +59 -63
- package/src/dataUtils/emojiUtils.ts +17 -74
- package/src/dataUtils/nativeEmojiSequenceSupport.ts +116 -0
- package/src/dataUtils/nativeEmojiSupport.ts +160 -0
- package/src/dataUtils/parseNativeEmoji.ts +3 -4
- package/src/dataUtils/suggested.ts +8 -4
- package/src/dataUtils/suggestedEmojis.ts +92 -0
- package/src/env.d.ts +4 -0
- package/src/hooks/preloadEmoji.ts +2 -47
- package/src/hooks/useActiveCategoryScrollDetection.ts +28 -16
- package/src/hooks/useCategoryHeight.ts +116 -10
- package/src/hooks/useDataIdentityStabilityWarning.ts +86 -0
- package/src/hooks/useDebouncedState.ts +13 -1
- package/src/hooks/useDisallowedEmojis.ts +31 -42
- package/src/hooks/useEmojiPreviewEvents.ts +43 -10
- package/src/hooks/useEmojiVirtualization.tsx +112 -52
- package/src/hooks/useFilter.ts +92 -132
- package/src/hooks/useFocus.ts +14 -24
- package/src/hooks/useIsEmojiHidden.ts +22 -14
- package/src/hooks/useKeyboardNavigation.ts +412 -432
- package/src/hooks/useMouseDownHandlers.ts +91 -16
- package/src/hooks/useOnFocus.ts +12 -3
- package/src/hooks/useOnScroll.ts +18 -2
- package/src/hooks/useReactionsFocus.ts +118 -0
- package/src/hooks/useRegisterRegion.ts +92 -0
- package/src/hooks/useResolvedEmojiData.ts +200 -0
- package/src/hooks/useScrollCategoryIntoView.ts +74 -12
- package/src/hooks/useSearchController.ts +369 -0
- package/src/hooks/useSearchResults.ts +51 -0
- package/src/hooks/useSetVariationPicker.ts +4 -1
- package/src/index.tsx +67 -5
- package/src/primitives/CategoryNav.tsx +40 -0
- package/src/primitives/Empty.tsx +68 -0
- package/src/primitives/List.tsx +61 -0
- package/src/primitives/LoadError.tsx +38 -0
- package/src/primitives/Loading.tsx +60 -0
- package/src/primitives/Panel.tsx +47 -0
- package/src/primitives/Preview.tsx +38 -0
- package/src/primitives/Reactions.tsx +2 -0
- package/src/primitives/Root.tsx +398 -0
- package/src/primitives/Search.tsx +41 -0
- package/src/primitives/SearchInput.tsx +110 -0
- package/src/primitives/SkinTone.tsx +76 -0
- package/src/primitives/Viewport.tsx +204 -0
- package/src/primitives/appearance.tsx +7 -0
- package/src/primitives/components.tsx +30 -0
- package/src/primitives/hooks.ts +165 -0
- package/src/primitives/index.ts +94 -0
- package/src/primitives/nativeProps.ts +90 -0
- package/src/primitives/scope.tsx +109 -0
- package/src/primitives/structuralStyles.tsx +136 -0
- package/src/primitives/tokens.ts +150 -0
- package/src/primitives/types.ts +192 -0
- package/src/state/activeEmojiStore.ts +39 -0
- package/src/state/navigationRegistry.ts +209 -0
- package/src/state/regionTraversal.ts +116 -0
- package/src/svg.d.ts +2 -2
- package/src/types/exposedTypes.ts +28 -1
- package/src/virtualization/virtualizationHelpers.ts +29 -8
- package/dist/components/body/Body.d.ts +0 -2
- package/dist/components/main/PickerMain.d.ts +0 -7
- package/dist/dataUtils/alphaNumericEmojiIndex.d.ts +0 -5
- package/dist/emoji-picker-react.cjs.development.js +0 -31413
- package/dist/emoji-picker-react.cjs.development.js.map +0 -1
- package/dist/emoji-picker-react.cjs.production.min.js +0 -2
- package/dist/emoji-picker-react.cjs.production.min.js.map +0 -1
- package/dist/emoji-picker-react.esm.js +0 -31411
- package/dist/emoji-picker-react.esm.js.map +0 -1
- package/dist/hooks/useHideEmojisByUniocode.d.ts +0 -1
- package/src/components/body/Body.tsx +0 -43
- package/src/components/main/PickerMain.tsx +0 -249
- package/src/dataUtils/alphaNumericEmojiIndex.ts +0 -21
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useIsUnicodeHidden(): (emojiUnified: string) => boolean;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cx } from 'shipstyles';
|
|
3
|
-
|
|
4
|
-
import { ClassNames } from '../../DomUtils/classNames';
|
|
5
|
-
import {
|
|
6
|
-
commonInteractionStyles,
|
|
7
|
-
stylesheet,
|
|
8
|
-
} from '../../Stylesheet/stylesheet';
|
|
9
|
-
import { MOUSE_EVENT_SOURCE } from '../../config/useConfig';
|
|
10
|
-
import { useOnMouseMove } from '../../hooks/useDisallowMouseMove';
|
|
11
|
-
import { useMouseDownHandlers } from '../../hooks/useMouseDownHandlers';
|
|
12
|
-
import { useOnScroll } from '../../hooks/useOnScroll';
|
|
13
|
-
import { useBodyRef } from '../context/ElementRefContext';
|
|
14
|
-
|
|
15
|
-
import { EmojiList } from './EmojiList';
|
|
16
|
-
import { EmojiVariationPicker } from './EmojiVariationPicker';
|
|
17
|
-
|
|
18
|
-
export function Body() {
|
|
19
|
-
const BodyRef = useBodyRef();
|
|
20
|
-
const scrollTop = useOnScroll(BodyRef);
|
|
21
|
-
useMouseDownHandlers(BodyRef, MOUSE_EVENT_SOURCE.PICKER);
|
|
22
|
-
useOnMouseMove();
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
className={cx(styles.body, commonInteractionStyles.hiddenOnReactions)}
|
|
27
|
-
ref={BodyRef}
|
|
28
|
-
>
|
|
29
|
-
<EmojiVariationPicker />
|
|
30
|
-
<EmojiList scrollTop={scrollTop} />
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const styles = stylesheet.create({
|
|
36
|
-
body: {
|
|
37
|
-
'.': ClassNames.scrollBody,
|
|
38
|
-
flex: '1',
|
|
39
|
-
overflowY: 'scroll',
|
|
40
|
-
overflowX: 'hidden',
|
|
41
|
-
position: 'relative',
|
|
42
|
-
},
|
|
43
|
-
});
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cx } from 'shipstyles';
|
|
3
|
-
|
|
4
|
-
import { ClassNames } from '../../DomUtils/classNames';
|
|
5
|
-
import { stylesheet } from '../../Stylesheet/stylesheet';
|
|
6
|
-
import {
|
|
7
|
-
useClassNameConfig,
|
|
8
|
-
useStyleConfig,
|
|
9
|
-
useThemeConfig,
|
|
10
|
-
} from '../../config/useConfig';
|
|
11
|
-
import useIsSearchMode from '../../hooks/useIsSearchMode';
|
|
12
|
-
import { useKeyboardNavigation } from '../../hooks/useKeyboardNavigation';
|
|
13
|
-
import { useOnFocus } from '../../hooks/useOnFocus';
|
|
14
|
-
import { Theme } from '../../types/exposedTypes';
|
|
15
|
-
import { usePickerMainRef } from '../context/ElementRefContext';
|
|
16
|
-
import {
|
|
17
|
-
PickerContextProvider,
|
|
18
|
-
useReactionsModeState,
|
|
19
|
-
} from '../context/PickerContext';
|
|
20
|
-
|
|
21
|
-
type Props = Readonly<{
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
}>;
|
|
24
|
-
|
|
25
|
-
export const DEFAULT_LABEL_HEIGHT = 40;
|
|
26
|
-
|
|
27
|
-
export default function PickerMain({ children }: Props) {
|
|
28
|
-
return (
|
|
29
|
-
<PickerContextProvider>
|
|
30
|
-
<PickerRootElement>{children}</PickerRootElement>
|
|
31
|
-
</PickerContextProvider>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type RootProps = Readonly<{
|
|
36
|
-
className?: string;
|
|
37
|
-
style?: React.CSSProperties;
|
|
38
|
-
children: React.ReactNode;
|
|
39
|
-
}>;
|
|
40
|
-
|
|
41
|
-
function PickerRootElement({ children }: RootProps) {
|
|
42
|
-
const [reactionsMode] = useReactionsModeState();
|
|
43
|
-
const theme = useThemeConfig();
|
|
44
|
-
const searchModeActive = useIsSearchMode();
|
|
45
|
-
const PickerMainRef = usePickerMainRef();
|
|
46
|
-
const className = useClassNameConfig();
|
|
47
|
-
const style = useStyleConfig();
|
|
48
|
-
|
|
49
|
-
useKeyboardNavigation();
|
|
50
|
-
useOnFocus();
|
|
51
|
-
|
|
52
|
-
const { width, height, ...styleProps } = style || {};
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<aside
|
|
56
|
-
className={cx(
|
|
57
|
-
styles.main,
|
|
58
|
-
styles.baseVariables,
|
|
59
|
-
theme === Theme.DARK && styles.darkTheme,
|
|
60
|
-
theme === Theme.AUTO && styles.autoThemeDark,
|
|
61
|
-
{
|
|
62
|
-
[ClassNames.searchActive]: searchModeActive,
|
|
63
|
-
},
|
|
64
|
-
reactionsMode && styles.reactionsMenu,
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
ref={PickerMainRef}
|
|
68
|
-
style={{
|
|
69
|
-
...styleProps,
|
|
70
|
-
...(!reactionsMode && { height, width }),
|
|
71
|
-
}}
|
|
72
|
-
>
|
|
73
|
-
{children}
|
|
74
|
-
</aside>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const DarkTheme = {
|
|
79
|
-
'--epr-emoji-variation-picker-bg-color':
|
|
80
|
-
'var(--epr-dark-emoji-variation-picker-bg-color)',
|
|
81
|
-
'--epr-hover-bg-color-reduced-opacity':
|
|
82
|
-
'var(--epr-dark-hover-bg-color-reduced-opacity)',
|
|
83
|
-
'--epr-highlight-color': 'var(--epr-dark-highlight-color)',
|
|
84
|
-
'--epr-text-color': 'var(--epr-dark-text-color)',
|
|
85
|
-
'--epr-hover-bg-color': 'var(--epr-dark-hover-bg-color)',
|
|
86
|
-
'--epr-focus-bg-color': 'var(--epr-dark-focus-bg-color)',
|
|
87
|
-
'--epr-search-input-bg-color': 'var(--epr-dark-search-input-bg-color)',
|
|
88
|
-
'--epr-category-label-bg-color': 'var(--epr-dark-category-label-bg-color)',
|
|
89
|
-
'--epr-picker-border-color': 'var(--epr-dark-picker-border-color)',
|
|
90
|
-
'--epr-bg-color': 'var(--epr-dark-bg-color)',
|
|
91
|
-
'--epr-reactions-bg-color': 'var(--epr-dark-reactions-bg-color)',
|
|
92
|
-
'--epr-search-input-bg-color-active':
|
|
93
|
-
'var(--epr-dark-search-input-bg-color-active)',
|
|
94
|
-
'--epr-emoji-variation-indicator-color':
|
|
95
|
-
'var(--epr-dark-emoji-variation-indicator-color)',
|
|
96
|
-
'--epr-category-icon-active-color':
|
|
97
|
-
'var(--epr-dark-category-icon-active-color)',
|
|
98
|
-
'--epr-category-icon-inactive-color':
|
|
99
|
-
'var(--epr-dark-category-icon-inactive-color)',
|
|
100
|
-
'--epr-skin-tone-picker-menu-color':
|
|
101
|
-
'var(--epr-dark-skin-tone-picker-menu-color)',
|
|
102
|
-
'--epr-skin-tone-outer-border-color':
|
|
103
|
-
'var(--epr-dark-skin-tone-outer-border-color)',
|
|
104
|
-
'--epr-skin-tone-inner-border-color':
|
|
105
|
-
'var(--epr-dark-skin-tone-inner-border-color)',
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const styles = stylesheet.create({
|
|
109
|
-
main: {
|
|
110
|
-
'.': ['epr-main', ClassNames.emojiPicker],
|
|
111
|
-
position: 'relative',
|
|
112
|
-
display: 'flex',
|
|
113
|
-
flexDirection: 'column',
|
|
114
|
-
borderWidth: '1px',
|
|
115
|
-
borderStyle: 'solid',
|
|
116
|
-
borderRadius: 'var(--epr-picker-border-radius)',
|
|
117
|
-
borderColor: 'var(--epr-picker-border-color)',
|
|
118
|
-
backgroundColor: 'var(--epr-bg-color)',
|
|
119
|
-
overflow: 'hidden',
|
|
120
|
-
transition: 'height 0.3s ease-in-out, background-color 0.1s ease-in-out',
|
|
121
|
-
'*': {
|
|
122
|
-
boxSizing: 'border-box',
|
|
123
|
-
fontFamily: 'sans-serif',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
baseVariables: {
|
|
127
|
-
'--': {
|
|
128
|
-
'--epr-highlight-color': '#007aeb',
|
|
129
|
-
'--epr-hover-bg-color': '#e5f0fa',
|
|
130
|
-
'--epr-hover-bg-color-reduced-opacity': '#e5f0fa80',
|
|
131
|
-
'--epr-focus-bg-color': '#e0f0ff',
|
|
132
|
-
'--epr-text-color': '#858585',
|
|
133
|
-
'--epr-search-input-bg-color': '#f6f6f6',
|
|
134
|
-
'--epr-picker-border-color': '#e7e7e7',
|
|
135
|
-
'--epr-bg-color': '#fff',
|
|
136
|
-
'--epr-reactions-bg-color': '#ffffff90',
|
|
137
|
-
'--epr-category-icon-active-color': '#3371B7',
|
|
138
|
-
'--epr-category-icon-inactive-color': '#868686',
|
|
139
|
-
'--epr-skin-tone-picker-menu-color': '#ffffff95',
|
|
140
|
-
'--epr-skin-tone-outer-border-color': '#555555',
|
|
141
|
-
'--epr-skin-tone-inner-border-color': 'var(--epr-bg-color)',
|
|
142
|
-
|
|
143
|
-
'--epr-horizontal-padding': '10px',
|
|
144
|
-
|
|
145
|
-
'--epr-picker-border-radius': '8px',
|
|
146
|
-
|
|
147
|
-
/* Header */
|
|
148
|
-
'--epr-header-padding': '15px var(--epr-horizontal-padding)',
|
|
149
|
-
|
|
150
|
-
/* Skin Tone Picker */
|
|
151
|
-
'--epr-active-skin-tone-indicator-border-color':
|
|
152
|
-
'var(--epr-highlight-color)',
|
|
153
|
-
'--epr-active-skin-hover-color': 'var(--epr-hover-bg-color)',
|
|
154
|
-
|
|
155
|
-
/* Search */
|
|
156
|
-
'--epr-search-input-bg-color-active': 'var(--epr-search-input-bg-color)',
|
|
157
|
-
'--epr-search-input-padding': '0 30px',
|
|
158
|
-
'--epr-search-input-border-radius': '8px',
|
|
159
|
-
'--epr-search-input-height': '40px',
|
|
160
|
-
'--epr-search-input-text-color': 'var(--epr-text-color)',
|
|
161
|
-
'--epr-search-input-placeholder-color': 'var(--epr-text-color)',
|
|
162
|
-
'--epr-search-bar-inner-padding': 'var(--epr-horizontal-padding)',
|
|
163
|
-
'--epr-search-border-color': 'var(--epr-search-input-bg-color)',
|
|
164
|
-
'--epr-search-border-color-active': 'var(--epr-highlight-color)',
|
|
165
|
-
|
|
166
|
-
/* Category Navigation */
|
|
167
|
-
'--epr-category-navigation-button-size': '30px',
|
|
168
|
-
|
|
169
|
-
/* Variation Picker */
|
|
170
|
-
'--epr-emoji-variation-picker-height': '45px',
|
|
171
|
-
'--epr-emoji-variation-picker-bg-color': 'var(--epr-bg-color)',
|
|
172
|
-
|
|
173
|
-
/* Preview */
|
|
174
|
-
'--epr-preview-height': '70px',
|
|
175
|
-
'--epr-preview-text-size': '14px',
|
|
176
|
-
'--epr-preview-text-padding': '0 var(--epr-horizontal-padding)',
|
|
177
|
-
'--epr-preview-border-color': 'var(--epr-picker-border-color)',
|
|
178
|
-
'--epr-preview-text-color': 'var(--epr-text-color)',
|
|
179
|
-
|
|
180
|
-
/* Category */
|
|
181
|
-
'--epr-category-padding': '0 var(--epr-horizontal-padding)',
|
|
182
|
-
|
|
183
|
-
/* Category Label */
|
|
184
|
-
'--epr-category-label-bg-color': '#ffffffe6',
|
|
185
|
-
'--epr-category-label-text-color': 'var(--epr-text-color)',
|
|
186
|
-
'--epr-category-label-padding': '0 var(--epr-horizontal-padding)',
|
|
187
|
-
'--epr-category-label-height': `${DEFAULT_LABEL_HEIGHT}px`,
|
|
188
|
-
|
|
189
|
-
/* Emoji */
|
|
190
|
-
'--epr-emoji-size': '30px',
|
|
191
|
-
'--epr-emoji-padding': '5px',
|
|
192
|
-
'--epr-emoji-fullsize':
|
|
193
|
-
'calc(var(--epr-emoji-size) + var(--epr-emoji-padding) * 2)',
|
|
194
|
-
'--epr-emoji-hover-color': 'var(--epr-hover-bg-color)',
|
|
195
|
-
'--epr-emoji-variation-indicator-color': 'var(--epr-picker-border-color)',
|
|
196
|
-
'--epr-emoji-variation-indicator-color-hover': 'var(--epr-text-color)',
|
|
197
|
-
|
|
198
|
-
/* Z-Index */
|
|
199
|
-
'--epr-header-overlay-z-index': '3',
|
|
200
|
-
'--epr-emoji-variations-indictator-z-index': '1',
|
|
201
|
-
'--epr-category-label-z-index': '2',
|
|
202
|
-
'--epr-skin-variation-picker-z-index': '5',
|
|
203
|
-
'--epr-preview-z-index': '6',
|
|
204
|
-
|
|
205
|
-
/* Dark Theme Variables */
|
|
206
|
-
'--epr-dark': '#000',
|
|
207
|
-
'--epr-dark-emoji-variation-picker-bg-color': 'var(--epr-dark)',
|
|
208
|
-
'--epr-dark-highlight-color': '#c0c0c0',
|
|
209
|
-
'--epr-dark-text-color': 'var(--epr-highlight-color)',
|
|
210
|
-
'--epr-dark-hover-bg-color': '#363636f6',
|
|
211
|
-
'--epr-dark-hover-bg-color-reduced-opacity': '#36363680',
|
|
212
|
-
'--epr-dark-focus-bg-color': '#474747',
|
|
213
|
-
'--epr-dark-search-input-bg-color': '#333333',
|
|
214
|
-
'--epr-dark-category-label-bg-color': '#222222e6',
|
|
215
|
-
'--epr-dark-picker-border-color': '#151617',
|
|
216
|
-
'--epr-dark-bg-color': '#222222',
|
|
217
|
-
'--epr-dark-reactions-bg-color': '#22222290',
|
|
218
|
-
'--epr-dark-search-input-bg-color-active': 'var(--epr-dark)',
|
|
219
|
-
'--epr-dark-emoji-variation-indicator-color': '#444',
|
|
220
|
-
'--epr-dark-category-icon-active-color': '#6AA9DD',
|
|
221
|
-
'--epr-dark-category-icon-inactive-color': '#C0C0BF',
|
|
222
|
-
'--epr-dark-skin-tone-picker-menu-color': '#22222295',
|
|
223
|
-
'--epr-dark-skin-tone-outer-border-color':
|
|
224
|
-
'var(--epr-dark-picker-border-color)',
|
|
225
|
-
'--epr-dark-skin-tone-inner-border-color': '#00000000',
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
autoThemeDark: {
|
|
229
|
-
'.': ClassNames.autoTheme,
|
|
230
|
-
'@media (prefers-color-scheme: dark)': {
|
|
231
|
-
'--': DarkTheme,
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
darkTheme: {
|
|
235
|
-
'.': ClassNames.darkTheme,
|
|
236
|
-
'--': DarkTheme,
|
|
237
|
-
},
|
|
238
|
-
reactionsMenu: {
|
|
239
|
-
'.': 'epr-reactions',
|
|
240
|
-
height: '50px',
|
|
241
|
-
display: 'inline-flex',
|
|
242
|
-
backgroundColor: 'var(--epr-reactions-bg-color)',
|
|
243
|
-
// @ts-ignore - backdropFilter is not recognized.
|
|
244
|
-
backdropFilter: 'blur(8px)',
|
|
245
|
-
'--': {
|
|
246
|
-
'--epr-picker-border-radius': '50px',
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DataEmoji } from './DataTypes';
|
|
2
|
-
import { emojiNames, emojiUnified } from './emojiUtils';
|
|
3
|
-
|
|
4
|
-
export const alphaNumericEmojiIndex: BaseIndex = {};
|
|
5
|
-
|
|
6
|
-
type BaseIndex = Record<string, Record<string, DataEmoji>>;
|
|
7
|
-
|
|
8
|
-
export function indexEmoji(emoji: DataEmoji): void {
|
|
9
|
-
const joinedNameString = emojiNames(emoji)
|
|
10
|
-
.flat()
|
|
11
|
-
.join('')
|
|
12
|
-
.toLowerCase()
|
|
13
|
-
.replace(/[^a-zA-Z\d]/g, '')
|
|
14
|
-
.split('');
|
|
15
|
-
|
|
16
|
-
joinedNameString.forEach((char) => {
|
|
17
|
-
alphaNumericEmojiIndex[char] = alphaNumericEmojiIndex[char] ?? {};
|
|
18
|
-
|
|
19
|
-
alphaNumericEmojiIndex[char][emojiUnified(emoji)] = emoji;
|
|
20
|
-
});
|
|
21
|
-
}
|