@atlaskit/reactions 21.8.1 → 22.0.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 +26 -0
- package/dist/cjs/MockReactionsClient.js +24 -16
- package/dist/cjs/analytics/analytics.js +9 -1
- package/dist/cjs/analytics/ufo.js +24 -2
- package/dist/cjs/components/Counter/Counter.js +16 -20
- package/dist/cjs/components/Reaction/Reaction.js +52 -18
- package/dist/cjs/components/Reaction/styles.js +8 -1
- package/dist/cjs/components/ReactionDialog/ReactionView.js +121 -0
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +187 -0
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +104 -0
- package/dist/cjs/components/ReactionDialog/index.js +13 -0
- package/dist/cjs/components/ReactionDialog/styles.js +202 -0
- package/dist/cjs/components/ReactionPicker/ReactionPicker.js +15 -20
- package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +26 -12
- package/dist/cjs/components/ReactionTooltip/styles.js +11 -2
- package/dist/cjs/components/Reactions/Reactions.js +166 -21
- package/dist/cjs/components/Reactions/styles.js +11 -6
- package/dist/cjs/components/Trigger/Trigger.js +1 -2
- package/dist/cjs/components/index.js +9 -1
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +6 -2
- package/dist/cjs/containers/ConnectedReactionsView/ConnectedReactionsView.js +9 -4
- package/dist/cjs/shared/constants.js +62 -10
- package/dist/cjs/shared/i18n.js +40 -0
- package/dist/cjs/shared/utils.js +60 -2
- package/dist/cjs/types/reaction.js +13 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/MockReactionsClient.js +22 -14
- package/dist/es2019/analytics/analytics.js +3 -0
- package/dist/es2019/analytics/ufo.js +19 -0
- package/dist/es2019/components/Counter/Counter.js +16 -15
- package/dist/es2019/components/Reaction/Reaction.js +43 -18
- package/dist/es2019/components/Reaction/styles.js +9 -2
- package/dist/es2019/components/ReactionDialog/ReactionView.js +69 -0
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +145 -0
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +69 -0
- package/dist/es2019/components/ReactionDialog/index.js +1 -0
- package/dist/es2019/components/ReactionDialog/styles.js +169 -0
- package/dist/es2019/components/ReactionPicker/ReactionPicker.js +12 -20
- package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +22 -12
- package/dist/es2019/components/ReactionTooltip/styles.js +9 -1
- package/dist/es2019/components/Reactions/Reactions.js +146 -22
- package/dist/es2019/components/Reactions/styles.js +9 -5
- package/dist/es2019/components/Trigger/Trigger.js +1 -2
- package/dist/es2019/components/index.js +2 -1
- package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +8 -2
- package/dist/es2019/containers/ConnectedReactionsView/ConnectedReactionsView.js +5 -4
- package/dist/es2019/shared/constants.js +55 -6
- package/dist/es2019/shared/i18n.js +43 -0
- package/dist/es2019/shared/utils.js +51 -0
- package/dist/es2019/types/reaction.js +13 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/MockReactionsClient.js +24 -13
- package/dist/esm/analytics/analytics.js +5 -0
- package/dist/esm/analytics/ufo.js +19 -0
- package/dist/esm/components/Counter/Counter.js +17 -17
- package/dist/esm/components/Reaction/Reaction.js +51 -19
- package/dist/esm/components/Reaction/styles.js +9 -2
- package/dist/esm/components/ReactionDialog/ReactionView.js +98 -0
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +161 -0
- package/dist/esm/components/ReactionDialog/ReactionsList.js +79 -0
- package/dist/esm/components/ReactionDialog/index.js +1 -0
- package/dist/esm/components/ReactionDialog/styles.js +177 -0
- package/dist/esm/components/ReactionPicker/ReactionPicker.js +15 -20
- package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +26 -12
- package/dist/esm/components/ReactionTooltip/styles.js +9 -1
- package/dist/esm/components/Reactions/Reactions.js +158 -22
- package/dist/esm/components/Reactions/styles.js +9 -5
- package/dist/esm/components/Trigger/Trigger.js +1 -2
- package/dist/esm/components/index.js +2 -1
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +6 -2
- package/dist/esm/containers/ConnectedReactionsView/ConnectedReactionsView.js +8 -4
- package/dist/esm/shared/constants.js +57 -6
- package/dist/esm/shared/i18n.js +40 -0
- package/dist/esm/shared/utils.js +53 -0
- package/dist/esm/types/reaction.js +13 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/MockReactionsClient.d.ts +7 -3
- package/dist/types/analytics/analytics.d.ts +10 -0
- package/dist/types/analytics/ufo.d.ts +18 -2
- package/dist/types/components/Counter/Counter.d.ts +0 -1
- package/dist/types/components/Reaction/Reaction.d.ts +11 -1
- package/dist/types/components/ReactionDialog/ReactionView.d.ts +19 -0
- package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +32 -0
- package/dist/types/components/ReactionDialog/ReactionsList.d.ts +23 -0
- package/dist/types/components/ReactionDialog/index.d.ts +1 -0
- package/dist/types/components/ReactionDialog/styles.d.ts +11 -0
- package/dist/types/components/ReactionPicker/ReactionPicker.d.ts +5 -0
- package/dist/types/components/ReactionTooltip/ReactionTooltip.d.ts +12 -0
- package/dist/types/components/ReactionTooltip/styles.d.ts +1 -0
- package/dist/types/components/Reactions/Reactions.d.ts +45 -6
- package/dist/types/components/Reactions/styles.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +0 -4
- package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +2 -11
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/constants.d.ts +11 -5
- package/dist/types/shared/i18n.d.ts +40 -0
- package/dist/types/shared/utils.d.ts +7 -0
- package/dist/types/types/User.d.ts +10 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/reaction.d.ts +15 -2
- package/docs/0-intro.tsx +3 -0
- package/docs/5-graphql-support.tsx +153 -0
- package/package.json +8 -6
|
@@ -7,7 +7,10 @@ export declare enum ExperienceName {
|
|
|
7
7
|
PICKER_OPENED = "reactions-picker-opened",
|
|
8
8
|
REACTION_ADDED = "reaction-added",
|
|
9
9
|
REACTION_REMOVED = "reaction-removed",
|
|
10
|
-
REACTION_DETAILS_FETCHED = "reaction-details-fetched"
|
|
10
|
+
REACTION_DETAILS_FETCHED = "reaction-details-fetched",
|
|
11
|
+
REACTION_DIALOG_OPENED = "reaction-dialog-opened",
|
|
12
|
+
REACTION_DIALOG_CLOSED = "reaction-dialog-closed",
|
|
13
|
+
REACTION_DIALOG_SELECTED_REACTION_CHANGED = "reaction-dialog-selected-reaction-changed"
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* UFO types of components been instrumented
|
|
@@ -15,7 +18,8 @@ export declare enum ExperienceName {
|
|
|
15
18
|
export declare enum ComponentName {
|
|
16
19
|
PICKER_RENDERED = "reactions-picker",
|
|
17
20
|
REACTIONS = "reactions-list",
|
|
18
|
-
REACTION_ITEM = "reaction-item"
|
|
21
|
+
REACTION_ITEM = "reaction-item",
|
|
22
|
+
REACTION_DIALOG = "reaction-dialog"
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Experience when the emoji picker is opened
|
|
@@ -29,6 +33,18 @@ export declare const ReactionsRendered: ConcurrentExperience;
|
|
|
29
33
|
* Experience when a reaction emoji gets added
|
|
30
34
|
*/
|
|
31
35
|
export declare const ReactionsAdd: ConcurrentExperience;
|
|
36
|
+
/**
|
|
37
|
+
* Expeirence when a reaction dialog is opened
|
|
38
|
+
*/
|
|
39
|
+
export declare const ReactionDialogOpened: UFOExperience;
|
|
40
|
+
/**
|
|
41
|
+
* Experience when a reaction dialog is closed
|
|
42
|
+
*/
|
|
43
|
+
export declare const ReactionDialogClosed: UFOExperience;
|
|
44
|
+
/**
|
|
45
|
+
* Experience when a reaction changed/fetched from inside the modal dialog
|
|
46
|
+
*/
|
|
47
|
+
export declare const ReactionDialogSelectedReactionChanged: UFOExperience;
|
|
32
48
|
/**
|
|
33
49
|
* Experience when a reaction details gets fetched
|
|
34
50
|
*/
|
|
@@ -38,7 +38,6 @@ export interface CounterProps {
|
|
|
38
38
|
*/
|
|
39
39
|
animationDuration?: number;
|
|
40
40
|
}
|
|
41
|
-
export declare const getLabel: (value: number, overLimitLabel?: string | undefined, limit?: number | undefined) => string;
|
|
42
41
|
/**
|
|
43
42
|
* Display reaction count next to the emoji button
|
|
44
43
|
*/
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { EmojiProvider } from '@atlaskit/emoji';
|
|
4
4
|
import { ReactionSummary, ReactionClick, ReactionMouseEnter } from '../../types';
|
|
5
|
+
import { ReactionTooltipProps } from '../ReactionTooltip';
|
|
6
|
+
import { ReactionFocused } from '../../types/reaction';
|
|
5
7
|
/**
|
|
6
8
|
* Test id for Reaction item wrapper div
|
|
7
9
|
*/
|
|
8
10
|
export declare const RENDER_REACTION_TESTID = "render_reaction_wrapper";
|
|
9
|
-
export interface ReactionProps {
|
|
11
|
+
export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDialog'> {
|
|
10
12
|
/**
|
|
11
13
|
* Data for the reaction
|
|
12
14
|
*/
|
|
@@ -27,10 +29,18 @@ export interface ReactionProps {
|
|
|
27
29
|
* Optional event when the mouse cursor hovers over the reaction
|
|
28
30
|
*/
|
|
29
31
|
onMouseEnter?: ReactionMouseEnter;
|
|
32
|
+
/**
|
|
33
|
+
* Optional event when focused the reaction
|
|
34
|
+
*/
|
|
35
|
+
onFocused?: ReactionFocused;
|
|
30
36
|
/**
|
|
31
37
|
* Show custom animation or render as standard without animation (defaults to false)
|
|
32
38
|
*/
|
|
33
39
|
flash?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Optional function when the user wants to see more users in a modal
|
|
42
|
+
*/
|
|
43
|
+
handleUserListClick?: (emojiId: string) => void;
|
|
34
44
|
}
|
|
35
45
|
/**
|
|
36
46
|
* Render an emoji reaction button
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
4
|
+
import { ReactionSummary } from '../../types';
|
|
5
|
+
export interface ReactionViewProps {
|
|
6
|
+
/**
|
|
7
|
+
* Selected reaction to get user data from
|
|
8
|
+
*/
|
|
9
|
+
reaction: ReactionSummary;
|
|
10
|
+
/**
|
|
11
|
+
* Current emoji selected in the reactions dialog
|
|
12
|
+
*/
|
|
13
|
+
selectedEmojiId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Provider for loading emojis
|
|
16
|
+
*/
|
|
17
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
18
|
+
}
|
|
19
|
+
export declare const ReactionView: FC<ReactionViewProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
4
|
+
import { OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { onDialogSelectReactionChange, ReactionSummary } from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* Test id for the Reactions modal dialog
|
|
8
|
+
*/
|
|
9
|
+
export declare const RENDER_MODAL_TESTID = "render-reactions-modal";
|
|
10
|
+
export interface ReactionsDialogProps {
|
|
11
|
+
/**
|
|
12
|
+
* List of reactions to render (defaults to empty list)
|
|
13
|
+
*/
|
|
14
|
+
reactions: ReactionSummary[];
|
|
15
|
+
/**
|
|
16
|
+
* Optional handler when the dialog closes
|
|
17
|
+
*/
|
|
18
|
+
handleCloseReactionsDialog: OnCloseHandler;
|
|
19
|
+
/**
|
|
20
|
+
* Provider for loading emojis
|
|
21
|
+
*/
|
|
22
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
23
|
+
/**
|
|
24
|
+
* Current emoji selected to show the reactions dialog
|
|
25
|
+
*/
|
|
26
|
+
selectedEmojiId: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional callback function called when user selects a reaction in reactions dialog
|
|
29
|
+
*/
|
|
30
|
+
handleSelectReaction?: onDialogSelectReactionChange;
|
|
31
|
+
}
|
|
32
|
+
export declare const ReactionsDialog: FC<ReactionsDialogProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
4
|
+
import { onDialogSelectReactionChange, ReactionSummary } from '../../types';
|
|
5
|
+
export interface ReactionsListProps {
|
|
6
|
+
/**
|
|
7
|
+
* Sorted list of reactions to render in list
|
|
8
|
+
*/
|
|
9
|
+
reactions: ReactionSummary[];
|
|
10
|
+
/**
|
|
11
|
+
* Current emoji selected in the reactions dialog
|
|
12
|
+
*/
|
|
13
|
+
initialEmojiId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Provider for loading emojis
|
|
16
|
+
*/
|
|
17
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
18
|
+
/**
|
|
19
|
+
* Function to handle clicking on an emoji from the list
|
|
20
|
+
*/
|
|
21
|
+
onReactionChanged: onDialogSelectReactionChange;
|
|
22
|
+
}
|
|
23
|
+
export declare const ReactionsList: FC<ReactionsListProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactionsDialog } from './ReactionsDialog';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ThemeIds } from '@atlaskit/tokens';
|
|
2
|
+
export declare const containerStyle: (reactionsBorderWidth: number) => import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const titleStyle: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const counterStyle: (isSelected: boolean) => import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const customTabWrapper: (isSelected: boolean, selectedEmojiId: string, theme: ThemeIds | null) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const navigationContainerStyle: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const reactionViewStyle: import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const userListStyle: import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const userStyle: import("@emotion/react").SerializedStyles;
|
|
10
|
+
export declare const customTabListStyles: import("@emotion/react").SerializedStyles;
|
|
11
|
+
export declare const centerSpinner: import("@emotion/react").SerializedStyles;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { PickerSize } from '@atlaskit/emoji/types';
|
|
3
4
|
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
4
5
|
import { SelectorProps } from '../Selector';
|
|
5
6
|
import { TriggerProps } from '../Trigger';
|
|
@@ -43,6 +44,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
43
44
|
* Optional event handler when the custom emoji picker icon is selected
|
|
44
45
|
*/
|
|
45
46
|
onShowMore?: () => void;
|
|
47
|
+
/**
|
|
48
|
+
* Optional emoji picker size to control the size of emoji picker
|
|
49
|
+
*/
|
|
50
|
+
emojiPickerSize?: PickerSize;
|
|
46
51
|
}
|
|
47
52
|
/**
|
|
48
53
|
* Picker component for adding reactions
|
|
@@ -18,5 +18,17 @@ export interface ReactionTooltipProps {
|
|
|
18
18
|
* Optional Max users to show in the displayed tooltip (defaults to 5)
|
|
19
19
|
*/
|
|
20
20
|
maxReactions?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Optional function when the user wants to see more users in a modal
|
|
23
|
+
*/
|
|
24
|
+
handleUserListClick?: (emojiId: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Optional flag to show reactions dialog (defaults to false)
|
|
27
|
+
*/
|
|
28
|
+
allowUserDialog?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Optional flag for enabling tooltip (defaults to true)
|
|
31
|
+
*/
|
|
32
|
+
isEnabled?: boolean;
|
|
21
33
|
}
|
|
22
34
|
export declare const ReactionTooltip: React.FC<ReactionTooltipProps>;
|
|
@@ -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;
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { onDialogSelectReactionChange, ReactionStatus, ReactionClick, ReactionSummary, QuickReactionEmojiSummary } from '../../types';
|
|
6
|
+
import { ReactionProps } from '../Reaction';
|
|
5
7
|
import { ReactionPickerProps } from '../ReactionPicker';
|
|
6
8
|
import { SelectorProps } from '../Selector';
|
|
9
|
+
/**
|
|
10
|
+
* Set of all available UFO experiences relating to reactions dialog
|
|
11
|
+
*/
|
|
12
|
+
export declare const ufoExperiences: {
|
|
13
|
+
/**
|
|
14
|
+
* Expeirence when a reaction dialog is opened
|
|
15
|
+
*/
|
|
16
|
+
openDialog: import("@atlaskit/ufo").UFOExperience;
|
|
17
|
+
/**
|
|
18
|
+
* Experience when a reaction dialog is closed
|
|
19
|
+
*/
|
|
20
|
+
closeDialog: import("@atlaskit/ufo").UFOExperience;
|
|
21
|
+
/**
|
|
22
|
+
* Experience when a reaction changed/fetched from inside the modal dialog
|
|
23
|
+
*/
|
|
24
|
+
selectedReactionChangeInsideDialog: import("@atlaskit/ufo").UFOExperience;
|
|
25
|
+
};
|
|
7
26
|
/**
|
|
8
27
|
* Test id for wrapper Reactions div
|
|
9
28
|
*/
|
|
10
29
|
export declare const RENDER_REACTIONS_TESTID = "render-reactions";
|
|
11
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Test id for the view all reacted user to trigger the dialog
|
|
32
|
+
*/
|
|
33
|
+
export declare const RENDER_VIEWALL_REACTED_USERS_DIALOG = "viewall-reacted-users-dialog";
|
|
34
|
+
export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize'>, Pick<SelectorProps, 'pickerQuickReactionEmojiIds'>, Pick<ReactionProps, 'allowUserDialog'> {
|
|
12
35
|
/**
|
|
13
36
|
* event handler to fetching the reactions
|
|
14
37
|
*/
|
|
@@ -22,7 +45,7 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
22
45
|
*/
|
|
23
46
|
reactions?: ReactionSummary[];
|
|
24
47
|
/**
|
|
25
|
-
* Condition for the reaction list status while
|
|
48
|
+
* Condition for the reaction list status while being fetched
|
|
26
49
|
*/
|
|
27
50
|
status: ReactionStatus;
|
|
28
51
|
/**
|
|
@@ -34,8 +57,12 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
34
57
|
*/
|
|
35
58
|
flash?: Record<string, boolean>;
|
|
36
59
|
/**
|
|
37
|
-
* Optional event
|
|
38
|
-
* @param emojiId
|
|
60
|
+
* Optional event to get reaction details for an emoji
|
|
61
|
+
* @param emojiId current reaction emoji id
|
|
62
|
+
*/
|
|
63
|
+
getReactionDetails?: (emojiId: string) => void;
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated use getReactionDetails instead
|
|
39
66
|
*/
|
|
40
67
|
onReactionHover?: (emojiId: string) => void;
|
|
41
68
|
/**
|
|
@@ -43,9 +70,21 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
43
70
|
*/
|
|
44
71
|
errorMessage?: string;
|
|
45
72
|
/**
|
|
46
|
-
*
|
|
73
|
+
* quickReactionEmojiIds are emojis that will be shown in the the primary view even if the reaction count is zero
|
|
47
74
|
*/
|
|
48
75
|
quickReactionEmojis?: QuickReactionEmojiSummary;
|
|
76
|
+
/**
|
|
77
|
+
* Optional callback function called when opening reactions dialog
|
|
78
|
+
*/
|
|
79
|
+
onDialogOpenCallback?: (emojiId: string, source?: string) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Optional callback function called when closing reactions dialog
|
|
82
|
+
*/
|
|
83
|
+
onDialogCloseCallback?: OnCloseHandler;
|
|
84
|
+
/**
|
|
85
|
+
* Optional callback function called when selecting a reaction in reactions dialog
|
|
86
|
+
*/
|
|
87
|
+
onDialogSelectReactionCallback?: onDialogSelectReactionChange;
|
|
49
88
|
}
|
|
50
89
|
/**
|
|
51
90
|
* Get content of the tooltip
|
|
@@ -6,3 +6,4 @@ export { Reactions } from './Reactions';
|
|
|
6
6
|
export type { ReactionsProps } from './Reactions';
|
|
7
7
|
export { UfoErrorBoundary } from './UfoErrorBoundary';
|
|
8
8
|
export type { UfoErrorBoundaryProps } from './UfoErrorBoundary';
|
|
9
|
+
export { ReactionsDialog } from './ReactionDialog/ReactionsDialog';
|
|
@@ -2,10 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { ReactionPickerProps } from '../../components';
|
|
3
3
|
import { StorePropInput } from '../../types';
|
|
4
4
|
export interface ConnectedReactionPickerProps extends Omit<ReactionPickerProps, 'onSelection'> {
|
|
5
|
-
/**
|
|
6
|
-
* Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)
|
|
7
|
-
*/
|
|
8
|
-
allowAllEmojis?: boolean;
|
|
9
5
|
/**
|
|
10
6
|
* Wrapper id for reactions list
|
|
11
7
|
*/
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
2
|
import { ReactionsProps, ReactionPickerProps } from '../../components';
|
|
4
3
|
import { ReactionStatus, Actions, State, StorePropInput } from '../../types';
|
|
5
|
-
export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
|
|
6
|
-
/**
|
|
7
|
-
* Provider for loading emojis
|
|
8
|
-
*/
|
|
9
|
-
emojiProvider: Promise<EmojiProvider>;
|
|
10
|
-
/**
|
|
11
|
-
* Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)
|
|
12
|
-
*/
|
|
13
|
-
allowAllEmojis?: boolean;
|
|
4
|
+
export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
|
|
14
5
|
/**
|
|
15
6
|
* Wrapper id for reactions list
|
|
16
7
|
*/
|
|
@@ -46,7 +37,7 @@ export declare const mapStateToPropsHelper: (containerAri: string, ari: string,
|
|
|
46
37
|
export declare const mapDispatchToPropsHelper: (actions: Actions, containerAri: string, ari: string) => {
|
|
47
38
|
loadReaction: () => void;
|
|
48
39
|
onReactionClick: (emojiId: string) => void;
|
|
49
|
-
|
|
40
|
+
getReactionDetails: (emojiId: string) => void;
|
|
50
41
|
onSelection: (emojiId: string) => void;
|
|
51
42
|
};
|
|
52
43
|
export declare const ConnectedReactionsView: React.FC<ConnectedReactionsViewProps>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { UFO } from './analytics';
|
|
2
2
|
export { ReactionServiceClient } from './client';
|
|
3
|
-
export type { Client as ReactionClient, Request as ReactionRequest, Store as ReactionsStore, StorePropInput, State, } from './types';
|
|
3
|
+
export type { Client as ReactionClient, Request as ReactionRequest, Store as ReactionsStore, StorePropInput, State, onDialogSelectReactionChange, } from './types';
|
|
4
4
|
export { constants } from './shared';
|
|
5
5
|
export { Reaction, ReactionPicker, Reactions } from './components';
|
|
6
6
|
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|
|
@@ -4,18 +4,24 @@ import { EmojiId } from '@atlaskit/emoji/types';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const DefaultReactions: EmojiId[];
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Extended list of reactions used only for examples
|
|
8
8
|
*/
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const ExtendedReactions: EmojiId[];
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* ES6 Map object from default emoji reactions (with key => shortName, value => entire emoji item)
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const DefaultReactionsByShortName: Map<string, EmojiId>;
|
|
14
14
|
/**
|
|
15
15
|
* ES6 Map object from default emoji reactions (with key => shortName, value => entire emoji item)
|
|
16
|
+
* Only for use in extended reaction examples
|
|
16
17
|
*/
|
|
17
|
-
export declare const
|
|
18
|
+
export declare const ExtendedReactionsByShortName: Map<string, EmojiId>;
|
|
18
19
|
/**
|
|
19
20
|
* Maximum number of users to show in the tooltip for an emoji reaction
|
|
20
21
|
*/
|
|
21
22
|
export declare const TOOLTIP_USERS_LIMIT = 5;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum number of reactions that will fit in the horizontal scroll of
|
|
25
|
+
* reactions dialog
|
|
26
|
+
*/
|
|
27
|
+
export declare const NUMBER_OF_REACTIONS_TO_DISPLAY = 9;
|
|
@@ -14,6 +14,11 @@ export declare const messages: {
|
|
|
14
14
|
defaultMessage: string;
|
|
15
15
|
description: string;
|
|
16
16
|
};
|
|
17
|
+
moreInfo: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
17
22
|
reactWithEmoji: {
|
|
18
23
|
id: string;
|
|
19
24
|
defaultMessage: string;
|
|
@@ -29,4 +34,39 @@ export declare const messages: {
|
|
|
29
34
|
defaultMessage: string;
|
|
30
35
|
description: string;
|
|
31
36
|
};
|
|
37
|
+
closeReactionsDialog: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
reactionsCount: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
leftNavigateLabel: {
|
|
48
|
+
id: string;
|
|
49
|
+
defaultMessage: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
rightNavigateLabel: {
|
|
53
|
+
id: string;
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
emojiName: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
seeWhoReacted: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
seeWhoReactedTooltip: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
32
72
|
};
|
|
@@ -9,3 +9,10 @@ export declare const isLeftClick: (event: React.MouseEvent<HTMLElement>) => bool
|
|
|
9
9
|
* @param item selected emoji item
|
|
10
10
|
*/
|
|
11
11
|
export declare const isDefaultReaction: (item: EmojiId) => boolean;
|
|
12
|
+
export declare const formatStringWithDecimal: (value: string, decimalPlaces: number) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Truncates numbers >= 1000 to shorthand representations with a maximum of one decimal point.
|
|
15
|
+
* If the first decimal number is a zero then it's also truncated.
|
|
16
|
+
* (Ex: 9085 will return 9K, 787555 will return 787.5M)
|
|
17
|
+
*/
|
|
18
|
+
export declare const formatLargeNumber: (value: number) => string;
|
|
@@ -7,4 +7,14 @@ export interface User {
|
|
|
7
7
|
* name of user clicked on the reaction
|
|
8
8
|
*/
|
|
9
9
|
displayName: string;
|
|
10
|
+
/**
|
|
11
|
+
* optional path to a user profile picture
|
|
12
|
+
*/
|
|
13
|
+
profilePicture?: ProfilePicture;
|
|
10
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Type defining the path to a user profile picture
|
|
17
|
+
*/
|
|
18
|
+
export declare type ProfilePicture = {
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ReactionAction, Actions } from './Actions';
|
|
2
2
|
export { ReactionStatus } from './reaction';
|
|
3
|
-
export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, QuickReactionEmojiSummary, ReactionsNotLoaded, Reactions, ReactionClick, ReactionMouseEnter, } from './reaction';
|
|
3
|
+
export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, QuickReactionEmojiSummary, ReactionsNotLoaded, Reactions, ReactionClick, ReactionMouseEnter, onDialogSelectReactionChange, } from './reaction';
|
|
4
4
|
export type { Client, Request } from './client';
|
|
5
5
|
export type { Updater } from './Updater';
|
|
6
6
|
export type { User } from './User';
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
3
|
import { User } from './User';
|
|
3
4
|
/**
|
|
4
5
|
* Collection of reactions as object (key is unique id from containerAri and ari combined)
|
|
5
6
|
*/
|
|
6
7
|
export declare type Reactions = Record<string, ReactionSummary[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Event handler when reactions dialog selected emoji is clicked
|
|
10
|
+
* @param emojiId selected emoji
|
|
11
|
+
* @param analyticsEvent Optional analytics event emitted from @atlaskit/tabs component
|
|
12
|
+
*/
|
|
13
|
+
export declare type onDialogSelectReactionChange = (emojiId: string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
7
14
|
/**
|
|
8
15
|
* MetaData for Reaction object
|
|
9
16
|
*/
|
|
@@ -62,10 +69,16 @@ export interface QuickReactionEmojiSummary {
|
|
|
62
69
|
export declare type ReactionClick = (id: string, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
63
70
|
/**
|
|
64
71
|
* Event handler for when the user hovers with the mouse on the reaction
|
|
65
|
-
* @param
|
|
72
|
+
* @param emojiId id of emoji
|
|
73
|
+
* @param event (Optional) custom DOM event handler callback
|
|
74
|
+
*/
|
|
75
|
+
export declare type ReactionMouseEnter = (emojiId: string, event?: React.MouseEvent<any>) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Event handler for when the user focused on the reaction
|
|
78
|
+
* @param emojiId id of emoji
|
|
66
79
|
* @param event (Optional) custom DOM event handler callback
|
|
67
80
|
*/
|
|
68
|
-
export declare type
|
|
81
|
+
export declare type ReactionFocused = (emojiId: string, event?: React.FocusEvent<any>) => void;
|
|
69
82
|
/**
|
|
70
83
|
* Condition of the reaction when gets loaded from the store
|
|
71
84
|
*/
|
package/docs/0-intro.tsx
CHANGED
|
@@ -25,6 +25,9 @@ export default md`
|
|
|
25
25
|
1. [ReactionServiceClient](/packages/elements/reactions/docs/reaction-service-client)
|
|
26
26
|
1. [EmojiResource](https://atlaskit.atlassian.com/packages/elements/emoji/docs/resourced-emoji)
|
|
27
27
|
|
|
28
|
+
The guide to supporting GraphQL can be found here:
|
|
29
|
+
* [Graphql Support](/packages/elements/reactions/docs/graphql-support)
|
|
30
|
+
|
|
28
31
|
## Usage
|
|
29
32
|
|
|
30
33
|
For each of these components, first import the following in your React app as follows:
|