@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.
Files changed (34) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/analytics/index.js +1 -1
  3. package/dist/cjs/components/ReactionDialog/ReactionView.js +2 -69
  4. package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +11 -17
  5. package/dist/cjs/components/ReactionDialog/ReactionsDialogHeader.js +168 -94
  6. package/dist/cjs/components/ReactionDialog/ReactionsList.js +2 -1
  7. package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +16 -7
  8. package/dist/cjs/components/Reactions/Reactions.js +22 -11
  9. package/dist/cjs/shared/i18n.js +0 -5
  10. package/dist/es2019/analytics/index.js +1 -1
  11. package/dist/es2019/components/ReactionDialog/ReactionView.js +4 -48
  12. package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +11 -17
  13. package/dist/es2019/components/ReactionDialog/ReactionsDialogHeader.js +129 -68
  14. package/dist/es2019/components/ReactionDialog/ReactionsList.js +2 -1
  15. package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +17 -8
  16. package/dist/es2019/components/Reactions/Reactions.js +23 -12
  17. package/dist/es2019/shared/i18n.js +0 -5
  18. package/dist/esm/analytics/index.js +1 -1
  19. package/dist/esm/components/ReactionDialog/ReactionView.js +4 -71
  20. package/dist/esm/components/ReactionDialog/ReactionsDialog.js +11 -17
  21. package/dist/esm/components/ReactionDialog/ReactionsDialogHeader.js +161 -83
  22. package/dist/esm/components/ReactionDialog/ReactionsList.js +2 -1
  23. package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +18 -9
  24. package/dist/esm/components/Reactions/Reactions.js +24 -13
  25. package/dist/esm/shared/i18n.js +0 -5
  26. package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +2 -1
  27. package/dist/types/components/ReactionDialog/ReactionsDialogHeader.d.ts +3 -2
  28. package/dist/types/components/Reactions/Reactions.d.ts +1 -0
  29. package/dist/types/shared/i18n.d.ts +0 -5
  30. package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +2 -1
  31. package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialogHeader.d.ts +3 -2
  32. package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +1 -0
  33. package/dist/types-ts4.5/shared/i18n.d.ts +0 -5
  34. package/package.json +1 -1
@@ -8,13 +8,14 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
8
8
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { jsx } from '@emotion/react';
11
- import { FormattedMessage } from 'react-intl-next';
11
+ import { FormattedMessage, useIntl } from 'react-intl-next';
12
12
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import { ModalTransition } from '@atlaskit/modal-dialog';
14
- import Button from '@atlaskit/button/new';
15
14
  import Tooltip from '@atlaskit/tooltip';
16
- import { Box, xcss } from '@atlaskit/primitives';
15
+ import { Box, Pressable, Flex, xcss } from '@atlaskit/primitives';
17
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
18
+ import Button from '@atlaskit/button/new';
18
19
  import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionsRenderedEvent, createReactionSelectionEvent, isSampled } from '../../analytics';
19
20
  import { SAMPLING_RATE_REACTIONS_RENDERED_EXP } from '../../shared/constants';
20
21
  import { messages } from '../../shared/i18n';
@@ -44,10 +45,6 @@ export var ufoExperiences = {
44
45
  selectedReactionChangeInsideDialog: ReactionDialogSelectedReactionChanged,
45
46
  pageNavigated: ReactionDialogPageNavigation
46
47
  };
47
- var dialogEntrypointButtonStyle = xcss({
48
- marginRight: 'space.050',
49
- marginTop: 'space.050'
50
- });
51
48
 
