emoji-picker-react 4.22.2 → 5.0.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.
- package/README.md +335 -49
- package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
- package/dist/DomUtils/classNames.d.ts +24 -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 +7 -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-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-46BUDQLE.mjs +228 -0
- package/dist/esm/chunks/chunk-7ZGTUZFB.mjs +16 -0
- package/dist/esm/chunks/chunk-FQIJ4HBW.mjs +25 -0
- package/dist/esm/chunks/chunk-KQPOIRSC.mjs +9305 -0
- package/dist/esm/chunks/chunk-LO4TPPLH.mjs +43 -0
- package/dist/esm/chunks/emojis-6L3GRBAP.mjs +9 -0
- package/dist/esm/data.mjs +18 -0
- package/dist/esm/index.mjs +389 -0
- package/dist/esm/primitives/index.mjs +67 -0
- package/dist/hooks/preloadEmoji.d.ts +9 -9
- package/dist/hooks/useActiveCategoryScrollDetection.d.ts +11 -11
- package/dist/hooks/useCategoryHeight.d.ts +6 -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 +21 -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 +20 -18
- package/llms-full.txt +3680 -0
- package/llms.txt +66 -476
- package/package.json +204 -66
- package/src/DomUtils/categoryNameFromDom.ts +1 -1
- package/src/DomUtils/classNames.ts +1 -0
- package/src/DomUtils/elementPositionInRow.ts +26 -4
- 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 +105 -149
- package/src/DomUtils/scrollTo.ts +18 -16
- package/src/DomUtils/selectors.ts +20 -111
- 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 +55 -23
- 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 +110 -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 +77 -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 +188 -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-core/pickerData.ts +173 -0
- package/src/data-core/prepare.ts +178 -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 +58 -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/suggested.ts +8 -4
- package/src/dataUtils/suggestedEmojis.ts +92 -0
- package/src/env.d.ts +4 -0
- package/src/hooks/preloadEmoji.ts +3 -3
- package/src/hooks/useActiveCategoryScrollDetection.ts +10 -1
- package/src/hooks/useCategoryHeight.ts +82 -8
- package/src/hooks/useDataIdentityStabilityWarning.ts +86 -0
- package/src/hooks/useDebouncedState.ts +13 -1
- package/src/hooks/useDisallowedEmojis.ts +26 -42
- package/src/hooks/useEmojiPreviewEvents.ts +43 -10
- package/src/hooks/useEmojiVirtualization.tsx +38 -4
- package/src/hooks/useFilter.ts +85 -127
- package/src/hooks/useFocus.ts +14 -24
- package/src/hooks/useIsEmojiHidden.ts +10 -6
- package/src/hooks/useKeyboardNavigation.ts +322 -429
- 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 +133 -0
- package/src/primitives/tokens.ts +149 -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 +20 -6
- 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
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// Imperative Root-scoped navigation registry.
|
|
2
|
+
//
|
|
3
|
+
// Cross-region keyboard navigation traverses registered semantic regions
|
|
4
|
+
// rather than hard-coded DOM siblings. This module owns registration
|
|
5
|
+
// bookkeeping plus the navigation generation token: every pending
|
|
6
|
+
// materialize/scroll/focus operation captures the generation and aborts when
|
|
7
|
+
// it changes. One instance lives in the Root services slice, so multiple
|
|
8
|
+
// Roots are isolated by construction.
|
|
9
|
+
//
|
|
10
|
+
// Framework-free on purpose: no React import, fully unit-testable, and the
|
|
11
|
+
// `/data` entry never touches it. Runtime code here stays within the
|
|
12
|
+
// React 16.8 API floor (see npm run check:react-floor).
|
|
13
|
+
|
|
14
|
+
/** Semantic focus regions. The managed panel and Viewport are structural containers, not regions. */
|
|
15
|
+
export type NavigationRegionKind =
|
|
16
|
+
| 'search'
|
|
17
|
+
| 'categories'
|
|
18
|
+
| 'grid'
|
|
19
|
+
| 'preview-skin-tone'
|
|
20
|
+
| 'reactions';
|
|
21
|
+
|
|
22
|
+
export interface RegisteredRegion {
|
|
23
|
+
readonly id: number;
|
|
24
|
+
readonly kind: NavigationRegionKind;
|
|
25
|
+
readonly element: Element;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class NavigationRegistry {
|
|
29
|
+
private nextId = 1;
|
|
30
|
+
private regions: RegisteredRegion[] = [];
|
|
31
|
+
private singletons = new Set<string>();
|
|
32
|
+
private generation = 0;
|
|
33
|
+
private disposed = false;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Register a region root. Returns an unregister function for unmount.
|
|
37
|
+
* Duplicate singleton validation lives in the primitive layer;
|
|
38
|
+
* the registry keeps every registration so that layer can adjudicate.
|
|
39
|
+
*/
|
|
40
|
+
register(kind: NavigationRegionKind, element: Element): () => void {
|
|
41
|
+
const entry: RegisteredRegion = {
|
|
42
|
+
id: this.nextId,
|
|
43
|
+
kind,
|
|
44
|
+
element,
|
|
45
|
+
};
|
|
46
|
+
this.nextId += 1;
|
|
47
|
+
this.regions.push(entry);
|
|
48
|
+
let removed = false;
|
|
49
|
+
return () => {
|
|
50
|
+
if (removed) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
removed = true;
|
|
54
|
+
this.regions = this.regions.filter((region) => region !== entry);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Registrations in mount order; traversal follows DOM document order instead. */
|
|
59
|
+
getRegions(): readonly RegisteredRegion[] {
|
|
60
|
+
return [...this.regions];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
getRegionsByKind(kind: NavigationRegionKind): readonly RegisteredRegion[] {
|
|
64
|
+
return this.regions.filter((region) => region.kind === kind);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* First registration wins. Later
|
|
69
|
+
* duplicates are ignored by picker behavior.
|
|
70
|
+
*/
|
|
71
|
+
getAuthoritativeRegion(
|
|
72
|
+
kind: NavigationRegionKind,
|
|
73
|
+
): RegisteredRegion | undefined {
|
|
74
|
+
return this.regions.find((region) => region.kind === kind);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Current navigation generation. Pending async focus work captures this value. */
|
|
78
|
+
currentGeneration(): number {
|
|
79
|
+
return this.generation;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Invalidate pending materialize/scroll/focus work. Called on accepted
|
|
84
|
+
* search change, data/category change, geometry change, reactions
|
|
85
|
+
* transition and Root unmount. Completions holding a stale token MUST NOT
|
|
86
|
+
* move focus or scroll.
|
|
87
|
+
*/
|
|
88
|
+
invalidate(): void {
|
|
89
|
+
this.generation += 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
isCurrent(token: number): boolean {
|
|
93
|
+
return !this.disposed && token === this.generation;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Revive a disposed registry when its Root remounts. The registry object
|
|
98
|
+
* persists across remounts (held in a ref), but the unmount cleanup
|
|
99
|
+
* disposes it — without a revive, every generation-guarded focus stays
|
|
100
|
+
* dead after any remount (StrictMode double-mount included). Bumps the
|
|
101
|
+
* generation so pre-unmount completions cannot fire post-remount.
|
|
102
|
+
*/
|
|
103
|
+
revive(): void {
|
|
104
|
+
this.disposed = false;
|
|
105
|
+
this.generation += 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
dispose(): void {
|
|
109
|
+
this.disposed = true;
|
|
110
|
+
this.regions = [];
|
|
111
|
+
this.singletons.clear();
|
|
112
|
+
this.generation += 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Claim a singleton primitive slot.
|
|
117
|
+
* Returns true for the first claimant; later claimants are ignored by
|
|
118
|
+
* picker behavior (dev throws, production warns once via
|
|
119
|
+
* reportDuplicateRegion).
|
|
120
|
+
*/
|
|
121
|
+
claimSingleton(kind: string): boolean {
|
|
122
|
+
if (this.singletons.has(kind)) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
this.singletons.add(kind);
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
releaseSingleton(kind: string): void {
|
|
130
|
+
this.singletons.delete(kind);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Duplicate singleton policy.
|
|
135
|
+
//
|
|
136
|
+
// Duplicate compositions are unsupported in every environment; production
|
|
137
|
+
// merely avoids turning a configuration mistake into a hard crash. Pure
|
|
138
|
+
// function of the environment so tests can cover both branches.
|
|
139
|
+
|
|
140
|
+
/* global process: readonly */
|
|
141
|
+
|
|
142
|
+
export type DuplicateRegionPolicy = 'throw' | 'warn-once';
|
|
143
|
+
|
|
144
|
+
export function duplicateRegionPolicy(): DuplicateRegionPolicy {
|
|
145
|
+
return process.env.NODE_ENV === 'production' ? 'warn-once' : 'throw';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const warnedDuplicates = new Set<string>();
|
|
149
|
+
|
|
150
|
+
export function reportDuplicateRegion(kind: string): void {
|
|
151
|
+
// Test NODE_ENV inline (not through duplicateRegionPolicy) so production
|
|
152
|
+
// bundles drop this branch and its component-name table.
|
|
153
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
154
|
+
throw new Error(
|
|
155
|
+
`[emoji-picker-react] Duplicate <${regionComponentName(kind)}> region: ` +
|
|
156
|
+
`only one ${kind} region is supported per Root. ` +
|
|
157
|
+
`See docs/v5/PRIMITIVES.md composition grammar.`,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
if (!warnedDuplicates.has(kind)) {
|
|
161
|
+
warnedDuplicates.add(kind);
|
|
162
|
+
// eslint-disable-next-line no-console
|
|
163
|
+
console.warn(`[emoji-picker-react] Duplicate ${kind} region ignored.`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const warnedPortals = new Set<string>();
|
|
168
|
+
|
|
169
|
+
export function reportPortalRegion(kind: NavigationRegionKind): void {
|
|
170
|
+
if (process.env.NODE_ENV === 'production') {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (!warnedPortals.has(kind)) {
|
|
174
|
+
warnedPortals.add(kind);
|
|
175
|
+
// eslint-disable-next-line no-console
|
|
176
|
+
console.warn(
|
|
177
|
+
`[emoji-picker-react] ${kind} region is mounted outside the Root DOM ` +
|
|
178
|
+
`element (portal). Portal regions are unsupported and excluded ` +
|
|
179
|
+
`from arrow-key traversal.`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function regionComponentName(kind: string): string {
|
|
185
|
+
switch (kind) {
|
|
186
|
+
case 'search':
|
|
187
|
+
return 'Search';
|
|
188
|
+
case 'categories':
|
|
189
|
+
return 'CategoryNav';
|
|
190
|
+
case 'grid':
|
|
191
|
+
return 'List';
|
|
192
|
+
case 'preview-skin-tone':
|
|
193
|
+
return 'SkinTone';
|
|
194
|
+
case 'reactions':
|
|
195
|
+
return 'Reactions';
|
|
196
|
+
case 'viewport':
|
|
197
|
+
return 'Viewport';
|
|
198
|
+
case 'preview':
|
|
199
|
+
return 'Preview';
|
|
200
|
+
default:
|
|
201
|
+
return kind;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Test-only: reset warn-once sets between cases. */
|
|
206
|
+
export function __resetNavigationWarningsForTest(): void {
|
|
207
|
+
warnedDuplicates.clear();
|
|
208
|
+
warnedPortals.clear();
|
|
209
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// DOM-document-order region traversal.
|
|
2
|
+
//
|
|
3
|
+
// Generic previous/next-region movement uses DOM document order of the
|
|
4
|
+
// currently active/focusable registered region roots — never registration
|
|
5
|
+
// order, render timing, or insertion order. Consumer nodes that are not
|
|
6
|
+
// registered regions are skipped by the arrow graph but stay in Tab order.
|
|
7
|
+
// Framework-free: no React import.
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
NavigationRegionKind,
|
|
11
|
+
NavigationRegistry,
|
|
12
|
+
RegisteredRegion,
|
|
13
|
+
} from './navigationRegistry';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Whether a registered root is currently a valid focus destination.
|
|
17
|
+
* Hidden, inert, disabled, aria-hidden, or disconnected regions are
|
|
18
|
+
* filtered out before traversal. In compact reactions mode the managed
|
|
19
|
+
* panel carries hidden/inert state, so its regions drop out of the active
|
|
20
|
+
* list while staying registered.
|
|
21
|
+
*/
|
|
22
|
+
export function isRegionFocusable(element: Element): boolean {
|
|
23
|
+
if (!element.isConnected) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const htmlElement = element as HTMLElement;
|
|
27
|
+
if (htmlElement.hidden) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (
|
|
31
|
+
element.hasAttribute('hidden') ||
|
|
32
|
+
element.hasAttribute('inert') ||
|
|
33
|
+
(htmlElement as HTMLButtonElement).disabled
|
|
34
|
+
) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (element.getAttribute('aria-hidden') === 'true') {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (element.closest('[hidden],[inert]')) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Active regions in DOM document order. Portal roots (outside the Root
|
|
48
|
+
* element) are unsupported and excluded. Only the authoritative (first)
|
|
49
|
+
* registration per singleton kind participates.
|
|
50
|
+
*/
|
|
51
|
+
export function getActiveRegionsInDomOrder(
|
|
52
|
+
registry: NavigationRegistry,
|
|
53
|
+
rootElement: Element | null,
|
|
54
|
+
): RegisteredRegion[] {
|
|
55
|
+
const seenKinds = new Set<NavigationRegionKind>();
|
|
56
|
+
const active = registry.getRegions().filter((region) => {
|
|
57
|
+
if (seenKinds.has(region.kind)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
seenKinds.add(region.kind);
|
|
61
|
+
if (rootElement && !rootElement.contains(region.element)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return isRegionFocusable(region.element);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
active.sort((a, b) => {
|
|
68
|
+
const position = a.element.compareDocumentPosition(b.element);
|
|
69
|
+
|
|
70
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING) {
|
|
71
|
+
return -1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return active;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function findRegion(
|
|
84
|
+
regions: readonly RegisteredRegion[],
|
|
85
|
+
kind: NavigationRegionKind,
|
|
86
|
+
): RegisteredRegion | undefined {
|
|
87
|
+
return regions.find((region) => region.kind === kind);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Next focusable region after `from` in DOM order, if any. */
|
|
91
|
+
export function getNextRegion(
|
|
92
|
+
registry: NavigationRegistry,
|
|
93
|
+
rootElement: Element | null,
|
|
94
|
+
from: NavigationRegionKind,
|
|
95
|
+
): RegisteredRegion | undefined {
|
|
96
|
+
const active = getActiveRegionsInDomOrder(registry, rootElement);
|
|
97
|
+
const index = active.findIndex((region) => region.kind === from);
|
|
98
|
+
if (index === -1) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
return active[index + 1];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Previous focusable region before `from` in DOM order, if any. */
|
|
105
|
+
export function getPrevRegion(
|
|
106
|
+
registry: NavigationRegistry,
|
|
107
|
+
rootElement: Element | null,
|
|
108
|
+
from: NavigationRegionKind,
|
|
109
|
+
): RegisteredRegion | undefined {
|
|
110
|
+
const active = getActiveRegionsInDomOrder(registry, rootElement);
|
|
111
|
+
const index = active.findIndex((region) => region.kind === from);
|
|
112
|
+
if (index <= 0) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
return active[index - 1];
|
|
116
|
+
}
|
package/src/svg.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type EmojiClickData = {
|
|
|
7
7
|
emoji: string;
|
|
8
8
|
names: string[];
|
|
9
9
|
imageUrl: string;
|
|
10
|
-
getImageUrl: (emojiStyle?:
|
|
10
|
+
getImageUrl: (emojiStyle?: EmojiStyleValue) => string;
|
|
11
11
|
isCustom: boolean;
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -42,6 +42,8 @@ export enum SuggestionMode {
|
|
|
42
42
|
FREQUENT = 'frequent',
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export type SuggestionModeValue = SuggestionMode | 'recent' | 'frequent';
|
|
46
|
+
|
|
45
47
|
export enum EmojiStyle {
|
|
46
48
|
NATIVE = 'native',
|
|
47
49
|
APPLE = 'apple',
|
|
@@ -50,12 +52,22 @@ export enum EmojiStyle {
|
|
|
50
52
|
FACEBOOK = 'facebook',
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
export type EmojiStyleValue =
|
|
56
|
+
| EmojiStyle
|
|
57
|
+
| 'native'
|
|
58
|
+
| 'apple'
|
|
59
|
+
| 'twitter'
|
|
60
|
+
| 'google'
|
|
61
|
+
| 'facebook';
|
|
62
|
+
|
|
53
63
|
export enum Theme {
|
|
54
64
|
DARK = 'dark',
|
|
55
65
|
LIGHT = 'light',
|
|
56
66
|
AUTO = 'auto',
|
|
57
67
|
}
|
|
58
68
|
|
|
69
|
+
export type ThemeValue = Theme | 'dark' | 'light' | 'auto';
|
|
70
|
+
|
|
59
71
|
export enum SkinTones {
|
|
60
72
|
NEUTRAL = 'neutral',
|
|
61
73
|
LIGHT = '1f3fb',
|
|
@@ -65,6 +77,16 @@ export enum SkinTones {
|
|
|
65
77
|
DARK = '1f3ff',
|
|
66
78
|
}
|
|
67
79
|
|
|
80
|
+
/** A skin tone as the enum or its literal value (`'neutral'`, `'1f3fb'`, …). */
|
|
81
|
+
export type SkinTonesValue =
|
|
82
|
+
| SkinTones
|
|
83
|
+
| 'neutral'
|
|
84
|
+
| '1f3fb'
|
|
85
|
+
| '1f3fc'
|
|
86
|
+
| '1f3fd'
|
|
87
|
+
| '1f3fe'
|
|
88
|
+
| '1f3ff';
|
|
89
|
+
|
|
68
90
|
export enum Categories {
|
|
69
91
|
SUGGESTED = 'suggested',
|
|
70
92
|
CUSTOM = 'custom',
|
|
@@ -81,4 +103,9 @@ export enum Categories {
|
|
|
81
103
|
export enum SkinTonePickerLocation {
|
|
82
104
|
SEARCH = 'SEARCH',
|
|
83
105
|
PREVIEW = 'PREVIEW',
|
|
106
|
+
/**
|
|
107
|
+
* No built-in placement: render the `SkinTone` primitive wherever you
|
|
108
|
+
* want it, or drive the tone through `skinTone` / `useSkinTone()`.
|
|
109
|
+
*/
|
|
110
|
+
NONE = 'NONE',
|
|
84
111
|
}
|
|
@@ -25,13 +25,25 @@ export function shouldVirtualize({
|
|
|
25
25
|
return !isVisible;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Columns spread across the row like the category grid's own
|
|
29
|
+
// `justify-content: space-between`: first column flush with the inline
|
|
30
|
+
// start, last flush with the inline end, leftover width shared evenly
|
|
31
|
+
// between columns. Packing from the start instead pushed the whole
|
|
32
|
+
// remainder (up to one emoji wide) into a gap at the end. Whole pixels
|
|
33
|
+
// keep image emojis crisp. The logical inset mirrors the grid under
|
|
34
|
+
// `dir="rtl"`, as v4's CSS grid did.
|
|
28
35
|
export function getEmojiPositionStyle(dimensions: Dimensions, index: number) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
if (!dimensions) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const { emojiSize, emojisPerRow, rowWidth } = dimensions;
|
|
40
|
+
const column = index % emojisPerRow;
|
|
41
|
+
const remainder = Math.max(0, (rowWidth ?? 0) - emojisPerRow * emojiSize);
|
|
42
|
+
const gap = emojisPerRow > 1 ? remainder / (emojisPerRow - 1) : 0;
|
|
43
|
+
return {
|
|
44
|
+
top: Math.floor(index / emojisPerRow) * emojiSize,
|
|
45
|
+
insetInlineStart: Math.round(column * (emojiSize + gap)),
|
|
46
|
+
};
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
// preload emoji if it is one row below viewport
|
|
@@ -41,5 +53,7 @@ export type Dimensions =
|
|
|
41
53
|
emojiSize: number;
|
|
42
54
|
emojisPerRow: number;
|
|
43
55
|
categoryHeight: number;
|
|
56
|
+
/** Usable row width the columns are distributed across. */
|
|
57
|
+
rowWidth?: number;
|
|
44
58
|
}
|
|
45
59
|
| undefined;
|