emoji-picker-react 5.1.1 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/index.js +1 -1
- package/dist/data-core/prepare.d.ts +6 -0
- package/dist/esm/chunks/{chunk-DDDACPJK.mjs → chunk-FYMRCRY5.mjs} +22 -29
- package/dist/esm/chunks/{chunk-G75AG4FD.mjs → chunk-GZYF2CX5.mjs} +1 -1
- package/dist/esm/chunks/{chunk-6LOWV5AK.mjs → chunk-V7DBC3DD.mjs} +10 -3
- package/dist/esm/data.mjs +2 -2
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/primitives/index.mjs +2 -2
- package/dist/index.js +1 -1
- package/dist/primitives/index.js +1 -1
- package/llms-full.txt +3 -0
- package/package.json +1 -1
|
@@ -19,5 +19,11 @@ export declare function __getPrepareCount(): number;
|
|
|
19
19
|
export declare function __resetPrepareCount(): void;
|
|
20
20
|
export declare function __clearCoreCacheForTest(): void;
|
|
21
21
|
export declare function normalizeUnified(input: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Datasets disagree on where U+FE0F (emoji presentation) appears in an ID:
|
|
24
|
+
* `2764` and `2764-fe0f` are the same heart. IDs are also indexed under
|
|
25
|
+
* this form, so either spelling finds the dataset's own record.
|
|
26
|
+
*/
|
|
27
|
+
export declare function withoutFe0f(unified: string): string;
|
|
22
28
|
export declare function normalizeQuery(input: string): string;
|
|
23
29
|
export declare function getPreparedCore(emojiData?: EmojiData): PreparedCore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EMPTY_EMOJI_DATA, defaultEmojiDataOrEmpty, getPreparedCore, getRegisteredDefaultEmojiData, loadDefaultEmojiData, normalizeQuery, parseNativeEmoji, searchEmojis } from "./chunk-
|
|
1
|
+
import { EMPTY_EMOJI_DATA, defaultEmojiDataOrEmpty, getPreparedCore, getRegisteredDefaultEmojiData, loadDefaultEmojiData, normalizeQuery, parseNativeEmoji, searchEmojis, withoutFe0f } from "./chunk-V7DBC3DD.mjs";
|
|
2
2
|
|
|
3
3
|
// src/primitives/Root.tsx
|
|
4
4
|
import * as React29 from "react";
|
|
@@ -1614,7 +1614,7 @@ function getBaseConfigByCategory(category, modifier = {}) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
|
|
1616
1616
|
// src/config/config.ts
|
|
1617
|
-
var KNOWN_FAILING_EMOJIS = [ "2640
|
|
1617
|
+
var KNOWN_FAILING_EMOJIS = [ "2640", "2642", "2695" ], DEFAULT_SEARCH_PLACEHOLDER = "Search", DEFAULT_PICKER_WIDTH = 350, DEFAULT_PICKER_HEIGHT = 450, DEFAULT_SEARCH_CLEAR_BUTTON_LABEL = "Clear", DEFAULT_LABELS = {
|
|
1618
1618
|
searchPlaceholder: DEFAULT_SEARCH_PLACEHOLDER,
|
|
1619
1619
|
searchLabel: "Type to search for an emoji",
|
|
1620
1620
|
searchClear: DEFAULT_SEARCH_CLEAR_BUTTON_LABEL,
|
|
@@ -1664,7 +1664,7 @@ function mergeConfig(rawUserConfig = {}) {
|
|
|
1664
1664
|
suggestionMode: config.suggestedEmojisMode
|
|
1665
1665
|
}, userConfig.emojiData, userConfig.customEmojis);
|
|
1666
1666
|
config.hiddenEmojis.forEach((emoji => {
|
|
1667
|
-
const id = String(emoji).trim().toLowerCase();
|
|
1667
|
+
const id = withoutFe0f(String(emoji).trim().toLowerCase());
|
|
1668
1668
|
id && config.unicodeToHide.add(id);
|
|
1669
1669
|
}));
|
|
1670
1670
|
const skinTonePickerLocation = resolveSkinTonePickerLocation(config.skinTonePickerLocation, config.searchDisabled, previewConfig.showPreview);
|
|
@@ -2330,9 +2330,9 @@ function getPickerDataSnapshot(genericEmojiData, customEmojis) {
|
|
|
2330
2330
|
emojis: nextEmojis
|
|
2331
2331
|
}, customGroups = customLayer.groups, allEmojis = Object.values(nextEmojis).concat(Object.values(customGroups)).flat(), allEmojisByUnified2 = /* @__PURE__ */ Object.create(null);
|
|
2332
2332
|
allEmojis.forEach((emoji => {
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
allEmojisByUnified2[
|
|
2333
|
+
[ emoji.u, ...emoji.v || [] ].forEach((id => {
|
|
2334
|
+
var _a;
|
|
2335
|
+
allEmojisByUnified2[id] = emoji, allEmojisByUnified2[_a = withoutFe0f(id)] || (allEmojisByUnified2[_a] = emoji);
|
|
2336
2336
|
}));
|
|
2337
2337
|
}));
|
|
2338
2338
|
const snapshot = {
|
|
@@ -2383,20 +2383,12 @@ function resolveSuggestedRenderIds(entries, lookup) {
|
|
|
2383
2383
|
}
|
|
2384
2384
|
|
|
2385
2385
|
function resolveEntryId(id, lookup) {
|
|
2386
|
-
if (id)
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
function nativeToUnifiedCandidates(native) {
|
|
2393
|
-
const codePoints = Array.from(native).map((char => char.codePointAt(0).toString(16).padStart(4, "0"))), exact = codePoints.join("-"), bare = codePoints.filter((codePoint => "fe0f" !== codePoint)), withPresentation = [ bare[0], "fe0f", ...bare.slice(1) ];
|
|
2394
|
-
return [ exact, bare.join("-"), withPresentation.join("-") ];
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
function isKnownRenderId(id, lookup) {
|
|
2398
|
-
const record = lookup(id);
|
|
2399
|
-
return !!record && (record.u === id || (record.v ?? []).includes(id));
|
|
2386
|
+
if (!id) return;
|
|
2387
|
+
let unified = id, record = lookup(id);
|
|
2388
|
+
if (!record && /[^\0-\x7f]/.test(id) && (unified = Array.from(id).map((char => char.codePointAt(0).toString(16).padStart(4, "0"))).join("-"),
|
|
2389
|
+
record = lookup(unified)), !record) return;
|
|
2390
|
+
const known = [ record.u, ...record.v ?? [] ];
|
|
2391
|
+
return known.includes(unified) ? unified : known.find((each => withoutFe0f(each) === withoutFe0f(unified)));
|
|
2400
2392
|
}
|
|
2401
2393
|
|
|
2402
2394
|
// src/hooks/useDataIdentityStabilityWarning.ts
|
|
@@ -2453,7 +2445,7 @@ function PickerDataProvider({children}) {
|
|
|
2453
2445
|
const {customEmojis, emojiData: genericEmojiData} = usePickerConfig();
|
|
2454
2446
|
useDataIdentityStabilityWarning(genericEmojiData, customEmojis);
|
|
2455
2447
|
const data = React10.useMemo((() => getPickerDataSnapshot(genericEmojiData, customEmojis)), [ genericEmojiData, customEmojis ]), emojiByUnified2 = React10.useCallback((unified => {
|
|
2456
|
-
if (unified) return data.allEmojisByUnified[unified] ?? data.allEmojisByUnified[unifiedWithoutSkinTone(unified)];
|
|
2448
|
+
if (unified) return data.allEmojisByUnified[unified] ?? data.allEmojisByUnified[withoutFe0f(unified)] ?? data.allEmojisByUnified[unifiedWithoutSkinTone(unified)];
|
|
2457
2449
|
}), [ data.allEmojisByUnified ]), allCustomEmojis = React10.useMemo((() => [ ...data.emojiData.emojis?.custom ?? [], ...Object.values(data.customGroups).flat() ]), [ data.emojiData, data.customGroups ]), queryFilterDict = React10.useCallback((query => {
|
|
2458
2450
|
const normalized = normalizeQuery(query), dict = /* @__PURE__ */ Object.create(null);
|
|
2459
2451
|
if (!normalized) return dict;
|
|
@@ -4812,7 +4804,7 @@ import { useCallback as useCallback10 } from "react";
|
|
|
4812
4804
|
function useIsEmojiDisallowed() {
|
|
4813
4805
|
const configured = parseFloat(useEmojiVersionConfig() || ""), nativeSupport = useNativeEmojiSupport(), cap = Number.isNaN(configured) ? 1 / 0 : configured, unicodeToHide = useUnicodeToHide(), [activeSkinTone] = useActiveSkinToneState();
|
|
4814
4806
|
return useCallback10((function isEmojiDisallowed(emoji, renderedUnified = emojiUnified(emoji, activeSkinTone)) {
|
|
4815
|
-
if (unicodeToHide.has(unifiedWithoutSkinTone(emojiUnified(emoji)))) return !0;
|
|
4807
|
+
if (unicodeToHide.has(withoutFe0f(unifiedWithoutSkinTone(emojiUnified(emoji))))) return !0;
|
|
4816
4808
|
if (isCustomEmoji(emoji)) return !1;
|
|
4817
4809
|
const version = addedIn(emoji);
|
|
4818
4810
|
return version > cap || !isNativeEmojiSupported(nativeSupport, renderedUnified, version);
|
|
@@ -5640,23 +5632,24 @@ var SKIN_TONE_LABEL_KEYS = {
|
|
|
5640
5632
|
":focus": {
|
|
5641
5633
|
boxShadow: "0 0 0 3px var(--epr-focus-bg-color)"
|
|
5642
5634
|
},
|
|
5635
|
+
// Swatch colors are themeable; the fallbacks are the defaults.
|
|
5643
5636
|
"&.epr-tone-neutral": {
|
|
5644
|
-
backgroundColor: "#ffd225"
|
|
5637
|
+
backgroundColor: "var(--epr-skin-tone-neutral-color, #ffd225)"
|
|
5645
5638
|
},
|
|
5646
5639
|
"&.epr-tone-1f3fb": {
|
|
5647
|
-
backgroundColor: "#ffdfbd"
|
|
5640
|
+
backgroundColor: "var(--epr-skin-tone-light-color, #ffdfbd)"
|
|
5648
5641
|
},
|
|
5649
5642
|
"&.epr-tone-1f3fc": {
|
|
5650
|
-
backgroundColor: "#e9c197"
|
|
5643
|
+
backgroundColor: "var(--epr-skin-tone-medium-light-color, #e9c197)"
|
|
5651
5644
|
},
|
|
5652
5645
|
"&.epr-tone-1f3fd": {
|
|
5653
|
-
backgroundColor: "#c88e62"
|
|
5646
|
+
backgroundColor: "var(--epr-skin-tone-medium-color, #c88e62)"
|
|
5654
5647
|
},
|
|
5655
5648
|
"&.epr-tone-1f3fe": {
|
|
5656
|
-
backgroundColor: "#a86637"
|
|
5649
|
+
backgroundColor: "var(--epr-skin-tone-medium-dark-color, #a86637)"
|
|
5657
5650
|
},
|
|
5658
5651
|
"&.epr-tone-1f3ff": {
|
|
5659
|
-
backgroundColor: "#60463a"
|
|
5652
|
+
backgroundColor: "var(--epr-skin-tone-dark-color, #60463a)"
|
|
5660
5653
|
}
|
|
5661
5654
|
}
|
|
5662
5655
|
}))();
|
|
@@ -6525,7 +6518,7 @@ function useEmojiVirtualization({categoryEmojis, topOffset, onHeightReady, scrol
|
|
|
6525
6518
|
})), accumulator;
|
|
6526
6519
|
}), []) : [];
|
|
6527
6520
|
return useEffect26((() => requestNativeProbe(probe2))), useEffect26((() => {
|
|
6528
|
-
preloads.forEach((emoji => preloadEmoji(getEmojiUrl, emoji, emojiStyle,
|
|
6521
|
+
preloads.forEach((emoji => preloadEmoji(getEmojiUrl, emoji, emojiStyle, emojiUnified(emoji, activeSkinTone))));
|
|
6529
6522
|
})), {
|
|
6530
6523
|
virtualizedCounter: emojisToPush.length - emojis.length,
|
|
6531
6524
|
emojis,
|
|
@@ -41,6 +41,10 @@ function normalizeUnified(input) {
|
|
|
41
41
|
return input.trim().toLowerCase();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function withoutFe0f(unified) {
|
|
45
|
+
return unified.replace(/-fe0f/g, "");
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
function normalizeQuery(input) {
|
|
45
49
|
return input && "string" == typeof input ? input.trim().toLowerCase() : "";
|
|
46
50
|
}
|
|
@@ -63,7 +67,8 @@ function appendEntry(byUnified, byCharMutable, records, entry) {
|
|
|
63
67
|
addedIn
|
|
64
68
|
});
|
|
65
69
|
records.push(info), byUnified.set(unified, info);
|
|
66
|
-
for (const
|
|
70
|
+
for (const id of [ unified, ...info.variations ]) byUnified.has(id) || byUnified.set(id, info),
|
|
71
|
+
byUnified.has(withoutFe0f(id)) || byUnified.set(withoutFe0f(id), info);
|
|
67
72
|
indexCharBucket(byCharMutable, names, info);
|
|
68
73
|
}
|
|
69
74
|
|
|
@@ -118,7 +123,9 @@ function smallestCandidateBucket(core, normalized) {
|
|
|
118
123
|
function getEmojiByUnified(unified, options) {
|
|
119
124
|
if (!unified || "string" != typeof unified) return;
|
|
120
125
|
const normalized = normalizeUnified(unified);
|
|
121
|
-
|
|
126
|
+
if (!normalized) return;
|
|
127
|
+
const core = getPreparedCore(options?.emojiData);
|
|
128
|
+
return core.byUnified.get(normalized) ?? core.byUnified.get(withoutFe0f(normalized));
|
|
122
129
|
}
|
|
123
130
|
|
|
124
131
|
function searchEmojis(query, options) {
|
|
@@ -141,4 +148,4 @@ function searchEmojis(query, options) {
|
|
|
141
148
|
return memoizeQuery(core, normalized, matches), Object.freeze([ ...matches ]);
|
|
142
149
|
}
|
|
143
150
|
|
|
144
|
-
export { registerDefaultEmojiData, getRegisteredDefaultEmojiData, EMPTY_EMOJI_DATA, defaultEmojiDataOrEmpty, loadDefaultEmojiData, parseNativeEmoji, normalizeQuery, getPreparedCore, getEmojiByUnified, searchEmojis };
|
|
151
|
+
export { registerDefaultEmojiData, getRegisteredDefaultEmojiData, EMPTY_EMOJI_DATA, defaultEmojiDataOrEmpty, loadDefaultEmojiData, parseNativeEmoji, withoutFe0f, normalizeQuery, getPreparedCore, getEmojiByUnified, searchEmojis };
|
package/dist/esm/data.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./chunks/chunk-
|
|
1
|
+
import "./chunks/chunk-GZYF2CX5.mjs";
|
|
2
2
|
|
|
3
|
-
import { getEmojiByUnified, searchEmojis } from "./chunks/chunk-
|
|
3
|
+
import { getEmojiByUnified, searchEmojis } from "./chunks/chunk-V7DBC3DD.mjs";
|
|
4
4
|
|
|
5
5
|
import "./chunks/chunk-ZOAKI5M6.mjs";
|
|
6
6
|
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Categories, CategoryNav, DEFAULT_PICKER_HEIGHT, DEFAULT_PICKER_WIDTH, DefaultPickerConfiguration, EmojiStyle, Empty, List, LoadError, Loading, MutableConfigProvider, Panel, Preview, Reactions, Relative, Root, Search, SkinTone, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme, ViewOnlyEmoji, Viewport, commonInteractionStyles, compareConfig, cx, defaultPickerTokens, emojiByUnified, isPickerBehaviorProp, resolveEmojiStyle, resolveSkinTonePickerLocation, stylesheet, useDefaultAppearance, useDefineMutableConfig, usePreviewConfig, useSearchDisabledConfig, useSkinTonePickerLocationConfig, useSkinTonesDisabledConfig, validColumns } from "./chunks/chunk-
|
|
2
|
+
import { Categories, CategoryNav, DEFAULT_PICKER_HEIGHT, DEFAULT_PICKER_WIDTH, DefaultPickerConfiguration, EmojiStyle, Empty, List, LoadError, Loading, MutableConfigProvider, Panel, Preview, Reactions, Relative, Root, Search, SkinTone, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme, ViewOnlyEmoji, Viewport, commonInteractionStyles, compareConfig, cx, defaultPickerTokens, emojiByUnified, isPickerBehaviorProp, resolveEmojiStyle, resolveSkinTonePickerLocation, stylesheet, useDefaultAppearance, useDefineMutableConfig, usePreviewConfig, useSearchDisabledConfig, useSkinTonePickerLocationConfig, useSkinTonesDisabledConfig, validColumns } from "./chunks/chunk-FYMRCRY5.mjs";
|
|
3
3
|
|
|
4
|
-
import "./chunks/chunk-
|
|
4
|
+
import "./chunks/chunk-GZYF2CX5.mjs";
|
|
5
5
|
|
|
6
|
-
import "./chunks/chunk-
|
|
6
|
+
import "./chunks/chunk-V7DBC3DD.mjs";
|
|
7
7
|
|
|
8
8
|
import "./chunks/chunk-ZOAKI5M6.mjs";
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Categories, CategoryNav, EmojiStyle, Empty, List, LoadError, Loading, Panel, Preview, Reactions, Root, Search, SearchInput, SkinTone, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme, Viewport, darkPickerTokens, defaultPickerTokens, lightPickerTokens, structuralPickerTokens, useActiveEmoji, useCategoryNavigation, useEmojiDataState, usePickerMode, useSearchActions, useSearchState, useSkinTone } from "../chunks/chunk-
|
|
2
|
+
import { Categories, CategoryNav, EmojiStyle, Empty, List, LoadError, Loading, Panel, Preview, Reactions, Root, Search, SearchInput, SkinTone, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme, Viewport, darkPickerTokens, defaultPickerTokens, lightPickerTokens, structuralPickerTokens, useActiveEmoji, useCategoryNavigation, useEmojiDataState, usePickerMode, useSearchActions, useSearchState, useSkinTone } from "../chunks/chunk-FYMRCRY5.mjs";
|
|
3
3
|
|
|
4
|
-
import "../chunks/chunk-
|
|
4
|
+
import "../chunks/chunk-V7DBC3DD.mjs";
|
|
5
5
|
|
|
6
6
|
export { Categories, CategoryNav, EmojiStyle, Empty, List, LoadError, Loading, Panel, Preview, Reactions, Root, Search, SearchInput, SkinTone, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme, Viewport, darkPickerTokens, defaultPickerTokens, lightPickerTokens, structuralPickerTokens, useActiveEmoji, useCategoryNavigation, useEmojiDataState, usePickerMode, useSearchActions, useSearchState, useSkinTone };
|