@atlaskit/media-card 77.1.0 → 77.1.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 +14 -0
- package/dist/cjs/card/card.js +17 -13
- package/dist/cjs/card/cardState.js +1 -1
- package/dist/cjs/card/cardSwitcher.js +5 -1
- package/dist/cjs/card/getCardPreview/index.js +2 -5
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +21 -17
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +18 -14
- package/dist/es2019/card/card.js +18 -16
- package/dist/es2019/card/cardState.js +1 -1
- package/dist/es2019/card/cardSwitcher.js +5 -1
- package/dist/es2019/card/getCardPreview/index.js +0 -5
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +22 -20
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +18 -9
- package/dist/esm/card/card.js +18 -14
- package/dist/esm/card/cardState.js +1 -1
- package/dist/esm/card/cardSwitcher.js +5 -1
- package/dist/esm/card/getCardPreview/index.js +2 -5
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +22 -18
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +17 -13
- package/dist/types/card/card.d.ts +1 -0
- package/dist/types/card/cardState.d.ts +1 -2
- package/dist/types/card/cardSwitcher.d.ts +3 -2
- package/dist/types/card/getCardPreview/index.d.ts +4 -10
- package/dist/types/card/v2/cardV2.d.ts +3 -2
- package/dist/types/utils/ufoExperiences.d.ts +7 -0
- package/package.json +2 -2
- package/report.api.md +1 -2
- package/dist/types-ts4.5/card/actions.d.ts +0 -9
- package/dist/types-ts4.5/card/card.d.ts +0 -63
- package/dist/types-ts4.5/card/cardAnalytics.d.ts +0 -10
- package/dist/types-ts4.5/card/cardConstants.d.ts +0 -1
- package/dist/types-ts4.5/card/cardLoader.d.ts +0 -6
- package/dist/types-ts4.5/card/cardState.d.ts +0 -10
- package/dist/types-ts4.5/card/cardSwitcher.d.ts +0 -3
- package/dist/types-ts4.5/card/cardView.d.ts +0 -78
- package/dist/types-ts4.5/card/classnames.d.ts +0 -2
- package/dist/types-ts4.5/card/getCardPreview/cache.d.ts +0 -21
- package/dist/types-ts4.5/card/getCardPreview/filePreviewStatus.d.ts +0 -4
- package/dist/types-ts4.5/card/getCardPreview/helpers.d.ts +0 -10
- package/dist/types-ts4.5/card/getCardPreview/index.d.ts +0 -59
- package/dist/types-ts4.5/card/getCardStatus.d.ts +0 -4
- package/dist/types-ts4.5/card/index.d.ts +0 -1
- package/dist/types-ts4.5/card/inlinePlayer.d.ts +0 -52
- package/dist/types-ts4.5/card/inlinePlayerLazy.d.ts +0 -2
- package/dist/types-ts4.5/card/inlinePlayerWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/inlinePlayerWrapperStyles.d.ts +0 -6
- package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +0 -14
- package/dist/types-ts4.5/card/types.d.ts +0 -13
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBar.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionButton.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +0 -12
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.d.ts +0 -14
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsView.d.ts +0 -16
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/index.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/styles.d.ts +0 -18
- package/dist/types-ts4.5/card/ui/actionsBar/styles.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/actionsBar/types.d.ts +0 -10
- package/dist/types-ts4.5/card/ui/blanket/blanket.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/blanket/styles.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/common.d.ts +0 -23
- package/dist/types-ts4.5/card/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/iconMessage/index.d.ts +0 -8
- package/dist/types-ts4.5/card/ui/iconMessage/styles.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/iconMessage/types.d.ts +0 -19
- package/dist/types-ts4.5/card/ui/iconWrapper/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/iconWrapper/types.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/imageRenderer/imageRenderer.d.ts +0 -15
- package/dist/types-ts4.5/card/ui/imageRenderer/resizeModeToMediaImageProps.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/playButton/playButton.d.ts +0 -2
- package/dist/types-ts4.5/card/ui/playButton/playButtonBackground.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/playButton/playButtonWrapper.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/playButton/styles.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/progressBar/progressBar.d.ts +0 -10
- package/dist/types-ts4.5/card/ui/progressBar/styledBar.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/progressBar/styles.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/progressBar/types.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/styles.d.ts +0 -13
- package/dist/types-ts4.5/card/ui/tickBox/styles.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/tickBox/tickBox.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/tickBox/tickBoxWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/tickBox/types.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/titleBox/failedTitleBox.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +0 -15
- package/dist/types-ts4.5/card/ui/titleBox/titleBox.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/titleBox/titleBoxComponents.d.ts +0 -8
- package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +0 -34
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/index.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/types.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/wrapper/index.d.ts +0 -1
- package/dist/types-ts4.5/card/ui/wrapper/styles.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/wrapper/types.d.ts +0 -25
- package/dist/types-ts4.5/card/ui/wrapper/wrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/cardV2.d.ts +0 -62
- package/dist/types-ts4.5/card/v2/cardV2Loader.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +0 -44
- package/dist/types-ts4.5/classnames.d.ts +0 -5
- package/dist/types-ts4.5/errors.d.ts +0 -53
- package/dist/types-ts4.5/index.d.ts +0 -15
- package/dist/types-ts4.5/inline/index.d.ts +0 -1
- package/dist/types-ts4.5/inline/loader.d.ts +0 -26
- package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +0 -12
- package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +0 -15
- package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +0 -6
- package/dist/types-ts4.5/types.d.ts +0 -105
- package/dist/types-ts4.5/utils/analytics.d.ts +0 -101
- package/dist/types-ts4.5/utils/cardDimensions.d.ts +0 -14
- package/dist/types-ts4.5/utils/containsPixelUnit.d.ts +0 -1
- package/dist/types-ts4.5/utils/dimensionComparer.d.ts +0 -3
- package/dist/types-ts4.5/utils/document.d.ts +0 -2
- package/dist/types-ts4.5/utils/generateUniqueId.d.ts +0 -1
- package/dist/types-ts4.5/utils/getCSSUnitValue.d.ts +0 -1
- package/dist/types-ts4.5/utils/getDataURIDimension.d.ts +0 -9
- package/dist/types-ts4.5/utils/getElementDimension.d.ts +0 -2
- package/dist/types-ts4.5/utils/getMediaCardCursor.d.ts +0 -6
- package/dist/types-ts4.5/utils/globalScope/getSSRData.d.ts +0 -3
- package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +0 -21
- package/dist/types-ts4.5/utils/globalScope/index.d.ts +0 -4
- package/dist/types-ts4.5/utils/globalScope/types.d.ts +0 -8
- package/dist/types-ts4.5/utils/index.d.ts +0 -6
- package/dist/types-ts4.5/utils/isRetina.d.ts +0 -1
- package/dist/types-ts4.5/utils/isValidPercentageUnit.d.ts +0 -1
- package/dist/types-ts4.5/utils/lightCards/cardError.d.ts +0 -12
- package/dist/types-ts4.5/utils/lightCards/cardLoading.d.ts +0 -5
- package/dist/types-ts4.5/utils/lightCards/errorIcon/index.d.ts +0 -12
- package/dist/types-ts4.5/utils/lightCards/errorIcon/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/lightCards/getDimensionsWithDefault.d.ts +0 -2
- package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +0 -4
- package/dist/types-ts4.5/utils/lightCards/styles.d.ts +0 -2
- package/dist/types-ts4.5/utils/lightCards/types.d.ts +0 -15
- package/dist/types-ts4.5/utils/metadata.d.ts +0 -2
- package/dist/types-ts4.5/utils/mockIntersectionObserver.d.ts +0 -20
- package/dist/types-ts4.5/utils/objectURLCache.d.ts +0 -12
- package/dist/types-ts4.5/utils/preventClickThrough.d.ts +0 -8
- package/dist/types-ts4.5/utils/printScript.d.ts +0 -2
- package/dist/types-ts4.5/utils/ufoExperiences.d.ts +0 -7
- package/dist/types-ts4.5/utils/videoIsPlayable.d.ts +0 -2
- package/dist/types-ts4.5/utils/videoSnapshot.d.ts +0 -1
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +0 -6
- package/tmp/api-report-tmp.d.ts +0 -346
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import type { CardBaseProps } from './card';
|
|
4
|
-
export type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
5
|
-
declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
|
|
6
|
-
export default CardLoader;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FileState } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { CardState } from '../types';
|
|
4
|
-
import { MediaCardError } from '../errors';
|
|
5
|
-
/**
|
|
6
|
-
* From docs: "Both state and props received by the updater function are guaranteed to be up-to-date.
|
|
7
|
-
* The output of the updater is shallowly merged with state."
|
|
8
|
-
*/
|
|
9
|
-
export declare const createStateUpdater: (newState: Partial<CardState>, fireErrorEvent: (error: MediaCardError) => void) => (prevState: CardState) => Partial<CardState>;
|
|
10
|
-
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags) => Partial<CardState>;
|
|
@@ -1,78 +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 '../types';
|
|
8
|
-
import { MediaCardError } from '../errors';
|
|
9
|
-
import { CardPreview } from '../types';
|
|
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
|
-
shouldHideTooltip?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface CardViewState {
|
|
31
|
-
elementWidth?: number;
|
|
32
|
-
didImageRender: boolean;
|
|
33
|
-
}
|
|
34
|
-
export type CardViewProps = CardViewOwnProps & WithAnalyticsEventsProps;
|
|
35
|
-
export interface RenderConfigByStatus {
|
|
36
|
-
renderTypeIcon?: boolean;
|
|
37
|
-
iconMessage?: JSX.Element;
|
|
38
|
-
renderImageRenderer?: boolean;
|
|
39
|
-
renderPlayButton?: boolean;
|
|
40
|
-
renderTitleBox?: boolean;
|
|
41
|
-
renderBlanket?: boolean;
|
|
42
|
-
isFixedBlanket?: boolean;
|
|
43
|
-
renderProgressBar?: boolean;
|
|
44
|
-
renderSpinner?: boolean;
|
|
45
|
-
renderFailedTitleBox?: boolean;
|
|
46
|
-
renderTickBox?: boolean;
|
|
47
|
-
customTitleMessage?: MessageDescriptor;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
51
|
-
* `createAnalyticsEvent` prop to satisfy it's Analytics Events needs.
|
|
52
|
-
*/
|
|
53
|
-
export declare class CardViewBase extends React.Component<CardViewProps, CardViewState> {
|
|
54
|
-
state: CardViewState;
|
|
55
|
-
divRef: React.RefObject<HTMLDivElement>;
|
|
56
|
-
static defaultProps: Partial<CardViewOwnProps>;
|
|
57
|
-
componentDidMount(): void;
|
|
58
|
-
componentDidUpdate({ cardPreview: prevCardPreview }: CardViewProps): void;
|
|
59
|
-
private onImageLoad;
|
|
60
|
-
private onImageError;
|
|
61
|
-
private get breakpoint();
|
|
62
|
-
private saveElementWidth;
|
|
63
|
-
private renderSpinner;
|
|
64
|
-
private shouldRenderPlayButton;
|
|
65
|
-
private renderPlayButton;
|
|
66
|
-
private renderBlanket;
|
|
67
|
-
private renderTitleBox;
|
|
68
|
-
private renderFailedTitleBox;
|
|
69
|
-
private renderProgressBar;
|
|
70
|
-
private renderImageRenderer;
|
|
71
|
-
private renderTickBox;
|
|
72
|
-
private renderMediaTypeIcon;
|
|
73
|
-
private renderActionsBar;
|
|
74
|
-
render(): jsx.JSX.Element;
|
|
75
|
-
private getRenderConfigByStatus;
|
|
76
|
-
private renderContents;
|
|
77
|
-
}
|
|
78
|
-
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,21 +0,0 @@
|
|
|
1
|
-
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
2
|
-
import { ObjectURLCache } from '../../utils/objectURLCache';
|
|
3
|
-
import { CardPreview } from '../../types';
|
|
4
|
-
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
|
-
clear(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare class CardPreviewCacheImpl implements CardPreviewCache {
|
|
13
|
-
private previewCache;
|
|
14
|
-
constructor(previewCache: ObjectURLCache);
|
|
15
|
-
get: (id: string, mode: Mode) => CardPreview | undefined;
|
|
16
|
-
set: (id: string, mode: Mode, cardPreview: CardPreview) => void;
|
|
17
|
-
remove: (id: string, mode: Mode) => void;
|
|
18
|
-
clear: () => void;
|
|
19
|
-
}
|
|
20
|
-
declare const _default: CardPreviewCacheImpl;
|
|
21
|
-
export default _default;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CardStatus, FilePreviewStatus } from '../../types';
|
|
2
|
-
import { FileState } from '@atlaskit/media-client';
|
|
3
|
-
export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean) => FilePreviewStatus;
|
|
4
|
-
export declare const isPreviewableStatus: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, MediaStoreGetFileImageParams, MediaType } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
-
import { CardPreview } from '../../types';
|
|
4
|
-
/**
|
|
5
|
-
* This method tells the support for the media
|
|
6
|
-
* types covered in getCardPreviewFromFilePreview
|
|
7
|
-
*/
|
|
8
|
-
export declare const isSupportedLocalPreview: (mediaType?: MediaType) => boolean;
|
|
9
|
-
export declare const getCardPreviewFromFilePreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<CardPreview>;
|
|
10
|
-
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext) => Promise<CardPreview>;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs, FileIdentifier } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags, SSR, MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
-
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
import { CardDimensions } from '../../types';
|
|
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 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
|
-
traceContext?: MediaTraceContext;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* This function will try to return a Card preview, either from cache, local preview or remote preview.
|
|
32
|
-
* It should only be called if there is a chance to get either a remote or a local preview, or both.
|
|
33
|
-
* This, in order to ensure there is always going to be a valid return value OR throw an error if the process fails.
|
|
34
|
-
* It is worth noting that local preview failures break the process if there is no remote preview available.
|
|
35
|
-
* In that case we throw an error immediately.
|
|
36
|
-
* Otherwise, if the local preview fails but there is a remote preview available, the failure does not break the process.
|
|
37
|
-
* In that case, we still want to report the local preview error to the caller, for feature realiability track.
|
|
38
|
-
* hence the use of the optional callback onLocalPreviewError
|
|
39
|
-
*/
|
|
40
|
-
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, traceContext, }: CardPreviewParams) => Promise<CardPreview>;
|
|
41
|
-
export declare const shouldResolvePreview: ({ status, fileState, prevDimensions, dimensions, identifier, fileImageMode, hasCardPreview, isBannedLocalPreview, featureFlags, wasResolvedUpfrontPreview, }: {
|
|
42
|
-
status: CardStatus;
|
|
43
|
-
fileState: FileState;
|
|
44
|
-
prevDimensions?: CardDimensions | undefined;
|
|
45
|
-
dimensions?: CardDimensions | undefined;
|
|
46
|
-
identifier: FileIdentifier;
|
|
47
|
-
fileImageMode?: ImageResizeMode | undefined;
|
|
48
|
-
hasCardPreview: boolean;
|
|
49
|
-
isBannedLocalPreview: boolean;
|
|
50
|
-
featureFlags?: MediaFeatureFlags | undefined;
|
|
51
|
-
wasResolvedUpfrontPreview: boolean;
|
|
52
|
-
}) => boolean;
|
|
53
|
-
export declare const getSSRCardPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => CardPreview;
|
|
54
|
-
export declare const isLocalPreview: (preview: CardPreview) => boolean;
|
|
55
|
-
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
56
|
-
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
57
|
-
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
58
|
-
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
59
|
-
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs, traceContext?: MediaTraceContext) => 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, { isPreviewable, hasPreview }: FilePreviewStatus) => CardStatus;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Card } from './cardSwitcher';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
import { MediaClient, FileIdentifier, FileState, MediaFileArtifacts, MediaSubscription } from '@atlaskit/media-client';
|
|
4
|
-
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
5
|
-
import { CardDimensions } from '../types';
|
|
6
|
-
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
-
import type { CardPreview } from '../types';
|
|
8
|
-
export interface InlinePlayerOwnProps {
|
|
9
|
-
identifier: FileIdentifier;
|
|
10
|
-
mediaClient: MediaClient;
|
|
11
|
-
dimensions?: CardDimensions;
|
|
12
|
-
originalDimensions?: NumericalCardDimensions;
|
|
13
|
-
autoplay: boolean;
|
|
14
|
-
selected?: boolean;
|
|
15
|
-
onFullscreenChange?: (fullscreen: boolean) => void;
|
|
16
|
-
onError?: (error: Error) => void;
|
|
17
|
-
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
18
|
-
testId?: string;
|
|
19
|
-
readonly cardPreview?: CardPreview;
|
|
20
|
-
readonly forwardRef?: React.Ref<HTMLDivElement>;
|
|
21
|
-
}
|
|
22
|
-
export type InlinePlayerProps = InlinePlayerOwnProps & WithAnalyticsEventsProps;
|
|
23
|
-
export interface InlinePlayerState {
|
|
24
|
-
fileSrc?: string;
|
|
25
|
-
isUploading?: boolean;
|
|
26
|
-
progress?: number;
|
|
27
|
-
elementWidth?: number;
|
|
28
|
-
}
|
|
29
|
-
export declare const getPreferredVideoArtifact: (fileState: FileState) => keyof MediaFileArtifacts | undefined;
|
|
30
|
-
export declare class InlinePlayerBase extends Component<InlinePlayerProps, InlinePlayerState> {
|
|
31
|
-
subscription?: MediaSubscription;
|
|
32
|
-
state: InlinePlayerState;
|
|
33
|
-
divRef: React.RefObject<HTMLDivElement>;
|
|
34
|
-
static defaultProps: {
|
|
35
|
-
dimensions: {
|
|
36
|
-
width: number;
|
|
37
|
-
height: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
componentDidMount(): void;
|
|
41
|
-
setFileSrc: (fileSrc: string) => void;
|
|
42
|
-
setBinaryURL: () => Promise<void>;
|
|
43
|
-
unsubscribe: () => void;
|
|
44
|
-
revoke: () => void;
|
|
45
|
-
componentWillUnmount(): void;
|
|
46
|
-
onDownloadClick: () => void;
|
|
47
|
-
onFirstPlay: () => void;
|
|
48
|
-
private get breakpoint();
|
|
49
|
-
saveElementWidth: () => void;
|
|
50
|
-
render(): JSX.Element;
|
|
51
|
-
}
|
|
52
|
-
export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<InlinePlayerProps, "createAnalyticsEvent" | keyof InlinePlayerOwnProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const InlinePlayerLazy: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<Pick<import("./inlinePlayer").InlinePlayerProps, "createAnalyticsEvent" | keyof import("./inlinePlayer").InlinePlayerOwnProps> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { InlinePlayerWrapperProps } from './types';
|
|
2
|
-
export declare const inlinePlayerClassName = "media-card-inline-player";
|
|
3
|
-
export declare const inlinePlayerWrapperStyles: {
|
|
4
|
-
({ dimensions, selected, }: InlinePlayerWrapperProps): import("@emotion/react").SerializedStyles;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { CardDimensions, CardOnClickCallback } from '../types';
|
|
4
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
export type MediaCardAnalyticsErrorBoundaryProps = {
|
|
6
|
-
dimensions?: CardDimensions;
|
|
7
|
-
data?: {
|
|
8
|
-
[k: string]: any;
|
|
9
|
-
};
|
|
10
|
-
onClick?: CardOnClickCallback;
|
|
11
|
-
featureFlags?: MediaFeatureFlags;
|
|
12
|
-
} & WithAnalyticsEventsProps;
|
|
13
|
-
declare const MediaCardAnalyticsErrorBoundary: React.ComponentType<MediaCardAnalyticsErrorBoundaryProps & WithAnalyticsEventsProps>;
|
|
14
|
-
export default MediaCardAnalyticsErrorBoundary;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, RefObject } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { CardDimensions } from '../types';
|
|
4
|
-
export type InlinePlayerWrapperProps = {
|
|
5
|
-
testId?: string;
|
|
6
|
-
dimensions?: CardDimensions;
|
|
7
|
-
selected: {
|
|
8
|
-
selected?: boolean | undefined;
|
|
9
|
-
};
|
|
10
|
-
onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
11
|
-
innerRef?: RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | undefined;
|
|
12
|
-
children?: JSX.Element[] | ReactElement<any, any> | null | any;
|
|
13
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Component, ReactNode, MouseEvent } from 'react';
|
|
2
|
-
import { CardActionIconButtonVariant } from './styles';
|
|
3
|
-
export type CardActionIconButtonProps = {
|
|
4
|
-
readonly icon: ReactNode;
|
|
5
|
-
readonly variant?: CardActionIconButtonVariant;
|
|
6
|
-
readonly triggerColor?: string;
|
|
7
|
-
readonly onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
8
|
-
};
|
|
9
|
-
export declare class CardActionIconButton extends Component<CardActionIconButtonProps> {
|
|
10
|
-
render(): JSX.Element;
|
|
11
|
-
private onMouseDown;
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import { CardAction } from '../../../actions';
|
|
3
|
-
import { CardActionIconButtonVariant } from './styles';
|
|
4
|
-
export type CardActionsDropdownMenuProps = {
|
|
5
|
-
readonly actions: CardAction[];
|
|
6
|
-
readonly triggerColor?: string;
|
|
7
|
-
readonly triggerVariant?: CardActionIconButtonVariant;
|
|
8
|
-
readonly onOpenChange?: (attrs: {
|
|
9
|
-
isOpen: boolean;
|
|
10
|
-
}) => void;
|
|
11
|
-
};
|
|
12
|
-
export declare class CardActionsDropdownMenu extends Component<CardActionsDropdownMenuProps> {
|
|
13
|
-
render(): JSX.Element | null;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import { CardAction } from '../../../actions';
|
|
3
|
-
import { CardActionIconButtonVariant } from './styles';
|
|
4
|
-
export interface CardActionsViewProps {
|
|
5
|
-
readonly actions: CardAction[];
|
|
6
|
-
readonly onToggle?: (attrs: {
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
}) => void;
|
|
9
|
-
readonly triggerColor?: string;
|
|
10
|
-
readonly variant?: CardActionIconButtonVariant;
|
|
11
|
-
}
|
|
12
|
-
export declare class CardActionsView extends Component<CardActionsViewProps> {
|
|
13
|
-
render(): JSX.Element | null;
|
|
14
|
-
private renderActionIconButton;
|
|
15
|
-
private renderOtherActionButtons;
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { CardActionsView as default, CardActionsView } from './cardActionsView';
|
|
2
|
-
export type { CardActionsViewProps } from './cardActionsView';
|
|
3
|
-
export { CardActionIconButton } from './cardActionIconButton';
|
|
4
|
-
export type { CardActionIconButtonProps } from './cardActionIconButton';
|
|
5
|
-
export { CardActionsDropdownMenu } from './cardActionsDropdownMenu';
|
|
6
|
-
export type { CardActionsDropdownMenuProps } from './cardActionsDropdownMenu';
|
|
7
|
-
export { CardActionIconButtonVariant } from './styles';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { MouseEvent, HTMLAttributes } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
-
export declare enum CardActionIconButtonVariant {
|
|
5
|
-
default = "default",
|
|
6
|
-
filled = "filled"
|
|
7
|
-
}
|
|
8
|
-
export type CardActionButtonOwnProps = {
|
|
9
|
-
variant?: CardActionIconButtonVariant;
|
|
10
|
-
style?: {
|
|
11
|
-
color: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
14
|
-
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
};
|
|
17
|
-
export type CardActionButtonProps = CardActionButtonOwnProps & HTMLAttributes<HTMLDivElement>;
|
|
18
|
-
export declare const cardActionButtonStyles: ({ variant, }: CardActionButtonProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CardAction } from '../../actions';
|
|
3
|
-
export interface ActionsBarProps {
|
|
4
|
-
actions: Array<CardAction>;
|
|
5
|
-
isFixed?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export type ActionBarWrapperProps = {
|
|
8
|
-
isFixed?: boolean;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare enum Breakpoint {
|
|
2
|
-
SMALL = "small",
|
|
3
|
-
LARGE = "large"
|
|
4
|
-
}
|
|
5
|
-
export declare const responsiveSettings: {
|
|
6
|
-
small: {
|
|
7
|
-
fontSize: number;
|
|
8
|
-
lineHeight: number;
|
|
9
|
-
titleBox: {
|
|
10
|
-
verticalPadding: number;
|
|
11
|
-
horizontalPadding: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
large: {
|
|
15
|
-
fontSize: number;
|
|
16
|
-
lineHeight: number;
|
|
17
|
-
titleBox: {
|
|
18
|
-
verticalPadding: number;
|
|
19
|
-
horizontalPadding: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export declare const getTitleBoxHeight: (breakpoint: Breakpoint) => number;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InternalIconMessageProps, CreatingPreviewProps } from './types';
|
|
3
|
-
export declare const IconMessage: React.FC<InternalIconMessageProps>;
|
|
4
|
-
export declare const CreatingPreview: React.FC<CreatingPreviewProps>;
|
|
5
|
-
export declare const PreviewUnavailable: React.FC;
|
|
6
|
-
export declare const FailedToLoad: React.FC;
|
|
7
|
-
export declare const FailedToUpload: React.FC;
|
|
8
|
-
export declare const PreviewCurrentlyUnavailable: React.FC;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { MessageDescriptor } from 'react-intl-next';
|
|
3
|
-
export type InternalIconMessageProps = {
|
|
4
|
-
messageDescriptor: MessageDescriptor;
|
|
5
|
-
animated?: boolean;
|
|
6
|
-
reducedFont?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type CreatingPreviewProps = {
|
|
9
|
-
disableAnimation?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export type StyledTextProps = {
|
|
12
|
-
animated?: boolean;
|
|
13
|
-
reducedFont?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type IconMessageWrapperProps = {
|
|
16
|
-
animated?: boolean;
|
|
17
|
-
reducedFont?: boolean;
|
|
18
|
-
children?: ReactNode;
|
|
19
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Breakpoint } from '../common';
|
|
2
|
-
import { IconWrapperProps } from './types';
|
|
3
|
-
export declare function titleBoxHeight(hasTitleBox: boolean, breakpoint: Breakpoint): string;
|
|
4
|
-
export declare const iconWrapperStyles: {
|
|
5
|
-
({ hasTitleBox, breakpoint, }: IconWrapperProps): import("@emotion/react").SerializedStyles;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
3
|
-
import { CardPreview } from '../../../types';
|
|
4
|
-
export type ImageRendererProps = {
|
|
5
|
-
readonly cardPreview: CardPreview;
|
|
6
|
-
readonly mediaType: MediaType;
|
|
7
|
-
readonly alt?: string;
|
|
8
|
-
readonly resizeMode?: ImageResizeMode;
|
|
9
|
-
readonly onDisplayImage?: () => void;
|
|
10
|
-
readonly onImageError?: (cardPreview: CardPreview) => void;
|
|
11
|
-
readonly onImageLoad?: (cardPreview: CardPreview) => void;
|
|
12
|
-
readonly nativeLazyLoad?: boolean;
|
|
13
|
-
readonly forceSyncDisplay?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare const ImageRenderer: React.FC<ImageRendererProps>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const playButtonClassName = "media-card-play-button";
|
|
2
|
-
export declare const bkgClassName = "play-icon-background";
|
|
3
|
-
export declare const fixedPlayButtonStyles: string;
|
|
4
|
-
export declare const playButtonWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
5
|
-
export declare const backgroundStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Breakpoint } from '../common';
|
|
3
|
-
export type ProgressBarProps = {
|
|
4
|
-
progress?: number;
|
|
5
|
-
breakpoint?: Breakpoint;
|
|
6
|
-
positionBottom?: boolean;
|
|
7
|
-
showOnTop?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const getNormalizedProgress: (progress?: number) => number;
|
|
10
|
-
export declare const ProgressBar: ({ progress, breakpoint, positionBottom, showOnTop, }: ProgressBarProps) => JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Breakpoint } from '../common';
|
|
2
|
-
import { StyledBarProps } from './types';
|
|
3
|
-
export declare function generateResponsiveStyles(breakpoint: Breakpoint, positionBottom: boolean, showOnTop: boolean, multiplier?: number): string;
|
|
4
|
-
export declare const styledBarStyles: {
|
|
5
|
-
(props: StyledBarProps): import("@emotion/react").SerializedStyles;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|