@atlaskit/reactions 21.5.1 → 21.6.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.
Files changed (406) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/MockReactionsClient/package.json +14 -0
  3. package/dist/cjs/{client/MockReactionsClient.js → MockReactionsClient.js} +4 -6
  4. package/dist/cjs/analytics/analytics.js +141 -0
  5. package/dist/cjs/analytics/index.js +4 -134
  6. package/dist/cjs/client/ReactionServiceClient.js +29 -6
  7. package/dist/cjs/client/index.js +1 -33
  8. package/dist/cjs/components/{Counter.js → Counter/Counter.js} +32 -39
  9. package/dist/cjs/components/Counter/index.js +36 -0
  10. package/dist/cjs/components/Counter/styles.js +33 -0
  11. package/dist/cjs/components/EmojiButton/EmojiButton.js +58 -0
  12. package/dist/cjs/components/EmojiButton/index.js +19 -0
  13. package/dist/cjs/components/EmojiButton/styles.js +25 -0
  14. package/dist/cjs/components/FlashAnimation/FlashAnimation.js +42 -0
  15. package/dist/cjs/components/FlashAnimation/index.js +19 -0
  16. package/dist/cjs/components/{FlashAnimation.js → FlashAnimation/styles.js} +7 -26
  17. package/dist/cjs/components/Reaction/Reaction.js +163 -0
  18. package/dist/cjs/components/Reaction/index.js +19 -0
  19. package/dist/cjs/components/Reaction/styles.js +70 -0
  20. package/dist/cjs/components/ReactionPicker/ReactionPicker.js +272 -0
  21. package/dist/cjs/components/ReactionPicker/index.js +19 -0
  22. package/dist/cjs/components/ReactionPicker/styles.js +37 -0
  23. package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +71 -0
  24. package/dist/cjs/components/ReactionTooltip/index.js +19 -0
  25. package/dist/cjs/components/ReactionTooltip/styles.js +46 -0
  26. package/dist/cjs/components/Reactions/Reactions.js +200 -0
  27. package/dist/cjs/components/Reactions/index.js +25 -0
  28. package/dist/cjs/components/Reactions/styles.js +29 -0
  29. package/dist/cjs/components/Selector/Selector.js +132 -0
  30. package/dist/cjs/components/Selector/index.js +30 -0
  31. package/dist/cjs/components/Selector/styles.js +56 -0
  32. package/dist/cjs/components/ShowMore/ShowMore.js +71 -0
  33. package/dist/cjs/components/ShowMore/index.js +19 -0
  34. package/dist/cjs/components/ShowMore/styles.js +44 -0
  35. package/dist/cjs/components/Trigger/Trigger.js +59 -0
  36. package/dist/cjs/components/Trigger/index.js +13 -0
  37. package/dist/cjs/components/Trigger/styles.js +46 -0
  38. package/dist/cjs/components/{UfoErrorBoundary.js → UfoErrorBoundary/UfoErrorBoundary.js} +3 -0
  39. package/dist/cjs/components/UfoErrorBoundary/index.js +13 -0
  40. package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +62 -0
  41. package/dist/cjs/containers/ConnectedReactionPicker/index.js +13 -0
  42. package/dist/cjs/containers/ConnectedReactionsView/ConnectedReactionsView.js +258 -0
  43. package/dist/cjs/containers/ConnectedReactionsView/index.js +13 -0
  44. package/dist/cjs/containers/index.js +23 -13
  45. package/dist/cjs/hooks/index.js +13 -0
  46. package/dist/cjs/hooks/useClickAway.js +35 -0
  47. package/dist/cjs/index.js +8 -0
  48. package/dist/cjs/shared/constants.js +39 -8
  49. package/dist/cjs/{components → shared}/i18n.js +1 -1
  50. package/dist/cjs/shared/index.js +11 -3
  51. package/dist/cjs/shared/utils.js +54 -0
  52. package/dist/cjs/store/{ReactionsStore.js → MemoryReactionsStore.js} +37 -18
  53. package/dist/cjs/store/ReactionConsumer.js +43 -15
  54. package/dist/cjs/store/index.js +8 -2
  55. package/dist/cjs/store/utils.js +4 -10
  56. package/dist/cjs/{client/ReactionClient.js → types/client.js} +0 -0
  57. package/dist/cjs/types/index.js +2 -2
  58. package/dist/cjs/types/reaction.js +43 -0
  59. package/dist/cjs/types/{DetailedReaction.js → store.js} +0 -0
  60. package/dist/cjs/version.json +1 -1
  61. package/dist/es2019/{client/MockReactionsClient.js → MockReactionsClient.js} +4 -5
  62. package/dist/es2019/analytics/analytics.js +64 -0
  63. package/dist/es2019/analytics/index.js +3 -65
  64. package/dist/es2019/analytics/ufo.js +0 -1
  65. package/dist/es2019/client/ReactionServiceClient.js +31 -6
  66. package/dist/es2019/client/index.js +1 -2
  67. package/dist/es2019/components/{Counter.js → Counter/Counter.js} +26 -31
  68. package/dist/es2019/components/Counter/index.js +3 -0
  69. package/dist/es2019/components/Counter/styles.js +20 -0
  70. package/dist/es2019/components/EmojiButton/EmojiButton.js +35 -0
  71. package/dist/es2019/components/EmojiButton/index.js +1 -0
  72. package/dist/es2019/components/EmojiButton/styles.js +16 -0
  73. package/dist/es2019/components/FlashAnimation/FlashAnimation.js +18 -0
  74. package/dist/es2019/components/FlashAnimation/index.js +1 -0
  75. package/dist/es2019/components/{FlashAnimation.js → FlashAnimation/styles.js} +6 -17
  76. package/dist/es2019/components/Reaction/Reaction.js +104 -0
  77. package/dist/es2019/components/Reaction/index.js +1 -0
  78. package/dist/es2019/components/Reaction/styles.js +55 -0
  79. package/dist/es2019/components/ReactionPicker/ReactionPicker.js +208 -0
  80. package/dist/es2019/components/ReactionPicker/index.js +1 -0
  81. package/dist/es2019/components/ReactionPicker/styles.js +23 -0
  82. package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +46 -0
  83. package/dist/es2019/components/ReactionTooltip/index.js +1 -0
  84. package/dist/es2019/components/ReactionTooltip/styles.js +32 -0
  85. package/dist/es2019/components/Reactions/Reactions.js +156 -0
  86. package/dist/es2019/components/Reactions/index.js +1 -0
  87. package/dist/es2019/components/Reactions/styles.js +19 -0
  88. package/dist/es2019/components/Selector/Selector.js +98 -0
  89. package/dist/es2019/components/Selector/index.js +3 -0
  90. package/dist/es2019/components/Selector/styles.js +39 -0
  91. package/dist/es2019/components/ShowMore/ShowMore.js +43 -0
  92. package/dist/es2019/components/ShowMore/index.js +1 -0
  93. package/dist/es2019/components/ShowMore/styles.js +30 -0
  94. package/dist/es2019/components/{Trigger.js → Trigger/Trigger.js} +15 -20
  95. package/dist/es2019/components/Trigger/index.js +1 -0
  96. package/dist/es2019/components/Trigger/styles.js +24 -0
  97. package/dist/es2019/components/{UfoErrorBoundary.js → UfoErrorBoundary/UfoErrorBoundary.js} +4 -0
  98. package/dist/es2019/components/UfoErrorBoundary/index.js +1 -0
  99. package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +27 -0
  100. package/dist/es2019/containers/ConnectedReactionPicker/index.js +1 -0
  101. package/dist/es2019/containers/ConnectedReactionsView/ConnectedReactionsView.js +166 -0
  102. package/dist/es2019/containers/ConnectedReactionsView/index.js +1 -0
  103. package/dist/es2019/containers/index.js +2 -2
  104. package/dist/es2019/hooks/index.js +1 -0
  105. package/dist/es2019/hooks/useClickAway.js +27 -0
  106. package/dist/es2019/index.js +3 -1
  107. package/dist/es2019/shared/constants.js +32 -4
  108. package/dist/es2019/{components → shared}/i18n.js +1 -1
  109. package/dist/es2019/shared/index.js +6 -2
  110. package/dist/es2019/shared/utils.js +35 -0
  111. package/dist/es2019/store/{ReactionsStore.js → MemoryReactionsStore.js} +36 -17
  112. package/dist/es2019/store/ReactionConsumer.js +18 -12
  113. package/dist/es2019/store/index.js +1 -1
  114. package/dist/es2019/store/utils.js +8 -4
  115. package/dist/es2019/{client/ReactionClient.js → types/client.js} +0 -0
  116. package/dist/es2019/types/index.js +1 -1
  117. package/dist/es2019/types/reaction.js +34 -0
  118. package/dist/es2019/types/{DetailedReaction.js → store.js} +0 -0
  119. package/dist/es2019/version.json +1 -1
  120. package/dist/esm/{client/MockReactionsClient.js → MockReactionsClient.js} +4 -5
  121. package/dist/esm/analytics/analytics.js +99 -0
  122. package/dist/esm/analytics/index.js +3 -99
  123. package/dist/esm/analytics/ufo.js +0 -1
  124. package/dist/esm/client/ReactionServiceClient.js +30 -6
  125. package/dist/esm/client/index.js +1 -2
  126. package/dist/esm/components/{Counter.js → Counter/Counter.js} +26 -31
  127. package/dist/esm/components/Counter/index.js +3 -0
  128. package/dist/esm/components/Counter/styles.js +20 -0
  129. package/dist/esm/components/EmojiButton/EmojiButton.js +35 -0
  130. package/dist/esm/components/EmojiButton/index.js +1 -0
  131. package/dist/esm/components/EmojiButton/styles.js +16 -0
  132. package/dist/esm/components/FlashAnimation/FlashAnimation.js +20 -0
  133. package/dist/esm/components/FlashAnimation/index.js +1 -0
  134. package/dist/esm/components/{FlashAnimation.js → FlashAnimation/styles.js} +6 -19
  135. package/dist/esm/components/Reaction/Reaction.js +131 -0
  136. package/dist/esm/components/Reaction/index.js +1 -0
  137. package/dist/esm/components/Reaction/styles.js +55 -0
  138. package/dist/esm/components/ReactionPicker/ReactionPicker.js +243 -0
  139. package/dist/esm/components/ReactionPicker/index.js +1 -0
  140. package/dist/esm/components/ReactionPicker/styles.js +23 -0
  141. package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +46 -0
  142. package/dist/esm/components/ReactionTooltip/index.js +1 -0
  143. package/dist/esm/components/ReactionTooltip/styles.js +32 -0
  144. package/dist/esm/components/Reactions/Reactions.js +166 -0
  145. package/dist/esm/components/Reactions/index.js +1 -0
  146. package/dist/esm/components/Reactions/styles.js +19 -0
  147. package/dist/esm/components/Selector/Selector.js +107 -0
  148. package/dist/esm/components/Selector/index.js +3 -0
  149. package/dist/esm/components/Selector/styles.js +41 -0
  150. package/dist/esm/components/ShowMore/ShowMore.js +46 -0
  151. package/dist/esm/components/ShowMore/index.js +1 -0
  152. package/dist/esm/components/ShowMore/styles.js +30 -0
  153. package/dist/esm/components/{Trigger.js → Trigger/Trigger.js} +15 -20
  154. package/dist/esm/components/Trigger/index.js +1 -0
  155. package/dist/esm/components/Trigger/styles.js +31 -0
  156. package/dist/esm/components/{UfoErrorBoundary.js → UfoErrorBoundary/UfoErrorBoundary.js} +4 -0
  157. package/dist/esm/components/UfoErrorBoundary/index.js +1 -0
  158. package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +46 -0
  159. package/dist/esm/containers/ConnectedReactionPicker/index.js +1 -0
  160. package/dist/esm/containers/ConnectedReactionsView/ConnectedReactionsView.js +227 -0
  161. package/dist/esm/containers/ConnectedReactionsView/index.js +1 -0
  162. package/dist/esm/containers/index.js +2 -2
  163. package/dist/esm/hooks/index.js +1 -0
  164. package/dist/esm/hooks/useClickAway.js +28 -0
  165. package/dist/esm/index.js +3 -1
  166. package/dist/esm/shared/constants.js +34 -4
  167. package/dist/esm/{components → shared}/i18n.js +1 -1
  168. package/dist/esm/shared/index.js +6 -2
  169. package/dist/esm/shared/utils.js +41 -0
  170. package/dist/esm/store/{ReactionsStore.js → MemoryReactionsStore.js} +36 -20
  171. package/dist/esm/store/ReactionConsumer.js +42 -15
  172. package/dist/esm/store/index.js +1 -1
  173. package/dist/esm/store/utils.js +8 -4
  174. package/dist/{es2019/types/ReactionSource.js → esm/types/client.js} +0 -0
  175. package/dist/esm/types/index.js +1 -1
  176. package/dist/esm/types/reaction.js +34 -0
  177. package/dist/{es2019/types/ReactionSummary.js → esm/types/store.js} +0 -0
  178. package/dist/esm/version.json +1 -1
  179. package/dist/types/MockReactionsClient.d.ts +20 -0
  180. package/dist/types/analytics/analytics.d.ts +96 -0
  181. package/dist/types/analytics/index.d.ts +1 -96
  182. package/dist/types/client/ReactionServiceClient.d.ts +27 -10
  183. package/dist/types/client/index.d.ts +0 -2
  184. package/dist/types/components/Counter/Counter.d.ts +40 -0
  185. package/dist/types/components/Counter/index.d.ts +3 -0
  186. package/dist/types/components/Counter/styles.d.ts +3 -0
  187. package/dist/types/components/EmojiButton/EmojiButton.d.ts +22 -0
  188. package/dist/types/components/EmojiButton/index.d.ts +2 -0
  189. package/dist/types/components/EmojiButton/styles.d.ts +1 -0
  190. package/dist/types/components/FlashAnimation/FlashAnimation.d.ts +20 -0
  191. package/dist/types/components/FlashAnimation/index.d.ts +2 -0
  192. package/dist/types/components/FlashAnimation/styles.d.ts +3 -0
  193. package/dist/types/components/Reaction/Reaction.d.ts +38 -0
  194. package/dist/types/components/Reaction/index.d.ts +2 -0
  195. package/dist/types/components/Reaction/styles.d.ts +10 -0
  196. package/dist/types/components/ReactionPicker/ReactionPicker.d.ts +53 -0
  197. package/dist/types/components/ReactionPicker/index.d.ts +2 -0
  198. package/dist/types/components/ReactionPicker/styles.d.ts +3 -0
  199. package/dist/types/components/ReactionTooltip/ReactionTooltip.d.ts +22 -0
  200. package/dist/types/components/ReactionTooltip/index.d.ts +2 -0
  201. package/dist/types/components/ReactionTooltip/styles.d.ts +4 -0
  202. package/dist/types/components/Reactions/Reactions.d.ts +64 -0
  203. package/dist/types/components/Reactions/index.d.ts +2 -0
  204. package/dist/types/components/Reactions/styles.d.ts +2 -0
  205. package/dist/types/components/Selector/Selector.d.ts +34 -0
  206. package/dist/types/components/Selector/index.d.ts +3 -0
  207. package/dist/types/components/Selector/styles.d.ts +10 -0
  208. package/dist/types/components/ShowMore/ShowMore.d.ts +34 -0
  209. package/dist/types/components/ShowMore/index.d.ts +2 -0
  210. package/dist/types/components/ShowMore/styles.d.ts +3 -0
  211. package/dist/types/components/Trigger/Trigger.d.ts +23 -0
  212. package/dist/types/components/Trigger/index.d.ts +2 -0
  213. package/dist/types/components/Trigger/styles.d.ts +5 -0
  214. package/dist/types/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +16 -0
  215. package/dist/types/components/UfoErrorBoundary/index.d.ts +2 -0
  216. package/dist/types/components/index.d.ts +4 -1
  217. package/dist/types/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +27 -0
  218. package/dist/types/containers/ConnectedReactionPicker/index.d.ts +2 -0
  219. package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +52 -0
  220. package/dist/types/containers/ConnectedReactionsView/index.d.ts +2 -0
  221. package/dist/types/containers/index.d.ts +2 -2
  222. package/dist/types/hooks/index.d.ts +1 -0
  223. package/dist/types/hooks/useClickAway.d.ts +8 -0
  224. package/dist/types/index.d.ts +2 -2
  225. package/dist/types/shared/constants.d.ts +13 -3
  226. package/dist/types/shared/i18n.d.ts +22 -0
  227. package/dist/types/shared/index.d.ts +3 -1
  228. package/dist/types/shared/utils.d.ts +11 -0
  229. package/dist/types/store/MemoryReactionsStore.d.ts +94 -0
  230. package/dist/types/store/ReactionConsumer.d.ts +47 -19
  231. package/dist/types/store/index.d.ts +2 -2
  232. package/dist/types/store/utils.d.ts +3 -7
  233. package/dist/types/types/Actions.d.ts +3 -0
  234. package/dist/types/types/User.d.ts +6 -0
  235. package/dist/types/types/client.d.ts +38 -0
  236. package/dist/types/types/index.d.ts +4 -6
  237. package/dist/types/types/reaction.d.ts +82 -0
  238. package/dist/types/types/store.d.ts +63 -0
  239. package/dist/{types/client → types-ts4.0}/MockReactionsClient.d.ts +4 -5
  240. package/dist/types-ts4.0/analytics/analytics.d.ts +96 -0
  241. package/dist/types-ts4.0/analytics/constants.d.ts +1 -0
  242. package/dist/types-ts4.0/analytics/index.d.ts +2 -0
  243. package/dist/types-ts4.0/analytics/ufo.d.ts +40 -0
  244. package/dist/types-ts4.0/client/ReactionServiceClient.d.ts +35 -0
  245. package/dist/types-ts4.0/client/index.d.ts +1 -0
  246. package/dist/{types/components → types-ts4.0/components/Counter}/Counter.d.ts +15 -7
  247. package/dist/types-ts4.0/components/Counter/index.d.ts +3 -0
  248. package/dist/types-ts4.0/components/Counter/styles.d.ts +3 -0
  249. package/dist/types-ts4.0/components/EmojiButton/EmojiButton.d.ts +22 -0
  250. package/dist/types-ts4.0/components/EmojiButton/index.d.ts +2 -0
  251. package/dist/types-ts4.0/components/EmojiButton/styles.d.ts +1 -0
  252. package/dist/types-ts4.0/components/FlashAnimation/FlashAnimation.d.ts +20 -0
  253. package/dist/types-ts4.0/components/FlashAnimation/index.d.ts +2 -0
  254. package/dist/types-ts4.0/components/FlashAnimation/styles.d.ts +3 -0
  255. package/dist/types-ts4.0/components/Reaction/Reaction.d.ts +38 -0
  256. package/dist/types-ts4.0/components/Reaction/index.d.ts +2 -0
  257. package/dist/types-ts4.0/components/Reaction/styles.d.ts +10 -0
  258. package/dist/{types/components → types-ts4.0/components/ReactionPicker}/ReactionPicker.d.ts +12 -33
  259. package/dist/types-ts4.0/components/ReactionPicker/index.d.ts +2 -0
  260. package/dist/types-ts4.0/components/ReactionPicker/styles.d.ts +3 -0
  261. package/dist/types-ts4.0/components/ReactionTooltip/ReactionTooltip.d.ts +22 -0
  262. package/dist/types-ts4.0/components/ReactionTooltip/index.d.ts +2 -0
  263. package/dist/types-ts4.0/components/ReactionTooltip/styles.d.ts +4 -0
  264. package/dist/types-ts4.0/components/Reactions/Reactions.d.ts +64 -0
  265. package/dist/types-ts4.0/components/Reactions/index.d.ts +2 -0
  266. package/dist/types-ts4.0/components/Reactions/styles.d.ts +2 -0
  267. package/dist/types-ts4.0/components/Selector/Selector.d.ts +34 -0
  268. package/dist/types-ts4.0/components/Selector/index.d.ts +3 -0
  269. package/dist/types-ts4.0/components/Selector/styles.d.ts +10 -0
  270. package/dist/{types/components → types-ts4.0/components/ShowMore}/ShowMore.d.ts +14 -13
  271. package/dist/types-ts4.0/components/ShowMore/index.d.ts +2 -0
  272. package/dist/types-ts4.0/components/ShowMore/styles.d.ts +3 -0
  273. package/dist/types-ts4.0/components/Trigger/Trigger.d.ts +23 -0
  274. package/dist/types-ts4.0/components/Trigger/index.d.ts +2 -0
  275. package/dist/types-ts4.0/components/Trigger/styles.d.ts +5 -0
  276. package/dist/types-ts4.0/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +16 -0
  277. package/dist/types-ts4.0/components/UfoErrorBoundary/index.d.ts +2 -0
  278. package/dist/types-ts4.0/components/index.d.ts +8 -0
  279. package/dist/types-ts4.0/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +27 -0
  280. package/dist/types-ts4.0/containers/ConnectedReactionPicker/index.d.ts +2 -0
  281. package/dist/types-ts4.0/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +52 -0
  282. package/dist/types-ts4.0/containers/ConnectedReactionsView/index.d.ts +2 -0
  283. package/dist/types-ts4.0/containers/index.d.ts +2 -0
  284. package/dist/types-ts4.0/hooks/index.d.ts +1 -0
  285. package/dist/types-ts4.0/hooks/useClickAway.d.ts +8 -0
  286. package/dist/types-ts4.0/i18n/cs.d.ts +13 -0
  287. package/dist/types-ts4.0/i18n/da.d.ts +13 -0
  288. package/dist/types-ts4.0/i18n/de.d.ts +13 -0
  289. package/dist/types-ts4.0/i18n/en.d.ts +7 -0
  290. package/dist/types-ts4.0/i18n/en_GB.d.ts +7 -0
  291. package/dist/types-ts4.0/i18n/en_ZZ.d.ts +13 -0
  292. package/dist/types-ts4.0/i18n/es.d.ts +13 -0
  293. package/dist/types-ts4.0/i18n/et.d.ts +12 -0
  294. package/dist/types-ts4.0/i18n/fi.d.ts +13 -0
  295. package/dist/types-ts4.0/i18n/fr.d.ts +13 -0
  296. package/dist/types-ts4.0/i18n/hu.d.ts +13 -0
  297. package/dist/types-ts4.0/i18n/index.d.ts +35 -0
  298. package/dist/types-ts4.0/i18n/is.d.ts +6 -0
  299. package/dist/types-ts4.0/i18n/it.d.ts +13 -0
  300. package/dist/types-ts4.0/i18n/ja.d.ts +13 -0
  301. package/dist/types-ts4.0/i18n/ko.d.ts +13 -0
  302. package/dist/types-ts4.0/i18n/languages.d.ts +27 -0
  303. package/dist/types-ts4.0/i18n/nb.d.ts +13 -0
  304. package/dist/types-ts4.0/i18n/nl.d.ts +13 -0
  305. package/dist/types-ts4.0/i18n/pl.d.ts +13 -0
  306. package/dist/types-ts4.0/i18n/pt_BR.d.ts +13 -0
  307. package/dist/types-ts4.0/i18n/pt_PT.d.ts +12 -0
  308. package/dist/types-ts4.0/i18n/ro.d.ts +6 -0
  309. package/dist/types-ts4.0/i18n/ru.d.ts +13 -0
  310. package/dist/types-ts4.0/i18n/sk.d.ts +12 -0
  311. package/dist/types-ts4.0/i18n/sv.d.ts +13 -0
  312. package/dist/types-ts4.0/i18n/th.d.ts +13 -0
  313. package/dist/types-ts4.0/i18n/tr.d.ts +13 -0
  314. package/dist/types-ts4.0/i18n/uk.d.ts +13 -0
  315. package/dist/types-ts4.0/i18n/vi.d.ts +13 -0
  316. package/dist/types-ts4.0/i18n/zh.d.ts +13 -0
  317. package/dist/types-ts4.0/i18n/zh_TW.d.ts +13 -0
  318. package/dist/types-ts4.0/index.d.ts +7 -0
  319. package/dist/types-ts4.0/shared/constants.d.ts +13 -0
  320. package/dist/{types/components → types-ts4.0/shared}/i18n.d.ts +0 -0
  321. package/dist/types-ts4.0/shared/index.d.ts +3 -0
  322. package/dist/types-ts4.0/shared/utils.d.ts +11 -0
  323. package/dist/{types/store/ReactionsStore.d.ts → types-ts4.0/store/MemoryReactionsStore.d.ts} +21 -61
  324. package/dist/types-ts4.0/store/ReactionConsumer.d.ts +57 -0
  325. package/dist/types-ts4.0/store/batched.d.ts +2 -0
  326. package/dist/types-ts4.0/store/index.d.ts +3 -0
  327. package/dist/types-ts4.0/store/utils.d.ts +11 -0
  328. package/dist/types-ts4.0/types/Actions.d.ts +27 -0
  329. package/dist/types-ts4.0/types/Updater.d.ts +1 -0
  330. package/dist/types-ts4.0/types/User.d.ts +10 -0
  331. package/dist/types-ts4.0/types/client.d.ts +38 -0
  332. package/dist/types-ts4.0/types/index.d.ts +7 -0
  333. package/dist/types-ts4.0/types/reaction.d.ts +82 -0
  334. package/dist/types-ts4.0/types/store.d.ts +63 -0
  335. package/extract-react-type/ConnectedReactionPicker.ts +2 -4
  336. package/extract-react-type/ConnectedReactionsView.ts +3 -5
  337. package/extract-react-type/Reaction.ts +2 -4
  338. package/extract-react-type/Reactions.ts +2 -4
  339. package/extract-react-type/actions.ts +1 -3
  340. package/extract-react-type/reactionClient.ts +3 -5
  341. package/extract-react-type/reactionsStore.ts +3 -5
  342. package/package.json +30 -7
  343. package/dist/cjs/components/EmojiButton.js +0 -100
  344. package/dist/cjs/components/Reaction.js +0 -229
  345. package/dist/cjs/components/ReactionPicker.js +0 -297
  346. package/dist/cjs/components/ReactionTooltip.js +0 -82
  347. package/dist/cjs/components/Reactions.js +0 -194
  348. package/dist/cjs/components/Selector.js +0 -189
  349. package/dist/cjs/components/ShowMore.js +0 -119
  350. package/dist/cjs/components/Trigger.js +0 -58
  351. package/dist/cjs/components/utils.js +0 -28
  352. package/dist/cjs/containers/ConnectedReactionPicker.js +0 -53
  353. package/dist/cjs/containers/ConnectedReactionsView.js +0 -139
  354. package/dist/cjs/types/ReactionSource.js +0 -5
  355. package/dist/cjs/types/ReactionStatus.js +0 -19
  356. package/dist/cjs/types/ReactionSummary.js +0 -5
  357. package/dist/cjs/types/Reactions.js +0 -5
  358. package/dist/cjs/types/ReactionsState.js +0 -5
  359. package/dist/es2019/components/EmojiButton.js +0 -50
  360. package/dist/es2019/components/Reaction.js +0 -183
  361. package/dist/es2019/components/ReactionPicker.js +0 -247
  362. package/dist/es2019/components/ReactionTooltip.js +0 -66
  363. package/dist/es2019/components/Reactions.js +0 -150
  364. package/dist/es2019/components/Selector.js +0 -127
  365. package/dist/es2019/components/ShowMore.js +0 -71
  366. package/dist/es2019/components/utils.js +0 -13
  367. package/dist/es2019/containers/ConnectedReactionPicker.js +0 -36
  368. package/dist/es2019/containers/ConnectedReactionsView.js +0 -118
  369. package/dist/es2019/types/ReactionStatus.js +0 -11
  370. package/dist/es2019/types/Reactions.js +0 -1
  371. package/dist/es2019/types/ReactionsState.js +0 -1
  372. package/dist/esm/client/ReactionClient.js +0 -1
  373. package/dist/esm/components/EmojiButton.js +0 -77
  374. package/dist/esm/components/Reaction.js +0 -207
  375. package/dist/esm/components/ReactionPicker.js +0 -274
  376. package/dist/esm/components/ReactionTooltip.js +0 -63
  377. package/dist/esm/components/Reactions.js +0 -180
  378. package/dist/esm/components/Selector.js +0 -160
  379. package/dist/esm/components/ShowMore.js +0 -95
  380. package/dist/esm/components/utils.js +0 -15
  381. package/dist/esm/containers/ConnectedReactionPicker.js +0 -38
  382. package/dist/esm/containers/ConnectedReactionsView.js +0 -116
  383. package/dist/esm/types/DetailedReaction.js +0 -1
  384. package/dist/esm/types/ReactionSource.js +0 -1
  385. package/dist/esm/types/ReactionStatus.js +0 -11
  386. package/dist/esm/types/ReactionSummary.js +0 -1
  387. package/dist/esm/types/Reactions.js +0 -1
  388. package/dist/esm/types/ReactionsState.js +0 -1
  389. package/dist/types/client/ReactionClient.d.ts +0 -28
  390. package/dist/types/components/EmojiButton.d.ts +0 -21
  391. package/dist/types/components/FlashAnimation.d.ts +0 -18
  392. package/dist/types/components/Reaction.d.ts +0 -44
  393. package/dist/types/components/ReactionTooltip.d.ts +0 -14
  394. package/dist/types/components/Reactions.d.ts +0 -83
  395. package/dist/types/components/Selector.d.ts +0 -39
  396. package/dist/types/components/Trigger.d.ts +0 -16
  397. package/dist/types/components/UfoErrorBoundary.d.ts +0 -9
  398. package/dist/types/components/utils.d.ts +0 -4
  399. package/dist/types/containers/ConnectedReactionPicker.d.ts +0 -16
  400. package/dist/types/containers/ConnectedReactionsView.d.ts +0 -31
  401. package/dist/types/types/DetailedReaction.d.ts +0 -7
  402. package/dist/types/types/ReactionSource.d.ts +0 -4
  403. package/dist/types/types/ReactionStatus.d.ts +0 -9
  404. package/dist/types/types/ReactionSummary.d.ts +0 -10
  405. package/dist/types/types/Reactions.d.ts +0 -4
  406. package/dist/types/types/ReactionsState.d.ts +0 -20
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ 'fabric.reactions.loading': string;
3
+ 'fabric.reactions.more.emoji': string;
4
+ 'fabric.reactions.error.unexpected': string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,7 @@
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';
@@ -0,0 +1,13 @@
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
+ * ES6 Map object from default emoji reactions (with key => shortName, value => entire emoji item)
8
+ */
9
+ export declare const DefaultReactionsByShortName: Map<string, EmojiId>;
10
+ /**
11
+ * Maximum number of users to show in the tooltip for an emoji reaction
12
+ */
13
+ export declare const TOOLTIP_USERS_LIMIT = 5;
@@ -0,0 +1,3 @@
1
+ export * as constants from './constants';
2
+ export * as utils from './utils';
3
+ export * as i18n from './i18n';
@@ -0,0 +1,11 @@
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,37 +1,5 @@
1
1
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { ReactionClient } from '../client';
3
2
  import * as Types from '../types';
