@atlaskit/reactions 25.4.1 → 25.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/MockReactionsClient.js +2 -1
  3. package/dist/cjs/analytics/index.js +1 -1
  4. package/dist/cjs/components/Reaction/Reaction.js +6 -2
  5. package/dist/cjs/components/ReactionDialog/ReactionView.js +2 -6
  6. package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +8 -97
  7. package/dist/cjs/components/ReactionDialog/ReactionsDialogHeader.js +17 -11
  8. package/dist/cjs/components/ReactionDialog/ReactionsDialogTrigger.js +49 -0
  9. package/dist/cjs/components/ReactionDialog/ReactionsList.js +0 -3
  10. package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +6 -36
  11. package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +9 -5
  12. package/dist/cjs/components/ReactionTooltip/styles.js +12 -1
  13. package/dist/cjs/components/Reactions/Reactions.js +28 -59
  14. package/dist/es2019/MockReactionsClient.js +2 -1
  15. package/dist/es2019/analytics/index.js +1 -1
  16. package/dist/es2019/components/Reaction/Reaction.js +6 -2
  17. package/dist/es2019/components/ReactionDialog/ReactionView.js +1 -5
  18. package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +3 -87
  19. package/dist/es2019/components/ReactionDialog/ReactionsDialogHeader.js +20 -11
  20. package/dist/es2019/components/ReactionDialog/ReactionsDialogTrigger.js +43 -0
  21. package/dist/es2019/components/ReactionDialog/ReactionsList.js +0 -3
  22. package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +7 -35
  23. package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +10 -6
  24. package/dist/es2019/components/ReactionTooltip/styles.js +12 -1
  25. package/dist/es2019/components/Reactions/Reactions.js +27 -55
  26. package/dist/esm/MockReactionsClient.js +2 -1
  27. package/dist/esm/analytics/index.js +1 -1
  28. package/dist/esm/components/Reaction/Reaction.js +6 -2
  29. package/dist/esm/components/ReactionDialog/ReactionView.js +2 -6
  30. package/dist/esm/components/ReactionDialog/ReactionsDialog.js +9 -98
  31. package/dist/esm/components/ReactionDialog/ReactionsDialogHeader.js +17 -11
  32. package/dist/esm/components/ReactionDialog/ReactionsDialogTrigger.js +42 -0
  33. package/dist/esm/components/ReactionDialog/ReactionsList.js +0 -3
  34. package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +7 -37
  35. package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +10 -6
  36. package/dist/esm/components/ReactionTooltip/styles.js +12 -1
  37. package/dist/esm/components/Reactions/Reactions.js +29 -60
  38. package/dist/types/components/Reaction/Reaction.d.ts +9 -1
  39. package/dist/types/components/ReactionDialog/ReactionView.d.ts +2 -8
  40. package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +1 -2
  41. package/dist/types/components/ReactionDialog/ReactionsDialogTrigger.d.ts +6 -0
  42. package/dist/types/components/ReactionDialog/ReactionsList.d.ts +1 -3
  43. package/dist/types/components/ReactionSummary/ReactionSummaryView.d.ts +7 -3
  44. package/dist/types/components/ReactionTooltip/ReactionTooltip.d.ts +9 -1
  45. package/dist/types/components/ReactionTooltip/styles.d.ts +1 -0
  46. package/dist/types/components/Reactions/Reactions.d.ts +1 -6
  47. package/dist/types-ts4.5/components/Reaction/Reaction.d.ts +9 -1
  48. package/dist/types-ts4.5/components/ReactionDialog/ReactionView.d.ts +2 -8
  49. package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +1 -2
  50. package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialogTrigger.d.ts +6 -0
  51. package/dist/types-ts4.5/components/ReactionDialog/ReactionsList.d.ts +1 -3
  52. package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryView.d.ts +7 -3
  53. package/dist/types-ts4.5/components/ReactionTooltip/ReactionTooltip.d.ts +9 -1
  54. package/dist/types-ts4.5/components/ReactionTooltip/styles.d.ts +1 -0
  55. package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +1 -6
  56. package/package.json +1 -1
