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