@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,11 +1,16 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
+
import { FileFetcherError } from '@atlaskit/media-client';
|
|
3
4
|
import { injectIntl, IntlProvider, createIntl } from 'react-intl-next';
|
|
4
5
|
import { MediaInlineCardLoadedView, MediaInlineCardLoadingView, MediaInlineCardErroredView, messages } from '@atlaskit/media-ui';
|
|
5
6
|
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
6
7
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
7
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
9
|
import { formatDate } from '@atlaskit/media-ui/formatDate';
|
|
10
|
+
import { fireMediaCardEvent } from '../utils/analytics';
|
|
11
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
|
+
import { MediaCardError } from '../errors';
|
|
13
|
+
import { getErrorStatusPayload, getFailedProcessingStatusPayload, getSucceededStatusPayload } from './mediaInlineCardAnalytics';
|
|
9
14
|
// UI component which renders an inline link in the appropiate state based on a media file
|
|
10
15
|
export const MediaInlineCardInternal = ({
|
|
11
16
|
mediaClient,
|
|
@@ -18,8 +23,23 @@ export const MediaInlineCardInternal = ({
|
|
|
18
23
|
intl
|
|
19
24
|
}) => {
|
|
20
25
|
const [fileState, setFileState] = useState();
|
|
21
|
-
const [
|
|
26
|
+
const [subscribeError, setSubscribeError] = useState();
|
|
27
|
+
const [isSucceededEventSent, setIsSucceededEventSent] = useState(false);
|
|
28
|
+
const [isFailedEventSent, setIsFailedEventSent] = useState(false);
|
|
22
29
|
const [isMediaViewerVisible, setMediaViewerVisible] = useState(false);
|
|
30
|
+
const {
|
|
31
|
+
createAnalyticsEvent
|
|
32
|
+
} = useAnalyticsEvents();
|
|
33
|
+
const fireFailedOperationalEvent = (error = new MediaCardError('missing-error-data'), failReason) => {
|
|
34
|
+
const payload = failReason ? getFailedProcessingStatusPayload(fileState) : getErrorStatusPayload(error, fileState);
|
|
35
|
+
setIsFailedEventSent(true);
|
|
36
|
+
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
37
|
+
};
|
|
38
|
+
const fireSucceededOperationalEvent = () => {
|
|
39
|
+
const payload = getSucceededStatusPayload(fileState);
|
|
40
|
+
setIsSucceededEventSent(true);
|
|
41
|
+
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
42
|
+
};
|
|
23
43
|
const onMediaInlineCardClick = event => {
|
|
24
44
|
if (onClick) {
|
|
25
45
|
const inlineCardEvent = {
|
|
@@ -59,25 +79,45 @@ export const MediaInlineCardInternal = ({
|
|
|
59
79
|
}).subscribe({
|
|
60
80
|
next: fileState => {
|
|
61
81
|
setFileState(fileState);
|
|
62
|
-
|
|
82
|
+
setSubscribeError(undefined);
|
|
63
83
|
},
|
|
64
|
-
error:
|
|
65
|
-
|
|
84
|
+
error: e => {
|
|
85
|
+
setSubscribeError(e);
|
|
66
86
|
}
|
|
67
87
|
});
|
|
68
88
|
return () => {
|
|
69
89
|
subscription.unsubscribe();
|
|
70
90
|
};
|
|
71
91
|
}, [identifier.collectionName, identifier.id, mediaClient.file]);
|
|
72
|
-
if (
|
|
92
|
+
if (subscribeError) {
|
|
93
|
+
const errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
|
|
94
|
+
const errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
|
|
95
|
+
!isFailedEventSent && fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
|
|
96
|
+
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
97
|
+
message: (intl || defaultIntl).formatMessage(errorMessage),
|
|
98
|
+
isSelected: isSelected
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
|
|
102
|
+
const error = new MediaCardError('error-file-state', new Error(fileState.message));
|
|
103
|
+
!isFailedEventSent && fireFailedOperationalEvent(error);
|
|
73
104
|
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
74
|
-
message: (intl || defaultIntl).formatMessage(messages.
|
|
105
|
+
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
75
106
|
isSelected: isSelected
|
|
76
107
|
});
|
|
77
108
|
}
|
|
78
|
-
if (
|
|
109
|
+
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
|
|
110
|
+
!isFailedEventSent && fireFailedOperationalEvent(undefined, 'failed-processing');
|
|
111
|
+
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
112
|
+
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
113
|
+
isSelected: isSelected
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
79
117
|
// Empty file handling
|
|
80
|
-
fileState && !fileState.name) {
|
|
118
|
+
if (fileState && !fileState.name) {
|
|
119
|
+
const error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', fileState.id));
|
|
120
|
+
!isFailedEventSent && fireFailedOperationalEvent(error);
|
|
81
121
|
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
82
122
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
83
123
|
isSelected: isSelected
|
|
@@ -117,6 +157,9 @@ export const MediaInlineCardInternal = ({
|
|
|
117
157
|
};
|
|
118
158
|
formattedDate = formatDate(fileState.createdAt, locale);
|
|
119
159
|
}
|
|
160
|
+
if (fileState.status === 'processed' && !isSucceededEventSent) {
|
|
161
|
+
fireSucceededOperationalEvent();
|
|
162
|
+
}
|
|
120
163
|
if (shouldDisplayToolTip === undefined || shouldDisplayToolTip === true) {
|
|
121
164
|
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
122
165
|
position: "bottom",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { extractErrorInfo } from '../utils/analytics';
|
|
2
|
+
export const getSucceededStatusPayload = fileState => {
|
|
3
|
+
return {
|
|
4
|
+
eventType: 'operational',
|
|
5
|
+
action: 'succeeded',
|
|
6
|
+
actionSubject: 'mediaInlineRender',
|
|
7
|
+
attributes: {
|
|
8
|
+
status: 'success',
|
|
9
|
+
fileAttributes: {
|
|
10
|
+
fileId: (fileState === null || fileState === void 0 ? void 0 : fileState.id) || '',
|
|
11
|
+
fileSize: fileState === null || fileState === void 0 ? void 0 : fileState.size,
|
|
12
|
+
fileMediatype: fileState === null || fileState === void 0 ? void 0 : fileState.mediaType,
|
|
13
|
+
fileMimetype: fileState === null || fileState === void 0 ? void 0 : fileState.mimeType,
|
|
14
|
+
fileStatus: fileState === null || fileState === void 0 ? void 0 : fileState.status
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export const getErrorStatusPayload = (error, fileState) => {
|
|
20
|
+
return {
|
|
21
|
+
eventType: 'operational',
|
|
22
|
+
action: 'failed',
|
|
23
|
+
actionSubject: 'mediaInlineRender',
|
|
24
|
+
attributes: {
|
|
25
|
+
status: 'fail',
|
|
26
|
+
fileAttributes: {
|
|
27
|
+
fileId: (fileState === null || fileState === void 0 ? void 0 : fileState.id) || '',
|
|
28
|
+
fileStatus: fileState === null || fileState === void 0 ? void 0 : fileState.status
|
|
29
|
+
},
|
|
30
|
+
...extractErrorInfo(error)
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export const getFailedProcessingStatusPayload = fileState => {
|
|
35
|
+
return {
|
|
36
|
+
eventType: 'operational',
|
|
37
|
+
action: 'failed',
|
|
38
|
+
actionSubject: 'mediaInlineRender',
|
|
39
|
+
attributes: {
|
|
40
|
+
status: 'fail',
|
|
41
|
+
fileAttributes: {
|
|
42
|
+
fileId: (fileState === null || fileState === void 0 ? void 0 : fileState.id) || '',
|
|
43
|
+
fileStatus: fileState === null || fileState === void 0 ? void 0 : fileState.status
|
|
44
|
+
},
|
|
45
|
+
failReason: 'failed-processing'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// Default dimensions
|
|
2
|
-
|
|
3
|
-
export const defaultSmallCardDimensions = {
|
|
4
|
-
width: '100%',
|
|
5
|
-
height: 42
|
|
6
|
-
};
|
|
7
1
|
export const defaultImageCardDimensions = {
|
|
8
2
|
width: 156,
|
|
9
3
|
height: 125
|
|
@@ -16,76 +10,6 @@ export const defaultSquareCardDimensions = {
|
|
|
16
10
|
width: 300,
|
|
17
11
|
height: 300
|
|
18
12
|
};
|
|
19
|
-
|
|
20
|
-
// Small dimensions
|
|
21
|
-
|
|
22
|
-
export const minSmallCardDimensions = {
|
|
23
|
-
width: 200,
|
|
24
|
-
height: 32
|
|
25
|
-
};
|
|
26
|
-
export const minImageCardDimensions = {
|
|
27
|
-
width: 144,
|
|
28
|
-
height: 96
|
|
29
|
-
};
|
|
30
|
-
export const minSquareCardDimensions = {
|
|
31
|
-
width: 272,
|
|
32
|
-
height: 275
|
|
33
|
-
};
|
|
34
|
-
export const minHorizontalCardDimensions = {
|
|
35
|
-
width: 400,
|
|
36
|
-
height: 125
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// Max dimensions
|
|
40
|
-
|
|
41
|
-
export const maxImageCardDimensions = {
|
|
42
|
-
width: 480,
|
|
43
|
-
height: 360
|
|
44
|
-
};
|
|
45
|
-
export const maxHorizontalCardDimensions = {
|
|
46
|
-
width: 400,
|
|
47
|
-
height: 116
|
|
48
|
-
};
|
|
49
|
-
export const maxSquareCardDimensions = {
|
|
50
|
-
width: 400,
|
|
51
|
-
height: 348
|
|
52
|
-
};
|
|
53
|
-
export const getCardMaxHeight = appearance => {
|
|
54
|
-
if (appearance === 'image') {
|
|
55
|
-
return maxImageCardDimensions.height;
|
|
56
|
-
}
|
|
57
|
-
if (appearance === 'horizontal') {
|
|
58
|
-
return maxHorizontalCardDimensions.height;
|
|
59
|
-
}
|
|
60
|
-
if (appearance === 'square') {
|
|
61
|
-
return maxSquareCardDimensions.height;
|
|
62
|
-
}
|
|
63
|
-
return maxSquareCardDimensions.width;
|
|
64
|
-
};
|
|
65
|
-
export const getCardMinWidth = appearance => {
|
|
66
|
-
if (appearance === 'image') {
|
|
67
|
-
return minImageCardDimensions.width;
|
|
68
|
-
}
|
|
69
|
-
if (appearance === 'horizontal') {
|
|
70
|
-
return minHorizontalCardDimensions.width;
|
|
71
|
-
}
|
|
72
|
-
if (appearance === 'square') {
|
|
73
|
-
return minSquareCardDimensions.width;
|
|
74
|
-
}
|
|
75
|
-
return minSmallCardDimensions.width;
|
|
76
|
-
};
|
|
77
|
-
export const getCardMaxWidth = appearance => {
|
|
78
|
-
if (appearance === 'image') {
|
|
79
|
-
return maxImageCardDimensions.width;
|
|
80
|
-
}
|
|
81
|
-
if (appearance === 'horizontal') {
|
|
82
|
-
return maxHorizontalCardDimensions.width;
|
|
83
|
-
}
|
|
84
|
-
if (appearance === 'square') {
|
|
85
|
-
return maxSquareCardDimensions.width;
|
|
86
|
-
}
|
|
87
|
-
return maxSquareCardDimensions.width;
|
|
88
|
-
};
|
|
89
13
|
export const getDefaultCardDimensions = appearance => {
|
|
90
14
|
if (appearance === 'image') {
|
|
91
15
|
return defaultImageCardDimensions;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export { ErrorIcon } from './errorIcon';
|
|
2
|
-
export { FileIcon } from './fileIcon';
|
|
3
|
-
export { CardActionIconButton, CardActionsDropdownMenu, CardActionsView, default } from './cardActions';
|
|
4
1
|
export { isRetina } from './isRetina';
|
|
5
|
-
export { defaultHorizontalCardDimensions, defaultImageCardDimensions,
|
|
6
|
-
export { breakpointSize, breakpointStyles, cardBreakpointSizes } from './breakpoint';
|
|
2
|
+
export { defaultHorizontalCardDimensions, defaultImageCardDimensions, defaultSquareCardDimensions, getDefaultCardDimensions } from './cardDimensions';
|
|
7
3
|
export { isValidPercentageUnit } from './isValidPercentageUnit';
|
|
8
4
|
export { getElementDimension } from './getElementDimension';
|
|
9
5
|
export { containsPixelUnit } from './containsPixelUnit';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Component } from 'react';
|
|
4
|
-
import { ErrorIcon } from '
|
|
4
|
+
import { ErrorIcon } from './errorIcon';
|
|
5
5
|
import { Wrapper } from './lightCardWrappers';
|
|
6
6
|
import { getDimensionsWithDefault } from './getDimensionsWithDefault';
|
|
7
7
|
export class CardError extends Component {
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { getDimensionsWithDefault } from './getDimensionsWithDefault';
|
|
4
|
-
import { Wrapper
|
|
4
|
+
import { Wrapper } from './lightCardWrappers';
|
|
5
5
|
import SpinnerIcon from '@atlaskit/spinner';
|
|
6
|
-
import FileIcon from '@atlaskit/icon/glyph/file';
|
|
7
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
8
6
|
export class CardLoading extends Component {
|
|
9
7
|
render() {
|
|
10
8
|
const {
|
|
11
9
|
dimensions: dimensionsProp,
|
|
12
|
-
testId
|
|
13
|
-
featureFlags
|
|
10
|
+
testId
|
|
14
11
|
} = this.props;
|
|
15
12
|
const dimensions = getDimensionsWithDefault(dimensionsProp);
|
|
16
|
-
|
|
17
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
18
|
-
"data-testid": testId || 'media-card-loading',
|
|
19
|
-
"data-test-loading": true,
|
|
20
|
-
dimensions: dimensions
|
|
21
|
-
}, /*#__PURE__*/React.createElement(SpinnerIcon, null));
|
|
22
|
-
}
|
|
23
|
-
return /*#__PURE__*/React.createElement(AnimatedWrapper, {
|
|
13
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
24
14
|
"data-testid": testId || 'media-card-loading',
|
|
25
15
|
"data-test-loading": true,
|
|
26
16
|
dimensions: dimensions
|
|
27
|
-
}, /*#__PURE__*/React.createElement(
|
|
28
|
-
label: "loading",
|
|
29
|
-
size: "medium"
|
|
30
|
-
}));
|
|
17
|
+
}, /*#__PURE__*/React.createElement(SpinnerIcon, null));
|
|
31
18
|
}
|
|
32
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/**@jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { wrapperStyles
|
|
4
|
+
import { wrapperStyles } from './styles';
|
|
5
5
|
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
6
|
export const Wrapper = props => {
|
|
7
7
|
const theme = useGlobalTheme();
|
|
@@ -11,13 +11,4 @@ export const Wrapper = props => {
|
|
|
11
11
|
theme: theme
|
|
12
12
|
})
|
|
13
13
|
}, props), props.children);
|
|
14
|
-
};
|
|
15
|
-
export const AnimatedWrapper = props => {
|
|
16
|
-
const theme = useGlobalTheme();
|
|
17
|
-
return jsx("div", _extends({
|
|
18
|
-
css: animatedWrapperStyles({
|
|
19
|
-
dimensions: props.dimensions,
|
|
20
|
-
theme: theme
|
|
21
|
-
})
|
|
22
|
-
}, props), props.children);
|
|
23
14
|
};
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import { css
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
3
3
|
import { themed } from '@atlaskit/theme/components';
|
|
4
4
|
import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
|
|
5
|
-
export const blinkLoadingAnimation = keyframes`
|
|
6
|
-
0%{
|
|
7
|
-
opacity: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
50%{
|
|
11
|
-
opacity: 0.6;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
100%{
|
|
15
|
-
opacity: 1;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
5
|
export const wrapperStyles = ({
|
|
19
6
|
dimensions,
|
|
20
7
|
theme
|
|
@@ -37,10 +24,4 @@ export const wrapperStyles = ({
|
|
|
37
24
|
max-width: 100%;
|
|
38
25
|
width: ${dimensions.width};
|
|
39
26
|
height: ${dimensions.height};
|
|
40
|
-
`;
|
|
41
|
-
export const animatedWrapperStyles = props => css`
|
|
42
|
-
${wrapperStyles(props)}
|
|
43
|
-
> span {
|
|
44
|
-
animation: ${blinkLoadingAnimation} 0.8s infinite;
|
|
45
|
-
}
|
|
46
27
|
`;
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "76.0.1";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/card/card.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
40
40
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "
|
|
43
|
+
var packageVersion = "76.0.1";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -20,7 +20,7 @@ export var createStateUpdater = function createStateUpdater(newState, fireErrorE
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export var getCardStateFromFileState = function getCardStateFromFileState(fileState, isBannedLocalPreview, featureFlags) {
|
|
23
|
-
var status = getCardStatus(fileState.status, extractFilePreviewStatus(fileState, isBannedLocalPreview, featureFlags)
|
|
23
|
+
var status = getCardStatus(fileState.status, extractFilePreviewStatus(fileState, isBannedLocalPreview, featureFlags));
|
|
24
24
|
var error = status === 'error' && isErrorFileState(fileState) ? new MediaCardError('error-file-state', new Error(fileState.message)) : undefined;
|
|
25
25
|
var progress = status === 'uploading' && fileState.status === 'uploading' ? fileState.progress : 1;
|
|
26
26
|
return {
|