@atlaskit/reactions 24.6.0 → 24.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/analytics/index.js +1 -1
  3. package/dist/cjs/components/ReactionDialog/ReactionView.js +76 -58
  4. package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +42 -81
  5. package/dist/cjs/components/ReactionDialog/ReactionsDialogHeader.js +205 -0
  6. package/dist/cjs/components/ReactionDialog/ReactionsList.js +12 -97
  7. package/dist/cjs/components/ReactionDialog/styles.js +4 -76
  8. package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +11 -4
  9. package/dist/cjs/components/Reactions/Reactions.js +23 -16
  10. package/dist/cjs/components/Reactions/styles.js +1 -12
  11. package/dist/es2019/analytics/index.js +1 -1
  12. package/dist/es2019/components/ReactionDialog/ReactionView.js +78 -60
  13. package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +30 -64
  14. package/dist/es2019/components/ReactionDialog/ReactionsDialogHeader.js +188 -0
  15. package/dist/es2019/components/ReactionDialog/ReactionsList.js +12 -83
  16. package/dist/es2019/components/ReactionDialog/styles.js +4 -72
  17. package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +12 -5
  18. package/dist/es2019/components/Reactions/Reactions.js +20 -16
  19. package/dist/es2019/components/Reactions/styles.js +0 -11
  20. package/dist/esm/analytics/index.js +1 -1
  21. package/dist/esm/components/ReactionDialog/ReactionView.js +79 -61
  22. package/dist/esm/components/ReactionDialog/ReactionsDialog.js +44 -82
  23. package/dist/esm/components/ReactionDialog/ReactionsDialogHeader.js +196 -0
  24. package/dist/esm/components/ReactionDialog/ReactionsList.js +11 -91
  25. package/dist/esm/components/ReactionDialog/styles.js +4 -76
  26. package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +12 -5
  27. package/dist/esm/components/Reactions/Reactions.js +23 -17
  28. package/dist/esm/components/Reactions/styles.js +0 -11
  29. package/dist/types/components/ReactionDialog/ReactionsDialogHeader.d.ts +15 -0
  30. package/dist/types/components/ReactionDialog/ReactionsList.d.ts +7 -7
  31. package/dist/types/components/ReactionDialog/styles.d.ts +0 -3
  32. package/dist/types/components/ReactionPicker/RepositionOnUpdate.d.ts +1 -1
  33. package/dist/types/components/ReactionSummary/ReactionSummaryView.d.ts +2 -2
  34. package/dist/types/components/Reactions/styles.d.ts +0 -1
  35. package/dist/types/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +1 -1
  36. package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
  37. package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialogHeader.d.ts +15 -0
  38. package/dist/types-ts4.5/components/ReactionDialog/ReactionsList.d.ts +7 -7
  39. package/dist/types-ts4.5/components/ReactionDialog/styles.d.ts +0 -3
  40. package/dist/types-ts4.5/components/ReactionPicker/RepositionOnUpdate.d.ts +1 -1
  41. package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryView.d.ts +2 -2
  42. package/dist/types-ts4.5/components/Reactions/styles.d.ts +0 -1
  43. package/dist/types-ts4.5/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +1 -1
  44. package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
  45. package/package.json +6 -3
@@ -1,118 +1,33 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.ReactionsList = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _react = require("react");
11
- var _react2 = require("@emotion/react");
12
- var _element = require("@atlaskit/emoji/element");
13
- var _tabs = _interopRequireWildcard(require("@atlaskit/tabs"));
14
- var _tokens = require("@atlaskit/tokens");
15
- var _primitives = require("@atlaskit/primitives");
16
- var _Counter = require("../Counter");
17
- var _styles = require("./styles");
7
+ var _react = require("@emotion/react");
18
8
  var _ReactionView = require("./ReactionView");
19
- 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); }
20
- 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; }
21
9
  /**
22
10
  * @jsxRuntime classic
23
11
  * @jsx jsx
24
12
  */
25
-
26
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
27
14
 
