box-ui-elements 16.0.0-beta.9 → 16.0.0

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 (788) hide show
  1. package/dist/explorer.css +1 -1
  2. package/dist/explorer.js +19 -58
  3. package/dist/openwith.css +1 -1
  4. package/dist/openwith.js +10 -10
  5. package/dist/picker.css +1 -1
  6. package/dist/picker.js +12 -12
  7. package/dist/preview.css +1 -1
  8. package/dist/preview.js +17 -56
  9. package/dist/sharing.css +1 -1
  10. package/dist/sharing.js +34 -34
  11. package/dist/sidebar.css +1 -1
  12. package/dist/sidebar.js +17 -56
  13. package/dist/uploader.css +1 -1
  14. package/dist/uploader.js +12 -12
  15. package/es/api/APIFactory.js +27 -0
  16. package/es/api/APIFactory.js.flow +26 -0
  17. package/es/api/APIFactory.js.map +1 -1
  18. package/es/api/Annotations.js +84 -8
  19. package/es/api/Annotations.js.flow +60 -6
  20. package/es/api/Annotations.js.map +1 -1
  21. package/es/api/Comments.js +2 -2
  22. package/es/api/Comments.js.flow +5 -4
  23. package/es/api/Comments.js.map +1 -1
  24. package/es/api/Feed.js +578 -71
  25. package/es/api/Feed.js.flow +677 -17
  26. package/es/api/Feed.js.map +1 -1
  27. package/es/api/FileCollaborators.js +29 -0
  28. package/es/api/FileCollaborators.js.flow +30 -0
  29. package/es/api/FileCollaborators.js.map +1 -1
  30. package/es/api/ThreadedComments.js +64 -27
  31. package/es/api/ThreadedComments.js.flow +54 -29
  32. package/es/api/ThreadedComments.js.map +1 -1
  33. package/es/api/fixtures.js +381 -0
  34. package/es/api/fixtures.js.flow +401 -0
  35. package/es/api/fixtures.js.map +1 -0
  36. package/es/api/messages.js +4 -0
  37. package/es/api/messages.js.flow +5 -0
  38. package/es/api/messages.js.map +1 -1
  39. package/es/api/utils.js +33 -0
  40. package/es/api/utils.js.flow +30 -0
  41. package/es/api/utils.js.map +1 -0
  42. package/es/common/types/annotations.js.flow +18 -12
  43. package/es/common/types/feed.js +1 -1
  44. package/es/common/types/feed.js.flow +40 -4
  45. package/es/common/types/feed.js.map +1 -1
  46. package/es/components/accessible-svg/AccessibleSVG.stories.js +20 -0
  47. package/es/components/accessible-svg/AccessibleSVG.stories.js.map +1 -0
  48. package/es/components/badge/Badge.stories.js +1 -13
  49. package/es/components/badge/Badge.stories.js.map +1 -1
  50. package/es/components/badge/BetaBadge.stories.js +10 -0
  51. package/es/components/badge/BetaBadge.stories.js.map +1 -0
  52. package/es/components/badge/TrialBadge.stories.js +10 -0
  53. package/es/components/badge/TrialBadge.stories.js.map +1 -0
  54. package/es/components/badge/UpgradeBadge.stories.js +10 -0
  55. package/es/components/badge/UpgradeBadge.stories.js.map +1 -0
  56. package/es/components/breadcrumb/Breadcrumb.js +48 -35
  57. package/es/components/breadcrumb/Breadcrumb.js.flow +68 -42
  58. package/es/components/breadcrumb/Breadcrumb.js.map +1 -1
  59. package/es/components/breadcrumb/EllipsisCrumb.js +5 -3
  60. package/es/components/breadcrumb/EllipsisCrumb.js.flow +10 -6
  61. package/es/components/breadcrumb/EllipsisCrumb.js.map +1 -1
  62. package/es/components/count-badge/CountBadge.stories.js +1 -1
  63. package/es/components/count-badge/CountBadge.stories.js.map +1 -1
  64. package/es/components/draggable-list/DraggableList.stories.js +119 -5
  65. package/es/components/draggable-list/DraggableList.stories.js.map +1 -1
  66. package/es/components/dropdown-menu/DropdownMenu.js +9 -0
  67. package/es/components/dropdown-menu/DropdownMenu.js.flow +11 -0
  68. package/es/components/dropdown-menu/DropdownMenu.js.map +1 -1
  69. package/es/components/dropdown-menu/DropdownMenu.scss +3 -3
  70. package/es/components/infinite-scroll/InfiniteScroll.js +4 -2
  71. package/es/components/infinite-scroll/InfiniteScroll.js.map +1 -1
  72. package/es/components/modal/Modal.scss +5 -1
  73. package/es/components/search-form/SearchForm.js +1 -1
  74. package/es/components/search-form/SearchForm.js.flow +1 -1
  75. package/es/components/search-form/SearchForm.js.map +1 -1
  76. package/es/components/table/makeSelectable.js +304 -97
  77. package/es/components/table/makeSelectable.js.flow +299 -98
  78. package/es/components/table/makeSelectable.js.map +1 -1
  79. package/es/components/tooltip/Tooltip.js +3 -2
  80. package/es/components/tooltip/Tooltip.js.map +1 -1
  81. package/es/constants.js +11 -0
  82. package/es/constants.js.flow +11 -0
  83. package/es/constants.js.map +1 -1
  84. package/es/elements/common/annotator-context/index.js +1 -0
  85. package/es/elements/common/annotator-context/index.js.flow +4 -0
  86. package/es/elements/common/annotator-context/index.js.map +1 -1
  87. package/es/elements/common/annotator-context/types.js +12 -0
  88. package/es/elements/common/annotator-context/types.js.flow +77 -35
  89. package/es/elements/common/annotator-context/types.js.map +1 -1
  90. package/es/elements/common/annotator-context/useAnnotatorEvents.js +205 -0
  91. package/es/elements/common/annotator-context/useAnnotatorEvents.js.flow +52 -0
  92. package/es/elements/common/annotator-context/useAnnotatorEvents.js.map +1 -0
  93. package/es/elements/common/annotator-context/withAnnotations.js +224 -5
  94. package/es/elements/common/annotator-context/withAnnotations.js.flow +73 -36
  95. package/es/elements/common/annotator-context/withAnnotations.js.map +1 -1
  96. package/es/elements/common/annotator-context/withAnnotatorContext.js +12 -4
  97. package/es/elements/common/annotator-context/withAnnotatorContext.js.flow +29 -9
  98. package/es/elements/common/annotator-context/withAnnotatorContext.js.map +1 -1
  99. package/es/elements/common/current-user/index.js +3 -0
  100. package/es/elements/common/current-user/index.js.flow +8 -0
  101. package/es/elements/common/current-user/index.js.map +1 -0
  102. package/es/elements/common/current-user/withCurrentUser.js +139 -0
  103. package/es/elements/common/current-user/withCurrentUser.js.flow +40 -0
  104. package/es/elements/common/current-user/withCurrentUser.js.map +1 -0
  105. package/es/elements/common/flowTypes.js.flow +22 -4
  106. package/es/elements/common/flowTypes.js.map +1 -1
  107. package/es/elements/common/interactionTargets.js +2 -0
  108. package/es/elements/common/interactionTargets.js.flow +2 -0
  109. package/es/elements/common/interactionTargets.js.map +1 -1
  110. package/es/elements/common/logger/Logger.js +1 -1
  111. package/es/elements/common/logger/Logger.js.flow +1 -1
  112. package/es/elements/common/logger/Logger.js.map +1 -1
  113. package/es/elements/common/messages.js +4 -0
  114. package/es/elements/common/messages.js.flow +5 -0
  115. package/es/elements/common/messages.js.map +1 -1
  116. package/es/elements/content-explorer/DeleteConfirmationDialog.js +2 -1
  117. package/es/elements/content-explorer/DeleteConfirmationDialog.js.flow +3 -1
  118. package/es/elements/content-explorer/DeleteConfirmationDialog.js.map +1 -1
  119. package/es/elements/content-explorer/DeleteConfirmationDialog.scss +5 -0
  120. package/es/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js +58 -0
  121. package/es/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js.flow +60 -0
  122. package/es/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js.map +1 -0
  123. package/es/elements/content-sidebar/ActivitySidebar.js +323 -197
  124. package/es/elements/content-sidebar/ActivitySidebar.js.flow +381 -154
  125. package/es/elements/content-sidebar/ActivitySidebar.js.map +1 -1
  126. package/es/elements/content-sidebar/ActivitySidebarFilter.js +52 -0
  127. package/es/elements/content-sidebar/ActivitySidebarFilter.js.flow +59 -0
  128. package/es/elements/content-sidebar/ActivitySidebarFilter.js.map +1 -0
  129. package/es/elements/content-sidebar/ActivitySidebarFilter.scss +4 -0
  130. package/es/elements/content-sidebar/DetailsSidebar.js +50 -25
  131. package/es/elements/content-sidebar/DetailsSidebar.js.flow +32 -4
  132. package/es/elements/content-sidebar/DetailsSidebar.js.map +1 -1
  133. package/es/elements/content-sidebar/Sidebar.js +4 -1
  134. package/es/elements/content-sidebar/Sidebar.js.flow +6 -1
  135. package/es/elements/content-sidebar/Sidebar.js.map +1 -1
  136. package/es/elements/content-sidebar/SidebarContentInsights.js +45 -0
  137. package/es/elements/content-sidebar/SidebarContentInsights.js.map +1 -0
  138. package/es/elements/content-sidebar/SidebarContentInsights.scss +6 -0
  139. package/es/elements/content-sidebar/SidebarPanels.js +2 -0
  140. package/es/elements/content-sidebar/SidebarPanels.js.flow +4 -0
  141. package/es/elements/content-sidebar/SidebarPanels.js.map +1 -1
  142. package/es/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js +91 -10
  143. package/es/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js.flow +122 -24
  144. package/es/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js.map +1 -1
  145. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js +27 -15
  146. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js.flow +59 -18
  147. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js.map +1 -1
  148. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js +101 -0
  149. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js.flow +126 -0
  150. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js.map +1 -0
  151. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.scss +17 -0
  152. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js +69 -0
  153. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js.flow +85 -0
  154. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js.map +1 -0
  155. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.scss +16 -0
  156. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js +62 -0
  157. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js.flow +59 -0
  158. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js.map +1 -0
  159. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.scss +22 -0
  160. package/es/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js +2 -2
  161. package/es/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js.flow +2 -2
  162. package/es/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js.map +1 -1
  163. package/es/elements/content-sidebar/activity-feed/activity-feed/fixtures.js +55 -0
  164. package/es/elements/content-sidebar/activity-feed/activity-feed/fixtures.js.map +1 -0
  165. package/es/elements/content-sidebar/activity-feed/activity-feed/messages.js +16 -0
  166. package/es/elements/content-sidebar/activity-feed/activity-feed/messages.js.flow +20 -0
  167. package/es/elements/content-sidebar/activity-feed/activity-feed/messages.js.map +1 -1
  168. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js +121 -0
  169. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js.flow +117 -0
  170. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js.map +1 -0
  171. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.scss +7 -0
  172. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js +75 -0
  173. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js.flow +105 -0
  174. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js.map +1 -0
  175. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.scss +5 -0
  176. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js +77 -0
  177. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js.flow +86 -0
  178. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js.map +1 -0
  179. package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.scss +3 -0
  180. package/es/elements/content-sidebar/activity-feed/annotation-thread/errors.js +11 -0
  181. package/es/elements/content-sidebar/activity-feed/annotation-thread/errors.js.flow +26 -0
  182. package/es/elements/content-sidebar/activity-feed/annotation-thread/errors.js.map +1 -0
  183. package/es/elements/content-sidebar/activity-feed/annotation-thread/index.js +2 -0
  184. package/es/elements/content-sidebar/activity-feed/annotation-thread/index.js.flow +1 -0
  185. package/es/elements/content-sidebar/activity-feed/annotation-thread/index.js.map +1 -0
  186. package/es/elements/content-sidebar/activity-feed/annotation-thread/messages.js +17 -0
  187. package/es/elements/content-sidebar/activity-feed/annotation-thread/messages.js.flow +21 -0
  188. package/es/elements/content-sidebar/activity-feed/annotation-thread/messages.js.map +1 -0
  189. package/es/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js +180 -0
  190. package/es/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js.flow +203 -0
  191. package/es/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js.map +1 -0
  192. package/es/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js +124 -0
  193. package/es/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js.flow +121 -0
  194. package/es/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js.map +1 -0
  195. package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js +19 -5
  196. package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js.flow +24 -4
  197. package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js.map +1 -1
  198. package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js +25 -4
  199. package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js.flow +36 -2
  200. package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js.map +1 -1
  201. package/es/elements/content-sidebar/activity-feed/annotations/messages.js +8 -0
  202. package/es/elements/content-sidebar/activity-feed/annotations/messages.js.flow +10 -0
  203. package/es/elements/content-sidebar/activity-feed/annotations/messages.js.map +1 -1
  204. package/es/elements/content-sidebar/activity-feed/comment/Comment.js +61 -28
  205. package/es/elements/content-sidebar/activity-feed/comment/Comment.js.flow +54 -10
  206. package/es/elements/content-sidebar/activity-feed/comment/Comment.js.map +1 -1
  207. package/es/elements/content-sidebar/activity-feed/comment/messages.js +8 -0
  208. package/es/elements/content-sidebar/activity-feed/comment/messages.js.flow +10 -0
  209. package/es/elements/content-sidebar/activity-feed/comment/messages.js.map +1 -1
  210. package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js +4 -2
  211. package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js.flow +3 -1
  212. package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js.map +1 -1
  213. package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js +16 -5
  214. package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js.flow +34 -4
  215. package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js.map +1 -1
  216. package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.scss +40 -3
  217. package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js +49 -0
  218. package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js.flow +42 -0
  219. package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js.map +1 -0
  220. package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js +21 -0
  221. package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js.flow +24 -0
  222. package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js.map +1 -0
  223. package/es/elements/content-sidebar/activity-feed/common/activity-message/messages.js +12 -0
  224. package/es/elements/content-sidebar/activity-feed/common/activity-message/messages.js.flow +15 -0
  225. package/es/elements/content-sidebar/activity-feed/common/activity-message/messages.js.map +1 -1
  226. package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js +24 -0
  227. package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js.flow +30 -0
  228. package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js.map +1 -0
  229. package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.scss +6 -0
  230. package/es/elements/content-sidebar/activity-feed/common/activity-status/index.js +2 -0
  231. package/es/elements/content-sidebar/activity-feed/common/activity-status/index.js.flow +2 -0
  232. package/es/elements/content-sidebar/activity-feed/common/activity-status/index.js.map +1 -0
  233. package/es/elements/content-sidebar/activity-feed/common/activity-status/messages.js +9 -0
  234. package/es/elements/content-sidebar/activity-feed/common/activity-status/messages.js.flow +13 -0
  235. package/es/elements/content-sidebar/activity-feed/common/activity-status/messages.js.map +1 -0
  236. package/es/elements/content-sidebar/activity-feed/common/activity-timestamp/ActivityTimestamp.scss +1 -1
  237. package/es/elements/content-sidebar/fixtures.js +181 -0
  238. package/es/elements/content-sidebar/fixtures.js.flow +185 -0
  239. package/es/elements/content-sidebar/fixtures.js.map +1 -0
  240. package/es/elements/content-sidebar/flowTypes.js.flow +9 -25
  241. package/es/elements/content-sidebar/messages.js +8 -0
  242. package/es/elements/content-sidebar/messages.js.flow +10 -0
  243. package/es/elements/content-sidebar/messages.js.map +1 -1
  244. package/es/elements/content-sidebar/withErrorHandling.js.flow +1 -1
  245. package/es/elements/content-sidebar/withErrorHandling.js.map +1 -1
  246. package/es/elements/content-sidebar/withSidebarAnnotations.js +215 -30
  247. package/es/elements/content-sidebar/withSidebarAnnotations.js.flow +162 -11
  248. package/es/elements/content-sidebar/withSidebarAnnotations.js.map +1 -1
  249. package/es/elements/content-uploader/OverallUploadsProgressBar.js +10 -8
  250. package/es/elements/content-uploader/OverallUploadsProgressBar.js.flow +11 -12
  251. package/es/elements/content-uploader/OverallUploadsProgressBar.js.map +1 -1
  252. package/es/features/classification/Classification.scss +1 -1
  253. package/es/features/classification/security-controls/SecurityControlsItem.scss +1 -0
  254. package/es/features/classification/security-controls/messages.js +8 -0
  255. package/es/features/classification/security-controls/messages.js.flow +10 -0
  256. package/es/features/classification/security-controls/messages.js.map +1 -1
  257. package/es/features/classification/security-controls/utils.js +4 -7
  258. package/es/features/classification/security-controls/utils.js.flow +8 -12
  259. package/es/features/classification/security-controls/utils.js.map +1 -1
  260. package/es/features/content-explorer/content-explorer/ContentExplorer.js +6 -1
  261. package/es/features/content-explorer/content-explorer/ContentExplorer.js.flow +4 -0
  262. package/es/features/content-explorer/content-explorer/ContentExplorer.js.map +1 -1
  263. package/es/features/content-explorer/content-explorer/ContentExplorer.scss +4 -0
  264. package/es/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js +15 -9
  265. package/es/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js.flow +14 -11
  266. package/es/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js.map +1 -1
  267. package/es/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js +4 -1
  268. package/es/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js.flow +4 -1
  269. package/es/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js.map +1 -1
  270. package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js +6 -3
  271. package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js.flow +5 -1
  272. package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js.map +1 -1
  273. package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js +6 -1
  274. package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js.flow +5 -1
  275. package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js.map +1 -1
  276. package/es/features/content-explorer/prop-types.js +7 -1
  277. package/es/features/content-explorer/prop-types.js.flow +8 -0
  278. package/es/features/content-explorer/prop-types.js.map +1 -1
  279. package/es/features/content-insights/CompactCount.js +24 -0
  280. package/es/features/content-insights/CompactCount.js.map +1 -0
  281. package/es/features/content-insights/ContentAnalyticsErrorState.js +35 -0
  282. package/es/features/content-insights/ContentAnalyticsErrorState.js.map +1 -0
  283. package/es/features/content-insights/ContentAnalyticsErrorState.scss +17 -0
  284. package/es/features/content-insights/ContentInsightsSummary.js +42 -0
  285. package/es/features/content-insights/ContentInsightsSummary.js.map +1 -0
  286. package/es/features/content-insights/ContentInsightsSummary.scss +12 -0
  287. package/es/features/content-insights/ContentInsightsSummaryGhostState.js +19 -0
  288. package/es/features/content-insights/ContentInsightsSummaryGhostState.js.map +1 -0
  289. package/es/features/content-insights/ContentInsightsSummaryGhostState.scss +9 -0
  290. package/es/features/content-insights/GraphCardGhostState.js +25 -0
  291. package/es/features/content-insights/GraphCardGhostState.js.map +1 -0
  292. package/es/features/content-insights/GraphCardGhostState.scss +18 -0
  293. package/es/features/content-insights/GraphCardPreviewsSummary.js +30 -0
  294. package/es/features/content-insights/GraphCardPreviewsSummary.js.map +1 -0
  295. package/es/features/content-insights/GraphCardPreviewsSummary.scss +10 -0
  296. package/es/features/content-insights/GraphGhostState.js +21 -0
  297. package/es/features/content-insights/GraphGhostState.js.map +1 -0
  298. package/es/features/content-insights/GraphGhostState.scss +11 -0
  299. package/es/features/content-insights/HeaderWithCount.js +23 -0
  300. package/es/features/content-insights/HeaderWithCount.js.map +1 -0
  301. package/es/features/content-insights/HeaderWithCount.scss +10 -0
  302. package/es/features/content-insights/MetricSummary.js +85 -0
  303. package/es/features/content-insights/MetricSummary.js.map +1 -0
  304. package/es/features/content-insights/MetricSummary.scss +14 -0
  305. package/es/features/content-insights/OpenContentInsightsButton.js +16 -0
  306. package/es/features/content-insights/OpenContentInsightsButton.js.map +1 -0
  307. package/es/features/content-insights/TrendPill.js +61 -0
  308. package/es/features/content-insights/TrendPill.js.map +1 -0
  309. package/es/features/content-insights/TrendPill.scss +33 -0
  310. package/es/features/content-insights/_mixins.scss +7 -0
  311. package/es/features/content-insights/_variables.scss +4 -0
  312. package/es/features/content-insights/charts/bar/Bar.js +57 -0
  313. package/es/features/content-insights/charts/bar/Bar.js.map +1 -0
  314. package/es/features/content-insights/charts/bar/Bar.scss +27 -0
  315. package/es/features/content-insights/charts/bar/BarChart.js +70 -0
  316. package/es/features/content-insights/charts/bar/BarChart.js.map +1 -0
  317. package/es/features/content-insights/charts/bar/BarChart.scss +56 -0
  318. package/es/features/content-insights/charts/types.js +2 -0
  319. package/es/{common/types/threadedComments.js.map → features/content-insights/charts/types.js.map} +1 -1
  320. package/es/features/content-insights/constants.js +54 -0
  321. package/es/features/content-insights/constants.js.map +1 -0
  322. package/es/features/content-insights/messages.js +69 -0
  323. package/es/features/content-insights/messages.js.map +1 -0
  324. package/es/features/content-insights/numberUtils.js +10 -0
  325. package/es/features/content-insights/numberUtils.js.map +1 -0
  326. package/es/features/content-insights/types.js +2 -0
  327. package/es/features/content-insights/types.js.map +1 -0
  328. package/es/features/item-details/ItemProperties.scss +1 -1
  329. package/es/features/shared-link-settings-modal/SharedLinkSettingsModal.js +5 -3
  330. package/es/features/shared-link-settings-modal/SharedLinkSettingsModal.js.flow +4 -2
  331. package/es/features/shared-link-settings-modal/SharedLinkSettingsModal.js.map +1 -1
  332. package/es/features/unified-share-modal/ContactRestrictionNotice.js +34 -8
  333. package/es/features/unified-share-modal/ContactRestrictionNotice.js.flow +36 -6
  334. package/es/features/unified-share-modal/ContactRestrictionNotice.js.map +1 -1
  335. package/es/features/unified-share-modal/EmailForm.js +59 -47
  336. package/es/features/unified-share-modal/EmailForm.js.flow +31 -13
  337. package/es/features/unified-share-modal/EmailForm.js.map +1 -1
  338. package/es/features/unified-share-modal/UnifiedShareForm.js +112 -103
  339. package/es/features/unified-share-modal/UnifiedShareForm.js.flow +25 -8
  340. package/es/features/unified-share-modal/UnifiedShareForm.js.map +1 -1
  341. package/es/features/unified-share-modal/UnifiedShareModal.js +1 -0
  342. package/es/features/unified-share-modal/UnifiedShareModal.js.flow +1 -0
  343. package/es/features/unified-share-modal/UnifiedShareModal.js.map +1 -1
  344. package/es/features/unified-share-modal/flowTypes.js.flow +4 -2
  345. package/es/features/unified-share-modal/flowTypes.js.map +1 -1
  346. package/es/features/unified-share-modal/messages.js +12 -8
  347. package/es/features/unified-share-modal/messages.js.flow +14 -8
  348. package/es/features/unified-share-modal/messages.js.map +1 -1
  349. package/es/features/unified-share-modal/utils/hasRestrictedContacts.js +9 -4
  350. package/es/features/unified-share-modal/utils/hasRestrictedContacts.js.flow +10 -3
  351. package/es/features/unified-share-modal/utils/hasRestrictedContacts.js.map +1 -1
  352. package/es/features/unified-share-modal/utils/isRestrictedContact.js +15 -0
  353. package/es/features/unified-share-modal/utils/isRestrictedContact.js.flow +21 -0
  354. package/es/features/unified-share-modal/utils/isRestrictedContact.js.map +1 -0
  355. package/es/icon/fill/Alert16.js +3 -2
  356. package/es/icon/fill/Alert16.js.flow +3 -2
  357. package/es/icon/fill/Alert16.js.map +1 -1
  358. package/es/icon/fill/AlertBadge16.js +31 -0
  359. package/es/icon/fill/AlertBadge16.js.flow +29 -0
  360. package/es/icon/fill/AlertBadge16.js.map +1 -0
  361. package/es/icon/fill/AlertBadge16.stories.js +13 -0
  362. package/es/icon/fill/AlertBadge16.stories.js.map +1 -0
  363. package/es/icon/fill/Info16.js +2 -2
  364. package/es/icon/fill/Info16.js.flow +1 -1
  365. package/es/icon/fill/Info16.js.map +1 -1
  366. package/es/icon/fill/InfoBadge16.js +30 -0
  367. package/es/icon/fill/InfoBadge16.js.flow +28 -0
  368. package/es/icon/fill/InfoBadge16.js.map +1 -0
  369. package/es/icon/fill/InfoBadge16.stories.js +13 -0
  370. package/es/icon/fill/InfoBadge16.stories.js.map +1 -0
  371. package/es/icon/line/AlertBubble16.js +31 -0
  372. package/es/icon/line/AlertBubble16.js.flow +29 -0
  373. package/es/icon/line/AlertBubble16.js.map +1 -0
  374. package/es/icon/line/AlertBubble16.stories.js +13 -0
  375. package/es/icon/line/AlertBubble16.stories.js.map +1 -0
  376. package/es/icon/line/AvatarXBadge16.js +45 -0
  377. package/es/icon/line/AvatarXBadge16.js.flow +39 -0
  378. package/es/icon/line/AvatarXBadge16.js.map +1 -0
  379. package/es/icon/line/AvatarXBadge16.stories.js +13 -0
  380. package/es/icon/line/AvatarXBadge16.stories.js.map +1 -0
  381. package/es/icon/line/CoEdit16.js +32 -0
  382. package/es/icon/line/CoEdit16.js.flow +30 -0
  383. package/es/icon/line/CoEdit16.js.map +1 -0
  384. package/es/icon/line/CoEdit16.stories.js +13 -0
  385. package/es/icon/line/CoEdit16.stories.js.map +1 -0
  386. package/es/icon/line/Collaborations16.js +32 -0
  387. package/es/icon/line/Collaborations16.js.flow +30 -0
  388. package/es/icon/line/Collaborations16.js.map +1 -0
  389. package/es/icon/line/Collaborations16.stories.js +13 -0
  390. package/es/icon/line/Collaborations16.stories.js.map +1 -0
  391. package/es/icon/line/CommentBubble16.js +35 -0
  392. package/es/icon/line/CommentBubble16.js.flow +34 -0
  393. package/es/icon/line/CommentBubble16.js.map +1 -0
  394. package/es/icon/line/CommentBubble16.stories.js +13 -0
  395. package/es/icon/line/CommentBubble16.stories.js.map +1 -0
  396. package/es/src/components/accessible-svg/AccessibleSVG.stories.d.ts +7 -0
  397. package/es/src/components/badge/Badge.stories.d.ts +0 -3
  398. package/es/src/components/badge/BetaBadge.stories.d.ts +6 -0
  399. package/es/src/components/badge/TrialBadge.stories.d.ts +6 -0
  400. package/es/src/components/badge/UpgradeBadge.stories.d.ts +6 -0
  401. package/es/src/components/draggable-list/DraggableList.stories.d.ts +3 -3
  402. package/es/src/components/infinite-scroll/InfiniteScroll.d.ts +1 -1
  403. package/es/src/components/tooltip/Tooltip.d.ts +2 -0
  404. package/es/src/elements/common/annotator-context/__tests__/useAnnotatorEvents.test.d.ts +1 -0
  405. package/es/src/elements/common/annotator-context/index.d.ts +1 -0
  406. package/es/src/elements/common/annotator-context/types.d.ts +28 -6
  407. package/es/src/elements/common/annotator-context/useAnnotatorEvents.d.ts +52 -0
  408. package/es/src/elements/common/annotator-context/withAnnotations.d.ts +11 -2
  409. package/es/src/elements/common/annotator-context/withAnnotatorContext.d.ts +6 -2
  410. package/es/src/elements/common/current-user/__tests__/withCurrentUser.test.d.ts +1 -0
  411. package/es/src/elements/common/current-user/index.d.ts +2 -0
  412. package/es/src/elements/common/current-user/withCurrentUser.d.ts +20 -0
  413. package/es/src/elements/content-sidebar/SidebarContentInsights.d.ts +15 -0
  414. package/es/src/elements/content-sidebar/__tests__/SidebarContentInsights.test.d.ts +1 -0
  415. package/es/src/elements/content-sidebar/activity-feed/activity-feed/fixtures.d.ts +55 -0
  416. package/es/src/features/content-insights/CompactCount.d.ts +15 -0
  417. package/es/src/features/content-insights/ContentAnalyticsErrorState.d.ts +7 -0
  418. package/es/src/features/content-insights/ContentInsightsSummary.d.ts +12 -0
  419. package/es/src/features/content-insights/ContentInsightsSummaryGhostState.d.ts +3 -0
  420. package/es/src/features/content-insights/GraphCardGhostState.d.ts +3 -0
  421. package/es/src/features/content-insights/GraphCardPreviewsSummary.d.ts +16 -0
  422. package/es/src/features/content-insights/GraphGhostState.d.ts +3 -0
  423. package/es/src/features/content-insights/HeaderWithCount.d.ts +7 -0
  424. package/es/src/features/content-insights/MetricSummary.d.ts +18 -0
  425. package/es/src/features/content-insights/OpenContentInsightsButton.d.ts +5 -0
  426. package/es/src/features/content-insights/TrendPill.d.ts +15 -0
  427. package/es/src/features/content-insights/__tests__/CompactCount.test.d.ts +1 -0
  428. package/es/src/features/content-insights/__tests__/ContentAnalyticsErrorState.test.d.ts +1 -0
  429. package/es/src/features/content-insights/__tests__/ContentInsightsSummary.test.d.ts +1 -0
  430. package/es/src/features/content-insights/__tests__/GraphCardPreviewsSummary.test.d.ts +1 -0
  431. package/es/src/features/content-insights/__tests__/HeaderWithCount.test.d.ts +1 -0
  432. package/es/src/features/content-insights/__tests__/MetricSummary.test.d.ts +1 -0
  433. package/es/src/features/content-insights/charts/bar/Bar.d.ts +11 -0
  434. package/es/src/features/content-insights/charts/bar/BarChart.d.ts +19 -0
  435. package/es/src/features/content-insights/charts/bar/__tests__/Bar.test.d.ts +1 -0
  436. package/es/src/features/content-insights/charts/bar/__tests__/BarChart.test.d.ts +1 -0
  437. package/es/src/features/content-insights/charts/types.d.ts +2 -0
  438. package/es/src/features/content-insights/constants.d.ts +27 -0
  439. package/es/src/features/content-insights/messages.d.ts +83 -0
  440. package/es/src/features/content-insights/numberUtils.d.ts +3 -0
  441. package/es/src/features/content-insights/types.d.ts +24 -0
  442. package/es/src/icon/fill/AlertBadge16.d.ts +13 -0
  443. package/es/src/icon/fill/AlertBadge16.stories.d.ts +9 -0
  444. package/es/src/icon/fill/InfoBadge16.d.ts +13 -0
  445. package/es/src/icon/fill/InfoBadge16.stories.d.ts +9 -0
  446. package/es/src/icon/line/AlertBubble16.d.ts +13 -0
  447. package/es/src/icon/line/AlertBubble16.stories.d.ts +9 -0
  448. package/es/src/icon/line/AvatarXBadge16.d.ts +13 -0
  449. package/es/src/icon/line/AvatarXBadge16.stories.d.ts +9 -0
  450. package/es/src/icon/line/CoEdit16.d.ts +13 -0
  451. package/es/src/icon/line/CoEdit16.stories.d.ts +9 -0
  452. package/es/src/icon/line/Collaborations16.d.ts +13 -0
  453. package/es/src/icon/line/Collaborations16.stories.d.ts +9 -0
  454. package/es/src/icon/line/CommentBubble16.d.ts +13 -0
  455. package/es/src/icon/line/CommentBubble16.stories.d.ts +9 -0
  456. package/es/src/styles/variables.d.ts +3 -1
  457. package/es/styles/constants/_layout.scss +1 -1
  458. package/es/styles/constants/_media-queries.scss +2 -0
  459. package/es/styles/variables.js +6 -2
  460. package/es/styles/variables.js.flow +4 -2
  461. package/es/styles/variables.js.map +1 -1
  462. package/es/utils/error.js +5 -1
  463. package/es/utils/error.js.flow +5 -1
  464. package/es/utils/error.js.map +1 -1
  465. package/es/utils/fields.js +8 -3
  466. package/es/utils/fields.js.flow +21 -3
  467. package/es/utils/fields.js.map +1 -1
  468. package/es/utils/sorter.js.flow +2 -2
  469. package/es/utils/sorter.js.map +1 -1
  470. package/i18n/bn-IN.js +45 -7
  471. package/i18n/bn-IN.properties +83 -7
  472. package/i18n/da-DK.js +45 -7
  473. package/i18n/da-DK.properties +83 -7
  474. package/i18n/de-DE.js +45 -7
  475. package/i18n/de-DE.properties +83 -7
  476. package/i18n/en-AU.js +45 -7
  477. package/i18n/en-AU.properties +83 -7
  478. package/i18n/en-CA.js +45 -7
  479. package/i18n/en-CA.properties +83 -7
  480. package/i18n/en-GB.js +45 -7
  481. package/i18n/en-GB.properties +83 -7
  482. package/i18n/en-US.js +45 -7
  483. package/i18n/en-US.properties +83 -7
  484. package/i18n/en-x-pseudo.js +891 -854
  485. package/i18n/en-x-pseudo.properties +941 -843
  486. package/i18n/es-419.js +45 -7
  487. package/i18n/es-419.properties +83 -7
  488. package/i18n/es-ES.js +45 -7
  489. package/i18n/es-ES.properties +83 -7
  490. package/i18n/fi-FI.js +45 -7
  491. package/i18n/fi-FI.properties +83 -7
  492. package/i18n/fr-CA.js +45 -7
  493. package/i18n/fr-CA.properties +83 -7
  494. package/i18n/fr-FR.js +45 -7
  495. package/i18n/fr-FR.properties +83 -7
  496. package/i18n/hi-IN.js +45 -7
  497. package/i18n/hi-IN.properties +83 -7
  498. package/i18n/it-IT.js +45 -7
  499. package/i18n/it-IT.properties +83 -7
  500. package/i18n/ja-JP.js +47 -9
  501. package/i18n/ja-JP.properties +85 -9
  502. package/i18n/ko-KR.js +45 -7
  503. package/i18n/ko-KR.properties +83 -7
  504. package/i18n/nb-NO.js +45 -7
  505. package/i18n/nb-NO.properties +83 -7
  506. package/i18n/nl-NL.js +45 -7
  507. package/i18n/nl-NL.properties +83 -7
  508. package/i18n/pl-PL.js +45 -7
  509. package/i18n/pl-PL.properties +83 -7
  510. package/i18n/pt-BR.js +45 -7
  511. package/i18n/pt-BR.properties +83 -7
  512. package/i18n/ru-RU.js +45 -7
  513. package/i18n/ru-RU.properties +83 -7
  514. package/i18n/sv-SE.js +45 -7
  515. package/i18n/sv-SE.properties +83 -7
  516. package/i18n/tr-TR.js +45 -7
  517. package/i18n/tr-TR.properties +83 -7
  518. package/i18n/zh-CN.js +45 -7
  519. package/i18n/zh-CN.properties +83 -7
  520. package/i18n/zh-TW.js +45 -7
  521. package/i18n/zh-TW.properties +83 -7
  522. package/package.json +7 -8
  523. package/src/__mocks__/react-intl.js +4 -0
  524. package/src/api/APIFactory.js +26 -0
  525. package/src/api/Annotations.js +60 -6
  526. package/src/api/Comments.js +5 -4
  527. package/src/api/Feed.js +677 -17
  528. package/src/api/FileCollaborators.js +30 -0
  529. package/src/api/ThreadedComments.js +54 -29
  530. package/src/api/__tests__/Annotations.test.js +77 -3
  531. package/src/api/__tests__/Feed.test.js +698 -85
  532. package/src/api/__tests__/FileCollaborators.test.js +41 -0
  533. package/src/api/__tests__/ThreadedComments.test.js +47 -10
  534. package/src/api/__tests__/utils.test.js +11 -0
  535. package/src/api/fixtures.js +401 -0
  536. package/src/api/messages.js +5 -0
  537. package/src/api/utils.js +30 -0
  538. package/src/common/types/annotations.js +18 -12
  539. package/src/common/types/feed.js +40 -4
  540. package/src/components/accessible-svg/AccessibleSVG.stories.tsx +18 -0
  541. package/src/components/badge/Badge.stories.md +1 -7
  542. package/src/components/badge/Badge.stories.tsx +1 -10
  543. package/src/components/badge/BetaBadge.stories.tsx +9 -0
  544. package/src/components/badge/TrialBadge.stories.tsx +9 -0
  545. package/src/components/badge/UpgradeBadge.stories.tsx +9 -0
  546. package/src/components/breadcrumb/Breadcrumb.js +68 -42
  547. package/src/components/breadcrumb/EllipsisCrumb.js +10 -6
  548. package/src/components/count-badge/CountBadge.stories.tsx +1 -1
  549. package/src/components/draggable-list/DraggableList.stories.tsx +72 -5
  550. package/src/components/dropdown-menu/DropdownMenu.js +11 -0
  551. package/src/components/dropdown-menu/DropdownMenu.scss +3 -3
  552. package/src/components/dropdown-menu/__tests__/DropdownMenu.test.js +38 -0
  553. package/src/components/grid-view/__tests__/__snapshots__/GridViewSlider.test.js.snap +1 -0
  554. package/src/components/infinite-scroll/InfiniteScroll.md +1 -1
  555. package/src/components/infinite-scroll/InfiniteScroll.tsx +5 -2
  556. package/src/components/infinite-scroll/__tests__/InfiniteScroll.test.tsx +115 -127
  557. package/src/components/modal/Modal.scss +5 -1
  558. package/src/components/search-form/SearchForm.js +1 -1
  559. package/src/components/search-form/__tests__/SearchForm.test.js +25 -6
  560. package/src/components/sidebar-toggle-button/__tests__/__snapshots__/SidebarToggleButton.test.js.snap +4 -0
  561. package/src/components/table/__tests__/makeSelectable.test.js +654 -144
  562. package/src/components/table/makeSelectable.js +299 -98
  563. package/src/components/time/__tests__/ReadableTime.test.js +0 -1
  564. package/src/components/tooltip/Tooltip.tsx +5 -2
  565. package/src/components/tooltip/__tests__/Tooltip.test.tsx +10 -0
  566. package/src/components/tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +1 -1
  567. package/src/constants.js +11 -0
  568. package/src/elements/common/annotator-context/__tests__/useAnnotatorEvents.test.tsx +509 -0
  569. package/src/elements/common/annotator-context/__tests__/withAnnotations.test.tsx +275 -12
  570. package/src/elements/common/annotator-context/__tests__/withAnnotatorContext.test.tsx +18 -6
  571. package/src/elements/common/annotator-context/index.js.flow +4 -0
  572. package/src/elements/common/annotator-context/index.ts +1 -0
  573. package/src/elements/common/annotator-context/types.js.flow +77 -35
  574. package/src/elements/common/annotator-context/types.ts +28 -6
  575. package/src/elements/common/annotator-context/useAnnotatorEvents.js.flow +52 -0
  576. package/src/elements/common/annotator-context/useAnnotatorEvents.ts +190 -0
  577. package/src/elements/common/annotator-context/withAnnotations.js.flow +73 -36
  578. package/src/elements/common/annotator-context/withAnnotations.tsx +170 -7
  579. package/src/elements/common/annotator-context/withAnnotatorContext.js.flow +29 -9
  580. package/src/elements/common/annotator-context/withAnnotatorContext.tsx +28 -5
  581. package/src/elements/common/current-user/__tests__/withCurrentUser.test.tsx +108 -0
  582. package/src/elements/common/current-user/index.js.flow +8 -0
  583. package/src/elements/common/current-user/index.ts +2 -0
  584. package/src/elements/common/current-user/withCurrentUser.js.flow +40 -0
  585. package/src/elements/common/current-user/withCurrentUser.tsx +139 -0
  586. package/src/elements/common/flowTypes.js +22 -4
  587. package/src/elements/common/interactionTargets.js +2 -0
  588. package/src/elements/common/logger/Logger.js +1 -1
  589. package/src/elements/common/messages.js +5 -0
  590. package/src/elements/content-explorer/DeleteConfirmationDialog.js +3 -1
  591. package/src/elements/content-explorer/DeleteConfirmationDialog.scss +5 -0
  592. package/src/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js +60 -0
  593. package/src/elements/content-explorer/stories/DeleteConfirmationDialog.stories.md +1 -0
  594. package/src/elements/content-sidebar/ActivitySidebar.js +381 -154
  595. package/src/elements/content-sidebar/ActivitySidebarFilter.js +59 -0
  596. package/src/elements/content-sidebar/ActivitySidebarFilter.scss +4 -0
  597. package/src/elements/content-sidebar/DetailsSidebar.js +32 -4
  598. package/src/elements/content-sidebar/Sidebar.js +6 -1
  599. package/src/elements/content-sidebar/SidebarContentInsights.scss +6 -0
  600. package/src/elements/content-sidebar/SidebarContentInsights.tsx +57 -0
  601. package/src/elements/content-sidebar/SidebarPanels.js +4 -0
  602. package/src/elements/content-sidebar/__tests__/ActivitySidebar.test.js +533 -243
  603. package/src/elements/content-sidebar/__tests__/ActivitySidebarFilter.test.js +54 -0
  604. package/src/elements/content-sidebar/__tests__/DetailsSidebar.test.js +45 -0
  605. package/src/elements/content-sidebar/__tests__/Sidebar.test.js +1 -1
  606. package/src/elements/content-sidebar/__tests__/SidebarContentInsights.test.tsx +56 -0
  607. package/src/elements/content-sidebar/__tests__/SidebarPanels.test.js +4 -3
  608. package/src/elements/content-sidebar/__tests__/__snapshots__/ActivitySidebar.test.js.snap +29 -15
  609. package/src/elements/content-sidebar/__tests__/__snapshots__/SidebarFileProperties.test.js.snap +1 -0
  610. package/src/elements/content-sidebar/__tests__/withSidebarAnnotations.test.js +325 -32
  611. package/src/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js +122 -24
  612. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js +59 -18
  613. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js +126 -0
  614. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.scss +17 -0
  615. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js +85 -0
  616. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.scss +16 -0
  617. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js +59 -0
  618. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.scss +22 -0
  619. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActiveState.test.js +19 -5
  620. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityFeed.test.js +22 -16
  621. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityThread.test.js +80 -0
  622. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityThreadReplies.test.js +24 -0
  623. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityThreadRepliesForm.test.js +47 -0
  624. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/__snapshots__/ActiveState.test.js.snap +74 -43
  625. package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/activityFeedUtils.test.js +8 -8
  626. package/src/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js +2 -2
  627. package/src/elements/content-sidebar/activity-feed/activity-feed/fixtures.ts +56 -0
  628. package/src/elements/content-sidebar/activity-feed/activity-feed/messages.js +20 -0
  629. package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js +117 -0
  630. package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.scss +7 -0
  631. package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js +105 -0
  632. package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.scss +5 -0
  633. package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js +86 -0
  634. package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.scss +3 -0
  635. package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/AnnotationThread.test.js +28 -0
  636. package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/AnnotationThreadContent.test.js +89 -0
  637. package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/AnnotationThreadCreate.test.js +103 -0
  638. package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/useAnnotationAPI.test.js +202 -0
  639. package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/useRepliesAPI.test.js +99 -0
  640. package/src/elements/content-sidebar/activity-feed/annotation-thread/errors.js +26 -0
  641. package/src/elements/content-sidebar/activity-feed/annotation-thread/index.js +1 -0
  642. package/src/elements/content-sidebar/activity-feed/annotation-thread/messages.js +21 -0
  643. package/src/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js +203 -0
  644. package/src/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js +121 -0
  645. package/src/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js +24 -4
  646. package/src/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js +36 -2
  647. package/src/elements/content-sidebar/activity-feed/annotations/__tests__/AnnotationActivity.test.js +14 -10
  648. package/src/elements/content-sidebar/activity-feed/annotations/__tests__/AnnotationActivityMenu.test.js +35 -1
  649. package/src/elements/content-sidebar/activity-feed/annotations/messages.js +10 -0
  650. package/src/elements/content-sidebar/activity-feed/comment/Comment.js +54 -10
  651. package/src/elements/content-sidebar/activity-feed/comment/__tests__/Comment.test.js +152 -7
  652. package/src/elements/content-sidebar/activity-feed/comment/__tests__/__snapshots__/Comment.test.js.snap +12 -7
  653. package/src/elements/content-sidebar/activity-feed/comment/messages.js +10 -0
  654. package/src/elements/content-sidebar/activity-feed/comment-form/CommentForm.js +3 -1
  655. package/src/elements/content-sidebar/activity-feed/comment-form/__tests__/CommentForm.test.js +11 -0
  656. package/src/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js +34 -4
  657. package/src/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.scss +40 -3
  658. package/src/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js +42 -0
  659. package/src/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js +24 -0
  660. package/src/elements/content-sidebar/activity-feed/common/activity-message/__tests__/ActivityMessage.test.js +48 -1
  661. package/src/elements/content-sidebar/activity-feed/common/activity-message/messages.js +15 -0
  662. package/src/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js +30 -0
  663. package/src/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.scss +6 -0
  664. package/src/elements/content-sidebar/activity-feed/common/activity-status/__tests__/ActivityStatus.test.js +19 -0
  665. package/src/elements/content-sidebar/activity-feed/common/activity-status/index.js +2 -0
  666. package/src/elements/content-sidebar/activity-feed/common/activity-status/messages.js +13 -0
  667. package/src/elements/content-sidebar/activity-feed/common/activity-timestamp/ActivityTimestamp.scss +1 -1
  668. package/src/elements/content-sidebar/activity-feed/task-new/__tests__/Task.test.js +4 -3
  669. package/src/elements/content-sidebar/activity-feed/task-new/__tests__/__snapshots__/Task.test.js.snap +1 -2
  670. package/src/elements/content-sidebar/fixtures.js +185 -0
  671. package/src/elements/content-sidebar/flowTypes.js +9 -25
  672. package/src/elements/content-sidebar/messages.js +10 -0
  673. package/src/elements/content-sidebar/withErrorHandling.js +1 -1
  674. package/src/elements/content-sidebar/withSidebarAnnotations.js +162 -11
  675. package/src/elements/content-uploader/OverallUploadsProgressBar.js +11 -12
  676. package/src/features/classification/Classification.scss +1 -1
  677. package/src/features/classification/security-controls/SecurityControlsItem.scss +1 -0
  678. package/src/features/classification/security-controls/__tests__/__snapshots__/utils.test.js.snap +18 -16
  679. package/src/features/classification/security-controls/__tests__/utils.test.js +13 -5
  680. package/src/features/classification/security-controls/messages.js +10 -0
  681. package/src/features/classification/security-controls/utils.js +8 -12
  682. package/src/features/collapsible-sidebar/__tests__/__snapshots__/CollapsibleSidebarLogo.test.js.snap +2 -0
  683. package/src/features/content-explorer/content-explorer/ContentExplorer.js +4 -0
  684. package/src/features/content-explorer/content-explorer/ContentExplorer.scss +4 -0
  685. package/src/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js +14 -11
  686. package/src/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js +4 -1
  687. package/src/features/content-explorer/content-explorer/__tests__/ContentExplorerBreadcrumbs.test.js +2 -2
  688. package/src/features/content-explorer/content-explorer-modal/ContentExplorerModal.js +5 -1
  689. package/src/features/content-explorer/content-explorer-modal/__tests__/__snapshots__/ContentExplorerModal.test.js.snap +1 -0
  690. package/src/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js +5 -1
  691. package/src/features/content-explorer/prop-types.js +8 -0
  692. package/src/features/content-insights/CompactCount.tsx +23 -0
  693. package/src/features/content-insights/ContentAnalyticsErrorState.scss +17 -0
  694. package/src/features/content-insights/ContentAnalyticsErrorState.tsx +44 -0
  695. package/src/features/content-insights/ContentInsightsSummary.scss +12 -0
  696. package/src/features/content-insights/ContentInsightsSummary.tsx +45 -0
  697. package/src/features/content-insights/ContentInsightsSummaryGhostState.scss +9 -0
  698. package/src/features/content-insights/ContentInsightsSummaryGhostState.tsx +18 -0
  699. package/src/features/content-insights/GraphCardGhostState.scss +18 -0
  700. package/src/features/content-insights/GraphCardGhostState.tsx +18 -0
  701. package/src/features/content-insights/GraphCardPreviewsSummary.scss +10 -0
  702. package/src/features/content-insights/GraphCardPreviewsSummary.tsx +40 -0
  703. package/src/features/content-insights/GraphGhostState.scss +11 -0
  704. package/src/features/content-insights/GraphGhostState.tsx +17 -0
  705. package/src/features/content-insights/HeaderWithCount.scss +10 -0
  706. package/src/features/content-insights/HeaderWithCount.tsx +24 -0
  707. package/src/features/content-insights/MetricSummary.scss +14 -0
  708. package/src/features/content-insights/MetricSummary.tsx +65 -0
  709. package/src/features/content-insights/OpenContentInsightsButton.tsx +20 -0
  710. package/src/features/content-insights/TrendPill.scss +33 -0
  711. package/src/features/content-insights/TrendPill.tsx +70 -0
  712. package/src/features/content-insights/__tests__/CompactCount.test.tsx +57 -0
  713. package/src/features/content-insights/__tests__/ContentAnalyticsErrorState.test.tsx +33 -0
  714. package/src/features/content-insights/__tests__/ContentInsightsSummary.test.tsx +81 -0
  715. package/src/features/content-insights/__tests__/GraphCardPreviewsSummary.test.tsx +35 -0
  716. package/src/features/content-insights/__tests__/HeaderWithCount.test.tsx +26 -0
  717. package/src/features/content-insights/__tests__/MetricSummary.test.tsx +88 -0
  718. package/src/features/content-insights/_mixins.scss +7 -0
  719. package/src/features/content-insights/_variables.scss +4 -0
  720. package/src/features/content-insights/charts/bar/Bar.scss +27 -0
  721. package/src/features/content-insights/charts/bar/Bar.tsx +48 -0
  722. package/src/features/content-insights/charts/bar/BarChart.scss +56 -0
  723. package/src/features/content-insights/charts/bar/BarChart.tsx +78 -0
  724. package/src/features/content-insights/charts/bar/__tests__/Bar.test.tsx +74 -0
  725. package/src/features/content-insights/charts/bar/__tests__/BarChart.test.tsx +110 -0
  726. package/src/features/content-insights/charts/types.ts +3 -0
  727. package/src/features/content-insights/constants.ts +60 -0
  728. package/src/features/content-insights/messages.ts +90 -0
  729. package/src/features/content-insights/numberUtils.ts +9 -0
  730. package/src/features/content-insights/types.ts +33 -0
  731. package/src/features/item-details/ItemProperties.scss +1 -1
  732. package/src/features/shared-link-settings-modal/SharedLinkSettingsModal.js +4 -2
  733. package/src/features/shared-link-settings-modal/__tests__/SharedLinkSettingsModal.test.js +22 -3
  734. package/src/features/shared-link-settings-modal/__tests__/__snapshots__/SharedLinkSettingsModal.test.js.snap +2 -1
  735. package/src/features/unified-share-modal/ContactRestrictionNotice.js +36 -6
  736. package/src/features/unified-share-modal/EmailForm.js +31 -13
  737. package/src/features/unified-share-modal/UnifiedShareForm.js +25 -8
  738. package/src/features/unified-share-modal/UnifiedShareModal.js +1 -0
  739. package/src/features/unified-share-modal/__tests__/ContactRestrictionNotice.test.js +55 -6
  740. package/src/features/unified-share-modal/__tests__/EmailForm.test.js +131 -24
  741. package/src/features/unified-share-modal/__tests__/UnifiedShareForm.test.js +89 -35
  742. package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareForm.test.js.snap +16 -0
  743. package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareModal.test.js.snap +17 -0
  744. package/src/features/unified-share-modal/flowTypes.js +4 -2
  745. package/src/features/unified-share-modal/messages.js +14 -8
  746. package/src/features/unified-share-modal/utils/__tests__/hasRestrictedContacts.test.js +24 -10
  747. package/src/features/unified-share-modal/utils/__tests__/isRestrictedContact.test.js +33 -0
  748. package/src/features/unified-share-modal/utils/hasRestrictedContacts.js +10 -3
  749. package/src/features/unified-share-modal/utils/isRestrictedContact.js +21 -0
  750. package/src/features/virtualized-table/__tests__/__snapshots__/VirtualizedTable.test.js.snap +1 -0
  751. package/src/icon/fill/Alert16.js.flow +3 -2
  752. package/src/icon/fill/Alert16.tsx +3 -2
  753. package/src/icon/fill/AlertBadge16.js.flow +29 -0
  754. package/src/icon/fill/AlertBadge16.stories.tsx +13 -0
  755. package/src/icon/fill/AlertBadge16.tsx +27 -0
  756. package/src/icon/fill/Info16.js.flow +1 -1
  757. package/src/icon/fill/Info16.tsx +1 -1
  758. package/src/icon/fill/InfoBadge16.js.flow +28 -0
  759. package/src/icon/fill/InfoBadge16.stories.tsx +13 -0
  760. package/src/icon/fill/InfoBadge16.tsx +26 -0
  761. package/src/icon/line/AlertBubble16.js.flow +29 -0
  762. package/src/icon/line/AlertBubble16.stories.tsx +13 -0
  763. package/src/icon/line/AlertBubble16.tsx +27 -0
  764. package/src/icon/line/AvatarXBadge16.js.flow +39 -0
  765. package/src/icon/line/AvatarXBadge16.stories.tsx +13 -0
  766. package/src/icon/line/AvatarXBadge16.tsx +37 -0
  767. package/src/icon/line/CoEdit16.js.flow +30 -0
  768. package/src/icon/line/CoEdit16.stories.tsx +13 -0
  769. package/src/icon/line/CoEdit16.tsx +28 -0
  770. package/src/icon/line/Collaborations16.js.flow +30 -0
  771. package/src/icon/line/Collaborations16.stories.tsx +13 -0
  772. package/src/icon/line/Collaborations16.tsx +28 -0
  773. package/src/icon/line/CommentBubble16.js.flow +34 -0
  774. package/src/icon/line/CommentBubble16.stories.tsx +13 -0
  775. package/src/icon/line/CommentBubble16.tsx +32 -0
  776. package/src/styles/constants/_layout.scss +1 -1
  777. package/src/styles/constants/_media-queries.scss +2 -0
  778. package/src/styles/variables.js +4 -2
  779. package/src/styles/variables.json +4 -2
  780. package/src/styles/variables.ts +3 -1
  781. package/src/utils/__tests__/fields.test.js +23 -4
  782. package/src/utils/__tests__/sorter.test.js +3 -3
  783. package/src/utils/error.js +5 -1
  784. package/src/utils/fields.js +21 -3
  785. package/src/utils/sorter.js +2 -2
  786. package/es/common/types/threadedComments.js +0 -2
  787. package/es/common/types/threadedComments.js.flow +0 -9
  788. package/src/common/types/threadedComments.js +0 -9
