emoji-picker-react 4.6.15 → 4.7.1
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 +60 -30
- package/dist/components/Reactions/BtnPlus.d.ts +2 -0
- package/dist/components/Reactions/DEFAULT_REACTIONS.d.ts +1 -0
- package/dist/components/Reactions/Reactions.d.ts +2 -0
- package/dist/components/context/ElementRefContext.d.ts +1 -0
- package/dist/components/context/PickerContext.d.ts +1 -0
- package/dist/components/emoji/ClickableEmojiButton.d.ts +2 -1
- package/dist/components/emoji/Emoji.d.ts +2 -1
- package/dist/config/config.d.ts +5 -1
- package/dist/config/mutableConfig.d.ts +3 -2
- package/dist/config/useConfig.d.ts +7 -1
- package/dist/emoji-picker-react.cjs.development.js +956 -741
- 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 +957 -742
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/hooks/useMouseDownHandlers.d.ts +2 -1
- package/package.json +5 -2
- package/src/EmojiPickerReact.tsx +28 -3
- package/src/Stylesheet/stylesheet.tsx +14 -2
- package/src/components/Reactions/BtnPlus.tsx +78 -0
- package/src/components/Reactions/DEFAULT_REACTIONS.ts +9 -0
- package/src/components/Reactions/Reactions.tsx +63 -0
- package/src/components/Reactions/svg/plus.svg +17 -0
- package/src/components/body/Body.tsx +10 -3
- package/src/components/context/ElementRefContext.tsx +10 -2
- package/src/components/context/PickerContext.tsx +16 -3
- package/src/components/emoji/ClickableEmojiButton.tsx +8 -2
- package/src/components/emoji/Emoji.tsx +4 -1
- package/src/components/footer/Preview.tsx +7 -2
- package/src/components/header/Header.tsx +5 -1
- package/src/components/main/PickerMain.tsx +27 -2
- package/src/config/config.ts +11 -3
- package/src/config/mutableConfig.ts +5 -3
- package/src/config/useConfig.ts +31 -8
- package/src/hooks/useMouseDownHandlers.ts +13 -11
- package/src/index.tsx +2 -1
|
@@ -8,38 +8,6 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var flairup = require('flairup');
|
|
10
10
|
|
|
11
|
-
var ClassNames;
|
|
12
|
-
(function (ClassNames) {
|
|
13
|
-
ClassNames["hiddenOnSearch"] = "epr-hidden-on-search";
|
|
14
|
-
ClassNames["searchActive"] = "epr-search-active";
|
|
15
|
-
ClassNames["hidden"] = "epr-hidden";
|
|
16
|
-
ClassNames["visible"] = "epr-visible";
|
|
17
|
-
ClassNames["active"] = "epr-active";
|
|
18
|
-
ClassNames["emoji"] = "epr-emoji";
|
|
19
|
-
ClassNames["category"] = "epr-emoji-category";
|
|
20
|
-
ClassNames["label"] = "epr-emoji-category-label";
|
|
21
|
-
ClassNames["categoryContent"] = "epr-emoji-category-content";
|
|
22
|
-
ClassNames["emojiHasVariations"] = "epr-emoji-has-variations";
|
|
23
|
-
ClassNames["scrollBody"] = "epr-body";
|
|
24
|
-
ClassNames["emojiList"] = "epr-emoji-list";
|
|
25
|
-
ClassNames["external"] = "__EmojiPicker__";
|
|
26
|
-
ClassNames["emojiPicker"] = "EmojiPickerReact";
|
|
27
|
-
ClassNames["open"] = "epr-open";
|
|
28
|
-
ClassNames["vertical"] = "epr-vertical";
|
|
29
|
-
ClassNames["horizontal"] = "epr-horizontal";
|
|
30
|
-
ClassNames["variationPicker"] = "epr-emoji-variation-picker";
|
|
31
|
-
ClassNames["darkTheme"] = "epr-dark-theme";
|
|
32
|
-
ClassNames["autoTheme"] = "epr-auto-theme";
|
|
33
|
-
})(ClassNames || (ClassNames = {}));
|
|
34
|
-
function asSelectors() {
|
|
35
|
-
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
-
classNames[_key] = arguments[_key];
|
|
37
|
-
}
|
|
38
|
-
return classNames.map(function (c) {
|
|
39
|
-
return "." + c;
|
|
40
|
-
}).join('');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
11
|
function _extends() {
|
|
44
12
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
45
13
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -110,6 +78,38 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
110
78
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
111
79
|
}
|
|
112
80
|
|
|
81
|
+
var ClassNames;
|
|
82
|
+
(function (ClassNames) {
|
|
83
|
+
ClassNames["hiddenOnSearch"] = "epr-hidden-on-search";
|
|
84
|
+
ClassNames["searchActive"] = "epr-search-active";
|
|
85
|
+
ClassNames["hidden"] = "epr-hidden";
|
|
86
|
+
ClassNames["visible"] = "epr-visible";
|
|
87
|
+
ClassNames["active"] = "epr-active";
|
|
88
|
+
ClassNames["emoji"] = "epr-emoji";
|
|
89
|
+
ClassNames["category"] = "epr-emoji-category";
|
|
90
|
+
ClassNames["label"] = "epr-emoji-category-label";
|
|
91
|
+
ClassNames["categoryContent"] = "epr-emoji-category-content";
|
|
92
|
+
ClassNames["emojiHasVariations"] = "epr-emoji-has-variations";
|
|
93
|
+
ClassNames["scrollBody"] = "epr-body";
|
|
94
|
+
ClassNames["emojiList"] = "epr-emoji-list";
|
|
95
|
+
ClassNames["external"] = "__EmojiPicker__";
|
|
96
|
+
ClassNames["emojiPicker"] = "EmojiPickerReact";
|
|
97
|
+
ClassNames["open"] = "epr-open";
|
|
98
|
+
ClassNames["vertical"] = "epr-vertical";
|
|
99
|
+
ClassNames["horizontal"] = "epr-horizontal";
|
|
100
|
+
ClassNames["variationPicker"] = "epr-emoji-variation-picker";
|
|
101
|
+
ClassNames["darkTheme"] = "epr-dark-theme";
|
|
102
|
+
ClassNames["autoTheme"] = "epr-auto-theme";
|
|
103
|
+
})(ClassNames || (ClassNames = {}));
|
|
104
|
+
function asSelectors() {
|
|
105
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
106
|
+
classNames[_key] = arguments[_key];
|
|
107
|
+
}
|
|
108
|
+
return classNames.map(function (c) {
|
|
109
|
+
return "." + c;
|
|
110
|
+
}).join('');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
113
|
function useIsMounted() {
|
|
114
114
|
var _React$useState = React.useState(false),
|
|
115
115
|
isMounted = _React$useState[0],
|
|
@@ -125,7 +125,8 @@ var hidden = {
|
|
|
125
125
|
display: 'none',
|
|
126
126
|
opacity: '0',
|
|
127
127
|
pointerEvents: 'none',
|
|
128
|
-
visibility: 'hidden'
|
|
128
|
+
visibility: 'hidden',
|
|
129
|
+
overflow: 'hidden'
|
|
129
130
|
};
|
|
130
131
|
var commonStyles = /*#__PURE__*/stylesheet.create({
|
|
131
132
|
hidden: /*#__PURE__*/_extends({
|
|
@@ -161,6 +162,18 @@ var commonInteractionStyles = /*#__PURE__*/stylesheet.create({
|
|
|
161
162
|
visibleOnSearchOnly: hidden
|
|
162
163
|
}
|
|
163
164
|
},
|
|
165
|
+
hiddenOnReactions: {
|
|
166
|
+
transition: 'all 0.5s ease-in-out'
|
|
167
|
+
},
|
|
168
|
+
'.epr-reactions': {
|
|
169
|
+
hiddenOnReactions: {
|
|
170
|
+
height: '0px',
|
|
171
|
+
width: '0px',
|
|
172
|
+
opacity: '0',
|
|
173
|
+
pointerEvents: 'none',
|
|
174
|
+
overflow: 'hidden'
|
|
175
|
+
}
|
|
176
|
+
},
|
|
164
177
|
'.EmojiPickerReact:not(.epr-search-active)': {
|
|
165
178
|
categoryBtn: {
|
|
166
179
|
':hover': {
|
|
@@ -179,93 +192,8 @@ var commonInteractionStyles = /*#__PURE__*/stylesheet.create({
|
|
|
179
192
|
}
|
|
180
193
|
});
|
|
181
194
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
requestAnimationFrame(function () {
|
|
187
|
-
element.focus();
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
function focusPrevElementSibling(element) {
|
|
191
|
-
if (!element) return;
|
|
192
|
-
var prev = element.previousElementSibling;
|
|
193
|
-
focusElement(prev);
|
|
194
|
-
}
|
|
195
|
-
function focusNextElementSibling(element) {
|
|
196
|
-
if (!element) return;
|
|
197
|
-
var next = element.nextElementSibling;
|
|
198
|
-
focusElement(next);
|
|
199
|
-
}
|
|
200
|
-
function focusFirstElementChild(element) {
|
|
201
|
-
if (!element) return;
|
|
202
|
-
var first = element.firstElementChild;
|
|
203
|
-
focusElement(first);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function ElementRefContextProvider(_ref) {
|
|
207
|
-
var children = _ref.children;
|
|
208
|
-
var PickerMainRef = React.useRef(null);
|
|
209
|
-
var AnchoredEmojiRef = React.useRef(null);
|
|
210
|
-
var BodyRef = React.useRef(null);
|
|
211
|
-
var SearchInputRef = React.useRef(null);
|
|
212
|
-
var SkinTonePickerRef = React.useRef(null);
|
|
213
|
-
var CategoryNavigationRef = React.useRef(null);
|
|
214
|
-
var VariationPickerRef = React.useRef(null);
|
|
215
|
-
return React.createElement(ElementRefContext.Provider, {
|
|
216
|
-
value: {
|
|
217
|
-
AnchoredEmojiRef: AnchoredEmojiRef,
|
|
218
|
-
BodyRef: BodyRef,
|
|
219
|
-
CategoryNavigationRef: CategoryNavigationRef,
|
|
220
|
-
PickerMainRef: PickerMainRef,
|
|
221
|
-
SearchInputRef: SearchInputRef,
|
|
222
|
-
SkinTonePickerRef: SkinTonePickerRef,
|
|
223
|
-
VariationPickerRef: VariationPickerRef
|
|
224
|
-
}
|
|
225
|
-
}, children);
|
|
226
|
-
}
|
|
227
|
-
var ElementRefContext = /*#__PURE__*/React.createContext({
|
|
228
|
-
AnchoredEmojiRef: /*#__PURE__*/React.createRef(),
|
|
229
|
-
BodyRef: /*#__PURE__*/React.createRef(),
|
|
230
|
-
CategoryNavigationRef: /*#__PURE__*/React.createRef(),
|
|
231
|
-
PickerMainRef: /*#__PURE__*/React.createRef(),
|
|
232
|
-
SearchInputRef: /*#__PURE__*/React.createRef(),
|
|
233
|
-
SkinTonePickerRef: /*#__PURE__*/React.createRef(),
|
|
234
|
-
VariationPickerRef: /*#__PURE__*/React.createRef()
|
|
235
|
-
});
|
|
236
|
-
function useElementRef() {
|
|
237
|
-
return React.useContext(ElementRefContext);
|
|
238
|
-
}
|
|
239
|
-
function usePickerMainRef() {
|
|
240
|
-
return useElementRef()['PickerMainRef'];
|
|
241
|
-
}
|
|
242
|
-
function useAnchoredEmojiRef() {
|
|
243
|
-
return useElementRef()['AnchoredEmojiRef'];
|
|
244
|
-
}
|
|
245
|
-
function useSetAnchoredEmojiRef() {
|
|
246
|
-
var AnchoredEmojiRef = useAnchoredEmojiRef();
|
|
247
|
-
return function (target) {
|
|
248
|
-
if (target === null && AnchoredEmojiRef.current !== null) {
|
|
249
|
-
focusElement(AnchoredEmojiRef.current);
|
|
250
|
-
}
|
|
251
|
-
AnchoredEmojiRef.current = target;
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
function useBodyRef() {
|
|
255
|
-
return useElementRef()['BodyRef'];
|
|
256
|
-
}
|
|
257
|
-
function useSearchInputRef() {
|
|
258
|
-
return useElementRef()['SearchInputRef'];
|
|
259
|
-
}
|
|
260
|
-
function useSkinTonePickerRef() {
|
|
261
|
-
return useElementRef()['SkinTonePickerRef'];
|
|
262
|
-
}
|
|
263
|
-
function useCategoryNavigationRef() {
|
|
264
|
-
return useElementRef()['CategoryNavigationRef'];
|
|
265
|
-
}
|
|
266
|
-
function useVariationPickerRef() {
|
|
267
|
-
return useElementRef()['VariationPickerRef'];
|
|
268
|
-
}
|
|
195
|
+
var DEFAULT_REACTIONS = ['1f44d', '2764-fe0f', '1f603', '1f622', '1f64f', '1f44e', '1f621' // 😡
|
|
196
|
+
];
|
|
269
197
|
|
|
270
198
|
(function (SuggestionMode) {
|
|
271
199
|
SuggestionMode["RECENT"] = "recent";
|
|
@@ -16910,7 +16838,9 @@ function basePickerConfig() {
|
|
|
16910
16838
|
suggestedEmojisMode: exports.SuggestionMode.FREQUENT,
|
|
16911
16839
|
theme: exports.Theme.LIGHT,
|
|
16912
16840
|
unicodeToHide: new Set(KNOWN_FAILING_EMOJIS),
|
|
16913
|
-
width: 350
|
|
16841
|
+
width: 350,
|
|
16842
|
+
reactionsDefaultOpen: false,
|
|
16843
|
+
reactions: DEFAULT_REACTIONS
|
|
16914
16844
|
};
|
|
16915
16845
|
}
|
|
16916
16846
|
var basePreviewConfig = {
|
|
@@ -16957,7 +16887,8 @@ function useMutableConfig() {
|
|
|
16957
16887
|
}
|
|
16958
16888
|
function useDefineMutableConfig(config) {
|
|
16959
16889
|
var MutableConfigRef = React__default.useRef({
|
|
16960
|
-
onEmojiClick: config.onEmojiClick || emptyFunc
|
|
16890
|
+
onEmojiClick: config.onEmojiClick || emptyFunc,
|
|
16891
|
+
onReactionClick: config.onReactionClick || config.onEmojiClick
|
|
16961
16892
|
});
|
|
16962
16893
|
React__default.useEffect(function () {
|
|
16963
16894
|
MutableConfigRef.current.onEmojiClick = config.onEmojiClick || emptyFunc;
|
|
@@ -16966,6 +16897,11 @@ function useDefineMutableConfig(config) {
|
|
|
16966
16897
|
}
|
|
16967
16898
|
function emptyFunc() {}
|
|
16968
16899
|
|
|
16900
|
+
var MOUSE_EVENT_SOURCE;
|
|
16901
|
+
(function (MOUSE_EVENT_SOURCE) {
|
|
16902
|
+
MOUSE_EVENT_SOURCE["REACTIONS"] = "reactions";
|
|
16903
|
+
MOUSE_EVENT_SOURCE["PICKER"] = "picker";
|
|
16904
|
+
})(MOUSE_EVENT_SOURCE || (MOUSE_EVENT_SOURCE = {}));
|
|
16969
16905
|
function useSearchPlaceHolderConfig() {
|
|
16970
16906
|
var _find;
|
|
16971
16907
|
var _usePickerConfig = usePickerConfig(),
|
|
@@ -17005,10 +16941,12 @@ function useCustomEmojisConfig() {
|
|
|
17005
16941
|
customEmojis = _usePickerConfig7.customEmojis;
|
|
17006
16942
|
return customEmojis;
|
|
17007
16943
|
}
|
|
17008
|
-
function useOnEmojiClickConfig() {
|
|
16944
|
+
function useOnEmojiClickConfig(mouseEventSource) {
|
|
16945
|
+
var _ref;
|
|
17009
16946
|
var _useMutableConfig = useMutableConfig(),
|
|
17010
16947
|
current = _useMutableConfig.current;
|
|
17011
|
-
|
|
16948
|
+
var handler = (_ref = mouseEventSource === MOUSE_EVENT_SOURCE.REACTIONS ? current.onReactionClick : current.onEmojiClick) != null ? _ref : current.onEmojiClick;
|
|
16949
|
+
return handler || function () {};
|
|
17012
16950
|
}
|
|
17013
16951
|
function usePreviewConfig() {
|
|
17014
16952
|
var _usePickerConfig8 = usePickerConfig(),
|
|
@@ -17045,29 +16983,39 @@ function useStyleConfig() {
|
|
|
17045
16983
|
width: getDimension(width)
|
|
17046
16984
|
}, style);
|
|
17047
16985
|
}
|
|
17048
|
-
function
|
|
16986
|
+
function useReactionsOpenConfig() {
|
|
17049
16987
|
var _usePickerConfig14 = usePickerConfig(),
|
|
17050
|
-
|
|
16988
|
+
reactionsDefaultOpen = _usePickerConfig14.reactionsDefaultOpen;
|
|
16989
|
+
return reactionsDefaultOpen;
|
|
16990
|
+
}
|
|
16991
|
+
function useEmojiVersionConfig() {
|
|
16992
|
+
var _usePickerConfig15 = usePickerConfig(),
|
|
16993
|
+
emojiVersion = _usePickerConfig15.emojiVersion;
|
|
17051
16994
|
return emojiVersion;
|
|
17052
16995
|
}
|
|
17053
16996
|
function useSearchDisabledConfig() {
|
|
17054
|
-
var
|
|
17055
|
-
searchDisabled =
|
|
16997
|
+
var _usePickerConfig16 = usePickerConfig(),
|
|
16998
|
+
searchDisabled = _usePickerConfig16.searchDisabled;
|
|
17056
16999
|
return searchDisabled;
|
|
17057
17000
|
}
|
|
17058
17001
|
function useSkinTonePickerLocationConfig() {
|
|
17059
|
-
var
|
|
17060
|
-
skinTonePickerLocation =
|
|
17002
|
+
var _usePickerConfig17 = usePickerConfig(),
|
|
17003
|
+
skinTonePickerLocation = _usePickerConfig17.skinTonePickerLocation;
|
|
17061
17004
|
return skinTonePickerLocation;
|
|
17062
17005
|
}
|
|
17063
17006
|
function useUnicodeToHide() {
|
|
17064
|
-
var
|
|
17065
|
-
unicodeToHide =
|
|
17007
|
+
var _usePickerConfig18 = usePickerConfig(),
|
|
17008
|
+
unicodeToHide = _usePickerConfig18.unicodeToHide;
|
|
17066
17009
|
return unicodeToHide;
|
|
17067
17010
|
}
|
|
17011
|
+
function useReactionsConfig() {
|
|
17012
|
+
var _usePickerConfig19 = usePickerConfig(),
|
|
17013
|
+
reactions = _usePickerConfig19.reactions;
|
|
17014
|
+
return reactions;
|
|
17015
|
+
}
|
|
17068
17016
|
function useGetEmojiUrlConfig() {
|
|
17069
|
-
var
|
|
17070
|
-
getEmojiUrl =
|
|
17017
|
+
var _usePickerConfig20 = usePickerConfig(),
|
|
17018
|
+
getEmojiUrl = _usePickerConfig20.getEmojiUrl;
|
|
17071
17019
|
return getEmojiUrl;
|
|
17072
17020
|
}
|
|
17073
17021
|
function getDimension(dimensionConfig) {
|
|
@@ -17082,270 +17030,50 @@ function useSearchResultsConfig(searchResultsCount) {
|
|
|
17082
17030
|
return SEARCH_RESULTS_NO_RESULTS_FOUND;
|
|
17083
17031
|
}
|
|
17084
17032
|
|
|
17085
|
-
function
|
|
17086
|
-
if (
|
|
17087
|
-
|
|
17088
|
-
}
|
|
17089
|
-
var _useState = React.useState(initialValue),
|
|
17090
|
-
state = _useState[0],
|
|
17091
|
-
setState = _useState[1];
|
|
17092
|
-
var timer = React.useRef(null);
|
|
17093
|
-
function debouncedSetState(value) {
|
|
17094
|
-
return new Promise(function (resolve) {
|
|
17095
|
-
var _window;
|
|
17096
|
-
if (timer.current) {
|
|
17097
|
-
clearTimeout(timer.current);
|
|
17098
|
-
}
|
|
17099
|
-
timer.current = (_window = window) == null ? void 0 : _window.setTimeout(function () {
|
|
17100
|
-
setState(value);
|
|
17101
|
-
resolve(value);
|
|
17102
|
-
}, delay);
|
|
17103
|
-
});
|
|
17033
|
+
function elementCountInRow(parent, element) {
|
|
17034
|
+
if (!parent || !element) {
|
|
17035
|
+
return 0;
|
|
17104
17036
|
}
|
|
17105
|
-
|
|
17037
|
+
var parentWidth = parent.getBoundingClientRect().width;
|
|
17038
|
+
var elementWidth = element.getBoundingClientRect().width;
|
|
17039
|
+
return Math.floor(parentWidth / elementWidth);
|
|
17106
17040
|
}
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17112
|
-
|
|
17041
|
+
function elementIndexInRow(parent, element) {
|
|
17042
|
+
if (!parent || !element) {
|
|
17043
|
+
return 0;
|
|
17044
|
+
}
|
|
17045
|
+
var elementWidth = element.getBoundingClientRect().width;
|
|
17046
|
+
var elementLeft = element.getBoundingClientRect().left;
|
|
17047
|
+
var parentLeft = parent.getBoundingClientRect().left;
|
|
17048
|
+
return Math.floor((elementLeft - parentLeft) / elementWidth);
|
|
17113
17049
|
}
|
|
17114
|
-
|
|
17115
|
-
|
|
17116
|
-
|
|
17117
|
-
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
}
|
|
17123
|
-
return allEmojis.reduce(function (disallowedEmojis, emoji) {
|
|
17124
|
-
if (addedInNewerVersion(emoji, emojiVersion)) {
|
|
17125
|
-
disallowedEmojis[emojiUnified(emoji)] = true;
|
|
17126
|
-
}
|
|
17127
|
-
return disallowedEmojis;
|
|
17128
|
-
}, DisallowedEmojisRef.current);
|
|
17129
|
-
}, [emojiVersionConfig]);
|
|
17050
|
+
function rowNumber(parent, element) {
|
|
17051
|
+
if (!parent || !element) {
|
|
17052
|
+
return 0;
|
|
17053
|
+
}
|
|
17054
|
+
var elementHeight = element.getBoundingClientRect().height;
|
|
17055
|
+
var elementTop = element.getBoundingClientRect().top;
|
|
17056
|
+
var parentTop = parent.getBoundingClientRect().top;
|
|
17057
|
+
return Math.round((elementTop - parentTop) / elementHeight);
|
|
17130
17058
|
}
|
|
17131
|
-
function
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17059
|
+
function hasNextRow(parent, element) {
|
|
17060
|
+
if (!parent || !element) {
|
|
17061
|
+
return false;
|
|
17062
|
+
}
|
|
17063
|
+
var elementHeight = element.getBoundingClientRect().height;
|
|
17064
|
+
var elementTop = element.getBoundingClientRect().top;
|
|
17065
|
+
var parentTop = parent.getBoundingClientRect().top;
|
|
17066
|
+
var parentHeight = parent.getBoundingClientRect().height;
|
|
17067
|
+
return Math.round(elementTop - parentTop + elementHeight) < parentHeight;
|
|
17138
17068
|
}
|
|
17139
|
-
function
|
|
17140
|
-
|
|
17141
|
-
|
|
17142
|
-
|
|
17143
|
-
|
|
17144
|
-
|
|
17145
|
-
|
|
17146
|
-
|
|
17147
|
-
}
|
|
17148
|
-
|
|
17149
|
-
function PickerContextProvider(_ref) {
|
|
17150
|
-
var children = _ref.children;
|
|
17151
|
-
var disallowedEmojis = useDisallowedEmojis();
|
|
17152
|
-
var defaultSkinTone = useDefaultSkinToneConfig();
|
|
17153
|
-
// Initialize the filter with the inititial dictionary
|
|
17154
|
-
var filterRef = React.useRef(alphaNumericEmojiIndex);
|
|
17155
|
-
var disallowClickRef = React.useRef(false);
|
|
17156
|
-
var disallowMouseRef = React.useRef(false);
|
|
17157
|
-
var disallowedEmojisRef = React.useRef(disallowedEmojis);
|
|
17158
|
-
var suggestedUpdateState = useDebouncedState(Date.now(), 200);
|
|
17159
|
-
var searchTerm = useDebouncedState('', 100);
|
|
17160
|
-
var skinToneFanOpenState = React.useState(false);
|
|
17161
|
-
var activeSkinTone = React.useState(defaultSkinTone);
|
|
17162
|
-
var activeCategoryState = React.useState(null);
|
|
17163
|
-
var emojisThatFailedToLoadState = React.useState(new Set());
|
|
17164
|
-
var emojiVariationPickerState = React.useState(null);
|
|
17165
|
-
var _useState = React.useState(false),
|
|
17166
|
-
isPastInitialLoad = _useState[0],
|
|
17167
|
-
setIsPastInitialLoad = _useState[1];
|
|
17168
|
-
useMarkInitialLoad(setIsPastInitialLoad);
|
|
17169
|
-
return React.createElement(PickerContext.Provider, {
|
|
17170
|
-
value: {
|
|
17171
|
-
activeCategoryState: activeCategoryState,
|
|
17172
|
-
activeSkinTone: activeSkinTone,
|
|
17173
|
-
disallowClickRef: disallowClickRef,
|
|
17174
|
-
disallowMouseRef: disallowMouseRef,
|
|
17175
|
-
disallowedEmojisRef: disallowedEmojisRef,
|
|
17176
|
-
emojiVariationPickerState: emojiVariationPickerState,
|
|
17177
|
-
emojisThatFailedToLoadState: emojisThatFailedToLoadState,
|
|
17178
|
-
filterRef: filterRef,
|
|
17179
|
-
isPastInitialLoad: isPastInitialLoad,
|
|
17180
|
-
searchTerm: searchTerm,
|
|
17181
|
-
skinToneFanOpenState: skinToneFanOpenState,
|
|
17182
|
-
suggestedUpdateState: suggestedUpdateState
|
|
17183
|
-
}
|
|
17184
|
-
}, children);
|
|
17185
|
-
}
|
|
17186
|
-
var PickerContext = /*#__PURE__*/React.createContext({
|
|
17187
|
-
activeCategoryState: [null, function () {}],
|
|
17188
|
-
activeSkinTone: [exports.SkinTones.NEUTRAL, function () {}],
|
|
17189
|
-
disallowClickRef: {
|
|
17190
|
-
current: false
|
|
17191
|
-
},
|
|
17192
|
-
disallowMouseRef: {
|
|
17193
|
-
current: false
|
|
17194
|
-
},
|
|
17195
|
-
disallowedEmojisRef: {
|
|
17196
|
-
current: {}
|
|
17197
|
-
},
|
|
17198
|
-
emojiVariationPickerState: [null, function () {}],
|
|
17199
|
-
emojisThatFailedToLoadState: [/*#__PURE__*/new Set(), function () {}],
|
|
17200
|
-
filterRef: {
|
|
17201
|
-
current: {}
|
|
17202
|
-
},
|
|
17203
|
-
isPastInitialLoad: true,
|
|
17204
|
-
searchTerm: ['', function () {
|
|
17205
|
-
return new Promise(function () {
|
|
17206
|
-
return undefined;
|
|
17207
|
-
});
|
|
17208
|
-
}],
|
|
17209
|
-
skinToneFanOpenState: [false, function () {}],
|
|
17210
|
-
suggestedUpdateState: [/*#__PURE__*/Date.now(), function () {}]
|
|
17211
|
-
});
|
|
17212
|
-
function useFilterRef() {
|
|
17213
|
-
var _React$useContext = React.useContext(PickerContext),
|
|
17214
|
-
filterRef = _React$useContext.filterRef;
|
|
17215
|
-
return filterRef;
|
|
17216
|
-
}
|
|
17217
|
-
function useDisallowClickRef() {
|
|
17218
|
-
var _React$useContext2 = React.useContext(PickerContext),
|
|
17219
|
-
disallowClickRef = _React$useContext2.disallowClickRef;
|
|
17220
|
-
return disallowClickRef;
|
|
17221
|
-
}
|
|
17222
|
-
function useDisallowMouseRef() {
|
|
17223
|
-
var _React$useContext3 = React.useContext(PickerContext),
|
|
17224
|
-
disallowMouseRef = _React$useContext3.disallowMouseRef;
|
|
17225
|
-
return disallowMouseRef;
|
|
17226
|
-
}
|
|
17227
|
-
function useSearchTermState() {
|
|
17228
|
-
var _React$useContext4 = React.useContext(PickerContext),
|
|
17229
|
-
searchTerm = _React$useContext4.searchTerm;
|
|
17230
|
-
return searchTerm;
|
|
17231
|
-
}
|
|
17232
|
-
function useActiveSkinToneState() {
|
|
17233
|
-
var _React$useContext5 = React.useContext(PickerContext),
|
|
17234
|
-
activeSkinTone = _React$useContext5.activeSkinTone;
|
|
17235
|
-
return activeSkinTone;
|
|
17236
|
-
}
|
|
17237
|
-
function useEmojisThatFailedToLoadState() {
|
|
17238
|
-
var _React$useContext6 = React.useContext(PickerContext),
|
|
17239
|
-
emojisThatFailedToLoadState = _React$useContext6.emojisThatFailedToLoadState;
|
|
17240
|
-
return emojisThatFailedToLoadState;
|
|
17241
|
-
}
|
|
17242
|
-
function useIsPastInitialLoad() {
|
|
17243
|
-
var _React$useContext7 = React.useContext(PickerContext),
|
|
17244
|
-
isPastInitialLoad = _React$useContext7.isPastInitialLoad;
|
|
17245
|
-
return isPastInitialLoad;
|
|
17246
|
-
}
|
|
17247
|
-
function useEmojiVariationPickerState() {
|
|
17248
|
-
var _React$useContext8 = React.useContext(PickerContext),
|
|
17249
|
-
emojiVariationPickerState = _React$useContext8.emojiVariationPickerState;
|
|
17250
|
-
return emojiVariationPickerState;
|
|
17251
|
-
}
|
|
17252
|
-
function useSkinToneFanOpenState() {
|
|
17253
|
-
var _React$useContext9 = React.useContext(PickerContext),
|
|
17254
|
-
skinToneFanOpenState = _React$useContext9.skinToneFanOpenState;
|
|
17255
|
-
return skinToneFanOpenState;
|
|
17256
|
-
}
|
|
17257
|
-
function useUpdateSuggested() {
|
|
17258
|
-
var _React$useContext11 = React.useContext(PickerContext),
|
|
17259
|
-
suggestedUpdateState = _React$useContext11.suggestedUpdateState;
|
|
17260
|
-
var suggestedUpdated = suggestedUpdateState[0],
|
|
17261
|
-
setsuggestedUpdate = suggestedUpdateState[1];
|
|
17262
|
-
return [suggestedUpdated, function updateSuggested() {
|
|
17263
|
-
setsuggestedUpdate(Date.now());
|
|
17264
|
-
}];
|
|
17265
|
-
}
|
|
17266
|
-
|
|
17267
|
-
function useDisallowMouseMove() {
|
|
17268
|
-
var DisallowMouseRef = useDisallowMouseRef();
|
|
17269
|
-
return function disallowMouseMove() {
|
|
17270
|
-
DisallowMouseRef.current = true;
|
|
17271
|
-
};
|
|
17272
|
-
}
|
|
17273
|
-
function useAllowMouseMove() {
|
|
17274
|
-
var DisallowMouseRef = useDisallowMouseRef();
|
|
17275
|
-
return function allowMouseMove() {
|
|
17276
|
-
DisallowMouseRef.current = false;
|
|
17277
|
-
};
|
|
17278
|
-
}
|
|
17279
|
-
function useIsMouseDisallowed() {
|
|
17280
|
-
var DisallowMouseRef = useDisallowMouseRef();
|
|
17281
|
-
return function isMouseDisallowed() {
|
|
17282
|
-
return DisallowMouseRef.current;
|
|
17283
|
-
};
|
|
17284
|
-
}
|
|
17285
|
-
function useOnMouseMove() {
|
|
17286
|
-
var BodyRef = useBodyRef();
|
|
17287
|
-
var allowMouseMove = useAllowMouseMove();
|
|
17288
|
-
var isMouseDisallowed = useIsMouseDisallowed();
|
|
17289
|
-
React.useEffect(function () {
|
|
17290
|
-
var bodyRef = BodyRef.current;
|
|
17291
|
-
bodyRef == null ? void 0 : bodyRef.addEventListener('mousemove', onMouseMove, {
|
|
17292
|
-
passive: true
|
|
17293
|
-
});
|
|
17294
|
-
function onMouseMove() {
|
|
17295
|
-
if (isMouseDisallowed()) {
|
|
17296
|
-
allowMouseMove();
|
|
17297
|
-
}
|
|
17298
|
-
}
|
|
17299
|
-
return function () {
|
|
17300
|
-
bodyRef == null ? void 0 : bodyRef.removeEventListener('mousemove', onMouseMove);
|
|
17301
|
-
};
|
|
17302
|
-
}, [BodyRef, allowMouseMove, isMouseDisallowed]);
|
|
17303
|
-
}
|
|
17304
|
-
|
|
17305
|
-
function elementCountInRow(parent, element) {
|
|
17306
|
-
if (!parent || !element) {
|
|
17307
|
-
return 0;
|
|
17308
|
-
}
|
|
17309
|
-
var parentWidth = parent.getBoundingClientRect().width;
|
|
17310
|
-
var elementWidth = element.getBoundingClientRect().width;
|
|
17311
|
-
return Math.floor(parentWidth / elementWidth);
|
|
17312
|
-
}
|
|
17313
|
-
function elementIndexInRow(parent, element) {
|
|
17314
|
-
if (!parent || !element) {
|
|
17315
|
-
return 0;
|
|
17316
|
-
}
|
|
17317
|
-
var elementWidth = element.getBoundingClientRect().width;
|
|
17318
|
-
var elementLeft = element.getBoundingClientRect().left;
|
|
17319
|
-
var parentLeft = parent.getBoundingClientRect().left;
|
|
17320
|
-
return Math.floor((elementLeft - parentLeft) / elementWidth);
|
|
17321
|
-
}
|
|
17322
|
-
function rowNumber(parent, element) {
|
|
17323
|
-
if (!parent || !element) {
|
|
17324
|
-
return 0;
|
|
17325
|
-
}
|
|
17326
|
-
var elementHeight = element.getBoundingClientRect().height;
|
|
17327
|
-
var elementTop = element.getBoundingClientRect().top;
|
|
17328
|
-
var parentTop = parent.getBoundingClientRect().top;
|
|
17329
|
-
return Math.round((elementTop - parentTop) / elementHeight);
|
|
17330
|
-
}
|
|
17331
|
-
function hasNextRow(parent, element) {
|
|
17332
|
-
if (!parent || !element) {
|
|
17333
|
-
return false;
|
|
17334
|
-
}
|
|
17335
|
-
var elementHeight = element.getBoundingClientRect().height;
|
|
17336
|
-
var elementTop = element.getBoundingClientRect().top;
|
|
17337
|
-
var parentTop = parent.getBoundingClientRect().top;
|
|
17338
|
-
var parentHeight = parent.getBoundingClientRect().height;
|
|
17339
|
-
return Math.round(elementTop - parentTop + elementHeight) < parentHeight;
|
|
17340
|
-
}
|
|
17341
|
-
function getRowElements(elements, row, elementsInRow) {
|
|
17342
|
-
if (row === -1) {
|
|
17343
|
-
var lastRow = Math.floor((elements.length - 1) / elementsInRow);
|
|
17344
|
-
var firstElementIndex = lastRow * elementsInRow;
|
|
17345
|
-
var lastElementIndex = elements.length - 1;
|
|
17346
|
-
return elements.slice(firstElementIndex, lastElementIndex + 1);
|
|
17347
|
-
}
|
|
17348
|
-
return elements.slice(row * elementsInRow, (row + 1) * elementsInRow);
|
|
17069
|
+
function getRowElements(elements, row, elementsInRow) {
|
|
17070
|
+
if (row === -1) {
|
|
17071
|
+
var lastRow = Math.floor((elements.length - 1) / elementsInRow);
|
|
17072
|
+
var firstElementIndex = lastRow * elementsInRow;
|
|
17073
|
+
var lastElementIndex = elements.length - 1;
|
|
17074
|
+
return elements.slice(firstElementIndex, lastElementIndex + 1);
|
|
17075
|
+
}
|
|
17076
|
+
return elements.slice(row * elementsInRow, (row + 1) * elementsInRow);
|
|
17349
17077
|
}
|
|
17350
17078
|
function getNextRowElements(allElements, currentRow, elementsInRow) {
|
|
17351
17079
|
var nextRow = currentRow + 1;
|
|
@@ -17580,41 +17308,232 @@ function closestCategoryContent(element) {
|
|
|
17580
17308
|
return element.closest(asSelectors(ClassNames.categoryContent));
|
|
17581
17309
|
}
|
|
17582
17310
|
|
|
17583
|
-
function
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
}
|
|
17311
|
+
function useDebouncedState(initialValue, delay) {
|
|
17312
|
+
if (delay === void 0) {
|
|
17313
|
+
delay = 0;
|
|
17314
|
+
}
|
|
17315
|
+
var _useState = React.useState(initialValue),
|
|
17316
|
+
state = _useState[0],
|
|
17317
|
+
setState = _useState[1];
|
|
17318
|
+
var timer = React.useRef(null);
|
|
17319
|
+
function debouncedSetState(value) {
|
|
17320
|
+
return new Promise(function (resolve) {
|
|
17321
|
+
var _window;
|
|
17322
|
+
if (timer.current) {
|
|
17323
|
+
clearTimeout(timer.current);
|
|
17324
|
+
}
|
|
17325
|
+
timer.current = (_window = window) == null ? void 0 : _window.setTimeout(function () {
|
|
17326
|
+
setState(value);
|
|
17327
|
+
resolve(value);
|
|
17328
|
+
}, delay);
|
|
17329
|
+
});
|
|
17330
|
+
}
|
|
17331
|
+
return [state, debouncedSetState];
|
|
17587
17332
|
}
|
|
17588
17333
|
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17594
|
-
return [];
|
|
17595
|
-
}
|
|
17596
|
-
var recent = JSON.parse((_window$localStorage$ = (_window2 = window) == null ? void 0 : _window2.localStorage.getItem(SUGGESTED_LS_KEY)) != null ? _window$localStorage$ : '[]');
|
|
17597
|
-
if (mode === exports.SuggestionMode.FREQUENT) {
|
|
17598
|
-
return recent.sort(function (a, b) {
|
|
17599
|
-
return b.count - a.count;
|
|
17600
|
-
});
|
|
17601
|
-
}
|
|
17602
|
-
return recent;
|
|
17603
|
-
} catch (_unused) {
|
|
17604
|
-
return [];
|
|
17605
|
-
}
|
|
17334
|
+
function useIsUnicodeHidden() {
|
|
17335
|
+
var unicodeToHide = useUnicodeToHide();
|
|
17336
|
+
return function (emojiUnified) {
|
|
17337
|
+
return unicodeToHide.has(emojiUnified);
|
|
17338
|
+
};
|
|
17606
17339
|
}
|
|
17607
|
-
|
|
17608
|
-
|
|
17609
|
-
var
|
|
17610
|
-
var
|
|
17611
|
-
|
|
17612
|
-
var
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17340
|
+
|
|
17341
|
+
function useDisallowedEmojis() {
|
|
17342
|
+
var DisallowedEmojisRef = React.useRef({});
|
|
17343
|
+
var emojiVersionConfig = useEmojiVersionConfig();
|
|
17344
|
+
return React.useMemo(function () {
|
|
17345
|
+
var emojiVersion = parseFloat("" + emojiVersionConfig);
|
|
17346
|
+
if (!emojiVersionConfig || Number.isNaN(emojiVersion)) {
|
|
17347
|
+
return DisallowedEmojisRef.current;
|
|
17348
|
+
}
|
|
17349
|
+
return allEmojis.reduce(function (disallowedEmojis, emoji) {
|
|
17350
|
+
if (addedInNewerVersion(emoji, emojiVersion)) {
|
|
17351
|
+
disallowedEmojis[emojiUnified(emoji)] = true;
|
|
17352
|
+
}
|
|
17353
|
+
return disallowedEmojis;
|
|
17354
|
+
}, DisallowedEmojisRef.current);
|
|
17355
|
+
}, [emojiVersionConfig]);
|
|
17356
|
+
}
|
|
17357
|
+
function useIsEmojiDisallowed() {
|
|
17358
|
+
var disallowedEmojis = useDisallowedEmojis();
|
|
17359
|
+
var isUnicodeHidden = useIsUnicodeHidden();
|
|
17360
|
+
return function isEmojiDisallowed(emoji) {
|
|
17361
|
+
var unified = unifiedWithoutSkinTone(emojiUnified(emoji));
|
|
17362
|
+
return Boolean(disallowedEmojis[unified] || isUnicodeHidden(unified));
|
|
17363
|
+
};
|
|
17364
|
+
}
|
|
17365
|
+
function addedInNewerVersion(emoji, supportedLevel) {
|
|
17366
|
+
return addedIn(emoji) > supportedLevel;
|
|
17367
|
+
}
|
|
17368
|
+
|
|
17369
|
+
function useMarkInitialLoad(dispatch) {
|
|
17370
|
+
React.useEffect(function () {
|
|
17371
|
+
dispatch(true);
|
|
17372
|
+
}, [dispatch]);
|
|
17373
|
+
}
|
|
17374
|
+
|
|
17375
|
+
function PickerContextProvider(_ref) {
|
|
17376
|
+
var children = _ref.children;
|
|
17377
|
+
var disallowedEmojis = useDisallowedEmojis();
|
|
17378
|
+
var defaultSkinTone = useDefaultSkinToneConfig();
|
|
17379
|
+
var reactionsDefaultOpen = useReactionsOpenConfig();
|
|
17380
|
+
// Initialize the filter with the inititial dictionary
|
|
17381
|
+
var filterRef = React.useRef(alphaNumericEmojiIndex);
|
|
17382
|
+
var disallowClickRef = React.useRef(false);
|
|
17383
|
+
var disallowMouseRef = React.useRef(false);
|
|
17384
|
+
var disallowedEmojisRef = React.useRef(disallowedEmojis);
|
|
17385
|
+
var suggestedUpdateState = useDebouncedState(Date.now(), 200);
|
|
17386
|
+
var searchTerm = useDebouncedState('', 100);
|
|
17387
|
+
var skinToneFanOpenState = React.useState(false);
|
|
17388
|
+
var activeSkinTone = React.useState(defaultSkinTone);
|
|
17389
|
+
var activeCategoryState = React.useState(null);
|
|
17390
|
+
var emojisThatFailedToLoadState = React.useState(new Set());
|
|
17391
|
+
var emojiVariationPickerState = React.useState(null);
|
|
17392
|
+
var reactionsModeState = React.useState(reactionsDefaultOpen);
|
|
17393
|
+
var _useState = React.useState(false),
|
|
17394
|
+
isPastInitialLoad = _useState[0],
|
|
17395
|
+
setIsPastInitialLoad = _useState[1];
|
|
17396
|
+
useMarkInitialLoad(setIsPastInitialLoad);
|
|
17397
|
+
return React.createElement(PickerContext.Provider, {
|
|
17398
|
+
value: {
|
|
17399
|
+
activeCategoryState: activeCategoryState,
|
|
17400
|
+
activeSkinTone: activeSkinTone,
|
|
17401
|
+
disallowClickRef: disallowClickRef,
|
|
17402
|
+
disallowMouseRef: disallowMouseRef,
|
|
17403
|
+
disallowedEmojisRef: disallowedEmojisRef,
|
|
17404
|
+
emojiVariationPickerState: emojiVariationPickerState,
|
|
17405
|
+
emojisThatFailedToLoadState: emojisThatFailedToLoadState,
|
|
17406
|
+
filterRef: filterRef,
|
|
17407
|
+
isPastInitialLoad: isPastInitialLoad,
|
|
17408
|
+
searchTerm: searchTerm,
|
|
17409
|
+
skinToneFanOpenState: skinToneFanOpenState,
|
|
17410
|
+
suggestedUpdateState: suggestedUpdateState,
|
|
17411
|
+
reactionsModeState: reactionsModeState
|
|
17412
|
+
}
|
|
17413
|
+
}, children);
|
|
17414
|
+
}
|
|
17415
|
+
var PickerContext = /*#__PURE__*/React.createContext({
|
|
17416
|
+
activeCategoryState: [null, function () {}],
|
|
17417
|
+
activeSkinTone: [exports.SkinTones.NEUTRAL, function () {}],
|
|
17418
|
+
disallowClickRef: {
|
|
17419
|
+
current: false
|
|
17420
|
+
},
|
|
17421
|
+
disallowMouseRef: {
|
|
17422
|
+
current: false
|
|
17423
|
+
},
|
|
17424
|
+
disallowedEmojisRef: {
|
|
17425
|
+
current: {}
|
|
17426
|
+
},
|
|
17427
|
+
emojiVariationPickerState: [null, function () {}],
|
|
17428
|
+
emojisThatFailedToLoadState: [/*#__PURE__*/new Set(), function () {}],
|
|
17429
|
+
filterRef: {
|
|
17430
|
+
current: {}
|
|
17431
|
+
},
|
|
17432
|
+
isPastInitialLoad: true,
|
|
17433
|
+
searchTerm: ['', function () {
|
|
17434
|
+
return new Promise(function () {
|
|
17435
|
+
return undefined;
|
|
17436
|
+
});
|
|
17437
|
+
}],
|
|
17438
|
+
skinToneFanOpenState: [false, function () {}],
|
|
17439
|
+
suggestedUpdateState: [/*#__PURE__*/Date.now(), function () {}],
|
|
17440
|
+
reactionsModeState: [false, function () {}]
|
|
17441
|
+
});
|
|
17442
|
+
function useFilterRef() {
|
|
17443
|
+
var _React$useContext = React.useContext(PickerContext),
|
|
17444
|
+
filterRef = _React$useContext.filterRef;
|
|
17445
|
+
return filterRef;
|
|
17446
|
+
}
|
|
17447
|
+
function useDisallowClickRef() {
|
|
17448
|
+
var _React$useContext2 = React.useContext(PickerContext),
|
|
17449
|
+
disallowClickRef = _React$useContext2.disallowClickRef;
|
|
17450
|
+
return disallowClickRef;
|
|
17451
|
+
}
|
|
17452
|
+
function useDisallowMouseRef() {
|
|
17453
|
+
var _React$useContext3 = React.useContext(PickerContext),
|
|
17454
|
+
disallowMouseRef = _React$useContext3.disallowMouseRef;
|
|
17455
|
+
return disallowMouseRef;
|
|
17456
|
+
}
|
|
17457
|
+
function useReactionsModeState() {
|
|
17458
|
+
var _React$useContext4 = React.useContext(PickerContext),
|
|
17459
|
+
reactionsModeState = _React$useContext4.reactionsModeState;
|
|
17460
|
+
return reactionsModeState;
|
|
17461
|
+
}
|
|
17462
|
+
function useSearchTermState() {
|
|
17463
|
+
var _React$useContext5 = React.useContext(PickerContext),
|
|
17464
|
+
searchTerm = _React$useContext5.searchTerm;
|
|
17465
|
+
return searchTerm;
|
|
17466
|
+
}
|
|
17467
|
+
function useActiveSkinToneState() {
|
|
17468
|
+
var _React$useContext6 = React.useContext(PickerContext),
|
|
17469
|
+
activeSkinTone = _React$useContext6.activeSkinTone;
|
|
17470
|
+
return activeSkinTone;
|
|
17471
|
+
}
|
|
17472
|
+
function useEmojisThatFailedToLoadState() {
|
|
17473
|
+
var _React$useContext7 = React.useContext(PickerContext),
|
|
17474
|
+
emojisThatFailedToLoadState = _React$useContext7.emojisThatFailedToLoadState;
|
|
17475
|
+
return emojisThatFailedToLoadState;
|
|
17476
|
+
}
|
|
17477
|
+
function useIsPastInitialLoad() {
|
|
17478
|
+
var _React$useContext8 = React.useContext(PickerContext),
|
|
17479
|
+
isPastInitialLoad = _React$useContext8.isPastInitialLoad;
|
|
17480
|
+
return isPastInitialLoad;
|
|
17481
|
+
}
|
|
17482
|
+
function useEmojiVariationPickerState() {
|
|
17483
|
+
var _React$useContext9 = React.useContext(PickerContext),
|
|
17484
|
+
emojiVariationPickerState = _React$useContext9.emojiVariationPickerState;
|
|
17485
|
+
return emojiVariationPickerState;
|
|
17486
|
+
}
|
|
17487
|
+
function useSkinToneFanOpenState() {
|
|
17488
|
+
var _React$useContext10 = React.useContext(PickerContext),
|
|
17489
|
+
skinToneFanOpenState = _React$useContext10.skinToneFanOpenState;
|
|
17490
|
+
return skinToneFanOpenState;
|
|
17491
|
+
}
|
|
17492
|
+
function useUpdateSuggested() {
|
|
17493
|
+
var _React$useContext12 = React.useContext(PickerContext),
|
|
17494
|
+
suggestedUpdateState = _React$useContext12.suggestedUpdateState;
|
|
17495
|
+
var suggestedUpdated = suggestedUpdateState[0],
|
|
17496
|
+
setsuggestedUpdate = suggestedUpdateState[1];
|
|
17497
|
+
return [suggestedUpdated, function updateSuggested() {
|
|
17498
|
+
setsuggestedUpdate(Date.now());
|
|
17499
|
+
}];
|
|
17500
|
+
}
|
|
17501
|
+
|
|
17502
|
+
function parseNativeEmoji(unified) {
|
|
17503
|
+
return unified.split('-').map(function (hex) {
|
|
17504
|
+
return String.fromCodePoint(parseInt(hex, 16));
|
|
17505
|
+
}).join('');
|
|
17506
|
+
}
|
|
17507
|
+
|
|
17508
|
+
var SUGGESTED_LS_KEY = 'epr_suggested';
|
|
17509
|
+
function getSuggested(mode) {
|
|
17510
|
+
try {
|
|
17511
|
+
var _window, _window$localStorage$, _window2;
|
|
17512
|
+
if (!((_window = window) != null && _window.localStorage)) {
|
|
17513
|
+
return [];
|
|
17514
|
+
}
|
|
17515
|
+
var recent = JSON.parse((_window$localStorage$ = (_window2 = window) == null ? void 0 : _window2.localStorage.getItem(SUGGESTED_LS_KEY)) != null ? _window$localStorage$ : '[]');
|
|
17516
|
+
if (mode === exports.SuggestionMode.FREQUENT) {
|
|
17517
|
+
return recent.sort(function (a, b) {
|
|
17518
|
+
return b.count - a.count;
|
|
17519
|
+
});
|
|
17520
|
+
}
|
|
17521
|
+
return recent;
|
|
17522
|
+
} catch (_unused) {
|
|
17523
|
+
return [];
|
|
17524
|
+
}
|
|
17525
|
+
}
|
|
17526
|
+
function setSuggested(emoji, skinTone) {
|
|
17527
|
+
var recent = getSuggested();
|
|
17528
|
+
var unified = emojiUnified(emoji, skinTone);
|
|
17529
|
+
var originalUnified = emojiUnified(emoji);
|
|
17530
|
+
var existing = recent.find(function (_ref) {
|
|
17531
|
+
var u = _ref.unified;
|
|
17532
|
+
return u === unified;
|
|
17533
|
+
});
|
|
17534
|
+
var nextList;
|
|
17535
|
+
if (existing) {
|
|
17536
|
+
nextList = [existing].concat(recent.filter(function (i) {
|
|
17618
17537
|
return i !== existing;
|
|
17619
17538
|
}));
|
|
17620
17539
|
} else {
|
|
@@ -17670,49 +17589,143 @@ function useHasOpenToggles() {
|
|
|
17670
17589
|
};
|
|
17671
17590
|
}
|
|
17672
17591
|
|
|
17673
|
-
function
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17592
|
+
function focusElement(element) {
|
|
17593
|
+
if (!element) {
|
|
17594
|
+
return;
|
|
17595
|
+
}
|
|
17596
|
+
requestAnimationFrame(function () {
|
|
17597
|
+
element.focus();
|
|
17598
|
+
});
|
|
17599
|
+
}
|
|
17600
|
+
function focusPrevElementSibling(element) {
|
|
17601
|
+
if (!element) return;
|
|
17602
|
+
var prev = element.previousElementSibling;
|
|
17603
|
+
focusElement(prev);
|
|
17604
|
+
}
|
|
17605
|
+
function focusNextElementSibling(element) {
|
|
17606
|
+
if (!element) return;
|
|
17607
|
+
var next = element.nextElementSibling;
|
|
17608
|
+
focusElement(next);
|
|
17609
|
+
}
|
|
17610
|
+
function focusFirstElementChild(element) {
|
|
17611
|
+
if (!element) return;
|
|
17612
|
+
var first = element.firstElementChild;
|
|
17613
|
+
focusElement(first);
|
|
17685
17614
|
}
|
|
17686
17615
|
|
|
17687
|
-
function
|
|
17688
|
-
var
|
|
17689
|
-
var
|
|
17690
|
-
var
|
|
17691
|
-
var
|
|
17692
|
-
|
|
17693
|
-
var
|
|
17694
|
-
var
|
|
17695
|
-
|
|
17696
|
-
var
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
emoji = _emojiFromEvent[0],
|
|
17708
|
-
unified = _emojiFromEvent[1];
|
|
17709
|
-
if (!emoji || !unified) {
|
|
17710
|
-
return;
|
|
17616
|
+
function ElementRefContextProvider(_ref) {
|
|
17617
|
+
var children = _ref.children;
|
|
17618
|
+
var PickerMainRef = React.useRef(null);
|
|
17619
|
+
var AnchoredEmojiRef = React.useRef(null);
|
|
17620
|
+
var BodyRef = React.useRef(null);
|
|
17621
|
+
var SearchInputRef = React.useRef(null);
|
|
17622
|
+
var SkinTonePickerRef = React.useRef(null);
|
|
17623
|
+
var CategoryNavigationRef = React.useRef(null);
|
|
17624
|
+
var VariationPickerRef = React.useRef(null);
|
|
17625
|
+
var ReactionsRef = React.useRef(null);
|
|
17626
|
+
return React.createElement(ElementRefContext.Provider, {
|
|
17627
|
+
value: {
|
|
17628
|
+
AnchoredEmojiRef: AnchoredEmojiRef,
|
|
17629
|
+
BodyRef: BodyRef,
|
|
17630
|
+
CategoryNavigationRef: CategoryNavigationRef,
|
|
17631
|
+
PickerMainRef: PickerMainRef,
|
|
17632
|
+
SearchInputRef: SearchInputRef,
|
|
17633
|
+
SkinTonePickerRef: SkinTonePickerRef,
|
|
17634
|
+
VariationPickerRef: VariationPickerRef,
|
|
17635
|
+
ReactionsRef: ReactionsRef
|
|
17711
17636
|
}
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17637
|
+
}, children);
|
|
17638
|
+
}
|
|
17639
|
+
var ElementRefContext = /*#__PURE__*/React.createContext({
|
|
17640
|
+
AnchoredEmojiRef: /*#__PURE__*/React.createRef(),
|
|
17641
|
+
BodyRef: /*#__PURE__*/React.createRef(),
|
|
17642
|
+
CategoryNavigationRef: /*#__PURE__*/React.createRef(),
|
|
17643
|
+
PickerMainRef: /*#__PURE__*/React.createRef(),
|
|
17644
|
+
SearchInputRef: /*#__PURE__*/React.createRef(),
|
|
17645
|
+
SkinTonePickerRef: /*#__PURE__*/React.createRef(),
|
|
17646
|
+
VariationPickerRef: /*#__PURE__*/React.createRef(),
|
|
17647
|
+
ReactionsRef: /*#__PURE__*/React.createRef()
|
|
17648
|
+
});
|
|
17649
|
+
function useElementRef() {
|
|
17650
|
+
return React.useContext(ElementRefContext);
|
|
17651
|
+
}
|
|
17652
|
+
function usePickerMainRef() {
|
|
17653
|
+
return useElementRef()['PickerMainRef'];
|
|
17654
|
+
}
|
|
17655
|
+
function useAnchoredEmojiRef() {
|
|
17656
|
+
return useElementRef()['AnchoredEmojiRef'];
|
|
17657
|
+
}
|
|
17658
|
+
function useSetAnchoredEmojiRef() {
|
|
17659
|
+
var AnchoredEmojiRef = useAnchoredEmojiRef();
|
|
17660
|
+
return function (target) {
|
|
17661
|
+
if (target === null && AnchoredEmojiRef.current !== null) {
|
|
17662
|
+
focusElement(AnchoredEmojiRef.current);
|
|
17663
|
+
}
|
|
17664
|
+
AnchoredEmojiRef.current = target;
|
|
17665
|
+
};
|
|
17666
|
+
}
|
|
17667
|
+
function useBodyRef() {
|
|
17668
|
+
return useElementRef()['BodyRef'];
|
|
17669
|
+
}
|
|
17670
|
+
function useReactionsRef() {
|
|
17671
|
+
return useElementRef()['ReactionsRef'];
|
|
17672
|
+
}
|
|
17673
|
+
function useSearchInputRef() {
|
|
17674
|
+
return useElementRef()['SearchInputRef'];
|
|
17675
|
+
}
|
|
17676
|
+
function useSkinTonePickerRef() {
|
|
17677
|
+
return useElementRef()['SkinTonePickerRef'];
|
|
17678
|
+
}
|
|
17679
|
+
function useCategoryNavigationRef() {
|
|
17680
|
+
return useElementRef()['CategoryNavigationRef'];
|
|
17681
|
+
}
|
|
17682
|
+
function useVariationPickerRef() {
|
|
17683
|
+
return useElementRef()['VariationPickerRef'];
|
|
17684
|
+
}
|
|
17685
|
+
|
|
17686
|
+
function useSetVariationPicker() {
|
|
17687
|
+
var setAnchoredEmojiRef = useSetAnchoredEmojiRef();
|
|
17688
|
+
var _useEmojiVariationPic = useEmojiVariationPickerState(),
|
|
17689
|
+
setEmojiVariationPicker = _useEmojiVariationPic[1];
|
|
17690
|
+
return function setVariationPicker(element) {
|
|
17691
|
+
var _emojiFromElement = emojiFromElement(element),
|
|
17692
|
+
emoji = _emojiFromElement[0];
|
|
17693
|
+
if (emoji) {
|
|
17694
|
+
setAnchoredEmojiRef(element);
|
|
17695
|
+
setEmojiVariationPicker(emoji);
|
|
17696
|
+
}
|
|
17697
|
+
};
|
|
17698
|
+
}
|
|
17699
|
+
|
|
17700
|
+
function useMouseDownHandlers(ContainerRef, mouseEventSource) {
|
|
17701
|
+
var mouseDownTimerRef = React.useRef();
|
|
17702
|
+
var setVariationPicker = useSetVariationPicker();
|
|
17703
|
+
var disallowClickRef = useDisallowClickRef();
|
|
17704
|
+
var _useEmojiVariationPic = useEmojiVariationPickerState(),
|
|
17705
|
+
setEmojiVariationPicker = _useEmojiVariationPic[1];
|
|
17706
|
+
var closeAllOpenToggles = useCloseAllOpenToggles();
|
|
17707
|
+
var _useActiveSkinToneSta = useActiveSkinToneState(),
|
|
17708
|
+
activeSkinTone = _useActiveSkinToneSta[0];
|
|
17709
|
+
var onEmojiClick = useOnEmojiClickConfig(mouseEventSource);
|
|
17710
|
+
var _useUpdateSuggested = useUpdateSuggested(),
|
|
17711
|
+
updateSuggested = _useUpdateSuggested[1];
|
|
17712
|
+
var getEmojiUrl = useGetEmojiUrlConfig();
|
|
17713
|
+
var activeEmojiStyle = useEmojiStyleConfig();
|
|
17714
|
+
var onClick = React.useCallback(function onClick(event) {
|
|
17715
|
+
if (disallowClickRef.current) {
|
|
17716
|
+
return;
|
|
17717
|
+
}
|
|
17718
|
+
closeAllOpenToggles();
|
|
17719
|
+
var _emojiFromEvent = emojiFromEvent(event),
|
|
17720
|
+
emoji = _emojiFromEvent[0],
|
|
17721
|
+
unified = _emojiFromEvent[1];
|
|
17722
|
+
if (!emoji || !unified) {
|
|
17723
|
+
return;
|
|
17724
|
+
}
|
|
17725
|
+
var skinToneToUse = activeVariationFromUnified(unified) || activeSkinTone;
|
|
17726
|
+
updateSuggested();
|
|
17727
|
+
setSuggested(emoji, skinToneToUse);
|
|
17728
|
+
onEmojiClick(emojiClickOutput(emoji, skinToneToUse, activeEmojiStyle, getEmojiUrl), event);
|
|
17716
17729
|
}, [activeSkinTone, closeAllOpenToggles, disallowClickRef, onEmojiClick, updateSuggested, getEmojiUrl, activeEmojiStyle]);
|
|
17717
17730
|
var onMouseDown = React.useCallback(function onMouseDown(event) {
|
|
17718
17731
|
var _window;
|
|
@@ -17748,25 +17761,25 @@ function useMouseDownHandlers(BodyRef) {
|
|
|
17748
17761
|
}
|
|
17749
17762
|
}, [disallowClickRef]);
|
|
17750
17763
|
React.useEffect(function () {
|
|
17751
|
-
if (!
|
|
17764
|
+
if (!ContainerRef.current) {
|
|
17752
17765
|
return;
|
|
17753
17766
|
}
|
|
17754
|
-
var
|
|
17755
|
-
|
|
17767
|
+
var confainerRef = ContainerRef.current;
|
|
17768
|
+
confainerRef.addEventListener('click', onClick, {
|
|
17756
17769
|
passive: true
|
|
17757
17770
|
});
|
|
17758
|
-
|
|
17771
|
+
confainerRef.addEventListener('mousedown', onMouseDown, {
|
|
17759
17772
|
passive: true
|
|
17760
17773
|
});
|
|
17761
|
-
|
|
17774
|
+
confainerRef.addEventListener('mouseup', onMouseUp, {
|
|
17762
17775
|
passive: true
|
|
17763
17776
|
});
|
|
17764
17777
|
return function () {
|
|
17765
|
-
|
|
17766
|
-
|
|
17767
|
-
|
|
17778
|
+
confainerRef == null ? void 0 : confainerRef.removeEventListener('click', onClick);
|
|
17779
|
+
confainerRef == null ? void 0 : confainerRef.removeEventListener('mousedown', onMouseDown);
|
|
17780
|
+
confainerRef == null ? void 0 : confainerRef.removeEventListener('mouseup', onMouseUp);
|
|
17768
17781
|
};
|
|
17769
|
-
}, [
|
|
17782
|
+
}, [ContainerRef, onClick, onMouseDown, onMouseUp]);
|
|
17770
17783
|
}
|
|
17771
17784
|
function emojiFromEvent(event) {
|
|
17772
17785
|
var target = event == null ? void 0 : event.target;
|
|
@@ -17810,6 +17823,391 @@ function emojiClickOutput(emoji, activeSkinTone, activeEmojiStyle, getEmojiUrl)
|
|
|
17810
17823
|
};
|
|
17811
17824
|
}
|
|
17812
17825
|
|
|
17826
|
+
function Button(props) {
|
|
17827
|
+
return React.createElement("button", Object.assign({
|
|
17828
|
+
type: "button"
|
|
17829
|
+
}, props, {
|
|
17830
|
+
className: flairup.cx(styles.button, props.className)
|
|
17831
|
+
}), props.children);
|
|
17832
|
+
}
|
|
17833
|
+
var styles = /*#__PURE__*/stylesheet.create({
|
|
17834
|
+
button: {
|
|
17835
|
+
'.': 'epr-btn',
|
|
17836
|
+
cursor: 'pointer',
|
|
17837
|
+
border: '0',
|
|
17838
|
+
background: 'none',
|
|
17839
|
+
outline: 'none'
|
|
17840
|
+
}
|
|
17841
|
+
});
|
|
17842
|
+
|
|
17843
|
+
function ClickableEmojiButton(_ref) {
|
|
17844
|
+
var _cx;
|
|
17845
|
+
var emojiNames = _ref.emojiNames,
|
|
17846
|
+
unified = _ref.unified,
|
|
17847
|
+
hidden = _ref.hidden,
|
|
17848
|
+
hiddenOnSearch = _ref.hiddenOnSearch,
|
|
17849
|
+
_ref$showVariations = _ref.showVariations,
|
|
17850
|
+
showVariations = _ref$showVariations === void 0 ? true : _ref$showVariations,
|
|
17851
|
+
hasVariations = _ref.hasVariations,
|
|
17852
|
+
children = _ref.children,
|
|
17853
|
+
_ref$round = _ref.round,
|
|
17854
|
+
round = _ref$round === void 0 ? false : _ref$round;
|
|
17855
|
+
return React.createElement(Button, {
|
|
17856
|
+
className: flairup.cx(styles$1.emoji, hidden && commonStyles.hidden, hiddenOnSearch && commonInteractionStyles.hiddenOnSearch, (_cx = {}, _cx[ClassNames.visible] = !hidden && !hiddenOnSearch, _cx), !!(hasVariations && showVariations) && styles$1.hasVariations, round && styles$1.round),
|
|
17857
|
+
"data-unified": unified,
|
|
17858
|
+
"aria-label": emojiNames[0],
|
|
17859
|
+
"data-full-name": emojiNames
|
|
17860
|
+
}, children);
|
|
17861
|
+
}
|
|
17862
|
+
var styles$1 = /*#__PURE__*/stylesheet.create({
|
|
17863
|
+
emoji: {
|
|
17864
|
+
'.': ClassNames.emoji,
|
|
17865
|
+
position: 'relative',
|
|
17866
|
+
width: 'var(--epr-emoji-fullsize)',
|
|
17867
|
+
height: 'var(--epr-emoji-fullsize)',
|
|
17868
|
+
boxSizing: 'border-box',
|
|
17869
|
+
display: 'flex',
|
|
17870
|
+
alignItems: 'center',
|
|
17871
|
+
justifyContent: 'center',
|
|
17872
|
+
maxWidth: 'var(--epr-emoji-fullsize)',
|
|
17873
|
+
maxHeight: 'var(--epr-emoji-fullsize)',
|
|
17874
|
+
borderRadius: '8px',
|
|
17875
|
+
overflow: 'hidden',
|
|
17876
|
+
transition: 'background-color 0.2s',
|
|
17877
|
+
':hover': {
|
|
17878
|
+
backgroundColor: 'var(--epr-emoji-hover-color)'
|
|
17879
|
+
},
|
|
17880
|
+
':focus': {
|
|
17881
|
+
backgroundColor: 'var(--epr-focus-bg-color)'
|
|
17882
|
+
}
|
|
17883
|
+
},
|
|
17884
|
+
round: {
|
|
17885
|
+
borderRadius: '50%'
|
|
17886
|
+
},
|
|
17887
|
+
hasVariations: {
|
|
17888
|
+
'.': ClassNames.emojiHasVariations,
|
|
17889
|
+
':after': {
|
|
17890
|
+
content: '',
|
|
17891
|
+
display: 'block',
|
|
17892
|
+
width: '0',
|
|
17893
|
+
height: '0',
|
|
17894
|
+
right: '0px',
|
|
17895
|
+
bottom: '1px',
|
|
17896
|
+
position: 'absolute',
|
|
17897
|
+
borderLeft: '4px solid transparent',
|
|
17898
|
+
borderRight: '4px solid transparent',
|
|
17899
|
+
transform: 'rotate(135deg)',
|
|
17900
|
+
borderBottom: '4px solid var(--epr-emoji-variation-indicator-color)',
|
|
17901
|
+
zIndex: 'var(--epr-emoji-variations-indictator-z-index)'
|
|
17902
|
+
},
|
|
17903
|
+
':hover:after': {
|
|
17904
|
+
borderBottom: '4px solid var(--epr-emoji-variation-indicator-color-hover)'
|
|
17905
|
+
}
|
|
17906
|
+
}
|
|
17907
|
+
});
|
|
17908
|
+
|
|
17909
|
+
var emojiStyles = /*#__PURE__*/stylesheet.create({
|
|
17910
|
+
external: {
|
|
17911
|
+
'.': ClassNames.external,
|
|
17912
|
+
fontSize: '0'
|
|
17913
|
+
},
|
|
17914
|
+
common: {
|
|
17915
|
+
alignSelf: 'center',
|
|
17916
|
+
justifySelf: 'center',
|
|
17917
|
+
display: 'block'
|
|
17918
|
+
}
|
|
17919
|
+
});
|
|
17920
|
+
|
|
17921
|
+
function EmojiImg(_ref) {
|
|
17922
|
+
var emojiName = _ref.emojiName,
|
|
17923
|
+
style = _ref.style,
|
|
17924
|
+
_ref$lazyLoad = _ref.lazyLoad,
|
|
17925
|
+
lazyLoad = _ref$lazyLoad === void 0 ? false : _ref$lazyLoad,
|
|
17926
|
+
imgUrl = _ref.imgUrl,
|
|
17927
|
+
onError = _ref.onError,
|
|
17928
|
+
className = _ref.className;
|
|
17929
|
+
return React.createElement("img", {
|
|
17930
|
+
src: imgUrl,
|
|
17931
|
+
alt: emojiName,
|
|
17932
|
+
className: flairup.cx(styles$2.emojiImag, emojiStyles.external, emojiStyles.common, className),
|
|
17933
|
+
loading: lazyLoad ? 'lazy' : 'eager',
|
|
17934
|
+
onError: onError,
|
|
17935
|
+
style: style
|
|
17936
|
+
});
|
|
17937
|
+
}
|
|
17938
|
+
var styles$2 = /*#__PURE__*/stylesheet.create({
|
|
17939
|
+
emojiImag: {
|
|
17940
|
+
'.': 'epr-emoji-img',
|
|
17941
|
+
maxWidth: 'var(--epr-emoji-fullsize)',
|
|
17942
|
+
maxHeight: 'var(--epr-emoji-fullsize)',
|
|
17943
|
+
minWidth: 'var(--epr-emoji-fullsize)',
|
|
17944
|
+
minHeight: 'var(--epr-emoji-fullsize)',
|
|
17945
|
+
padding: 'var(--epr-emoji-padding)'
|
|
17946
|
+
}
|
|
17947
|
+
});
|
|
17948
|
+
|
|
17949
|
+
function NativeEmoji(_ref) {
|
|
17950
|
+
var unified = _ref.unified,
|
|
17951
|
+
style = _ref.style,
|
|
17952
|
+
className = _ref.className;
|
|
17953
|
+
return React.createElement("span", {
|
|
17954
|
+
className: flairup.cx(styles$3.nativeEmoji, emojiStyles.common, emojiStyles.external, className),
|
|
17955
|
+
"data-unified": unified,
|
|
17956
|
+
style: style
|
|
17957
|
+
}, parseNativeEmoji(unified));
|
|
17958
|
+
}
|
|
17959
|
+
var styles$3 = /*#__PURE__*/stylesheet.create({
|
|
17960
|
+
nativeEmoji: {
|
|
17961
|
+
'.': 'epr-emoji-native',
|
|
17962
|
+
fontFamily: '"Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji"!important',
|
|
17963
|
+
position: 'relative',
|
|
17964
|
+
lineHeight: '100%',
|
|
17965
|
+
fontSize: 'var(--epr-emoji-size)',
|
|
17966
|
+
textAlign: 'center',
|
|
17967
|
+
alignSelf: 'center',
|
|
17968
|
+
justifySelf: 'center',
|
|
17969
|
+
letterSpacing: '0',
|
|
17970
|
+
padding: 'var(--epr-emoji-padding)'
|
|
17971
|
+
}
|
|
17972
|
+
});
|
|
17973
|
+
|
|
17974
|
+
function ViewOnlyEmoji(_ref) {
|
|
17975
|
+
var emoji = _ref.emoji,
|
|
17976
|
+
unified = _ref.unified,
|
|
17977
|
+
emojiStyle = _ref.emojiStyle,
|
|
17978
|
+
size = _ref.size,
|
|
17979
|
+
lazyLoad = _ref.lazyLoad,
|
|
17980
|
+
_ref$getEmojiUrl = _ref.getEmojiUrl,
|
|
17981
|
+
getEmojiUrl = _ref$getEmojiUrl === void 0 ? emojiUrlByUnified : _ref$getEmojiUrl,
|
|
17982
|
+
className = _ref.className;
|
|
17983
|
+
var _useEmojisThatFailedT = useEmojisThatFailedToLoadState(),
|
|
17984
|
+
setEmojisThatFailedToLoad = _useEmojisThatFailedT[1];
|
|
17985
|
+
var style = {};
|
|
17986
|
+
if (size) {
|
|
17987
|
+
style.width = style.height = style.fontSize = size + "px";
|
|
17988
|
+
}
|
|
17989
|
+
var emojiToRender = emoji ? emoji : emojiByUnified(unified);
|
|
17990
|
+
if (!emojiToRender) {
|
|
17991
|
+
return null;
|
|
17992
|
+
}
|
|
17993
|
+
if (isCustomEmoji(emojiToRender)) {
|
|
17994
|
+
return React.createElement(EmojiImg, {
|
|
17995
|
+
style: style,
|
|
17996
|
+
emojiName: unified,
|
|
17997
|
+
emojiStyle: exports.EmojiStyle.NATIVE,
|
|
17998
|
+
lazyLoad: lazyLoad,
|
|
17999
|
+
imgUrl: emojiToRender.imgUrl,
|
|
18000
|
+
onError: onError,
|
|
18001
|
+
className: className
|
|
18002
|
+
});
|
|
18003
|
+
}
|
|
18004
|
+
return React.createElement(React.Fragment, null, emojiStyle === exports.EmojiStyle.NATIVE ? React.createElement(NativeEmoji, {
|
|
18005
|
+
unified: unified,
|
|
18006
|
+
style: style,
|
|
18007
|
+
className: className
|
|
18008
|
+
}) : React.createElement(EmojiImg, {
|
|
18009
|
+
style: style,
|
|
18010
|
+
emojiName: emojiName(emojiToRender),
|
|
18011
|
+
emojiStyle: emojiStyle,
|
|
18012
|
+
lazyLoad: lazyLoad,
|
|
18013
|
+
imgUrl: getEmojiUrl(unified, emojiStyle),
|
|
18014
|
+
onError: onError,
|
|
18015
|
+
className: className
|
|
18016
|
+
}));
|
|
18017
|
+
function onError() {
|
|
18018
|
+
setEmojisThatFailedToLoad(function (prev) {
|
|
18019
|
+
return new Set(prev).add(unified);
|
|
18020
|
+
});
|
|
18021
|
+
}
|
|
18022
|
+
}
|
|
18023
|
+
|
|
18024
|
+
function ClickableEmoji(_ref) {
|
|
18025
|
+
var emoji = _ref.emoji,
|
|
18026
|
+
unified = _ref.unified,
|
|
18027
|
+
hidden = _ref.hidden,
|
|
18028
|
+
hiddenOnSearch = _ref.hiddenOnSearch,
|
|
18029
|
+
emojiStyle = _ref.emojiStyle,
|
|
18030
|
+
_ref$showVariations = _ref.showVariations,
|
|
18031
|
+
showVariations = _ref$showVariations === void 0 ? true : _ref$showVariations,
|
|
18032
|
+
size = _ref.size,
|
|
18033
|
+
lazyLoad = _ref.lazyLoad,
|
|
18034
|
+
getEmojiUrl = _ref.getEmojiUrl,
|
|
18035
|
+
_ref$round = _ref.round,
|
|
18036
|
+
round = _ref$round === void 0 ? false : _ref$round;
|
|
18037
|
+
var hasVariations = emojiHasVariations(emoji);
|
|
18038
|
+
return React.createElement(ClickableEmojiButton, {
|
|
18039
|
+
hasVariations: hasVariations,
|
|
18040
|
+
showVariations: showVariations,
|
|
18041
|
+
hidden: hidden,
|
|
18042
|
+
hiddenOnSearch: hiddenOnSearch,
|
|
18043
|
+
emojiNames: emojiNames(emoji),
|
|
18044
|
+
unified: unified,
|
|
18045
|
+
round: round
|
|
18046
|
+
}, React.createElement(ViewOnlyEmoji, {
|
|
18047
|
+
unified: unified,
|
|
18048
|
+
emoji: emoji,
|
|
18049
|
+
size: size,
|
|
18050
|
+
emojiStyle: emojiStyle,
|
|
18051
|
+
lazyLoad: lazyLoad,
|
|
18052
|
+
getEmojiUrl: getEmojiUrl
|
|
18053
|
+
}));
|
|
18054
|
+
}
|
|
18055
|
+
|
|
18056
|
+
var Plus = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjgwcHgiIHZpZXdCb3g9IjAgMCAyMCA4MCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjAgODAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjODY4Njg2IiBkPSJNNS43LDEwLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40QzYsMTAuOSw2LjEsMTEsNi4zLDExaDMuNHYzLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40CgljMC4xLDAuMSwwLjIsMC4yLDAuNCwwLjJjMC4zLDAsMC41LTAuMiwwLjUtMC41di0zLjRoMy40YzAuMywwLDAuNS0wLjIsMC41LTAuNXMtMC4yLTAuNS0wLjUtMC41aC0zLjRWNi43YzAtMC4zLTAuMi0wLjUtMC41LTAuNQoJQzkuOCw2LDkuNiw2LjIsOS42LDYuNXYzLjRINi4yQzUuOSw5LjksNS43LDEwLjEsNS43LDEwLjRMNS43LDEwLjR6Ii8+CjxwYXRoIGZpbGw9IiMzMzcxQjciIGQ9Ik01LjcsMzAuNGMwLDAuMSwwLjEsMC4zLDAuMiwwLjRTNi4xLDMxLDYuMywzMWgzLjR2My40YzAsMC4xLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMiwwLjIsMC40LDAuMgoJYzAuMywwLDAuNS0wLjIsMC41LTAuNXYtMy40aDMuNGMwLjMsMCwwLjUtMC4yLDAuNS0wLjVzLTAuMi0wLjUtMC41LTAuNWgtMy40di0zLjRjMC0wLjMtMC4yLTAuNS0wLjUtMC41cy0wLjUsMC4yLTAuNSwwLjV2My40SDYuMgoJQzUuOSwyOS45LDUuNywzMC4xLDUuNywzMC40TDUuNywzMC40eiIvPgo8cGF0aCBmaWxsPSIjQzBDMEJGIiBkPSJNNS43LDUwLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40QzYsNTAuOSw2LjEsNTEsNi4zLDUxaDMuNHYzLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40CgljMC4xLDAuMSwwLjIsMC4yLDAuNCwwLjJjMC4zLDAsMC41LTAuMiwwLjUtMC41di0zLjRoMy40YzAuMywwLDAuNS0wLjIsMC41LTAuNXMtMC4yLTAuNS0wLjUtMC41aC0zLjR2LTMuNGMwLTAuMy0wLjItMC41LTAuNS0wLjUKCXMtMC41LDAuMi0wLjUsMC41djMuNEg2LjJDNS45LDQ5LjksNS43LDUwLjEsNS43LDUwLjRMNS43LDUwLjR6Ii8+CjxwYXRoIGZpbGw9IiM2QUE5REQiIGQ9Ik01LjcsNzAuNGMwLDAuMSwwLjEsMC4zLDAuMiwwLjRTNi4xLDcxLDYuMyw3MWgzLjR2My40YzAsMC4xLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMiwwLjIsMC40LDAuMgoJYzAuMywwLDAuNS0wLjIsMC41LTAuNXYtMy40aDMuNGMwLjMsMCwwLjUtMC4yLDAuNS0wLjVzLTAuMi0wLjUtMC41LTAuNWgtMy40di0zLjRjMC0wLjMtMC4yLTAuNS0wLjUtMC41cy0wLjUsMC4yLTAuNSwwLjV2My40SDYuNAoJQzUuOSw2OS45LDUuNyw3MC4xLDUuNyw3MC40TDUuNyw3MC40eiIvPgo8L3N2Zz4=';
|
|
18057
|
+
|
|
18058
|
+
function BtnPlus() {
|
|
18059
|
+
var _useReactionsModeStat = useReactionsModeState(),
|
|
18060
|
+
setReactionsMode = _useReactionsModeStat[1];
|
|
18061
|
+
return React.createElement(Button, {
|
|
18062
|
+
"aria-label": "Show all Emojis",
|
|
18063
|
+
title: "Show all Emojis",
|
|
18064
|
+
tabIndex: 0,
|
|
18065
|
+
className: flairup.cx(styles$4.plusSign),
|
|
18066
|
+
onClick: function onClick() {
|
|
18067
|
+
return setReactionsMode(false);
|
|
18068
|
+
}
|
|
18069
|
+
});
|
|
18070
|
+
}
|
|
18071
|
+
var styles$4 = /*#__PURE__*/stylesheet.create({
|
|
18072
|
+
plusSign: {
|
|
18073
|
+
fontSize: '20px',
|
|
18074
|
+
padding: '18px',
|
|
18075
|
+
color: 'var(--epr-text-color)',
|
|
18076
|
+
borderRadius: '50%',
|
|
18077
|
+
textAlign: 'center',
|
|
18078
|
+
lineHeight: '100%',
|
|
18079
|
+
width: '20px',
|
|
18080
|
+
height: '20px',
|
|
18081
|
+
display: 'flex',
|
|
18082
|
+
justifyContent: 'center',
|
|
18083
|
+
alignItems: 'center',
|
|
18084
|
+
transition: 'background-color 0.1s ease-in-out',
|
|
18085
|
+
':after': {
|
|
18086
|
+
content: '',
|
|
18087
|
+
minWidth: '20px',
|
|
18088
|
+
minHeight: '20px',
|
|
18089
|
+
backgroundImage: "url(" + Plus + ")",
|
|
18090
|
+
backgroundColor: 'transparent',
|
|
18091
|
+
backgroundRepeat: 'no-repeat',
|
|
18092
|
+
backgroundSize: '20px',
|
|
18093
|
+
backgroundPositionY: '0'
|
|
18094
|
+
},
|
|
18095
|
+
':hover': {
|
|
18096
|
+
color: 'var(--epr-highlight-color)',
|
|
18097
|
+
backgroundColor: 'var(--epr-hover-bg-color)',
|
|
18098
|
+
// @ts-ignore
|
|
18099
|
+
':after': {
|
|
18100
|
+
backgroundPositionY: '-20px'
|
|
18101
|
+
}
|
|
18102
|
+
},
|
|
18103
|
+
':focus': {
|
|
18104
|
+
color: 'var(--epr-highlight-color)',
|
|
18105
|
+
backgroundColor: 'var(--epr-hover-bg-color)',
|
|
18106
|
+
// @ts-ignore
|
|
18107
|
+
':after': {
|
|
18108
|
+
backgroundPositionY: '-40px'
|
|
18109
|
+
}
|
|
18110
|
+
}
|
|
18111
|
+
},
|
|
18112
|
+
'.epr-dark-theme': {
|
|
18113
|
+
plusSign: {
|
|
18114
|
+
':after': {
|
|
18115
|
+
backgroundPositionY: '-40px'
|
|
18116
|
+
},
|
|
18117
|
+
':hover:after': {
|
|
18118
|
+
backgroundPositionY: '-60px'
|
|
18119
|
+
}
|
|
18120
|
+
}
|
|
18121
|
+
},
|
|
18122
|
+
'.epr-auto-theme': {
|
|
18123
|
+
plusSign: {
|
|
18124
|
+
'@media (prefers-color-scheme: dark)': {
|
|
18125
|
+
':after': {
|
|
18126
|
+
backgroundPositionY: '-40px'
|
|
18127
|
+
},
|
|
18128
|
+
':hover:after': {
|
|
18129
|
+
backgroundPositionY: '-60px'
|
|
18130
|
+
}
|
|
18131
|
+
}
|
|
18132
|
+
}
|
|
18133
|
+
}
|
|
18134
|
+
});
|
|
18135
|
+
|
|
18136
|
+
function Reactions() {
|
|
18137
|
+
var _useReactionsModeStat = useReactionsModeState(),
|
|
18138
|
+
reactionsOpen = _useReactionsModeStat[0];
|
|
18139
|
+
var ReactionsRef = useReactionsRef();
|
|
18140
|
+
var reactions = useReactionsConfig();
|
|
18141
|
+
useMouseDownHandlers(ReactionsRef, MOUSE_EVENT_SOURCE.REACTIONS);
|
|
18142
|
+
var emojiStyle = useEmojiStyleConfig();
|
|
18143
|
+
if (!reactionsOpen) {
|
|
18144
|
+
return null;
|
|
18145
|
+
}
|
|
18146
|
+
return React.createElement("ul", {
|
|
18147
|
+
className: flairup.cx(styles$5.list, !reactionsOpen && commonStyles.hidden),
|
|
18148
|
+
ref: ReactionsRef
|
|
18149
|
+
}, reactions.map(function (reaction) {
|
|
18150
|
+
return React.createElement("li", {
|
|
18151
|
+
key: reaction
|
|
18152
|
+
}, React.createElement(ClickableEmoji, {
|
|
18153
|
+
emoji: emojiByUnified(reaction),
|
|
18154
|
+
emojiStyle: emojiStyle,
|
|
18155
|
+
unified: reaction,
|
|
18156
|
+
showVariations: false,
|
|
18157
|
+
round: true
|
|
18158
|
+
}));
|
|
18159
|
+
}), React.createElement("li", null, React.createElement(BtnPlus, null)));
|
|
18160
|
+
}
|
|
18161
|
+
var styles$5 = /*#__PURE__*/stylesheet.create({
|
|
18162
|
+
list: {
|
|
18163
|
+
listStyle: 'none',
|
|
18164
|
+
margin: '0',
|
|
18165
|
+
padding: '0 5px',
|
|
18166
|
+
display: 'flex',
|
|
18167
|
+
justifyContent: 'space-between',
|
|
18168
|
+
alignItems: 'center',
|
|
18169
|
+
height: '100%'
|
|
18170
|
+
}
|
|
18171
|
+
});
|
|
18172
|
+
|
|
18173
|
+
function useDisallowMouseMove() {
|
|
18174
|
+
var DisallowMouseRef = useDisallowMouseRef();
|
|
18175
|
+
return function disallowMouseMove() {
|
|
18176
|
+
DisallowMouseRef.current = true;
|
|
18177
|
+
};
|
|
18178
|
+
}
|
|
18179
|
+
function useAllowMouseMove() {
|
|
18180
|
+
var DisallowMouseRef = useDisallowMouseRef();
|
|
18181
|
+
return function allowMouseMove() {
|
|
18182
|
+
DisallowMouseRef.current = false;
|
|
18183
|
+
};
|
|
18184
|
+
}
|
|
18185
|
+
function useIsMouseDisallowed() {
|
|
18186
|
+
var DisallowMouseRef = useDisallowMouseRef();
|
|
18187
|
+
return function isMouseDisallowed() {
|
|
18188
|
+
return DisallowMouseRef.current;
|
|
18189
|
+
};
|
|
18190
|
+
}
|
|
18191
|
+
function useOnMouseMove() {
|
|
18192
|
+
var BodyRef = useBodyRef();
|
|
18193
|
+
var allowMouseMove = useAllowMouseMove();
|
|
18194
|
+
var isMouseDisallowed = useIsMouseDisallowed();
|
|
18195
|
+
React.useEffect(function () {
|
|
18196
|
+
var bodyRef = BodyRef.current;
|
|
18197
|
+
bodyRef == null ? void 0 : bodyRef.addEventListener('mousemove', onMouseMove, {
|
|
18198
|
+
passive: true
|
|
18199
|
+
});
|
|
18200
|
+
function onMouseMove() {
|
|
18201
|
+
if (isMouseDisallowed()) {
|
|
18202
|
+
allowMouseMove();
|
|
18203
|
+
}
|
|
18204
|
+
}
|
|
18205
|
+
return function () {
|
|
18206
|
+
bodyRef == null ? void 0 : bodyRef.removeEventListener('mousemove', onMouseMove);
|
|
18207
|
+
};
|
|
18208
|
+
}, [BodyRef, allowMouseMove, isMouseDisallowed]);
|
|
18209
|
+
}
|
|
18210
|
+
|
|
17813
18211
|
function useOnScroll(BodyRef) {
|
|
17814
18212
|
var closeAllOpenToggles = useCloseAllOpenToggles();
|
|
17815
18213
|
React.useEffect(function () {
|
|
@@ -18053,228 +18451,6 @@ function useIsEmojiHidden() {
|
|
|
18053
18451
|
};
|
|
18054
18452
|
}
|
|
18055
18453
|
|
|
18056
|
-
function Button(props) {
|
|
18057
|
-
return React.createElement("button", Object.assign({
|
|
18058
|
-
type: "button"
|
|
18059
|
-
}, props, {
|
|
18060
|
-
className: flairup.cx(styles.button, props.className)
|
|
18061
|
-
}), props.children);
|
|
18062
|
-
}
|
|
18063
|
-
var styles = /*#__PURE__*/stylesheet.create({
|
|
18064
|
-
button: {
|
|
18065
|
-
'.': 'epr-btn',
|
|
18066
|
-
cursor: 'pointer',
|
|
18067
|
-
border: '0',
|
|
18068
|
-
background: 'none',
|
|
18069
|
-
outline: 'none'
|
|
18070
|
-
}
|
|
18071
|
-
});
|
|
18072
|
-
|
|
18073
|
-
function ClickableEmojiButton(_ref) {
|
|
18074
|
-
var _cx;
|
|
18075
|
-
var emojiNames = _ref.emojiNames,
|
|
18076
|
-
unified = _ref.unified,
|
|
18077
|
-
hidden = _ref.hidden,
|
|
18078
|
-
hiddenOnSearch = _ref.hiddenOnSearch,
|
|
18079
|
-
_ref$showVariations = _ref.showVariations,
|
|
18080
|
-
showVariations = _ref$showVariations === void 0 ? true : _ref$showVariations,
|
|
18081
|
-
hasVariations = _ref.hasVariations,
|
|
18082
|
-
children = _ref.children;
|
|
18083
|
-
return React.createElement(Button, {
|
|
18084
|
-
className: flairup.cx(styles$1.emoji, hidden && commonStyles.hidden, hiddenOnSearch && commonInteractionStyles.hiddenOnSearch, (_cx = {}, _cx[ClassNames.visible] = !hidden && !hiddenOnSearch, _cx), !!(hasVariations && showVariations) && styles$1.hasVariations),
|
|
18085
|
-
"data-unified": unified,
|
|
18086
|
-
"aria-label": emojiNames[0],
|
|
18087
|
-
"data-full-name": emojiNames
|
|
18088
|
-
}, children);
|
|
18089
|
-
}
|
|
18090
|
-
var styles$1 = /*#__PURE__*/stylesheet.create({
|
|
18091
|
-
emoji: {
|
|
18092
|
-
'.': ClassNames.emoji,
|
|
18093
|
-
position: 'relative',
|
|
18094
|
-
width: 'var(--epr-emoji-fullsize)',
|
|
18095
|
-
height: 'var(--epr-emoji-fullsize)',
|
|
18096
|
-
boxSizing: 'border-box',
|
|
18097
|
-
display: 'flex',
|
|
18098
|
-
alignItems: 'center',
|
|
18099
|
-
justifyContent: 'center',
|
|
18100
|
-
maxWidth: 'var(--epr-emoji-fullsize)',
|
|
18101
|
-
maxHeight: 'var(--epr-emoji-fullsize)',
|
|
18102
|
-
borderRadius: '8px',
|
|
18103
|
-
overflow: 'hidden',
|
|
18104
|
-
transition: 'background-color 0.2s',
|
|
18105
|
-
':hover': {
|
|
18106
|
-
backgroundColor: 'var(--epr-emoji-hover-color)'
|
|
18107
|
-
},
|
|
18108
|
-
':focus': {
|
|
18109
|
-
backgroundColor: 'var(--epr-focus-bg-color)'
|
|
18110
|
-
}
|
|
18111
|
-
},
|
|
18112
|
-
hasVariations: {
|
|
18113
|
-
'.': ClassNames.emojiHasVariations,
|
|
18114
|
-
':after': {
|
|
18115
|
-
content: '',
|
|
18116
|
-
display: 'block',
|
|
18117
|
-
width: '0',
|
|
18118
|
-
height: '0',
|
|
18119
|
-
right: '0px',
|
|
18120
|
-
bottom: '1px',
|
|
18121
|
-
position: 'absolute',
|
|
18122
|
-
borderLeft: '4px solid transparent',
|
|
18123
|
-
borderRight: '4px solid transparent',
|
|
18124
|
-
transform: 'rotate(135deg)',
|
|
18125
|
-
borderBottom: '4px solid var(--epr-emoji-variation-indicator-color)',
|
|
18126
|
-
zIndex: 'var(--epr-emoji-variations-indictator-z-index)'
|
|
18127
|
-
},
|
|
18128
|
-
':hover:after': {
|
|
18129
|
-
borderBottom: '4px solid var(--epr-emoji-variation-indicator-color-hover)'
|
|
18130
|
-
}
|
|
18131
|
-
}
|
|
18132
|
-
});
|
|
18133
|
-
|
|
18134
|
-
var emojiStyles = /*#__PURE__*/stylesheet.create({
|
|
18135
|
-
external: {
|
|
18136
|
-
'.': ClassNames.external,
|
|
18137
|
-
fontSize: '0'
|
|
18138
|
-
},
|
|
18139
|
-
common: {
|
|
18140
|
-
alignSelf: 'center',
|
|
18141
|
-
justifySelf: 'center',
|
|
18142
|
-
display: 'block'
|
|
18143
|
-
}
|
|
18144
|
-
});
|
|
18145
|
-
|
|
18146
|
-
function EmojiImg(_ref) {
|
|
18147
|
-
var emojiName = _ref.emojiName,
|
|
18148
|
-
style = _ref.style,
|
|
18149
|
-
_ref$lazyLoad = _ref.lazyLoad,
|
|
18150
|
-
lazyLoad = _ref$lazyLoad === void 0 ? false : _ref$lazyLoad,
|
|
18151
|
-
imgUrl = _ref.imgUrl,
|
|
18152
|
-
onError = _ref.onError,
|
|
18153
|
-
className = _ref.className;
|
|
18154
|
-
return React.createElement("img", {
|
|
18155
|
-
src: imgUrl,
|
|
18156
|
-
alt: emojiName,
|
|
18157
|
-
className: flairup.cx(styles$2.emojiImag, emojiStyles.external, emojiStyles.common, className),
|
|
18158
|
-
loading: lazyLoad ? 'lazy' : 'eager',
|
|
18159
|
-
onError: onError,
|
|
18160
|
-
style: style
|
|
18161
|
-
});
|
|
18162
|
-
}
|
|
18163
|
-
var styles$2 = /*#__PURE__*/stylesheet.create({
|
|
18164
|
-
emojiImag: {
|
|
18165
|
-
'.': 'epr-emoji-img',
|
|
18166
|
-
maxWidth: 'var(--epr-emoji-fullsize)',
|
|
18167
|
-
maxHeight: 'var(--epr-emoji-fullsize)',
|
|
18168
|
-
minWidth: 'var(--epr-emoji-fullsize)',
|
|
18169
|
-
minHeight: 'var(--epr-emoji-fullsize)',
|
|
18170
|
-
padding: 'var(--epr-emoji-padding)'
|
|
18171
|
-
}
|
|
18172
|
-
});
|
|
18173
|
-
|
|
18174
|
-
function NativeEmoji(_ref) {
|
|
18175
|
-
var unified = _ref.unified,
|
|
18176
|
-
style = _ref.style,
|
|
18177
|
-
className = _ref.className;
|
|
18178
|
-
return React.createElement("span", {
|
|
18179
|
-
className: flairup.cx(styles$3.nativeEmoji, emojiStyles.common, emojiStyles.external, className),
|
|
18180
|
-
"data-unified": unified,
|
|
18181
|
-
style: style
|
|
18182
|
-
}, parseNativeEmoji(unified));
|
|
18183
|
-
}
|
|
18184
|
-
var styles$3 = /*#__PURE__*/stylesheet.create({
|
|
18185
|
-
nativeEmoji: {
|
|
18186
|
-
'.': 'epr-emoji-native',
|
|
18187
|
-
fontFamily: '"Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji"!important',
|
|
18188
|
-
position: 'relative',
|
|
18189
|
-
lineHeight: '100%',
|
|
18190
|
-
fontSize: 'var(--epr-emoji-size)',
|
|
18191
|
-
textAlign: 'center',
|
|
18192
|
-
alignSelf: 'center',
|
|
18193
|
-
justifySelf: 'center',
|
|
18194
|
-
letterSpacing: '0',
|
|
18195
|
-
padding: 'var(--epr-emoji-padding)'
|
|
18196
|
-
}
|
|
18197
|
-
});
|
|
18198
|
-
|
|
18199
|
-
function ViewOnlyEmoji(_ref) {
|
|
18200
|
-
var emoji = _ref.emoji,
|
|
18201
|
-
unified = _ref.unified,
|
|
18202
|
-
emojiStyle = _ref.emojiStyle,
|
|
18203
|
-
size = _ref.size,
|
|
18204
|
-
lazyLoad = _ref.lazyLoad,
|
|
18205
|
-
_ref$getEmojiUrl = _ref.getEmojiUrl,
|
|
18206
|
-
getEmojiUrl = _ref$getEmojiUrl === void 0 ? emojiUrlByUnified : _ref$getEmojiUrl,
|
|
18207
|
-
className = _ref.className;
|
|
18208
|
-
var _useEmojisThatFailedT = useEmojisThatFailedToLoadState(),
|
|
18209
|
-
setEmojisThatFailedToLoad = _useEmojisThatFailedT[1];
|
|
18210
|
-
var style = {};
|
|
18211
|
-
if (size) {
|
|
18212
|
-
style.width = style.height = style.fontSize = size + "px";
|
|
18213
|
-
}
|
|
18214
|
-
var emojiToRender = emoji ? emoji : emojiByUnified(unified);
|
|
18215
|
-
if (!emojiToRender) {
|
|
18216
|
-
return null;
|
|
18217
|
-
}
|
|
18218
|
-
if (isCustomEmoji(emojiToRender)) {
|
|
18219
|
-
return React.createElement(EmojiImg, {
|
|
18220
|
-
style: style,
|
|
18221
|
-
emojiName: unified,
|
|
18222
|
-
emojiStyle: exports.EmojiStyle.NATIVE,
|
|
18223
|
-
lazyLoad: lazyLoad,
|
|
18224
|
-
imgUrl: emojiToRender.imgUrl,
|
|
18225
|
-
onError: onError,
|
|
18226
|
-
className: className
|
|
18227
|
-
});
|
|
18228
|
-
}
|
|
18229
|
-
return React.createElement(React.Fragment, null, emojiStyle === exports.EmojiStyle.NATIVE ? React.createElement(NativeEmoji, {
|
|
18230
|
-
unified: unified,
|
|
18231
|
-
style: style,
|
|
18232
|
-
className: className
|
|
18233
|
-
}) : React.createElement(EmojiImg, {
|
|
18234
|
-
style: style,
|
|
18235
|
-
emojiName: emojiName(emojiToRender),
|
|
18236
|
-
emojiStyle: emojiStyle,
|
|
18237
|
-
lazyLoad: lazyLoad,
|
|
18238
|
-
imgUrl: getEmojiUrl(unified, emojiStyle),
|
|
18239
|
-
onError: onError,
|
|
18240
|
-
className: className
|
|
18241
|
-
}));
|
|
18242
|
-
function onError() {
|
|
18243
|
-
setEmojisThatFailedToLoad(function (prev) {
|
|
18244
|
-
return new Set(prev).add(unified);
|
|
18245
|
-
});
|
|
18246
|
-
}
|
|
18247
|
-
}
|
|
18248
|
-
|
|
18249
|
-
function ClickableEmoji(_ref) {
|
|
18250
|
-
var emoji = _ref.emoji,
|
|
18251
|
-
unified = _ref.unified,
|
|
18252
|
-
hidden = _ref.hidden,
|
|
18253
|
-
hiddenOnSearch = _ref.hiddenOnSearch,
|
|
18254
|
-
emojiStyle = _ref.emojiStyle,
|
|
18255
|
-
_ref$showVariations = _ref.showVariations,
|
|
18256
|
-
showVariations = _ref$showVariations === void 0 ? true : _ref$showVariations,
|
|
18257
|
-
size = _ref.size,
|
|
18258
|
-
lazyLoad = _ref.lazyLoad,
|
|
18259
|
-
getEmojiUrl = _ref.getEmojiUrl;
|
|
18260
|
-
var hasVariations = emojiHasVariations(emoji);
|
|
18261
|
-
return React.createElement(ClickableEmojiButton, {
|
|
18262
|
-
hasVariations: hasVariations,
|
|
18263
|
-
showVariations: showVariations,
|
|
18264
|
-
hidden: hidden,
|
|
18265
|
-
hiddenOnSearch: hiddenOnSearch,
|
|
18266
|
-
emojiNames: emojiNames(emoji),
|
|
18267
|
-
unified: unified
|
|
18268
|
-
}, React.createElement(ViewOnlyEmoji, {
|
|
18269
|
-
unified: unified,
|
|
18270
|
-
emoji: emoji,
|
|
18271
|
-
size: size,
|
|
18272
|
-
emojiStyle: emojiStyle,
|
|
18273
|
-
lazyLoad: lazyLoad,
|
|
18274
|
-
getEmojiUrl: getEmojiUrl
|
|
18275
|
-
}));
|
|
18276
|
-
}
|
|
18277
|
-
|
|
18278
18454
|
function EmojiCategory(_ref) {
|
|
18279
18455
|
var categoryConfig = _ref.categoryConfig,
|
|
18280
18456
|
children = _ref.children,
|
|
@@ -18283,16 +18459,16 @@ function EmojiCategory(_ref) {
|
|
|
18283
18459
|
var category = categoryFromCategoryConfig(categoryConfig);
|
|
18284
18460
|
var categoryName = categoryNameFromCategoryConfig(categoryConfig);
|
|
18285
18461
|
return React.createElement("li", {
|
|
18286
|
-
className: flairup.cx(styles$
|
|
18462
|
+
className: flairup.cx(styles$6.category, hidden && commonStyles.hidden, hiddenOnSearch && commonInteractionStyles.hiddenOnSearch),
|
|
18287
18463
|
"data-name": category,
|
|
18288
18464
|
"aria-label": categoryName
|
|
18289
18465
|
}, React.createElement("h2", {
|
|
18290
|
-
className: flairup.cx(styles$
|
|
18466
|
+
className: flairup.cx(styles$6.label)
|
|
18291
18467
|
}, categoryName), React.createElement("div", {
|
|
18292
|
-
className: flairup.cx(styles$
|
|
18468
|
+
className: flairup.cx(styles$6.categoryContent)
|
|
18293
18469
|
}, children));
|
|
18294
18470
|
}
|
|
18295
|
-
var styles$
|
|
18471
|
+
var styles$6 = /*#__PURE__*/stylesheet.create({
|
|
18296
18472
|
category: {
|
|
18297
18473
|
'.': ClassNames.category,
|
|
18298
18474
|
':not(:has(.epr-visible))': {
|
|
@@ -18370,7 +18546,7 @@ function EmojiList() {
|
|
|
18370
18546
|
var categories = useCategoriesConfig();
|
|
18371
18547
|
var renderdCategoriesCountRef = React.useRef(0);
|
|
18372
18548
|
return React.createElement("ul", {
|
|
18373
|
-
className: flairup.cx(styles$
|
|
18549
|
+
className: flairup.cx(styles$7.emojiList)
|
|
18374
18550
|
}, categories.map(function (categoryConfig) {
|
|
18375
18551
|
var category = categoryFromCategoryConfig(categoryConfig);
|
|
18376
18552
|
if (category === exports.Categories.SUGGESTED) {
|
|
@@ -18439,7 +18615,7 @@ function RenderCategory(_ref) {
|
|
|
18439
18615
|
hidden: hiddenCounter === emojis.length
|
|
18440
18616
|
}, emojis);
|
|
18441
18617
|
}
|
|
18442
|
-
var styles$
|
|
18618
|
+
var styles$7 = /*#__PURE__*/stylesheet.create({
|
|
18443
18619
|
emojiList: {
|
|
18444
18620
|
'.': ClassNames.emojiList,
|
|
18445
18621
|
listStyle: 'none',
|
|
@@ -18578,7 +18754,7 @@ function EmojiVariationPicker() {
|
|
|
18578
18754
|
}
|
|
18579
18755
|
return React.createElement("div", {
|
|
18580
18756
|
ref: VariationPickerRef,
|
|
18581
|
-
className: flairup.cx(styles$
|
|
18757
|
+
className: flairup.cx(styles$8.variationPicker, getMenuDirection() === Direction.Down && styles$8.pointingUp, visible && styles$8.visible),
|
|
18582
18758
|
style: {
|
|
18583
18759
|
top: top
|
|
18584
18760
|
}
|
|
@@ -18592,7 +18768,7 @@ function EmojiVariationPicker() {
|
|
|
18592
18768
|
getEmojiUrl: getEmojiUrl
|
|
18593
18769
|
});
|
|
18594
18770
|
}) : null, React.createElement("div", {
|
|
18595
|
-
className: flairup.cx(styles$
|
|
18771
|
+
className: flairup.cx(styles$8.pointer),
|
|
18596
18772
|
style: pointerStyle
|
|
18597
18773
|
}));
|
|
18598
18774
|
}
|
|
@@ -18648,7 +18824,7 @@ function useVariationPickerTop(VariationPickerRef) {
|
|
|
18648
18824
|
return emojiOffsetTop - height;
|
|
18649
18825
|
}
|
|
18650
18826
|
}
|
|
18651
|
-
var styles$
|
|
18827
|
+
var styles$8 = /*#__PURE__*/stylesheet.create({
|
|
18652
18828
|
variationPicker: {
|
|
18653
18829
|
'.': ClassNames.variationPicker,
|
|
18654
18830
|
position: 'absolute',
|
|
@@ -18718,14 +18894,14 @@ var styles$6 = /*#__PURE__*/stylesheet.create({
|
|
|
18718
18894
|
function Body() {
|
|
18719
18895
|
var BodyRef = useBodyRef();
|
|
18720
18896
|
useOnScroll(BodyRef);
|
|
18721
|
-
useMouseDownHandlers(BodyRef);
|
|
18897
|
+
useMouseDownHandlers(BodyRef, MOUSE_EVENT_SOURCE.PICKER);
|
|
18722
18898
|
useOnMouseMove();
|
|
18723
18899
|
return React.createElement("div", {
|
|
18724
|
-
className: flairup.cx(styles$
|
|
18900
|
+
className: flairup.cx(styles$9.body, commonInteractionStyles.hiddenOnReactions),
|
|
18725
18901
|
ref: BodyRef
|
|
18726
18902
|
}, React.createElement(EmojiVariationPicker, null), React.createElement(EmojiList, null));
|
|
18727
18903
|
}
|
|
18728
|
-
var styles$
|
|
18904
|
+
var styles$9 = /*#__PURE__*/stylesheet.create({
|
|
18729
18905
|
body: {
|
|
18730
18906
|
'.': ClassNames.scrollBody,
|
|
18731
18907
|
flex: '1',
|
|
@@ -18825,10 +19001,10 @@ function Flex(_ref) {
|
|
|
18825
19001
|
direction = _ref$direction === void 0 ? FlexDirection.ROW : _ref$direction;
|
|
18826
19002
|
return React.createElement("div", {
|
|
18827
19003
|
style: _extends({}, style),
|
|
18828
|
-
className: flairup.cx(styles$
|
|
19004
|
+
className: flairup.cx(styles$a.flex, className, styles$a[direction])
|
|
18829
19005
|
}, children);
|
|
18830
19006
|
}
|
|
18831
|
-
var styles$
|
|
19007
|
+
var styles$a = /*#__PURE__*/stylesheet.create((_stylesheet$create = {
|
|
18832
19008
|
flex: {
|
|
18833
19009
|
display: 'flex'
|
|
18834
19010
|
}
|
|
@@ -18884,13 +19060,13 @@ function BtnSkinToneVariation(_ref) {
|
|
|
18884
19060
|
return React.createElement(Button, {
|
|
18885
19061
|
style: style,
|
|
18886
19062
|
onClick: onClick,
|
|
18887
|
-
className: flairup.cx("epr-tone-" + skinToneVariation, styles$
|
|
19063
|
+
className: flairup.cx("epr-tone-" + skinToneVariation, styles$b.tone, !isOpen && styles$b.closedTone, isActive && styles$b.active),
|
|
18888
19064
|
tabIndex: isOpen ? 0 : -1,
|
|
18889
19065
|
"aria-pressed": isActive,
|
|
18890
19066
|
"aria-label": "Skin tone " + skinTonesNamed[skinToneVariation]
|
|
18891
19067
|
});
|
|
18892
19068
|
}
|
|
18893
|
-
var styles$
|
|
19069
|
+
var styles$b = /*#__PURE__*/stylesheet.create({
|
|
18894
19070
|
closedTone: {
|
|
18895
19071
|
opacity: '0',
|
|
18896
19072
|
zIndex: '0'
|
|
@@ -18966,7 +19142,7 @@ function SkinTonePicker(_ref) {
|
|
|
18966
19142
|
var expandedSize = isOpen ? fullWidth : ITEM_SIZE + 'px';
|
|
18967
19143
|
var vertical = direction === SkinTonePickerDirection.VERTICAL;
|
|
18968
19144
|
return React.createElement(Relative, {
|
|
18969
|
-
className: flairup.cx(styles$
|
|
19145
|
+
className: flairup.cx(styles$c.skinTones, vertical && styles$c.vertical, isOpen && styles$c.open, vertical && isOpen && styles$c.verticalShadow),
|
|
18970
19146
|
style: vertical ? {
|
|
18971
19147
|
flexBasis: expandedSize,
|
|
18972
19148
|
height: expandedSize
|
|
@@ -18974,7 +19150,7 @@ function SkinTonePicker(_ref) {
|
|
|
18974
19150
|
flexBasis: expandedSize
|
|
18975
19151
|
}
|
|
18976
19152
|
}, React.createElement("div", {
|
|
18977
|
-
className: flairup.cx(styles$
|
|
19153
|
+
className: flairup.cx(styles$c.select),
|
|
18978
19154
|
ref: SkinTonePickerRef
|
|
18979
19155
|
}, skinToneVariations.map(function (skinToneVariation, i) {
|
|
18980
19156
|
var active = skinToneVariation === activeSkinTone;
|
|
@@ -19003,7 +19179,7 @@ var SkinTonePickerDirection;
|
|
|
19003
19179
|
SkinTonePickerDirection["VERTICAL"] = "epr-vertical";
|
|
19004
19180
|
SkinTonePickerDirection["HORIZONTAL"] = "epr-horizontal";
|
|
19005
19181
|
})(SkinTonePickerDirection || (SkinTonePickerDirection = {}));
|
|
19006
|
-
var styles$
|
|
19182
|
+
var styles$c = /*#__PURE__*/stylesheet.create({
|
|
19007
19183
|
skinTones: {
|
|
19008
19184
|
'.': 'epr-skin-tones',
|
|
19009
19185
|
'--': {
|
|
@@ -19069,7 +19245,7 @@ function Preview() {
|
|
|
19069
19245
|
return null;
|
|
19070
19246
|
}
|
|
19071
19247
|
return React.createElement(Flex, {
|
|
19072
|
-
className: flairup.cx(styles$
|
|
19248
|
+
className: flairup.cx(styles$d.preview, commonInteractionStyles.hiddenOnReactions)
|
|
19073
19249
|
}, React.createElement(PreviewBody, null), React.createElement(Space, null), isSkinToneInPreview ? React.createElement(SkinTonePickerMenu, null) : null);
|
|
19074
19250
|
}
|
|
19075
19251
|
function PreviewBody() {
|
|
@@ -19098,20 +19274,20 @@ function PreviewBody() {
|
|
|
19098
19274
|
emojiStyle: emojiStyle,
|
|
19099
19275
|
size: 45,
|
|
19100
19276
|
getEmojiUrl: getEmojiUrl,
|
|
19101
|
-
className: flairup.cx(styles$
|
|
19277
|
+
className: flairup.cx(styles$d.emoji)
|
|
19102
19278
|
}) : defaultEmoji ? React.createElement(ViewOnlyEmoji, {
|
|
19103
19279
|
unified: emojiUnified(defaultEmoji),
|
|
19104
19280
|
emoji: defaultEmoji,
|
|
19105
19281
|
emojiStyle: emojiStyle,
|
|
19106
19282
|
size: 45,
|
|
19107
19283
|
getEmojiUrl: getEmojiUrl,
|
|
19108
|
-
className: flairup.cx(styles$
|
|
19284
|
+
className: flairup.cx(styles$d.emoji)
|
|
19109
19285
|
}) : null), React.createElement("div", {
|
|
19110
|
-
className: flairup.cx(styles$
|
|
19286
|
+
className: flairup.cx(styles$d.label)
|
|
19111
19287
|
}, show ? emojiName(emoji) : defaultText));
|
|
19112
19288
|
}
|
|
19113
19289
|
}
|
|
19114
|
-
var styles$
|
|
19290
|
+
var styles$d = /*#__PURE__*/stylesheet.create({
|
|
19115
19291
|
preview: {
|
|
19116
19292
|
alignItems: 'center',
|
|
19117
19293
|
borderTop: '1px solid var(--epr-preview-border-color)',
|
|
@@ -19215,7 +19391,7 @@ function CategoryButton(_ref) {
|
|
|
19215
19391
|
onClick = _ref.onClick;
|
|
19216
19392
|
return React.createElement(Button, {
|
|
19217
19393
|
tabIndex: allowNavigation ? 0 : -1,
|
|
19218
|
-
className: flairup.cx(styles$
|
|
19394
|
+
className: flairup.cx(styles$e.catBtn, commonInteractionStyles.categoryBtn, "epr-icn-" + category, (_cx = {}, _cx[ClassNames.active] = isActiveCategory, _cx)),
|
|
19219
19395
|
onClick: onClick,
|
|
19220
19396
|
"aria-label": categoryNameFromCategoryConfig(categoryConfig),
|
|
19221
19397
|
"aria-selected": isActiveCategory,
|
|
@@ -19237,7 +19413,7 @@ var DarkInactivePosition = {
|
|
|
19237
19413
|
}
|
|
19238
19414
|
}
|
|
19239
19415
|
};
|
|
19240
|
-
var styles$
|
|
19416
|
+
var styles$e = /*#__PURE__*/stylesheet.create({
|
|
19241
19417
|
catBtn: {
|
|
19242
19418
|
'.': 'epr-cat-btn',
|
|
19243
19419
|
display: 'inline-block',
|
|
@@ -19312,7 +19488,7 @@ function CategoryNavigation() {
|
|
|
19312
19488
|
var CategoryNavigationRef = useCategoryNavigationRef();
|
|
19313
19489
|
var hideCustomCategory = useShouldHideCustomEmojis();
|
|
19314
19490
|
return React.createElement("div", {
|
|
19315
|
-
className: flairup.cx(styles$
|
|
19491
|
+
className: flairup.cx(styles$f.nav),
|
|
19316
19492
|
role: "tablist",
|
|
19317
19493
|
"aria-label": "Category navigation",
|
|
19318
19494
|
id: "epr-category-nav-id",
|
|
@@ -19337,7 +19513,7 @@ function CategoryNavigation() {
|
|
|
19337
19513
|
});
|
|
19338
19514
|
}));
|
|
19339
19515
|
}
|
|
19340
|
-
var styles$
|
|
19516
|
+
var styles$f = /*#__PURE__*/stylesheet.create({
|
|
19341
19517
|
nav: {
|
|
19342
19518
|
'.': 'epr-category-nav',
|
|
19343
19519
|
display: 'flex',
|
|
@@ -19366,12 +19542,12 @@ var SVGTimes = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz
|
|
|
19366
19542
|
function BtnClearSearch() {
|
|
19367
19543
|
var clearSearch = useClearSearch();
|
|
19368
19544
|
return React.createElement(Button, {
|
|
19369
|
-
className: flairup.cx(styles$
|
|
19545
|
+
className: flairup.cx(styles$g.btnClearSearch, commonInteractionStyles.visibleOnSearchOnly),
|
|
19370
19546
|
onClick: clearSearch,
|
|
19371
19547
|
"aria-label": "Clear",
|
|
19372
19548
|
title: "Clear"
|
|
19373
19549
|
}, React.createElement("div", {
|
|
19374
|
-
className: flairup.cx(styles$
|
|
19550
|
+
className: flairup.cx(styles$g.icnClearnSearch)
|
|
19375
19551
|
}));
|
|
19376
19552
|
}
|
|
19377
19553
|
var HoverDark = {
|
|
@@ -19381,7 +19557,7 @@ var HoverDark = {
|
|
|
19381
19557
|
}
|
|
19382
19558
|
}
|
|
19383
19559
|
};
|
|
19384
|
-
var styles$
|
|
19560
|
+
var styles$g = /*#__PURE__*/stylesheet.create({
|
|
19385
19561
|
btnClearSearch: {
|
|
19386
19562
|
'.': 'epr-btn-clear-search',
|
|
19387
19563
|
position: 'absolute',
|
|
@@ -19454,10 +19630,10 @@ var SVGMagnifier = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZG
|
|
|
19454
19630
|
|
|
19455
19631
|
function IcnSearch() {
|
|
19456
19632
|
return React.createElement("div", {
|
|
19457
|
-
className: flairup.cx(styles$
|
|
19633
|
+
className: flairup.cx(styles$h.icnSearch)
|
|
19458
19634
|
});
|
|
19459
19635
|
}
|
|
19460
|
-
var styles$
|
|
19636
|
+
var styles$h = /*#__PURE__*/stylesheet.create({
|
|
19461
19637
|
icnSearch: {
|
|
19462
19638
|
'.': 'epr-icn-search',
|
|
19463
19639
|
content: '',
|
|
@@ -19493,7 +19669,7 @@ function SearchContainer() {
|
|
|
19493
19669
|
return null;
|
|
19494
19670
|
}
|
|
19495
19671
|
return React.createElement(Flex, {
|
|
19496
|
-
className: flairup.cx(styles$
|
|
19672
|
+
className: flairup.cx(styles$i.overlay)
|
|
19497
19673
|
}, React.createElement(Search, null), isSkinToneInSearch ? React.createElement(SkinTonePicker, null) : null);
|
|
19498
19674
|
}
|
|
19499
19675
|
function Search() {
|
|
@@ -19511,7 +19687,7 @@ function Search() {
|
|
|
19511
19687
|
var input = SearchInputRef == null ? void 0 : SearchInputRef.current;
|
|
19512
19688
|
var value = input == null ? void 0 : input.value;
|
|
19513
19689
|
return React.createElement(Relative, {
|
|
19514
|
-
className: flairup.cx(styles$
|
|
19690
|
+
className: flairup.cx(styles$i.searchContainer)
|
|
19515
19691
|
}, React.createElement(CssSearch, {
|
|
19516
19692
|
value: value
|
|
19517
19693
|
}), React.createElement("input", {
|
|
@@ -19519,7 +19695,7 @@ function Search() {
|
|
|
19519
19695
|
autoFocus: autoFocus,
|
|
19520
19696
|
"aria-label": 'Type to search for an emoji',
|
|
19521
19697
|
onFocus: closeAllOpenToggles,
|
|
19522
|
-
className: flairup.cx(styles$
|
|
19698
|
+
className: flairup.cx(styles$i.search),
|
|
19523
19699
|
type: "text",
|
|
19524
19700
|
"aria-controls": "epr-search-id",
|
|
19525
19701
|
placeholder: placeholder,
|
|
@@ -19533,13 +19709,13 @@ function Search() {
|
|
|
19533
19709
|
ref: SearchInputRef
|
|
19534
19710
|
}), searchTerm ? React.createElement("div", {
|
|
19535
19711
|
role: "status",
|
|
19536
|
-
className: flairup.cx('epr-status-search-results', styles$
|
|
19712
|
+
className: flairup.cx('epr-status-search-results', styles$i.visuallyHidden),
|
|
19537
19713
|
"aria-live": "polite",
|
|
19538
19714
|
id: "epr-search-id",
|
|
19539
19715
|
"aria-atomic": "true"
|
|
19540
19716
|
}, statusSearchResults) : null, React.createElement(IcnSearch, null), React.createElement(BtnClearSearch, null));
|
|
19541
19717
|
}
|
|
19542
|
-
var styles$
|
|
19718
|
+
var styles$i = /*#__PURE__*/stylesheet.create({
|
|
19543
19719
|
overlay: {
|
|
19544
19720
|
padding: 'var(--epr-header-padding)',
|
|
19545
19721
|
zIndex: 'var(--epr-header-overlay-z-index)'
|
|
@@ -19641,7 +19817,7 @@ var styles$g = /*#__PURE__*/stylesheet.create({
|
|
|
19641
19817
|
|
|
19642
19818
|
function Header() {
|
|
19643
19819
|
return React.createElement(Relative, {
|
|
19644
|
-
className:
|
|
19820
|
+
className: flairup.cx('epr-header', commonInteractionStyles.hiddenOnReactions)
|
|
19645
19821
|
}, React.createElement(SearchContainer, null), React.createElement(CategoryNavigation, null));
|
|
19646
19822
|
}
|
|
19647
19823
|
|
|
@@ -20046,6 +20222,7 @@ function useOnFocus() {
|
|
|
20046
20222
|
}, [BodyRef, emojiStyle, getEmojiUrl]);
|
|
20047
20223
|
}
|
|
20048
20224
|
|
|
20225
|
+
var _excluded$1 = ["width", "height"];
|
|
20049
20226
|
function PickerMain(_ref) {
|
|
20050
20227
|
var children = _ref.children;
|
|
20051
20228
|
return React.createElement(PickerContextProvider, null, React.createElement(PickerStyleTag, null), React.createElement(PickerRootElement, null, children));
|
|
@@ -20053,6 +20230,8 @@ function PickerMain(_ref) {
|
|
|
20053
20230
|
function PickerRootElement(_ref2) {
|
|
20054
20231
|
var _cx;
|
|
20055
20232
|
var children = _ref2.children;
|
|
20233
|
+
var _useReactionsModeStat = useReactionsModeState(),
|
|
20234
|
+
reactionsMode = _useReactionsModeStat[0];
|
|
20056
20235
|
var theme = useThemeConfig();
|
|
20057
20236
|
var searchModeActive = useIsSearchMode();
|
|
20058
20237
|
var PickerMainRef = usePickerMainRef();
|
|
@@ -20060,10 +20239,17 @@ function PickerRootElement(_ref2) {
|
|
|
20060
20239
|
var style = useStyleConfig();
|
|
20061
20240
|
useKeyboardNavigation();
|
|
20062
20241
|
useOnFocus();
|
|
20242
|
+
var _ref3 = style || {},
|
|
20243
|
+
width = _ref3.width,
|
|
20244
|
+
height = _ref3.height,
|
|
20245
|
+
styleProps = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
|
|
20063
20246
|
return React.createElement("aside", {
|
|
20064
|
-
className: flairup.cx(styles$
|
|
20247
|
+
className: flairup.cx(styles$j.main, styles$j.baseVariables, theme === exports.Theme.DARK && styles$j.darkTheme, theme === exports.Theme.AUTO && styles$j.autoThemeDark, (_cx = {}, _cx[ClassNames.searchActive] = searchModeActive, _cx), reactionsMode && styles$j.reactionsMenu, className),
|
|
20065
20248
|
ref: PickerMainRef,
|
|
20066
|
-
style:
|
|
20249
|
+
style: _extends({}, styleProps, !reactionsMode && {
|
|
20250
|
+
height: height,
|
|
20251
|
+
width: width
|
|
20252
|
+
})
|
|
20067
20253
|
}, children);
|
|
20068
20254
|
}
|
|
20069
20255
|
var DarkTheme = {
|
|
@@ -20076,12 +20262,13 @@ var DarkTheme = {
|
|
|
20076
20262
|
'--epr-category-label-bg-color': 'var(--epr-dark-category-label-bg-color)',
|
|
20077
20263
|
'--epr-picker-border-color': 'var(--epr-dark-picker-border-color)',
|
|
20078
20264
|
'--epr-bg-color': 'var(--epr-dark-bg-color)',
|
|
20265
|
+
'--epr-reactions-bg-color': 'var(--epr-dark-reactions-bg-color)',
|
|
20079
20266
|
'--epr-search-input-bg-color-active': 'var(--epr-dark-search-input-bg-color-active)',
|
|
20080
20267
|
'--epr-emoji-variation-indicator-color': 'var(--epr-dark-emoji-variation-indicator-color)',
|
|
20081
20268
|
'--epr-category-icon-active-color': 'var(--epr-dark-category-icon-active-color)',
|
|
20082
20269
|
'--epr-skin-tone-picker-menu-color': 'var(--epr-dark-skin-tone-picker-menu-color)'
|
|
20083
20270
|
};
|
|
20084
|
-
var styles$
|
|
20271
|
+
var styles$j = /*#__PURE__*/stylesheet.create({
|
|
20085
20272
|
main: {
|
|
20086
20273
|
'.': ['epr-main', ClassNames.emojiPicker],
|
|
20087
20274
|
position: 'relative',
|
|
@@ -20093,6 +20280,7 @@ var styles$h = /*#__PURE__*/stylesheet.create({
|
|
|
20093
20280
|
borderColor: 'var(--epr-picker-border-color)',
|
|
20094
20281
|
backgroundColor: 'var(--epr-bg-color)',
|
|
20095
20282
|
overflow: 'hidden',
|
|
20283
|
+
transition: 'all 0.3s ease-in-out, background-color 0.1s ease-in-out',
|
|
20096
20284
|
// @ts-expect-error - need to work on this
|
|
20097
20285
|
'*': {
|
|
20098
20286
|
boxSizing: 'border-box',
|
|
@@ -20108,6 +20296,7 @@ var styles$h = /*#__PURE__*/stylesheet.create({
|
|
|
20108
20296
|
'--epr-search-input-bg-color': '#f6f6f6',
|
|
20109
20297
|
'--epr-picker-border-color': '#e7e7e7',
|
|
20110
20298
|
'--epr-bg-color': '#fff',
|
|
20299
|
+
'--epr-reactions-bg-color': '#ffffff90',
|
|
20111
20300
|
'--epr-category-icon-active-color': '#6aa8de',
|
|
20112
20301
|
'--epr-skin-tone-picker-menu-color': '#ffffff95',
|
|
20113
20302
|
'--epr-horizontal-padding': '10px',
|
|
@@ -20168,6 +20357,7 @@ var styles$h = /*#__PURE__*/stylesheet.create({
|
|
|
20168
20357
|
'--epr-dark-category-label-bg-color': '#222222e6',
|
|
20169
20358
|
'--epr-dark-picker-border-color': '#151617',
|
|
20170
20359
|
'--epr-dark-bg-color': '#222222',
|
|
20360
|
+
'--epr-dark-reactions-bg-color': '#22222290',
|
|
20171
20361
|
'--epr-dark-search-input-bg-color-active': 'var(--epr-dark)',
|
|
20172
20362
|
'--epr-dark-emoji-variation-indicator-color': '#444',
|
|
20173
20363
|
'--epr-dark-category-icon-active-color': '#3271b7',
|
|
@@ -20183,18 +20373,42 @@ var styles$h = /*#__PURE__*/stylesheet.create({
|
|
|
20183
20373
|
darkTheme: {
|
|
20184
20374
|
'.': ClassNames.darkTheme,
|
|
20185
20375
|
'--': DarkTheme
|
|
20376
|
+
},
|
|
20377
|
+
reactionsMenu: {
|
|
20378
|
+
'.': 'epr-reactions',
|
|
20379
|
+
height: '50px',
|
|
20380
|
+
display: 'inline-flex',
|
|
20381
|
+
backgroundColor: 'var(--epr-reactions-bg-color)',
|
|
20382
|
+
// @ts-expect-error - need to work on this
|
|
20383
|
+
backdropFilter: 'blur(8px)',
|
|
20384
|
+
'--': {
|
|
20385
|
+
'--epr-picker-border-radius': '50px'
|
|
20386
|
+
}
|
|
20186
20387
|
}
|
|
20187
20388
|
});
|
|
20188
20389
|
|
|
20189
20390
|
function EmojiPicker(props) {
|
|
20190
|
-
return React.createElement(ElementRefContextProvider, null, React.createElement(PickerConfigProvider, Object.assign({}, props), React.createElement(PickerMain, null, React.createElement(
|
|
20391
|
+
return React.createElement(ElementRefContextProvider, null, React.createElement(PickerConfigProvider, Object.assign({}, props), React.createElement(PickerMain, null, React.createElement(ContentControl, null))));
|
|
20392
|
+
}
|
|
20393
|
+
function ContentControl() {
|
|
20394
|
+
var _useReactionsModeStat = useReactionsModeState(),
|
|
20395
|
+
reactionsDefaultOpen = _useReactionsModeStat[0];
|
|
20396
|
+
var _React$useState = React.useState(!reactionsDefaultOpen),
|
|
20397
|
+
renderAll = _React$useState[0],
|
|
20398
|
+
setRenderAll = _React$useState[1];
|
|
20399
|
+
React.useEffect(function () {
|
|
20400
|
+
if (!renderAll) {
|
|
20401
|
+
setRenderAll(true);
|
|
20402
|
+
}
|
|
20403
|
+
}, []);
|
|
20404
|
+
return React.createElement(React.Fragment, null, React.createElement(Reactions, null), renderAll ? React.createElement(React.Fragment, null, React.createElement(Header, null), React.createElement(Body, null), React.createElement(Preview, null)) : null);
|
|
20191
20405
|
}
|
|
20192
20406
|
// eslint-disable-next-line complexity
|
|
20193
20407
|
var EmojiPickerReact = /*#__PURE__*/React.memo(EmojiPicker, function (prev, next) {
|
|
20194
20408
|
var _prev$customEmojis, _next$customEmojis;
|
|
20195
20409
|
var prevCustomEmojis = (_prev$customEmojis = prev.customEmojis) != null ? _prev$customEmojis : [];
|
|
20196
20410
|
var nextCustomEmojis = (_next$customEmojis = next.customEmojis) != null ? _next$customEmojis : [];
|
|
20197
|
-
return prev.emojiVersion === next.emojiVersion && prev.searchPlaceHolder === next.searchPlaceHolder && prev.searchPlaceholder === next.searchPlaceholder && prev.defaultSkinTone === next.defaultSkinTone && prev.skinTonesDisabled === next.skinTonesDisabled && prev.autoFocusSearch === next.autoFocusSearch && prev.emojiStyle === next.emojiStyle && prev.theme === next.theme && prev.suggestedEmojisMode === next.suggestedEmojisMode && prev.lazyLoadEmojis === next.lazyLoadEmojis && prev.className === next.className && prev.height === next.height && prev.width === next.width && prev.style === next.style && prev.searchDisabled === next.searchDisabled && prev.skinTonePickerLocation === next.skinTonePickerLocation && prevCustomEmojis.length === nextCustomEmojis.length;
|
|
20411
|
+
return prev.emojiVersion === next.emojiVersion && prev.reactionsDefaultOpen === next.reactionsDefaultOpen && prev.searchPlaceHolder === next.searchPlaceHolder && prev.searchPlaceholder === next.searchPlaceholder && prev.defaultSkinTone === next.defaultSkinTone && prev.skinTonesDisabled === next.skinTonesDisabled && prev.autoFocusSearch === next.autoFocusSearch && prev.emojiStyle === next.emojiStyle && prev.theme === next.theme && prev.suggestedEmojisMode === next.suggestedEmojisMode && prev.lazyLoadEmojis === next.lazyLoadEmojis && prev.className === next.className && prev.height === next.height && prev.width === next.width && prev.style === next.style && prev.searchDisabled === next.searchDisabled && prev.skinTonePickerLocation === next.skinTonePickerLocation && prevCustomEmojis.length === nextCustomEmojis.length;
|
|
20198
20412
|
});
|
|
20199
20413
|
|
|
20200
20414
|
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -20252,7 +20466,8 @@ function ExportedEmoji(_ref) {
|
|
|
20252
20466
|
|
|
20253
20467
|
function EmojiPicker$1(props) {
|
|
20254
20468
|
var MutableConfigRef = useDefineMutableConfig({
|
|
20255
|
-
onEmojiClick: props.onEmojiClick
|
|
20469
|
+
onEmojiClick: props.onEmojiClick,
|
|
20470
|
+
onReactionClick: props.onReactionClick
|
|
20256
20471
|
});
|
|
20257
20472
|
return React.createElement(ErrorBoundary, null, React.createElement(MutableConfigContext.Provider, {
|
|
20258
20473
|
value: MutableConfigRef
|