@atlaskit/media-card 74.2.0 → 74.3.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 +14 -0
- package/dist/cjs/card/card.js +4 -4
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +3 -1
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +8 -6
- package/dist/cjs/card/cardImageView/fileCardImageView.js +3 -1
- package/dist/cjs/card/cardImageView/styles.js +11 -7
- package/dist/cjs/card/getCardPreview/helpers.js +2 -2
- package/dist/cjs/card/getCardPreview/index.js +5 -5
- package/dist/cjs/card/styles/index.js +3 -1
- package/dist/cjs/card/ui/blanket/styles.js +3 -1
- package/dist/cjs/card/ui/iconMessage/styles.js +3 -1
- package/dist/cjs/card/ui/loadingRateLimited/styles.js +3 -1
- package/dist/cjs/card/ui/newFileExperience/styles.js +3 -1
- package/dist/cjs/card/ui/playButton/styles.js +4 -2
- package/dist/cjs/card/ui/progressBar/styles.js +5 -1
- package/dist/cjs/card/ui/styles.js +3 -1
- package/dist/cjs/card/ui/tickBox/styles.js +4 -2
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +3 -1
- package/dist/cjs/card/ui/titleBox/styles.js +3 -1
- package/dist/cjs/utils/cardActions/styles.js +6 -2
- package/dist/cjs/utils/errorIcon/styles.js +3 -1
- package/dist/cjs/utils/fileIcon/index.js +1 -1
- package/dist/cjs/utils/lightCards/styles.js +6 -4
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +4 -4
- package/dist/es2019/card/cardImageView/cardOverlay/index.js +2 -1
- package/dist/es2019/card/cardImageView/cardOverlay/styles.js +24 -55
- package/dist/es2019/card/cardImageView/fileCardImageView.js +3 -3
- package/dist/es2019/card/cardImageView/styles.js +10 -7
- package/dist/es2019/card/getCardPreview/helpers.js +2 -2
- package/dist/es2019/card/getCardPreview/index.js +4 -4
- package/dist/es2019/card/styles/index.js +2 -1
- package/dist/es2019/card/ui/blanket/styles.js +2 -1
- package/dist/es2019/card/ui/iconMessage/styles.js +2 -1
- package/dist/es2019/card/ui/loadingRateLimited/styles.js +2 -1
- package/dist/es2019/card/ui/newFileExperience/styles.js +9 -8
- package/dist/es2019/card/ui/playButton/styles.js +3 -2
- package/dist/es2019/card/ui/progressBar/styles.js +5 -2
- package/dist/es2019/card/ui/styles.js +2 -1
- package/dist/es2019/card/ui/tickBox/styles.js +5 -4
- package/dist/es2019/card/ui/titleBox/failedTitleBox.js +2 -1
- package/dist/es2019/card/ui/titleBox/styles.js +2 -1
- package/dist/es2019/utils/cardActions/styles.js +6 -5
- package/dist/es2019/utils/errorIcon/styles.js +2 -1
- package/dist/es2019/utils/fileIcon/index.js +1 -1
- package/dist/es2019/utils/lightCards/styles.js +6 -6
- package/dist/es2019/utils/progressBar/styles.js +1 -0
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +4 -4
- package/dist/esm/card/cardImageView/cardOverlay/index.js +2 -1
- package/dist/esm/card/cardImageView/cardOverlay/styles.js +8 -7
- package/dist/esm/card/cardImageView/fileCardImageView.js +3 -3
- package/dist/esm/card/cardImageView/styles.js +10 -7
- package/dist/esm/card/getCardPreview/helpers.js +2 -2
- package/dist/esm/card/getCardPreview/index.js +5 -5
- package/dist/esm/card/styles/index.js +2 -1
- package/dist/esm/card/ui/blanket/styles.js +2 -1
- package/dist/esm/card/ui/iconMessage/styles.js +2 -1
- package/dist/esm/card/ui/loadingRateLimited/styles.js +2 -1
- package/dist/esm/card/ui/newFileExperience/styles.js +2 -1
- package/dist/esm/card/ui/playButton/styles.js +3 -2
- package/dist/esm/card/ui/progressBar/styles.js +5 -2
- package/dist/esm/card/ui/styles.js +2 -1
- package/dist/esm/card/ui/tickBox/styles.js +3 -2
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +2 -1
- package/dist/esm/card/ui/titleBox/styles.js +2 -1
- package/dist/esm/utils/cardActions/styles.js +4 -2
- package/dist/esm/utils/errorIcon/styles.js +2 -1
- package/dist/esm/utils/fileIcon/index.js +1 -1
- package/dist/esm/utils/lightCards/styles.js +6 -6
- package/dist/esm/utils/progressBar/styles.js +1 -0
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/card/getCardPreview/helpers.d.ts +2 -1
- package/dist/types/card/getCardPreview/index.d.ts +4 -4
- package/dist/types/card/styles/index.d.ts +1 -1
- package/example-helpers/styles.ts +10 -6
- package/package.json +13 -15
- package/report.api.md +44 -39
- package/dist/cjs/utils/mediaTypeIcon/iconWrapper.js +0 -20
- package/dist/cjs/utils/mediaTypeIcon/index.js +0 -81
- package/dist/cjs/utils/mediaTypeIcon/styles.js +0 -37
- package/dist/cjs/utils/mediaTypeIcon/types.js +0 -5
- package/dist/es2019/utils/mediaTypeIcon/iconWrapper.js +0 -9
- package/dist/es2019/utils/mediaTypeIcon/index.js +0 -35
- package/dist/es2019/utils/mediaTypeIcon/styles.js +0 -22
- package/dist/es2019/utils/mediaTypeIcon/types.js +0 -1
- package/dist/esm/utils/mediaTypeIcon/iconWrapper.js +0 -9
- package/dist/esm/utils/mediaTypeIcon/index.js +0 -59
- package/dist/esm/utils/mediaTypeIcon/styles.js +0 -24
- package/dist/esm/utils/mediaTypeIcon/types.js +0 -1
- package/dist/types/utils/mediaTypeIcon/iconWrapper.d.ts +0 -4
- package/dist/types/utils/mediaTypeIcon/index.d.ts +0 -10
- package/dist/types/utils/mediaTypeIcon/styles.d.ts +0 -2
- package/dist/types/utils/mediaTypeIcon/types.d.ts +0 -6
- package/dist/types-ts4.0/card/actions.d.ts +0 -9
- package/dist/types-ts4.0/card/card.d.ts +0 -60
- package/dist/types-ts4.0/card/cardAnalytics.d.ts +0 -9
- package/dist/types-ts4.0/card/cardConstants.d.ts +0 -1
- package/dist/types-ts4.0/card/cardImageView/cardImageViewWrapper.d.ts +0 -6
- package/dist/types-ts4.0/card/cardImageView/cardOverlay/cardOverlayComponents.d.ts +0 -8
- package/dist/types-ts4.0/card/cardImageView/cardOverlay/index.d.ts +0 -39
- package/dist/types-ts4.0/card/cardImageView/cardOverlay/styles.d.ts +0 -26
- package/dist/types-ts4.0/card/cardImageView/cardViewWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/cardImageView/classnames.d.ts +0 -2
- package/dist/types-ts4.0/card/cardImageView/fileCardImageView.d.ts +0 -49
- package/dist/types-ts4.0/card/cardImageView/index.d.ts +0 -2
- package/dist/types-ts4.0/card/cardImageView/styles.d.ts +0 -24
- package/dist/types-ts4.0/card/cardLoader.d.ts +0 -6
- package/dist/types-ts4.0/card/cardState.d.ts +0 -5
- package/dist/types-ts4.0/card/cardView.d.ts +0 -80
- package/dist/types-ts4.0/card/getCardPreview/cache.d.ts +0 -19
- package/dist/types-ts4.0/card/getCardPreview/filePreviewStatus.d.ts +0 -5
- package/dist/types-ts4.0/card/getCardPreview/helpers.d.ts +0 -9
- package/dist/types-ts4.0/card/getCardPreview/imageRefetchingAnalytics.d.ts +0 -10
- package/dist/types-ts4.0/card/getCardPreview/index.d.ts +0 -58
- package/dist/types-ts4.0/card/getCardStatus.d.ts +0 -4
- package/dist/types-ts4.0/card/index.d.ts +0 -1
- package/dist/types-ts4.0/card/inlinePlayer.d.ts +0 -52
- package/dist/types-ts4.0/card/inlinePlayerLazy.d.ts +0 -2
- package/dist/types-ts4.0/card/inlinePlayerWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/styles/animations.d.ts +0 -1
- package/dist/types-ts4.0/card/styles/config.d.ts +0 -1
- package/dist/types-ts4.0/card/styles/easing.d.ts +0 -2
- package/dist/types-ts4.0/card/styles/getSelectedBorderStyle.d.ts +0 -3
- package/dist/types-ts4.0/card/styles/index.d.ts +0 -9
- package/dist/types-ts4.0/card/styles/mixins.d.ts +0 -21
- package/dist/types-ts4.0/card/styles/styles.d.ts +0 -10
- package/dist/types-ts4.0/card/types.d.ts +0 -24
- package/dist/types-ts4.0/card/ui/actionsBar/actionsBar.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/actionsBar/styles.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/actionsBar/types.d.ts +0 -10
- package/dist/types-ts4.0/card/ui/blanket/blanket.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/blanket/styles.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/common.d.ts +0 -23
- package/dist/types-ts4.0/card/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/iconMessage/index.d.ts +0 -8
- package/dist/types-ts4.0/card/ui/iconMessage/styles.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/iconMessage/types.d.ts +0 -19
- package/dist/types-ts4.0/card/ui/iconWrapper/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/iconWrapper/styles.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/iconWrapper/types.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/imageRenderer/imageRenderer.d.ts +0 -15
- package/dist/types-ts4.0/card/ui/loadingRateLimited/styles.d.ts +0 -13
- package/dist/types-ts4.0/card/ui/newFileExperience/newFileExperienceWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/newFileExperience/styles.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/newFileExperience/types.d.ts +0 -23
- package/dist/types-ts4.0/card/ui/playButton/playButton.d.ts +0 -2
- package/dist/types-ts4.0/card/ui/playButton/playButtonBackground.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/playButton/playButtonWrapper.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/playButton/styles.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/progressBar/progressBar.d.ts +0 -10
- package/dist/types-ts4.0/card/ui/progressBar/styledBar.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/progressBar/styles.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/progressBar/types.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/styles.d.ts +0 -11
- package/dist/types-ts4.0/card/ui/tickBox/styles.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/tickBox/tickBox.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/tickBox/tickBoxWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/tickBox/types.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/titleBox/failedTitleBox.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/titleBox/styles.d.ts +0 -15
- package/dist/types-ts4.0/card/ui/titleBox/titleBox.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/titleBox/titleBoxComponents.d.ts +0 -8
- package/dist/types-ts4.0/card/ui/titleBox/types.d.ts +0 -32
- package/dist/types-ts4.0/classnames.d.ts +0 -5
- package/dist/types-ts4.0/errors.d.ts +0 -41
- package/dist/types-ts4.0/index.d.ts +0 -15
- package/dist/types-ts4.0/inline/index.d.ts +0 -1
- package/dist/types-ts4.0/inline/loader.d.ts +0 -25
- package/dist/types-ts4.0/inline/mediaInlineCard.d.ts +0 -14
- package/dist/types-ts4.0/types.d.ts +0 -96
- package/dist/types-ts4.0/utils/analytics.d.ts +0 -77
- package/dist/types-ts4.0/utils/breakpoint.d.ts +0 -11
- package/dist/types-ts4.0/utils/cardActions/cardActionButton.d.ts +0 -3
- package/dist/types-ts4.0/utils/cardActions/cardActionIconButton.d.ts +0 -12
- package/dist/types-ts4.0/utils/cardActions/cardActionsDropdownMenu.d.ts +0 -14
- package/dist/types-ts4.0/utils/cardActions/cardActionsView.d.ts +0 -16
- package/dist/types-ts4.0/utils/cardActions/index.d.ts +0 -7
- package/dist/types-ts4.0/utils/cardActions/styles.d.ts +0 -18
- package/dist/types-ts4.0/utils/cardDimensions.d.ts +0 -49
- package/dist/types-ts4.0/utils/containsPixelUnit.d.ts +0 -1
- package/dist/types-ts4.0/utils/dimensionComparer.d.ts +0 -3
- package/dist/types-ts4.0/utils/document.d.ts +0 -2
- package/dist/types-ts4.0/utils/errorIcon/index.d.ts +0 -12
- package/dist/types-ts4.0/utils/errorIcon/styles.d.ts +0 -1
- package/dist/types-ts4.0/utils/fileIcon/index.d.ts +0 -12
- package/dist/types-ts4.0/utils/fileIcon/styles.d.ts +0 -1
- package/dist/types-ts4.0/utils/generateUniqueId.d.ts +0 -1
- package/dist/types-ts4.0/utils/getCSSUnitValue.d.ts +0 -1
- package/dist/types-ts4.0/utils/getDataURIDimension.d.ts +0 -9
- package/dist/types-ts4.0/utils/getElementDimension.d.ts +0 -2
- package/dist/types-ts4.0/utils/getErrorMessage.d.ts +0 -2
- package/dist/types-ts4.0/utils/getMediaCardCursor.d.ts +0 -6
- package/dist/types-ts4.0/utils/globalScope/getSSRData.d.ts +0 -3
- package/dist/types-ts4.0/utils/globalScope/globalScope.d.ts +0 -21
- package/dist/types-ts4.0/utils/globalScope/index.d.ts +0 -4
- package/dist/types-ts4.0/utils/globalScope/types.d.ts +0 -8
- package/dist/types-ts4.0/utils/index.d.ts +0 -14
- package/dist/types-ts4.0/utils/isRetina.d.ts +0 -1
- package/dist/types-ts4.0/utils/isValidPercentageUnit.d.ts +0 -1
- package/dist/types-ts4.0/utils/lightCards/cardError.d.ts +0 -12
- package/dist/types-ts4.0/utils/lightCards/cardLoading.d.ts +0 -5
- package/dist/types-ts4.0/utils/lightCards/getDimensionsWithDefault.d.ts +0 -2
- package/dist/types-ts4.0/utils/lightCards/lightCardWrappers.d.ts +0 -5
- package/dist/types-ts4.0/utils/lightCards/styles.d.ts +0 -4
- package/dist/types-ts4.0/utils/lightCards/types.d.ts +0 -15
- package/dist/types-ts4.0/utils/media-card-analytics-error-boundary.d.ts +0 -10
- package/dist/types-ts4.0/utils/mediaTypeIcon/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.0/utils/mediaTypeIcon/index.d.ts +0 -10
- package/dist/types-ts4.0/utils/mediaTypeIcon/styles.d.ts +0 -2
- package/dist/types-ts4.0/utils/mediaTypeIcon/types.d.ts +0 -6
- package/dist/types-ts4.0/utils/metadata.d.ts +0 -2
- package/dist/types-ts4.0/utils/objectURLCache.d.ts +0 -11
- package/dist/types-ts4.0/utils/preventClickThrough.d.ts +0 -8
- package/dist/types-ts4.0/utils/printScript.d.ts +0 -2
- package/dist/types-ts4.0/utils/progressBar/index.d.ts +0 -9
- package/dist/types-ts4.0/utils/progressBar/styles.d.ts +0 -1
- package/dist/types-ts4.0/utils/resizeModeToMediaImageProps.d.ts +0 -5
- package/dist/types-ts4.0/utils/shouldDisplayImageThumbnail.d.ts +0 -3
- package/dist/types-ts4.0/utils/ufoExperiences.d.ts +0 -7
- package/dist/types-ts4.0/utils/videoSnapshot.d.ts +0 -1
- package/dist/types-ts4.0/utils/viewportDetector.d.ts +0 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MediaClient, FilePreview, MediaStoreGetFileImageParams, MediaType } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
2
3
|
import { CardPreview } from '../../types';
|
|
3
4
|
/**
|
|
4
5
|
* This method tells the support for the media
|
|
@@ -6,4 +7,4 @@ import { CardPreview } from '../../types';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare const isSupportedLocalPreview: (mediaType?: MediaType | undefined) => boolean;
|
|
8
9
|
export declare const getCardPreviewFromFilePreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<CardPreview>;
|
|
9
|
-
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams,
|
|
10
|
+
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext | undefined) => Promise<CardPreview>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs, FileIdentifier } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
|
|
2
|
+
import { MediaFeatureFlags, SSR, MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
4
4
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { CardDimensions } from '../../types';
|
|
@@ -25,7 +25,7 @@ export declare type CardPreviewParams = {
|
|
|
25
25
|
mediaBlobUrlAttrs?: MediaBlobUrlAttrs;
|
|
26
26
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
27
27
|
featureFlags?: MediaFeatureFlags;
|
|
28
|
-
|
|
28
|
+
traceContext?: MediaTraceContext;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* This function will try to return a Card preview, either from cache, local preview or remote preview.
|
|
@@ -37,7 +37,7 @@ export declare type CardPreviewParams = {
|
|
|
37
37
|
* In that case, we still want to report the local preview error to the caller, for feature realiability track.
|
|
38
38
|
* hence the use of the optional callback onLocalPreviewError
|
|
39
39
|
*/
|
|
40
|
-
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags,
|
|
40
|
+
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, traceContext, }: CardPreviewParams) => Promise<CardPreview>;
|
|
41
41
|
export declare const shouldResolvePreview: ({ status, fileState, prevDimensions, dimensions, identifier, fileImageMode, hasCardPreview, isBannedLocalPreview, featureFlags, }: {
|
|
42
42
|
status: CardStatus;
|
|
43
43
|
fileState: FileState;
|
|
@@ -55,4 +55,4 @@ export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
|
55
55
|
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
56
56
|
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
57
57
|
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
58
|
-
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined,
|
|
58
|
+
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined, traceContext?: MediaTraceContext | undefined) => Promise<CardPreview>;
|
|
@@ -4,6 +4,6 @@ export type { WithAppearanceProps } from './mixins';
|
|
|
4
4
|
export { easeOutCubic, easeOutExpo } from './easing';
|
|
5
5
|
export { spin } from './animations';
|
|
6
6
|
export declare const rootStyles: () => import("@emotion/react").SerializedStyles;
|
|
7
|
-
export declare const cardShadow
|
|
7
|
+
export declare const cardShadow: string;
|
|
8
8
|
export declare const fadeinImageStyles: () => import("@emotion/react").SerializedStyles;
|
|
9
9
|
export default rootStyles;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { token } from '@atlaskit/tokens';
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
|
|
3
4
|
export const editableCardOptionsStyles = css`
|
|
4
5
|
padding: 20px;
|
|
5
|
-
border-bottom: 1px solid #ccc;
|
|
6
|
+
border-bottom: 1px solid ${token('color.border', '#ccc')};
|
|
6
7
|
max-width: 700px;
|
|
7
8
|
`;
|
|
8
9
|
|
|
@@ -22,7 +23,10 @@ export const editableCardContentStyles = css`
|
|
|
22
23
|
border: 2px dashed;
|
|
23
24
|
margin: 0 10px 50px 10px;
|
|
24
25
|
overflow: hidden;
|
|
25
|
-
background:
|
|
26
|
+
background: ${token(
|
|
27
|
+
'color.background.accent.orange.subtlest',
|
|
28
|
+
'antiquewhite',
|
|
29
|
+
)};
|
|
26
30
|
box-sizing: border-box;
|
|
27
31
|
`;
|
|
28
32
|
|
|
@@ -40,7 +44,7 @@ export const cardDimensionsWrapperStyles = css`
|
|
|
40
44
|
display: flex;
|
|
41
45
|
|
|
42
46
|
> div {
|
|
43
|
-
border: 1px solid;
|
|
47
|
+
border: 1px solid ${token('color.border.bold', 'black')};
|
|
44
48
|
margin: 5px;
|
|
45
49
|
padding: 5px;
|
|
46
50
|
border-radius: 3px;
|
|
@@ -55,7 +59,7 @@ export const cardPreviewWrapperStyles = css`
|
|
|
55
59
|
`;
|
|
56
60
|
|
|
57
61
|
export const cardWrapperStyles = css`
|
|
58
|
-
border: 1px solid;
|
|
62
|
+
border: 1px solid ${token('color.border.bold', 'black')};
|
|
59
63
|
padding: 10px;
|
|
60
64
|
margin: 5px;
|
|
61
65
|
flex-direction: column;
|
|
@@ -82,7 +86,7 @@ export const externalIdentifierWrapperStyles = css`
|
|
|
82
86
|
|
|
83
87
|
export const inlineCardVideoWrapperItemStyles = css`
|
|
84
88
|
padding: 10px;
|
|
85
|
-
border: 1px solid;
|
|
89
|
+
border: 1px solid ${token('color.border.bold', 'black')};
|
|
86
90
|
margin: 10px;
|
|
87
91
|
`;
|
|
88
92
|
|
|
@@ -110,6 +114,6 @@ export const mediaInlineTableStyles = css`
|
|
|
110
114
|
width: 800px;
|
|
111
115
|
tr,
|
|
112
116
|
td {
|
|
113
|
-
border: 1px solid #ddd;
|
|
117
|
+
border: 1px solid ${token('color.border', '#ddd')};
|
|
114
118
|
}
|
|
115
119
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.3.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.0 <4.5": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.0/*",
|
|
19
|
-
"dist/types-ts4.0/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": false,
|
|
24
16
|
"atlaskit:src": "src/index.ts",
|
|
25
17
|
"af:exports": {
|
|
@@ -40,12 +32,13 @@
|
|
|
40
32
|
"@atlaskit/dropdown-menu": "^11.5.0",
|
|
41
33
|
"@atlaskit/editor-shared-styles": "^2.2.0",
|
|
42
34
|
"@atlaskit/icon": "^21.11.0",
|
|
43
|
-
"@atlaskit/media-client": "^
|
|
35
|
+
"@atlaskit/media-client": "^19.0.0",
|
|
44
36
|
"@atlaskit/media-common": "^2.17.0",
|
|
45
|
-
"@atlaskit/media-ui": "^22.
|
|
46
|
-
"@atlaskit/media-viewer": "^47.
|
|
47
|
-
"@atlaskit/spinner": "^15.
|
|
37
|
+
"@atlaskit/media-ui": "^22.2.0",
|
|
38
|
+
"@atlaskit/media-viewer": "^47.2.0",
|
|
39
|
+
"@atlaskit/spinner": "^15.3.0",
|
|
48
40
|
"@atlaskit/theme": "^12.2.0",
|
|
41
|
+
"@atlaskit/tokens": "^0.11.1",
|
|
49
42
|
"@atlaskit/tooltip": "^17.6.0",
|
|
50
43
|
"@atlaskit/ufo": "^0.1.0",
|
|
51
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -63,7 +56,7 @@
|
|
|
63
56
|
"devDependencies": {
|
|
64
57
|
"@atlaskit/analytics-listeners": "^8.3.0",
|
|
65
58
|
"@atlaskit/analytics-namespaced-context": "^6.5.0",
|
|
66
|
-
"@atlaskit/button": "^16.
|
|
59
|
+
"@atlaskit/button": "^16.5.0",
|
|
67
60
|
"@atlaskit/checkbox": "^12.4.0",
|
|
68
61
|
"@atlaskit/docs": "*",
|
|
69
62
|
"@atlaskit/inline-message": "^11.4.0",
|
|
@@ -72,7 +65,7 @@
|
|
|
72
65
|
"@atlaskit/media-test-helpers": "^30.0.0",
|
|
73
66
|
"@atlaskit/radio": "^5.4.0",
|
|
74
67
|
"@atlaskit/range": "^7.0.0",
|
|
75
|
-
"@atlaskit/select": "^
|
|
68
|
+
"@atlaskit/select": "^16.0.0",
|
|
76
69
|
"@atlaskit/ssr": "*",
|
|
77
70
|
"@atlaskit/toggle": "^12.5.0",
|
|
78
71
|
"@atlaskit/visual-regression": "*",
|
|
@@ -93,5 +86,10 @@
|
|
|
93
86
|
"uuid": "^3.1.0",
|
|
94
87
|
"wait-for-expect": "^1.2.0"
|
|
95
88
|
},
|
|
89
|
+
"techstack": {
|
|
90
|
+
"@repo/internal": {
|
|
91
|
+
"theming": "tokens"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
96
94
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
97
95
|
}
|
package/report.api.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
<!-- API Report Version: 2.2 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/media-card"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
12
|
+
### Main Entry Types
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
15
|
|
|
11
16
|
```ts
|
|
12
17
|
/// <reference types="react" />
|
|
@@ -45,7 +50,7 @@ export interface CardAction {
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
// @public (undocumented)
|
|
48
|
-
export type CardAppearance = 'auto' | '
|
|
53
|
+
export type CardAppearance = 'auto' | 'horizontal' | 'image' | 'square';
|
|
49
54
|
|
|
50
55
|
// @public (undocumented)
|
|
51
56
|
type CardBaseProps = CardProps &
|
|
@@ -121,16 +126,16 @@ export interface CardPreview {
|
|
|
121
126
|
|
|
122
127
|
// @public (undocumented)
|
|
123
128
|
type CardPreviewSource =
|
|
124
|
-
| 'local'
|
|
125
|
-
| 'remote'
|
|
126
|
-
| 'ssr-server'
|
|
127
|
-
| 'ssr-client'
|
|
128
|
-
| 'ssr-data'
|
|
129
129
|
| 'cache-local'
|
|
130
130
|
| 'cache-remote'
|
|
131
131
|
| 'cache-ssr-client'
|
|
132
132
|
| 'cache-ssr-server'
|
|
133
|
-
| 'external'
|
|
133
|
+
| 'external'
|
|
134
|
+
| 'local'
|
|
135
|
+
| 'remote'
|
|
136
|
+
| 'ssr-client'
|
|
137
|
+
| 'ssr-data'
|
|
138
|
+
| 'ssr-server';
|
|
134
139
|
|
|
135
140
|
// @public (undocumented)
|
|
136
141
|
export interface CardProps extends SharedCardProps, CardEventProps {
|
|
@@ -184,13 +189,13 @@ export interface CardState {
|
|
|
184
189
|
|
|
185
190
|
// @public (undocumented)
|
|
186
191
|
export type CardStatus =
|
|
187
|
-
| 'uploading'
|
|
188
|
-
| 'loading'
|
|
189
|
-
| 'processing'
|
|
190
|
-
| 'loading-preview'
|
|
191
192
|
| 'complete'
|
|
192
193
|
| 'error'
|
|
193
|
-
| 'failed-processing'
|
|
194
|
+
| 'failed-processing'
|
|
195
|
+
| 'loading'
|
|
196
|
+
| 'loading-preview'
|
|
197
|
+
| 'processing'
|
|
198
|
+
| 'uploading';
|
|
194
199
|
|
|
195
200
|
// @public (undocumented)
|
|
196
201
|
type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
@@ -211,7 +216,7 @@ type ErrorBoundaryComponent = React_2.ComponentType<{
|
|
|
211
216
|
// @public (undocumented)
|
|
212
217
|
interface ErrorCardProps extends StaticCardProps {
|
|
213
218
|
// (undocumented)
|
|
214
|
-
readonly size: '
|
|
219
|
+
readonly size: 'large' | 'medium' | 'small' | 'xlarge';
|
|
215
220
|
}
|
|
216
221
|
|
|
217
222
|
// @public (undocumented)
|
|
@@ -223,11 +228,11 @@ export const fileCardImageViewSelector = 'media-file-card-view';
|
|
|
223
228
|
|
|
224
229
|
// @public (undocumented)
|
|
225
230
|
type ImageLoadPrimaryReason =
|
|
226
|
-
| 'cache-remote-uri'
|
|
227
231
|
| 'cache-local-uri'
|
|
232
|
+
| 'cache-remote-uri'
|
|
233
|
+
| 'external-uri'
|
|
228
234
|
| 'local-uri'
|
|
229
235
|
| 'remote-uri'
|
|
230
|
-
| 'external-uri'
|
|
231
236
|
| 'unknown-uri';
|
|
232
237
|
|
|
233
238
|
// @public (undocumented)
|
|
@@ -236,9 +241,9 @@ export const inlinePlayerClassName = 'media-card-inline-player';
|
|
|
236
241
|
// @public (undocumented)
|
|
237
242
|
type LocalPreviewPrimaryReason =
|
|
238
243
|
| 'local-preview-get'
|
|
239
|
-
| 'local-preview-unsupported'
|
|
240
|
-
| 'local-preview-rejected'
|
|
241
244
|
| 'local-preview-image'
|
|
245
|
+
| 'local-preview-rejected'
|
|
246
|
+
| 'local-preview-unsupported'
|
|
242
247
|
| 'local-preview-video';
|
|
243
248
|
|
|
244
249
|
// @public (undocumented)
|
|
@@ -255,15 +260,15 @@ class MediaCardError extends Error {
|
|
|
255
260
|
|
|
256
261
|
// @public
|
|
257
262
|
type MediaCardErrorPrimaryReason =
|
|
258
|
-
| 'upload'
|
|
259
|
-
| 'metadata-fetch'
|
|
260
263
|
| 'error-file-state'
|
|
261
|
-
|
|
|
262
|
-
| LocalPreviewPrimaryReason
|
|
263
|
-
| ImageLoadPrimaryReason
|
|
264
|
-
| SsrPreviewPrimaryReason
|
|
264
|
+
| 'metadata-fetch'
|
|
265
265
|
| 'missing-error-data'
|
|
266
|
-
| 'preview-fetch'
|
|
266
|
+
| 'preview-fetch'
|
|
267
|
+
| 'upload'
|
|
268
|
+
| ImageLoadPrimaryReason
|
|
269
|
+
| LocalPreviewPrimaryReason
|
|
270
|
+
| RemotePreviewPrimaryReason
|
|
271
|
+
| SsrPreviewPrimaryReason;
|
|
267
272
|
|
|
268
273
|
// @public (undocumented)
|
|
269
274
|
export class MediaInlineCard extends React_2.PureComponent<
|
|
@@ -307,20 +312,18 @@ interface MediaInlineCardProps {
|
|
|
307
312
|
// (undocumented)
|
|
308
313
|
mediaViewerDataSource?: MediaViewerDataSource;
|
|
309
314
|
// (undocumented)
|
|
310
|
-
onClick?: React_2.EventHandler<React_2.
|
|
315
|
+
onClick?: React_2.EventHandler<React_2.KeyboardEvent | React_2.MouseEvent>;
|
|
311
316
|
// (undocumented)
|
|
312
317
|
shouldOpenMediaViewer?: boolean;
|
|
313
318
|
}
|
|
314
319
|
|
|
315
320
|
// @public (undocumented)
|
|
316
|
-
type MediaInlineCardWithMediaClientConfigComponent =
|
|
317
|
-
MediaInlineCardWithMediaClientConfigProps
|
|
318
|
-
>;
|
|
321
|
+
type MediaInlineCardWithMediaClientConfigComponent =
|
|
322
|
+
React_2.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
319
323
|
|
|
320
324
|
// @public (undocumented)
|
|
321
|
-
type MediaInlineCardWithMediaClientConfigProps =
|
|
322
|
-
MediaInlineCardProps
|
|
323
|
-
>;
|
|
325
|
+
type MediaInlineCardWithMediaClientConfigProps =
|
|
326
|
+
WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
324
327
|
|
|
325
328
|
// @public (undocumented)
|
|
326
329
|
export const newFileExperienceClassName = 'new-file-experience-wrapper';
|
|
@@ -364,10 +367,10 @@ export interface SharedCardProps {
|
|
|
364
367
|
|
|
365
368
|
// @public (undocumented)
|
|
366
369
|
type SsrPreviewPrimaryReason =
|
|
367
|
-
| 'ssr-client-uri'
|
|
368
370
|
| 'ssr-client-load'
|
|
369
|
-
| 'ssr-
|
|
370
|
-
| 'ssr-server-load'
|
|
371
|
+
| 'ssr-client-uri'
|
|
372
|
+
| 'ssr-server-load'
|
|
373
|
+
| 'ssr-server-uri';
|
|
371
374
|
|
|
372
375
|
// @public (undocumented)
|
|
373
376
|
interface StaticCardProps {
|
|
@@ -384,3 +387,5 @@ export type TitleBoxIcon = 'LockFilledIcon';
|
|
|
384
387
|
|
|
385
388
|
// (No @packageDocumentation comment for this package)
|
|
386
389
|
```
|
|
390
|
+
|
|
391
|
+
<!--SECTION END: Main Entry Types-->
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.IconWrapper = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = require("@emotion/react");
|
|
9
|
-
|
|
10
|
-
var _styles = require("./styles");
|
|
11
|
-
|
|
12
|
-
/**@jsx jsx */
|
|
13
|
-
var IconWrapper = function IconWrapper(props) {
|
|
14
|
-
return (0, _react.jsx)("div", {
|
|
15
|
-
id: "iconWrapper",
|
|
16
|
-
css: (0, _styles.iconWrapperStyles)(props)
|
|
17
|
-
}, props.children);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.IconWrapper = IconWrapper;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.MediaTypeIcon = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
|
|
22
|
-
var _image = _interopRequireDefault(require("@atlaskit/icon/glyph/image"));
|
|
23
|
-
|
|
24
|
-
var _audio = _interopRequireDefault(require("@atlaskit/icon/glyph/audio"));
|
|
25
|
-
|
|
26
|
-
var _zip = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/zip"));
|
|
27
|
-
|
|
28
|
-
var _video = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/video"));
|
|
29
|
-
|
|
30
|
-
var _document = _interopRequireDefault(require("@atlaskit/icon/glyph/document"));
|
|
31
|
-
|
|
32
|
-
var _page = _interopRequireDefault(require("@atlaskit/icon/glyph/page"));
|
|
33
|
-
|
|
34
|
-
var _iconWrapper = require("./iconWrapper");
|
|
35
|
-
|
|
36
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
37
|
-
|
|
38
|
-
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; } }
|
|
39
|
-
|
|
40
|
-
var icons = {
|
|
41
|
-
image: _image.default,
|
|
42
|
-
audio: _audio.default,
|
|
43
|
-
video: _video.default,
|
|
44
|
-
doc: _document.default,
|
|
45
|
-
unknown: _page.default,
|
|
46
|
-
archive: _zip.default
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
var MediaTypeIcon = /*#__PURE__*/function (_React$Component) {
|
|
50
|
-
(0, _inherits2.default)(MediaTypeIcon, _React$Component);
|
|
51
|
-
|
|
52
|
-
var _super = _createSuper(MediaTypeIcon);
|
|
53
|
-
|
|
54
|
-
function MediaTypeIcon() {
|
|
55
|
-
(0, _classCallCheck2.default)(this, MediaTypeIcon);
|
|
56
|
-
return _super.apply(this, arguments);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
(0, _createClass2.default)(MediaTypeIcon, [{
|
|
60
|
-
key: "render",
|
|
61
|
-
value: // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
|
|
62
|
-
function render() {
|
|
63
|
-
var _this$props = this.props,
|
|
64
|
-
type = _this$props.type,
|
|
65
|
-
_this$props$size = _this$props.size,
|
|
66
|
-
size = _this$props$size === void 0 ? 'small' : _this$props$size,
|
|
67
|
-
className = _this$props.className;
|
|
68
|
-
var Icon = type && icons[type] || icons.unknown;
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(_iconWrapper.IconWrapper, {
|
|
70
|
-
type: type || 'unknown'
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
72
|
-
label: "media-type",
|
|
73
|
-
size: size,
|
|
74
|
-
className: className
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
return MediaTypeIcon;
|
|
79
|
-
}(_react.default.Component);
|
|
80
|
-
|
|
81
|
-
exports.MediaTypeIcon = MediaTypeIcon;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.iconWrapperStyles = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _react = require("@emotion/react");
|
|
13
|
-
|
|
14
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
15
|
-
|
|
16
|
-
var _templateObject;
|
|
17
|
-
|
|
18
|
-
var typeToColorMap = {
|
|
19
|
-
image: _colors.Y200,
|
|
20
|
-
audio: _colors.P200,
|
|
21
|
-
video: '#ff7143',
|
|
22
|
-
doc: _colors.B300,
|
|
23
|
-
unknown: '#3dc7dc',
|
|
24
|
-
archive: '' // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var getWrapperColor = function getWrapperColor(_ref) {
|
|
29
|
-
var type = _ref.type;
|
|
30
|
-
return typeToColorMap[type] || typeToColorMap.unknown;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var iconWrapperStyles = function iconWrapperStyles(props) {
|
|
34
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n color: ", ";\n"])), getWrapperColor(props));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
exports.iconWrapperStyles = iconWrapperStyles;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ImageIcon from '@atlaskit/icon/glyph/image';
|
|
3
|
-
import AudioIcon from '@atlaskit/icon/glyph/audio';
|
|
4
|
-
import ArchiveIcon from '@atlaskit/icon/glyph/media-services/zip';
|
|
5
|
-
import VideoIcon from '@atlaskit/icon/glyph/media-services/video';
|
|
6
|
-
import DocIcon from '@atlaskit/icon/glyph/document';
|
|
7
|
-
import UnknownIcon from '@atlaskit/icon/glyph/page';
|
|
8
|
-
import { IconWrapper } from './iconWrapper';
|
|
9
|
-
const icons = {
|
|
10
|
-
image: ImageIcon,
|
|
11
|
-
audio: AudioIcon,
|
|
12
|
-
video: VideoIcon,
|
|
13
|
-
doc: DocIcon,
|
|
14
|
-
unknown: UnknownIcon,
|
|
15
|
-
archive: ArchiveIcon
|
|
16
|
-
};
|
|
17
|
-
export class MediaTypeIcon extends React.Component {
|
|
18
|
-
// TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
|
|
19
|
-
render() {
|
|
20
|
-
const {
|
|
21
|
-
type,
|
|
22
|
-
size = 'small',
|
|
23
|
-
className
|
|
24
|
-
} = this.props;
|
|
25
|
-
const Icon = type && icons[type] || icons.unknown;
|
|
26
|
-
return /*#__PURE__*/React.createElement(IconWrapper, {
|
|
27
|
-
type: type || 'unknown'
|
|
28
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
-
label: "media-type",
|
|
30
|
-
size: size,
|
|
31
|
-
className: className
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
|
-
import { Y200, P200, B300 } from '@atlaskit/theme/colors';
|
|
3
|
-
const typeToColorMap = {
|
|
4
|
-
image: Y200,
|
|
5
|
-
audio: P200,
|
|
6
|
-
video: '#ff7143',
|
|
7
|
-
doc: B300,
|
|
8
|
-
unknown: '#3dc7dc',
|
|
9
|
-
archive: '' // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const getWrapperColor = ({
|
|
14
|
-
type
|
|
15
|
-
}) => {
|
|
16
|
-
return typeToColorMap[type] || typeToColorMap.unknown;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const iconWrapperStyles = props => css`
|
|
20
|
-
display: inline-flex;
|
|
21
|
-
color: ${getWrapperColor(props)};
|
|
22
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
7
|
-
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); }; }
|
|
8
|
-
|
|
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; } }
|
|
10
|
-
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import ImageIcon from '@atlaskit/icon/glyph/image';
|
|
13
|
-
import AudioIcon from '@atlaskit/icon/glyph/audio';
|
|
14
|
-
import ArchiveIcon from '@atlaskit/icon/glyph/media-services/zip';
|
|
15
|
-
import VideoIcon from '@atlaskit/icon/glyph/media-services/video';
|
|
16
|
-
import DocIcon from '@atlaskit/icon/glyph/document';
|
|
17
|
-
import UnknownIcon from '@atlaskit/icon/glyph/page';
|
|
18
|
-
import { IconWrapper } from './iconWrapper';
|
|
19
|
-
var icons = {
|
|
20
|
-
image: ImageIcon,
|
|
21
|
-
audio: AudioIcon,
|
|
22
|
-
video: VideoIcon,
|
|
23
|
-
doc: DocIcon,
|
|
24
|
-
unknown: UnknownIcon,
|
|
25
|
-
archive: ArchiveIcon
|
|
26
|
-
};
|
|
27
|
-
export var MediaTypeIcon = /*#__PURE__*/function (_React$Component) {
|
|
28
|
-
_inherits(MediaTypeIcon, _React$Component);
|
|
29
|
-
|
|
30
|
-
var _super = _createSuper(MediaTypeIcon);
|
|
31
|
-
|
|
32
|
-
function MediaTypeIcon() {
|
|
33
|
-
_classCallCheck(this, MediaTypeIcon);
|
|
34
|
-
|
|
35
|
-
return _super.apply(this, arguments);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
_createClass(MediaTypeIcon, [{
|
|
39
|
-
key: "render",
|
|
40
|
-
value: // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
|
|
41
|
-
function render() {
|
|
42
|
-
var _this$props = this.props,
|
|
43
|
-
type = _this$props.type,
|
|
44
|
-
_this$props$size = _this$props.size,
|
|
45
|
-
size = _this$props$size === void 0 ? 'small' : _this$props$size,
|
|
46
|
-
className = _this$props.className;
|
|
47
|
-
var Icon = type && icons[type] || icons.unknown;
|
|
48
|
-
return /*#__PURE__*/React.createElement(IconWrapper, {
|
|
49
|
-
type: type || 'unknown'
|
|
50
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
51
|
-
label: "media-type",
|
|
52
|
-
size: size,
|
|
53
|
-
className: className
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
}]);
|
|
57
|
-
|
|
58
|
-
return MediaTypeIcon;
|
|
59
|
-
}(React.Component);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
|
-
var _templateObject;
|
|
4
|
-
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
-
import { Y200, P200, B300 } from '@atlaskit/theme/colors';
|
|
7
|
-
var typeToColorMap = {
|
|
8
|
-
image: Y200,
|
|
9
|
-
audio: P200,
|
|
10
|
-
video: '#ff7143',
|
|
11
|
-
doc: B300,
|
|
12
|
-
unknown: '#3dc7dc',
|
|
13
|
-
archive: '' // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var getWrapperColor = function getWrapperColor(_ref) {
|
|
18
|
-
var type = _ref.type;
|
|
19
|
-
return typeToColorMap[type] || typeToColorMap.unknown;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export var iconWrapperStyles = function iconWrapperStyles(props) {
|
|
23
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n color: ", ";\n"])), getWrapperColor(props));
|
|
24
|
-
};
|