28
- var emojiStyles = (0, _primitives.xcss)({
29
- minWidth: '36px'
30
- });
31
15
  var ReactionsList = exports.ReactionsList = function ReactionsList(_ref) {
32
16
  var reactions = _ref.reactions,
33
- initialEmojiId = _ref.initialEmojiId,
17
+ selectedEmojiId = _ref.selectedEmojiId,
34
18
  emojiProvider = _ref.emojiProvider,
35
- onReactionChanged = _ref.onReactionChanged,
36
19
  ProfileCardWrapper = _ref.ProfileCardWrapper;
37
- var _useState = (0, _react.useState)(function () {
38
- // Calculate this only on initialize the List of Tabs and each Reactions View collection
39
- return {
40
- index: reactions.findIndex(function (reaction) {
41
- return reaction.emojiId === initialEmojiId;
42
- }),
43
- id: initialEmojiId
44
- };
45
- }),
46
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
- selectedEmoji = _useState2[0],
48
- setSelectedEmoji = _useState2[1];
49
- var _useThemeObserver = (0, _tokens.useThemeObserver)(),
50
- colorMode = _useThemeObserver.colorMode;
51
- (0, _react.useEffect)(function () {
52
- // select first emoji when navigating to a new page
53
- var currentPageEmojis = reactions.map(function (reaction) {
54
- return reaction.emojiId;
55
- });
56
- if (!currentPageEmojis.includes(selectedEmoji.id)) {
57
- setSelectedEmoji({
58
- index: 0,
59
- id: initialEmojiId
20
+ return (0, _react.jsx)("div", null, reactions.map(function (reaction) {
21
+ if (reaction.emojiId === selectedEmojiId) {
22
+ return (0, _react.jsx)(_ReactionView.ReactionView, {
23
+ key: reaction.emojiId,
24
+ reaction: reaction,
25
+ selectedEmojiId: selectedEmojiId,
26
+ emojiProvider: emojiProvider,
27
+ ProfileCardWrapper: ProfileCardWrapper
60
28
  });
29
+ } else {
30
+ return null;
61
31
  }
62
- // eslint-disable-next-line react-hooks/exhaustive-deps
63
- }, [reactions, initialEmojiId]);
64
- var onTabChange = (0, _react.useCallback)(function (index, analyticsEvent) {
65
- if (index === selectedEmoji.index) {
66
- return;
67
- }
68
- var emojiId = reactions[index].emojiId;
69
- setSelectedEmoji({
70
- index: index,
71
- id: emojiId
72
- });
73
- onReactionChanged(emojiId, analyticsEvent);
74
- }, [selectedEmoji.index, reactions, onReactionChanged]);
75
- return (0, _react2.jsx)(_tabs.default, {
76
- id: "reactions-dialog-tabs",
77
- onChange: onTabChange,
78
- selected: selectedEmoji.index
79
- }, (0, _react2.jsx)("div", {
80
- css: _styles.customTabListStyles,
81
- id: "reactions-dialog-tabs-list"
82
- }, (0, _react2.jsx)(_tabs.TabList, null, reactions.map(function (reaction) {
83
- var emojiId = {
84
- id: reaction.emojiId,
85
- shortName: ''
86
- };
87
- return (0, _react2.jsx)("div", {
88
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
89
- css: (0, _styles.customTabWrapper)((emojiId === null || emojiId === void 0 ? void 0 : emojiId.id) === selectedEmoji.id, selectedEmoji.id, colorMode)
90
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
91
- ,
92
- className: "reaction-elements",
93
- key: reaction.emojiId,
94
- "data-testid": emojiId === null || emojiId === void 0 ? void 0 : emojiId.id
95
- }, (0, _react2.jsx)(_tabs.Tab, null, (0, _react2.jsx)(_primitives.Flex, {
96
- justifyContent: "center",
97
- alignItems: "center",
98
- direction: "row"
99
- }, (0, _react2.jsx)(_primitives.Box, {
100
- xcss: emojiStyles
101
- }, (0, _react2.jsx)(_element.ResourcedEmoji, {
102
- emojiProvider: emojiProvider,
103
- emojiId: emojiId,
104
- fitToHeight: 16,
105
- showTooltip: true
106
- })), (0, _react2.jsx)(_Counter.Counter, {
107
- value: reaction.count
108
- }))));
109
- }))), reactions.map(function (reaction) {
110
- return (0, _react2.jsx)(_ReactionView.ReactionView, {
111
- key: reaction.emojiId,
112
- reaction: reaction,
113
- selectedEmojiId: selectedEmoji.id,
114
- emojiProvider: emojiProvider,
115
- ProfileCardWrapper: ProfileCardWrapper
116
- });
117
32
  }));
118
33
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.userStyle = exports.userListStyle = exports.reactionViewStyle = exports.navigationContainerStyle = exports.customTabWrapper = exports.customTabListStyles = exports.containerStyle = exports.centerSpinner = void 0;
6
+ exports.userStyle = exports.userListStyle = exports.navigationContainerStyle = exports.customTabListStyles = exports.containerStyle = exports.centerSpinner = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _colors = require("@atlaskit/theme/colors");
9
9
  /**
@@ -12,9 +12,6 @@ var _colors = require("@atlaskit/theme/colors");
12
12
  */
13
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
14
 
15
- var REACTIONS_CONTAINER_WIDTH = 48;
16
- var REACTION_CONTAINER_HEIGHT = 40;
17
-
18
15
  /*Reactions Container. Using pseudo Element :after to set border since with onClick of Reaction to higlight the
19
16
  border blue below the reaction. Setting Border Width based on number of reactions to make sure it shows up
20
17
  in case the container overflows */
@@ -39,55 +36,6 @@ var containerStyle = exports.containerStyle = function containerStyle(reactionsB
39
36
  }
40
37
  });
41
38
  };
42
- var containerEdgeAngle = {
43
- rightEdge: 270,
44
- leftEdge: 90
45
- };
46
- var fadedCss = function fadedCss(edge, theme) {
47
- return (0, _react.css)({
48
- content: '""',
49
- position: 'absolute',
50
- left: '0px',
51
- top: '0px',
52
- width: "".concat(REACTIONS_CONTAINER_WIDTH, "px"),
53
- height: "".concat(REACTION_CONTAINER_HEIGHT, "px"),
54
- zIndex: 0,
55
- background:
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
57
- theme === 'dark' ? "linear-gradient(".concat(containerEdgeAngle[edge], "deg, rgba(34, 39, 43, 0.95) 40.23%, rgba(34, 39, 43, 0.55) 58.33%, rgba(34, 39, 43, 0) 77.49%)") : "linear-gradient(".concat(containerEdgeAngle[edge], "deg, rgba(255, 255, 255, 0.95) 40.23%, rgba(255, 255, 255, 0.55) 58.33%, rgba(255, 255, 255, 0) 77.49%)")
58
- });
59
- };
60
- var customTabWrapper = exports.customTabWrapper = function customTabWrapper(isSelected, selectedEmojiId, theme) {
61
- return (0, _react.css)({
62
- flexShrink: 0,
63
- display: 'flex',
64
- flexDirection: 'column',
65
- textAlign: 'center',
66
- alignItems: 'center',
67
- justifyContent: 'center',
68
- minWidth: "".concat(REACTIONS_CONTAINER_WIDTH, "px"),
69
- boxSizing: 'border-box',
70
- position: 'relative',
71
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
72
- '> div': {
73
- minWidth: "".concat(REACTIONS_CONTAINER_WIDTH, "px"),
74
- minHeight: "".concat(REACTION_CONTAINER_HEIGHT, "px"),
75
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
76
- padding: '0px !important',
77
- alignItems: 'center',
78
- justifyContent: 'center'
79
- },
80
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
81
- '& > span': {
82
- minHeight: '16px',
83
- minWidth: '16px'
84
- },
85
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
86
- '&.disabled:after': fadedCss('rightEdge', theme),
87
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
88
- '&.disabled + &.disabled:after': fadedCss('leftEdge', theme)
89
- });
90
- };
91
39
 
92
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
93
41
  var navigationContainerStyle = exports.navigationContainerStyle = (0, _react.css)({
@@ -101,26 +49,6 @@ var navigationContainerStyle = exports.navigationContainerStyle = (0, _react.css
101
49
  }
102
50
  });
103
51
 
104
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
105
- var reactionViewStyle = exports.reactionViewStyle = (0, _react.css)({
106
- marginTop: "var(--ds-space-300, 24px)",
107
- display: 'flex',
108
- flexDirection: 'column',
109
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
110
- p: {
111
- margin: 0,
112
- color: "".concat("var(--ds-text, ".concat(_colors.N800, ")")),
113
- font: "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
114
- fontWeight: "var(--ds-font-weight-semibold, 600)",
115
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
116
- lineHeight: '20px',
117
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
118
- '> span': {
119
- marginRight: "var(--ds-space-100, 8px)"
120
- }
121
- }
122
- });
123
-
124
52
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
125
53
  var userListStyle = exports.userListStyle = (0, _react.css)({
126
54
  listStyle: 'none',
@@ -138,7 +66,7 @@ var userListStyle = exports.userListStyle = (0, _react.css)({
138
66
  var userStyle = exports.userStyle = (0, _react.css)({
139
67
  display: 'flex',
140
68
  alignItems: 'center',
141
- padding: "var(--ds-space-100, 8px)".concat(" 0px ", "var(--ds-space-100, 8px)", " 0px"),
69
+ padding: "var(--ds-space-050, 4px)".concat(" 0px ", "var(--ds-space-050, 4px)", " 0px"),
142
70
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
143
71
  '> span': {
144
72
  marginLeft: "var(--ds-space-200, 16px)"
@@ -149,7 +77,6 @@ var userStyle = exports.userStyle = (0, _react.css)({
149
77
  var customTabListStyles = exports.customTabListStyles = (0, _react.css)({
150
78
  overflow: 'auto',
151
79
  display: 'flex',
152
- paddingBottom: "var(--ds-space-050, 4px)",
153
80
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
154
81
  'div[role=tablist]': {
155
82
  flexGrow: 1,
@@ -163,5 +90,6 @@ var centerSpinner = exports.centerSpinner = (0, _react.css)({
163
90
  display: 'flex',
164
91
  justifyContent: 'center',
165
92
  alignItems: 'center',
166
- height: '100%'
93
+ height: '100%',
94
+ marginTop: "var(--ds-space-300, 24px)"
167
95
  });
@@ -23,6 +23,9 @@ var summaryPopupStyles = (0, _primitives.xcss)({
23
23
  paddingTop: 'space.050',
24
24
  maxWidth: '325px'
25
25
  });
26
+ var viewAllButtonStyling = (0, _primitives.xcss)({
27
+ marginTop: 'space.050'
28
+ });
26
29
 
27
30
  /**
28
31
  * Test id for the Reactions summary view popup
@@ -64,7 +67,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
64
67
  xcss: summaryPopupStyles,
65
68
  testId: RENDER_SUMMARY_VIEW_POPUP_TESTID,
66
69
  space: "space.025",
67
- shouldWrap: true
70
+ shouldWrap: true,
71
+ alignBlock: "center"
68
72
  }, reactions.map(function (reaction) {
69
73
  return /*#__PURE__*/_react.default.createElement(_Reaction.Reaction, {
70
74
  key: reaction.emojiId,
@@ -76,15 +80,18 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
76
80
  flash: flash[reaction.emojiId],
77
81
  showParticleEffect: particleEffectByEmoji[reaction.emojiId]
78
82
  });
79
- }), allowUserDialog && /*#__PURE__*/_react.default.createElement(_new.default, {
83
+ }), allowUserDialog && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
84
+ xcss: viewAllButtonStyling
85
+ }, /*#__PURE__*/_react.default.createElement(_new.default, {
80
86
  appearance: "subtle",
81
87
  onClick: function onClick() {
82
88
  return handleOpenReactionsDialog === null || handleOpenReactionsDialog === void 0 ? void 0 : handleOpenReactionsDialog(reactions[0].emojiId);
83
- }
89
+ },
90
+ spacing: "compact"
84
91
  }, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
85
92
  color: "color.text.subtlest",
86
93
  weight: "medium"
87
- }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReacted))));
94
+ }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReacted)))));
88
95
  },
89
96
  isOpen: isSummaryPopupOpen,
90
97
  onClose: handlePopupClose,
@@ -8,14 +8,17 @@ 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"));
11
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
13
  var _react = _interopRequireWildcard(require("react"));
13
14
  var _react2 = require("@emotion/react");
14
15
  var _reactIntlNext = require("react-intl-next");
15
16
  var _analyticsNext = require("@atlaskit/analytics-next");
16
17
  var _modalDialog = require("@atlaskit/modal-dialog");
17
- var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
18
+ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
18
19
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
20
+ var _primitives = require("@atlaskit/primitives");
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
22
  var _analytics = require("../../analytics");
20
23
  var _constants = require("../../shared/constants");
21
24
  var _i18n = require("../../shared/i18n");
@@ -35,6 +38,10 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
35
38
 
36
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
37
40
 
41
+ var tooltipStyle = (0, _primitives.xcss)({
42
+ paddingLeft: 'space.050'
43
+ });
44
+
38
45
  /**
39
46
  * Set of all available UFO experiences relating to reactions dialog
40
47
  */
@@ -149,7 +156,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
149
156
  if (status !== _types.ReactionStatus.ready) {
150
157
  renderTime.current = Date.now();
151
158
  } else {
152
- if ((0, _analytics.isSampled)(_constants.SAMPLING_RATE_REACTIONS_RENDERED_EXP)) {
159
+ var isSSR = process.env.REACT_SSR && (0, _platformFeatureFlags.fg)('platform_fix_analytics_error');
160
+ if ((0, _analytics.isSampled)(_constants.SAMPLING_RATE_REACTIONS_RENDERED_EXP) && !isSSR) {
153
161
  var _renderTime$current;
154
162
  (0, _analytics.createAndFireSafe)(createAnalyticsEvent, _analytics.createReactionsRenderedEvent, (_renderTime$current = renderTime.current) !== null && _renderTime$current !== void 0 ? _renderTime$current : Date.now() //renderTime.current can be null during unit test cases
155
163
  );
@@ -240,6 +248,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
240
248
  // ufo selected reaction inside the modal dialog
241
249
  ufoExperiences.selectedReactionChangeInsideDialog.start();
242
250
  handleReactionMouseEnter(emojiId);
251
+ setSelectedEmojiId(emojiId);
243
252
  if (analyticsEvent) {
244
253
  onDialogSelectReactionCallback(emojiId, analyticsEvent);
245
254
  }
@@ -317,7 +326,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
317
326
  showOpaqueBackground: showOpaqueBackground,
318
327
  subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
319
328
  handleOpenReactionsDialog: handleOpenReactionsDialog,
320
- allowUserDialog: allowUserDialog
329
+ allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions
321
330
  })) : memorizedReactions.map(function (reaction) {
322
331
  return (0, _react2.jsx)(_Reaction.Reaction, {
323
332
  key: reaction.emojiId,
@@ -348,21 +357,19 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
348
357
  showOpaqueBackground: showOpaqueBackground,
349
358
  showAddReactionText: showAddReactionText,
350
359
  subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
351
- }), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && (0, _react2.jsx)(_tooltip.default, {
360
+ }), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && (0, _react2.jsx)(_primitives.Box, {
361
+ xcss: tooltipStyle
362
+ }, (0, _react2.jsx)(_tooltip.default, {
352
363
  content: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReactedTooltip),
353
364
  hideTooltipOnClick: true
354
- }, (0, _react2.jsx)(_standardButton.default
355
- // TODO: (from codemod) "link" and "subtle-link" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.
356
- // https://product-fabric.atlassian.net/browse/DSP-18982
357
- , {
358
- appearance: "subtle-link",
359
- onClick: handleOpenAllReactionsDialog
360
- // TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
361
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
362
- ,
363
- css: _styles.seeWhoReactedStyle,
364
- testId: RENDER_VIEWALL_REACTED_USERS_DIALOG
365
- }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReacted))), (0, _react2.jsx)(_modalDialog.ModalTransition, null, !!selectedEmojiId && (0, _react2.jsx)(_ReactionDialog.ReactionsDialog, {
365
+ }, function (tooltipProps) {
366
+ return (0, _react2.jsx)(_new.default, (0, _extends2.default)({}, tooltipProps, {
367
+ appearance: "subtle",
368
+ spacing: "compact",
369
+ onClick: handleOpenAllReactionsDialog,
370
+ testId: RENDER_VIEWALL_REACTED_USERS_DIALOG
371
+ }), (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReacted));
372
+ })), (0, _react2.jsx)(_modalDialog.ModalTransition, null, !!selectedEmojiId && (0, _react2.jsx)(_ReactionDialog.ReactionsDialog, {
366
373
  selectedEmojiId: selectedEmojiId,
367
374
  reactions: memorizedReactions,
368
375
  emojiProvider: emojiProvider,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.wrapperStyle = exports.seeWhoReactedStyle = exports.reactionPickerStyle = void 0;
6
+ exports.wrapperStyle = exports.reactionPickerStyle = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  /**
9
9
  * @jsxRuntime classic
@@ -17,17 +17,6 @@ var reactionPickerStyle = exports.reactionPickerStyle = (0, _react.css)({
17
17
  marginTop: "var(--ds-space-050, 4px)"
18
18
  });
19
19
 
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
21
- var seeWhoReactedStyle = exports.seeWhoReactedStyle = (0, _react.css)({
22
- height: '24px',
23
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
24
- lineHeight: '24px',
25
- paddingLeft: 0,
26
- paddingRight: 0,
27
- marginTop: "var(--ds-space-050, 4px)",
28
- marginLeft: "var(--ds-space-050, 4px)"
29
- });
30
-
31
20
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
32
21
  var wrapperStyle = exports.wrapperStyle = (0, _react.css)({
33
22
  display: 'flex',
@@ -1,7 +1,7 @@
1
1
  import { createAndFireEvent } from '@atlaskit/analytics-next';
2
2
  import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
3
3
  const packageName = "@atlaskit/reactions";
4
- const packageVersion = "24.6.0";
4
+ const packageVersion = "24.8.0";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -10,12 +10,25 @@ import { jsx } from '@emotion/react';
10
10
  import { ResourcedEmoji } from '@atlaskit/emoji/element';
11
11
  import Avatar from '@atlaskit/avatar/Avatar';
12
12
  import Spinner from '@atlaskit/spinner';
13
- import { useTabPanel } from '@atlaskit/tabs';
14
- import { Text, Flex, xcss } from '@atlaskit/primitives';
13
+ import { TabPanel } from '@atlaskit/tabs';
14
+ import { Box, Flex, xcss, Inline } from '@atlaskit/primitives';
15
+ import Heading from '@atlaskit/heading';
15
16
  import { messages } from '../../shared/i18n';
16
- import { reactionViewStyle, userListStyle, userStyle, centerSpinner } from './styles';
17
+ import { userListStyle, userStyle, centerSpinner } from './styles';
17
18
  const userDescriptionStyle = xcss({
18
- marginLeft: 'space.200'
19
+ marginLeft: 'space.150'
20
+ });
21
+ const profileWrapperStyle = xcss({
22
+ marginLeft: 'space.0'
23
+ });
24
+ const reactionViewStyle = xcss({
25
+ marginTop: 'space.300'
26
+ });
27
+ const headerStyle = xcss({
28
+ alignItems: 'flex-end'
29
+ });
30
+ const emojiSpacingStlye = xcss({
31
+ marginLeft: 'space.100'
19
32
  });
20
33
  export const ReactionView = ({
21
34
  selectedEmojiId,
@@ -32,7 +45,8 @@ export const ReactionView = ({
32
45
  id: selectedEmojiId
33
46
  });
34
47
  if (emoji !== null && emoji !== void 0 && emoji.shortName) {
35
- setEmojiShortName(emoji.shortName);
48
+ const shortNameWithoutColons = emoji.shortName.replace(/:/g, '');
49
+ setEmojiShortName(shortNameWithoutColons);
36
50
  }
37
51
  })();
38
52
  }, [emojiProvider, selectedEmojiId, reaction]);
@@ -41,59 +55,63 @@ export const ReactionView = ({
41
55
  const reactionObj = reaction;
42
56
  return ((_reactionObj$users = reactionObj.users) === null || _reactionObj$users === void 0 ? void 0 : _reactionObj$users.sort((a, b) => a.displayName.localeCompare(b.displayName))) || [];
43
57
  }, [reaction]);
44
- const tabPanelAttributes = useTabPanel();
45
- return (
46
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
47
- jsx("div", _extends({
48
- css: reactionViewStyle
49
- }, tabPanelAttributes), jsx(Text, {
50
- as: "p"
51
- }, jsx(FormattedMessage, _extends({}, messages.peopleWhoReactedSubheading, {
52
- values: {
53
- emojiShortName
54
- }
55
- })), jsx(ResourcedEmoji, {
56
- emojiProvider: emojiProvider,
57
- emojiId: {
58
- id: selectedEmojiId,
59
- shortName: ''
60
- },
61
- fitToHeight: 24
62
- })), alphabeticalNames.length === 0 ?
63
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
64
- jsx("div", {
65
- css: centerSpinner
66
- }, jsx(Spinner, {
67
- size: "large"
68
- })) :
69
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
70
- jsx("ul", {
71
- css: userListStyle
72
- }, alphabeticalNames.map(user => {
73
- var _user$profilePicture;
74
- const profile = (_user$profilePicture = user.profilePicture) === null || _user$profilePicture === void 0 ? void 0 : _user$profilePicture.path;
75
- return (
76
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
77
- jsx("li", {
78
- css: userStyle,
79
- key: user.id
80
- }, ProfileCardWrapper && user.accountId ? jsx(ProfileCardWrapper, {
81
- userId: user.accountId,
82
- isAnonymous: false,
83
- canViewProfile: true,
84
- position: "left-start"
85
- }, jsx(Avatar, {
86
- size: "large",
87
- src: profile,
88
- testId: "profile"
89
- })) : jsx(Avatar, {
90
- size: "large",
91
- src: profile,
92
- testId: "profile"
93
- }), jsx(Flex, {
94
- xcss: userDescriptionStyle
95
- }, jsx("div", null, user.displayName)))
96
- );
97
- })))
98
- );
58
+ return jsx(TabPanel, null, jsx(Flex, {
59
+ direction: "column",
60
+ xcss: reactionViewStyle
61
+ }, jsx(Inline, {
62
+ xcss: headerStyle
63
+ }, jsx(Heading, {
64
+ size: "xsmall"
65
+ }, jsx(FormattedMessage, _extends({}, messages.peopleWhoReactedSubheading, {
66
+ values: {
67
+ emojiShortName
68
+ }
69
+ }))), jsx(Box, {
70
+ as: "span",
71
+ xcss: emojiSpacingStlye
72
+ }, jsx(ResourcedEmoji, {
73
+ emojiProvider: emojiProvider,
74
+ emojiId: {
75
+ id: selectedEmojiId,
76
+ shortName: ''
77
+ },
78
+ fitToHeight: 24
79
+ }))), alphabeticalNames.length === 0 ?
80
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
81
+ jsx("div", {
82
+ css: centerSpinner
83
+ }, jsx(Spinner, {
84
+ size: "large"
85
+ })) :
86
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
87
+ jsx("ul", {
88
+ css: userListStyle
89
+ }, alphabeticalNames.map(user => {
90
+ var _user$profilePicture;
91
+ const profile = (_user$profilePicture = user.profilePicture) === null || _user$profilePicture === void 0 ? void 0 : _user$profilePicture.path;
92
+ return (
93
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
94
+ jsx("li", {
95
+ css: userStyle,
96
+ key: user.id
97
+ }, ProfileCardWrapper && user.accountId ? jsx(Box, {
98
+ xcss: profileWrapperStyle
99
+ }, jsx(ProfileCardWrapper, {
100
+ userId: user.accountId,
101
+ isAnonymous: false,
102
+ canViewProfile: true,
103
+ position: "left-start"
104
+ }, jsx(Avatar, {
105
+ size: "medium",
106
+ src: profile,
107
+ testId: "profile"
108
+ }))) : jsx(Avatar, {
109
+ size: "medium",
110
+ src: profile,
111
+ testId: "profile"
112
+ }), jsx(Flex, {
113
+ xcss: userDescriptionStyle
114
+ }, jsx("div", null, user.displayName)))
115
+ );
116
+ }))));
99
117
  };