4
- /**
5
- * store main structure
6
- */
7
- export declare type State = {
8
- /**
9
- * collection of the different reactions (key => unique reaction id , value => state of the reaction)
10
- */
11
- reactions: {
12
- [key: string]: Types.ReactionsState;
13
- };
14
- /**
15
- * custom animation for given emojis as true|false (key => unique reaction id, value => collection of emojiIds and true|false to apply custom animation)
16
- */
17
- flash: {
18
- [key: string]: {
19
- [emojiId: string]: boolean;
20
- };
21
- };
22
- };
23
- /**
24
- * Callback event when changes apply to the main store
25
- * @param state latest store state
26
- */
27
- export declare type OnChangeCallback = (state: State) => void;
28
- /**
29
- * Optional metadata information in the store used in sending the API client requests
30
- */
31
- export interface StoreMetadata {
32
- subproduct?: string;
33
- [k: string]: any;
34
- }
35
3
  /**
36
4
  * Set of all available UFO experiences relating to reaction element
37
5
  */
@@ -54,40 +22,31 @@ export declare const ufoExperiences: {
54
22
  fetchDetails: import("@atlaskit/ufo").ConcurrentExperience;
55
23
  };
56
24
  /**
57
- * Collection of methods to manage internal state across the different Reaction container components ConnectedReactionPicker and ConnectedReactionsView
25
+ * Optional metadata information in the store used in sending the API client requests
58
26
  */
