box-ui-elements 15.0.0-beta.7 → 15.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/CONTRIBUTING.md +3 -1
- package/dist/explorer.css +1 -1
- package/dist/explorer.js +58 -26
- package/dist/openwith.css +1 -1
- package/dist/openwith.js +10 -17
- package/dist/picker.css +1 -1
- package/dist/picker.js +12 -19
- package/dist/preview.css +1 -1
- package/dist/preview.js +56 -24
- package/dist/sharing.css +1 -1
- package/dist/sharing.js +54 -22
- package/dist/sidebar.css +1 -1
- package/dist/sidebar.js +56 -24
- package/dist/uploader.css +1 -1
- package/dist/uploader.js +12 -19
- package/es/api/uploads/UploadsReachability.js.flow +2 -2
- package/es/api/uploads/UploadsReachability.js.map +1 -1
- package/es/common/messages.js +4 -0
- package/es/common/messages.js.flow +5 -0
- package/es/common/messages.js.map +1 -1
- package/es/common/types/core.js.flow +2 -0
- package/es/common/types/core.js.map +1 -1
- package/es/components/avatar/UnknownUserAvatar.js +6 -9
- package/es/components/avatar/UnknownUserAvatar.js.map +1 -1
- package/es/components/close-button/CloseButton.js +24 -0
- package/es/components/close-button/CloseButton.js.flow +26 -0
- package/es/components/close-button/CloseButton.js.map +1 -0
- package/es/components/close-button/CloseButton.scss +10 -0
- package/es/components/close-button/CloseButton.stories.js +14 -0
- package/es/components/close-button/CloseButton.stories.js.map +1 -0
- package/es/components/close-button/index.js +2 -0
- package/es/components/close-button/index.js.flow +2 -0
- package/es/components/close-button/index.js.map +1 -0
- package/es/components/date-picker/AccessiblePikaday.js +113 -0
- package/es/components/date-picker/AccessiblePikaday.js.map +1 -0
- package/es/components/date-picker/DatePicker.js +426 -106
- package/es/components/date-picker/DatePicker.js.map +1 -1
- package/es/components/date-picker/DatePicker.scss +32 -22
- package/es/components/date-picker/DatePicker.stories.js +10 -0
- package/es/components/date-picker/DatePicker.stories.js.map +1 -1
- package/es/components/date-picker/_pikaday.scss +8 -2
- package/es/components/flyout/Flyout.js +13 -3
- package/es/components/flyout/Flyout.js.flow +14 -3
- package/es/components/flyout/Flyout.js.map +1 -1
- package/es/components/flyout/Flyout.scss +40 -0
- package/es/components/flyout/FlyoutContext.js +6 -0
- package/es/components/flyout/FlyoutContext.js.flow +9 -0
- package/es/components/flyout/FlyoutContext.js.map +1 -0
- package/es/components/flyout/OverlayHeader.js +33 -0
- package/es/components/flyout/OverlayHeader.js.map +1 -0
- package/es/components/flyout/OverlayHeader.scss +9 -0
- package/es/components/flyout/_variables.scss +1 -0
- package/es/components/flyout/index.js +2 -0
- package/es/components/flyout/index.js.flow +2 -0
- package/es/components/flyout/index.js.map +1 -1
- package/es/components/image-tooltip/ImageTooltip.js +1 -2
- package/es/components/image-tooltip/ImageTooltip.js.map +1 -1
- package/es/components/media-query/constants.js +26 -0
- package/es/components/media-query/constants.js.flow +32 -0
- package/es/components/media-query/constants.js.map +1 -0
- package/es/components/media-query/index.js +3 -0
- package/es/components/media-query/index.js.flow +4 -0
- package/es/components/media-query/index.js.map +1 -0
- package/es/components/media-query/stories/MediaQuery.stories.js +37 -0
- package/es/components/media-query/stories/MediaQuery.stories.js.flow +80 -0
- package/es/components/media-query/stories/MediaQuery.stories.js.map +1 -0
- package/es/components/media-query/types.js +2 -0
- package/es/components/media-query/types.js.flow +29 -0
- package/es/components/media-query/types.js.map +1 -0
- package/es/components/media-query/useMediaQuery.js +91 -0
- package/es/components/media-query/useMediaQuery.js.flow +97 -0
- package/es/components/media-query/useMediaQuery.js.map +1 -0
- package/es/components/media-query/withMediaQuery.js +21 -0
- package/es/components/media-query/withMediaQuery.js.flow +23 -0
- package/es/components/media-query/withMediaQuery.js.map +1 -0
- package/es/components/modal/Modal.scss +27 -0
- package/es/components/preview/previewIcons.js +4 -0
- package/es/components/preview/previewIcons.js.map +1 -1
- package/es/components/search-form/SearchForm.scss +0 -5
- package/es/components/selector-dropdown/SelectorDropdown.js +5 -3
- package/es/components/selector-dropdown/SelectorDropdown.js.flow +3 -3
- package/es/components/selector-dropdown/SelectorDropdown.js.map +1 -1
- package/es/components/tab-view/Tabs.scss +0 -4
- package/es/components/tooltip/Tooltip.js +21 -4
- package/es/components/tooltip/Tooltip.js.map +1 -1
- package/es/constants.js +1 -0
- package/es/constants.js.flow +1 -0
- package/es/constants.js.map +1 -1
- package/es/elements/content-open-with/IconFileMap.js +0 -2
- package/es/elements/content-open-with/IconFileMap.js.flow +0 -2
- package/es/elements/content-open-with/IconFileMap.js.map +1 -1
- package/es/elements/content-sidebar/Sidebar.js +2 -1
- package/es/elements/content-sidebar/Sidebar.js.flow +1 -1
- package/es/elements/content-sidebar/Sidebar.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/common/delete-confirmation/DeleteConfirmation.scss +3 -3
- package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js +14 -4
- package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.flow +18 -5
- package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.map +1 -1
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js +78 -0
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.flow +97 -0
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.map +1 -0
- package/es/elements/content-sidebar/versions/StaticVersionsSidebar.scss +67 -0
- package/es/elements/content-sidebar/versions/VersionsSidebar.js +12 -4
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.flow +16 -3
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsSidebar.scss +5 -0
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js +42 -10
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.flow +42 -7
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.map +1 -1
- package/es/elements/content-sidebar/versions/flowTypes.js.flow +1 -0
- package/es/elements/content-sidebar/versions/messages.js +20 -0
- package/es/elements/content-sidebar/versions/messages.js.flow +28 -0
- package/es/elements/content-sidebar/versions/messages.js.map +1 -1
- package/es/features/classification/constants.js +2 -1
- package/es/features/classification/constants.js.flow +2 -0
- package/es/features/classification/constants.js.map +1 -1
- package/es/features/classification/flowTypes.js +1 -0
- package/es/features/classification/flowTypes.js.flow +7 -1
- package/es/features/classification/flowTypes.js.map +1 -1
- package/es/features/classification/security-controls/SecurityControls.js +3 -4
- package/es/features/classification/security-controls/SecurityControls.js.flow +3 -4
- package/es/features/classification/security-controls/SecurityControls.js.map +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.js +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.js.flow +20 -17
- package/es/features/classification/security-controls/SecurityControlsItem.js.map +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.scss +4 -0
- package/es/features/classification/security-controls/SecurityControlsModal.js +2 -2
- package/es/features/classification/security-controls/SecurityControlsModal.js.flow +2 -2
- package/es/features/classification/security-controls/SecurityControlsModal.js.map +1 -1
- package/es/features/classification/security-controls/messages.js +4 -0
- package/es/features/classification/security-controls/messages.js.flow +5 -0
- package/es/features/classification/security-controls/messages.js.map +1 -1
- package/es/features/classification/security-controls/utils.js +56 -35
- package/es/features/classification/security-controls/utils.js.flow +51 -27
- package/es/features/classification/security-controls/utils.js.map +1 -1
- package/es/features/collapsible-sidebar/CollapsibleSidebar.js +9 -3
- package/es/features/collapsible-sidebar/CollapsibleSidebar.js.flow +13 -5
- package/es/features/collapsible-sidebar/CollapsibleSidebar.js.map +1 -1
- package/es/features/collapsible-sidebar/CollapsibleSidebar.scss +35 -3
- package/es/features/content-explorer/content-explorer/ContentExplorer.scss +1 -1
- package/es/features/content-explorer/item-list/ItemList.js +1 -0
- package/es/features/content-explorer/item-list/ItemList.js.flow +1 -0
- package/es/features/content-explorer/item-list/ItemList.js.map +1 -1
- package/es/features/content-explorer/item-list/ItemListName.js +13 -2
- package/es/features/content-explorer/item-list/ItemListName.js.flow +3 -2
- package/es/features/content-explorer/item-list/ItemListName.js.map +1 -1
- package/es/features/header-flyout/HeaderFlyout.js +8 -10
- package/es/features/header-flyout/HeaderFlyout.js.flow +4 -8
- package/es/features/header-flyout/HeaderFlyout.js.map +1 -1
- package/es/features/header-flyout/styles/HeaderFlyout.scss +54 -15
- package/es/features/header-flyout/styles/_variables.scss +4 -0
- package/es/features/message-center/components/message-center-modal/MessageCenterModal.js +1 -0
- package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.flow +1 -0
- package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.map +1 -1
- package/es/features/presence/PresenceCollaborator.js +90 -0
- package/es/features/presence/PresenceCollaborator.js.flow +81 -0
- package/es/features/presence/PresenceCollaborator.js.map +1 -0
- package/es/features/presence/PresenceCollaborator.scss +28 -0
- package/es/features/presence/PresenceCollaboratorsList.js +9 -57
- package/es/features/presence/PresenceCollaboratorsList.js.flow +7 -58
- package/es/features/presence/PresenceCollaboratorsList.js.map +1 -1
- package/es/features/presence/PresenceCollaboratorsList.scss +8 -35
- package/es/features/quick-search/QuickSearch.js +4 -2
- package/es/features/quick-search/QuickSearch.js.flow +13 -1
- package/es/features/quick-search/QuickSearch.js.map +1 -1
- package/es/features/unified-share-modal/SharedLinkSection.js +9 -20
- package/es/features/unified-share-modal/SharedLinkSection.js.flow +6 -27
- package/es/features/unified-share-modal/SharedLinkSection.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareForm.js +95 -53
- package/es/features/unified-share-modal/UnifiedShareForm.js.flow +70 -14
- package/es/features/unified-share-modal/UnifiedShareForm.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareModal.scss +3 -0
- package/es/features/unified-share-modal/flowTypes.js.flow +6 -0
- package/es/features/unified-share-modal/flowTypes.js.map +1 -1
- package/es/features/unified-share-modal/messages.js +8 -0
- package/es/features/unified-share-modal/messages.js.flow +10 -0
- package/es/features/unified-share-modal/messages.js.map +1 -1
- package/es/features/unified-share-modal/utils/mergeContacts.js +13 -10
- package/es/features/unified-share-modal/utils/mergeContacts.js.flow +4 -2
- package/es/features/unified-share-modal/utils/mergeContacts.js.map +1 -1
- package/es/icon/content/FileXbd32.js +39 -0
- package/es/icon/content/FileXbd32.js.flow +38 -0
- package/es/icon/content/FileXbd32.js.map +1 -0
- package/es/icon/content/FileXbd32.stories.js +13 -0
- package/es/icon/content/FileXbd32.stories.js.map +1 -0
- package/es/icon/content/FileXdw32.js +39 -0
- package/es/icon/content/FileXdw32.js.flow +38 -0
- package/es/icon/content/FileXdw32.js.map +1 -0
- package/es/icon/content/FileXdw32.stories.js +13 -0
- package/es/icon/content/FileXdw32.stories.js.map +1 -0
- package/es/icon/content/RetentionPolicyModifiable32.js +36 -0
- package/es/icon/content/RetentionPolicyModifiable32.js.flow +31 -0
- package/es/icon/content/RetentionPolicyModifiable32.js.map +1 -0
- package/es/icon/content/RetentionPolicyModifiable32.stories.js +13 -0
- package/es/icon/content/RetentionPolicyModifiable32.stories.js.map +1 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.js +36 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.js.flow +31 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.js.map +1 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.stories.js +13 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.stories.js.map +1 -0
- package/es/icons/avatars/UnknownUserAvatar.js +10 -34
- package/es/icons/avatars/UnknownUserAvatar.js.map +1 -1
- package/es/icons/file-icon/FileIcon.js +8 -2
- package/es/icons/file-icon/FileIcon.js.flow +2 -2
- package/es/icons/file-icon/FileIcon.js.map +1 -1
- package/es/icons/general/IconSearch.js +1 -1
- package/es/icons/general/IconSearch.js.flow +1 -1
- package/es/icons/general/IconSearch.js.map +1 -1
- package/es/icons/general/IconSearchJuicy.js +30 -0
- package/es/icons/general/IconSearchJuicy.js.flow +26 -0
- package/es/icons/general/IconSearchJuicy.js.map +1 -0
- package/es/icons/google-docs/IconGoogle.js +89 -0
- package/es/icons/google-docs/IconGoogle.js.flow +57 -0
- package/es/icons/google-docs/IconGoogle.js.map +1 -0
- package/es/icons/item-icon/ItemIcon.js +4 -0
- package/es/icons/item-icon/ItemIcon.js.map +1 -1
- package/es/icons/microsoft-office/IconOffice.js +80 -0
- package/es/icons/microsoft-office/IconOffice.js.flow +45 -0
- package/es/icons/microsoft-office/IconOffice.js.map +1 -0
- package/es/illustration/EmailVerification140.js +111 -0
- package/es/illustration/EmailVerification140.js.flow +102 -0
- package/es/illustration/EmailVerification140.js.map +1 -0
- package/es/illustration/EmailVerification140.stories.js +13 -0
- package/es/illustration/EmailVerification140.stories.js.map +1 -0
- package/es/src/components/close-button/CloseButton.d.ts +9 -0
- package/es/src/components/close-button/CloseButton.stories.d.ts +9 -0
- package/es/src/components/close-button/__tests__/CloseButton.stories.test.d.ts +0 -0
- package/es/src/components/close-button/__tests__/CloseButton.test.d.ts +1 -0
- package/es/src/components/close-button/index.d.ts +1 -0
- package/es/src/components/date-picker/AccessiblePikaday.d.ts +16 -0
- package/es/src/components/date-picker/DatePicker.d.ts +33 -6
- package/es/src/components/date-picker/DatePicker.stories.d.ts +2 -1
- package/es/src/components/flyout/OverlayHeader.d.ts +10 -0
- package/es/src/components/tooltip/Tooltip.d.ts +4 -3
- package/es/src/icon/content/FileXbd32.d.ts +13 -0
- package/es/src/icon/content/FileXbd32.stories.d.ts +9 -0
- package/es/src/icon/content/FileXdw32.d.ts +13 -0
- package/es/src/icon/content/FileXdw32.stories.d.ts +9 -0
- package/es/src/icon/content/RetentionPolicyModifiable32.d.ts +13 -0
- package/es/src/icon/content/RetentionPolicyModifiable32.stories.d.ts +9 -0
- package/es/src/icon/content/RetentionPolicyNonModifiable32.d.ts +13 -0
- package/es/src/icon/content/RetentionPolicyNonModifiable32.stories.d.ts +9 -0
- package/es/src/icons/avatars/UnknownUserAvatar.d.ts +0 -1
- package/es/src/icons/general/IconSearchJuicy.d.ts +3 -0
- package/es/src/icons/general/__tests__/IconSearchJuicy.test.d.ts +1 -0
- package/es/src/icons/google-docs/IconGoogle.d.ts +12 -0
- package/es/src/icons/google-docs/__tests__/IconGoogle.test.d.ts +1 -0
- package/es/src/icons/item-icon/ItemIcon.d.ts +2 -0
- package/es/src/icons/microsoft-office/IconOffice.d.ts +12 -0
- package/es/src/icons/microsoft-office/__tests__/IconOffice.test.d.ts +1 -0
- package/es/src/illustration/EmailVerification140.d.ts +13 -0
- package/es/src/illustration/EmailVerification140.stories.d.ts +9 -0
- package/es/src/styles/variables.d.ts +9 -0
- package/es/styles/_variables.scss +1 -0
- package/es/styles/common/_forms.scss +6 -0
- package/es/styles/constants/_layout.scss +3 -0
- package/es/styles/constants/_media-queries.scss +15 -0
- package/es/styles/variables.js +18 -0
- package/es/styles/variables.js.flow +10 -1
- package/es/styles/variables.js.map +1 -1
- package/es/utils/Browser.js +12 -0
- package/es/utils/Browser.js.flow +10 -0
- package/es/utils/Browser.js.map +1 -1
- package/es/utils/validators.js +26 -4
- package/es/utils/validators.js.flow +25 -3
- package/es/utils/validators.js.map +1 -1
- package/i18n/bn-IN.js +12 -0
- package/i18n/bn-IN.properties +24 -0
- package/i18n/da-DK.js +12 -0
- package/i18n/da-DK.properties +24 -0
- package/i18n/de-DE.js +12 -0
- package/i18n/de-DE.properties +24 -0
- package/i18n/en-AU.js +12 -0
- package/i18n/en-AU.properties +24 -0
- package/i18n/en-CA.js +12 -0
- package/i18n/en-CA.properties +24 -0
- package/i18n/en-GB.js +12 -0
- package/i18n/en-GB.properties +24 -0
- package/i18n/en-US.js +12 -0
- package/i18n/en-US.properties +24 -0
- package/i18n/en-x-pseudo.js +12 -0
- package/i18n/es-419.js +12 -0
- package/i18n/es-419.properties +24 -0
- package/i18n/es-ES.js +12 -0
- package/i18n/es-ES.properties +24 -0
- package/i18n/fi-FI.js +12 -0
- package/i18n/fi-FI.properties +24 -0
- package/i18n/fr-CA.js +12 -0
- package/i18n/fr-CA.properties +24 -0
- package/i18n/fr-FR.js +12 -0
- package/i18n/fr-FR.properties +24 -0
- package/i18n/hi-IN.js +12 -0
- package/i18n/hi-IN.properties +24 -0
- package/i18n/it-IT.js +12 -0
- package/i18n/it-IT.properties +24 -0
- package/i18n/ja-JP.js +25 -13
- package/i18n/ja-JP.properties +37 -13
- package/i18n/ko-KR.js +12 -0
- package/i18n/ko-KR.properties +24 -0
- package/i18n/nb-NO.js +12 -0
- package/i18n/nb-NO.properties +24 -0
- package/i18n/nl-NL.js +12 -0
- package/i18n/nl-NL.properties +24 -0
- package/i18n/pl-PL.js +12 -0
- package/i18n/pl-PL.properties +24 -0
- package/i18n/pt-BR.js +12 -0
- package/i18n/pt-BR.properties +24 -0
- package/i18n/ru-RU.js +12 -0
- package/i18n/ru-RU.properties +24 -0
- package/i18n/sv-SE.js +12 -0
- package/i18n/sv-SE.properties +24 -0
- package/i18n/tr-TR.js +12 -0
- package/i18n/tr-TR.properties +24 -0
- package/i18n/zh-CN.js +12 -0
- package/i18n/zh-CN.properties +24 -0
- package/i18n/zh-TW.js +12 -0
- package/i18n/zh-TW.properties +24 -0
- package/package.json +8 -5
- package/src/__mocks__/pikaday.js +1 -0
- package/src/api/__tests__/MockOpenWithData.json +2 -25
- package/src/api/uploads/UploadsReachability.js +2 -2
- package/src/common/messages.js +5 -0
- package/src/common/types/core.js +2 -0
- package/src/components/avatar/UnknownUserAvatar.tsx +5 -4
- package/src/components/close-button/CloseButton.js.flow +26 -0
- package/src/components/close-button/CloseButton.scss +10 -0
- package/src/components/close-button/CloseButton.stories.md +1 -0
- package/src/components/close-button/CloseButton.stories.tsx +14 -0
- package/src/components/close-button/CloseButton.tsx +30 -0
- package/src/components/close-button/__tests__/CloseButton.stories.test.tsx +6 -0
- package/src/components/close-button/__tests__/CloseButton.test.tsx +40 -0
- package/src/components/close-button/__tests__/__image_snapshots__/close-button-stories-test-tsx-components-close-button-close-button-looks-visually-correct-when-using-story-components-buttons-closebutton-regular-1-snap.png +0 -0
- package/src/components/close-button/index.js.flow +2 -0
- package/src/components/close-button/index.ts +1 -0
- package/src/components/date-picker/AccessiblePikaday.ts +79 -0
- package/src/components/date-picker/DatePicker.scss +32 -22
- package/src/components/date-picker/DatePicker.stories.tsx +6 -0
- package/src/components/date-picker/DatePicker.tsx +350 -64
- package/src/components/date-picker/__tests__/DatePicker.test.tsx +44 -2
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-allows-editing-in-story-components-datepicker-manually-editable-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-allows-keyboard-selection-in-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-closes-calendar-and-clears-date-for-components-datepicker-basic-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-basic-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-custom-error-tooltip-position-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-disabled-with-error-message-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-manually-editable-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-description-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-limited-date-range-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-range-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-reflects-changes-in-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-shows-calendar-and-date-for-components-datepicker-basic-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-shows-limited-range-in-components-datepicker-with-limited-date-range-1-snap.png +0 -0
- package/src/components/date-picker/_pikaday.scss +8 -2
- package/src/components/flyout/Flyout.js +14 -3
- package/src/components/flyout/Flyout.scss +40 -0
- package/src/components/flyout/FlyoutContext.js +9 -0
- package/src/components/flyout/OverlayHeader.scss +9 -0
- package/src/components/flyout/OverlayHeader.tsx +38 -0
- package/src/components/flyout/__tests__/Flyout.test.js +15 -0
- package/src/components/flyout/__tests__/OverlayHeader.test.js +56 -0
- package/src/components/flyout/_variables.scss +1 -0
- package/src/components/flyout/index.js +2 -0
- package/src/components/image-tooltip/ImageTooltip.tsx +1 -2
- package/src/components/media-query/__tests__/useMediaQuery.test.js +48 -0
- package/src/components/media-query/__tests__/withMediaQuery.test.js +29 -0
- package/src/components/media-query/constants.js +32 -0
- package/src/components/media-query/index.js +4 -0
- package/src/components/media-query/stories/MediaQuery.stories.js +80 -0
- package/src/components/media-query/stories/MediaQuery.stories.md +29 -0
- package/src/components/media-query/types.js +29 -0
- package/src/components/media-query/useMediaQuery.js +97 -0
- package/src/components/media-query/withMediaQuery.js +23 -0
- package/src/components/modal/Modal.scss +27 -0
- package/src/components/modal/__tests__/Modal.stories.test.js +10 -0
- package/src/components/modal/__tests__/__image_snapshots__/modal-stories-test-js-components-modal-modal-looks-visually-correct-for-small-screens-when-button-is-clicked-in-story-components-modal-basic-1-snap.png +0 -0
- package/src/components/modal/__tests__/__image_snapshots__/modal-stories-test-js-components-modal-modal-looks-visually-correct-for-small-screens-when-button-is-clicked-in-story-components-modal-with-custom-backdrop-click-handler-1-snap.png +0 -0
- package/src/components/preview/previewIcons.ts +4 -0
- package/src/components/search-form/SearchForm.scss +0 -5
- package/src/components/selector-dropdown/SelectorDropdown.js +3 -3
- package/src/components/selector-dropdown/__tests__/SelectorDropdown.test.js +5 -1
- package/src/components/sidebar-toggle-button/__tests__/__snapshots__/SidebarToggleButton.test.js.snap +0 -8
- package/src/components/tab-view/Tabs.scss +0 -4
- package/src/components/tooltip/Tooltip.tsx +20 -5
- package/src/components/tooltip/__tests__/Tooltip.test.tsx +17 -4
- package/src/components/tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -2
- package/src/constants.js +1 -0
- package/src/elements/content-open-with/IconFileMap.js +0 -2
- package/src/elements/content-open-with/__tests__/ContentOpenWith.test.js +13 -13
- package/src/elements/content-open-with/__tests__/OpenWithButton.test.js +1 -1
- package/src/elements/content-open-with/__tests__/OpenWithDropdownMenu.test.js +1 -5
- package/src/elements/content-open-with/__tests__/OpenWithDropdownMenuItem.test.js +2 -2
- package/src/elements/content-open-with/__tests__/__snapshots__/ContentOpenWith.test.js.snap +5 -5
- package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithButton.test.js.snap +1 -1
- package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenu.test.js.snap +1 -11
- package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenuItem.test.js.snap +4 -3
- package/src/elements/content-sidebar/Sidebar.js +1 -1
- package/src/elements/content-sidebar/__tests__/AddTaskButton.test.js +15 -0
- package/src/elements/content-sidebar/activity-feed/common/delete-confirmation/DeleteConfirmation.scss +3 -3
- package/src/elements/content-sidebar/activity-feed/task-form/TaskForm.js +18 -5
- package/src/elements/content-sidebar/versions/StaticVersionSidebar.js +97 -0
- package/src/elements/content-sidebar/versions/StaticVersionsSidebar.scss +67 -0
- package/src/elements/content-sidebar/versions/VersionsSidebar.js +16 -3
- package/src/elements/content-sidebar/versions/VersionsSidebar.scss +5 -0
- package/src/elements/content-sidebar/versions/VersionsSidebarContainer.js +42 -7
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebar.test.js +18 -1
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebarContainer.test.js +51 -2
- package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebarContainer.test.js.snap +75 -0
- package/src/elements/content-sidebar/versions/flowTypes.js +1 -0
- package/src/elements/content-sidebar/versions/messages.js +28 -0
- package/src/features/classification/constants.js +2 -0
- package/src/features/classification/flowTypes.js +7 -1
- package/src/features/classification/security-controls/SecurityControls.js +3 -4
- package/src/features/classification/security-controls/SecurityControlsItem.js +20 -17
- package/src/features/classification/security-controls/SecurityControlsItem.scss +4 -0
- package/src/features/classification/security-controls/SecurityControlsModal.js +2 -2
- package/src/features/classification/security-controls/__tests__/SecurityControlsItem.test.js +10 -0
- package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControls.test.js.snap +6 -6
- package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsItem.test.js.snap +35 -0
- package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsModal.test.js.snap +2 -2
- package/src/features/classification/security-controls/__tests__/__snapshots__/utils.test.js.snap +20 -0
- package/src/features/classification/security-controls/__tests__/utils.test.js +38 -18
- package/src/features/classification/security-controls/messages.js +5 -0
- package/src/features/classification/security-controls/utils.js +51 -27
- package/src/features/collapsible-sidebar/CollapsibleSidebar.js +13 -5
- package/src/features/collapsible-sidebar/CollapsibleSidebar.scss +35 -3
- package/src/features/collapsible-sidebar/__tests__/CollapsibleSidebar.test.js +35 -0
- package/src/features/collapsible-sidebar/__tests__/__snapshots__/CollapsibleSidebar.test.js.snap +1 -0
- package/src/features/content-explorer/content-explorer/ContentExplorer.scss +1 -1
- package/src/features/content-explorer/item-list/ItemList.js +1 -0
- package/src/features/content-explorer/item-list/ItemListName.js +3 -2
- package/src/features/content-explorer/item-list/__tests__/ItemListName.test.js +16 -2
- package/src/features/header-flyout/HeaderFlyout.js +4 -8
- package/src/features/header-flyout/__tests__/__snapshots__/HeaderFlyout.test.js.snap +14 -11
- package/src/features/header-flyout/styles/HeaderFlyout.scss +54 -15
- package/src/features/header-flyout/styles/_variables.scss +4 -0
- package/src/features/message-center/components/message-center-modal/MessageCenterModal.js +1 -0
- package/src/features/metadata-instance-editor/__tests__/__snapshots__/TemplateDropdown.test.js.snap +7 -0
- package/src/features/pagination/__tests__/__snapshots__/MarkerBasedPagination.test.js.snap +0 -8
- package/src/features/pagination/__tests__/__snapshots__/OffsetBasedPagination.test.js.snap +0 -16
- package/src/features/presence/PresenceCollaborator.js +81 -0
- package/src/features/presence/PresenceCollaborator.scss +28 -0
- package/src/features/presence/PresenceCollaboratorsList.js +7 -58
- package/src/features/presence/PresenceCollaboratorsList.scss +8 -35
- package/src/features/presence/__tests__/PresenceCollaborator.test.js +36 -0
- package/src/features/presence/__tests__/PresenceCollaboratorsList.test.js +13 -57
- package/src/features/presence/__tests__/__snapshots__/Presence.test.js.snap +5 -0
- package/src/features/presence/__tests__/__snapshots__/PresenceLink.test.js.snap +3 -0
- package/src/features/query-bar/__tests__/__snapshots__/ColumnButton.test.js.snap +3 -0
- package/src/features/quick-search/QuickSearch.js +13 -1
- package/src/features/quick-search/__tests__/QuickSearch.test.js +17 -0
- package/src/features/unified-share-modal/SharedLinkSection.js +6 -27
- package/src/features/unified-share-modal/UnifiedShareForm.js +70 -14
- package/src/features/unified-share-modal/UnifiedShareModal.scss +3 -0
- package/src/features/unified-share-modal/__tests__/EmailForm.test.js +9 -0
- package/src/features/unified-share-modal/__tests__/SharedLinkSection.test.js +14 -4
- package/src/features/unified-share-modal/__tests__/UnifiedShareForm.test.js +53 -4
- package/src/features/unified-share-modal/__tests__/__snapshots__/SharedLinkSection.test.js.snap +9 -0
- package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareForm.test.js.snap +0 -159
- package/src/features/unified-share-modal/flowTypes.js +6 -0
- package/src/features/unified-share-modal/messages.js +10 -0
- package/src/features/unified-share-modal/utils/__tests__/mergeContacts.test.js +23 -0
- package/src/features/unified-share-modal/utils/mergeContacts.js +4 -2
- package/src/icon/content/FileXbd32.js.flow +38 -0
- package/src/icon/content/FileXbd32.stories.tsx +13 -0
- package/src/icon/content/FileXbd32.tsx +37 -0
- package/src/icon/content/FileXdw32.js.flow +38 -0
- package/src/icon/content/FileXdw32.stories.tsx +13 -0
- package/src/icon/content/FileXdw32.tsx +37 -0
- package/src/icon/content/RetentionPolicyModifiable32.js.flow +31 -0
- package/src/icon/content/RetentionPolicyModifiable32.stories.tsx +14 -0
- package/src/icon/content/RetentionPolicyModifiable32.tsx +29 -0
- package/src/icon/content/RetentionPolicyNonModifiable32.js.flow +31 -0
- package/src/icon/content/RetentionPolicyNonModifiable32.stories.tsx +14 -0
- package/src/icon/content/RetentionPolicyNonModifiable32.tsx +29 -0
- package/src/icons/adobe-sign/README.md +1 -1
- package/src/icons/avatars/UnknownUserAvatar.tsx +7 -15
- package/src/icons/file-icon/FileIcon.js.flow +2 -2
- package/src/icons/file-icon/FileIcon.tsx +8 -2
- package/src/icons/file-icon/__tests__/FileIcon.test.tsx +28 -69
- package/src/icons/file-icon/__tests__/__snapshots__/FileIcon.test.tsx.snap +48 -34
- package/src/icons/general/IconSearch.js.flow +1 -1
- package/src/icons/general/IconSearch.tsx +1 -1
- package/src/icons/general/IconSearchJuicy.js.flow +26 -0
- package/src/icons/general/IconSearchJuicy.tsx +25 -0
- package/src/icons/general/README.md +5 -0
- package/src/icons/general/__tests__/IconSearchJuicy.test.tsx +38 -0
- package/src/icons/google-docs/IconGoogle.js.flow +57 -0
- package/src/icons/google-docs/IconGoogle.tsx +50 -0
- package/src/icons/google-docs/__tests__/IconGoogle.test.tsx +44 -0
- package/src/icons/item-icon/ItemIcon.tsx +4 -0
- package/src/icons/item-icon/__tests__/ItemIcon.test.tsx +47 -115
- package/src/icons/item-icon/__tests__/__snapshots__/ItemIcon.test.tsx.snap +229 -229
- package/src/icons/microsoft-office/IconOffice.js.flow +45 -0
- package/src/icons/microsoft-office/IconOffice.tsx +38 -0
- package/src/icons/microsoft-office/__tests__/IconOffice.test.tsx +44 -0
- package/src/illustration/EmailVerification140.js.flow +102 -0
- package/src/illustration/EmailVerification140.stories.tsx +13 -0
- package/src/illustration/EmailVerification140.tsx +100 -0
- package/src/styles/_variables.scss +1 -0
- package/src/styles/common/_forms.scss +6 -0
- package/src/styles/constants/_layout.scss +3 -0
- package/src/styles/constants/_media-queries.scss +15 -0
- package/src/styles/variables.js +10 -1
- package/src/styles/variables.json +10 -1
- package/src/styles/variables.ts +9 -0
- package/src/utils/Browser.js +10 -0
- package/src/utils/validators.js +25 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { Flyout, Overlay } from '../../components/flyout';
|
|
4
|
+
import { Flyout, Overlay, OverlayHeader } from '../../components/flyout';
|
|
5
5
|
import ScrollWrapper from '../../components/scroll-wrapper';
|
|
6
6
|
import type { FlyoutProps } from '../../components/flyout/Flyout';
|
|
7
7
|
|
|
@@ -34,20 +34,16 @@ class HeaderFlyout extends React.Component<Props> {
|
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<Flyout
|
|
37
|
-
closeOnClick={false}
|
|
38
|
-
offset={HeaderFlyout.panelOffset}
|
|
39
37
|
className={classNames('header-flyout', className)}
|
|
38
|
+
closeOnClick={false}
|
|
40
39
|
constrainToWindow
|
|
40
|
+
offset={HeaderFlyout.panelOffset}
|
|
41
41
|
{...rest}
|
|
42
42
|
>
|
|
43
43
|
{flyoutButton}
|
|
44
44
|
<Overlay className="header-flyout-overlay">
|
|
45
|
+
<OverlayHeader>{header && <h4 className="header-flyout-title">{header}</h4>}</OverlayHeader>
|
|
45
46
|
<div className="header-flyout-list-container">
|
|
46
|
-
{header && (
|
|
47
|
-
<div className="flyout-list-container-title">
|
|
48
|
-
<h4 className="flyout-list-title">{header}</h4>
|
|
49
|
-
</div>
|
|
50
|
-
)}
|
|
51
47
|
<div
|
|
52
48
|
className={classNames('flyout-list-container-body', {
|
|
53
49
|
'with-header': !!header,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/header-flyout/HeaderFlyout.js"],"names":["React","classNames","Flyout","Overlay","ScrollWrapper","HeaderFlyout","props","header","footer","flyoutButton","children","scrollRefFn","className","rest","panelOffset","Component","position"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,OAAjB,
|
|
1
|
+
{"version":3,"sources":["../../../src/features/header-flyout/HeaderFlyout.js"],"names":["React","classNames","Flyout","Overlay","OverlayHeader","ScrollWrapper","HeaderFlyout","props","header","footer","flyoutButton","children","scrollRefFn","className","rest","panelOffset","Component","position"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,OAAjB,EAA0BC,aAA1B,QAA+C,yBAA/C;AACA,OAAOC,aAAP,MAA0B,iCAA1B;AAGA,OAAO,4BAAP;;IAiBMC,Y;;;;;;;;;;;;;6BAOO;AAAA,wBAC+E,KAAKC,KADpF;AAAA,UACGC,MADH,eACGA,MADH;AAAA,UACWC,MADX,eACWA,MADX;AAAA,UACmBC,YADnB,eACmBA,YADnB;AAAA,UACiCC,QADjC,eACiCA,QADjC;AAAA,UAC2CC,WAD3C,eAC2CA,WAD3C;AAAA,UACwDC,SADxD,eACwDA,SADxD;AAAA,UACsEC,IADtE;;AAGL,aACI,oBAAC,MAAD;AACI,QAAA,SAAS,EAAEb,UAAU,CAAC,eAAD,EAAkBY,SAAlB,CADzB;AAEI,QAAA,YAAY,EAAE,KAFlB;AAGI,QAAA,iBAAiB,MAHrB;AAII,QAAA,MAAM,EAAEP,YAAY,CAACS;AAJzB,SAKQD,IALR,GAOKJ,YAPL,EAQI,oBAAC,OAAD;AAAS,QAAA,SAAS,EAAC;AAAnB,SACI,oBAAC,aAAD,QAAgBF,MAAM,IAAI;AAAI,QAAA,SAAS,EAAC;AAAd,SAAqCA,MAArC,CAA1B,CADJ,EAEI;AAAK,QAAA,SAAS,EAAC;AAAf,SACI;AACI,QAAA,SAAS,EAAEP,UAAU,CAAC,4BAAD,EAA+B;AAChD,yBAAe,CAAC,CAACO,MAD+B;AAEhD,yBAAe,CAAC,CAACC;AAF+B,SAA/B;AADzB,SAMKE,QAAQ,IAAI,IAAZ,IACG,oBAAC,aAAD;AAAe,QAAA,WAAW,EAAEC,WAA5B;AAAyC,QAAA,UAAU,EAAC;AAApD,SACKD,QADL,CAPR,CADJ,EAaKF,MAAM,IAAI;AAAK,QAAA,SAAS,EAAC;AAAf,SAA+CA,MAA/C,CAbf,CAFJ,CARJ,CADJ;AA6BH;;;;EAvCsBT,KAAK,CAACgB,S;;gBAA3BV,Y,iBACmB,U;;gBADnBA,Y,kBAGoB;AAClBW,EAAAA,QAAQ,EAAE;AADQ,C;;AAuC1B,eAAeX,YAAf","sourcesContent":["// @flow\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Flyout, Overlay, OverlayHeader } from '../../components/flyout';\nimport ScrollWrapper from '../../components/scroll-wrapper';\nimport type { FlyoutProps } from '../../components/flyout/Flyout';\n\nimport './styles/HeaderFlyout.scss';\n\ntype Props = FlyoutProps & {\n /** Components to render in the overlay */\n children: ?React.Node,\n /** Set className to the overlay wrapper */\n className?: string,\n /** Custom button to trigger for opening/closing the flyout */\n flyoutButton: React.Element<any>,\n /** What content to display in the footer */\n footer?: React.Element<any>,\n /** What content to display in the header */\n header?: React.Element<any>,\n /** Optional function to get the scrollRef in parent components */\n scrollRefFn?: any => any,\n};\n\nclass HeaderFlyout extends React.Component<Props> {\n static panelOffset = '-4px 0px';\n\n static defaultProps = {\n position: 'bottom-left',\n };\n\n render() {\n const { header, footer, flyoutButton, children, scrollRefFn, className, ...rest } = this.props;\n\n return (\n <Flyout\n className={classNames('header-flyout', className)}\n closeOnClick={false}\n constrainToWindow\n offset={HeaderFlyout.panelOffset}\n {...rest}\n >\n {flyoutButton}\n <Overlay className=\"header-flyout-overlay\">\n <OverlayHeader>{header && <h4 className=\"header-flyout-title\">{header}</h4>}</OverlayHeader>\n <div className=\"header-flyout-list-container\">\n <div\n className={classNames('flyout-list-container-body', {\n 'with-header': !!header,\n 'with-footer': !!footer,\n })}\n >\n {children != null && (\n <ScrollWrapper scrollRefFn={scrollRefFn} shadowSize=\"contain\">\n {children}\n </ScrollWrapper>\n )}\n </div>\n {footer && <div className=\"flyout-list-container-footer\">{footer}</div>}\n </div>\n </Overlay>\n </Flyout>\n );\n }\n}\n\nexport default HeaderFlyout;\n"],"file":"HeaderFlyout.js"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import '../../../components/flyout/variables';
|
|
1
2
|
@import '../../../styles/variables';
|
|
2
3
|
@import '../../../styles/mixins/overlay';
|
|
3
4
|
@import './variables';
|
|
@@ -17,43 +18,35 @@
|
|
|
17
18
|
|
|
18
19
|
padding: (2 * $flyout-header-spacer) $flyout-list-padding 0;
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.header-flyout-list-container {
|
|
23
|
-
padding: 0;
|
|
24
|
-
|
|
25
|
-
.flyout-list-container-title {
|
|
26
|
-
padding-bottom: $flyout-header-spacer;
|
|
27
|
-
}
|
|
28
21
|
|
|
29
|
-
.flyout-
|
|
22
|
+
.header-flyout-title {
|
|
30
23
|
margin: 0;
|
|
24
|
+
padding-bottom: $flyout-header-spacer;
|
|
31
25
|
font-size: $flyout-title-font-size;
|
|
32
26
|
line-height: $flyout-title-line-height;
|
|
33
27
|
}
|
|
28
|
+
}
|
|
34
29
|
|
|
30
|
+
.header-flyout-list-container {
|
|
35
31
|
.flyout-list-container-body {
|
|
36
|
-
$title-height: $flyout-title-line-height + $flyout-header-spacer;
|
|
37
|
-
$footer-height: $flyout-title-line-height + 2 * $flyout-footer-spacer;
|
|
38
|
-
|
|
39
32
|
// the overall height, minus the top and bottom padding
|
|
40
33
|
height: $flyout-list-height - 2 * $flyout-list-padding;
|
|
41
34
|
margin-bottom: $flyout-list-padding;
|
|
42
35
|
|
|
43
36
|
&.with-header {
|
|
44
37
|
// the overall height minus the padding, and header height
|
|
45
|
-
height: $flyout-list-height - (2 * $flyout-list-padding + $title-height);
|
|
38
|
+
height: $flyout-list-height - (2 * $flyout-list-padding + $flyout-title-height);
|
|
46
39
|
}
|
|
47
40
|
|
|
48
41
|
&.with-footer {
|
|
49
42
|
// the overall height minus the padding, and the footer height
|
|
50
|
-
height: $flyout-list-height - ($flyout-list-padding + $footer-height);
|
|
43
|
+
height: $flyout-list-height - ($flyout-list-padding + $flyout-footer-height);
|
|
51
44
|
margin-bottom: 0;
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
&.with-header.with-footer {
|
|
55
48
|
// the overall height minus the padding, and both text hbdl-gray-50
|
|
56
|
-
height: $flyout-list-height - ($flyout-list-padding + $title-height + $footer-height);
|
|
49
|
+
height: $flyout-list-height - ($flyout-list-padding + $flyout-title-height + $flyout-footer-height);
|
|
57
50
|
margin-bottom: 0;
|
|
58
51
|
}
|
|
59
52
|
}
|
|
@@ -69,3 +62,49 @@
|
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
64
|
}
|
|
65
|
+
|
|
66
|
+
@include breakpoint($medium-screen) {
|
|
67
|
+
.bdl-Flyout--responsive {
|
|
68
|
+
.header-flyout-list-container {
|
|
69
|
+
.flyout-list-container-body {
|
|
70
|
+
$header-height: $bdl-OverlayHeader-height;
|
|
71
|
+
|
|
72
|
+
height: calc(100vh - #{$header-height});
|
|
73
|
+
|
|
74
|
+
&.with-header {
|
|
75
|
+
height: calc(100vh - #{$header-height});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.with-footer {
|
|
79
|
+
height: calc(100vh - #{$flyout-footer-height});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.with-header.with-footer {
|
|
83
|
+
height: calc(100vh - #{$header-height} - #{$flyout-footer-height});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.scroll-container {
|
|
87
|
+
overflow-y: auto;
|
|
88
|
+
|
|
89
|
+
.scroll-wrap-container {
|
|
90
|
+
&::before,
|
|
91
|
+
&::after {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.flyout-list-container-footer {
|
|
99
|
+
height: $flyout-footer-height;
|
|
100
|
+
padding: $flyout-footer-spacer;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.header-flyout-overlay {
|
|
105
|
+
.header-flyout-title {
|
|
106
|
+
padding-bottom: 0;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -11,6 +11,10 @@ $flyout-title-line-height: 16px;
|
|
|
11
11
|
$flyout-footer-font-size: 13px;
|
|
12
12
|
$flyout-footer-line-height: 16px;
|
|
13
13
|
|
|
14
|
+
// Variables for title and footer height to help calculate component height
|
|
15
|
+
$flyout-title-height: $flyout-title-line-height + $flyout-header-spacer;
|
|
16
|
+
$flyout-footer-height: $flyout-title-line-height + 2 * $flyout-footer-spacer;
|
|
17
|
+
|
|
14
18
|
// Consumable mixins - to use with the contents of a header flyout
|
|
15
19
|
@mixin header-flyout-row-padding {
|
|
16
20
|
padding: 12px 0;
|
package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/features/message-center/components/message-center-modal/MessageCenterModal.js"],"names":["React","FormattedMessage","injectIntl","classNames","AutoSizer","CellMeasurer","CellMeasurerCache","List","debounce","AnimateHeight","Scrollbar","Modal","CategorySelector","CollapsibleScrollbar","Message","intlMessages","MessagePreviewGhost","ContentGhost","BottomContentWrapper","ErrorState","EmptyState","ALL","cache","defaultHeight","fixedWidth","SCROLLBAR_MARGIN","listStyle","overflowX","overflowY","trackYStyles","marginLeft","MessageCenterModal","apiHost","contentPreviewProps","onRequestClose","messages","getToken","intl","overscanRowCount","onMessageShown","categories","useMemo","Array","isArray","messageCategoriesSet","Set","forEach","category","templateParams","add","size","value","displayText","formatMessage","all","product","events","boxEducation","listRef","useRef","isMouseInTitleRef","messageLoadCacheRef","Map","useState","setCategory","isExpanded","setIsExpanded","width","height","dimensions","setDimensions","scrollRef","title","current","clearAll","filteredMessages","filter","sort","activateDateA","activateDate","priorityA","priority","activateDateB","priorityB","useEffect","scrollbarRef","scrollToTop","rowRenderer","index","parent","style","isVisible","message","messageId","id","isFirstTimeBeingShown","has","set","registerChild","handleOnScroll","clientHeight","scrollTop","prevClientHeight","prevScrollTop","isScrollingDown","handleResize","resizeDimensions","handlOnResize","useCallback","renderMessages","length","rowHeight","scrollLeft","Grid","handleScrollEvent","Error","errorFetchingPosts"],"mappings":";;;;;;;;;;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,gBAAT,EAA2BC,UAA3B,QAA2E,YAA3E;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,iBAAlC,EAAqDC,IAArD,QAAiE,wBAAjE;AACA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,OAAOC,SAAP,MAAsB,yBAAtB;AAEA,OAAOC,KAAP,MAAkB,oCAAlB;AACA,OAAOC,gBAAP,MAA6B,2DAA7B;AAEA,OAAOC,oBAAP,MAAiC,gDAAj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;AAAW,IAAA,QAAQ,EAAEmC;AAArB,KACK;AAAA,QAAGvC,MAAH,SAAGA,MAAH;AAAA,QAAWD,KAAX,SAAWA,KAAX;AAAA,WACG,oBAAC,oBAAD;AACI,MAAA,GAAG,EAAEI,SADT;AAEI,MAAA,QAAQ,EAAE,iCAGL;AAAA,YAFC6B,YAED,SAFCA,YAED;AAAA,YAFeC,SAEf,SAFeA,SAEf;AAAA,YAF0BW,UAE1B,SAF0BA,UAE1B;AAAA,YADeV,gBACf,UADCF,YACD;AAAA,YAD4CG,aAC5C,UADiCF,SACjC;AACDF,QAAAA,cAAc,CAACC,YAAD,EAAeC,SAAf,EAA0BC,gBAA1B,EAA4CC,aAA5C,CAAd;;AACA,YAAI7C,OAAO,CAACe,OAAR,IAAmBf,OAAO,CAACe,OAAR,CAAgBwC,IAAvC,EAA6C;AAAA,cACjCA,IADiC,GACxBvD,OAAO,CAACe,OADgB,CACjCwC,IADiC;AAEzCA,UAAAA,IAAI,CAACC,iBAAL,CAAuB;AAAEb,YAAAA,SAAS,EAATA,SAAF;AAAaW,YAAAA,UAAU,EAAVA;AAAb,WAAvB;AACH;AACJ,OAXL;AAYI,MAAA,eAAe,MAZnB;AAaI,MAAA,KAAK,EAAE;AAAE7C,QAAAA,KAAK,EAALA,KAAF;AAASC,QAAAA,MAAM,EAANA;AAAT,OAbX;AAcI,MAAA,YAAY,EAAEvC;AAdlB,OAgBKM,QAAQ,YAAYgF,KAApB,GACG,oBAAC,UAAD,QACI,oBAAC,gBAAD,EAAsBpG,YAAY,CAACqG,kBAAnC,CADJ,CADH,GAKGP,cAAc,CAAC1C,KAAD,EAAQC,MAAR,CArBtB,CADH;AAAA,GADL,CADJ,CARJ,CADJ;AAyCH;;AAED,eAAelE,UAAU,CAAC6B,kBAAD,CAAzB","sourcesContent":["// @flow\nimport * as React from 'react';\nimport { FormattedMessage, injectIntl, type InjectIntlProvidedProps } from 'react-intl';\nimport classNames from 'classnames';\nimport { AutoSizer, CellMeasurer, CellMeasurerCache, List } from '@box/react-virtualized';\nimport debounce from 'lodash/debounce';\nimport AnimateHeight from 'react-animate-height';\nimport Scrollbar from 'react-scrollbars-custom';\nimport type { Token } from '../../../../common/types/core';\nimport Modal from '../../../../components/modal/Modal';\nimport CategorySelector from '../../../../components/category-selector/CategorySelector';\n\nimport CollapsibleScrollbar from '../collapsibile-scrollbar/CollapsibleScrollbar';\nimport Message from '../message/Message';\nimport intlMessages from '../../messages';\nimport type { EligibleMessageCenterMessage } from '../../types';\nimport type { ContentPreviewProps } from '../../../message-preview-content/MessagePreviewContent';\nimport './MessageCenterModal.scss';\nimport MessagePreviewGhost from '../../../message-preview-ghost/MessagePreviewGhost';\nimport ContentGhost from '../templates/common/ContentGhost';\nimport BottomContentWrapper from '../templates/common/BottomContentWrapper';\nimport ErrorState from '../error-state/ErrorState';\nimport EmptyState from './EmptyState';\n\ntype Props = {|\n apiHost: string,\n contentPreviewProps?: ContentPreviewProps,\n getToken: (fileId: string) => Promise<Token>,\n messages: Array<EligibleMessageCenterMessage> | null | Error,\n onMessageShown: EligibleMessageCenterMessage => void,\n onRequestClose: () => void,\n overscanRowCount?: number,\n|};\n\nconst ALL = 'all';\nconst cache = new CellMeasurerCache({\n defaultHeight: 400,\n fixedWidth: true,\n});\n\nconst SCROLLBAR_MARGIN = 16;\nconst listStyle = { overflowX: false, overflowY: false };\nconst trackYStyles = { marginLeft: `${SCROLLBAR_MARGIN}px` };\n\nfunction MessageCenterModal({\n apiHost,\n contentPreviewProps,\n onRequestClose,\n messages,\n getToken,\n intl,\n overscanRowCount = 1,\n onMessageShown,\n}: Props & InjectIntlProvidedProps) {\n const categories: Array<{ displayText: string, value: string }> | null = React.useMemo(() => {\n if (!Array.isArray(messages)) {\n return null;\n }\n\n const messageCategoriesSet = new Set<string>();\n messages.forEach(({ templateParams: { category } }) => {\n messageCategoriesSet.add(category);\n });\n\n if (messageCategoriesSet.size <= 1) {\n return null;\n }\n\n return [\n {\n value: ALL,\n displayText: intl.formatMessage(intlMessages.all),\n },\n {\n value: 'product',\n displayText: intl.formatMessage(intlMessages.product),\n },\n {\n value: 'events',\n displayText: intl.formatMessage(intlMessages.events),\n },\n {\n value: 'education',\n displayText: intl.formatMessage(intlMessages.boxEducation),\n },\n ];\n }, [intl, messages]);\n const listRef = React.useRef(null);\n const isMouseInTitleRef = React.useRef(false);\n const messageLoadCacheRef = React.useRef(new Map<number, boolean>());\n const [category, setCategory] = React.useState(ALL);\n const [isExpanded, setIsExpanded] = React.useState(true);\n const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 });\n const scrollRef = React.useRef<{ scrollbarRef: React.ElementRef<typeof Scrollbar> } | null>(null);\n\n const title = (\n <section\n className={classNames('bdl-MessageCenterModal-title', {\n 'is-expanded': isExpanded,\n 'is-collapsed': !isExpanded,\n })}\n data-testid=\"modal-title\"\n onMouseEnter={() => {\n isMouseInTitleRef.current = true;\n setIsExpanded(true);\n }}\n onMouseLeave={() => {\n isMouseInTitleRef.current = false;\n }}\n >\n <div className=\"bdl-MessageCenterModal-whatsNew\">\n <FormattedMessage {...intlMessages.title} />\n </div>\n {categories && (\n <AnimateHeight duration={300} height={isExpanded ? 'auto' : 0}>\n <section className=\"bdl-MessageCenterModal-categorySelector\">\n <CategorySelector\n currentCategory={category}\n categories={categories}\n onSelect={value => {\n cache.clearAll();\n setCategory(value);\n }}\n />\n </section>\n </AnimateHeight>\n )}\n </section>\n );\n\n const filteredMessages = React.useMemo(() => {\n if (!Array.isArray(messages)) {\n return [];\n }\n\n return messages\n .filter(({ templateParams }) => {\n return category === ALL || templateParams.category === category;\n })\n .sort(\n (\n { activateDate: activateDateA, priority: priorityA },\n { activateDate: activateDateB, priority: priorityB },\n ) => {\n // sort by date (descending), secondary sort by priority (descending)\n if (activateDateA > activateDateB) {\n return -1;\n }\n\n if (activateDateA < activateDateB) {\n return 1;\n }\n\n if (priorityA > priorityB) {\n return -1;\n }\n\n if (priorityA < priorityB) {\n return 1;\n }\n\n return 0;\n },\n );\n }, [category, messages]);\n\n React.useEffect(() => {\n if (scrollRef.current && scrollRef.current.scrollbarRef && scrollRef.current.scrollbarRef.current) {\n scrollRef.current.scrollbarRef.current.scrollToTop();\n }\n }, [category]);\n\n function rowRenderer({ index, parent, style, isVisible }: Object) {\n const message = filteredMessages[index];\n const messageId = message.id;\n const isFirstTimeBeingShown = !messageLoadCacheRef.current.has(messageId);\n if (isVisible && isFirstTimeBeingShown) {\n messageLoadCacheRef.current.set(messageId, true);\n onMessageShown(message);\n }\n\n return (\n <CellMeasurer key={messageId} cache={cache} columnIndex={0} parent={parent} rowIndex={index}>\n {({ registerChild }) => (\n <div\n ref={registerChild}\n className=\"bdl-MessageCenterModal-message\"\n style={style}\n data-testid=\"messagecentermodalmessage\"\n >\n <Message\n contentPreviewProps={contentPreviewProps}\n apiHost={apiHost}\n {...message}\n getToken={getToken}\n />\n </div>\n )}\n </CellMeasurer>\n );\n }\n\n function handleOnScroll(clientHeight, scrollTop, prevClientHeight, prevScrollTop) {\n if (clientHeight > 0 && clientHeight === prevClientHeight && !isMouseInTitleRef.current) {\n const isScrollingDown = prevScrollTop < scrollTop;\n if (isExpanded && isScrollingDown) {\n setIsExpanded(false);\n } else if (!isExpanded && !isScrollingDown) {\n setIsExpanded(true);\n }\n }\n }\n\n function handleResize(resizeDimensions) {\n setDimensions(resizeDimensions);\n }\n\n const handlOnResize = React.useCallback(debounce(handleResize, 300), []);\n\n function renderMessages(width: number, height: number): React.Node {\n if (!messages) {\n return (\n <div className=\"bdl-MessageCenterModal-message\">\n <div className=\"bdl-MessageCenterModal-ghost\">\n <MessagePreviewGhost />\n <BottomContentWrapper>\n <ContentGhost />\n </BottomContentWrapper>\n </div>\n </div>\n );\n }\n\n return (\n <List\n ref={listRef}\n className=\"bdl-MessageCenterModal-list\"\n deferredMeasurementCache={cache}\n height={dimensions.height || height}\n noRowsRenderer={EmptyState}\n overscanRowCount={overscanRowCount}\n rowCount={filteredMessages.length}\n rowHeight={cache.rowHeight}\n rowRenderer={rowRenderer}\n style={listStyle}\n width={width - SCROLLBAR_MARGIN}\n />\n );\n }\n\n return (\n <Modal\n className=\"bdl-MessageCenterModal\"\n data-resin-component=\"messageCenterModal\"\n data-testid=\"messagecentermodal\"\n isOpen\n onRequestClose={onRequestClose}\n title={title}\n >\n <section className=\"bdl-MessageCenterModal-messages\">\n <AutoSizer onResize={handlOnResize}>\n {({ height, width }) => (\n <CollapsibleScrollbar\n ref={scrollRef}\n onScroll={(\n { clientHeight, scrollTop, scrollLeft },\n { clientHeight: prevClientHeight, scrollTop: prevScrollTop },\n ) => {\n handleOnScroll(clientHeight, scrollTop, prevClientHeight, prevScrollTop);\n if (listRef.current && listRef.current.Grid) {\n const { Grid } = listRef.current;\n Grid.handleScrollEvent({ scrollTop, scrollLeft });\n }\n }}\n permanentTrackY\n style={{ width, height }}\n trackYStyles={trackYStyles}\n >\n {messages instanceof Error ? (\n <ErrorState>\n <FormattedMessage {...intlMessages.errorFetchingPosts} />\n </ErrorState>\n ) : (\n renderMessages(width, height)\n )}\n </CollapsibleScrollbar>\n )}\n </AutoSizer>\n </section>\n </Modal>\n );\n}\n\nexport default injectIntl(MessageCenterModal);\n"],"file":"MessageCenterModal.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/features/message-center/components/message-center-modal/MessageCenterModal.js"],"names":["React","FormattedMessage","injectIntl","classNames","AutoSizer","CellMeasurer","CellMeasurerCache","List","debounce","AnimateHeight","Scrollbar","Modal","CategorySelector","CollapsibleScrollbar","Message","intlMessages","MessagePreviewGhost","ContentGhost","BottomContentWrapper","ErrorState","EmptyState","ALL","cache","defaultHeight","fixedWidth","SCROLLBAR_MARGIN","listStyle","overflowX","overflowY","trackYStyles","marginLeft","MessageCenterModal","apiHost","contentPreviewProps","onRequestClose","messages","getToken","intl","overscanRowCount","onMessageShown","categories","useMemo","Array","isArray","messageCategoriesSet","Set","forEach","category","templateParams","add","size","value","displayText","formatMessage","all","product","events","boxEducation","listRef","useRef","isMouseInTitleRef","messageLoadCacheRef","Map","useState","setCategory","isExpanded","setIsExpanded","width","height","dimensions","setDimensions","scrollRef","title","current","clearAll","filteredMessages","filter","sort","activateDateA","activateDate","priorityA","priority","activateDateB","priorityB","useEffect","scrollbarRef","scrollToTop","rowRenderer","index","parent","style","isVisible","message","messageId","id","isFirstTimeBeingShown","has","set","registerChild","handleOnScroll","clientHeight","scrollTop","prevClientHeight","prevScrollTop","isScrollingDown","handleResize","resizeDimensions","handlOnResize","useCallback","renderMessages","length","rowHeight","scrollLeft","Grid","handleScrollEvent","Error","errorFetchingPosts"],"mappings":";;;;;;;;;;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,gBAAT,EAA2BC,UAA3B,QAA2E,YAA3E;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,iBAAlC,EAAqDC,IAArD,QAAiE,wBAAjE;AACA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,OAAOC,SAAP,MAAsB,yBAAtB;AAEA,OAAOC,KAAP,MAAkB,oCAAlB;AACA,OAAOC,gBAAP,MAA6B,2DAA7B;AAEA,OAAOC,oBAAP,MAAiC,gDAAjC;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AAGA,OAAO,2BAAP;AACA,OAAOC,mBAAP,MAAgC,oDAAhC;AACA,OAAOC,YAAP,MAAyB,kCAAzB;AACA,OAAOC,oBAAP,MAAiC,0CAAjC;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAYA,IAAMC,GAAG,GAAG,KAAZ;AACA,IAAMC,KAAK,GAAG,IAAIhB,iBAAJ,CAAsB;AAChCiB,EAAAA,aAAa,EAAE,GADiB;AAEhCC,EAAAA,UAAU,EAAE;AAFoB,CAAtB,CAAd;AAKA,IAAMC,gBAAgB,GAAG,EAAzB;AAC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C,aAA5C,CAAd;;AACA,YAAI7C,OAAO,CAACe,OAAR,IAAmBf,OAAO,CAACe,OAAR,CAAgBwC,IAAvC,EAA6C;AAAA,cACjCA,IADiC,GACxBvD,OAAO,CAACe,OADgB,CACjCwC,IADiC;AAEzCA,UAAAA,IAAI,CAACC,iBAAL,CAAuB;AAAEb,YAAAA,SAAS,EAATA,SAAF;AAAaW,YAAAA,UAAU,EAAVA;AAAb,WAAvB;AACH;AACJ,OAXL;AAYI,MAAA,eAAe,MAZnB;AAaI,MAAA,KAAK,EAAE;AAAE7C,QAAAA,KAAK,EAALA,KAAF;AAASC,QAAAA,MAAM,EAANA;AAAT,OAbX;AAcI,MAAA,YAAY,EAAEvC;AAdlB,OAgBKM,QAAQ,YAAYgF,KAApB,GACG,oBAAC,UAAD,QACI,oBAAC,gBAAD,EAAsBpG,YAAY,CAACqG,kBAAnC,CADJ,CADH,GAKGP,cAAc,CAAC1C,KAAD,EAAQC,MAAR,CArBtB,CADH;AAAA,GADL,CADJ,CARJ,CADJ;AAyCH;;AAED,eAAelE,UAAU,CAAC6B,kBAAD,CAAzB","sourcesContent":["// @flow\nimport * as React from 'react';\nimport { FormattedMessage, injectIntl, type InjectIntlProvidedProps } from 'react-intl';\nimport classNames from 'classnames';\nimport { AutoSizer, CellMeasurer, CellMeasurerCache, List } from '@box/react-virtualized';\nimport debounce from 'lodash/debounce';\nimport AnimateHeight from 'react-animate-height';\nimport Scrollbar from 'react-scrollbars-custom';\nimport type { Token } from '../../../../common/types/core';\nimport Modal from '../../../../components/modal/Modal';\nimport CategorySelector from '../../../../components/category-selector/CategorySelector';\n\nimport CollapsibleScrollbar from '../collapsibile-scrollbar/CollapsibleScrollbar';\nimport Message from '../message/Message';\nimport intlMessages from '../../messages';\nimport type { EligibleMessageCenterMessage } from '../../types';\nimport type { ContentPreviewProps } from '../../../message-preview-content/MessagePreviewContent';\nimport './MessageCenterModal.scss';\nimport MessagePreviewGhost from '../../../message-preview-ghost/MessagePreviewGhost';\nimport ContentGhost from '../templates/common/ContentGhost';\nimport BottomContentWrapper from '../templates/common/BottomContentWrapper';\nimport ErrorState from '../error-state/ErrorState';\nimport EmptyState from './EmptyState';\n\ntype Props = {|\n apiHost: string,\n contentPreviewProps?: ContentPreviewProps,\n getToken: (fileId: string) => Promise<Token>,\n messages: Array<EligibleMessageCenterMessage> | null | Error,\n onMessageShown: EligibleMessageCenterMessage => void,\n onRequestClose: () => void,\n overscanRowCount?: number,\n|};\n\nconst ALL = 'all';\nconst cache = new CellMeasurerCache({\n defaultHeight: 400,\n fixedWidth: true,\n});\n\nconst SCROLLBAR_MARGIN = 16;\nconst listStyle = { overflowX: false, overflowY: false };\nconst trackYStyles = { marginLeft: `${SCROLLBAR_MARGIN}px` };\n\nfunction MessageCenterModal({\n apiHost,\n contentPreviewProps,\n onRequestClose,\n messages,\n getToken,\n intl,\n overscanRowCount = 1,\n onMessageShown,\n}: Props & InjectIntlProvidedProps) {\n const categories: Array<{ displayText: string, value: string }> | null = React.useMemo(() => {\n if (!Array.isArray(messages)) {\n return null;\n }\n\n const messageCategoriesSet = new Set<string>();\n messages.forEach(({ templateParams: { category } }) => {\n messageCategoriesSet.add(category);\n });\n\n if (messageCategoriesSet.size <= 1) {\n return null;\n }\n\n return [\n {\n value: ALL,\n displayText: intl.formatMessage(intlMessages.all),\n },\n {\n value: 'product',\n displayText: intl.formatMessage(intlMessages.product),\n },\n {\n value: 'events',\n displayText: intl.formatMessage(intlMessages.events),\n },\n {\n value: 'education',\n displayText: intl.formatMessage(intlMessages.boxEducation),\n },\n ];\n }, [intl, messages]);\n const listRef = React.useRef(null);\n const isMouseInTitleRef = React.useRef(false);\n const messageLoadCacheRef = React.useRef(new Map<number, boolean>());\n const [category, setCategory] = React.useState(ALL);\n const [isExpanded, setIsExpanded] = React.useState(true);\n const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 });\n const scrollRef = React.useRef<{ scrollbarRef: React.ElementRef<typeof Scrollbar> } | null>(null);\n\n const title = (\n <section\n className={classNames('bdl-MessageCenterModal-title', {\n 'is-expanded': isExpanded,\n 'is-collapsed': !isExpanded,\n })}\n data-testid=\"modal-title\"\n onMouseEnter={() => {\n isMouseInTitleRef.current = true;\n setIsExpanded(true);\n }}\n onMouseLeave={() => {\n isMouseInTitleRef.current = false;\n }}\n >\n <div className=\"bdl-MessageCenterModal-whatsNew\">\n <FormattedMessage {...intlMessages.title} />\n </div>\n {categories && (\n <AnimateHeight duration={300} height={isExpanded ? 'auto' : 0}>\n <section className=\"bdl-MessageCenterModal-categorySelector\">\n <CategorySelector\n currentCategory={category}\n categories={categories}\n onSelect={value => {\n cache.clearAll();\n setCategory(value);\n }}\n />\n </section>\n </AnimateHeight>\n )}\n </section>\n );\n\n const filteredMessages = React.useMemo(() => {\n if (!Array.isArray(messages)) {\n return [];\n }\n\n return messages\n .filter(({ templateParams }) => {\n return category === ALL || templateParams.category === category;\n })\n .sort(\n (\n { activateDate: activateDateA, priority: priorityA },\n { activateDate: activateDateB, priority: priorityB },\n ) => {\n // sort by date (descending), secondary sort by priority (descending)\n if (activateDateA > activateDateB) {\n return -1;\n }\n\n if (activateDateA < activateDateB) {\n return 1;\n }\n\n if (priorityA > priorityB) {\n return -1;\n }\n\n if (priorityA < priorityB) {\n return 1;\n }\n\n return 0;\n },\n );\n }, [category, messages]);\n\n React.useEffect(() => {\n if (scrollRef.current && scrollRef.current.scrollbarRef && scrollRef.current.scrollbarRef.current) {\n scrollRef.current.scrollbarRef.current.scrollToTop();\n }\n }, [category]);\n\n function rowRenderer({ index, parent, style, isVisible }: Object) {\n const message = filteredMessages[index];\n const messageId = message.id;\n const isFirstTimeBeingShown = !messageLoadCacheRef.current.has(messageId);\n if (isVisible && isFirstTimeBeingShown) {\n messageLoadCacheRef.current.set(messageId, true);\n onMessageShown(message);\n }\n\n return (\n <CellMeasurer key={messageId} cache={cache} columnIndex={0} parent={parent} rowIndex={index}>\n {({ registerChild }) => (\n <div\n ref={registerChild}\n className=\"bdl-MessageCenterModal-message\"\n style={style}\n data-testid=\"messagecentermodalmessage\"\n >\n <Message\n contentPreviewProps={contentPreviewProps}\n apiHost={apiHost}\n {...message}\n getToken={getToken}\n />\n </div>\n )}\n </CellMeasurer>\n );\n }\n\n function handleOnScroll(clientHeight, scrollTop, prevClientHeight, prevScrollTop) {\n if (clientHeight > 0 && clientHeight === prevClientHeight && !isMouseInTitleRef.current) {\n const isScrollingDown = prevScrollTop < scrollTop;\n if (isExpanded && isScrollingDown) {\n setIsExpanded(false);\n } else if (!isExpanded && !isScrollingDown) {\n setIsExpanded(true);\n }\n }\n }\n\n function handleResize(resizeDimensions) {\n setDimensions(resizeDimensions);\n }\n\n const handlOnResize = React.useCallback(debounce(handleResize, 300), []);\n\n function renderMessages(width: number, height: number): React.Node {\n if (!messages) {\n return (\n <div className=\"bdl-MessageCenterModal-message\">\n <div className=\"bdl-MessageCenterModal-ghost\">\n <MessagePreviewGhost />\n <BottomContentWrapper>\n <ContentGhost />\n </BottomContentWrapper>\n </div>\n </div>\n );\n }\n\n return (\n <List\n ref={listRef}\n className=\"bdl-MessageCenterModal-list\"\n deferredMeasurementCache={cache}\n height={dimensions.height || height}\n noRowsRenderer={EmptyState}\n overscanRowCount={overscanRowCount}\n rowCount={filteredMessages.length}\n rowHeight={cache.rowHeight}\n rowRenderer={rowRenderer}\n scrollToIndex={0}\n style={listStyle}\n width={width - SCROLLBAR_MARGIN}\n />\n );\n }\n\n return (\n <Modal\n className=\"bdl-MessageCenterModal\"\n data-resin-component=\"messageCenterModal\"\n data-testid=\"messagecentermodal\"\n isOpen\n onRequestClose={onRequestClose}\n title={title}\n >\n <section className=\"bdl-MessageCenterModal-messages\">\n <AutoSizer onResize={handlOnResize}>\n {({ height, width }) => (\n <CollapsibleScrollbar\n ref={scrollRef}\n onScroll={(\n { clientHeight, scrollTop, scrollLeft },\n { clientHeight: prevClientHeight, scrollTop: prevScrollTop },\n ) => {\n handleOnScroll(clientHeight, scrollTop, prevClientHeight, prevScrollTop);\n if (listRef.current && listRef.current.Grid) {\n const { Grid } = listRef.current;\n Grid.handleScrollEvent({ scrollTop, scrollLeft });\n }\n }}\n permanentTrackY\n style={{ width, height }}\n trackYStyles={trackYStyles}\n >\n {messages instanceof Error ? (\n <ErrorState>\n <FormattedMessage {...intlMessages.errorFetchingPosts} />\n </ErrorState>\n ) : (\n renderMessages(width, height)\n )}\n </CollapsibleScrollbar>\n )}\n </AutoSizer>\n </section>\n </Modal>\n );\n}\n\nexport default injectIntl(MessageCenterModal);\n"],"file":"MessageCenterModal.js"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2
|
+
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import isEmpty from 'lodash/isEmpty';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
11
|
+
import Link from '../../components/link/LinkBase';
|
|
12
|
+
import messages from './messages';
|
|
13
|
+
import PresenceAvatar from './PresenceAvatar';
|
|
14
|
+
import { determineInteractionMessage } from './utils/presenceUtils';
|
|
15
|
+
import './PresenceCollaborator.scss';
|
|
16
|
+
export var renderTimestampMessage = function renderTimestampMessage(interactedAt, interactionType, intl) {
|
|
17
|
+
var lastActionMessage = determineInteractionMessage(interactionType, interactedAt);
|
|
18
|
+
var timeAgo = intl.formatRelativeTime ? intl.formatRelativeTime(interactedAt - Date.now()) : intl.formatRelative(interactedAt);
|
|
19
|
+
|
|
20
|
+
if (lastActionMessage) {
|
|
21
|
+
return React.createElement(FormattedMessage, _extends({}, lastActionMessage, {
|
|
22
|
+
values: {
|
|
23
|
+
timeAgo: timeAgo
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var PresenceCollaborator = function PresenceCollaborator(_ref) {
|
|
32
|
+
var collaborator = _ref.collaborator,
|
|
33
|
+
intl = _ref.intl,
|
|
34
|
+
props = _objectWithoutProperties(_ref, ["collaborator", "intl"]);
|
|
35
|
+
|
|
36
|
+
var avatarUrl = collaborator.avatarUrl,
|
|
37
|
+
id = collaborator.id,
|
|
38
|
+
interactedAt = collaborator.interactedAt,
|
|
39
|
+
interactionType = collaborator.interactionType,
|
|
40
|
+
isActive = collaborator.isActive,
|
|
41
|
+
name = collaborator.name,
|
|
42
|
+
profileUrl = collaborator.profileUrl;
|
|
43
|
+
return React.createElement("div", _extends({
|
|
44
|
+
className: "bdl-PresenceCollaborator"
|
|
45
|
+
}, props), React.createElement(PresenceAvatar, {
|
|
46
|
+
avatarUrl: avatarUrl,
|
|
47
|
+
id: id,
|
|
48
|
+
isActive: isActive,
|
|
49
|
+
isDropDownAvatar: true,
|
|
50
|
+
name: name
|
|
51
|
+
}), React.createElement("div", {
|
|
52
|
+
className: "bdl-PresenceCollaborator-info-container"
|
|
53
|
+
}, React.createElement("div", {
|
|
54
|
+
className: "bdl-PresenceCollaborator-info-name"
|
|
55
|
+
}, isEmpty(profileUrl) ? React.createElement("span", null, name) : React.createElement(Link, {
|
|
56
|
+
href: profileUrl,
|
|
57
|
+
target: "_blank"
|
|
58
|
+
}, name)), React.createElement("div", {
|
|
59
|
+
className: "bdl-PresenceCollaborator-info-time"
|
|
60
|
+
}, isActive ? React.createElement(FormattedMessage, messages.activeNowText) : renderTimestampMessage(interactedAt, interactionType, intl))));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
PresenceCollaborator.propTypes = {
|
|
64
|
+
collaborator: PropTypes.shape({
|
|
65
|
+
/** Url to avatar image. If passed in, component will render the avatar image instead of the initials */
|
|
66
|
+
avatarUrl: PropTypes.string,
|
|
67
|
+
|
|
68
|
+
/** Users id */
|
|
69
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
70
|
+
isActive: PropTypes.bool,
|
|
71
|
+
|
|
72
|
+
/** Unix timestamp of when the user last interacted with the document */
|
|
73
|
+
interactedAt: PropTypes.number,
|
|
74
|
+
|
|
75
|
+
/** The type of interaction by the user */
|
|
76
|
+
interactionType: PropTypes.string,
|
|
77
|
+
|
|
78
|
+
/** User's full name */
|
|
79
|
+
name: PropTypes.string.isRequired,
|
|
80
|
+
|
|
81
|
+
/** Custom Profile URL */
|
|
82
|
+
profileUrl: PropTypes.string
|
|
83
|
+
}).isRequired,
|
|
84
|
+
|
|
85
|
+
/* Intl object */
|
|
86
|
+
intl: PropTypes.any
|
|
87
|
+
};
|
|
88
|
+
export { PresenceCollaborator as PresenceCollaboratorComponent };
|
|
89
|
+
export default injectIntl(PresenceCollaborator);
|
|
90
|
+
//# sourceMappingURL=PresenceCollaborator.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
5
|
+
|
|
6
|
+
import Link from '../../components/link/LinkBase';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
import PresenceAvatar from './PresenceAvatar';
|
|
9
|
+
import { determineInteractionMessage } from './utils/presenceUtils';
|
|
10
|
+
|
|
11
|
+
import './PresenceCollaborator.scss';
|
|
12
|
+
|
|
13
|
+
export const renderTimestampMessage = (interactedAt, interactionType, intl) => {
|
|
14
|
+
const lastActionMessage = determineInteractionMessage(interactionType, interactedAt);
|
|
15
|
+
const timeAgo = intl.formatRelativeTime
|
|
16
|
+
? intl.formatRelativeTime(interactedAt - Date.now())
|
|
17
|
+
: intl.formatRelative(interactedAt);
|
|
18
|
+
|
|
19
|
+
if (lastActionMessage) {
|
|
20
|
+
return (
|
|
21
|
+
<FormattedMessage
|
|
22
|
+
{...lastActionMessage}
|
|
23
|
+
values={{
|
|
24
|
+
timeAgo,
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const PresenceCollaborator = ({ collaborator, intl, ...props }) => {
|
|
33
|
+
const { avatarUrl, id, interactedAt, interactionType, isActive, name, profileUrl } = collaborator;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div className="bdl-PresenceCollaborator" {...props}>
|
|
37
|
+
<PresenceAvatar avatarUrl={avatarUrl} id={id} isActive={isActive} isDropDownAvatar name={name} />
|
|
38
|
+
<div className="bdl-PresenceCollaborator-info-container">
|
|
39
|
+
<div className="bdl-PresenceCollaborator-info-name">
|
|
40
|
+
{isEmpty(profileUrl) ? (
|
|
41
|
+
<span>{name}</span>
|
|
42
|
+
) : (
|
|
43
|
+
<Link href={profileUrl} target="_blank">
|
|
44
|
+
{name}
|
|
45
|
+
</Link>
|
|
46
|
+
)}
|
|
47
|
+
</div>
|
|
48
|
+
<div className="bdl-PresenceCollaborator-info-time">
|
|
49
|
+
{isActive ? (
|
|
50
|
+
<FormattedMessage {...messages.activeNowText} />
|
|
51
|
+
) : (
|
|
52
|
+
renderTimestampMessage(interactedAt, interactionType, intl)
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
PresenceCollaborator.propTypes = {
|
|
61
|
+
collaborator: PropTypes.shape({
|
|
62
|
+
/** Url to avatar image. If passed in, component will render the avatar image instead of the initials */
|
|
63
|
+
avatarUrl: PropTypes.string,
|
|
64
|
+
/** Users id */
|
|
65
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
66
|
+
isActive: PropTypes.bool,
|
|
67
|
+
/** Unix timestamp of when the user last interacted with the document */
|
|
68
|
+
interactedAt: PropTypes.number,
|
|
69
|
+
/** The type of interaction by the user */
|
|
70
|
+
interactionType: PropTypes.string,
|
|
71
|
+
/** User's full name */
|
|
72
|
+
name: PropTypes.string.isRequired,
|
|
73
|
+
/** Custom Profile URL */
|
|
74
|
+
profileUrl: PropTypes.string,
|
|
75
|
+
}).isRequired,
|
|
76
|
+
/* Intl object */
|
|
77
|
+
intl: PropTypes.any,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { PresenceCollaborator as PresenceCollaboratorComponent };
|
|
81
|
+
export default injectIntl(PresenceCollaborator);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/features/presence/PresenceCollaborator.js"],"names":["React","isEmpty","PropTypes","FormattedMessage","injectIntl","Link","messages","PresenceAvatar","determineInteractionMessage","renderTimestampMessage","interactedAt","interactionType","intl","lastActionMessage","timeAgo","formatRelativeTime","Date","now","formatRelative","PresenceCollaborator","collaborator","props","avatarUrl","id","isActive","name","profileUrl","activeNowText","propTypes","shape","string","oneOfType","number","bool","isRequired","any","PresenceCollaboratorComponent"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SA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EAAAA,IAAI,EAAEV,SAAS,CAACiC;AAjBa,CAAjC;AAoBA,SAAShB,oBAAoB,IAAIiB,6BAAjC;AACA,eAAehC,UAAU,CAACe,oBAAD,CAAzB","sourcesContent":["import * as React from 'react';\nimport isEmpty from 'lodash/isEmpty';\nimport PropTypes from 'prop-types';\nimport { FormattedMessage, injectIntl } from 'react-intl';\n\nimport Link from '../../components/link/LinkBase';\nimport messages from './messages';\nimport PresenceAvatar from './PresenceAvatar';\nimport { determineInteractionMessage } from './utils/presenceUtils';\n\nimport './PresenceCollaborator.scss';\n\nexport const renderTimestampMessage = (interactedAt, interactionType, intl) => {\n const lastActionMessage = determineInteractionMessage(interactionType, interactedAt);\n const timeAgo = intl.formatRelativeTime\n ? intl.formatRelativeTime(interactedAt - Date.now())\n : intl.formatRelative(interactedAt);\n\n if (lastActionMessage) {\n return (\n <FormattedMessage\n {...lastActionMessage}\n values={{\n timeAgo,\n }}\n />\n );\n }\n return null;\n};\n\nconst PresenceCollaborator = ({ collaborator, intl, ...props }) => {\n const { avatarUrl, id, interactedAt, interactionType, isActive, name, profileUrl } = collaborator;\n\n return (\n <div className=\"bdl-PresenceCollaborator\" {...props}>\n <PresenceAvatar avatarUrl={avatarUrl} id={id} isActive={isActive} isDropDownAvatar name={name} />\n <div className=\"bdl-PresenceCollaborator-info-container\">\n <div className=\"bdl-PresenceCollaborator-info-name\">\n {isEmpty(profileUrl) ? (\n <span>{name}</span>\n ) : (\n <Link href={profileUrl} target=\"_blank\">\n {name}\n </Link>\n )}\n </div>\n <div className=\"bdl-PresenceCollaborator-info-time\">\n {isActive ? (\n <FormattedMessage {...messages.activeNowText} />\n ) : (\n renderTimestampMessage(interactedAt, interactionType, intl)\n )}\n </div>\n </div>\n </div>\n );\n};\n\nPresenceCollaborator.propTypes = {\n collaborator: PropTypes.shape({\n /** Url to avatar image. If passed in, component will render the avatar image instead of the initials */\n avatarUrl: PropTypes.string,\n /** Users id */\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isActive: PropTypes.bool,\n /** Unix timestamp of when the user last interacted with the document */\n interactedAt: PropTypes.number,\n /** The type of interaction by the user */\n interactionType: PropTypes.string,\n /** User's full name */\n name: PropTypes.string.isRequired,\n /** Custom Profile URL */\n profileUrl: PropTypes.string,\n }).isRequired,\n /* Intl object */\n intl: PropTypes.any,\n};\n\nexport { PresenceCollaborator as PresenceCollaboratorComponent };\nexport default injectIntl(PresenceCollaborator);\n"],"file":"PresenceCollaborator.js"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import './styles';
|
|
2
|
+
|
|
3
|
+
.bdl-PresenceCollaborator-info-container {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
margin-left: 10px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.bdl-PresenceCollaborator-info-name {
|
|
9
|
+
width: 180px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
color: $bdl-gray;
|
|
12
|
+
font-size: 13px;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
text-overflow: ellipsis;
|
|
15
|
+
|
|
16
|
+
a {
|
|
17
|
+
color: $bdl-gray;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
text-decoration: underline;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bdl-PresenceCollaborator-info-time {
|
|
26
|
+
color: $bdl-gray-62;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
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
|
-
|
|
5
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
4
|
|
|
7
5
|
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); } }
|
|
@@ -22,15 +20,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
22
20
|
|
|
23
21
|
import * as React from 'react';
|
|
24
22
|
import classnames from 'classnames';
|
|
25
|
-
import isEmpty from 'lodash/isEmpty';
|
|
26
23
|
import PropTypes from 'prop-types';
|
|
27
24
|
import throttle from 'lodash/throttle';
|
|
28
25
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
29
26
|
import Button from '../../components/button';
|
|
30
|
-
import
|
|
27
|
+
import PresenceCollaborator from './PresenceCollaborator';
|
|
31
28
|
import messages from './messages';
|
|
32
|
-
import PresenceAvatar from './PresenceAvatar';
|
|
33
|
-
import { determineInteractionMessage } from './utils/presenceUtils';
|
|
34
29
|
import './PresenceCollaboratorsList.scss';
|
|
35
30
|
|
|
36
31
|
var PresenceCollaboratorsList =
|
|
@@ -88,55 +83,6 @@ function (_React$Component) {
|
|
|
88
83
|
}, React.createElement(FormattedMessage, messages.recentActivity));
|
|
89
84
|
});
|
|
90
85
|
|
|
91
|
-
_defineProperty(_assertThisInitialized(_this), "renderTimestampMessage", function (interactedAt, interactionType) {
|
|
92
|
-
var lastActionMessage = determineInteractionMessage(interactionType, interactedAt);
|
|
93
|
-
var intl = _this.props.intl;
|
|
94
|
-
var timeAgo = intl.formatRelativeTime ? intl.formatRelativeTime(interactedAt - Date.now()) : intl.formatRelative(interactedAt);
|
|
95
|
-
|
|
96
|
-
if (lastActionMessage) {
|
|
97
|
-
return React.createElement(FormattedMessage, _extends({}, lastActionMessage, {
|
|
98
|
-
values: {
|
|
99
|
-
timeAgo: timeAgo
|
|
100
|
-
}
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return null;
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
_defineProperty(_assertThisInitialized(_this), "renderCollabList", function () {
|
|
108
|
-
var collaborators = _this.props.collaborators;
|
|
109
|
-
return collaborators.map(function (collaborator) {
|
|
110
|
-
var avatarUrl = collaborator.avatarUrl,
|
|
111
|
-
id = collaborator.id,
|
|
112
|
-
isActive = collaborator.isActive,
|
|
113
|
-
interactedAt = collaborator.interactedAt,
|
|
114
|
-
interactionType = collaborator.interactionType,
|
|
115
|
-
name = collaborator.name,
|
|
116
|
-
profileUrl = collaborator.profileUrl;
|
|
117
|
-
return React.createElement("div", {
|
|
118
|
-
key: id,
|
|
119
|
-
className: "bdl-PresenceCollaboratorsList-item",
|
|
120
|
-
role: "listitem"
|
|
121
|
-
}, React.createElement(PresenceAvatar, {
|
|
122
|
-
avatarUrl: avatarUrl,
|
|
123
|
-
id: id,
|
|
124
|
-
isActive: isActive,
|
|
125
|
-
isDropDownAvatar: true,
|
|
126
|
-
name: name
|
|
127
|
-
}), React.createElement("div", {
|
|
128
|
-
className: "bdl-PresenceCollaboratorsList-item-info-container"
|
|
129
|
-
}, React.createElement("div", {
|
|
130
|
-
className: "bdl-PresenceCollaboratorsList-item-info-name"
|
|
131
|
-
}, isEmpty(profileUrl) ? React.createElement("span", null, name) : React.createElement(Link, {
|
|
132
|
-
href: profileUrl,
|
|
133
|
-
target: "_blank"
|
|
134
|
-
}, name)), React.createElement("div", {
|
|
135
|
-
className: "bdl-PresenceCollaboratorsList-item-info-time"
|
|
136
|
-
}, isActive ? React.createElement(FormattedMessage, messages.activeNowText) : _this.renderTimestampMessage(interactedAt, interactionType))));
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
86
|
_defineProperty(_assertThisInitialized(_this), "renderActions", function () {
|
|
141
87
|
var _this$props = _this.props,
|
|
142
88
|
getLinkCallback = _this$props.getLinkCallback,
|
|
@@ -183,6 +129,7 @@ function (_React$Component) {
|
|
|
183
129
|
isScrollableAbove = _this$state.isScrollableAbove,
|
|
184
130
|
isScrollableBelow = _this$state.isScrollableBelow;
|
|
185
131
|
var _this$props2 = this.props,
|
|
132
|
+
collaborators = _this$props2.collaborators,
|
|
186
133
|
getLinkCallback = _this$props2.getLinkCallback,
|
|
187
134
|
inviteCallback = _this$props2.inviteCallback;
|
|
188
135
|
var buttonsPresent = getLinkCallback || inviteCallback;
|
|
@@ -193,7 +140,6 @@ function (_React$Component) {
|
|
|
193
140
|
'is-scrollable-below': isScrollableBelow
|
|
194
141
|
});
|
|
195
142
|
var title = this.renderTitle();
|
|
196
|
-
var collabList = this.renderCollabList();
|
|
197
143
|
var actions = this.renderActions();
|
|
198
144
|
return React.createElement("div", {
|
|
199
145
|
className: "bdl-PresenceCollaboratorsList"
|
|
@@ -204,7 +150,13 @@ function (_React$Component) {
|
|
|
204
150
|
className: dropdownListClasses,
|
|
205
151
|
onScroll: this.throttledHandleScroll,
|
|
206
152
|
role: "list"
|
|
207
|
-
},
|
|
153
|
+
}, collaborators.map(function (collaborator) {
|
|
154
|
+
return React.createElement(PresenceCollaborator, {
|
|
155
|
+
collaborator: collaborator,
|
|
156
|
+
key: collaborator.id,
|
|
157
|
+
role: "listitem"
|
|
158
|
+
});
|
|
159
|
+
})), actions);
|
|
208
160
|
}
|
|
209
161
|
}]);
|
|
210
162
|
|