@atlaskit/reactions 22.3.1 → 22.3.3
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 +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/MockReactionsClient.d.ts +27 -0
- package/dist/types-ts4.5/analytics/analytics.d.ts +121 -0
- package/dist/types-ts4.5/analytics/index.d.ts +2 -0
- package/dist/types-ts4.5/analytics/ufo.d.ts +56 -0
- package/dist/types-ts4.5/client/ReactionServiceClient.d.ts +35 -0
- package/dist/types-ts4.5/client/index.d.ts +1 -0
- package/dist/types-ts4.5/components/Counter/Counter.d.ts +44 -0
- package/dist/types-ts4.5/components/Counter/index.d.ts +3 -0
- package/dist/types-ts4.5/components/Counter/styles.d.ts +4 -0
- package/dist/types-ts4.5/components/EmojiButton/EmojiButton.d.ts +22 -0
- package/dist/types-ts4.5/components/EmojiButton/index.d.ts +2 -0
- package/dist/types-ts4.5/components/EmojiButton/styles.d.ts +1 -0
- package/dist/types-ts4.5/components/FlashAnimation/FlashAnimation.d.ts +20 -0
- package/dist/types-ts4.5/components/FlashAnimation/index.d.ts +2 -0
- package/dist/types-ts4.5/components/FlashAnimation/styles.d.ts +5 -0
- package/dist/types-ts4.5/components/Reaction/Reaction.d.ts +48 -0
- package/dist/types-ts4.5/components/Reaction/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Reaction/styles.d.ts +10 -0
- package/dist/types-ts4.5/components/ReactionDialog/ReactionView.d.ts +19 -0
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +32 -0
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsList.d.ts +23 -0
- package/dist/types-ts4.5/components/ReactionDialog/index.d.ts +1 -0
- package/dist/types-ts4.5/components/ReactionDialog/styles.d.ts +11 -0
- package/dist/types-ts4.5/components/ReactionPicker/ReactionPicker.d.ts +59 -0
- package/dist/types-ts4.5/components/ReactionPicker/RepositionOnUpdate.d.ts +13 -0
- package/dist/types-ts4.5/components/ReactionPicker/index.d.ts +2 -0
- package/dist/types-ts4.5/components/ReactionPicker/styles.d.ts +4 -0
- package/dist/types-ts4.5/components/ReactionTooltip/ReactionTooltip.d.ts +34 -0
- package/dist/types-ts4.5/components/ReactionTooltip/index.d.ts +2 -0
- package/dist/types-ts4.5/components/ReactionTooltip/styles.d.ts +5 -0
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +96 -0
- package/dist/types-ts4.5/components/Reactions/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Reactions/styles.d.ts +3 -0
- package/dist/types-ts4.5/components/Selector/Selector.d.ts +34 -0
- package/dist/types-ts4.5/components/Selector/index.d.ts +3 -0
- package/dist/types-ts4.5/components/Selector/styles.d.ts +12 -0
- package/dist/types-ts4.5/components/ShowMore/ShowMore.d.ts +35 -0
- package/dist/types-ts4.5/components/ShowMore/index.d.ts +2 -0
- package/dist/types-ts4.5/components/ShowMore/styles.d.ts +3 -0
- package/dist/types-ts4.5/components/Trigger/Trigger.d.ts +36 -0
- package/dist/types-ts4.5/components/Trigger/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Trigger/styles.d.ts +5 -0
- package/dist/types-ts4.5/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +16 -0
- package/dist/types-ts4.5/components/UfoErrorBoundary/index.d.ts +2 -0
- package/dist/types-ts4.5/components/index.d.ts +9 -0
- package/dist/types-ts4.5/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +23 -0
- package/dist/types-ts4.5/containers/ConnectedReactionPicker/index.d.ts +2 -0
- package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +43 -0
- package/dist/types-ts4.5/containers/ConnectedReactionsView/index.d.ts +2 -0
- package/dist/types-ts4.5/containers/index.d.ts +2 -0
- package/dist/types-ts4.5/hooks/index.d.ts +1 -0
- package/dist/types-ts4.5/hooks/useCloseManager.d.ts +11 -0
- package/dist/types-ts4.5/hooks/useFocusTrap.d.ts +5 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +23 -0
- package/dist/types-ts4.5/i18n/da.d.ts +23 -0
- package/dist/types-ts4.5/i18n/de.d.ts +22 -0
- package/dist/types-ts4.5/i18n/en.d.ts +23 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +23 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +23 -0
- package/dist/types-ts4.5/i18n/es.d.ts +23 -0
- package/dist/types-ts4.5/i18n/et.d.ts +11 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +22 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +23 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +23 -0
- package/dist/types-ts4.5/i18n/index.d.ts +35 -0
- package/dist/types-ts4.5/i18n/is.d.ts +6 -0
- package/dist/types-ts4.5/i18n/it.d.ts +23 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +23 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +22 -0
- package/dist/types-ts4.5/i18n/languages.d.ts +27 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +22 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +23 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +23 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +23 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +11 -0
- package/dist/types-ts4.5/i18n/ro.d.ts +6 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +22 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +11 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +23 -0
- package/dist/types-ts4.5/i18n/th.d.ts +23 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +23 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +23 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +23 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +23 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +22 -0
- package/dist/types-ts4.5/index.d.ts +7 -0
- package/dist/types-ts4.5/shared/constants.d.ts +28 -0
- package/dist/types-ts4.5/shared/i18n.d.ts +72 -0
- package/dist/types-ts4.5/shared/index.d.ts +3 -0
- package/dist/types-ts4.5/shared/utils.d.ts +18 -0
- package/dist/types-ts4.5/store/MemoryReactionsStore.d.ts +94 -0
- package/dist/types-ts4.5/store/ReactionConsumer.d.ts +57 -0
- package/dist/types-ts4.5/store/batched.d.ts +2 -0
- package/dist/types-ts4.5/store/index.d.ts +3 -0
- package/dist/types-ts4.5/store/utils.d.ts +11 -0
- package/dist/types-ts4.5/types/Actions.d.ts +27 -0
- package/dist/types-ts4.5/types/Updater.d.ts +1 -0
- package/dist/types-ts4.5/types/User.d.ts +20 -0
- package/dist/types-ts4.5/types/client.d.ts +38 -0
- package/dist/types-ts4.5/types/index.d.ts +7 -0
- package/dist/types-ts4.5/types/reaction.d.ts +113 -0
- package/dist/types-ts4.5/types/store.d.ts +63 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 22.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`82f7f9600a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/82f7f9600a9) - Migrated to declarative entry points internally for emoji and reactions. Public API is unchanged.
|
|
8
|
+
|
|
9
|
+
## 22.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 22.3.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Reactions, Client, ReactionSummary } from './types';
|
|
2
|
+
export declare const containerAri = "ari:cloud:owner:demo-cloud-id:container/1";
|
|
3
|
+
export declare const ari = "ari:cloud:owner:demo-cloud-id:item/1";
|
|
4
|
+
export declare const getReactionSummary: (shortName: string, count: number, reacted: boolean, extendedReactions?: boolean) => ReactionSummary;
|
|
5
|
+
export declare const getUser: (id: string, displayName: string) => {
|
|
6
|
+
id: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
profilePicture: {
|
|
9
|
+
path: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const simpleMockData: {
|
|
13
|
+
[key: string]: ReactionSummary[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Mocked version of the client to fetch user information
|
|
17
|
+
*/
|
|
18
|
+
export declare class MockReactionsClient implements Client {
|
|
19
|
+
private delay;
|
|
20
|
+
private mockData;
|
|
21
|
+
constructor(delay?: number, showExtendedReactions?: boolean);
|
|
22
|
+
private delayPromise;
|
|
23
|
+
getReactions(containerAri: string, aris: string[]): Promise<Reactions>;
|
|
24
|
+
getDetailedReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary>;
|
|
25
|
+
addReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary[]>;
|
|
26
|
+
deleteReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary[]>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { AnalyticsEventPayload, CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { EventType } from '@atlaskit/analytics-gas-types';
|
|
3
|
+
import { ReactionSummary, ReactionSource } from '../types';
|
|
4
|
+
export type PreviousState = 'new' | 'existingNotReacted' | 'existingReacted';
|
|
5
|
+
/**
|
|
6
|
+
* TODO: move to utility package?
|
|
7
|
+
* A random sampling function
|
|
8
|
+
* sampling algorithm is from @atlassian/jira-coinflip at https://stash.atlassian.com/projects/JIRACLOUD/repos/jira-frontend/browse/src/packages/platform/app-framework/coinflip/src/index.tsx
|
|
9
|
+
* E.g. isSampled(2) will pass 50% of the time
|
|
10
|
+
* @param rate The chance that it will pass (1 in <rate> times)
|
|
11
|
+
* @returns bool, if it passes or not
|
|
12
|
+
*/
|
|
13
|
+
export declare const isSampled: (rate: number) => boolean;
|
|
14
|
+
export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
15
|
+
export declare const createAndFireSafe: <U extends any[], T extends (...args: U) => AnalyticsEventPayload>(createAnalyticsEvent: CreateUIAnalyticsEvent | void, creator: T, ...args: U) => void;
|
|
16
|
+
export declare const createRestSucceededEvent: (actionSubject: string) => {
|
|
17
|
+
action: string;
|
|
18
|
+
actionSubject: string;
|
|
19
|
+
eventType: EventType;
|
|
20
|
+
actionSubjectId: string | undefined;
|
|
21
|
+
attributes: {
|
|
22
|
+
packageName: any;
|
|
23
|
+
packageVersion: any;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const createRestFailedEvent: (actionSubject: string, errorCode?: number) => {
|
|
27
|
+
action: string;
|
|
28
|
+
actionSubject: string;
|
|
29
|
+
eventType: EventType;
|
|
30
|
+
actionSubjectId: string | undefined;
|
|
31
|
+
attributes: {
|
|
32
|
+
packageName: any;
|
|
33
|
+
packageVersion: any;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const createReactionsRenderedEvent: (startTime: number) => {
|
|
37
|
+
action: string;
|
|
38
|
+
actionSubject: string;
|
|
39
|
+
eventType: EventType;
|
|
40
|
+
actionSubjectId: string | undefined;
|
|
41
|
+
attributes: {
|
|
42
|
+
packageName: any;
|
|
43
|
+
packageVersion: any;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const createPickerButtonClickedEvent: (reactionEmojiCount: number) => {
|
|
47
|
+
action: string;
|
|
48
|
+
actionSubject: string;
|
|
49
|
+
eventType: EventType;
|
|
50
|
+
actionSubjectId: string | undefined;
|
|
51
|
+
attributes: {
|
|
52
|
+
packageName: any;
|
|
53
|
+
packageVersion: any;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare const createPickerCancelledEvent: (startTime?: number) => {
|
|
57
|
+
action: string;
|
|
58
|
+
actionSubject: string;
|
|
59
|
+
eventType: EventType;
|
|
60
|
+
actionSubjectId: string | undefined;
|
|
61
|
+
attributes: {
|
|
62
|
+
packageName: any;
|
|
63
|
+
packageVersion: any;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const createPickerMoreClickedEvent: (startTime?: number) => {
|
|
67
|
+
action: string;
|
|
68
|
+
actionSubject: string;
|
|
69
|
+
eventType: EventType;
|
|
70
|
+
actionSubjectId: string | undefined;
|
|
71
|
+
attributes: {
|
|
72
|
+
packageName: any;
|
|
73
|
+
packageVersion: any;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const createReactionSelectionEvent: (source: ReactionSource, emojiId: string, reaction?: ReactionSummary, startTime?: number) => {
|
|
77
|
+
action: string;
|
|
78
|
+
actionSubject: string;
|
|
79
|
+
eventType: EventType;
|
|
80
|
+
actionSubjectId: string | undefined;
|
|
81
|
+
attributes: {
|
|
82
|
+
packageName: any;
|
|
83
|
+
packageVersion: any;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export declare const createReactionHoveredEvent: (startTime?: number) => {
|
|
87
|
+
action: string;
|
|
88
|
+
actionSubject: string;
|
|
89
|
+
eventType: EventType;
|
|
90
|
+
actionSubjectId: string | undefined;
|
|
91
|
+
attributes: {
|
|
92
|
+
packageName: any;
|
|
93
|
+
packageVersion: any;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export declare const createReactionFocusedEvent: (startTime?: number) => {
|
|
97
|
+
action: string;
|
|
98
|
+
actionSubject: string;
|
|
99
|
+
eventType: EventType;
|
|
100
|
+
actionSubjectId: string | undefined;
|
|
101
|
+
attributes: {
|
|
102
|
+
packageName: any;
|
|
103
|
+
packageVersion: any;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export declare const createReactionClickedEvent: (added: boolean, emojiId: string) => {
|
|
107
|
+
action: string;
|
|
108
|
+
actionSubject: string;
|
|
109
|
+
eventType: EventType;
|
|
110
|
+
actionSubjectId: string | undefined;
|
|
111
|
+
attributes: {
|
|
112
|
+
packageName: any;
|
|
113
|
+
packageVersion: any;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Used for store failure metadata for analytics
|
|
118
|
+
* @param error The error could be a service error with {code, reason} or an Error
|
|
119
|
+
* @returns any
|
|
120
|
+
*/
|
|
121
|
+
export declare const extractErrorInfo: (error: any) => any;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ConcurrentExperience, UFOExperience } from '@atlaskit/ufo';
|
|
2
|
+
/**
|
|
3
|
+
* Types of experiences
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ExperienceName {
|
|
6
|
+
REACTIONS_RENDERED = "reactions-rendered",
|
|
7
|
+
PICKER_OPENED = "reactions-picker-opened",
|
|
8
|
+
REACTION_ADDED = "reaction-added",
|
|
9
|
+
REACTION_REMOVED = "reaction-removed",
|
|
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"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* UFO types of components been instrumented
|
|
17
|
+
*/
|
|
18
|
+
export declare enum ComponentName {
|
|
19
|
+
PICKER_RENDERED = "reactions-picker",
|
|
20
|
+
REACTIONS = "reactions-list",
|
|
21
|
+
REACTION_ITEM = "reaction-item",
|
|
22
|
+
REACTION_DIALOG = "reaction-dialog"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Experience when the emoji picker is opened
|
|
26
|
+
*/
|
|
27
|
+
export declare const PickerRender: UFOExperience;
|
|
28
|
+
/**
|
|
29
|
+
* Experience when the list of reactions gets rendered
|
|
30
|
+
*/
|
|
31
|
+
export declare const ReactionsRendered: ConcurrentExperience;
|
|
32
|
+
/**
|
|
33
|
+
* Experience when a reaction emoji gets added
|
|
34
|
+
*/
|
|
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;
|
|
48
|
+
/**
|
|
49
|
+
* Experience when a reaction details gets fetched
|
|
50
|
+
*/
|
|
51
|
+
export declare const ReactionDetailsFetch: ConcurrentExperience;
|
|
52
|
+
/**
|
|
53
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
54
|
+
*/
|
|
55
|
+
export declare const ReactionsRemove: ConcurrentExperience;
|
|
56
|
+
export declare const sampledReactionsRendered: (instanceId: string) => import("@atlaskit/emoji").WithSamplingUFOExperience;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Reactions, ReactionSummary, Client } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Utility class to retrieve/modify all actions on reactions collection
|
|
4
|
+
*/
|
|
5
|
+
export declare class ReactionServiceClient implements Client {
|
|
6
|
+
/**
|
|
7
|
+
* oAuth token
|
|
8
|
+
*/
|
|
9
|
+
private sessionToken?;
|
|
10
|
+
/**
|
|
11
|
+
* API config
|
|
12
|
+
*/
|
|
13
|
+
private serviceConfig;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param baseUrl base domain url
|
|
17
|
+
* @param sessionToken oAuth token for reactions emoji services
|
|
18
|
+
*/
|
|
19
|
+
constructor(baseUrl: string, sessionToken?: string);
|
|
20
|
+
/**
|
|
21
|
+
* Get http headers for the "fetch" request
|
|
22
|
+
* @param hasBody
|
|
23
|
+
*/
|
|
24
|
+
private getHeaders;
|
|
25
|
+
/**
|
|
26
|
+
* Send a request to remote service
|
|
27
|
+
* @param path endpoint api url
|
|
28
|
+
* @param options Optional custom params
|
|
29
|
+
*/
|
|
30
|
+
private requestService;
|
|
31
|
+
getReactions(containerAri: string, aris: string[]): Promise<Reactions>;
|
|
32
|
+
getDetailedReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary>;
|
|
33
|
+
addReaction(containerAri: string, ari: string, emojiId: string, metadata?: Record<string, any>): Promise<ReactionSummary[]>;
|
|
34
|
+
deleteReaction(containerAri: string, ari: string, emojiId: string, metadata?: Record<string, any>): Promise<ReactionSummary[]>;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactionServiceClient } from './ReactionServiceClient';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Test id for component top level div
|
|
5
|
+
*/
|
|
6
|
+
export declare const RENDER_COMPONENT_WRAPPER = "counter-wrapper";
|
|
7
|
+
/**
|
|
8
|
+
* Test id for wrapper div of the counter inside the slider
|
|
9
|
+
*/
|
|
10
|
+
export declare const RENDER_COUNTER_TESTID = "counter-container";
|
|
11
|
+
/**
|
|
12
|
+
* Counter label value wrapper div
|
|
13
|
+
*/
|
|
14
|
+
export declare const RENDER_LABEL_TESTID = "counter_label_wrapper";
|
|
15
|
+
export interface CounterProps {
|
|
16
|
+
/**
|
|
17
|
+
* Count of emoji been selected
|
|
18
|
+
*/
|
|
19
|
+
value: number;
|
|
20
|
+
/**
|
|
21
|
+
* Has the emoji been selected by given user (defaults to false)
|
|
22
|
+
*/
|
|
23
|
+
highlight?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Max threshold of selections to show before having a label (defaults to 1000)
|
|
26
|
+
*/
|
|
27
|
+
limit?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Label to show when the value surpasses the limit value (defaults to "1k+")
|
|
30
|
+
*/
|
|
31
|
+
overLimitLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional wrapper class name
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Duration in ms of how long the motion will take (defaults to "mediumDurationMs" from '@atlaskit/motion')
|
|
38
|
+
*/
|
|
39
|
+
animationDuration?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Display reaction count next to the emoji button
|
|
43
|
+
*/
|
|
44
|
+
export declare const Counter: React.FC<CounterProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const countStyle: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const containerStyle: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const highlightStyle: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const counterLabelStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { EmojiId, OnEmojiEvent, EmojiProvider } from '@atlaskit/emoji';
|
|
4
|
+
export declare const RENDER_BUTTON_TESTID = "button-emoji-id";
|
|
5
|
+
export interface EmojiButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* identifier info for a given emoji
|
|
8
|
+
*/
|
|
9
|
+
emojiId: EmojiId;
|
|
10
|
+
/**
|
|
11
|
+
* Async provider to fetch the emoji
|
|
12
|
+
*/
|
|
13
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
14
|
+
/**
|
|
15
|
+
* Event handler when a new emoji is selected
|
|
16
|
+
*/
|
|
17
|
+
onClick: OnEmojiEvent;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* custom button to render the custom emoji selector inside the reaction picker
|
|
21
|
+
*/
|
|
22
|
+
export declare const EmojiButton: React.FC<EmojiButtonProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const emojiButtonStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface FlashAnimationProps {
|
|
4
|
+
/**
|
|
5
|
+
* Optional wrapper div class anme
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Show custom animation or render as standard without animation (defaults to false)
|
|
10
|
+
*/
|
|
11
|
+
flash?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Test id for wrapper FlashAnimation div
|
|
15
|
+
*/
|
|
16
|
+
export declare const RENDER_FLASHANIMATION_TESTID = "flash-animation";
|
|
17
|
+
/**
|
|
18
|
+
* Flash animation background component. See Reaction component for usage.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FlashAnimation: React.FC<FlashAnimationProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { keyframes } from '@emotion/react';
|
|
3
|
+
export declare const flashAnimation: typeof keyframes;
|
|
4
|
+
export declare const containerStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const flashStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { EmojiProvider } from '@atlaskit/emoji';
|
|
4
|
+
import { ReactionSummary, ReactionClick, ReactionMouseEnter } from '../../types';
|
|
5
|
+
import { ReactionTooltipProps } from '../ReactionTooltip';
|
|
6
|
+
import { ReactionFocused } from '../../types/reaction';
|
|
7
|
+
/**
|
|
8
|
+
* Test id for Reaction item wrapper div
|
|
9
|
+
*/
|
|
10
|
+
export declare const RENDER_REACTION_TESTID = "render_reaction_wrapper";
|
|
11
|
+
export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDialog'> {
|
|
12
|
+
/**
|
|
13
|
+
* Data for the reaction
|
|
14
|
+
*/
|
|
15
|
+
reaction: ReactionSummary;
|
|
16
|
+
/**
|
|
17
|
+
* Provider for loading emojis
|
|
18
|
+
*/
|
|
19
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
20
|
+
/**
|
|
21
|
+
* event handler when the emoji button is clicked
|
|
22
|
+
*/
|
|
23
|
+
onClick: ReactionClick;
|
|
24
|
+
/**
|
|
25
|
+
* Optional wrapper reaction <button /> class name
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional event when the mouse cursor hovers over the reaction
|
|
30
|
+
*/
|
|
31
|
+
onMouseEnter?: ReactionMouseEnter;
|
|
32
|
+
/**
|
|
33
|
+
* Optional event when focused the reaction
|
|
34
|
+
*/
|
|
35
|
+
onFocused?: ReactionFocused;
|
|
36
|
+
/**
|
|
37
|
+
* Show custom animation or render as standard without animation (defaults to false)
|
|
38
|
+
*/
|
|
39
|
+
flash?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Optional function when the user wants to see more users in a modal
|
|
42
|
+
*/
|
|
43
|
+
handleUserListClick?: (emojiId: string) => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render an emoji reaction button
|
|
47
|
+
*/
|
|
48
|
+
export declare const Reaction: React.FC<ReactionProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styling Note:
|
|
3
|
+
* Padding and line height are set within the child components
|
|
4
|
+
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
5
|
+
*/
|
|
6
|
+
export declare const emojiStyle: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const reactionStyle: import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const reactedStyle: import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const flashHeight: number;
|
|
10
|
+
export declare const flashStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -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 { ThemeColorModes } 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?: ThemeColorModes) => 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;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PickerSize } from '@atlaskit/emoji/types';
|
|
4
|
+
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
5
|
+
import { SelectorProps } from '../Selector';
|
|
6
|
+
import { TriggerProps } from '../Trigger';
|
|
7
|
+
import { ReactionSource } from '../../types';
|
|
8
|
+
/**
|
|
9
|
+
* Test id for wrapper ReactionPicker div
|
|
10
|
+
*/
|
|
11
|
+
export declare const RENDER_REACTIONPICKER_TESTID = "reactionPicker-testid";
|
|
12
|
+
/**
|
|
13
|
+
* Test id for ReactionPicker panel div
|
|
14
|
+
*/
|
|
15
|
+
export declare const RENDER_REACTIONPICKERPANEL_TESTID = "reactionPickerPanel-testid";
|
|
16
|
+
export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickReactionEmojiIds'>, Partial<Pick<TriggerProps, 'tooltipContent' | 'miniMode'>> {
|
|
17
|
+
/**
|
|
18
|
+
* Provider for loading emojis
|
|
19
|
+
*/
|
|
20
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
21
|
+
/**
|
|
22
|
+
* Event callback when an emoji button is selected
|
|
23
|
+
* @param emojiId emoji unique id
|
|
24
|
+
* @param source source where the reaction was picked (either the initial default reactions or the custom reactions picker)
|
|
25
|
+
*/
|
|
26
|
+
onSelection: (emojiId: string, source: ReactionSource) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Optional class name
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)
|
|
33
|
+
*/
|
|
34
|
+
allowAllEmojis?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Enable/Disable the button to be clickable (defaults to false)
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Optional event handler when the emoji picker is opened
|
|
41
|
+
*/
|
|
42
|
+
onOpen?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Optional event handler when the emoji picker is clicked outside and closed
|
|
45
|
+
*/
|
|
46
|
+
onCancel?: () => void;
|
|
47
|
+
/**
|
|
48
|
+
* Optional event handler when the custom emoji picker icon is selected
|
|
49
|
+
*/
|
|
50
|
+
onShowMore?: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Optional emoji picker size to control the size of emoji picker
|
|
53
|
+
*/
|
|
54
|
+
emojiPickerSize?: PickerSize;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Picker component for adding reactions
|
|
58
|
+
*/
|
|
59
|
+
export declare const ReactionPicker: React.FC<ReactionPickerProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied from ADS popup component with some tweeks for our use
|
|
3
|
+
*/
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
import { PopperChildrenProps } from '@atlaskit/popper';
|
|
6
|
+
export type RepositionOnUpdateProps = {
|
|
7
|
+
update: PopperChildrenProps['update'];
|
|
8
|
+
settings: {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
showFullPicker: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const RepositionOnUpdate: FC<RepositionOnUpdateProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const pickerStyle: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const contentStyle: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const popupWrapperStyle: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const popupStyle: import("@emotion/react").SerializedStyles;
|