emoji-picker-react 4.6.15 → 4.7.16-rc.0

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