@atlaskit/reactions 25.0.0 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionDialog/ReactionView.js +2 -69
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +11 -17
- package/dist/cjs/components/ReactionDialog/ReactionsDialogHeader.js +168 -94
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +2 -1
- package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +16 -7
- package/dist/cjs/components/Reactions/Reactions.js +22 -11
- package/dist/cjs/shared/i18n.js +0 -5
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionDialog/ReactionView.js +4 -48
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +11 -17
- package/dist/es2019/components/ReactionDialog/ReactionsDialogHeader.js +129 -68
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +2 -1
- package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +17 -8
- package/dist/es2019/components/Reactions/Reactions.js +23 -12
- package/dist/es2019/shared/i18n.js +0 -5
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionDialog/ReactionView.js +4 -71
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +11 -17
- package/dist/esm/components/ReactionDialog/ReactionsDialogHeader.js +161 -83
- package/dist/esm/components/ReactionDialog/ReactionsList.js +2 -1
- package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +18 -9
- package/dist/esm/components/Reactions/Reactions.js +24 -13
- package/dist/esm/shared/i18n.js +0 -5
- package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +2 -1
- package/dist/types/components/ReactionDialog/ReactionsDialogHeader.d.ts +3 -2
- package/dist/types/components/Reactions/Reactions.d.ts +1 -0
- package/dist/types/shared/i18n.d.ts +0 -5
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +2 -1
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialogHeader.d.ts +3 -2
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +1 -0
- package/dist/types-ts4.5/shared/i18n.d.ts +0 -5
- package/package.json +1 -1
|
@@ -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:
|
|
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
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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,
|
package/dist/esm/shared/i18n.js
CHANGED
|
@@ -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,
|
|
15
|
+
export declare const ReactionsDialogHeader: ({ totalReactionsCount, handlePreviousPage, handleNextPage, currentPage, maxPages, currentReactions, emojiProvider, handleCloseReactionsDialog, }: ReactionsDialogModalHeaderProps) => jsx.JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -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,
|
|
15
|
+
export declare const ReactionsDialogHeader: ({ totalReactionsCount, handlePreviousPage, handleNextPage, currentPage, maxPages, currentReactions, emojiProvider, handleCloseReactionsDialog, }: ReactionsDialogModalHeaderProps) => jsx.JSX.Element;
|
|
15
16
|
export {};
|