@@ -26,5 +26,13 @@ export type ReactionTooltipProps = PropsWithChildren<{
26
26
  * Optional flag for enabling tooltip (defaults to true)
27
27
  */
28
28
  isEnabled?: boolean;
29
+ /**
30
+ * Optional prop for enabling the Reactions Dialog
31
+ */
32
+ allowUserDialog?: boolean;
33
+ /**
34
+ * Optional function when the user wants to open the Reactions Dialog
35
+ */
36
+ handleOpenReactionsDialog?: (emojiId?: string, source?: string) => void;
29
37
  }>;
30
- export declare const ReactionTooltip: ({ children, emojiName, reaction: { users }, maxReactions, isEnabled, }: ReactionTooltipProps) => jsx.JSX.Element;
38
+ export declare const ReactionTooltip: ({ children, emojiName, reaction: { users }, maxReactions, isEnabled, allowUserDialog, handleOpenReactionsDialog, }: ReactionTooltipProps) => jsx.JSX.Element;
@@ -2,3 +2,4 @@ export declare const verticalMargin = 5;
2
2
  export declare const tooltipStyle: import("@emotion/react").SerializedStyles;
3
3
  export declare const emojiNameStyle: import("@emotion/react").SerializedStyles;
4
4
  export declare const footerStyle: import("@emotion/react").SerializedStyles;
5
+ export declare const underlineStyle: import("@emotion/react").SerializedStyles;
@@ -74,11 +74,6 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
74
74
  * @param emojiId current reaction emoji id
75
75
  */
76
76
  getReactionDetails?: (emojiId: string) => void;
77
- /**
78
- * @private
79
- * @deprecated use getReactionDetails instead
80
- */
81
- onReactionHover?: (emojiId: string) => void;
82
77
  /**
83
78
  * Optional error message to show when unable to display the reaction emoji
84
79
  */
@@ -159,4 +154,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
159
154
  /**
160
155
  * Renders list of reactions
161
156
  */
162
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, showRoundTrigger, isViewOnly, }: ReactionsProps) => jsx.JSX.Element>;
157
+ 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, showRoundTrigger, isViewOnly, }: ReactionsProps) => jsx.JSX.Element>;
@@ -39,8 +39,16 @@ export interface ReactionProps {
39
39
  * Optional prop for using an opaque button background instead of a transparent background
40
40
  */
41
41
  showOpaqueBackground?: boolean;
42
+ /**
43
+ * Optional prop for enabling the Reactions Dialog
44
+ */
45
+ allowUserDialog?: boolean;
46
+ /**
47
+ * Optional function when the user wants to open the Reactions Dialog
48
+ */
49
+ handleOpenReactionsDialog?: (emojiId?: string, source?: string) => void;
42
50
  }
43
51
  /**
44
52
  * Render an emoji reaction button
45
53
  */
46
- export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, showOpaqueBackground, }: ReactionProps) => jsx.JSX.Element;
54
+ export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, showOpaqueBackground, allowUserDialog, handleOpenReactionsDialog, }: ReactionProps) => jsx.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { type EmojiProvider } from '@atlaskit/emoji/resource';
3
2
  import { type ReactionSummary, type ProfileCardWrapper } from '../../types';
4
3
  export interface ReactionViewProps {
5
4
  /**
@@ -7,13 +6,8 @@ export interface ReactionViewProps {
7
6
  */
8
7
  reaction: ReactionSummary;
9
8
  /**
10
- * Current emoji selected in the reactions dialog
9
+ * Optional ProfileWrapper component to show profile card on hover
11
10
  */
12
- selectedEmojiId: string;
13
- /**
14
- * Provider for loading emojis
15
- */
16
- emojiProvider: Promise<EmojiProvider>;
17
11
  ProfileCardWrapper?: ProfileCardWrapper;
18
12
  }
19
- export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction, ProfileCardWrapper, }: ReactionViewProps) => jsx.JSX.Element;
13
+ export declare const ReactionView: ({ reaction, ProfileCardWrapper }: ReactionViewProps) => jsx.JSX.Element;
@@ -29,6 +29,5 @@ 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;
33
32
  }