package/es/api/Feed.js CHANGED
@@ -6,22 +6,10 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
6
6
 
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
8
 
9
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
10
-
11
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
12
-
13
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
14
-
15
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
16
-
17
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
18
10
 
19
11
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
20
12
 
21
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22
-
23
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24
-
25
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
14
 
27
15
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -42,8 +30,24 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
42
30
 
43
31
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
44
32
 
33
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
34
+
35
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
36
+
37
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
38
+
39
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
40
+
41
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
42
+
43
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
44
+
45
45
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
46
46
 
47
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
48
+
49
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
50
+
47
51
  /**
48
52
  *
49
53
  * @file Helper for activity feed API's
@@ -51,22 +55,46 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
51
55
  */
52
56
  import uniqueId from 'lodash/uniqueId';
53
57
  import noop from 'lodash/noop';
54
- import { getBadItemError, getBadUserError, isUserCorrectableError } from '../utils/error';
58
+ import { getBadItemError, getBadUserError, getMissingItemTextOrStatus, isUserCorrectableError } from '../utils/error';
55
59
  import commonMessages from '../elements/common/messages';
56
60
  import messages from './messages';
57
61
  import { sortFeedItems } from '../utils/sorter';
62
+ import { FEED_FILE_VERSIONS_FIELDS_TO_FETCH } from '../utils/fields';
58
63
  import Base from './Base';
