@atlaskit/reactions 31.1.0 → 31.3.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 (31) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/analytics/index.js +1 -1
  3. package/dist/cjs/components/ReactionButton.js +2 -0
  4. package/dist/cjs/components/ReactionSummaryButton.js +5 -1
  5. package/dist/cjs/components/ReactionSummaryView.js +59 -14
  6. package/dist/cjs/components/Reactions.js +6 -4
  7. package/dist/cjs/components/Trigger.compiled.css +2 -1
  8. package/dist/cjs/components/Trigger.js +2 -2
  9. package/dist/es2019/analytics/index.js +1 -1
  10. package/dist/es2019/components/ReactionButton.js +2 -0
  11. package/dist/es2019/components/ReactionSummaryButton.js +5 -1
  12. package/dist/es2019/components/ReactionSummaryView.js +53 -15
  13. package/dist/es2019/components/Reactions.js +5 -4
  14. package/dist/es2019/components/Trigger.compiled.css +2 -1
  15. package/dist/es2019/components/Trigger.js +2 -2
  16. package/dist/esm/analytics/index.js +1 -1
  17. package/dist/esm/components/ReactionButton.js +2 -0
  18. package/dist/esm/components/ReactionSummaryButton.js +5 -1
  19. package/dist/esm/components/ReactionSummaryView.js +59 -14
  20. package/dist/esm/components/Reactions.js +6 -4
  21. package/dist/esm/components/Trigger.compiled.css +2 -1
  22. package/dist/esm/components/Trigger.js +2 -2
  23. package/dist/types/components/ReactionButton.d.ts +2 -1
  24. package/dist/types/components/ReactionSummaryButton.d.ts +8 -0
  25. package/dist/types/components/ReactionSummaryView.d.ts +5 -1
  26. package/dist/types/components/Reactions.d.ts +5 -1
  27. package/dist/types-ts4.5/components/ReactionButton.d.ts +2 -1
  28. package/dist/types-ts4.5/components/ReactionSummaryButton.d.ts +8 -0
  29. package/dist/types-ts4.5/components/ReactionSummaryView.d.ts +5 -1
  30. package/dist/types-ts4.5/components/Reactions.d.ts +5 -1
  31. package/package.json +1 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 31.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#143861](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143861)
8
+ [`54b42c1ffa021`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/54b42c1ffa021) -
9
+ [ux] Updating the UI for the summary tray that includes the reaction picker
10
+
11
+ ## 31.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#143535](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143535)
16
+ [`a39ad7cdc2c99`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a39ad7cdc2c99) -
17
+ [ux] Adds hoverable reactions summary functionality behind a prop as part of byline reactions
18
+ changes
19
+
3
20
  ## 31.1.0
4
21
 
5
22
  ### Minor Changes
