emoji-picker-react 4.15.1 → 4.15.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/components/body/MeasureEmoji.d.ts +2 -0
- package/dist/components/context/PickerContext.d.ts +1 -0
- package/dist/emoji-picker-react.cjs.development.js +164 -114
- 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 +165 -115
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/body/EmojiCategory.tsx +2 -0
- package/src/components/body/EmojiList.tsx +2 -0
- package/src/components/body/MeasureEmoji.tsx +74 -0
- package/src/components/context/PickerContext.tsx +11 -2
- package/src/hooks/useCategoryHeight.ts +18 -12
- package/src/hooks/useEmojiVirtualization.tsx +15 -12
|
@@ -1,74 +1,60 @@
|
|
|
1
|
-
import React__default, { memo, createElement, useState, useRef, useMemo, useEffect, createContext, useContext, createRef, useCallback, Fragment, Suspense, Component } from 'react';
|
|
1
|
+
import React__default, { memo, createElement, useState, useRef, useMemo, useEffect, createContext, useContext, createRef, useCallback, Fragment, useLayoutEffect, Suspense, Component } from 'react';
|
|
2
2
|
import { createSheet, cx } from 'flairup';
|
|
3
3
|
|
|
4
|
+
function _arrayLikeToArray(r, a) {
|
|
5
|
+
(null == a || a > r.length) && (a = r.length);
|
|
6
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
10
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
11
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
12
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
13
|
+
t && (r = t);
|
|
14
|
+
var o = 0;
|
|
15
|
+
return function () {
|
|
16
|
+
return o >= r.length ? {
|
|
17
|
+
done: !0
|
|
18
|
+
} : {
|
|
19
|
+
done: !1,
|
|
20
|
+
value: r[o++]
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
25
|
+
}
|
|
4
26
|
function _extends() {
|
|
5
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
6
|
-
for (var
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
27
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
28
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
29
|
+
var t = arguments[e];
|
|
30
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
13
31
|
}
|
|
14
|
-
return
|
|
15
|
-
};
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
32
|
+
return n;
|
|
33
|
+
}, _extends.apply(null, arguments);
|
|
17
34
|
}
|
|
18
|
-
function _inheritsLoose(
|
|
19
|
-
|
|
20
|
-
subClass.prototype.constructor = subClass;
|
|
21
|
-
_setPrototypeOf(subClass, superClass);
|
|
35
|
+
function _inheritsLoose(t, o) {
|
|
36
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
22
37
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
31
|
-
if (source == null) return {};
|
|
32
|
-
var target = {};
|
|
33
|
-
var sourceKeys = Object.keys(source);
|
|
34
|
-
var key, i;
|
|
35
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
36
|
-
key = sourceKeys[i];
|
|
37
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
38
|
-
target[key] = source[key];
|
|
38
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
39
|
+
if (null == r) return {};
|
|
40
|
+
var t = {};
|
|
41
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
42
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
43
|
+
t[n] = r[n];
|
|
39
44
|
}
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
43
|
-
if (!o) return;
|
|
44
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
45
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
46
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
47
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
48
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
45
|
+
return t;
|
|
49
46
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
function _setPrototypeOf(t, e) {
|
|
48
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
49
|
+
return t.__proto__ = e, t;
|
|
50
|
+
}, _setPrototypeOf(t, e);
|
|
54
51
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var i = 0;
|
|
61
|
-
return function () {
|
|
62
|
-
if (i >= o.length) return {
|
|
63
|
-
done: true
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
done: false,
|
|
67
|
-
value: o[i++]
|
|
68
|
-
};
|
|
69
|
-
};
|
|
52
|
+
function _unsupportedIterableToArray(r, a) {
|
|
53
|
+
if (r) {
|
|
54
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
55
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
56
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
70
57
|
}
|
|
71
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
72
58
|
}
|
|
73
59
|
|
|
74
60
|
var ClassNames;
|
|
@@ -339,6 +325,7 @@ function PickerContextProvider(_ref) {
|
|
|
339
325
|
isPastInitialLoad = _useState[0],
|
|
340
326
|
setIsPastInitialLoad = _useState[1];
|
|
341
327
|
var visibleCategoriesState = useState([]);
|
|
328
|
+
var emojiSizeState = useState(null);
|
|
342
329
|
useMarkInitialLoad(setIsPastInitialLoad);
|
|
343
330
|
return createElement(PickerContext.Provider, {
|
|
344
331
|
value: {
|
|
@@ -355,7 +342,8 @@ function PickerContextProvider(_ref) {
|
|
|
355
342
|
skinToneFanOpenState: skinToneFanOpenState,
|
|
356
343
|
suggestedUpdateState: suggestedUpdateState,
|
|
357
344
|
reactionsModeState: reactionsModeState,
|
|
358
|
-
visibleCategoriesState: visibleCategoriesState
|
|
345
|
+
visibleCategoriesState: visibleCategoriesState,
|
|
346
|
+
emojiSizeState: emojiSizeState
|
|
359
347
|
}
|
|
360
348
|
}, children);
|
|
361
349
|
}
|
|
@@ -387,7 +375,8 @@ var PickerContext = /*#__PURE__*/createContext({
|
|
|
387
375
|
reactionsModeState: [false, function () {}],
|
|
388
376
|
visibleCategoriesState: [[], function () {
|
|
389
377
|
return [];
|
|
390
|
-
}]
|
|
378
|
+
}],
|
|
379
|
+
emojiSizeState: [null, function () {}]
|
|
391
380
|
});
|
|
392
381
|
function useFilterRef() {
|
|
393
382
|
var _React$useContext = useContext(PickerContext),
|
|
@@ -430,18 +419,23 @@ function useEmojiVariationPickerState() {
|
|
|
430
419
|
return emojiVariationPickerState;
|
|
431
420
|
}
|
|
432
421
|
function useSkinToneFanOpenState() {
|
|
433
|
-
var _React$
|
|
434
|
-
skinToneFanOpenState = _React$
|
|
422
|
+
var _React$useContext0 = useContext(PickerContext),
|
|
423
|
+
skinToneFanOpenState = _React$useContext0.skinToneFanOpenState;
|
|
435
424
|
return skinToneFanOpenState;
|
|
436
425
|
}
|
|
437
426
|
function useVisibleCategoriesState() {
|
|
438
|
-
var _React$
|
|
439
|
-
visibleCategoriesState = _React$
|
|
427
|
+
var _React$useContext10 = useContext(PickerContext),
|
|
428
|
+
visibleCategoriesState = _React$useContext10.visibleCategoriesState;
|
|
440
429
|
return visibleCategoriesState;
|
|
441
430
|
}
|
|
431
|
+
function useEmojiSizeState() {
|
|
432
|
+
var _React$useContext11 = useContext(PickerContext),
|
|
433
|
+
emojiSizeState = _React$useContext11.emojiSizeState;
|
|
434
|
+
return emojiSizeState;
|
|
435
|
+
}
|
|
442
436
|
function useUpdateSuggested() {
|
|
443
|
-
var _React$
|
|
444
|
-
suggestedUpdateState = _React$
|
|
437
|
+
var _React$useContext12 = useContext(PickerContext),
|
|
438
|
+
suggestedUpdateState = _React$useContext12.suggestedUpdateState;
|
|
445
439
|
var suggestedUpdated = suggestedUpdateState[0],
|
|
446
440
|
setsuggestedUpdate = suggestedUpdateState[1];
|
|
447
441
|
return [suggestedUpdated, function updateSuggested() {
|
|
@@ -17607,7 +17601,7 @@ var basePreviewConfig = {
|
|
|
17607
17601
|
};
|
|
17608
17602
|
|
|
17609
17603
|
var _excluded = ["children"];
|
|
17610
|
-
var ConfigContext = /*#__PURE__*/createContext(
|
|
17604
|
+
var ConfigContext = /*#__PURE__*/createContext(/*#__PURE__*/basePickerConfig());
|
|
17611
17605
|
function PickerConfigProvider(_ref) {
|
|
17612
17606
|
var children = _ref.children,
|
|
17613
17607
|
config = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -17751,73 +17745,73 @@ function useOnSkinToneChangeConfig() {
|
|
|
17751
17745
|
return current.onSkinToneChange || function () {};
|
|
17752
17746
|
}
|
|
17753
17747
|
function usePreviewConfig() {
|
|
17754
|
-
var
|
|
17755
|
-
previewConfig =
|
|
17748
|
+
var _usePickerConfig0 = usePickerConfig(),
|
|
17749
|
+
previewConfig = _usePickerConfig0.previewConfig;
|
|
17756
17750
|
return previewConfig;
|
|
17757
17751
|
}
|
|
17758
17752
|
function useThemeConfig() {
|
|
17759
|
-
var
|
|
17760
|
-
theme =
|
|
17753
|
+
var _usePickerConfig1 = usePickerConfig(),
|
|
17754
|
+
theme = _usePickerConfig1.theme;
|
|
17761
17755
|
return theme;
|
|
17762
17756
|
}
|
|
17763
17757
|
function useSuggestedEmojisModeConfig() {
|
|
17764
|
-
var
|
|
17765
|
-
suggestedEmojisMode =
|
|
17758
|
+
var _usePickerConfig10 = usePickerConfig(),
|
|
17759
|
+
suggestedEmojisMode = _usePickerConfig10.suggestedEmojisMode;
|
|
17766
17760
|
return suggestedEmojisMode;
|
|
17767
17761
|
}
|
|
17768
17762
|
function useLazyLoadEmojisConfig() {
|
|
17769
|
-
var
|
|
17770
|
-
lazyLoadEmojis =
|
|
17763
|
+
var _usePickerConfig11 = usePickerConfig(),
|
|
17764
|
+
lazyLoadEmojis = _usePickerConfig11.lazyLoadEmojis;
|
|
17771
17765
|
return lazyLoadEmojis;
|
|
17772
17766
|
}
|
|
17773
17767
|
function useClassNameConfig() {
|
|
17774
|
-
var
|
|
17775
|
-
className =
|
|
17768
|
+
var _usePickerConfig12 = usePickerConfig(),
|
|
17769
|
+
className = _usePickerConfig12.className;
|
|
17776
17770
|
return className;
|
|
17777
17771
|
}
|
|
17778
17772
|
function useStyleConfig() {
|
|
17779
|
-
var
|
|
17780
|
-
height =
|
|
17781
|
-
width =
|
|
17782
|
-
style =
|
|
17773
|
+
var _usePickerConfig13 = usePickerConfig(),
|
|
17774
|
+
height = _usePickerConfig13.height,
|
|
17775
|
+
width = _usePickerConfig13.width,
|
|
17776
|
+
style = _usePickerConfig13.style;
|
|
17783
17777
|
return _extends({
|
|
17784
17778
|
height: getDimension(height),
|
|
17785
17779
|
width: getDimension(width)
|
|
17786
17780
|
}, style);
|
|
17787
17781
|
}
|
|
17788
17782
|
function useReactionsOpenConfig() {
|
|
17789
|
-
var
|
|
17790
|
-
reactionsDefaultOpen =
|
|
17783
|
+
var _usePickerConfig14 = usePickerConfig(),
|
|
17784
|
+
reactionsDefaultOpen = _usePickerConfig14.reactionsDefaultOpen;
|
|
17791
17785
|
return reactionsDefaultOpen;
|
|
17792
17786
|
}
|
|
17793
17787
|
function useEmojiVersionConfig() {
|
|
17794
|
-
var
|
|
17795
|
-
emojiVersion =
|
|
17788
|
+
var _usePickerConfig15 = usePickerConfig(),
|
|
17789
|
+
emojiVersion = _usePickerConfig15.emojiVersion;
|
|
17796
17790
|
return emojiVersion;
|
|
17797
17791
|
}
|
|
17798
17792
|
function useSearchDisabledConfig() {
|
|
17799
|
-
var
|
|
17800
|
-
searchDisabled =
|
|
17793
|
+
var _usePickerConfig16 = usePickerConfig(),
|
|
17794
|
+
searchDisabled = _usePickerConfig16.searchDisabled;
|
|
17801
17795
|
return searchDisabled;
|
|
17802
17796
|
}
|
|
17803
17797
|
function useSkinTonePickerLocationConfig() {
|
|
17804
|
-
var
|
|
17805
|
-
skinTonePickerLocation =
|
|
17798
|
+
var _usePickerConfig17 = usePickerConfig(),
|
|
17799
|
+
skinTonePickerLocation = _usePickerConfig17.skinTonePickerLocation;
|
|
17806
17800
|
return skinTonePickerLocation;
|
|
17807
17801
|
}
|
|
17808
17802
|
function useUnicodeToHide() {
|
|
17809
|
-
var
|
|
17810
|
-
unicodeToHide =
|
|
17803
|
+
var _usePickerConfig18 = usePickerConfig(),
|
|
17804
|
+
unicodeToHide = _usePickerConfig18.unicodeToHide;
|
|
17811
17805
|
return unicodeToHide;
|
|
17812
17806
|
}
|
|
17813
17807
|
function useReactionsConfig() {
|
|
17814
|
-
var
|
|
17815
|
-
reactions =
|
|
17808
|
+
var _usePickerConfig19 = usePickerConfig(),
|
|
17809
|
+
reactions = _usePickerConfig19.reactions;
|
|
17816
17810
|
return reactions;
|
|
17817
17811
|
}
|
|
17818
17812
|
function useGetEmojiUrlConfig() {
|
|
17819
|
-
var
|
|
17820
|
-
getEmojiUrl =
|
|
17813
|
+
var _usePickerConfig20 = usePickerConfig(),
|
|
17814
|
+
getEmojiUrl = _usePickerConfig20.getEmojiUrl;
|
|
17821
17815
|
return getEmojiUrl;
|
|
17822
17816
|
}
|
|
17823
17817
|
function getDimension(dimensionConfig) {
|
|
@@ -19612,7 +19606,7 @@ function BtnPlus() {
|
|
|
19612
19606
|
}
|
|
19613
19607
|
});
|
|
19614
19608
|
}
|
|
19615
|
-
var styles$5 = /*#__PURE__*/stylesheet.create(
|
|
19609
|
+
var styles$5 = /*#__PURE__*/stylesheet.create(/*#__PURE__*/_extends({
|
|
19616
19610
|
plusSign: {
|
|
19617
19611
|
fontSize: '20px',
|
|
19618
19612
|
padding: '17px',
|
|
@@ -19759,7 +19753,7 @@ function getEmojiPositionStyle(dimensions, index) {
|
|
|
19759
19753
|
} : undefined;
|
|
19760
19754
|
}
|
|
19761
19755
|
|
|
19762
|
-
var EMOJI_SIZE_DEFAULT =
|
|
19756
|
+
var EMOJI_SIZE_DEFAULT = 40;
|
|
19763
19757
|
function useCategoryHeight(emojiCount) {
|
|
19764
19758
|
var EmojiListRef = useEmojiListRef();
|
|
19765
19759
|
var _useReactionsModeStat = useReactionsModeState(),
|
|
@@ -19768,18 +19762,21 @@ function useCategoryHeight(emojiCount) {
|
|
|
19768
19762
|
var emojiSizeRef = useRef();
|
|
19769
19763
|
var _useVisibleCategories = useVisibleCategoriesState(),
|
|
19770
19764
|
visibleCategories = _useVisibleCategories[0];
|
|
19765
|
+
var _useEmojiSizeState = useEmojiSizeState(),
|
|
19766
|
+
emojiSizeFromContext = _useEmojiSizeState[0];
|
|
19771
19767
|
var _React$useState = useState(),
|
|
19772
19768
|
dimensions = _React$useState[0],
|
|
19773
19769
|
setDimensions = _React$useState[1];
|
|
19774
19770
|
// Helper to compute and store dimensions based on current DOM
|
|
19775
19771
|
var computeAndSetDimensions = useCallback(function () {
|
|
19776
|
-
var _ref;
|
|
19777
19772
|
var listEl = EmojiListRef.current;
|
|
19778
19773
|
if (!listEl) return;
|
|
19779
19774
|
var emojiElement = listEl.querySelector(EmojiButtonSelector);
|
|
19780
19775
|
var measured = emojiElement == null ? void 0 : emojiElement.clientHeight;
|
|
19781
|
-
|
|
19782
|
-
|
|
19776
|
+
if (measured) {
|
|
19777
|
+
emojiSizeRef.current = measured;
|
|
19778
|
+
}
|
|
19779
|
+
var emojiSize = emojiSizeFromContext || measured || emojiSizeRef.current || EMOJI_SIZE_DEFAULT;
|
|
19783
19780
|
var pickerWidth = listEl.clientWidth;
|
|
19784
19781
|
if (pickerWidth === 0 || emojiSize === 0) return;
|
|
19785
19782
|
var emojisPerRow = Math.max(1, Math.floor(pickerWidth / emojiSize));
|
|
@@ -19790,7 +19787,7 @@ function useCategoryHeight(emojiCount) {
|
|
|
19790
19787
|
emojisPerRow: emojisPerRow,
|
|
19791
19788
|
emojiSize: emojiSize
|
|
19792
19789
|
});
|
|
19793
|
-
}, [EmojiListRef, emojiCount]);
|
|
19790
|
+
}, [EmojiListRef, emojiCount, emojiSizeFromContext]);
|
|
19794
19791
|
// Recompute on data-count changes and when reactions mode toggles
|
|
19795
19792
|
useEffect(function () {
|
|
19796
19793
|
computeAndSetDimensions();
|
|
@@ -19870,17 +19867,20 @@ function useEmojiVirtualization(_ref) {
|
|
|
19870
19867
|
onHeightReady(dimensions.categoryHeight);
|
|
19871
19868
|
}
|
|
19872
19869
|
}, [dimensions, onHeightReady, emojisToPush.length]);
|
|
19873
|
-
var
|
|
19870
|
+
var isVirtualized = function isVirtualized(style) {
|
|
19874
19871
|
var _BodyRef$current$clie, _BodyRef$current;
|
|
19875
|
-
|
|
19876
|
-
var style = getEmojiPositionStyle(dimensions, index);
|
|
19877
|
-
if (dimensions && BodyRef.current && shouldVirtualize({
|
|
19872
|
+
return dimensions && BodyRef.current && shouldVirtualize({
|
|
19878
19873
|
scrollTop: scrollTop,
|
|
19879
19874
|
clientHeight: (_BodyRef$current$clie = (_BodyRef$current = BodyRef.current) == null ? void 0 : _BodyRef$current.clientHeight) != null ? _BodyRef$current$clie : 0,
|
|
19880
19875
|
topOffset: topOffset,
|
|
19881
19876
|
style: style,
|
|
19882
19877
|
dimensions: dimensions
|
|
19883
|
-
})
|
|
19878
|
+
});
|
|
19879
|
+
};
|
|
19880
|
+
var emojis = emojisToPush.reduce(function (accumulator, emoji, index) {
|
|
19881
|
+
var unified = emojiUnified(emoji, activeSkinTone);
|
|
19882
|
+
var style = getEmojiPositionStyle(dimensions, index);
|
|
19883
|
+
if (isVirtualized(style)) {
|
|
19884
19884
|
var _BodyRef$current$clie2, _BodyRef$current2;
|
|
19885
19885
|
virtualizedCounter++;
|
|
19886
19886
|
preloadEmojiIfNeeded(emoji, emojiStyle, scrollTop, (_BodyRef$current$clie2 = (_BodyRef$current2 = BodyRef.current) == null ? void 0 : _BodyRef$current2.clientHeight) != null ? _BodyRef$current$clie2 : 0, topOffset, style, dimensions, getEmojiUrl);
|
|
@@ -19935,6 +19935,7 @@ function EmojiCategory(_ref) {
|
|
|
19935
19935
|
var styles$7 = /*#__PURE__*/stylesheet.create({
|
|
19936
19936
|
category: {
|
|
19937
19937
|
'.': ClassNames.category,
|
|
19938
|
+
minHeight: 'calc(var(--epr-emoji-fullsize) + var(--epr-category-label-height))',
|
|
19938
19939
|
position: 'relative'
|
|
19939
19940
|
},
|
|
19940
19941
|
categoryContent: {
|
|
@@ -19967,6 +19968,55 @@ var styles$7 = /*#__PURE__*/stylesheet.create({
|
|
|
19967
19968
|
}
|
|
19968
19969
|
});
|
|
19969
19970
|
|
|
19971
|
+
function MeasureEmoji() {
|
|
19972
|
+
var categories = useCategoriesConfig();
|
|
19973
|
+
var getEmojisByCategory = useGetEmojisByCategory();
|
|
19974
|
+
var emojiStyle = useEmojiStyleConfig();
|
|
19975
|
+
var getEmojiUrl = useGetEmojiUrlConfig();
|
|
19976
|
+
var lazyLoadEmojis = useLazyLoadEmojisConfig();
|
|
19977
|
+
var _useActiveSkinToneSta = useActiveSkinToneState(),
|
|
19978
|
+
activeSkinTone = _useActiveSkinToneSta[0];
|
|
19979
|
+
var _useEmojiSizeState = useEmojiSizeState(),
|
|
19980
|
+
emojiSize = _useEmojiSizeState[0],
|
|
19981
|
+
setEmojiSize = _useEmojiSizeState[1];
|
|
19982
|
+
var ref = useRef(null);
|
|
19983
|
+
useLayoutEffect(function () {
|
|
19984
|
+
if (ref.current) {
|
|
19985
|
+
setEmojiSize(ref.current.clientHeight);
|
|
19986
|
+
}
|
|
19987
|
+
});
|
|
19988
|
+
if (emojiSize) {
|
|
19989
|
+
return null;
|
|
19990
|
+
}
|
|
19991
|
+
var firstCategory = categories[0];
|
|
19992
|
+
var dummyEmoji = getEmojisByCategory(categoryFromCategoryConfig(firstCategory))[0];
|
|
19993
|
+
var unified = dummyEmoji ? emojiUnified(dummyEmoji, activeSkinTone) : '';
|
|
19994
|
+
if (!dummyEmoji) {
|
|
19995
|
+
return null;
|
|
19996
|
+
}
|
|
19997
|
+
return createElement("div", {
|
|
19998
|
+
ref: ref
|
|
19999
|
+
}, createElement(ClickableEmoji, {
|
|
20000
|
+
emoji: dummyEmoji,
|
|
20001
|
+
unified: unified,
|
|
20002
|
+
emojiStyle: emojiStyle,
|
|
20003
|
+
getEmojiUrl: getEmojiUrl,
|
|
20004
|
+
lazyLoad: lazyLoadEmojis,
|
|
20005
|
+
showVariations: false,
|
|
20006
|
+
hidden: false,
|
|
20007
|
+
style: {
|
|
20008
|
+
opacity: 0,
|
|
20009
|
+
pointerEvents: 'none',
|
|
20010
|
+
position: 'absolute',
|
|
20011
|
+
top: 0,
|
|
20012
|
+
left: 0,
|
|
20013
|
+
zIndex: -1,
|
|
20014
|
+
height: 'var(--epr-emoji-fullsize)',
|
|
20015
|
+
width: 'var(--epr-emoji-fullsize)'
|
|
20016
|
+
}
|
|
20017
|
+
}));
|
|
20018
|
+
}
|
|
20019
|
+
|
|
19970
20020
|
function EmojiList(_ref) {
|
|
19971
20021
|
var scrollTop = _ref.scrollTop;
|
|
19972
20022
|
var categories = useCategoriesConfig();
|
|
@@ -19980,7 +20030,7 @@ function EmojiList(_ref) {
|
|
|
19980
20030
|
return createElement("ul", {
|
|
19981
20031
|
className: cx(styles$8.emojiList),
|
|
19982
20032
|
ref: EmojiListRef
|
|
19983
|
-
}, categories.map(function (categoryConfig) {
|
|
20033
|
+
}, createElement(MeasureEmoji, null), categories.map(function (categoryConfig) {
|
|
19984
20034
|
var category = categoryFromCategoryConfig(categoryConfig);
|
|
19985
20035
|
var currentOffset = topOffset;
|
|
19986
20036
|
var categoryHeight = categoryHeights[category];
|
|
@@ -20147,7 +20197,7 @@ function useVariationPickerTop(VariationPickerRef) {
|
|
|
20147
20197
|
return emojiOffsetTop - height;
|
|
20148
20198
|
}
|
|
20149
20199
|
}
|
|
20150
|
-
var styles$9 = /*#__PURE__*/stylesheet.create(
|
|
20200
|
+
var styles$9 = /*#__PURE__*/stylesheet.create(/*#__PURE__*/_extends({
|
|
20151
20201
|
variationPicker: {
|
|
20152
20202
|
'.': ClassNames.variationPicker,
|
|
20153
20203
|
position: 'absolute',
|
|
@@ -20759,7 +20809,7 @@ var DarkInactivePosition = {
|
|
|
20759
20809
|
}
|
|
20760
20810
|
}
|
|
20761
20811
|
};
|
|
20762
|
-
var styles$f = /*#__PURE__*/stylesheet.create(
|
|
20812
|
+
var styles$f = /*#__PURE__*/stylesheet.create(/*#__PURE__*/_extends({
|
|
20763
20813
|
catBtn: {
|
|
20764
20814
|
'.': 'epr-cat-btn',
|
|
20765
20815
|
display: 'inline-block',
|
|
@@ -20904,7 +20954,7 @@ var HoverDark = {
|
|
|
20904
20954
|
}
|
|
20905
20955
|
}
|
|
20906
20956
|
};
|
|
20907
|
-
var styles$h = /*#__PURE__*/stylesheet.create(
|
|
20957
|
+
var styles$h = /*#__PURE__*/stylesheet.create(/*#__PURE__*/_extends({
|
|
20908
20958
|
btnClearSearch: {
|
|
20909
20959
|
'.': 'epr-btn-clear-search',
|
|
20910
20960
|
position: 'absolute',
|
|
@@ -20951,7 +21001,7 @@ function IcnSearch() {
|
|
|
20951
21001
|
className: cx(styles$i.icnSearch)
|
|
20952
21002
|
});
|
|
20953
21003
|
}
|
|
20954
|
-
var styles$i = /*#__PURE__*/stylesheet.create(
|
|
21004
|
+
var styles$i = /*#__PURE__*/stylesheet.create(/*#__PURE__*/_extends({
|
|
20955
21005
|
icnSearch: {
|
|
20956
21006
|
'.': 'epr-icn-search',
|
|
20957
21007
|
content: '',
|
|
@@ -21015,7 +21065,7 @@ function Search() {
|
|
|
21015
21065
|
"aria-atomic": "true"
|
|
21016
21066
|
}, statusSearchResults) : null, createElement(IcnSearch, null), createElement(BtnClearSearch, null));
|
|
21017
21067
|
}
|
|
21018
|
-
var styles$j = /*#__PURE__*/stylesheet.create(
|
|
21068
|
+
var styles$j = /*#__PURE__*/stylesheet.create(/*#__PURE__*/_extends({
|
|
21019
21069
|
overlay: {
|
|
21020
21070
|
padding: 'var(--epr-header-padding)',
|
|
21021
21071
|
zIndex: 'var(--epr-header-overlay-z-index)'
|