59
64
  import AnnotationsAPI from './Annotations';
60
65
  import CommentsAPI from './Comments';
66
+ import ThreadedCommentsAPI from './ThreadedComments';
61
67
  import VersionsAPI from './Versions';
62
68
  import TasksNewAPI from './tasks/TasksNew';
63
69
  import GroupsAPI from './Groups';
64
70
  import TaskCollaboratorsAPI from './tasks/TaskCollaborators';
65
71
  import TaskLinksAPI from './tasks/TaskLinks';
66
72
  import AppActivityAPI from './AppActivity';
67
- import { ERROR_CODE_CREATE_TASK, ERROR_CODE_UPDATE_TASK, ERROR_CODE_GROUP_EXCEEDS_LIMIT, HTTP_STATUS_CODE_CONFLICT, IS_ERROR_DISPLAYED, TASK_NEW_APPROVED, TASK_NEW_COMPLETED, TASK_NEW_REJECTED, TASK_NEW_NOT_STARTED, TYPED_ID_FEED_PREFIX, TASK_MAX_GROUP_ASSIGNEES } from '../constants';
73
+ import { ERROR_CODE_CREATE_TASK, ERROR_CODE_UPDATE_TASK, ERROR_CODE_GROUP_EXCEEDS_LIMIT, FEED_ITEM_TYPE_ANNOTATION, FEED_ITEM_TYPE_COMMENT, FEED_ITEM_TYPE_TASK, HTTP_STATUS_CODE_CONFLICT, IS_ERROR_DISPLAYED, TASK_NEW_APPROVED, TASK_NEW_COMPLETED, TASK_NEW_REJECTED, TASK_NEW_NOT_STARTED, TYPED_ID_FEED_PREFIX, TASK_MAX_GROUP_ASSIGNEES } from '../constants';
68
74
  var TASK_NEW_INITIAL_STATUS = TASK_NEW_NOT_STARTED;
