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.
- package/dist/explorer.css +1 -1
- package/dist/explorer.js +19 -58
- package/dist/openwith.css +1 -1
- package/dist/openwith.js +10 -10
- package/dist/picker.css +1 -1
- package/dist/picker.js +12 -12
- package/dist/preview.css +1 -1
- package/dist/preview.js +17 -56
- package/dist/sharing.css +1 -1
- package/dist/sharing.js +34 -34
- package/dist/sidebar.css +1 -1
- package/dist/sidebar.js +17 -56
- package/dist/uploader.css +1 -1
- package/dist/uploader.js +12 -12
- package/es/api/APIFactory.js +27 -0
- package/es/api/APIFactory.js.flow +26 -0
- package/es/api/APIFactory.js.map +1 -1
- package/es/api/Annotations.js +84 -8
- package/es/api/Annotations.js.flow +60 -6
- package/es/api/Annotations.js.map +1 -1
- package/es/api/Comments.js +2 -2
- package/es/api/Comments.js.flow +5 -4
- package/es/api/Comments.js.map +1 -1
- package/es/api/Feed.js +578 -71
- package/es/api/Feed.js.flow +677 -17
- package/es/api/Feed.js.map +1 -1
- package/es/api/FileCollaborators.js +29 -0
- package/es/api/FileCollaborators.js.flow +30 -0
- package/es/api/FileCollaborators.js.map +1 -1
- package/es/api/ThreadedComments.js +64 -27
- package/es/api/ThreadedComments.js.flow +54 -29
- package/es/api/ThreadedComments.js.map +1 -1
- package/es/api/fixtures.js +381 -0
- package/es/api/fixtures.js.flow +401 -0
- package/es/api/fixtures.js.map +1 -0
- package/es/api/messages.js +4 -0
- package/es/api/messages.js.flow +5 -0
- package/es/api/messages.js.map +1 -1
- package/es/api/utils.js +33 -0
- package/es/api/utils.js.flow +30 -0
- package/es/api/utils.js.map +1 -0
- package/es/common/types/annotations.js.flow +18 -12
- package/es/common/types/feed.js +1 -1
- package/es/common/types/feed.js.flow +40 -4
- package/es/common/types/feed.js.map +1 -1
- package/es/components/accessible-svg/AccessibleSVG.stories.js +20 -0
- package/es/components/accessible-svg/AccessibleSVG.stories.js.map +1 -0
- package/es/components/badge/Badge.stories.js +1 -13
- package/es/components/badge/Badge.stories.js.map +1 -1
- package/es/components/badge/BetaBadge.stories.js +10 -0
- package/es/components/badge/BetaBadge.stories.js.map +1 -0
- package/es/components/badge/TrialBadge.stories.js +10 -0
- package/es/components/badge/TrialBadge.stories.js.map +1 -0
- package/es/components/badge/UpgradeBadge.stories.js +10 -0
- package/es/components/badge/UpgradeBadge.stories.js.map +1 -0
- package/es/components/breadcrumb/Breadcrumb.js +48 -35
- package/es/components/breadcrumb/Breadcrumb.js.flow +68 -42
- package/es/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/es/components/breadcrumb/EllipsisCrumb.js +5 -3
- package/es/components/breadcrumb/EllipsisCrumb.js.flow +10 -6
- package/es/components/breadcrumb/EllipsisCrumb.js.map +1 -1
- package/es/components/count-badge/CountBadge.stories.js +1 -1
- package/es/components/count-badge/CountBadge.stories.js.map +1 -1
- package/es/components/draggable-list/DraggableList.stories.js +119 -5
- package/es/components/draggable-list/DraggableList.stories.js.map +1 -1
- package/es/components/dropdown-menu/DropdownMenu.js +9 -0
- package/es/components/dropdown-menu/DropdownMenu.js.flow +11 -0
- package/es/components/dropdown-menu/DropdownMenu.js.map +1 -1
- package/es/components/dropdown-menu/DropdownMenu.scss +3 -3
- package/es/components/infinite-scroll/InfiniteScroll.js +4 -2
- package/es/components/infinite-scroll/InfiniteScroll.js.map +1 -1
- package/es/components/modal/Modal.scss +5 -1
- package/es/components/search-form/SearchForm.js +1 -1
- package/es/components/search-form/SearchForm.js.flow +1 -1
- package/es/components/search-form/SearchForm.js.map +1 -1
- package/es/components/table/makeSelectable.js +304 -97
- package/es/components/table/makeSelectable.js.flow +299 -98
- package/es/components/table/makeSelectable.js.map +1 -1
- package/es/components/tooltip/Tooltip.js +3 -2
- package/es/components/tooltip/Tooltip.js.map +1 -1
- package/es/constants.js +11 -0
- package/es/constants.js.flow +11 -0
- package/es/constants.js.map +1 -1
- package/es/elements/common/annotator-context/index.js +1 -0
- package/es/elements/common/annotator-context/index.js.flow +4 -0
- package/es/elements/common/annotator-context/index.js.map +1 -1
- package/es/elements/common/annotator-context/types.js +12 -0
- package/es/elements/common/annotator-context/types.js.flow +77 -35
- package/es/elements/common/annotator-context/types.js.map +1 -1
- package/es/elements/common/annotator-context/useAnnotatorEvents.js +205 -0
- package/es/elements/common/annotator-context/useAnnotatorEvents.js.flow +52 -0
- package/es/elements/common/annotator-context/useAnnotatorEvents.js.map +1 -0
- package/es/elements/common/annotator-context/withAnnotations.js +224 -5
- package/es/elements/common/annotator-context/withAnnotations.js.flow +73 -36
- package/es/elements/common/annotator-context/withAnnotations.js.map +1 -1
- package/es/elements/common/annotator-context/withAnnotatorContext.js +12 -4
- package/es/elements/common/annotator-context/withAnnotatorContext.js.flow +29 -9
- package/es/elements/common/annotator-context/withAnnotatorContext.js.map +1 -1
- package/es/elements/common/current-user/index.js +3 -0
- package/es/elements/common/current-user/index.js.flow +8 -0
- package/es/elements/common/current-user/index.js.map +1 -0
- package/es/elements/common/current-user/withCurrentUser.js +139 -0
- package/es/elements/common/current-user/withCurrentUser.js.flow +40 -0
- package/es/elements/common/current-user/withCurrentUser.js.map +1 -0
- package/es/elements/common/flowTypes.js.flow +22 -4
- package/es/elements/common/flowTypes.js.map +1 -1
- package/es/elements/common/interactionTargets.js +2 -0
- package/es/elements/common/interactionTargets.js.flow +2 -0
- package/es/elements/common/interactionTargets.js.map +1 -1
- package/es/elements/common/logger/Logger.js +1 -1
- package/es/elements/common/logger/Logger.js.flow +1 -1
- package/es/elements/common/logger/Logger.js.map +1 -1
- package/es/elements/common/messages.js +4 -0
- package/es/elements/common/messages.js.flow +5 -0
- package/es/elements/common/messages.js.map +1 -1
- package/es/elements/content-explorer/DeleteConfirmationDialog.js +2 -1
- package/es/elements/content-explorer/DeleteConfirmationDialog.js.flow +3 -1
- package/es/elements/content-explorer/DeleteConfirmationDialog.js.map +1 -1
- package/es/elements/content-explorer/DeleteConfirmationDialog.scss +5 -0
- package/es/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js +58 -0
- package/es/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js.flow +60 -0
- package/es/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js.map +1 -0
- package/es/elements/content-sidebar/ActivitySidebar.js +323 -197
- package/es/elements/content-sidebar/ActivitySidebar.js.flow +381 -154
- package/es/elements/content-sidebar/ActivitySidebar.js.map +1 -1
- package/es/elements/content-sidebar/ActivitySidebarFilter.js +52 -0
- package/es/elements/content-sidebar/ActivitySidebarFilter.js.flow +59 -0
- package/es/elements/content-sidebar/ActivitySidebarFilter.js.map +1 -0
- package/es/elements/content-sidebar/ActivitySidebarFilter.scss +4 -0
- package/es/elements/content-sidebar/DetailsSidebar.js +50 -25
- package/es/elements/content-sidebar/DetailsSidebar.js.flow +32 -4
- package/es/elements/content-sidebar/DetailsSidebar.js.map +1 -1
- package/es/elements/content-sidebar/Sidebar.js +4 -1
- package/es/elements/content-sidebar/Sidebar.js.flow +6 -1
- package/es/elements/content-sidebar/Sidebar.js.map +1 -1
- package/es/elements/content-sidebar/SidebarContentInsights.js +45 -0
- package/es/elements/content-sidebar/SidebarContentInsights.js.map +1 -0
- package/es/elements/content-sidebar/SidebarContentInsights.scss +6 -0
- package/es/elements/content-sidebar/SidebarPanels.js +2 -0
- package/es/elements/content-sidebar/SidebarPanels.js.flow +4 -0
- package/es/elements/content-sidebar/SidebarPanels.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js +91 -10
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js.flow +122 -24
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js +27 -15
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js.flow +59 -18
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js +101 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js.flow +126 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.scss +17 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js +69 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js.flow +85 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.scss +16 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js +62 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js.flow +59 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.scss +22 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js +2 -2
- package/es/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js.flow +2 -2
- package/es/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/activity-feed/fixtures.js +55 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/fixtures.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/messages.js +16 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/messages.js.flow +20 -0
- package/es/elements/content-sidebar/activity-feed/activity-feed/messages.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js +121 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js.flow +117 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.scss +7 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js +75 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js.flow +105 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.scss +5 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js +77 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js.flow +86 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.scss +3 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/errors.js +11 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/errors.js.flow +26 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/errors.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/index.js +2 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/index.js.flow +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/index.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/messages.js +17 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/messages.js.flow +21 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/messages.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js +180 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js.flow +203 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js +124 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js.flow +121 -0
- package/es/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js +19 -5
- package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js.flow +24 -4
- package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js +25 -4
- package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js.flow +36 -2
- package/es/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/annotations/messages.js +8 -0
- package/es/elements/content-sidebar/activity-feed/annotations/messages.js.flow +10 -0
- package/es/elements/content-sidebar/activity-feed/annotations/messages.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/comment/Comment.js +61 -28
- package/es/elements/content-sidebar/activity-feed/comment/Comment.js.flow +54 -10
- package/es/elements/content-sidebar/activity-feed/comment/Comment.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/comment/messages.js +8 -0
- package/es/elements/content-sidebar/activity-feed/comment/messages.js.flow +10 -0
- package/es/elements/content-sidebar/activity-feed/comment/messages.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js +4 -2
- package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js.flow +3 -1
- package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js +16 -5
- package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js.flow +34 -4
- package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.scss +40 -3
- package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js +49 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js.flow +42 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js +21 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js.flow +24 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/messages.js +12 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/messages.js.flow +15 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-message/messages.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js +24 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js.flow +30 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.scss +6 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/index.js +2 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/index.js.flow +2 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/index.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/messages.js +9 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/messages.js.flow +13 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-status/messages.js.map +1 -0
- package/es/elements/content-sidebar/activity-feed/common/activity-timestamp/ActivityTimestamp.scss +1 -1
- package/es/elements/content-sidebar/fixtures.js +181 -0
- package/es/elements/content-sidebar/fixtures.js.flow +185 -0
- package/es/elements/content-sidebar/fixtures.js.map +1 -0
- package/es/elements/content-sidebar/flowTypes.js.flow +9 -25
- package/es/elements/content-sidebar/messages.js +8 -0
- package/es/elements/content-sidebar/messages.js.flow +10 -0
- package/es/elements/content-sidebar/messages.js.map +1 -1
- package/es/elements/content-sidebar/withErrorHandling.js.flow +1 -1
- package/es/elements/content-sidebar/withErrorHandling.js.map +1 -1
- package/es/elements/content-sidebar/withSidebarAnnotations.js +215 -30
- package/es/elements/content-sidebar/withSidebarAnnotations.js.flow +162 -11
- package/es/elements/content-sidebar/withSidebarAnnotations.js.map +1 -1
- package/es/elements/content-uploader/OverallUploadsProgressBar.js +10 -8
- package/es/elements/content-uploader/OverallUploadsProgressBar.js.flow +11 -12
- package/es/elements/content-uploader/OverallUploadsProgressBar.js.map +1 -1
- package/es/features/classification/Classification.scss +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.scss +1 -0
- package/es/features/classification/security-controls/messages.js +8 -0
- package/es/features/classification/security-controls/messages.js.flow +10 -0
- package/es/features/classification/security-controls/messages.js.map +1 -1
- package/es/features/classification/security-controls/utils.js +4 -7
- package/es/features/classification/security-controls/utils.js.flow +8 -12
- package/es/features/classification/security-controls/utils.js.map +1 -1
- package/es/features/content-explorer/content-explorer/ContentExplorer.js +6 -1
- package/es/features/content-explorer/content-explorer/ContentExplorer.js.flow +4 -0
- package/es/features/content-explorer/content-explorer/ContentExplorer.js.map +1 -1
- package/es/features/content-explorer/content-explorer/ContentExplorer.scss +4 -0
- package/es/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js +15 -9
- package/es/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js.flow +14 -11
- package/es/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js.map +1 -1
- package/es/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js +4 -1
- package/es/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js.flow +4 -1
- package/es/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js.map +1 -1
- package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js +6 -3
- package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js.flow +5 -1
- package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js.map +1 -1
- package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js +6 -1
- package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js.flow +5 -1
- package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js.map +1 -1
- package/es/features/content-explorer/prop-types.js +7 -1
- package/es/features/content-explorer/prop-types.js.flow +8 -0
- package/es/features/content-explorer/prop-types.js.map +1 -1
- package/es/features/content-insights/CompactCount.js +24 -0
- package/es/features/content-insights/CompactCount.js.map +1 -0
- package/es/features/content-insights/ContentAnalyticsErrorState.js +35 -0
- package/es/features/content-insights/ContentAnalyticsErrorState.js.map +1 -0
- package/es/features/content-insights/ContentAnalyticsErrorState.scss +17 -0
- package/es/features/content-insights/ContentInsightsSummary.js +42 -0
- package/es/features/content-insights/ContentInsightsSummary.js.map +1 -0
- package/es/features/content-insights/ContentInsightsSummary.scss +12 -0
- package/es/features/content-insights/ContentInsightsSummaryGhostState.js +19 -0
- package/es/features/content-insights/ContentInsightsSummaryGhostState.js.map +1 -0
- package/es/features/content-insights/ContentInsightsSummaryGhostState.scss +9 -0
- package/es/features/content-insights/GraphCardGhostState.js +25 -0
- package/es/features/content-insights/GraphCardGhostState.js.map +1 -0
- package/es/features/content-insights/GraphCardGhostState.scss +18 -0
- package/es/features/content-insights/GraphCardPreviewsSummary.js +30 -0
- package/es/features/content-insights/GraphCardPreviewsSummary.js.map +1 -0
- package/es/features/content-insights/GraphCardPreviewsSummary.scss +10 -0
- package/es/features/content-insights/GraphGhostState.js +21 -0
- package/es/features/content-insights/GraphGhostState.js.map +1 -0
- package/es/features/content-insights/GraphGhostState.scss +11 -0
- package/es/features/content-insights/HeaderWithCount.js +23 -0
- package/es/features/content-insights/HeaderWithCount.js.map +1 -0
- package/es/features/content-insights/HeaderWithCount.scss +10 -0
- package/es/features/content-insights/MetricSummary.js +85 -0
- package/es/features/content-insights/MetricSummary.js.map +1 -0
- package/es/features/content-insights/MetricSummary.scss +14 -0
- package/es/features/content-insights/OpenContentInsightsButton.js +16 -0
- package/es/features/content-insights/OpenContentInsightsButton.js.map +1 -0
- package/es/features/content-insights/TrendPill.js +61 -0
- package/es/features/content-insights/TrendPill.js.map +1 -0
- package/es/features/content-insights/TrendPill.scss +33 -0
- package/es/features/content-insights/_mixins.scss +7 -0
- package/es/features/content-insights/_variables.scss +4 -0
- package/es/features/content-insights/charts/bar/Bar.js +57 -0
- package/es/features/content-insights/charts/bar/Bar.js.map +1 -0
- package/es/features/content-insights/charts/bar/Bar.scss +27 -0
- package/es/features/content-insights/charts/bar/BarChart.js +70 -0
- package/es/features/content-insights/charts/bar/BarChart.js.map +1 -0
- package/es/features/content-insights/charts/bar/BarChart.scss +56 -0
- package/es/features/content-insights/charts/types.js +2 -0
- package/es/{common/types/threadedComments.js.map → features/content-insights/charts/types.js.map} +1 -1
- package/es/features/content-insights/constants.js +54 -0
- package/es/features/content-insights/constants.js.map +1 -0
- package/es/features/content-insights/messages.js +69 -0
- package/es/features/content-insights/messages.js.map +1 -0
- package/es/features/content-insights/numberUtils.js +10 -0
- package/es/features/content-insights/numberUtils.js.map +1 -0
- package/es/features/content-insights/types.js +2 -0
- package/es/features/content-insights/types.js.map +1 -0
- package/es/features/item-details/ItemProperties.scss +1 -1
- package/es/features/shared-link-settings-modal/SharedLinkSettingsModal.js +5 -3
- package/es/features/shared-link-settings-modal/SharedLinkSettingsModal.js.flow +4 -2
- package/es/features/shared-link-settings-modal/SharedLinkSettingsModal.js.map +1 -1
- package/es/features/unified-share-modal/ContactRestrictionNotice.js +34 -8
- package/es/features/unified-share-modal/ContactRestrictionNotice.js.flow +36 -6
- package/es/features/unified-share-modal/ContactRestrictionNotice.js.map +1 -1
- package/es/features/unified-share-modal/EmailForm.js +59 -47
- package/es/features/unified-share-modal/EmailForm.js.flow +31 -13
- package/es/features/unified-share-modal/EmailForm.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareForm.js +112 -103
- package/es/features/unified-share-modal/UnifiedShareForm.js.flow +25 -8
- package/es/features/unified-share-modal/UnifiedShareForm.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareModal.js +1 -0
- package/es/features/unified-share-modal/UnifiedShareModal.js.flow +1 -0
- package/es/features/unified-share-modal/UnifiedShareModal.js.map +1 -1
- package/es/features/unified-share-modal/flowTypes.js.flow +4 -2
- package/es/features/unified-share-modal/flowTypes.js.map +1 -1
- package/es/features/unified-share-modal/messages.js +12 -8
- package/es/features/unified-share-modal/messages.js.flow +14 -8
- package/es/features/unified-share-modal/messages.js.map +1 -1
- package/es/features/unified-share-modal/utils/hasRestrictedContacts.js +9 -4
- package/es/features/unified-share-modal/utils/hasRestrictedContacts.js.flow +10 -3
- package/es/features/unified-share-modal/utils/hasRestrictedContacts.js.map +1 -1
- package/es/features/unified-share-modal/utils/isRestrictedContact.js +15 -0
- package/es/features/unified-share-modal/utils/isRestrictedContact.js.flow +21 -0
- package/es/features/unified-share-modal/utils/isRestrictedContact.js.map +1 -0
- package/es/icon/fill/Alert16.js +3 -2
- package/es/icon/fill/Alert16.js.flow +3 -2
- package/es/icon/fill/Alert16.js.map +1 -1
- package/es/icon/fill/AlertBadge16.js +31 -0
- package/es/icon/fill/AlertBadge16.js.flow +29 -0
- package/es/icon/fill/AlertBadge16.js.map +1 -0
- package/es/icon/fill/AlertBadge16.stories.js +13 -0
- package/es/icon/fill/AlertBadge16.stories.js.map +1 -0
- package/es/icon/fill/Info16.js +2 -2
- package/es/icon/fill/Info16.js.flow +1 -1
- package/es/icon/fill/Info16.js.map +1 -1
- package/es/icon/fill/InfoBadge16.js +30 -0
- package/es/icon/fill/InfoBadge16.js.flow +28 -0
- package/es/icon/fill/InfoBadge16.js.map +1 -0
- package/es/icon/fill/InfoBadge16.stories.js +13 -0
- package/es/icon/fill/InfoBadge16.stories.js.map +1 -0
- package/es/icon/line/AlertBubble16.js +31 -0
- package/es/icon/line/AlertBubble16.js.flow +29 -0
- package/es/icon/line/AlertBubble16.js.map +1 -0
- package/es/icon/line/AlertBubble16.stories.js +13 -0
- package/es/icon/line/AlertBubble16.stories.js.map +1 -0
- package/es/icon/line/AvatarXBadge16.js +45 -0
- package/es/icon/line/AvatarXBadge16.js.flow +39 -0
- package/es/icon/line/AvatarXBadge16.js.map +1 -0
- package/es/icon/line/AvatarXBadge16.stories.js +13 -0
- package/es/icon/line/AvatarXBadge16.stories.js.map +1 -0
- package/es/icon/line/CoEdit16.js +32 -0
- package/es/icon/line/CoEdit16.js.flow +30 -0
- package/es/icon/line/CoEdit16.js.map +1 -0
- package/es/icon/line/CoEdit16.stories.js +13 -0
- package/es/icon/line/CoEdit16.stories.js.map +1 -0
- package/es/icon/line/Collaborations16.js +32 -0
- package/es/icon/line/Collaborations16.js.flow +30 -0
- package/es/icon/line/Collaborations16.js.map +1 -0
- package/es/icon/line/Collaborations16.stories.js +13 -0
- package/es/icon/line/Collaborations16.stories.js.map +1 -0
- package/es/icon/line/CommentBubble16.js +35 -0
- package/es/icon/line/CommentBubble16.js.flow +34 -0
- package/es/icon/line/CommentBubble16.js.map +1 -0
- package/es/icon/line/CommentBubble16.stories.js +13 -0
- package/es/icon/line/CommentBubble16.stories.js.map +1 -0
- package/es/src/components/accessible-svg/AccessibleSVG.stories.d.ts +7 -0
- package/es/src/components/badge/Badge.stories.d.ts +0 -3
- package/es/src/components/badge/BetaBadge.stories.d.ts +6 -0
- package/es/src/components/badge/TrialBadge.stories.d.ts +6 -0
- package/es/src/components/badge/UpgradeBadge.stories.d.ts +6 -0
- package/es/src/components/draggable-list/DraggableList.stories.d.ts +3 -3
- package/es/src/components/infinite-scroll/InfiniteScroll.d.ts +1 -1
- package/es/src/components/tooltip/Tooltip.d.ts +2 -0
- package/es/src/elements/common/annotator-context/__tests__/useAnnotatorEvents.test.d.ts +1 -0
- package/es/src/elements/common/annotator-context/index.d.ts +1 -0
- package/es/src/elements/common/annotator-context/types.d.ts +28 -6
- package/es/src/elements/common/annotator-context/useAnnotatorEvents.d.ts +52 -0
- package/es/src/elements/common/annotator-context/withAnnotations.d.ts +11 -2
- package/es/src/elements/common/annotator-context/withAnnotatorContext.d.ts +6 -2
- package/es/src/elements/common/current-user/__tests__/withCurrentUser.test.d.ts +1 -0
- package/es/src/elements/common/current-user/index.d.ts +2 -0
- package/es/src/elements/common/current-user/withCurrentUser.d.ts +20 -0
- package/es/src/elements/content-sidebar/SidebarContentInsights.d.ts +15 -0
- package/es/src/elements/content-sidebar/__tests__/SidebarContentInsights.test.d.ts +1 -0
- package/es/src/elements/content-sidebar/activity-feed/activity-feed/fixtures.d.ts +55 -0
- package/es/src/features/content-insights/CompactCount.d.ts +15 -0
- package/es/src/features/content-insights/ContentAnalyticsErrorState.d.ts +7 -0
- package/es/src/features/content-insights/ContentInsightsSummary.d.ts +12 -0
- package/es/src/features/content-insights/ContentInsightsSummaryGhostState.d.ts +3 -0
- package/es/src/features/content-insights/GraphCardGhostState.d.ts +3 -0
- package/es/src/features/content-insights/GraphCardPreviewsSummary.d.ts +16 -0
- package/es/src/features/content-insights/GraphGhostState.d.ts +3 -0
- package/es/src/features/content-insights/HeaderWithCount.d.ts +7 -0
- package/es/src/features/content-insights/MetricSummary.d.ts +18 -0
- package/es/src/features/content-insights/OpenContentInsightsButton.d.ts +5 -0
- package/es/src/features/content-insights/TrendPill.d.ts +15 -0
- package/es/src/features/content-insights/__tests__/CompactCount.test.d.ts +1 -0
- package/es/src/features/content-insights/__tests__/ContentAnalyticsErrorState.test.d.ts +1 -0
- package/es/src/features/content-insights/__tests__/ContentInsightsSummary.test.d.ts +1 -0
- package/es/src/features/content-insights/__tests__/GraphCardPreviewsSummary.test.d.ts +1 -0
- package/es/src/features/content-insights/__tests__/HeaderWithCount.test.d.ts +1 -0
- package/es/src/features/content-insights/__tests__/MetricSummary.test.d.ts +1 -0
- package/es/src/features/content-insights/charts/bar/Bar.d.ts +11 -0
- package/es/src/features/content-insights/charts/bar/BarChart.d.ts +19 -0
- package/es/src/features/content-insights/charts/bar/__tests__/Bar.test.d.ts +1 -0
- package/es/src/features/content-insights/charts/bar/__tests__/BarChart.test.d.ts +1 -0
- package/es/src/features/content-insights/charts/types.d.ts +2 -0
- package/es/src/features/content-insights/constants.d.ts +27 -0
- package/es/src/features/content-insights/messages.d.ts +83 -0
- package/es/src/features/content-insights/numberUtils.d.ts +3 -0
- package/es/src/features/content-insights/types.d.ts +24 -0
- package/es/src/icon/fill/AlertBadge16.d.ts +13 -0
- package/es/src/icon/fill/AlertBadge16.stories.d.ts +9 -0
- package/es/src/icon/fill/InfoBadge16.d.ts +13 -0
- package/es/src/icon/fill/InfoBadge16.stories.d.ts +9 -0
- package/es/src/icon/line/AlertBubble16.d.ts +13 -0
- package/es/src/icon/line/AlertBubble16.stories.d.ts +9 -0
- package/es/src/icon/line/AvatarXBadge16.d.ts +13 -0
- package/es/src/icon/line/AvatarXBadge16.stories.d.ts +9 -0
- package/es/src/icon/line/CoEdit16.d.ts +13 -0
- package/es/src/icon/line/CoEdit16.stories.d.ts +9 -0
- package/es/src/icon/line/Collaborations16.d.ts +13 -0
- package/es/src/icon/line/Collaborations16.stories.d.ts +9 -0
- package/es/src/icon/line/CommentBubble16.d.ts +13 -0
- package/es/src/icon/line/CommentBubble16.stories.d.ts +9 -0
- package/es/src/styles/variables.d.ts +3 -1
- package/es/styles/constants/_layout.scss +1 -1
- package/es/styles/constants/_media-queries.scss +2 -0
- package/es/styles/variables.js +6 -2
- package/es/styles/variables.js.flow +4 -2
- package/es/styles/variables.js.map +1 -1
- package/es/utils/error.js +5 -1
- package/es/utils/error.js.flow +5 -1
- package/es/utils/error.js.map +1 -1
- package/es/utils/fields.js +8 -3
- package/es/utils/fields.js.flow +21 -3
- package/es/utils/fields.js.map +1 -1
- package/es/utils/sorter.js.flow +2 -2
- package/es/utils/sorter.js.map +1 -1
- package/i18n/bn-IN.js +45 -7
- package/i18n/bn-IN.properties +83 -7
- package/i18n/da-DK.js +45 -7
- package/i18n/da-DK.properties +83 -7
- package/i18n/de-DE.js +45 -7
- package/i18n/de-DE.properties +83 -7
- package/i18n/en-AU.js +45 -7
- package/i18n/en-AU.properties +83 -7
- package/i18n/en-CA.js +45 -7
- package/i18n/en-CA.properties +83 -7
- package/i18n/en-GB.js +45 -7
- package/i18n/en-GB.properties +83 -7
- package/i18n/en-US.js +45 -7
- package/i18n/en-US.properties +83 -7
- package/i18n/en-x-pseudo.js +891 -854
- package/i18n/en-x-pseudo.properties +941 -843
- package/i18n/es-419.js +45 -7
- package/i18n/es-419.properties +83 -7
- package/i18n/es-ES.js +45 -7
- package/i18n/es-ES.properties +83 -7
- package/i18n/fi-FI.js +45 -7
- package/i18n/fi-FI.properties +83 -7
- package/i18n/fr-CA.js +45 -7
- package/i18n/fr-CA.properties +83 -7
- package/i18n/fr-FR.js +45 -7
- package/i18n/fr-FR.properties +83 -7
- package/i18n/hi-IN.js +45 -7
- package/i18n/hi-IN.properties +83 -7
- package/i18n/it-IT.js +45 -7
- package/i18n/it-IT.properties +83 -7
- package/i18n/ja-JP.js +47 -9
- package/i18n/ja-JP.properties +85 -9
- package/i18n/ko-KR.js +45 -7
- package/i18n/ko-KR.properties +83 -7
- package/i18n/nb-NO.js +45 -7
- package/i18n/nb-NO.properties +83 -7
- package/i18n/nl-NL.js +45 -7
- package/i18n/nl-NL.properties +83 -7
- package/i18n/pl-PL.js +45 -7
- package/i18n/pl-PL.properties +83 -7
- package/i18n/pt-BR.js +45 -7
- package/i18n/pt-BR.properties +83 -7
- package/i18n/ru-RU.js +45 -7
- package/i18n/ru-RU.properties +83 -7
- package/i18n/sv-SE.js +45 -7
- package/i18n/sv-SE.properties +83 -7
- package/i18n/tr-TR.js +45 -7
- package/i18n/tr-TR.properties +83 -7
- package/i18n/zh-CN.js +45 -7
- package/i18n/zh-CN.properties +83 -7
- package/i18n/zh-TW.js +45 -7
- package/i18n/zh-TW.properties +83 -7
- package/package.json +7 -8
- package/src/__mocks__/react-intl.js +4 -0
- package/src/api/APIFactory.js +26 -0
- package/src/api/Annotations.js +60 -6
- package/src/api/Comments.js +5 -4
- package/src/api/Feed.js +677 -17
- package/src/api/FileCollaborators.js +30 -0
- package/src/api/ThreadedComments.js +54 -29
- package/src/api/__tests__/Annotations.test.js +77 -3
- package/src/api/__tests__/Feed.test.js +698 -85
- package/src/api/__tests__/FileCollaborators.test.js +41 -0
- package/src/api/__tests__/ThreadedComments.test.js +47 -10
- package/src/api/__tests__/utils.test.js +11 -0
- package/src/api/fixtures.js +401 -0
- package/src/api/messages.js +5 -0
- package/src/api/utils.js +30 -0
- package/src/common/types/annotations.js +18 -12
- package/src/common/types/feed.js +40 -4
- package/src/components/accessible-svg/AccessibleSVG.stories.tsx +18 -0
- package/src/components/badge/Badge.stories.md +1 -7
- package/src/components/badge/Badge.stories.tsx +1 -10
- package/src/components/badge/BetaBadge.stories.tsx +9 -0
- package/src/components/badge/TrialBadge.stories.tsx +9 -0
- package/src/components/badge/UpgradeBadge.stories.tsx +9 -0
- package/src/components/breadcrumb/Breadcrumb.js +68 -42
- package/src/components/breadcrumb/EllipsisCrumb.js +10 -6
- package/src/components/count-badge/CountBadge.stories.tsx +1 -1
- package/src/components/draggable-list/DraggableList.stories.tsx +72 -5
- package/src/components/dropdown-menu/DropdownMenu.js +11 -0
- package/src/components/dropdown-menu/DropdownMenu.scss +3 -3
- package/src/components/dropdown-menu/__tests__/DropdownMenu.test.js +38 -0
- package/src/components/grid-view/__tests__/__snapshots__/GridViewSlider.test.js.snap +1 -0
- package/src/components/infinite-scroll/InfiniteScroll.md +1 -1
- package/src/components/infinite-scroll/InfiniteScroll.tsx +5 -2
- package/src/components/infinite-scroll/__tests__/InfiniteScroll.test.tsx +115 -127
- package/src/components/modal/Modal.scss +5 -1
- package/src/components/search-form/SearchForm.js +1 -1
- package/src/components/search-form/__tests__/SearchForm.test.js +25 -6
- package/src/components/sidebar-toggle-button/__tests__/__snapshots__/SidebarToggleButton.test.js.snap +4 -0
- package/src/components/table/__tests__/makeSelectable.test.js +654 -144
- package/src/components/table/makeSelectable.js +299 -98
- package/src/components/time/__tests__/ReadableTime.test.js +0 -1
- package/src/components/tooltip/Tooltip.tsx +5 -2
- package/src/components/tooltip/__tests__/Tooltip.test.tsx +10 -0
- package/src/components/tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +1 -1
- package/src/constants.js +11 -0
- package/src/elements/common/annotator-context/__tests__/useAnnotatorEvents.test.tsx +509 -0
- package/src/elements/common/annotator-context/__tests__/withAnnotations.test.tsx +275 -12
- package/src/elements/common/annotator-context/__tests__/withAnnotatorContext.test.tsx +18 -6
- package/src/elements/common/annotator-context/index.js.flow +4 -0
- package/src/elements/common/annotator-context/index.ts +1 -0
- package/src/elements/common/annotator-context/types.js.flow +77 -35
- package/src/elements/common/annotator-context/types.ts +28 -6
- package/src/elements/common/annotator-context/useAnnotatorEvents.js.flow +52 -0
- package/src/elements/common/annotator-context/useAnnotatorEvents.ts +190 -0
- package/src/elements/common/annotator-context/withAnnotations.js.flow +73 -36
- package/src/elements/common/annotator-context/withAnnotations.tsx +170 -7
- package/src/elements/common/annotator-context/withAnnotatorContext.js.flow +29 -9
- package/src/elements/common/annotator-context/withAnnotatorContext.tsx +28 -5
- package/src/elements/common/current-user/__tests__/withCurrentUser.test.tsx +108 -0
- package/src/elements/common/current-user/index.js.flow +8 -0
- package/src/elements/common/current-user/index.ts +2 -0
- package/src/elements/common/current-user/withCurrentUser.js.flow +40 -0
- package/src/elements/common/current-user/withCurrentUser.tsx +139 -0
- package/src/elements/common/flowTypes.js +22 -4
- package/src/elements/common/interactionTargets.js +2 -0
- package/src/elements/common/logger/Logger.js +1 -1
- package/src/elements/common/messages.js +5 -0
- package/src/elements/content-explorer/DeleteConfirmationDialog.js +3 -1
- package/src/elements/content-explorer/DeleteConfirmationDialog.scss +5 -0
- package/src/elements/content-explorer/stories/DeleteConfirmationDialog.stories.js +60 -0
- package/src/elements/content-explorer/stories/DeleteConfirmationDialog.stories.md +1 -0
- package/src/elements/content-sidebar/ActivitySidebar.js +381 -154
- package/src/elements/content-sidebar/ActivitySidebarFilter.js +59 -0
- package/src/elements/content-sidebar/ActivitySidebarFilter.scss +4 -0
- package/src/elements/content-sidebar/DetailsSidebar.js +32 -4
- package/src/elements/content-sidebar/Sidebar.js +6 -1
- package/src/elements/content-sidebar/SidebarContentInsights.scss +6 -0
- package/src/elements/content-sidebar/SidebarContentInsights.tsx +57 -0
- package/src/elements/content-sidebar/SidebarPanels.js +4 -0
- package/src/elements/content-sidebar/__tests__/ActivitySidebar.test.js +533 -243
- package/src/elements/content-sidebar/__tests__/ActivitySidebarFilter.test.js +54 -0
- package/src/elements/content-sidebar/__tests__/DetailsSidebar.test.js +45 -0
- package/src/elements/content-sidebar/__tests__/Sidebar.test.js +1 -1
- package/src/elements/content-sidebar/__tests__/SidebarContentInsights.test.tsx +56 -0
- package/src/elements/content-sidebar/__tests__/SidebarPanels.test.js +4 -3
- package/src/elements/content-sidebar/__tests__/__snapshots__/ActivitySidebar.test.js.snap +29 -15
- package/src/elements/content-sidebar/__tests__/__snapshots__/SidebarFileProperties.test.js.snap +1 -0
- package/src/elements/content-sidebar/__tests__/withSidebarAnnotations.test.js +325 -32
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActiveState.js +122 -24
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityFeed.js +59 -18
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.js +126 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThread.scss +17 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.js +85 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplies.scss +16 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js +59 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.scss +22 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActiveState.test.js +19 -5
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityFeed.test.js +22 -16
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityThread.test.js +80 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityThreadReplies.test.js +24 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/ActivityThreadRepliesForm.test.js +47 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/__snapshots__/ActiveState.test.js.snap +74 -43
- package/src/elements/content-sidebar/activity-feed/activity-feed/__tests__/activityFeedUtils.test.js +8 -8
- package/src/elements/content-sidebar/activity-feed/activity-feed/activityFeedUtils.js +2 -2
- package/src/elements/content-sidebar/activity-feed/activity-feed/fixtures.ts +56 -0
- package/src/elements/content-sidebar/activity-feed/activity-feed/messages.js +20 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js +117 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.scss +7 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js +105 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.scss +5 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js +86 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.scss +3 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/AnnotationThread.test.js +28 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/AnnotationThreadContent.test.js +89 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/AnnotationThreadCreate.test.js +103 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/useAnnotationAPI.test.js +202 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/__tests__/useRepliesAPI.test.js +99 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/errors.js +26 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/index.js +1 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/messages.js +21 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/useAnnotationAPI.js +203 -0
- package/src/elements/content-sidebar/activity-feed/annotation-thread/useRepliesAPI.js +121 -0
- package/src/elements/content-sidebar/activity-feed/annotations/AnnotationActivity.js +24 -4
- package/src/elements/content-sidebar/activity-feed/annotations/AnnotationActivityMenu.js +36 -2
- package/src/elements/content-sidebar/activity-feed/annotations/__tests__/AnnotationActivity.test.js +14 -10
- package/src/elements/content-sidebar/activity-feed/annotations/__tests__/AnnotationActivityMenu.test.js +35 -1
- package/src/elements/content-sidebar/activity-feed/annotations/messages.js +10 -0
- package/src/elements/content-sidebar/activity-feed/comment/Comment.js +54 -10
- package/src/elements/content-sidebar/activity-feed/comment/__tests__/Comment.test.js +152 -7
- package/src/elements/content-sidebar/activity-feed/comment/__tests__/__snapshots__/Comment.test.js.snap +12 -7
- package/src/elements/content-sidebar/activity-feed/comment/messages.js +10 -0
- package/src/elements/content-sidebar/activity-feed/comment-form/CommentForm.js +3 -1
- package/src/elements/content-sidebar/activity-feed/comment-form/__tests__/CommentForm.test.js +11 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.js +34 -4
- package/src/elements/content-sidebar/activity-feed/common/activity-message/ActivityMessage.scss +40 -3
- package/src/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessage.js +42 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-message/CollapsableMessageToggle.js +24 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-message/__tests__/ActivityMessage.test.js +48 -1
- package/src/elements/content-sidebar/activity-feed/common/activity-message/messages.js +15 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.js +30 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-status/ActivityStatus.scss +6 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-status/__tests__/ActivityStatus.test.js +19 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-status/index.js +2 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-status/messages.js +13 -0
- package/src/elements/content-sidebar/activity-feed/common/activity-timestamp/ActivityTimestamp.scss +1 -1
- package/src/elements/content-sidebar/activity-feed/task-new/__tests__/Task.test.js +4 -3
- package/src/elements/content-sidebar/activity-feed/task-new/__tests__/__snapshots__/Task.test.js.snap +1 -2
- package/src/elements/content-sidebar/fixtures.js +185 -0
- package/src/elements/content-sidebar/flowTypes.js +9 -25
- package/src/elements/content-sidebar/messages.js +10 -0
- package/src/elements/content-sidebar/withErrorHandling.js +1 -1
- package/src/elements/content-sidebar/withSidebarAnnotations.js +162 -11
- package/src/elements/content-uploader/OverallUploadsProgressBar.js +11 -12
- package/src/features/classification/Classification.scss +1 -1
- package/src/features/classification/security-controls/SecurityControlsItem.scss +1 -0
- package/src/features/classification/security-controls/__tests__/__snapshots__/utils.test.js.snap +18 -16
- package/src/features/classification/security-controls/__tests__/utils.test.js +13 -5
- package/src/features/classification/security-controls/messages.js +10 -0
- package/src/features/classification/security-controls/utils.js +8 -12
- package/src/features/collapsible-sidebar/__tests__/__snapshots__/CollapsibleSidebarLogo.test.js.snap +2 -0
- package/src/features/content-explorer/content-explorer/ContentExplorer.js +4 -0
- package/src/features/content-explorer/content-explorer/ContentExplorer.scss +4 -0
- package/src/features/content-explorer/content-explorer/ContentExplorerBreadcrumbs.js +14 -11
- package/src/features/content-explorer/content-explorer/ContentExplorerHeaderActions.js +4 -1
- package/src/features/content-explorer/content-explorer/__tests__/ContentExplorerBreadcrumbs.test.js +2 -2
- package/src/features/content-explorer/content-explorer-modal/ContentExplorerModal.js +5 -1
- package/src/features/content-explorer/content-explorer-modal/__tests__/__snapshots__/ContentExplorerModal.test.js.snap +1 -0
- package/src/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js +5 -1
- package/src/features/content-explorer/prop-types.js +8 -0
- package/src/features/content-insights/CompactCount.tsx +23 -0
- package/src/features/content-insights/ContentAnalyticsErrorState.scss +17 -0
- package/src/features/content-insights/ContentAnalyticsErrorState.tsx +44 -0
- package/src/features/content-insights/ContentInsightsSummary.scss +12 -0
- package/src/features/content-insights/ContentInsightsSummary.tsx +45 -0
- package/src/features/content-insights/ContentInsightsSummaryGhostState.scss +9 -0
- package/src/features/content-insights/ContentInsightsSummaryGhostState.tsx +18 -0
- package/src/features/content-insights/GraphCardGhostState.scss +18 -0
- package/src/features/content-insights/GraphCardGhostState.tsx +18 -0
- package/src/features/content-insights/GraphCardPreviewsSummary.scss +10 -0
- package/src/features/content-insights/GraphCardPreviewsSummary.tsx +40 -0
- package/src/features/content-insights/GraphGhostState.scss +11 -0
- package/src/features/content-insights/GraphGhostState.tsx +17 -0
- package/src/features/content-insights/HeaderWithCount.scss +10 -0
- package/src/features/content-insights/HeaderWithCount.tsx +24 -0
- package/src/features/content-insights/MetricSummary.scss +14 -0
- package/src/features/content-insights/MetricSummary.tsx +65 -0
- package/src/features/content-insights/OpenContentInsightsButton.tsx +20 -0
- package/src/features/content-insights/TrendPill.scss +33 -0
- package/src/features/content-insights/TrendPill.tsx +70 -0
- package/src/features/content-insights/__tests__/CompactCount.test.tsx +57 -0
- package/src/features/content-insights/__tests__/ContentAnalyticsErrorState.test.tsx +33 -0
- package/src/features/content-insights/__tests__/ContentInsightsSummary.test.tsx +81 -0
- package/src/features/content-insights/__tests__/GraphCardPreviewsSummary.test.tsx +35 -0
- package/src/features/content-insights/__tests__/HeaderWithCount.test.tsx +26 -0
- package/src/features/content-insights/__tests__/MetricSummary.test.tsx +88 -0
- package/src/features/content-insights/_mixins.scss +7 -0
- package/src/features/content-insights/_variables.scss +4 -0
- package/src/features/content-insights/charts/bar/Bar.scss +27 -0
- package/src/features/content-insights/charts/bar/Bar.tsx +48 -0
- package/src/features/content-insights/charts/bar/BarChart.scss +56 -0
- package/src/features/content-insights/charts/bar/BarChart.tsx +78 -0
- package/src/features/content-insights/charts/bar/__tests__/Bar.test.tsx +74 -0
- package/src/features/content-insights/charts/bar/__tests__/BarChart.test.tsx +110 -0
- package/src/features/content-insights/charts/types.ts +3 -0
- package/src/features/content-insights/constants.ts +60 -0
- package/src/features/content-insights/messages.ts +90 -0
- package/src/features/content-insights/numberUtils.ts +9 -0
- package/src/features/content-insights/types.ts +33 -0
- package/src/features/item-details/ItemProperties.scss +1 -1
- package/src/features/shared-link-settings-modal/SharedLinkSettingsModal.js +4 -2
- package/src/features/shared-link-settings-modal/__tests__/SharedLinkSettingsModal.test.js +22 -3
- package/src/features/shared-link-settings-modal/__tests__/__snapshots__/SharedLinkSettingsModal.test.js.snap +2 -1
- package/src/features/unified-share-modal/ContactRestrictionNotice.js +36 -6
- package/src/features/unified-share-modal/EmailForm.js +31 -13
- package/src/features/unified-share-modal/UnifiedShareForm.js +25 -8
- package/src/features/unified-share-modal/UnifiedShareModal.js +1 -0
- package/src/features/unified-share-modal/__tests__/ContactRestrictionNotice.test.js +55 -6
- package/src/features/unified-share-modal/__tests__/EmailForm.test.js +131 -24
- package/src/features/unified-share-modal/__tests__/UnifiedShareForm.test.js +89 -35
- package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareForm.test.js.snap +16 -0
- package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareModal.test.js.snap +17 -0
- package/src/features/unified-share-modal/flowTypes.js +4 -2
- package/src/features/unified-share-modal/messages.js +14 -8
- package/src/features/unified-share-modal/utils/__tests__/hasRestrictedContacts.test.js +24 -10
- package/src/features/unified-share-modal/utils/__tests__/isRestrictedContact.test.js +33 -0
- package/src/features/unified-share-modal/utils/hasRestrictedContacts.js +10 -3
- package/src/features/unified-share-modal/utils/isRestrictedContact.js +21 -0
- package/src/features/virtualized-table/__tests__/__snapshots__/VirtualizedTable.test.js.snap +1 -0
- package/src/icon/fill/Alert16.js.flow +3 -2
- package/src/icon/fill/Alert16.tsx +3 -2
- package/src/icon/fill/AlertBadge16.js.flow +29 -0
- package/src/icon/fill/AlertBadge16.stories.tsx +13 -0
- package/src/icon/fill/AlertBadge16.tsx +27 -0
- package/src/icon/fill/Info16.js.flow +1 -1
- package/src/icon/fill/Info16.tsx +1 -1
- package/src/icon/fill/InfoBadge16.js.flow +28 -0
- package/src/icon/fill/InfoBadge16.stories.tsx +13 -0
- package/src/icon/fill/InfoBadge16.tsx +26 -0
- package/src/icon/line/AlertBubble16.js.flow +29 -0
- package/src/icon/line/AlertBubble16.stories.tsx +13 -0
- package/src/icon/line/AlertBubble16.tsx +27 -0
- package/src/icon/line/AvatarXBadge16.js.flow +39 -0
- package/src/icon/line/AvatarXBadge16.stories.tsx +13 -0
- package/src/icon/line/AvatarXBadge16.tsx +37 -0
- package/src/icon/line/CoEdit16.js.flow +30 -0
- package/src/icon/line/CoEdit16.stories.tsx +13 -0
- package/src/icon/line/CoEdit16.tsx +28 -0
- package/src/icon/line/Collaborations16.js.flow +30 -0
- package/src/icon/line/Collaborations16.stories.tsx +13 -0
- package/src/icon/line/Collaborations16.tsx +28 -0
- package/src/icon/line/CommentBubble16.js.flow +34 -0
- package/src/icon/line/CommentBubble16.stories.tsx +13 -0
- package/src/icon/line/CommentBubble16.tsx +32 -0
- package/src/styles/constants/_layout.scss +1 -1
- package/src/styles/constants/_media-queries.scss +2 -0
- package/src/styles/variables.js +4 -2
- package/src/styles/variables.json +4 -2
- package/src/styles/variables.ts +3 -1
- package/src/utils/__tests__/fields.test.js +23 -4
- package/src/utils/__tests__/sorter.test.js +3 -3
- package/src/utils/error.js +5 -1
- package/src/utils/fields.js +21 -3
- package/src/utils/sorter.js +2 -2
- package/es/common/types/threadedComments.js +0 -2
- package/es/common/types/threadedComments.js.flow +0 -9
- package/src/common/types/threadedComments.js +0 -9
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flow
|
|
3
|
+
* @file Annotation Thread Container
|
|
4
|
+
* @author Box
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import debounce from 'lodash/debounce';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { IntlProvider } from 'react-intl';
|
|
11
|
+
import type EventEmitter from 'events';
|
|
12
|
+
import AnnotationThreadContent from './AnnotationThreadContent';
|
|
13
|
+
import AnnotationThreadCreate from './AnnotationThreadCreate';
|
|
14
|
+
import API from '../../../../api/APIFactory';
|
|
15
|
+
import { DEFAULT_COLLAB_DEBOUNCE, DEFAULT_HOSTNAME_API } from '../../../../constants';
|
|
16
|
+
|
|
17
|
+
import type APICache from '../../../../utils/Cache';
|
|
18
|
+
import type { BoxItem, SelectorItems, StringMap, Token, User } from '../../../../common/types/core';
|
|
19
|
+
import type { ElementOrigin, ElementsXhrError } from '../../../../common/types/api';
|
|
20
|
+
import type { Annotation, Target } from '../../../../common/types/annotations';
|
|
21
|
+
|
|
22
|
+
import './AnnotationThread.scss';
|
|
23
|
+
|
|
24
|
+
type Props = {
|
|
25
|
+
annotationId?: string,
|
|
26
|
+
apiHost?: string,
|
|
27
|
+
cache?: APICache,
|
|
28
|
+
className: string,
|
|
29
|
+
clientName: string,
|
|
30
|
+
currentUser: User,
|
|
31
|
+
eventEmitter?: EventEmitter,
|
|
32
|
+
file: BoxItem,
|
|
33
|
+
handleCancel: () => void,
|
|
34
|
+
language?: string,
|
|
35
|
+
messages?: StringMap,
|
|
36
|
+
onAnnotationCreate: (annotation: Annotation) => void,
|
|
37
|
+
onError: (error: ElementsXhrError | Error, code: string, contextInfo?: Object, origin?: ElementOrigin) => void,
|
|
38
|
+
target: Target,
|
|
39
|
+
token: Token,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const AnnotationThread = ({
|
|
43
|
+
annotationId,
|
|
44
|
+
apiHost = DEFAULT_HOSTNAME_API,
|
|
45
|
+
cache,
|
|
46
|
+
className = '',
|
|
47
|
+
clientName,
|
|
48
|
+
currentUser,
|
|
49
|
+
file,
|
|
50
|
+
handleCancel,
|
|
51
|
+
language,
|
|
52
|
+
messages,
|
|
53
|
+
onAnnotationCreate,
|
|
54
|
+
onError,
|
|
55
|
+
target,
|
|
56
|
+
token,
|
|
57
|
+
}: Props) => {
|
|
58
|
+
const api = new API({
|
|
59
|
+
apiHost,
|
|
60
|
+
cache,
|
|
61
|
+
clientName,
|
|
62
|
+
language,
|
|
63
|
+
token,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const [mentionSelectorContacts, setMentionSelectorContacts] = React.useState([]);
|
|
67
|
+
|
|
68
|
+
const getAvatarUrl = async (userId: string): Promise<?string> =>
|
|
69
|
+
api.getUsersAPI(false).getAvatarUrlWithAccessToken(userId, file.id);
|
|
70
|
+
|
|
71
|
+
const getMentionContactsSuccessCallback = ({ entries }: { entries: SelectorItems<> }): void => {
|
|
72
|
+
setMentionSelectorContacts(entries);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const getMentionWithQuery = debounce(searchStr => {
|
|
76
|
+
api.getFileCollaboratorsAPI(false).getCollaboratorsWithQuery(
|
|
77
|
+
file.id,
|
|
78
|
+
getMentionContactsSuccessCallback,
|
|
79
|
+
onError,
|
|
80
|
+
searchStr,
|
|
81
|
+
);
|
|
82
|
+
}, DEFAULT_COLLAB_DEBOUNCE);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div className={classNames('AnnotationThread', className)} data-testid="annotation-thread">
|
|
86
|
+
<IntlProvider locale={language} messages={messages}>
|
|
87
|
+
{!annotationId ? (
|
|
88
|
+
<AnnotationThreadCreate
|
|
89
|
+
api={api}
|
|
90
|
+
currentUser={currentUser}
|
|
91
|
+
file={file}
|
|
92
|
+
getAvatarUrl={getAvatarUrl}
|
|
93
|
+
getMentionWithQuery={getMentionWithQuery}
|
|
94
|
+
handleCancel={handleCancel}
|
|
95
|
+
mentionSelectorContacts={mentionSelectorContacts}
|
|
96
|
+
onAnnotationCreate={onAnnotationCreate}
|
|
97
|
+
onError={onError}
|
|
98
|
+
target={target}
|
|
99
|
+
/>
|
|
100
|
+
) : (
|
|
101
|
+
<AnnotationThreadContent
|
|
102
|
+
api={api}
|
|
103
|
+
annotationId={annotationId}
|
|
104
|
+
currentUser={currentUser}
|
|
105
|
+
file={file}
|
|
106
|
+
getAvatarUrl={getAvatarUrl}
|
|
107
|
+
getMentionWithQuery={getMentionWithQuery}
|
|
108
|
+
mentionSelectorContacts={mentionSelectorContacts}
|
|
109
|
+
onError={onError}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</IntlProvider>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default AnnotationThread;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThread.js"],"names":["React","debounce","classNames","IntlProvider","AnnotationThreadContent","AnnotationThreadCreate","API","DEFAULT_COLLAB_DEBOUNCE","DEFAULT_HOSTNAME_API","AnnotationThread","annotationId","apiHost","cache","className","clientName","currentUser","file","handleCancel","language","messages","onAnnotationCreate","onError","target","token","api","useState","mentionSelectorContacts","setMentionSelectorContacts","getAvatarUrl","userId","getUsersAPI","getAvatarUrlWithAccessToken","id","getMentionContactsSuccessCallback","entries","getMentionWithQuery","searchStr","getFileCollaboratorsAPI","getCollaboratorsWithQuery"],"mappings":"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","sourcesContent":["/**\n * @flow\n * @file Annotation Thread Container\n * @author Box\n */\n\nimport React from 'react';\nimport debounce from 'lodash/debounce';\nimport classNames from 'classnames';\nimport { IntlProvider } from 'react-intl';\nimport type EventEmitter from 'events';\nimport AnnotationThreadContent from './AnnotationThreadContent';\nimport AnnotationThreadCreate from './AnnotationThreadCreate';\nimport API from '../../../../api/APIFactory';\nimport { DEFAULT_COLLAB_DEBOUNCE, DEFAULT_HOSTNAME_API } from '../../../../constants';\n\nimport type APICache from '../../../../utils/Cache';\nimport type { BoxItem, SelectorItems, StringMap, Token, User } from '../../../../common/types/core';\nimport type { ElementOrigin, ElementsXhrError } from '../../../../common/types/api';\nimport type { Annotation, Target } from '../../../../common/types/annotations';\n\nimport './AnnotationThread.scss';\n\ntype Props = {\n annotationId?: string,\n apiHost?: string,\n cache?: APICache,\n className: string,\n clientName: string,\n currentUser: User,\n eventEmitter?: EventEmitter,\n file: BoxItem,\n handleCancel: () => void,\n language?: string,\n messages?: StringMap,\n onAnnotationCreate: (annotation: Annotation) => void,\n onError: (error: ElementsXhrError | Error, code: string, contextInfo?: Object, origin?: ElementOrigin) => void,\n target: Target,\n token: Token,\n};\n\nconst AnnotationThread = ({\n annotationId,\n apiHost = DEFAULT_HOSTNAME_API,\n cache,\n className = '',\n clientName,\n currentUser,\n file,\n handleCancel,\n language,\n messages,\n onAnnotationCreate,\n onError,\n target,\n token,\n}: Props) => {\n const api = new API({\n apiHost,\n cache,\n clientName,\n language,\n token,\n });\n\n const [mentionSelectorContacts, setMentionSelectorContacts] = React.useState([]);\n\n const getAvatarUrl = async (userId: string): Promise<?string> =>\n api.getUsersAPI(false).getAvatarUrlWithAccessToken(userId, file.id);\n\n const getMentionContactsSuccessCallback = ({ entries }: { entries: SelectorItems<> }): void => {\n setMentionSelectorContacts(entries);\n };\n\n const getMentionWithQuery = debounce(searchStr => {\n api.getFileCollaboratorsAPI(false).getCollaboratorsWithQuery(\n file.id,\n getMentionContactsSuccessCallback,\n onError,\n searchStr,\n );\n }, DEFAULT_COLLAB_DEBOUNCE);\n\n return (\n <div className={classNames('AnnotationThread', className)} data-testid=\"annotation-thread\">\n <IntlProvider locale={language} messages={messages}>\n {!annotationId ? (\n <AnnotationThreadCreate\n api={api}\n currentUser={currentUser}\n file={file}\n getAvatarUrl={getAvatarUrl}\n getMentionWithQuery={getMentionWithQuery}\n handleCancel={handleCancel}\n mentionSelectorContacts={mentionSelectorContacts}\n onAnnotationCreate={onAnnotationCreate}\n onError={onError}\n target={target}\n />\n ) : (\n <AnnotationThreadContent\n api={api}\n annotationId={annotationId}\n currentUser={currentUser}\n file={file}\n getAvatarUrl={getAvatarUrl}\n getMentionWithQuery={getMentionWithQuery}\n mentionSelectorContacts={mentionSelectorContacts}\n onError={onError}\n />\n )}\n </IntlProvider>\n </div>\n );\n};\n\nexport default AnnotationThread;\n"],"file":"AnnotationThread.js"}
|
package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ActivityError from '../common/activity-error';
|
|
3
|
+
import ActivityThread from '../activity-feed/ActivityThread';
|
|
4
|
+
import AnnotationActivity from '../annotations';
|
|
5
|
+
import API from '../../../../api/APIFactory';
|
|
6
|
+
import LoadingIndicator from '../../../../components/loading-indicator/LoadingIndicator';
|
|
7
|
+
import useAnnotationAPI from './useAnnotationAPI';
|
|
8
|
+
import './AnnotationThreadContent.scss';
|
|
9
|
+
|
|
10
|
+
var AnnotationThreadContent = function AnnotationThreadContent(_ref) {
|
|
11
|
+
var annotationId = _ref.annotationId,
|
|
12
|
+
api = _ref.api,
|
|
13
|
+
currentUser = _ref.currentUser,
|
|
14
|
+
file = _ref.file,
|
|
15
|
+
getAvatarUrl = _ref.getAvatarUrl,
|
|
16
|
+
getMentionWithQuery = _ref.getMentionWithQuery,
|
|
17
|
+
mentionSelectorContacts = _ref.mentionSelectorContacts,
|
|
18
|
+
onError = _ref.onError;
|
|
19
|
+
var fileId = file.id,
|
|
20
|
+
_file$permissions = file.permissions,
|
|
21
|
+
permissions = _file$permissions === void 0 ? {} : _file$permissions;
|
|
22
|
+
|
|
23
|
+
var _useAnnotationAPI = useAnnotationAPI({
|
|
24
|
+
api: api,
|
|
25
|
+
annotationId: annotationId,
|
|
26
|
+
currentUser: currentUser,
|
|
27
|
+
fileId: fileId,
|
|
28
|
+
filePermissions: permissions,
|
|
29
|
+
errorCallback: onError
|
|
30
|
+
}),
|
|
31
|
+
annotation = _useAnnotationAPI.annotation,
|
|
32
|
+
replies = _useAnnotationAPI.replies,
|
|
33
|
+
isLoading = _useAnnotationAPI.isLoading,
|
|
34
|
+
error = _useAnnotationAPI.error,
|
|
35
|
+
handleEdit = _useAnnotationAPI.handleEdit,
|
|
36
|
+
handleStatusChange = _useAnnotationAPI.handleStatusChange,
|
|
37
|
+
handleDelete = _useAnnotationAPI.handleDelete,
|
|
38
|
+
handleCreateReply = _useAnnotationAPI.handleCreateReply,
|
|
39
|
+
handleDeleteReply = _useAnnotationAPI.handleDeleteReply,
|
|
40
|
+
handleEditReply = _useAnnotationAPI.handleEditReply;
|
|
41
|
+
|
|
42
|
+
var onReplyEditHandler = function onReplyEditHandler(id, text, status, hasMention, replyPermissions) {
|
|
43
|
+
handleEditReply(id, text, status, replyPermissions);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return React.createElement(ActivityThread, {
|
|
47
|
+
hasReplies: true,
|
|
48
|
+
getAvatarUrl: getAvatarUrl,
|
|
49
|
+
getMentionWithQuery: getMentionWithQuery,
|
|
50
|
+
isAlwaysExpanded: true,
|
|
51
|
+
isRepliesLoading: isLoading,
|
|
52
|
+
mentionSelectorContacts: mentionSelectorContacts,
|
|
53
|
+
onReplyCreate: handleCreateReply,
|
|
54
|
+
onReplyDelete: handleDeleteReply,
|
|
55
|
+
onReplyEdit: onReplyEditHandler,
|
|
56
|
+
replies: replies,
|
|
57
|
+
repliesTotalCount: replies.length
|
|
58
|
+
}, error && React.createElement(ActivityError, error), isLoading && React.createElement("div", {
|
|
59
|
+
className: "AnnotationThreadContent-loading",
|
|
60
|
+
"data-testid": "annotation-loading"
|
|
61
|
+
}, React.createElement(LoadingIndicator, null)), annotation && React.createElement(AnnotationActivity, {
|
|
62
|
+
getAvatarUrl: getAvatarUrl,
|
|
63
|
+
currentUser: currentUser,
|
|
64
|
+
isCurrentVersion: true,
|
|
65
|
+
item: annotation,
|
|
66
|
+
getMentionWithQuery: getMentionWithQuery,
|
|
67
|
+
mentionSelectorContacts: mentionSelectorContacts,
|
|
68
|
+
onEdit: handleEdit,
|
|
69
|
+
onDelete: handleDelete,
|
|
70
|
+
onStatusChange: handleStatusChange
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default AnnotationThreadContent;
|
|
75
|
+
//# sourceMappingURL=AnnotationThreadContent.js.map
|
package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js.flow
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ActivityError from '../common/activity-error';
|
|
4
|
+
import ActivityThread from '../activity-feed/ActivityThread';
|
|
5
|
+
import AnnotationActivity from '../annotations';
|
|
6
|
+
import API from '../../../../api/APIFactory';
|
|
7
|
+
import LoadingIndicator from '../../../../components/loading-indicator/LoadingIndicator';
|
|
8
|
+
import useAnnotationAPI from './useAnnotationAPI';
|
|
9
|
+
|
|
10
|
+
import type { BoxItem, SelectorItems, User } from '../../../../common/types/core';
|
|
11
|
+
import type { ErrorContextProps } from '../../../../common/types/api';
|
|
12
|
+
import type { BoxCommentPermission, FeedItemStatus } from '../../../../common/types/feed';
|
|
13
|
+
|
|
14
|
+
import './AnnotationThreadContent.scss';
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
annotationId: string,
|
|
18
|
+
api: API,
|
|
19
|
+
currentUser: User,
|
|
20
|
+
file: BoxItem,
|
|
21
|
+
getAvatarUrl: string => Promise<?string>,
|
|
22
|
+
getMentionWithQuery: (searchStr: string) => void,
|
|
23
|
+
mentionSelectorContacts: SelectorItems<>,
|
|
24
|
+
} & ErrorContextProps;
|
|
25
|
+
|
|
26
|
+
const AnnotationThreadContent = ({
|
|
27
|
+
annotationId,
|
|
28
|
+
api,
|
|
29
|
+
currentUser,
|
|
30
|
+
file,
|
|
31
|
+
getAvatarUrl,
|
|
32
|
+
getMentionWithQuery,
|
|
33
|
+
mentionSelectorContacts,
|
|
34
|
+
onError,
|
|
35
|
+
}: Props) => {
|
|
36
|
+
const { id: fileId, permissions = {} } = file;
|
|
37
|
+
|
|
38
|
+
const {
|
|
39
|
+
annotation,
|
|
40
|
+
replies,
|
|
41
|
+
isLoading,
|
|
42
|
+
error,
|
|
43
|
+
handleEdit,
|
|
44
|
+
handleStatusChange,
|
|
45
|
+
handleDelete,
|
|
46
|
+
handleCreateReply,
|
|
47
|
+
handleDeleteReply,
|
|
48
|
+
handleEditReply,
|
|
49
|
+
} = useAnnotationAPI({
|
|
50
|
+
api,
|
|
51
|
+
annotationId,
|
|
52
|
+
currentUser,
|
|
53
|
+
fileId,
|
|
54
|
+
filePermissions: permissions,
|
|
55
|
+
errorCallback: onError,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const onReplyEditHandler = (
|
|
59
|
+
id: string,
|
|
60
|
+
text: string,
|
|
61
|
+
status?: FeedItemStatus,
|
|
62
|
+
hasMention?: boolean,
|
|
63
|
+
replyPermissions: BoxCommentPermission,
|
|
64
|
+
) => {
|
|
65
|
+
handleEditReply(id, text, status, replyPermissions);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<ActivityThread
|
|
70
|
+
hasReplies
|
|
71
|
+
getAvatarUrl={getAvatarUrl}
|
|
72
|
+
getMentionWithQuery={getMentionWithQuery}
|
|
73
|
+
isAlwaysExpanded
|
|
74
|
+
isRepliesLoading={isLoading}
|
|
75
|
+
mentionSelectorContacts={mentionSelectorContacts}
|
|
76
|
+
onReplyCreate={handleCreateReply}
|
|
77
|
+
onReplyDelete={handleDeleteReply}
|
|
78
|
+
onReplyEdit={onReplyEditHandler}
|
|
79
|
+
replies={replies}
|
|
80
|
+
repliesTotalCount={replies.length}
|
|
81
|
+
>
|
|
82
|
+
{error && <ActivityError {...error} />}
|
|
83
|
+
{isLoading && (
|
|
84
|
+
<div className="AnnotationThreadContent-loading" data-testid="annotation-loading">
|
|
85
|
+
<LoadingIndicator />
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
{annotation && (
|
|
89
|
+
<AnnotationActivity
|
|
90
|
+
getAvatarUrl={getAvatarUrl}
|
|
91
|
+
currentUser={currentUser}
|
|
92
|
+
isCurrentVersion
|
|
93
|
+
item={annotation}
|
|
94
|
+
getMentionWithQuery={getMentionWithQuery}
|
|
95
|
+
mentionSelectorContacts={mentionSelectorContacts}
|
|
96
|
+
onEdit={handleEdit}
|
|
97
|
+
onDelete={handleDelete}
|
|
98
|
+
onStatusChange={handleStatusChange}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</ActivityThread>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default AnnotationThreadContent;
|
package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadContent.js"],"names":["React","ActivityError","ActivityThread","AnnotationActivity","API","LoadingIndicator","useAnnotationAPI","AnnotationThreadContent","annotationId","api","currentUser","file","getAvatarUrl","getMentionWithQuery","mentionSelectorContacts","onError","fileId","id","permissions","filePermissions","errorCallback","annotation","replies","isLoading","error","handleEdit","handleStatusChange","handleDelete","handleCreateReply","handleDeleteReply","handleEditReply","onReplyEditHandler","text","status","hasMention","replyPermissions","length"],"mappings":"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","sourcesContent":["// @flow\nimport React from 'react';\nimport ActivityError from '../common/activity-error';\nimport ActivityThread from '../activity-feed/ActivityThread';\nimport AnnotationActivity from '../annotations';\nimport API from '../../../../api/APIFactory';\nimport LoadingIndicator from '../../../../components/loading-indicator/LoadingIndicator';\nimport useAnnotationAPI from './useAnnotationAPI';\n\nimport type { BoxItem, SelectorItems, User } from '../../../../common/types/core';\nimport type { ErrorContextProps } from '../../../../common/types/api';\nimport type { BoxCommentPermission, FeedItemStatus } from '../../../../common/types/feed';\n\nimport './AnnotationThreadContent.scss';\n\ntype Props = {\n annotationId: string,\n api: API,\n currentUser: User,\n file: BoxItem,\n getAvatarUrl: string => Promise<?string>,\n getMentionWithQuery: (searchStr: string) => void,\n mentionSelectorContacts: SelectorItems<>,\n} & ErrorContextProps;\n\nconst AnnotationThreadContent = ({\n annotationId,\n api,\n currentUser,\n file,\n getAvatarUrl,\n getMentionWithQuery,\n mentionSelectorContacts,\n onError,\n}: Props) => {\n const { id: fileId, permissions = {} } = file;\n\n const {\n annotation,\n replies,\n isLoading,\n error,\n handleEdit,\n handleStatusChange,\n handleDelete,\n handleCreateReply,\n handleDeleteReply,\n handleEditReply,\n } = useAnnotationAPI({\n api,\n annotationId,\n currentUser,\n fileId,\n filePermissions: permissions,\n errorCallback: onError,\n });\n\n const onReplyEditHandler = (\n id: string,\n text: string,\n status?: FeedItemStatus,\n hasMention?: boolean,\n replyPermissions: BoxCommentPermission,\n ) => {\n handleEditReply(id, text, status, replyPermissions);\n };\n\n return (\n <ActivityThread\n hasReplies\n getAvatarUrl={getAvatarUrl}\n getMentionWithQuery={getMentionWithQuery}\n isAlwaysExpanded\n isRepliesLoading={isLoading}\n mentionSelectorContacts={mentionSelectorContacts}\n onReplyCreate={handleCreateReply}\n onReplyDelete={handleDeleteReply}\n onReplyEdit={onReplyEditHandler}\n replies={replies}\n repliesTotalCount={replies.length}\n >\n {error && <ActivityError {...error} />}\n {isLoading && (\n <div className=\"AnnotationThreadContent-loading\" data-testid=\"annotation-loading\">\n <LoadingIndicator />\n </div>\n )}\n {annotation && (\n <AnnotationActivity\n getAvatarUrl={getAvatarUrl}\n currentUser={currentUser}\n isCurrentVersion\n item={annotation}\n getMentionWithQuery={getMentionWithQuery}\n mentionSelectorContacts={mentionSelectorContacts}\n onEdit={handleEdit}\n onDelete={handleDelete}\n onStatusChange={handleStatusChange}\n />\n )}\n </ActivityThread>\n );\n};\n\nexport default AnnotationThreadContent;\n"],"file":"AnnotationThreadContent.js"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
6
|
+
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import API from '../../../../api/APIFactory';
|
|
12
|
+
import CommentForm from '../comment-form';
|
|
13
|
+
import { getBadUserError } from '../../../../utils/error';
|
|
14
|
+
import './AnnotationThreadCreate.scss';
|
|
15
|
+
|
|
16
|
+
var AnnotationThreadCreate = function AnnotationThreadCreate(_ref) {
|
|
17
|
+
var api = _ref.api,
|
|
18
|
+
currentUser = _ref.currentUser,
|
|
19
|
+
getAvatarUrl = _ref.getAvatarUrl,
|
|
20
|
+
getMentionWithQuery = _ref.getMentionWithQuery,
|
|
21
|
+
file = _ref.file,
|
|
22
|
+
handleCancel = _ref.handleCancel,
|
|
23
|
+
mentionSelectorContacts = _ref.mentionSelectorContacts,
|
|
24
|
+
onAnnotationCreate = _ref.onAnnotationCreate,
|
|
25
|
+
onError = _ref.onError,
|
|
26
|
+
target = _ref.target;
|
|
27
|
+
|
|
28
|
+
var _React$useState = React.useState(false),
|
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
+
isPending = _React$useState2[0],
|
|
31
|
+
setIsPending = _React$useState2[1];
|
|
32
|
+
|
|
33
|
+
var handleCreate = function handleCreate(text) {
|
|
34
|
+
var id = file.id,
|
|
35
|
+
_file$permissions = file.permissions,
|
|
36
|
+
permissions = _file$permissions === void 0 ? {} : _file$permissions,
|
|
37
|
+
_file$file_version = file.file_version,
|
|
38
|
+
file_version = _file$file_version === void 0 ? {} : _file$file_version;
|
|
39
|
+
setIsPending(true);
|
|
40
|
+
|
|
41
|
+
if (!currentUser) {
|
|
42
|
+
throw getBadUserError();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var successCallback = function successCallback(annotation) {
|
|
46
|
+
onAnnotationCreate(annotation);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var payload = {
|
|
50
|
+
description: {
|
|
51
|
+
message: text
|
|
52
|
+
},
|
|
53
|
+
target: target
|
|
54
|
+
};
|
|
55
|
+
api.getAnnotationsAPI(false).createAnnotation(id, file_version.id, payload, permissions, successCallback, onError);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return React.createElement("div", {
|
|
59
|
+
"data-testid": "annotation-create",
|
|
60
|
+
className: classNames('AnnotationThreadCreate', {
|
|
61
|
+
'is-pending': isPending
|
|
62
|
+
})
|
|
63
|
+
}, React.createElement(CommentForm, {
|
|
64
|
+
className: "AnnotationThreadCreate-editor",
|
|
65
|
+
user: currentUser,
|
|
66
|
+
entityId: file.id,
|
|
67
|
+
onSubmit: handleCreate,
|
|
68
|
+
getMentionWithQuery: getMentionWithQuery,
|
|
69
|
+
mentionSelectorContacts: mentionSelectorContacts,
|
|
70
|
+
getAvatarUrl: getAvatarUrl,
|
|
71
|
+
isOpen: true,
|
|
72
|
+
onCancel: handleCancel
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default AnnotationThreadCreate;
|
|
77
|
+
//# sourceMappingURL=AnnotationThreadCreate.js.map
|
package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js.flow
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import API from '../../../../api/APIFactory';
|
|
5
|
+
import CommentForm from '../comment-form';
|
|
6
|
+
import { getBadUserError } from '../../../../utils/error';
|
|
7
|
+
|
|
8
|
+
import type { Annotation, Target } from '../../../../common/types/annotations';
|
|
9
|
+
import type { BoxItem, SelectorItems, User } from '../../../../common/types/core';
|
|
10
|
+
import type { ErrorContextProps } from '../../../../common/types/api';
|
|
11
|
+
|
|
12
|
+
import './AnnotationThreadCreate.scss';
|
|
13
|
+
|
|
14
|
+
type Props = {
|
|
15
|
+
api: API,
|
|
16
|
+
currentUser: User,
|
|
17
|
+
file: BoxItem,
|
|
18
|
+
getAvatarUrl: string => Promise<?string>,
|
|
19
|
+
getMentionWithQuery: (searchStr: string) => void,
|
|
20
|
+
handleCancel: () => void,
|
|
21
|
+
mentionSelectorContacts: SelectorItems<>,
|
|
22
|
+
onAnnotationCreate: (annotation: Annotation) => void,
|
|
23
|
+
target: Target,
|
|
24
|
+
} & ErrorContextProps;
|
|
25
|
+
|
|
26
|
+
const AnnotationThreadCreate = ({
|
|
27
|
+
api,
|
|
28
|
+
currentUser,
|
|
29
|
+
getAvatarUrl,
|
|
30
|
+
getMentionWithQuery,
|
|
31
|
+
file,
|
|
32
|
+
handleCancel,
|
|
33
|
+
mentionSelectorContacts,
|
|
34
|
+
onAnnotationCreate,
|
|
35
|
+
onError,
|
|
36
|
+
target,
|
|
37
|
+
}: Props) => {
|
|
38
|
+
const [isPending, setIsPending] = React.useState(false);
|
|
39
|
+
|
|
40
|
+
const handleCreate = (text: string): void => {
|
|
41
|
+
const { id, permissions = {}, file_version = {} } = file;
|
|
42
|
+
setIsPending(true);
|
|
43
|
+
if (!currentUser) {
|
|
44
|
+
throw getBadUserError();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const successCallback = (annotation: Annotation) => {
|
|
48
|
+
onAnnotationCreate(annotation);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const payload = {
|
|
52
|
+
description: { message: text },
|
|
53
|
+
target,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
api.getAnnotationsAPI(false).createAnnotation(
|
|
57
|
+
id,
|
|
58
|
+
file_version.id,
|
|
59
|
+
payload,
|
|
60
|
+
permissions,
|
|
61
|
+
successCallback,
|
|
62
|
+
onError,
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
data-testid="annotation-create"
|
|
69
|
+
className={classNames('AnnotationThreadCreate', { 'is-pending': isPending })}
|
|
70
|
+
>
|
|
71
|
+
<CommentForm
|
|
72
|
+
className="AnnotationThreadCreate-editor"
|
|
73
|
+
user={currentUser}
|
|
74
|
+
entityId={file.id}
|
|
75
|
+
onSubmit={handleCreate}
|
|
76
|
+
getMentionWithQuery={getMentionWithQuery}
|
|
77
|
+
mentionSelectorContacts={mentionSelectorContacts}
|
|
78
|
+
getAvatarUrl={getAvatarUrl}
|
|
79
|
+
isOpen
|
|
80
|
+
onCancel={handleCancel}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default AnnotationThreadCreate;
|
package/es/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/content-sidebar/activity-feed/annotation-thread/AnnotationThreadCreate.js"],"names":["React","classNames","API","CommentForm","getBadUserError","AnnotationThreadCreate","api","currentUser","getAvatarUrl","getMentionWithQuery","file","handleCancel","mentionSelectorContacts","onAnnotationCreate","onError","target","useState","isPending","setIsPending","handleCreate","text","id","permissions","file_version","successCallback","annotation","payload","description","message","getAnnotationsAPI","createAnnotation"],"mappings":";;;;;;;;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,GAAP,MAAgB,4BAAhB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAASC,eAAT,QAAgC,yBAAhC;AAMA,OAAO,+BAAP;;AAcA,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAyB,OAWlB;AAAA,MAVTC,GAUS,QAVTA,GAUS;AAAA,MATTC,WASS,QATTA,WASS;AAAA,MARTC,YAQS,QARTA,YAQS;AAAA,MAPTC,mBAOS,QAPTA,mBAOS;AAAA,MANTC,IAMS,QANTA,IAMS;AAAA,MALTC,YAKS,QALTA,YAKS;AAAA,MAJTC,uBAIS,QAJTA,uBAIS;AAAA,MAHTC,kBAGS,QAHTA,kBAGS;AAAA,MAFTC,OAES,QAFTA,OAES;AAAA,MADTC,MACS,QADTA,MACS;;AAAA,wBACyBf,KAAK,CAACgB,QAAN,CAAe,KAAf,CADzB;AAAA;AAAA,MACFC,SADE;AAAA,MACSC,YADT;;AAGT,MAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,IAAD,EAAwB;AAAA,QACjCC,EADiC,GACWX,IADX,CACjCW,EADiC;AAAA,4BACWX,IADX,CAC7BY,WAD6B;AAAA,QAC7BA,WAD6B,kCACf,EADe;AAAA,6BACWZ,IADX,CACXa,YADW;AAAA,QACXA,YADW,mCACI,EADJ;AAEzCL,IAAAA,YAAY,CAAC,IAAD,CAAZ;;AACA,QAAI,CAACX,WAAL,EAAkB;AACd,YAAMH,eAAe,EAArB;AACH;;AAED,QAAMoB,eAAe,GAAG,SAAlBA,eAAkB,CAACC,UAAD,EAA4B;AAChDZ,MAAAA,kBAAkB,CAACY,UAAD,CAAlB;AACH,KAFD;;AAIA,QAAMC,OAAO,GAAG;AACZC,MAAAA,WAAW,EAAE;AAAEC,QAAAA,OAAO,EAAER;AAAX,OADD;AAEZL,MAAAA,MAAM,EAANA;AAFY,KAAhB;AAKAT,IAAAA,GAAG,CAACuB,iBAAJ,CAAsB,KAAtB,EAA6BC,gBAA7B,CACIT,EADJ,EAEIE,YAAY,CAACF,EAFjB,EAGIK,OAHJ,EAIIJ,WAJJ,EAKIE,eALJ,EAMIV,OANJ;AAQH,GAxBD;;AA0BA,SACI;AACI,mBAAY,mBADhB;AAEI,IAAA,SAAS,EAAEb,UAAU,CAAC,wBAAD,EAA2B;AAAE,oBAAcgB;AAAhB,KAA3B;AAFzB,KAII,oBAAC,WAAD;AACI,IAAA,SAAS,EAAC,+BADd;AAEI,IAAA,IAAI,EAAEV,WAFV;AAGI,IAAA,QAAQ,EAAEG,IAAI,CAACW,EAHnB;AAII,IAAA,QAAQ,EAAEF,YAJd;AAKI,IAAA,mBAAmB,EAAEV,mBALzB;AAMI,IAAA,uBAAuB,EAAEG,uBAN7B;AAOI,IAAA,YAAY,EAAEJ,YAPlB;AAQI,IAAA,MAAM,MARV;AASI,IAAA,QAAQ,EAAEG;AATd,IAJJ,CADJ;AAkBH,CA1DD;;AA4DA,eAAeN,sBAAf","sourcesContent":["// @flow\nimport React from 'react';\nimport classNames from 'classnames';\nimport API from '../../../../api/APIFactory';\nimport CommentForm from '../comment-form';\nimport { getBadUserError } from '../../../../utils/error';\n\nimport type { Annotation, Target } from '../../../../common/types/annotations';\nimport type { BoxItem, SelectorItems, User } from '../../../../common/types/core';\nimport type { ErrorContextProps } from '../../../../common/types/api';\n\nimport './AnnotationThreadCreate.scss';\n\ntype Props = {\n api: API,\n currentUser: User,\n file: BoxItem,\n getAvatarUrl: string => Promise<?string>,\n getMentionWithQuery: (searchStr: string) => void,\n handleCancel: () => void,\n mentionSelectorContacts: SelectorItems<>,\n onAnnotationCreate: (annotation: Annotation) => void,\n target: Target,\n} & ErrorContextProps;\n\nconst AnnotationThreadCreate = ({\n api,\n currentUser,\n getAvatarUrl,\n getMentionWithQuery,\n file,\n handleCancel,\n mentionSelectorContacts,\n onAnnotationCreate,\n onError,\n target,\n}: Props) => {\n const [isPending, setIsPending] = React.useState(false);\n\n const handleCreate = (text: string): void => {\n const { id, permissions = {}, file_version = {} } = file;\n setIsPending(true);\n if (!currentUser) {\n throw getBadUserError();\n }\n\n const successCallback = (annotation: Annotation) => {\n onAnnotationCreate(annotation);\n };\n\n const payload = {\n description: { message: text },\n target,\n };\n\n api.getAnnotationsAPI(false).createAnnotation(\n id,\n file_version.id,\n payload,\n permissions,\n successCallback,\n onError,\n );\n };\n\n return (\n <div\n data-testid=\"annotation-create\"\n className={classNames('AnnotationThreadCreate', { 'is-pending': isPending })}\n >\n <CommentForm\n className=\"AnnotationThreadCreate-editor\"\n user={currentUser}\n entityId={file.id}\n onSubmit={handleCreate}\n getMentionWithQuery={getMentionWithQuery}\n mentionSelectorContacts={mentionSelectorContacts}\n getAvatarUrl={getAvatarUrl}\n isOpen\n onCancel={handleCancel}\n />\n </div>\n );\n};\n\nexport default AnnotationThreadCreate;\n"],"file":"AnnotationThreadCreate.js"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var _annotationErrors, _commentsErrors;
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
import { ERROR_CODE_CREATE_REPLY, ERROR_CODE_DELETE_ANNOTATION, ERROR_CODE_DELETE_COMMENT, ERROR_CODE_EDIT_ANNOTATION, ERROR_CODE_FETCH_ANNOTATION, ERROR_CODE_UPDATE_COMMENT } from '../../../../constants';
|
|
6
|
+
import messages from './messages';
|
|
7
|
+
import commonMessages from '../../../common/messages';
|
|
8
|
+
var annotationErrors = (_annotationErrors = {}, _defineProperty(_annotationErrors, ERROR_CODE_FETCH_ANNOTATION, messages.errorFetchAnnotation), _defineProperty(_annotationErrors, ERROR_CODE_EDIT_ANNOTATION, messages.errorEditAnnotation), _defineProperty(_annotationErrors, ERROR_CODE_DELETE_ANNOTATION, messages.errorDeleteAnnotation), _defineProperty(_annotationErrors, "default", commonMessages.error), _annotationErrors);
|
|
9
|
+
var commentsErrors = (_commentsErrors = {}, _defineProperty(_commentsErrors, ERROR_CODE_UPDATE_COMMENT, messages.commentUpdateErrorMessage), _defineProperty(_commentsErrors, ERROR_CODE_CREATE_REPLY, messages.commentCreateErrorMessage), _defineProperty(_commentsErrors, ERROR_CODE_DELETE_COMMENT, messages.commentDeleteErrorMessage), _defineProperty(_commentsErrors, "default", commonMessages.error), _commentsErrors);
|
|
10
|
+
export { annotationErrors, commentsErrors };
|
|
11
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ERROR_CODE_CREATE_REPLY,
|
|
3
|
+
ERROR_CODE_DELETE_ANNOTATION,
|
|
4
|
+
ERROR_CODE_DELETE_COMMENT,
|
|
5
|
+
ERROR_CODE_EDIT_ANNOTATION,
|
|
6
|
+
ERROR_CODE_FETCH_ANNOTATION,
|
|
7
|
+
ERROR_CODE_UPDATE_COMMENT,
|
|
8
|
+
} from '../../../../constants';
|
|
9
|
+
import messages from './messages';
|
|
10
|
+
import commonMessages from '../../../common/messages';
|
|
11
|
+
|
|
12
|
+
const annotationErrors = {
|
|
13
|
+
[ERROR_CODE_FETCH_ANNOTATION]: messages.errorFetchAnnotation,
|
|
14
|
+
[ERROR_CODE_EDIT_ANNOTATION]: messages.errorEditAnnotation,
|
|
15
|
+
[ERROR_CODE_DELETE_ANNOTATION]: messages.errorDeleteAnnotation,
|
|
16
|
+
default: commonMessages.error,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const commentsErrors = {
|
|
20
|
+
[ERROR_CODE_UPDATE_COMMENT]: messages.commentUpdateErrorMessage,
|
|
21
|
+
[ERROR_CODE_CREATE_REPLY]: messages.commentCreateErrorMessage,
|
|
22
|
+
[ERROR_CODE_DELETE_COMMENT]: messages.commentDeleteErrorMessage,
|
|
23
|
+
default: commonMessages.error,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { annotationErrors, commentsErrors };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/content-sidebar/activity-feed/annotation-thread/errors.js"],"names":["ERROR_CODE_CREATE_REPLY","ERROR_CODE_DELETE_ANNOTATION","ERROR_CODE_DELETE_COMMENT","ERROR_CODE_EDIT_ANNOTATION","ERROR_CODE_FETCH_ANNOTATION","ERROR_CODE_UPDATE_COMMENT","messages","commonMessages","annotationErrors","errorFetchAnnotation","errorEditAnnotation","errorDeleteAnnotation","error","commentsErrors","commentUpdateErrorMessage","commentCreateErrorMessage","commentDeleteErrorMessage"],"mappings":";;;;AAAA,SACIA,uBADJ,EAEIC,4BAFJ,EAGIC,yBAHJ,EAIIC,0BAJJ,EAKIC,2BALJ,EAMIC,yBANJ,QAOO,uBAPP;AAQA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,cAAP,MAA2B,0BAA3B;AAEA,IAAMC,gBAAgB,+DACjBJ,2BADiB,EACaE,QAAQ,CAACG,oBADtB,sCAEjBN,0BAFiB,EAEYG,QAAQ,CAACI,mBAFrB,sCAGjBT,4BAHiB,EAGcK,QAAQ,CAACK,qBAHvB,iDAITJ,cAAc,CAACK,KAJN,qBAAtB;AAOA,IAAMC,cAAc,2DACfR,yBADe,EACaC,QAAQ,CAACQ,yBADtB,oCAEfd,uBAFe,EAEWM,QAAQ,CAACS,yBAFpB,oCAGfb,yBAHe,EAGaI,QAAQ,CAACU,yBAHtB,+CAIPT,cAAc,CAACK,KAJR,mBAApB;AAOA,SAASJ,gBAAT,EAA2BK,cAA3B","sourcesContent":["import {\n ERROR_CODE_CREATE_REPLY,\n ERROR_CODE_DELETE_ANNOTATION,\n ERROR_CODE_DELETE_COMMENT,\n ERROR_CODE_EDIT_ANNOTATION,\n ERROR_CODE_FETCH_ANNOTATION,\n ERROR_CODE_UPDATE_COMMENT,\n} from '../../../../constants';\nimport messages from './messages';\nimport commonMessages from '../../../common/messages';\n\nconst annotationErrors = {\n [ERROR_CODE_FETCH_ANNOTATION]: messages.errorFetchAnnotation,\n [ERROR_CODE_EDIT_ANNOTATION]: messages.errorEditAnnotation,\n [ERROR_CODE_DELETE_ANNOTATION]: messages.errorDeleteAnnotation,\n default: commonMessages.error,\n};\n\nconst commentsErrors = {\n [ERROR_CODE_UPDATE_COMMENT]: messages.commentUpdateErrorMessage,\n [ERROR_CODE_CREATE_REPLY]: messages.commentCreateErrorMessage,\n [ERROR_CODE_DELETE_COMMENT]: messages.commentDeleteErrorMessage,\n default: commonMessages.error,\n};\n\nexport { annotationErrors, commentsErrors };\n"],"file":"errors.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AnnotationThread';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/content-sidebar/activity-feed/annotation-thread/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,oBAAxB","sourcesContent":["export { default } from './AnnotationThread';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
var messages = defineMessages({
|
|
3
|
+
errorFetchAnnotation: {
|
|
4
|
+
"id": "be.annotattionThread.errorFetchAnnotation",
|
|
5
|
+
"defaultMessage": "The annotation could not be fetched."
|
|
6
|
+
},
|
|
7
|
+
errorEditAnnotation: {
|
|
8
|
+
"id": "be.annotationThread.errorEditAnnotation",
|
|
9
|
+
"defaultMessage": "This annotation could not be modified."
|
|
10
|
+
},
|
|
11
|
+
errorDeleteAnnotation: {
|
|
12
|
+
"id": "be.annotationThread.errorDeleteAnnotation",
|
|
13
|
+
"defaultMessage": "There was an error deleting this item."
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default messages;
|
|
17
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
const messages = defineMessages({
|
|
4
|
+
errorFetchAnnotation: {
|
|
5
|
+
id: 'be.annotattionThread.errorFetchAnnotation',
|
|
6
|
+
description: 'Error message when an annotation fetch fails',
|
|
7
|
+
defaultMessage: 'The annotation could not be fetched.',
|
|
8
|
+
},
|
|
9
|
+
errorEditAnnotation: {
|
|
10
|
+
id: 'be.annotationThread.errorEditAnnotation',
|
|
11
|
+
description: 'Error message when an annotation update fails',
|
|
12
|
+
defaultMessage: 'This annotation could not be modified.',
|
|
13
|
+
},
|
|
14
|
+
errorDeleteAnnotation: {
|
|
15
|
+
id: 'be.annotationThread.errorDeleteAnnotation',
|
|
16
|
+
description: 'Error message when an annotation deletion fails',
|
|
17
|
+
defaultMessage: 'There was an error deleting this item.',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export default messages;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/content-sidebar/activity-feed/annotation-thread/messages.js"],"names":["defineMessages","messages","errorFetchAnnotation","errorEditAnnotation","errorDeleteAnnotation"],"mappings":"AAAA,SAASA,cAAT,QAA+B,YAA/B;AAEA,IAAMC,QAAQ,GAAGD,cAAc,CAAC;AAC5BE,EAAAA,oBAAoB;AAAA;AAAA;AAAA,GADQ;AAM5BC,EAAAA,mBAAmB;AAAA;AAAA;AAAA,GANS;AAW5BC,EAAAA,qBAAqB;AAAA;AAAA;AAAA;AAXO,CAAD,CAA/B;AAkBA,eAAeH,QAAf","sourcesContent":["import { defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n errorFetchAnnotation: {\n id: 'be.annotattionThread.errorFetchAnnotation',\n description: 'Error message when an annotation fetch fails',\n defaultMessage: 'The annotation could not be fetched.',\n },\n errorEditAnnotation: {\n id: 'be.annotationThread.errorEditAnnotation',\n description: 'Error message when an annotation update fails',\n defaultMessage: 'This annotation could not be modified.',\n },\n errorDeleteAnnotation: {\n id: 'be.annotationThread.errorDeleteAnnotation',\n description: 'Error message when an annotation deletion fails',\n defaultMessage: 'There was an error deleting this item.',\n },\n});\n\nexport default messages;\n"],"file":"messages.js"}
|