@@ -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 = "31.1.0";
14
+ var packageVersion = "31.3.0";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -45,6 +45,7 @@ var ReactionButton = exports.ReactionButton = function ReactionButton(_ref) {
45
45
  ariaLabel = _ref.ariaLabel,
46
46
  ariaPressed = _ref.ariaPressed,
47
47
  onMouseEnter = _ref.onMouseEnter,
48
+ onMouseLeave = _ref.onMouseLeave,
48
49
  onFocus = _ref.onFocus,
49
50
  children = _ref.children,
50
51
  _ref$dataAttributes = _ref.dataAttributes,
@@ -53,6 +54,7 @@ var ReactionButton = exports.ReactionButton = function ReactionButton(_ref) {
53
54
  return /*#__PURE__*/React.createElement(_compiled.Pressable, (0, _extends2.default)({
54
55
  onClick: onClick,
55
56
  onMouseEnter: onMouseEnter,
57
+ onMouseLeave: onMouseLeave,
56
58
  onFocus: onFocus,
57
59
  "aria-label": ariaLabel,
58
60
  "aria-pressed": ariaPressed,
@@ -49,7 +49,9 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
49
49
  _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
50
50
  subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
51
51
  _ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
52
- useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme;
52
+ useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme,
53
+ onMouseEnter = _ref.onMouseEnter,
54
+ onMouseLeave = _ref.onMouseLeave;
53
55
  var intl = (0, _reactIntlNext.useIntl)();
54
56
 
55
57
  // Helper function to sort reactions by count and return top N
@@ -73,6 +75,8 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
73
75
  justifyContent: "center"
74
76
  }, /*#__PURE__*/React.createElement(_ReactionButton.ReactionButton, {
75
77
  onClick: onClick,
78
+ onMouseEnter: onMouseEnter,
79
+ onMouseLeave: onMouseLeave,
76
80
  testId: RENDER_SUMMARY_BUTTON_TESTID,
77
81
  ariaLabel: intl.formatMessage(_i18n.messages.summary),
78
82
  showSubtleStyle: subtleReactionsSummaryAndPicker,
@@ -57,23 +57,77 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
57
57
  reactionPickerTriggerIcon = _ref.reactionPickerTriggerIcon,
58
58
  onOpen = _ref.onOpen,
59
59
  useButtonAlignmentStyling = _ref.useButtonAlignmentStyling,
60
- reactionPickerTriggerText = _ref.reactionPickerTriggerText;
60
+ reactionPickerTriggerText = _ref.reactionPickerTriggerText,
61
+ _ref$hoverableSummary = _ref.hoverableSummaryView,
62
+ hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary;
61
63
  var _useState = (0, _react.useState)(false),
62
64
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
63
65
  isSummaryPopupOpen = _useState2[0],
64
66
  setSummaryPopupOpen = _useState2[1];
67
+ var _useState3 = (0, _react.useState)(false),
68
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
69
+ isHoveringSummaryView = _useState4[0],
70
+ setIsHoveringSummaryView = _useState4[1];
71
+ var _useState5 = (0, _react.useState)(false),
72
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
73
+ isSummaryViewButtonHovered = _useState6[0],
74
+ setIsSummaryViewButtonHovered = _useState6[1];
65
75
  var handlePopupClose = (0, _react.useCallback)(function () {
66
76
  return setSummaryPopupOpen(false);
67
77
  }, []);
68
78
  var handleSummaryClick = (0, _react.useCallback)(function () {
69
79
  return setSummaryPopupOpen(!isSummaryPopupOpen);
70
80
  }, [isSummaryPopupOpen]);
81
+ var handleButtonMouseEnter = (0, _react.useCallback)(function () {
82
+ setIsSummaryViewButtonHovered(true);
83
+ if (hoverableSummaryView) {
84
+ setSummaryPopupOpen(true);
85
+ }
86
+ }, [hoverableSummaryView]);
87
+ var handleButtonMouseLeave = (0, _react.useCallback)(function () {
88
+ setIsSummaryViewButtonHovered(false);
89
+ if (hoverableSummaryView && !isHoveringSummaryView) {
90
+ setSummaryPopupOpen(false);
91
+ }
92
+ }, [hoverableSummaryView, isHoveringSummaryView]);
93
+ var handleSummaryViewTrayMouseEnter = (0, _react.useCallback)(function () {
94
+ setIsHoveringSummaryView(true);
95
+ if (hoverableSummaryView) {
96
+ setSummaryPopupOpen(true);
97
+ }
98
+ }, [hoverableSummaryView]);
99
+ var handleSummaryViewTrayMouseLeave = (0, _react.useCallback)(function () {
100
+ setIsHoveringSummaryView(false);
101
+ if (hoverableSummaryView && !isSummaryViewButtonHovered) {
102
+ setSummaryPopupOpen(false);
103
+ }
104
+ }, [hoverableSummaryView, isSummaryViewButtonHovered]);
105
+ var handleEmojiSelection = (0, _react.useCallback)(function (emojiId, source) {
106
+ onSelection(emojiId, source);
107
+ if (hoverableSummaryView) {
108
+ setSummaryPopupOpen(false);
109
+ }
110
+ }, [onSelection, hoverableSummaryView]);
71
111
  return /*#__PURE__*/React.createElement(_popup.default, {
72
112
  placement: placement,
113
+ offset: hoverableSummaryView ? [0, 0] : undefined,
73
114
  content: function content() {
74
115
  return /*#__PURE__*/React.createElement(_compiled.Box, {
75
- testId: RENDER_SUMMARY_VIEW_POPUP_TESTID
76
- }, /*#__PURE__*/React.createElement(_compiled.Inline, {
116
+ testId: RENDER_SUMMARY_VIEW_POPUP_TESTID,
117
+ onMouseEnter: handleSummaryViewTrayMouseEnter,
118
+ onMouseLeave: handleSummaryViewTrayMouseLeave
119
+ }, allowSelectFromSummaryView && /*#__PURE__*/React.createElement(_compiled.Flex, {
120
+ justifyContent: "center"
121
+ }, /*#__PURE__*/React.createElement(_ReactionSummaryViewEmojiPicker.ReactionSummaryViewEmojiPicker, {
122
+ emojiProvider: emojiProvider,
123
+ disabled: disabled,
124
+ onSelection: handleEmojiSelection,
125
+ emojiPickerSize: emojiPickerSize,
126
+ tooltipContent: tooltipContent,
127
+ reactionPickerTriggerIcon: reactionPickerTriggerIcon,
128
+ reactionPickerTriggerText: reactionPickerTriggerText,
129
+ onOpen: onOpen
130
+ })), /*#__PURE__*/React.createElement(_compiled.Inline, {
77
131
  xcss: styles.summaryPopup,
78
132
  space: "space.025",
79
133
  shouldWrap: true,
@@ -92,17 +146,6 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
92
146
  handleOpenReactionsDialog: handleOpenReactionsDialog,
93
147
  isViewOnly: isViewOnly
94
148
  });
95
- })), allowSelectFromSummaryView && /*#__PURE__*/React.createElement(_compiled.Flex, {
96
- justifyContent: "center"
97
- }, /*#__PURE__*/React.createElement(_ReactionSummaryViewEmojiPicker.ReactionSummaryViewEmojiPicker, {
98
- emojiProvider: emojiProvider,
99
- disabled: disabled,
100
- onSelection: onSelection,
101
- emojiPickerSize: emojiPickerSize,
102
- tooltipContent: tooltipContent,
103
- reactionPickerTriggerIcon: reactionPickerTriggerIcon,
104
- reactionPickerTriggerText: reactionPickerTriggerText,
105
- onOpen: onOpen
106
149
  })));
107
150
  },
108
151
  isOpen: isSummaryPopupOpen,
@@ -112,6 +155,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
112
155
  emojiProvider: emojiProvider,
113
156
  reactions: reactions,
114
157
  onClick: handleSummaryClick,
158
+ onMouseEnter: handleButtonMouseEnter,
159
+ onMouseLeave: handleButtonMouseLeave,
115
160
  showOpaqueBackground: showOpaqueBackground,
116
161
  subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
117
162
  useButtonAlignmentStyling: useButtonAlignmentStyling
@@ -17,7 +17,6 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntlNext = require("react-intl-next");
18
18
  var _analyticsNext = require("@atlaskit/analytics-next");
19
19
  var _modalDialog = require("@atlaskit/modal-dialog");
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  var _segment = _interopRequireDefault(require("@atlaskit/react-ufo/segment"));
22
21
  var _analytics = require("../analytics");
23
22
  var _constants = require("../shared/constants");
@@ -143,7 +142,9 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
143
142
  allowSelectFromSummaryView = _ref$allowSelectFromS === void 0 ? false : _ref$allowSelectFromS,
144
143
  _ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
145
144
  useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme,
146
- reactionPickerTriggerText = _ref.reactionPickerTriggerText;
145
+ reactionPickerTriggerText = _ref.reactionPickerTriggerText,
146
+ _ref$hoverableSummary = _ref.hoverableSummaryView,
147
+ hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary;
147
148
  var _useState = (0, _react.useState)(''),
148
149
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
149
150
  selectedEmojiId = _useState2[0],
@@ -161,7 +162,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
161
162
  if (status !== _types.ReactionStatus.ready) {
162
163
  renderTime.current = Date.now();
163
164
  } else {
164
- var isSSR = process.env.REACT_SSR && (0, _platformFeatureFlags.fg)('platform_fix_analytics_error');
165
+ var isSSR = process.env.REACT_SSR;
165
166
  if ((0, _analytics.isSampled)(_constants.SAMPLING_RATE_REACTIONS_RENDERED_EXP) && !isSSR) {
166
167
  var _renderTime$current;
167
168
  (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
@@ -325,7 +326,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
325
326
  emojiPickerSize: emojiPickerSize,
326
327
  onOpen: handlePickerOpen,
327
328
  useButtonAlignmentStyling: useButtonAlignmentStyling,
328
- reactionPickerTriggerText: reactionPickerTriggerText
329
+ reactionPickerTriggerText: reactionPickerTriggerText,
330
+ hoverableSummaryView: hoverableSummaryView
329
331
  })) : memorizedReactions.map(function (reaction) {
330
332
  return /*#__PURE__*/_react.default.createElement(_Reaction.Reaction, {
331
333
  key: reaction.emojiId,
@@ -24,10 +24,11 @@
24
24
  ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
25
25
  ._bfhkvuon{background-color:var(--ds-surface,#fff)}
26
26
  ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
27
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
27
28
  ._ca0qze3t{padding-top:var(--ds-space-0,0)}
28
29
  ._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
29
- ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
30
30
  ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
31
+ ._p12f3xl8{max-width:305px}
31
32
  ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
32
33
  ._u5f31b66{padding-right:var(--ds-space-050,4px)}
33
34
  ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
@@ -26,8 +26,8 @@ var styles = {
26
26
  opaqueEnabledTrigger: "_1h6dmuej _bfhkvuon _irr3108i _1di61ji5",
27
27
  disabledTrigger: "_1h6d13gt _bfhksyzs",
28
28
  miniMode: "_2rkoglpi _1dqoglyw _1ul91tcg _ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66",
29
- fullWidthSummaryViewReactionPickerTrigger: "_1bsb1osq _19bvu2gc _u5f3u2gc _n3tdu2gc",
30
- fullWidth: "_1bsb1osq"
29
+ fullWidthSummaryViewReactionPickerTrigger: "_1bsb1osq _ca0qu2gc _19bvu2gc _u5f3u2gc",
30
+ fullWidth: "_1bsb1osq _p12f3xl8"
31
31
  };
32
32
 
33
33
  /**
@@ -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 = "31.1.0";
4
+ const packageVersion = "31.3.0";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -34,6 +34,7 @@ export const ReactionButton = ({
34
34
  ariaLabel,
35
35
  ariaPressed,
36
36
  onMouseEnter,
37
+ onMouseLeave,
37
38
  onFocus,
38
39
  children,
39
40
  dataAttributes = {},
@@ -42,6 +43,7 @@ export const ReactionButton = ({
42
43
  return /*#__PURE__*/React.createElement(Pressable, _extends({
43
44
  onClick: onClick,
44
45
  onMouseEnter: onMouseEnter,
46
+ onMouseLeave: onMouseLeave,
45
47
  onFocus: onFocus,
46
48
  "aria-label": ariaLabel,
47
49
  "aria-pressed": ariaPressed,
@@ -33,7 +33,9 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
33
33
  onClick,
34
34
  showOpaqueBackground = false,
35
35
  subtleReactionsSummaryAndPicker = false,
36
- useButtonAlignmentStyling = false
36
+ useButtonAlignmentStyling = false,
37
+ onMouseEnter,
38
+ onMouseLeave
37
39
  }, ref) => {
38
40
  const intl = useIntl();
39
41
 
@@ -54,6 +56,8 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
54
56
  justifyContent: "center"
55
57
  }, /*#__PURE__*/React.createElement(ReactionButton, {
56
58
  onClick: onClick,
59
+ onMouseEnter: onMouseEnter,
60
+ onMouseLeave: onMouseLeave,
57
61
  testId: RENDER_SUMMARY_BUTTON_TESTID,
58
62
  ariaLabel: intl.formatMessage(messages.summary),
59
63
  showSubtleStyle: subtleReactionsSummaryAndPicker,
@@ -39,16 +39,63 @@ export const ReactionSummaryView = ({
39
39
  reactionPickerTriggerIcon,
40
40
  onOpen,
41
41
  useButtonAlignmentStyling,
42
- reactionPickerTriggerText
42
+ reactionPickerTriggerText,
43
+ hoverableSummaryView = false
43
44
  }) => {
44
45
  const [isSummaryPopupOpen, setSummaryPopupOpen] = useState(false);
46
+ const [isHoveringSummaryView, setIsHoveringSummaryView] = useState(false);
47
+ const [isSummaryViewButtonHovered, setIsSummaryViewButtonHovered] = useState(false);
45
48
  const handlePopupClose = useCallback(() => setSummaryPopupOpen(false), []);
46
49
  const handleSummaryClick = useCallback(() => setSummaryPopupOpen(!isSummaryPopupOpen), [isSummaryPopupOpen]);
50
+ const handleButtonMouseEnter = useCallback(() => {
51
+ setIsSummaryViewButtonHovered(true);
52
+ if (hoverableSummaryView) {
53
+ setSummaryPopupOpen(true);
54
+ }
55
+ }, [hoverableSummaryView]);
56
+ const handleButtonMouseLeave = useCallback(() => {
57
+ setIsSummaryViewButtonHovered(false);
58
+ if (hoverableSummaryView && !isHoveringSummaryView) {
59
+ setSummaryPopupOpen(false);
60
+ }
61
+ }, [hoverableSummaryView, isHoveringSummaryView]);
62
+ const handleSummaryViewTrayMouseEnter = useCallback(() => {
63
+ setIsHoveringSummaryView(true);
64
+ if (hoverableSummaryView) {
65
+ setSummaryPopupOpen(true);
66
+ }
67
+ }, [hoverableSummaryView]);
68
+ const handleSummaryViewTrayMouseLeave = useCallback(() => {
69
+ setIsHoveringSummaryView(false);
70
+ if (hoverableSummaryView && !isSummaryViewButtonHovered) {
71
+ setSummaryPopupOpen(false);
72
+ }
73
+ }, [hoverableSummaryView, isSummaryViewButtonHovered]);
74
+ const handleEmojiSelection = useCallback((emojiId, source) => {
75
+ onSelection(emojiId, source);
76
+ if (hoverableSummaryView) {
77
+ setSummaryPopupOpen(false);
78
+ }
79
+ }, [onSelection, hoverableSummaryView]);
47
80
  return /*#__PURE__*/React.createElement(Popup, {
48
81
  placement: placement,
82
+ offset: hoverableSummaryView ? [0, 0] : undefined,
49
83
  content: () => /*#__PURE__*/React.createElement(Box, {
50
- testId: RENDER_SUMMARY_VIEW_POPUP_TESTID
51
- }, /*#__PURE__*/React.createElement(Inline, {
84
+ testId: RENDER_SUMMARY_VIEW_POPUP_TESTID,
85
+ onMouseEnter: handleSummaryViewTrayMouseEnter,
86
+ onMouseLeave: handleSummaryViewTrayMouseLeave
87
+ }, allowSelectFromSummaryView && /*#__PURE__*/React.createElement(Flex, {
88
+ justifyContent: "center"
89
+ }, /*#__PURE__*/React.createElement(ReactionSummaryViewEmojiPicker, {
90
+ emojiProvider: emojiProvider,
91
+ disabled: disabled,
92
+ onSelection: handleEmojiSelection,
93
+ emojiPickerSize: emojiPickerSize,
94
+ tooltipContent: tooltipContent,
95
+ reactionPickerTriggerIcon: reactionPickerTriggerIcon,
96
+ reactionPickerTriggerText: reactionPickerTriggerText,
97
+ onOpen: onOpen
98
+ })), /*#__PURE__*/React.createElement(Inline, {
52
99
  xcss: styles.summaryPopup,
53
100
  space: "space.025",
54
101
  shouldWrap: true,
@@ -65,24 +112,15 @@ export const ReactionSummaryView = ({
65
112
  allowUserDialog: allowUserDialog,
66
113
  handleOpenReactionsDialog: handleOpenReactionsDialog,
67
114
  isViewOnly: isViewOnly
68
- }))), allowSelectFromSummaryView && /*#__PURE__*/React.createElement(Flex, {
69
- justifyContent: "center"
70
- }, /*#__PURE__*/React.createElement(ReactionSummaryViewEmojiPicker, {
71
- emojiProvider: emojiProvider,
72
- disabled: disabled,
73
- onSelection: onSelection,
74
- emojiPickerSize: emojiPickerSize,
75
- tooltipContent: tooltipContent,
76
- reactionPickerTriggerIcon: reactionPickerTriggerIcon,
77
- reactionPickerTriggerText: reactionPickerTriggerText,
78
- onOpen: onOpen
79
- }))),
115
+ })))),
80
116
  isOpen: isSummaryPopupOpen,
81
117
  onClose: handlePopupClose,
82
118
  trigger: triggerProps => /*#__PURE__*/React.createElement(ReactionSummaryButton, _extends({}, triggerProps, {
83
119
  emojiProvider: emojiProvider,
84
120
  reactions: reactions,
85
121
  onClick: handleSummaryClick,
122
+ onMouseEnter: handleButtonMouseEnter,
123
+ onMouseLeave: handleButtonMouseLeave,
86
124
  showOpaqueBackground: showOpaqueBackground,
87
125
  subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
88
126
  useButtonAlignmentStyling: useButtonAlignmentStyling
@@ -5,7 +5,6 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
7
7
  import { ModalTransition } from '@atlaskit/modal-dialog';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import UFOSegment from '@atlaskit/react-ufo/segment';
10
9
  import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionsRenderedEvent, createReactionSelectionEvent, isSampled } from '../analytics';
11
10
  import { SAMPLING_RATE_REACTIONS_RENDERED_EXP } from '../shared/constants';
@@ -107,7 +106,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
107
106
  reactionPickerTriggerIcon,
108
107
  allowSelectFromSummaryView = false,
109
108
  useButtonAlignmentStyling = false,
110
- reactionPickerTriggerText
109
+ reactionPickerTriggerText,
110
+ hoverableSummaryView = false
111
111
  }) => {
112
112
  const [selectedEmojiId, setSelectedEmojiId] = useState('');
113
113
  const {
@@ -124,7 +124,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
124
124
  if (status !== ReactionStatus.ready) {
125
125
  renderTime.current = Date.now();
126
126
  } else {
127
- const isSSR = process.env.REACT_SSR && fg('platform_fix_analytics_error');
127
+ const isSSR = process.env.REACT_SSR;
128
128
  if (isSampled(SAMPLING_RATE_REACTIONS_RENDERED_EXP) && !isSSR) {
129
129
  var _renderTime$current;
130
130
  createAndFireSafe(createAnalyticsEvent, createReactionsRenderedEvent, (_renderTime$current = renderTime.current) !== null && _renderTime$current !== void 0 ? _renderTime$current : Date.now() //renderTime.current can be null during unit test cases
@@ -276,7 +276,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
276
276
  emojiPickerSize: emojiPickerSize,
277
277
  onOpen: handlePickerOpen,
278
278
  useButtonAlignmentStyling: useButtonAlignmentStyling,
279
- reactionPickerTriggerText: reactionPickerTriggerText
279
+ reactionPickerTriggerText: reactionPickerTriggerText,
280
+ hoverableSummaryView: hoverableSummaryView
280
281
  })) : memorizedReactions.map(reaction => /*#__PURE__*/React.createElement(Reaction, {
281
282
  key: reaction.emojiId,
282
283
  reaction: reaction,
@@ -24,10 +24,11 @@
24
24
  ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
25
25
  ._bfhkvuon{background-color:var(--ds-surface,#fff)}
26
26
  ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
27
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
27
28
  ._ca0qze3t{padding-top:var(--ds-space-0,0)}
28
29
  ._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
29
- ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
30
30
  ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
31
+ ._p12f3xl8{max-width:305px}
31
32
  ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
32
33
  ._u5f31b66{padding-right:var(--ds-space-050,4px)}
33
34
  ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
@@ -19,8 +19,8 @@ const styles = {
19
19
  opaqueEnabledTrigger: "_1h6dmuej _bfhkvuon _irr3108i _1di61ji5",
20
20
  disabledTrigger: "_1h6d13gt _bfhksyzs",
21
21
  miniMode: "_2rkoglpi _1dqoglyw _1ul91tcg _ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66",
22
- fullWidthSummaryViewReactionPickerTrigger: "_1bsb1osq _19bvu2gc _u5f3u2gc _n3tdu2gc",
23
- fullWidth: "_1bsb1osq"
22
+ fullWidthSummaryViewReactionPickerTrigger: "_1bsb1osq _ca0qu2gc _19bvu2gc _u5f3u2gc",
23
+ fullWidth: "_1bsb1osq _p12f3xl8"
24
24
  };
25
25
 
26
26
  /**
@@ -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 = "31.1.0";
7
+ var packageVersion = "31.3.0";
8
8
  /**
9
9
  * TODO: move to utility package?
10
10
  * A random sampling function
@@ -35,6 +35,7 @@ export var ReactionButton = function ReactionButton(_ref) {
35
35
  ariaLabel = _ref.ariaLabel,
36
36
  ariaPressed = _ref.ariaPressed,
37
37
  onMouseEnter = _ref.onMouseEnter,
38
+ onMouseLeave = _ref.onMouseLeave,
38
39
  onFocus = _ref.onFocus,
39
40
  children = _ref.children,
40
41
  _ref$dataAttributes = _ref.dataAttributes,
@@ -43,6 +44,7 @@ export var ReactionButton = function ReactionButton(_ref) {
43
44
  return /*#__PURE__*/React.createElement(Pressable, _extends({
44
45
  onClick: onClick,
45
46
  onMouseEnter: onMouseEnter,
47
+ onMouseLeave: onMouseLeave,
46
48
  onFocus: onFocus,
47
49
  "aria-label": ariaLabel,
48
50
  "aria-pressed": ariaPressed,
@@ -39,7 +39,9 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
39
39
  _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
40
40
  subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
41
41
  _ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
42
- useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme;
42
+ useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme,
43
+ onMouseEnter = _ref.onMouseEnter,
44
+ onMouseLeave = _ref.onMouseLeave;
43
45
  var intl = useIntl();
44
46
 
45
47
  // Helper function to sort reactions by count and return top N
@@ -63,6 +65,8 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
63
65
  justifyContent: "center"
64
66
  }, /*#__PURE__*/React.createElement(ReactionButton, {
65
67
  onClick: onClick,
68
+ onMouseEnter: onMouseEnter,
69
+ onMouseLeave: onMouseLeave,
66
70
  testId: RENDER_SUMMARY_BUTTON_TESTID,
67
71
  ariaLabel: intl.formatMessage(messages.summary),
68
72
  showSubtleStyle: subtleReactionsSummaryAndPicker,
@@ -47,23 +47,77 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
47
47
  reactionPickerTriggerIcon = _ref.reactionPickerTriggerIcon,
48
48
  onOpen = _ref.onOpen,
49
49
  useButtonAlignmentStyling = _ref.useButtonAlignmentStyling,
50
- reactionPickerTriggerText = _ref.reactionPickerTriggerText;
50
+ reactionPickerTriggerText = _ref.reactionPickerTriggerText,
51
+ _ref$hoverableSummary = _ref.hoverableSummaryView,
52
+ hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary;
51
53
  var _useState = useState(false),
52
54
  _useState2 = _slicedToArray(_useState, 2),
53
55
  isSummaryPopupOpen = _useState2[0],
54
56
  setSummaryPopupOpen = _useState2[1];
57
+ var _useState3 = useState(false),
58
+ _useState4 = _slicedToArray(_useState3, 2),
59
+ isHoveringSummaryView = _useState4[0],
60
+ setIsHoveringSummaryView = _useState4[1];
61
+ var _useState5 = useState(false),
62
+ _useState6 = _slicedToArray(_useState5, 2),
63
+ isSummaryViewButtonHovered = _useState6[0],
64
+ setIsSummaryViewButtonHovered = _useState6[1];
55
65
  var handlePopupClose = useCallback(function () {
56
66
  return setSummaryPopupOpen(false);
57
67
  }, []);
58
68
  var handleSummaryClick = useCallback(function () {
59
69
  return setSummaryPopupOpen(!isSummaryPopupOpen);
60
70
  }, [isSummaryPopupOpen]);
71
+ var handleButtonMouseEnter = useCallback(function () {
72
+ setIsSummaryViewButtonHovered(true);
73
+ if (hoverableSummaryView) {
74
+ setSummaryPopupOpen(true);
75
+ }
76
+ }, [hoverableSummaryView]);
77
+ var handleButtonMouseLeave = useCallback(function () {
78
+ setIsSummaryViewButtonHovered(false);
79
+ if (hoverableSummaryView && !isHoveringSummaryView) {
80
+ setSummaryPopupOpen(false);
81
+ }
82
+ }, [hoverableSummaryView, isHoveringSummaryView]);
83
+ var handleSummaryViewTrayMouseEnter = useCallback(function () {
84
+ setIsHoveringSummaryView(true);
85
+ if (hoverableSummaryView) {
86
+ setSummaryPopupOpen(true);
87
+ }
88
+ }, [hoverableSummaryView]);
89
+ var handleSummaryViewTrayMouseLeave = useCallback(function () {
90
+ setIsHoveringSummaryView(false);
91
+ if (hoverableSummaryView && !isSummaryViewButtonHovered) {
92
+ setSummaryPopupOpen(false);
93
+ }
94
+ }, [hoverableSummaryView, isSummaryViewButtonHovered]);
95
+ var handleEmojiSelection = useCallback(function (emojiId, source) {
96
+ onSelection(emojiId, source);
97
+ if (hoverableSummaryView) {
98
+ setSummaryPopupOpen(false);
99
+ }
100
+ }, [onSelection, hoverableSummaryView]);
61
101
  return /*#__PURE__*/React.createElement(Popup, {
62
102
  placement: placement,
103
+ offset: hoverableSummaryView ? [0, 0] : undefined,
63
104
  content: function content() {
64
105
  return /*#__PURE__*/React.createElement(Box, {
65
- testId: RENDER_SUMMARY_VIEW_POPUP_TESTID
66
- }, /*#__PURE__*/React.createElement(Inline, {
106
+ testId: RENDER_SUMMARY_VIEW_POPUP_TESTID,
107
+ onMouseEnter: handleSummaryViewTrayMouseEnter,
108
+ onMouseLeave: handleSummaryViewTrayMouseLeave
109
+ }, allowSelectFromSummaryView && /*#__PURE__*/React.createElement(Flex, {
110
+ justifyContent: "center"
111
+ }, /*#__PURE__*/React.createElement(ReactionSummaryViewEmojiPicker, {
112
+ emojiProvider: emojiProvider,
113
+ disabled: disabled,
114
+ onSelection: handleEmojiSelection,
115
+ emojiPickerSize: emojiPickerSize,
116
+ tooltipContent: tooltipContent,
117
+ reactionPickerTriggerIcon: reactionPickerTriggerIcon,
118
+ reactionPickerTriggerText: reactionPickerTriggerText,
119
+ onOpen: onOpen
120
+ })), /*#__PURE__*/React.createElement(Inline, {
67
121
  xcss: styles.summaryPopup,
68
122
  space: "space.025",
69
123
  shouldWrap: true,
@@ -82,17 +136,6 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
82
136
  handleOpenReactionsDialog: handleOpenReactionsDialog,
83
137
  isViewOnly: isViewOnly
84
138
  });
85
- })), allowSelectFromSummaryView && /*#__PURE__*/React.createElement(Flex, {
86
- justifyContent: "center"
87
- }, /*#__PURE__*/React.createElement(ReactionSummaryViewEmojiPicker, {
88
- emojiProvider: emojiProvider,
89
- disabled: disabled,
90
- onSelection: onSelection,
91
- emojiPickerSize: emojiPickerSize,
92
- tooltipContent: tooltipContent,
93
- reactionPickerTriggerIcon: reactionPickerTriggerIcon,
94
- reactionPickerTriggerText: reactionPickerTriggerText,
95
- onOpen: onOpen
96
139
  })));
97
140
  },
98
141
  isOpen: isSummaryPopupOpen,
@@ -102,6 +145,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
102
145
  emojiProvider: emojiProvider,
103
146
  reactions: reactions,
104
147
  onClick: handleSummaryClick,
148
+ onMouseEnter: handleButtonMouseEnter,
149
+ onMouseLeave: handleButtonMouseLeave,
105
150
  showOpaqueBackground: showOpaqueBackground,
106
151
  subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
107
152
  useButtonAlignmentStyling: useButtonAlignmentStyling
@@ -7,7 +7,6 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
9
9
  import { ModalTransition } from '@atlaskit/modal-dialog';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import UFOSegment from '@atlaskit/react-ufo/segment';
12
11
  import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionsRenderedEvent, createReactionSelectionEvent, isSampled } from '../analytics';
13
12
  import { SAMPLING_RATE_REACTIONS_RENDERED_EXP } from '../shared/constants';
@@ -131,7 +130,9 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
131
130
  allowSelectFromSummaryView = _ref$allowSelectFromS === void 0 ? false : _ref$allowSelectFromS,
132
131
  _ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
133
132
  useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme,
134
- reactionPickerTriggerText = _ref.reactionPickerTriggerText;
133
+ reactionPickerTriggerText = _ref.reactionPickerTriggerText,
134
+ _ref$hoverableSummary = _ref.hoverableSummaryView,
135
+ hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary;
135
136
  var _useState = useState(''),
136
137
  _useState2 = _slicedToArray(_useState, 2),
137
138
  selectedEmojiId = _useState2[0],
@@ -149,7 +150,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
149
150
  if (status !== ReactionStatus.ready) {
150
151
  renderTime.current = Date.now();
151
152
  } else {
152
- var isSSR = process.env.REACT_SSR && fg('platform_fix_analytics_error');
153
+ var isSSR = process.env.REACT_SSR;
153
154
  if (isSampled(SAMPLING_RATE_REACTIONS_RENDERED_EXP) && !isSSR) {
154
155
  var _renderTime$current;
155
156
  createAndFireSafe(createAnalyticsEvent, createReactionsRenderedEvent, (_renderTime$current = renderTime.current) !== null && _renderTime$current !== void 0 ? _renderTime$current : Date.now() //renderTime.current can be null during unit test cases
@@ -313,7 +314,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
313
314
  emojiPickerSize: emojiPickerSize,
314
315
  onOpen: handlePickerOpen,
315
316
  useButtonAlignmentStyling: useButtonAlignmentStyling,
316
- reactionPickerTriggerText: reactionPickerTriggerText
317
+ reactionPickerTriggerText: reactionPickerTriggerText,
318
+ hoverableSummaryView: hoverableSummaryView
317
319
  })) : memorizedReactions.map(function (reaction) {
318
320
  return /*#__PURE__*/React.createElement(Reaction, {
319
321
  key: reaction.emojiId,
@@ -24,10 +24,11 @@
24
24
  ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
25
25
  ._bfhkvuon{background-color:var(--ds-surface,#fff)}
26
26
  ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
27
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
27
28
  ._ca0qze3t{padding-top:var(--ds-space-0,0)}
28
29
  ._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
29
- ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
30
30
  ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
31
+ ._p12f3xl8{max-width:305px}
31
32
  ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
32
33
  ._u5f31b66{padding-right:var(--ds-space-050,4px)}
33
34
  ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
@@ -19,8 +19,8 @@ var styles = {
19
19
  opaqueEnabledTrigger: "_1h6dmuej _bfhkvuon _irr3108i _1di61ji5",
20
20
  disabledTrigger: "_1h6d13gt _bfhksyzs",
21
21
  miniMode: "_2rkoglpi _1dqoglyw _1ul91tcg _ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66",
22
- fullWidthSummaryViewReactionPickerTrigger: "_1bsb1osq _19bvu2gc _u5f3u2gc _n3tdu2gc",
23
- fullWidth: "_1bsb1osq"
22
+ fullWidthSummaryViewReactionPickerTrigger: "_1bsb1osq _ca0qu2gc _19bvu2gc _u5f3u2gc",
23
+ fullWidth: "_1bsb1osq _p12f3xl8"
24
24
  };
25
25
 
26
26
  /**
@@ -6,6 +6,7 @@ interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
6
6
  ariaLabel: string;
7
7
  ariaPressed?: boolean;
8
8
  onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
+ onMouseLeave?: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
10
  onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
10
11
  dataAttributes?: {
11
12
  [key: string]: string;
@@ -17,5 +18,5 @@ interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
17
18
  useCompactStyles?: boolean;
18
19
  reacted?: boolean;
19
20
  }
20
- export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaPressed, onMouseEnter, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
+ export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaPressed, onMouseEnter, onMouseLeave, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
22
  export {};
@@ -17,6 +17,14 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
17
17
  * Optional prop for applying subtle styling to reaction summary button
18
18
  */
19
19
  subtleReactionsSummaryAndPicker?: boolean;
20
+ /**
21
+ * Optional event handler when mouse enters the button
22
+ */
23
+ onMouseEnter?: () => void;
24
+ /**
25
+ * Optional event handler when mouse leaves the button
26
+ */
27
+ onMouseLeave?: () => void;
20
28
  }
21
29
  /**
22
30
  * Test id for summary reaction wrapper button
@@ -53,6 +53,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
53
53
  * Optional event handler when the emoji picker is opened
54
54
  */
55
55
  onOpen?: () => void;
56
+ /**
57
+ * Optional prop to make the summary view open on hover
58
+ */
59
+ hoverableSummaryView?: boolean;
56
60
  }
57
- export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, }: ReactionSummaryViewProps) => JSX.Element;
61
+ export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, }: ReactionSummaryViewProps) => JSX.Element;
58
62
  export {};
@@ -161,6 +161,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
161
161
  * Optional prop for controlling text of the trigger button
162
162
  */
163
163
  reactionPickerTriggerText?: string;
164
+ /**
165
+ * Optional prop for controlling if the summary view is hoverable
166
+ */
167
+ hoverableSummaryView?: boolean;
164
168
  }
165
169
  export interface OpenReactionsDialogOptions {
166
170
  emojiId?: string;
@@ -173,4 +177,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
173
177
  /**
174
178
  * Renders list of reactions
175
179
  */
176
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, }: ReactionsProps) => JSX.Element>;
180
+ export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, }: ReactionsProps) => JSX.Element>;
@@ -6,6 +6,7 @@ interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
6
6
  ariaLabel: string;
7
7
  ariaPressed?: boolean;
8
8
  onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
+ onMouseLeave?: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
10
  onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
10
11
  dataAttributes?: {
11
12
  [key: string]: string;
@@ -17,5 +18,5 @@ interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
17
18
  useCompactStyles?: boolean;
18
19
  reacted?: boolean;
19
20
  }
20
- export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaPressed, onMouseEnter, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
+ export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaPressed, onMouseEnter, onMouseLeave, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
22
  export {};
@@ -17,6 +17,14 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
17
17
  * Optional prop for applying subtle styling to reaction summary button
18
18
  */
19
19
  subtleReactionsSummaryAndPicker?: boolean;
20
+ /**
21
+ * Optional event handler when mouse enters the button
22
+ */
23
+ onMouseEnter?: () => void;
24
+ /**
25
+ * Optional event handler when mouse leaves the button
26
+ */
27
+ onMouseLeave?: () => void;
20
28
  }
21
29
  /**
22
30
  * Test id for summary reaction wrapper button
@@ -53,6 +53,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
53
53
  * Optional event handler when the emoji picker is opened
54
54
  */
55
55
  onOpen?: () => void;
56
+ /**
57
+ * Optional prop to make the summary view open on hover
58
+ */
59
+ hoverableSummaryView?: boolean;
56
60
  }
57
- export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, }: ReactionSummaryViewProps) => JSX.Element;
61
+ export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, }: ReactionSummaryViewProps) => JSX.Element;
58
62
  export {};
@@ -161,6 +161,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
161
161
  * Optional prop for controlling text of the trigger button
162
162
  */
163
163
  reactionPickerTriggerText?: string;
164
+ /**
165
+ * Optional prop for controlling if the summary view is hoverable
166
+ */
167
+ hoverableSummaryView?: boolean;
164
168
  }
165
169
  export interface OpenReactionsDialogOptions {
166
170
  emojiId?: string;
@@ -173,4 +177,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
173
177
  /**
174
178
  * Renders list of reactions
175
179
  */
176
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, }: ReactionsProps) => JSX.Element>;
180
+ export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, }: ReactionsProps) => JSX.Element>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "31.1.0",
3
+ "version": "31.3.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -121,9 +121,6 @@
121
121
  "platform-component-visual-refresh": {
122
122
  "type": "boolean"
123
123
  },
124
- "platform_fix_analytics_error": {
125
- "type": "boolean"
126
- },
127
124
  "platform-make-accessible-close-button": {
128
125
  "type": "boolean"
129
126
  }