@atlaskit/reactions 34.4.11 → 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.
Files changed (111) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/ConnectedReactionPicker/package.json +1 -8
  3. package/ConnectedReactionsView/package.json +1 -8
  4. package/MemoryReactionsStore/package.json +1 -8
  5. package/MockReactionsClient/package.json +1 -8
  6. package/Reaction/package.json +1 -8
  7. package/ReactionConsumer/package.json +1 -8
  8. package/ReactionPicker/package.json +1 -8
  9. package/ReactionServiceClient/package.json +1 -8
  10. package/Reactions/package.json +1 -8
  11. package/dist/cjs/analytics/index.js +1 -1
  12. package/dist/cjs/components/Selector.js +17 -6
  13. package/dist/cjs/shared/constants.js +28 -1
  14. package/dist/es2019/analytics/index.js +1 -1
  15. package/dist/es2019/components/Selector.js +15 -7
  16. package/dist/es2019/shared/constants.js +24 -0
  17. package/dist/esm/analytics/index.js +1 -1
  18. package/dist/esm/components/Selector.js +19 -8
  19. package/dist/esm/shared/constants.js +27 -0
  20. package/dist/types/MockReactionsClient.d.ts +1 -1
  21. package/dist/types/index.d.ts +1 -1
  22. package/dist/types/shared/constants.d.ts +5 -0
  23. package/package.json +2 -2
  24. package/reaction/package.json +1 -8
  25. package/store/package.json +1 -8
  26. package/types/package.json +1 -8
  27. package/useCloseManager/package.json +1 -8
  28. package/dist/types-ts4.5/MockReactionsClient.d.ts +0 -27
  29. package/dist/types-ts4.5/analytics/index.d.ts +0 -121
  30. package/dist/types-ts4.5/client/ReactionServiceClient.d.ts +0 -35
  31. package/dist/types-ts4.5/client/index.d.ts +0 -1
  32. package/dist/types-ts4.5/components/Counter.d.ts +0 -51
  33. package/dist/types-ts4.5/components/EmojiButton.d.ts +0 -24
  34. package/dist/types-ts4.5/components/FlashAnimation.d.ts +0 -23
  35. package/dist/types-ts4.5/components/Reaction.d.ts +0 -67
  36. package/dist/types-ts4.5/components/ReactionButton.d.ts +0 -22
  37. package/dist/types-ts4.5/components/ReactionParticleEffect.d.ts +0 -22
  38. package/dist/types-ts4.5/components/ReactionPicker.d.ts +0 -119
  39. package/dist/types-ts4.5/components/ReactionSummaryButton.d.ts +0 -61
  40. package/dist/types-ts4.5/components/ReactionSummaryView.d.ts +0 -81
  41. package/dist/types-ts4.5/components/ReactionTooltip.d.ts +0 -43
  42. package/dist/types-ts4.5/components/ReactionView.d.ts +0 -12
  43. package/dist/types-ts4.5/components/Reactions.d.ts +0 -206
  44. package/dist/types-ts4.5/components/ReactionsDialog.d.ts +0 -32
  45. package/dist/types-ts4.5/components/ReactionsDialogHeader.d.ts +0 -15
  46. package/dist/types-ts4.5/components/ReactionsDialogTrigger.d.ts +0 -5
  47. package/dist/types-ts4.5/components/ReactionsList.d.ts +0 -20
  48. package/dist/types-ts4.5/components/RepositionOnUpdate.d.ts +0 -13
  49. package/dist/types-ts4.5/components/Selector.d.ts +0 -36
  50. package/dist/types-ts4.5/components/ShowMore.d.ts +0 -15
  51. package/dist/types-ts4.5/components/StaticReaction.d.ts +0 -11
  52. package/dist/types-ts4.5/components/Trigger.d.ts +0 -83
  53. package/dist/types-ts4.5/components/UfoErrorBoundary.d.ts +0 -17
  54. package/dist/types-ts4.5/components/index.d.ts +0 -9
  55. package/dist/types-ts4.5/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +0 -23
  56. package/dist/types-ts4.5/containers/ConnectedReactionPicker/index.d.ts +0 -2
  57. package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +0 -56
  58. package/dist/types-ts4.5/containers/ConnectedReactionsView/index.d.ts +0 -2
  59. package/dist/types-ts4.5/containers/index.d.ts +0 -2
  60. package/dist/types-ts4.5/hooks/useCloseManager.d.ts +0 -20
  61. package/dist/types-ts4.5/hooks/useDelayedState.d.ts +0 -6
  62. package/dist/types-ts4.5/hooks/useFocusTrap.d.ts +0 -5
  63. package/dist/types-ts4.5/i18n/cs.d.ts +0 -27
  64. package/dist/types-ts4.5/i18n/da.d.ts +0 -27
  65. package/dist/types-ts4.5/i18n/de.d.ts +0 -26
  66. package/dist/types-ts4.5/i18n/en.d.ts +0 -27
  67. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -27
  68. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -27
  69. package/dist/types-ts4.5/i18n/es.d.ts +0 -27
  70. package/dist/types-ts4.5/i18n/et.d.ts +0 -11
  71. package/dist/types-ts4.5/i18n/fi.d.ts +0 -26
  72. package/dist/types-ts4.5/i18n/fr.d.ts +0 -27
  73. package/dist/types-ts4.5/i18n/hu.d.ts +0 -27
  74. package/dist/types-ts4.5/i18n/index.d.ts +0 -37
  75. package/dist/types-ts4.5/i18n/is.d.ts +0 -6
  76. package/dist/types-ts4.5/i18n/it.d.ts +0 -27
  77. package/dist/types-ts4.5/i18n/ja.d.ts +0 -27
  78. package/dist/types-ts4.5/i18n/ko.d.ts +0 -26
  79. package/dist/types-ts4.5/i18n/languages.d.ts +0 -28
  80. package/dist/types-ts4.5/i18n/nb.d.ts +0 -26
  81. package/dist/types-ts4.5/i18n/nl.d.ts +0 -27
  82. package/dist/types-ts4.5/i18n/pl.d.ts +0 -27
  83. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -27
  84. package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -11
  85. package/dist/types-ts4.5/i18n/ro.d.ts +0 -6
  86. package/dist/types-ts4.5/i18n/ru.d.ts +0 -26
  87. package/dist/types-ts4.5/i18n/sk.d.ts +0 -11
  88. package/dist/types-ts4.5/i18n/sv.d.ts +0 -27
  89. package/dist/types-ts4.5/i18n/th.d.ts +0 -27
  90. package/dist/types-ts4.5/i18n/tr.d.ts +0 -27
  91. package/dist/types-ts4.5/i18n/uk.d.ts +0 -27
  92. package/dist/types-ts4.5/i18n/vi.d.ts +0 -27
  93. package/dist/types-ts4.5/i18n/zh.d.ts +0 -27
  94. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -26
  95. package/dist/types-ts4.5/index.d.ts +0 -34
  96. package/dist/types-ts4.5/shared/constants.d.ts +0 -29
  97. package/dist/types-ts4.5/shared/i18n.d.ts +0 -87
  98. package/dist/types-ts4.5/shared/utils.d.ts +0 -18
  99. package/dist/types-ts4.5/store/MemoryReactionsStore.d.ts +0 -99
  100. package/dist/types-ts4.5/store/ReactionConsumer.d.ts +0 -57
  101. package/dist/types-ts4.5/store/batched.d.ts +0 -2
  102. package/dist/types-ts4.5/store/index.d.ts +0 -3
  103. package/dist/types-ts4.5/store/utils.d.ts +0 -11
  104. package/dist/types-ts4.5/types/Actions.d.ts +0 -28
  105. package/dist/types-ts4.5/types/Updater.d.ts +0 -2
  106. package/dist/types-ts4.5/types/User.d.ts +0 -21
  107. package/dist/types-ts4.5/types/client.d.ts +0 -38
  108. package/dist/types-ts4.5/types/index.d.ts +0 -25
  109. package/dist/types-ts4.5/types/reaction.d.ts +0 -117
  110. package/dist/types-ts4.5/types/store.d.ts +0 -71
  111. package/dist/types-ts4.5/ufo/index.d.ts +0 -54
