@atlaskit/reactions 21.6.0 → 21.6.2
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/MockReactionsClient/package.json +8 -1
- 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.0/MockReactionsClient.d.ts +20 -0
- package/dist/types-ts4.0/analytics/analytics.d.ts +96 -0
- package/dist/types-ts4.0/analytics/constants.d.ts +1 -0
- package/dist/types-ts4.0/analytics/index.d.ts +2 -0
- package/dist/types-ts4.0/analytics/ufo.d.ts +40 -0
- package/dist/types-ts4.0/client/ReactionServiceClient.d.ts +35 -0
- package/dist/types-ts4.0/client/index.d.ts +1 -0
- package/dist/types-ts4.0/components/Counter/Counter.d.ts +40 -0
- package/dist/types-ts4.0/components/Counter/index.d.ts +3 -0
- package/dist/types-ts4.0/components/Counter/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/EmojiButton/EmojiButton.d.ts +22 -0
- package/dist/types-ts4.0/components/EmojiButton/index.d.ts +2 -0
- package/dist/types-ts4.0/components/EmojiButton/styles.d.ts +1 -0
- package/dist/types-ts4.0/components/FlashAnimation/FlashAnimation.d.ts +20 -0
- package/dist/types-ts4.0/components/FlashAnimation/index.d.ts +2 -0
- package/dist/types-ts4.0/components/FlashAnimation/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/Reaction/Reaction.d.ts +38 -0
- package/dist/types-ts4.0/components/Reaction/index.d.ts +2 -0
- package/dist/types-ts4.0/components/Reaction/styles.d.ts +10 -0
- package/dist/types-ts4.0/components/ReactionPicker/ReactionPicker.d.ts +53 -0
- package/dist/types-ts4.0/components/ReactionPicker/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ReactionPicker/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/ReactionTooltip/ReactionTooltip.d.ts +22 -0
- package/dist/types-ts4.0/components/ReactionTooltip/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ReactionTooltip/styles.d.ts +4 -0
- package/dist/types-ts4.0/components/Reactions/Reactions.d.ts +64 -0
- package/dist/types-ts4.0/components/Reactions/index.d.ts +2 -0
- package/dist/types-ts4.0/components/Reactions/styles.d.ts +2 -0
- package/dist/types-ts4.0/components/Selector/Selector.d.ts +34 -0
- package/dist/types-ts4.0/components/Selector/index.d.ts +3 -0
- package/dist/types-ts4.0/components/Selector/styles.d.ts +10 -0
- package/dist/types-ts4.0/components/ShowMore/ShowMore.d.ts +34 -0
- package/dist/types-ts4.0/components/ShowMore/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ShowMore/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/Trigger/Trigger.d.ts +23 -0
- package/dist/types-ts4.0/components/Trigger/index.d.ts +2 -0
- package/dist/types-ts4.0/components/Trigger/styles.d.ts +5 -0
- package/dist/types-ts4.0/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +16 -0
- package/dist/types-ts4.0/components/UfoErrorBoundary/index.d.ts +2 -0
- package/dist/types-ts4.0/components/index.d.ts +8 -0
- package/dist/types-ts4.0/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +27 -0
- package/dist/types-ts4.0/containers/ConnectedReactionPicker/index.d.ts +2 -0
- package/dist/types-ts4.0/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +52 -0
- package/dist/types-ts4.0/containers/ConnectedReactionsView/index.d.ts +2 -0
- package/dist/types-ts4.0/containers/index.d.ts +2 -0
- package/dist/types-ts4.0/hooks/index.d.ts +1 -0
- package/dist/types-ts4.0/hooks/useClickAway.d.ts +8 -0
- package/dist/types-ts4.0/i18n/cs.d.ts +13 -0
- package/dist/types-ts4.0/i18n/da.d.ts +13 -0
- package/dist/types-ts4.0/i18n/de.d.ts +13 -0
- package/dist/types-ts4.0/i18n/en.d.ts +7 -0
- package/dist/types-ts4.0/i18n/en_GB.d.ts +7 -0
- package/dist/types-ts4.0/i18n/en_ZZ.d.ts +13 -0
- package/dist/types-ts4.0/i18n/es.d.ts +13 -0
- package/dist/types-ts4.0/i18n/et.d.ts +12 -0
- package/dist/types-ts4.0/i18n/fi.d.ts +13 -0
- package/dist/types-ts4.0/i18n/fr.d.ts +13 -0
- package/dist/types-ts4.0/i18n/hu.d.ts +13 -0
- package/dist/types-ts4.0/i18n/index.d.ts +35 -0
- package/dist/types-ts4.0/i18n/is.d.ts +6 -0
- package/dist/types-ts4.0/i18n/it.d.ts +13 -0
- package/dist/types-ts4.0/i18n/ja.d.ts +13 -0
- package/dist/types-ts4.0/i18n/ko.d.ts +13 -0
- package/dist/types-ts4.0/i18n/languages.d.ts +27 -0
- package/dist/types-ts4.0/i18n/nb.d.ts +13 -0
- package/dist/types-ts4.0/i18n/nl.d.ts +13 -0
- package/dist/types-ts4.0/i18n/pl.d.ts +13 -0
- package/dist/types-ts4.0/i18n/pt_BR.d.ts +13 -0
- package/dist/types-ts4.0/i18n/pt_PT.d.ts +12 -0
- package/dist/types-ts4.0/i18n/ro.d.ts +6 -0
- package/dist/types-ts4.0/i18n/ru.d.ts +13 -0
- package/dist/types-ts4.0/i18n/sk.d.ts +12 -0
- package/dist/types-ts4.0/i18n/sv.d.ts +13 -0
- package/dist/types-ts4.0/i18n/th.d.ts +13 -0
- package/dist/types-ts4.0/i18n/tr.d.ts +13 -0
- package/dist/types-ts4.0/i18n/uk.d.ts +13 -0
- package/dist/types-ts4.0/i18n/vi.d.ts +13 -0
- package/dist/types-ts4.0/i18n/zh.d.ts +13 -0
- package/dist/types-ts4.0/i18n/zh_TW.d.ts +13 -0
- package/dist/types-ts4.0/index.d.ts +7 -0
- package/dist/types-ts4.0/shared/constants.d.ts +13 -0
- package/dist/types-ts4.0/shared/i18n.d.ts +22 -0
- package/dist/types-ts4.0/shared/index.d.ts +3 -0
- package/dist/types-ts4.0/shared/utils.d.ts +11 -0
- package/dist/types-ts4.0/store/MemoryReactionsStore.d.ts +94 -0
- package/dist/types-ts4.0/store/ReactionConsumer.d.ts +57 -0
- package/dist/types-ts4.0/store/batched.d.ts +2 -0
- package/dist/types-ts4.0/store/index.d.ts +3 -0
- package/dist/types-ts4.0/store/utils.d.ts +11 -0
- package/dist/types-ts4.0/types/Actions.d.ts +27 -0
- package/dist/types-ts4.0/types/Updater.d.ts +1 -0
- package/dist/types-ts4.0/types/User.d.ts +10 -0
- package/dist/types-ts4.0/types/client.d.ts +38 -0
- package/dist/types-ts4.0/types/index.d.ts +7 -0
- package/dist/types-ts4.0/types/reaction.d.ts +82 -0
- package/dist/types-ts4.0/types/store.d.ts +63 -0
- package/package.json +15 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 21.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 21.6.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
14
|
+
|
|
3
15
|
## 21.6.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -3,5 +3,12 @@
|
|
|
3
3
|
"main": "../dist/cjs/MockReactionsClient.js",
|
|
4
4
|
"module": "../dist/esm/MockReactionsClient.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/MockReactionsClient.js",
|
|
6
|
-
"types": "../dist/types/MockReactionsClient.d.ts"
|
|
6
|
+
"types": "../dist/types/MockReactionsClient.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.0 <4.5": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../dist/types-ts4.0/MockReactionsClient.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
7
14
|
}
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
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) => ReactionSummary;
|
|
5
|
+
export declare const getUser: (id: string, displayName: string) => {
|
|
6
|
+
id: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Mocked version of the client to fetch user information
|
|
11
|
+
*/
|
|
12
|
+
export declare class MockReactionsClient implements Client {
|
|
13
|
+
private delay;
|
|
14
|
+
constructor(delay?: number);
|
|
15
|
+
private delayPromise;
|
|
16
|
+
getReactions(containerAri: string, aris: string[]): Promise<Reactions>;
|
|
17
|
+
getDetailedReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary>;
|
|
18
|
+
addReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary[]>;
|
|
19
|
+
deleteReaction(containerAri: string, ari: string, emojiId: string): Promise<ReactionSummary[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { AnalyticsEventPayload, CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { EventType } from '@atlaskit/analytics-gas-types';
|
|
3
|
+
import { ReactionSummary, ReactionSource } from '../types';
|
|
4
|
+
export declare type PreviousState = 'new' | 'existingNotReacted' | 'existingReacted';
|
|
5
|
+
export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
6
|
+
export declare const createAndFireSafe: <U extends any[], T extends (...args: U) => AnalyticsEventPayload>(createAnalyticsEvent: CreateUIAnalyticsEvent | void, creator: T, ...args: U) => void;
|
|
7
|
+
export declare const createRestSucceededEvent: (actionSubject: string) => {
|
|
8
|
+
action: string;
|
|
9
|
+
actionSubject: string;
|
|
10
|
+
eventType: EventType;
|
|
11
|
+
actionSubjectId: string | undefined;
|
|
12
|
+
attributes: {
|
|
13
|
+
packageName: any;
|
|
14
|
+
packageVersion: any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const createRestFailedEvent: (actionSubject: string, errorCode?: number | undefined) => {
|
|
18
|
+
action: string;
|
|
19
|
+
actionSubject: string;
|
|
20
|
+
eventType: EventType;
|
|
21
|
+
actionSubjectId: string | undefined;
|
|
22
|
+
attributes: {
|
|
23
|
+
packageName: any;
|
|
24
|
+
packageVersion: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const createReactionsRenderedEvent: (startTime: number) => {
|
|
28
|
+
action: string;
|
|
29
|
+
actionSubject: string;
|
|
30
|
+
eventType: EventType;
|
|
31
|
+
actionSubjectId: string | undefined;
|
|
32
|
+
attributes: {
|
|
33
|
+
packageName: any;
|
|
34
|
+
packageVersion: any;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare const createPickerButtonClickedEvent: (reactionEmojiCount: number) => {
|
|
38
|
+
action: string;
|
|
39
|
+
actionSubject: string;
|
|
40
|
+
eventType: EventType;
|
|
41
|
+
actionSubjectId: string | undefined;
|
|
42
|
+
attributes: {
|
|
43
|
+
packageName: any;
|
|
44
|
+
packageVersion: any;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare const createPickerCancelledEvent: (startTime?: number | undefined) => {
|
|
48
|
+
action: string;
|
|
49
|
+
actionSubject: string;
|
|
50
|
+
eventType: EventType;
|
|
51
|
+
actionSubjectId: string | undefined;
|
|
52
|
+
attributes: {
|
|
53
|
+
packageName: any;
|
|
54
|
+
packageVersion: any;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare const createPickerMoreClickedEvent: (startTime?: number | undefined) => {
|
|
58
|
+
action: string;
|
|
59
|
+
actionSubject: string;
|
|
60
|
+
eventType: EventType;
|
|
61
|
+
actionSubjectId: string | undefined;
|
|
62
|
+
attributes: {
|
|
63
|
+
packageName: any;
|
|
64
|
+
packageVersion: any;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare const createReactionSelectionEvent: (source: ReactionSource, emojiId: string, reaction?: ReactionSummary | undefined, startTime?: number | undefined) => {
|
|
68
|
+
action: string;
|
|
69
|
+
actionSubject: string;
|
|
70
|
+
eventType: EventType;
|
|
71
|
+
actionSubjectId: string | undefined;
|
|
72
|
+
attributes: {
|
|
73
|
+
packageName: any;
|
|
74
|
+
packageVersion: any;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export declare const createReactionHoveredEvent: (startTime?: number | undefined) => {
|
|
78
|
+
action: string;
|
|
79
|
+
actionSubject: string;
|
|
80
|
+
eventType: EventType;
|
|
81
|
+
actionSubjectId: string | undefined;
|
|
82
|
+
attributes: {
|
|
83
|
+
packageName: any;
|
|
84
|
+
packageVersion: any;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export declare const createReactionClickedEvent: (added: boolean, emojiId: string) => {
|
|
88
|
+
action: string;
|
|
89
|
+
actionSubject: string;
|
|
90
|
+
eventType: EventType;
|
|
91
|
+
actionSubjectId: string | undefined;
|
|
92
|
+
attributes: {
|
|
93
|
+
packageName: any;
|
|
94
|
+
packageVersion: any;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SAMPLING_RATE_REACTIONS_RENDERED_EXP = 0.02;
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* UFO types of components been instrumented
|
|
14
|
+
*/
|
|
15
|
+
export declare enum ComponentName {
|
|
16
|
+
PICKER_RENDERED = "reactions-picker",
|
|
17
|
+
REACTIONS = "reactions-list",
|
|
18
|
+
REACTION_ITEM = "reaction-item"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Experience when the emoji picker is opened
|
|
22
|
+
*/
|
|
23
|
+
export declare const PickerRender: UFOExperience;
|
|
24
|
+
/**
|
|
25
|
+
* Experience when the list of reactions gets rendered
|
|
26
|
+
*/
|
|
27
|
+
export declare const ReactionsRendered: ConcurrentExperience;
|
|
28
|
+
/**
|
|
29
|
+
* Experience when a reaction emoji gets added
|
|
30
|
+
*/
|
|
31
|
+
export declare const ReactionsAdd: ConcurrentExperience;
|
|
32
|
+
/**
|
|
33
|
+
* Experience when a reaction details gets fetched
|
|
34
|
+
*/
|
|
35
|
+
export declare const ReactionDetailsFetch: ConcurrentExperience;
|
|
36
|
+
/**
|
|
37
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
38
|
+
*/
|
|
39
|
+
export declare const ReactionsRemove: ConcurrentExperience;
|
|
40
|
+
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,40 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Test id for wrapper div
|
|
5
|
+
*/
|
|
6
|
+
export declare const RENDER_COUNTER_TESTID = "counter-container";
|
|
7
|
+
/**
|
|
8
|
+
* Test id for container div
|
|
9
|
+
*/
|
|
10
|
+
export declare const RENDER_COUNTER_WRAPPER_TESTID = "counter-wrapper";
|
|
11
|
+
export interface CounterProps {
|
|
12
|
+
/**
|
|
13
|
+
* Count of emoji been selected
|
|
14
|
+
*/
|
|
15
|
+
value: number;
|
|
16
|
+
/**
|
|
17
|
+
* Has the emoji been selected by given user (defaults to false)
|
|
18
|
+
*/
|
|
19
|
+
highlight?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Max threshold of selections to show before having a label (defaults to 1000)
|
|
22
|
+
*/
|
|
23
|
+
limit?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Label to show when the value surpasses the limit value (defaults to "1k+")
|
|
26
|
+
*/
|
|
27
|
+
overLimitLabel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional wrapper class name
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Duration in ms of how long the motion will take (defaults to "mediumDurationMs" from '@atlaskit/motion')
|
|
34
|
+
*/
|
|
35
|
+
animationDuration?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Display reaction count next to the emoji button
|
|
39
|
+
*/
|
|
40
|
+
export declare const Counter: React.FC<CounterProps>;
|
|
@@ -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/utils").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,38 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { EmojiProvider } from '@atlaskit/emoji';
|
|
4
|
+
import { ReactionSummary, ReactionClick, ReactionMouseEnter } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Test id for Reaction item wrapper div
|
|
7
|
+
*/
|
|
8
|
+
export declare const RENDER_REACTION_TESTID = "render_reaction_wrapper";
|
|
9
|
+
export interface ReactionProps {
|
|
10
|
+
/**
|
|
11
|
+
* Data for the reaction
|
|
12
|
+
*/
|
|
13
|
+
reaction: ReactionSummary;
|
|
14
|
+
/**
|
|
15
|
+
* Provider for loading emojis
|
|
16
|
+
*/
|
|
17
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
18
|
+
/**
|
|
19
|
+
* event handler when the emoji button is clicked
|
|
20
|
+
*/
|
|
21
|
+
onClick: ReactionClick;
|
|
22
|
+
/**
|
|
23
|
+
* Optional wrapper reaction <button /> class name
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional event when the mouse cursor hovers over the reaction
|
|
28
|
+
*/
|
|
29
|
+
onMouseEnter?: ReactionMouseEnter;
|
|
30
|
+
/**
|
|
31
|
+
* Show custom animation or render as standard without animation (defaults to false)
|
|
32
|
+
*/
|
|
33
|
+
flash?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Render an emoji reaction button
|
|
37
|
+
*/
|
|
38
|
+
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/utils").SerializedStyles;
|
|
7
|
+
export declare const reactionStyle: import("@emotion/utils").SerializedStyles;
|
|
8
|
+
export declare const reactedStyle: import("@emotion/utils").SerializedStyles;
|
|
9
|
+
export declare const flashHeight: number;
|
|
10
|
+
export declare const flashStyle: import("@emotion/utils").SerializedStyles;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
4
|
+
import { SelectorProps } from '../Selector';
|
|
5
|
+
import { ReactionSource } from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* Test id for wrapper ReactionPicker div
|
|
8
|
+
*/
|
|
9
|
+
export declare const RENDER_REACTIONPICKER_TESTID = "reactionPicker-testid";
|
|
10
|
+
export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickReactionEmojiIds'> {
|
|
11
|
+
/**
|
|
12
|
+
* Provider for loading emojis
|
|
13
|
+
*/
|
|
14
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
15
|
+
/**
|
|
16
|
+
* Event callback when an emoji button is selected
|
|
17
|
+
* @param emojiId emoji unique id
|
|
18
|
+
* @param source source where the reaction was picked (either the initial default reactions or the custom reactions picker)
|
|
19
|
+
*/
|
|
20
|
+
onSelection: (emojiId: string, source: ReactionSource) => void;
|
|
21
|
+
/**
|
|
22
|
+
* apply "miniMode" className to the <ReactionPicker /> component
|
|
23
|
+
*/
|
|
24
|
+
miniMode?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Optional class name
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)
|
|
31
|
+
*/
|
|
32
|
+
allowAllEmojis?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Enable/Disable the button to be clickable (defaults to false)
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Optional event handler when the emoji picker is opened
|
|
39
|
+
*/
|
|
40
|
+
onOpen?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Optional event handler when the emoji picker is clicked outside and closed
|
|
43
|
+
*/
|
|
44
|
+
onCancel?: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Optional event handler when the custom emoji picker icon is selected
|
|
47
|
+
*/
|
|
48
|
+
onShowMore?: () => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Picker component for adding reactions
|
|
52
|
+
*/
|
|
53
|
+
export declare const ReactionPicker: React.FC<ReactionPickerProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactionSummary } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Test id for wrapper ReactionTooltip div
|
|
6
|
+
*/
|
|
7
|
+
export declare const RENDER_REACTIONTOOLTIP_TESTID = "render-reactionTooltip";
|
|
8
|
+
export interface ReactionTooltipProps {
|
|
9
|
+
/**
|
|
10
|
+
* Optional name for the reaction emoji
|
|
11
|
+
*/
|
|
12
|
+
emojiName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Info on the emoji reaction to render
|
|
15
|
+
*/
|
|
16
|
+
reaction: ReactionSummary;
|
|
17
|
+
/**
|
|
18
|
+
* Optional Max users to show in the displayed tooltip (defaults to 5)
|
|
19
|
+
*/
|
|
20
|
+
maxReactions?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const ReactionTooltip: React.FC<ReactionTooltipProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const verticalMargin = 5;
|
|
2
|
+
export declare const tooltipStyle: import("@emotion/utils").SerializedStyles;
|
|
3
|
+
export declare const emojiNameStyle: import("@emotion/utils").SerializedStyles;
|
|
4
|
+
export declare const footerStyle: import("@emotion/utils").SerializedStyles;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactionStatus, ReactionClick, ReactionSummary } from '../../types';
|
|
4
|
+
import { ReactionPickerProps } from '../ReactionPicker';
|
|
5
|
+
import { SelectorProps } from '../Selector';
|
|
6
|
+
/**
|
|
7
|
+
* Test id for wrapper Reactions div
|
|
8
|
+
*/
|
|
9
|
+
export declare const RENDER_REACTIONS_TESTID = "render-reactions";
|
|
10
|
+
/**
|
|
11
|
+
* Test id for the tooltip
|
|
12
|
+
*/
|
|
13
|
+
export declare const RENDER_TOOLTIP_TESTID = "render-tooltip";
|
|
14
|
+
export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmojis' | 'emojiProvider'>, Pick<SelectorProps, 'pickerQuickReactionEmojiIds'> {
|
|
15
|
+
/**
|
|
16
|
+
* event handler to fetching the reactions
|
|
17
|
+
*/
|
|
18
|
+
loadReaction: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Event callback when an emoji button is selected
|
|
21
|
+
*/
|
|
22
|
+
onSelection: (emojiId: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Optional list of reactions to render (defaults to empty list)
|
|
25
|
+
*/
|
|
26
|
+
reactions?: ReactionSummary[];
|
|
27
|
+
/**
|
|
28
|
+
* Condition for the reaction list status while been fetched
|
|
29
|
+
*/
|
|
30
|
+
status: ReactionStatus;
|
|
31
|
+
/**
|
|
32
|
+
* event handler when the emoji button is clicked
|
|
33
|
+
*/
|
|
34
|
+
onReactionClick: ReactionClick;
|
|
35
|
+
/**
|
|
36
|
+
* Optional emoji reactions list to show custom animation or render as standard (key => emoji string "id", value => true/false to show custom animation)
|
|
37
|
+
*/
|
|
38
|
+
flash?: Record<string, boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Optional event when the mouse cursor hovers over the reaction
|
|
41
|
+
* @param emojiId hovered reaction emoji id
|
|
42
|
+
*/
|
|
43
|
+
onReactionHover?: (emojiId: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Optional error message to show when unable to display the reaction emoji
|
|
46
|
+
*/
|
|
47
|
+
errorMessage?: string;
|
|
48
|
+
/**
|
|
49
|
+
* the container for reactions/ari in the page (attached to the "quickReactionEmojiIds" prop)
|
|
50
|
+
*/
|
|
51
|
+
containerAri: string;
|
|
52
|
+
/**
|
|
53
|
+
* unique Atlassian identifier for an emoji (attached to the "quickReactionEmojiIds" prop)
|
|
54
|
+
*/
|
|
55
|
+
ari: string;
|
|
56
|
+
/**
|
|
57
|
+
* quickReactionEmojiIds are emojis that will be shown in the the primary view even if the reaction count is zero
|
|
58
|
+
*/
|
|
59
|
+
quickReactionEmojiIds?: string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Renders list of reactions
|
|
63
|
+
*/
|
|
64
|
+
export declare const Reactions: React.FC<ReactionsProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { EmojiId, OnEmojiEvent } from '@atlaskit/emoji/types';
|
|
4
|
+
import { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
5
|
+
/**
|
|
6
|
+
* Test id for wrapper Selector div
|
|
7
|
+
*/
|
|
8
|
+
export declare const RENDER_SELECTOR_TESTID = "render-selector";
|
|
9
|
+
export interface SelectorProps {
|
|
10
|
+
/**
|
|
11
|
+
* Provider for loading emojis
|
|
12
|
+
*/
|
|
13
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
14
|
+
/**
|
|
15
|
+
* Event handler when an emoji gets selected
|
|
16
|
+
*/
|
|
17
|
+
onSelection: OnEmojiEvent;
|
|
18
|
+
/**
|
|
19
|
+
* Enable/Disable selection of extra custom emoji beyond default list (defaults to false)
|
|
20
|
+
*/
|
|
21
|
+
showMore?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Optional event when extra custom emojis icon is selected
|
|
24
|
+
*/
|
|
25
|
+
onMoreClick?: React.MouseEventHandler<HTMLElement>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional emojis shown for user to select from when the reaction add button is clicked (defaults to pre-defined list of emojis {@link constants.DEFAULT_REACTION_EMOJI_IDS})
|
|
28
|
+
*/
|
|
29
|
+
pickerQuickReactionEmojiIds?: EmojiId[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Reactions picker panel part of the <ReactionPicker /> component
|
|
33
|
+
*/
|
|
34
|
+
export declare const Selector: React.FC<SelectorProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const selectorStyle: import("@emotion/utils").SerializedStyles;
|
|
3
|
+
export declare const emojiStyle: import("@emotion/utils").SerializedStyles;
|
|
4
|
+
export declare const revealAnimation: import("@emotion/serialize").Keyframes;
|
|
5
|
+
export declare const revealStyle: import("@emotion/utils").SerializedStyles;
|
|
6
|
+
/**
|
|
7
|
+
* custom css styling for the emoji icon
|
|
8
|
+
* @param index location of the emoji in the rendered list of items
|
|
9
|
+
*/
|
|
10
|
+
export declare const emojiStyleAnimation: (index: number) => React.CSSProperties;
|