@atlaskit/media-card 77.11.2 → 77.12.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 +2815 -2809
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +6 -8
- package/dist/cjs/card/inlinePlayerWrapper.js +3 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/actionsBar/actionsBarWrapper.js +3 -1
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionButton.js +3 -1
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionIconButton.js +3 -1
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -1
- package/dist/cjs/card/ui/blanket/blanket.js +3 -1
- package/dist/cjs/card/ui/playButton/playButtonBackground.js +1 -0
- package/dist/cjs/card/ui/playButton/playButtonWrapper.js +7 -4
- package/dist/cjs/card/ui/styles.js +1 -12
- package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +3 -1
- package/dist/cjs/card/ui/wrapper/imageContainer.js +52 -0
- package/dist/cjs/card/ui/wrapper/index.js +8 -1
- package/dist/cjs/card/ui/wrapper/wrapper.js +3 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardViewV2.js +15 -17
- package/dist/cjs/card/v2/cardviews/cardViewWrapper.js +8 -9
- package/dist/cjs/card/v2/cardviews/index.js +4 -2
- package/dist/cjs/card/v2/fileCard.js +71 -21
- package/dist/cjs/card/v2/svgView/helpers.js +16 -0
- package/dist/cjs/card/v2/svgView/index.js +12 -0
- package/dist/cjs/card/v2/svgView/svgView.js +134 -0
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +11 -7
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardView.js +8 -10
- package/dist/es2019/card/inlinePlayerWrapper.js +3 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/actionsBar/actionsBarWrapper.js +3 -1
- package/dist/es2019/card/ui/actionsBar/cardActions/cardActionButton.js +3 -1
- package/dist/es2019/card/ui/actionsBar/cardActions/cardActionIconButton.js +3 -1
- package/dist/es2019/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -1
- package/dist/es2019/card/ui/blanket/blanket.js +3 -1
- package/dist/es2019/card/ui/playButton/playButtonBackground.js +1 -0
- package/dist/es2019/card/ui/playButton/playButtonWrapper.js +7 -4
- package/dist/es2019/card/ui/styles.js +0 -11
- package/dist/es2019/card/ui/tickBox/tickBoxWrapper.js +3 -1
- package/dist/es2019/card/ui/wrapper/imageContainer.js +44 -0
- package/dist/es2019/card/ui/wrapper/index.js +2 -1
- package/dist/es2019/card/ui/wrapper/wrapper.js +3 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/cardViewV2.js +16 -18
- package/dist/es2019/card/v2/cardviews/cardViewWrapper.js +8 -9
- package/dist/es2019/card/v2/cardviews/index.js +4 -2
- package/dist/es2019/card/v2/fileCard.js +57 -9
- package/dist/es2019/card/v2/svgView/helpers.js +12 -0
- package/dist/es2019/card/v2/svgView/index.js +1 -0
- package/dist/es2019/card/v2/svgView/svgView.js +113 -0
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +11 -7
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardView.js +8 -10
- package/dist/esm/card/inlinePlayerWrapper.js +3 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/actionsBar/actionsBarWrapper.js +3 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionButton.js +3 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionIconButton.js +3 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -1
- package/dist/esm/card/ui/blanket/blanket.js +3 -1
- package/dist/esm/card/ui/playButton/playButtonBackground.js +1 -0
- package/dist/esm/card/ui/playButton/playButtonWrapper.js +7 -4
- package/dist/esm/card/ui/styles.js +0 -11
- package/dist/esm/card/ui/tickBox/tickBoxWrapper.js +3 -1
- package/dist/esm/card/ui/wrapper/imageContainer.js +45 -0
- package/dist/esm/card/ui/wrapper/index.js +2 -1
- package/dist/esm/card/ui/wrapper/wrapper.js +3 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/cardViewV2.js +16 -18
- package/dist/esm/card/v2/cardviews/cardViewWrapper.js +9 -10
- package/dist/esm/card/v2/cardviews/index.js +4 -2
- package/dist/esm/card/v2/fileCard.js +72 -21
- package/dist/esm/card/v2/svgView/helpers.js +10 -0
- package/dist/esm/card/v2/svgView/index.js +1 -0
- package/dist/esm/card/v2/svgView/svgView.js +123 -0
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +11 -7
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/actions.d.ts +2 -2
- package/dist/types/card/card.d.ts +5 -5
- package/dist/types/card/cardAnalytics.d.ts +4 -4
- package/dist/types/card/cardState.d.ts +2 -2
- package/dist/types/card/cardSwitcher.d.ts +1 -1
- package/dist/types/card/cardView.d.ts +8 -8
- package/dist/types/card/getCardPreview/cache.d.ts +3 -3
- package/dist/types/card/getCardPreview/filePreviewStatus.d.ts +2 -2
- package/dist/types/card/getCardPreview/helpers.d.ts +3 -3
- package/dist/types/card/getCardPreview/index.d.ts +5 -5
- package/dist/types/card/getCardStatus.d.ts +2 -2
- package/dist/types/card/inlinePlayer.d.ts +4 -4
- package/dist/types/card/inlinePlayerWrapper.d.ts +1 -1
- package/dist/types/card/inlinePlayerWrapperStyles.d.ts +1 -1
- package/dist/types/card/media-card-analytics-error-boundary.d.ts +4 -4
- package/dist/types/card/types.d.ts +4 -3
- package/dist/types/card/ui/actionsBar/actionsBar.d.ts +1 -1
- package/dist/types/card/ui/actionsBar/actionsBarWrapper.d.ts +1 -1
- package/dist/types/card/ui/actionsBar/cardActions/cardActionButton.d.ts +1 -1
- package/dist/types/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +2 -2
- package/dist/types/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.d.ts +2 -2
- package/dist/types/card/ui/actionsBar/cardActions/cardActionsView.d.ts +2 -2
- package/dist/types/card/ui/actionsBar/cardActions/styles.d.ts +3 -2
- package/dist/types/card/ui/actionsBar/types.d.ts +2 -2
- package/dist/types/card/ui/iconMessage/iconMessageWrapper.d.ts +1 -1
- package/dist/types/card/ui/iconMessage/index.d.ts +1 -1
- package/dist/types/card/ui/iconMessage/types.d.ts +2 -2
- package/dist/types/card/ui/iconWrapper/iconWrapper.d.ts +1 -1
- package/dist/types/card/ui/iconWrapper/styles.d.ts +2 -2
- package/dist/types/card/ui/iconWrapper/types.d.ts +1 -1
- package/dist/types/card/ui/imageRenderer/imageRenderer.d.ts +2 -2
- package/dist/types/card/ui/imageRenderer/resizeModeToMediaImageProps.d.ts +1 -1
- package/dist/types/card/ui/openMediaViewerButton/openMediaViewerButton.d.ts +1 -1
- package/dist/types/card/ui/progressBar/styledBar.d.ts +1 -1
- package/dist/types/card/ui/progressBar/styles.d.ts +1 -1
- package/dist/types/card/ui/progressBar/types.d.ts +1 -1
- package/dist/types/card/ui/styles.d.ts +2 -3
- package/dist/types/card/ui/tickBox/tickBox.d.ts +1 -1
- package/dist/types/card/ui/tickBox/tickBoxWrapper.d.ts +1 -1
- package/dist/types/card/ui/titleBox/failedTitleBox.d.ts +1 -1
- package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types/card/ui/titleBox/titleBox.d.ts +1 -1
- package/dist/types/card/ui/titleBox/titleBoxComponents.d.ts +1 -1
- package/dist/types/card/ui/titleBox/types.d.ts +3 -3
- package/dist/types/card/ui/unhandledErrorCard/index.d.ts +1 -1
- package/dist/types/card/ui/unhandledErrorCard/types.d.ts +1 -1
- package/dist/types/card/ui/wrapper/imageContainer.d.ts +15 -0
- package/dist/types/card/ui/wrapper/index.d.ts +1 -0
- package/dist/types/card/ui/wrapper/styles.d.ts +1 -1
- package/dist/types/card/ui/wrapper/types.d.ts +6 -5
- package/dist/types/card/ui/wrapper/wrapper.d.ts +1 -1
- package/dist/types/card/useBreakpoint.d.ts +2 -2
- package/dist/types/card/v2/cardV2.d.ts +3 -3
- package/dist/types/card/v2/cardV2Loader.d.ts +1 -1
- package/dist/types/card/v2/cardViewV2.d.ts +10 -9
- package/dist/types/card/v2/cardWithMediaClientV2.d.ts +1 -1
- package/dist/types/card/v2/cardviews/cardViewWrapper.d.ts +8 -7
- package/dist/types/card/v2/cardviews/errorCardView.d.ts +4 -4
- package/dist/types/card/v2/cardviews/iconCardView.d.ts +3 -3
- package/dist/types/card/v2/cardviews/imageCardView.d.ts +4 -4
- package/dist/types/card/v2/cardviews/index.d.ts +9 -8
- package/dist/types/card/v2/cardviews/loadingCardView.d.ts +3 -3
- package/dist/types/card/v2/cardviews/processingCardView.d.ts +2 -2
- package/dist/types/card/v2/cardviews/videoCardView.d.ts +4 -4
- package/dist/types/card/v2/externalImageCard.d.ts +3 -3
- package/dist/types/card/v2/fileCard.d.ts +5 -5
- package/dist/types/card/v2/inlinePlayerV2.d.ts +4 -4
- package/dist/types/card/v2/svgView/helpers.d.ts +3 -0
- package/dist/types/card/v2/svgView/index.d.ts +1 -0
- package/dist/types/card/v2/svgView/svgView.d.ts +31 -0
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/inline/loader.d.ts +3 -3
- package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
- package/dist/types/inline/mediaInlineCard.d.ts +4 -4
- package/dist/types/inline/mediaInlineCardAnalytics.d.ts +2 -2
- package/dist/types/types.d.ts +6 -6
- package/dist/types/utils/analytics/analytics.d.ts +5 -5
- package/dist/types/utils/cardDimensions.d.ts +1 -1
- package/dist/types/utils/dimensionComparer.d.ts +1 -1
- package/dist/types/utils/getDataURIDimension.d.ts +3 -3
- package/dist/types/utils/getMediaCardCursor.d.ts +1 -1
- package/dist/types/utils/globalScope/getSSRData.d.ts +1 -1
- package/dist/types/utils/globalScope/globalScope.d.ts +5 -5
- package/dist/types/utils/globalScope/types.d.ts +2 -2
- package/dist/types/utils/lightCards/cardError.d.ts +1 -1
- package/dist/types/utils/lightCards/cardLoading.d.ts +1 -1
- package/dist/types/utils/lightCards/getDimensionsWithDefault.d.ts +1 -1
- package/dist/types/utils/lightCards/lightCardWrappers.d.ts +1 -1
- package/dist/types/utils/lightCards/styles.d.ts +1 -1
- package/dist/types/utils/lightCards/types.d.ts +2 -2
- package/dist/types/utils/metadata.d.ts +1 -1
- package/dist/types/utils/objectURLCache.d.ts +1 -1
- package/dist/types/utils/preventClickThrough.d.ts +1 -1
- package/dist/types/utils/ufoExperiences.d.ts +4 -4
- package/dist/types/utils/useCurrentValueRef.d.ts +1 -1
- package/dist/types/utils/videoIsPlayable.d.ts +1 -1
- package/dist/types/utils/viewportDetector.d.ts +1 -1
- package/dist/types-ts4.5/card/actions.d.ts +2 -2
- package/dist/types-ts4.5/card/card.d.ts +5 -5
- package/dist/types-ts4.5/card/cardAnalytics.d.ts +4 -4
- package/dist/types-ts4.5/card/cardState.d.ts +2 -2
- package/dist/types-ts4.5/card/cardSwitcher.d.ts +1 -1
- package/dist/types-ts4.5/card/cardView.d.ts +8 -8
- package/dist/types-ts4.5/card/getCardPreview/cache.d.ts +3 -3
- package/dist/types-ts4.5/card/getCardPreview/filePreviewStatus.d.ts +2 -2
- package/dist/types-ts4.5/card/getCardPreview/helpers.d.ts +3 -3
- package/dist/types-ts4.5/card/getCardPreview/index.d.ts +5 -5
- package/dist/types-ts4.5/card/getCardStatus.d.ts +2 -2
- package/dist/types-ts4.5/card/inlinePlayer.d.ts +4 -4
- package/dist/types-ts4.5/card/inlinePlayerWrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/inlinePlayerWrapperStyles.d.ts +1 -1
- package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +4 -4
- package/dist/types-ts4.5/card/types.d.ts +4 -3
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBar.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBarWrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionButton.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsView.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/styles.d.ts +3 -2
- package/dist/types-ts4.5/card/ui/actionsBar/types.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/iconMessage/iconMessageWrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/iconMessage/index.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/iconMessage/types.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/iconWrapper/iconWrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/iconWrapper/types.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/imageRenderer/imageRenderer.d.ts +2 -2
- package/dist/types-ts4.5/card/ui/imageRenderer/resizeModeToMediaImageProps.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/openMediaViewerButton/openMediaViewerButton.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/progressBar/styledBar.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/progressBar/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/progressBar/types.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/styles.d.ts +2 -3
- package/dist/types-ts4.5/card/ui/tickBox/tickBox.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/tickBox/tickBoxWrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/failedTitleBox.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/titleBox.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/titleBoxComponents.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +3 -3
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/index.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/types.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/wrapper/imageContainer.d.ts +15 -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 +1 -1
- package/dist/types-ts4.5/card/ui/wrapper/types.d.ts +6 -5
- package/dist/types-ts4.5/card/ui/wrapper/wrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/useBreakpoint.d.ts +2 -2
- package/dist/types-ts4.5/card/v2/cardV2.d.ts +3 -3
- package/dist/types-ts4.5/card/v2/cardV2Loader.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +10 -9
- package/dist/types-ts4.5/card/v2/cardWithMediaClientV2.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/cardviews/cardViewWrapper.d.ts +8 -7
- package/dist/types-ts4.5/card/v2/cardviews/errorCardView.d.ts +4 -4
- package/dist/types-ts4.5/card/v2/cardviews/iconCardView.d.ts +3 -3
- package/dist/types-ts4.5/card/v2/cardviews/imageCardView.d.ts +4 -4
- package/dist/types-ts4.5/card/v2/cardviews/index.d.ts +9 -8
- package/dist/types-ts4.5/card/v2/cardviews/loadingCardView.d.ts +3 -3
- package/dist/types-ts4.5/card/v2/cardviews/processingCardView.d.ts +2 -2
- package/dist/types-ts4.5/card/v2/cardviews/videoCardView.d.ts +4 -4
- package/dist/types-ts4.5/card/v2/externalImageCard.d.ts +3 -3
- package/dist/types-ts4.5/card/v2/fileCard.d.ts +5 -5
- package/dist/types-ts4.5/card/v2/inlinePlayerV2.d.ts +4 -4
- package/dist/types-ts4.5/card/v2/svgView/helpers.d.ts +3 -0
- package/dist/types-ts4.5/card/v2/svgView/index.d.ts +1 -0
- package/dist/types-ts4.5/card/v2/svgView/svgView.d.ts +31 -0
- package/dist/types-ts4.5/errors.d.ts +2 -2
- package/dist/types-ts4.5/inline/loader.d.ts +3 -3
- package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +3 -3
- package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +4 -4
- package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +6 -6
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +5 -5
- package/dist/types-ts4.5/utils/cardDimensions.d.ts +1 -1
- package/dist/types-ts4.5/utils/dimensionComparer.d.ts +1 -1
- package/dist/types-ts4.5/utils/getDataURIDimension.d.ts +3 -3
- package/dist/types-ts4.5/utils/getMediaCardCursor.d.ts +1 -1
- package/dist/types-ts4.5/utils/globalScope/getSSRData.d.ts +1 -1
- package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +5 -5
- package/dist/types-ts4.5/utils/globalScope/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/lightCards/cardError.d.ts +1 -1
- package/dist/types-ts4.5/utils/lightCards/cardLoading.d.ts +1 -1
- package/dist/types-ts4.5/utils/lightCards/getDimensionsWithDefault.d.ts +1 -1
- package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +1 -1
- package/dist/types-ts4.5/utils/lightCards/styles.d.ts +1 -1
- package/dist/types-ts4.5/utils/lightCards/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/metadata.d.ts +1 -1
- package/dist/types-ts4.5/utils/objectURLCache.d.ts +1 -1
- package/dist/types-ts4.5/utils/preventClickThrough.d.ts +1 -1
- package/dist/types-ts4.5/utils/ufoExperiences.d.ts +4 -4
- package/dist/types-ts4.5/utils/useCurrentValueRef.d.ts +1 -1
- package/dist/types-ts4.5/utils/videoIsPlayable.d.ts +1 -1
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +1 -1
- package/example-helpers/cards.tsx +3 -1
- package/example-helpers/developmentUseMessage.tsx +1 -0
- package/example-helpers/index.tsx +4 -4
- package/example-helpers/selectableCard.tsx +2 -2
- package/example-helpers/svg-helpers/cardContainer.tsx +30 -0
- package/example-helpers/svg-helpers/controls.tsx +21 -0
- package/example-helpers/svg-helpers/delayApiResponses.ts +31 -0
- package/example-helpers/svg-helpers/dimensionPicker.tsx +124 -0
- package/example-helpers/svg-helpers/index.ts +7 -0
- package/example-helpers/svg-helpers/svgContainer.tsx +32 -0
- package/example-helpers/svg-helpers/toggle.tsx +43 -0
- package/example-helpers/svg-helpers/uploader.ts +44 -0
- package/package.json +20 -14
|
@@ -24,6 +24,9 @@ import { CardViews } from './cardviews';
|
|
|
24
24
|
import { InlinePlayerLazyV2 } from './inlinePlayerLazyV2';
|
|
25
25
|
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
26
26
|
import { performanceNow } from './performance';
|
|
27
|
+
import { useContext } from 'react';
|
|
28
|
+
import { DateOverrideContext } from '../../dateOverrideContext';
|
|
29
|
+
import { SvgView } from './svgView';
|
|
27
30
|
const LoadedCardView = getBooleanFF('platform.media-experience.card-views-refactor_b91lr') ? CardViews : CardViewV2;
|
|
28
31
|
export const FileCard = ({
|
|
29
32
|
appearance = 'auto',
|
|
@@ -87,6 +90,8 @@ export const FileCard = ({
|
|
|
87
90
|
return prevFileState;
|
|
88
91
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89
92
|
}, [fileState]);
|
|
93
|
+
const dateOverrides = useContext(DateOverrideContext);
|
|
94
|
+
const overridenDate = dateOverrides === null || dateOverrides === void 0 ? void 0 : dateOverrides[identifier.id];
|
|
90
95
|
|
|
91
96
|
//----------------------------------------------------------------//
|
|
92
97
|
//------------ State, Refs & Initial Values ----------------------//
|
|
@@ -106,6 +111,7 @@ export const FileCard = ({
|
|
|
106
111
|
}), []);
|
|
107
112
|
const [status, setStatus] = useState('loading');
|
|
108
113
|
const [isPlayingFile, setIsPlayingFile] = useState(false);
|
|
114
|
+
const [shouldRenderSVG, setShouldRenderSVG] = useState(false);
|
|
109
115
|
const [shouldAutoplay, setShouldAutoplay] = useState(false);
|
|
110
116
|
const [previewDidRender, setPreviewDidRender] = useState(false);
|
|
111
117
|
const mediaBlobUrlAttrs = useMemo(() => {
|
|
@@ -389,6 +395,23 @@ export const FileCard = ({
|
|
|
389
395
|
}
|
|
390
396
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
391
397
|
|
|
398
|
+
//----------------------------------------------------------------//
|
|
399
|
+
// Switch to SVG
|
|
400
|
+
//----------------------------------------------------------------//
|
|
401
|
+
|
|
402
|
+
useEffect(() => {
|
|
403
|
+
if (getBooleanFF('platform.media-svg-rendering') &&
|
|
404
|
+
/**
|
|
405
|
+
* We need to check that the card is visible before switching to SVG
|
|
406
|
+
* in order to avoid race conditions of the ViewportDector being unmounted before
|
|
407
|
+
* it is able to set isCardVisible to true.
|
|
408
|
+
*/
|
|
409
|
+
isCardVisible && metadata.mimeType === 'image/svg+xml' && disableOverlay // SVG won't be supported when overlay is on
|
|
410
|
+
) {
|
|
411
|
+
setShouldRenderSVG(true);
|
|
412
|
+
}
|
|
413
|
+
}, [isCardVisible, disableOverlay, metadata]);
|
|
414
|
+
|
|
392
415
|
//----------------------------------------------------------------//
|
|
393
416
|
//----------------- fireScreenEvent ------------------------------//
|
|
394
417
|
//----------------------------------------------------------------//
|
|
@@ -456,6 +479,18 @@ export const FileCard = ({
|
|
|
456
479
|
updateFileStateRef.current();
|
|
457
480
|
}, [fileState, preview, previewStatus, updateFileStateRef]);
|
|
458
481
|
|
|
482
|
+
//----------------------------------------------------------------//
|
|
483
|
+
// Shared Card View & SVG View resources
|
|
484
|
+
//----------------------------------------------------------------//
|
|
485
|
+
|
|
486
|
+
const mediaCardCursor = getMediaCardCursor(!!useInlinePlayer, !!shouldOpenMediaViewer, finalStatus === 'error' || finalStatus === 'failed-processing', !!preview, metadata.mediaType);
|
|
487
|
+
const onImageMouseEnter = event => {
|
|
488
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({
|
|
489
|
+
event,
|
|
490
|
+
mediaItemDetails: metadata
|
|
491
|
+
});
|
|
492
|
+
};
|
|
493
|
+
|
|
459
494
|
//----------------------------------------------------------------//
|
|
460
495
|
//---------------------- Render Card Function --------------------//
|
|
461
496
|
//----------------------------------------------------------------//
|
|
@@ -474,7 +509,6 @@ export const FileCard = ({
|
|
|
474
509
|
const nativeLazyLoad = isLazyWithOverride && !isCardVisible && preview && isSSRPreview(preview);
|
|
475
510
|
// Force Media Image to always display img for SSR
|
|
476
511
|
const forceSyncDisplay = !!ssr;
|
|
477
|
-
const mediaCardCursor = getMediaCardCursor(!!useInlinePlayer, !!shouldOpenMediaViewer, finalStatus === 'error' || finalStatus === 'failed-processing', !!preview, metadata.mediaType);
|
|
478
512
|
const card = /*#__PURE__*/React.createElement(LoadedCardView, {
|
|
479
513
|
status: cardStatusOverride || finalStatus,
|
|
480
514
|
error: finalError,
|
|
@@ -490,12 +524,7 @@ export const FileCard = ({
|
|
|
490
524
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
491
525
|
openMediaViewerButtonRef: mediaViewerButtonRef,
|
|
492
526
|
onClick: withCallbacks ? onCardViewClick : undefined,
|
|
493
|
-
onMouseEnter: withCallbacks ?
|
|
494
|
-
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({
|
|
495
|
-
event,
|
|
496
|
-
mediaItemDetails: metadata
|
|
497
|
-
});
|
|
498
|
-
} : undefined,
|
|
527
|
+
onMouseEnter: withCallbacks ? onImageMouseEnter : undefined,
|
|
499
528
|
disableOverlay: disableOverlay,
|
|
500
529
|
progress: uploadProgressRef.current,
|
|
501
530
|
onDisplayImage: withCallbacks ? () => {
|
|
@@ -517,7 +546,8 @@ export const FileCard = ({
|
|
|
517
546
|
nativeLazyLoad: nativeLazyLoad,
|
|
518
547
|
forceSyncDisplay: forceSyncDisplay,
|
|
519
548
|
mediaCardCursor: mediaCardCursor,
|
|
520
|
-
shouldHideTooltip: shouldHideTooltip
|
|
549
|
+
shouldHideTooltip: shouldHideTooltip,
|
|
550
|
+
overriddenCreationDate: overridenDate
|
|
521
551
|
});
|
|
522
552
|
return isLazyWithOverride ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
523
553
|
cardEl: cardElement,
|
|
@@ -552,7 +582,25 @@ export const FileCard = ({
|
|
|
552
582
|
testId: testId,
|
|
553
583
|
cardPreview: preview,
|
|
554
584
|
videoControlsWrapperRef: videoControlsWrapperRef
|
|
555
|
-
})) :
|
|
585
|
+
})) : shouldRenderSVG ? /*#__PURE__*/React.createElement(SvgView, {
|
|
586
|
+
testId: testId,
|
|
587
|
+
identifier: identifier,
|
|
588
|
+
status: finalStatus,
|
|
589
|
+
fileName: metadata.name,
|
|
590
|
+
cardPreview: preview,
|
|
591
|
+
alt: alt,
|
|
592
|
+
resizeMode: resizeMode,
|
|
593
|
+
dimensions: cardDimensions,
|
|
594
|
+
selected: selected,
|
|
595
|
+
onClick: onCardViewClick,
|
|
596
|
+
onMouseEnter: onImageMouseEnter,
|
|
597
|
+
progress: uploadProgressRef.current,
|
|
598
|
+
onImageError: onImageError,
|
|
599
|
+
onImageLoad: onImageLoad,
|
|
600
|
+
mediaCardCursor: mediaCardCursor,
|
|
601
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
602
|
+
openMediaViewerButtonRef: mediaViewerButtonRef
|
|
603
|
+
}) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
|
|
556
604
|
collectionName: collectionName,
|
|
557
605
|
items: mediaViewerItems || [],
|
|
558
606
|
mediaClientConfig: mediaClient.config,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const calculateSvgDimensions = (img, resizeMode) => {
|
|
2
|
+
const {
|
|
3
|
+
naturalWidth,
|
|
4
|
+
naturalHeight
|
|
5
|
+
} = img;
|
|
6
|
+
const isLadscape = naturalWidth / naturalHeight > 1;
|
|
7
|
+
return resizeMode === 'crop' ? isLadscape ? {
|
|
8
|
+
height: '100%'
|
|
9
|
+
} : {
|
|
10
|
+
width: '100%'
|
|
11
|
+
} : {};
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvgView } from './svgView';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import React, { useState, useRef } from 'react';
|
|
4
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
+
import { createAndFireMediaCardEvent } from '../../../utils/analytics';
|
|
6
|
+
import { ImageRenderer } from '../../ui/imageRenderer/imageRenderer';
|
|
7
|
+
import { ProgressBar } from '../../ui/progressBar/progressBar';
|
|
8
|
+
import { Blanket } from '../../ui/blanket/blanket';
|
|
9
|
+
import { Wrapper, ImageContainer } from '../../ui/wrapper';
|
|
10
|
+
import { fileCardImageViewSelector } from '../../classnames';
|
|
11
|
+
import { useBreakpoint } from '../../useBreakpoint';
|
|
12
|
+
import MediaSvg from '@atlaskit/media-svg';
|
|
13
|
+
import { calculateSvgDimensions } from './helpers';
|
|
14
|
+
import OpenMediaViewerButton from '../../ui/openMediaViewerButton/openMediaViewerButton';
|
|
15
|
+
export const convertResizeMode = resizeMode => {
|
|
16
|
+
switch (resizeMode) {
|
|
17
|
+
case 'crop':
|
|
18
|
+
return 'cover';
|
|
19
|
+
case 'fit':
|
|
20
|
+
case 'full-fit':
|
|
21
|
+
return 'scale-down';
|
|
22
|
+
case 'stretchy-fit':
|
|
23
|
+
return 'contain';
|
|
24
|
+
default:
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export const SvgViewBase = ({
|
|
29
|
+
identifier,
|
|
30
|
+
dimensions,
|
|
31
|
+
onClick,
|
|
32
|
+
onMouseEnter,
|
|
33
|
+
testId,
|
|
34
|
+
status,
|
|
35
|
+
selected,
|
|
36
|
+
fileName,
|
|
37
|
+
cardPreview,
|
|
38
|
+
mediaCardCursor,
|
|
39
|
+
progress,
|
|
40
|
+
alt,
|
|
41
|
+
resizeMode,
|
|
42
|
+
shouldOpenMediaViewer,
|
|
43
|
+
openMediaViewerButtonRef = null
|
|
44
|
+
}) => {
|
|
45
|
+
const [didSvgRender, setDidSvgRender] = useState(false);
|
|
46
|
+
const [didPreviewRender, setDidPreviewRender] = useState(false);
|
|
47
|
+
const [svgDimensions, setSvgDimensions] = useState();
|
|
48
|
+
const divRef = useRef(null);
|
|
49
|
+
const breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
50
|
+
const onSvgLoad = evt => {
|
|
51
|
+
setSvgDimensions(calculateSvgDimensions(evt.currentTarget, resizeMode));
|
|
52
|
+
setDidSvgRender(true);
|
|
53
|
+
};
|
|
54
|
+
const onPreviewLoad = () => {
|
|
55
|
+
setDidPreviewRender(true);
|
|
56
|
+
};
|
|
57
|
+
return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
|
|
58
|
+
fileName: fileName !== null && fileName !== void 0 ? fileName : '',
|
|
59
|
+
innerRef: openMediaViewerButtonRef,
|
|
60
|
+
onClick: onClick
|
|
61
|
+
}), jsx(Wrapper, {
|
|
62
|
+
testId: testId || 'media-card-svg-wrapper',
|
|
63
|
+
dimensions: dimensions,
|
|
64
|
+
onClick: onClick,
|
|
65
|
+
onMouseEnter: onMouseEnter,
|
|
66
|
+
innerRef: divRef,
|
|
67
|
+
mediaCardCursor: mediaCardCursor,
|
|
68
|
+
selected: !!selected,
|
|
69
|
+
breakpoint: breakpoint,
|
|
70
|
+
disableOverlay: true,
|
|
71
|
+
displayBackground: !didSvgRender && !didPreviewRender,
|
|
72
|
+
isTickBoxSelectable: false,
|
|
73
|
+
shouldDisplayTooltip: false,
|
|
74
|
+
isPlayButtonClickable: false
|
|
75
|
+
}, jsx(ImageContainer, {
|
|
76
|
+
centerElements: true,
|
|
77
|
+
testId: fileCardImageViewSelector,
|
|
78
|
+
mediaName: fileName,
|
|
79
|
+
status: status,
|
|
80
|
+
progress: progress,
|
|
81
|
+
selected: selected,
|
|
82
|
+
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
83
|
+
}, jsx(MediaSvg, {
|
|
84
|
+
testId: "media-card-svg",
|
|
85
|
+
identifier: identifier,
|
|
86
|
+
dimensions: svgDimensions,
|
|
87
|
+
onLoad: onSvgLoad,
|
|
88
|
+
style: {
|
|
89
|
+
visibility: didSvgRender ? 'visible' : 'hidden',
|
|
90
|
+
objectFit: convertResizeMode(resizeMode)
|
|
91
|
+
}
|
|
92
|
+
}), !!cardPreview && !didSvgRender && jsx(ImageRenderer, {
|
|
93
|
+
cardPreview: cardPreview,
|
|
94
|
+
onImageLoad: onPreviewLoad,
|
|
95
|
+
mediaType: 'image',
|
|
96
|
+
alt: alt,
|
|
97
|
+
resizeMode: resizeMode
|
|
98
|
+
}), status === 'uploading' && jsx(Blanket, {
|
|
99
|
+
isFixed: true
|
|
100
|
+
}), status === 'uploading' && jsx(ProgressBar, {
|
|
101
|
+
progress: progress,
|
|
102
|
+
breakpoint: breakpoint,
|
|
103
|
+
positionBottom: true
|
|
104
|
+
}))));
|
|
105
|
+
};
|
|
106
|
+
export const SvgView = withAnalyticsEvents({
|
|
107
|
+
onClick: createAndFireMediaCardEvent({
|
|
108
|
+
eventType: 'ui',
|
|
109
|
+
action: 'clicked',
|
|
110
|
+
actionSubject: 'mediaCard',
|
|
111
|
+
attributes: {}
|
|
112
|
+
})
|
|
113
|
+
})(SvgViewBase);
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "77.
|
|
40
|
+
packageName: "77.12.0",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -47,13 +47,17 @@ const ErrorBoundaryComponent = ({
|
|
|
47
47
|
userSelect: 'text'
|
|
48
48
|
})
|
|
49
49
|
};
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
return (
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
53
|
+
React.createElement("span", {
|
|
54
|
+
style: style
|
|
55
|
+
}, /*#__PURE__*/React.createElement(WarningIcon, {
|
|
56
|
+
label: "error",
|
|
57
|
+
size: "small",
|
|
58
|
+
primaryColor: `var(--ds-icon-danger, ${R300})`
|
|
59
|
+
}), message)
|
|
60
|
+
);
|
|
57
61
|
};
|
|
58
62
|
class WrappedMediaInlineAnalyticsErrorBoundary extends React.Component {
|
|
59
63
|
constructor(props) {
|
|
@@ -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 = "77.
|
|
7
|
+
const packageVersion = "77.12.0";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.
|
|
44
|
+
var packageVersion = "77.12.0";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
var _super = _createSuper(CardBase);
|
|
@@ -22,7 +22,7 @@ import { isValidPercentageUnit } from '../utils/isValidPercentageUnit';
|
|
|
22
22
|
import { getElementDimension } from '../utils/getElementDimension';
|
|
23
23
|
import { createAndFireMediaCardEvent } from '../utils/analytics';
|
|
24
24
|
import { attachDetailsToActions } from './actions';
|
|
25
|
-
import {
|
|
25
|
+
import { calcBreakpointSize } from './ui/styles';
|
|
26
26
|
import { ImageRenderer } from './ui/imageRenderer/imageRenderer';
|
|
27
27
|
import { TitleBox } from './ui/titleBox/titleBox';
|
|
28
28
|
import { FailedTitleBox } from './ui/titleBox/failedTitleBox';
|
|
@@ -34,7 +34,7 @@ import { ActionsBar } from './ui/actionsBar/actionsBar';
|
|
|
34
34
|
import { IconWrapper } from './ui/iconWrapper/iconWrapper';
|
|
35
35
|
import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUnavailable, FailedToLoad } from './ui/iconMessage';
|
|
36
36
|
import { isUploadError, isRateLimitedError, isPollingError } from '../errors';
|
|
37
|
-
import { Wrapper } from './ui/wrapper';
|
|
37
|
+
import { ImageContainer, Wrapper } from './ui/wrapper';
|
|
38
38
|
import { fileCardImageViewSelector } from './classnames';
|
|
39
39
|
import OpenMediaViewerButton from './ui/openMediaViewerButton/openMediaViewerButton';
|
|
40
40
|
/**
|
|
@@ -200,14 +200,12 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
200
200
|
var _ref3 = metadata || {},
|
|
201
201
|
name = _ref3.name;
|
|
202
202
|
var hasTitleBox = !!renderTitleBox || !!renderFailedTitleBox;
|
|
203
|
-
return jsx(React.Fragment, null, jsx(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
"data-test-progress": progress,
|
|
210
|
-
"data-test-selected": selected ? true : undefined
|
|
203
|
+
return jsx(React.Fragment, null, jsx(ImageContainer, {
|
|
204
|
+
testId: fileCardImageViewSelector,
|
|
205
|
+
mediaName: name,
|
|
206
|
+
status: status,
|
|
207
|
+
progress: progress,
|
|
208
|
+
selected: selected ? true : undefined
|
|
211
209
|
}, renderTypeIcon && _this.renderMediaTypeIcon(hasTitleBox, iconMessage), renderSpinner && _this.renderSpinner(hasTitleBox), renderImageRenderer && _this.renderImageRenderer(), renderPlayButton && _this.renderPlayButton(hasTitleBox), renderBlanket && _this.renderBlanket(!!isFixedBlanket), renderTitleBox && _this.renderTitleBox(), renderFailedTitleBox && _this.renderFailedTitleBox(customTitleMessage), renderProgressBar && _this.renderProgressBar(!hasTitleBox), renderTickBox && _this.renderTickBox()), _this.renderActionsBar());
|
|
212
210
|
});
|
|
213
211
|
return _this;
|
|
@@ -9,7 +9,9 @@ export var InlinePlayerWrapper = function InlinePlayerWrapper(props) {
|
|
|
9
9
|
innerRef = props.innerRef;
|
|
10
10
|
return jsx("div", {
|
|
11
11
|
id: "inlinePlayerWrapper",
|
|
12
|
-
"data-testid": testId
|
|
12
|
+
"data-testid": testId
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
14
|
+
,
|
|
13
15
|
className: inlinePlayerClassName,
|
|
14
16
|
css: inlinePlayerWrapperStyles({
|
|
15
17
|
selected: selected,
|
|
@@ -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 = "77.
|
|
86
|
+
var packageVersion = "77.12.0";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -4,7 +4,9 @@ import { wrapperStyles, actionsBarClassName } from './styles';
|
|
|
4
4
|
export var ActionsBarWrapper = function ActionsBarWrapper(props) {
|
|
5
5
|
return jsx("div", {
|
|
6
6
|
id: "actionsBarWrapper",
|
|
7
|
-
css: wrapperStyles(props.isFixed)
|
|
7
|
+
css: wrapperStyles(props.isFixed)
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
9
|
+
,
|
|
8
10
|
className: actionsBarClassName
|
|
9
11
|
}, props.children);
|
|
10
12
|
};
|
|
@@ -8,7 +8,9 @@ export var CardActionButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
8
8
|
id: "cardActionButton",
|
|
9
9
|
"data-testid": "media-card-primary-action",
|
|
10
10
|
"aria-label": props.label,
|
|
11
|
-
css: cardActionButtonStyles(props)
|
|
11
|
+
css: cardActionButtonStyles(props)
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
13
|
+
,
|
|
12
14
|
style: props.style,
|
|
13
15
|
onClick: props.onClick,
|
|
14
16
|
onMouseDown: props.onMouseDown,
|
|
@@ -38,7 +38,9 @@ export var CardActionIconButton = /*#__PURE__*/function (_Component) {
|
|
|
38
38
|
variant = _this$props.variant;
|
|
39
39
|
return /*#__PURE__*/React.createElement(CardActionButton, {
|
|
40
40
|
onClick: onClick,
|
|
41
|
-
onMouseDown: this.onMouseDown
|
|
41
|
+
onMouseDown: this.onMouseDown
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
43
|
+
,
|
|
42
44
|
style: {
|
|
43
45
|
color: triggerColor
|
|
44
46
|
},
|
|
@@ -72,7 +72,9 @@ export var CardActionsDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
var triggerRef = _ref.triggerRef,
|
|
73
73
|
providedProps = _objectWithoutProperties(_ref, _excluded);
|
|
74
74
|
return /*#__PURE__*/React.createElement(CardActionButtonWithAnalytics, _extends({
|
|
75
|
-
variant: triggerVariant
|
|
75
|
+
variant: triggerVariant
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
77
|
+
,
|
|
76
78
|
style: {
|
|
77
79
|
color: triggerColor
|
|
78
80
|
},
|
|
@@ -4,7 +4,9 @@ import { blanketStyles, blanketClassName } from './styles';
|
|
|
4
4
|
export var Blanket = function Blanket(props) {
|
|
5
5
|
var isFixed = props.isFixed;
|
|
6
6
|
return jsx("div", {
|
|
7
|
-
css: blanketStyles(isFixed)
|
|
7
|
+
css: blanketStyles(isFixed)
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
9
|
+
,
|
|
8
10
|
className: blanketClassName,
|
|
9
11
|
"data-testid": "media-card-blanket"
|
|
10
12
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { backgroundStyles, bkgClassName } from './styles';
|
|
4
4
|
export var PlayButtonBackground = function PlayButtonBackground() {
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
5
6
|
return jsx("div", {
|
|
6
7
|
css: backgroundStyles,
|
|
7
8
|
className: bkgClassName
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { playButtonClassName, playButtonWrapperStyles } from './styles';
|
|
4
4
|
export var PlayButtonWrapper = function PlayButtonWrapper(props) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
return (
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
7
|
+
jsx("div", {
|
|
8
|
+
css: playButtonWrapperStyles,
|
|
9
|
+
className: playButtonClassName
|
|
10
|
+
}, props.children)
|
|
11
|
+
);
|
|
9
12
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
import { borderRadius } from '@atlaskit/media-ui';
|
|
4
2
|
import { N60A } from '@atlaskit/theme/colors';
|
|
5
3
|
import { akEditorSelectedBoxShadow } from '@atlaskit/editor-shared-styles/consts';
|
|
6
4
|
import { getCSSUnitValue } from '../../utils/getCSSUnitValue';
|
|
@@ -59,15 +57,6 @@ export var getSelectableTickBoxStyles = function getSelectableTickBoxStyles(isTi
|
|
|
59
57
|
}
|
|
60
58
|
return "\n &:hover .".concat(tickBoxClassName, " {\n ").concat(tickboxFixedStyles, "\n }\n ");
|
|
61
59
|
};
|
|
62
|
-
export var cardImageContainerStyles = css({
|
|
63
|
-
display: 'flex',
|
|
64
|
-
position: 'relative',
|
|
65
|
-
maxWidth: '100%',
|
|
66
|
-
width: '100%',
|
|
67
|
-
height: '100%',
|
|
68
|
-
maxHeight: '100%',
|
|
69
|
-
overflow: 'hidden'
|
|
70
|
-
}, borderRadius);
|
|
71
60
|
var defaultTransitionDuration = '.3s';
|
|
72
61
|
export var transition = function transition() {
|
|
73
62
|
var propertyName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all';
|
|
@@ -29,7 +29,9 @@ wrapperStyles.displayName = 'TickBoxWrapper';
|
|
|
29
29
|
export var TickBoxWrapper = function TickBoxWrapper(props) {
|
|
30
30
|
return jsx("div", {
|
|
31
31
|
id: "tickBoxWrapper",
|
|
32
|
-
css: wrapperStyles(props.selected)
|
|
32
|
+
css: wrapperStyles(props.selected)
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
34
|
+
,
|
|
33
35
|
className: tickBoxClassName
|
|
34
36
|
}, props.children);
|
|
35
37
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, css } from '@emotion/react';
|
|
3
|
+
import { fileCardImageViewSelector } from '../../classnames';
|
|
4
|
+
var imageContainerStyles = css({
|
|
5
|
+
display: 'flex',
|
|
6
|
+
position: 'relative',
|
|
7
|
+
maxWidth: '100%',
|
|
8
|
+
width: '100%',
|
|
9
|
+
height: '100%',
|
|
10
|
+
maxHeight: '100%',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
borderRadius: "var(--ds-border-radius, 3px)"
|
|
13
|
+
});
|
|
14
|
+
var imageContainerCenterStyles = css({
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
alignItems: 'center'
|
|
18
|
+
});
|
|
19
|
+
export var ImageContainer = function ImageContainer(_ref) {
|
|
20
|
+
var children = _ref.children,
|
|
21
|
+
testId = _ref.testId,
|
|
22
|
+
mediaName = _ref.mediaName,
|
|
23
|
+
status = _ref.status,
|
|
24
|
+
progress = _ref.progress,
|
|
25
|
+
selected = _ref.selected,
|
|
26
|
+
source = _ref.source,
|
|
27
|
+
centerElements = _ref.centerElements;
|
|
28
|
+
return jsx("div", {
|
|
29
|
+
css: [imageContainerStyles, centerElements && imageContainerCenterStyles],
|
|
30
|
+
"data-testid": fileCardImageViewSelector
|
|
31
|
+
/**
|
|
32
|
+
* This wrapper MUST add the classname in order to allow the editor to prevent bubbling up the click event.
|
|
33
|
+
* See the method isInteractiveElement in source platform/packages/editor/renderer/src/ui/Renderer/click-to-edit.ts
|
|
34
|
+
* Also, many other consumer tests rely on this selector.
|
|
35
|
+
*/
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
37
|
+
,
|
|
38
|
+
className: fileCardImageViewSelector,
|
|
39
|
+
"data-test-media-name": mediaName,
|
|
40
|
+
"data-test-status": status,
|
|
41
|
+
"data-test-progress": progress,
|
|
42
|
+
"data-test-selected": selected,
|
|
43
|
+
"data-test-source": source
|
|
44
|
+
}, children);
|
|
45
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Wrapper } from './wrapper';
|
|
1
|
+
export { Wrapper } from './wrapper';
|
|
2
|
+
export { ImageContainer } from './imageContainer';
|
|
@@ -18,7 +18,9 @@ export var Wrapper = function Wrapper(props) {
|
|
|
18
18
|
isTickBoxSelectable = props.isTickBoxSelectable,
|
|
19
19
|
shouldDisplayTooltip = props.shouldDisplayTooltip;
|
|
20
20
|
return jsx("div", {
|
|
21
|
-
id: "newFileExperienceWrapper"
|
|
21
|
+
id: "newFileExperienceWrapper"
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
23
|
+
,
|
|
22
24
|
className: newFileExperienceClassName,
|
|
23
25
|
"data-testid": testId,
|
|
24
26
|
css: wrapperStyles({
|
|
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.
|
|
12
|
+
var packageVersion = "77.12.0";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -12,7 +12,6 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
12
12
|
import { messages } from '@atlaskit/media-ui';
|
|
13
13
|
import { createAndFireMediaCardEvent } from '../../utils/analytics';
|
|
14
14
|
import { attachDetailsToActions } from '../actions';
|
|
15
|
-
import { cardImageContainerStyles } from '../ui/styles';
|
|
16
15
|
import { ImageRenderer } from '../ui/imageRenderer/imageRenderer';
|
|
17
16
|
import { TitleBox } from '../ui/titleBox/titleBox';
|
|
18
17
|
import { FailedTitleBox } from '../ui/titleBox/failedTitleBox';
|
|
@@ -24,7 +23,7 @@ import { ActionsBar } from '../ui/actionsBar/actionsBar';
|
|
|
24
23
|
import { IconWrapper } from '../ui/iconWrapper/iconWrapper';
|
|
25
24
|
import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUnavailable, FailedToLoad } from '../ui/iconMessage';
|
|
26
25
|
import { isUploadError, isRateLimitedError, isPollingError } from '../../errors';
|
|
27
|
-
import { Wrapper } from '../ui/wrapper';
|
|
26
|
+
import { Wrapper, ImageContainer } from '../ui/wrapper';
|
|
28
27
|
import { fileCardImageViewSelector } from '../classnames';
|
|
29
28
|
import { useBreakpoint } from '../useBreakpoint';
|
|
30
29
|
import OpenMediaViewerButton from '../ui/openMediaViewerButton/openMediaViewerButton';
|
|
@@ -57,7 +56,8 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
57
56
|
disableAnimation = _ref.disableAnimation,
|
|
58
57
|
_ref$openMediaViewerB = _ref.openMediaViewerButtonRef,
|
|
59
58
|
openMediaViewerButtonRef = _ref$openMediaViewerB === void 0 ? null : _ref$openMediaViewerB,
|
|
60
|
-
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer
|
|
59
|
+
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
60
|
+
overriddenCreationDate = _ref.overriddenCreationDate;
|
|
61
61
|
var _useState = useState(false),
|
|
62
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
63
63
|
didImageRender = _useState2[0],
|
|
@@ -80,11 +80,11 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
/*
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
We render the icon & icon message always, even if there is cardPreview available.
|
|
84
|
+
If the image fails to load/render, the icon will remain, i.e. the user won't see a change until the root card decides to chage status to error.
|
|
85
|
+
If the image renders successfully, we switch this variable to hide the icon & icon message behind the thumbnail in case the image has transparency.
|
|
86
|
+
It is less likely that root component replaces a suceeded cardPreview for a failed one than the opposite case. Therefore we prefer to hide the icon instead show when the image fails, for a smoother transition
|
|
87
|
+
*/
|
|
88
88
|
setDidImageRender(true);
|
|
89
89
|
onImageLoad === null || onImageLoad === void 0 || onImageLoad(cardPreview);
|
|
90
90
|
};
|
|
@@ -200,15 +200,13 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
200
200
|
name = _ref5.name,
|
|
201
201
|
createdAt = _ref5.createdAt;
|
|
202
202
|
var actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
203
|
-
var contents = jsx(React.Fragment, null, jsx(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"data-test-selected": selected,
|
|
211
|
-
"data-test-source": cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
203
|
+
var contents = jsx(React.Fragment, null, jsx(ImageContainer, {
|
|
204
|
+
testId: fileCardImageViewSelector,
|
|
205
|
+
mediaName: name,
|
|
206
|
+
status: status,
|
|
207
|
+
progress: progress,
|
|
208
|
+
selected: selected,
|
|
209
|
+
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
212
210
|
}, renderTypeIcon && jsx(IconWrapper, {
|
|
213
211
|
breakpoint: breakpoint,
|
|
214
212
|
hasTitleBox: hasTitleBox
|
|
@@ -240,7 +238,7 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
240
238
|
isFixed: isFixedBlanket
|
|
241
239
|
}), renderTitleBox && name && jsx(TitleBox, {
|
|
242
240
|
name: name,
|
|
243
|
-
createdAt: createdAt,
|
|
241
|
+
createdAt: overriddenCreationDate !== null && overriddenCreationDate !== void 0 ? overriddenCreationDate : createdAt,
|
|
244
242
|
breakpoint: breakpoint,
|
|
245
243
|
titleBoxIcon: titleBoxIcon,
|
|
246
244
|
titleBoxBgColor: titleBoxBgColor
|