@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,412 +0,0 @@
|
|
|
1
|
-
/* ReactionPickerNew.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import "./ReactionPickerNew.compiled.css";
|
|
5
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
9
|
-
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
10
|
-
import { EmojiPicker } from '@atlaskit/emoji/picker';
|
|
11
|
-
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
12
|
-
import { layers } from '@atlaskit/theme/constants';
|
|
13
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { useCloseManagerV2 } from '../hooks/useCloseManager';
|
|
16
|
-
import { useDelayedState } from '../hooks/useDelayedState';
|
|
17
|
-
import { useFocusTrap } from '../hooks/useFocusTrap';
|
|
18
|
-
import { messages } from '../shared/i18n';
|
|
19
|
-
import { PickerRender } from '../ufo';
|
|
20
|
-
import { Selector } from './Selector';
|
|
21
|
-
import { Trigger } from './Trigger';
|
|
22
|
-
import { RepositionOnUpdate } from './RepositionOnUpdate';
|
|
23
|
-
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
24
|
-
import Portal from '@atlaskit/portal';
|
|
25
|
-
var pickerStyle = null;
|
|
26
|
-
var popupWrapperStyle = null;
|
|
27
|
-
var popupStyle = null;
|
|
28
|
-
var popupStyleWithMarginTop = null;
|
|
29
|
-
var additionalStyles = {
|
|
30
|
-
selectorContainer: "_1e0c1txw"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Test id for wrapper ReactionPicker div
|
|
35
|
-
*/
|
|
36
|
-
export var RENDER_REACTIONPICKER_TESTID = 'reactionPicker-testid';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Test id for ReactionPicker panel div
|
|
40
|
-
*/
|
|
41
|
-
export var RENDER_REACTIONPICKERPANEL_TESTID = 'reactionPickerPanel-testid';
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Emoji Picker Controller Id for Accessibility Labels
|
|
45
|
-
*/
|
|
46
|
-
var PICKER_CONTROL_ID = 'emoji-picker';
|
|
47
|
-
/**
|
|
48
|
-
* Picker component for adding reactions
|
|
49
|
-
*/
|
|
50
|
-
export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
51
|
-
var miniMode = props.miniMode,
|
|
52
|
-
className = props.className,
|
|
53
|
-
emojiProvider = props.emojiProvider,
|
|
54
|
-
onSelection = props.onSelection,
|
|
55
|
-
allowAllEmojis = props.allowAllEmojis,
|
|
56
|
-
disabled = props.disabled,
|
|
57
|
-
pickerQuickReactionEmojiIds = props.pickerQuickReactionEmojiIds,
|
|
58
|
-
_props$onShowMore = props.onShowMore,
|
|
59
|
-
onShowMore = _props$onShowMore === void 0 ? function () {} : _props$onShowMore,
|
|
60
|
-
_props$onOpen = props.onOpen,
|
|
61
|
-
onOpen = _props$onOpen === void 0 ? function () {} : _props$onOpen,
|
|
62
|
-
_props$onCancel = props.onCancel,
|
|
63
|
-
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
64
|
-
_props$tooltipContent = props.tooltipContent,
|
|
65
|
-
tooltipContent = _props$tooltipContent === void 0 ? /*#__PURE__*/React.createElement(FormattedMessage, messages.addReaction) : _props$tooltipContent,
|
|
66
|
-
emojiPickerSize = props.emojiPickerSize,
|
|
67
|
-
_props$showOpaqueBack = props.showOpaqueBackground,
|
|
68
|
-
showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack,
|
|
69
|
-
_props$subtleReaction = props.subtleReactionsSummaryAndPicker,
|
|
70
|
-
subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction,
|
|
71
|
-
_props$showAddReactio = props.showAddReactionText,
|
|
72
|
-
showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio,
|
|
73
|
-
reactionPickerTriggerIcon = props.reactionPickerTriggerIcon,
|
|
74
|
-
reactionPickerTriggerText = props.reactionPickerTriggerText,
|
|
75
|
-
reactionPickerPlacement = props.reactionPickerPlacement,
|
|
76
|
-
_props$isListItem = props.isListItem,
|
|
77
|
-
isListItem = _props$isListItem === void 0 ? false : _props$isListItem,
|
|
78
|
-
_props$hoverableReact = props.hoverableReactionPicker,
|
|
79
|
-
hoverableReactionPicker = _props$hoverableReact === void 0 ? false : _props$hoverableReact,
|
|
80
|
-
_props$hoverableReact2 = props.hoverableReactionPickerDelay,
|
|
81
|
-
hoverableReactionPickerDelay = _props$hoverableReact2 === void 0 ? 0 : _props$hoverableReact2;
|
|
82
|
-
var _useState = useState(null),
|
|
83
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
-
triggerRef = _useState2[0],
|
|
85
|
-
setTriggerRef = _useState2[1];
|
|
86
|
-
var _useState3 = useState(false),
|
|
87
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
88
|
-
isHoverableReactionPickerEmojiPickerOpen = _useState4[0],
|
|
89
|
-
setIsHoverableReactionPickerEmojiPickerOpen = _useState4[1];
|
|
90
|
-
var _useState5 = useState(false),
|
|
91
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
92
|
-
isHoveringTrigger = _useState6[0],
|
|
93
|
-
setIsHoveringTrigger = _useState6[1];
|
|
94
|
-
var _useState7 = useState(false),
|
|
95
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
96
|
-
isHoveringPopup = _useState8[0],
|
|
97
|
-
setIsHoveringPopup = _useState8[1];
|
|
98
|
-
var _useState9 = useState(false),
|
|
99
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
100
|
-
isTriggerClicked = _useState0[0],
|
|
101
|
-
setIsTriggerClicked = _useState0[1];
|
|
102
|
-
var _useDelayedState = useDelayedState(false, hoverableReactionPickerDelay),
|
|
103
|
-
_useDelayedState2 = _slicedToArray(_useDelayedState, 2),
|
|
104
|
-
isPopupTrayOpen = _useDelayedState2[0],
|
|
105
|
-
setIsPopupTrayOpen = _useDelayedState2[1];
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Container <div /> reference (used by custom hook to detect click outside)
|
|
109
|
-
*/
|
|
110
|
-
var wrapperRef = useRef(null);
|
|
111
|
-
var updatePopper = useRef();
|
|
112
|
-
var popperPlacement = reactionPickerPlacement || 'bottom-start';
|
|
113
|
-
var popperModifiers = [
|
|
114
|
-
/**
|
|
115
|
-
Removing this applyStyle modifier as it throws client errors ref:
|
|
116
|
-
https://popper.js.org/docs/v1/#modifiers
|
|
117
|
-
https://popper.js.org/docs/v1/#modifiers..applyStyle
|
|
118
|
-
{ name: 'applyStyle', enabled: false },
|
|
119
|
-
*/
|
|
120
|
-
{
|
|
121
|
-
name: 'hide',
|
|
122
|
-
enabled: false
|
|
123
|
-
}, {
|
|
124
|
-
name: 'offset',
|
|
125
|
-
enabled: true,
|
|
126
|
-
options: {
|
|
127
|
-
offset: [0, fg('platform-reactions-offset-based-popper') ? 4 : 0]
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
name: 'flip',
|
|
131
|
-
enabled: true,
|
|
132
|
-
options: {
|
|
133
|
-
flipVariations: true,
|
|
134
|
-
boundariesElement: 'scrollParent'
|
|
135
|
-
}
|
|
136
|
-
}];
|
|
137
|
-
var _useState1 = useState({
|
|
138
|
-
/**
|
|
139
|
-
* Show the full custom emoji list picker or the default list of emojis
|
|
140
|
-
*/
|
|
141
|
-
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0,
|
|
142
|
-
/**
|
|
143
|
-
* Use placement for popper based on reactionPickerPlacement prop
|
|
144
|
-
*/
|
|
145
|
-
popperPlacement: popperPlacement
|
|
146
|
-
}),
|
|
147
|
-
_useState10 = _slicedToArray(_useState1, 2),
|
|
148
|
-
settings = _useState10[0],
|
|
149
|
-
setSettings = _useState10[1];
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Event callback when the picker is closed
|
|
153
|
-
* @param _id Optional id if an emoji button was selected or undefineed if was clicked outside the picker
|
|
154
|
-
*/
|
|
155
|
-
var close = useCallback(function (_id) {
|
|
156
|
-
setIsPopupTrayOpen(false, true);
|
|
157
|
-
// ufo abort reaction experience
|
|
158
|
-
PickerRender.abort({
|
|
159
|
-
metadata: {
|
|
160
|
-
emojiId: _id,
|
|
161
|
-
source: 'ReactionPicker',
|
|
162
|
-
reason: 'close dialog'
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
if (hoverableReactionPicker) {
|
|
166
|
-
setIsHoverableReactionPickerEmojiPickerOpen(false);
|
|
167
|
-
setIsTriggerClicked(false);
|
|
168
|
-
setIsHoveringTrigger(false);
|
|
169
|
-
setIsHoveringPopup(false);
|
|
170
|
-
}
|
|
171
|
-
}, [setIsPopupTrayOpen, setIsHoverableReactionPickerEmojiPickerOpen, hoverableReactionPicker, setIsTriggerClicked, setIsHoveringTrigger, setIsHoveringPopup]);
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Event handle rwhen selecting to show the custom emoji icons picker
|
|
175
|
-
* @param e event param
|
|
176
|
-
*/
|
|
177
|
-
var onSelectMoreClick = useCallback(function (e) {
|
|
178
|
-
e.preventDefault();
|
|
179
|
-
setSettings({
|
|
180
|
-
showFullPicker: hoverableReactionPicker ? settings.showFullPicker : true,
|
|
181
|
-
popperPlacement: popperPlacement
|
|
182
|
-
});
|
|
183
|
-
setIsPopupTrayOpen(true);
|
|
184
|
-
if (hoverableReactionPicker) {
|
|
185
|
-
setIsHoverableReactionPickerEmojiPickerOpen(!isHoverableReactionPickerEmojiPickerOpen);
|
|
186
|
-
setIsTriggerClicked(false);
|
|
187
|
-
}
|
|
188
|
-
onShowMore();
|
|
189
|
-
}, [settings.showFullPicker, setIsPopupTrayOpen, onShowMore, popperPlacement, hoverableReactionPicker, setIsHoverableReactionPickerEmojiPickerOpen, isHoverableReactionPickerEmojiPickerOpen]);
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Event callback when an emoji icon is selected
|
|
193
|
-
* @param item selected item
|
|
194
|
-
*/
|
|
195
|
-
var onEmojiSelected = useCallback(function (item) {
|
|
196
|
-
// no emoji was selected
|
|
197
|
-
if (!item.id) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
onSelection(item.id, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? 'emojiPicker' : 'quickSelector');
|
|
201
|
-
close(item.id);
|
|
202
|
-
}, [close, onSelection, settings.showFullPicker, hoverableReactionPicker, isHoverableReactionPickerEmojiPickerOpen]);
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Event handler when the emoji icon to open the custom picker is selected
|
|
206
|
-
*/
|
|
207
|
-
var onTriggerClick = useCallback(function () {
|
|
208
|
-
// ufo start reactions picker open experience
|
|
209
|
-
PickerRender.start();
|
|
210
|
-
setSettings(_objectSpread(_objectSpread({}, settings), {}, {
|
|
211
|
-
popperPlacement: popperPlacement
|
|
212
|
-
}));
|
|
213
|
-
if (hoverableReactionPicker) {
|
|
214
|
-
if (isHoverableReactionPickerEmojiPickerOpen || isTriggerClicked) {
|
|
215
|
-
// if either the emoji picker is open or the trigger was clicked, close the popup and reset the state
|
|
216
|
-
setIsTriggerClicked(false);
|
|
217
|
-
setIsPopupTrayOpen(false, true);
|
|
218
|
-
} else {
|
|
219
|
-
// if neither condition is true, open the popup and set the state
|
|
220
|
-
setIsTriggerClicked(true);
|
|
221
|
-
setIsPopupTrayOpen(true, true);
|
|
222
|
-
}
|
|
223
|
-
// close the emoji picker
|
|
224
|
-
setIsHoverableReactionPickerEmojiPickerOpen(false);
|
|
225
|
-
} else {
|
|
226
|
-
setIsPopupTrayOpen(!isPopupTrayOpen);
|
|
227
|
-
}
|
|
228
|
-
onOpen();
|
|
229
|
-
// ufo reactions picker opened success
|
|
230
|
-
PickerRender.success();
|
|
231
|
-
}, [hoverableReactionPicker, isPopupTrayOpen, setIsPopupTrayOpen, isTriggerClicked, setIsTriggerClicked, isHoverableReactionPickerEmojiPickerOpen, onOpen, settings, popperPlacement]);
|
|
232
|
-
var handleTriggerMouseEnter = useCallback(function () {
|
|
233
|
-
if (hoverableReactionPicker) {
|
|
234
|
-
setIsHoveringTrigger(true);
|
|
235
|
-
if (!isHoverableReactionPickerEmojiPickerOpen) {
|
|
236
|
-
setIsPopupTrayOpen(true);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}, [hoverableReactionPicker, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen]);
|
|
240
|
-
var handleTriggerMouseLeave = useCallback(function () {
|
|
241
|
-
if (hoverableReactionPicker) {
|
|
242
|
-
setIsHoveringTrigger(false);
|
|
243
|
-
if (!isHoveringPopup && !isHoverableReactionPickerEmojiPickerOpen && !isTriggerClicked) {
|
|
244
|
-
setIsPopupTrayOpen(false);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}, [hoverableReactionPicker, isHoveringPopup, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen, isTriggerClicked]);
|
|
248
|
-
var handlePopupMouseEnter = useCallback(function () {
|
|
249
|
-
if (hoverableReactionPicker) {
|
|
250
|
-
setIsHoveringPopup(true);
|
|
251
|
-
if (!isHoverableReactionPickerEmojiPickerOpen) {
|
|
252
|
-
setIsPopupTrayOpen(true);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}, [hoverableReactionPicker, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen]);
|
|
256
|
-
var handlePopupMouseLeave = useCallback(function () {
|
|
257
|
-
if (hoverableReactionPicker) {
|
|
258
|
-
setIsHoveringPopup(false);
|
|
259
|
-
if (!isHoveringTrigger && !isHoverableReactionPickerEmojiPickerOpen && !isTriggerClicked) {
|
|
260
|
-
setIsPopupTrayOpen(false);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}, [hoverableReactionPicker, isHoveringTrigger, isHoverableReactionPickerEmojiPickerOpen, setIsPopupTrayOpen, isTriggerClicked]);
|
|
264
|
-
var wrapperClassName = " ".concat(isPopupTrayOpen ? 'isOpen' : '', " ").concat(miniMode ? 'miniMode' : '', " ").concat(className);
|
|
265
|
-
useLayoutEffect(function () {
|
|
266
|
-
var _updatePopper$current;
|
|
267
|
-
(_updatePopper$current = updatePopper.current) === null || _updatePopper$current === void 0 || _updatePopper$current.call(updatePopper);
|
|
268
|
-
}, [settings]);
|
|
269
|
-
var onClose = function onClose() {
|
|
270
|
-
close();
|
|
271
|
-
onCancel();
|
|
272
|
-
};
|
|
273
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
274
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
275
|
-
className: ax(["_s7n4nkob _1pra1o8l", wrapperClassName]),
|
|
276
|
-
"data-testid": RENDER_REACTIONPICKER_TESTID,
|
|
277
|
-
ref: wrapperRef
|
|
278
|
-
}, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
|
|
279
|
-
var _ref2 = _ref.ref;
|
|
280
|
-
return (
|
|
281
|
-
/*#__PURE__*/
|
|
282
|
-
// Render a button to open the <Selector /> panel
|
|
283
|
-
React.createElement(Box, {
|
|
284
|
-
onMouseEnter: handleTriggerMouseEnter,
|
|
285
|
-
onMouseLeave: handleTriggerMouseLeave
|
|
286
|
-
}, /*#__PURE__*/React.createElement(Trigger, {
|
|
287
|
-
ariaAttributes: {
|
|
288
|
-
'aria-expanded': isPopupTrayOpen,
|
|
289
|
-
'aria-controls': PICKER_CONTROL_ID
|
|
290
|
-
},
|
|
291
|
-
ref: function ref(node) {
|
|
292
|
-
if (node && isPopupTrayOpen) {
|
|
293
|
-
if (typeof _ref2 === 'function') {
|
|
294
|
-
_ref2(node);
|
|
295
|
-
} else {
|
|
296
|
-
_ref2.current = node;
|
|
297
|
-
}
|
|
298
|
-
setTriggerRef(node);
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
isSelected: isPopupTrayOpen,
|
|
302
|
-
onClick: onTriggerClick,
|
|
303
|
-
miniMode: miniMode,
|
|
304
|
-
disabled: disabled,
|
|
305
|
-
tooltipContent: isPopupTrayOpen ? null : tooltipContent,
|
|
306
|
-
showOpaqueBackground: showOpaqueBackground,
|
|
307
|
-
showAddReactionText: showAddReactionText,
|
|
308
|
-
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
309
|
-
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
310
|
-
reactionPickerTriggerText: reactionPickerTriggerText,
|
|
311
|
-
isListItem: isListItem
|
|
312
|
-
}))
|
|
313
|
-
);
|
|
314
|
-
}), isPopupTrayOpen && /*#__PURE__*/React.createElement(Portal, {
|
|
315
|
-
zIndex: layers.flag()
|
|
316
|
-
}, /*#__PURE__*/React.createElement(PopperWrapper, {
|
|
317
|
-
settings: settings,
|
|
318
|
-
popperModifiers: popperModifiers,
|
|
319
|
-
isOpen: isPopupTrayOpen,
|
|
320
|
-
onClose: onClose,
|
|
321
|
-
triggerRef: triggerRef
|
|
322
|
-
}, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? /*#__PURE__*/React.createElement(EmojiPicker, {
|
|
323
|
-
emojiProvider: emojiProvider,
|
|
324
|
-
onSelection: onEmojiSelected,
|
|
325
|
-
size: emojiPickerSize
|
|
326
|
-
}) : /*#__PURE__*/React.createElement(Box, {
|
|
327
|
-
xcss: additionalStyles.selectorContainer,
|
|
328
|
-
onMouseEnter: handlePopupMouseEnter,
|
|
329
|
-
onMouseLeave: handlePopupMouseLeave
|
|
330
|
-
}, /*#__PURE__*/React.createElement(Selector, {
|
|
331
|
-
emojiProvider: emojiProvider,
|
|
332
|
-
onSelection: onEmojiSelected,
|
|
333
|
-
showMore: allowAllEmojis,
|
|
334
|
-
onMoreClick: onSelectMoreClick,
|
|
335
|
-
pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
|
|
336
|
-
hoverableReactionPickerSelector: hoverableReactionPicker
|
|
337
|
-
}))))));
|
|
338
|
-
});
|
|
339
|
-
export var PopperWrapper = function PopperWrapper(props) {
|
|
340
|
-
var triggerRef = props.triggerRef,
|
|
341
|
-
settings = props.settings,
|
|
342
|
-
isOpen = props.isOpen,
|
|
343
|
-
onClose = props.onClose,
|
|
344
|
-
children = props.children,
|
|
345
|
-
popperModifiers = props.popperModifiers;
|
|
346
|
-
var _useState11 = useState(null),
|
|
347
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
348
|
-
popupRef = _useState12[0],
|
|
349
|
-
setPopupRef = _useState12[1];
|
|
350
|
-
var _useIntl = useIntl(),
|
|
351
|
-
formatMessage = _useIntl.formatMessage;
|
|
352
|
-
/**
|
|
353
|
-
* add focus lock to popup
|
|
354
|
-
*/
|
|
355
|
-
useFocusTrap({
|
|
356
|
-
initialFocusRef: null,
|
|
357
|
-
targetRef: popupRef
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Custom hook triggers when user clicks outside the reactions picker
|
|
362
|
-
*/
|
|
363
|
-
useCloseManagerV2(popupRef, triggerRef, function (callbackType) {
|
|
364
|
-
onClose();
|
|
365
|
-
if (popupRef && callbackType === 'ESCAPE') {
|
|
366
|
-
requestAnimationFrame(function () {
|
|
367
|
-
return triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.focus();
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}, true, isOpen);
|
|
371
|
-
return /*#__PURE__*/React.createElement(Popper, {
|
|
372
|
-
placement: settings.popperPlacement,
|
|
373
|
-
modifiers: popperModifiers
|
|
374
|
-
}, function (_ref3) {
|
|
375
|
-
var _ref4 = _ref3.ref,
|
|
376
|
-
style = _ref3.style,
|
|
377
|
-
update = _ref3.update;
|
|
378
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
379
|
-
role: "group",
|
|
380
|
-
"aria-label": formatMessage(messages.popperWrapperLabel),
|
|
381
|
-
id: PICKER_CONTROL_ID,
|
|
382
|
-
"data-testid": RENDER_REACTIONPICKERPANEL_TESTID
|
|
383
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
384
|
-
,
|
|
385
|
-
style: _objectSpread({
|
|
386
|
-
zIndex: layers.layer()
|
|
387
|
-
}, style),
|
|
388
|
-
ref: function ref(node) {
|
|
389
|
-
if (node) {
|
|
390
|
-
if (typeof _ref4 === 'function') {
|
|
391
|
-
_ref4(node);
|
|
392
|
-
} else {
|
|
393
|
-
_ref4.current = node;
|
|
394
|
-
}
|
|
395
|
-
setPopupRef(node);
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
399
|
-
tabIndex: 0,
|
|
400
|
-
className: ax(["_nt751r31 _49pcglyw _1hvw1o36"])
|
|
401
|
-
}, /*#__PURE__*/React.createElement(RepositionOnUpdate, {
|
|
402
|
-
update: update,
|
|
403
|
-
settings: settings
|
|
404
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
405
|
-
className: ax(["_2rkofajl _bfhk13b4 _16qs1a23 _79pa1b66", !fg('platform-reactions-offset-based-popper') && "_1bch1b66"]),
|
|
406
|
-
style: {
|
|
407
|
-
"--_1f6rtr1": ix("var(--ds-surface-overlay, ".concat(N0, ")")),
|
|
408
|
-
"--_3t1odq": ix("var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"))
|
|
409
|
-
}
|
|
410
|
-
}, children)));
|
|
411
|
-
});
|
|
412
|
-
};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React, { type PropsWithChildren } from 'react';
|
|
6
|
-
import { type PickerSize } from '@atlaskit/emoji/types';
|
|
7
|
-
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
8
|
-
import { type PopperProps, type Placement } from '@atlaskit/popper';
|
|
9
|
-
import { type ReactionSource } from '../types';
|
|
10
|
-
import { type SelectorProps } from './Selector';
|
|
11
|
-
import { type TriggerProps } from './Trigger';
|
|
12
|
-
/**
|
|
13
|
-
* Test id for wrapper ReactionPicker div
|
|
14
|
-
*/
|
|
15
|
-
export declare const RENDER_REACTIONPICKER_TESTID = "reactionPicker-testid";
|
|
16
|
-
/**
|
|
17
|
-
* Test id for ReactionPicker panel div
|
|
18
|
-
*/
|
|
19
|
-
export declare const RENDER_REACTIONPICKERPANEL_TESTID = "reactionPickerPanel-testid";
|
|
20
|
-
export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickReactionEmojiIds'>, Partial<Pick<TriggerProps, 'tooltipContent' | 'miniMode'>> {
|
|
21
|
-
/**
|
|
22
|
-
* Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)
|
|
23
|
-
*/
|
|
24
|
-
allowAllEmojis?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Optional class name
|
|
27
|
-
*/
|
|
28
|
-
className?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Enable/Disable the button to be clickable (defaults to false)
|
|
31
|
-
*/
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Optional emoji picker size to control the size of emoji picker
|
|
35
|
-
*/
|
|
36
|
-
emojiPickerSize?: PickerSize;
|
|
37
|
-
/**
|
|
38
|
-
* Provider for loading emojis
|
|
39
|
-
*/
|
|
40
|
-
emojiProvider: Promise<EmojiProvider>;
|
|
41
|
-
/**
|
|
42
|
-
* Optional prop for hoverable reaction picker
|
|
43
|
-
*/
|
|
44
|
-
hoverableReactionPicker?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Optional prop to set a delay for the reaction picker when it opens/closes on hover
|
|
47
|
-
*/
|
|
48
|
-
hoverableReactionPickerDelay?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Optional prop to say if the reactions component is in a list
|
|
51
|
-
*/
|
|
52
|
-
isListItem?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Optional event handler when the emoji picker is clicked outside and closed
|
|
55
|
-
*/
|
|
56
|
-
onCancel?: () => void;
|
|
57
|
-
/**
|
|
58
|
-
* Optional event handler when the emoji picker is opened
|
|
59
|
-
*/
|
|
60
|
-
onOpen?: () => void;
|
|
61
|
-
/**
|
|
62
|
-
* Event callback when an emoji button is selected
|
|
63
|
-
* @param emojiId emoji unique id
|
|
64
|
-
* @param source source where the reaction was picked (either the initial default reactions or the custom reactions picker)
|
|
65
|
-
*/
|
|
66
|
-
onSelection: (emojiId: string, source: ReactionSource) => void;
|
|
67
|
-
/**
|
|
68
|
-
* Optional event handler when the custom emoji picker icon is selected
|
|
69
|
-
*/
|
|
70
|
-
onShowMore?: () => void;
|
|
71
|
-
/**
|
|
72
|
-
* Optional prop for controlling the picker location
|
|
73
|
-
*/
|
|
74
|
-
reactionPickerPlacement?: Placement;
|
|
75
|
-
/**
|
|
76
|
-
* Optional prop to set the strategy of the reaction picker popup
|
|
77
|
-
*/
|
|
78
|
-
reactionPickerStrategy?: PopperProps<{}>['strategy'];
|
|
79
|
-
/**
|
|
80
|
-
* Optional prop for controlling icon inside Trigger
|
|
81
|
-
*/
|
|
82
|
-
reactionPickerTriggerIcon?: React.ReactNode;
|
|
83
|
-
/**
|
|
84
|
-
* Optional prop for controlling text of the trigger button
|
|
85
|
-
*/
|
|
86
|
-
reactionPickerTriggerText?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Optional prop for displaying text to add a reaction
|
|
89
|
-
*/
|
|
90
|
-
showAddReactionText?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Optional prop for using an opaque button background instead of a transparent background
|
|
93
|
-
*/
|
|
94
|
-
showOpaqueBackground?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Optional prop for applying subtle styling to reaction summary and picker
|
|
97
|
-
*/
|
|
98
|
-
subtleReactionsSummaryAndPicker?: boolean;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Picker component for adding reactions
|
|
102
|
-
*/
|
|
103
|
-
export declare const ReactionPicker: React.MemoExoticComponent<(props: ReactionPickerProps) => JSX.Element>;
|
|
104
|
-
export interface PopperWrapperProps {
|
|
105
|
-
isOpen: boolean;
|
|
106
|
-
onClose: () => void;
|
|
107
|
-
popperModifiers?: PopperProps<{}>['modifiers'];
|
|
108
|
-
settings: {
|
|
109
|
-
popperPlacement: Placement;
|
|
110
|
-
showFullPicker: boolean;
|
|
111
|
-
};
|
|
112
|
-
triggerRef: HTMLDivElement | HTMLButtonElement | null;
|
|
113
|
-
}
|
|
114
|
-
export declare const PopperWrapper: (props: PropsWithChildren<PopperWrapperProps>) => JSX.Element;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React, { type PropsWithChildren } from 'react';
|
|
6
|
-
import { type PickerSize } from '@atlaskit/emoji/types';
|
|
7
|
-
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
8
|
-
import { type PopperProps, type Placement } from '@atlaskit/popper';
|
|
9
|
-
import { type ReactionSource } from '../types';
|
|
10
|
-
import { type SelectorProps } from './Selector';
|
|
11
|
-
import { type TriggerProps } from './Trigger';
|
|
12
|
-
/**
|
|
13
|
-
* Test id for wrapper ReactionPicker div
|
|
14
|
-
*/
|
|
15
|
-
export declare const RENDER_REACTIONPICKER_TESTID = "reactionPicker-testid";
|
|
16
|
-
/**
|
|
17
|
-
* Test id for ReactionPicker panel div
|
|
18
|
-
*/
|
|
19
|
-
export declare const RENDER_REACTIONPICKERPANEL_TESTID = "reactionPickerPanel-testid";
|
|
20
|
-
export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickReactionEmojiIds'>, Partial<Pick<TriggerProps, 'tooltipContent' | 'miniMode'>> {
|
|
21
|
-
/**
|
|
22
|
-
* Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)
|
|
23
|
-
*/
|
|
24
|
-
allowAllEmojis?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Optional class name
|
|
27
|
-
*/
|
|
28
|
-
className?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Enable/Disable the button to be clickable (defaults to false)
|
|
31
|
-
*/
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Optional emoji picker size to control the size of emoji picker
|
|
35
|
-
*/
|
|
36
|
-
emojiPickerSize?: PickerSize;
|
|
37
|
-
/**
|
|
38
|
-
* Provider for loading emojis
|
|
39
|
-
*/
|
|
40
|
-
emojiProvider: Promise<EmojiProvider>;
|
|
41
|
-
/**
|
|
42
|
-
* Optional prop for hoverable reaction picker
|
|
43
|
-
*/
|
|
44
|
-
hoverableReactionPicker?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Optional prop to set a delay for the reaction picker when it opens/closes on hover
|
|
47
|
-
*/
|
|
48
|
-
hoverableReactionPickerDelay?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Optional prop to say if the reactions component is in a list
|
|
51
|
-
*/
|
|
52
|
-
isListItem?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Optional event handler when the emoji picker is clicked outside and closed
|
|
55
|
-
*/
|
|
56
|
-
onCancel?: () => void;
|
|
57
|
-
/**
|
|
58
|
-
* Optional event handler when the emoji picker is opened
|
|
59
|
-
*/
|
|
60
|
-
onOpen?: () => void;
|
|
61
|
-
/**
|
|
62
|
-
* Event callback when an emoji button is selected
|
|
63
|
-
* @param emojiId emoji unique id
|
|
64
|
-
* @param source source where the reaction was picked (either the initial default reactions or the custom reactions picker)
|
|
65
|
-
*/
|
|
66
|
-
onSelection: (emojiId: string, source: ReactionSource) => void;
|
|
67
|
-
/**
|
|
68
|
-
* Optional event handler when the custom emoji picker icon is selected
|
|
69
|
-
*/
|
|
70
|
-
onShowMore?: () => void;
|
|
71
|
-
/**
|
|
72
|
-
* Optional prop for controlling the picker location
|
|
73
|
-
*/
|
|
74
|
-
reactionPickerPlacement?: Placement;
|
|
75
|
-
/**
|
|
76
|
-
* Optional prop to set the strategy of the reaction picker popup
|
|
77
|
-
*/
|
|
78
|
-
reactionPickerStrategy?: PopperProps<{}>['strategy'];
|
|
79
|
-
/**
|
|
80
|
-
* Optional prop for controlling icon inside Trigger
|
|
81
|
-
*/
|
|
82
|
-
reactionPickerTriggerIcon?: React.ReactNode;
|
|
83
|
-
/**
|
|
84
|
-
* Optional prop for controlling text of the trigger button
|
|
85
|
-
*/
|
|
86
|
-
reactionPickerTriggerText?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Optional prop for displaying text to add a reaction
|
|
89
|
-
*/
|
|
90
|
-
showAddReactionText?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Optional prop for using an opaque button background instead of a transparent background
|
|
93
|
-
*/
|
|
94
|
-
showOpaqueBackground?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Optional prop for applying subtle styling to reaction summary and picker
|
|
97
|
-
*/
|
|
98
|
-
subtleReactionsSummaryAndPicker?: boolean;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Picker component for adding reactions
|
|
102
|
-
*/
|
|
103
|
-
export declare const ReactionPicker: React.MemoExoticComponent<(props: ReactionPickerProps) => JSX.Element>;
|
|
104
|
-
export interface PopperWrapperProps {
|
|
105
|
-
isOpen: boolean;
|
|
106
|
-
onClose: () => void;
|
|
107
|
-
popperModifiers?: PopperProps<{}>['modifiers'];
|
|
108
|
-
settings: {
|
|
109
|
-
popperPlacement: Placement;
|
|
110
|
-
showFullPicker: boolean;
|
|
111
|
-
};
|
|
112
|
-
triggerRef: HTMLDivElement | HTMLButtonElement | null;
|
|
113
|
-
}
|
|
114
|
-
export declare const PopperWrapper: (props: PropsWithChildren<PopperWrapperProps>) => JSX.Element;
|