@atlaskit/reactions 33.2.19 → 33.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Counter.js +1 -1
- package/dist/cjs/components/EmojiButton.js +1 -1
- package/dist/cjs/components/FlashAnimation.js +1 -1
- package/dist/cjs/components/Reaction.js +1 -1
- package/dist/cjs/components/ReactionButton.js +1 -1
- package/dist/cjs/components/ReactionParticleEffect.js +1 -1
- package/dist/cjs/components/ReactionPicker.js +31 -20
- package/dist/cjs/components/ReactionSummaryButton.js +1 -1
- package/dist/cjs/components/ReactionSummaryView.js +1 -1
- package/dist/cjs/components/ReactionTooltip.js +1 -1
- package/dist/cjs/components/ReactionView.js +1 -1
- package/dist/cjs/components/Reactions.js +2 -8
- package/dist/cjs/components/ReactionsDialog.js +1 -1
- package/dist/cjs/components/ReactionsDialogHeader.compiled.css +1 -1
- package/dist/cjs/components/ReactionsDialogHeader.js +2 -5
- package/dist/cjs/components/ReactionsDialogTrigger.js +1 -1
- package/dist/cjs/components/Selector.js +1 -1
- package/dist/cjs/components/StaticReaction.js +1 -1
- package/dist/cjs/components/Trigger.js +1 -1
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -7
- package/dist/cjs/index.js +6 -8
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Counter.js +1 -1
- package/dist/es2019/components/EmojiButton.js +1 -1
- package/dist/es2019/components/FlashAnimation.js +1 -1
- package/dist/es2019/components/Reaction.js +1 -1
- package/dist/es2019/components/ReactionButton.js +1 -1
- package/dist/es2019/components/ReactionParticleEffect.js +1 -1
- package/dist/es2019/components/ReactionPicker.js +29 -18
- package/dist/es2019/components/ReactionSummaryButton.js +1 -1
- package/dist/es2019/components/ReactionSummaryView.js +1 -1
- package/dist/es2019/components/ReactionTooltip.js +1 -1
- package/dist/es2019/components/ReactionView.js +1 -1
- package/dist/es2019/components/Reactions.js +2 -8
- package/dist/es2019/components/ReactionsDialog.js +1 -1
- package/dist/es2019/components/ReactionsDialogHeader.js +1 -1
- package/dist/es2019/components/ReactionsDialogTrigger.js +1 -1
- package/dist/es2019/components/Selector.js +1 -1
- package/dist/es2019/components/StaticReaction.js +1 -1
- package/dist/es2019/components/Trigger.js +1 -1
- package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -7
- package/dist/es2019/index.js +1 -7
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Counter.js +1 -1
- package/dist/esm/components/EmojiButton.js +1 -1
- package/dist/esm/components/FlashAnimation.js +1 -1
- package/dist/esm/components/Reaction.js +1 -1
- package/dist/esm/components/ReactionButton.js +1 -1
- package/dist/esm/components/ReactionParticleEffect.js +1 -1
- package/dist/esm/components/ReactionPicker.js +32 -21
- package/dist/esm/components/ReactionSummaryButton.js +1 -1
- package/dist/esm/components/ReactionSummaryView.js +1 -1
- package/dist/esm/components/ReactionTooltip.js +1 -1
- package/dist/esm/components/ReactionView.js +1 -1
- package/dist/esm/components/Reactions.js +2 -8
- package/dist/esm/components/ReactionsDialog.js +1 -1
- package/dist/esm/components/ReactionsDialogHeader.compiled.css +1 -1
- package/dist/esm/components/ReactionsDialogHeader.js +2 -5
- package/dist/esm/components/ReactionsDialogTrigger.js +1 -1
- package/dist/esm/components/Selector.js +1 -1
- package/dist/esm/components/StaticReaction.js +1 -1
- package/dist/esm/components/Trigger.js +1 -1
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -7
- package/dist/esm/index.js +1 -7
- package/dist/types/components/ReactionPicker.d.ts +7 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/components/ReactionPicker.d.ts +7 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +4 -10
- package/dist/cjs/components/ReactionPickerNew.compiled.css +0 -11
- package/dist/cjs/components/ReactionPickerNew.js +0 -421
- package/dist/es2019/components/ReactionPickerNew.compiled.css +0 -11
- package/dist/es2019/components/ReactionPickerNew.js +0 -374
- package/dist/esm/components/ReactionPickerNew.compiled.css +0 -11
- package/dist/esm/components/ReactionPickerNew.js +0 -412
- package/dist/types/components/ReactionPickerNew.d.ts +0 -114
- package/dist/types-ts4.5/components/ReactionPickerNew.d.ts +0 -114
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
/* ReactionPickerNew.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
-
import "./ReactionPickerNew.compiled.css";
|
|
3
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
-
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
6
|
-
import { EmojiPicker } from '@atlaskit/emoji/picker';
|
|
7
|
-
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
8
|
-
import { layers } from '@atlaskit/theme/constants';
|
|
9
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
-
import { useCloseManagerV2 } from '../hooks/useCloseManager';
|
|
12
|
-
import { useDelayedState } from '../hooks/useDelayedState';
|
|
13
|
-
import { useFocusTrap } from '../hooks/useFocusTrap';
|
|
14
|
-
import { messages } from '../shared/i18n';
|
|
15
|
-
import { PickerRender } from '../ufo';
|
|
16
|
-
import { Selector } from './Selector';
|
|
17
|
-
import { Trigger } from './Trigger';
|
|
18
|
-
import { RepositionOnUpdate } from './RepositionOnUpdate';
|
|
19
|
-
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
20
|
-
import Portal from '@atlaskit/portal';
|
|
21
|
-
const pickerStyle = null;
|
|
22
|
-
const popupWrapperStyle = null;
|
|
23
|
-
const popupStyle = null;
|
|
24
|
-
const popupStyleWithMarginTop = null;
|
|
25
|
-
const additionalStyles = {
|
|
26
|
-
selectorContainer: "_1e0c1txw"
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Test id for wrapper ReactionPicker div
|
|
31
|
-
*/
|
|
32
|
-
export const RENDER_REACTIONPICKER_TESTID = 'reactionPicker-testid';
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Test id for ReactionPicker panel div
|
|
36
|
-
*/
|
|
37
|
-
export const RENDER_REACTIONPICKERPANEL_TESTID = 'reactionPickerPanel-testid';
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Emoji Picker Controller Id for Accessibility Labels
|
|
41
|
-
*/
|
|
42
|
-
const PICKER_CONTROL_ID = 'emoji-picker';
|
|
43
|
-
/**
|
|
44
|
-
* Picker component for adding reactions
|
|
45
|
-
*/
|
|
46
|
-
export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
47
|
-
const {
|
|
48
|
-
miniMode,
|
|
49
|
-
className,
|
|
50
|
-
emojiProvider,
|
|
51
|
-
onSelection,
|
|
52
|
-
allowAllEmojis,
|
|
53
|
-
disabled,
|
|
54
|
-
pickerQuickReactionEmojiIds,
|
|
55
|
-
onShowMore = () => {},
|
|
56
|
-
onOpen = () => {},
|
|
57
|
-
onCancel = () => {},
|
|
58
|
-
tooltipContent = /*#__PURE__*/React.createElement(FormattedMessage, messages.addReaction),
|
|
59
|
-
emojiPickerSize,
|
|
60
|
-
showOpaqueBackground = false,
|
|
61
|
-
subtleReactionsSummaryAndPicker = false,
|
|
62
|
-
showAddReactionText = false,
|
|
63
|
-
reactionPickerTriggerIcon,
|
|
64
|
-
reactionPickerTriggerText,
|
|
65
|
-
reactionPickerPlacement,
|
|
66
|
-
isListItem = false,
|
|
67
|
-
hoverableReactionPicker = false,
|
|
68
|
-
hoverableReactionPickerDelay = 0
|
|
69
|
-
} = props;
|
|
70
|
-
const [triggerRef, setTriggerRef] = useState(null);
|
|
71
|
-
const [isHoverableReactionPickerEmojiPickerOpen, setIsHoverableReactionPickerEmojiPickerOpen] = useState(false);
|
|
72
|
-
const [isHoveringTrigger, setIsHoveringTrigger] = useState(false);
|
|
73
|
-
const [isHoveringPopup, setIsHoveringPopup] = useState(false);
|
|
74
|
-
const [isTriggerClicked, setIsTriggerClicked] = useState(false);
|
|
75
|
-
const [isPopupTrayOpen, setIsPopupTrayOpen] = useDelayedState(false, hoverableReactionPickerDelay);
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Container <div /> reference (used by custom hook to detect click outside)
|
|
79
|
-
*/
|
|
80
|
-
const wrapperRef = useRef(null);
|
|
81
|
-
const updatePopper = useRef();
|
|
82
|
-
const popperPlacement = reactionPickerPlacement || 'bottom-start';
|
|
83
|
-
const popperModifiers = [
|
|
84
|
-
/**
|
|
85
|
-
Removing this applyStyle modifier as it throws client errors ref:
|
|
86
|
-
https://popper.js.org/docs/v1/#modifiers
|
|
87
|
-
https://popper.js.org/docs/v1/#modifiers..applyStyle
|
|
88
|
-
{ name: 'applyStyle', enabled: false },
|
|
89
|
-
*/
|
|
90
|
-
{
|
|
91
|
-
name: 'hide',
|
|
92
|
-
enabled: false
|
|
93
|
-
}, {
|
|
94
|
-
name: 'offset',
|
|
95
|
-
enabled: true,
|
|
96
|
-
options: {
|
|
97
|
-
offset: [0, fg('platform-reactions-offset-based-popper') ? 4 : 0]
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
name: 'flip',
|
|
101
|
-
enabled: true,
|
|
102
|
-
options: {
|
|
103
|
-
flipVariations: true,
|
|
104
|
-
boundariesElement: 'scrollParent'
|
|
105
|
-
}
|
|
106
|
-
}];
|
|
107
|
-
const [settings, setSettings] = useState({
|
|
108
|
-
/**
|
|
109
|
-
* Show the full custom emoji list picker or the default list of emojis
|
|
110
|
-
*/
|
|
111
|
-
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0,
|
|
112
|
-
/**
|
|
113
|
-
* Use placement for popper based on reactionPickerPlacement prop
|
|
114
|
-
*/
|
|
115
|
-
popperPlacement
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Event callback when the picker is closed
|
|
120
|
-
* @param _id Optional id if an emoji button was selected or undefineed if was clicked outside the picker
|
|
121
|
-
*/
|
|
122
|
-
const close = useCallback(_id => {
|
|
123
|
-
setIsPopupTrayOpen(false, true);
|
|
124
|
-
// ufo abort reaction experience
|
|
125
|
-
PickerRender.abort({
|
|
126
|
-
metadata: {
|
|
127
|
-
emojiId: _id,
|
|
128
|
-
source: 'ReactionPicker',
|
|
129
|
-
reason: 'close dialog'
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
if (hoverableReactionPicker) {
|
|
133
|
-
setIsHoverableReactionPickerEmojiPickerOpen(false);
|
|
134
|
-
setIsTriggerClicked(false);
|
|
135
|
-
setIsHoveringTrigger(false);
|
|
136
|
-
setIsHoveringPopup(false);
|
|
137
|
-
}
|
|
138
|
-
}, [setIsPopupTrayOpen, setIsHoverableReactionPickerEmojiPickerOpen, hoverableReactionPicker, setIsTriggerClicked, setIsHoveringTrigger, setIsHoveringPopup]);
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Event handle rwhen selecting to show the custom emoji icons picker
|
|
142
|
-
* @param e event param
|
|
143
|
-
*/
|
|
144
|
-
const onSelectMoreClick = useCallback(e => {
|
|
145
|
-
e.preventDefault();
|
|
146
|
-
setSettings({
|
|
147
|
-
showFullPicker: hoverableReactionPicker ? settings.showFullPicker : true,
|
|
148
|
-
popperPlacement
|
|
149
|
-
});
|
|
150
|
-
setIsPopupTrayOpen(true);
|
|
151
|
-
if (hoverableReactionPicker) {
|
|
152
|
-
setIsHoverableReactionPickerEmojiPickerOpen(!isHoverableReactionPickerEmojiPickerOpen);
|
|
153
|
-
setIsTriggerClicked(false);
|
|
154
|
-
}
|
|
155
|
-
onShowMore();
|
|
156
|
-
}, [settings.showFullPicker, setIsPopupTrayOpen, onShowMore, popperPlacement, hoverableReactionPicker, setIsHoverableReactionPickerEmojiPickerOpen, isHoverableReactionPickerEmojiPickerOpen]);
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Event callback when an emoji icon is selected
|
|
160
|
-
* @param item selected item
|
|
161
|
-
*/
|
|
162
|
-
const onEmojiSelected = useCallback(item => {
|
|
163
|
-
// no emoji was selected
|
|
164
|
-
if (!item.id) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
onSelection(item.id, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? 'emojiPicker' : 'quickSelector');
|
|
168
|
-
close(item.id);
|
|
169
|
-
}, [close, onSelection, settings.showFullPicker, hoverableReactionPicker, isHoverableReactionPickerEmojiPickerOpen]);
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Event handler when the emoji icon to open the custom picker is selected
|
|
173
|
-
*/
|
|
174
|
-
const onTriggerClick = useCallback(() => {
|
|
175
|
-
// ufo start reactions picker open experience
|
|
176
|
-
PickerRender.start();
|
|
177
|
-
setSettings({
|
|
178
|
-
...settings,
|
|
179
|
-
popperPlacement
|
|
180
|
-
});
|
|
181
|
-
if (hoverableReactionPicker) {
|
|
182
|
-
if (isHoverableReactionPickerEmojiPickerOpen || isTriggerClicked) {
|
|
183
|
-
// if either the emoji picker is open or the trigger was clicked, close the popup and reset the state
|
|
184
|
-
setIsTriggerClicked(false);
|
|
185
|
-
setIsPopupTrayOpen(false, true);
|
|
186
|
-
} else {
|
|
187
|
-
// if neither condition is true, open the popup and set the state
|
|
188
|
-
setIsTriggerClicked(true);
|
|
189
|
-
setIsPopupTrayOpen(true, true);
|
|
190
|
-
}
|
|
191
|
-
// close the emoji picker
|
|
192
|
-
setIsHoverableReactionPickerEmojiPickerOpen(false);
|
|
193
|
-
} else {
|
|
194
|
-
setIsPopupTrayOpen(!isPopupTrayOpen);
|
|
195
|
-
}
|
|
196
|
-
onOpen();
|
|
197
|
-
// ufo reactions picker opened success
|
|
198
|
-
PickerRender.success();
|
|
199
|
-
}, [hoverableReactionPicker, isPopupTrayOpen, setIsPopupTrayOpen, isTriggerClicked, setIsTriggerClicked, isHoverableReactionPickerEmojiPickerOpen, onOpen, settings, popperPlacement]);
|
|
200
|
-
const handleTriggerMouseEnter = useCallback(() => {
|
|
201
|
-
if (hoverableReactionPicker) {
|
|
202
|
-
setIsHoveringTrigger(true);
|
|
203
|
-
if (!isHoverableReactionPickerEmojiPickerOpen) {
|
|
204
|
-
setIsPopupTrayOpen(true);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}, [hoverableReactionPicker, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen]);
|
|
208
|
-
const handleTriggerMouseLeave = useCallback(() => {
|
|
209
|
-
if (hoverableReactionPicker) {
|
|
210
|
-
setIsHoveringTrigger(false);
|
|
211
|
-
if (!isHoveringPopup && !isHoverableReactionPickerEmojiPickerOpen && !isTriggerClicked) {
|
|
212
|
-
setIsPopupTrayOpen(false);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}, [hoverableReactionPicker, isHoveringPopup, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen, isTriggerClicked]);
|
|
216
|
-
const handlePopupMouseEnter = useCallback(() => {
|
|
217
|
-
if (hoverableReactionPicker) {
|
|
218
|
-
setIsHoveringPopup(true);
|
|
219
|
-
if (!isHoverableReactionPickerEmojiPickerOpen) {
|
|
220
|
-
setIsPopupTrayOpen(true);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}, [hoverableReactionPicker, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen]);
|
|
224
|
-
const handlePopupMouseLeave = useCallback(() => {
|
|
225
|
-
if (hoverableReactionPicker) {
|
|
226
|
-
setIsHoveringPopup(false);
|
|
227
|
-
if (!isHoveringTrigger && !isHoverableReactionPickerEmojiPickerOpen && !isTriggerClicked) {
|
|
228
|
-
setIsPopupTrayOpen(false);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}, [hoverableReactionPicker, isHoveringTrigger, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen, isTriggerClicked]);
|
|
232
|
-
const wrapperClassName = ` ${isPopupTrayOpen ? 'isOpen' : ''} ${miniMode ? 'miniMode' : ''} ${className}`;
|
|
233
|
-
useLayoutEffect(() => {
|
|
234
|
-
var _updatePopper$current;
|
|
235
|
-
(_updatePopper$current = updatePopper.current) === null || _updatePopper$current === void 0 ? void 0 : _updatePopper$current.call(updatePopper);
|
|
236
|
-
}, [settings]);
|
|
237
|
-
const onClose = () => {
|
|
238
|
-
close();
|
|
239
|
-
onCancel();
|
|
240
|
-
};
|
|
241
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
242
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
243
|
-
className: ax(["_s7n4nkob _1pra1o8l", wrapperClassName]),
|
|
244
|
-
"data-testid": RENDER_REACTIONPICKER_TESTID,
|
|
245
|
-
ref: wrapperRef
|
|
246
|
-
}, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, ({
|
|
247
|
-
ref
|
|
248
|
-
}) =>
|
|
249
|
-
/*#__PURE__*/
|
|
250
|
-
// Render a button to open the <Selector /> panel
|
|
251
|
-
React.createElement(Box, {
|
|
252
|
-
onMouseEnter: handleTriggerMouseEnter,
|
|
253
|
-
onMouseLeave: handleTriggerMouseLeave
|
|
254
|
-
}, /*#__PURE__*/React.createElement(Trigger, {
|
|
255
|
-
ariaAttributes: {
|
|
256
|
-
'aria-expanded': isPopupTrayOpen,
|
|
257
|
-
'aria-controls': PICKER_CONTROL_ID
|
|
258
|
-
},
|
|
259
|
-
ref: node => {
|
|
260
|
-
if (node && isPopupTrayOpen) {
|
|
261
|
-
if (typeof ref === 'function') {
|
|
262
|
-
ref(node);
|
|
263
|
-
} else {
|
|
264
|
-
ref.current = node;
|
|
265
|
-
}
|
|
266
|
-
setTriggerRef(node);
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
isSelected: isPopupTrayOpen,
|
|
270
|
-
onClick: onTriggerClick,
|
|
271
|
-
miniMode: miniMode,
|
|
272
|
-
disabled: disabled,
|
|
273
|
-
tooltipContent: isPopupTrayOpen ? null : tooltipContent,
|
|
274
|
-
showOpaqueBackground: showOpaqueBackground,
|
|
275
|
-
showAddReactionText: showAddReactionText,
|
|
276
|
-
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
277
|
-
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
278
|
-
reactionPickerTriggerText: reactionPickerTriggerText,
|
|
279
|
-
isListItem: isListItem
|
|
280
|
-
}))), isPopupTrayOpen && /*#__PURE__*/React.createElement(Portal, {
|
|
281
|
-
zIndex: layers.flag()
|
|
282
|
-
}, /*#__PURE__*/React.createElement(PopperWrapper, {
|
|
283
|
-
settings: settings,
|
|
284
|
-
popperModifiers: popperModifiers,
|
|
285
|
-
isOpen: isPopupTrayOpen,
|
|
286
|
-
onClose: onClose,
|
|
287
|
-
triggerRef: triggerRef
|
|
288
|
-
}, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? /*#__PURE__*/React.createElement(EmojiPicker, {
|
|
289
|
-
emojiProvider: emojiProvider,
|
|
290
|
-
onSelection: onEmojiSelected,
|
|
291
|
-
size: emojiPickerSize
|
|
292
|
-
}) : /*#__PURE__*/React.createElement(Box, {
|
|
293
|
-
xcss: additionalStyles.selectorContainer,
|
|
294
|
-
onMouseEnter: handlePopupMouseEnter,
|
|
295
|
-
onMouseLeave: handlePopupMouseLeave
|
|
296
|
-
}, /*#__PURE__*/React.createElement(Selector, {
|
|
297
|
-
emojiProvider: emojiProvider,
|
|
298
|
-
onSelection: onEmojiSelected,
|
|
299
|
-
showMore: allowAllEmojis,
|
|
300
|
-
onMoreClick: onSelectMoreClick,
|
|
301
|
-
pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
|
|
302
|
-
hoverableReactionPickerSelector: hoverableReactionPicker
|
|
303
|
-
}))))));
|
|
304
|
-
});
|
|
305
|
-
export const PopperWrapper = props => {
|
|
306
|
-
const {
|
|
307
|
-
triggerRef,
|
|
308
|
-
settings,
|
|
309
|
-
isOpen,
|
|
310
|
-
onClose,
|
|
311
|
-
children,
|
|
312
|
-
popperModifiers
|
|
313
|
-
} = props;
|
|
314
|
-
const [popupRef, setPopupRef] = useState(null);
|
|
315
|
-
const {
|
|
316
|
-
formatMessage
|
|
317
|
-
} = useIntl();
|
|
318
|
-
/**
|
|
319
|
-
* add focus lock to popup
|
|
320
|
-
*/
|
|
321
|
-
useFocusTrap({
|
|
322
|
-
initialFocusRef: null,
|
|
323
|
-
targetRef: popupRef
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Custom hook triggers when user clicks outside the reactions picker
|
|
328
|
-
*/
|
|
329
|
-
useCloseManagerV2(popupRef, triggerRef, callbackType => {
|
|
330
|
-
onClose();
|
|
331
|
-
if (popupRef && callbackType === 'ESCAPE') {
|
|
332
|
-
requestAnimationFrame(() => triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.focus());
|
|
333
|
-
}
|
|
334
|
-
}, true, isOpen);
|
|
335
|
-
return /*#__PURE__*/React.createElement(Popper, {
|
|
336
|
-
placement: settings.popperPlacement,
|
|
337
|
-
modifiers: popperModifiers
|
|
338
|
-
}, ({
|
|
339
|
-
ref,
|
|
340
|
-
style,
|
|
341
|
-
update
|
|
342
|
-
}) => {
|
|
343
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
344
|
-
role: "group",
|
|
345
|
-
"aria-label": formatMessage(messages.popperWrapperLabel),
|
|
346
|
-
id: PICKER_CONTROL_ID,
|
|
347
|
-
"data-testid": RENDER_REACTIONPICKERPANEL_TESTID
|
|
348
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
349
|
-
,
|
|
350
|
-
style: {
|
|
351
|
-
zIndex: layers.layer(),
|
|
352
|
-
...style
|
|
353
|
-
},
|
|
354
|
-
ref: node => {
|
|
355
|
-
if (node) {
|
|
356
|
-
if (typeof ref === 'function') {
|
|
357
|
-
ref(node);
|
|
358
|
-
} else {
|
|
359
|
-
ref.current = node;
|
|
360
|
-
}
|
|
361
|
-
setPopupRef(node);
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
365
|
-
tabIndex: 0,
|
|
366
|
-
className: ax(["_nt751r31 _49pcglyw _1hvw1o36"])
|
|
367
|
-
}, /*#__PURE__*/React.createElement(RepositionOnUpdate, {
|
|
368
|
-
update: update,
|
|
369
|
-
settings: settings
|
|
370
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
371
|
-
className: ax(["_2rkofajl _bfhk1bhr _16qs1kf5 _79pa1b66", !fg('platform-reactions-offset-based-popper') && "_1bch1b66"])
|
|
372
|
-
}, children)));
|
|
373
|
-
});
|
|
374
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
._2rkofajl{border-radius:var(--ds-radius-small,3px)}._16qs1a23{box-shadow:var(--_3t1odq)}
|
|
3
|
-
._1bch1b66>div{margin-top:var(--ds-space-050,4px)}
|
|
4
|
-
._1e0c1txw{display:flex}
|
|
5
|
-
._1pra1o8l.miniMode{display:inline-block}
|
|
6
|
-
._79pa1b66>div{margin-bottom:var(--ds-space-050,4px)}
|
|
7
|
-
._bfhk13b4{background-color:var(--_1f6rtr1)}
|
|
8
|
-
._s7n4nkob{vertical-align:middle}
|
|
9
|
-
._1hvw1o36:focus{outline-width:medium}
|
|
10
|
-
._49pcglyw:focus{outline-style:none}
|
|
11
|
-
._nt751r31:focus{outline-color:currentColor}
|