@atlaskit/media-card 73.7.0 → 74.1.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/CHANGELOG.md +41 -0
- package/dist/cjs/errors.js +4 -0
- package/dist/cjs/files/cardImageView/cardImageViewWrapper.js +60 -0
- package/dist/cjs/files/cardImageView/cardOverlay/cardOverlayComponents.js +63 -0
- package/dist/cjs/files/cardImageView/cardOverlay/index.js +31 -19
- package/dist/cjs/files/cardImageView/cardOverlay/styles.js +75 -0
- package/dist/cjs/files/cardImageView/index.js +39 -28
- package/dist/cjs/files/cardImageView/styles.js +60 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/root/card/cardAnalytics.js +6 -2
- package/dist/cjs/root/card/getCardPreview/cache.js +9 -10
- package/dist/cjs/root/card/getCardPreview/index.js +65 -28
- package/dist/cjs/root/card/imageRefetchingAnalytics.js +45 -0
- package/dist/cjs/root/card/index.js +31 -31
- package/dist/cjs/root/cardView.js +48 -46
- package/dist/cjs/root/cardViewWrapper.js +35 -0
- package/dist/cjs/root/inlinePlayer.js +12 -14
- package/dist/cjs/root/inlinePlayerWrapper.js +32 -0
- package/dist/cjs/root/styles.js +57 -0
- package/dist/cjs/root/types.js +5 -0
- package/dist/cjs/root/ui/actionsBar/actionsBar.js +2 -2
- package/dist/cjs/root/ui/actionsBar/actionsBarWrapper.js +21 -0
- package/dist/cjs/root/ui/actionsBar/styles.js +28 -0
- package/dist/cjs/root/ui/actionsBar/types.js +5 -0
- package/dist/cjs/root/ui/blanket/blanket.js +21 -0
- package/dist/cjs/root/ui/blanket/styles.js +30 -0
- package/dist/cjs/root/ui/iconMessage/iconMessageWrapper.js +25 -0
- package/dist/cjs/root/ui/iconMessage/index.js +3 -5
- package/dist/cjs/root/ui/iconMessage/styles.js +32 -0
- package/dist/cjs/root/ui/iconMessage/types.js +5 -0
- package/dist/cjs/root/ui/iconWrapper/iconWrapper.js +25 -0
- package/dist/cjs/root/ui/iconWrapper/{styled.js → styles.js} +7 -7
- package/dist/cjs/root/ui/iconWrapper/types.js +5 -0
- package/dist/cjs/root/ui/loadingRateLimited/styles.js +36 -0
- package/dist/cjs/root/ui/newFileExperience/newFileExperienceWrapper.js +52 -0
- package/dist/cjs/root/ui/newFileExperience/styles.js +47 -0
- package/dist/cjs/root/ui/newFileExperience/types.js +5 -0
- package/dist/cjs/root/ui/playButton/playButton.js +4 -2
- package/dist/cjs/root/ui/playButton/playButtonBackground.js +20 -0
- package/dist/cjs/root/ui/playButton/playButtonWrapper.js +20 -0
- package/dist/cjs/root/ui/playButton/styles.js +29 -0
- package/dist/cjs/root/ui/progressBar/progressBar.js +10 -5
- package/dist/cjs/root/ui/progressBar/styledBar.js +29 -0
- package/dist/cjs/root/ui/progressBar/{styled.js → styles.js} +11 -7
- package/dist/cjs/root/ui/progressBar/types.js +5 -0
- package/dist/cjs/root/ui/{styled.js → styles.js} +22 -39
- package/dist/cjs/root/ui/tickBox/styles.js +36 -0
- package/dist/cjs/root/ui/tickBox/tickBox.js +3 -3
- package/dist/cjs/root/ui/tickBox/tickBoxWrapper.js +21 -0
- package/dist/cjs/root/ui/tickBox/types.js +5 -0
- package/dist/cjs/root/ui/titleBox/failedTitleBox.js +5 -7
- package/dist/cjs/root/ui/titleBox/styles.js +62 -0
- package/dist/cjs/root/ui/titleBox/titleBox.js +7 -7
- package/dist/cjs/root/ui/titleBox/titleBoxComponents.js +66 -0
- package/dist/cjs/root/ui/titleBox/types.js +5 -0
- package/dist/cjs/styles/animations.js +2 -2
- package/dist/cjs/styles/index.js +12 -7
- package/dist/cjs/utils/analytics.js +29 -2
- package/dist/cjs/utils/cardActions/cardActionButton.js +24 -0
- package/dist/cjs/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +3 -3
- package/dist/cjs/utils/cardActions/cardActionsView.js +11 -13
- package/dist/cjs/utils/cardActions/index.js +2 -2
- package/dist/cjs/utils/cardActions/{styled.js → styles.js} +8 -8
- package/dist/cjs/utils/document.js +9 -1
- package/dist/cjs/utils/errorIcon/index.js +8 -10
- package/dist/cjs/utils/errorIcon/styles.js +17 -0
- package/dist/cjs/utils/fileIcon/index.js +9 -14
- package/dist/cjs/utils/fileIcon/styles.js +19 -0
- package/dist/cjs/utils/lightCards/cardError.js +2 -2
- package/dist/cjs/utils/lightCards/cardLoading.js +3 -3
- package/dist/cjs/utils/lightCards/lightCardWrappers.js +41 -0
- package/dist/cjs/utils/lightCards/styles.js +47 -0
- package/dist/cjs/utils/mediaTypeIcon/iconWrapper.js +20 -0
- package/dist/cjs/utils/mediaTypeIcon/index.js +2 -2
- package/dist/cjs/utils/mediaTypeIcon/{styled.js → styles.js} +9 -5
- package/dist/cjs/utils/mediaTypeIcon/types.js +5 -0
- package/dist/cjs/utils/progressBar/index.js +7 -9
- package/dist/cjs/utils/progressBar/styles.js +19 -0
- package/dist/cjs/utils/ufoExperiences.js +12 -8
- package/dist/cjs/utils/viewportDetector.js +11 -36
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/errors.js +4 -0
- package/dist/es2019/files/cardImageView/cardImageViewWrapper.js +43 -0
- package/dist/es2019/files/cardImageView/cardOverlay/cardOverlayComponents.js +41 -0
- package/dist/es2019/files/cardImageView/cardOverlay/index.js +29 -15
- package/dist/es2019/files/cardImageView/cardOverlay/{styled.js → styles.js} +34 -25
- package/dist/es2019/files/cardImageView/index.js +38 -26
- package/dist/es2019/files/cardImageView/{styled.js → styles.js} +15 -14
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/root/card/cardAnalytics.js +3 -2
- package/dist/es2019/root/card/getCardPreview/cache.js +9 -10
- package/dist/es2019/root/card/getCardPreview/index.js +43 -10
- package/dist/es2019/root/card/imageRefetchingAnalytics.js +30 -0
- package/dist/es2019/root/card/index.js +28 -28
- package/dist/es2019/root/cardView.js +39 -36
- package/dist/es2019/root/cardViewWrapper.js +26 -0
- package/dist/es2019/root/inlinePlayer.js +6 -6
- package/dist/es2019/root/inlinePlayerWrapper.js +23 -0
- package/dist/es2019/root/{styled.js → styles.js} +18 -19
- package/dist/es2019/root/types.js +1 -0
- package/dist/es2019/root/ui/actionsBar/actionsBar.js +2 -2
- package/dist/es2019/root/ui/actionsBar/actionsBarWrapper.js +10 -0
- package/dist/es2019/root/ui/actionsBar/styles.js +15 -0
- package/dist/es2019/root/ui/actionsBar/types.js +1 -0
- package/dist/es2019/root/ui/blanket/blanket.js +12 -0
- package/dist/es2019/root/ui/blanket/styles.js +17 -0
- package/dist/es2019/root/ui/iconMessage/iconMessageWrapper.js +16 -0
- package/dist/es2019/root/ui/iconMessage/index.js +2 -3
- package/dist/es2019/root/ui/iconMessage/styles.js +32 -0
- package/dist/es2019/root/ui/iconMessage/types.js +1 -0
- package/dist/es2019/root/ui/iconWrapper/iconWrapper.js +16 -0
- package/dist/es2019/root/ui/iconWrapper/styles.js +25 -0
- package/dist/es2019/root/ui/iconWrapper/types.js +1 -0
- package/dist/es2019/root/ui/loadingRateLimited/styles.js +41 -0
- package/dist/es2019/root/ui/newFileExperience/newFileExperienceWrapper.js +42 -0
- package/dist/es2019/root/ui/newFileExperience/styles.js +50 -0
- package/dist/es2019/root/ui/newFileExperience/types.js +1 -0
- package/dist/es2019/root/ui/playButton/playButton.js +3 -2
- package/dist/es2019/root/ui/playButton/playButtonBackground.js +9 -0
- package/dist/es2019/root/ui/playButton/playButtonWrapper.js +9 -0
- package/dist/es2019/root/ui/playButton/{styled.js → styles.js} +5 -11
- package/dist/es2019/root/ui/progressBar/progressBar.js +5 -3
- package/dist/es2019/root/ui/progressBar/styledBar.js +20 -0
- package/dist/es2019/root/ui/progressBar/{styled.js → styles.js} +28 -24
- package/dist/es2019/root/ui/progressBar/types.js +1 -0
- package/dist/es2019/root/ui/styles.js +78 -0
- package/dist/es2019/root/ui/tickBox/styles.js +30 -0
- package/dist/es2019/root/ui/tickBox/tickBox.js +2 -2
- package/dist/es2019/root/ui/tickBox/tickBoxWrapper.js +10 -0
- package/dist/es2019/root/ui/tickBox/types.js +1 -0
- package/dist/es2019/root/ui/titleBox/failedTitleBox.js +3 -4
- package/dist/es2019/root/ui/titleBox/styles.js +68 -0
- package/dist/es2019/root/ui/titleBox/titleBox.js +2 -2
- package/dist/es2019/root/ui/titleBox/titleBoxComponents.js +49 -0
- package/dist/es2019/root/ui/titleBox/types.js +1 -0
- package/dist/es2019/styles/animations.js +1 -1
- package/dist/es2019/styles/index.js +4 -4
- package/dist/es2019/utils/analytics.js +18 -1
- package/dist/es2019/utils/cardActions/cardActionButton.js +13 -0
- package/dist/es2019/utils/cardActions/cardActionIconButton.js +1 -2
- package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +1 -1
- package/dist/es2019/utils/cardActions/cardActionsView.js +9 -6
- package/dist/es2019/utils/cardActions/index.js +1 -1
- package/dist/es2019/utils/cardActions/{styled.js → styles.js} +14 -12
- package/dist/es2019/utils/document.js +11 -1
- package/dist/es2019/utils/errorIcon/index.js +7 -3
- package/dist/es2019/utils/errorIcon/styles.js +5 -0
- package/dist/es2019/utils/fileIcon/index.js +7 -5
- package/dist/es2019/utils/fileIcon/{styled.js → styles.js} +2 -2
- package/dist/es2019/utils/lightCards/cardError.js +1 -1
- package/dist/es2019/utils/lightCards/cardLoading.js +1 -1
- package/dist/es2019/utils/lightCards/lightCardWrappers.js +24 -0
- package/dist/es2019/utils/lightCards/{styled.js → styles.js} +16 -9
- package/dist/es2019/utils/mediaTypeIcon/iconWrapper.js +9 -0
- package/dist/es2019/utils/mediaTypeIcon/index.js +1 -1
- package/dist/es2019/utils/mediaTypeIcon/{styled.js → styles.js} +10 -5
- package/dist/es2019/utils/mediaTypeIcon/types.js +1 -0
- package/dist/es2019/utils/progressBar/index.js +6 -3
- package/dist/es2019/utils/progressBar/{styled.js → styles.js} +2 -2
- package/dist/es2019/utils/ufoExperiences.js +5 -3
- package/dist/es2019/utils/viewportDetector.js +9 -36
- package/dist/es2019/version.json +1 -1
- package/dist/esm/errors.js +4 -0
- package/dist/esm/files/cardImageView/cardImageViewWrapper.js +41 -0
- package/dist/esm/files/cardImageView/cardOverlay/cardOverlayComponents.js +39 -0
- package/dist/esm/files/cardImageView/cardOverlay/index.js +28 -15
- package/dist/esm/files/cardImageView/cardOverlay/styles.js +46 -0
- package/dist/esm/files/cardImageView/index.js +37 -26
- package/dist/esm/files/cardImageView/styles.js +36 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/root/card/cardAnalytics.js +5 -2
- package/dist/esm/root/card/getCardPreview/cache.js +9 -10
- package/dist/esm/root/card/getCardPreview/helpers.js +1 -1
- package/dist/esm/root/card/getCardPreview/index.js +64 -29
- package/dist/esm/root/card/imageRefetchingAnalytics.js +32 -0
- package/dist/esm/root/card/index.js +29 -31
- package/dist/esm/root/cardView.js +38 -36
- package/dist/esm/root/cardViewWrapper.js +24 -0
- package/dist/esm/root/inline/loader.js +1 -1
- package/dist/esm/root/inlinePlayer.js +7 -7
- package/dist/esm/root/inlinePlayerWrapper.js +21 -0
- package/dist/esm/root/styles.js +36 -0
- package/dist/esm/root/types.js +1 -0
- package/dist/esm/root/ui/actionsBar/actionsBar.js +2 -2
- package/dist/esm/root/ui/actionsBar/actionsBarWrapper.js +10 -0
- package/dist/esm/root/ui/actionsBar/styles.js +12 -0
- package/dist/esm/root/ui/actionsBar/types.js +1 -0
- package/dist/esm/root/ui/blanket/blanket.js +10 -0
- package/dist/esm/root/ui/blanket/styles.js +13 -0
- package/dist/esm/root/ui/iconMessage/iconMessageWrapper.js +14 -0
- package/dist/esm/root/ui/iconMessage/index.js +2 -3
- package/dist/esm/root/ui/iconMessage/styles.js +19 -0
- package/dist/esm/root/ui/iconMessage/types.js +1 -0
- package/dist/esm/root/ui/iconWrapper/iconWrapper.js +14 -0
- package/dist/esm/root/ui/iconWrapper/{styled.js → styles.js} +5 -5
- package/dist/esm/root/ui/iconWrapper/types.js +1 -0
- package/dist/esm/root/ui/loadingRateLimited/styles.js +17 -0
- package/dist/esm/root/ui/newFileExperience/newFileExperienceWrapper.js +40 -0
- package/dist/esm/root/ui/newFileExperience/styles.js +27 -0
- package/dist/esm/root/ui/newFileExperience/types.js +1 -0
- package/dist/esm/root/ui/playButton/playButton.js +3 -2
- package/dist/esm/root/ui/playButton/playButtonBackground.js +9 -0
- package/dist/esm/root/ui/playButton/playButtonWrapper.js +9 -0
- package/dist/esm/root/ui/playButton/styles.js +13 -0
- package/dist/esm/root/ui/progressBar/progressBar.js +5 -3
- package/dist/esm/root/ui/progressBar/styledBar.js +18 -0
- package/dist/esm/root/ui/progressBar/{styled.js → styles.js} +10 -5
- package/dist/esm/root/ui/progressBar/types.js +1 -0
- package/dist/esm/root/ui/styles.js +72 -0
- package/dist/esm/root/ui/tickBox/styles.js +16 -0
- package/dist/esm/root/ui/tickBox/tickBox.js +2 -2
- package/dist/esm/root/ui/tickBox/tickBoxWrapper.js +10 -0
- package/dist/esm/root/ui/tickBox/types.js +1 -0
- package/dist/esm/root/ui/titleBox/failedTitleBox.js +3 -4
- package/dist/esm/root/ui/titleBox/styles.js +39 -0
- package/dist/esm/root/ui/titleBox/titleBox.js +2 -2
- package/dist/esm/root/ui/titleBox/titleBoxComponents.js +43 -0
- package/dist/esm/root/ui/titleBox/types.js +1 -0
- package/dist/esm/styles/animations.js +1 -1
- package/dist/esm/styles/index.js +8 -4
- package/dist/esm/utils/analytics.js +22 -1
- package/dist/esm/utils/cardActions/cardActionButton.js +13 -0
- package/dist/esm/utils/cardActions/cardActionIconButton.js +1 -2
- package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +1 -1
- package/dist/esm/utils/cardActions/cardActionsView.js +9 -6
- package/dist/esm/utils/cardActions/index.js +1 -1
- package/dist/esm/utils/cardActions/{styled.js → styles.js} +6 -6
- package/dist/esm/utils/document.js +9 -1
- package/dist/esm/utils/errorIcon/index.js +6 -3
- package/dist/esm/utils/errorIcon/styles.js +6 -0
- package/dist/esm/utils/fileIcon/index.js +7 -5
- package/dist/esm/utils/fileIcon/styles.js +7 -0
- package/dist/esm/utils/lightCards/cardError.js +1 -1
- package/dist/esm/utils/lightCards/cardLoading.js +1 -1
- package/dist/esm/utils/lightCards/lightCardWrappers.js +24 -0
- package/dist/esm/utils/lightCards/styles.js +28 -0
- package/dist/esm/utils/mediaTypeIcon/iconWrapper.js +9 -0
- package/dist/esm/utils/mediaTypeIcon/index.js +1 -1
- package/dist/esm/utils/mediaTypeIcon/{styled.js → styles.js} +8 -3
- package/dist/esm/utils/mediaTypeIcon/types.js +1 -0
- package/dist/esm/utils/progressBar/index.js +6 -3
- package/dist/esm/utils/progressBar/styles.js +7 -0
- package/dist/esm/utils/ufoExperiences.js +7 -3
- package/dist/esm/utils/videoSnapshot.js +1 -1
- package/dist/esm/utils/viewportDetector.js +9 -36
- package/dist/esm/version.json +1 -1
- package/dist/types/errors.d.ts +5 -1
- package/dist/types/files/cardImageView/cardImageViewWrapper.d.ts +6 -0
- package/dist/types/files/cardImageView/cardOverlay/cardOverlayComponents.d.ts +8 -0
- package/dist/types/files/cardImageView/cardOverlay/index.d.ts +6 -4
- package/dist/types/files/cardImageView/cardOverlay/styles.d.ts +26 -0
- package/dist/types/files/cardImageView/index.d.ts +3 -1
- package/dist/types/files/cardImageView/styles.d.ts +24 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/root/card/cardAnalytics.d.ts +1 -1
- package/dist/types/root/card/getCardPreview/cache.d.ts +9 -8
- package/dist/types/root/card/getCardPreview/index.d.ts +11 -6
- package/dist/types/root/card/imageRefetchingAnalytics.d.ts +10 -0
- package/dist/types/root/card/index.d.ts +0 -2
- package/dist/types/root/cardView.d.ts +4 -2
- package/dist/types/root/cardViewWrapper.d.ts +4 -0
- package/dist/types/root/inlinePlayer.d.ts +0 -1
- package/dist/types/root/inlinePlayerWrapper.d.ts +4 -0
- package/dist/types/root/styles.d.ts +10 -0
- package/dist/types/root/types.d.ts +24 -0
- package/dist/types/root/ui/actionsBar/actionsBar.d.ts +1 -5
- package/dist/types/root/ui/actionsBar/actionsBarWrapper.d.ts +4 -0
- package/dist/types/root/ui/actionsBar/styles.d.ts +6 -0
- package/dist/types/root/ui/actionsBar/types.d.ts +10 -0
- package/dist/types/root/ui/blanket/blanket.d.ts +6 -0
- package/dist/types/root/ui/blanket/styles.d.ts +6 -0
- package/dist/types/root/ui/iconMessage/iconMessageWrapper.d.ts +4 -0
- package/dist/types/root/ui/iconMessage/index.d.ts +1 -10
- package/dist/types/root/ui/iconMessage/styles.d.ts +5 -0
- package/dist/types/root/ui/iconMessage/types.d.ts +19 -0
- package/dist/types/root/ui/iconWrapper/iconWrapper.d.ts +4 -0
- package/dist/types/root/ui/iconWrapper/styles.d.ts +7 -0
- package/dist/types/root/ui/iconWrapper/types.d.ts +6 -0
- package/dist/types/root/ui/loadingRateLimited/styles.d.ts +13 -0
- package/dist/types/root/ui/newFileExperience/newFileExperienceWrapper.d.ts +4 -0
- package/dist/types/root/ui/newFileExperience/styles.d.ts +5 -0
- package/dist/types/root/ui/newFileExperience/types.d.ts +23 -0
- package/dist/types/root/ui/playButton/playButtonBackground.d.ts +3 -0
- package/dist/types/root/ui/playButton/playButtonWrapper.d.ts +3 -0
- package/dist/types/root/ui/playButton/styles.d.ts +5 -0
- package/dist/types/root/ui/progressBar/progressBar.d.ts +1 -0
- package/dist/types/root/ui/progressBar/styledBar.d.ts +4 -0
- package/dist/types/root/ui/progressBar/styles.d.ts +7 -0
- package/dist/types/root/ui/progressBar/types.d.ts +7 -0
- package/dist/types/root/ui/styles.d.ts +11 -0
- package/dist/types/root/ui/tickBox/styles.d.ts +7 -0
- package/dist/types/root/ui/tickBox/tickBox.d.ts +1 -3
- package/dist/types/root/ui/tickBox/tickBoxWrapper.d.ts +4 -0
- package/dist/types/root/ui/tickBox/types.d.ts +4 -0
- package/dist/types/root/ui/titleBox/failedTitleBox.d.ts +1 -7
- package/dist/types/root/ui/titleBox/styles.d.ts +15 -0
- package/dist/types/root/ui/titleBox/titleBox.d.ts +1 -13
- package/dist/types/root/ui/titleBox/titleBoxComponents.d.ts +8 -0
- package/dist/types/root/ui/titleBox/types.d.ts +32 -0
- package/dist/types/styles/animations.d.ts +1 -1
- package/dist/types/styles/index.d.ts +3 -4
- package/dist/types/styles/mixins.d.ts +2 -2
- package/dist/types/types.d.ts +2 -0
- package/dist/types/utils/analytics.d.ts +17 -1
- package/dist/types/utils/cardActions/cardActionButton.d.ts +4 -0
- package/dist/types/utils/cardActions/cardActionIconButton.d.ts +1 -1
- package/dist/types/utils/cardActions/cardActionsDropdownMenu.d.ts +1 -1
- package/dist/types/utils/cardActions/cardActionsView.d.ts +1 -1
- package/dist/types/utils/cardActions/index.d.ts +1 -1
- package/dist/types/utils/cardActions/styles.d.ts +18 -0
- package/dist/types/utils/document.d.ts +1 -1
- package/dist/types/utils/errorIcon/index.d.ts +3 -1
- package/dist/types/utils/errorIcon/styles.d.ts +1 -0
- package/dist/types/utils/fileIcon/index.d.ts +3 -1
- package/dist/types/utils/fileIcon/styles.d.ts +1 -0
- package/dist/types/utils/lightCards/lightCardWrappers.d.ts +5 -0
- package/dist/types/utils/lightCards/styles.d.ts +4 -0
- package/dist/types/utils/lightCards/types.d.ts +8 -0
- package/dist/types/utils/mediaTypeIcon/iconWrapper.d.ts +4 -0
- package/dist/types/utils/mediaTypeIcon/styles.d.ts +2 -0
- package/dist/types/utils/mediaTypeIcon/types.d.ts +6 -0
- package/dist/types/utils/progressBar/index.d.ts +3 -1
- package/dist/types/utils/progressBar/styles.d.ts +1 -0
- package/dist/types/utils/ufoExperiences.d.ts +1 -1
- package/dist/types/utils/viewportDetector.d.ts +0 -10
- package/example-helpers/cardViewWrapper.tsx +26 -0
- package/example-helpers/cards.tsx +417 -0
- package/example-helpers/styles.ts +115 -0
- package/package.json +12 -11
- package/report.api.md +269 -0
- package/dist/cjs/files/cardImageView/cardOverlay/styled.js +0 -86
- package/dist/cjs/files/cardImageView/styled.js +0 -73
- package/dist/cjs/root/styled.js +0 -58
- package/dist/cjs/root/ui/actionsBar/styled.js +0 -31
- package/dist/cjs/root/ui/blanket/styled.js +0 -33
- package/dist/cjs/root/ui/iconMessage/styled.js +0 -34
- package/dist/cjs/root/ui/loadingRateLimited/loadingRateLimited.js +0 -35
- package/dist/cjs/root/ui/loadingRateLimited/styled.js +0 -43
- package/dist/cjs/root/ui/playButton/styled.js +0 -38
- package/dist/cjs/root/ui/tickBox/styled.js +0 -37
- package/dist/cjs/root/ui/titleBox/styled.js +0 -67
- package/dist/cjs/utils/errorIcon/styled.js +0 -18
- package/dist/cjs/utils/fileIcon/styled.js +0 -20
- package/dist/cjs/utils/lightCards/styled.js +0 -43
- package/dist/cjs/utils/progressBar/styled.js +0 -20
- package/dist/es2019/root/ui/actionsBar/styled.js +0 -23
- package/dist/es2019/root/ui/blanket/styled.js +0 -25
- package/dist/es2019/root/ui/iconMessage/styled.js +0 -30
- package/dist/es2019/root/ui/iconWrapper/styled.js +0 -27
- package/dist/es2019/root/ui/loadingRateLimited/loadingRateLimited.js +0 -16
- package/dist/es2019/root/ui/loadingRateLimited/styled.js +0 -43
- package/dist/es2019/root/ui/styled.js +0 -134
- package/dist/es2019/root/ui/tickBox/styled.js +0 -41
- package/dist/es2019/root/ui/titleBox/styled.js +0 -81
- package/dist/es2019/utils/errorIcon/styled.js +0 -5
- package/dist/esm/files/cardImageView/cardOverlay/styled.js +0 -39
- package/dist/esm/files/cardImageView/styled.js +0 -34
- package/dist/esm/root/styled.js +0 -36
- package/dist/esm/root/ui/actionsBar/styled.js +0 -15
- package/dist/esm/root/ui/blanket/styled.js +0 -16
- package/dist/esm/root/ui/iconMessage/styled.js +0 -15
- package/dist/esm/root/ui/loadingRateLimited/loadingRateLimited.js +0 -17
- package/dist/esm/root/ui/loadingRateLimited/styled.js +0 -17
- package/dist/esm/root/ui/playButton/styled.js +0 -19
- package/dist/esm/root/ui/styled.js +0 -98
- package/dist/esm/root/ui/tickBox/styled.js +0 -21
- package/dist/esm/root/ui/titleBox/styled.js +0 -40
- package/dist/esm/utils/errorIcon/styled.js +0 -6
- package/dist/esm/utils/fileIcon/styled.js +0 -7
- package/dist/esm/utils/lightCards/styled.js +0 -19
- package/dist/esm/utils/progressBar/styled.js +0 -7
- package/dist/types/files/cardImageView/cardOverlay/styled.d.ts +0 -23
- package/dist/types/files/cardImageView/styled.d.ts +0 -276
- package/dist/types/root/styled.d.ts +0 -16
- package/dist/types/root/ui/actionsBar/styled.d.ts +0 -10
- package/dist/types/root/ui/blanket/styled.d.ts +0 -10
- package/dist/types/root/ui/iconMessage/styled.d.ts +0 -6
- package/dist/types/root/ui/iconWrapper/styled.d.ts +0 -8
- package/dist/types/root/ui/loadingRateLimited/loadingRateLimited.d.ts +0 -6
- package/dist/types/root/ui/loadingRateLimited/styled.d.ts +0 -11
- package/dist/types/root/ui/playButton/styled.d.ts +0 -9
- package/dist/types/root/ui/progressBar/styled.d.ts +0 -10
- package/dist/types/root/ui/styled.d.ts +0 -20
- package/dist/types/root/ui/tickBox/styled.d.ts +0 -10
- package/dist/types/root/ui/titleBox/styled.d.ts +0 -18
- package/dist/types/utils/cardActions/styled.d.ts +0 -12
- package/dist/types/utils/errorIcon/styled.d.ts +0 -2
- package/dist/types/utils/fileIcon/styled.d.ts +0 -2
- package/dist/types/utils/lightCards/styled.d.ts +0 -8
- package/dist/types/utils/mediaTypeIcon/styled.d.ts +0 -6
- package/dist/types/utils/progressBar/styled.d.ts +0 -2
- package/example-helpers/styled.ts +0 -137
|
@@ -5,6 +5,8 @@ import { getCardPreviewFromFilePreview, getCardPreviewFromBackend } from './help
|
|
|
5
5
|
import { MediaCardError, SsrPreviewError, isUnsupportedLocalPreviewError } from '../../../errors';
|
|
6
6
|
import { isBigger } from '../../../utils/dimensionComparer';
|
|
7
7
|
import { extractFilePreviewStatus, isPreviewableStatus } from './filePreviewStatus';
|
|
8
|
+
import { fireImageFetchingOperationalEvent, calculatePercentageDifference } from '../imageRefetchingAnalytics';
|
|
9
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
8
10
|
export { getCardPreviewFromFilePreview, getCardPreviewFromBackend, isSupportedLocalPreview } from './helpers';
|
|
9
11
|
export { extractFilePreviewStatus } from './filePreviewStatus';
|
|
10
12
|
export const getCardPreviewFromCache = cardPreviewCache.get;
|
|
@@ -16,7 +18,7 @@ export const removeCardPreviewFromCache = cardPreviewCache.remove;
|
|
|
16
18
|
|
|
17
19
|
export const getFilePreviewFromFileState = fileState => 'mimeType' in fileState && isMimeTypeSupportedByBrowser(fileState.mimeType) && isPreviewableFileState(fileState) ? fileState.preview : undefined;
|
|
18
20
|
|
|
19
|
-
const extendAndCachePreview = (id,
|
|
21
|
+
const extendAndCachePreview = (id, mode, preview, mediaBlobUrlAttrs) => {
|
|
20
22
|
let source;
|
|
21
23
|
|
|
22
24
|
switch (preview.source) {
|
|
@@ -43,7 +45,7 @@ const extendAndCachePreview = (id, dimensions, preview, mediaBlobUrlAttrs) => {
|
|
|
43
45
|
|
|
44
46
|
const dataURI = mediaBlobUrlAttrs ? addFileAttrsToUrl(preview.dataURI, mediaBlobUrlAttrs) : preview.dataURI; // We store new cardPreview into cache
|
|
45
47
|
|
|
46
|
-
cardPreviewCache.set(id,
|
|
48
|
+
cardPreviewCache.set(id, mode, { ...preview,
|
|
47
49
|
source,
|
|
48
50
|
dataURI
|
|
49
51
|
});
|
|
@@ -71,18 +73,33 @@ export const getCardPreview = async ({
|
|
|
71
73
|
onLocalPreviewError,
|
|
72
74
|
isRemotePreviewReady,
|
|
73
75
|
imageUrlParams,
|
|
74
|
-
mediaBlobUrlAttrs
|
|
76
|
+
mediaBlobUrlAttrs,
|
|
77
|
+
createAnalyticsEvent,
|
|
78
|
+
featureFlags
|
|
75
79
|
}) => {
|
|
76
|
-
const
|
|
80
|
+
const mode = imageUrlParams.mode;
|
|
81
|
+
const cachedPreview = cardPreviewCache.get(id, mode);
|
|
82
|
+
const dimensionsAreBigger = isBigger(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions);
|
|
83
|
+
|
|
84
|
+
if (cachedPreview && !dimensionsAreBigger) {
|
|
85
|
+
if (getMediaFeatureFlag('memoryCacheLogging', featureFlags)) {
|
|
86
|
+
createAnalyticsEvent && fireImageFetchingOperationalEvent(createAnalyticsEvent, 'cache-hit', {
|
|
87
|
+
fileId: id,
|
|
88
|
+
prevDimensions: cachedPreview.dimensions,
|
|
89
|
+
currentDimensions: dimensions,
|
|
90
|
+
source: cachedPreview.source
|
|
91
|
+
});
|
|
92
|
+
}
|
|
77
93
|
|
|
78
|
-
if (cachedPreview) {
|
|
79
94
|
return cachedPreview;
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
try {
|
|
83
98
|
if (filePreview) {
|
|
84
99
|
const localPreview = await getCardPreviewFromFilePreview(filePreview);
|
|
85
|
-
return extendAndCachePreview(id,
|
|
100
|
+
return extendAndCachePreview(id, mode, { ...localPreview,
|
|
101
|
+
dimensions
|
|
102
|
+
}, mediaBlobUrlAttrs);
|
|
86
103
|
}
|
|
87
104
|
} catch (e) {
|
|
88
105
|
/**
|
|
@@ -119,19 +136,33 @@ export const getCardPreview = async ({
|
|
|
119
136
|
throw new MediaCardError('remote-preview-not-ready');
|
|
120
137
|
}
|
|
121
138
|
|
|
122
|
-
|
|
139
|
+
const remotePreview = await fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs);
|
|
140
|
+
|
|
141
|
+
if (getMediaFeatureFlag('memoryCacheLogging', featureFlags)) {
|
|
142
|
+
createAnalyticsEvent && fireImageFetchingOperationalEvent(createAnalyticsEvent, 'remote-success', {
|
|
143
|
+
fileId: id,
|
|
144
|
+
prevDimensions: cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions,
|
|
145
|
+
currentDimensions: dimensions,
|
|
146
|
+
dimensionsPercentageDiff: calculatePercentageDifference(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions),
|
|
147
|
+
source: remotePreview.source
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return remotePreview;
|
|
123
152
|
};
|
|
124
153
|
export const shouldResolvePreview = ({
|
|
125
154
|
status,
|
|
126
155
|
fileState,
|
|
127
156
|
dimensions,
|
|
128
|
-
|
|
157
|
+
identifier,
|
|
158
|
+
fileImageMode,
|
|
129
159
|
hasCardPreview,
|
|
130
160
|
isBannedLocalPreview,
|
|
131
161
|
featureFlags
|
|
132
162
|
}) => {
|
|
133
163
|
const statusIsPreviewable = isPreviewableStatus(status, extractFilePreviewStatus(fileState, isBannedLocalPreview, featureFlags));
|
|
134
|
-
const
|
|
164
|
+
const cardPreview = cardPreviewCache.get(identifier.id, fileImageMode);
|
|
165
|
+
const dimensionsAreBigger = isBigger(cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dimensions, dimensions);
|
|
135
166
|
return statusIsPreviewable && (!hasCardPreview || dimensionsAreBigger);
|
|
136
167
|
};
|
|
137
168
|
export const getSSRCardPreview = (ssr, mediaClient, id, params, mediaBlobUrlAttrs) => {
|
|
@@ -168,5 +199,7 @@ export const isSSRClientPreview = preview => {
|
|
|
168
199
|
export const isSSRDataPreview = preview => preview.source === 'ssr-data';
|
|
169
200
|
export const fetchAndCacheRemotePreview = async (mediaClient, id, dimensions, params, mediaBlobUrlAttrs) => {
|
|
170
201
|
const remotePreview = await getCardPreviewFromBackend(mediaClient, id, params);
|
|
171
|
-
return extendAndCachePreview(id,
|
|
202
|
+
return extendAndCachePreview(id, params.mode, { ...remotePreview,
|
|
203
|
+
dimensions
|
|
204
|
+
}, mediaBlobUrlAttrs);
|
|
172
205
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { fireMediaCardEvent, getCacheHitEventPayload, getRemoteSuccessEventPayload } from '../../utils/analytics';
|
|
2
|
+
export const fireImageFetchingOperationalEvent = (createAnalyticsEvent, action, cardPreviewAttributes) => {
|
|
3
|
+
const fireEvent = payload => fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
4
|
+
|
|
5
|
+
switch (action) {
|
|
6
|
+
case 'cache-hit':
|
|
7
|
+
fireEvent(getCacheHitEventPayload(cardPreviewAttributes));
|
|
8
|
+
break;
|
|
9
|
+
|
|
10
|
+
case 'remote-success':
|
|
11
|
+
fireEvent(getRemoteSuccessEventPayload(cardPreviewAttributes));
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export const calculatePercentageDifference = (prevDimensions, currentDimensions) => {
|
|
16
|
+
if (!prevDimensions) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const prevWidth = parseInt(`${prevDimensions === null || prevDimensions === void 0 ? void 0 : prevDimensions.width}`, 10);
|
|
21
|
+
const currWidth = parseInt(`${currentDimensions === null || currentDimensions === void 0 ? void 0 : currentDimensions.width}`, 10);
|
|
22
|
+
const prevHeight = parseInt(`${prevDimensions === null || prevDimensions === void 0 ? void 0 : prevDimensions.height}`, 10);
|
|
23
|
+
const currHeight = parseInt(`${currentDimensions === null || currentDimensions === void 0 ? void 0 : currentDimensions.height}`, 10);
|
|
24
|
+
const percentageDiffInWidth = ((currWidth - prevWidth) / prevWidth * 100).toFixed(2);
|
|
25
|
+
const percentageDiffInHeight = ((currHeight - prevHeight) / prevHeight * 100).toFixed(2);
|
|
26
|
+
return {
|
|
27
|
+
width: percentageDiffInWidth,
|
|
28
|
+
height: percentageDiffInHeight
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React, { Component
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
|
-
import { version as packageVersion, name as packageName } from '../../version.json';
|
|
5
4
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
5
|
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
7
6
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
@@ -9,7 +8,7 @@ import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECEN
|
|
|
9
8
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
10
9
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
11
10
|
import { CardView } from '../cardView';
|
|
12
|
-
import {
|
|
11
|
+
import { ViewportDetector } from '../../utils/viewportDetector';
|
|
13
12
|
import { getRequestedDimensions } from '../../utils/getDataURIDimension';
|
|
14
13
|
import { getCardPreview, getCardPreviewFromCache, removeCardPreviewFromCache, getFilePreviewFromFileState, shouldResolvePreview, getSSRCardPreview, isLocalPreview, isSSRPreview, isSSRClientPreview, isSSRDataPreview, fetchAndCacheRemotePreview } from './getCardPreview';
|
|
15
14
|
import { getFileDetails } from '../../utils/metadata';
|
|
@@ -25,6 +24,8 @@ import { isBigger } from '../../utils/dimensionComparer';
|
|
|
25
24
|
import { getMediaCardCursor } from '../../utils/getMediaCardCursor';
|
|
26
25
|
import { completeUfoExperience, startUfoExperience } from '../../utils/ufoExperiences';
|
|
27
26
|
import { generateUniqueId } from '../../utils/generateUniqueId';
|
|
27
|
+
const packageName = "@atlaskit/media-card";
|
|
28
|
+
const packageVersion = "74.1.0";
|
|
28
29
|
export class CardBase extends Component {
|
|
29
30
|
// An internalOccurrenceKey is a randomly generated value to differentiate various instances
|
|
30
31
|
// of Cards regardless of whether it shares the same file (either internal or external)
|
|
@@ -42,10 +43,6 @@ export class CardBase extends Component {
|
|
|
42
43
|
wasStatusProcessing: false
|
|
43
44
|
});
|
|
44
45
|
|
|
45
|
-
_defineProperty(this, "viewportPreAnchorRef", /*#__PURE__*/createRef());
|
|
46
|
-
|
|
47
|
-
_defineProperty(this, "viewportPostAnchorRef", /*#__PURE__*/createRef());
|
|
48
|
-
|
|
49
46
|
_defineProperty(this, "ssrReliability", {
|
|
50
47
|
server: {
|
|
51
48
|
status: 'unknown'
|
|
@@ -102,7 +99,8 @@ export class CardBase extends Component {
|
|
|
102
99
|
} = identifier;
|
|
103
100
|
const {
|
|
104
101
|
dimensions = {},
|
|
105
|
-
mediaClient
|
|
102
|
+
mediaClient,
|
|
103
|
+
createAnalyticsEvent
|
|
106
104
|
} = this.props;
|
|
107
105
|
return {
|
|
108
106
|
mediaClient,
|
|
@@ -112,7 +110,9 @@ export class CardBase extends Component {
|
|
|
112
110
|
filePreview: isBannedLocalPreview ? undefined : getFilePreviewFromFileState(fileState),
|
|
113
111
|
isRemotePreviewReady: isImageRepresentationReady(fileState),
|
|
114
112
|
imageUrlParams: this.getImageURLParams(identifier),
|
|
115
|
-
mediaBlobUrlAttrs: this.getMediaBlobUrlAttrs(identifier, fileState)
|
|
113
|
+
mediaBlobUrlAttrs: this.getMediaBlobUrlAttrs(identifier, fileState),
|
|
114
|
+
createAnalyticsEvent,
|
|
115
|
+
featureFlags: this.props.featureFlags
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -232,9 +232,10 @@ export class CardBase extends Component {
|
|
|
232
232
|
|
|
233
233
|
const {
|
|
234
234
|
identifier,
|
|
235
|
-
|
|
235
|
+
resizeMode
|
|
236
236
|
} = this.props;
|
|
237
|
-
|
|
237
|
+
const fileImageMode = imageResizeModeToFileImageMode(resizeMode);
|
|
238
|
+
isFileIdentifier(identifier) && removeCardPreviewFromCache(identifier.id, fileImageMode);
|
|
238
239
|
this.safeSetState(updateState);
|
|
239
240
|
} else {
|
|
240
241
|
this.safeSetState({
|
|
@@ -551,16 +552,8 @@ export class CardBase extends Component {
|
|
|
551
552
|
});
|
|
552
553
|
return isLazy ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
553
554
|
cardEl: cardRef,
|
|
554
|
-
preAnchorRef: this.viewportPreAnchorRef,
|
|
555
|
-
postAnchorRef: this.viewportPostAnchorRef,
|
|
556
555
|
onVisible: this.onCardInViewport
|
|
557
|
-
},
|
|
558
|
-
ref: this.viewportPreAnchorRef,
|
|
559
|
-
offsetTop: -ABS_VIEWPORT_ANCHOR_OFFSET_TOP
|
|
560
|
-
}), card, /*#__PURE__*/React.createElement(ViewportAnchor, {
|
|
561
|
-
ref: this.viewportPostAnchorRef,
|
|
562
|
-
offsetTop: ABS_VIEWPORT_ANCHOR_OFFSET_TOP
|
|
563
|
-
})) : card;
|
|
556
|
+
}, card) : card;
|
|
564
557
|
});
|
|
565
558
|
|
|
566
559
|
_defineProperty(this, "storeSSRData", () => {
|
|
@@ -631,7 +624,7 @@ export class CardBase extends Component {
|
|
|
631
624
|
|
|
632
625
|
const {
|
|
633
626
|
identifier: _identifier,
|
|
634
|
-
|
|
627
|
+
resizeMode: _resizeMode,
|
|
635
628
|
ssr: _ssr,
|
|
636
629
|
mediaClient: _mediaClient
|
|
637
630
|
} = this.props;
|
|
@@ -640,7 +633,8 @@ export class CardBase extends Component {
|
|
|
640
633
|
const {
|
|
641
634
|
id
|
|
642
635
|
} = _identifier;
|
|
643
|
-
|
|
636
|
+
const fileImageMode = imageResizeModeToFileImageMode(_resizeMode);
|
|
637
|
+
_cardPreview = getCardPreviewFromCache(id, fileImageMode);
|
|
644
638
|
|
|
645
639
|
if (!_cardPreview && _ssr) {
|
|
646
640
|
var _this$ssrData, _this$ssrData2;
|
|
@@ -703,6 +697,8 @@ export class CardBase extends Component {
|
|
|
703
697
|
}
|
|
704
698
|
|
|
705
699
|
componentDidMount() {
|
|
700
|
+
var _getDocument;
|
|
701
|
+
|
|
706
702
|
this.hasBeenMounted = true;
|
|
707
703
|
const {
|
|
708
704
|
isCardVisible,
|
|
@@ -738,14 +734,13 @@ export class CardBase extends Component {
|
|
|
738
734
|
// won't work in IE11
|
|
739
735
|
|
|
740
736
|
|
|
741
|
-
getDocument().addEventListener('copy', this.fireCopiedEvent);
|
|
737
|
+
(_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.addEventListener('copy', this.fireCopiedEvent);
|
|
742
738
|
}
|
|
743
739
|
|
|
744
740
|
componentDidUpdate(prevProps, prevState) {
|
|
745
741
|
const {
|
|
746
742
|
mediaClient: prevMediaClient,
|
|
747
|
-
identifier: prevIdentifier
|
|
748
|
-
dimensions: prevDimensions
|
|
743
|
+
identifier: prevIdentifier
|
|
749
744
|
} = prevProps;
|
|
750
745
|
const {
|
|
751
746
|
isCardVisible: prevIsCardVisible
|
|
@@ -756,7 +751,8 @@ export class CardBase extends Component {
|
|
|
756
751
|
dimensions,
|
|
757
752
|
featureFlags,
|
|
758
753
|
useInlinePlayer,
|
|
759
|
-
disableOverlay
|
|
754
|
+
disableOverlay,
|
|
755
|
+
resizeMode
|
|
760
756
|
} = this.props;
|
|
761
757
|
const {
|
|
762
758
|
isCardVisible,
|
|
@@ -770,6 +766,7 @@ export class CardBase extends Component {
|
|
|
770
766
|
const isDifferent = isDifferentIdentifier(prevIdentifier, identifier);
|
|
771
767
|
const turnedVisible = !prevIsCardVisible && isCardVisible;
|
|
772
768
|
const isNewMediaClient = prevMediaClient !== mediaClient;
|
|
769
|
+
const fileImageMode = imageResizeModeToFileImageMode(resizeMode);
|
|
773
770
|
this.updateFileStateFlag(fileState);
|
|
774
771
|
|
|
775
772
|
if (isExternalImageIdentifier(identifier) && isDifferent) {
|
|
@@ -804,7 +801,8 @@ export class CardBase extends Component {
|
|
|
804
801
|
status,
|
|
805
802
|
fileState,
|
|
806
803
|
dimensions,
|
|
807
|
-
|
|
804
|
+
identifier,
|
|
805
|
+
fileImageMode,
|
|
808
806
|
featureFlags,
|
|
809
807
|
hasCardPreview: !!cardPreview,
|
|
810
808
|
isBannedLocalPreview
|
|
@@ -837,9 +835,11 @@ export class CardBase extends Component {
|
|
|
837
835
|
}
|
|
838
836
|
|
|
839
837
|
componentWillUnmount() {
|
|
838
|
+
var _getDocument2;
|
|
839
|
+
|
|
840
840
|
this.hasBeenMounted = false;
|
|
841
841
|
this.unsubscribe();
|
|
842
|
-
getDocument().removeEventListener('copy', this.fireCopiedEvent);
|
|
842
|
+
(_getDocument2 = getDocument()) === null || _getDocument2 === void 0 ? void 0 : _getDocument2.removeEventListener('copy', this.fireCopiedEvent);
|
|
843
843
|
}
|
|
844
844
|
|
|
845
845
|
updateStateForIdentifier(identifier) {
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
7
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
8
|
+
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
9
|
+
import SpinnerIcon from '@atlaskit/spinner';
|
|
10
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
11
|
+
import { toHumanReadableMediaSize, messages } from '@atlaskit/media-ui';
|
|
12
|
+
import { isRateLimitedError, isPollingError } from '@atlaskit/media-client';
|
|
5
13
|
import { FileCardImageView } from '../files';
|
|
6
14
|
import { breakpointSize } from '../utils/breakpoint';
|
|
7
15
|
import { defaultImageCardDimensions, getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
8
16
|
import { isValidPercentageUnit } from '../utils/isValidPercentageUnit';
|
|
9
17
|
import { getCSSUnitValue } from '../utils/getCSSUnitValue';
|
|
10
18
|
import { getElementDimension } from '../utils/getElementDimension';
|
|
11
|
-
import { Wrapper } from './styled';
|
|
12
19
|
import { createAndFireMediaCardEvent } from '../utils/analytics';
|
|
13
20
|
import { attachDetailsToActions } from '../actions';
|
|
14
21
|
import { getErrorMessage } from '../utils/getErrorMessage';
|
|
15
|
-
import {
|
|
16
|
-
import { NewFileExperienceWrapper, CardImageContainer, calcBreakpointSize } from './ui/styled';
|
|
22
|
+
import { cardImageContainerStyles, calcBreakpointSize } from './ui/styles';
|
|
17
23
|
import { ImageRenderer } from './ui/imageRenderer/imageRenderer';
|
|
18
24
|
import { TitleBox } from './ui/titleBox/titleBox';
|
|
19
25
|
import { FailedTitleBox } from './ui/titleBox/failedTitleBox';
|
|
20
26
|
import { ProgressBar } from './ui/progressBar/progressBar';
|
|
21
27
|
import { PlayButton } from './ui/playButton/playButton';
|
|
22
28
|
import { TickBox } from './ui/tickBox/tickBox';
|
|
23
|
-
import { Blanket } from './ui/blanket/
|
|
29
|
+
import { Blanket } from './ui/blanket/blanket';
|
|
24
30
|
import { ActionsBar } from './ui/actionsBar/actionsBar';
|
|
25
|
-
import
|
|
26
|
-
import { IconWrapper } from './ui/iconWrapper/styled';
|
|
27
|
-
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
28
|
-
import SpinnerIcon from '@atlaskit/spinner';
|
|
31
|
+
import { IconWrapper } from './ui/iconWrapper/iconWrapper';
|
|
29
32
|
import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUnavailable, FailedToLoad } from './ui/iconMessage';
|
|
30
|
-
import { isRateLimitedError, isPollingError } from '@atlaskit/media-client';
|
|
31
|
-
import { newFileExperienceClassName } from './card/cardConstants';
|
|
32
33
|
import { isUploadError } from '../errors';
|
|
34
|
+
import { NewFileExperienceWrapper } from './ui/newFileExperience/newFileExperienceWrapper';
|
|
35
|
+
import { Wrapper } from './cardViewWrapper';
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
38
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
@@ -123,9 +126,8 @@ export class CardViewBase extends React.Component {
|
|
|
123
126
|
const isTickBoxSelectable = !disableOverlay && !!selectable && !selected; // Disable tooltip for Media Single
|
|
124
127
|
|
|
125
128
|
const shouldDisplayTooltip = !disableOverlay;
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
"data-testid": testId || 'media-card-view',
|
|
129
|
+
return jsx(NewFileExperienceWrapper, {
|
|
130
|
+
testId: testId || 'media-card-view',
|
|
129
131
|
dimensions: dimensions,
|
|
130
132
|
appearance: appearance,
|
|
131
133
|
onClick: onClick,
|
|
@@ -139,7 +141,7 @@ export class CardViewBase extends React.Component {
|
|
|
139
141
|
isPlayButtonClickable: isPlayButtonClickable,
|
|
140
142
|
isTickBoxSelectable: isTickBoxSelectable,
|
|
141
143
|
shouldDisplayTooltip: shouldDisplayTooltip
|
|
142
|
-
}, shouldDisplayTooltip ?
|
|
144
|
+
}, shouldDisplayTooltip ? jsx(Tooltip, {
|
|
143
145
|
content: name,
|
|
144
146
|
position: "bottom",
|
|
145
147
|
tag: 'div'
|
|
@@ -175,7 +177,7 @@ export class CardViewBase extends React.Component {
|
|
|
175
177
|
const actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
176
178
|
const errorMessage = getErrorMessage(status);
|
|
177
179
|
const fileSize = !size ? '' : toHumanReadableMediaSize(size);
|
|
178
|
-
return
|
|
180
|
+
return jsx(FileCardImageView, {
|
|
179
181
|
error: errorMessage,
|
|
180
182
|
dimensions: dimensions,
|
|
181
183
|
selectable: selectable,
|
|
@@ -237,7 +239,7 @@ export class CardViewBase extends React.Component {
|
|
|
237
239
|
|
|
238
240
|
case 'processing':
|
|
239
241
|
return { ...defaultConfig,
|
|
240
|
-
iconMessage: !didImageRender && !isZeroSize ?
|
|
242
|
+
iconMessage: !didImageRender && !isZeroSize ? jsx(CreatingPreview, {
|
|
241
243
|
disableAnimation: disableAnimation
|
|
242
244
|
}) : undefined
|
|
243
245
|
};
|
|
@@ -260,14 +262,14 @@ export class CardViewBase extends React.Component {
|
|
|
260
262
|
} = error || {};
|
|
261
263
|
|
|
262
264
|
if (isRateLimitedError(secondaryError) || isPollingError(secondaryError)) {
|
|
263
|
-
iconMessage =
|
|
265
|
+
iconMessage = jsx(PreviewCurrentlyUnavailable, null);
|
|
264
266
|
} else if (isUploadError(error)) {
|
|
265
|
-
iconMessage =
|
|
267
|
+
iconMessage = jsx(FailedToUpload, null);
|
|
266
268
|
customTitleMessage = messages.failed_to_upload;
|
|
267
269
|
} else if (!metadata) {
|
|
268
|
-
iconMessage =
|
|
270
|
+
iconMessage = jsx(FailedToLoad, null);
|
|
269
271
|
} else {
|
|
270
|
-
iconMessage =
|
|
272
|
+
iconMessage = jsx(PreviewUnavailable, null);
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
if (!disableOverlay) {
|
|
@@ -320,7 +322,8 @@ export class CardViewBase extends React.Component {
|
|
|
320
322
|
name
|
|
321
323
|
} = metadata || {};
|
|
322
324
|
const hasTitleBox = !!renderTitleBox || !!renderFailedTitleBox;
|
|
323
|
-
return
|
|
325
|
+
return jsx(React.Fragment, null, jsx("div", {
|
|
326
|
+
css: cardImageContainerStyles,
|
|
324
327
|
className: "media-file-card-view",
|
|
325
328
|
"data-testid": "media-file-card-view",
|
|
326
329
|
"data-test-media-name": name,
|
|
@@ -402,8 +405,8 @@ export class CardViewBase extends React.Component {
|
|
|
402
405
|
testId
|
|
403
406
|
} = this.props;
|
|
404
407
|
const wrapperDimensions = dimensions ? dimensions : getDefaultCardDimensions(appearance);
|
|
405
|
-
return
|
|
406
|
-
|
|
408
|
+
return jsx(Wrapper, {
|
|
409
|
+
testId: testId || 'media-card-view',
|
|
407
410
|
shouldUsePointerCursor: true,
|
|
408
411
|
breakpointSize: breakpointSize(this.width),
|
|
409
412
|
dimensions: wrapperDimensions,
|
|
@@ -414,10 +417,10 @@ export class CardViewBase extends React.Component {
|
|
|
414
417
|
}
|
|
415
418
|
|
|
416
419
|
renderSpinner(hasTitleBox) {
|
|
417
|
-
return
|
|
420
|
+
return jsx(IconWrapper, {
|
|
418
421
|
breakpoint: this.breakpoint,
|
|
419
422
|
hasTitleBox: hasTitleBox
|
|
420
|
-
},
|
|
423
|
+
}, jsx(SpinnerIcon, null));
|
|
421
424
|
}
|
|
422
425
|
|
|
423
426
|
shouldRenderPlayButton() {
|
|
@@ -437,16 +440,16 @@ export class CardViewBase extends React.Component {
|
|
|
437
440
|
}
|
|
438
441
|
|
|
439
442
|
renderPlayButton(hasTitleBox) {
|
|
440
|
-
return
|
|
443
|
+
return jsx(IconWrapper, {
|
|
441
444
|
breakpoint: this.breakpoint,
|
|
442
445
|
hasTitleBox: hasTitleBox
|
|
443
|
-
},
|
|
446
|
+
}, jsx(PlayButton, null));
|
|
444
447
|
} //This Blanket will provide a shadow backround for uploading status by
|
|
445
448
|
//setting isFixed.
|
|
446
449
|
|
|
447
450
|
|
|
448
451
|
renderBlanket(isFixed) {
|
|
449
|
-
return
|
|
452
|
+
return jsx(Blanket, {
|
|
450
453
|
isFixed: isFixed
|
|
451
454
|
});
|
|
452
455
|
}
|
|
@@ -461,7 +464,7 @@ export class CardViewBase extends React.Component {
|
|
|
461
464
|
name,
|
|
462
465
|
createdAt
|
|
463
466
|
} = metadata || {};
|
|
464
|
-
return !!name &&
|
|
467
|
+
return !!name && jsx(TitleBox, {
|
|
465
468
|
name: name,
|
|
466
469
|
createdAt: createdAt,
|
|
467
470
|
breakpoint: this.breakpoint,
|
|
@@ -471,7 +474,7 @@ export class CardViewBase extends React.Component {
|
|
|
471
474
|
}
|
|
472
475
|
|
|
473
476
|
renderFailedTitleBox(customMessage) {
|
|
474
|
-
return
|
|
477
|
+
return jsx(FailedTitleBox, {
|
|
475
478
|
breakpoint: this.breakpoint,
|
|
476
479
|
customMessage: customMessage
|
|
477
480
|
});
|
|
@@ -481,7 +484,7 @@ export class CardViewBase extends React.Component {
|
|
|
481
484
|
const {
|
|
482
485
|
progress
|
|
483
486
|
} = this.props;
|
|
484
|
-
return
|
|
487
|
+
return jsx(ProgressBar, {
|
|
485
488
|
progress: progress,
|
|
486
489
|
breakpoint: this.breakpoint,
|
|
487
490
|
positionBottom: positionBottom
|
|
@@ -500,7 +503,7 @@ export class CardViewBase extends React.Component {
|
|
|
500
503
|
nativeLazyLoad,
|
|
501
504
|
forceSyncDisplay
|
|
502
505
|
} = this.props;
|
|
503
|
-
return !!cardPreview &&
|
|
506
|
+
return !!cardPreview && jsx(ImageRenderer, {
|
|
504
507
|
cardPreview: cardPreview,
|
|
505
508
|
mediaType: mediaType,
|
|
506
509
|
alt: alt,
|
|
@@ -517,7 +520,7 @@ export class CardViewBase extends React.Component {
|
|
|
517
520
|
const {
|
|
518
521
|
selected
|
|
519
522
|
} = this.props;
|
|
520
|
-
return
|
|
523
|
+
return jsx(TickBox, {
|
|
521
524
|
selected: selected
|
|
522
525
|
});
|
|
523
526
|
}
|
|
@@ -531,10 +534,10 @@ export class CardViewBase extends React.Component {
|
|
|
531
534
|
mimeType,
|
|
532
535
|
name
|
|
533
536
|
} = metadata || {};
|
|
534
|
-
return
|
|
537
|
+
return jsx(IconWrapper, {
|
|
535
538
|
breakpoint: this.breakpoint,
|
|
536
539
|
hasTitleBox: hasTitleBox
|
|
537
|
-
},
|
|
540
|
+
}, jsx(MimeTypeIcon, {
|
|
538
541
|
testId: 'media-card-file-type-icon',
|
|
539
542
|
mediaType: mediaType,
|
|
540
543
|
mimeType: mimeType,
|
|
@@ -554,7 +557,7 @@ export class CardViewBase extends React.Component {
|
|
|
554
557
|
return null;
|
|
555
558
|
}
|
|
556
559
|
|
|
557
|
-
return
|
|
560
|
+
return jsx(ActionsBar, {
|
|
558
561
|
actions: actionsWithDetails
|
|
559
562
|
});
|
|
560
563
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**@jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { wrapperStyles } from './styles';
|
|
4
|
+
export const Wrapper = props => {
|
|
5
|
+
const {
|
|
6
|
+
testId,
|
|
7
|
+
shouldUsePointerCursor,
|
|
8
|
+
breakpointSize,
|
|
9
|
+
dimensions,
|
|
10
|
+
onClick,
|
|
11
|
+
onMouseEnter,
|
|
12
|
+
innerRef
|
|
13
|
+
} = props;
|
|
14
|
+
return jsx("div", {
|
|
15
|
+
id: "cardViewWrapper",
|
|
16
|
+
"data-testid": testId,
|
|
17
|
+
css: wrapperStyles({
|
|
18
|
+
shouldUsePointerCursor,
|
|
19
|
+
breakpointSize,
|
|
20
|
+
dimensions
|
|
21
|
+
}),
|
|
22
|
+
onClick: onClick,
|
|
23
|
+
onMouseEnter: onMouseEnter,
|
|
24
|
+
ref: innerRef
|
|
25
|
+
}, props.children);
|
|
26
|
+
};
|
|
@@ -4,14 +4,13 @@ import React from 'react';
|
|
|
4
4
|
import { Component } from 'react';
|
|
5
5
|
import { globalMediaEventEmitter } from '@atlaskit/media-client';
|
|
6
6
|
import { CustomMediaPlayer, InactivityDetector } from '@atlaskit/media-ui';
|
|
7
|
-
import { InlinePlayerWrapper } from './styled';
|
|
8
7
|
import { defaultImageCardDimensions } from '..';
|
|
9
8
|
import { CardLoading } from '../utils/lightCards/cardLoading';
|
|
10
9
|
import { ProgressBar } from './ui/progressBar/progressBar';
|
|
11
|
-
import { calcBreakpointSize } from './ui/
|
|
10
|
+
import { calcBreakpointSize } from './ui/styles';
|
|
12
11
|
import { isValidPercentageUnit } from '../utils/isValidPercentageUnit';
|
|
13
12
|
import { getElementDimension } from '../utils/getElementDimension';
|
|
14
|
-
|
|
13
|
+
import { InlinePlayerWrapper } from './inlinePlayerWrapper';
|
|
15
14
|
export const getPreferredVideoArtifact = fileState => {
|
|
16
15
|
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
17
16
|
const {
|
|
@@ -234,9 +233,10 @@ export class InlinePlayerBase extends Component {
|
|
|
234
233
|
}
|
|
235
234
|
|
|
236
235
|
return /*#__PURE__*/React.createElement(InlinePlayerWrapper, {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
testId: testId || 'media-card-inline-player',
|
|
237
|
+
selected: {
|
|
238
|
+
selected
|
|
239
|
+
},
|
|
240
240
|
onClick: onClick,
|
|
241
241
|
innerRef: forwardRef || undefined,
|
|
242
242
|
dimensions: dimensions
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**@jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { inlinePlayerWrapperStyles, inlinePlayerClassName } from './styles';
|
|
4
|
+
export const InlinePlayerWrapper = props => {
|
|
5
|
+
const {
|
|
6
|
+
testId,
|
|
7
|
+
selected,
|
|
8
|
+
dimensions,
|
|
9
|
+
onClick,
|
|
10
|
+
innerRef
|
|
11
|
+
} = props;
|
|
12
|
+
return jsx("div", {
|
|
13
|
+
id: "inlinePlayerWrapper",
|
|
14
|
+
"data-testid": testId,
|
|
15
|
+
className: inlinePlayerClassName,
|
|
16
|
+
css: inlinePlayerWrapperStyles({
|
|
17
|
+
selected,
|
|
18
|
+
dimensions
|
|
19
|
+
}),
|
|
20
|
+
onClick: onClick,
|
|
21
|
+
ref: innerRef
|
|
22
|
+
}, props.children);
|
|
23
|
+
};
|