52
49
  /**
53
50
  * Test id for wrapper Reactions div
@@ -79,6 +76,13 @@ export function getTooltip(status, errorMessage) {
79
76
  return jsx(FormattedMessage, messages.addReaction);
80
77
  }
81
78
  }
79
+ var dialogEntrypointButtonStyle = xcss({
80
+ marginRight: 'space.050',
81
+ marginTop: 'space.050'
82
+ });
83
+ var iconStyle = xcss({
84
+ height: '20px'
85
+ });
82
86
 
83
87
  /**
84
88
  * Renders list of reactions
@@ -136,6 +140,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
136
140
  setSelectedEmojiId = _useState2[1];
137
141
  var _useAnalyticsEvents = useAnalyticsEvents(),
138
142
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
143
+ var intl = useIntl();
139
144
  var openTime = useRef();
140
145
  var renderTime = useRef();
141
146
  useEffect(function () {
@@ -327,18 +332,24 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
327
332
  });
328
333
  }), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && jsx(Box, {
329
334
  xcss: dialogEntrypointButtonStyle
335
+ }, jsx(Pressable, {
336
+ backgroundColor: "color.background.neutral.subtle",
337
+ padding: "space.0"
330
338
  }, jsx(Tooltip, {
331
- content: jsx(FormattedMessage, messages.seeWhoReactedTooltip),
332
- hideTooltipOnClick: true
339
+ content: intl.formatMessage(messages.seeWhoReactedTooltip)
333
340
  }, function (tooltipProps) {
334
341
  return jsx(Button, _extends({}, tooltipProps, {
335
342
  spacing: "compact",
336
343
  onClick: function onClick() {
337
344
  return handleOpenReactionsDialog(sortedReactions[0].emojiId);
338
- },
339
- testId: RENDER_VIEWALL_REACTED_USERS_DIALOG
340
- }), jsx(FormattedMessage, messages.seeWhoReacted));
341
- })), jsx(ReactionPicker
345
+ }
346
+ }), jsx(Flex, {
347
+ alignItems: "center",
348
+ xcss: iconStyle
349
+ }, jsx(ShowMoreHorizontalIcon, {
350
+ label: intl.formatMessage(messages.seeWhoReacted)
351
+ })));
352
+ }))), jsx(ReactionPicker
342
353
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
343
354
  , {
344
355
  css: reactionPickerStyle,
@@ -69,10 +69,5 @@ export var messages = defineMessages({
69
69
  id: 'reactions.dialog.viewall.tooltip',
70
70
  defaultMessage: 'View all user reactions',
71
71
  description: 'Tooltip content of see who reacted link'
72
- },
73
- peopleWhoReactedSubheading: {
74
- id: 'reactions.dialog.people-who-reacted.subheader',
75
- defaultMessage: 'People who reacted with {emojiShortName}',
76
- description: 'Subheading that shows the user which emoji tab they are on'
77
72
  }
78
73
  });
@@ -29,5 +29,6 @@ export interface ReactionsDialogProps {
29
29
  handleSelectReaction?: (emojiId: string) => void;
30
30
  handlePaginationChange?: (emojiId: string, currentPage: number, maxPages: number) => void;
31
31
  ProfileCardWrapper?: ProfileCardWrapper;
32
+ handleReactionMouseEnter?: (emojiId: string) => void;
32
33
  }
33
- export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, }: ReactionsDialogProps) => jsx.JSX.Element;
34
+ export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, handleReactionMouseEnter, }: ReactionsDialogProps) => jsx.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { jsx } from '@emotion/react';
2
+ import { type OnCloseHandler } from '@atlaskit/modal-dialog';
2
3
  import { type EmojiProvider } from '@atlaskit/emoji/resource';
3
4
  import { type ReactionSummary } from '../../types';
4
5
  interface ReactionsDialogModalHeaderProps {
@@ -8,8 +9,8 @@ interface ReactionsDialogModalHeaderProps {
8
9
  currentPage: number;
9
10
  maxPages: number;
10
11
  emojiProvider: Promise<EmojiProvider>;
11
- selectedEmojiId: string;
12
12
  currentReactions: ReactionSummary[];
13
+ handleCloseReactionsDialog: OnCloseHandler;
13
14
  }
14
- export declare const ReactionsDialogHeader: ({ totalReactionsCount, handlePreviousPage, handleNextPage, currentPage, maxPages, currentReactions, emojiProvider, selectedEmojiId, }: ReactionsDialogModalHeaderProps) => jsx.JSX.Element;
15
+ export declare const ReactionsDialogHeader: ({ totalReactionsCount, handlePreviousPage, handleNextPage, currentPage, maxPages, currentReactions, emojiProvider, handleCloseReactionsDialog, }: ReactionsDialogModalHeaderProps) => jsx.JSX.Element;
15
16
  export {};
@@ -75,6 +75,7 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
75
75
  */
76
76
  getReactionDetails?: (emojiId: string) => void;
77
77
  /**
78
+ * @private
78
79
  * @deprecated use getReactionDetails instead
79
80
  */
80
81
  onReactionHover?: (emojiId: string) => void;
@@ -69,9 +69,4 @@ export declare const messages: {
69
69
  defaultMessage: string;
70
70
  description: string;
71
71
  };
72
- peopleWhoReactedSubheading: {
73
- id: string;
74
- defaultMessage: string;
75
- description: string;
76
- };
77
72
  };
@@ -29,5 +29,6 @@ export interface ReactionsDialogProps {
29
29
  handleSelectReaction?: (emojiId: string) => void;
30
30
  handlePaginationChange?: (emojiId: string, currentPage: number, maxPages: number) => void;
31
31
  ProfileCardWrapper?: ProfileCardWrapper;
32
+ handleReactionMouseEnter?: (emojiId: string) => void;
32
33
  }
33
- export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, }: ReactionsDialogProps) => jsx.JSX.Element;
34
+ export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, handleReactionMouseEnter, }: ReactionsDialogProps) => jsx.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { jsx } from '@emotion/react';
2
+ import { type OnCloseHandler } from '@atlaskit/modal-dialog';
2
3
  import { type EmojiProvider } from '@atlaskit/emoji/resource';
3
4
  import { type ReactionSummary } from '../../types';
4
5
  interface ReactionsDialogModalHeaderProps {
@@ -8,8 +9,8 @@ interface ReactionsDialogModalHeaderProps {
8
9
  currentPage: number;
9
10
  maxPages: number;
10
11
  emojiProvider: Promise<EmojiProvider>;
11
- selectedEmojiId: string;
12
12
  currentReactions: ReactionSummary[];
13
+ handleCloseReactionsDialog: OnCloseHandler;
13
14
  }
14
- export declare const ReactionsDialogHeader: ({ totalReactionsCount, handlePreviousPage, handleNextPage, currentPage, maxPages, currentReactions, emojiProvider, selectedEmojiId, }: ReactionsDialogModalHeaderProps) => jsx.JSX.Element;
15
+ export declare const ReactionsDialogHeader: ({ totalReactionsCount, handlePreviousPage, handleNextPage, currentPage, maxPages, currentReactions, emojiProvider, handleCloseReactionsDialog, }: ReactionsDialogModalHeaderProps) => jsx.JSX.Element;
15
16
  export {};
@@ -75,6 +75,7 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
75
75
  */
76
76
  getReactionDetails?: (emojiId: string) => void;
77
77
  /**
78
+ * @private
78
79
  * @deprecated use getReactionDetails instead
79
80
  */
80
81
  onReactionHover?: (emojiId: string) => void;
@@ -69,9 +69,4 @@ export declare const messages: {
69
69
  defaultMessage: string;
70
70
  description: string;
71
71
  };
72
- peopleWhoReactedSubheading: {
73
- id: string;
74
- defaultMessage: string;
75
- description: string;
76
- };
77
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "25.0.0",
3
+ "version": "25.1.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"