69
- var TASK = 'task';
75
+
76
+ var getItemWithFilteredReplies = function getItemWithFilteredReplies(item, replyId) {
77
+ var _item$replies = item.replies,
78
+ replies = _item$replies === void 0 ? [] : _item$replies,
79
+ rest = _objectWithoutProperties(item, ["replies"]);
80
+
81
+ return _objectSpread({
82
+ replies: replies.filter(function (_ref) {
83
+ var id = _ref.id;
84
+ return id !== replyId;
85
+ })
86
+ }, rest);
87
+ };
88
+
89
+ var getItemWithPendingReply = function getItemWithPendingReply(item, reply) {
90
+ var _item$replies2 = item.replies,
91
+ replies = _item$replies2 === void 0 ? [] : _item$replies2,
92
+ rest = _objectWithoutProperties(item, ["replies"]);
93
+
94
+ return _objectSpread({
95
+ replies: [].concat(_toConsumableArray(replies), [reply])
96
+ }, rest);
97
+ };
70
98
 
71
99
  var Feed =
72
100
  /*#__PURE__*/
@@ -101,6 +129,10 @@ function (_Base) {
101
129
  * @property {TaskLinksAPI}
102
130
  */
103
131
 
132
+ /**
133
+ * @property {ThreadedCommentsAPI}
134
+ */
135
+
104
136
  /**
105
137
  * @property {BoxItem}
106
138
  */
@@ -115,23 +147,33 @@ function (_Base) {
115
147
 
116
148
  _this = _possibleConstructorReturn(this, _getPrototypeOf(Feed).call(this, options));
117
149
 
118
- _defineProperty(_assertThisInitialized(_this), "updateAnnotation", function (file, annotationId, text, permissions, successCallback, errorCallback) {
150
+ _defineProperty(_assertThisInitialized(_this), "updateAnnotation", function (file, annotationId, text, status, permissions, successCallback, errorCallback) {
119
151
  if (!file.id) {
120
152
  throw getBadItemError();
121
153
  }
122
154
 
155
+ if (!text && !status) {
156
+ throw getMissingItemTextOrStatus();
157
+ }
158
+
123
159
  _this.annotationsAPI = new AnnotationsAPI(_this.options);
124
160
  _this.file = file;
125
161
  _this.errorCallback = errorCallback;
162
+ var feedItemChanges = {};
126
163
 
127
- _this.updateFeedItem({
128
- message: text,
164
+ if (text) {
165
+ feedItemChanges.message = text;
166
+ }
167
+
168
+ if (status) {
169
+ feedItemChanges.status = status;
170
+ }
171
+
172
+ _this.updateFeedItem(_objectSpread({}, feedItemChanges, {
129
173
  isPending: true
130
- }, annotationId);
174
+ }), annotationId);
131
175
 
132
- _this.annotationsAPI.updateAnnotation(_this.file.id, annotationId, permissions, {
133
- message: text
134
- }, function (annotation) {
176
+ _this.annotationsAPI.updateAnnotation(_this.file.id, annotationId, permissions, feedItemChanges, function (annotation) {
135
177
  _this.updateFeedItem(_objectSpread({}, annotation, {
136
178
  isPending: false
137
179
  }), annotationId);
@@ -150,6 +192,18 @@ function (_Base) {
150
192
  _this.feedErrorCallback(true, e, code);
151
193
  });
152
194
 
195
+ _defineProperty(_assertThisInitialized(_this), "updateReplyErrorCallback", function (error, code, id, parentId) {
196
+ _this.updateReplyItem(_this.createFeedError(messages.commentUpdateErrorMessage), parentId, id);
197
+
198
+ _this.feedErrorCallback(true, error, code);
199
+ });
200
+
201
+ _defineProperty(_assertThisInitialized(_this), "fetchRepliesErrorCallback", function (error, code, id) {
202
+ _this.updateFeedItem(_this.createFeedError(messages.repliesFetchErrorMessage), id);
203
+
204
+ _this.feedErrorCallback(true, error, code);
205
+ });
206
+
153
207
  _defineProperty(_assertThisInitialized(_this), "deleteAnnotation", function (file, annotationId, permissions, successCallBack, errorCallback) {
154
208
  _this.annotationsAPI = new AnnotationsAPI(_this.options);
155
209
 
@@ -246,7 +300,7 @@ function (_Base) {
246
300
  _defineProperty(_assertThisInitialized(_this), "updateTaskNew",
247
301
  /*#__PURE__*/
248
302
  function () {
249
- var _ref = _asyncToGenerator(
303
+ var _ref2 = _asyncToGenerator(
250
304
  /*#__PURE__*/
251
305
  regeneratorRuntime.mark(function _callee(file, task) {
252
306
  var successCallback,
@@ -380,7 +434,7 @@ function (_Base) {
380
434
  }));
381
435
 
382
436
  return function (_x6, _x7) {
383
- return _ref.apply(this, arguments);
437
+ return _ref2.apply(this, arguments);
384
438
  };
385
439
  }());
386
440
 
@@ -409,12 +463,68 @@ function (_Base) {
409
463
  });
410
464
  });
411
465
 
466
+ _defineProperty(_assertThisInitialized(_this), "deleteThreadedComment", function (file, commentId, permissions, successCallback, errorCallback) {
467
+ if (!file.id) {
468
+ throw getBadItemError();
469
+ }
470
+
471
+ _this.file = file;
472
+ _this.errorCallback = errorCallback;
473
+
474
+ _this.updateFeedItem({
475
+ isPending: true
476
+ }, commentId);
477
+
478
+ _this.threadedCommentsAPI = new ThreadedCommentsAPI(_this.options);
479
+
480
+ _this.threadedCommentsAPI.deleteComment({
481
+ fileId: file.id,
482
+ commentId: commentId,
483
+ permissions: permissions,
484
+ successCallback: _this.deleteFeedItem.bind(_assertThisInitialized(_this), commentId, successCallback),
485
+ errorCallback: function errorCallback(e, code) {
486
+ _this.deleteCommentErrorCallback(e, code, commentId);
487
+ }
488
+ });
489
+ });
490
+
491
+ _defineProperty(_assertThisInitialized(_this), "deleteReply", function (file, id, parentId, permissions, successCallback, errorCallback) {
492
+ if (!file.id) {
493
+ throw getBadItemError();
494
+ }
495
+
496
+ _this.file = file;
497
+ _this.errorCallback = errorCallback;
498
+
499
+ _this.updateReplyItem({
500
+ isPending: true
501
+ }, parentId, id);
502
+
503
+ _this.threadedCommentsAPI = new ThreadedCommentsAPI(_this.options);
504
+
505
+ _this.threadedCommentsAPI.deleteComment({
506
+ fileId: file.id,
507
+ commentId: id,
508
+ permissions: permissions,
509
+ successCallback: _this.deleteReplyItem.bind(_assertThisInitialized(_this), id, parentId, successCallback),
510
+ errorCallback: function errorCallback(e, code) {
511
+ _this.deleteReplyErrorCallback(e, code, id, parentId);
512
+ }
513
+ });
514
+ });
515
+
412
516
  _defineProperty(_assertThisInitialized(_this), "deleteCommentErrorCallback", function (e, code, commentId) {
413
517
  _this.updateFeedItem(_this.createFeedError(messages.commentDeleteErrorMessage), commentId);
414
518
 
415
519
  _this.feedErrorCallback(true, e, code);
416
520
  });
417
521
 
522
+ _defineProperty(_assertThisInitialized(_this), "deleteReplyErrorCallback", function (error, code, id, parentId) {
523
+ _this.updateReplyItem(_this.createFeedError(messages.commentDeleteErrorMessage), parentId, id);
524
+
525
+ _this.feedErrorCallback(true, error, code);
526
+ });
527
+
418
528
  _defineProperty(_assertThisInitialized(_this), "createTaskNew", function (file, currentUser, message, assignees, taskType, dueAt, completionRule, _successCallback3, errorCallback) {
419
529
  if (!file.id) {
420
530
  throw getBadItemError();
@@ -444,7 +554,7 @@ function (_Base) {
444
554
  due_at: dueAtString,
445
555
  id: uuid,
446
556
  description: message,
447
- type: TASK,
557
+ type: FEED_ITEM_TYPE_TASK,
448
558
  assigned_to: {
449
559
  entries: assignees.map(function (assignee) {
450
560
  return {
@@ -604,6 +714,35 @@ function (_Base) {
604
714
  }
605
715
  });
606
716
 
717
+ _defineProperty(_assertThisInitialized(_this), "deleteReplyItem", function (id, parentId) {
718
+ var successCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
719
+ var cachedItems = _this.getCachedItems(_this.file.id) || {
720
+ items: [],
721
+ errors: []
722
+ };
723
+ var feedItems = cachedItems.items.map(function (item) {
724
+ if (item.id !== parentId) {
725
+ return item;
726
+ }
727
+
728
+ if (item.type === FEED_ITEM_TYPE_ANNOTATION) {
729
+ return getItemWithFilteredReplies(item, id);
730
+ }
731
+
732
+ if (item.type === FEED_ITEM_TYPE_COMMENT) {
733
+ return getItemWithFilteredReplies(item, id);
734
+ }
735
+
736
+ return item;
737
+ });
738
+
739
+ _this.setCachedItems(_this.file.id, feedItems);
740
+
741
+ if (!_this.isDestroyed()) {
742
+ successCallback(id, parentId);
743
+ }
744
+ });
745
+
607
746
  _defineProperty(_assertThisInitialized(_this), "feedErrorCallback", function () {
608
747
  var hasError = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
609
748
  var e = arguments.length > 1 ? arguments[1] : undefined;
@@ -648,6 +787,45 @@ function (_Base) {
648
787
  return pendingFeedItem;
649
788
  });
650
789
 
790
+ _defineProperty(_assertThisInitialized(_this), "addPendingReply", function (parentId, currentUser, commentBase) {
791
+ if (!_this.file.id) {
792
+ throw getBadItemError();
793
+ }
794
+
795
+ if (!currentUser) {
796
+ throw getBadUserError();
797
+ }
798
+
799
+ var date = new Date().toISOString();
800
+
801
+ var pendingReply = _objectSpread({
802
+ created_at: date,
803
+ created_by: currentUser,
804
+ modified_at: date,
805
+ isPending: true
806
+ }, commentBase);
807
+
808
+ var cachedItems = _this.getCachedItems(_this.file.id);
809
+
810
+ if (cachedItems) {
811
+ var updatedFeedItems = cachedItems.items.map(function (item) {
812
+ if (item.id === parentId && item.type === FEED_ITEM_TYPE_COMMENT) {
813
+ return getItemWithPendingReply(item, pendingReply);
814
+ }
815
+
816
+ if (item.id === parentId && item.type === FEED_ITEM_TYPE_ANNOTATION) {
817
+ return getItemWithPendingReply(item, pendingReply);
818
+ }
819
+
820
+ return item;
821
+ });
822
+
823
+ _this.setCachedItems(_this.file.id, updatedFeedItems);
824
+ }
825
+
826
+ return pendingReply;
827
+ });
828
+
651
829
  _defineProperty(_assertThisInitialized(_this), "createCommentSuccessCallback", function (commentData, id, successCallback) {
652
830
  var _commentData$message = commentData.message,
653
831
  message = _commentData$message === void 0 ? '' : _commentData$message,
@@ -673,6 +851,24 @@ function (_Base) {
673
851
  _this.feedErrorCallback(false, e, code);
674
852
  });
675
853
 
854
+ _defineProperty(_assertThisInitialized(_this), "createReplySuccessCallback", function (commentData, parentId, id, successCallback) {
855
+ _this.updateReplyItem(_objectSpread({}, commentData, {
856
+ isPending: false
857
+ }), parentId, id);
858
+
859
+ if (!_this.isDestroyed()) {
860
+ successCallback(commentData);
861
+ }
862
+ });
863
+
864
+ _defineProperty(_assertThisInitialized(_this), "createReplyErrorCallback", function (error, code, parentId, id) {
865
+ var errorMessage = error.status === HTTP_STATUS_CODE_CONFLICT ? messages.commentCreateConflictMessage : messages.commentCreateErrorMessage;
866
+
867
+ _this.updateReplyItem(_this.createFeedError(errorMessage), parentId, id);
868
+
869
+ _this.feedErrorCallback(false, error, code);
870
+ });
871
+
676
872
  _defineProperty(_assertThisInitialized(_this), "updateFeedItem", function (updates, id) {
677
873
  if (!_this.file.id) {
678
874
  throw getBadItemError();
@@ -697,12 +893,52 @@ function (_Base) {
697
893
  return null;
698
894
  });
699
895
 
896
+ _defineProperty(_assertThisInitialized(_this), "updateReplyItem", function (replyUpdates, parentId, id) {
897
+ if (!_this.file.id) {
898
+ throw getBadItemError();
899
+ }
900
+
901
+ var getItemWithUpdatedReply = function getItemWithUpdatedReply(item, replyId, updates) {
902
+ var updatedItem = _objectSpread({}, item);
903
+
904
+ if (updatedItem.replies) {
905
+ updatedItem.replies = updatedItem.replies.map(function (reply) {
906
+ if (reply.id === replyId) {
907
+ return _objectSpread({}, reply, {}, updates);
908
+ }
909
+
910
+ return reply;
911
+ });
912
+ }
913
+
914
+ return updatedItem;
915
+ };
916
+
917
+ var cachedItems = _this.getCachedItems(_this.file.id);
918
+
919
+ if (cachedItems) {
920
+ var updatedFeedItems = cachedItems.items.map(function (item) {
921
+ if (item.id === parentId && item.type === FEED_ITEM_TYPE_COMMENT) {
922
+ return getItemWithUpdatedReply(item, id, replyUpdates);
923
+ }
924
+
925
+ if (item.id === parentId && item.type === FEED_ITEM_TYPE_ANNOTATION) {
926
+ return getItemWithUpdatedReply(item, id, replyUpdates);
927
+ }
928
+
929
+ return item;
930
+ });
931
+
932
+ _this.setCachedItems(_this.file.id, updatedFeedItems);
933
+ }
934
+ });
935
+
700
936
  _defineProperty(_assertThisInitialized(_this), "createComment", function (file, currentUser, text, hasMention, _successCallback4, errorCallback) {
701
937
  var uuid = uniqueId('comment_');
702
938
  var commentData = {
703
939
  id: uuid,
704
940
  tagged_message: text,
705
- type: 'comment'
941
+ type: FEED_ITEM_TYPE_COMMENT
706
942
  };
707
943
 
708
944
  if (!file.id) {
@@ -736,7 +972,37 @@ function (_Base) {
736
972
  }));
737
973
  });
738
974
 
739
- _defineProperty(_assertThisInitialized(_this), "updateComment", function (file, commentId, text, hasMention, permissions, _successCallback5, errorCallback) {
975
+ _defineProperty(_assertThisInitialized(_this), "createThreadedComment", function (file, currentUser, text, _successCallback5, errorCallback) {
976
+ if (!file.id) {
977
+ throw getBadItemError();
978
+ }
979
+
980
+ var uuid = uniqueId('comment_');
981
+ var commentData = {
982
+ id: uuid,
983
+ tagged_message: text,
984
+ type: FEED_ITEM_TYPE_COMMENT
985
+ };
986
+ _this.file = file;
987
+ _this.errorCallback = errorCallback;
988
+
989
+ _this.addPendingItem(_this.file.id, currentUser, commentData);
990
+
991
+ _this.threadedCommentsAPI = new ThreadedCommentsAPI(_this.options);
992
+
993
+ _this.threadedCommentsAPI.createComment({
994
+ file: file,
995
+ message: text,
996
+ successCallback: function successCallback(comment) {
997
+ _this.createCommentSuccessCallback(comment, uuid, _successCallback5);
998
+ },
999
+ errorCallback: function errorCallback(e, code) {
1000
+ _this.createCommentErrorCallback(e, code, uuid);
1001
+ }
1002
+ });
1003
+ });
1004
+
1005
+ _defineProperty(_assertThisInitialized(_this), "updateComment", function (file, commentId, text, hasMention, permissions, _successCallback6, errorCallback) {
740
1006
  var commentData = {
741
1007
  tagged_message: text
742
1008
  };
@@ -776,7 +1042,7 @@ function (_Base) {
776
1042
  }), commentId);
777
1043
 
778
1044
  if (!_this.isDestroyed()) {
779
- _successCallback5(comment);
1045
+ _successCallback6(comment);
780
1046
  }
781
1047
  },
782
1048
  errorCallback: function errorCallback(e, code) {
@@ -785,6 +1051,91 @@ function (_Base) {
785
1051
  }));
786
1052
  });
787
1053
 
1054
+ _defineProperty(_assertThisInitialized(_this), "updateThreadedComment", function (file, commentId, text, status, permissions, _successCallback7, errorCallback) {
1055
+ if (!file.id) {
1056
+ throw getBadItemError();
1057
+ }
1058
+
1059
+ if (!text && !status) {
1060
+ throw getMissingItemTextOrStatus();
1061
+ }
1062
+
1063
+ var commentData = {};
1064
+
1065
+ if (text) {
1066
+ commentData.tagged_message = text;
1067
+ }
1068
+
1069
+ if (status) {
1070
+ commentData.status = status;
1071
+ }
1072
+
1073
+ _this.file = file;
1074
+ _this.errorCallback = errorCallback;
1075
+
1076
+ _this.updateFeedItem(_objectSpread({}, commentData, {
1077
+ isPending: true
1078
+ }), commentId);
1079
+
1080
+ _this.threadedCommentsAPI = new ThreadedCommentsAPI(_this.options);
1081
+
1082
+ _this.threadedCommentsAPI.updateComment({
1083
+ fileId: file.id,
1084
+ commentId: commentId,
1085
+ permissions: permissions,
1086
+ message: text,
1087
+ status: status,
1088
+ successCallback: function successCallback(comment) {
1089
+ _this.updateFeedItem(_objectSpread({}, comment, {
1090
+ isPending: false
1091
+ }), commentId);
1092
+
1093
+ if (!_this.isDestroyed()) {
1094
+ _successCallback7(comment);
1095
+ }
1096
+ },
1097
+ errorCallback: function errorCallback(e, code) {
1098
+ _this.updateCommentErrorCallback(e, code, commentId);
1099
+ }
1100
+ });
1101
+ });
1102
+
1103
+ _defineProperty(_assertThisInitialized(_this), "updateReply", function (file, id, parentId, text, permissions, _successCallback8, errorCallback) {
1104
+ if (!file.id) {
1105
+ throw getBadItemError();
1106
+ }
1107
+
1108
+ _this.file = file;
1109
+ _this.errorCallback = errorCallback;
1110
+
1111
+ _this.updateReplyItem({
1112
+ tagged_message: text,
1113
+ isPending: true
1114
+ }, parentId, id);
1115
+
1116
+ _this.threadedCommentsAPI = new ThreadedCommentsAPI(_this.options);
1117
+
1118
+ _this.threadedCommentsAPI.updateComment({
1119
+ fileId: file.id,
1120
+ commentId: id,
1121
+ permissions: permissions,
1122
+ message: text,
1123
+ undefined: undefined,
1124
+ successCallback: function successCallback(comment) {
1125
+ _this.updateReplyItem(_objectSpread({}, comment, {
1126
+ isPending: false
1127
+ }), parentId, id);
1128
+
1129
+ if (!_this.isDestroyed()) {
1130
+ _successCallback8(comment);
1131
+ }
1132
+ },
1133
+ errorCallback: function errorCallback(error, code) {
1134
+ _this.updateReplyErrorCallback(error, code, id, parentId);
1135
+ }
1136
+ });
1137
+ });
1138
+
788
1139
  _defineProperty(_assertThisInitialized(_this), "deleteAppActivity", function (file, appActivityId, successCallback, errorCallback) {
789
1140
  var id = file.id;
790
1141
 
@@ -844,7 +1195,7 @@ function (_Base) {
844
1195
  var newAnnotation = _objectSpread({}, annotation, {
845
1196
  created_by: currentUser,
846
1197
  id: id,
847
- type: 'annotation'
1198
+ type: FEED_ITEM_TYPE_ANNOTATION
848
1199
  });
849
1200
 
850
1201
  this.addPendingItem(this.file.id, currentUser, newAnnotation);
@@ -925,15 +1276,17 @@ function (_Base) {
925
1276
  }(function (file, shouldRefreshCache, successCallback, errorCallback, onError) {
926
1277
  var _this2 = this;
927
1278
 
928
- var _ref2 = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {},
929
- _ref2$shouldShowAnnot = _ref2.shouldShowAnnotations,
930
- shouldShowAnnotations = _ref2$shouldShowAnnot === void 0 ? false : _ref2$shouldShowAnnot,
931
- _ref2$shouldShowAppAc = _ref2.shouldShowAppActivity,
932
- shouldShowAppActivity = _ref2$shouldShowAppAc === void 0 ? false : _ref2$shouldShowAppAc,
933
- _ref2$shouldShowTasks = _ref2.shouldShowTasks,
934
- shouldShowTasks = _ref2$shouldShowTasks === void 0 ? true : _ref2$shouldShowTasks,
935
- _ref2$shouldShowVersi = _ref2.shouldShowVersions,
936
- shouldShowVersions = _ref2$shouldShowVersi === void 0 ? true : _ref2$shouldShowVersi;
1279
+ var _ref3 = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {},
1280
+ _ref3$shouldShowAnnot = _ref3.shouldShowAnnotations,
1281
+ shouldShowAnnotations = _ref3$shouldShowAnnot === void 0 ? false : _ref3$shouldShowAnnot,
1282
+ _ref3$shouldShowAppAc = _ref3.shouldShowAppActivity,
1283
+ shouldShowAppActivity = _ref3$shouldShowAppAc === void 0 ? false : _ref3$shouldShowAppAc,
1284
+ _ref3$shouldShowRepli = _ref3.shouldShowReplies,
1285
+ shouldShowReplies = _ref3$shouldShowRepli === void 0 ? false : _ref3$shouldShowRepli,
1286
+ _ref3$shouldShowTasks = _ref3.shouldShowTasks,
1287
+ shouldShowTasks = _ref3$shouldShowTasks === void 0 ? true : _ref3$shouldShowTasks,
1288
+ _ref3$shouldShowVersi = _ref3.shouldShowVersions,
1289
+ shouldShowVersions = _ref3$shouldShowVersi === void 0 ? true : _ref3$shouldShowVersi;
937
1290
 
938
1291
  var id = file.id,
939
1292
  _file$permissions = file.permissions,
@@ -958,17 +1311,17 @@ function (_Base) {
958
1311
  this.file = file;
959
1312
  this.errors = [];
960
1313
  this.errorCallback = onError;
961
- var annotationsPromise = shouldShowAnnotations ? this.fetchAnnotations(permissions) : Promise.resolve();
1314
+ var annotationsPromise = shouldShowAnnotations ? this.fetchAnnotations(permissions, shouldShowReplies) : Promise.resolve();
962
1315
  var versionsPromise = shouldShowVersions ? this.fetchVersions() : Promise.resolve();
963
1316
  var currentVersionPromise = shouldShowVersions ? this.fetchCurrentVersion() : Promise.resolve();
964
- var commentsPromise = this.fetchComments(permissions);
1317
+ var commentsPromise = shouldShowReplies ? this.fetchThreadedComments(permissions) : this.fetchComments(permissions);
965
1318
  var tasksPromise = shouldShowTasks ? this.fetchTasksNew() : Promise.resolve();
966
1319
  var appActivityPromise = shouldShowAppActivity ? this.fetchAppActivity(permissions) : Promise.resolve();
967
- Promise.all([versionsPromise, currentVersionPromise, commentsPromise, tasksPromise, appActivityPromise, annotationsPromise]).then(function (_ref3) {
968
- var _ref4 = _toArray(_ref3),
969
- versions = _ref4[0],
970
- currentVersion = _ref4[1],
971
- feedItems = _ref4.slice(2);
1320
+ Promise.all([versionsPromise, currentVersionPromise, commentsPromise, tasksPromise, appActivityPromise, annotationsPromise]).then(function (_ref4) {
1321
+ var _ref5 = _toArray(_ref4),
1322
+ versions = _ref5[0],
1323
+ currentVersion = _ref5[1],
1324
+ feedItems = _ref5.slice(2);
972
1325
 
973
1326
  var versionsWithCurrent = currentVersion ? _this2.versionsAPI.addCurrentVersion(currentVersion, versions, _this2.file) : undefined;
974
1327
  var sortedFeedItems = sortFeedItems.apply(void 0, [versionsWithCurrent].concat(_toConsumableArray(feedItems)));
@@ -986,12 +1339,12 @@ function (_Base) {
986
1339
  })
987
1340
  }, {
988
1341
  key: "fetchAnnotations",
989
- value: function fetchAnnotations(permissions) {
1342
+ value: function fetchAnnotations(permissions, shouldFetchReplies) {
990
1343
  var _this3 = this;
991
1344
 
992
1345
  this.annotationsAPI = new AnnotationsAPI(this.options);
993
1346
  return new Promise(function (resolve) {
994
- _this3.annotationsAPI.getAnnotations(_this3.file.id, undefined, permissions, resolve, _this3.fetchFeedItemErrorCallback.bind(_this3, resolve));
1347
+ _this3.annotationsAPI.getAnnotations(_this3.file.id, undefined, permissions, resolve, _this3.fetchFeedItemErrorCallback.bind(_this3, resolve), undefined, undefined, shouldFetchReplies);
995
1348
  });
996
1349
  }
997
1350
  /**
@@ -1011,6 +1364,84 @@ function (_Base) {
1011
1364
  _this4.commentsAPI.getComments(_this4.file.id, permissions, resolve, _this4.fetchFeedItemErrorCallback.bind(_this4, resolve));
1012
1365
  });
1013
1366
  }
1367
+ /**
1368
+ * Fetches the comments with replies for a file
1369
+ *
1370
+ * @param {Object} permissions - the file permissions
1371
+ * @return {Promise} - the file comments
1372
+ */
1373
+
1374
+ }, {
1375
+ key: "fetchThreadedComments",
1376
+ value: function fetchThreadedComments(permissions) {
1377
+ var _this5 = this;
1378
+
1379
+ this.threadedCommentsAPI = new ThreadedCommentsAPI(this.options);
1380
+ return new Promise(function (resolve) {
1381
+ _this5.threadedCommentsAPI.getComments({
1382
+ errorCallback: _this5.fetchFeedItemErrorCallback.bind(_this5, resolve),
1383
+ fileId: _this5.file.id,
1384
+ permissions: permissions,
1385
+ successCallback: resolve
1386
+ });
1387
+ });
1388
+ }
1389
+ /**
1390
+ * Fetches replies (comments) of a comment or annotation
1391
+ *
1392
+ * @param {BoxItem} file - The file to which the comment or annotation belongs to
1393
+ * @param {string} commentFeedItemId - ID of the comment or annotation
1394
+ * @param {CommentFeedItemType} commentFeedItemType - Type of the comment or annotation
1395
+ * @param {Function} successCallback
1396
+ * @param {ErrorCallback} errorCallback
1397
+ * @return {void}
1398
+ */
1399
+
1400
+ }, {
1401
+ key: "fetchReplies",
1402
+ value: function fetchReplies(file, commentFeedItemId, commentFeedItemType, successCallback, errorCallback) {
1403
+ var _this6 = this;
1404
+
1405
+ var id = file.id,
1406
+ permissions = file.permissions;
1407
+
1408
+ if (!id || !permissions) {
1409
+ throw getBadItemError();
1410
+ }
1411
+
1412
+ this.file = file;
1413
+ this.errorCallback = errorCallback;
1414
+ this.updateFeedItem({
1415
+ isRepliesLoading: true
1416
+ }, commentFeedItemId);
1417
+
1418
+ var successCallbackFn = function successCallbackFn(comments) {
1419
+ _this6.updateFeedItem({
1420
+ isRepliesLoading: false,
1421
+ replies: comments.entries
1422
+ }, commentFeedItemId);
1423
+
1424
+ successCallback(comments.entries);
1425
+ };
1426
+
1427
+ var errorCallbackFn = function errorCallbackFn(error, code) {
1428
+ _this6.fetchRepliesErrorCallback(error, code, commentFeedItemId);
1429
+ };
1430
+
1431
+ if (commentFeedItemType === FEED_ITEM_TYPE_ANNOTATION) {
1432
+ this.annotationsAPI = new AnnotationsAPI(this.options);
1433
+ this.annotationsAPI.getAnnotationReplies(file.id, commentFeedItemId, permissions, successCallbackFn, errorCallbackFn);
1434
+ } else if (commentFeedItemType === FEED_ITEM_TYPE_COMMENT) {
1435
+ this.threadedCommentsAPI = new ThreadedCommentsAPI(this.options);
1436
+ this.threadedCommentsAPI.getCommentReplies({
1437
+ fileId: file.id,
1438
+ commentId: commentFeedItemId,
1439
+ permissions: permissions,
1440
+ successCallback: successCallbackFn,
1441
+ errorCallback: errorCallbackFn
1442
+ });
1443
+ }
1444
+ }
1014
1445
  /**
1015
1446
  * Fetches the versions for a file
1016
1447
  *
@@ -1020,11 +1451,11 @@ function (_Base) {
1020
1451
  }, {
1021
1452
  key: "fetchVersions",
1022
1453
  value: function fetchVersions() {
1023
- var _this5 = this;
1454
+ var _this7 = this;
1024
1455
 
1025
1456
  this.versionsAPI = new VersionsAPI(this.options);
1026
1457
  return new Promise(function (resolve) {
1027
- _this5.versionsAPI.getVersions(_this5.file.id, resolve, _this5.fetchFeedItemErrorCallback.bind(_this5, resolve));
1458
+ _this7.versionsAPI.getVersions(_this7.file.id, resolve, _this7.fetchFeedItemErrorCallback.bind(_this7, resolve), undefined, undefined, FEED_FILE_VERSIONS_FIELDS_TO_FETCH);
1028
1459
  });
1029
1460
  }
1030
1461
  /**
@@ -1036,14 +1467,14 @@ function (_Base) {
1036
1467
  }, {
1037
1468
  key: "fetchCurrentVersion",
1038
1469
  value: function fetchCurrentVersion() {
1039
- var _this6 = this;
1470
+ var _this8 = this;
1040
1471
 
1041
1472
  this.versionsAPI = new VersionsAPI(this.options);
1042
1473
  return new Promise(function (resolve) {
1043
- var _this6$file$file_vers = _this6.file.file_version,
1044
- file_version = _this6$file$file_vers === void 0 ? {} : _this6$file$file_vers;
1474
+ var _this8$file$file_vers = _this8.file.file_version,
1475
+ file_version = _this8$file$file_vers === void 0 ? {} : _this8$file$file_vers;
1045
1476
 
1046
- _this6.versionsAPI.getVersion(_this6.file.id, file_version.id, resolve, _this6.fetchFeedItemErrorCallback.bind(_this6, resolve));
1477
+ _this8.versionsAPI.getVersion(_this8.file.id, file_version.id, resolve, _this8.fetchFeedItemErrorCallback.bind(_this8, resolve));
1047
1478
  });
1048
1479
  }
1049
1480
  /**
@@ -1055,17 +1486,17 @@ function (_Base) {
1055
1486
  }, {
1056
1487
  key: "fetchTasksNew",
1057
1488
  value: function fetchTasksNew() {
1058
- var _this7 = this;
1489
+ var _this9 = this;
1059
1490
 
1060
1491
  this.tasksNewAPI = new TasksNewAPI(this.options);
1061
1492
  return new Promise(function (resolve) {
1062
- _this7.tasksNewAPI.getTasksForFile({
1493
+ _this9.tasksNewAPI.getTasksForFile({
1063
1494
  file: {
1064
- id: _this7.file.id
1495
+ id: _this9.file.id
1065
1496
  },
1066
1497
  successCallback: resolve,
1067
1498
  errorCallback: function errorCallback(err, code) {
1068
- return _this7.fetchFeedItemErrorCallback(resolve, err, code);
1499
+ return _this9.fetchFeedItemErrorCallback(resolve, err, code);
1069
1500
  }
1070
1501
  });
1071
1502
  });
@@ -1113,7 +1544,7 @@ function (_Base) {
1113
1544
  * @return {Promise<TaskAssignment>}
1114
1545
  */
1115
1546
  value: function createTaskCollaboratorsforGroup(file, task, assignee) {
1116
- var _this8 = this;
1547
+ var _this10 = this;
1117
1548
 
1118
1549
  if (!file.id) {
1119
1550
  throw getBadItemError();
@@ -1121,9 +1552,9 @@ function (_Base) {
1121
1552
 
1122
1553
  this.file = file;
1123
1554
  return new Promise(function (resolve, reject) {
1124
- var taskCollaboratorsAPI = new TaskCollaboratorsAPI(_this8.options);
1555
+ var taskCollaboratorsAPI = new TaskCollaboratorsAPI(_this10.options);
1125
1556
 
1126
- _this8.taskCollaboratorsAPI.push(taskCollaboratorsAPI);
1557
+ _this10.taskCollaboratorsAPI.push(taskCollaboratorsAPI);
1127
1558
 
1128
1559
  taskCollaboratorsAPI.createTaskCollaboratorsforGroup({
1129
1560
  file: file,
@@ -1149,7 +1580,7 @@ function (_Base) {
1149
1580
  }, {
1150
1581
  key: "createTaskCollaborator",
1151
1582
  value: function createTaskCollaborator(file, task, assignee) {
1152
- var _this9 = this;
1583
+ var _this11 = this;
1153
1584
 
1154
1585
  if (!file.id) {
1155
1586
  throw getBadItemError();
@@ -1157,9 +1588,9 @@ function (_Base) {
1157
1588
 
1158
1589
  this.file = file;
1159
1590
  return new Promise(function (resolve, reject) {
1160
- var taskCollaboratorsAPI = new TaskCollaboratorsAPI(_this9.options);
1591
+ var taskCollaboratorsAPI = new TaskCollaboratorsAPI(_this11.options);
1161
1592
 
1162
- _this9.taskCollaboratorsAPI.push(taskCollaboratorsAPI);
1593
+ _this11.taskCollaboratorsAPI.push(taskCollaboratorsAPI);
1163
1594
 
1164
1595
  taskCollaboratorsAPI.createTaskCollaborator({
1165
1596
  file: file,
@@ -1185,7 +1616,7 @@ function (_Base) {
1185
1616
  }, {
1186
1617
  key: "deleteTaskCollaborator",
1187
1618
  value: function deleteTaskCollaborator(file, task, assignee) {
1188
- var _this10 = this;
1619
+ var _this12 = this;
1189
1620
 
1190
1621
  if (!file.id) {
1191
1622
  throw getBadItemError();
@@ -1193,9 +1624,9 @@ function (_Base) {
1193
1624
 
1194
1625
  this.file.id = file.id;
1195
1626
  return new Promise(function (resolve, reject) {
1196
- var taskCollaboratorsAPI = new TaskCollaboratorsAPI(_this10.options);
1627
+ var taskCollaboratorsAPI = new TaskCollaboratorsAPI(_this12.options);
1197
1628
 
1198
- _this10.taskCollaboratorsAPI.push(taskCollaboratorsAPI);
1629
+ _this12.taskCollaboratorsAPI.push(taskCollaboratorsAPI);
1199
1630
 
1200
1631
  taskCollaboratorsAPI.deleteTaskCollaborator({
1201
1632
  file: file,
@@ -1222,7 +1653,7 @@ function (_Base) {
1222
1653
  }, {
1223
1654
  key: "createTaskLink",
1224
1655
  value: function createTaskLink(file, task) {
1225
- var _this11 = this;
1656
+ var _this13 = this;
1226
1657
 
1227
1658
  if (!file.id) {
1228
1659
  throw getBadItemError();
@@ -1230,9 +1661,9 @@ function (_Base) {
1230
1661
 
1231
1662
  this.file = file;
1232
1663
  return new Promise(function (resolve, reject) {
1233
- var taskLinksAPI = new TaskLinksAPI(_this11.options);
1664
+ var taskLinksAPI = new TaskLinksAPI(_this13.options);
1234
1665
 
1235
- _this11.taskLinksAPI.push(taskLinksAPI);
1666
+ _this13.taskLinksAPI.push(taskLinksAPI);
1236
1667
 
1237
1668
  taskLinksAPI.createTaskLink({
1238
1669
  file: file,
@@ -1279,6 +1710,77 @@ function (_Base) {
1279
1710
  * @return {void}
1280
1711
  */
1281
1712
 
1713
+ }, {
1714
+ key: "createReply",
1715
+
1716
+ /**
1717
+ * Create a reply to annotation or comment, and make a pending item to be replaced once the API is successful.
1718
+ *
1719
+ * @param {BoxItem} file - The file to which the task is assigned
1720
+ * @param {Object} currentUser - the user who performed the action
1721
+ * @param {string} parentId - id of the parent item
1722
+ * @param {CommentFeedItemType} parentType - type of the parent item
1723
+ * @param {string} text - the comment text
1724
+ * @param {Function} successCallback - the success callback
1725
+ * @param {Function} errorCallback - the error callback
1726
+ * @return {void}
1727
+ */
1728
+ value: function createReply(file, currentUser, parentId, parentType, text, successCallback, errorCallback) {
1729
+ var _this14 = this;
1730
+
1731
+ var id = file.id,
1732
+ permissions = file.permissions;
1733
+
1734
+ if (!id || !permissions) {
1735
+ throw getBadItemError();
1736
+ }
1737
+
1738
+ var uuid = uniqueId('comment_');
1739
+ var commentData = {
1740
+ id: uuid,
1741
+ tagged_message: text,
1742
+ type: FEED_ITEM_TYPE_COMMENT
1743
+ };
1744
+ this.file = file;
1745
+ this.errorCallback = errorCallback;
1746
+ this.addPendingReply(parentId, currentUser, commentData);
1747
+
1748
+ var successCallbackFn = function successCallbackFn(comment) {
1749
+ _this14.createReplySuccessCallback(comment, parentId, uuid, successCallback);
1750
+ };
1751
+
1752
+ var errorCallbackFn = function errorCallbackFn(error, code) {
1753
+ _this14.createReplyErrorCallback(error, code, parentId, uuid);
1754
+ };
1755
+
1756
+ if (parentType === FEED_ITEM_TYPE_ANNOTATION) {
1757
+ this.annotationsAPI = new AnnotationsAPI(this.options);
1758
+ this.annotationsAPI.createAnnotationReply(file.id, parentId, permissions, text, successCallbackFn, errorCallbackFn);
1759
+ } else if (parentType === FEED_ITEM_TYPE_COMMENT) {
1760
+ this.threadedCommentsAPI = new ThreadedCommentsAPI(this.options);
1761
+ this.threadedCommentsAPI.createCommentReply({
1762
+ fileId: file.id,
1763
+ commentId: parentId,
1764
+ permissions: permissions,
1765
+ message: text,
1766
+ successCallback: successCallbackFn,
1767
+ errorCallback: errorCallbackFn
1768
+ });
1769
+ }
1770
+ }
1771
+ /**
1772
+ * Update a comment
1773
+ *
1774
+ * @param {BoxItem} file - The file to which the task is assigned
1775
+ * @param {string} commentId - Comment ID
1776
+ * @param {string} text - the comment text
1777
+ * @param {boolean} hasMention - true if there is an @mention in the text
1778
+ * @param {BoxCommentPermission} permissions - Permissions to attach to the app activity items
1779
+ * @param {Function} successCallback - the success callback
1780
+ * @param {Function} errorCallback - the error callback
1781
+ * @return {void}
1782
+ */
1783
+
1282
1784
  }, {
1283
1785
  key: "destroyTaskCollaborators",
1284
1786
  value: function destroyTaskCollaborators() {
@@ -1309,11 +1811,11 @@ function (_Base) {
1309
1811
  }, {
1310
1812
  key: "fetchAppActivity",
1311
1813
  value: function fetchAppActivity(permissions) {
1312
- var _this12 = this;
1814
+ var _this15 = this;
1313
1815
 
1314
1816
  this.appActivityAPI = new AppActivityAPI(this.options);
1315
1817
  return new Promise(function (resolve) {
1316
- _this12.appActivityAPI.getAppActivity(_this12.file.id, permissions, resolve, _this12.fetchFeedItemErrorCallback.bind(_this12, resolve));
1818
+ _this15.appActivityAPI.getAppActivity(_this15.file.id, permissions, resolve, _this15.fetchFeedItemErrorCallback.bind(_this15, resolve));
1317
1819
  });
1318
1820
  }
1319
1821
  /**
@@ -1347,6 +1849,11 @@ function (_Base) {
1347
1849
  delete this.commentsAPI;
1348
1850
  }
1349
1851
 
1852
+ if (this.threadedCommentsAPI) {
1853
+ this.threadedCommentsAPI.destroy();
1854
+ delete this.threadedCommentsAPI;
1855
+ }
1856
+
1350
1857
  if (this.versionsAPI) {
1351
1858
  this.versionsAPI.destroy();
1352
1859
  delete this.versionsAPI;