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
|
@@ -2,6 +2,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
+
|
|
5
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
10
|
|
|
7
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -24,6 +28,7 @@ import * as React from 'react';
|
|
|
24
28
|
import getProp from 'lodash/get';
|
|
25
29
|
import noop from 'lodash/noop';
|
|
26
30
|
import { matchPath } from 'react-router-dom';
|
|
31
|
+
import { FEED_ITEM_TYPE_VERSION } from '../../constants';
|
|
27
32
|
import { getBadUserError } from '../../utils/error';
|
|
28
33
|
export default function withSidebarAnnotations(WrappedComponent) {
|
|
29
34
|
var WithSidebarAnnotations =
|
|
@@ -101,7 +106,7 @@ export default function withSidebarAnnotations(WrappedComponent) {
|
|
|
101
106
|
feedItems = _ref$items === void 0 ? [] : _ref$items;
|
|
102
107
|
|
|
103
108
|
var version = feedItems.filter(function (item) {
|
|
104
|
-
return item.type ===
|
|
109
|
+
return item.type === FEED_ITEM_TYPE_VERSION;
|
|
105
110
|
}).find(function (item) {
|
|
106
111
|
return item.id === fileVersionId;
|
|
107
112
|
});
|
|
@@ -116,6 +121,19 @@ export default function withSidebarAnnotations(WrappedComponent) {
|
|
|
116
121
|
}
|
|
117
122
|
});
|
|
118
123
|
|
|
124
|
+
_defineProperty(_assertThisInitialized(_this), "refreshActivitySidebar", function () {
|
|
125
|
+
var _this$props4 = _this.props,
|
|
126
|
+
isOpen = _this$props4.isOpen,
|
|
127
|
+
location = _this$props4.location;
|
|
128
|
+
var pathname = getProp(location, 'pathname', '');
|
|
129
|
+
var isActivity = matchPath(pathname, '/activity');
|
|
130
|
+
var current = _this.sidebarPanels.current; // If the activity sidebar is currently open, then force it to refresh with the updated data
|
|
131
|
+
|
|
132
|
+
if (current && isActivity && isOpen) {
|
|
133
|
+
current.refresh(false);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
119
137
|
_this.redirectDeeplinkedAnnotation();
|
|
120
138
|
|
|
121
139
|
return _this;
|
|
@@ -124,16 +142,17 @@ export default function withSidebarAnnotations(WrappedComponent) {
|
|
|
124
142
|
_createClass(WithSidebarAnnotations, [{
|
|
125
143
|
key: "componentDidUpdate",
|
|
126
144
|
value: function componentDidUpdate(prevProps) {
|
|
127
|
-
var _this$
|
|
128
|
-
annotatorState = _this$
|
|
129
|
-
fileId = _this$
|
|
130
|
-
getAnnotationsMatchPath = _this$
|
|
131
|
-
location = _this$
|
|
132
|
-
onVersionChange = _this$
|
|
145
|
+
var _this$props5 = this.props,
|
|
146
|
+
annotatorState = _this$props5.annotatorState,
|
|
147
|
+
fileId = _this$props5.fileId,
|
|
148
|
+
getAnnotationsMatchPath = _this$props5.getAnnotationsMatchPath,
|
|
149
|
+
location = _this$props5.location,
|
|
150
|
+
onVersionChange = _this$props5.onVersionChange;
|
|
133
151
|
var prevAnnotatorState = prevProps.annotatorState,
|
|
134
152
|
prevFileId = prevProps.fileId,
|
|
135
153
|
prevLocation = prevProps.location;
|
|
136
|
-
var
|
|
154
|
+
var action = annotatorState.action,
|
|
155
|
+
activeAnnotationId = annotatorState.activeAnnotationId,
|
|
137
156
|
annotation = annotatorState.annotation;
|
|
138
157
|
var prevActiveAnnotationId = prevAnnotatorState.activeAnnotationId,
|
|
139
158
|
prevAnnotation = prevAnnotatorState.annotation;
|
|
@@ -145,7 +164,27 @@ export default function withSidebarAnnotations(WrappedComponent) {
|
|
|
145
164
|
var isTransitioningToAnnotationPath = activeAnnotationId && !isAnnotationsPath;
|
|
146
165
|
var prevFileVersionId = getProp(prevMatch, 'params.fileVersionId');
|
|
147
166
|
|
|
148
|
-
if (
|
|
167
|
+
if (action === 'reply_create_start' || action === 'reply_create_end') {
|
|
168
|
+
this.addAnnotationReply();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (action === 'reply_delete_start' || action === 'reply_delete_end') {
|
|
172
|
+
this.deleteAnnotationReply();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (action === 'reply_update_start' || action === 'reply_update_end') {
|
|
176
|
+
this.updateAnnotationReply();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (action === 'update_start' || action === 'update_end') {
|
|
180
|
+
this.updateAnnotation();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (action === 'delete_start' || action === 'delete_end') {
|
|
184
|
+
this.deleteAnnotation();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if ((action === 'create_start' || action === 'create_end') && annotation && prevAnnotation !== annotation) {
|
|
149
188
|
this.addAnnotation();
|
|
150
189
|
} // Active annotation id changed. If location is currently an annotation path or
|
|
151
190
|
// if location is not currently an annotation path but the active annotation id
|
|
@@ -169,19 +208,17 @@ export default function withSidebarAnnotations(WrappedComponent) {
|
|
|
169
208
|
}, {
|
|
170
209
|
key: "addAnnotation",
|
|
171
210
|
value: function addAnnotation() {
|
|
172
|
-
var _this$
|
|
173
|
-
_this$
|
|
174
|
-
action = _this$
|
|
175
|
-
annotation = _this$
|
|
176
|
-
_this$
|
|
177
|
-
_this$
|
|
178
|
-
var requestId = _this$
|
|
179
|
-
api = _this$
|
|
180
|
-
currentUser = _this$
|
|
181
|
-
file = _this$
|
|
182
|
-
fileId = _this$
|
|
183
|
-
isOpen = _this$props5.isOpen,
|
|
184
|
-
location = _this$props5.location;
|
|
211
|
+
var _this$props6 = this.props,
|
|
212
|
+
_this$props6$annotato = _this$props6.annotatorState,
|
|
213
|
+
action = _this$props6$annotato.action,
|
|
214
|
+
annotation = _this$props6$annotato.annotation,
|
|
215
|
+
_this$props6$annotato2 = _this$props6$annotato.meta;
|
|
216
|
+
_this$props6$annotato2 = _this$props6$annotato2 === void 0 ? {} : _this$props6$annotato2;
|
|
217
|
+
var requestId = _this$props6$annotato2.requestId,
|
|
218
|
+
api = _this$props6.api,
|
|
219
|
+
currentUser = _this$props6.currentUser,
|
|
220
|
+
file = _this$props6.file,
|
|
221
|
+
fileId = _this$props6.fileId;
|
|
185
222
|
|
|
186
223
|
if (!requestId) {
|
|
187
224
|
return;
|
|
@@ -193,24 +230,172 @@ export default function withSidebarAnnotations(WrappedComponent) {
|
|
|
193
230
|
}
|
|
194
231
|
|
|
195
232
|
var feedAPI = api.getFeedAPI(false);
|
|
196
|
-
var pathname = getProp(location, 'pathname', '');
|
|
197
|
-
var isActivity = matchPath(pathname, '/activity');
|
|
198
233
|
var isPending = action === 'create_start';
|
|
199
234
|
|
|
200
235
|
var _ref2 = feedAPI.getCachedItems(fileId) || {},
|
|
201
|
-
hasItems = _ref2.items;
|
|
202
|
-
|
|
203
|
-
var current = this.sidebarPanels.current; // If there are existing items in the cache for this file, then patch the cache with the new annotation
|
|
236
|
+
hasItems = _ref2.items; // If there are existing items in the cache for this file, then patch the cache with the new annotation
|
|
204
237
|
// If there are no cache entry for feeditems, then it is assumed that it has not yet been fetched.
|
|
205
238
|
|
|
239
|
+
|
|
206
240
|
if (hasItems) {
|
|
207
241
|
feedAPI.addAnnotation(file, currentUser, annotation, requestId, isPending);
|
|
208
|
-
}
|
|
242
|
+
}
|
|
209
243
|
|
|
244
|
+
this.refreshActivitySidebar();
|
|
245
|
+
}
|
|
246
|
+
}, {
|
|
247
|
+
key: "addAnnotationReply",
|
|
248
|
+
value: function addAnnotationReply() {
|
|
249
|
+
var _this$props7 = this.props,
|
|
250
|
+
_this$props7$annotato = _this$props7.annotatorState,
|
|
251
|
+
action = _this$props7$annotato.action,
|
|
252
|
+
annotationId = _this$props7$annotato.annotation.id,
|
|
253
|
+
annotationReply = _this$props7$annotato.annotationReply,
|
|
254
|
+
requestId = _this$props7$annotato.meta.requestId,
|
|
255
|
+
api = _this$props7.api,
|
|
256
|
+
currentUser = _this$props7.currentUser,
|
|
257
|
+
file = _this$props7.file;
|
|
210
258
|
|
|
211
|
-
if (
|
|
212
|
-
|
|
259
|
+
if (!currentUser) {
|
|
260
|
+
throw getBadUserError();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
var feedAPI = api.getFeedAPI(false);
|
|
264
|
+
feedAPI.file = file;
|
|
265
|
+
|
|
266
|
+
if (action === 'reply_create_start') {
|
|
267
|
+
feedAPI.addPendingReply(annotationId, currentUser, _objectSpread({}, annotationReply, {
|
|
268
|
+
id: requestId
|
|
269
|
+
}));
|
|
270
|
+
} else {
|
|
271
|
+
var _ref3 = feedAPI.getCachedItems(file.id) || {},
|
|
272
|
+
_ref3$items = _ref3.items,
|
|
273
|
+
feedItems = _ref3$items === void 0 ? [] : _ref3$items;
|
|
274
|
+
|
|
275
|
+
var annotationItem = feedItems.find(function (_ref4) {
|
|
276
|
+
var id = _ref4.id;
|
|
277
|
+
return id === annotationId;
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
if (!annotationItem) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
feedAPI.updateFeedItem({
|
|
285
|
+
total_reply_count: annotationItem.total_reply_count + 1
|
|
286
|
+
}, annotationId);
|
|
287
|
+
feedAPI.updateReplyItem(_objectSpread({}, annotationReply, {
|
|
288
|
+
isPending: false
|
|
289
|
+
}), annotationId, requestId);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
this.refreshActivitySidebar();
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
key: "deleteAnnotation",
|
|
296
|
+
value: function deleteAnnotation() {
|
|
297
|
+
var _this$props8 = this.props,
|
|
298
|
+
_this$props8$annotato = _this$props8.annotatorState,
|
|
299
|
+
action = _this$props8$annotato.action,
|
|
300
|
+
annotation = _this$props8$annotato.annotation,
|
|
301
|
+
api = _this$props8.api,
|
|
302
|
+
file = _this$props8.file;
|
|
303
|
+
var feedAPI = api.getFeedAPI(false);
|
|
304
|
+
feedAPI.file = file;
|
|
305
|
+
|
|
306
|
+
if (action === 'delete_start') {
|
|
307
|
+
feedAPI.updateFeedItem({
|
|
308
|
+
isPending: true
|
|
309
|
+
}, annotation.id);
|
|
310
|
+
} else {
|
|
311
|
+
feedAPI.deleteFeedItem(annotation.id);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
this.refreshActivitySidebar();
|
|
315
|
+
}
|
|
316
|
+
}, {
|
|
317
|
+
key: "deleteAnnotationReply",
|
|
318
|
+
value: function deleteAnnotationReply() {
|
|
319
|
+
var _this$props9 = this.props,
|
|
320
|
+
_this$props9$annotato = _this$props9.annotatorState,
|
|
321
|
+
action = _this$props9$annotato.action,
|
|
322
|
+
annotationId = _this$props9$annotato.annotation.id,
|
|
323
|
+
replyId = _this$props9$annotato.annotationReply.id,
|
|
324
|
+
api = _this$props9.api,
|
|
325
|
+
file = _this$props9.file;
|
|
326
|
+
var feedAPI = api.getFeedAPI(false);
|
|
327
|
+
feedAPI.file = file;
|
|
328
|
+
|
|
329
|
+
if (action === 'reply_delete_start') {
|
|
330
|
+
feedAPI.updateReplyItem({
|
|
331
|
+
isPending: true
|
|
332
|
+
}, annotationId, replyId);
|
|
333
|
+
} else {
|
|
334
|
+
var _ref5 = feedAPI.getCachedItems(file.id) || {},
|
|
335
|
+
_ref5$items = _ref5.items,
|
|
336
|
+
feedItems = _ref5$items === void 0 ? [] : _ref5$items;
|
|
337
|
+
|
|
338
|
+
var annotationItem = feedItems.find(function (_ref6) {
|
|
339
|
+
var id = _ref6.id;
|
|
340
|
+
return id === annotationId;
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
if (!annotationItem) {
|
|
344
|
+
return;
|
|
345
|
+
} // Check if the parent annotation has the reply currently visible
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
var replyItem = annotationItem.replies.find(function (_ref7) {
|
|
349
|
+
var id = _ref7.id;
|
|
350
|
+
return id === replyId;
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
if (replyItem) {
|
|
354
|
+
feedAPI.deleteReplyItem(replyId, annotationId);
|
|
355
|
+
} else if (annotationItem.total_reply_count > 0) {
|
|
356
|
+
// Decrease the amount of replies by 1
|
|
357
|
+
feedAPI.updateFeedItem({
|
|
358
|
+
total_reply_count: annotationItem.total_reply_count - 1
|
|
359
|
+
}, annotationId);
|
|
360
|
+
}
|
|
213
361
|
}
|
|
362
|
+
|
|
363
|
+
this.refreshActivitySidebar();
|
|
364
|
+
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "updateAnnotation",
|
|
367
|
+
value: function updateAnnotation() {
|
|
368
|
+
var _this$props10 = this.props,
|
|
369
|
+
_this$props10$annotat = _this$props10.annotatorState,
|
|
370
|
+
action = _this$props10$annotat.action,
|
|
371
|
+
annotation = _this$props10$annotat.annotation,
|
|
372
|
+
api = _this$props10.api,
|
|
373
|
+
file = _this$props10.file;
|
|
374
|
+
var feedAPI = api.getFeedAPI(false);
|
|
375
|
+
var isPending = action === 'update_start';
|
|
376
|
+
feedAPI.file = file;
|
|
377
|
+
feedAPI.updateFeedItem(_objectSpread({}, annotation, {
|
|
378
|
+
isPending: isPending
|
|
379
|
+
}), annotation.id);
|
|
380
|
+
this.refreshActivitySidebar();
|
|
381
|
+
}
|
|
382
|
+
}, {
|
|
383
|
+
key: "updateAnnotationReply",
|
|
384
|
+
value: function updateAnnotationReply() {
|
|
385
|
+
var _this$props11 = this.props,
|
|
386
|
+
_this$props11$annotat = _this$props11.annotatorState,
|
|
387
|
+
action = _this$props11$annotat.action,
|
|
388
|
+
annotation = _this$props11$annotat.annotation,
|
|
389
|
+
annotationReply = _this$props11$annotat.annotationReply,
|
|
390
|
+
api = _this$props11.api,
|
|
391
|
+
file = _this$props11.file;
|
|
392
|
+
var feedAPI = api.getFeedAPI(false);
|
|
393
|
+
var isPending = action === 'reply_update_start';
|
|
394
|
+
feedAPI.file = file;
|
|
395
|
+
feedAPI.updateReplyItem(_objectSpread({}, annotationReply, {
|
|
396
|
+
isPending: isPending
|
|
397
|
+
}), annotation.id, annotationReply.id);
|
|
398
|
+
this.refreshActivitySidebar();
|
|
214
399
|
}
|
|
215
400
|
}, {
|
|
216
401
|
key: "render",
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import getProp from 'lodash/get';
|
|
4
4
|
import noop from 'lodash/noop';
|
|
5
5
|
import { matchPath, type ContextRouter } from 'react-router-dom';
|
|
6
|
+
import { FEED_ITEM_TYPE_VERSION } from '../../constants';
|
|
6
7
|
import { getBadUserError } from '../../utils/error';
|
|
7
8
|
import type { WithAnnotatorContextProps } from '../common/annotator-context';
|
|
8
9
|
import type { BoxItem, User } from '../../common/types/core';
|
|
@@ -58,7 +59,7 @@ export default function withSidebarAnnotations(
|
|
|
58
59
|
componentDidUpdate(prevProps: Props) {
|
|
59
60
|
const { annotatorState, fileId, getAnnotationsMatchPath, location, onVersionChange }: Props = this.props;
|
|
60
61
|
const { annotatorState: prevAnnotatorState, fileId: prevFileId, location: prevLocation }: Props = prevProps;
|
|
61
|
-
const { activeAnnotationId, annotation } = annotatorState;
|
|
62
|
+
const { action, activeAnnotationId, annotation } = annotatorState;
|
|
62
63
|
const { activeAnnotationId: prevActiveAnnotationId, annotation: prevAnnotation } = prevAnnotatorState;
|
|
63
64
|
|
|
64
65
|
const match = getAnnotationsMatchPath(location);
|
|
@@ -69,7 +70,27 @@ export default function withSidebarAnnotations(
|
|
|
69
70
|
const isTransitioningToAnnotationPath = activeAnnotationId && !isAnnotationsPath;
|
|
70
71
|
const prevFileVersionId = getProp(prevMatch, 'params.fileVersionId');
|
|
71
72
|
|
|
72
|
-
if (
|
|
73
|
+
if (action === 'reply_create_start' || action === 'reply_create_end') {
|
|
74
|
+
this.addAnnotationReply();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (action === 'reply_delete_start' || action === 'reply_delete_end') {
|
|
78
|
+
this.deleteAnnotationReply();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (action === 'reply_update_start' || action === 'reply_update_end') {
|
|
82
|
+
this.updateAnnotationReply();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (action === 'update_start' || action === 'update_end') {
|
|
86
|
+
this.updateAnnotation();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (action === 'delete_start' || action === 'delete_end') {
|
|
90
|
+
this.deleteAnnotation();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if ((action === 'create_start' || action === 'create_end') && annotation && prevAnnotation !== annotation) {
|
|
73
94
|
this.addAnnotation();
|
|
74
95
|
}
|
|
75
96
|
|
|
@@ -98,8 +119,6 @@ export default function withSidebarAnnotations(
|
|
|
98
119
|
currentUser,
|
|
99
120
|
file,
|
|
100
121
|
fileId,
|
|
101
|
-
isOpen,
|
|
102
|
-
location,
|
|
103
122
|
} = this.props;
|
|
104
123
|
|
|
105
124
|
if (!requestId) {
|
|
@@ -112,11 +131,8 @@ export default function withSidebarAnnotations(
|
|
|
112
131
|
}
|
|
113
132
|
|
|
114
133
|
const feedAPI = api.getFeedAPI(false);
|
|
115
|
-
const pathname = getProp(location, 'pathname', '');
|
|
116
|
-
const isActivity = matchPath(pathname, '/activity');
|
|
117
134
|
const isPending = action === 'create_start';
|
|
118
135
|
const { items: hasItems } = feedAPI.getCachedItems(fileId) || {};
|
|
119
|
-
const { current } = this.sidebarPanels;
|
|
120
136
|
|
|
121
137
|
// If there are existing items in the cache for this file, then patch the cache with the new annotation
|
|
122
138
|
// If there are no cache entry for feeditems, then it is assumed that it has not yet been fetched.
|
|
@@ -124,10 +140,132 @@ export default function withSidebarAnnotations(
|
|
|
124
140
|
feedAPI.addAnnotation(file, currentUser, annotation, requestId, isPending);
|
|
125
141
|
}
|
|
126
142
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
143
|
+
this.refreshActivitySidebar();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
addAnnotationReply() {
|
|
147
|
+
const {
|
|
148
|
+
annotatorState: {
|
|
149
|
+
action,
|
|
150
|
+
annotation: { id: annotationId },
|
|
151
|
+
annotationReply,
|
|
152
|
+
meta: { requestId },
|
|
153
|
+
},
|
|
154
|
+
api,
|
|
155
|
+
currentUser,
|
|
156
|
+
file,
|
|
157
|
+
} = this.props;
|
|
158
|
+
|
|
159
|
+
if (!currentUser) {
|
|
160
|
+
throw getBadUserError();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const feedAPI = api.getFeedAPI(false);
|
|
164
|
+
feedAPI.file = file;
|
|
165
|
+
|
|
166
|
+
if (action === 'reply_create_start') {
|
|
167
|
+
feedAPI.addPendingReply(annotationId, currentUser, { ...annotationReply, id: requestId });
|
|
168
|
+
} else {
|
|
169
|
+
const { items: feedItems = [] } = feedAPI.getCachedItems(file.id) || {};
|
|
170
|
+
const annotationItem = feedItems.find(({ id }) => id === annotationId);
|
|
171
|
+
|
|
172
|
+
if (!annotationItem) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
feedAPI.updateFeedItem({ total_reply_count: annotationItem.total_reply_count + 1 }, annotationId);
|
|
177
|
+
feedAPI.updateReplyItem({ ...annotationReply, isPending: false }, annotationId, requestId);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
this.refreshActivitySidebar();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
deleteAnnotation() {
|
|
184
|
+
const {
|
|
185
|
+
annotatorState: { action, annotation },
|
|
186
|
+
api,
|
|
187
|
+
file,
|
|
188
|
+
} = this.props;
|
|
189
|
+
|
|
190
|
+
const feedAPI = api.getFeedAPI(false);
|
|
191
|
+
feedAPI.file = file;
|
|
192
|
+
|
|
193
|
+
if (action === 'delete_start') {
|
|
194
|
+
feedAPI.updateFeedItem({ isPending: true }, annotation.id);
|
|
195
|
+
} else {
|
|
196
|
+
feedAPI.deleteFeedItem(annotation.id);
|
|
130
197
|
}
|
|
198
|
+
|
|
199
|
+
this.refreshActivitySidebar();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
deleteAnnotationReply() {
|
|
203
|
+
const {
|
|
204
|
+
annotatorState: {
|
|
205
|
+
action,
|
|
206
|
+
annotation: { id: annotationId },
|
|
207
|
+
annotationReply: { id: replyId },
|
|
208
|
+
},
|
|
209
|
+
api,
|
|
210
|
+
file,
|
|
211
|
+
} = this.props;
|
|
212
|
+
|
|
213
|
+
const feedAPI = api.getFeedAPI(false);
|
|
214
|
+
feedAPI.file = file;
|
|
215
|
+
|
|
216
|
+
if (action === 'reply_delete_start') {
|
|
217
|
+
feedAPI.updateReplyItem({ isPending: true }, annotationId, replyId);
|
|
218
|
+
} else {
|
|
219
|
+
const { items: feedItems = [] } = feedAPI.getCachedItems(file.id) || {};
|
|
220
|
+
const annotationItem = feedItems.find(({ id }) => id === annotationId);
|
|
221
|
+
|
|
222
|
+
if (!annotationItem) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Check if the parent annotation has the reply currently visible
|
|
227
|
+
const replyItem = annotationItem.replies.find(({ id }) => id === replyId);
|
|
228
|
+
if (replyItem) {
|
|
229
|
+
feedAPI.deleteReplyItem(replyId, annotationId);
|
|
230
|
+
} else if (annotationItem.total_reply_count > 0) {
|
|
231
|
+
// Decrease the amount of replies by 1
|
|
232
|
+
feedAPI.updateFeedItem({ total_reply_count: annotationItem.total_reply_count - 1 }, annotationId);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
this.refreshActivitySidebar();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
updateAnnotation() {
|
|
240
|
+
const {
|
|
241
|
+
annotatorState: { action, annotation },
|
|
242
|
+
api,
|
|
243
|
+
file,
|
|
244
|
+
} = this.props;
|
|
245
|
+
|
|
246
|
+
const feedAPI = api.getFeedAPI(false);
|
|
247
|
+
const isPending = action === 'update_start';
|
|
248
|
+
feedAPI.file = file;
|
|
249
|
+
|
|
250
|
+
feedAPI.updateFeedItem({ ...annotation, isPending }, annotation.id);
|
|
251
|
+
|
|
252
|
+
this.refreshActivitySidebar();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
updateAnnotationReply() {
|
|
256
|
+
const {
|
|
257
|
+
annotatorState: { action, annotation, annotationReply },
|
|
258
|
+
api,
|
|
259
|
+
file,
|
|
260
|
+
} = this.props;
|
|
261
|
+
|
|
262
|
+
const feedAPI = api.getFeedAPI(false);
|
|
263
|
+
const isPending = action === 'reply_update_start';
|
|
264
|
+
feedAPI.file = file;
|
|
265
|
+
|
|
266
|
+
feedAPI.updateReplyItem({ ...annotationReply, isPending }, annotation.id, annotationReply.id);
|
|
267
|
+
|
|
268
|
+
this.refreshActivitySidebar();
|
|
131
269
|
}
|
|
132
270
|
|
|
133
271
|
updateActiveAnnotation = () => {
|
|
@@ -169,7 +307,7 @@ export default function withSidebarAnnotations(
|
|
|
169
307
|
const fileVersionId = getProp(match, 'params.fileVersionId');
|
|
170
308
|
const { items: feedItems = [] } = feedAPI.getCachedItems(fileId) || {};
|
|
171
309
|
const version = feedItems
|
|
172
|
-
.filter(item => item.type ===
|
|
310
|
+
.filter(item => item.type === FEED_ITEM_TYPE_VERSION)
|
|
173
311
|
.find(item => item.id === fileVersionId);
|
|
174
312
|
|
|
175
313
|
if (version) {
|
|
@@ -180,6 +318,19 @@ export default function withSidebarAnnotations(
|
|
|
180
318
|
}
|
|
181
319
|
};
|
|
182
320
|
|
|
321
|
+
refreshActivitySidebar = () => {
|
|
322
|
+
const { isOpen, location } = this.props;
|
|
323
|
+
|
|
324
|
+
const pathname = getProp(location, 'pathname', '');
|
|
325
|
+
const isActivity = matchPath(pathname, '/activity');
|
|
326
|
+
const { current } = this.sidebarPanels;
|
|
327
|
+
|
|
328
|
+
// If the activity sidebar is currently open, then force it to refresh with the updated data
|
|
329
|
+
if (current && isActivity && isOpen) {
|
|
330
|
+
current.refresh(false);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
183
334
|
render() {
|
|
184
335
|
return <WrappedComponent ref={this.sidebarPanels} {...this.props} />;
|
|
185
336
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/content-sidebar/withSidebarAnnotations.js"],"names":["React","getProp","noop","matchPath","getBadUserError","withSidebarAnnotations","WrappedComponent","WithSidebarAnnotations","props","createRef","file","getAnnotationsPath","getAnnotationsMatchPath","history","location","match","annotationId","currentFileVersionId","fileVersionId","replace","annotatorState","activeAnnotationFileVersionId","activeAnnotationId","defaultFileVersionId","newLocationState","open","state","push","pathname","api","fileId","onVersionChange","feedAPI","getFeedAPI","getCachedItems","items","feedItems","version","filter","item","type","find","id","currentVersionId","updateVersionToCurrent","redirectDeeplinkedAnnotation","prevProps","prevAnnotatorState","prevFileId","prevLocation","annotation","prevActiveAnnotationId","prevAnnotation","prevMatch","hasActiveAnnotationChanged","isAnnotationsPath","isTransitioningToAnnotationPath","prevFileVersionId","addAnnotation","updateActiveAnnotation","updateActiveVersion","action","meta","requestId","currentUser","isOpen","isActivity","isPending","hasItems","current","sidebarPanels","refresh","Component","displayName","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,SAASC,SAAT,QAA8C,kBAA9C;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAiBA,eAAe,SAASC,sBAAT,CACXC,gBADW,EAEe;AAAA,MACpBC,sB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lodash/get';\nimport noop from 'lodash/noop';\nimport { matchPath, type ContextRouter } from 'react-router-dom';\nimport { getBadUserError } from '../../utils/error';\nimport type { WithAnnotatorContextProps } from '../common/annotator-context';\nimport type { BoxItem, User } from '../../common/types/core';\n\ntype Props = {\n ...ContextRouter,\n currentUser?: User,\n file: BoxItem,\n fileId: string,\n isOpen: boolean,\n onVersionChange: Function,\n} & WithAnnotatorContextProps;\n\ntype SidebarPanelsRefType = {\n refresh: (shouldRefreshCache?: boolean) => void,\n};\n\nexport default function withSidebarAnnotations(\n WrappedComponent: React.ComponentType<Props>,\n): React.ComponentType<Props> {\n class WithSidebarAnnotations extends React.Component<Props> {\n static defaultProps = {\n annotatorState: {},\n getAnnotationsMatchPath: noop,\n getAnnotationsPath: noop,\n onVersionChange: noop,\n };\n\n static displayName: ?string;\n\n props: Props;\n\n sidebarPanels: { current: SidebarPanelsRefType | null } = React.createRef();\n\n constructor(props) {\n super(props);\n\n this.redirectDeeplinkedAnnotation();\n }\n\n redirectDeeplinkedAnnotation = () => {\n const { file, getAnnotationsPath, getAnnotationsMatchPath, history, location } = this.props;\n const match = getAnnotationsMatchPath(location);\n const annotationId = getProp(match, 'params.annotationId');\n const currentFileVersionId = getProp(file, 'file_version.id');\n const fileVersionId = getProp(match, 'params.fileVersionId');\n\n if (fileVersionId && fileVersionId !== currentFileVersionId) {\n history.replace(getAnnotationsPath(currentFileVersionId, annotationId));\n }\n };\n\n componentDidUpdate(prevProps: Props) {\n const { annotatorState, fileId, getAnnotationsMatchPath, location, onVersionChange }: Props = this.props;\n const { annotatorState: prevAnnotatorState, fileId: prevFileId, location: prevLocation }: Props = prevProps;\n const { activeAnnotationId, annotation } = annotatorState;\n const { activeAnnotationId: prevActiveAnnotationId, annotation: prevAnnotation } = prevAnnotatorState;\n\n const match = getAnnotationsMatchPath(location);\n const prevMatch = getAnnotationsMatchPath(prevLocation);\n const fileVersionId = getProp(match, 'params.fileVersionId');\n const hasActiveAnnotationChanged = prevActiveAnnotationId !== activeAnnotationId;\n const isAnnotationsPath = !!match;\n const isTransitioningToAnnotationPath = activeAnnotationId && !isAnnotationsPath;\n const prevFileVersionId = getProp(prevMatch, 'params.fileVersionId');\n\n if (annotation && prevAnnotation !== annotation) {\n this.addAnnotation();\n }\n\n // Active annotation id changed. If location is currently an annotation path or\n // if location is not currently an annotation path but the active annotation id\n // transitioned from falsy to truthy, update the location accordingly\n if (hasActiveAnnotationChanged && (isAnnotationsPath || isTransitioningToAnnotationPath)) {\n this.updateActiveAnnotation();\n }\n\n if (fileVersionId && prevFileVersionId !== fileVersionId) {\n this.updateActiveVersion();\n }\n\n if (prevFileId !== fileId) {\n // If the file id has changed, reset the current version id since the previous (possibly versioned)\n // location is no longer active\n onVersionChange(null);\n }\n }\n\n addAnnotation() {\n const {\n annotatorState: { action, annotation, meta: { requestId } = {} },\n api,\n currentUser,\n file,\n fileId,\n isOpen,\n location,\n } = this.props;\n\n if (!requestId) {\n return;\n }\n\n // TODO: need to address in follow on -- currentUser may be undefined here but is never fetched for sure until ActivitySidebar\n if (!currentUser) {\n throw getBadUserError();\n }\n\n const feedAPI = api.getFeedAPI(false);\n const pathname = getProp(location, 'pathname', '');\n const isActivity = matchPath(pathname, '/activity');\n const isPending = action === 'create_start';\n const { items: hasItems } = feedAPI.getCachedItems(fileId) || {};\n const { current } = this.sidebarPanels;\n\n // If there are existing items in the cache for this file, then patch the cache with the new annotation\n // If there are no cache entry for feeditems, then it is assumed that it has not yet been fetched.\n if (hasItems) {\n feedAPI.addAnnotation(file, currentUser, annotation, requestId, isPending);\n }\n\n // If the activity sidebar is currently open, then force it to refresh with the updated data\n if (current && isActivity && isOpen) {\n current.refresh(false);\n }\n }\n\n updateActiveAnnotation = () => {\n const {\n annotatorState: { activeAnnotationFileVersionId, activeAnnotationId },\n file,\n getAnnotationsMatchPath,\n getAnnotationsPath,\n history,\n location,\n } = this.props;\n const match = getAnnotationsMatchPath(location);\n const currentFileVersionId = getProp(file, 'file_version.id');\n const defaultFileVersionId = activeAnnotationFileVersionId || currentFileVersionId;\n const fileVersionId = getProp(match, 'params.fileVersionId', defaultFileVersionId);\n const newLocationState = activeAnnotationId ? { open: true } : location.state;\n\n // Update the location pathname and open state if transitioning to an active annotation id, force the sidebar open\n history.push({\n pathname: getAnnotationsPath(fileVersionId, activeAnnotationId),\n state: newLocationState,\n });\n };\n\n updateActiveVersion = () => {\n const {\n api,\n file,\n fileId,\n getAnnotationsMatchPath,\n getAnnotationsPath,\n history,\n location,\n onVersionChange,\n } = this.props;\n const feedAPI = api.getFeedAPI(false);\n const match = getAnnotationsMatchPath(location);\n const currentFileVersionId = getProp(file, 'file_version.id');\n const fileVersionId = getProp(match, 'params.fileVersionId');\n const { items: feedItems = [] } = feedAPI.getCachedItems(fileId) || {};\n const version = feedItems\n .filter(item => item.type === 'file_version')\n .find(item => item.id === fileVersionId);\n\n if (version) {\n onVersionChange(version, {\n currentVersionId: currentFileVersionId,\n updateVersionToCurrent: () => history.push(getAnnotationsPath(currentFileVersionId)),\n });\n }\n };\n\n render() {\n return <WrappedComponent ref={this.sidebarPanels} {...this.props} />;\n }\n }\n\n const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n WithSidebarAnnotations.displayName = `WithSidebarAnnotations(${displayName})`;\n\n return WithSidebarAnnotations;\n}\n"],"file":"withSidebarAnnotations.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/content-sidebar/withSidebarAnnotations.js"],"names":["React","getProp","noop","matchPath","FEED_ITEM_TYPE_VERSION","getBadUserError","withSidebarAnnotations","WrappedComponent","WithSidebarAnnotations","props","createRef","file","getAnnotationsPath","getAnnotationsMatchPath","history","location","match","annotationId","currentFileVersionId","fileVersionId","replace","annotatorState","activeAnnotationFileVersionId","activeAnnotationId","defaultFileVersionId","newLocationState","open","state","push","pathname","api","fileId","onVersionChange","feedAPI","getFeedAPI","getCachedItems","items","feedItems","version","filter","item","type","find","id","currentVersionId","updateVersionToCurrent","isOpen","isActivity","current","sidebarPanels","refresh","redirectDeeplinkedAnnotation","prevProps","prevAnnotatorState","prevFileId","prevLocation","action","annotation","prevActiveAnnotationId","prevAnnotation","prevMatch","hasActiveAnnotationChanged","isAnnotationsPath","isTransitioningToAnnotationPath","prevFileVersionId","addAnnotationReply","deleteAnnotationReply","updateAnnotationReply","updateAnnotation","deleteAnnotation","addAnnotation","updateActiveAnnotation","updateActiveVersion","meta","requestId","currentUser","isPending","hasItems","refreshActivitySidebar","annotationReply","addPendingReply","annotationItem","updateFeedItem","total_reply_count","updateReplyItem","deleteFeedItem","replyId","replyItem","replies","deleteReplyItem","Component","displayName","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,SAASC,SAAT,QAA8C,kBAA9C;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAiBA,eAAe,SAASC,sBAAT,CACXC,gBADW,EAEe;AAAA,MACpBC,sBADoB;AAAA;AAAA;AAAA;;AAetB,oCAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACf,kGAAMA,KAAN;;AADe,sEAFuCT,KAAK,CAACU,SAAN,EAEvC;;AAAA,qFAMY,YAAM;AAAA,0BACgD,MAAKD,KADrD;AAAA,YACzBE,IADyB,eACzBA,IADyB;AAAA,YACnBC,kBADmB,eACnBA,kBADmB;AAAA,YACCC,uBADD,eACCA,uBADD;AAAA,YAC0BC,OAD1B,eAC0BA,OAD1B;AAAA,YACmCC,QADnC,eACmCA,QADnC;AAEjC,YAAMC,KAAK,GAAGH,uBAAuB,CAACE,QAAD,CAArC;AACA,YAAME,YAAY,GAAGhB,OAAO,CAACe,KAAD,EAAQ,qBAAR,CAA5B;AACA,YAAME,oBAAoB,GAAGjB,OAAO,CAACU,IAAD,EAAO,iBAAP,CAApC;AACA,YAAMQ,aAAa,GAAGlB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AACAvB,QAAAA,OAAO,CAACtB,IAAR,GAAeA,IAAf;AAEAsB,QAAAA,OAAO,CAACmD,eAAR,mBAA6BL,eAA7B;AAA8CH,UAAAA,SAAS,EAATA;AAA9C,YAA2DnB,UAAU,CAACd,EAAtE,EAA0EoC,eAAe,CAACpC,EAA1F;AAEA,aAAKmC,sBAAL;AACH;AAnPqB;AAAA;AAAA,+BAoTb;AACL,eAAO,oBAAC,gBAAD;AAAkB,UAAA,GAAG,EAAE,KAAK7B;AAA5B,WAA+C,KAAKxC,KAApD,EAAP;AACH;AAtTqB;;AAAA;AAAA,IACWT,KAAK,CAAC0F,SADjB;;AAAA,kBACpBlF,sBADoB,kBAEA;AAClBa,IAAAA,cAAc,EAAE,EADE;AAElBR,IAAAA,uBAAuB,EAAEX,IAFP;AAGlBU,IAAAA,kBAAkB,EAAEV,IAHF;AAIlB8B,IAAAA,eAAe,EAAE9B;AAJC,GAFA;;AAyT1B,MAAMyF,WAAW,GAAGpF,gBAAgB,CAACoF,WAAjB,IAAgCpF,gBAAgB,CAACqF,IAAjD,IAAyD,WAA7E;AACApF,EAAAA,sBAAsB,CAACmF,WAAvB,oCAA+DA,WAA/D;AAEA,SAAOnF,sBAAP;AACH","sourcesContent":["// @flow\nimport * as React from 'react';\nimport getProp from 'lodash/get';\nimport noop from 'lodash/noop';\nimport { matchPath, type ContextRouter } from 'react-router-dom';\nimport { FEED_ITEM_TYPE_VERSION } from '../../constants';\nimport { getBadUserError } from '../../utils/error';\nimport type { WithAnnotatorContextProps } from '../common/annotator-context';\nimport type { BoxItem, User } from '../../common/types/core';\n\ntype Props = {\n ...ContextRouter,\n currentUser?: User,\n file: BoxItem,\n fileId: string,\n isOpen: boolean,\n onVersionChange: Function,\n} & WithAnnotatorContextProps;\n\ntype SidebarPanelsRefType = {\n refresh: (shouldRefreshCache?: boolean) => void,\n};\n\nexport default function withSidebarAnnotations(\n WrappedComponent: React.ComponentType<Props>,\n): React.ComponentType<Props> {\n class WithSidebarAnnotations extends React.Component<Props> {\n static defaultProps = {\n annotatorState: {},\n getAnnotationsMatchPath: noop,\n getAnnotationsPath: noop,\n onVersionChange: noop,\n };\n\n static displayName: ?string;\n\n props: Props;\n\n sidebarPanels: { current: SidebarPanelsRefType | null } = React.createRef();\n\n constructor(props) {\n super(props);\n\n this.redirectDeeplinkedAnnotation();\n }\n\n redirectDeeplinkedAnnotation = () => {\n const { file, getAnnotationsPath, getAnnotationsMatchPath, history, location } = this.props;\n const match = getAnnotationsMatchPath(location);\n const annotationId = getProp(match, 'params.annotationId');\n const currentFileVersionId = getProp(file, 'file_version.id');\n const fileVersionId = getProp(match, 'params.fileVersionId');\n\n if (fileVersionId && fileVersionId !== currentFileVersionId) {\n history.replace(getAnnotationsPath(currentFileVersionId, annotationId));\n }\n };\n\n componentDidUpdate(prevProps: Props) {\n const { annotatorState, fileId, getAnnotationsMatchPath, location, onVersionChange }: Props = this.props;\n const { annotatorState: prevAnnotatorState, fileId: prevFileId, location: prevLocation }: Props = prevProps;\n const { action, activeAnnotationId, annotation } = annotatorState;\n const { activeAnnotationId: prevActiveAnnotationId, annotation: prevAnnotation } = prevAnnotatorState;\n\n const match = getAnnotationsMatchPath(location);\n const prevMatch = getAnnotationsMatchPath(prevLocation);\n const fileVersionId = getProp(match, 'params.fileVersionId');\n const hasActiveAnnotationChanged = prevActiveAnnotationId !== activeAnnotationId;\n const isAnnotationsPath = !!match;\n const isTransitioningToAnnotationPath = activeAnnotationId && !isAnnotationsPath;\n const prevFileVersionId = getProp(prevMatch, 'params.fileVersionId');\n\n if (action === 'reply_create_start' || action === 'reply_create_end') {\n this.addAnnotationReply();\n }\n\n if (action === 'reply_delete_start' || action === 'reply_delete_end') {\n this.deleteAnnotationReply();\n }\n\n if (action === 'reply_update_start' || action === 'reply_update_end') {\n this.updateAnnotationReply();\n }\n\n if (action === 'update_start' || action === 'update_end') {\n this.updateAnnotation();\n }\n\n if (action === 'delete_start' || action === 'delete_end') {\n this.deleteAnnotation();\n }\n\n if ((action === 'create_start' || action === 'create_end') && annotation && prevAnnotation !== annotation) {\n this.addAnnotation();\n }\n\n // Active annotation id changed. If location is currently an annotation path or\n // if location is not currently an annotation path but the active annotation id\n // transitioned from falsy to truthy, update the location accordingly\n if (hasActiveAnnotationChanged && (isAnnotationsPath || isTransitioningToAnnotationPath)) {\n this.updateActiveAnnotation();\n }\n\n if (fileVersionId && prevFileVersionId !== fileVersionId) {\n this.updateActiveVersion();\n }\n\n if (prevFileId !== fileId) {\n // If the file id has changed, reset the current version id since the previous (possibly versioned)\n // location is no longer active\n onVersionChange(null);\n }\n }\n\n addAnnotation() {\n const {\n annotatorState: { action, annotation, meta: { requestId } = {} },\n api,\n currentUser,\n file,\n fileId,\n } = this.props;\n\n if (!requestId) {\n return;\n }\n\n // TODO: need to address in follow on -- currentUser may be undefined here but is never fetched for sure until ActivitySidebar\n if (!currentUser) {\n throw getBadUserError();\n }\n\n const feedAPI = api.getFeedAPI(false);\n const isPending = action === 'create_start';\n const { items: hasItems } = feedAPI.getCachedItems(fileId) || {};\n\n // If there are existing items in the cache for this file, then patch the cache with the new annotation\n // If there are no cache entry for feeditems, then it is assumed that it has not yet been fetched.\n if (hasItems) {\n feedAPI.addAnnotation(file, currentUser, annotation, requestId, isPending);\n }\n\n this.refreshActivitySidebar();\n }\n\n addAnnotationReply() {\n const {\n annotatorState: {\n action,\n annotation: { id: annotationId },\n annotationReply,\n meta: { requestId },\n },\n api,\n currentUser,\n file,\n } = this.props;\n\n if (!currentUser) {\n throw getBadUserError();\n }\n\n const feedAPI = api.getFeedAPI(false);\n feedAPI.file = file;\n\n if (action === 'reply_create_start') {\n feedAPI.addPendingReply(annotationId, currentUser, { ...annotationReply, id: requestId });\n } else {\n const { items: feedItems = [] } = feedAPI.getCachedItems(file.id) || {};\n const annotationItem = feedItems.find(({ id }) => id === annotationId);\n\n if (!annotationItem) {\n return;\n }\n\n feedAPI.updateFeedItem({ total_reply_count: annotationItem.total_reply_count + 1 }, annotationId);\n feedAPI.updateReplyItem({ ...annotationReply, isPending: false }, annotationId, requestId);\n }\n\n this.refreshActivitySidebar();\n }\n\n deleteAnnotation() {\n const {\n annotatorState: { action, annotation },\n api,\n file,\n } = this.props;\n\n const feedAPI = api.getFeedAPI(false);\n feedAPI.file = file;\n\n if (action === 'delete_start') {\n feedAPI.updateFeedItem({ isPending: true }, annotation.id);\n } else {\n feedAPI.deleteFeedItem(annotation.id);\n }\n\n this.refreshActivitySidebar();\n }\n\n deleteAnnotationReply() {\n const {\n annotatorState: {\n action,\n annotation: { id: annotationId },\n annotationReply: { id: replyId },\n },\n api,\n file,\n } = this.props;\n\n const feedAPI = api.getFeedAPI(false);\n feedAPI.file = file;\n\n if (action === 'reply_delete_start') {\n feedAPI.updateReplyItem({ isPending: true }, annotationId, replyId);\n } else {\n const { items: feedItems = [] } = feedAPI.getCachedItems(file.id) || {};\n const annotationItem = feedItems.find(({ id }) => id === annotationId);\n\n if (!annotationItem) {\n return;\n }\n\n // Check if the parent annotation has the reply currently visible\n const replyItem = annotationItem.replies.find(({ id }) => id === replyId);\n if (replyItem) {\n feedAPI.deleteReplyItem(replyId, annotationId);\n } else if (annotationItem.total_reply_count > 0) {\n // Decrease the amount of replies by 1\n feedAPI.updateFeedItem({ total_reply_count: annotationItem.total_reply_count - 1 }, annotationId);\n }\n }\n\n this.refreshActivitySidebar();\n }\n\n updateAnnotation() {\n const {\n annotatorState: { action, annotation },\n api,\n file,\n } = this.props;\n\n const feedAPI = api.getFeedAPI(false);\n const isPending = action === 'update_start';\n feedAPI.file = file;\n\n feedAPI.updateFeedItem({ ...annotation, isPending }, annotation.id);\n\n this.refreshActivitySidebar();\n }\n\n updateAnnotationReply() {\n const {\n annotatorState: { action, annotation, annotationReply },\n api,\n file,\n } = this.props;\n\n const feedAPI = api.getFeedAPI(false);\n const isPending = action === 'reply_update_start';\n feedAPI.file = file;\n\n feedAPI.updateReplyItem({ ...annotationReply, isPending }, annotation.id, annotationReply.id);\n\n this.refreshActivitySidebar();\n }\n\n updateActiveAnnotation = () => {\n const {\n annotatorState: { activeAnnotationFileVersionId, activeAnnotationId },\n file,\n getAnnotationsMatchPath,\n getAnnotationsPath,\n history,\n location,\n } = this.props;\n const match = getAnnotationsMatchPath(location);\n const currentFileVersionId = getProp(file, 'file_version.id');\n const defaultFileVersionId = activeAnnotationFileVersionId || currentFileVersionId;\n const fileVersionId = getProp(match, 'params.fileVersionId', defaultFileVersionId);\n const newLocationState = activeAnnotationId ? { open: true } : location.state;\n\n // Update the location pathname and open state if transitioning to an active annotation id, force the sidebar open\n history.push({\n pathname: getAnnotationsPath(fileVersionId, activeAnnotationId),\n state: newLocationState,\n });\n };\n\n updateActiveVersion = () => {\n const {\n api,\n file,\n fileId,\n getAnnotationsMatchPath,\n getAnnotationsPath,\n history,\n location,\n onVersionChange,\n } = this.props;\n const feedAPI = api.getFeedAPI(false);\n const match = getAnnotationsMatchPath(location);\n const currentFileVersionId = getProp(file, 'file_version.id');\n const fileVersionId = getProp(match, 'params.fileVersionId');\n const { items: feedItems = [] } = feedAPI.getCachedItems(fileId) || {};\n const version = feedItems\n .filter(item => item.type === FEED_ITEM_TYPE_VERSION)\n .find(item => item.id === fileVersionId);\n\n if (version) {\n onVersionChange(version, {\n currentVersionId: currentFileVersionId,\n updateVersionToCurrent: () => history.push(getAnnotationsPath(currentFileVersionId)),\n });\n }\n };\n\n refreshActivitySidebar = () => {\n const { isOpen, location } = this.props;\n\n const pathname = getProp(location, 'pathname', '');\n const isActivity = matchPath(pathname, '/activity');\n const { current } = this.sidebarPanels;\n\n // If the activity sidebar is currently open, then force it to refresh with the updated data\n if (current && isActivity && isOpen) {\n current.refresh(false);\n }\n };\n\n render() {\n return <WrappedComponent ref={this.sidebarPanels} {...this.props} />;\n }\n }\n\n const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n WithSidebarAnnotations.displayName = `WithSidebarAnnotations(${displayName})`;\n\n return WithSidebarAnnotations;\n}\n"],"file":"withSidebarAnnotations.js"}
|