@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
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["cardPreview", "testId", "dimensions", "appearance", "metadata", "selected", "selectable", "actions", "breakpoint", "disableOverlay", "titleBoxBgColor", "titleBoxIcon", "shouldHideTooltip", "children", "onClick", "onMouseEnter", "mediaCardCursor", "customBlanket", "customTitleBox", "progressBar", "shouldOpenMediaViewer", "openMediaViewerButtonRef"];
|
|
3
|
+
var _excluded = ["cardPreview", "testId", "dimensions", "appearance", "metadata", "selected", "selectable", "actions", "breakpoint", "disableOverlay", "titleBoxBgColor", "titleBoxIcon", "shouldHideTooltip", "children", "onClick", "onMouseEnter", "mediaCardCursor", "customBlanket", "customTitleBox", "progressBar", "shouldOpenMediaViewer", "openMediaViewerButtonRef", "overriddenCreationDate"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
|
-
import { Wrapper } from '../../ui/wrapper';
|
|
8
|
+
import { ImageContainer, Wrapper } from '../../ui/wrapper';
|
|
9
9
|
import { attachDetailsToActions } from '../../actions';
|
|
10
|
-
import { cardImageContainerStyles } from '../../ui/styles';
|
|
11
10
|
import { TitleBox } from '../../ui/titleBox/titleBox';
|
|
12
11
|
import { TickBox } from '../../ui/tickBox/tickBox';
|
|
13
12
|
import { Blanket } from '../../ui/blanket/blanket';
|
|
@@ -39,6 +38,7 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
39
38
|
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
40
39
|
_ref$openMediaViewerB = _ref.openMediaViewerButtonRef,
|
|
41
40
|
openMediaViewerButtonRef = _ref$openMediaViewerB === void 0 ? null : _ref$openMediaViewerB,
|
|
41
|
+
overriddenCreationDate = _ref.overriddenCreationDate,
|
|
42
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
43
43
|
var _ref2 = metadata || {},
|
|
44
44
|
name = _ref2.name,
|
|
@@ -48,17 +48,16 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
48
48
|
var defaultBlanket = !disableOverlay && jsx(Blanket, null);
|
|
49
49
|
var defaultTitleBox = !disableOverlay && !!name && jsx(TitleBox, {
|
|
50
50
|
name: name,
|
|
51
|
-
createdAt: createdAt,
|
|
51
|
+
createdAt: overriddenCreationDate !== null && overriddenCreationDate !== void 0 ? overriddenCreationDate : createdAt,
|
|
52
52
|
breakpoint: breakpoint,
|
|
53
53
|
titleBoxIcon: titleBoxIcon,
|
|
54
54
|
titleBoxBgColor: titleBoxBgColor
|
|
55
55
|
});
|
|
56
|
-
var contents = jsx(React.Fragment, null, jsx(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"data-test-selected": selected ? true : undefined
|
|
56
|
+
var contents = jsx(React.Fragment, null, jsx(ImageContainer, _extends({
|
|
57
|
+
testId: fileCardImageViewSelector,
|
|
58
|
+
mediaName: name,
|
|
59
|
+
status: status,
|
|
60
|
+
selected: selected ? true : undefined
|
|
62
61
|
}, props), children, customBlanket ? customBlanket() : defaultBlanket, customTitleBox ? customTitleBox() : defaultTitleBox, !disableOverlay && !!selectable && jsx(TickBox, {
|
|
63
62
|
selected: selected
|
|
64
63
|
}), progressBar && progressBar()), !disableOverlay && actions && actions.length !== 0 && jsx(ActionsBar, {
|
|
@@ -42,7 +42,8 @@ export var CardViewsBase = function CardViewsBase(_ref) {
|
|
|
42
42
|
error = _ref.error,
|
|
43
43
|
disableAnimation = _ref.disableAnimation,
|
|
44
44
|
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
45
|
-
openMediaViewerButtonRef = _ref.openMediaViewerButtonRef
|
|
45
|
+
openMediaViewerButtonRef = _ref.openMediaViewerButtonRef,
|
|
46
|
+
overriddenCreationDate = _ref.overriddenCreationDate;
|
|
46
47
|
var _useState = useState(false),
|
|
47
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48
49
|
didImageRender = _useState2[0],
|
|
@@ -101,7 +102,8 @@ export var CardViewsBase = function CardViewsBase(_ref) {
|
|
|
101
102
|
mediaCardCursor: mediaCardCursor,
|
|
102
103
|
innerRef: innerRef,
|
|
103
104
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
104
|
-
openMediaViewerButtonRef: openMediaViewerButtonRef
|
|
105
|
+
openMediaViewerButtonRef: openMediaViewerButtonRef,
|
|
106
|
+
overriddenCreationDate: overriddenCreationDate
|
|
105
107
|
};
|
|
106
108
|
switch (status) {
|
|
107
109
|
case 'uploading':
|
|
@@ -29,6 +29,9 @@ import { CardViews } from './cardviews';
|
|
|
29
29
|
import { InlinePlayerLazyV2 } from './inlinePlayerLazyV2';
|
|
30
30
|
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
31
31
|
import { performanceNow } from './performance';
|
|
32
|
+
import { useContext } from 'react';
|
|
33
|
+
import { DateOverrideContext } from '../../dateOverrideContext';
|
|
34
|
+
import { SvgView } from './svgView';
|
|
32
35
|
var LoadedCardView = getBooleanFF('platform.media-experience.card-views-refactor_b91lr') ? CardViews : CardViewV2;
|
|
33
36
|
export var FileCard = function FileCard(_ref) {
|
|
34
37
|
var _ref$appearance = _ref.appearance,
|
|
@@ -103,6 +106,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
103
106
|
return prevFileState;
|
|
104
107
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
105
108
|
}, [fileState]);
|
|
109
|
+
var dateOverrides = useContext(DateOverrideContext);
|
|
110
|
+
var overridenDate = dateOverrides === null || dateOverrides === void 0 ? void 0 : dateOverrides[identifier.id];
|
|
106
111
|
|
|
107
112
|
//----------------------------------------------------------------//
|
|
108
113
|
//------------ State, Refs & Initial Values ----------------------//
|
|
@@ -136,12 +141,16 @@ export var FileCard = function FileCard(_ref) {
|
|
|
136
141
|
setIsPlayingFile = _useState8[1];
|
|
137
142
|
var _useState9 = useState(false),
|
|
138
143
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
shouldRenderSVG = _useState10[0],
|
|
145
|
+
setShouldRenderSVG = _useState10[1];
|
|
141
146
|
var _useState11 = useState(false),
|
|
142
147
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
shouldAutoplay = _useState12[0],
|
|
149
|
+
setShouldAutoplay = _useState12[1];
|
|
150
|
+
var _useState13 = useState(false),
|
|
151
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
152
|
+
previewDidRender = _useState14[0],
|
|
153
|
+
setPreviewDidRender = _useState14[1];
|
|
145
154
|
var mediaBlobUrlAttrs = useMemo(function () {
|
|
146
155
|
var id = identifier.id,
|
|
147
156
|
collection = identifier.collectionName;
|
|
@@ -177,18 +186,18 @@ export var FileCard = function FileCard(_ref) {
|
|
|
177
186
|
onImageErrorBase = _useFilePreview.onImageError,
|
|
178
187
|
onImageLoadBase = _useFilePreview.onImageLoad,
|
|
179
188
|
getSsrScriptProps = _useFilePreview.getSsrScriptProps;
|
|
180
|
-
var
|
|
181
|
-
|
|
182
|
-
error =
|
|
183
|
-
setError =
|
|
189
|
+
var _useState15 = useState(),
|
|
190
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
191
|
+
error = _useState16[0],
|
|
192
|
+
setError = _useState16[1];
|
|
184
193
|
|
|
185
194
|
// CXP-2723 TODO: TEMPORARY VARIABLES
|
|
186
195
|
var finalError = error || (previewError && previewError.primaryReason !== 'failed-processing' ? previewError : undefined);
|
|
187
196
|
var finalStatus = finalError ? 'error' : status;
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
mediaViewerSelectedItem =
|
|
191
|
-
setMediaViewerSelectedItem =
|
|
197
|
+
var _useState17 = useState(null),
|
|
198
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
199
|
+
mediaViewerSelectedItem = _useState18[0],
|
|
200
|
+
setMediaViewerSelectedItem = _useState18[1];
|
|
192
201
|
var uploadProgressRef = useRef();
|
|
193
202
|
var metadata = useMemo(function () {
|
|
194
203
|
var getProcessingStatusFromFileState = function getProcessingStatusFromFileState(status) {
|
|
@@ -426,6 +435,23 @@ export var FileCard = function FileCard(_ref) {
|
|
|
426
435
|
}
|
|
427
436
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
428
437
|
|
|
438
|
+
//----------------------------------------------------------------//
|
|
439
|
+
// Switch to SVG
|
|
440
|
+
//----------------------------------------------------------------//
|
|
441
|
+
|
|
442
|
+
useEffect(function () {
|
|
443
|
+
if (getBooleanFF('platform.media-svg-rendering') &&
|
|
444
|
+
/**
|
|
445
|
+
* We need to check that the card is visible before switching to SVG
|
|
446
|
+
* in order to avoid race conditions of the ViewportDector being unmounted before
|
|
447
|
+
* it is able to set isCardVisible to true.
|
|
448
|
+
*/
|
|
449
|
+
isCardVisible && metadata.mimeType === 'image/svg+xml' && disableOverlay // SVG won't be supported when overlay is on
|
|
450
|
+
) {
|
|
451
|
+
setShouldRenderSVG(true);
|
|
452
|
+
}
|
|
453
|
+
}, [isCardVisible, disableOverlay, metadata]);
|
|
454
|
+
|
|
429
455
|
//----------------------------------------------------------------//
|
|
430
456
|
//----------------- fireScreenEvent ------------------------------//
|
|
431
457
|
//----------------------------------------------------------------//
|
|
@@ -493,6 +519,18 @@ export var FileCard = function FileCard(_ref) {
|
|
|
493
519
|
updateFileStateRef.current();
|
|
494
520
|
}, [fileState, preview, previewStatus, updateFileStateRef]);
|
|
495
521
|
|
|
522
|
+
//----------------------------------------------------------------//
|
|
523
|
+
// Shared Card View & SVG View resources
|
|
524
|
+
//----------------------------------------------------------------//
|
|
525
|
+
|
|
526
|
+
var mediaCardCursor = getMediaCardCursor(!!useInlinePlayer, !!shouldOpenMediaViewer, finalStatus === 'error' || finalStatus === 'failed-processing', !!preview, metadata.mediaType);
|
|
527
|
+
var onImageMouseEnter = function onImageMouseEnter(event) {
|
|
528
|
+
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({
|
|
529
|
+
event: event,
|
|
530
|
+
mediaItemDetails: metadata
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
|
|
496
534
|
//----------------------------------------------------------------//
|
|
497
535
|
//---------------------- Render Card Function --------------------//
|
|
498
536
|
//----------------------------------------------------------------//
|
|
@@ -512,7 +550,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
512
550
|
var nativeLazyLoad = isLazyWithOverride && !isCardVisible && preview && isSSRPreview(preview);
|
|
513
551
|
// Force Media Image to always display img for SSR
|
|
514
552
|
var forceSyncDisplay = !!ssr;
|
|
515
|
-
var mediaCardCursor = getMediaCardCursor(!!useInlinePlayer, !!shouldOpenMediaViewer, finalStatus === 'error' || finalStatus === 'failed-processing', !!preview, metadata.mediaType);
|
|
516
553
|
var card = /*#__PURE__*/React.createElement(LoadedCardView, {
|
|
517
554
|
status: cardStatusOverride || finalStatus,
|
|
518
555
|
error: finalError,
|
|
@@ -528,12 +565,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
528
565
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
529
566
|
openMediaViewerButtonRef: mediaViewerButtonRef,
|
|
530
567
|
onClick: withCallbacks ? onCardViewClick : undefined,
|
|
531
|
-
onMouseEnter: withCallbacks ?
|
|
532
|
-
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({
|
|
533
|
-
event: event,
|
|
534
|
-
mediaItemDetails: metadata
|
|
535
|
-
});
|
|
536
|
-
} : undefined,
|
|
568
|
+
onMouseEnter: withCallbacks ? onImageMouseEnter : undefined,
|
|
537
569
|
disableOverlay: disableOverlay,
|
|
538
570
|
progress: uploadProgressRef.current,
|
|
539
571
|
onDisplayImage: withCallbacks ? function () {
|
|
@@ -554,7 +586,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
554
586
|
nativeLazyLoad: nativeLazyLoad,
|
|
555
587
|
forceSyncDisplay: forceSyncDisplay,
|
|
556
588
|
mediaCardCursor: mediaCardCursor,
|
|
557
|
-
shouldHideTooltip: shouldHideTooltip
|
|
589
|
+
shouldHideTooltip: shouldHideTooltip,
|
|
590
|
+
overriddenCreationDate: overridenDate
|
|
558
591
|
});
|
|
559
592
|
return isLazyWithOverride ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
560
593
|
cardEl: cardElement,
|
|
@@ -589,7 +622,25 @@ export var FileCard = function FileCard(_ref) {
|
|
|
589
622
|
testId: testId,
|
|
590
623
|
cardPreview: preview,
|
|
591
624
|
videoControlsWrapperRef: videoControlsWrapperRef
|
|
592
|
-
})) :
|
|
625
|
+
})) : shouldRenderSVG ? /*#__PURE__*/React.createElement(SvgView, {
|
|
626
|
+
testId: testId,
|
|
627
|
+
identifier: identifier,
|
|
628
|
+
status: finalStatus,
|
|
629
|
+
fileName: metadata.name,
|
|
630
|
+
cardPreview: preview,
|
|
631
|
+
alt: alt,
|
|
632
|
+
resizeMode: resizeMode,
|
|
633
|
+
dimensions: cardDimensions,
|
|
634
|
+
selected: selected,
|
|
635
|
+
onClick: onCardViewClick,
|
|
636
|
+
onMouseEnter: onImageMouseEnter,
|
|
637
|
+
progress: uploadProgressRef.current,
|
|
638
|
+
onImageError: onImageError,
|
|
639
|
+
onImageLoad: onImageLoad,
|
|
640
|
+
mediaCardCursor: mediaCardCursor,
|
|
641
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
642
|
+
openMediaViewerButtonRef: mediaViewerButtonRef
|
|
643
|
+
}) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
|
|
593
644
|
collectionName: collectionName,
|
|
594
645
|
items: mediaViewerItems || [],
|
|
595
646
|
mediaClientConfig: mediaClient.config,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var calculateSvgDimensions = function calculateSvgDimensions(img, resizeMode) {
|
|
2
|
+
var naturalWidth = img.naturalWidth,
|
|
3
|
+
naturalHeight = img.naturalHeight;
|
|
4
|
+
var isLadscape = naturalWidth / naturalHeight > 1;
|
|
5
|
+
return resizeMode === 'crop' ? isLadscape ? {
|
|
6
|
+
height: '100%'
|
|
7
|
+
} : {
|
|
8
|
+
width: '100%'
|
|
9
|
+
} : {};
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvgView } from './svgView';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import React, { useState, useRef } from 'react';
|
|
5
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
+
import { createAndFireMediaCardEvent } from '../../../utils/analytics';
|
|
7
|
+
import { ImageRenderer } from '../../ui/imageRenderer/imageRenderer';
|
|
8
|
+
import { ProgressBar } from '../../ui/progressBar/progressBar';
|
|
9
|
+
import { Blanket } from '../../ui/blanket/blanket';
|
|
10
|
+
import { Wrapper, ImageContainer } from '../../ui/wrapper';
|
|
11
|
+
import { fileCardImageViewSelector } from '../../classnames';
|
|
12
|
+
import { useBreakpoint } from '../../useBreakpoint';
|
|
13
|
+
import MediaSvg from '@atlaskit/media-svg';
|
|
14
|
+
import { calculateSvgDimensions } from './helpers';
|
|
15
|
+
import OpenMediaViewerButton from '../../ui/openMediaViewerButton/openMediaViewerButton';
|
|
16
|
+
export var convertResizeMode = function convertResizeMode(resizeMode) {
|
|
17
|
+
switch (resizeMode) {
|
|
18
|
+
case 'crop':
|
|
19
|
+
return 'cover';
|
|
20
|
+
case 'fit':
|
|
21
|
+
case 'full-fit':
|
|
22
|
+
return 'scale-down';
|
|
23
|
+
case 'stretchy-fit':
|
|
24
|
+
return 'contain';
|
|
25
|
+
default:
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export var SvgViewBase = function SvgViewBase(_ref) {
|
|
30
|
+
var identifier = _ref.identifier,
|
|
31
|
+
dimensions = _ref.dimensions,
|
|
32
|
+
onClick = _ref.onClick,
|
|
33
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
34
|
+
testId = _ref.testId,
|
|
35
|
+
status = _ref.status,
|
|
36
|
+
selected = _ref.selected,
|
|
37
|
+
fileName = _ref.fileName,
|
|
38
|
+
cardPreview = _ref.cardPreview,
|
|
39
|
+
mediaCardCursor = _ref.mediaCardCursor,
|
|
40
|
+
progress = _ref.progress,
|
|
41
|
+
alt = _ref.alt,
|
|
42
|
+
resizeMode = _ref.resizeMode,
|
|
43
|
+
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
44
|
+
_ref$openMediaViewerB = _ref.openMediaViewerButtonRef,
|
|
45
|
+
openMediaViewerButtonRef = _ref$openMediaViewerB === void 0 ? null : _ref$openMediaViewerB;
|
|
46
|
+
var _useState = useState(false),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
didSvgRender = _useState2[0],
|
|
49
|
+
setDidSvgRender = _useState2[1];
|
|
50
|
+
var _useState3 = useState(false),
|
|
51
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
+
didPreviewRender = _useState4[0],
|
|
53
|
+
setDidPreviewRender = _useState4[1];
|
|
54
|
+
var _useState5 = useState(),
|
|
55
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
56
|
+
svgDimensions = _useState6[0],
|
|
57
|
+
setSvgDimensions = _useState6[1];
|
|
58
|
+
var divRef = useRef(null);
|
|
59
|
+
var breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
60
|
+
var onSvgLoad = function onSvgLoad(evt) {
|
|
61
|
+
setSvgDimensions(calculateSvgDimensions(evt.currentTarget, resizeMode));
|
|
62
|
+
setDidSvgRender(true);
|
|
63
|
+
};
|
|
64
|
+
var onPreviewLoad = function onPreviewLoad() {
|
|
65
|
+
setDidPreviewRender(true);
|
|
66
|
+
};
|
|
67
|
+
return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
|
|
68
|
+
fileName: fileName !== null && fileName !== void 0 ? fileName : '',
|
|
69
|
+
innerRef: openMediaViewerButtonRef,
|
|
70
|
+
onClick: onClick
|
|
71
|
+
}), jsx(Wrapper, {
|
|
72
|
+
testId: testId || 'media-card-svg-wrapper',
|
|
73
|
+
dimensions: dimensions,
|
|
74
|
+
onClick: onClick,
|
|
75
|
+
onMouseEnter: onMouseEnter,
|
|
76
|
+
innerRef: divRef,
|
|
77
|
+
mediaCardCursor: mediaCardCursor,
|
|
78
|
+
selected: !!selected,
|
|
79
|
+
breakpoint: breakpoint,
|
|
80
|
+
disableOverlay: true,
|
|
81
|
+
displayBackground: !didSvgRender && !didPreviewRender,
|
|
82
|
+
isTickBoxSelectable: false,
|
|
83
|
+
shouldDisplayTooltip: false,
|
|
84
|
+
isPlayButtonClickable: false
|
|
85
|
+
}, jsx(ImageContainer, {
|
|
86
|
+
centerElements: true,
|
|
87
|
+
testId: fileCardImageViewSelector,
|
|
88
|
+
mediaName: fileName,
|
|
89
|
+
status: status,
|
|
90
|
+
progress: progress,
|
|
91
|
+
selected: selected,
|
|
92
|
+
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
93
|
+
}, jsx(MediaSvg, {
|
|
94
|
+
testId: "media-card-svg",
|
|
95
|
+
identifier: identifier,
|
|
96
|
+
dimensions: svgDimensions,
|
|
97
|
+
onLoad: onSvgLoad,
|
|
98
|
+
style: {
|
|
99
|
+
visibility: didSvgRender ? 'visible' : 'hidden',
|
|
100
|
+
objectFit: convertResizeMode(resizeMode)
|
|
101
|
+
}
|
|
102
|
+
}), !!cardPreview && !didSvgRender && jsx(ImageRenderer, {
|
|
103
|
+
cardPreview: cardPreview,
|
|
104
|
+
onImageLoad: onPreviewLoad,
|
|
105
|
+
mediaType: 'image',
|
|
106
|
+
alt: alt,
|
|
107
|
+
resizeMode: resizeMode
|
|
108
|
+
}), status === 'uploading' && jsx(Blanket, {
|
|
109
|
+
isFixed: true
|
|
110
|
+
}), status === 'uploading' && jsx(ProgressBar, {
|
|
111
|
+
progress: progress,
|
|
112
|
+
breakpoint: breakpoint,
|
|
113
|
+
positionBottom: true
|
|
114
|
+
}))));
|
|
115
|
+
};
|
|
116
|
+
export var SvgView = withAnalyticsEvents({
|
|
117
|
+
onClick: createAndFireMediaCardEvent({
|
|
118
|
+
eventType: 'ui',
|
|
119
|
+
action: 'clicked',
|
|
120
|
+
actionSubject: 'mediaCard',
|
|
121
|
+
attributes: {}
|
|
122
|
+
})
|
|
123
|
+
})(SvgViewBase);
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.
|
|
106
|
+
packageName: "77.12.0",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -53,13 +53,17 @@ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
|
53
53
|
}, isSelected ? _objectSpread({}, selectedStyle) : {
|
|
54
54
|
userSelect: 'text'
|
|
55
55
|
});
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
return (
|
|
57
|
+
/*#__PURE__*/
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
59
|
+
React.createElement("span", {
|
|
60
|
+
style: style
|
|
61
|
+
}, /*#__PURE__*/React.createElement(WarningIcon, {
|
|
62
|
+
label: "error",
|
|
63
|
+
size: "small",
|
|
64
|
+
primaryColor: "var(--ds-icon-danger, ".concat(R300, ")")
|
|
65
|
+
}), message)
|
|
66
|
+
);
|
|
63
67
|
};
|
|
64
68
|
var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
65
69
|
_inherits(WrappedMediaInlineAnalyticsErrorBoundary, _React$Component);
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.
|
|
10
|
+
var packageVersion = "77.12.0";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FileItem, FileDetails } from '@atlaskit/media-client';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type FileItem, type FileDetails } from '@atlaskit/media-client';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
export interface CardAction {
|
|
4
4
|
label?: string;
|
|
5
5
|
handler: CardEventHandler;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import { FileIdentifier, FileState, MediaSubscription } from '@atlaskit/media-client';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
|
-
import { CardAction } from './actions';
|
|
6
|
-
import { CardProps, CardState, CardStatus } from '../types';
|
|
2
|
+
import { type UIAnalyticsEvent, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import { type FileIdentifier, type FileState, type MediaSubscription } from '@atlaskit/media-client';
|
|
4
|
+
import { type WrappedComponentProps } from 'react-intl-next';
|
|
5
|
+
import { type CardAction } from './actions';
|
|
6
|
+
import { type CardProps, type CardState, type CardStatus } from '../types';
|
|
7
7
|
export type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps> & {
|
|
8
8
|
dateOverride?: number;
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FileAttributes, MediaTraceContext, PerformanceAttributes } from '@atlaskit/media-common';
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { SSRStatus } from '../utils/analytics';
|
|
4
|
-
import { CardStatus } from '../types';
|
|
1
|
+
import { type FileAttributes, type MediaTraceContext, type PerformanceAttributes } from '@atlaskit/media-common';
|
|
2
|
+
import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import { type SSRStatus } from '../utils/analytics';
|
|
4
|
+
import { type CardStatus } from '../types';
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
6
|
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
7
7
|
export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, traceContext: MediaTraceContext) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FileState } from '@atlaskit/media-client';
|
|
2
|
-
import { CardState } from '../types';
|
|
1
|
+
import { type FileState } from '@atlaskit/media-client';
|
|
2
|
+
import { type CardState } from '../types';
|
|
3
3
|
import { MediaCardError } from '../errors';
|
|
4
4
|
/**
|
|
5
5
|
* From docs: "Both state and props received by the updater function are guaranteed to be up-to-date.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CardWithMediaClientConfigProps } from './types';
|
|
2
|
+
import { type CardWithMediaClientConfigProps } from './types';
|
|
3
3
|
declare function CardSwitcher(props: CardWithMediaClientConfigProps): JSX.Element;
|
|
4
4
|
export default CardSwitcher;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import React, { MouseEvent } from 'react';
|
|
4
|
-
import { MessageDescriptor } from 'react-intl-next';
|
|
5
|
-
import { MediaItemType, FileDetails } from '@atlaskit/media-client';
|
|
6
|
-
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
-
import { SharedCardProps, CardStatus } from '../types';
|
|
8
|
-
import { MediaCardError } from '../errors';
|
|
9
|
-
import { CardPreview } from '../types';
|
|
10
|
-
import { MediaCardCursor } from '../types';
|
|
3
|
+
import React, { type MouseEvent } from 'react';
|
|
4
|
+
import { type MessageDescriptor } from 'react-intl-next';
|
|
5
|
+
import { type MediaItemType, type FileDetails } from '@atlaskit/media-client';
|
|
6
|
+
import { type WithAnalyticsEventsProps, type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
+
import { type SharedCardProps, type CardStatus } from '../types';
|
|
8
|
+
import { type MediaCardError } from '../errors';
|
|
9
|
+
import { type CardPreview } from '../types';
|
|
10
|
+
import { type MediaCardCursor } from '../types';
|
|
11
11
|
export interface CardViewOwnProps extends SharedCardProps {
|
|
12
12
|
readonly status: CardStatus;
|
|
13
13
|
readonly mediaItemType: MediaItemType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
2
|
-
import { ObjectURLCache } from '../../utils/objectURLCache';
|
|
3
|
-
import { CardPreview } from '../../types';
|
|
1
|
+
import { type ImageResizeMode } from '@atlaskit/media-client';
|
|
2
|
+
import { type ObjectURLCache } from '../../utils/objectURLCache';
|
|
3
|
+
import { type CardPreview } from '../../types';
|
|
4
4
|
type Mode = ImageResizeMode | undefined;
|
|
5
5
|
export declare const getCacheKey: (id: string, mode: Mode) => string;
|
|
6
6
|
export interface CardPreviewCache {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CardStatus, FilePreviewStatus } from '../../types';
|
|
2
|
-
import { FileState } from '@atlaskit/media-client';
|
|
1
|
+
import { type CardStatus, type FilePreviewStatus } from '../../types';
|
|
2
|
+
import { type FileState } from '@atlaskit/media-client';
|
|
3
3
|
export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean) => FilePreviewStatus;
|
|
4
4
|
export declare const isPreviewableStatus: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, MediaStoreGetFileImageParams, MediaType } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
-
import { CardPreview } from '../../types';
|
|
1
|
+
import { type MediaClient, type FilePreview, type MediaStoreGetFileImageParams, type MediaType } from '@atlaskit/media-client';
|
|
2
|
+
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
+
import { type CardPreview } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* This method tells the support for the media
|
|
6
6
|
* types covered in getCardPreviewFromFilePreview
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
2
|
-
import { SSR, MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
-
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
4
|
-
import { CardDimensions } from '../../types';
|
|
1
|
+
import { type MediaClient, type FilePreview, type FileState, type MediaStoreGetFileImageParams, type MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
2
|
+
import { type SSR, type MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
+
import { type ImageResizeMode } from '@atlaskit/media-client';
|
|
4
|
+
import { type CardDimensions } from '../../types';
|
|
5
5
|
import { MediaCardError } from '../../errors';
|
|
6
|
-
import { CardStatus, CardPreview } from '../../types';
|
|
6
|
+
import { type CardStatus, type CardPreview } from '../../types';
|
|
7
7
|
export { getCardPreviewFromFilePreview, getCardPreviewFromBackend, isSupportedLocalPreview, } from './helpers';
|
|
8
8
|
export { extractFilePreviewStatus } from './filePreviewStatus';
|
|
9
9
|
export declare const getCardPreviewFromCache: (id: string, mode: ImageResizeMode | undefined) => CardPreview | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileStatus } from '@atlaskit/media-client';
|
|
2
|
-
import { CardStatus, FilePreviewStatus } from '../types';
|
|
1
|
+
import { type FileStatus } from '@atlaskit/media-client';
|
|
2
|
+
import { type CardStatus, type FilePreviewStatus } from '../types';
|
|
3
3
|
export declare const isFinalCardStatus: (status: CardStatus) => boolean;
|
|
4
4
|
export declare const getCardStatus: (fileStatus: FileStatus, { isPreviewable, hasPreview }: FilePreviewStatus) => CardStatus;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import { MediaClient, FileIdentifier, FileState, MediaFileArtifacts, MediaSubscription } from '@atlaskit/media-client';
|
|
4
|
-
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
5
|
-
import { CardDimensions } from '../types';
|
|
6
|
-
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import { type MediaClient, type FileIdentifier, type FileState, type MediaFileArtifacts, type MediaSubscription } from '@atlaskit/media-client';
|
|
4
|
+
import { type NumericalCardDimensions } from '@atlaskit/media-common';
|
|
5
|
+
import { type CardDimensions } from '../types';
|
|
6
|
+
import { type WithAnalyticsEventsProps, type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
7
|
import type { CardPreview } from '../types';
|
|
8
8
|
export interface InlinePlayerOwnProps {
|
|
9
9
|
identifier: FileIdentifier;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InlinePlayerWrapperProps } from './types';
|
|
1
|
+
import { type InlinePlayerWrapperProps } from './types';
|
|
2
2
|
export declare const inlinePlayerClassName = "media-card-inline-player";
|
|
3
3
|
export declare const inlinePlayerWrapperStyles: {
|
|
4
4
|
({ dimensions, selected, }: InlinePlayerWrapperProps): import("@emotion/react").SerializedStyles;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { CardDimensions, CardOnClickCallback } from '../types';
|
|
4
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
+
import { type CardDimensions, type CardOnClickCallback } from '../types';
|
|
4
|
+
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
5
|
export type MediaCardAnalyticsErrorBoundaryProps = PropsWithChildren<{
|
|
6
6
|
dimensions?: CardDimensions;
|
|
7
7
|
data?: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { type ReactElement, type RefObject } from 'react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
import type { WithMediaClientConfigProps } from '@atlaskit/media-client-react';
|
|
4
5
|
import type { CardBaseProps } from './card';
|
|
5
|
-
import { CardDimensions } from '../types';
|
|
6
|
+
import { type CardDimensions } from '../types';
|
|
6
7
|
export type InlinePlayerWrapperProps = {
|
|
7
8
|
testId?: string;
|
|
8
9
|
dimensions?: CardDimensions;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CardActionButtonOwnProps } from './styles';
|
|
2
|
+
import { type CardActionButtonOwnProps } from './styles';
|
|
3
3
|
export declare const CardActionButton: import("react").ForwardRefExoticComponent<CardActionButtonOwnProps & import("react").RefAttributes<HTMLButtonElement>>;
|