@atlaskit/media-card 74.5.1 → 74.5.2
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 +6 -0
- package/dist/cjs/card/actions.js +0 -5
- package/dist/cjs/card/card.js +126 -260
- package/dist/cjs/card/cardAnalytics.js +0 -18
- package/dist/cjs/card/cardImageView/cardImageViewWrapper.js +7 -16
- package/dist/cjs/card/cardImageView/cardOverlay/cardOverlayComponents.js +3 -15
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +20 -52
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +1 -19
- package/dist/cjs/card/cardImageView/cardViewWrapper.js +7 -10
- package/dist/cjs/card/cardImageView/fileCardImageView.js +66 -111
- package/dist/cjs/card/cardImageView/index.js +0 -1
- package/dist/cjs/card/cardImageView/styles.js +0 -14
- package/dist/cjs/card/cardLoader.js +3 -20
- package/dist/cjs/card/cardState.js +0 -9
- package/dist/cjs/card/cardView.js +105 -198
- package/dist/cjs/card/getCardPreview/cache.js +0 -12
- package/dist/cjs/card/getCardPreview/filePreviewStatus.js +8 -16
- package/dist/cjs/card/getCardPreview/helpers.js +0 -39
- package/dist/cjs/card/getCardPreview/imageRefetchingAnalytics.js +0 -8
- package/dist/cjs/card/getCardPreview/index.js +16 -85
- package/dist/cjs/card/getCardStatus.js +5 -24
- package/dist/cjs/card/index.js +0 -2
- package/dist/cjs/card/inlinePlayer.js +19 -102
- package/dist/cjs/card/inlinePlayerLazy.js +0 -11
- package/dist/cjs/card/inlinePlayerWrapper.js +5 -8
- package/dist/cjs/card/media-card-analytics-error-boundary.js +6 -34
- package/dist/cjs/card/styles/animations.js +0 -5
- package/dist/cjs/card/styles/getSelectedBorderStyle.js +0 -4
- package/dist/cjs/card/styles/index.js +0 -14
- package/dist/cjs/card/styles/mixins.js +0 -11
- package/dist/cjs/card/styles/styles.js +4 -20
- package/dist/cjs/card/ui/actionsBar/actionsBar.js +2 -20
- package/dist/cjs/card/ui/actionsBar/actionsBarWrapper.js +1 -4
- package/dist/cjs/card/ui/actionsBar/styles.js +0 -8
- package/dist/cjs/card/ui/blanket/blanket.js +1 -4
- package/dist/cjs/card/ui/blanket/styles.js +0 -9
- package/dist/cjs/card/ui/common.js +0 -8
- package/dist/cjs/card/ui/iconMessage/iconMessageWrapper.js +2 -5
- package/dist/cjs/card/ui/iconMessage/index.js +4 -22
- package/dist/cjs/card/ui/iconMessage/styles.js +1 -10
- package/dist/cjs/card/ui/iconWrapper/iconWrapper.js +2 -5
- package/dist/cjs/card/ui/iconWrapper/styles.js +3 -11
- package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +8 -21
- package/dist/cjs/card/ui/loadingRateLimited/styles.js +1 -10
- package/dist/cjs/card/ui/newFileExperience/newFileExperienceWrapper.js +14 -19
- package/dist/cjs/card/ui/newFileExperience/styles.js +10 -26
- package/dist/cjs/card/ui/playButton/playButton.js +0 -7
- package/dist/cjs/card/ui/playButton/playButtonBackground.js +1 -4
- package/dist/cjs/card/ui/playButton/playButtonWrapper.js +1 -4
- package/dist/cjs/card/ui/playButton/styles.js +0 -6
- package/dist/cjs/card/ui/progressBar/progressBar.js +6 -14
- package/dist/cjs/card/ui/progressBar/styledBar.js +4 -7
- package/dist/cjs/card/ui/progressBar/styles.js +4 -18
- package/dist/cjs/card/ui/styles.js +12 -46
- package/dist/cjs/card/ui/tickBox/styles.js +0 -11
- package/dist/cjs/card/ui/tickBox/tickBox.js +0 -6
- package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +1 -4
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +2 -11
- package/dist/cjs/card/ui/titleBox/styles.js +4 -19
- package/dist/cjs/card/ui/titleBox/titleBox.js +9 -21
- package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +2 -14
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +6 -36
- package/dist/cjs/classnames.js +0 -1
- package/dist/cjs/errors.js +7 -66
- package/dist/cjs/index.js +0 -8
- package/dist/cjs/inline/index.js +0 -2
- package/dist/cjs/inline/loader.js +2 -43
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +4 -29
- package/dist/cjs/inline/mediaInlineCard.js +21 -57
- package/dist/cjs/types.js +0 -2
- package/dist/cjs/utils/analytics.js +0 -49
- package/dist/cjs/utils/breakpoint.js +0 -10
- package/dist/cjs/utils/cardActions/cardActionButton.js +1 -4
- package/dist/cjs/utils/cardActions/cardActionIconButton.js +7 -29
- package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +6 -35
- package/dist/cjs/utils/cardActions/cardActionsView.js +7 -34
- package/dist/cjs/utils/cardActions/index.js +0 -4
- package/dist/cjs/utils/cardActions/styles.js +0 -13
- package/dist/cjs/utils/cardDimensions.js +5 -22
- package/dist/cjs/utils/containsPixelUnit.js +0 -2
- package/dist/cjs/utils/dimensionComparer.js +0 -8
- package/dist/cjs/utils/document.js +0 -4
- package/dist/cjs/utils/errorIcon/index.js +0 -18
- package/dist/cjs/utils/errorIcon/styles.js +0 -5
- package/dist/cjs/utils/fileIcon/index.js +3 -21
- package/dist/cjs/utils/fileIcon/styles.js +0 -6
- package/dist/cjs/utils/generateUniqueId.js +0 -2
- package/dist/cjs/utils/getCSSUnitValue.js +0 -1
- package/dist/cjs/utils/getDataURIDimension.js +0 -13
- package/dist/cjs/utils/getElementDimension.js +0 -2
- package/dist/cjs/utils/getErrorMessage.js +0 -6
- package/dist/cjs/utils/getMediaCardCursor.js +1 -6
- package/dist/cjs/utils/globalScope/getSSRData.js +0 -5
- package/dist/cjs/utils/globalScope/globalScope.js +8 -25
- package/dist/cjs/utils/globalScope/index.js +0 -2
- package/dist/cjs/utils/index.js +0 -12
- package/dist/cjs/utils/isRetina.js +0 -1
- package/dist/cjs/utils/isValidPercentageUnit.js +0 -2
- package/dist/cjs/utils/lightCards/cardError.js +0 -21
- package/dist/cjs/utils/lightCards/cardLoading.js +3 -27
- package/dist/cjs/utils/lightCards/getDimensionsWithDefault.js +0 -2
- package/dist/cjs/utils/lightCards/lightCardWrappers.js +1 -9
- package/dist/cjs/utils/lightCards/styles.js +1 -13
- package/dist/cjs/utils/metadata.js +0 -7
- package/dist/cjs/utils/objectURLCache.js +0 -22
- package/dist/cjs/utils/preventClickThrough.js +0 -5
- package/dist/cjs/utils/printScript.js +0 -10
- package/dist/cjs/utils/progressBar/index.js +0 -17
- package/dist/cjs/utils/progressBar/styles.js +0 -6
- package/dist/cjs/utils/resizeModeToMediaImageProps.js +0 -1
- package/dist/cjs/utils/shouldDisplayImageThumbnail.js +0 -5
- package/dist/cjs/utils/ufoExperiences.js +1 -21
- package/dist/cjs/utils/videoSnapshot.js +2 -11
- package/dist/cjs/utils/viewportDetector.js +5 -24
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/actions.js +2 -1
- package/dist/es2019/card/card.js +26 -121
- package/dist/es2019/card/cardAnalytics.js +0 -5
- package/dist/es2019/card/cardImageView/cardOverlay/index.js +2 -16
- package/dist/es2019/card/cardImageView/cardOverlay/styles.js +1 -2
- package/dist/es2019/card/cardImageView/fileCardImageView.js +3 -36
- package/dist/es2019/card/cardImageView/styles.js +0 -3
- package/dist/es2019/card/cardLoader.js +3 -14
- package/dist/es2019/card/cardState.js +1 -2
- package/dist/es2019/card/cardView.js +24 -68
- package/dist/es2019/card/getCardPreview/cache.js +0 -4
- package/dist/es2019/card/getCardPreview/filePreviewStatus.js +8 -5
- package/dist/es2019/card/getCardPreview/helpers.js +0 -9
- package/dist/es2019/card/getCardPreview/imageRefetchingAnalytics.js +0 -3
- package/dist/es2019/card/getCardPreview/index.js +16 -30
- package/dist/es2019/card/getCardStatus.js +2 -15
- package/dist/es2019/card/inlinePlayer.js +2 -35
- package/dist/es2019/card/inlinePlayerLazy.js +1 -2
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -15
- package/dist/es2019/card/styles/getSelectedBorderStyle.js +1 -1
- package/dist/es2019/card/styles/styles.js +0 -3
- package/dist/es2019/card/ui/actionsBar/actionsBar.js +0 -3
- package/dist/es2019/card/ui/common.js +0 -2
- package/dist/es2019/card/ui/iconMessage/styles.js +0 -2
- package/dist/es2019/card/ui/iconWrapper/styles.js +2 -2
- package/dist/es2019/card/ui/imageRenderer/imageRenderer.js +0 -3
- package/dist/es2019/card/ui/progressBar/styles.js +1 -3
- package/dist/es2019/card/ui/styles.js +3 -4
- package/dist/es2019/card/ui/titleBox/styles.js +2 -3
- package/dist/es2019/card/ui/unhandledErrorCard/index.js +0 -8
- package/dist/es2019/errors.js +8 -17
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/inline/loader.js +1 -18
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -12
- package/dist/es2019/inline/mediaInlineCard.js +0 -15
- package/dist/es2019/types.js +1 -1
- package/dist/es2019/utils/analytics.js +0 -3
- package/dist/es2019/utils/breakpoint.js +0 -4
- package/dist/es2019/utils/cardActions/cardActionIconButton.js +3 -5
- package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +0 -5
- package/dist/es2019/utils/cardActions/cardActionsView.js +0 -10
- package/dist/es2019/utils/cardActions/styles.js +0 -3
- package/dist/es2019/utils/cardDimensions.js +7 -14
- package/dist/es2019/utils/dimensionComparer.js +0 -3
- package/dist/es2019/utils/document.js +0 -2
- package/dist/es2019/utils/errorIcon/index.js +0 -3
- package/dist/es2019/utils/fileIcon/index.js +0 -1
- package/dist/es2019/utils/getDataURIDimension.js +0 -4
- package/dist/es2019/utils/getMediaCardCursor.js +1 -4
- package/dist/es2019/utils/globalScope/getSSRData.js +0 -2
- package/dist/es2019/utils/globalScope/globalScope.js +3 -10
- package/dist/es2019/utils/lightCards/cardError.js +0 -3
- package/dist/es2019/utils/lightCards/cardLoading.js +0 -3
- package/dist/es2019/utils/lightCards/lightCardWrappers.js +0 -1
- package/dist/es2019/utils/metadata.js +0 -5
- package/dist/es2019/utils/objectURLCache.js +0 -10
- package/dist/es2019/utils/printScript.js +0 -3
- package/dist/es2019/utils/progressBar/index.js +0 -2
- package/dist/es2019/utils/shouldDisplayImageThumbnail.js +0 -2
- package/dist/es2019/utils/ufoExperiences.js +5 -10
- package/dist/es2019/utils/videoSnapshot.js +2 -4
- package/dist/es2019/utils/viewportDetector.js +0 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/actions.js +0 -3
- package/dist/esm/card/card.js +126 -254
- package/dist/esm/card/cardAnalytics.js +0 -6
- package/dist/esm/card/cardImageView/cardImageViewWrapper.js +6 -6
- package/dist/esm/card/cardImageView/cardOverlay/cardOverlayComponents.js +2 -2
- package/dist/esm/card/cardImageView/cardOverlay/index.js +22 -37
- package/dist/esm/card/cardImageView/cardOverlay/styles.js +2 -6
- package/dist/esm/card/cardImageView/cardViewWrapper.js +6 -6
- package/dist/esm/card/cardImageView/fileCardImageView.js +66 -104
- package/dist/esm/card/cardImageView/styles.js +0 -5
- package/dist/esm/card/cardLoader.js +6 -17
- package/dist/esm/card/cardState.js +1 -2
- package/dist/esm/card/cardView.js +105 -171
- package/dist/esm/card/getCardPreview/cache.js +0 -7
- package/dist/esm/card/getCardPreview/filePreviewStatus.js +11 -11
- package/dist/esm/card/getCardPreview/helpers.js +0 -28
- package/dist/esm/card/getCardPreview/imageRefetchingAnalytics.js +0 -3
- package/dist/esm/card/getCardPreview/index.js +16 -53
- package/dist/esm/card/getCardStatus.js +5 -20
- package/dist/esm/card/inlinePlayer.js +19 -85
- package/dist/esm/card/inlinePlayerLazy.js +1 -5
- package/dist/esm/card/inlinePlayerWrapper.js +4 -4
- package/dist/esm/card/media-card-analytics-error-boundary.js +6 -28
- package/dist/esm/card/styles/animations.js +0 -2
- package/dist/esm/card/styles/getSelectedBorderStyle.js +1 -1
- package/dist/esm/card/styles/index.js +0 -2
- package/dist/esm/card/styles/styles.js +4 -9
- package/dist/esm/card/ui/actionsBar/actionsBar.js +2 -12
- package/dist/esm/card/ui/actionsBar/styles.js +0 -2
- package/dist/esm/card/ui/blanket/styles.js +0 -2
- package/dist/esm/card/ui/common.js +0 -4
- package/dist/esm/card/ui/iconMessage/iconMessageWrapper.js +1 -1
- package/dist/esm/card/ui/iconMessage/index.js +4 -4
- package/dist/esm/card/ui/iconMessage/styles.js +1 -5
- package/dist/esm/card/ui/iconWrapper/iconWrapper.js +1 -1
- package/dist/esm/card/ui/iconWrapper/styles.js +3 -5
- package/dist/esm/card/ui/imageRenderer/imageRenderer.js +8 -11
- package/dist/esm/card/ui/loadingRateLimited/styles.js +1 -3
- package/dist/esm/card/ui/newFileExperience/newFileExperienceWrapper.js +13 -13
- package/dist/esm/card/ui/newFileExperience/styles.js +10 -12
- package/dist/esm/card/ui/playButton/styles.js +0 -2
- package/dist/esm/card/ui/progressBar/progressBar.js +6 -6
- package/dist/esm/card/ui/progressBar/styledBar.js +3 -3
- package/dist/esm/card/ui/progressBar/styles.js +4 -8
- package/dist/esm/card/ui/styles.js +12 -20
- package/dist/esm/card/ui/tickBox/styles.js +0 -2
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +2 -2
- package/dist/esm/card/ui/titleBox/styles.js +4 -7
- package/dist/esm/card/ui/titleBox/titleBox.js +9 -11
- package/dist/esm/card/ui/titleBox/titleBoxComponents.js +1 -1
- package/dist/esm/card/ui/unhandledErrorCard/index.js +6 -24
- package/dist/esm/errors.js +8 -40
- package/dist/esm/index.js +1 -0
- package/dist/esm/inline/loader.js +3 -40
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +4 -23
- package/dist/esm/inline/mediaInlineCard.js +21 -40
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils/analytics.js +0 -6
- package/dist/esm/utils/breakpoint.js +0 -5
- package/dist/esm/utils/cardActions/cardActionIconButton.js +7 -18
- package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +6 -19
- package/dist/esm/utils/cardActions/cardActionsView.js +7 -22
- package/dist/esm/utils/cardActions/styles.js +0 -5
- package/dist/esm/utils/cardDimensions.js +7 -14
- package/dist/esm/utils/dimensionComparer.js +0 -3
- package/dist/esm/utils/document.js +0 -2
- package/dist/esm/utils/errorIcon/index.js +0 -9
- package/dist/esm/utils/errorIcon/styles.js +0 -2
- package/dist/esm/utils/fileIcon/index.js +3 -11
- package/dist/esm/utils/fileIcon/styles.js +0 -2
- package/dist/esm/utils/getDataURIDimension.js +0 -4
- package/dist/esm/utils/getMediaCardCursor.js +1 -4
- package/dist/esm/utils/globalScope/getSSRData.js +0 -2
- package/dist/esm/utils/globalScope/globalScope.js +8 -15
- package/dist/esm/utils/lightCards/cardError.js +0 -9
- package/dist/esm/utils/lightCards/cardLoading.js +3 -13
- package/dist/esm/utils/lightCards/lightCardWrappers.js +0 -1
- package/dist/esm/utils/lightCards/styles.js +1 -3
- package/dist/esm/utils/metadata.js +0 -5
- package/dist/esm/utils/objectURLCache.js +0 -15
- package/dist/esm/utils/printScript.js +0 -5
- package/dist/esm/utils/progressBar/index.js +0 -9
- package/dist/esm/utils/progressBar/styles.js +0 -2
- package/dist/esm/utils/shouldDisplayImageThumbnail.js +0 -2
- package/dist/esm/utils/ufoExperiences.js +1 -12
- package/dist/esm/utils/videoSnapshot.js +2 -6
- package/dist/esm/utils/viewportDetector.js +5 -16
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { jsx } from '@emotion/react';
|
|
|
3
3
|
import { iconWrapperStyles } from './styles';
|
|
4
4
|
export var IconWrapper = function IconWrapper(props) {
|
|
5
5
|
var breakpoint = props.breakpoint,
|
|
6
|
-
|
|
6
|
+
hasTitleBox = props.hasTitleBox;
|
|
7
7
|
return jsx("div", {
|
|
8
8
|
id: "iconWrapper",
|
|
9
9
|
css: iconWrapperStyles({
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { getTitleBoxHeight } from '../common';
|
|
7
5
|
export function titleBoxHeight(hasTitleBox, breakpoint) {
|
|
8
6
|
// there is no titlebox
|
|
9
7
|
if (!hasTitleBox) {
|
|
10
8
|
return "0px";
|
|
11
|
-
}
|
|
12
|
-
|
|
9
|
+
}
|
|
13
10
|
|
|
11
|
+
// calculate height of the titlebox
|
|
14
12
|
var marginBottom = getTitleBoxHeight(breakpoint);
|
|
15
13
|
return "".concat(marginBottom, "px");
|
|
16
14
|
}
|
|
17
15
|
export var iconWrapperStyles = function iconWrapperStyles(_ref) {
|
|
18
16
|
var hasTitleBox = _ref.hasTitleBox,
|
|
19
|
-
|
|
17
|
+
breakpoint = _ref.breakpoint;
|
|
20
18
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n width: 100%;\n height: calc(100% - ", ");\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])), titleBoxHeight(hasTitleBox, breakpoint));
|
|
21
19
|
};
|
|
22
20
|
iconWrapperStyles.displayName = 'MediaIconWrapper';
|
|
@@ -4,29 +4,26 @@ import { MediaImage } from '@atlaskit/media-ui';
|
|
|
4
4
|
import { resizeModeToMediaImageProps } from '../../../utils/resizeModeToMediaImageProps';
|
|
5
5
|
export var ImageRenderer = function ImageRenderer(_ref) {
|
|
6
6
|
var cardPreview = _ref.cardPreview,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
alt = _ref.alt,
|
|
8
|
+
resizeMode = _ref.resizeMode,
|
|
9
|
+
onImageLoad = _ref.onImageLoad,
|
|
10
|
+
onImageError = _ref.onImageError,
|
|
11
|
+
onDisplayImage = _ref.onDisplayImage,
|
|
12
|
+
mediaType = _ref.mediaType,
|
|
13
|
+
nativeLazyLoad = _ref.nativeLazyLoad,
|
|
14
|
+
forceSyncDisplay = _ref.forceSyncDisplay;
|
|
15
15
|
useEffect(function () {
|
|
16
16
|
// TODO: trigger accordingly with the succeeded event. This could be a breaking change
|
|
17
17
|
if (mediaType === 'image' && onDisplayImage) {
|
|
18
18
|
onDisplayImage();
|
|
19
19
|
}
|
|
20
20
|
}, [mediaType, onDisplayImage]);
|
|
21
|
-
|
|
22
21
|
var onLoad = function onLoad() {
|
|
23
22
|
onImageLoad && onImageLoad(cardPreview);
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
var onError = function onError() {
|
|
27
25
|
onImageError && onImageError(cardPreview);
|
|
28
26
|
};
|
|
29
|
-
|
|
30
27
|
return /*#__PURE__*/React.createElement(MediaImage, _extends({
|
|
31
28
|
dataURI: cardPreview.dataURI,
|
|
32
29
|
alt: alt,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { generateResponsiveStyles } from '../progressBar/styles';
|
|
7
5
|
import { N300 } from '@atlaskit/theme/colors';
|
|
@@ -9,7 +7,7 @@ export var loadingRateLimitedContainerStyles = css(_templateObject || (_template
|
|
|
9
7
|
export var warningIconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n justify-content: center;\n display: flex;\n /* Required to allow end users to select text in the error message */\n cursor: auto;\n user-select: text;\n > svg {\n width: 45px;\n }\n"])));
|
|
10
8
|
export var loadingRateLimitedTextWrapperStyles = function loadingRateLimitedTextWrapperStyles(_ref) {
|
|
11
9
|
var breakpoint = _ref.breakpoint,
|
|
12
|
-
|
|
10
|
+
positionBottom = _ref.positionBottom;
|
|
13
11
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: 10px;\n overflow: hidden;\n color: ", ";\n display: block;\n width: 100%;\n text-align: center;\n ", "\n"])), "var(--ds-text-subtlest, ".concat(N300, ")"), generateResponsiveStyles(breakpoint, positionBottom, false, 1));
|
|
14
12
|
};
|
|
15
13
|
loadingRateLimitedTextWrapperStyles.displayName = 'LoadingRateLimitedTextWrapper';
|
|
@@ -5,19 +5,19 @@ import { newFileExperienceWrapperStyles } from './styles';
|
|
|
5
5
|
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
6
|
export var NewFileExperienceWrapper = function NewFileExperienceWrapper(props) {
|
|
7
7
|
var testId = props.testId,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
dimensions = props.dimensions,
|
|
9
|
+
appearance = props.appearance,
|
|
10
|
+
onClick = props.onClick,
|
|
11
|
+
onMouseEnter = props.onMouseEnter,
|
|
12
|
+
innerRef = props.innerRef,
|
|
13
|
+
breakpoint = props.breakpoint,
|
|
14
|
+
mediaCardCursor = props.mediaCardCursor,
|
|
15
|
+
disableOverlay = props.disableOverlay,
|
|
16
|
+
selected = props.selected,
|
|
17
|
+
displayBackground = props.displayBackground,
|
|
18
|
+
isPlayButtonClickable = props.isPlayButtonClickable,
|
|
19
|
+
isTickBoxSelectable = props.isTickBoxSelectable,
|
|
20
|
+
shouldDisplayTooltip = props.shouldDisplayTooltip;
|
|
21
21
|
var theme = useGlobalTheme();
|
|
22
22
|
return jsx("div", {
|
|
23
23
|
id: "newFileExperienceWrapper",
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { fontFamily } from '@atlaskit/theme/constants';
|
|
7
5
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
@@ -15,16 +13,16 @@ import { generateResponsiveStyles, getClickablePlayButtonStyles, getCursorStyle,
|
|
|
15
13
|
var BACKGROUND_COLOR_DARK = '#22272C';
|
|
16
14
|
export var newFileExperienceWrapperStyles = function newFileExperienceWrapperStyles(_ref) {
|
|
17
15
|
var breakpoint = _ref.breakpoint,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
dimensions = _ref.dimensions,
|
|
17
|
+
appearance = _ref.appearance,
|
|
18
|
+
disableOverlay = _ref.disableOverlay,
|
|
19
|
+
displayBackground = _ref.displayBackground,
|
|
20
|
+
selected = _ref.selected,
|
|
21
|
+
isPlayButtonClickable = _ref.isPlayButtonClickable,
|
|
22
|
+
isTickBoxSelectable = _ref.isTickBoxSelectable,
|
|
23
|
+
shouldDisplayTooltip = _ref.shouldDisplayTooltip,
|
|
24
|
+
mediaCardCursor = _ref.mediaCardCursor,
|
|
25
|
+
theme = _ref.theme;
|
|
28
26
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground && "background: ".concat(themed({
|
|
29
27
|
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
30
28
|
dark: "var(--ds-background-neutral, ".concat(BACKGROUND_COLOR_DARK, ")")
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { N0, N90A } from '@atlaskit/theme/colors';
|
|
7
5
|
export var playButtonClassName = 'media-card-play-button';
|
|
@@ -6,12 +6,12 @@ export var getNormalizedProgress = function getNormalizedProgress(progress) {
|
|
|
6
6
|
};
|
|
7
7
|
export var ProgressBar = function ProgressBar(_ref) {
|
|
8
8
|
var progress = _ref.progress,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
_ref$breakpoint = _ref.breakpoint,
|
|
10
|
+
breakpoint = _ref$breakpoint === void 0 ? Breakpoint.SMALL : _ref$breakpoint,
|
|
11
|
+
_ref$positionBottom = _ref.positionBottom,
|
|
12
|
+
positionBottom = _ref$positionBottom === void 0 ? false : _ref$positionBottom,
|
|
13
|
+
_ref$showOnTop = _ref.showOnTop,
|
|
14
|
+
showOnTop = _ref$showOnTop === void 0 ? false : _ref$showOnTop;
|
|
15
15
|
return /*#__PURE__*/React.createElement(StyledBar, {
|
|
16
16
|
progress: getNormalizedProgress(progress),
|
|
17
17
|
breakpoint: breakpoint,
|
|
@@ -3,9 +3,9 @@ import { jsx } from '@emotion/react';
|
|
|
3
3
|
import { styledBarStyles } from './styles';
|
|
4
4
|
export var StyledBar = function StyledBar(props) {
|
|
5
5
|
var progress = props.progress,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
breakpoint = props.breakpoint,
|
|
7
|
+
positionBottom = props.positionBottom,
|
|
8
|
+
showOnTop = props.showOnTop;
|
|
9
9
|
return jsx("div", {
|
|
10
10
|
id: "styledBar",
|
|
11
11
|
css: styledBarStyles({
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
7
5
|
import { rgba } from '../../styles/mixins';
|
|
@@ -10,7 +8,6 @@ import { Breakpoint, getTitleBoxHeight, responsiveSettings } from '../common';
|
|
|
10
8
|
var height = 3;
|
|
11
9
|
var padding = 1;
|
|
12
10
|
var width = 95; // %
|
|
13
|
-
|
|
14
11
|
var left = (100 - width) / 2; // %
|
|
15
12
|
|
|
16
13
|
var smallSizeSettings = {
|
|
@@ -26,18 +23,17 @@ export function generateResponsiveStyles(breakpoint, positionBottom, showOnTop)
|
|
|
26
23
|
var marginBottom = setting.marginBottom * multiplier + (positionBottom ? marginPositionBottom : getTitleBoxHeight(breakpoint));
|
|
27
24
|
return "\n ".concat(showOnTop ? 'top' : 'bottom', ": ").concat(marginBottom, "px\n ");
|
|
28
25
|
}
|
|
29
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
30
26
|
|
|
27
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
31
28
|
var getStyledBarStylesBasedOnProps = function getStyledBarStylesBasedOnProps(_ref) {
|
|
32
29
|
var progress = _ref.progress,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
breakpoint = _ref.breakpoint,
|
|
31
|
+
positionBottom = _ref.positionBottom,
|
|
32
|
+
showOnTop = _ref.showOnTop;
|
|
36
33
|
return "\n".concat(borderRadius, "\noverflow: hidden;\nposition: absolute;\nwidth: ").concat(width, "%;\nleft: ").concat(left, "%;\nbackground-color: ").concat(rgba(N0, 0.8), ";\nheight: ").concat(height + padding * 2, "px;\npadding: ").concat(padding, "px;\nbox-sizing: border-box;\n\n::before {\n content: '';\n width: ").concat(progress, "%;\n height: 100%;\n background-color: #44546F;\n ").concat(borderRadius, "\n display: block;\n}\n").concat(generateResponsiveStyles(breakpoint, positionBottom, showOnTop), "\n");
|
|
37
34
|
};
|
|
38
35
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
39
36
|
|
|
40
|
-
|
|
41
37
|
export var styledBarStyles = function styledBarStyles(props) {
|
|
42
38
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n "])), getStyledBarStylesBasedOnProps(props));
|
|
43
39
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
3
|
var _templateObject;
|
|
5
|
-
|
|
6
4
|
import { css } from '@emotion/react';
|
|
7
5
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
8
6
|
import { N60A } from '@atlaskit/theme/colors';
|
|
@@ -15,17 +13,14 @@ import { Breakpoint, responsiveSettings } from './common';
|
|
|
15
13
|
var breakpointSizes = [[Breakpoint.SMALL, 599], [Breakpoint.LARGE, Infinity]];
|
|
16
14
|
export var calcBreakpointSize = function calcBreakpointSize() {
|
|
17
15
|
var wrapperWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
18
|
-
|
|
19
16
|
var _ref = breakpointSizes.find(function (_ref3) {
|
|
20
|
-
|
|
17
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
21
18
|
_breakpoint = _ref4[0],
|
|
22
19
|
limit = _ref4[1];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
breakpoint = _ref2[0];
|
|
28
|
-
|
|
20
|
+
return wrapperWidth <= limit;
|
|
21
|
+
}) || [Breakpoint.SMALL],
|
|
22
|
+
_ref2 = _slicedToArray(_ref, 1),
|
|
23
|
+
breakpoint = _ref2[0];
|
|
29
24
|
return breakpoint;
|
|
30
25
|
};
|
|
31
26
|
export var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
@@ -35,17 +30,16 @@ export var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
|
35
30
|
};
|
|
36
31
|
export var getWrapperDimensions = function getWrapperDimensions(dimensions, appearance) {
|
|
37
32
|
var _ref5 = dimensions || {},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
width = _ref5.width,
|
|
34
|
+
height = _ref5.height;
|
|
41
35
|
var _getDefaultCardDimens = getDefaultCardDimensions(appearance),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
defaultWidth = _getDefaultCardDimens.width,
|
|
37
|
+
defaultHeight = _getDefaultCardDimens.height;
|
|
45
38
|
return "\n width: ".concat(getCSSUnitValue(width || defaultWidth), ";\n max-width: 100%;\n height: ").concat(getCSSUnitValue(height || defaultHeight), ";\n max-height: 100%;\n ");
|
|
46
|
-
};
|
|
47
|
-
// CSS outline has no 'radius', therefore we can't achieve the same effect with it
|
|
39
|
+
};
|
|
48
40
|
|
|
41
|
+
// This is a trick to simulate the blue border without affecting the dimensions.
|
|
42
|
+
// CSS outline has no 'radius', therefore we can't achieve the same effect with it
|
|
49
43
|
export var getWrapperShadow = function getWrapperShadow(disableOverlay, selected) {
|
|
50
44
|
var withOverlayShadow = !disableOverlay ? "".concat("var(--ds-shadow-raised, ".concat("0 1px 1px ".concat(N60A, ", 0 0 1px 0 ").concat(N60A), ")")) : '';
|
|
51
45
|
var selectedShadow = selected ? akEditorSelectedBoxShadow : '';
|
|
@@ -59,14 +53,12 @@ export var getClickablePlayButtonStyles = function getClickablePlayButtonStyles(
|
|
|
59
53
|
if (!isPlayButtonClickable) {
|
|
60
54
|
return '';
|
|
61
55
|
}
|
|
62
|
-
|
|
63
56
|
return "\n &:hover .".concat(playButtonClassName, " {\n ").concat(fixedPlayButtonStyles, "\n }\n ");
|
|
64
57
|
};
|
|
65
58
|
export var getSelectableTickBoxStyles = function getSelectableTickBoxStyles(isTickBoxSelectable) {
|
|
66
59
|
if (!isTickBoxSelectable) {
|
|
67
60
|
return '';
|
|
68
61
|
}
|
|
69
|
-
|
|
70
62
|
return "\n &:hover .".concat(tickBoxClassName, " {\n ").concat(tickboxFixedStyles, "\n }\n ");
|
|
71
63
|
};
|
|
72
64
|
export var cardImageContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n max-width: 100%;\n width: 100%;\n height: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"])), borderRadius);
|
|
@@ -6,8 +6,8 @@ import { R300 } from '@atlaskit/theme/colors';
|
|
|
6
6
|
import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
|
|
7
7
|
export var FailedTitleBox = function FailedTitleBox(_ref) {
|
|
8
8
|
var breakpoint = _ref.breakpoint,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
_ref$customMessage = _ref.customMessage,
|
|
10
|
+
customMessage = _ref$customMessage === void 0 ? messages.failed_to_load : _ref$customMessage;
|
|
11
11
|
return /*#__PURE__*/React.createElement(TitleBoxWrapper, {
|
|
12
12
|
breakpoint: breakpoint
|
|
13
13
|
}, /*#__PURE__*/React.createElement(ErrorMessageWrapper, null, /*#__PURE__*/React.createElement(EditorWarningIcon, {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { responsiveSettings, getTitleBoxHeight, Breakpoint } from '../common';
|
|
7
5
|
import { N0, N800 } from '@atlaskit/theme/colors';
|
|
8
6
|
import { rgba } from '../../styles/mixins';
|
|
9
7
|
import { themed } from '@atlaskit/theme/components';
|
|
10
|
-
|
|
11
8
|
var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
12
9
|
var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Breakpoint.SMALL;
|
|
13
10
|
var setting = responsiveSettings[breakpoint];
|
|
@@ -16,17 +13,17 @@ var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
|
16
13
|
var height = getTitleBoxHeight(breakpoint);
|
|
17
14
|
return "height: ".concat(height, "px;\n padding: ").concat(verticalPadding, "px ").concat(horizontalPadding, "px;");
|
|
18
15
|
};
|
|
19
|
-
|
|
20
16
|
var HEX_REGEX = /^#[0-9A-F]{6}$/i;
|
|
21
17
|
var BACKGROUND_COLOR_DARK = '#161a1d';
|
|
22
18
|
var TEXT_COLOR_DARK = '#C7D1DB';
|
|
23
19
|
export var titleBoxWrapperStyles = function titleBoxWrapperStyles(_ref) {
|
|
24
20
|
var breakpoint = _ref.breakpoint,
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
22
|
+
theme = _ref.theme;
|
|
27
23
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: ", ";\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), themed({
|
|
28
24
|
light: "var(--ds-surface, ".concat(rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 1), ")"),
|
|
29
|
-
dark: "var(--ds-surface, ".concat(rgba(
|
|
25
|
+
dark: "var(--ds-surface, ".concat(rgba(
|
|
26
|
+
// theme does not contain this color, use constant instead
|
|
30
27
|
titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : BACKGROUND_COLOR_DARK, 1), ")")
|
|
31
28
|
})({
|
|
32
29
|
theme: theme
|
|
@@ -6,22 +6,20 @@ import { formatDate } from '@atlaskit/media-ui/formatDate';
|
|
|
6
6
|
import { TitleBoxWrapper, TitleBoxFooter, TitleBoxHeader, TitleBoxIcon } from './titleBoxComponents';
|
|
7
7
|
export var FormattedDate = injectIntl(function (_ref) {
|
|
8
8
|
var timestamp = _ref.timestamp,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
intl = _ref.intl;
|
|
11
10
|
var _ref2 = intl || {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
locale: 'en'
|
|
12
|
+
},
|
|
13
|
+
_ref2$locale = _ref2.locale,
|
|
14
|
+
locale = _ref2$locale === void 0 ? 'en' : _ref2$locale;
|
|
17
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, formatDate(timestamp, locale));
|
|
18
16
|
});
|
|
19
17
|
export var TitleBox = function TitleBox(_ref3) {
|
|
20
18
|
var name = _ref3.name,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
createdAt = _ref3.createdAt,
|
|
20
|
+
breakpoint = _ref3.breakpoint,
|
|
21
|
+
titleBoxBgColor = _ref3.titleBoxBgColor,
|
|
22
|
+
titleBoxIcon = _ref3.titleBoxIcon;
|
|
25
23
|
return /*#__PURE__*/React.createElement(TitleBoxWrapper, {
|
|
26
24
|
breakpoint: breakpoint,
|
|
27
25
|
titleBoxBgColor: titleBoxBgColor
|
|
@@ -4,7 +4,7 @@ import { errorMessageWrapperStyles, titleBoxFooterStyles, titleBoxHeaderStyles,
|
|
|
4
4
|
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
5
|
export var TitleBoxWrapper = function TitleBoxWrapper(props) {
|
|
6
6
|
var breakpoint = props.breakpoint,
|
|
7
|
-
|
|
7
|
+
titleBoxBgColor = props.titleBoxBgColor;
|
|
8
8
|
var theme = useGlobalTheme();
|
|
9
9
|
return jsx("div", {
|
|
10
10
|
id: "titleBoxWrapper",
|
|
@@ -4,13 +4,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
7
|
-
|
|
8
7
|
var _templateObject;
|
|
9
|
-
|
|
10
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
10
|
/** @jsx jsx */
|
|
15
11
|
import { Component } from 'react';
|
|
16
12
|
import { css, jsx } from '@emotion/react';
|
|
@@ -19,65 +15,52 @@ import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
|
19
15
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
20
16
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
21
17
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
22
|
-
|
|
23
18
|
var isPercentage = function isPercentage(value) {
|
|
24
19
|
return /^\d+(\.\d+)?%$/.test(value);
|
|
25
20
|
};
|
|
26
|
-
|
|
27
21
|
var shouldShowText = function shouldShowText(_ref) {
|
|
28
22
|
var width = _ref.width,
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
height = _ref.height;
|
|
31
24
|
if (isPercentage(width) || isPercentage(height)) {
|
|
32
25
|
return false;
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
return parseInt(width, 10) >= 240 && parseInt(height, 10) >= 90;
|
|
36
28
|
};
|
|
37
|
-
|
|
38
29
|
var normalizeDimension = function normalizeDimension(value, defaultValue) {
|
|
39
30
|
var sValue = value.toString();
|
|
40
31
|
return isPercentage(sValue) ? sValue : isNaN(parseInt(sValue, 10)) ? defaultValue + 'px' : parseInt(sValue, 10) + 'px';
|
|
41
32
|
};
|
|
42
|
-
|
|
43
33
|
var getConvertedDimension = function getConvertedDimension(dimensions) {
|
|
44
34
|
var _dimensions$width = dimensions.width,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
width = _dimensions$width === void 0 ? defaultImageCardDimensions.width : _dimensions$width,
|
|
36
|
+
_dimensions$height = dimensions.height,
|
|
37
|
+
height = _dimensions$height === void 0 ? defaultImageCardDimensions.height : _dimensions$height;
|
|
48
38
|
return {
|
|
49
39
|
width: normalizeDimension(width, defaultImageCardDimensions.width),
|
|
50
40
|
height: normalizeDimension(height, defaultImageCardDimensions.height)
|
|
51
41
|
};
|
|
52
42
|
};
|
|
53
|
-
|
|
54
43
|
var wrapperStyles = function wrapperStyles() {
|
|
55
44
|
var dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultImageCardDimensions;
|
|
56
|
-
|
|
57
45
|
try {
|
|
58
46
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n ", ";\n background: ", ";\n color: ", ";\n max-height: 100%;\n max-width: 100%;\n ", ";\n display: flex;\n flex-direction: column;\n\n p {\n font-size: ", "px;\n text-align: center;\n display: ", ";\n }\n "])), center, borderRadius, "var(--ds-background-neutral, ".concat(N20, ")"), "var(--ds-text-subtle, ".concat(N800, ")"), getConvertedDimension(dimensions), fontSize(), shouldShowText(getConvertedDimension(dimensions)) ? 'block' : 'none');
|
|
59
47
|
} catch (e) {
|
|
60
48
|
return null;
|
|
61
49
|
}
|
|
62
50
|
};
|
|
63
|
-
|
|
64
51
|
export var UnhandledErrorCard = /*#__PURE__*/function (_Component) {
|
|
65
52
|
_inherits(UnhandledErrorCard, _Component);
|
|
66
|
-
|
|
67
53
|
var _super = _createSuper(UnhandledErrorCard);
|
|
68
|
-
|
|
69
54
|
function UnhandledErrorCard() {
|
|
70
55
|
_classCallCheck(this, UnhandledErrorCard);
|
|
71
|
-
|
|
72
56
|
return _super.apply(this, arguments);
|
|
73
57
|
}
|
|
74
|
-
|
|
75
58
|
_createClass(UnhandledErrorCard, [{
|
|
76
59
|
key: "render",
|
|
77
60
|
value: function render() {
|
|
78
61
|
var _this$props = this.props,
|
|
79
|
-
|
|
80
|
-
|
|
62
|
+
dimensions = _this$props.dimensions,
|
|
63
|
+
onClick = _this$props.onClick;
|
|
81
64
|
return jsx("div", {
|
|
82
65
|
css: wrapperStyles(dimensions),
|
|
83
66
|
onClick: onClick
|
|
@@ -88,6 +71,5 @@ export var UnhandledErrorCard = /*#__PURE__*/function (_Component) {
|
|
|
88
71
|
}), jsx("p", null, "We couldn't load this content"));
|
|
89
72
|
}
|
|
90
73
|
}]);
|
|
91
|
-
|
|
92
74
|
return UnhandledErrorCard;
|
|
93
75
|
}(Component);
|