@atlaskit/reactions 34.4.12 → 34.4.13
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/ConnectedReactionPicker/package.json +1 -8
- package/ConnectedReactionsView/package.json +1 -8
- package/MemoryReactionsStore/package.json +1 -8
- package/MockReactionsClient/package.json +1 -8
- package/Reaction/package.json +1 -8
- package/ReactionConsumer/package.json +1 -8
- package/ReactionPicker/package.json +1 -8
- package/ReactionServiceClient/package.json +1 -8
- package/Reactions/package.json +1 -8
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/esm/analytics/index.js +1 -1
- package/package.json +2 -2
- package/reaction/package.json +1 -8
- package/store/package.json +1 -8
- package/types/package.json +1 -8
- package/useCloseManager/package.json +1 -8
- package/dist/types-ts4.5/MockReactionsClient.d.ts +0 -27
- package/dist/types-ts4.5/analytics/index.d.ts +0 -121
- package/dist/types-ts4.5/client/ReactionServiceClient.d.ts +0 -35
- package/dist/types-ts4.5/client/index.d.ts +0 -1
- package/dist/types-ts4.5/components/Counter.d.ts +0 -51
- package/dist/types-ts4.5/components/EmojiButton.d.ts +0 -24
- package/dist/types-ts4.5/components/FlashAnimation.d.ts +0 -23
- package/dist/types-ts4.5/components/Reaction.d.ts +0 -67
- package/dist/types-ts4.5/components/ReactionButton.d.ts +0 -22
- package/dist/types-ts4.5/components/ReactionParticleEffect.d.ts +0 -22
- package/dist/types-ts4.5/components/ReactionPicker.d.ts +0 -119
- package/dist/types-ts4.5/components/ReactionSummaryButton.d.ts +0 -61
- package/dist/types-ts4.5/components/ReactionSummaryView.d.ts +0 -81
- package/dist/types-ts4.5/components/ReactionTooltip.d.ts +0 -43
- package/dist/types-ts4.5/components/ReactionView.d.ts +0 -12
- package/dist/types-ts4.5/components/Reactions.d.ts +0 -206
- package/dist/types-ts4.5/components/ReactionsDialog.d.ts +0 -32
- package/dist/types-ts4.5/components/ReactionsDialogHeader.d.ts +0 -15
- package/dist/types-ts4.5/components/ReactionsDialogTrigger.d.ts +0 -5
- package/dist/types-ts4.5/components/ReactionsList.d.ts +0 -20
- package/dist/types-ts4.5/components/RepositionOnUpdate.d.ts +0 -13
- package/dist/types-ts4.5/components/Selector.d.ts +0 -36
- package/dist/types-ts4.5/components/ShowMore.d.ts +0 -15
- package/dist/types-ts4.5/components/StaticReaction.d.ts +0 -11
- package/dist/types-ts4.5/components/Trigger.d.ts +0 -83
- package/dist/types-ts4.5/components/UfoErrorBoundary.d.ts +0 -17
- package/dist/types-ts4.5/components/index.d.ts +0 -9
- package/dist/types-ts4.5/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +0 -23
- package/dist/types-ts4.5/containers/ConnectedReactionPicker/index.d.ts +0 -2
- package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +0 -56
- package/dist/types-ts4.5/containers/ConnectedReactionsView/index.d.ts +0 -2
- package/dist/types-ts4.5/containers/index.d.ts +0 -2
- package/dist/types-ts4.5/hooks/useCloseManager.d.ts +0 -20
- package/dist/types-ts4.5/hooks/useDelayedState.d.ts +0 -6
- package/dist/types-ts4.5/hooks/useFocusTrap.d.ts +0 -5
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -27
- package/dist/types-ts4.5/i18n/da.d.ts +0 -27
- package/dist/types-ts4.5/i18n/de.d.ts +0 -26
- package/dist/types-ts4.5/i18n/en.d.ts +0 -27
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -27
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -27
- package/dist/types-ts4.5/i18n/es.d.ts +0 -27
- package/dist/types-ts4.5/i18n/et.d.ts +0 -11
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -26
- package/dist/types-ts4.5/i18n/fr.d.ts +0 -27
- package/dist/types-ts4.5/i18n/hu.d.ts +0 -27
- package/dist/types-ts4.5/i18n/index.d.ts +0 -37
- package/dist/types-ts4.5/i18n/is.d.ts +0 -6
- package/dist/types-ts4.5/i18n/it.d.ts +0 -27
- package/dist/types-ts4.5/i18n/ja.d.ts +0 -27
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -26
- package/dist/types-ts4.5/i18n/languages.d.ts +0 -28
- package/dist/types-ts4.5/i18n/nb.d.ts +0 -26
- package/dist/types-ts4.5/i18n/nl.d.ts +0 -27
- package/dist/types-ts4.5/i18n/pl.d.ts +0 -27
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -27
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -11
- package/dist/types-ts4.5/i18n/ro.d.ts +0 -6
- package/dist/types-ts4.5/i18n/ru.d.ts +0 -26
- package/dist/types-ts4.5/i18n/sk.d.ts +0 -11
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -27
- package/dist/types-ts4.5/i18n/th.d.ts +0 -27
- package/dist/types-ts4.5/i18n/tr.d.ts +0 -27
- package/dist/types-ts4.5/i18n/uk.d.ts +0 -27
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -27
- package/dist/types-ts4.5/i18n/zh.d.ts +0 -27
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -26
- package/dist/types-ts4.5/index.d.ts +0 -34
- package/dist/types-ts4.5/shared/constants.d.ts +0 -34
- package/dist/types-ts4.5/shared/i18n.d.ts +0 -87
- package/dist/types-ts4.5/shared/utils.d.ts +0 -18
- package/dist/types-ts4.5/store/MemoryReactionsStore.d.ts +0 -99
- package/dist/types-ts4.5/store/ReactionConsumer.d.ts +0 -57
- package/dist/types-ts4.5/store/batched.d.ts +0 -2
- package/dist/types-ts4.5/store/index.d.ts +0 -3
- package/dist/types-ts4.5/store/utils.d.ts +0 -11
- package/dist/types-ts4.5/types/Actions.d.ts +0 -28
- package/dist/types-ts4.5/types/Updater.d.ts +0 -2
- package/dist/types-ts4.5/types/User.d.ts +0 -21
- package/dist/types-ts4.5/types/client.d.ts +0 -38
- package/dist/types-ts4.5/types/index.d.ts +0 -25
- package/dist/types-ts4.5/types/reaction.d.ts +0 -117
- package/dist/types-ts4.5/types/store.d.ts +0 -71
- package/dist/types-ts4.5/ufo/index.d.ts +0 -54
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { type Client, type OnChangeCallback, type State, type Store } from '../types';
|
|
3
|
-
import { type ReactionUpdateSuccess } from '../types/reaction';
|
|
4
|
-
import type { WithSamplingUFOExperience } from '@atlaskit/emoji';
|
|
5
|
-
import type { ConcurrentExperience } from '@atlaskit/ufo';
|
|
6
|
-
/**
|
|
7
|
-
* Set of all available UFO experiences relating to reaction element
|
|
8
|
-
*/
|
|
9
|
-
export declare const ufoExperiences: {
|
|
10
|
-
/**
|
|
11
|
-
* Experience when a reaction emoji gets added
|
|
12
|
-
*/
|
|
13
|
-
add: ConcurrentExperience;
|
|
14
|
-
/**
|
|
15
|
-
* Experience when a reaction emoji gets removed/decrement
|
|
16
|
-
*/
|
|
17
|
-
remove: ConcurrentExperience;
|
|
18
|
-
/**
|
|
19
|
-
* Experience when the list of reactions gets rendered with sampling
|
|
20
|
-
*/
|
|
21
|
-
render: (instanceId: string) => WithSamplingUFOExperience;
|
|
22
|
-
/**
|
|
23
|
-
* Experience when a reaction details gets fetched
|
|
24
|
-
*/
|
|
25
|
-
fetchDetails: ConcurrentExperience;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Optional metadata information in the store used in sending the API client requests
|
|
29
|
-
*/
|
|
30
|
-
interface StoreMetadata {
|
|
31
|
-
[k: string]: any;
|
|
32
|
-
subproduct?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare class MemoryReactionsStore implements Store {
|
|
35
|
-
private client;
|
|
36
|
-
private state;
|
|
37
|
-
private metadata;
|
|
38
|
-
private callbacks;
|
|
39
|
-
private createAnalyticsEvent?;
|
|
40
|
-
/**
|
|
41
|
-
* default initial store data
|
|
42
|
-
*/
|
|
43
|
-
private initialState;
|
|
44
|
-
constructor(client: Client, state?: State, metadata?: StoreMetadata);
|
|
45
|
-
/**
|
|
46
|
-
* Update the store state data with a new data
|
|
47
|
-
* @param newState new store data
|
|
48
|
-
*/
|
|
49
|
-
private setState;
|
|
50
|
-
/**
|
|
51
|
-
* Calls any onChange callbacks in the store using latest state data.
|
|
52
|
-
*/
|
|
53
|
-
private triggerOnChange;
|
|
54
|
-
private setReactions;
|
|
55
|
-
private getReactionsState;
|
|
56
|
-
private handleDetailedReactionResponse;
|
|
57
|
-
private setFlash;
|
|
58
|
-
private flash;
|
|
59
|
-
private setParticleEffectForEmoji;
|
|
60
|
-
private displayParticleEffect;
|
|
61
|
-
private optmisticUpdate;
|
|
62
|
-
/**
|
|
63
|
-
* Utility function to help execute a callback to Reaction if its state is ready.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @param containerAri
|
|
67
|
-
* @param ari
|
|
68
|
-
*
|
|
69
|
-
* @returns (updater: Updater<ReactionsReadyState>) => ReactionsState?
|
|
70
|
-
* A function that will execute the received callback with the ReactionsState if
|
|
71
|
-
* ready. If some state is returned, the new state will be applied.
|
|
72
|
-
*/
|
|
73
|
-
private withReadyReaction;
|
|
74
|
-
/**
|
|
75
|
-
* Utility function to help execute actions with a reaction. It handles reaction discovery
|
|
76
|
-
* and branching between reacted and not reacted.
|
|
77
|
-
*
|
|
78
|
-
* @param reactedCallback callback that will be executed when the user has already reacted
|
|
79
|
-
* with the emoji
|
|
80
|
-
* @param notReactedCallback callback that will be executed when the user hasn't reacted
|
|
81
|
-
* with the emoji
|
|
82
|
-
*
|
|
83
|
-
* @returns (containerAri: string, ari: string, emojiId: string) => ReactionsState?
|
|
84
|
-
* A function that will execute the correct callback to the triple containerAri, ari and
|
|
85
|
-
* emojiId. If some state is returned, the new state will be applied.
|
|
86
|
-
*/
|
|
87
|
-
private withReaction;
|
|
88
|
-
private doAddReaction;
|
|
89
|
-
private doRemoveReaction;
|
|
90
|
-
setCreateAnalyticsEvent: (createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
91
|
-
getReactions: (key: string, ...args: string[]) => void;
|
|
92
|
-
toggleReaction: (containerAri: string, ari: string, emojiId: string, onSuccess?: ReactionUpdateSuccess) => void;
|
|
93
|
-
addReaction: (containerAri: string, ari: string, emojiId: string, onSuccess?: ReactionUpdateSuccess) => void;
|
|
94
|
-
getDetailedReaction: (containerAri: string, ari: string, emojiId: string) => void;
|
|
95
|
-
getState: () => State;
|
|
96
|
-
onChange: (callback: OnChangeCallback) => void;
|
|
97
|
-
removeOnChangeListener: (toRemove: OnChangeCallback) => void;
|
|
98
|
-
}
|
|
99
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Actions, type State, type StorePropInput, type Store } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Props type for the ReactionConsumer class component
|
|
5
|
-
*/
|
|
6
|
-
export type ReactioConsumerProps<PropsFromState, PropsFromActions> = {
|
|
7
|
-
/**
|
|
8
|
-
* Component to render
|
|
9
|
-
*/
|
|
10
|
-
children: (props: PropsFromState & PropsFromActions) => React.ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Specify which actions the child component might need to dispatch from its props
|
|
13
|
-
*/
|
|
14
|
-
mapActionsToProps?: (actions: Actions) => PropsFromActions;
|
|
15
|
-
/**
|
|
16
|
-
* Return a plain object containing the data that the connected component needs
|
|
17
|
-
*/
|
|
18
|
-
mapStateToProps?: (state: State) => PropsFromState;
|
|
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 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 { type Updater, type ReactionsReadyState, type ReactionSummary } from '../types';
|
|
2
|
-
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[]) => ReactionSummarySortFunction;
|
|
9
|
-
export declare const flattenAris: (a: string[], b: string[]) => string[];
|
|
10
|
-
export declare function isRealErrorFromService(errorCode?: number): boolean;
|
|
11
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type ReactionUpdateSuccess } from './reaction';
|
|
2
|
-
/**
|
|
3
|
-
* Event callback by the client to the API
|
|
4
|
-
* @param containerAri the container for reactions/ari in the page (attached to the "quickReactionEmojis" prop)
|
|
5
|
-
* @param ariunique Atlassian identifier for an emoji (attached to the "quickReactionEmojis" prop)
|
|
6
|
-
* @param emojiId unique identifier guid for the emoji
|
|
7
|
-
*/
|
|
8
|
-
export type ReactionAction = (containerAri: string, ari: string, emojiId: string, onSuccess?: ReactionUpdateSuccess) => void;
|
|
9
|
-
export type Actions = {
|
|
10
|
-
/**
|
|
11
|
-
* Add a new reation api
|
|
12
|
-
*/
|
|
13
|
-
addReaction: ReactionAction;
|
|
14
|
-
/**
|
|
15
|
-
* Hover an existing reaction emoji api
|
|
16
|
-
*/
|
|
17
|
-
getDetailedReaction: ReactionAction;
|
|
18
|
-
/**
|
|
19
|
-
* Retrieve reaction collection api
|
|
20
|
-
* @param containerId the container for reactions/ari in the page
|
|
21
|
-
* @param aris collection of Asset ids in the container
|
|
22
|
-
*/
|
|
23
|
-
getReactions: (containerId: string, aris: string) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Select/deselect a rection callback
|
|
26
|
-
*/
|
|
27
|
-
toggleReaction: ReactionAction;
|
|
28
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface User {
|
|
2
|
-
accountId?: string;
|
|
3
|
-
/**
|
|
4
|
-
* name of user clicked on the reaction
|
|
5
|
-
*/
|
|
6
|
-
displayName: string;
|
|
7
|
-
/**
|
|
8
|
-
* user id in system
|
|
9
|
-
*/
|
|
10
|
-
id: string;
|
|
11
|
-
/**
|
|
12
|
-
* optional path to a user profile picture
|
|
13
|
-
*/
|
|
14
|
-
profilePicture?: ProfilePicture;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Type defining the path to a user profile picture
|
|
18
|
-
*/
|
|
19
|
-
export type ProfilePicture = {
|
|
20
|
-
path: string;
|
|
21
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type Reactions, type ReactionSummary } from './reaction';
|
|
2
|
-
export 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 request when adding a reaction to a container.
|
|
22
|
-
*/
|
|
23
|
-
addReaction: Request<ReactionSummary[]>;
|
|
24
|
-
/**
|
|
25
|
-
* Fetch request when removing a reaction from a container.
|
|
26
|
-
*/
|
|
27
|
-
deleteReaction: Request<ReactionSummary[]>;
|
|
28
|
-
/**
|
|
29
|
-
* Fetch details for a given reaction.
|
|
30
|
-
*/
|
|
31
|
-
getDetailedReaction: Request<ReactionSummary>;
|
|
32
|
-
/**
|
|
33
|
-
* fetch reactions request handler
|
|
34
|
-
* @param containerAri container wrapper id
|
|
35
|
-
* @param aris container reaction assets unique ids
|
|
36
|
-
*/
|
|
37
|
-
getReactions(containerAri: string, aris: string[]): Promise<Reactions>;
|
|
38
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
export type { ReactionAction, Actions } from './Actions';
|
|
3
|
-
export { ReactionStatus, ReactionUpdateType } from './reaction';
|
|
4
|
-
export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, ReactionFocused, QuickReactionEmojiSummary, ReactionsNotLoaded, Reactions, ReactionClick, ReactionMouseEnter, } from './reaction';
|
|
5
|
-
export type { Client, Request } from './client';
|
|
6
|
-
export type { Updater } from './Updater';
|
|
7
|
-
export type { User } from './User';
|
|
8
|
-
export type { Store, StorePropInput, State, OnChangeCallback } from './store';
|
|
9
|
-
type TriggerPosition = 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'top-end' | 'top' | 'top-start' | 'right-end' | 'right' | 'right-start';
|
|
10
|
-
type ProfileCardWrapperProps = {
|
|
11
|
-
ariaLabel?: string;
|
|
12
|
-
canViewProfile?: boolean;
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
disabledAriaAttributes?: boolean;
|
|
15
|
-
fullName?: string;
|
|
16
|
-
isAnonymous?: boolean;
|
|
17
|
-
offset?: [
|
|
18
|
-
number,
|
|
19
|
-
number
|
|
20
|
-
];
|
|
21
|
-
onVisibilityChange?: (isVisible: boolean) => void;
|
|
22
|
-
position?: TriggerPosition;
|
|
23
|
-
userId?: string | null;
|
|
24
|
-
};
|
|
25
|
-
export type ProfileCardWrapper = React.ComponentType<ProfileCardWrapperProps>;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { type User } from './User';
|
|
2
|
-
/**
|
|
3
|
-
* Collection of reactions as object (key is unique id from containerAri and ari combined)
|
|
4
|
-
*/
|
|
5
|
-
export type Reactions = Record<string, ReactionSummary[]>;
|
|
6
|
-
/**
|
|
7
|
-
* MetaData for Reaction object
|
|
8
|
-
*/
|
|
9
|
-
export interface ReactionSummary {
|
|
10
|
-
/**
|
|
11
|
-
* Reaction Asset id in the container
|
|
12
|
-
*/
|
|
13
|
-
ari: string;
|
|
14
|
-
/**
|
|
15
|
-
* the container for reactions/ari in the page
|
|
16
|
-
*/
|
|
17
|
-
containerAri: string;
|
|
18
|
-
/**
|
|
19
|
-
* Number of selected count for the emoji
|
|
20
|
-
*/
|
|
21
|
-
count: number;
|
|
22
|
-
/**
|
|
23
|
-
* unique Atlassian identifier for an emoji
|
|
24
|
-
*/
|
|
25
|
-
emojiId: string;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated Legacy content Not in use anymore
|
|
28
|
-
*/
|
|
29
|
-
optimisticallyUpdated?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Has the current user selected the emoji or not
|
|
32
|
-
*/
|
|
33
|
-
reacted: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Users collection
|
|
36
|
-
*/
|
|
37
|
-
users?: User[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Metadata for composing a summary of emojis that will be shown in the the primary view even if the reaction count is zero
|
|
41
|
-
*/
|
|
42
|
-
export interface QuickReactionEmojiSummary {
|
|
43
|
-
/**
|
|
44
|
-
* unique Atlassian identifier for an emoji (attached to the "emojiIds" when forming {@link ReactionSummary} object)
|
|
45
|
-
*/
|
|
46
|
-
ari: string;
|
|
47
|
-
/**
|
|
48
|
-
* unique Atlassian identifier for the container grouping reactions/ari in the page (attached to the "emojiIds" when forming {@link ReactionSummary} object)
|
|
49
|
-
*/
|
|
50
|
-
containerAri: string;
|
|
51
|
-
/**
|
|
52
|
-
* emoji ids collection that will be shown in the the primary view even if the reaction count is zero
|
|
53
|
-
*/
|
|
54
|
-
emojiIds: string[];
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Event handler for when the user clicks on the reaction
|
|
58
|
-
* @param id give id for the emoji
|
|
59
|
-
* @param event selected mouse event proerties
|
|
60
|
-
*/
|
|
61
|
-
export type ReactionClick = (id: string, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Event handler for when the user hovers with the mouse on the reaction
|
|
64
|
-
* @param emojiId id of emoji
|
|
65
|
-
* @param event (Optional) custom DOM event handler callback
|
|
66
|
-
*/
|
|
67
|
-
export type ReactionMouseEnter = (emojiId: string, event?: React.MouseEvent<any>) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Event handler for when the user focused on the reaction
|
|
70
|
-
* @param emojiId id of emoji
|
|
71
|
-
* @param event (Optional) custom DOM event handler callback
|
|
72
|
-
*/
|
|
73
|
-
export type ReactionFocused = (emojiId: string, event?: React.FocusEvent<any>) => void;
|
|
74
|
-
export declare enum ReactionUpdateType {
|
|
75
|
-
added = "added",
|
|
76
|
-
removed = "removed"
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Event handler that is invoked when a reaction update is successful.
|
|
80
|
-
*
|
|
81
|
-
* @param {ReactionUpdateType} action - The action performed on the reaction.
|
|
82
|
-
* @param ari - The ARI (Atlassian Resource Identifier) of the entity.
|
|
83
|
-
* @param emojiId - The ID of the emoji used in the reaction.
|
|
84
|
-
*/
|
|
85
|
-
export type ReactionUpdateSuccess = (action: ReactionUpdateType, ari: string, emojiId: string, count: number) => void;
|
|
86
|
-
/**
|
|
87
|
-
* Condition of the reaction when gets loaded from the store
|
|
88
|
-
*/
|
|
89
|
-
export declare enum ReactionStatus {
|
|
90
|
-
ready = "READY",
|
|
91
|
-
loading = "LOADING",
|
|
92
|
-
error = "ERROR",
|
|
93
|
-
notLoaded = "NOT_LOADED",
|
|
94
|
-
disabled = "DISABLED"
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* state in which the reaction is at
|
|
98
|
-
*/
|
|
99
|
-
export type ReactionsState = ReactionsNotLoaded | ReactionsLoading | ReactionsReadyState | ReactionsError;
|
|
100
|
-
export type ReactionsReadyState = {
|
|
101
|
-
readonly reactions: ReactionSummary[];
|
|
102
|
-
readonly status: ReactionStatus.ready;
|
|
103
|
-
};
|
|
104
|
-
export type ReactionsLoading = {
|
|
105
|
-
readonly status: ReactionStatus.loading;
|
|
106
|
-
};
|
|
107
|
-
export type ReactionsError = {
|
|
108
|
-
readonly message: string;
|
|
109
|
-
readonly status: ReactionStatus.error;
|
|
110
|
-
};
|
|
111
|
-
export type ReactionsNotLoaded = {
|
|
112
|
-
readonly status: ReactionStatus.notLoaded;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Source where the emoji selected from ("quickSelector" -> default list, "emojiPicker" -> custom emoji list)
|
|
116
|
-
*/
|
|
117
|
-
export type ReactionSource = 'quickSelector' | 'emojiPicker';
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { type Actions } from './Actions';
|
|
3
|
-
import { type ReactionsState } from './reaction';
|
|
4
|
-
/**
|
|
5
|
-
* Callback event when changes apply to the main store
|
|
6
|
-
* @param state latest store state
|
|
7
|
-
*/
|
|
8
|
-
export 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 type StorePropInput = Store | Promise<Store>;
|
|
45
|
-
/**
|
|
46
|
-
* store main structure
|
|
47
|
-
*/
|
|
48
|
-
export type State = {
|
|
49
|
-
/**
|
|
50
|
-
* custom animation for given emojis as true|false (key => unique reaction id, value => collection of emojiIds and true|false to apply custom animation)
|
|
51
|
-
*/
|
|
52
|
-
flash: {
|
|
53
|
-
[key: string]: {
|
|
54
|
-
[emojiId: string]: boolean;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* floating reactions for given emojis as true|false (key => unique id, value => collection of emojiIds and true|false to apply floating animation)
|
|
59
|
-
*/
|
|
60
|
-
particleEffectByEmoji: {
|
|
61
|
-
[key: string]: {
|
|
62
|
-
[emojiId: string]: boolean;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* collection of the different reactions (key => unique reaction id , value => state of the reaction)
|
|
67
|
-
*/
|
|
68
|
-
reactions: {
|
|
69
|
-
[key: string]: ReactionsState;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ConcurrentExperience, UFOExperience } from '@atlaskit/ufo';
|
|
2
|
-
import { type WithSamplingUFOExperience } from '@atlaskit/emoji';
|
|
3
|
-
/**
|
|
4
|
-
* Types of experiences
|
|
5
|
-
*/
|
|
6
|
-
export declare enum ExperienceName {
|
|
7
|
-
REACTIONS_RENDERED = "reactions-rendered",
|
|
8
|
-
PICKER_OPENED = "reactions-picker-opened",
|
|
9
|
-
REACTION_ADDED = "reaction-added",
|
|
10
|
-
REACTION_REMOVED = "reaction-removed",
|
|
11
|
-
REACTION_DETAILS_FETCHED = "reaction-details-fetched",
|
|
12
|
-
REACTION_DIALOG_OPENED = "reaction-dialog-opened",
|
|
13
|
-
REACTION_DIALOG_CLOSED = "reaction-dialog-closed",
|
|
14
|
-
REACTION_DIALOG_SELECTED_REACTION_CHANGED = "reaction-dialog-selected-reaction-changed",
|
|
15
|
-
REACTION_DIALOG_PAGE_NAVIGATION = "reaction-dialog-page-navigation"
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* UFO types of components been instrumented
|
|
19
|
-
*/
|
|
20
|
-
export declare enum ComponentName {
|
|
21
|
-
PICKER_RENDERED = "reactions-picker",
|
|
22
|
-
REACTIONS = "reactions-list",
|
|
23
|
-
REACTION_ITEM = "reaction-item",
|
|
24
|
-
REACTION_DIALOG = "reaction-dialog"
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Experience when the emoji picker is opened
|
|
28
|
-
*/
|
|
29
|
-
export declare const PickerRender: UFOExperience;
|
|
30
|
-
/**
|
|
31
|
-
* Experience when the list of reactions gets rendered
|
|
32
|
-
*/
|
|
33
|
-
export declare const ReactionsRendered: ConcurrentExperience;
|
|
34
|
-
/**
|
|
35
|
-
* Experience when a reaction emoji gets added
|
|
36
|
-
*/
|
|
37
|
-
export declare const ReactionsAdd: ConcurrentExperience;
|
|
38
|
-
/**
|
|
39
|
-
* Expeirence when a reaction dialog is opened
|
|
40
|
-
*/
|
|
41
|
-
export declare const ReactionDialogOpened: UFOExperience;
|
|
42
|
-
/**
|
|
43
|
-
* Experience when a reaction changed/fetched from inside the modal dialog
|
|
44
|
-
*/
|
|
45
|
-
export declare const ReactionDialogSelectedReactionChanged: UFOExperience;
|
|
46
|
-
/**
|
|
47
|
-
* Experience when a reaction details gets fetched
|
|
48
|
-
*/
|
|
49
|
-
export declare const ReactionDetailsFetch: ConcurrentExperience;
|
|
50
|
-
/**
|
|
51
|
-
* Experience when a reaction emoji gets removed/decrement
|
|
52
|
-
*/
|
|
53
|
-
export declare const ReactionsRemove: ConcurrentExperience;
|
|
54
|
-
export declare const sampledReactionsRendered: (instanceId: string) => WithSamplingUFOExperience;
|