emoji-picker-react 5.1.2 → 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
CHANGED
|
@@ -66,7 +66,7 @@ See [PROPS.md](PROPS.md) for every prop.
|
|
|
66
66
|
- **Localized** — 28 emoji datasets; translate search, categories, previews, reactions, skin tones, loading errors and retry controls, including accessible announcements.
|
|
67
67
|
- **Emoji styles** — native (default), Apple, Google, Facebook, Twitter; native mode filters detected unsupported OS glyphs, including individual sequences and skin tones. See [detection limits](docs/v5/API.md#5c-native-emoji-support-detection).
|
|
68
68
|
- **Custom emojis** — image-based emojis, optionally in their own named groups.
|
|
69
|
-
- **Lean when you want** — the primitives entry loads the dataset on demand (a
|
|
69
|
+
- **Lean when you want** — the primitives entry loads the dataset on demand (a 35 KiB min+gz startup budget including ShipStyles; see the consumer gate); a framework-free data API for search and lookup.
|
|
70
70
|
- **Modern React** — React 16.8 through 19, SSR, React Server Components (`"use client"` entries), TypeScript types included; ships ES2020 for every browser since 2020 and any modern bundler.
|
|
71
71
|
|
|
72
72
|
> **Upgrading from v4?** Most code works unchanged; the default emoji style is now native, and markup, styling and package boundaries have changed. See [Migrating from v4](docs/v5/MIGRATION.md). The APIs on this page need `emoji-picker-react@5` or later.
|
|
@@ -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
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
4
|
import "./chunks/chunk-GZYF2CX5.mjs";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
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
4
|
import "../chunks/chunk-V7DBC3DD.mjs";
|
|
5
5
|
|