34
- export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, handleReactionMouseEnter, }: ReactionsDialogProps) => jsx.JSX.Element;
33
+ export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, }: ReactionsDialogProps) => jsx.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface ReactionsDialogTriggerProps {
3
+ onClick: () => void;
4
+ }
5
+ export declare const ReactionsDialogTrigger: ({ onClick }: ReactionsDialogTriggerProps) => React.JSX.Element;
6
+ export {};
@@ -3,7 +3,6 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { jsx } from '@emotion/react';
6
- import { type EmojiProvider } from '@atlaskit/emoji/resource';
7
6
  import { type ReactionSummary, type ProfileCardWrapper } from '../../types';
8
7
  export interface ReactionsListProps {
9
8
  /**
@@ -17,10 +16,9 @@ export interface ReactionsListProps {
17
16
  /**
18
17
  * Provider for loading emojis
19
18
  */
20
- emojiProvider: Promise<EmojiProvider>;
21
19
  /**
22
20
  * A functional component from Confluence to show a profile card on hover
23
21
  */
24
22
  ProfileCardWrapper?: ProfileCardWrapper;
25
23
  }
26
- export declare const ReactionsList: ({ reactions, selectedEmojiId, emojiProvider, ProfileCardWrapper, }: ReactionsListProps) => jsx.JSX.Element;
24
+ export declare const ReactionsList: ({ reactions, selectedEmojiId, ProfileCardWrapper, }: ReactionsListProps) => jsx.JSX.Element;
@@ -32,9 +32,13 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
32
32
  */
33
33
  subtleReactionsSummaryAndPicker?: boolean;
34
34
  /**
35
- * Optional function when the user wants to see more users in a modal
35
+ * Optional prop for enabling the Reactions Dialog
36
36
  */
37
- handleOpenReactionsDialog?: (emojiId: string) => void;
37
+ allowUserDialog?: boolean;
38
+ /**
39
+ * Optional function when the user wants to open the Reactions Dialog
40
+ */
41
+ handleOpenReactionsDialog?: (emojiId?: string, source?: string) => void;
38
42
  }
39
- export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, handleOpenReactionsDialog, allowUserDialog, }: ReactionSummaryViewProps) => React.JSX.Element;
43
+ export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, }: ReactionSummaryViewProps) => React.JSX.Element;
40
44
  export {};
@@ -26,5 +26,13 @@ export type ReactionTooltipProps = PropsWithChildren<{
26
26
  * Optional flag for enabling tooltip (defaults to true)
27
27
  */
28
28
  isEnabled?: boolean;
29
+ /**
30
+ * Optional prop for enabling the Reactions Dialog
31
+ */
32
+ allowUserDialog?: boolean;
33
+ /**
34
+ * Optional function when the user wants to open the Reactions Dialog
35
+ */
36
+ handleOpenReactionsDialog?: (emojiId?: string, source?: string) => void;
29
37
  }>;
30
- export declare const ReactionTooltip: ({ children, emojiName, reaction: { users }, maxReactions, isEnabled, }: ReactionTooltipProps) => jsx.JSX.Element;
38
+ export declare const ReactionTooltip: ({ children, emojiName, reaction: { users }, maxReactions, isEnabled, allowUserDialog, handleOpenReactionsDialog, }: ReactionTooltipProps) => jsx.JSX.Element;
@@ -2,3 +2,4 @@ export declare const verticalMargin = 5;
2
2
  export declare const tooltipStyle: import("@emotion/react").SerializedStyles;
3
3
  export declare const emojiNameStyle: import("@emotion/react").SerializedStyles;
4
4
  export declare const footerStyle: import("@emotion/react").SerializedStyles;
5
+ export declare const underlineStyle: import("@emotion/react").SerializedStyles;
@@ -74,11 +74,6 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
74
74
  * @param emojiId current reaction emoji id
75
75
  */
76
76
  getReactionDetails?: (emojiId: string) => void;
77
- /**
78
- * @private
79
- * @deprecated use getReactionDetails instead
80
- */
81
- onReactionHover?: (emojiId: string) => void;
82
77
  /**
83
78
  * Optional error message to show when unable to display the reaction emoji
84
79
  */
@@ -159,4 +154,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
159
154
  /**
160
155
  * Renders list of reactions
161
156
  */
162
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, showRoundTrigger, isViewOnly, }: ReactionsProps) => jsx.JSX.Element>;
157
+ 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, showRoundTrigger, isViewOnly, }: ReactionsProps) => jsx.JSX.Element>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "25.4.1",
3
+ "version": "25.5.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"