@atlaskit/media-card 75.0.1 → 76.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -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 +61 -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 +50 -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 +61 -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 +4 -4
- 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
|
@@ -13,21 +13,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
import { jsx } from '@emotion/react';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
17
16
|
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
18
17
|
import SpinnerIcon from '@atlaskit/spinner';
|
|
19
18
|
import Tooltip from '@atlaskit/tooltip';
|
|
20
|
-
import {
|
|
19
|
+
import { messages } from '@atlaskit/media-ui';
|
|
21
20
|
import { isRateLimitedError, isPollingError } from '@atlaskit/media-client';
|
|
22
|
-
import {
|
|
23
|
-
import { breakpointSize } from '../utils/breakpoint';
|
|
24
|
-
import { defaultImageCardDimensions, getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
21
|
+
import { defaultImageCardDimensions } from '../utils/cardDimensions';
|
|
25
22
|
import { isValidPercentageUnit } from '../utils/isValidPercentageUnit';
|
|
26
|
-
import { getCSSUnitValue } from '../utils/getCSSUnitValue';
|
|
27
23
|
import { getElementDimension } from '../utils/getElementDimension';
|
|
28
24
|
import { createAndFireMediaCardEvent } from '../utils/analytics';
|
|
29
25
|
import { attachDetailsToActions } from './actions';
|
|
30
|
-
import { getErrorMessage } from '../utils/getErrorMessage';
|
|
31
26
|
import { cardImageContainerStyles, calcBreakpointSize } from './ui/styles';
|
|
32
27
|
import { ImageRenderer } from './ui/imageRenderer/imageRenderer';
|
|
33
28
|
import { TitleBox } from './ui/titleBox/titleBox';
|
|
@@ -40,8 +35,8 @@ import { ActionsBar } from './ui/actionsBar/actionsBar';
|
|
|
40
35
|
import { IconWrapper } from './ui/iconWrapper/iconWrapper';
|
|
41
36
|
import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUnavailable, FailedToLoad } from './ui/iconMessage';
|
|
42
37
|
import { isUploadError } from '../errors';
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
38
|
+
import { Wrapper } from './ui/wrapper';
|
|
39
|
+
import { fileCardImageViewSelector } from './classnames';
|
|
45
40
|
/**
|
|
46
41
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
47
42
|
* `createAnalyticsEvent` prop to satisfy it's Analytics Events needs.
|
|
@@ -102,110 +97,18 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
102
97
|
});
|
|
103
98
|
}
|
|
104
99
|
});
|
|
105
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
100
|
+
_defineProperty(_assertThisInitialized(_this), "getRenderConfigByStatus", function () {
|
|
106
101
|
var _this$props2 = _this.props,
|
|
107
|
-
|
|
108
|
-
appearance = _this$props2.appearance,
|
|
109
|
-
onClick = _this$props2.onClick,
|
|
110
|
-
onMouseEnter = _this$props2.onMouseEnter,
|
|
111
|
-
testId = _this$props2.testId,
|
|
112
|
-
metadata = _this$props2.metadata,
|
|
102
|
+
cardPreview = _this$props2.cardPreview,
|
|
113
103
|
status = _this$props2.status,
|
|
114
|
-
|
|
115
|
-
selectable = _this$props2.selectable,
|
|
104
|
+
metadata = _this$props2.metadata,
|
|
116
105
|
disableOverlay = _this$props2.disableOverlay,
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
error = _this$props2.error,
|
|
107
|
+
selectable = _this$props2.selectable,
|
|
108
|
+
disableAnimation = _this$props2.disableAnimation;
|
|
119
109
|
var _ref = metadata || {},
|
|
120
|
-
name = _ref.name
|
|
121
|
-
|
|
122
|
-
var isPlayButtonClickable = !!(_this.shouldRenderPlayButton() && disableOverlay);
|
|
123
|
-
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
124
|
-
// Disable tooltip for Media Single
|
|
125
|
-
var shouldDisplayTooltip = !disableOverlay;
|
|
126
|
-
return jsx(NewFileExperienceWrapper, {
|
|
127
|
-
testId: testId || 'media-card-view',
|
|
128
|
-
dimensions: dimensions,
|
|
129
|
-
appearance: appearance,
|
|
130
|
-
onClick: onClick,
|
|
131
|
-
onMouseEnter: onMouseEnter,
|
|
132
|
-
innerRef: _this.divRef,
|
|
133
|
-
breakpoint: _this.breakpoint,
|
|
134
|
-
mediaCardCursor: mediaCardCursor,
|
|
135
|
-
disableOverlay: !!disableOverlay,
|
|
136
|
-
selected: !!selected,
|
|
137
|
-
displayBackground: shouldDisplayBackground,
|
|
138
|
-
isPlayButtonClickable: isPlayButtonClickable,
|
|
139
|
-
isTickBoxSelectable: isTickBoxSelectable,
|
|
140
|
-
shouldDisplayTooltip: shouldDisplayTooltip
|
|
141
|
-
}, shouldDisplayTooltip ? jsx(Tooltip, {
|
|
142
|
-
content: name,
|
|
143
|
-
position: "bottom",
|
|
144
|
-
tag: 'div'
|
|
145
|
-
}, _this.renderNewExperienceCard()) : _this.renderNewExperienceCard());
|
|
146
|
-
});
|
|
147
|
-
_defineProperty(_assertThisInitialized(_this), "renderFile", function () {
|
|
148
|
-
var _this$props3 = _this.props,
|
|
149
|
-
cardPreview = _this$props3.cardPreview,
|
|
150
|
-
status = _this$props3.status,
|
|
151
|
-
mediaItemType = _this$props3.mediaItemType,
|
|
152
|
-
metadata = _this$props3.metadata,
|
|
153
|
-
progress = _this$props3.progress,
|
|
154
|
-
resizeMode = _this$props3.resizeMode,
|
|
155
|
-
dimensions = _this$props3.dimensions,
|
|
156
|
-
selectable = _this$props3.selectable,
|
|
157
|
-
selected = _this$props3.selected,
|
|
158
|
-
disableOverlay = _this$props3.disableOverlay,
|
|
159
|
-
alt = _this$props3.alt,
|
|
160
|
-
onDisplayImage = _this$props3.onDisplayImage,
|
|
161
|
-
actions = _this$props3.actions;
|
|
162
|
-
var _ref2 = cardPreview || {},
|
|
163
|
-
dataURI = _ref2.dataURI,
|
|
164
|
-
orientation = _ref2.orientation;
|
|
165
|
-
var _ref3 = metadata || {},
|
|
166
|
-
name = _ref3.name,
|
|
167
|
-
mediaType = _ref3.mediaType,
|
|
168
|
-
mimeType = _ref3.mimeType,
|
|
169
|
-
size = _ref3.size;
|
|
170
|
-
var actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
171
|
-
var errorMessage = getErrorMessage(status);
|
|
172
|
-
var fileSize = !size ? '' : toHumanReadableMediaSize(size);
|
|
173
|
-
return jsx(FileCardImageView, {
|
|
174
|
-
error: errorMessage,
|
|
175
|
-
dimensions: dimensions,
|
|
176
|
-
selectable: selectable,
|
|
177
|
-
selected: selected,
|
|
178
|
-
dataURI: dataURI,
|
|
179
|
-
mediaName: name,
|
|
180
|
-
mediaType: mediaType,
|
|
181
|
-
mimeType: mimeType,
|
|
182
|
-
fileSize: fileSize,
|
|
183
|
-
status: status,
|
|
184
|
-
mediaItemType: mediaItemType,
|
|
185
|
-
progress: progress,
|
|
186
|
-
resizeMode: resizeMode,
|
|
187
|
-
onDisplayImage: onDisplayImage,
|
|
188
|
-
actions: actionsWithDetails,
|
|
189
|
-
disableOverlay: disableOverlay,
|
|
190
|
-
previewOrientation: orientation,
|
|
191
|
-
alt: alt,
|
|
192
|
-
onImageLoad: _this.onImageLoad,
|
|
193
|
-
onImageError: _this.onImageError,
|
|
194
|
-
cardPreview: cardPreview
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
_defineProperty(_assertThisInitialized(_this), "getRenderConfigByStatus", function () {
|
|
198
|
-
var _this$props4 = _this.props,
|
|
199
|
-
cardPreview = _this$props4.cardPreview,
|
|
200
|
-
status = _this$props4.status,
|
|
201
|
-
metadata = _this$props4.metadata,
|
|
202
|
-
disableOverlay = _this$props4.disableOverlay,
|
|
203
|
-
error = _this$props4.error,
|
|
204
|
-
selectable = _this$props4.selectable,
|
|
205
|
-
disableAnimation = _this$props4.disableAnimation;
|
|
206
|
-
var _ref4 = metadata || {},
|
|
207
|
-
name = _ref4.name,
|
|
208
|
-
mediaType = _ref4.mediaType;
|
|
110
|
+
name = _ref.name,
|
|
111
|
+
mediaType = _ref.mediaType;
|
|
209
112
|
var didImageRender = _this.state.didImageRender;
|
|
210
113
|
var isZeroSize = !!(metadata && metadata.size === 0);
|
|
211
114
|
var defaultConfig = {
|
|
@@ -241,8 +144,8 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
241
144
|
});
|
|
242
145
|
var iconMessage;
|
|
243
146
|
var customTitleMessage;
|
|
244
|
-
var
|
|
245
|
-
secondaryError =
|
|
147
|
+
var _ref2 = error || {},
|
|
148
|
+
secondaryError = _ref2.secondaryError;
|
|
246
149
|
if (isRateLimitedError(secondaryError) || isPollingError(secondaryError)) {
|
|
247
150
|
iconMessage = jsx(PreviewCurrentlyUnavailable, null);
|
|
248
151
|
} else if (isUploadError(error)) {
|
|
@@ -275,7 +178,7 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
275
178
|
});
|
|
276
179
|
}
|
|
277
180
|
});
|
|
278
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
181
|
+
_defineProperty(_assertThisInitialized(_this), "renderContents", function () {
|
|
279
182
|
var _this$getRenderConfig = _this.getRenderConfigByStatus(),
|
|
280
183
|
renderTypeIcon = _this$getRenderConfig.renderTypeIcon,
|
|
281
184
|
iconMessage = _this$getRenderConfig.iconMessage,
|
|
@@ -289,18 +192,18 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
289
192
|
renderTickBox = _this$getRenderConfig.renderTickBox,
|
|
290
193
|
isFixedBlanket = _this$getRenderConfig.isFixedBlanket,
|
|
291
194
|
customTitleMessage = _this$getRenderConfig.customTitleMessage;
|
|
292
|
-
var _this$
|
|
293
|
-
progress = _this$
|
|
294
|
-
selected = _this$
|
|
295
|
-
status = _this$
|
|
296
|
-
metadata = _this$
|
|
297
|
-
var
|
|
298
|
-
name =
|
|
195
|
+
var _this$props3 = _this.props,
|
|
196
|
+
progress = _this$props3.progress,
|
|
197
|
+
selected = _this$props3.selected,
|
|
198
|
+
status = _this$props3.status,
|
|
199
|
+
metadata = _this$props3.metadata;
|
|
200
|
+
var _ref3 = metadata || {},
|
|
201
|
+
name = _ref3.name;
|
|
299
202
|
var hasTitleBox = !!renderTitleBox || !!renderFailedTitleBox;
|
|
300
203
|
return jsx(React.Fragment, null, jsx("div", {
|
|
301
204
|
css: cardImageContainerStyles,
|
|
302
|
-
className:
|
|
303
|
-
"data-testid":
|
|
205
|
+
className: fileCardImageViewSelector,
|
|
206
|
+
"data-testid": fileCardImageViewSelector,
|
|
304
207
|
"data-test-media-name": name,
|
|
305
208
|
"data-test-status": status,
|
|
306
209
|
"data-test-progress": progress,
|
|
@@ -318,8 +221,8 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
318
221
|
}
|
|
319
222
|
}, {
|
|
320
223
|
key: "componentDidUpdate",
|
|
321
|
-
value: function componentDidUpdate(
|
|
322
|
-
var prevCardPreview =
|
|
224
|
+
value: function componentDidUpdate(_ref4) {
|
|
225
|
+
var prevCardPreview = _ref4.cardPreview;
|
|
323
226
|
var cardPreview = this.props.cardPreview;
|
|
324
227
|
// We should only switch didImageRender to false
|
|
325
228
|
// when cardPreview goes undefined, not when it is updated.
|
|
@@ -329,71 +232,30 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
329
232
|
didImageRender: false
|
|
330
233
|
});
|
|
331
234
|
}
|
|
332
|
-
}, {
|
|
333
|
-
key: "width",
|
|
334
|
-
get:
|
|
335
|
-
// This width is only used to calculate breakpoints, dimensions are passed down as
|
|
336
|
-
// integrator pass it to the root component
|
|
337
|
-
function get() {
|
|
338
|
-
var elementWidth = this.state.elementWidth;
|
|
339
|
-
if (elementWidth) {
|
|
340
|
-
return elementWidth;
|
|
341
|
-
}
|
|
342
|
-
var _ref8 = this.props.dimensions || {
|
|
343
|
-
width: undefined
|
|
344
|
-
},
|
|
345
|
-
width = _ref8.width;
|
|
346
|
-
if (!width) {
|
|
347
|
-
return defaultImageCardDimensions.width;
|
|
348
|
-
}
|
|
349
|
-
return getCSSUnitValue(width);
|
|
350
|
-
}
|
|
351
235
|
}, {
|
|
352
236
|
key: "breakpoint",
|
|
353
237
|
get: function get() {
|
|
354
238
|
var width = this.state.elementWidth || (this.props.dimensions ? this.props.dimensions.width : '') || defaultImageCardDimensions.width;
|
|
355
239
|
return calcBreakpointSize(parseInt("".concat(width), 10));
|
|
356
240
|
}
|
|
357
|
-
}, {
|
|
358
|
-
key: "render",
|
|
359
|
-
value: function render() {
|
|
360
|
-
var featureFlags = this.props.featureFlags;
|
|
361
|
-
if (getMediaFeatureFlag('newCardExperience', featureFlags)) {
|
|
362
|
-
return this.renderFileNewExperience();
|
|
363
|
-
}
|
|
364
|
-
var _this$props6 = this.props,
|
|
365
|
-
dimensions = _this$props6.dimensions,
|
|
366
|
-
appearance = _this$props6.appearance,
|
|
367
|
-
onClick = _this$props6.onClick,
|
|
368
|
-
onMouseEnter = _this$props6.onMouseEnter,
|
|
369
|
-
testId = _this$props6.testId;
|
|
370
|
-
var wrapperDimensions = dimensions ? dimensions : getDefaultCardDimensions(appearance);
|
|
371
|
-
return jsx(Wrapper, {
|
|
372
|
-
testId: testId || 'media-card-view',
|
|
373
|
-
shouldUsePointerCursor: true,
|
|
374
|
-
breakpointSize: breakpointSize(this.width),
|
|
375
|
-
dimensions: wrapperDimensions,
|
|
376
|
-
onClick: onClick,
|
|
377
|
-
onMouseEnter: onMouseEnter,
|
|
378
|
-
innerRef: this.divRef
|
|
379
|
-
}, this.renderFile());
|
|
380
|
-
}
|
|
381
241
|
}, {
|
|
382
242
|
key: "renderSpinner",
|
|
383
243
|
value: function renderSpinner(hasTitleBox) {
|
|
384
244
|
return jsx(IconWrapper, {
|
|
385
245
|
breakpoint: this.breakpoint,
|
|
386
246
|
hasTitleBox: hasTitleBox
|
|
387
|
-
}, jsx(SpinnerIcon,
|
|
247
|
+
}, jsx(SpinnerIcon, {
|
|
248
|
+
testId: 'media-card-loading'
|
|
249
|
+
}));
|
|
388
250
|
}
|
|
389
251
|
}, {
|
|
390
252
|
key: "shouldRenderPlayButton",
|
|
391
253
|
value: function shouldRenderPlayButton() {
|
|
392
|
-
var _this$
|
|
393
|
-
metadata = _this$
|
|
394
|
-
cardPreview = _this$
|
|
395
|
-
var
|
|
396
|
-
mediaType =
|
|
254
|
+
var _this$props4 = this.props,
|
|
255
|
+
metadata = _this$props4.metadata,
|
|
256
|
+
cardPreview = _this$props4.cardPreview;
|
|
257
|
+
var _ref5 = metadata || {},
|
|
258
|
+
mediaType = _ref5.mediaType;
|
|
397
259
|
if (mediaType !== 'video' || !cardPreview) {
|
|
398
260
|
return false;
|
|
399
261
|
}
|
|
@@ -420,13 +282,13 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
420
282
|
}, {
|
|
421
283
|
key: "renderTitleBox",
|
|
422
284
|
value: function renderTitleBox() {
|
|
423
|
-
var _this$
|
|
424
|
-
metadata = _this$
|
|
425
|
-
titleBoxBgColor = _this$
|
|
426
|
-
titleBoxIcon = _this$
|
|
427
|
-
var
|
|
428
|
-
name =
|
|
429
|
-
createdAt =
|
|
285
|
+
var _this$props5 = this.props,
|
|
286
|
+
metadata = _this$props5.metadata,
|
|
287
|
+
titleBoxBgColor = _this$props5.titleBoxBgColor,
|
|
288
|
+
titleBoxIcon = _this$props5.titleBoxIcon;
|
|
289
|
+
var _ref6 = metadata || {},
|
|
290
|
+
name = _ref6.name,
|
|
291
|
+
createdAt = _ref6.createdAt;
|
|
430
292
|
return !!name && jsx(TitleBox, {
|
|
431
293
|
name: name,
|
|
432
294
|
createdAt: createdAt,
|
|
@@ -456,17 +318,17 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
456
318
|
}, {
|
|
457
319
|
key: "renderImageRenderer",
|
|
458
320
|
value: function renderImageRenderer() {
|
|
459
|
-
var _this$
|
|
460
|
-
cardPreview = _this$
|
|
461
|
-
_this$
|
|
462
|
-
_this$
|
|
463
|
-
_this$
|
|
464
|
-
mediaType = _this$
|
|
465
|
-
alt = _this$
|
|
466
|
-
resizeMode = _this$
|
|
467
|
-
onDisplayImage = _this$
|
|
468
|
-
nativeLazyLoad = _this$
|
|
469
|
-
forceSyncDisplay = _this$
|
|
321
|
+
var _this$props6 = this.props,
|
|
322
|
+
cardPreview = _this$props6.cardPreview,
|
|
323
|
+
_this$props6$metadata = _this$props6.metadata,
|
|
324
|
+
_this$props6$metadata2 = _this$props6$metadata === void 0 ? {} : _this$props6$metadata,
|
|
325
|
+
_this$props6$metadata3 = _this$props6$metadata2.mediaType,
|
|
326
|
+
mediaType = _this$props6$metadata3 === void 0 ? 'unknown' : _this$props6$metadata3,
|
|
327
|
+
alt = _this$props6.alt,
|
|
328
|
+
resizeMode = _this$props6.resizeMode,
|
|
329
|
+
onDisplayImage = _this$props6.onDisplayImage,
|
|
330
|
+
nativeLazyLoad = _this$props6.nativeLazyLoad,
|
|
331
|
+
forceSyncDisplay = _this$props6.forceSyncDisplay;
|
|
470
332
|
return !!cardPreview && jsx(ImageRenderer, {
|
|
471
333
|
cardPreview: cardPreview,
|
|
472
334
|
mediaType: mediaType,
|
|
@@ -491,10 +353,10 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
491
353
|
key: "renderMediaTypeIcon",
|
|
492
354
|
value: function renderMediaTypeIcon(hasTitleBox, iconMessage) {
|
|
493
355
|
var metadata = this.props.metadata;
|
|
494
|
-
var
|
|
495
|
-
mediaType =
|
|
496
|
-
mimeType =
|
|
497
|
-
name =
|
|
356
|
+
var _ref7 = metadata || {},
|
|
357
|
+
mediaType = _ref7.mediaType,
|
|
358
|
+
mimeType = _ref7.mimeType,
|
|
359
|
+
name = _ref7.name;
|
|
498
360
|
return jsx(IconWrapper, {
|
|
499
361
|
breakpoint: this.breakpoint,
|
|
500
362
|
hasTitleBox: hasTitleBox
|
|
@@ -508,10 +370,10 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
508
370
|
}, {
|
|
509
371
|
key: "renderActionsBar",
|
|
510
372
|
value: function renderActionsBar() {
|
|
511
|
-
var _this$
|
|
512
|
-
disableOverlay = _this$
|
|
513
|
-
actions = _this$
|
|
514
|
-
metadata = _this$
|
|
373
|
+
var _this$props7 = this.props,
|
|
374
|
+
disableOverlay = _this$props7.disableOverlay,
|
|
375
|
+
actions = _this$props7.actions,
|
|
376
|
+
metadata = _this$props7.metadata;
|
|
515
377
|
var actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
516
378
|
if (disableOverlay || !actions || actions.length === 0) {
|
|
517
379
|
return null;
|
|
@@ -520,6 +382,50 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
520
382
|
actions: actionsWithDetails
|
|
521
383
|
});
|
|
522
384
|
}
|
|
385
|
+
}, {
|
|
386
|
+
key: "render",
|
|
387
|
+
value: function render() {
|
|
388
|
+
var _this$props8 = this.props,
|
|
389
|
+
dimensions = _this$props8.dimensions,
|
|
390
|
+
appearance = _this$props8.appearance,
|
|
391
|
+
onClick = _this$props8.onClick,
|
|
392
|
+
onMouseEnter = _this$props8.onMouseEnter,
|
|
393
|
+
testId = _this$props8.testId,
|
|
394
|
+
metadata = _this$props8.metadata,
|
|
395
|
+
status = _this$props8.status,
|
|
396
|
+
selected = _this$props8.selected,
|
|
397
|
+
selectable = _this$props8.selectable,
|
|
398
|
+
disableOverlay = _this$props8.disableOverlay,
|
|
399
|
+
cardPreview = _this$props8.cardPreview,
|
|
400
|
+
mediaCardCursor = _this$props8.mediaCardCursor;
|
|
401
|
+
var _ref8 = metadata || {},
|
|
402
|
+
name = _ref8.name;
|
|
403
|
+
var shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
404
|
+
var isPlayButtonClickable = !!(this.shouldRenderPlayButton() && disableOverlay);
|
|
405
|
+
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
406
|
+
// Disable tooltip for Media Single
|
|
407
|
+
var shouldDisplayTooltip = !disableOverlay;
|
|
408
|
+
return jsx(Wrapper, {
|
|
409
|
+
testId: testId || 'media-card-view',
|
|
410
|
+
dimensions: dimensions,
|
|
411
|
+
appearance: appearance,
|
|
412
|
+
onClick: onClick,
|
|
413
|
+
onMouseEnter: onMouseEnter,
|
|
414
|
+
innerRef: this.divRef,
|
|
415
|
+
breakpoint: this.breakpoint,
|
|
416
|
+
mediaCardCursor: mediaCardCursor,
|
|
417
|
+
disableOverlay: !!disableOverlay,
|
|
418
|
+
selected: !!selected,
|
|
419
|
+
displayBackground: shouldDisplayBackground,
|
|
420
|
+
isPlayButtonClickable: isPlayButtonClickable,
|
|
421
|
+
isTickBoxSelectable: isTickBoxSelectable,
|
|
422
|
+
shouldDisplayTooltip: shouldDisplayTooltip
|
|
423
|
+
}, shouldDisplayTooltip ? jsx(Tooltip, {
|
|
424
|
+
content: name,
|
|
425
|
+
position: "bottom",
|
|
426
|
+
tag: 'div'
|
|
427
|
+
}, this.renderContents()) : this.renderContents());
|
|
428
|
+
}
|
|
523
429
|
}]);
|
|
524
430
|
return CardViewBase;
|
|
525
431
|
}(React.Component);
|
|
@@ -1,42 +1,9 @@
|
|
|
1
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
2
1
|
export var isFinalCardStatus = function isFinalCardStatus(status) {
|
|
3
2
|
return ['complete', 'error', 'failed-processing'].includes(status);
|
|
4
3
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
isPreviewable = _ref.isPreviewable,
|
|
4
|
+
export var getCardStatus = function getCardStatus(fileStatus, _ref) {
|
|
5
|
+
var isPreviewable = _ref.isPreviewable,
|
|
8
6
|
hasPreview = _ref.hasPreview;
|
|
9
|
-
switch (fileStatus) {
|
|
10
|
-
case 'uploading':
|
|
11
|
-
case 'failed-processing':
|
|
12
|
-
case 'error':
|
|
13
|
-
return fileStatus;
|
|
14
|
-
case 'processing':
|
|
15
|
-
// Legacy empty files logic
|
|
16
|
-
// isPreviewable will most likely be false for empty files,
|
|
17
|
-
// therefore we need to do this cut before that check.
|
|
18
|
-
// TODO: https://product-fabric.atlassian.net/browse/BMPT-1247
|
|
19
|
-
if (!hasFilesize) {
|
|
20
|
-
return 'processing';
|
|
21
|
-
}
|
|
22
|
-
// If we show no preview for this file
|
|
23
|
-
// we won't show the "creating preview" message, i.e. Card is "complete".
|
|
24
|
-
if (!isPreviewable) {
|
|
25
|
-
return 'complete';
|
|
26
|
-
}
|
|
27
|
-
return 'processing';
|
|
28
|
-
case 'processed':
|
|
29
|
-
if (!isPreviewable || !hasPreview) {
|
|
30
|
-
return 'complete';
|
|
31
|
-
}
|
|
32
|
-
return 'loading-preview';
|
|
33
|
-
default:
|
|
34
|
-
return 'loading';
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var getCardStatusFixed = function getCardStatusFixed(fileStatus, _ref2) {
|
|
38
|
-
var isPreviewable = _ref2.isPreviewable,
|
|
39
|
-
hasPreview = _ref2.hasPreview;
|
|
40
7
|
switch (fileStatus) {
|
|
41
8
|
case 'uploading':
|
|
42
9
|
case 'failed-processing':
|
|
@@ -51,10 +18,4 @@ var getCardStatusFixed = function getCardStatusFixed(fileStatus, _ref2) {
|
|
|
51
18
|
default:
|
|
52
19
|
return 'loading';
|
|
53
20
|
}
|
|
54
|
-
};
|
|
55
|
-
export var getCardStatus = function getCardStatus(fileStatus, filePreviewStatus, featureFlags) {
|
|
56
|
-
if (getMediaFeatureFlag('fetchFileStateAfterUpload', featureFlags)) {
|
|
57
|
-
return getCardStatusFixed(fileStatus, filePreviewStatus);
|
|
58
|
-
}
|
|
59
|
-
return getCardStatusBuggy(fileStatus, filePreviewStatus);
|
|
60
21
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { inlinePlayerWrapperStyles, inlinePlayerClassName } from './
|
|
3
|
+
import { inlinePlayerWrapperStyles, inlinePlayerClassName } from './inlinePlayerWrapperStyles';
|
|
4
4
|
export var InlinePlayerWrapper = function InlinePlayerWrapper(props) {
|
|
5
5
|
var testId = props.testId,
|
|
6
6
|
selected = props.selected,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
5
|
+
import { getDimensionsWithDefault } from '../utils/lightCards/getDimensionsWithDefault';
|
|
6
|
+
import { getSelectionStyles, SelectionStyle, hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Used to display the blue border around a selected card without
|
|
10
|
+
* shrinking the image OR growing the card size
|
|
11
|
+
*/
|
|
12
|
+
var getSelectedBorderStyle = function getSelectedBorderStyle(_ref) {
|
|
13
|
+
var selected = _ref.selected;
|
|
14
|
+
return "\n ".concat(hideNativeBrowserTextSelectionStyles, "\n\n &::after {\n content: '';\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n box-sizing: border-box;\n pointer-events: none;\n ").concat(borderRadius, "\n ").concat(selected ? getSelectionStyles([SelectionStyle.Border]) : '', "\n }\n ");
|
|
15
|
+
};
|
|
16
|
+
export var inlinePlayerClassName = 'media-card-inline-player';
|
|
17
|
+
export var inlinePlayerWrapperStyles = function inlinePlayerWrapperStyles(_ref2) {
|
|
18
|
+
var dimensions = _ref2.dimensions,
|
|
19
|
+
selected = _ref2.selected;
|
|
20
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n border-radius: ", "px;\n position: relative;\n max-width: 100%;\n max-height: 100%;\n\n ", "\n\n video {\n width: 100%;\n height: 100%;\n }\n"])), getDimensionsWithDefault(dimensions).width || '100%', getDimensionsWithDefault(dimensions).height || 'auto', borderRadius(), getSelectedBorderStyle(selected));
|
|
21
|
+
};
|
|
22
|
+
inlinePlayerWrapperStyles.displayName = 'InlinePlayerWrapper';
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "
|
|
86
|
+
var packageVersion = "76.0.0";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -6,7 +6,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { CardActionIconButtonVariant, CardActionsView } from '
|
|
9
|
+
import { CardActionIconButtonVariant, CardActionsView } from './cardActions';
|
|
10
10
|
import { ActionsBarWrapper } from './actionsBarWrapper';
|
|
11
11
|
export var ActionsBar = /*#__PURE__*/function (_React$Component) {
|
|
12
12
|
_inherits(ActionsBar, _React$Component);
|
|
@@ -13,7 +13,7 @@ import { Component } from 'react';
|
|
|
13
13
|
import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
14
14
|
import DropdownMenu, { DropdownItemGroup, DropdownItem } from '@atlaskit/dropdown-menu';
|
|
15
15
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
|
-
import { createAndFireMediaCardEvent } from '
|
|
16
|
+
import { createAndFireMediaCardEvent } from '../../../../utils/analytics';
|
|
17
17
|
import { CardActionButton } from './cardActionButton';
|
|
18
18
|
var CardActionButtonWithAnalytics = withAnalyticsEvents({
|
|
19
19
|
onClick: createAndFireMediaCardEvent({
|
|
@@ -11,8 +11,8 @@ import { Component } from 'react';
|
|
|
11
11
|
import { CardActionIconButton } from './cardActionIconButton';
|
|
12
12
|
import { wrapperStyles } from './styles';
|
|
13
13
|
import { CardActionsDropdownMenu } from './cardActionsDropdownMenu';
|
|
14
|
-
import { PreventClickThrough } from '
|
|
15
|
-
import { createAndFireMediaCardEvent } from '
|
|
14
|
+
import { PreventClickThrough } from '../../../../utils/preventClickThrough';
|
|
15
|
+
import { createAndFireMediaCardEvent } from '../../../../utils/analytics';
|
|
16
16
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
17
|
var CardActionIconButtonWithProps = function CardActionIconButtonWithProps(props) {
|
|
18
18
|
return jsx(CardActionIconButton, props);
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { N500, N0 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { borderRadius, size, center } from '@atlaskit/media-ui';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { rgba } from '../../styles';
|
|
7
|
+
import { fontFamily } from '@atlaskit/theme/constants';
|
|
8
|
+
var rootStyles = function rootStyles() {
|
|
9
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n font-family: ", ";\n\n * {\n box-sizing: border-box;\n }\n"])), fontFamily());
|
|
10
|
+
};
|
|
11
|
+
export var wrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n display: flex;\n position: relative;\n line-height: 0;\n"])), rootStyles());
|
|
9
12
|
export var CardActionIconButtonVariant = /*#__PURE__*/function (CardActionIconButtonVariant) {
|
|
10
13
|
CardActionIconButtonVariant["default"] = "default";
|
|
11
14
|
CardActionIconButtonVariant["filled"] = "filled";
|
|
@@ -16,5 +19,5 @@ var getVariantStyles = function getVariantStyles(variant) {
|
|
|
16
19
|
};
|
|
17
20
|
export var cardActionButtonStyles = function cardActionButtonStyles(_ref) {
|
|
18
21
|
var variant = _ref.variant;
|
|
19
|
-
return css(
|
|
22
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), center, borderRadius, size(26), "var(--ds-icon, ".concat(N500, ")"), getVariantStyles(variant));
|
|
20
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { transition } from '
|
|
4
|
+
import { transition } from '../styles';
|
|
5
5
|
export var actionsBarClassName = 'media-card-actions-bar';
|
|
6
6
|
export var fixedActionBarStyles = "opacity: 1;";
|
|
7
7
|
export var wrapperStyles = function wrapperStyles(isFixed) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { transition } from '
|
|
4
|
+
import { transition } from '../styles';
|
|
5
5
|
import { N90A } from '@atlaskit/theme/colors';
|
|
6
6
|
export var blanketClassName = 'media-card-blanket';
|
|
7
7
|
export var fixedBlanketStyles = "background-color: ".concat("var(--ds-blanket, ".concat(N90A, ")"), ";");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { MediaImage } from '@atlaskit/media-ui';
|
|
4
|
-
import { resizeModeToMediaImageProps } from '
|
|
4
|
+
import { resizeModeToMediaImageProps } from './resizeModeToMediaImageProps';
|
|
5
5
|
export var ImageRenderer = function ImageRenderer(_ref) {
|
|
6
6
|
var cardPreview = _ref.cardPreview,
|
|
7
7
|
alt = _ref.alt,
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
5
|
-
import { rgba } from '
|
|
5
|
+
import { rgba } from '../styles';
|
|
6
6
|
import { N0 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { Breakpoint, getTitleBoxHeight, responsiveSettings } from '../common';
|
|
8
8
|
var height = 3;
|
|
@@ -61,4 +61,16 @@ export var getSelectableTickBoxStyles = function getSelectableTickBoxStyles(isTi
|
|
|
61
61
|
}
|
|
62
62
|
return "\n &:hover .".concat(tickBoxClassName, " {\n ").concat(tickboxFixedStyles, "\n }\n ");
|
|
63
63
|
};
|
|
64
|
-
export var cardImageContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n max-width: 100%;\n width: 100%;\n height: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"])), borderRadius);
|
|
64
|
+
export var cardImageContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n max-width: 100%;\n width: 100%;\n height: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"])), borderRadius);
|
|
65
|
+
var defaultTransitionDuration = '.3s';
|
|
66
|
+
export var transition = function transition() {
|
|
67
|
+
var propertyName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all';
|
|
68
|
+
return "\n transition: ".concat(propertyName, " ").concat(defaultTransitionDuration, ";\n");
|
|
69
|
+
};
|
|
70
|
+
var hexToRgb = function hexToRgb(hex) {
|
|
71
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
72
|
+
return result ? "".concat(parseInt(result[1], 16), ",").concat(parseInt(result[2], 16), ",").concat(parseInt(result[3], 16)) : null;
|
|
73
|
+
};
|
|
74
|
+
export var rgba = function rgba(hex, opacity) {
|
|
75
|
+
return "rgba(".concat(hexToRgb(hex), ", ").concat(opacity, ")");
|
|
76
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { transition } from '
|
|
4
|
+
import { transition } from '../styles';
|
|
5
5
|
import { B200, N0, N100 } from '@atlaskit/theme/colors';
|
|
6
6
|
export var tickBoxClassName = 'media-card-tickbox';
|
|
7
7
|
export var tickboxFixedStyles = "\n background-color: ".concat("var(--ds-background-input, ".concat(N0, ")"), ";\n color: ", "var(--ds-icon-subtle, ".concat(N100, ")"), ";\n");
|