emoji-picker-react 5.1.1 → 5.1.3
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 +1 -1
- package/dist/data/index.js +1 -1
- package/dist/data-core/prepare.d.ts +6 -0
- package/dist/esm/chunks/{chunk-DDDACPJK.mjs → chunk-CEY4YIFR.mjs} +34 -32
- 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 +5 -2
- 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";
|
|
@@ -1100,13 +1100,22 @@ var useIsomorphicLayoutEffect = "undefined" != typeof window ? React.useLayoutEf
|
|
|
1100
1100
|
|
|
1101
1101
|
// src/Stylesheet/DedupedStyle.tsx
|
|
1102
1102
|
function DedupedStyle({css, nonce}) {
|
|
1103
|
-
const styleRef = React2.useRef(null), rootRef = React2.useRef(void 0), [owner, setOwner] = React2.useState(!0), syncRef = React2.useRef(void 0);
|
|
1103
|
+
const kept = "undefined" != typeof document && css.startsWith("@layer"), styleRef = React2.useRef(null), rootRef = React2.useRef(void 0), [owner, setOwner] = React2.useState(!0), syncRef = React2.useRef(void 0);
|
|
1104
1104
|
return useIsomorphicLayoutEffect((() => {
|
|
1105
1105
|
const style = styleRef.current, root = rootRef.current = rootRef.current || (style ? style.getRootNode() : void 0);
|
|
1106
1106
|
if (!root) return;
|
|
1107
1107
|
const byKey = claimsByRoot.get(root) || {};
|
|
1108
1108
|
claimsByRoot.set(root, byKey);
|
|
1109
|
-
const key = nonce + css
|
|
1109
|
+
const key = nonce + css;
|
|
1110
|
+
if (kept) {
|
|
1111
|
+
if (!byKey[key]) {
|
|
1112
|
+
byKey[key] = [];
|
|
1113
|
+
const sheet = style.cloneNode();
|
|
1114
|
+
sheet.textContent = css, (root.head || root).appendChild(sheet);
|
|
1115
|
+
}
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
const claims = byKey[key] = byKey[key] || [], claim = {
|
|
1110
1119
|
update: () => setOwner(claims[0] === claim),
|
|
1111
1120
|
detached: () => !!styleRef.current && !styleRef.current.isConnected
|
|
1112
1121
|
}, sync = syncRef.current = () => {
|
|
@@ -1122,7 +1131,7 @@ function DedupedStyle({css, nonce}) {
|
|
|
1122
1131
|
nonce,
|
|
1123
1132
|
suppressHydrationWarning: !0,
|
|
1124
1133
|
dangerouslySetInnerHTML: {
|
|
1125
|
-
__html: css
|
|
1134
|
+
__html: kept ? "" : css
|
|
1126
1135
|
}
|
|
1127
1136
|
}) : null;
|
|
1128
1137
|
}
|
|
@@ -1614,7 +1623,7 @@ function getBaseConfigByCategory(category, modifier = {}) {
|
|
|
1614
1623
|
}
|
|
1615
1624
|
|
|
1616
1625
|
// src/config/config.ts
|
|
1617
|
-
var KNOWN_FAILING_EMOJIS = [ "2640
|
|
1626
|
+
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
1627
|
searchPlaceholder: DEFAULT_SEARCH_PLACEHOLDER,
|
|
1619
1628
|
searchLabel: "Type to search for an emoji",
|
|
1620
1629
|
searchClear: DEFAULT_SEARCH_CLEAR_BUTTON_LABEL,
|
|
@@ -1664,7 +1673,7 @@ function mergeConfig(rawUserConfig = {}) {
|
|
|
1664
1673
|
suggestionMode: config.suggestedEmojisMode
|
|
1665
1674
|
}, userConfig.emojiData, userConfig.customEmojis);
|
|
1666
1675
|
config.hiddenEmojis.forEach((emoji => {
|
|
1667
|
-
const id = String(emoji).trim().toLowerCase();
|
|
1676
|
+
const id = withoutFe0f(String(emoji).trim().toLowerCase());
|
|
1668
1677
|
id && config.unicodeToHide.add(id);
|
|
1669
1678
|
}));
|
|
1670
1679
|
const skinTonePickerLocation = resolveSkinTonePickerLocation(config.skinTonePickerLocation, config.searchDisabled, previewConfig.showPreview);
|
|
@@ -2330,9 +2339,9 @@ function getPickerDataSnapshot(genericEmojiData, customEmojis) {
|
|
|
2330
2339
|
emojis: nextEmojis
|
|
2331
2340
|
}, customGroups = customLayer.groups, allEmojis = Object.values(nextEmojis).concat(Object.values(customGroups)).flat(), allEmojisByUnified2 = /* @__PURE__ */ Object.create(null);
|
|
2332
2341
|
allEmojis.forEach((emoji => {
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
allEmojisByUnified2[
|
|
2342
|
+
[ emoji.u, ...emoji.v || [] ].forEach((id => {
|
|
2343
|
+
var _a;
|
|
2344
|
+
allEmojisByUnified2[id] = emoji, allEmojisByUnified2[_a = withoutFe0f(id)] || (allEmojisByUnified2[_a] = emoji);
|
|
2336
2345
|
}));
|
|
2337
2346
|
}));
|
|
2338
2347
|
const snapshot = {
|
|
@@ -2383,20 +2392,12 @@ function resolveSuggestedRenderIds(entries, lookup) {
|
|
|
2383
2392
|
}
|
|
2384
2393
|
|
|
2385
2394
|
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));
|
|
2395
|
+
if (!id) return;
|
|
2396
|
+
let unified = id, record = lookup(id);
|
|
2397
|
+
if (!record && /[^\0-\x7f]/.test(id) && (unified = Array.from(id).map((char => char.codePointAt(0).toString(16).padStart(4, "0"))).join("-"),
|
|
2398
|
+
record = lookup(unified)), !record) return;
|
|
2399
|
+
const known = [ record.u, ...record.v ?? [] ];
|
|
2400
|
+
return known.includes(unified) ? unified : known.find((each => withoutFe0f(each) === withoutFe0f(unified)));
|
|
2400
2401
|
}
|
|
2401
2402
|
|
|
2402
2403
|
// src/hooks/useDataIdentityStabilityWarning.ts
|
|
@@ -2453,7 +2454,7 @@ function PickerDataProvider({children}) {
|
|
|
2453
2454
|
const {customEmojis, emojiData: genericEmojiData} = usePickerConfig();
|
|
2454
2455
|
useDataIdentityStabilityWarning(genericEmojiData, customEmojis);
|
|
2455
2456
|
const data = React10.useMemo((() => getPickerDataSnapshot(genericEmojiData, customEmojis)), [ genericEmojiData, customEmojis ]), emojiByUnified2 = React10.useCallback((unified => {
|
|
2456
|
-
if (unified) return data.allEmojisByUnified[unified] ?? data.allEmojisByUnified[unifiedWithoutSkinTone(unified)];
|
|
2457
|
+
if (unified) return data.allEmojisByUnified[unified] ?? data.allEmojisByUnified[withoutFe0f(unified)] ?? data.allEmojisByUnified[unifiedWithoutSkinTone(unified)];
|
|
2457
2458
|
}), [ data.allEmojisByUnified ]), allCustomEmojis = React10.useMemo((() => [ ...data.emojiData.emojis?.custom ?? [], ...Object.values(data.customGroups).flat() ]), [ data.emojiData, data.customGroups ]), queryFilterDict = React10.useCallback((query => {
|
|
2458
2459
|
const normalized = normalizeQuery(query), dict = /* @__PURE__ */ Object.create(null);
|
|
2459
2460
|
if (!normalized) return dict;
|
|
@@ -4812,7 +4813,7 @@ import { useCallback as useCallback10 } from "react";
|
|
|
4812
4813
|
function useIsEmojiDisallowed() {
|
|
4813
4814
|
const configured = parseFloat(useEmojiVersionConfig() || ""), nativeSupport = useNativeEmojiSupport(), cap = Number.isNaN(configured) ? 1 / 0 : configured, unicodeToHide = useUnicodeToHide(), [activeSkinTone] = useActiveSkinToneState();
|
|
4814
4815
|
return useCallback10((function isEmojiDisallowed(emoji, renderedUnified = emojiUnified(emoji, activeSkinTone)) {
|
|
4815
|
-
if (unicodeToHide.has(unifiedWithoutSkinTone(emojiUnified(emoji)))) return !0;
|
|
4816
|
+
if (unicodeToHide.has(withoutFe0f(unifiedWithoutSkinTone(emojiUnified(emoji))))) return !0;
|
|
4816
4817
|
if (isCustomEmoji(emoji)) return !1;
|
|
4817
4818
|
const version = addedIn(emoji);
|
|
4818
4819
|
return version > cap || !isNativeEmojiSupported(nativeSupport, renderedUnified, version);
|
|
@@ -5640,23 +5641,24 @@ var SKIN_TONE_LABEL_KEYS = {
|
|
|
5640
5641
|
":focus": {
|
|
5641
5642
|
boxShadow: "0 0 0 3px var(--epr-focus-bg-color)"
|
|
5642
5643
|
},
|
|
5644
|
+
// Swatch colors are themeable; the fallbacks are the defaults.
|
|
5643
5645
|
"&.epr-tone-neutral": {
|
|
5644
|
-
backgroundColor: "#ffd225"
|
|
5646
|
+
backgroundColor: "var(--epr-skin-tone-neutral-color, #ffd225)"
|
|
5645
5647
|
},
|
|
5646
5648
|
"&.epr-tone-1f3fb": {
|
|
5647
|
-
backgroundColor: "#ffdfbd"
|
|
5649
|
+
backgroundColor: "var(--epr-skin-tone-light-color, #ffdfbd)"
|
|
5648
5650
|
},
|
|
5649
5651
|
"&.epr-tone-1f3fc": {
|
|
5650
|
-
backgroundColor: "#e9c197"
|
|
5652
|
+
backgroundColor: "var(--epr-skin-tone-medium-light-color, #e9c197)"
|
|
5651
5653
|
},
|
|
5652
5654
|
"&.epr-tone-1f3fd": {
|
|
5653
|
-
backgroundColor: "#c88e62"
|
|
5655
|
+
backgroundColor: "var(--epr-skin-tone-medium-color, #c88e62)"
|
|
5654
5656
|
},
|
|
5655
5657
|
"&.epr-tone-1f3fe": {
|
|
5656
|
-
backgroundColor: "#a86637"
|
|
5658
|
+
backgroundColor: "var(--epr-skin-tone-medium-dark-color, #a86637)"
|
|
5657
5659
|
},
|
|
5658
5660
|
"&.epr-tone-1f3ff": {
|
|
5659
|
-
backgroundColor: "#60463a"
|
|
5661
|
+
backgroundColor: "var(--epr-skin-tone-dark-color, #60463a)"
|
|
5660
5662
|
}
|
|
5661
5663
|
}
|
|
5662
5664
|
}))();
|
|
@@ -6525,7 +6527,7 @@ function useEmojiVirtualization({categoryEmojis, topOffset, onHeightReady, scrol
|
|
|
6525
6527
|
})), accumulator;
|
|
6526
6528
|
}), []) : [];
|
|
6527
6529
|
return useEffect26((() => requestNativeProbe(probe2))), useEffect26((() => {
|
|
6528
|
-
preloads.forEach((emoji => preloadEmoji(getEmojiUrl, emoji, emojiStyle,
|
|
6530
|
+
preloads.forEach((emoji => preloadEmoji(getEmojiUrl, emoji, emojiStyle, emojiUnified(emoji, activeSkinTone))));
|
|
6529
6531
|
})), {
|
|
6530
6532
|
virtualizedCounter: emojisToPush.length - emojis.length,
|
|
6531
6533
|
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-CEY4YIFR.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-CEY4YIFR.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 };
|