@atlaskit/media-card 75.0.1 → 76.0.1
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 +22 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardState.js +1 -1
- package/dist/cjs/card/cardView.js +102 -196
- package/dist/cjs/card/getCardStatus.js +2 -41
- package/dist/cjs/card/inlinePlayerWrapper.js +3 -3
- package/dist/cjs/card/inlinePlayerWrapperStyles.js +30 -0
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/actionsBar/actionsBar.js +1 -1
- package/dist/cjs/{utils → card/ui/actionsBar}/cardActions/cardActionsDropdownMenu.js +1 -1
- package/dist/cjs/{utils → card/ui/actionsBar}/cardActions/cardActionsView.js +2 -2
- package/dist/cjs/{utils → card/ui/actionsBar}/cardActions/styles.js +9 -6
- package/dist/cjs/card/ui/actionsBar/styles.js +1 -1
- package/dist/cjs/card/ui/blanket/styles.js +1 -1
- package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +1 -1
- package/dist/cjs/card/ui/progressBar/styles.js +2 -2
- package/dist/cjs/card/ui/styles.js +16 -2
- package/dist/cjs/card/ui/tickBox/styles.js +1 -1
- package/dist/cjs/card/ui/titleBox/styles.js +3 -3
- package/dist/cjs/card/ui/wrapper/index.js +12 -0
- package/dist/cjs/card/ui/{newFileExperience → wrapper}/styles.js +7 -8
- package/dist/cjs/card/ui/{newFileExperience/newFileExperienceWrapper.js → wrapper/wrapper.js} +4 -4
- package/dist/cjs/classnames.js +1 -7
- package/dist/cjs/index.js +3 -9
- package/dist/cjs/inline/loader.js +15 -6
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -9
- package/dist/cjs/inline/mediaInlineCard.js +62 -12
- package/dist/cjs/inline/mediaInlineCardAnalytics.js +60 -0
- package/dist/cjs/utils/cardDimensions.js +1 -86
- package/dist/cjs/utils/index.js +1 -128
- package/dist/cjs/utils/lightCards/cardError.js +1 -1
- package/dist/cjs/utils/lightCards/cardLoading.js +3 -16
- package/dist/cjs/utils/lightCards/lightCardWrappers.js +2 -12
- package/dist/cjs/utils/lightCards/styles.js +4 -10
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardState.js +1 -1
- package/dist/es2019/card/cardView.js +54 -154
- package/dist/es2019/card/getCardStatus.js +1 -41
- package/dist/es2019/card/inlinePlayerWrapper.js +1 -1
- package/dist/es2019/card/inlinePlayerWrapperStyles.js +47 -0
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/actionsBar/actionsBar.js +1 -1
- package/dist/es2019/{utils → card/ui/actionsBar}/cardActions/cardActionsDropdownMenu.js +1 -1
- package/dist/es2019/{utils → card/ui/actionsBar}/cardActions/cardActionsView.js +2 -2
- package/dist/es2019/{utils → card/ui/actionsBar}/cardActions/styles.js +10 -2
- package/dist/es2019/card/ui/actionsBar/styles.js +1 -1
- package/dist/es2019/card/ui/blanket/styles.js +1 -1
- package/dist/es2019/card/ui/imageRenderer/imageRenderer.js +1 -1
- package/dist/es2019/card/ui/progressBar/styles.js +1 -1
- package/dist/es2019/card/ui/styles.js +10 -1
- package/dist/es2019/card/ui/tickBox/styles.js +1 -1
- package/dist/es2019/card/ui/titleBox/styles.js +1 -1
- package/dist/es2019/card/ui/wrapper/index.js +1 -0
- package/dist/es2019/card/ui/{newFileExperience → wrapper}/styles.js +3 -3
- package/dist/es2019/card/ui/{newFileExperience/newFileExperienceWrapper.js → wrapper/wrapper.js} +3 -3
- package/dist/es2019/classnames.js +1 -1
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/inline/loader.js +15 -6
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -9
- package/dist/es2019/inline/mediaInlineCard.js +51 -8
- package/dist/es2019/inline/mediaInlineCardAnalytics.js +48 -0
- package/dist/es2019/utils/cardDimensions.js +0 -76
- package/dist/es2019/utils/index.js +1 -5
- package/dist/es2019/utils/lightCards/cardError.js +1 -1
- package/dist/es2019/utils/lightCards/cardLoading.js +4 -17
- package/dist/es2019/utils/lightCards/lightCardWrappers.js +1 -10
- package/dist/es2019/utils/lightCards/styles.js +1 -20
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardState.js +1 -1
- package/dist/esm/card/cardView.js +104 -198
- package/dist/esm/card/getCardStatus.js +2 -41
- package/dist/esm/card/inlinePlayerWrapper.js +1 -1
- package/dist/esm/card/inlinePlayerWrapperStyles.js +22 -0
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/actionsBar/actionsBar.js +1 -1
- package/dist/esm/{utils → card/ui/actionsBar}/cardActions/cardActionsDropdownMenu.js +1 -1
- package/dist/esm/{utils → card/ui/actionsBar}/cardActions/cardActionsView.js +2 -2
- package/dist/esm/{utils → card/ui/actionsBar}/cardActions/styles.js +8 -5
- package/dist/esm/card/ui/actionsBar/styles.js +1 -1
- package/dist/esm/card/ui/blanket/styles.js +1 -1
- package/dist/esm/card/ui/imageRenderer/imageRenderer.js +1 -1
- package/dist/esm/card/ui/progressBar/styles.js +1 -1
- package/dist/esm/card/ui/styles.js +13 -1
- package/dist/esm/card/ui/tickBox/styles.js +1 -1
- package/dist/esm/card/ui/titleBox/styles.js +1 -1
- package/dist/esm/card/ui/wrapper/index.js +1 -0
- package/dist/esm/card/ui/{newFileExperience → wrapper}/styles.js +3 -3
- package/dist/esm/card/ui/{newFileExperience/newFileExperienceWrapper.js → wrapper/wrapper.js} +3 -3
- package/dist/esm/classnames.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/inline/loader.js +15 -6
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -9
- package/dist/esm/inline/mediaInlineCard.js +62 -12
- package/dist/esm/inline/mediaInlineCardAnalytics.js +50 -0
- package/dist/esm/utils/cardDimensions.js +0 -76
- package/dist/esm/utils/index.js +1 -5
- package/dist/esm/utils/lightCards/cardError.js +1 -1
- package/dist/esm/utils/lightCards/cardLoading.js +4 -17
- package/dist/esm/utils/lightCards/lightCardWrappers.js +1 -10
- package/dist/esm/utils/lightCards/styles.js +3 -7
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/card/cardView.d.ts +3 -6
- package/dist/types/card/getCardStatus.d.ts +1 -2
- package/dist/{types-ts4.5/card/styles/styles.d.ts → types/card/inlinePlayerWrapperStyles.d.ts} +1 -5
- package/dist/types/card/types.d.ts +1 -12
- package/dist/{types-ts4.5/utils → types/card/ui/actionsBar}/cardActions/cardActionsDropdownMenu.d.ts +1 -1
- package/dist/{types-ts4.5/utils → types/card/ui/actionsBar}/cardActions/cardActionsView.d.ts +1 -1
- package/dist/types/card/ui/styles.d.ts +2 -0
- package/dist/types/card/ui/wrapper/index.d.ts +1 -0
- package/dist/types/card/ui/wrapper/styles.d.ts +5 -0
- package/dist/{types-ts4.5/card/ui/newFileExperience → types/card/ui/wrapper}/types.d.ts +1 -1
- package/dist/{types-ts4.5/card/cardImageView/cardViewWrapper.d.ts → types/card/ui/wrapper/wrapper.d.ts} +1 -1
- package/dist/types/classnames.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/inline/loader.d.ts +1 -1
- package/dist/types/inline/mediaInlineCardAnalytics.d.ts +6 -0
- package/dist/types/utils/analytics.d.ts +7 -1
- package/dist/types/utils/cardDimensions.d.ts +0 -35
- package/dist/types/utils/index.d.ts +1 -9
- package/dist/types/utils/lightCards/lightCardWrappers.d.ts +0 -1
- package/dist/types/utils/lightCards/styles.d.ts +0 -2
- package/dist/types-ts4.5/card/cardView.d.ts +3 -6
- package/dist/types-ts4.5/card/getCardStatus.d.ts +1 -2
- package/dist/{types/card/styles/styles.d.ts → types-ts4.5/card/inlinePlayerWrapperStyles.d.ts} +1 -5
- package/dist/types-ts4.5/card/types.d.ts +1 -12
- package/dist/{types/utils → types-ts4.5/card/ui/actionsBar}/cardActions/cardActionsDropdownMenu.d.ts +1 -1
- package/dist/{types/utils → types-ts4.5/card/ui/actionsBar}/cardActions/cardActionsView.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/styles.d.ts +2 -0
- package/dist/types-ts4.5/card/ui/wrapper/index.d.ts +1 -0
- package/dist/types-ts4.5/card/ui/wrapper/styles.d.ts +5 -0
- package/dist/{types/card/ui/newFileExperience → types-ts4.5/card/ui/wrapper}/types.d.ts +1 -1
- package/dist/{types/card/cardImageView/cardViewWrapper.d.ts → types-ts4.5/card/ui/wrapper/wrapper.d.ts} +1 -1
- package/dist/types-ts4.5/classnames.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/inline/loader.d.ts +1 -1
- package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +6 -0
- package/dist/types-ts4.5/utils/analytics.d.ts +7 -1
- package/dist/types-ts4.5/utils/cardDimensions.d.ts +0 -35
- package/dist/types-ts4.5/utils/index.d.ts +1 -9
- package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +0 -1
- package/dist/types-ts4.5/utils/lightCards/styles.d.ts +0 -2
- package/package.json +5 -5
- package/report.api.md +2 -6
- package/dist/cjs/card/cardImageView/cardImageViewWrapper.js +0 -51
- package/dist/cjs/card/cardImageView/cardOverlay/cardOverlayComponents.js +0 -51
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +0 -183
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +0 -63
- package/dist/cjs/card/cardImageView/cardViewWrapper.js +0 -32
- package/dist/cjs/card/cardImageView/fileCardImageView.js +0 -310
- package/dist/cjs/card/cardImageView/index.js +0 -12
- package/dist/cjs/card/cardImageView/styles.js +0 -48
- package/dist/cjs/card/styles/animations.js +0 -12
- package/dist/cjs/card/styles/config.js +0 -8
- package/dist/cjs/card/styles/easing.js +0 -10
- package/dist/cjs/card/styles/getSelectedBorderStyle.js +0 -17
- package/dist/cjs/card/styles/index.js +0 -121
- package/dist/cjs/card/styles/mixins.js +0 -45
- package/dist/cjs/card/styles/styles.js +0 -41
- package/dist/cjs/card/ui/loadingRateLimited/styles.js +0 -27
- package/dist/cjs/utils/breakpoint.js +0 -42
- package/dist/cjs/utils/fileIcon/index.js +0 -54
- package/dist/cjs/utils/fileIcon/styles.js +0 -13
- package/dist/cjs/utils/getErrorMessage.js +0 -14
- package/dist/cjs/utils/progressBar/index.js +0 -45
- package/dist/cjs/utils/progressBar/styles.js +0 -14
- package/dist/cjs/utils/shouldDisplayImageThumbnail.js +0 -17
- package/dist/es2019/card/cardImageView/cardImageViewWrapper.js +0 -43
- package/dist/es2019/card/cardImageView/cardOverlay/cardOverlayComponents.js +0 -41
- package/dist/es2019/card/cardImageView/cardOverlay/index.js +0 -158
- package/dist/es2019/card/cardImageView/cardOverlay/styles.js +0 -240
- package/dist/es2019/card/cardImageView/cardViewWrapper.js +0 -26
- package/dist/es2019/card/cardImageView/fileCardImageView.js +0 -291
- package/dist/es2019/card/cardImageView/index.js +0 -1
- package/dist/es2019/card/cardImageView/styles.js +0 -131
- package/dist/es2019/card/styles/animations.js +0 -4
- package/dist/es2019/card/styles/config.js +0 -1
- package/dist/es2019/card/styles/easing.js +0 -2
- package/dist/es2019/card/styles/getSelectedBorderStyle.js +0 -24
- package/dist/es2019/card/styles/index.js +0 -18
- package/dist/es2019/card/styles/mixins.js +0 -51
- package/dist/es2019/card/styles/styles.js +0 -42
- package/dist/es2019/card/ui/loadingRateLimited/styles.js +0 -41
- package/dist/es2019/utils/breakpoint.js +0 -83
- package/dist/es2019/utils/fileIcon/index.js +0 -31
- package/dist/es2019/utils/fileIcon/styles.js +0 -11
- package/dist/es2019/utils/getErrorMessage.js +0 -4
- package/dist/es2019/utils/progressBar/index.js +0 -21
- package/dist/es2019/utils/progressBar/styles.js +0 -15
- package/dist/es2019/utils/shouldDisplayImageThumbnail.js +0 -10
- package/dist/esm/card/cardImageView/cardImageViewWrapper.js +0 -41
- package/dist/esm/card/cardImageView/cardOverlay/cardOverlayComponents.js +0 -39
- package/dist/esm/card/cardImageView/cardOverlay/index.js +0 -176
- package/dist/esm/card/cardImageView/cardOverlay/styles.js +0 -42
- package/dist/esm/card/cardImageView/cardViewWrapper.js +0 -24
- package/dist/esm/card/cardImageView/fileCardImageView.js +0 -300
- package/dist/esm/card/cardImageView/index.js +0 -1
- package/dist/esm/card/cardImageView/styles.js +0 -33
- package/dist/esm/card/styles/animations.js +0 -4
- package/dist/esm/card/styles/config.js +0 -1
- package/dist/esm/card/styles/easing.js +0 -2
- package/dist/esm/card/styles/getSelectedBorderStyle.js +0 -11
- package/dist/esm/card/styles/index.js +0 -13
- package/dist/esm/card/styles/mixins.js +0 -27
- package/dist/esm/card/styles/styles.js +0 -31
- package/dist/esm/card/ui/loadingRateLimited/styles.js +0 -15
- package/dist/esm/utils/breakpoint.js +0 -33
- package/dist/esm/utils/fileIcon/index.js +0 -47
- package/dist/esm/utils/fileIcon/styles.js +0 -5
- package/dist/esm/utils/getErrorMessage.js +0 -6
- package/dist/esm/utils/progressBar/index.js +0 -38
- package/dist/esm/utils/progressBar/styles.js +0 -6
- package/dist/esm/utils/shouldDisplayImageThumbnail.js +0 -10
- package/dist/types/card/cardImageView/cardImageViewWrapper.d.ts +0 -6
- package/dist/types/card/cardImageView/cardOverlay/cardOverlayComponents.d.ts +0 -8
- package/dist/types/card/cardImageView/cardOverlay/index.d.ts +0 -39
- package/dist/types/card/cardImageView/cardOverlay/styles.d.ts +0 -26
- package/dist/types/card/cardImageView/fileCardImageView.d.ts +0 -49
- package/dist/types/card/cardImageView/index.d.ts +0 -2
- package/dist/types/card/cardImageView/styles.d.ts +0 -24
- package/dist/types/card/styles/animations.d.ts +0 -1
- package/dist/types/card/styles/config.d.ts +0 -1
- package/dist/types/card/styles/easing.d.ts +0 -2
- package/dist/types/card/styles/getSelectedBorderStyle.d.ts +0 -3
- package/dist/types/card/styles/index.d.ts +0 -8
- package/dist/types/card/styles/mixins.d.ts +0 -21
- package/dist/types/card/ui/loadingRateLimited/styles.d.ts +0 -13
- package/dist/types/card/ui/newFileExperience/newFileExperienceWrapper.d.ts +0 -4
- package/dist/types/card/ui/newFileExperience/styles.d.ts +0 -5
- package/dist/types/utils/breakpoint.d.ts +0 -11
- package/dist/types/utils/fileIcon/index.d.ts +0 -12
- package/dist/types/utils/fileIcon/styles.d.ts +0 -1
- package/dist/types/utils/getErrorMessage.d.ts +0 -2
- package/dist/types/utils/progressBar/index.d.ts +0 -9
- package/dist/types/utils/progressBar/styles.d.ts +0 -1
- package/dist/types/utils/shouldDisplayImageThumbnail.d.ts +0 -3
- package/dist/types-ts4.5/card/cardImageView/cardImageViewWrapper.d.ts +0 -6
- package/dist/types-ts4.5/card/cardImageView/cardOverlay/cardOverlayComponents.d.ts +0 -8
- package/dist/types-ts4.5/card/cardImageView/cardOverlay/index.d.ts +0 -39
- package/dist/types-ts4.5/card/cardImageView/cardOverlay/styles.d.ts +0 -26
- package/dist/types-ts4.5/card/cardImageView/fileCardImageView.d.ts +0 -49
- package/dist/types-ts4.5/card/cardImageView/index.d.ts +0 -2
- package/dist/types-ts4.5/card/cardImageView/styles.d.ts +0 -24
- package/dist/types-ts4.5/card/styles/animations.d.ts +0 -1
- package/dist/types-ts4.5/card/styles/config.d.ts +0 -1
- package/dist/types-ts4.5/card/styles/easing.d.ts +0 -2
- package/dist/types-ts4.5/card/styles/getSelectedBorderStyle.d.ts +0 -3
- package/dist/types-ts4.5/card/styles/index.d.ts +0 -8
- package/dist/types-ts4.5/card/styles/mixins.d.ts +0 -21
- package/dist/types-ts4.5/card/ui/loadingRateLimited/styles.d.ts +0 -13
- package/dist/types-ts4.5/card/ui/newFileExperience/newFileExperienceWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/newFileExperience/styles.d.ts +0 -5
- package/dist/types-ts4.5/utils/breakpoint.d.ts +0 -11
- package/dist/types-ts4.5/utils/fileIcon/index.d.ts +0 -12
- package/dist/types-ts4.5/utils/fileIcon/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/getErrorMessage.d.ts +0 -2
- package/dist/types-ts4.5/utils/progressBar/index.d.ts +0 -9
- package/dist/types-ts4.5/utils/progressBar/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/shouldDisplayImageThumbnail.d.ts +0 -3
- /package/dist/cjs/card/{cardImageView/classnames.js → classnames.js} +0 -0
- /package/dist/cjs/{utils → card/ui/actionsBar}/cardActions/cardActionButton.js +0 -0
- /package/dist/cjs/{utils → card/ui/actionsBar}/cardActions/cardActionIconButton.js +0 -0
- /package/dist/cjs/{utils → card/ui/actionsBar}/cardActions/index.js +0 -0
- /package/dist/cjs/{utils → card/ui/imageRenderer}/resizeModeToMediaImageProps.js +0 -0
- /package/dist/cjs/card/ui/{newFileExperience → wrapper}/types.js +0 -0
- /package/dist/cjs/utils/{errorIcon → lightCards/errorIcon}/index.js +0 -0
- /package/dist/cjs/utils/{errorIcon → lightCards/errorIcon}/styles.js +0 -0
- /package/dist/es2019/card/{cardImageView/classnames.js → classnames.js} +0 -0
- /package/dist/es2019/{utils → card/ui/actionsBar}/cardActions/cardActionButton.js +0 -0
- /package/dist/es2019/{utils → card/ui/actionsBar}/cardActions/cardActionIconButton.js +0 -0
- /package/dist/es2019/{utils → card/ui/actionsBar}/cardActions/index.js +0 -0
- /package/dist/es2019/{utils → card/ui/imageRenderer}/resizeModeToMediaImageProps.js +0 -0
- /package/dist/es2019/card/ui/{newFileExperience → wrapper}/types.js +0 -0
- /package/dist/es2019/utils/{errorIcon → lightCards/errorIcon}/index.js +0 -0
- /package/dist/es2019/utils/{errorIcon → lightCards/errorIcon}/styles.js +0 -0
- /package/dist/esm/card/{cardImageView/classnames.js → classnames.js} +0 -0
- /package/dist/esm/{utils → card/ui/actionsBar}/cardActions/cardActionButton.js +0 -0
- /package/dist/esm/{utils → card/ui/actionsBar}/cardActions/cardActionIconButton.js +0 -0
- /package/dist/esm/{utils → card/ui/actionsBar}/cardActions/index.js +0 -0
- /package/dist/esm/{utils → card/ui/imageRenderer}/resizeModeToMediaImageProps.js +0 -0
- /package/dist/esm/card/ui/{newFileExperience → wrapper}/types.js +0 -0
- /package/dist/esm/utils/{errorIcon → lightCards/errorIcon}/index.js +0 -0
- /package/dist/esm/utils/{errorIcon → lightCards/errorIcon}/styles.js +0 -0
- /package/dist/types/card/{cardImageView/classnames.d.ts → classnames.d.ts} +0 -0
- /package/dist/types/{utils → card/ui/actionsBar}/cardActions/cardActionButton.d.ts +0 -0
- /package/dist/types/{utils → card/ui/actionsBar}/cardActions/cardActionIconButton.d.ts +0 -0
- /package/dist/types/{utils → card/ui/actionsBar}/cardActions/index.d.ts +0 -0
- /package/dist/types/{utils → card/ui/actionsBar}/cardActions/styles.d.ts +0 -0
- /package/dist/types/{utils → card/ui/imageRenderer}/resizeModeToMediaImageProps.d.ts +0 -0
- /package/dist/types/utils/{errorIcon → lightCards/errorIcon}/index.d.ts +0 -0
- /package/dist/types/utils/{errorIcon → lightCards/errorIcon}/styles.d.ts +0 -0
- /package/dist/types-ts4.5/card/{cardImageView/classnames.d.ts → classnames.d.ts} +0 -0
- /package/dist/types-ts4.5/{utils → card/ui/actionsBar}/cardActions/cardActionButton.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → card/ui/actionsBar}/cardActions/cardActionIconButton.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → card/ui/actionsBar}/cardActions/index.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → card/ui/actionsBar}/cardActions/styles.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → card/ui/imageRenderer}/resizeModeToMediaImageProps.d.ts +0 -0
- /package/dist/types-ts4.5/utils/{errorIcon → lightCards/errorIcon}/index.d.ts +0 -0
- /package/dist/types-ts4.5/utils/{errorIcon → lightCards/errorIcon}/styles.d.ts +0 -0
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/**@jsx jsx */
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Component } from 'react';
|
|
6
|
-
import cx from 'classnames';
|
|
7
|
-
import TickIcon from '@atlaskit/icon/glyph/check';
|
|
8
|
-
import { Ellipsify } from '@atlaskit/media-ui';
|
|
9
|
-
|
|
10
|
-
// We dont require things directly from "utils" to avoid circular dependencies
|
|
11
|
-
import { FileIcon } from '../../../utils/fileIcon';
|
|
12
|
-
import { ErrorIcon } from '../../../utils/errorIcon';
|
|
13
|
-
import CardActions from '../../../utils/cardActions';
|
|
14
|
-
import { tickBoxStyles, errorLineStyles, leftColumnStyles, topRowStyles, bottomRowStyles, rightColumnStyles, subtitleStyles } from './styles';
|
|
15
|
-
import { Metadata, AltWrapper, ErrorMessage, TitleWrapper, Overlay } from './cardOverlayComponents';
|
|
16
|
-
const resolveTitleText = (cardStatus, mediaName, error, selected) => {
|
|
17
|
-
// don't show title if error
|
|
18
|
-
// also when card is uploading + selected, title is already showing outside of the overlay
|
|
19
|
-
if (error || !mediaName || cardStatus === 'uploading' && !selected) {
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
return mediaName;
|
|
23
|
-
};
|
|
24
|
-
export class CardOverlay extends Component {
|
|
25
|
-
constructor(props) {
|
|
26
|
-
super(props);
|
|
27
|
-
_defineProperty(this, "onMenuToggle", attrs => {
|
|
28
|
-
this.setState({
|
|
29
|
-
isMenuExpanded: attrs.isOpen
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
this.state = {
|
|
33
|
-
isMenuExpanded: false
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
get wrapperClassNames() {
|
|
37
|
-
const {
|
|
38
|
-
error,
|
|
39
|
-
noHover,
|
|
40
|
-
selectable,
|
|
41
|
-
selected,
|
|
42
|
-
mediaType,
|
|
43
|
-
persistent
|
|
44
|
-
} = this.props;
|
|
45
|
-
const {
|
|
46
|
-
isMenuExpanded
|
|
47
|
-
} = this.state;
|
|
48
|
-
return error ? cx('overlay', {
|
|
49
|
-
error,
|
|
50
|
-
active: isMenuExpanded
|
|
51
|
-
}) : cx('overlay', mediaType, {
|
|
52
|
-
active: isMenuExpanded,
|
|
53
|
-
selectable,
|
|
54
|
-
selected,
|
|
55
|
-
// Yes, you right. We put "persistent" class when it is NOT persistent. 🤦
|
|
56
|
-
persistent: !persistent,
|
|
57
|
-
noHover
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
const {
|
|
62
|
-
cardStatus,
|
|
63
|
-
error,
|
|
64
|
-
noHover,
|
|
65
|
-
mediaName,
|
|
66
|
-
persistent,
|
|
67
|
-
selected,
|
|
68
|
-
actions
|
|
69
|
-
} = this.props;
|
|
70
|
-
const titleText = resolveTitleText(cardStatus, mediaName, error, selected);
|
|
71
|
-
const menuTriggerColor = !persistent ? "var(--ds-icon-inverse, white)" : undefined;
|
|
72
|
-
return jsx(Overlay, {
|
|
73
|
-
hasError: !!error,
|
|
74
|
-
noHover: noHover,
|
|
75
|
-
className: this.wrapperClassNames
|
|
76
|
-
}, jsx("div", {
|
|
77
|
-
css: topRowStyles,
|
|
78
|
-
className: 'top-row'
|
|
79
|
-
}, this.errorLine(), jsx(TitleWrapper, null, titleText ? jsx(Ellipsify, {
|
|
80
|
-
testId: "media-card-file-name",
|
|
81
|
-
text: titleText,
|
|
82
|
-
lines: 2
|
|
83
|
-
}) : null), this.tickBox()), jsx("div", {
|
|
84
|
-
css: bottomRowStyles,
|
|
85
|
-
className: 'bottom-row'
|
|
86
|
-
}, jsx("div", {
|
|
87
|
-
css: leftColumnStyles
|
|
88
|
-
}, this.bottomLeftColumn()), jsx("div", {
|
|
89
|
-
css: rightColumnStyles
|
|
90
|
-
}, actions ? jsx(CardActions, {
|
|
91
|
-
actions: actions,
|
|
92
|
-
onToggle: this.onMenuToggle,
|
|
93
|
-
triggerColor: menuTriggerColor
|
|
94
|
-
}) : null)));
|
|
95
|
-
}
|
|
96
|
-
errorLine() {
|
|
97
|
-
const {
|
|
98
|
-
error,
|
|
99
|
-
alt
|
|
100
|
-
} = this.props;
|
|
101
|
-
return error && jsx(React.Fragment, null, jsx("div", {
|
|
102
|
-
css: errorLineStyles
|
|
103
|
-
}, jsx(ErrorIcon, null), jsx(ErrorMessage, null, error)), alt && jsx("div", {
|
|
104
|
-
css: errorLineStyles
|
|
105
|
-
}, jsx(AltWrapper, null, alt)));
|
|
106
|
-
}
|
|
107
|
-
tickBox() {
|
|
108
|
-
const {
|
|
109
|
-
selected,
|
|
110
|
-
selectable
|
|
111
|
-
} = this.props;
|
|
112
|
-
const tick = jsx(TickIcon, {
|
|
113
|
-
label: "tick"
|
|
114
|
-
});
|
|
115
|
-
const className = cx('tickbox', {
|
|
116
|
-
selected
|
|
117
|
-
});
|
|
118
|
-
return selectable && jsx("div", {
|
|
119
|
-
css: tickBoxStyles,
|
|
120
|
-
className: className
|
|
121
|
-
}, tick);
|
|
122
|
-
}
|
|
123
|
-
bottomLeftColumn() {
|
|
124
|
-
const {
|
|
125
|
-
error
|
|
126
|
-
} = this.props;
|
|
127
|
-
if (!error) {
|
|
128
|
-
const {
|
|
129
|
-
mediaType,
|
|
130
|
-
subtitle,
|
|
131
|
-
icon
|
|
132
|
-
} = this.props;
|
|
133
|
-
const classNames = cx('metadata');
|
|
134
|
-
const fileIcon = mediaType || icon ? jsx(FileIcon, {
|
|
135
|
-
mediaType: mediaType,
|
|
136
|
-
iconUrl: icon
|
|
137
|
-
}) : null;
|
|
138
|
-
const subtitleEl = subtitle ? jsx("div", {
|
|
139
|
-
css: subtitleStyles,
|
|
140
|
-
className: "file-size"
|
|
141
|
-
}, subtitle) : null;
|
|
142
|
-
return jsx("div", null, jsx(Metadata, {
|
|
143
|
-
className: classNames
|
|
144
|
-
}, fileIcon, subtitleEl));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
removeBtnClick(handler) {
|
|
148
|
-
return e => {
|
|
149
|
-
e.preventDefault();
|
|
150
|
-
e.stopPropagation();
|
|
151
|
-
handler();
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
_defineProperty(CardOverlay, "defaultProps", {
|
|
156
|
-
actions: [],
|
|
157
|
-
mediaName: ''
|
|
158
|
-
});
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Everything about this file change is just wrong.
|
|
3
|
-
* Mostly because we do bad things with classes.
|
|
4
|
-
* This is all wrong and hopefully will be removed from existence with card v3,
|
|
5
|
-
* so please don’t be too sad about all this!
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { css } from '@emotion/react';
|
|
9
|
-
import { borderRadius, size, ellipsis, absolute } from '@atlaskit/media-ui';
|
|
10
|
-
import { themed } from '@atlaskit/theme/components';
|
|
11
|
-
import * as colors from '@atlaskit/theme/colors';
|
|
12
|
-
import { rgba, easeOutCubic, transition, antialiased } from '../../styles';
|
|
13
|
-
export const tickBoxStyles = css`
|
|
14
|
-
${size(14)}
|
|
15
|
-
${transition()}
|
|
16
|
-
background-color: ${`var(--ds-surface-overlay, ${rgba('#ffffff', 0.5)})`};
|
|
17
|
-
position: absolute;
|
|
18
|
-
top: 8px;
|
|
19
|
-
right: 8px;
|
|
20
|
-
border-radius: 20px;
|
|
21
|
-
color: ${"var(--ds-icon-subtle, #798599)"}; /* CLEANUP - TODO FIL-3884: Align color with new design */
|
|
22
|
-
display: flex;
|
|
23
|
-
opacity: 0;
|
|
24
|
-
|
|
25
|
-
&.selected {
|
|
26
|
-
opacity: 1;
|
|
27
|
-
color: ${"var(--ds-icon-inverse, white)"};
|
|
28
|
-
background-color: ${"var(--ds-icon-selected, #0052cc)"}; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Enforce dimensions of "tick" icon */
|
|
32
|
-
svg {
|
|
33
|
-
position: absolute;
|
|
34
|
-
width: 14px;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
const getOverlayStyles = ({
|
|
38
|
-
hasError,
|
|
39
|
-
noHover
|
|
40
|
-
}) => {
|
|
41
|
-
if (hasError || noHover) {
|
|
42
|
-
return `
|
|
43
|
-
cursor: default;
|
|
44
|
-
|
|
45
|
-
&:hover {
|
|
46
|
-
background: transparent;
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
export const overlayStyles = props => css`
|
|
52
|
-
${size()}
|
|
53
|
-
${absolute()}
|
|
54
|
-
${borderRadius} display: flex;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
background: transparent;
|
|
58
|
-
transition: 0.3s background ${easeOutCubic}, 0.3s border-color;
|
|
59
|
-
padding: 16px;
|
|
60
|
-
|
|
61
|
-
${getOverlayStyles(props)}
|
|
62
|
-
&:not(.persistent):hover, &.active {
|
|
63
|
-
.top-row {
|
|
64
|
-
.title {
|
|
65
|
-
color: ${`var(--ds-text-information, ${colors.B400})`};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.noHover:hover {
|
|
71
|
-
.top-row {
|
|
72
|
-
.title {
|
|
73
|
-
color: ${`var(--ds-text, ${colors.N800})`};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.file-type-icon {
|
|
79
|
-
display: block;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&:not(.persistent) {
|
|
83
|
-
&:not(.error, .noHover):hover {
|
|
84
|
-
background-color: ${`var(--ds-background-neutral-hovered, ${rgba(colors.N900, 0.06)})`};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&.selectable {
|
|
88
|
-
&.selected {
|
|
89
|
-
background-color: ${`var(--ds-background-selected, ${colors.B200})`};
|
|
90
|
-
|
|
91
|
-
&:hover {
|
|
92
|
-
/* CLEANUP - TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */
|
|
93
|
-
background-color: ${`var(--ds-background-selected-hovered, ${rgba(colors.N900, 0.16)})`};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.title,
|
|
97
|
-
.bottom-row,
|
|
98
|
-
.file-size {
|
|
99
|
-
color: ${`var(--ds-text, ${colors.N900})`};
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&.persistent {
|
|
106
|
-
&:not(.active) {
|
|
107
|
-
overflow: hidden;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.top-row {
|
|
111
|
-
.title {
|
|
112
|
-
transition: opacity 0.3s;
|
|
113
|
-
opacity: 0;
|
|
114
|
-
color: ${"var(--ds-text, white)"};
|
|
115
|
-
visibility: hidden;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.bottom-row {
|
|
120
|
-
opacity: 0;
|
|
121
|
-
transition: transform 0.2s, opacity 0.5s;
|
|
122
|
-
/* This is the height of the overlay footer, needs to be present now since the parent uses flex and 100% doesn't look right anymore */
|
|
123
|
-
transform: translateY(35px);
|
|
124
|
-
|
|
125
|
-
.file-type-icon {
|
|
126
|
-
display: none;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.file-size {
|
|
130
|
-
color: ${"var(--ds-text, white)"};
|
|
131
|
-
display: none;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&:hover,
|
|
136
|
-
&.active {
|
|
137
|
-
background-color: ${`var(--ds-interaction-hovered, ${rgba(colors.N900, 0.5)})`};
|
|
138
|
-
|
|
139
|
-
.title {
|
|
140
|
-
opacity: 1;
|
|
141
|
-
visibility: visible;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.file-type-icon,
|
|
145
|
-
.file-size {
|
|
146
|
-
display: block;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.bottom-row {
|
|
150
|
-
opacity: 1;
|
|
151
|
-
transform: translateY(0);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/* Selectable */
|
|
156
|
-
&.selectable {
|
|
157
|
-
&:hover {
|
|
158
|
-
.tickbox {
|
|
159
|
-
opacity: 1;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&.selected {
|
|
164
|
-
.tickbox {
|
|
165
|
-
background-color: ${`var(--ds-background-selected-bold, ${colors.B200})`} !important;
|
|
166
|
-
color: ${"var(--ds-icon-inverse, white)"};
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
&.error {
|
|
173
|
-
.top-row {
|
|
174
|
-
overflow: visible;
|
|
175
|
-
}
|
|
176
|
-
&:hover,
|
|
177
|
-
&.active {
|
|
178
|
-
.top-row {
|
|
179
|
-
.title {
|
|
180
|
-
color: ${`var(--ds-text, ${colors.N800})`};
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
`;
|
|
186
|
-
export const errorLineStyles = css`
|
|
187
|
-
height: 24px;
|
|
188
|
-
display: flex;
|
|
189
|
-
align-items: center;
|
|
190
|
-
`;
|
|
191
|
-
export const leftColumnStyles = css`
|
|
192
|
-
width: 100%;
|
|
193
|
-
position: relative;
|
|
194
|
-
box-sizing: border-box;
|
|
195
|
-
vertical-align: middle;
|
|
196
|
-
`;
|
|
197
|
-
export const topRowStyles = css``;
|
|
198
|
-
export const bottomRowStyles = css`
|
|
199
|
-
display: flex;
|
|
200
|
-
align-items: center;
|
|
201
|
-
height: 16px;
|
|
202
|
-
`;
|
|
203
|
-
export const rightColumnStyles = css``;
|
|
204
|
-
export const errorMessageStyles = css`
|
|
205
|
-
${antialiased} display: inline-block;
|
|
206
|
-
vertical-align: middle;
|
|
207
|
-
font-weight: bold;
|
|
208
|
-
color: ${`var(--ds-text-subtlest, ${colors.N70})`};
|
|
209
|
-
font-size: 12px;
|
|
210
|
-
line-height: 15px;
|
|
211
|
-
overflow: hidden;
|
|
212
|
-
max-width: 'calc(100% - 24px)';
|
|
213
|
-
text-overflow: ellipsis;
|
|
214
|
-
white-space: nowrap;
|
|
215
|
-
margin: auto 3px;
|
|
216
|
-
`;
|
|
217
|
-
export const altWrapperStyles = css`
|
|
218
|
-
${errorMessageStyles}
|
|
219
|
-
font-weight: normal;
|
|
220
|
-
`;
|
|
221
|
-
export const titleWrapperStyles = theme => css`
|
|
222
|
-
box-sizing: border-box;
|
|
223
|
-
word-wrap: break-word;
|
|
224
|
-
color: ${themed({
|
|
225
|
-
light: `var(--ds-text, ${colors.N800})`,
|
|
226
|
-
dark: `var(--ds-text, ${colors.DN900})`
|
|
227
|
-
})({
|
|
228
|
-
theme
|
|
229
|
-
})};
|
|
230
|
-
font-size: 12px;
|
|
231
|
-
line-height: 18px;
|
|
232
|
-
`;
|
|
233
|
-
export const subtitleStyles = css`
|
|
234
|
-
${ellipsis('100px')} font-size: 12px;
|
|
235
|
-
color: ${"var(--ds-text-subtlest, #5e6c84)"};
|
|
236
|
-
`;
|
|
237
|
-
export const metadataStyles = css`
|
|
238
|
-
display: flex;
|
|
239
|
-
align-items: center;
|
|
240
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { wrapperStyles } from '../styles/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
|
-
};
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/**@jsx jsx */
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import React, { Component } from 'react';
|
|
5
|
-
import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
|
|
6
|
-
import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
|
|
7
|
-
import { CardOverlay } from './cardOverlay';
|
|
8
|
-
import { bodyStyles, cardActionsWrapperStyles, overlayStyles, progressWrapperStyles, titleStyles, playIconBackgroundStyles } from './styles';
|
|
9
|
-
import { CardLoading } from '../../utils/lightCards/cardLoading';
|
|
10
|
-
import { shouldDisplayImageThumbnail } from '../../utils/shouldDisplayImageThumbnail';
|
|
11
|
-
import { ProgressBar } from '../../utils/progressBar';
|
|
12
|
-
import CardActions from '../../utils/cardActions';
|
|
13
|
-
import { CardImageViewWrapper, PlayIconWrapper, ProgressBarWrapper } from './cardImageViewWrapper';
|
|
14
|
-
export class FileCardImageView extends Component {
|
|
15
|
-
constructor(...args) {
|
|
16
|
-
super(...args);
|
|
17
|
-
_defineProperty(this, "wasThumbnailDisplayed", false);
|
|
18
|
-
_defineProperty(this, "renderCardContents", () => {
|
|
19
|
-
const {
|
|
20
|
-
status,
|
|
21
|
-
mediaType,
|
|
22
|
-
fileSize
|
|
23
|
-
} = this.props;
|
|
24
|
-
if (status === 'error') {
|
|
25
|
-
return this.renderErrorContents();
|
|
26
|
-
} else if (status === 'failed-processing') {
|
|
27
|
-
return this.renderFailedContents();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// If a video has no errors/failed processing, we want to be able to play it
|
|
31
|
-
// immediately, even if there's no image preview
|
|
32
|
-
const isZeroSize = fileSize === '' && ['processing', 'loading-preview'].includes(status);
|
|
33
|
-
if (mediaType !== 'video' && !this.isFileCardImageReadyForDisplay && !isZeroSize) {
|
|
34
|
-
return this.renderLoadingContents();
|
|
35
|
-
}
|
|
36
|
-
return this.renderSuccessCardContents();
|
|
37
|
-
});
|
|
38
|
-
_defineProperty(this, "renderLoadingContents", () => {
|
|
39
|
-
return jsx("div", {
|
|
40
|
-
className: "wrapper"
|
|
41
|
-
}, jsx("div", {
|
|
42
|
-
className: "img-wrapper"
|
|
43
|
-
}, jsx(CardLoading, null)));
|
|
44
|
-
});
|
|
45
|
-
_defineProperty(this, "renderErrorContents", () => {
|
|
46
|
-
const {
|
|
47
|
-
status,
|
|
48
|
-
error,
|
|
49
|
-
alt,
|
|
50
|
-
mediaName,
|
|
51
|
-
mediaType,
|
|
52
|
-
actions,
|
|
53
|
-
fileSize
|
|
54
|
-
} = this.props;
|
|
55
|
-
return jsx(React.Fragment, null, jsx("div", {
|
|
56
|
-
className: "wrapper"
|
|
57
|
-
}), jsx(CardOverlay, {
|
|
58
|
-
cardStatus: status,
|
|
59
|
-
error: error,
|
|
60
|
-
persistent: true,
|
|
61
|
-
mediaName: mediaName,
|
|
62
|
-
mediaType: mediaType,
|
|
63
|
-
alt: alt,
|
|
64
|
-
subtitle: fileSize,
|
|
65
|
-
actions: actions
|
|
66
|
-
}));
|
|
67
|
-
});
|
|
68
|
-
_defineProperty(this, "renderFailedContents", () => {
|
|
69
|
-
const {
|
|
70
|
-
status,
|
|
71
|
-
mediaName,
|
|
72
|
-
mediaType,
|
|
73
|
-
actions,
|
|
74
|
-
fileSize
|
|
75
|
-
} = this.props;
|
|
76
|
-
return jsx(React.Fragment, null, jsx("div", {
|
|
77
|
-
className: "wrapper"
|
|
78
|
-
}), jsx(CardOverlay, {
|
|
79
|
-
cardStatus: status,
|
|
80
|
-
noHover: true,
|
|
81
|
-
persistent: true,
|
|
82
|
-
mediaName: mediaName,
|
|
83
|
-
mediaType: mediaType,
|
|
84
|
-
subtitle: fileSize,
|
|
85
|
-
actions: actions
|
|
86
|
-
}));
|
|
87
|
-
});
|
|
88
|
-
_defineProperty(this, "renderUploadingCardOverlay", () => {
|
|
89
|
-
const {
|
|
90
|
-
status,
|
|
91
|
-
mediaName,
|
|
92
|
-
mediaType,
|
|
93
|
-
dataURI,
|
|
94
|
-
selectable,
|
|
95
|
-
selected
|
|
96
|
-
} = this.props;
|
|
97
|
-
const isPersistent = mediaType === 'doc' || !dataURI;
|
|
98
|
-
return jsx(CardOverlay, {
|
|
99
|
-
cardStatus: status,
|
|
100
|
-
persistent: isPersistent,
|
|
101
|
-
mediaName: mediaName,
|
|
102
|
-
selectable: selectable,
|
|
103
|
-
selected: selected
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
_defineProperty(this, "renderPlayButton", () => {
|
|
107
|
-
const {
|
|
108
|
-
status,
|
|
109
|
-
mediaItemType,
|
|
110
|
-
mediaType,
|
|
111
|
-
mimeType,
|
|
112
|
-
selectable,
|
|
113
|
-
dataURI
|
|
114
|
-
} = this.props;
|
|
115
|
-
if (mediaType !== 'video') {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
if (selectable && !shouldDisplayImageThumbnail(status, mediaItemType, dataURI, mediaType, mimeType)) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
return jsx(PlayIconWrapper, null, jsx("div", {
|
|
122
|
-
css: playIconBackgroundStyles
|
|
123
|
-
}, jsx(VidPlayIcon, {
|
|
124
|
-
testId: "media-card-play-button",
|
|
125
|
-
label: "play",
|
|
126
|
-
size: "large"
|
|
127
|
-
})));
|
|
128
|
-
});
|
|
129
|
-
_defineProperty(this, "onImageLoad", () => {
|
|
130
|
-
const {
|
|
131
|
-
onImageLoad,
|
|
132
|
-
cardPreview
|
|
133
|
-
} = this.props;
|
|
134
|
-
onImageLoad && onImageLoad(cardPreview);
|
|
135
|
-
});
|
|
136
|
-
_defineProperty(this, "onImageError", () => {
|
|
137
|
-
const {
|
|
138
|
-
onImageError,
|
|
139
|
-
cardPreview
|
|
140
|
-
} = this.props;
|
|
141
|
-
onImageError && onImageError(cardPreview);
|
|
142
|
-
});
|
|
143
|
-
_defineProperty(this, "renderMediaImage", () => {
|
|
144
|
-
const {
|
|
145
|
-
status,
|
|
146
|
-
mediaItemType,
|
|
147
|
-
dataURI,
|
|
148
|
-
mediaType,
|
|
149
|
-
mimeType,
|
|
150
|
-
previewOrientation,
|
|
151
|
-
onDisplayImage,
|
|
152
|
-
alt
|
|
153
|
-
} = this.props;
|
|
154
|
-
if (!shouldDisplayImageThumbnail(status, mediaItemType, dataURI, mediaType, mimeType)) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
if (!this.wasThumbnailDisplayed && onDisplayImage && mediaType === 'image') {
|
|
158
|
-
onDisplayImage();
|
|
159
|
-
this.wasThumbnailDisplayed = true;
|
|
160
|
-
}
|
|
161
|
-
return jsx(MediaImage, {
|
|
162
|
-
dataURI: dataURI,
|
|
163
|
-
alt: alt,
|
|
164
|
-
crop: this.isCropped,
|
|
165
|
-
stretch: this.isStretched,
|
|
166
|
-
previewOrientation: previewOrientation,
|
|
167
|
-
onImageLoad: this.onImageLoad,
|
|
168
|
-
onImageError: this.onImageError
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
_defineProperty(this, "renderProgressBar", () => {
|
|
172
|
-
const {
|
|
173
|
-
mediaName,
|
|
174
|
-
progress,
|
|
175
|
-
actions,
|
|
176
|
-
status
|
|
177
|
-
} = this.props;
|
|
178
|
-
if (status !== 'uploading') {
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
return jsx(ProgressBarWrapper, null, jsx("div", {
|
|
182
|
-
css: overlayStyles
|
|
183
|
-
}, jsx("div", {
|
|
184
|
-
css: titleStyles
|
|
185
|
-
}, jsx(Ellipsify, {
|
|
186
|
-
testId: "media-card-file-name",
|
|
187
|
-
text: mediaName || '',
|
|
188
|
-
lines: 2
|
|
189
|
-
})), jsx("div", {
|
|
190
|
-
css: bodyStyles
|
|
191
|
-
}, jsx("div", {
|
|
192
|
-
css: progressWrapperStyles
|
|
193
|
-
}, jsx(ProgressBar, {
|
|
194
|
-
progress: progress
|
|
195
|
-
})), jsx("div", {
|
|
196
|
-
css: cardActionsWrapperStyles
|
|
197
|
-
}, actions ? jsx(CardActions, {
|
|
198
|
-
actions: actions,
|
|
199
|
-
triggerColor: "var(--ds-icon-inverse, white)"
|
|
200
|
-
}) : null))));
|
|
201
|
-
});
|
|
202
|
-
_defineProperty(this, "renderSuccessCardContents", () => {
|
|
203
|
-
const {
|
|
204
|
-
disableOverlay,
|
|
205
|
-
selectable,
|
|
206
|
-
status
|
|
207
|
-
} = this.props;
|
|
208
|
-
let overlay = null;
|
|
209
|
-
if (!disableOverlay) {
|
|
210
|
-
if (status === 'uploading') {
|
|
211
|
-
if (selectable) {
|
|
212
|
-
overlay = this.renderUploadingCardOverlay();
|
|
213
|
-
}
|
|
214
|
-
} else {
|
|
215
|
-
overlay = this.renderSuccessCardOverlay();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return jsx("div", {
|
|
219
|
-
className: "wrapper"
|
|
220
|
-
}, jsx("div", {
|
|
221
|
-
className: "img-wrapper"
|
|
222
|
-
}, this.renderMediaImage(), this.renderProgressBar(), this.renderPlayButton()), overlay);
|
|
223
|
-
});
|
|
224
|
-
_defineProperty(this, "renderSuccessCardOverlay", () => {
|
|
225
|
-
const {
|
|
226
|
-
status,
|
|
227
|
-
mediaName,
|
|
228
|
-
mediaType,
|
|
229
|
-
fileSize,
|
|
230
|
-
dataURI,
|
|
231
|
-
selectable,
|
|
232
|
-
selected,
|
|
233
|
-
actions
|
|
234
|
-
} = this.props;
|
|
235
|
-
const isPersistent = mediaType === 'doc' || !dataURI;
|
|
236
|
-
return jsx(CardOverlay, {
|
|
237
|
-
cardStatus: status,
|
|
238
|
-
persistent: isPersistent,
|
|
239
|
-
mediaName: mediaName,
|
|
240
|
-
mediaType: mediaType,
|
|
241
|
-
selectable: selectable,
|
|
242
|
-
selected: selected,
|
|
243
|
-
subtitle: fileSize,
|
|
244
|
-
actions: actions
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
render() {
|
|
249
|
-
const {
|
|
250
|
-
disableOverlay,
|
|
251
|
-
selectable,
|
|
252
|
-
selected,
|
|
253
|
-
mediaType,
|
|
254
|
-
progress,
|
|
255
|
-
status,
|
|
256
|
-
mediaName
|
|
257
|
-
} = this.props;
|
|
258
|
-
return jsx(CardImageViewWrapper, {
|
|
259
|
-
mediaName: mediaName,
|
|
260
|
-
status: status,
|
|
261
|
-
progress: progress,
|
|
262
|
-
disableOverlay: disableOverlay,
|
|
263
|
-
selectable: selectable,
|
|
264
|
-
selected: selected,
|
|
265
|
-
mediaType: mediaType
|
|
266
|
-
}, this.renderCardContents());
|
|
267
|
-
}
|
|
268
|
-
get isFileCardImageReadyForDisplay() {
|
|
269
|
-
const {
|
|
270
|
-
dataURI,
|
|
271
|
-
status
|
|
272
|
-
} = this.props;
|
|
273
|
-
return !!dataURI || !['loading', 'processing', 'loading-preview'].includes(status);
|
|
274
|
-
}
|
|
275
|
-
get isCropped() {
|
|
276
|
-
const {
|
|
277
|
-
resizeMode
|
|
278
|
-
} = this.props;
|
|
279
|
-
return resizeMode === 'crop';
|
|
280
|
-
}
|
|
281
|
-
get isStretched() {
|
|
282
|
-
const {
|
|
283
|
-
resizeMode
|
|
284
|
-
} = this.props;
|
|
285
|
-
return resizeMode === 'stretchy-fit';
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
_defineProperty(FileCardImageView, "defaultProps", {
|
|
289
|
-
resizeMode: 'crop',
|
|
290
|
-
disableOverlay: false
|
|
291
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FileCardImageView } from './fileCardImageView';
|