@@ -1,27 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.reactions.add': string;
9
- 'fabric.reactions.add.new': string;
10
- 'fabric.reactions.error.unexpected': string;
11
- 'fabric.reactions.loading': string;
12
- 'fabric.reactions.more.emojis': string;
13
- 'fabric.reactions.other.reacted.users': string;
14
- 'fabric.reactions.reactwithemoji': string;
15
- 'fabric.reactions.reactwithemojiandcount': string;
16
- 'fabric.reactions.summary': string;
17
- 'reaction-picker-trigger.add.reaction.message': string;
18
- 'reactions-reaction.picker-label': string;
19
- 'reactions.dialog.close': string;
20
- 'reactions.dialog.emoji.name': string;
21
- 'reactions.dialog.left.navigate': string;
22
- 'reactions.dialog.reactions.count': string;
23
- 'reactions.dialog.right.navigate': string;
24
- 'reactions.dialog.viewall': string;
25
- 'reactions.dialog.viewall.tooltip': string;
26
- };
27
- export default _default;
@@ -1,27 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.reactions.add': string;
9
- 'fabric.reactions.add.new': string;
10
- 'fabric.reactions.error.unexpected': string;
11
- 'fabric.reactions.loading': string;
12
- 'fabric.reactions.more.emojis': string;
13
- 'fabric.reactions.other.reacted.users': string;
14
- 'fabric.reactions.reactwithemoji': string;
15
- 'fabric.reactions.reactwithemojiandcount': string;
16
- 'fabric.reactions.summary': string;
17
- 'reaction-picker-trigger.add.reaction.message': string;
18
- 'reactions-reaction.picker-label': string;
19
- 'reactions.dialog.close': string;
20
- 'reactions.dialog.emoji.name': string;
21
- 'reactions.dialog.left.navigate': string;
22
- 'reactions.dialog.reactions.count': string;
23
- 'reactions.dialog.right.navigate': string;
24
- 'reactions.dialog.viewall': string;
25
- 'reactions.dialog.viewall.tooltip': string;
26
- };
27
- export default _default;
@@ -1,27 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.reactions.add': string;
9
- 'fabric.reactions.add.new': string;
10
- 'fabric.reactions.error.unexpected': string;
11
- 'fabric.reactions.loading': string;
12
- 'fabric.reactions.more.emojis': string;
13
- 'fabric.reactions.other.reacted.users': string;
14
- 'fabric.reactions.reactwithemoji': string;
15
- 'fabric.reactions.reactwithemojiandcount': string;
16
- 'fabric.reactions.summary': string;
17
- 'reaction-picker-trigger.add.reaction.message': string;
18
- 'reactions-reaction.picker-label': string;
19
- 'reactions.dialog.close': string;
20
- 'reactions.dialog.emoji.name': string;
21
- 'reactions.dialog.left.navigate': string;
22
- 'reactions.dialog.reactions.count': string;
23
- 'reactions.dialog.right.navigate': string;
24
- 'reactions.dialog.viewall': string;
25
- 'reactions.dialog.viewall.tooltip': string;
26
- };
27
- export default _default;
@@ -1,27 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.reactions.add': string;
9
- 'fabric.reactions.add.new': string;
10
- 'fabric.reactions.error.unexpected': string;
11
- 'fabric.reactions.loading': string;
12
- 'fabric.reactions.more.emojis': string;
13
- 'fabric.reactions.other.reacted.users': string;
14
- 'fabric.reactions.reactwithemoji': string;
15
- 'fabric.reactions.reactwithemojiandcount': string;
16
- 'fabric.reactions.summary': string;
17
- 'reaction-picker-trigger.add.reaction.message': string;
18
- 'reactions-reaction.picker-label': string;
19
- 'reactions.dialog.close': string;
20
- 'reactions.dialog.emoji.name': string;
21
- 'reactions.dialog.left.navigate': string;
22
- 'reactions.dialog.reactions.count': string;
23
- 'reactions.dialog.right.navigate': string;
24
- 'reactions.dialog.viewall': string;
25
- 'reactions.dialog.viewall.tooltip': string;
26
- };
27
- export default _default;
@@ -1,27 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.reactions.add': string;
9
- 'fabric.reactions.add.new': string;
10
- 'fabric.reactions.error.unexpected': string;
11
- 'fabric.reactions.loading': string;
12
- 'fabric.reactions.more.emojis': string;
13
- 'fabric.reactions.other.reacted.users': string;
14
- 'fabric.reactions.reactwithemoji': string;
15
- 'fabric.reactions.reactwithemojiandcount': string;
16
- 'fabric.reactions.summary': string;
17
- 'reaction-picker-trigger.add.reaction.message': string;
18
- 'reactions-reaction.picker-label': string;
19
- 'reactions.dialog.close': string;
20
- 'reactions.dialog.emoji.name': string;
21
- 'reactions.dialog.left.navigate': string;
22
- 'reactions.dialog.reactions.count': string;
23
- 'reactions.dialog.right.navigate': string;
24
- 'reactions.dialog.viewall': string;
25
- 'reactions.dialog.viewall.tooltip': string;
26
- };
27
- export default _default;
@@ -1,26 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.reactions.add': string;
9
- 'fabric.reactions.add.new': string;
10
- 'fabric.reactions.error.unexpected': string;
11
- 'fabric.reactions.loading': string;
12
- 'fabric.reactions.more.emojis': string;
13
- 'fabric.reactions.other.reacted.users': string;
14
- 'fabric.reactions.reactwithemoji': string;
15
- 'fabric.reactions.reactwithemojiandcount': string;
16
- 'fabric.reactions.summary': string;
17
- 'reaction-picker-trigger.add.reaction.message': string;
18
- 'reactions-reaction.picker-label': string;
19
- 'reactions.dialog.close': string;
20
- 'reactions.dialog.left.navigate': string;
21
- 'reactions.dialog.reactions.count': string;
22
- 'reactions.dialog.right.navigate': string;
23
- 'reactions.dialog.viewall': string;
24
- 'reactions.dialog.viewall.tooltip': string;
25
- };
26
- export default _default;
@@ -1,34 +0,0 @@
1
- import { ComponentName, ExperienceName } from './ufo';
2
- import { ReactionPicker } from './components/ReactionPicker';
3
- import type { EmojiId, WithSamplingUFOExperience } from '@atlaskit/emoji';
4
- import type { UFOExperience, ConcurrentExperience } from '@atlaskit/ufo';
5
- export { ReactionServiceClient } from './client';
6
- export { Reaction } from './components/Reaction';
7
- export { ReactionPicker };
8
- export { Reactions } from './components/Reactions';
9
- export { useCloseManager } from './hooks/useCloseManager';
10
- export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
11
- export { MemoryReactionsStore, ReactionConsumer } from './store';
12
- export type { Client as ReactionClient, Request as ReactionRequest, Store as ReactionsStore, Reactions as ReactionsType, StorePropInput, State, } from './types';
13
- export { ReactionUpdateType, ReactionStatus, type ReactionSummary } from './types';
14
- export declare const constants: {
15
- DefaultReactions: EmojiId[];
16
- DefaultReactionsByShortName: Map<string, EmojiId>;
17
- ExtendedReactions: EmojiId[];
18
- ExtendedReactionsByShortName: Map<string, EmojiId>;
19
- NUMBER_OF_REACTIONS_TO_DISPLAY: number;
20
- SAMPLING_RATE_REACTIONS_RENDERED_EXP: number;
21
- TOOLTIP_USERS_LIMIT: number;
22
- };
23
- export declare const UFO: {
24
- ComponentName: typeof ComponentName;
25
- ExperienceName: typeof ExperienceName;
26
- PickerRender: UFOExperience;
27
- ReactionsAdd: ConcurrentExperience;
28
- ReactionDetailsFetch: ConcurrentExperience;
29
- ReactionDialogOpened: UFOExperience;
30
- ReactionDialogSelectedReactionChanged: UFOExperience;
31
- ReactionsRemove: ConcurrentExperience;
32
- ReactionsRendered: ConcurrentExperience;
33
- sampledReactionsRendered: (instanceId: string) => WithSamplingUFOExperience;
34
- };
@@ -1,29 +0,0 @@
1
- import { type EmojiId } from '@atlaskit/emoji/types';
2
- /**
3
- * Initial list of emoji to pick from
4
- */
5
- export declare const DefaultReactions: EmojiId[];
6
- /**
7
- * Extended list of reactions used only for examples
8
- */
9
- export declare const ExtendedReactions: EmojiId[];
10
- /**
11
- * ES6 Map object from default emoji reactions (with key => shortName, value => entire emoji item)
12
- */
13
- export declare const DefaultReactionsByShortName: Map<string, EmojiId>;
14
- /**
15
- * ES6 Map object from default emoji reactions (with key => shortName, value => entire emoji item)
16
- * Only for use in extended reaction examples
17
- */
18
- export declare const ExtendedReactionsByShortName: Map<string, EmojiId>;
19
- /**
20
- * Maximum number of users to show in the tooltip for an emoji reaction
21
- */
22
- export declare const TOOLTIP_USERS_LIMIT = 5;
23
- /**
24
- * Maximum number of reactions that will fit in the horizontal pagination of
25
- * reactions dialog
26
- */
27
- export declare const NUMBER_OF_REACTIONS_TO_DISPLAY = 8;
28
- export declare const SAMPLING_RATE_REACTIONS_RENDERED_EXP = 50;
29
- export declare const RESOURCED_EMOJI_COMPACT_HEIGHT = 16;
@@ -1,87 +0,0 @@
1
- export declare const messages: {
2
- addNewReaction: {
3
- defaultMessage: string;
4
- description: string;
5
- id: string;
6
- };
7
- addReaction: {
8
- defaultMessage: string;
9
- description: string;
10
- id: string;
11
- };
12
- closeReactionsDialog: {
13
- defaultMessage: string;
14
- description: string;
15
- id: string;
16
- };
17
- emojiName: {
18
- defaultMessage: string;
19
- description: string;
20
- id: string;
21
- };
22
- leftNavigateLabel: {
23
- defaultMessage: string;
24
- description: string;
25
- id: string;
26
- };
27
- loadingReactions: {
28
- defaultMessage: string;
29
- description: string;
30
- id: string;
31
- };
32
- moreEmoji: {
33
- defaultMessage: string;
34
- description: string;
35
- id: string;
36
- };
37
- otherUsers: {
38
- defaultMessage: string;
39
- description: string;
40
- id: string;
41
- };
42
- popperWrapperLabel: {
43
- defaultMessage: string;
44
- description: string;
45
- id: string;
46
- };
47
- reactionsCount: {
48
- defaultMessage: string;
49
- description: string;
50
- id: string;
51
- };
52
- reactWithEmoji: {
53
- defaultMessage: string;
54
- description: string;
55
- id: string;
56
- };
57
- reactWithEmojiAndCount: {
58
- defaultMessage: string;
59
- description: string;
60
- id: string;
61
- };
62
- rightNavigateLabel: {
63
- defaultMessage: string;
64
- description: string;
65
- id: string;
66
- };
67
- seeWhoReacted: {
68
- defaultMessage: string;
69
- description: string;
70
- id: string;
71
- };
72
- seeWhoReactedTooltip: {
73
- defaultMessage: string;
74
- description: string;
75
- id: string;
76
- };
77
- summary: {
78
- defaultMessage: string;
79
- description: string;
80
- id: string;
81
- };
82
- unexpectedError: {
83
- defaultMessage: string;
84
- description: string;
85
- id: string;
86
- };
87
- };
@@ -1,18 +0,0 @@
1
- import { type 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;
12
- export declare const formatStringWithDecimal: (value: string, decimalPlaces: number) => string;
13
- /**
14
- * Truncates numbers >= 1000 to shorthand representations with a maximum of one decimal point.
15
- * If the first decimal number is a zero then it's also truncated.
16
- * (Ex: 9085 will return 9K, 787555 will return 787.5M)
17
- */
18
- export declare const formatLargeNumber: (value: number) => string;
@@ -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,2 +0,0 @@
1
- export declare function batch<T>(callback: (args: T[][]) => void): (...args: T[]) => void;
2
- export declare function batchByKey<T>(callback: (key: string, args: T[][]) => void): (key: string, ...args: T[]) => void;
@@ -1,3 +0,0 @@
1
- export { ReactionConsumer } from './ReactionConsumer';
2
- export type { ReactioConsumerProps } from './ReactionConsumer';
3
- export { MemoryReactionsStore, ufoExperiences } from './MemoryReactionsStore';
@@ -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,2 +0,0 @@
1
- import { type ReactionUpdateSuccess } from './reaction';
2
- export type Updater<T> = (original: T, onSuccess?: ReactionUpdateSuccess) => T | void;
@@ -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>;