@atlaskit/reactions 25.3.0 → 25.5.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.
- package/CHANGELOG.md +25 -0
- package/dist/cjs/MockReactionsClient.js +2 -1
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Reaction/Reaction.js +6 -2
- package/dist/cjs/components/ReactionDialog/ReactionView.js +2 -6
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +8 -97
- package/dist/cjs/components/ReactionDialog/ReactionsDialogHeader.js +17 -11
- package/dist/cjs/components/ReactionDialog/ReactionsDialogTrigger.js +49 -0
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +0 -3
- package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +6 -36
- package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +9 -5
- package/dist/cjs/components/ReactionTooltip/styles.js +12 -1
- package/dist/cjs/components/Reactions/Reactions.js +31 -60
- package/dist/cjs/components/Selector/Selector.js +0 -6
- package/dist/es2019/MockReactionsClient.js +2 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Reaction/Reaction.js +6 -2
- package/dist/es2019/components/ReactionDialog/ReactionView.js +1 -5
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +3 -87
- package/dist/es2019/components/ReactionDialog/ReactionsDialogHeader.js +20 -11
- package/dist/es2019/components/ReactionDialog/ReactionsDialogTrigger.js +43 -0
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +0 -3
- package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +7 -35
- package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +10 -6
- package/dist/es2019/components/ReactionTooltip/styles.js +12 -1
- package/dist/es2019/components/Reactions/Reactions.js +29 -56
- package/dist/es2019/components/Selector/Selector.js +0 -6
- package/dist/esm/MockReactionsClient.js +2 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Reaction/Reaction.js +6 -2
- package/dist/esm/components/ReactionDialog/ReactionView.js +2 -6
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +9 -98
- package/dist/esm/components/ReactionDialog/ReactionsDialogHeader.js +17 -11
- package/dist/esm/components/ReactionDialog/ReactionsDialogTrigger.js +42 -0
- package/dist/esm/components/ReactionDialog/ReactionsList.js +0 -3
- package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +7 -37
- package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +10 -6
- package/dist/esm/components/ReactionTooltip/styles.js +12 -1
- package/dist/esm/components/Reactions/Reactions.js +32 -61
- package/dist/esm/components/Selector/Selector.js +0 -6
- package/dist/types/components/Reaction/Reaction.d.ts +9 -1
- package/dist/types/components/ReactionDialog/ReactionView.d.ts +2 -8
- package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +1 -2
- package/dist/types/components/ReactionDialog/ReactionsDialogTrigger.d.ts +6 -0
- package/dist/types/components/ReactionDialog/ReactionsList.d.ts +1 -3
- package/dist/types/components/ReactionSummary/ReactionSummaryView.d.ts +7 -3
- package/dist/types/components/ReactionTooltip/ReactionTooltip.d.ts +9 -1
- package/dist/types/components/ReactionTooltip/styles.d.ts +1 -0
- package/dist/types/components/Reactions/Reactions.d.ts +5 -6
- package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
- package/dist/types-ts4.5/components/Reaction/Reaction.d.ts +9 -1
- package/dist/types-ts4.5/components/ReactionDialog/ReactionView.d.ts +2 -8
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +1 -2
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialogTrigger.d.ts +6 -0
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsList.d.ts +1 -3
- package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryView.d.ts +7 -3
- package/dist/types-ts4.5/components/ReactionTooltip/ReactionTooltip.d.ts +9 -1
- package/dist/types-ts4.5/components/ReactionTooltip/styles.d.ts +1 -0
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +5 -6
- package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 25.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#113818](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113818)
|
|
8
|
+
[`ae63179ab3076`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ae63179ab3076) -
|
|
9
|
+
[ux] Reactions Dialog changed after leadership review to remove border from meatball menu. Also
|
|
10
|
+
misc fixes like fixing button accessibility for the meatball, and removing left navigation button
|
|
11
|
+
from tablist
|
|
12
|
+
|
|
13
|
+
## 25.4.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 25.4.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [#115405](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115405)
|
|
24
|
+
[`8f77c2c8c5307`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f77c2c8c5307) -
|
|
25
|
+
[ux] Adds the isViewOnly prop to the reactions component, making the picker disabled and
|
|
26
|
+
preventing addition of new reactions
|
|
27
|
+
|
|
3
28
|
## 25.3.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -23,7 +23,8 @@ var getReactionSummary = exports.getReactionSummary = function getReactionSummar
|
|
|
23
23
|
containerAri: containerAri,
|
|
24
24
|
emojiId: getReactionsByShortName.id,
|
|
25
25
|
count: count,
|
|
26
|
-
reacted: reacted
|
|
26
|
+
reacted: reacted,
|
|
27
|
+
users: defaultUsers
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
var getUser = exports.getUser = function getUser(id, displayName) {
|
|
@@ -11,7 +11,7 @@ var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
|
|
|
11
11
|
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; }
|
|
12
12
|
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) { (0, _defineProperty2.default)(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; }
|
|
13
13
|
var packageName = "@atlaskit/reactions";
|
|
14
|
-
var packageVersion = "25.
|
|
14
|
+
var packageVersion = "25.5.0";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -75,7 +75,9 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
75
75
|
_ref$showParticleEffe = _ref.showParticleEffect,
|
|
76
76
|
showParticleEffect = _ref$showParticleEffe === void 0 ? false : _ref$showParticleEffe,
|
|
77
77
|
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
78
|
-
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr
|
|
78
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
|
|
79
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
80
|
+
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog;
|
|
79
81
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
80
82
|
var hoverStart = (0, _react.useRef)();
|
|
81
83
|
var focusStart = (0, _react.useRef)();
|
|
@@ -157,7 +159,9 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
157
159
|
}), (0, _react2.jsx)(_ReactionTooltip.ReactionTooltip, {
|
|
158
160
|
emojiName: emojiName,
|
|
159
161
|
reaction: reaction,
|
|
160
|
-
isEnabled: isTooltipEnabled
|
|
162
|
+
isEnabled: isTooltipEnabled,
|
|
163
|
+
allowUserDialog: allowUserDialog,
|
|
164
|
+
handleOpenReactionsDialog: handleOpenReactionsDialog
|
|
161
165
|
}, (0, _react2.jsx)(_ReactionButton.ReactionButton, {
|
|
162
166
|
onClick: handleClick,
|
|
163
167
|
flash: flash,
|
|
@@ -38,9 +38,7 @@ var centerSpinnerStyle = (0, _primitives.xcss)({
|
|
|
38
38
|
marginTop: 'space.300'
|
|
39
39
|
});
|
|
40
40
|
var ReactionView = exports.ReactionView = function ReactionView(_ref) {
|
|
41
|
-
var
|
|
42
|
-
emojiProvider = _ref.emojiProvider,
|
|
43
|
-
reaction = _ref.reaction,
|
|
41
|
+
var reaction = _ref.reaction,
|
|
44
42
|
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
45
43
|
var alphabeticalNames = (0, _react.useMemo)(function () {
|
|
46
44
|
var _reactionObj$users;
|
|
@@ -52,9 +50,7 @@ var ReactionView = exports.ReactionView = function ReactionView(_ref) {
|
|
|
52
50
|
return (0, _react2.jsx)(_tabs.TabPanel, null, (0, _react2.jsx)(_primitives.Flex, {
|
|
53
51
|
direction: "column",
|
|
54
52
|
xcss: reactionViewStyle
|
|
55
|
-
}, alphabeticalNames.length === 0 ?
|
|
56
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
57
|
-
(0, _react2.jsx)(_primitives.Box, {
|
|
53
|
+
}, alphabeticalNames.length === 0 ? (0, _react2.jsx)(_primitives.Box, {
|
|
58
54
|
xcss: centerSpinnerStyle
|
|
59
55
|
}, (0, _react2.jsx)(_spinner.default, {
|
|
60
56
|
size: "large"
|
|
@@ -29,13 +29,6 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
29
29
|
* Test id for the Reactions modal dialog
|
|
30
30
|
*/
|
|
31
31
|
var RENDER_MODAL_TESTID = exports.RENDER_MODAL_TESTID = 'render-reactions-modal';
|
|
32
|
-
var getDimensions = function getDimensions(container) {
|
|
33
|
-
return {
|
|
34
|
-
clientWidth: container === null || container === void 0 ? void 0 : container.clientWidth,
|
|
35
|
-
scrollWidth: container === null || container === void 0 ? void 0 : container.scrollWidth,
|
|
36
|
-
scrollLeft: container === null || container === void 0 ? void 0 : container.scrollLeft
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
32
|
var modalBodyStyle = (0, _primitives.xcss)({
|
|
40
33
|
marginBottom: 'space.300'
|
|
41
34
|
});
|
|
@@ -51,29 +44,15 @@ var ReactionsDialog = exports.ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
51
44
|
handleSelectReaction = _ref$handleSelectReac === void 0 ? function () {} : _ref$handleSelectReac,
|
|
52
45
|
_ref$handlePagination = _ref.handlePaginationChange,
|
|
53
46
|
handlePaginationChange = _ref$handlePagination === void 0 ? function () {} : _ref$handlePagination,
|
|
54
|
-
ProfileCardWrapper = _ref.ProfileCardWrapper
|
|
55
|
-
|
|
56
|
-
var _useState = (0, _react.useState)(),
|
|
47
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
48
|
+
var _useState = (0, _react.useState)(false),
|
|
57
49
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _useState3 = (0, _react.useState)(
|
|
50
|
+
hasNavigatedPages = _useState2[0],
|
|
51
|
+
setHasNavigatedPages = _useState2[1];
|
|
52
|
+
var _useState3 = (0, _react.useState)(1),
|
|
61
53
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// prevents accidental triggering of handlePaginationChange on initial load
|
|
66
|
-
var _useState5 = (0, _react.useState)(false),
|
|
67
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
68
|
-
hasNavigatedPages = _useState6[0],
|
|
69
|
-
setHasNavigatedPages = _useState6[1];
|
|
70
|
-
var _useState7 = (0, _react.useState)(1),
|
|
71
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
72
|
-
currentPage = _useState8[0],
|
|
73
|
-
setCurrentPage = _useState8[1];
|
|
74
|
-
var reactionElementsRef = (0, _react.useRef)();
|
|
75
|
-
var observerRef = (0, _react.useRef)();
|
|
76
|
-
var isSelectedEmojiViewed = (0, _react.useRef)(false);
|
|
54
|
+
currentPage = _useState4[0],
|
|
55
|
+
setCurrentPage = _useState4[1];
|
|
77
56
|
var totalReactionsCount = (0, _react.useMemo)(function () {
|
|
78
57
|
return reactions.reduce(function (accum, current) {
|
|
79
58
|
return accum += current === null || current === void 0 ? void 0 : current.count;
|
|
@@ -109,72 +88,6 @@ var ReactionsDialog = exports.ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
109
88
|
var reactionsBorderWidth = (0, _react.useMemo)(function () {
|
|
110
89
|
return Math.ceil(reactions.length / _constants.NUMBER_OF_REACTIONS_TO_DISPLAY) * 100;
|
|
111
90
|
}, [reactions]);
|
|
112
|
-
|
|
113
|
-
/* Callback from IntersectionObserver to set/unset classNames based on visibility to toggle styles*/
|
|
114
|
-
var handleNavigation = (0, _react.useCallback)(function (entries) {
|
|
115
|
-
entries.forEach(function (entry) {
|
|
116
|
-
var _dataset;
|
|
117
|
-
var element = entry.target;
|
|
118
|
-
var emojiElement = element === null || element === void 0 ? void 0 : element.querySelector('[data-emoji-id]');
|
|
119
|
-
var emojiId = emojiElement === null || emojiElement === void 0 || (_dataset = emojiElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.emojiId;
|
|
120
|
-
if (entry.intersectionRatio < 1) {
|
|
121
|
-
element.classList.add('disabled');
|
|
122
|
-
/*Check if selectedEmoji (passed as props based on what user selects) is out of viewport */
|
|
123
|
-
if (emojiId === selectedEmojiId && !isSelectedEmojiViewed.current) {
|
|
124
|
-
setElementToScroll(emojiElement !== null && emojiElement !== void 0 ? emojiElement : undefined);
|
|
125
|
-
}
|
|
126
|
-
} else {
|
|
127
|
-
if (emojiId === selectedEmojiId && !isSelectedEmojiViewed.current) {
|
|
128
|
-
isSelectedEmojiViewed.current = true;
|
|
129
|
-
}
|
|
130
|
-
element.classList.remove('disabled');
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}, [selectedEmojiId]);
|
|
134
|
-
(0, _react.useEffect)(function () {
|
|
135
|
-
if (elementToScroll && !isSelectedEmojiViewed.current && reactionsContainerRef) {
|
|
136
|
-
isSelectedEmojiViewed.current = true;
|
|
137
|
-
var parentElement = elementToScroll.closest('.reaction-elements');
|
|
138
|
-
var reactionsList = document.querySelector('#reactions-dialog-tabs-list');
|
|
139
|
-
var _getDimensions = getDimensions(reactionsList),
|
|
140
|
-
clientWidth = _getDimensions.clientWidth;
|
|
141
|
-
var offsetLeft = parentElement === null || parentElement === void 0 ? void 0 : parentElement.offsetLeft;
|
|
142
|
-
/* which means emoji is not in viewport so scroll to it*/
|
|
143
|
-
if (reactionsList && offsetLeft > clientWidth) {
|
|
144
|
-
var scrollBy = Math.trunc(offsetLeft / clientWidth) * clientWidth;
|
|
145
|
-
reactionsList.scrollLeft += scrollBy;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}, [elementToScroll, reactionsContainerRef]);
|
|
149
|
-
|
|
150
|
-
/* Set up InterSectionObserver to observer reaction elements on navigating*/
|
|
151
|
-
(0, _react.useEffect)(function () {
|
|
152
|
-
if (reactionsContainerRef) {
|
|
153
|
-
var options = {
|
|
154
|
-
root: reactionsContainerRef,
|
|
155
|
-
rootMargin: '0px',
|
|
156
|
-
threshold: 1.0
|
|
157
|
-
};
|
|
158
|
-
observerRef.current = new IntersectionObserver(handleNavigation, options);
|
|
159
|
-
reactionElementsRef.current = reactionsContainerRef.querySelectorAll('.reaction-elements');
|
|
160
|
-
reactionElementsRef.current && reactionElementsRef.current.length > 0 && reactionElementsRef.current.forEach(function (child) {
|
|
161
|
-
var _observerRef$current;
|
|
162
|
-
observerRef === null || observerRef === void 0 || (_observerRef$current = observerRef.current) === null || _observerRef$current === void 0 || _observerRef$current.observe(child);
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return function () {
|
|
166
|
-
if (observerRef.current) {
|
|
167
|
-
observerRef.current.disconnect();
|
|
168
|
-
observerRef.current = undefined;
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
}, [reactionsContainerRef, reactions, handleNavigation, selectedEmojiId]);
|
|
172
|
-
var setRef = (0, _react.useCallback)(function (node) {
|
|
173
|
-
if (!reactionsContainerRef) {
|
|
174
|
-
setReactionsContainerRef(node);
|
|
175
|
-
}
|
|
176
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
177
|
-
}, []);
|
|
178
91
|
var selectedIndex = currentReactions.findIndex(function (reaction) {
|
|
179
92
|
return reaction.emojiId === selectedEmojiId;
|
|
180
93
|
});
|
|
@@ -208,12 +121,10 @@ var ReactionsDialog = exports.ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
208
121
|
}), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(_primitives.Box, {
|
|
209
122
|
xcss: modalBodyStyle
|
|
210
123
|
}, (0, _react2.jsx)("div", {
|
|
211
|
-
css: (0, _styles.containerStyle)(reactionsBorderWidth)
|
|
212
|
-
ref: setRef
|
|
124
|
+
css: (0, _styles.containerStyle)(reactionsBorderWidth)
|
|
213
125
|
}, (0, _react2.jsx)(_ReactionsList.ReactionsList, {
|
|
214
126
|
selectedEmojiId: selectedEmojiId,
|
|
215
127
|
reactions: currentReactions,
|
|
216
|
-
emojiProvider: emojiProvider,
|
|
217
128
|
ProfileCardWrapper: ProfileCardWrapper
|
|
218
129
|
}))))));
|
|
219
130
|
};
|
|
@@ -37,15 +37,16 @@ var containerEdgeAngle = {
|
|
|
37
37
|
leftEdge: 90
|
|
38
38
|
};
|
|
39
39
|
var leftNavigationStyle = (0, _primitives.xcss)({
|
|
40
|
-
|
|
40
|
+
marginTop: 'space.050',
|
|
41
41
|
alignSelf: 'self-start',
|
|
42
|
-
|
|
42
|
+
paddingLeft: 'space.200',
|
|
43
|
+
paddingBottom: 'space.150'
|
|
43
44
|
});
|
|
44
45
|
var rightNavigationStyle = (0, _primitives.xcss)({
|
|
45
|
-
|
|
46
|
-
marginLeft: 'auto',
|
|
46
|
+
marginTop: 'space.050',
|
|
47
47
|
alignSelf: 'self-start',
|
|
48
|
-
|
|
48
|
+
marginLeft: 'auto',
|
|
49
|
+
marginRight: 'space.100'
|
|
49
50
|
});
|
|
50
51
|
var fadedCss = function fadedCss(edge, theme) {
|
|
51
52
|
return (0, _react2.css)({
|
|
@@ -68,10 +69,15 @@ var customTabListStyles = (0, _react2.css)({
|
|
|
68
69
|
'div[role=tablist]': {
|
|
69
70
|
flexGrow: 1,
|
|
70
71
|
// paddingInline exists to maintain styling prior to @atlaskit/tabs update that removed baked in horizontal padding
|
|
71
|
-
paddingInline: "var(--ds-space-100, 8px)"
|
|
72
|
+
paddingInline: "var(--ds-space-100, 8px)",
|
|
73
|
+
// we add our own border bottom below since tablist border is not full width
|
|
74
|
+
'&::before': {
|
|
75
|
+
backgroundColor: 'transparent'
|
|
76
|
+
}
|
|
72
77
|
},
|
|
73
78
|
width: ' 100%',
|
|
74
|
-
alignItems: 'flex-start'
|
|
79
|
+
alignItems: 'flex-start',
|
|
80
|
+
borderBottom: "1px solid ".concat("var(--ds-border, #EBECF0)")
|
|
75
81
|
});
|
|
76
82
|
var customTabWrapper = function customTabWrapper(theme) {
|
|
77
83
|
return (0, _react2.css)({
|
|
@@ -179,7 +185,7 @@ var ReactionsDialogHeader = exports.ReactionsDialogHeader = function ReactionsDi
|
|
|
179
185
|
var isSinglePage = maxPages === 1;
|
|
180
186
|
var isOnFirstPage = currentPage === 1;
|
|
181
187
|
var isOnLastPage = currentPage === maxPages;
|
|
182
|
-
var
|
|
188
|
+
var handleMouseEnterTab = function handleMouseEnterTab(reaction) {
|
|
183
189
|
var emojiId = reaction.emojiId;
|
|
184
190
|
if (!emojiId || cache[emojiId]) {
|
|
185
191
|
return;
|
|
@@ -231,9 +237,9 @@ var ReactionsDialogHeader = exports.ReactionsDialogHeader = function ReactionsDi
|
|
|
231
237
|
})), (0, _react2.jsx)(_primitives.Inline, null, (0, _react2.jsx)("div", {
|
|
232
238
|
css: customTabListStyles,
|
|
233
239
|
id: "reactions-dialog-tabs-list"
|
|
234
|
-
},
|
|
240
|
+
}, !isSinglePage && !isOnFirstPage && (0, _react2.jsx)(LeftNavigationButton, {
|
|
235
241
|
handlePreviousPage: handlePreviousPage
|
|
236
|
-
}), currentReactions.map(function (reaction, index) {
|
|
242
|
+
}), (0, _react2.jsx)(_tabs.TabList, null, currentReactions.map(function (reaction, index) {
|
|
237
243
|
var emojiId = {
|
|
238
244
|
id: reaction.emojiId,
|
|
239
245
|
shortName: ''
|
|
@@ -249,7 +255,7 @@ var ReactionsDialogHeader = exports.ReactionsDialogHeader = function ReactionsDi
|
|
|
249
255
|
key: reaction.emojiId,
|
|
250
256
|
"data-testid": emojiId === null || emojiId === void 0 ? void 0 : emojiId.id,
|
|
251
257
|
onMouseEnter: function onMouseEnter() {
|
|
252
|
-
|
|
258
|
+
handleMouseEnterTab(reaction);
|
|
253
259
|
}
|
|
254
260
|
}, (0, _react2.jsx)(_tabs.Tab, null, (0, _react2.jsx)(_tooltip.default, {
|
|
255
261
|
content: cache[reaction.emojiId],
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ReactionsDialogTrigger = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
10
|
+
var _primitives = require("@atlaskit/primitives");
|
|
11
|
+
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
12
|
+
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _i18n = require("../../shared/i18n");
|
|
14
|
+
var triggerStyles = (0, _primitives.xcss)({
|
|
15
|
+
marginRight: 'space.050',
|
|
16
|
+
marginTop: 'space.050',
|
|
17
|
+
minWidth: '32px',
|
|
18
|
+
height: '24px',
|
|
19
|
+
borderRadius: 'border.radius.100',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
alignItems: 'center'
|
|
23
|
+
});
|
|
24
|
+
var transparentEnabledTriggerStyles = (0, _primitives.xcss)({
|
|
25
|
+
borderColor: 'color.border',
|
|
26
|
+
':hover': {
|
|
27
|
+
backgroundColor: 'color.background.neutral.subtle.hovered'
|
|
28
|
+
},
|
|
29
|
+
':active': {
|
|
30
|
+
backgroundColor: 'color.background.neutral.subtle.pressed'
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
// Currently not in use due to Reactions Dialog trigger being moved to tooltip
|
|
34
|
+
// Similar to platform/packages/elements/reactions/src/components/Trigger/Trigger.tsx
|
|
35
|
+
var ReactionsDialogTrigger = exports.ReactionsDialogTrigger = function ReactionsDialogTrigger(_ref) {
|
|
36
|
+
var onClick = _ref.onClick;
|
|
37
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
39
|
+
xcss: [triggerStyles, transparentEnabledTriggerStyles],
|
|
40
|
+
backgroundColor: "color.background.neutral.subtle",
|
|
41
|
+
padding: "space.0",
|
|
42
|
+
onClick: onClick,
|
|
43
|
+
"aria-label": intl.formatMessage(_i18n.messages.seeWhoReactedTooltip)
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
45
|
+
content: intl.formatMessage(_i18n.messages.seeWhoReactedTooltip)
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_showMoreHorizontal.default, {
|
|
47
|
+
label: intl.formatMessage(_i18n.messages.seeWhoReacted)
|
|
48
|
+
})));
|
|
49
|
+
};
|
|
@@ -16,15 +16,12 @@ var _ReactionView = require("./ReactionView");
|
|
|
16
16
|
var ReactionsList = exports.ReactionsList = function ReactionsList(_ref) {
|
|
17
17
|
var reactions = _ref.reactions,
|
|
18
18
|
selectedEmojiId = _ref.selectedEmojiId,
|
|
19
|
-
emojiProvider = _ref.emojiProvider,
|
|
20
19
|
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
21
20
|
return (0, _react.jsx)(_primitives.Box, null, reactions.map(function (reaction) {
|
|
22
21
|
if (reaction.emojiId === selectedEmojiId) {
|
|
23
22
|
return (0, _react.jsx)(_ReactionView.ReactionView, {
|
|
24
23
|
key: reaction.emojiId,
|
|
25
24
|
reaction: reaction,
|
|
26
|
-
selectedEmojiId: selectedEmojiId,
|
|
27
|
-
emojiProvider: emojiProvider,
|
|
28
25
|
ProfileCardWrapper: ProfileCardWrapper
|
|
29
26
|
});
|
|
30
27
|
} else {
|
|
@@ -9,15 +9,10 @@ exports.ReactionSummaryView = exports.RENDER_SUMMARY_VIEW_POPUP_TESTID = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _reactIntlNext = require("react-intl-next");
|
|
13
12
|
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
14
13
|
var _primitives = require("@atlaskit/primitives");
|
|
15
|
-
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
16
|
-
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
|
-
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
18
14
|
var _Reaction = require("../Reaction");
|
|
19
15
|
var _ReactionSummaryButton = require("./ReactionSummaryButton");
|
|
20
|
-
var _i18n = require("../../shared/i18n");
|
|
21
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
18
|
var summaryPopupStyles = (0, _primitives.xcss)({
|
|
@@ -25,12 +20,6 @@ var summaryPopupStyles = (0, _primitives.xcss)({
|
|
|
25
20
|
paddingTop: 'space.050',
|
|
26
21
|
maxWidth: '325px'
|
|
27
22
|
});
|
|
28
|
-
var viewAllButtonStyling = (0, _primitives.xcss)({
|
|
29
|
-
marginTop: 'space.050'
|
|
30
|
-
});
|
|
31
|
-
var iconStyle = (0, _primitives.xcss)({
|
|
32
|
-
height: '20px'
|
|
33
|
-
});
|
|
34
23
|
|
|
35
24
|
/**
|
|
36
25
|
* Test id for the Reactions summary view popup
|
|
@@ -53,9 +42,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
53
42
|
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
|
|
54
43
|
_ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
|
|
55
44
|
subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var intl = (0, _reactIntlNext.useIntl)();
|
|
45
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
46
|
+
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog;
|
|
59
47
|
var _useState = (0, _react.useState)(false),
|
|
60
48
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
61
49
|
isSummaryPopupOpen = _useState2[0],
|
|
@@ -84,29 +72,11 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
84
72
|
onFocused: onReactionFocused,
|
|
85
73
|
onMouseEnter: onReactionMouseEnter,
|
|
86
74
|
flash: flash[reaction.emojiId],
|
|
87
|
-
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
75
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId],
|
|
76
|
+
allowUserDialog: allowUserDialog,
|
|
77
|
+
handleOpenReactionsDialog: handleOpenReactionsDialog
|
|
88
78
|
});
|
|
89
|
-
})
|
|
90
|
-
xcss: viewAllButtonStyling
|
|
91
|
-
}, /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
92
|
-
backgroundColor: "color.background.neutral.subtle",
|
|
93
|
-
padding: "space.0"
|
|
94
|
-
}, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
95
|
-
content: intl.formatMessage(_i18n.messages.seeWhoReactedTooltip)
|
|
96
|
-
}, function (tooltipProps) {
|
|
97
|
-
return /*#__PURE__*/_react.default.createElement(_new.default, (0, _extends2.default)({}, tooltipProps, {
|
|
98
|
-
spacing: "compact",
|
|
99
|
-
onClick: function onClick() {
|
|
100
|
-
handlePopupClose();
|
|
101
|
-
handleOpenReactionsDialog === null || handleOpenReactionsDialog === void 0 || handleOpenReactionsDialog(reactions[0].emojiId);
|
|
102
|
-
}
|
|
103
|
-
}), /*#__PURE__*/_react.default.createElement(_primitives.Flex, {
|
|
104
|
-
alignItems: "center",
|
|
105
|
-
xcss: iconStyle
|
|
106
|
-
}, /*#__PURE__*/_react.default.createElement(_showMoreHorizontal.default, {
|
|
107
|
-
label: intl.formatMessage(_i18n.messages.seeWhoReacted)
|
|
108
|
-
})));
|
|
109
|
-
}))));
|
|
79
|
+
}));
|
|
110
80
|
},
|
|
111
81
|
isOpen: isSummaryPopupOpen,
|
|
112
82
|
onClose: handlePopupClose,
|
|
@@ -32,10 +32,9 @@ var ReactionTooltip = exports.ReactionTooltip = function ReactionTooltip(_ref) {
|
|
|
32
32
|
_ref$maxReactions = _ref.maxReactions,
|
|
33
33
|
maxReactions = _ref$maxReactions === void 0 ? _constants.TOOLTIP_USERS_LIMIT : _ref$maxReactions,
|
|
34
34
|
_ref$isEnabled = _ref.isEnabled,
|
|
35
|
-
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
35
|
+
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
|
|
36
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
37
|
+
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog;
|
|
39
38
|
var content = !users || users.length === 0 || !isEnabled ? null :
|
|
40
39
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values, jsx-a11y/no-noninteractive-tabindex -- Ignored via go/DSP-18766
|
|
41
40
|
(0, _react2.jsx)("div", {
|
|
@@ -49,7 +48,12 @@ var ReactionTooltip = exports.ReactionTooltip = function ReactionTooltip(_ref) {
|
|
|
49
48
|
}, user.displayName);
|
|
50
49
|
}), (0, _react2.jsx)("li", {
|
|
51
50
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
52
|
-
css: _styles.footerStyle
|
|
51
|
+
css: allowUserDialog ? [_styles.footerStyle, _styles.underlineStyle] : _styles.footerStyle,
|
|
52
|
+
onClick: function onClick() {
|
|
53
|
+
if (allowUserDialog && handleOpenReactionsDialog) {
|
|
54
|
+
handleOpenReactionsDialog();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
53
57
|
}, users.length > maxReactions && (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.otherUsers, {
|
|
54
58
|
values: {
|
|
55
59
|
count: users.length - maxReactions
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.verticalMargin = exports.tooltipStyle = exports.footerStyle = exports.emojiNameStyle = void 0;
|
|
6
|
+
exports.verticalMargin = exports.underlineStyle = exports.tooltipStyle = exports.footerStyle = exports.emojiNameStyle = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
/**
|
|
@@ -46,4 +46,15 @@ var emojiNameStyle = exports.emojiNameStyle = (0, _react.css)({
|
|
|
46
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
47
47
|
var footerStyle = exports.footerStyle = (0, _react.css)({
|
|
48
48
|
color: "var(--ds-text-inverse, ".concat(_colors.N90, ")")
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
52
|
+
var underlineStyle = exports.underlineStyle = (0, _react.css)({
|
|
53
|
+
cursor: 'pointer',
|
|
54
|
+
textDecoration: 'underline',
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
56
|
+
':hover': {
|
|
57
|
+
backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.N800, ")"),
|
|
58
|
+
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")")
|
|
59
|
+
}
|
|
49
60
|
});
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.Reactions = exports.RENDER_VIEWALL_REACTED_USERS_DIALOG = exports.RENDER_REACTIONS_TESTID = exports.RENDER_REACTIONS_SUMMARY_TESTID = void 0;
|
|
9
9
|
exports.getTooltip = getTooltip;
|
|
10
10
|
exports.ufoExperiences = void 0;
|
|
11
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -16,11 +15,7 @@ var _react2 = require("@emotion/react");
|
|
|
16
15
|
var _reactIntlNext = require("react-intl-next");
|
|
17
16
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
18
17
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
19
|
-
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
20
|
-
var _primitives = require("@atlaskit/primitives");
|
|
21
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
-
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
23
|
-
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
24
19
|
var _analytics = require("../../analytics");
|
|
25
20
|
var _constants = require("../../shared/constants");
|
|
26
21
|
var _i18n = require("../../shared/i18n");
|
|
@@ -89,13 +84,6 @@ function getTooltip(status, errorMessage) {
|
|
|
89
84
|
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.addReaction);
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
|
-
var dialogEntrypointButtonStyle = (0, _primitives.xcss)({
|
|
93
|
-
marginRight: 'space.050',
|
|
94
|
-
marginTop: 'space.050'
|
|
95
|
-
});
|
|
96
|
-
var iconStyle = (0, _primitives.xcss)({
|
|
97
|
-
height: '20px'
|
|
98
|
-
});
|
|
99
87
|
|
|
100
88
|
/**
|
|
101
89
|
* Renders list of reactions
|
|
@@ -112,8 +100,6 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
112
100
|
pickerQuickReactionEmojiIds = _ref.pickerQuickReactionEmojiIds,
|
|
113
101
|
_ref$getReactionDetai = _ref.getReactionDetails,
|
|
114
102
|
getReactionDetails = _ref$getReactionDetai === void 0 ? function () {} : _ref$getReactionDetai,
|
|
115
|
-
_ref$onReactionHover = _ref.onReactionHover,
|
|
116
|
-
onReactionHover = _ref$onReactionHover === void 0 ? function () {} : _ref$onReactionHover,
|
|
117
103
|
onSelection = _ref.onSelection,
|
|
118
104
|
_ref$reactions = _ref.reactions,
|
|
119
105
|
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
|
@@ -150,14 +136,15 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
150
136
|
_ref$onlyRenderPicker = _ref.onlyRenderPicker,
|
|
151
137
|
onlyRenderPicker = _ref$onlyRenderPicker === void 0 ? false : _ref$onlyRenderPicker,
|
|
152
138
|
_ref$showRoundTrigger = _ref.showRoundTrigger,
|
|
153
|
-
showRoundTrigger = _ref$showRoundTrigger === void 0 ? false : _ref$showRoundTrigger
|
|
139
|
+
showRoundTrigger = _ref$showRoundTrigger === void 0 ? false : _ref$showRoundTrigger,
|
|
140
|
+
_ref$isViewOnly = _ref.isViewOnly,
|
|
141
|
+
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly;
|
|
154
142
|
var _useState = (0, _react.useState)(),
|
|
155
143
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
156
144
|
selectedEmojiId = _useState2[0],
|
|
157
145
|
setSelectedEmojiId = _useState2[1];
|
|
158
146
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
159
147
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
160
|
-
var intl = (0, _reactIntlNext.useIntl)();
|
|
161
148
|
var openTime = (0, _react.useRef)();
|
|
162
149
|
var renderTime = (0, _react.useRef)();
|
|
163
150
|
(0, _react.useEffect)(function () {
|
|
@@ -180,8 +167,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
180
167
|
}, [createAnalyticsEvent, status]);
|
|
181
168
|
var handleReactionMouseEnter = (0, _react.useCallback)(function (emojiId) {
|
|
182
169
|
getReactionDetails(emojiId);
|
|
183
|
-
|
|
184
|
-
}, [getReactionDetails, onReactionHover]);
|
|
170
|
+
}, [getReactionDetails]);
|
|
185
171
|
var handleReactionFocused = (0, _react.useCallback)(function (emojiId) {
|
|
186
172
|
getReactionDetails(emojiId);
|
|
187
173
|
}, [getReactionDetails]);
|
|
@@ -203,27 +189,6 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
203
189
|
openTime.current = undefined;
|
|
204
190
|
onSelection(emojiId);
|
|
205
191
|
}, [createAnalyticsEvent, onSelection, reactions]);
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* event handler to open dialog with selected reaction
|
|
209
|
-
* @param emojiId selected emoji id
|
|
210
|
-
*/
|
|
211
|
-
var handleOpenReactionsDialog = function handleOpenReactionsDialog(emojiId) {
|
|
212
|
-
// ufo start opening reaction dialog
|
|
213
|
-
ufoExperiences.openDialog.start();
|
|
214
|
-
getReactionDetails(emojiId);
|
|
215
|
-
setSelectedEmojiId(emojiId);
|
|
216
|
-
onDialogOpenCallback(emojiId, 'button');
|
|
217
|
-
|
|
218
|
-
// ufo opening reaction dialog success
|
|
219
|
-
ufoExperiences.openDialog.success({
|
|
220
|
-
metadata: {
|
|
221
|
-
emojiId: emojiId,
|
|
222
|
-
source: 'Reactions',
|
|
223
|
-
reason: 'Opening Reactions Dialog successfully'
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
};
|
|
227
192
|
var handleCloseReactionsDialog = function handleCloseReactionsDialog(e, analyticsEvent) {
|
|
228
193
|
// ufo closing opening reaction dialog
|
|
229
194
|
ufoExperiences.closeDialog.start();
|
|
@@ -315,6 +280,29 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
315
280
|
return (b === null || b === void 0 ? void 0 : b.count) - (a === null || a === void 0 ? void 0 : a.count);
|
|
316
281
|
});
|
|
317
282
|
}, [memorizedReactions]);
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* event handler to open dialog with selected reaction
|
|
286
|
+
* @param emojiId initial emoji id to load dialog with
|
|
287
|
+
*/
|
|
288
|
+
var handleOpenReactionsDialog = function handleOpenReactionsDialog() {
|
|
289
|
+
var emojiId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : sortedReactions[0].emojiId;
|
|
290
|
+
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'endOfPageReactions';
|
|
291
|
+
// ufo start opening reaction dialog
|
|
292
|
+
ufoExperiences.openDialog.start();
|
|
293
|
+
getReactionDetails(emojiId);
|
|
294
|
+
setSelectedEmojiId(emojiId);
|
|
295
|
+
onDialogOpenCallback(emojiId, source);
|
|
296
|
+
|
|
297
|
+
// ufo opening reaction dialog success
|
|
298
|
+
ufoExperiences.openDialog.success({
|
|
299
|
+
metadata: {
|
|
300
|
+
emojiId: emojiId,
|
|
301
|
+
source: 'Reactions',
|
|
302
|
+
reason: 'Opening Reactions Dialog successfully'
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
};
|
|
318
306
|
return (
|
|
319
307
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
320
308
|
(0, _react2.jsx)("div", {
|
|
@@ -345,28 +333,11 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
345
333
|
onFocused: handleReactionFocused,
|
|
346
334
|
flash: flash[reaction.emojiId],
|
|
347
335
|
showParticleEffect: particleEffectByEmoji[reaction.emojiId],
|
|
348
|
-
showOpaqueBackground: showOpaqueBackground
|
|
336
|
+
showOpaqueBackground: showOpaqueBackground,
|
|
337
|
+
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
338
|
+
handleOpenReactionsDialog: handleOpenReactionsDialog
|
|
349
339
|
});
|
|
350
|
-
})), !
|
|
351
|
-
xcss: dialogEntrypointButtonStyle
|
|
352
|
-
}, (0, _react2.jsx)(_primitives.Pressable, {
|
|
353
|
-
backgroundColor: "color.background.neutral.subtle",
|
|
354
|
-
padding: "space.0"
|
|
355
|
-
}, (0, _react2.jsx)(_tooltip.default, {
|
|
356
|
-
content: intl.formatMessage(_i18n.messages.seeWhoReactedTooltip)
|
|
357
|
-
}, function (tooltipProps) {
|
|
358
|
-
return (0, _react2.jsx)(_new.default, (0, _extends2.default)({}, tooltipProps, {
|
|
359
|
-
spacing: "compact",
|
|
360
|
-
onClick: function onClick() {
|
|
361
|
-
return handleOpenReactionsDialog(sortedReactions[0].emojiId);
|
|
362
|
-
}
|
|
363
|
-
}), (0, _react2.jsx)(_primitives.Flex, {
|
|
364
|
-
alignItems: "center",
|
|
365
|
-
xcss: iconStyle
|
|
366
|
-
}, (0, _react2.jsx)(_showMoreHorizontal.default, {
|
|
367
|
-
label: intl.formatMessage(_i18n.messages.seeWhoReacted)
|
|
368
|
-
})));
|
|
369
|
-
}))), (0, _react2.jsx)(_ReactionPicker.ReactionPicker
|
|
340
|
+
})), !isViewOnly && (0, _react2.jsx)(_ReactionPicker.ReactionPicker
|
|
370
341
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
371
342
|
, {
|
|
372
343
|
css: _styles.reactionPickerStyle,
|