emoji-picker-react 4.0.0-rc.22 → 4.0.0-rc.23
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/components/emoji/Emoji.d.ts +8 -5
- package/dist/emoji-picker-react.cjs.development.js +41 -30
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +42 -31
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/body/EmojiList.tsx +2 -2
- package/src/components/body/EmojiVariationPicker.tsx +2 -2
- package/src/components/body/Suggested.tsx +2 -2
- package/src/components/emoji/Emoji.tsx +41 -20
- package/src/components/footer/Preview.tsx +3 -7
|
@@ -3,15 +3,18 @@ import { EmojiRef } from '../../DomUtils/emojiElementRef';
|
|
|
3
3
|
import { DataEmoji } from '../../dataUtils/DataTypes';
|
|
4
4
|
import { EmojiStyle } from '../../types/exposedTypes';
|
|
5
5
|
import './Emoji.css';
|
|
6
|
-
declare type
|
|
6
|
+
declare type ClickableEmojiProps = Readonly<BaseProps & {
|
|
7
7
|
hidden?: boolean;
|
|
8
|
+
showVariations?: boolean;
|
|
9
|
+
emojiRef?: EmojiRef;
|
|
10
|
+
}>;
|
|
11
|
+
declare type BaseProps = {
|
|
8
12
|
emojiStyle: EmojiStyle;
|
|
9
13
|
emoji: DataEmoji;
|
|
10
14
|
unified: string;
|
|
11
|
-
showVariations?: boolean;
|
|
12
15
|
size?: number;
|
|
13
|
-
emojiRef?: EmojiRef;
|
|
14
16
|
lazyLoad?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function
|
|
17
|
+
};
|
|
18
|
+
export declare function ClickableEmoji({ emoji, unified, hidden, emojiStyle, showVariations, size, emojiRef, lazyLoad }: ClickableEmojiProps): JSX.Element;
|
|
19
|
+
export declare function ViewOnlyEmoji({ emoji, unified, emojiStyle, size, lazyLoad }: BaseProps): JSX.Element;
|
|
17
20
|
export {};
|
|
@@ -16050,7 +16050,7 @@ function useIsEmojiHidden() {
|
|
|
16050
16050
|
};
|
|
16051
16051
|
}
|
|
16052
16052
|
|
|
16053
|
-
function
|
|
16053
|
+
function ClickableEmoji(_ref) {
|
|
16054
16054
|
var _clsx;
|
|
16055
16055
|
|
|
16056
16056
|
var emoji = _ref.emoji,
|
|
@@ -16063,31 +16063,46 @@ function Emoji(_ref) {
|
|
|
16063
16063
|
emojiRef = _ref.emojiRef,
|
|
16064
16064
|
lazyLoad = _ref.lazyLoad;
|
|
16065
16065
|
var hasVariations = emojiHasVariations(emoji);
|
|
16066
|
+
return React.createElement("button", {
|
|
16067
|
+
className: clsx(ClassNames.emoji, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.visible] = !hidden, _clsx['epr-emoji-has-variations'] = hasVariations && showVariations, _clsx)),
|
|
16068
|
+
"data-unified": unified,
|
|
16069
|
+
// @ts-ignore - let's ignore the fact this is not a real react ref, ok?
|
|
16070
|
+
ref: emojiRef
|
|
16071
|
+
}, React.createElement(ViewOnlyEmoji, {
|
|
16072
|
+
unified: unified,
|
|
16073
|
+
emoji: emoji,
|
|
16074
|
+
size: size,
|
|
16075
|
+
emojiStyle: emojiStyle,
|
|
16076
|
+
lazyLoad: lazyLoad
|
|
16077
|
+
}));
|
|
16078
|
+
}
|
|
16079
|
+
function ViewOnlyEmoji(_ref2) {
|
|
16080
|
+
var emoji = _ref2.emoji,
|
|
16081
|
+
unified = _ref2.unified,
|
|
16082
|
+
emojiStyle = _ref2.emojiStyle,
|
|
16083
|
+
size = _ref2.size,
|
|
16084
|
+
lazyLoad = _ref2.lazyLoad;
|
|
16066
16085
|
var style = {};
|
|
16067
16086
|
|
|
16068
16087
|
if (size) {
|
|
16069
16088
|
style.width = style.height = style.fontSize = size + "px";
|
|
16070
16089
|
}
|
|
16071
16090
|
|
|
16072
|
-
|
|
16091
|
+
return React.createElement(React.Fragment, null, emojiStyle === exports.EmojiStyle.NATIVE ? React.createElement(NativeEmoji, {
|
|
16092
|
+
unified: unified,
|
|
16093
|
+
style: style
|
|
16094
|
+
}) : React.createElement(EmojiImg, {
|
|
16095
|
+
unified: unified,
|
|
16073
16096
|
style: style,
|
|
16074
|
-
unified: unified
|
|
16075
|
-
};
|
|
16076
|
-
return React.createElement("button", {
|
|
16077
|
-
className: clsx(ClassNames.emoji, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.visible] = !hidden, _clsx['epr-emoji-has-variations'] = hasVariations && showVariations, _clsx)),
|
|
16078
|
-
"data-unified": unified,
|
|
16079
|
-
// @ts-ignore - let's ignore the fact this is not a real react ref, ok?
|
|
16080
|
-
ref: emojiRef
|
|
16081
|
-
}, emojiStyle === exports.EmojiStyle.NATIVE ? React.createElement(NativeEmoji, Object.assign({}, base)) : React.createElement(EmojiImg, Object.assign({}, base, {
|
|
16082
16097
|
emoji: emoji,
|
|
16083
16098
|
emojiStyle: emojiStyle,
|
|
16084
16099
|
lazyLoad: lazyLoad
|
|
16085
|
-
}))
|
|
16100
|
+
}));
|
|
16086
16101
|
}
|
|
16087
16102
|
|
|
16088
|
-
function NativeEmoji(
|
|
16089
|
-
var unified =
|
|
16090
|
-
style =
|
|
16103
|
+
function NativeEmoji(_ref3) {
|
|
16104
|
+
var unified = _ref3.unified,
|
|
16105
|
+
style = _ref3.style;
|
|
16091
16106
|
return React.createElement("span", {
|
|
16092
16107
|
className: "epr-emoji-native",
|
|
16093
16108
|
"data-unified": unified,
|
|
@@ -16095,13 +16110,13 @@ function NativeEmoji(_ref2) {
|
|
|
16095
16110
|
}, parseNativeEmoji(unified));
|
|
16096
16111
|
}
|
|
16097
16112
|
|
|
16098
|
-
function EmojiImg(
|
|
16099
|
-
var emoji =
|
|
16100
|
-
unified =
|
|
16101
|
-
emojiStyle =
|
|
16102
|
-
style =
|
|
16103
|
-
|
|
16104
|
-
lazyLoad =
|
|
16113
|
+
function EmojiImg(_ref4) {
|
|
16114
|
+
var emoji = _ref4.emoji,
|
|
16115
|
+
unified = _ref4.unified,
|
|
16116
|
+
emojiStyle = _ref4.emojiStyle,
|
|
16117
|
+
style = _ref4.style,
|
|
16118
|
+
_ref4$lazyLoad = _ref4.lazyLoad,
|
|
16119
|
+
lazyLoad = _ref4$lazyLoad === void 0 ? false : _ref4$lazyLoad;
|
|
16105
16120
|
|
|
16106
16121
|
var _useEmojisThatFailedT = useEmojisThatFailedToLoadState(),
|
|
16107
16122
|
setEmojisThatFailedToLoad = _useEmojisThatFailedT[1];
|
|
@@ -16170,7 +16185,7 @@ function Suggested(_ref) {
|
|
|
16170
16185
|
return null;
|
|
16171
16186
|
}
|
|
16172
16187
|
|
|
16173
|
-
return React.createElement(
|
|
16188
|
+
return React.createElement(ClickableEmoji, {
|
|
16174
16189
|
showVariations: false,
|
|
16175
16190
|
unified: suggestedItem.unified,
|
|
16176
16191
|
emojiStyle: emojiStyle,
|
|
@@ -16229,7 +16244,7 @@ function RenderCategory(_ref) {
|
|
|
16229
16244
|
hiddenCounter++;
|
|
16230
16245
|
}
|
|
16231
16246
|
|
|
16232
|
-
return React.createElement(
|
|
16247
|
+
return React.createElement(ClickableEmoji, {
|
|
16233
16248
|
key: unified,
|
|
16234
16249
|
emoji: emoji,
|
|
16235
16250
|
unified: unified,
|
|
@@ -16292,7 +16307,7 @@ function EmojiVariationPicker() {
|
|
|
16292
16307
|
top: top
|
|
16293
16308
|
}
|
|
16294
16309
|
}, visible ? [emojiUnified(safeEmoji)].concat(emojiVariations(safeEmoji)).slice(0, 6).map(function (unified) {
|
|
16295
|
-
return React.createElement(
|
|
16310
|
+
return React.createElement(ClickableEmoji, {
|
|
16296
16311
|
key: unified,
|
|
16297
16312
|
emoji: safeEmoji,
|
|
16298
16313
|
unified: unified,
|
|
@@ -16533,19 +16548,15 @@ function Preview() {
|
|
|
16533
16548
|
function PreviewContent() {
|
|
16534
16549
|
var defaultEmoji = asEmoji(variationPickerEmoji != null ? variationPickerEmoji : emojiByUnified(previewConfig.defaultEmoji));
|
|
16535
16550
|
var defaultText = variationPickerEmoji ? emojiName(variationPickerEmoji) : previewConfig.defaultCaption;
|
|
16536
|
-
return React.createElement(React.Fragment, null, React.createElement("div", null, show ? React.createElement(
|
|
16551
|
+
return React.createElement(React.Fragment, null, React.createElement("div", null, show ? React.createElement(ViewOnlyEmoji, {
|
|
16537
16552
|
unified: previewEmoji == null ? void 0 : previewEmoji.unified,
|
|
16538
16553
|
emoji: asEmoji(emoji),
|
|
16539
|
-
showVariations: false,
|
|
16540
16554
|
emojiStyle: emojiStyle,
|
|
16541
|
-
hidden: false,
|
|
16542
16555
|
size: 45
|
|
16543
|
-
}) : defaultEmoji ? React.createElement(
|
|
16556
|
+
}) : defaultEmoji ? React.createElement(ViewOnlyEmoji, {
|
|
16544
16557
|
unified: emojiUnified(defaultEmoji),
|
|
16545
16558
|
emoji: defaultEmoji,
|
|
16546
|
-
showVariations: false,
|
|
16547
16559
|
emojiStyle: emojiStyle,
|
|
16548
|
-
hidden: false,
|
|
16549
16560
|
size: 45
|
|
16550
16561
|
}) : null), show ? React.createElement("div", {
|
|
16551
16562
|
className: "epr-preview-emoji-label"
|