@atlaskit/reactions 21.8.0 → 21.8.1
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 +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +4 -13
- package/dist/types-ts4.0/MockReactionsClient.d.ts +0 -23
- package/dist/types-ts4.0/analytics/analytics.d.ts +0 -102
- package/dist/types-ts4.0/analytics/constants.d.ts +0 -1
- package/dist/types-ts4.0/analytics/index.d.ts +0 -2
- package/dist/types-ts4.0/analytics/ufo.d.ts +0 -40
- package/dist/types-ts4.0/client/ReactionServiceClient.d.ts +0 -35
- package/dist/types-ts4.0/client/index.d.ts +0 -1
- package/dist/types-ts4.0/components/Counter/Counter.d.ts +0 -45
- package/dist/types-ts4.0/components/Counter/index.d.ts +0 -3
- package/dist/types-ts4.0/components/Counter/styles.d.ts +0 -3
- package/dist/types-ts4.0/components/EmojiButton/EmojiButton.d.ts +0 -22
- package/dist/types-ts4.0/components/EmojiButton/index.d.ts +0 -2
- package/dist/types-ts4.0/components/EmojiButton/styles.d.ts +0 -1
- package/dist/types-ts4.0/components/FlashAnimation/FlashAnimation.d.ts +0 -20
- package/dist/types-ts4.0/components/FlashAnimation/index.d.ts +0 -2
- package/dist/types-ts4.0/components/FlashAnimation/styles.d.ts +0 -5
- package/dist/types-ts4.0/components/Reaction/Reaction.d.ts +0 -38
- package/dist/types-ts4.0/components/Reaction/index.d.ts +0 -2
- package/dist/types-ts4.0/components/Reaction/styles.d.ts +0 -10
- package/dist/types-ts4.0/components/ReactionPicker/ReactionPicker.d.ts +0 -50
- package/dist/types-ts4.0/components/ReactionPicker/index.d.ts +0 -2
- package/dist/types-ts4.0/components/ReactionPicker/styles.d.ts +0 -3
- package/dist/types-ts4.0/components/ReactionTooltip/ReactionTooltip.d.ts +0 -22
- package/dist/types-ts4.0/components/ReactionTooltip/index.d.ts +0 -2
- package/dist/types-ts4.0/components/ReactionTooltip/styles.d.ts +0 -4
- package/dist/types-ts4.0/components/Reactions/Reactions.d.ts +0 -57
- package/dist/types-ts4.0/components/Reactions/index.d.ts +0 -2
- package/dist/types-ts4.0/components/Reactions/styles.d.ts +0 -2
- package/dist/types-ts4.0/components/Selector/Selector.d.ts +0 -34
- package/dist/types-ts4.0/components/Selector/index.d.ts +0 -3
- package/dist/types-ts4.0/components/Selector/styles.d.ts +0 -12
- package/dist/types-ts4.0/components/ShowMore/ShowMore.d.ts +0 -35
- package/dist/types-ts4.0/components/ShowMore/index.d.ts +0 -2
- package/dist/types-ts4.0/components/ShowMore/styles.d.ts +0 -3
- package/dist/types-ts4.0/components/Trigger/Trigger.d.ts +0 -35
- package/dist/types-ts4.0/components/Trigger/index.d.ts +0 -2
- package/dist/types-ts4.0/components/Trigger/styles.d.ts +0 -5
- package/dist/types-ts4.0/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +0 -16
- package/dist/types-ts4.0/components/UfoErrorBoundary/index.d.ts +0 -2
- package/dist/types-ts4.0/components/index.d.ts +0 -8
- package/dist/types-ts4.0/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +0 -27
- package/dist/types-ts4.0/containers/ConnectedReactionPicker/index.d.ts +0 -2
- package/dist/types-ts4.0/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +0 -52
- package/dist/types-ts4.0/containers/ConnectedReactionsView/index.d.ts +0 -2
- package/dist/types-ts4.0/containers/index.d.ts +0 -2
- package/dist/types-ts4.0/hooks/index.d.ts +0 -1
- package/dist/types-ts4.0/hooks/useClickAway.d.ts +0 -9
- package/dist/types-ts4.0/i18n/cs.d.ts +0 -13
- package/dist/types-ts4.0/i18n/da.d.ts +0 -13
- package/dist/types-ts4.0/i18n/de.d.ts +0 -13
- package/dist/types-ts4.0/i18n/en.d.ts +0 -7
- package/dist/types-ts4.0/i18n/en_GB.d.ts +0 -7
- package/dist/types-ts4.0/i18n/en_ZZ.d.ts +0 -13
- package/dist/types-ts4.0/i18n/es.d.ts +0 -13
- package/dist/types-ts4.0/i18n/et.d.ts +0 -12
- package/dist/types-ts4.0/i18n/fi.d.ts +0 -13
- package/dist/types-ts4.0/i18n/fr.d.ts +0 -13
- package/dist/types-ts4.0/i18n/hu.d.ts +0 -13
- package/dist/types-ts4.0/i18n/index.d.ts +0 -35
- package/dist/types-ts4.0/i18n/is.d.ts +0 -6
- package/dist/types-ts4.0/i18n/it.d.ts +0 -13
- package/dist/types-ts4.0/i18n/ja.d.ts +0 -13
- package/dist/types-ts4.0/i18n/ko.d.ts +0 -13
- package/dist/types-ts4.0/i18n/languages.d.ts +0 -27
- package/dist/types-ts4.0/i18n/nb.d.ts +0 -13
- package/dist/types-ts4.0/i18n/nl.d.ts +0 -13
- package/dist/types-ts4.0/i18n/pl.d.ts +0 -13
- package/dist/types-ts4.0/i18n/pt_BR.d.ts +0 -13
- package/dist/types-ts4.0/i18n/pt_PT.d.ts +0 -12
- package/dist/types-ts4.0/i18n/ro.d.ts +0 -6
- package/dist/types-ts4.0/i18n/ru.d.ts +0 -13
- package/dist/types-ts4.0/i18n/sk.d.ts +0 -12
- package/dist/types-ts4.0/i18n/sv.d.ts +0 -13
- package/dist/types-ts4.0/i18n/th.d.ts +0 -13
- package/dist/types-ts4.0/i18n/tr.d.ts +0 -13
- package/dist/types-ts4.0/i18n/uk.d.ts +0 -13
- package/dist/types-ts4.0/i18n/vi.d.ts +0 -13
- package/dist/types-ts4.0/i18n/zh.d.ts +0 -13
- package/dist/types-ts4.0/i18n/zh_TW.d.ts +0 -13
- package/dist/types-ts4.0/index.d.ts +0 -7
- package/dist/types-ts4.0/shared/constants.d.ts +0 -21
- package/dist/types-ts4.0/shared/i18n.d.ts +0 -32
- package/dist/types-ts4.0/shared/index.d.ts +0 -3
- package/dist/types-ts4.0/shared/utils.d.ts +0 -11
- package/dist/types-ts4.0/store/MemoryReactionsStore.d.ts +0 -94
- package/dist/types-ts4.0/store/ReactionConsumer.d.ts +0 -57
- package/dist/types-ts4.0/store/batched.d.ts +0 -2
- package/dist/types-ts4.0/store/index.d.ts +0 -3
- package/dist/types-ts4.0/store/utils.d.ts +0 -11
- package/dist/types-ts4.0/types/Actions.d.ts +0 -27
- package/dist/types-ts4.0/types/Updater.d.ts +0 -1
- package/dist/types-ts4.0/types/User.d.ts +0 -10
- package/dist/types-ts4.0/types/client.d.ts +0 -38
- package/dist/types-ts4.0/types/index.d.ts +0 -7
- package/dist/types-ts4.0/types/reaction.d.ts +0 -100
- package/dist/types-ts4.0/types/store.d.ts +0 -63
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* NOTE:
|
|
8
|
-
*
|
|
9
|
-
* This file is automatically generated by Traduki 2.0.
|
|
10
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
11
|
-
*/
|
|
12
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'fabric.reactions.error.unexpected': string;
|
|
3
|
-
'fabric.reactions.loading': string;
|
|
4
|
-
'fabric.reactions.more.emoji': string;
|
|
5
|
-
'fabric.reactions.other.reacted.users': string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* NOTE:
|
|
9
|
-
*
|
|
10
|
-
* This file is automatically generated by Traduki 2.0.
|
|
11
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
12
|
-
*/
|
|
13
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { UFO } from './analytics';
|
|
2
|
-
export { ReactionServiceClient } from './client';
|
|
3
|
-
export type { Client as ReactionClient, Request as ReactionRequest, Store as ReactionsStore, StorePropInput, State, } from './types';
|
|
4
|
-
export { constants } from './shared';
|
|
5
|
-
export { Reaction, ReactionPicker, Reactions } from './components';
|
|
6
|
-
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|
|
7
|
-
export { MemoryReactionsStore, ReactionConsumer } from './store';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { EmojiId } from '@atlaskit/emoji/types';
|
|
2
|
-
/**
|
|
3
|
-
* Initial list of emoji to pick from
|
|
4
|
-
*/
|
|
5
|
-
export declare const DefaultReactions: EmojiId[];
|
|
6
|
-
/**
|
|
7
|
-
* Default label to show for the overLimitLabel prop
|
|
8
|
-
*/
|
|
9
|
-
export declare const DEFAULT_OVER_THE_LIMIT_REACTION_LABEL = "1k+";
|
|
10
|
-
/**
|
|
11
|
-
* Default maximum value to use when the emoji received higher than top limit reactions
|
|
12
|
-
*/
|
|
13
|
-
export declare const DEFAULT_REACTION_TOP_LIMIT = 1000;
|
|
14
|
-
/**
|
|
15
|
-
* ES6 Map object from default emoji reactions (with key => shortName, value => entire emoji item)
|
|
16
|
-
*/
|
|
17
|
-
export declare const DefaultReactionsByShortName: Map<string, EmojiId>;
|
|
18
|
-
/**
|
|
19
|
-
* Maximum number of users to show in the tooltip for an emoji reaction
|
|
20
|
-
*/
|
|
21
|
-
export declare const TOOLTIP_USERS_LIMIT = 5;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const messages: {
|
|
2
|
-
addReaction: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
loadingReactions: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
moreEmoji: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
reactWithEmoji: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
unexpectedError: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
otherUsers: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EmojiId } from '@atlaskit/emoji/types';
|
|
2
|
-
/**
|
|
3
|
-
* Is selected mouse event a left click
|
|
4
|
-
* @param event event data
|
|
5
|
-
*/
|
|
6
|
-
export declare const isLeftClick: (event: React.MouseEvent<HTMLElement>) => boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Does provided item part of the default emoji ids
|
|
9
|
-
* @param item selected emoji item
|
|
10
|
-
*/
|
|
11
|
-
export declare const isDefaultReaction: (item: EmojiId) => boolean;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import * as Types from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Set of all available UFO experiences relating to reaction element
|
|
5
|
-
*/
|
|
6
|
-
export declare const ufoExperiences: {
|
|
7
|
-
/**
|
|
8
|
-
* Experience when a reaction emoji gets added
|
|
9
|
-
*/
|
|
10
|
-
add: import("@atlaskit/ufo").ConcurrentExperience;
|
|
11
|
-
/**
|
|
12
|
-
* Experience when a reaction emoji gets removed/decrement
|
|
13
|
-
*/
|
|
14
|
-
remove: import("@atlaskit/ufo").ConcurrentExperience;
|
|
15
|
-
/**
|
|
16
|
-
* Experience when the list of reactions gets rendered with sampling
|
|
17
|
-
*/
|
|
18
|
-
render: (instanceId: string) => import("@atlaskit/emoji").WithSamplingUFOExperience;
|
|
19
|
-
/**
|
|
20
|
-
* Experience when a reaction details gets fetched
|
|
21
|
-
*/
|
|
22
|
-
fetchDetails: import("@atlaskit/ufo").ConcurrentExperience;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Optional metadata information in the store used in sending the API client requests
|
|
26
|
-
*/
|
|
27
|
-
interface StoreMetadata {
|
|
28
|
-
subproduct?: string;
|
|
29
|
-
[k: string]: any;
|
|
30
|
-
}
|
|
31
|
-
export declare class MemoryReactionsStore implements Types.Store {
|
|
32
|
-
private client;
|
|
33
|
-
private state;
|
|
34
|
-
private metadata;
|
|
35
|
-
private callbacks;
|
|
36
|
-
private createAnalyticsEvent?;
|
|
37
|
-
/**
|
|
38
|
-
* default initial store data
|
|
39
|
-
*/
|
|
40
|
-
private initialState;
|
|
41
|
-
constructor(client: Types.Client, state?: Types.State, metadata?: StoreMetadata);
|
|
42
|
-
/**
|
|
43
|
-
* Update the store state data with a new data
|
|
44
|
-
* @param newState new store data
|
|
45
|
-
*/
|
|
46
|
-
private setState;
|
|
47
|
-
/**
|
|
48
|
-
* Calls any onChange callbacks in the store using latest state data.
|
|
49
|
-
*/
|
|
50
|
-
private triggerOnChange;
|
|
51
|
-
private setReactions;
|
|
52
|
-
private getReactionsState;
|
|
53
|
-
private handleDetailedReactionResponse;
|
|
54
|
-
private setFlash;
|
|
55
|
-
private flash;
|
|
56
|
-
private optmisticUpdate;
|
|
57
|
-
/**
|
|
58
|
-
* Utility function to help execute a callback to Reaction if its state is ready.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* @param containerAri
|
|
62
|
-
* @param ari
|
|
63
|
-
*
|
|
64
|
-
* @returns (updater: Updater<ReactionsReadyState>) => ReactionsState?
|
|
65
|
-
* A function that will execute the received callback with the ReactionsState if
|
|
66
|
-
* ready. If some state is returned, the new state will be applied.
|
|
67
|
-
*/
|
|
68
|
-
private withReadyReaction;
|
|
69
|
-
/**
|
|
70
|
-
* Utility function to help execute actions with a reaction. It handles reaction discovery
|
|
71
|
-
* and branching between reacted and not reacted.
|
|
72
|
-
*
|
|
73
|
-
* @param reactedCallback callback that will be executed when the user has already reacted
|
|
74
|
-
* with the emoji
|
|
75
|
-
* @param notReactedCallback callback that will be executed when the user hasn't reacted
|
|
76
|
-
* with the emoji
|
|
77
|
-
*
|
|
78
|
-
* @returns (containerAri: string, ari: string, emojiId: string) => ReactionsState?
|
|
79
|
-
* A function that will execute the correct callback to the triple containerAri, ari and
|
|
80
|
-
* emojiId. If some state is returned, the new state will be applied.
|
|
81
|
-
*/
|
|
82
|
-
private withReaction;
|
|
83
|
-
private doAddReaction;
|
|
84
|
-
private doRemoveReaction;
|
|
85
|
-
setCreateAnalyticsEvent: (createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined) => void;
|
|
86
|
-
getReactions: (key: string, ...args: string[]) => void;
|
|
87
|
-
toggleReaction: (containerAri: string, ari: string, emojiId: string) => void;
|
|
88
|
-
addReaction: (containerAri: string, ari: string, emojiId: string) => void;
|
|
89
|
-
getDetailedReaction: (containerAri: string, ari: string, emojiId: string) => void;
|
|
90
|
-
getState: () => Types.State;
|
|
91
|
-
onChange: (callback: Types.OnChangeCallback) => void;
|
|
92
|
-
removeOnChangeListener: (toRemove: Types.OnChangeCallback) => void;
|
|
93
|
-
}
|
|
94
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Actions, State, StorePropInput, Store } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Props type for the ReactionConsumer class component
|
|
5
|
-
*/
|
|
6
|
-
export declare type ReactioConsumerProps<PropsFromState, PropsFromActions> = {
|
|
7
|
-
/**
|
|
8
|
-
* Return a plain object containing the data that the connected component needs
|
|
9
|
-
*/
|
|
10
|
-
mapStateToProps?: (state: State) => PropsFromState;
|
|
11
|
-
/**
|
|
12
|
-
* Specify which actions the child component might need to dispatch from its props
|
|
13
|
-
*/
|
|
14
|
-
mapActionsToProps?: (actions: Actions) => PropsFromActions;
|
|
15
|
-
/**
|
|
16
|
-
* Component to render
|
|
17
|
-
*/
|
|
18
|
-
children: (props: PropsFromState & PropsFromActions) => React.ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* Reference to the store.
|
|
21
|
-
* @remarks
|
|
22
|
-
* This was initially implemented with a sync and Async versions and will be replaced with just a sync Store in a future release (Please use only the sync version)
|
|
23
|
-
*/
|
|
24
|
-
store: StorePropInput;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* State type for the ReactionConsumer class component
|
|
28
|
-
*/
|
|
29
|
-
export declare type ReactionConsumerState = {
|
|
30
|
-
store?: Store;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* A custom mapper class that takes the store instance and mapper functions "mapStateToProps" and "mapActionsToProps" to return the renderProps pattern as a child component
|
|
34
|
-
* @deprecated please avoid using this class as it will be removed in a future release
|
|
35
|
-
*/
|
|
36
|
-
export declare class ReactionConsumer<PropsFromState, PropsFromActions> extends React.PureComponent<ReactioConsumerProps<PropsFromState, PropsFromActions>, ReactionConsumerState> {
|
|
37
|
-
private previousActions;
|
|
38
|
-
private propsFromActions;
|
|
39
|
-
constructor(props: ReactioConsumerProps<PropsFromState, PropsFromActions>);
|
|
40
|
-
componentDidMount(): void;
|
|
41
|
-
componentWillUnmount(): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Get the actions the child component might need to dispatch from its props
|
|
44
|
-
*/
|
|
45
|
-
private getPropsFromActions;
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @param state Internal state data
|
|
49
|
-
* @returns object containing the data that the connected component needs
|
|
50
|
-
*/
|
|
51
|
-
private getPropsFromState;
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
private handleOnChange;
|
|
56
|
-
render(): React.ReactNode;
|
|
57
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Updater, ReactionsReadyState, ReactionSummary } from '../types';
|
|
2
|
-
declare type ReactionSummarySortFunction = (a: ReactionSummary, b: ReactionSummary) => number;
|
|
3
|
-
export declare const readyState: (reactions: ReactionSummary[]) => ReactionsReadyState;
|
|
4
|
-
export declare const byEmojiId: (emojiId: string) => (reaction: ReactionSummary) => boolean;
|
|
5
|
-
export declare const addOne: (reaction: ReactionSummary) => ReactionSummary;
|
|
6
|
-
export declare const removeOne: (reaction: ReactionSummary) => ReactionSummary;
|
|
7
|
-
export declare const updateByEmojiId: (emojiId: string, updater: Updater<ReactionSummary> | ReactionSummary) => (reaction: ReactionSummary) => void | ReactionSummary;
|
|
8
|
-
export declare const getReactionsSortFunction: (reactions?: ReactionSummary[] | undefined) => ReactionSummarySortFunction;
|
|
9
|
-
export declare const flattenAris: (a: string[], b: string[]) => string[];
|
|
10
|
-
export declare function isRealErrorFromService(errorCode?: number): boolean;
|
|
11
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Event callback by the client to the API
|
|
3
|
-
* @param containerAri the container for reactions/ari in the page (attached to the "quickReactionEmojis" prop)
|
|
4
|
-
* @param ariunique Atlassian identifier for an emoji (attached to the "quickReactionEmojis" prop)
|
|
5
|
-
* @param emojiId unique identifier guid for the emoji
|
|
6
|
-
*/
|
|
7
|
-
export declare type ReactionAction = (containerAri: string, ari: string, emojiId: string) => void;
|
|
8
|
-
export declare type Actions = {
|
|
9
|
-
/**
|
|
10
|
-
* Retrieve reaction collection api
|
|
11
|
-
* @param containerId the container for reactions/ari in the page
|
|
12
|
-
* @param aris collection of Asset ids in the container
|
|
13
|
-
*/
|
|
14
|
-
getReactions: (containerId: string, aris: string) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Select/deselect a rection callback
|
|
17
|
-
*/
|
|
18
|
-
toggleReaction: ReactionAction;
|
|
19
|
-
/**
|
|
20
|
-
* Add a new reation api
|
|
21
|
-
*/
|
|
22
|
-
addReaction: ReactionAction;
|
|
23
|
-
/**
|
|
24
|
-
* Hover an existing reaction emoji api
|
|
25
|
-
*/
|
|
26
|
-
getDetailedReaction: ReactionAction;
|
|
27
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type Updater<T> = (original: T) => T | void;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Reactions, ReactionSummary } from './reaction';
|
|
2
|
-
export declare type Request<T> = (
|
|
3
|
-
/**
|
|
4
|
-
* Reaction Asset id in the container
|
|
5
|
-
*/
|
|
6
|
-
ari: string,
|
|
7
|
-
/**
|
|
8
|
-
* the container for reactions/ari
|
|
9
|
-
*/
|
|
10
|
-
containerAri: string,
|
|
11
|
-
/**
|
|
12
|
-
* unique Atlassian identifier for an emoji
|
|
13
|
-
*/
|
|
14
|
-
emojiId: string,
|
|
15
|
-
/**
|
|
16
|
-
* Optional metadata information used in the API request
|
|
17
|
-
*/
|
|
18
|
-
metadata?: Record<string, any>) => Promise<T>;
|
|
19
|
-
export interface Client {
|
|
20
|
-
/**
|
|
21
|
-
* fetch reactions request handler
|
|
22
|
-
* @param containerAri container wrapper id
|
|
23
|
-
* @param aris container reaction assets unique ids
|
|
24
|
-
*/
|
|
25
|
-
getReactions(containerAri: string, aris: string[]): Promise<Reactions>;
|
|
26
|
-
/**
|
|
27
|
-
* Fetch details for a given reaction.
|
|
28
|
-
*/
|
|
29
|
-
getDetailedReaction: Request<ReactionSummary>;
|
|
30
|
-
/**
|
|
31
|
-
* Fetch request when adding a reaction to a container.
|
|
32
|
-
*/
|
|
33
|
-
addReaction: Request<ReactionSummary[]>;
|
|
34
|
-
/**
|
|
35
|
-
* Fetch request when removing a reaction from a container.
|
|
36
|
-
*/
|
|
37
|
-
deleteReaction: Request<ReactionSummary[]>;
|
|
38
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type { ReactionAction, Actions } from './Actions';
|
|
2
|
-
export { ReactionStatus } from './reaction';
|
|
3
|
-
export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, QuickReactionEmojiSummary, ReactionsNotLoaded, Reactions, ReactionClick, ReactionMouseEnter, } from './reaction';
|
|
4
|
-
export type { Client, Request } from './client';
|
|
5
|
-
export type { Updater } from './Updater';
|
|
6
|
-
export type { User } from './User';
|
|
7
|
-
export type { Store, StorePropInput, State, OnChangeCallback } from './store';
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { User } from './User';
|
|
3
|
-
/**
|
|
4
|
-
* Collection of reactions as object (key is unique id from containerAri and ari combined)
|
|
5
|
-
*/
|
|
6
|
-
export declare type Reactions = Record<string, ReactionSummary[]>;
|
|
7
|
-
/**
|
|
8
|
-
* MetaData for Reaction object
|
|
9
|
-
*/
|
|
10
|
-
export interface ReactionSummary {
|
|
11
|
-
/**
|
|
12
|
-
* Reaction Asset id in the container
|
|
13
|
-
*/
|
|
14
|
-
ari: string;
|
|
15
|
-
/**
|
|
16
|
-
* the container for reactions/ari in the page
|
|
17
|
-
*/
|
|
18
|
-
containerAri: string;
|
|
19
|
-
/**
|
|
20
|
-
* unique Atlassian identifier for an emoji
|
|
21
|
-
*/
|
|
22
|
-
emojiId: string;
|
|
23
|
-
/**
|
|
24
|
-
* Number of selected count for the emoji
|
|
25
|
-
*/
|
|
26
|
-
count: number;
|
|
27
|
-
/**
|
|
28
|
-
* Has the current user selected the emoji or not
|
|
29
|
-
*/
|
|
30
|
-
reacted: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Users collection
|
|
33
|
-
*/
|
|
34
|
-
users?: User[];
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated Legacy content Not in use anymore
|
|
37
|
-
*/
|
|
38
|
-
optimisticallyUpdated?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Metadata for composing a summary of emojis that will be shown in the the primary view even if the reaction count is zero
|
|
42
|
-
*/
|
|
43
|
-
export interface QuickReactionEmojiSummary {
|
|
44
|
-
/**
|
|
45
|
-
* unique Atlassian identifier for an emoji (attached to the "emojiIds" when forming {@link ReactionSummary} object)
|
|
46
|
-
*/
|
|
47
|
-
ari: string;
|
|
48
|
-
/**
|
|
49
|
-
* unique Atlassian identifier for the container grouping reactions/ari in the page (attached to the "emojiIds" when forming {@link ReactionSummary} object)
|
|
50
|
-
*/
|
|
51
|
-
containerAri: string;
|
|
52
|
-
/**
|
|
53
|
-
* emoji ids collection that will be shown in the the primary view even if the reaction count is zero
|
|
54
|
-
*/
|
|
55
|
-
emojiIds: string[];
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Event handler for when the user clicks on the reaction
|
|
59
|
-
* @param id give id for the emoji
|
|
60
|
-
* @param event selected mouse event proerties
|
|
61
|
-
*/
|
|
62
|
-
export declare type ReactionClick = (id: string, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Event handler for when the user hovers with the mouse on the reaction
|
|
65
|
-
* @param reaction reaction object
|
|
66
|
-
* @param event (Optional) custom DOM event handler callback
|
|
67
|
-
*/
|
|
68
|
-
export declare type ReactionMouseEnter = (reaction: ReactionSummary, event?: React.MouseEvent<any>) => void;
|
|
69
|
-
/**
|
|
70
|
-
* Condition of the reaction when gets loaded from the store
|
|
71
|
-
*/
|
|
72
|
-
export declare enum ReactionStatus {
|
|
73
|
-
ready = "READY",
|
|
74
|
-
loading = "LOADING",
|
|
75
|
-
error = "ERROR",
|
|
76
|
-
notLoaded = "NOT_LOADED",
|
|
77
|
-
disabled = "DISABLED"
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* state in which the reaction is at
|
|
81
|
-
*/
|
|
82
|
-
export declare type ReactionsState = ReactionsNotLoaded | ReactionsLoading | ReactionsReadyState | ReactionsError;
|
|
83
|
-
export declare type ReactionsReadyState = {
|
|
84
|
-
readonly status: ReactionStatus.ready;
|
|
85
|
-
readonly reactions: ReactionSummary[];
|
|
86
|
-
};
|
|
87
|
-
export declare type ReactionsLoading = {
|
|
88
|
-
readonly status: ReactionStatus.loading;
|
|
89
|
-
};
|
|
90
|
-
export declare type ReactionsError = {
|
|
91
|
-
readonly status: ReactionStatus.error;
|
|
92
|
-
readonly message: string;
|
|
93
|
-
};
|
|
94
|
-
export declare type ReactionsNotLoaded = {
|
|
95
|
-
readonly status: ReactionStatus.notLoaded;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Source where the emoji selected from ("quickSelector" -> default list, "emojiPicker" -> custom emoji list)
|
|
99
|
-
*/
|
|
100
|
-
export declare type ReactionSource = 'quickSelector' | 'emojiPicker';
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { Actions } from './Actions';
|
|
3
|
-
import { ReactionsState } from './reaction';
|
|
4
|
-
/**
|
|
5
|
-
* Callback event when changes apply to the main store
|
|
6
|
-
* @param state latest store state
|
|
7
|
-
*/
|
|
8
|
-
export declare type OnChangeCallback = (state: State) => void;
|
|
9
|
-
/**
|
|
10
|
-
* Map of state props
|
|
11
|
-
*/
|
|
12
|
-
export interface StoreProps {
|
|
13
|
-
/**
|
|
14
|
-
* Get current state of the stor
|
|
15
|
-
*/
|
|
16
|
-
getState: () => State;
|
|
17
|
-
/**
|
|
18
|
-
* Register a callbsack event on change to the store instance state data
|
|
19
|
-
* @param callback event to register
|
|
20
|
-
* @deprecated initially implemented by the MemoryReactionsStore class and kept. This will be removed in a future release
|
|
21
|
-
*/
|
|
22
|
-
onChange: (callback: OnChangeCallback) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Deregister any callback event on changes to the store instance state data
|
|
25
|
-
* @param callback event to de-register
|
|
26
|
-
* @deprecated initially implemented by the MemoryReactionsStore class and kept. This will be removed in a future release
|
|
27
|
-
*/
|
|
28
|
-
removeOnChangeListener: (callback: OnChangeCallback) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Add Atlaskit analytics events to different operations in the store
|
|
31
|
-
* @param createAnalyticsEvent analytics event trigger
|
|
32
|
-
* @deprecated initially implemented by the MemoryReactionsStore class and kept. This will be removed in a future release
|
|
33
|
-
*/
|
|
34
|
-
setCreateAnalyticsEvent?: (createAnalyticsEvent: CreateUIAnalyticsEvent) => void;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* General Interface for a reaction store
|
|
38
|
-
*/
|
|
39
|
-
export interface Store extends Actions, StoreProps {
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* the "store" prop option to the connected view and picker components
|
|
43
|
-
*/
|
|
44
|
-
export declare type StorePropInput = Store | Promise<Store>;
|
|
45
|
-
/**
|
|
46
|
-
* store main structure
|
|
47
|
-
*/
|
|
48
|
-
export declare type State = {
|
|
49
|
-
/**
|
|
50
|
-
* collection of the different reactions (key => unique reaction id , value => state of the reaction)
|
|
51
|
-
*/
|
|
52
|
-
reactions: {
|
|
53
|
-
[key: string]: ReactionsState;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* custom animation for given emojis as true|false (key => unique reaction id, value => collection of emojiIds and true|false to apply custom animation)
|
|
57
|
-
*/
|
|
58
|
-
flash: {
|
|
59
|
-
[key: string]: {
|
|
60
|
-
[emojiId: string]: boolean;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|