@atlaskit/reactions 25.0.0 → 25.1.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 +10 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionDialog/ReactionView.js +2 -69
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +11 -17
- package/dist/cjs/components/ReactionDialog/ReactionsDialogHeader.js +168 -94
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +2 -1
- package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +16 -7
- package/dist/cjs/components/Reactions/Reactions.js +22 -11
- package/dist/cjs/shared/i18n.js +0 -5
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionDialog/ReactionView.js +4 -48
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +11 -17
- package/dist/es2019/components/ReactionDialog/ReactionsDialogHeader.js +129 -68
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +2 -1
- package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +17 -8
- package/dist/es2019/components/Reactions/Reactions.js +23 -12
- package/dist/es2019/shared/i18n.js +0 -5
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionDialog/ReactionView.js +4 -71
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +11 -17
- package/dist/esm/components/ReactionDialog/ReactionsDialogHeader.js +161 -83
- package/dist/esm/components/ReactionDialog/ReactionsList.js +2 -1
- package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +18 -9
- package/dist/esm/components/Reactions/Reactions.js +24 -13
- package/dist/esm/shared/i18n.js +0 -5
- package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +2 -1
- package/dist/types/components/ReactionDialog/ReactionsDialogHeader.d.ts +3 -2
- package/dist/types/components/Reactions/Reactions.d.ts +1 -0
- package/dist/types/shared/i18n.d.ts +0 -5
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +2 -1
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialogHeader.d.ts +3 -2
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +1 -0
- package/dist/types-ts4.5/shared/i18n.d.ts +0 -5
- package/package.json +1 -1
|
@@ -6,13 +6,14 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
6
6
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
10
10
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
11
|
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
12
|
-
import Button from '@atlaskit/button/new';
|
|
13
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
13
|
+
import { Box, Pressable, Flex, xcss } from '@atlaskit/primitives';
|
|
15
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
+
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
16
|
+
import Button from '@atlaskit/button/new';
|
|
16
17
|
import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionsRenderedEvent, createReactionSelectionEvent, isSampled } from '../../analytics';
|
|
17
18
|
import { SAMPLING_RATE_REACTIONS_RENDERED_EXP } from '../../shared/constants';
|
|
18
19
|
import { messages } from '../../shared/i18n';
|
|
@@ -42,10 +43,6 @@ export const ufoExperiences = {
|
|
|
42
43
|
selectedReactionChangeInsideDialog: ReactionDialogSelectedReactionChanged,
|
|
43
44
|
pageNavigated: ReactionDialogPageNavigation
|
|
44
45
|
};
|
|
45
|
-
const dialogEntrypointButtonStyle = xcss({
|
|
46
|
-
marginRight: 'space.050',
|
|
47
|
-
marginTop: 'space.050'
|
|
48
|
-
});
|
|
49
46
|
|
|
50
47
|
/**
|
|
51
48
|
* Test id for wrapper Reactions div
|
|
@@ -77,6 +74,13 @@ export function getTooltip(status, errorMessage) {
|
|
|
77
74
|
return jsx(FormattedMessage, messages.addReaction);
|
|
78
75
|
}
|
|
79
76
|
}
|
|
77
|
+
const dialogEntrypointButtonStyle = xcss({
|
|
78
|
+
marginRight: 'space.050',
|
|
79
|
+
marginTop: 'space.050'
|
|
80
|
+
});
|
|
81
|
+
const iconStyle = xcss({
|
|
82
|
+
height: '20px'
|
|
83
|
+
});
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
86
|
* Renders list of reactions
|
|
@@ -116,6 +120,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
116
120
|
const {
|
|
117
121
|
createAnalyticsEvent
|
|
118
122
|
} = useAnalyticsEvents();
|
|
123
|
+
const intl = useIntl();
|
|
119
124
|
let openTime = useRef();
|
|
120
125
|
let renderTime = useRef();
|
|
121
126
|
useEffect(() => {
|
|
@@ -297,14 +302,20 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
297
302
|
showOpaqueBackground: showOpaqueBackground
|
|
298
303
|
})), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && jsx(Box, {
|
|
299
304
|
xcss: dialogEntrypointButtonStyle
|
|
305
|
+
}, jsx(Pressable, {
|
|
306
|
+
backgroundColor: "color.background.neutral.subtle",
|
|
307
|
+
padding: "space.0"
|
|
300
308
|
}, jsx(Tooltip, {
|
|
301
|
-
content:
|
|
302
|
-
hideTooltipOnClick: true
|
|
309
|
+
content: intl.formatMessage(messages.seeWhoReactedTooltip)
|
|
303
310
|
}, tooltipProps => jsx(Button, _extends({}, tooltipProps, {
|
|
304
311
|
spacing: "compact",
|
|
305
|
-
onClick: () => handleOpenReactionsDialog(sortedReactions[0].emojiId)
|
|
306
|
-
|
|
307
|
-
|
|
312
|
+
onClick: () => handleOpenReactionsDialog(sortedReactions[0].emojiId)
|
|
313
|
+
}), jsx(Flex, {
|
|
314
|
+
alignItems: "center",
|
|
315
|
+
xcss: iconStyle
|
|
316
|
+
}, jsx(ShowMoreHorizontalIcon, {
|
|
317
|
+
label: intl.formatMessage(messages.seeWhoReacted)
|
|
318
|
+
})))))), jsx(ReactionPicker
|
|
308
319
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
309
320
|
, {
|
|
310
321
|
css: reactionPickerStyle,
|
|
@@ -72,10 +72,5 @@ export const messages = defineMessages({
|
|
|
72
72
|
id: 'reactions.dialog.viewall.tooltip',
|
|
73
73
|
defaultMessage: 'View all user reactions',
|
|
74
74
|
description: 'Tooltip content of see who reacted link'
|
|
75
|
-
},
|
|
76
|
-
peopleWhoReactedSubheading: {
|
|
77
|
-
id: 'reactions.dialog.people-who-reacted.subheader',
|
|
78
|
-
defaultMessage: 'People who reacted with {emojiShortName}',
|
|
79
|
-
description: 'Subheading that shows the user which emoji tab they are on'
|
|
80
75
|
}
|
|
81
76
|
});
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
6
6
|
var packageName = "@atlaskit/reactions";
|
|
7
|
-
var packageVersion = "25.
|
|
7
|
+
var packageVersion = "25.1.0";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
1
|
/**
|
|
6
2
|
* @jsxRuntime classic
|
|
7
3
|
* @jsx jsx
|
|
8
4
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import { useMemo } from 'react';
|
|
11
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
7
|
import { jsx } from '@emotion/react';
|
|
13
|
-
import { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
14
8
|
import Avatar from '@atlaskit/avatar/Avatar';
|
|
15
9
|
import Spinner from '@atlaskit/spinner';
|
|
16
10
|
import { TabPanel } from '@atlaskit/tabs';
|
|
17
|
-
import { Box, Flex, xcss
|
|
18
|
-
import Heading from '@atlaskit/heading';
|
|
19
|
-
import { messages } from '../../shared/i18n';
|
|
11
|
+
import { Box, Flex, xcss } from '@atlaskit/primitives';
|
|
20
12
|
import { userListStyle, userStyle } from './styles';
|
|
21
13
|
var userDescriptionStyle = xcss({
|
|
22
14
|
marginLeft: 'space.150'
|
|
@@ -25,7 +17,7 @@ var profileWrapperStyle = xcss({
|
|
|
25
17
|
marginLeft: 'space.0'
|
|
26
18
|
});
|
|
27
19
|
var reactionViewStyle = xcss({
|
|
28
|
-
marginTop: 'space.
|
|
20
|
+
marginTop: 'space.150',
|
|
29
21
|
minHeight: '300px',
|
|
30
22
|
minWidth: '550px'
|
|
31
23
|
});
|
|
@@ -36,52 +28,11 @@ var centerSpinnerStyle = xcss({
|
|
|
36
28
|
height: '100%',
|
|
37
29
|
marginTop: 'space.300'
|
|
38
30
|
});
|
|
39
|
-
var headerStyle = xcss({
|
|
40
|
-
alignItems: 'flex-end'
|
|
41
|
-
});
|
|
42
|
-
var emojiSpacingStlye = xcss({
|
|
43
|
-
marginLeft: 'space.100'
|
|
44
|
-
});
|
|
45
31
|
export var ReactionView = function ReactionView(_ref) {
|
|
46
32
|
var selectedEmojiId = _ref.selectedEmojiId,
|
|
47
33
|
emojiProvider = _ref.emojiProvider,
|
|
48
34
|
reaction = _ref.reaction,
|
|
49
35
|
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
50
|
-
var _useState = useState(''),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
emojiName = _useState2[0],
|
|
53
|
-
setEmojiName = _useState2[1];
|
|
54
|
-
useEffect(function () {
|
|
55
|
-
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
56
|
-
var provider, emoji, capitalizedName;
|
|
57
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
58
|
-
while (1) switch (_context.prev = _context.next) {
|
|
59
|
-
case 0:
|
|
60
|
-
_context.next = 2;
|
|
61
|
-
return emojiProvider;
|
|
62
|
-
case 2:
|
|
63
|
-
provider = _context.sent;
|
|
64
|
-
_context.next = 5;
|
|
65
|
-
return provider.findByEmojiId({
|
|
66
|
-
shortName: '',
|
|
67
|
-
id: selectedEmojiId
|
|
68
|
-
});
|
|
69
|
-
case 5:
|
|
70
|
-
emoji = _context.sent;
|
|
71
|
-
if (emoji !== null && emoji !== void 0 && emoji.name) {
|
|
72
|
-
// capitalize first letter of each string
|
|
73
|
-
capitalizedName = emoji.name.replace(/\b\w/g, function (char) {
|
|
74
|
-
return char.toUpperCase();
|
|
75
|
-
});
|
|
76
|
-
setEmojiName(capitalizedName);
|
|
77
|
-
}
|
|
78
|
-
case 7:
|
|
79
|
-
case "end":
|
|
80
|
-
return _context.stop();
|
|
81
|
-
}
|
|
82
|
-
}, _callee);
|
|
83
|
-
}))();
|
|
84
|
-
}, [emojiProvider, selectedEmojiId, reaction]);
|
|
85
36
|
var alphabeticalNames = useMemo(function () {
|
|
86
37
|
var _reactionObj$users;
|
|
87
38
|
var reactionObj = reaction;
|
|
@@ -92,25 +43,7 @@ export var ReactionView = function ReactionView(_ref) {
|
|
|
92
43
|
return jsx(TabPanel, null, jsx(Flex, {
|
|
93
44
|
direction: "column",
|
|
94
45
|
xcss: reactionViewStyle
|
|
95
|
-
},
|
|
96
|
-
xcss: headerStyle
|
|
97
|
-
}, jsx(Heading, {
|
|
98
|
-
size: "xsmall"
|
|
99
|
-
}, jsx(FormattedMessage, _extends({}, messages.peopleWhoReactedSubheading, {
|
|
100
|
-
values: {
|
|
101
|
-
emojiShortName: emojiName
|
|
102
|
-
}
|
|
103
|
-
}))), jsx(Box, {
|
|
104
|
-
as: "span",
|
|
105
|
-
xcss: emojiSpacingStlye
|
|
106
|
-
}, jsx(ResourcedEmoji, {
|
|
107
|
-
emojiProvider: emojiProvider,
|
|
108
|
-
emojiId: {
|
|
109
|
-
id: selectedEmojiId,
|
|
110
|
-
shortName: ''
|
|
111
|
-
},
|
|
112
|
-
fitToHeight: 24
|
|
113
|
-
}))), alphabeticalNames.length === 0 ?
|
|
46
|
+
}, alphabeticalNames.length === 0 ?
|
|
114
47
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
115
48
|
jsx(Box, {
|
|
116
49
|
xcss: centerSpinnerStyle
|
|
@@ -4,15 +4,12 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
6
|
import { useEffect, useState, useRef, useCallback, useMemo } from 'react';
|
|
7
|
-
import { useIntl } from 'react-intl-next';
|
|
8
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
8
|
import { jsx } from '@emotion/react';
|
|
10
9
|
import Tabs from '@atlaskit/tabs';
|
|
11
|
-
import
|
|
10
|
+
import Modal, { ModalBody } from '@atlaskit/modal-dialog';
|
|
12
11
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
13
|
-
import Modal, { ModalBody, ModalFooter } from '@atlaskit/modal-dialog';
|
|
14
12
|
import { NUMBER_OF_REACTIONS_TO_DISPLAY } from '../../shared/constants';
|
|
15
|
-
import { messages } from '../../shared/i18n';
|
|
16
13
|
import { ReactionsList } from './ReactionsList';
|
|
17
14
|
import { ReactionsDialogHeader } from './ReactionsDialogHeader';
|
|
18
15
|
import { containerStyle } from './styles';
|
|
@@ -28,8 +25,8 @@ var getDimensions = function getDimensions(container) {
|
|
|
28
25
|
scrollLeft: container === null || container === void 0 ? void 0 : container.scrollLeft
|
|
29
26
|
};
|
|
30
27
|
};
|
|
31
|
-
var
|
|
32
|
-
|
|
28
|
+
var modalBodyStyle = xcss({
|
|
29
|
+
marginBottom: 'space.300'
|
|
33
30
|
});
|
|
34
31
|
export var ReactionsDialog = function ReactionsDialog(_ref) {
|
|
35
32
|
var _currentReactions$;
|
|
@@ -43,7 +40,8 @@ export var ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
43
40
|
handleSelectReaction = _ref$handleSelectReac === void 0 ? function () {} : _ref$handleSelectReac,
|
|
44
41
|
_ref$handlePagination = _ref.handlePaginationChange,
|
|
45
42
|
handlePaginationChange = _ref$handlePagination === void 0 ? function () {} : _ref$handlePagination,
|
|
46
|
-
ProfileCardWrapper = _ref.ProfileCardWrapper
|
|
43
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper,
|
|
44
|
+
handleReactionMouseEnter = _ref.handleReactionMouseEnter;
|
|
47
45
|
var _useState = useState(),
|
|
48
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
47
|
elementToScroll = _useState2[0],
|
|
@@ -64,7 +62,6 @@ export var ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
64
62
|
setCurrentPage = _useState8[1];
|
|
65
63
|
var reactionElementsRef = useRef();
|
|
66
64
|
var observerRef = useRef();
|
|
67
|
-
var intl = useIntl();
|
|
68
65
|
var isSelectedEmojiViewed = useRef(false);
|
|
69
66
|
var totalReactionsCount = useMemo(function () {
|
|
70
67
|
return reactions.reduce(function (accum, current) {
|
|
@@ -195,9 +192,11 @@ export var ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
195
192
|
handleNextPage: handleNextPage,
|
|
196
193
|
currentPage: currentPage,
|
|
197
194
|
emojiProvider: emojiProvider,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}), jsx(ModalBody, null, jsx(
|
|
195
|
+
currentReactions: currentReactions,
|
|
196
|
+
handleCloseReactionsDialog: handleCloseReactionsDialog
|
|
197
|
+
}), jsx(ModalBody, null, jsx(Box, {
|
|
198
|
+
xcss: modalBodyStyle
|
|
199
|
+
}, jsx("div", {
|
|
201
200
|
css: containerStyle(reactionsBorderWidth),
|
|
202
201
|
ref: setRef
|
|
203
202
|
}, jsx(ReactionsList, {
|
|
@@ -205,10 +204,5 @@ export var ReactionsDialog = function ReactionsDialog(_ref) {
|
|
|
205
204
|
reactions: currentReactions,
|
|
206
205
|
emojiProvider: emojiProvider,
|
|
207
206
|
ProfileCardWrapper: ProfileCardWrapper
|
|
208
|
-
}))))
|
|
209
|
-
xcss: footerStyle
|
|
210
|
-
}, jsx(ModalFooter, null, jsx(Button, {
|
|
211
|
-
appearance: "subtle",
|
|
212
|
-
onClick: handleCloseReactionsDialog
|
|
213
|
-
}, intl.formatMessage(messages.closeReactionsDialog)))));
|
|
207
|
+
}))))));
|
|
214
208
|
};
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
2
7
|
/**
|
|
3
8
|
* @jsxRuntime classic
|
|
4
9
|
* @jsx jsx
|
|
5
10
|
*/
|
|
11
|
+
import { useState } from 'react';
|
|
6
12
|
import { useIntl } from 'react-intl-next';
|
|
7
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
14
|
import { jsx, css } from '@emotion/react';
|
|
9
15
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
10
16
|
import { Tab, TabList } from '@atlaskit/tabs';
|
|
11
|
-
import { Box, Flex, xcss, Stack } from '@atlaskit/primitives';
|
|
17
|
+
import { Box, Flex, xcss, Stack, Inline } from '@atlaskit/primitives';
|
|
12
18
|
import { IconButton } from '@atlaskit/button/new';
|
|
13
19
|
import Heading from '@atlaskit/heading';
|
|
14
20
|
import { useModal } from '@atlaskit/modal-dialog';
|
|
15
21
|
import Tooltip from '@atlaskit/tooltip';
|
|
16
22
|
import ChevronLeftIcon from '@atlaskit/icon/utility/chevron-left';
|
|
17
23
|
import ChevronRightIcon from '@atlaskit/icon/utility/chevron-right';
|
|
24
|
+
import CloseIcon from '@atlaskit/icon/core/close';
|
|
18
25
|
import { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
19
26
|
import { messages } from '../../shared/i18n';
|
|
20
27
|
import { Counter } from '../Counter';
|
|
@@ -24,6 +31,17 @@ var containerEdgeAngle = {
|
|
|
24
31
|
rightEdge: 270,
|
|
25
32
|
leftEdge: 90
|
|
26
33
|
};
|
|
34
|
+
var leftNavigationStyle = xcss({
|
|
35
|
+
marginLeft: 'space.200',
|
|
36
|
+
alignSelf: 'self-start',
|
|
37
|
+
marginTop: 'space.050'
|
|
38
|
+
});
|
|
39
|
+
var rightNavigationStyle = xcss({
|
|
40
|
+
marginRight: 'space.100',
|
|
41
|
+
marginLeft: 'auto',
|
|
42
|
+
alignSelf: 'self-start',
|
|
43
|
+
marginTop: 'space.050'
|
|
44
|
+
});
|
|
27
45
|
var fadedCss = function fadedCss(edge, theme) {
|
|
28
46
|
return css({
|
|
29
47
|
content: '""',
|
|
@@ -46,7 +64,9 @@ var customTabListStyles = css({
|
|
|
46
64
|
flexGrow: 1,
|
|
47
65
|
// paddingInline exists to maintain styling prior to @atlaskit/tabs update that removed baked in horizontal padding
|
|
48
66
|
paddingInline: "var(--ds-space-100, 8px)"
|
|
49
|
-
}
|
|
67
|
+
},
|
|
68
|
+
width: ' 100%',
|
|
69
|
+
alignItems: 'flex-start'
|
|
50
70
|
});
|
|
51
71
|
var customTabWrapper = function customTabWrapper(theme) {
|
|
52
72
|
return css({
|
|
@@ -96,61 +116,101 @@ var emojiStyles = xcss({
|
|
|
96
116
|
var counterStyle = xcss({
|
|
97
117
|
marginTop: 'space.025'
|
|
98
118
|
});
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
var emojiId = {
|
|
110
|
-
id: reaction.emojiId,
|
|
111
|
-
shortName: ''
|
|
112
|
-
};
|
|
113
|
-
return jsx("div", {
|
|
114
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
115
|
-
css: [customTabWrapper(colorMode), index === 0 ? firstElement : []]
|
|
116
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
117
|
-
,
|
|
118
|
-
className: "reaction-elements",
|
|
119
|
-
key: reaction.emojiId,
|
|
120
|
-
"data-testid": emojiId === null || emojiId === void 0 ? void 0 : emojiId.id
|
|
121
|
-
}, jsx(Tab, null, jsx(Flex, {
|
|
122
|
-
justifyContent: "center",
|
|
123
|
-
alignItems: "center",
|
|
124
|
-
direction: "row"
|
|
125
|
-
}, jsx(Box, {
|
|
126
|
-
xcss: emojiStyles
|
|
127
|
-
}, jsx(ResourcedEmoji, {
|
|
128
|
-
emojiProvider: emojiProvider,
|
|
129
|
-
emojiId: emojiId,
|
|
130
|
-
fitToHeight: 16,
|
|
131
|
-
showTooltip: true
|
|
132
|
-
})), jsx(Box, {
|
|
133
|
-
xcss: counterStyle
|
|
134
|
-
}, jsx(Counter, {
|
|
135
|
-
value: reaction.count
|
|
136
|
-
})))));
|
|
137
|
-
})));
|
|
119
|
+
var CloseButton = function CloseButton(_ref) {
|
|
120
|
+
var handleCloseReactionsDialog = _ref.handleCloseReactionsDialog;
|
|
121
|
+
var intl = useIntl();
|
|
122
|
+
return jsx(IconButton, {
|
|
123
|
+
onClick: handleCloseReactionsDialog,
|
|
124
|
+
icon: CloseIcon,
|
|
125
|
+
label: intl.formatMessage(messages.closeReactionsDialog),
|
|
126
|
+
appearance: "subtle",
|
|
127
|
+
isTooltipDisabled: false
|
|
128
|
+
});
|
|
138
129
|
};
|
|
139
|
-
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
130
|
+
var LeftNavigationButton = function LeftNavigationButton(_ref2) {
|
|
131
|
+
var handlePreviousPage = _ref2.handlePreviousPage;
|
|
132
|
+
var intl = useIntl();
|
|
133
|
+
return jsx(Flex, {
|
|
134
|
+
xcss: leftNavigationStyle
|
|
135
|
+
}, jsx(IconButton, {
|
|
136
|
+
spacing: "compact",
|
|
137
|
+
onClick: handlePreviousPage,
|
|
138
|
+
icon: ChevronLeftIcon,
|
|
139
|
+
label: intl.formatMessage(messages.leftNavigateLabel),
|
|
140
|
+
isTooltipDisabled: false
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
143
|
+
var RightNavigationButton = function RightNavigationButton(_ref3) {
|
|
144
|
+
var handleNextPage = _ref3.handleNextPage;
|
|
145
|
+
var intl = useIntl();
|
|
146
|
+
return jsx(Flex, {
|
|
147
|
+
xcss: rightNavigationStyle
|
|
148
|
+
}, jsx(IconButton, {
|
|
149
|
+
spacing: "compact",
|
|
150
|
+
onClick: handleNextPage,
|
|
151
|
+
icon: ChevronRightIcon,
|
|
152
|
+
label: intl.formatMessage(messages.rightNavigateLabel),
|
|
153
|
+
isTooltipDisabled: false
|
|
154
|
+
}));
|
|
155
|
+
};
|
|
156
|
+
export var ReactionsDialogHeader = function ReactionsDialogHeader(_ref4) {
|
|
157
|
+
var totalReactionsCount = _ref4.totalReactionsCount,
|
|
158
|
+
handlePreviousPage = _ref4.handlePreviousPage,
|
|
159
|
+
handleNextPage = _ref4.handleNextPage,
|
|
160
|
+
currentPage = _ref4.currentPage,
|
|
161
|
+
maxPages = _ref4.maxPages,
|
|
162
|
+
currentReactions = _ref4.currentReactions,
|
|
163
|
+
emojiProvider = _ref4.emojiProvider,
|
|
164
|
+
handleCloseReactionsDialog = _ref4.handleCloseReactionsDialog;
|
|
165
|
+
var _useState = useState({}),
|
|
166
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
167
|
+
cache = _useState2[0],
|
|
168
|
+
setCache = _useState2[1];
|
|
148
169
|
var _useModal = useModal(),
|
|
149
170
|
titleId = _useModal.titleId;
|
|
150
171
|
var intl = useIntl();
|
|
172
|
+
var _useThemeObserver = useThemeObserver(),
|
|
173
|
+
colorMode = _useThemeObserver.colorMode;
|
|
151
174
|
var isSinglePage = maxPages === 1;
|
|
152
175
|
var isOnFirstPage = currentPage === 1;
|
|
153
176
|
var isOnLastPage = currentPage === maxPages;
|
|
177
|
+
var handleHover = function handleHover(reaction) {
|
|
178
|
+
var emojiId = reaction.emojiId;
|
|
179
|
+
if (!emojiId || cache[emojiId]) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
183
|
+
var provider, emoji, capitalizedName;
|
|
184
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
185
|
+
while (1) switch (_context.prev = _context.next) {
|
|
186
|
+
case 0:
|
|
187
|
+
_context.next = 2;
|
|
188
|
+
return emojiProvider;
|
|
189
|
+
case 2:
|
|
190
|
+
provider = _context.sent;
|
|
191
|
+
_context.next = 5;
|
|
192
|
+
return provider.findByEmojiId({
|
|
193
|
+
shortName: '',
|
|
194
|
+
id: emojiId
|
|
195
|
+
});
|
|
196
|
+
case 5:
|
|
197
|
+
emoji = _context.sent;
|
|
198
|
+
if (emoji !== null && emoji !== void 0 && emoji.name) {
|
|
199
|
+
// capitalize first letter of each string
|
|
200
|
+
capitalizedName = emoji.name.replace(/\b\w/g, function (char) {
|
|
201
|
+
return char.toUpperCase();
|
|
202
|
+
});
|
|
203
|
+
setCache(function (prevCache) {
|
|
204
|
+
return _objectSpread(_objectSpread({}, prevCache), {}, _defineProperty({}, emojiId, capitalizedName));
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
case 7:
|
|
208
|
+
case "end":
|
|
209
|
+
return _context.stop();
|
|
210
|
+
}
|
|
211
|
+
}, _callee);
|
|
212
|
+
}))();
|
|
213
|
+
};
|
|
154
214
|
return jsx(Stack, null, jsx(Flex, {
|
|
155
215
|
direction: "row",
|
|
156
216
|
justifyContent: "space-between",
|
|
@@ -161,36 +221,54 @@ export var ReactionsDialogHeader = function ReactionsDialogHeader(_ref2) {
|
|
|
161
221
|
id: titleId
|
|
162
222
|
}, intl.formatMessage(messages.reactionsCount, {
|
|
163
223
|
count: totalReactionsCount
|
|
164
|
-
})),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
224
|
+
})), jsx(CloseButton, {
|
|
225
|
+
handleCloseReactionsDialog: handleCloseReactionsDialog
|
|
226
|
+
})), jsx(Inline, null, jsx("div", {
|
|
227
|
+
css: customTabListStyles,
|
|
228
|
+
id: "reactions-dialog-tabs-list"
|
|
229
|
+
}, jsx(TabList, null, !isSinglePage && !isOnFirstPage && jsx(LeftNavigationButton, {
|
|
230
|
+
handlePreviousPage: handlePreviousPage
|
|
231
|
+
}), currentReactions.map(function (reaction, index) {
|
|
232
|
+
var emojiId = {
|
|
233
|
+
id: reaction.emojiId,
|
|
234
|
+
shortName: ''
|
|
235
|
+
};
|
|
236
|
+
return (
|
|
237
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
238
|
+
jsx("div", {
|
|
239
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
240
|
+
css: [customTabWrapper(colorMode), index === 0 ? firstElement : []]
|
|
241
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
242
|
+
,
|
|
243
|
+
className: "reaction-elements",
|
|
244
|
+
key: reaction.emojiId,
|
|
245
|
+
"data-testid": emojiId === null || emojiId === void 0 ? void 0 : emojiId.id,
|
|
246
|
+
onMouseEnter: function onMouseEnter() {
|
|
247
|
+
return handleHover(reaction);
|
|
248
|
+
}
|
|
249
|
+
}, jsx(Tab, null, jsx(Tooltip, {
|
|
250
|
+
content: cache[reaction.emojiId],
|
|
251
|
+
canAppear: function canAppear() {
|
|
252
|
+
return !!cache[reaction.emojiId];
|
|
253
|
+
}
|
|
254
|
+
}, jsx(Flex, {
|
|
255
|
+
justifyContent: "center",
|
|
256
|
+
alignItems: "center",
|
|
257
|
+
direction: "row"
|
|
258
|
+
}, jsx(Box, {
|
|
259
|
+
xcss: emojiStyles
|
|
260
|
+
}, jsx(ResourcedEmoji, {
|
|
261
|
+
emojiProvider: emojiProvider,
|
|
262
|
+
emojiId: emojiId,
|
|
263
|
+
fitToHeight: 16,
|
|
264
|
+
showTooltip: true
|
|
265
|
+
})), jsx(Box, {
|
|
266
|
+
xcss: counterStyle
|
|
267
|
+
}, jsx(Counter, {
|
|
268
|
+
value: reaction.count
|
|
269
|
+
}))))))
|
|
270
|
+
);
|
|
271
|
+
}), !isSinglePage && !isOnLastPage && jsx(RightNavigationButton, {
|
|
272
|
+
handleNextPage: handleNextPage
|
|
273
|
+
})))));
|
|
196
274
|
};
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
import { Box } from '@atlaskit/primitives';
|
|
7
8
|
import { ReactionView } from './ReactionView';
|
|
8
9
|
export var ReactionsList = function ReactionsList(_ref) {
|
|
9
10
|
var reactions = _ref.reactions,
|
|
10
11
|
selectedEmojiId = _ref.selectedEmojiId,
|
|
11
12
|
emojiProvider = _ref.emojiProvider,
|
|
12
13
|
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
13
|
-
return jsx(
|
|
14
|
+
return jsx(Box, null, reactions.map(function (reaction) {
|
|
14
15
|
if (reaction.emojiId === selectedEmojiId) {
|
|
15
16
|
return jsx(ReactionView, {
|
|
16
17
|
key: reaction.emojiId,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import React, { useCallback, useState } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { useIntl } from 'react-intl-next';
|
|
5
5
|
import Popup from '@atlaskit/popup';
|
|
6
|
-
import { Box, Inline,
|
|
6
|
+
import { Box, Inline, Pressable, Flex, xcss } from '@atlaskit/primitives';
|
|
7
7
|
import Button from '@atlaskit/button/new';
|
|
8
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
|
+
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
9
10
|
import { Reaction } from '../Reaction';
|
|
10
11
|
import { ReactionSummaryButton } from './ReactionSummaryButton';
|
|
11
12
|
import { messages } from '../../shared/i18n';
|
|
@@ -17,6 +18,9 @@ var summaryPopupStyles = xcss({
|
|
|
17
18
|
var viewAllButtonStyling = xcss({
|
|
18
19
|
marginTop: 'space.050'
|
|
19
20
|
});
|
|
21
|
+
var iconStyle = xcss({
|
|
22
|
+
height: '20px'
|
|
23
|
+
});
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* Test id for the Reactions summary view popup
|
|
@@ -41,6 +45,7 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
41
45
|
subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
|
|
42
46
|
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog,
|
|
43
47
|
allowUserDialog = _ref.allowUserDialog;
|
|
48
|
+
var intl = useIntl();
|
|
44
49
|
var _useState = useState(false),
|
|
45
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
51
|
isSummaryPopupOpen = _useState2[0],
|
|
@@ -73,9 +78,11 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
73
78
|
});
|
|
74
79
|
}), allowUserDialog && /*#__PURE__*/React.createElement(Box, {
|
|
75
80
|
xcss: viewAllButtonStyling
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
82
|
+
backgroundColor: "color.background.neutral.subtle",
|
|
83
|
+
padding: "space.0"
|
|
76
84
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
77
|
-
content:
|
|
78
|
-
hideTooltipOnClick: true
|
|
85
|
+
content: intl.formatMessage(messages.seeWhoReactedTooltip)
|
|
79
86
|
}, function (tooltipProps) {
|
|
80
87
|
return /*#__PURE__*/React.createElement(Button, _extends({}, tooltipProps, {
|
|
81
88
|
spacing: "compact",
|
|
@@ -83,11 +90,13 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
83
90
|
handlePopupClose();
|
|
84
91
|
handleOpenReactionsDialog === null || handleOpenReactionsDialog === void 0 || handleOpenReactionsDialog(reactions[0].emojiId);
|
|
85
92
|
}
|
|
86
|
-
}), /*#__PURE__*/React.createElement(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, /*#__PURE__*/React.createElement(
|
|
90
|
-
|
|
93
|
+
}), /*#__PURE__*/React.createElement(Flex, {
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
xcss: iconStyle
|
|
96
|
+
}, /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
|
|
97
|
+
label: intl.formatMessage(messages.seeWhoReacted)
|
|
98
|
+
})));
|
|
99
|
+
}))));
|
|
91
100
|
},
|
|
92
101
|
isOpen: isSummaryPopupOpen,
|
|
93
102
|
onClose: handlePopupClose,
|