@atlaskit/media-card 74.1.5 → 74.1.6
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 +0 -12
- package/classnames/package.json +1 -8
- package/dist/cjs/root/card/getCardPreview/helpers.js +4 -4
- package/dist/cjs/root/card/getCardPreview/index.js +3 -5
- package/dist/cjs/root/card/index.js +4 -2
- package/dist/cjs/root/inlinePlayer.js +2 -2
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/viewportDetector.js +4 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/root/card/getCardPreview/helpers.js +4 -4
- package/dist/es2019/root/card/getCardPreview/index.js +3 -3
- package/dist/es2019/root/card/index.js +4 -2
- package/dist/es2019/root/inlinePlayer.js +2 -2
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/utils/viewportDetector.js +4 -22
- package/dist/es2019/version.json +1 -1
- package/dist/esm/root/card/getCardPreview/helpers.js +4 -4
- package/dist/esm/root/card/getCardPreview/index.js +3 -3
- package/dist/esm/root/card/index.js +4 -2
- package/dist/esm/root/inlinePlayer.js +2 -2
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/viewportDetector.js +4 -22
- package/dist/esm/version.json +1 -1
- package/dist/types/root/card/getCardPreview/index.d.ts +2 -1
- package/in-product/package.json +1 -8
- package/package.json +3 -10
- package/types/package.json +1 -8
- package/dist/types-ts4.0/__tests_external__/index.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/MediaCard.d.ts +0 -8
- package/dist/types-ts4.0/actions.d.ts +0 -9
- package/dist/types-ts4.0/classnames.d.ts +0 -1
- package/dist/types-ts4.0/errors.d.ts +0 -41
- package/dist/types-ts4.0/files/cardImageView/cardImageViewWrapper.d.ts +0 -6
- package/dist/types-ts4.0/files/cardImageView/cardOverlay/cardOverlayComponents.d.ts +0 -8
- package/dist/types-ts4.0/files/cardImageView/cardOverlay/index.d.ts +0 -39
- package/dist/types-ts4.0/files/cardImageView/cardOverlay/styles.d.ts +0 -26
- package/dist/types-ts4.0/files/cardImageView/classnames.d.ts +0 -2
- package/dist/types-ts4.0/files/cardImageView/index.d.ts +0 -50
- package/dist/types-ts4.0/files/cardImageView/styles.d.ts +0 -24
- package/dist/types-ts4.0/files/index.d.ts +0 -2
- package/dist/types-ts4.0/in-product.d.ts +0 -1
- package/dist/types-ts4.0/index.d.ts +0 -77
- package/dist/types-ts4.0/root/card/cardAnalytics.d.ts +0 -9
- package/dist/types-ts4.0/root/card/cardConstants.d.ts +0 -1
- package/dist/types-ts4.0/root/card/cardLoader.d.ts +0 -6
- package/dist/types-ts4.0/root/card/cardState.d.ts +0 -5
- package/dist/types-ts4.0/root/card/getCardPreview/cache.d.ts +0 -19
- package/dist/types-ts4.0/root/card/getCardPreview/filePreviewStatus.d.ts +0 -5
- package/dist/types-ts4.0/root/card/getCardPreview/helpers.d.ts +0 -9
- package/dist/types-ts4.0/root/card/getCardPreview/index.d.ts +0 -56
- package/dist/types-ts4.0/root/card/getCardStatus.d.ts +0 -4
- package/dist/types-ts4.0/root/card/imageRefetchingAnalytics.d.ts +0 -10
- package/dist/types-ts4.0/root/card/index.d.ts +0 -58
- package/dist/types-ts4.0/root/cardView.d.ts +0 -80
- package/dist/types-ts4.0/root/cardViewWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/index.d.ts +0 -2
- package/dist/types-ts4.0/root/inline/loader.d.ts +0 -25
- package/dist/types-ts4.0/root/inline/mediaInlineCard.d.ts +0 -14
- package/dist/types-ts4.0/root/inlinePlayer.d.ts +0 -51
- package/dist/types-ts4.0/root/inlinePlayerLazy.d.ts +0 -2
- package/dist/types-ts4.0/root/inlinePlayerWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/media-card-analytics-error-boundary.d.ts +0 -10
- package/dist/types-ts4.0/root/styles.d.ts +0 -10
- package/dist/types-ts4.0/root/types.d.ts +0 -24
- package/dist/types-ts4.0/root/ui/actionsBar/actionsBar.d.ts +0 -5
- package/dist/types-ts4.0/root/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/actionsBar/styles.d.ts +0 -6
- package/dist/types-ts4.0/root/ui/actionsBar/types.d.ts +0 -10
- package/dist/types-ts4.0/root/ui/blanket/blanket.d.ts +0 -6
- package/dist/types-ts4.0/root/ui/blanket/styles.d.ts +0 -6
- package/dist/types-ts4.0/root/ui/common.d.ts +0 -23
- package/dist/types-ts4.0/root/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/iconMessage/index.d.ts +0 -8
- package/dist/types-ts4.0/root/ui/iconMessage/styles.d.ts +0 -5
- package/dist/types-ts4.0/root/ui/iconMessage/types.d.ts +0 -19
- package/dist/types-ts4.0/root/ui/iconWrapper/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/iconWrapper/styles.d.ts +0 -7
- package/dist/types-ts4.0/root/ui/iconWrapper/types.d.ts +0 -6
- package/dist/types-ts4.0/root/ui/imageRenderer/imageRenderer.d.ts +0 -15
- package/dist/types-ts4.0/root/ui/loadingRateLimited/styles.d.ts +0 -13
- package/dist/types-ts4.0/root/ui/newFileExperience/newFileExperienceWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/newFileExperience/styles.d.ts +0 -5
- package/dist/types-ts4.0/root/ui/newFileExperience/types.d.ts +0 -23
- package/dist/types-ts4.0/root/ui/playButton/playButton.d.ts +0 -2
- package/dist/types-ts4.0/root/ui/playButton/playButtonBackground.d.ts +0 -3
- package/dist/types-ts4.0/root/ui/playButton/playButtonWrapper.d.ts +0 -3
- package/dist/types-ts4.0/root/ui/playButton/styles.d.ts +0 -5
- package/dist/types-ts4.0/root/ui/progressBar/progressBar.d.ts +0 -10
- package/dist/types-ts4.0/root/ui/progressBar/styledBar.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/progressBar/styles.d.ts +0 -7
- package/dist/types-ts4.0/root/ui/progressBar/types.d.ts +0 -7
- package/dist/types-ts4.0/root/ui/styles.d.ts +0 -11
- package/dist/types-ts4.0/root/ui/tickBox/styles.d.ts +0 -7
- package/dist/types-ts4.0/root/ui/tickBox/tickBox.d.ts +0 -3
- package/dist/types-ts4.0/root/ui/tickBox/tickBoxWrapper.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/tickBox/types.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/titleBox/failedTitleBox.d.ts +0 -3
- package/dist/types-ts4.0/root/ui/titleBox/styles.d.ts +0 -15
- package/dist/types-ts4.0/root/ui/titleBox/titleBox.d.ts +0 -4
- package/dist/types-ts4.0/root/ui/titleBox/titleBoxComponents.d.ts +0 -8
- package/dist/types-ts4.0/root/ui/titleBox/types.d.ts +0 -32
- package/dist/types-ts4.0/styles/animations.d.ts +0 -1
- package/dist/types-ts4.0/styles/config.d.ts +0 -1
- package/dist/types-ts4.0/styles/easing.d.ts +0 -2
- package/dist/types-ts4.0/styles/getSelectedBorderStyle.d.ts +0 -3
- package/dist/types-ts4.0/styles/index.d.ts +0 -9
- package/dist/types-ts4.0/styles/mixins.d.ts +0 -21
- package/dist/types-ts4.0/types.d.ts +0 -25
- package/dist/types-ts4.0/utils/analytics.d.ts +0 -78
- package/dist/types-ts4.0/utils/breakpoint.d.ts +0 -11
- package/dist/types-ts4.0/utils/cardActions/cardActionButton.d.ts +0 -4
- 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 -53
- 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 -15
- 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/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,41 +0,0 @@
|
|
|
1
|
-
import { CardPreview } from '.';
|
|
2
|
-
/**
|
|
3
|
-
* Primary reason is logged through Data Portal.
|
|
4
|
-
* Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
|
|
5
|
-
*/
|
|
6
|
-
export declare type MediaCardErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'error-file-state' | RemotePreviewPrimaryReason | LocalPreviewPrimaryReason | ImageLoadPrimaryReason | SsrPreviewPrimaryReason | 'missing-error-data' | 'preview-fetch';
|
|
7
|
-
export declare type ImageLoadPrimaryReason = 'cache-remote-uri' | 'cache-local-uri' | 'local-uri' | 'remote-uri' | 'external-uri' | 'unknown-uri';
|
|
8
|
-
export declare type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-not-ready';
|
|
9
|
-
export declare type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-unsupported' | 'local-preview-rejected' | 'local-preview-image' | 'local-preview-video';
|
|
10
|
-
export declare type SsrPreviewPrimaryReason = 'ssr-client-uri' | 'ssr-client-load' | 'ssr-server-uri' | 'ssr-server-load';
|
|
11
|
-
export declare class MediaCardError extends Error {
|
|
12
|
-
readonly primaryReason: MediaCardErrorPrimaryReason;
|
|
13
|
-
readonly secondaryError?: Error | undefined;
|
|
14
|
-
constructor(primaryReason: MediaCardErrorPrimaryReason, secondaryError?: Error | undefined);
|
|
15
|
-
}
|
|
16
|
-
export declare class LocalPreviewError extends MediaCardError {
|
|
17
|
-
readonly primaryReason: LocalPreviewPrimaryReason;
|
|
18
|
-
readonly secondaryError?: Error | undefined;
|
|
19
|
-
constructor(primaryReason: LocalPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
20
|
-
}
|
|
21
|
-
export declare class RemotePreviewError extends MediaCardError {
|
|
22
|
-
readonly primaryReason: RemotePreviewPrimaryReason;
|
|
23
|
-
readonly secondaryError?: Error | undefined;
|
|
24
|
-
constructor(primaryReason: RemotePreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
25
|
-
}
|
|
26
|
-
export declare class SsrPreviewError extends MediaCardError {
|
|
27
|
-
readonly primaryReason: SsrPreviewPrimaryReason;
|
|
28
|
-
readonly secondaryError?: Error | undefined;
|
|
29
|
-
constructor(primaryReason: SsrPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
30
|
-
}
|
|
31
|
-
export declare const getImageLoadPrimaryReason: (source?: import("./types").CardPreviewSource | undefined) => ImageLoadPrimaryReason;
|
|
32
|
-
export declare class ImageLoadError extends MediaCardError {
|
|
33
|
-
constructor(source?: CardPreview['source']);
|
|
34
|
-
}
|
|
35
|
-
export declare function isMediaCardError(err: Error): err is MediaCardError;
|
|
36
|
-
export declare const isLocalPreviewError: (err: Error) => err is LocalPreviewError;
|
|
37
|
-
export declare const isRemotePreviewError: (err: Error) => err is LocalPreviewError;
|
|
38
|
-
export declare const isUnsupportedLocalPreviewError: (err: Error) => boolean;
|
|
39
|
-
export declare function isImageLoadError(err: Error): err is ImageLoadError;
|
|
40
|
-
export declare const ensureMediaCardError: (primaryReason: MediaCardErrorPrimaryReason, error: Error) => MediaCardError;
|
|
41
|
-
export declare const isUploadError: (error?: MediaCardError | undefined) => boolean | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { WrapperProps } from './styles';
|
|
4
|
-
export declare const CardImageViewWrapper: (props: WrapperProps) => jsx.JSX.Element;
|
|
5
|
-
export declare const PlayIconWrapper: (props: any) => jsx.JSX.Element;
|
|
6
|
-
export declare const ProgressBarWrapper: (props: any) => jsx.JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { OverlayProps } from './styles';
|
|
4
|
-
export declare const Overlay: (props: OverlayProps) => jsx.JSX.Element;
|
|
5
|
-
export declare const ErrorMessage: (props: any) => jsx.JSX.Element;
|
|
6
|
-
export declare const AltWrapper: (props: any) => jsx.JSX.Element;
|
|
7
|
-
export declare const TitleWrapper: (props: any) => jsx.JSX.Element;
|
|
8
|
-
export declare const Metadata: (props: any) => jsx.JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { MouseEvent, Component, ReactNode } from 'react';
|
|
4
|
-
import { MediaType } from '@atlaskit/media-client';
|
|
5
|
-
import { CardAction, CardEventHandler } from '../../../actions';
|
|
6
|
-
import { CardStatus } from '../../../index';
|
|
7
|
-
export interface CardOverlayProps {
|
|
8
|
-
readonly cardStatus: CardStatus;
|
|
9
|
-
mediaType?: MediaType;
|
|
10
|
-
mediaName?: string;
|
|
11
|
-
subtitle?: string;
|
|
12
|
-
selectable?: boolean;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
persistent: boolean;
|
|
15
|
-
error?: ReactNode;
|
|
16
|
-
alt?: string;
|
|
17
|
-
noHover?: boolean;
|
|
18
|
-
actions?: Array<CardAction>;
|
|
19
|
-
icon?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface CardOverlayState {
|
|
22
|
-
isMenuExpanded: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare class CardOverlay extends Component<CardOverlayProps, CardOverlayState> {
|
|
25
|
-
static defaultProps: {
|
|
26
|
-
actions: never[];
|
|
27
|
-
mediaName: string;
|
|
28
|
-
};
|
|
29
|
-
constructor(props: CardOverlayProps);
|
|
30
|
-
private get wrapperClassNames();
|
|
31
|
-
render(): jsx.JSX.Element;
|
|
32
|
-
errorLine(): false | "" | 0 | jsx.JSX.Element | null | undefined;
|
|
33
|
-
tickBox(): false | jsx.JSX.Element | undefined;
|
|
34
|
-
bottomLeftColumn(): jsx.JSX.Element | undefined;
|
|
35
|
-
onMenuToggle: (attrs: {
|
|
36
|
-
isOpen: boolean;
|
|
37
|
-
}) => void;
|
|
38
|
-
removeBtnClick(handler: CardEventHandler): (e: MouseEvent<HTMLDivElement, any>) => void;
|
|
39
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* Everything about this file change is just wrong.
|
|
4
|
-
* Mostly because we do bad things with classes.
|
|
5
|
-
* This is all wrong and hopefully will be removed from existence with card v3,
|
|
6
|
-
* so please don’t be too sad about all this!
|
|
7
|
-
*/
|
|
8
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
9
|
-
export interface OverlayProps {
|
|
10
|
-
hasError?: boolean;
|
|
11
|
-
noHover?: boolean;
|
|
12
|
-
className?: string;
|
|
13
|
-
children?: JSX.Element[];
|
|
14
|
-
}
|
|
15
|
-
export declare const tickBoxStyles: import("@emotion/react").SerializedStyles;
|
|
16
|
-
export declare const overlayStyles: (props: OverlayProps) => import("@emotion/react").SerializedStyles;
|
|
17
|
-
export declare const errorLineStyles: import("@emotion/react").SerializedStyles;
|
|
18
|
-
export declare const leftColumnStyles: import("@emotion/react").SerializedStyles;
|
|
19
|
-
export declare const topRowStyles: import("@emotion/react").SerializedStyles;
|
|
20
|
-
export declare const bottomRowStyles: import("@emotion/react").SerializedStyles;
|
|
21
|
-
export declare const rightColumnStyles: import("@emotion/react").SerializedStyles;
|
|
22
|
-
export declare const errorMessageStyles: import("@emotion/react").SerializedStyles;
|
|
23
|
-
export declare const altWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
24
|
-
export declare const titleWrapperStyles: (theme: GlobalThemeTokens) => import("@emotion/react").SerializedStyles;
|
|
25
|
-
export declare const subtitleStyles: import("@emotion/react").SerializedStyles;
|
|
26
|
-
export declare const metadataStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { Component, ReactNode } from 'react';
|
|
4
|
-
import { MediaItemType, MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
5
|
-
import { CardDimensions, CardStatus } from '../../index';
|
|
6
|
-
import { CardAction } from '../../actions';
|
|
7
|
-
import { CardPreview } from '../..';
|
|
8
|
-
export interface FileCardImageViewProps {
|
|
9
|
-
readonly mediaName?: string;
|
|
10
|
-
readonly mediaType?: MediaType;
|
|
11
|
-
readonly mimeType?: string;
|
|
12
|
-
readonly fileSize?: string;
|
|
13
|
-
readonly dataURI?: string;
|
|
14
|
-
readonly alt?: string;
|
|
15
|
-
readonly progress?: number;
|
|
16
|
-
readonly status: CardStatus;
|
|
17
|
-
readonly mediaItemType: MediaItemType;
|
|
18
|
-
readonly dimensions?: CardDimensions;
|
|
19
|
-
readonly resizeMode?: ImageResizeMode;
|
|
20
|
-
readonly disableOverlay?: boolean;
|
|
21
|
-
readonly selectable?: boolean;
|
|
22
|
-
readonly selected?: boolean;
|
|
23
|
-
readonly error?: ReactNode;
|
|
24
|
-
readonly actions?: CardAction[];
|
|
25
|
-
readonly onDisplayImage?: () => void;
|
|
26
|
-
readonly previewOrientation?: number;
|
|
27
|
-
readonly onImageError?: (cardPreview: CardPreview) => void;
|
|
28
|
-
readonly onImageLoad?: (cardPreview: CardPreview) => void;
|
|
29
|
-
readonly cardPreview: CardPreview;
|
|
30
|
-
}
|
|
31
|
-
export declare class FileCardImageView extends Component<FileCardImageViewProps> {
|
|
32
|
-
private wasThumbnailDisplayed;
|
|
33
|
-
static defaultProps: Partial<FileCardImageViewProps>;
|
|
34
|
-
render(): jsx.JSX.Element;
|
|
35
|
-
private renderCardContents;
|
|
36
|
-
private renderLoadingContents;
|
|
37
|
-
private renderErrorContents;
|
|
38
|
-
private renderFailedContents;
|
|
39
|
-
private renderUploadingCardOverlay;
|
|
40
|
-
private renderPlayButton;
|
|
41
|
-
onImageLoad: () => void;
|
|
42
|
-
onImageError: () => void;
|
|
43
|
-
private renderMediaImage;
|
|
44
|
-
private renderProgressBar;
|
|
45
|
-
private renderSuccessCardContents;
|
|
46
|
-
private renderSuccessCardOverlay;
|
|
47
|
-
private get isFileCardImageReadyForDisplay();
|
|
48
|
-
private get isCropped();
|
|
49
|
-
private get isStretched();
|
|
50
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
3
|
-
import { CardStatus } from '../../index';
|
|
4
|
-
export interface WrapperProps {
|
|
5
|
-
disableOverlay?: boolean;
|
|
6
|
-
selectable?: boolean;
|
|
7
|
-
selected?: boolean;
|
|
8
|
-
hasOnClick?: boolean;
|
|
9
|
-
mediaType?: string;
|
|
10
|
-
mediaName?: string;
|
|
11
|
-
progress?: number;
|
|
12
|
-
status?: CardStatus;
|
|
13
|
-
theme?: GlobalThemeTokens;
|
|
14
|
-
children?: JSX.Element | JSX.Element[];
|
|
15
|
-
}
|
|
16
|
-
export declare const wrapperStyles: (props: WrapperProps) => import("@emotion/react").SerializedStyles;
|
|
17
|
-
export declare const playIconWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
18
|
-
export declare const playIconBackgroundStyles: import("@emotion/react").SerializedStyles;
|
|
19
|
-
export declare const progressBarWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
20
|
-
export declare const overlayStyles: import("@emotion/react").SerializedStyles;
|
|
21
|
-
export declare const titleStyles: import("@emotion/react").SerializedStyles;
|
|
22
|
-
export declare const bodyStyles: import("@emotion/react").SerializedStyles;
|
|
23
|
-
export declare const progressWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
24
|
-
export declare const cardActionsWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MediaCardPageObject } from './__tests_external__';
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from 'react';
|
|
2
|
-
import { FileDetails, MediaClient, Identifier, ImageResizeMode, FileState } from '@atlaskit/media-client';
|
|
3
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
import { MediaFeatureFlags, NumericalCardDimensions, SSR } from '@atlaskit/media-common';
|
|
5
|
-
import { CardAction } from './actions';
|
|
6
|
-
import { MediaViewerDataSource } from '@atlaskit/media-viewer';
|
|
7
|
-
import { CardPreview, CardStatus, CardAppearance } from './types';
|
|
8
|
-
import { MediaCardError } from './errors';
|
|
9
|
-
import { CardDimensions } from './utils';
|
|
10
|
-
export type { CardDimensions } from './utils';
|
|
11
|
-
export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
12
|
-
export { Card, MediaInlineCard } from './root';
|
|
13
|
-
export type { CardAction, CardEventHandler } from './actions';
|
|
14
|
-
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, } from './types';
|
|
15
|
-
export declare type TitleBoxIcon = 'LockFilledIcon';
|
|
16
|
-
export interface CardEvent {
|
|
17
|
-
event: MouseEvent<HTMLElement>;
|
|
18
|
-
mediaItemDetails?: FileDetails;
|
|
19
|
-
}
|
|
20
|
-
export interface SharedCardProps {
|
|
21
|
-
readonly disableOverlay?: boolean;
|
|
22
|
-
readonly resizeMode?: ImageResizeMode;
|
|
23
|
-
readonly featureFlags?: MediaFeatureFlags;
|
|
24
|
-
readonly appearance?: CardAppearance;
|
|
25
|
-
readonly dimensions?: CardDimensions;
|
|
26
|
-
readonly originalDimensions?: NumericalCardDimensions;
|
|
27
|
-
readonly actions?: Array<CardAction>;
|
|
28
|
-
readonly selectable?: boolean;
|
|
29
|
-
readonly selected?: boolean;
|
|
30
|
-
readonly alt?: string;
|
|
31
|
-
readonly testId?: string;
|
|
32
|
-
readonly titleBoxBgColor?: string;
|
|
33
|
-
readonly titleBoxIcon?: TitleBoxIcon;
|
|
34
|
-
}
|
|
35
|
-
export interface CardOnClickCallback {
|
|
36
|
-
(result: CardEvent, analyticsEvent?: UIAnalyticsEvent): void;
|
|
37
|
-
}
|
|
38
|
-
export interface CardEventProps {
|
|
39
|
-
readonly onClick?: CardOnClickCallback;
|
|
40
|
-
readonly onMouseEnter?: (result: CardEvent) => void;
|
|
41
|
-
/** Callback function to be called when video enters and exit fullscreen.
|
|
42
|
-
* `fullscreen = true` indicates video enters fullscreen
|
|
43
|
-
* `fullscreen = false` indicates video exits fullscreen
|
|
44
|
-
*/
|
|
45
|
-
readonly onFullscreenChange?: (fullscreen: boolean) => void;
|
|
46
|
-
}
|
|
47
|
-
export interface CardProps extends SharedCardProps, CardEventProps {
|
|
48
|
-
readonly mediaClient: MediaClient;
|
|
49
|
-
readonly identifier: Identifier;
|
|
50
|
-
readonly isLazy?: boolean;
|
|
51
|
-
readonly useInlinePlayer?: boolean;
|
|
52
|
-
readonly shouldOpenMediaViewer?: boolean;
|
|
53
|
-
readonly mediaViewerDataSource?: MediaViewerDataSource;
|
|
54
|
-
readonly contextId?: string;
|
|
55
|
-
readonly shouldEnableDownloadButton?: boolean;
|
|
56
|
-
readonly ssr?: SSR;
|
|
57
|
-
}
|
|
58
|
-
export interface CardState {
|
|
59
|
-
status: CardStatus;
|
|
60
|
-
isCardVisible: boolean;
|
|
61
|
-
shouldAutoplay?: boolean;
|
|
62
|
-
isPlayingFile: boolean;
|
|
63
|
-
mediaViewerSelectedItem?: Identifier;
|
|
64
|
-
fileState?: FileState;
|
|
65
|
-
progress?: number;
|
|
66
|
-
cardPreview?: CardPreview;
|
|
67
|
-
error?: MediaCardError;
|
|
68
|
-
cardRef: HTMLDivElement | null;
|
|
69
|
-
isBannedLocalPreview: boolean;
|
|
70
|
-
previewDidRender: boolean;
|
|
71
|
-
}
|
|
72
|
-
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
73
|
-
export { CardError } from './utils/lightCards/cardError';
|
|
74
|
-
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
75
|
-
export { fileCardImageViewSelector, fileCardImageViewSelectedSelector, } from './files/cardImageView/classnames';
|
|
76
|
-
export { inlinePlayerClassName } from './root/styles';
|
|
77
|
-
export { newFileExperienceClassName } from './root/card/cardConstants';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FileAttributes, PerformanceAttributes } from '@atlaskit/media-common';
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { SSRStatus } from '../../utils/analytics';
|
|
4
|
-
import { CardStatus } from '../..';
|
|
5
|
-
import { MediaCardError } from './../../errors';
|
|
6
|
-
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error?: MediaCardError) => void;
|
|
7
|
-
export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => void;
|
|
8
|
-
export declare const fireCopiedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileId: string, cardRef: HTMLDivElement) => void;
|
|
9
|
-
export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const newFileExperienceClassName = "new-file-experience-wrapper";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import type { CardBaseProps } from '.';
|
|
4
|
-
export declare type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
5
|
-
declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
|
|
6
|
-
export default CardLoader;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { FileState } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { CardState } from '../..';
|
|
4
|
-
export declare const createStateUpdater: (newState: Partial<CardState>) => (prevState: CardState) => Pick<CardState, keyof CardState>;
|
|
5
|
-
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags | undefined) => Partial<CardState>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
2
|
-
import { ObjectURLCache } from '../../../utils/objectURLCache';
|
|
3
|
-
import { CardPreview } from '../../../types';
|
|
4
|
-
declare type Mode = ImageResizeMode | undefined;
|
|
5
|
-
export declare const getCacheKey: (id: string, mode: Mode) => string;
|
|
6
|
-
export interface CardPreviewCache {
|
|
7
|
-
get(id: string, mode: Mode): CardPreview | undefined;
|
|
8
|
-
set(id: string, mode: Mode, cardPreview: CardPreview): void;
|
|
9
|
-
remove(id: string, mode: Mode): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class CardPreviewCacheImpl implements CardPreviewCache {
|
|
12
|
-
private previewCache;
|
|
13
|
-
constructor(previewCache: ObjectURLCache);
|
|
14
|
-
get: (id: string, mode: Mode) => CardPreview | undefined;
|
|
15
|
-
set: (id: string, mode: Mode, cardPreview: CardPreview) => void;
|
|
16
|
-
remove: (id: string, mode: Mode) => void;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: CardPreviewCacheImpl;
|
|
19
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
2
|
-
import { CardStatus, FilePreviewStatus } from '../../../types';
|
|
3
|
-
import { FileState } from '@atlaskit/media-client';
|
|
4
|
-
export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags | undefined) => FilePreviewStatus;
|
|
5
|
-
export declare const isPreviewableStatus: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, MediaStoreGetFileImageParams, MediaType } from '@atlaskit/media-client';
|
|
2
|
-
import { CardPreview } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* This method tells the support for the media
|
|
5
|
-
* types covered in getCardPreviewFromFilePreview
|
|
6
|
-
*/
|
|
7
|
-
export declare const isSupportedLocalPreview: (mediaType?: MediaType | undefined) => boolean;
|
|
8
|
-
export declare const getCardPreviewFromFilePreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<CardPreview>;
|
|
9
|
-
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams) => Promise<CardPreview>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs, FileIdentifier } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
|
|
3
|
-
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
import { CardDimensions } from '../../../utils/cardDimensions';
|
|
6
|
-
import { MediaCardError } from '../../../errors';
|
|
7
|
-
import { CardStatus, CardPreview } from '../../../types';
|
|
8
|
-
export { getCardPreviewFromFilePreview, getCardPreviewFromBackend, isSupportedLocalPreview, } from './helpers';
|
|
9
|
-
export { extractFilePreviewStatus } from './filePreviewStatus';
|
|
10
|
-
export declare const getCardPreviewFromCache: (id: string, mode: ImageResizeMode | undefined) => CardPreview | undefined;
|
|
11
|
-
export declare const removeCardPreviewFromCache: (id: string, mode: ImageResizeMode | undefined) => void;
|
|
12
|
-
/**
|
|
13
|
-
* Will return the preview if available and supported by the browser
|
|
14
|
-
* See extractFilePreviewStatus "hasLocalPreview" logic
|
|
15
|
-
*/
|
|
16
|
-
export declare const getFilePreviewFromFileState: (fileState: FileState) => FilePreview | Promise<FilePreview> | undefined;
|
|
17
|
-
export declare type CardPreviewParams = {
|
|
18
|
-
mediaClient: MediaClient;
|
|
19
|
-
id: string;
|
|
20
|
-
dimensions?: CardDimensions;
|
|
21
|
-
filePreview?: FilePreview | Promise<FilePreview>;
|
|
22
|
-
onLocalPreviewError?: (error: MediaCardError) => void;
|
|
23
|
-
isRemotePreviewReady: boolean;
|
|
24
|
-
imageUrlParams: MediaStoreGetFileImageParams;
|
|
25
|
-
mediaBlobUrlAttrs?: MediaBlobUrlAttrs;
|
|
26
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
27
|
-
featureFlags?: MediaFeatureFlags;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* This function will try to return a Card preview, either from cache, local preview or remote preview.
|
|
31
|
-
* It should only be called if there is a chance to get either a remote or a local preview, or both.
|
|
32
|
-
* This, in order to ensure there is always going to be a valid return value OR throw an error if the process fails.
|
|
33
|
-
* It is worth noting that local preview failures break the process if there is no remote preview available.
|
|
34
|
-
* In that case we throw an error immediately.
|
|
35
|
-
* Otherwise, if the local preview fails but there is a remote preview available, the failure does not break the process.
|
|
36
|
-
* In that case, we still want to report the local preview error to the caller, for feature realiability track.
|
|
37
|
-
* hence the use of the optional callback onLocalPreviewError
|
|
38
|
-
*/
|
|
39
|
-
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, }: CardPreviewParams) => Promise<CardPreview>;
|
|
40
|
-
export declare const shouldResolvePreview: ({ status, fileState, dimensions, identifier, fileImageMode, hasCardPreview, isBannedLocalPreview, featureFlags, }: {
|
|
41
|
-
status: CardStatus;
|
|
42
|
-
fileState: FileState;
|
|
43
|
-
dimensions?: CardDimensions | undefined;
|
|
44
|
-
identifier: FileIdentifier;
|
|
45
|
-
fileImageMode?: ImageResizeMode | undefined;
|
|
46
|
-
hasCardPreview: boolean;
|
|
47
|
-
isBannedLocalPreview: boolean;
|
|
48
|
-
featureFlags?: MediaFeatureFlags | undefined;
|
|
49
|
-
}) => boolean;
|
|
50
|
-
export declare const getSSRCardPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined) => CardPreview;
|
|
51
|
-
export declare const isLocalPreview: (preview: CardPreview) => boolean;
|
|
52
|
-
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
53
|
-
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
54
|
-
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
55
|
-
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
56
|
-
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined) => Promise<CardPreview>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FileStatus } from '@atlaskit/media-client';
|
|
2
|
-
import { CardStatus, FilePreviewStatus } from '../../types';
|
|
3
|
-
export declare const isFinalCardStatus: (status: CardStatus) => boolean;
|
|
4
|
-
export declare const getCardStatus: (fileStatus: FileStatus, { hasFilesize, isPreviewable, hasPreview }: FilePreviewStatus) => CardStatus;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { CardDimensions } from '../../utils';
|
|
3
|
-
import { CardPreviewAttributes } from '../../utils/analytics';
|
|
4
|
-
declare type cardAction = 'cache-hit' | 'remote-success';
|
|
5
|
-
export declare const fireImageFetchingOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, action: cardAction, cardPreviewAttributes: CardPreviewAttributes) => void;
|
|
6
|
-
export declare const calculatePercentageDifference: (prevDimensions: CardDimensions | undefined, currentDimensions: CardDimensions | undefined) => {
|
|
7
|
-
width: string;
|
|
8
|
-
height: string;
|
|
9
|
-
} | undefined;
|
|
10
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
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, CardProps, CardState, CardStatus } from '../..';
|
|
6
|
-
export declare type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
|
|
7
|
-
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
8
|
-
private internalOccurrenceKey;
|
|
9
|
-
private hasBeenMounted;
|
|
10
|
-
private fileStateFlags;
|
|
11
|
-
private ssrReliability;
|
|
12
|
-
private timeElapsedTillCommenced;
|
|
13
|
-
subscription?: MediaSubscription;
|
|
14
|
-
private ssrData?;
|
|
15
|
-
static defaultProps: Partial<CardProps>;
|
|
16
|
-
constructor(props: CardBaseProps);
|
|
17
|
-
componentDidMount(): void;
|
|
18
|
-
componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
|
|
19
|
-
componentWillUnmount(): void;
|
|
20
|
-
updateStateForIdentifier(identifier: FileIdentifier): void;
|
|
21
|
-
private getImageURLParams;
|
|
22
|
-
private getMediaBlobUrlAttrs;
|
|
23
|
-
private getCardPreviewParams;
|
|
24
|
-
private setCacheSSRPreview;
|
|
25
|
-
private refetchSSRPreview;
|
|
26
|
-
private resolvePreview;
|
|
27
|
-
updateFileStateFlag(fileState?: FileState): void;
|
|
28
|
-
subscribeInternalFile(identifier: FileIdentifier): void;
|
|
29
|
-
private get requestedDimensions();
|
|
30
|
-
private get metadata();
|
|
31
|
-
private get fileAttributes();
|
|
32
|
-
private getPerformanceAttributes;
|
|
33
|
-
private logSSRImageError;
|
|
34
|
-
private onImageError;
|
|
35
|
-
private onImageLoad;
|
|
36
|
-
private fireOperationalEvent;
|
|
37
|
-
private fireCommencedEvent;
|
|
38
|
-
private fireCopiedEvent;
|
|
39
|
-
private fireScreenEvent;
|
|
40
|
-
private fireLocalPreviewErrorEvent;
|
|
41
|
-
private safeSetState;
|
|
42
|
-
unsubscribe: () => void;
|
|
43
|
-
get actions(): CardAction[];
|
|
44
|
-
onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
|
45
|
-
onInlinePlayerError: () => void;
|
|
46
|
-
setRef: (cardRef: HTMLDivElement | null) => void;
|
|
47
|
-
renderInlinePlayer: () => JSX.Element;
|
|
48
|
-
onMediaViewerClose: () => void;
|
|
49
|
-
private onDisplayImage;
|
|
50
|
-
renderMediaViewer: () => React.ReactPortal | undefined;
|
|
51
|
-
renderCard: (withCallbacks?: boolean, cardStatusOverride?: CardStatus | undefined, izLazyOverride?: boolean | undefined) => JSX.Element;
|
|
52
|
-
private storeSSRData;
|
|
53
|
-
render(): JSX.Element;
|
|
54
|
-
private onCardInViewport;
|
|
55
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
|
56
|
-
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
57
|
-
}
|
|
58
|
-
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
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 '../index';
|
|
8
|
-
import { MediaCardError } from '../errors';
|
|
9
|
-
import { CardPreview } from '..';
|
|
10
|
-
import { MediaCardCursor } from '../types';
|
|
11
|
-
export interface CardViewOwnProps extends SharedCardProps {
|
|
12
|
-
readonly status: CardStatus;
|
|
13
|
-
readonly mediaItemType: MediaItemType;
|
|
14
|
-
readonly mediaCardCursor?: MediaCardCursor;
|
|
15
|
-
readonly metadata?: FileDetails;
|
|
16
|
-
readonly error?: MediaCardError;
|
|
17
|
-
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
18
|
-
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
19
|
-
readonly onDisplayImage?: () => void;
|
|
20
|
-
readonly cardPreview?: CardPreview;
|
|
21
|
-
readonly progress?: number;
|
|
22
|
-
readonly innerRef?: (instance: HTMLDivElement | null) => void;
|
|
23
|
-
readonly onImageLoad: (cardPreview: CardPreview) => void;
|
|
24
|
-
readonly onImageError: (cardPreview: CardPreview) => void;
|
|
25
|
-
readonly nativeLazyLoad?: boolean;
|
|
26
|
-
readonly forceSyncDisplay?: boolean;
|
|
27
|
-
disableAnimation?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface CardViewState {
|
|
30
|
-
elementWidth?: number;
|
|
31
|
-
didImageRender: boolean;
|
|
32
|
-
}
|
|
33
|
-
export declare type CardViewProps = CardViewOwnProps & WithAnalyticsEventsProps;
|
|
34
|
-
export interface RenderConfigByStatus {
|
|
35
|
-
renderTypeIcon?: boolean;
|
|
36
|
-
iconMessage?: JSX.Element;
|
|
37
|
-
renderImageRenderer?: boolean;
|
|
38
|
-
renderPlayButton?: boolean;
|
|
39
|
-
renderTitleBox?: boolean;
|
|
40
|
-
renderBlanket?: boolean;
|
|
41
|
-
isFixedBlanket?: boolean;
|
|
42
|
-
renderProgressBar?: boolean;
|
|
43
|
-
renderSpinner?: boolean;
|
|
44
|
-
renderFailedTitleBox?: boolean;
|
|
45
|
-
renderTickBox?: boolean;
|
|
46
|
-
customTitleMessage?: MessageDescriptor;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
50
|
-
* `createAnalyticsEvent` prop to satisfy it's Analytics Events needs.
|
|
51
|
-
*/
|
|
52
|
-
export declare class CardViewBase extends React.Component<CardViewProps, CardViewState> {
|
|
53
|
-
state: CardViewState;
|
|
54
|
-
divRef: React.RefObject<HTMLDivElement>;
|
|
55
|
-
static defaultProps: Partial<CardViewOwnProps>;
|
|
56
|
-
componentDidMount(): void;
|
|
57
|
-
componentDidUpdate({ cardPreview: prevCardPreview }: CardViewProps): void;
|
|
58
|
-
private onImageLoad;
|
|
59
|
-
private onImageError;
|
|
60
|
-
private get width();
|
|
61
|
-
private get breakpoint();
|
|
62
|
-
saveElementWidth: () => void;
|
|
63
|
-
render(): jsx.JSX.Element;
|
|
64
|
-
private renderSpinner;
|
|
65
|
-
private shouldRenderPlayButton;
|
|
66
|
-
private renderPlayButton;
|
|
67
|
-
private renderBlanket;
|
|
68
|
-
private renderTitleBox;
|
|
69
|
-
private renderFailedTitleBox;
|
|
70
|
-
private renderProgressBar;
|
|
71
|
-
private renderImageRenderer;
|
|
72
|
-
private renderTickBox;
|
|
73
|
-
private renderMediaTypeIcon;
|
|
74
|
-
private renderActionsBar;
|
|
75
|
-
private renderFileNewExperience;
|
|
76
|
-
private renderFile;
|
|
77
|
-
private getRenderConfigByStatus;
|
|
78
|
-
private renderNewExperienceCard;
|
|
79
|
-
}
|
|
80
|
-
export declare const CardView: React.ForwardRefExoticComponent<Pick<Omit<CardViewProps, keyof WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<CardViewProps, keyof WithAnalyticsEventsProps>, keyof CardViewOwnProps>> & Partial<Pick<Partial<CardViewOwnProps>, never>> & React.RefAttributes<any>>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import { MediaInlineCardProps } from './mediaInlineCard';
|
|
4
|
-
export declare type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
5
|
-
declare type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
6
|
-
declare type ErrorBoundaryComponent = React.ComponentType<{
|
|
7
|
-
data?: {
|
|
8
|
-
[k: string]: any;
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
export interface MediaInlineCardLoaderState {
|
|
12
|
-
MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
13
|
-
ErrorBoundary?: ErrorBoundaryComponent;
|
|
14
|
-
}
|
|
15
|
-
export default class MediaInlineCardLoader extends React.PureComponent<MediaInlineCardWithMediaClientConfigProps & MediaInlineCardLoaderState, MediaInlineCardLoaderState> {
|
|
16
|
-
static displayName: string;
|
|
17
|
-
static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
18
|
-
static ErrorBoundary?: ErrorBoundaryComponent;
|
|
19
|
-
isMounted: boolean;
|
|
20
|
-
state: MediaInlineCardLoaderState;
|
|
21
|
-
componentDidMount(): Promise<void>;
|
|
22
|
-
componentWillUnmount(): Promise<void>;
|
|
23
|
-
render(): JSX.Element;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { FileIdentifier, MediaClient } from '@atlaskit/media-client';
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { MediaViewerDataSource } from '@atlaskit/media-viewer';
|
|
5
|
-
export interface MediaInlineCardProps {
|
|
6
|
-
identifier: FileIdentifier;
|
|
7
|
-
mediaClient: MediaClient;
|
|
8
|
-
shouldOpenMediaViewer?: boolean;
|
|
9
|
-
isSelected?: boolean;
|
|
10
|
-
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
11
|
-
mediaViewerDataSource?: MediaViewerDataSource;
|
|
12
|
-
}
|
|
13
|
-
export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
|
|
14
|
-
export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
|