59
- export interface ReactionsStore extends Types.Actions {
60
- /**
61
- * Get current state of the stor
62
- */
63
- getState: () => State;
64
- /**
65
- * Register a callback event on change to the store instance state data
66
- * @param callback event to register
67
- * @deprecated initially implemented by the MemoryReactionsStore and kept. This is not required by external ReactionsStore implementation
68
- */
69
- onChange: (callback: OnChangeCallback) => void;
70
- /**
71
- * Deregister any callback event on changes to the store instance state data
72
- * @param callback event to deregister
73
- * @deprecated initially implemented by the MemoryReactionsStore and kept. This is not required by external ReactionsStore implementation
74
- */
75
- removeOnChangeListener: (callback: OnChangeCallback) => void;
76
- /**
77
- * Add Atlaskit analytics events to different operations in the store
78
- * @param createAnalyticsEvent analytics event trigger
79
- * @deprecated initially implemented by the MemoryReactionsStore and kept. This is not required by external ReactionsStore implementation
80
- */
81
- setCreateAnalyticsEvent?: (createAnalyticsEvent: CreateUIAnalyticsEvent) => void;
27
+ interface StoreMetadata {
28
+ subproduct?: string;
29
+ [k: string]: any;
82
30
  }
83
- export declare class MemoryReactionsStore implements ReactionsStore {
31
+ export declare class MemoryReactionsStore implements Types.Store {
84
32
  private client;
85
33
  private state;
86
34
  private metadata;
87
35
  private callbacks;
88
36
  private createAnalyticsEvent?;
89
- constructor(client: ReactionClient, state?: State, metadata?: StoreMetadata);
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
+ */
90
46
  private setState;
47
+ /**
48
+ * Calls any onChange callbacks in the store using latest state data.
49
+ */
91
50
  private triggerOnChange;
92
51
  private setReactions;
93
52
  private getReactionsState;
@@ -128,7 +87,8 @@ export declare class MemoryReactionsStore implements ReactionsStore {
128
87
  toggleReaction: (containerAri: string, ari: string, emojiId: string) => void;
129
88
  addReaction: (containerAri: string, ari: string, emojiId: string) => void;
130
89
  getDetailedReaction: (containerAri: string, ari: string, emojiId: string) => void;
131
- getState: () => State;
132
- onChange: (callback: OnChangeCallback) => void;
133
- removeOnChangeListener: (toRemove: OnChangeCallback) => void;
90
+ getState: () => Types.State;
91
+ onChange: (callback: Types.OnChangeCallback) => void;
92
+ removeOnChangeListener: (toRemove: Types.OnChangeCallback) => void;
134
93
  }
94
+ export {};
@@ -0,0 +1,57 @@
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
+ }
@@ -0,0 +1,2 @@
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;
@@ -0,0 +1,3 @@
1
+ export { ReactionConsumer } from './ReactionConsumer';
2
+ export type { ReactioConsumerProps } from './ReactionConsumer';
3
+ export { MemoryReactionsStore, ufoExperiences } from './MemoryReactionsStore';
@@ -0,0 +1,11 @@
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 {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Event callback by the client to the API
3
+ * @param containerAri the container for reactions/ari in the page (attached to the "quickReactionEmojiIds" prop)
4
+ * @param ariunique Atlassian identifier for an emoji (attached to the "quickReactionEmojiIds" 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
+ };
@@ -0,0 +1 @@
1
+ export declare type Updater<T> = (original: T) => T | void;
@@ -0,0 +1,10 @@
1
+ export interface User {
2
+ /**
3
+ * user id in system
4
+ */
5
+ id: string;
6
+ /**
7
+ * name of user clicked on the reaction
8
+ */
9
+ displayName: string;
10
+ }
@@ -0,0 +1,38 @@
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
+ }
@@ -0,0 +1,7 @@
1
+ export type { ReactionAction, Actions } from './Actions';
2
+ export { ReactionStatus } from './reaction';
3
+ export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, 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';
@@ -0,0 +1,82 @@
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
+ * Event handler for when the user clicks on the reaction
42
+ * @param id give id for the emoji
43
+ * @param event selected mouse event proerties
44
+ */
45
+ export declare type ReactionClick = (id: string, event: React.MouseEvent<HTMLButtonElement>) => void;
46
+ /**
47
+ * Event handler for when the user hovers with the mouse on the reaction
48
+ * @param reaction reaction object
49
+ * @param event (Optional) custom DOM event handler callback
50
+ */
51
+ export declare type ReactionMouseEnter = (reaction: ReactionSummary, event?: React.MouseEvent<any>) => void;
52
+ /**
53
+ * Condition of the reaction when gets loaded from the store
54
+ */
55
+ export declare enum ReactionStatus {
56
+ ready = "READY",
57
+ loading = "LOADING",
58
+ error = "ERROR",
59
+ notLoaded = "NOT_LOADED"
60
+ }
61
+ /**
62
+ * state in which the reaction is at
63
+ */
64
+ export declare type ReactionsState = ReactionsNotLoaded | ReactionsLoading | ReactionsReadyState | ReactionsError;
65
+ export declare type ReactionsReadyState = {
66
+ readonly status: ReactionStatus.ready;
67
+ readonly reactions: ReactionSummary[];
68
+ };
69
+ export declare type ReactionsLoading = {
70
+ readonly status: ReactionStatus.loading;
71
+ };
72
+ export declare type ReactionsError = {
73
+ readonly status: ReactionStatus.error;
74
+ readonly message: string;
75
+ };
76
+ export declare type ReactionsNotLoaded = {
77
+ readonly status: ReactionStatus.notLoaded;
78
+ };
79
+ /**
80
+ * Source where the emoji selected from ("quickSelector" -> default list, "emojiPicker" -> custom emoji list)
81
+ */
82
+ export declare type ReactionSource = 'quickSelector' | 'emojiPicker';
@@ -0,0 +1,63 @@
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
+ };
@@ -1,8 +1,6 @@
1
- import type { ConnectedReactionPickerProps } from '../src/containers/ConnectedReactionPicker';
1
+ import type { ConnectedReactionPickerProps } from '../src/containers';
2
2
 
3
3
  /**
4
- * The props definition in custom-item.tsx breaks ERT unfortunately,
5
- * because we had to typecast the component to make forwardRef work with generics
6
- * (for the custom component props).
4
+ * The props definition in src/containers/ConnectedReactionPicker.tsx breaks ERT unfortunately, hence this hack (for the custom component props).
7
5
  */
8
6
  export default function (_: ConnectedReactionPickerProps) {}