@atlaskit/media-card 74.8.1 → 75.0.1
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 +18 -0
- package/dist/cjs/card/card.js +2 -7
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/styles/index.js +1 -7
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/cjs/inline/mediaInlineCard.js +12 -21
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +2 -7
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/styles/index.js +0 -4
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/es2019/inline/mediaInlineCard.js +12 -21
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +2 -7
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/styles/index.js +1 -5
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/esm/inline/mediaInlineCard.js +12 -21
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/card/styles/index.d.ts +0 -1
- package/dist/types/inline/mediaInlineCard.d.ts +0 -8
- package/dist/types/types.d.ts +0 -8
- package/dist/types-ts4.5/card/actions.d.ts +9 -0
- package/dist/types-ts4.5/card/card.d.ts +63 -0
- package/dist/types-ts4.5/card/cardAnalytics.d.ts +10 -0
- package/dist/types-ts4.5/card/cardConstants.d.ts +1 -0
- package/dist/types-ts4.5/card/cardImageView/cardImageViewWrapper.d.ts +6 -0
- package/dist/types-ts4.5/card/cardImageView/cardOverlay/cardOverlayComponents.d.ts +8 -0
- package/dist/types-ts4.5/card/cardImageView/cardOverlay/index.d.ts +39 -0
- package/dist/types-ts4.5/card/cardImageView/cardOverlay/styles.d.ts +26 -0
- package/dist/types-ts4.5/card/cardImageView/cardViewWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/cardImageView/classnames.d.ts +2 -0
- package/dist/types-ts4.5/card/cardImageView/fileCardImageView.d.ts +49 -0
- package/dist/types-ts4.5/card/cardImageView/index.d.ts +2 -0
- package/dist/types-ts4.5/card/cardImageView/styles.d.ts +24 -0
- package/dist/types-ts4.5/card/cardLoader.d.ts +6 -0
- package/dist/types-ts4.5/card/cardState.d.ts +10 -0
- package/dist/types-ts4.5/card/cardView.d.ts +80 -0
- package/dist/types-ts4.5/card/getCardPreview/cache.d.ts +19 -0
- package/dist/types-ts4.5/card/getCardPreview/filePreviewStatus.d.ts +5 -0
- package/dist/types-ts4.5/card/getCardPreview/helpers.d.ts +10 -0
- package/dist/types-ts4.5/card/getCardPreview/imageRefetchingAnalytics.d.ts +10 -0
- package/dist/types-ts4.5/card/getCardPreview/index.d.ts +59 -0
- package/dist/types-ts4.5/card/getCardStatus.d.ts +5 -0
- package/dist/types-ts4.5/card/index.d.ts +1 -0
- package/dist/types-ts4.5/card/inlinePlayer.d.ts +52 -0
- package/dist/types-ts4.5/card/inlinePlayerLazy.d.ts +2 -0
- package/dist/types-ts4.5/card/inlinePlayerWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +14 -0
- package/dist/types-ts4.5/card/styles/animations.d.ts +1 -0
- package/dist/types-ts4.5/card/styles/config.d.ts +1 -0
- package/dist/types-ts4.5/card/styles/easing.d.ts +2 -0
- package/dist/types-ts4.5/card/styles/getSelectedBorderStyle.d.ts +3 -0
- package/dist/types-ts4.5/card/styles/index.d.ts +8 -0
- package/dist/types-ts4.5/card/styles/mixins.d.ts +21 -0
- package/dist/types-ts4.5/card/styles/styles.d.ts +10 -0
- package/dist/types-ts4.5/card/types.d.ts +24 -0
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBar.d.ts +5 -0
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBarWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/actionsBar/styles.d.ts +6 -0
- package/dist/types-ts4.5/card/ui/actionsBar/types.d.ts +10 -0
- package/dist/types-ts4.5/card/ui/blanket/blanket.d.ts +6 -0
- package/dist/types-ts4.5/card/ui/blanket/styles.d.ts +6 -0
- package/dist/types-ts4.5/card/ui/common.d.ts +23 -0
- package/dist/types-ts4.5/card/ui/iconMessage/iconMessageWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/iconMessage/index.d.ts +8 -0
- package/dist/types-ts4.5/card/ui/iconMessage/styles.d.ts +5 -0
- package/dist/types-ts4.5/card/ui/iconMessage/types.d.ts +19 -0
- package/dist/types-ts4.5/card/ui/iconWrapper/iconWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +7 -0
- package/dist/types-ts4.5/card/ui/iconWrapper/types.d.ts +6 -0
- package/dist/types-ts4.5/card/ui/imageRenderer/imageRenderer.d.ts +15 -0
- package/dist/types-ts4.5/card/ui/loadingRateLimited/styles.d.ts +13 -0
- package/dist/types-ts4.5/card/ui/newFileExperience/newFileExperienceWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/newFileExperience/styles.d.ts +5 -0
- package/dist/types-ts4.5/card/ui/newFileExperience/types.d.ts +25 -0
- package/dist/types-ts4.5/card/ui/playButton/playButton.d.ts +2 -0
- package/dist/types-ts4.5/card/ui/playButton/playButtonBackground.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/playButton/playButtonWrapper.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/playButton/styles.d.ts +5 -0
- package/dist/types-ts4.5/card/ui/progressBar/progressBar.d.ts +10 -0
- package/dist/types-ts4.5/card/ui/progressBar/styledBar.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/progressBar/styles.d.ts +7 -0
- package/dist/types-ts4.5/card/ui/progressBar/types.d.ts +7 -0
- package/dist/types-ts4.5/card/ui/styles.d.ts +11 -0
- package/dist/types-ts4.5/card/ui/tickBox/styles.d.ts +7 -0
- package/dist/types-ts4.5/card/ui/tickBox/tickBox.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/tickBox/tickBoxWrapper.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/tickBox/types.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/titleBox/failedTitleBox.d.ts +3 -0
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +15 -0
- package/dist/types-ts4.5/card/ui/titleBox/titleBox.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/titleBox/titleBoxComponents.d.ts +8 -0
- package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +34 -0
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/index.d.ts +7 -0
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/types.d.ts +6 -0
- package/dist/types-ts4.5/classnames.d.ts +5 -0
- package/dist/types-ts4.5/errors.d.ts +41 -0
- package/dist/types-ts4.5/index.d.ts +15 -0
- package/dist/types-ts4.5/inline/index.d.ts +1 -0
- package/dist/types-ts4.5/inline/loader.d.ts +26 -0
- package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +12 -0
- package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +15 -0
- package/dist/types-ts4.5/types.d.ts +103 -0
- package/dist/types-ts4.5/utils/analytics.d.ts +95 -0
- package/dist/types-ts4.5/utils/breakpoint.d.ts +11 -0
- package/dist/types-ts4.5/utils/cardActions/cardActionButton.d.ts +3 -0
- package/dist/types-ts4.5/utils/cardActions/cardActionIconButton.d.ts +12 -0
- package/dist/types-ts4.5/utils/cardActions/cardActionsDropdownMenu.d.ts +14 -0
- package/dist/types-ts4.5/utils/cardActions/cardActionsView.d.ts +16 -0
- package/dist/types-ts4.5/utils/cardActions/index.d.ts +7 -0
- package/dist/types-ts4.5/utils/cardActions/styles.d.ts +18 -0
- package/dist/types-ts4.5/utils/cardDimensions.d.ts +49 -0
- package/dist/types-ts4.5/utils/containsPixelUnit.d.ts +1 -0
- package/dist/types-ts4.5/utils/dimensionComparer.d.ts +3 -0
- package/dist/types-ts4.5/utils/document.d.ts +2 -0
- package/dist/types-ts4.5/utils/errorIcon/index.d.ts +12 -0
- package/dist/types-ts4.5/utils/errorIcon/styles.d.ts +1 -0
- package/dist/types-ts4.5/utils/fileIcon/index.d.ts +12 -0
- package/dist/types-ts4.5/utils/fileIcon/styles.d.ts +1 -0
- package/dist/types-ts4.5/utils/generateUniqueId.d.ts +1 -0
- package/dist/types-ts4.5/utils/getCSSUnitValue.d.ts +1 -0
- package/dist/types-ts4.5/utils/getDataURIDimension.d.ts +9 -0
- package/dist/types-ts4.5/utils/getElementDimension.d.ts +2 -0
- package/dist/types-ts4.5/utils/getErrorMessage.d.ts +2 -0
- package/dist/types-ts4.5/utils/getMediaCardCursor.d.ts +6 -0
- package/dist/types-ts4.5/utils/globalScope/getSSRData.d.ts +3 -0
- package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +21 -0
- package/dist/types-ts4.5/utils/globalScope/index.d.ts +4 -0
- package/dist/types-ts4.5/utils/globalScope/types.d.ts +8 -0
- package/dist/types-ts4.5/utils/index.d.ts +14 -0
- package/dist/types-ts4.5/utils/isRetina.d.ts +1 -0
- package/dist/types-ts4.5/utils/isValidPercentageUnit.d.ts +1 -0
- package/dist/types-ts4.5/utils/lightCards/cardError.d.ts +12 -0
- package/dist/types-ts4.5/utils/lightCards/cardLoading.d.ts +5 -0
- package/dist/types-ts4.5/utils/lightCards/getDimensionsWithDefault.d.ts +2 -0
- package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +5 -0
- package/dist/types-ts4.5/utils/lightCards/styles.d.ts +4 -0
- package/dist/types-ts4.5/utils/lightCards/types.d.ts +15 -0
- package/dist/types-ts4.5/utils/metadata.d.ts +2 -0
- package/dist/types-ts4.5/utils/objectURLCache.d.ts +11 -0
- package/dist/types-ts4.5/utils/preventClickThrough.d.ts +8 -0
- package/dist/types-ts4.5/utils/printScript.d.ts +2 -0
- package/dist/types-ts4.5/utils/progressBar/index.d.ts +9 -0
- package/dist/types-ts4.5/utils/progressBar/styles.d.ts +1 -0
- package/dist/types-ts4.5/utils/resizeModeToMediaImageProps.d.ts +5 -0
- package/dist/types-ts4.5/utils/shouldDisplayImageThumbnail.d.ts +3 -0
- package/dist/types-ts4.5/utils/ufoExperiences.d.ts +7 -0
- package/dist/types-ts4.5/utils/videoIsPlayable.d.ts +2 -0
- package/dist/types-ts4.5/utils/videoSnapshot.d.ts +1 -0
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +6 -0
- package/package.json +5 -5
- package/report.api.md +0 -5
|
@@ -0,0 +1,23 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Breakpoint } from '../common';
|
|
2
|
+
export declare const loadingRateLimitedContainerStyles: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const warningIconWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export type StyledTextProps = {
|
|
5
|
+
breakpoint: Breakpoint;
|
|
6
|
+
positionBottom: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const loadingRateLimitedTextWrapperStyles: {
|
|
9
|
+
({ breakpoint, positionBottom, }: StyledTextProps): import("@emotion/react").SerializedStyles;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const couldntLoadWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
13
|
+
export declare const errorWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NewFileExperienceWrapperProps } from './types';
|
|
2
|
+
export declare const newFileExperienceWrapperStyles: {
|
|
3
|
+
({ breakpoint, dimensions, appearance, disableOverlay, displayBackground, selected, isPlayButtonClickable, isTickBoxSelectable, shouldDisplayTooltip, mediaCardCursor, theme, }: NewFileExperienceWrapperProps): import("@emotion/react").SerializedStyles;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { MouseEvent, RefObject } from 'react';
|
|
2
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import { CardDimensions, CardAppearance } from '../../../types';
|
|
4
|
+
import { Breakpoint } from '../common';
|
|
5
|
+
import { MediaCardCursor } from '../../../types';
|
|
6
|
+
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
7
|
+
export interface NewFileExperienceWrapperProps {
|
|
8
|
+
testId?: string;
|
|
9
|
+
breakpoint: Breakpoint;
|
|
10
|
+
mediaCardCursor?: MediaCardCursor;
|
|
11
|
+
dimensions?: CardDimensions;
|
|
12
|
+
appearance?: CardAppearance;
|
|
13
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
14
|
+
onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
15
|
+
mediaType?: string;
|
|
16
|
+
disableOverlay: boolean;
|
|
17
|
+
displayBackground: boolean;
|
|
18
|
+
selected: boolean;
|
|
19
|
+
isPlayButtonClickable: boolean;
|
|
20
|
+
isTickBoxSelectable: boolean;
|
|
21
|
+
shouldDisplayTooltip: boolean;
|
|
22
|
+
innerRef?: RefObject<HTMLDivElement>;
|
|
23
|
+
children?: JSX.Element;
|
|
24
|
+
theme?: GlobalThemeTokens;
|
|
25
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CardDimensions, CardAppearance } from '../../types';
|
|
2
|
+
import { Breakpoint } from './common';
|
|
3
|
+
import { MediaCardCursor } from '../../types';
|
|
4
|
+
export declare const calcBreakpointSize: (wrapperWidth?: number) => Breakpoint;
|
|
5
|
+
export declare const generateResponsiveStyles: (breakpoint?: Breakpoint) => string;
|
|
6
|
+
export declare const getWrapperDimensions: (dimensions?: CardDimensions, appearance?: CardAppearance) => string;
|
|
7
|
+
export declare const getWrapperShadow: (disableOverlay: boolean, selected: boolean) => string;
|
|
8
|
+
export declare const getCursorStyle: (cursor: MediaCardCursor | undefined) => string;
|
|
9
|
+
export declare const getClickablePlayButtonStyles: (isPlayButtonClickable: boolean) => string;
|
|
10
|
+
export declare const getSelectableTickBoxStyles: (isTickBoxSelectable: boolean) => string;
|
|
11
|
+
export declare const cardImageContainerStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const tickBoxClassName = "media-card-tickbox";
|
|
2
|
+
export declare const tickboxFixedStyles: string;
|
|
3
|
+
export declare const getSelectedStyles: (selected?: boolean) => string;
|
|
4
|
+
export declare const wrapperStyles: {
|
|
5
|
+
(selected?: boolean): import("@emotion/react").SerializedStyles;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TitleBoxFooterProps, TitleBoxHeaderProps, TitleBoxWrapperProps } from './types';
|
|
2
|
+
export declare const titleBoxWrapperStyles: {
|
|
3
|
+
({ breakpoint, titleBoxBgColor, theme, }: TitleBoxWrapperProps): import("@emotion/react").SerializedStyles;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const titleBoxHeaderStyles: {
|
|
7
|
+
({ hasIconOverlap, }: TitleBoxHeaderProps): import("@emotion/react").SerializedStyles;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const titleBoxFooterStyles: {
|
|
11
|
+
({ hasIconOverlap, }: TitleBoxFooterProps): import("@emotion/react").SerializedStyles;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const titleBoxIconStyles: import("@emotion/react").SerializedStyles;
|
|
15
|
+
export declare const errorMessageWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedDateProps, TitleBoxProps } from './types';
|
|
3
|
+
export declare const FormattedDate: React.ComponentType<FormattedDateProps>;
|
|
4
|
+
export declare const TitleBox: ({ name, createdAt, breakpoint, titleBoxBgColor, titleBoxIcon, }: TitleBoxProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { TitleBoxFooterProps, TitleBoxHeaderProps, TitleBoxWrapperProps } from './types';
|
|
4
|
+
export declare const TitleBoxWrapper: (props: TitleBoxWrapperProps) => jsx.JSX.Element;
|
|
5
|
+
export declare const TitleBoxHeader: (props: TitleBoxHeaderProps) => jsx.JSX.Element;
|
|
6
|
+
export declare const TitleBoxFooter: (props: TitleBoxFooterProps) => jsx.JSX.Element;
|
|
7
|
+
export declare const TitleBoxIcon: (props: any) => jsx.JSX.Element;
|
|
8
|
+
export declare const ErrorMessageWrapper: (props: any) => jsx.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
3
|
+
import { Breakpoint } from '../common';
|
|
4
|
+
import { TitleBoxIcon as TitleBoxIconType } from '../../../types';
|
|
5
|
+
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
6
|
+
export type TitleBoxProps = {
|
|
7
|
+
name: string;
|
|
8
|
+
breakpoint: Breakpoint;
|
|
9
|
+
createdAt?: number;
|
|
10
|
+
titleBoxBgColor?: string;
|
|
11
|
+
titleBoxIcon?: TitleBoxIconType;
|
|
12
|
+
};
|
|
13
|
+
export type FormattedDateProps = {
|
|
14
|
+
timestamp: number;
|
|
15
|
+
};
|
|
16
|
+
export type TitleBoxWrapperProps = {
|
|
17
|
+
breakpoint: Breakpoint;
|
|
18
|
+
titleBoxBgColor?: string;
|
|
19
|
+
children?: JSX.Element | JSX.Element[] | any;
|
|
20
|
+
theme?: GlobalThemeTokens;
|
|
21
|
+
};
|
|
22
|
+
export type TitleBoxFooterProps = {
|
|
23
|
+
hasIconOverlap: boolean;
|
|
24
|
+
children?: JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
export type TitleBoxHeaderProps = {
|
|
27
|
+
hasIconOverlap: boolean;
|
|
28
|
+
children?: JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
export type OnRetryFunction = () => void;
|
|
31
|
+
export type FailedTitleBoxProps = {
|
|
32
|
+
breakpoint: Breakpoint;
|
|
33
|
+
customMessage?: MessageDescriptor;
|
|
34
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { UnhandledErrorCardProps } from './types';
|
|
5
|
+
export declare class UnhandledErrorCard extends Component<UnhandledErrorCardProps, {}> {
|
|
6
|
+
render(): jsx.JSX.Element;
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CardPreview } from './types';
|
|
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 type MediaCardErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'error-file-state' | RemotePreviewPrimaryReason | LocalPreviewPrimaryReason | ImageLoadPrimaryReason | SsrPreviewPrimaryReason | 'missing-error-data' | 'preview-fetch';
|
|
7
|
+
export type ImageLoadPrimaryReason = 'cache-remote-uri' | 'cache-local-uri' | 'local-uri' | 'remote-uri' | 'external-uri' | 'unknown-uri';
|
|
8
|
+
export type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-not-ready' | 'remote-preview-fetch-ssr';
|
|
9
|
+
export type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-unsupported' | 'local-preview-rejected' | 'local-preview-image' | 'local-preview-video';
|
|
10
|
+
export 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?: CardPreview['source']) => 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, updatePrimaryReason?: boolean) => MediaCardError;
|
|
41
|
+
export declare const isUploadError: (error?: MediaCardError) => boolean | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry Point: @atlaskit/media-card
|
|
3
|
+
* tsconfig.entry-points.json
|
|
4
|
+
*/
|
|
5
|
+
export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
6
|
+
export type { CardAction, CardEventHandler } from './card/actions';
|
|
7
|
+
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, TitleBoxIcon, CardEvent, InlineCardEvent, SharedCardProps, CardOnClickCallback, InlineCardOnClickCallback, CardProps, CardState, CardDimensions, } from './types';
|
|
8
|
+
export { Card } from './card';
|
|
9
|
+
export { MediaInlineCard } from './inline';
|
|
10
|
+
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
11
|
+
export { CardError } from './utils/lightCards/cardError';
|
|
12
|
+
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
13
|
+
export { fileCardImageViewSelector, fileCardImageViewSelectedSelector, } from './card/cardImageView/classnames';
|
|
14
|
+
export { inlinePlayerClassName } from './card/styles/styles';
|
|
15
|
+
export { newFileExperienceClassName } from './card/cardConstants';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MediaInlineCard } from './loader';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
+
import { MediaInlineCardProps } from './mediaInlineCard';
|
|
4
|
+
export type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
5
|
+
type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
6
|
+
type ErrorBoundaryComponent = React.ComponentType<{
|
|
7
|
+
data?: {
|
|
8
|
+
[k: string]: any;
|
|
9
|
+
};
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export interface MediaInlineCardLoaderState {
|
|
13
|
+
MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
14
|
+
ErrorBoundary?: ErrorBoundaryComponent;
|
|
15
|
+
}
|
|
16
|
+
export default class MediaInlineCardLoader extends React.PureComponent<MediaInlineCardWithMediaClientConfigProps & MediaInlineCardLoaderState, MediaInlineCardLoaderState> {
|
|
17
|
+
static displayName: string;
|
|
18
|
+
static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
19
|
+
static ErrorBoundary?: ErrorBoundaryComponent;
|
|
20
|
+
isMounted: boolean;
|
|
21
|
+
state: MediaInlineCardLoaderState;
|
|
22
|
+
componentDidMount(): Promise<void>;
|
|
23
|
+
componentWillUnmount(): Promise<void>;
|
|
24
|
+
render(): JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
+
export type MediaInlineAnalyticsErrorBoundaryProps = {
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
data?: {
|
|
7
|
+
[k: string]: any;
|
|
8
|
+
};
|
|
9
|
+
featureFlags?: MediaFeatureFlags;
|
|
10
|
+
} & WithAnalyticsEventsProps;
|
|
11
|
+
declare const MediaInlineAnalyticsErrorBoundary: React.ComponentType<MediaInlineAnalyticsErrorBoundaryProps & WithAnalyticsEventsProps>;
|
|
12
|
+
export default MediaInlineAnalyticsErrorBoundary;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { FileIdentifier, Identifier, MediaClient } from '@atlaskit/media-client';
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import { InlineCardOnClickCallback } from '../types';
|
|
5
|
+
export interface MediaInlineCardProps {
|
|
6
|
+
identifier: FileIdentifier;
|
|
7
|
+
mediaClient: MediaClient;
|
|
8
|
+
shouldOpenMediaViewer?: boolean;
|
|
9
|
+
shouldDisplayToolTip?: boolean;
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
onClick?: InlineCardOnClickCallback;
|
|
12
|
+
mediaViewerItems?: Identifier[];
|
|
13
|
+
}
|
|
14
|
+
export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
|
|
15
|
+
export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry Point: @atlaskit/media-card/types
|
|
3
|
+
* tsconfig.entry-points.json
|
|
4
|
+
*/
|
|
5
|
+
import { MouseEvent } from 'react';
|
|
6
|
+
import { FileDetails, MediaClient, Identifier, ImageResizeMode, FileState } from '@atlaskit/media-client';
|
|
7
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
8
|
+
import { MediaFeatureFlags, NumericalCardDimensions, SSR } from '@atlaskit/media-common';
|
|
9
|
+
import { CardAction } from './card/actions';
|
|
10
|
+
import { MediaCardError } from './errors';
|
|
11
|
+
export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
|
|
12
|
+
export type FilePreviewStatus = {
|
|
13
|
+
hasFilesize: boolean;
|
|
14
|
+
isPreviewable: boolean;
|
|
15
|
+
hasPreview: boolean;
|
|
16
|
+
isSupportedByBrowser: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type FileStateFlags = {
|
|
19
|
+
wasStatusProcessing: boolean;
|
|
20
|
+
wasStatusUploading: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
|
|
23
|
+
export declare type CardDimensionValue = number | string;
|
|
24
|
+
export type CardPreviewSource = 'local' | 'remote' | 'ssr-server' | 'ssr-client' | 'ssr-data' | 'cache-local' | 'cache-remote' | 'cache-ssr-client' | 'cache-ssr-server' | 'external';
|
|
25
|
+
export interface CardPreview {
|
|
26
|
+
dataURI: string;
|
|
27
|
+
orientation?: number;
|
|
28
|
+
dimensions?: CardDimensions;
|
|
29
|
+
source: CardPreviewSource;
|
|
30
|
+
}
|
|
31
|
+
export declare enum MediaCardCursor {
|
|
32
|
+
Action = "pointer",
|
|
33
|
+
NotReady = "wait"
|
|
34
|
+
}
|
|
35
|
+
export interface CardDimensions {
|
|
36
|
+
width?: CardDimensionValue;
|
|
37
|
+
height?: CardDimensionValue;
|
|
38
|
+
}
|
|
39
|
+
export type TitleBoxIcon = 'LockFilledIcon';
|
|
40
|
+
export interface CardEvent {
|
|
41
|
+
event: MouseEvent<HTMLElement>;
|
|
42
|
+
mediaItemDetails?: FileDetails;
|
|
43
|
+
}
|
|
44
|
+
export interface InlineCardEvent {
|
|
45
|
+
event: MouseEvent<HTMLElement> | React.KeyboardEvent;
|
|
46
|
+
mediaItemDetails?: FileDetails;
|
|
47
|
+
}
|
|
48
|
+
export interface SharedCardProps {
|
|
49
|
+
readonly disableOverlay?: boolean;
|
|
50
|
+
readonly resizeMode?: ImageResizeMode;
|
|
51
|
+
readonly featureFlags?: MediaFeatureFlags;
|
|
52
|
+
readonly appearance?: CardAppearance;
|
|
53
|
+
readonly dimensions?: CardDimensions;
|
|
54
|
+
readonly originalDimensions?: NumericalCardDimensions;
|
|
55
|
+
readonly actions?: Array<CardAction>;
|
|
56
|
+
readonly selectable?: boolean;
|
|
57
|
+
readonly selected?: boolean;
|
|
58
|
+
readonly alt?: string;
|
|
59
|
+
readonly testId?: string;
|
|
60
|
+
readonly titleBoxBgColor?: string;
|
|
61
|
+
readonly titleBoxIcon?: TitleBoxIcon;
|
|
62
|
+
}
|
|
63
|
+
export interface CardOnClickCallback {
|
|
64
|
+
(result: CardEvent, analyticsEvent?: UIAnalyticsEvent): void;
|
|
65
|
+
}
|
|
66
|
+
export interface InlineCardOnClickCallback {
|
|
67
|
+
(result: InlineCardEvent, analyticsEvent?: UIAnalyticsEvent): void;
|
|
68
|
+
}
|
|
69
|
+
export interface CardEventProps {
|
|
70
|
+
readonly onClick?: CardOnClickCallback;
|
|
71
|
+
readonly onMouseEnter?: (result: CardEvent) => void;
|
|
72
|
+
/** Callback function to be called when video enters and exit fullscreen.
|
|
73
|
+
* `fullscreen = true` indicates video enters fullscreen
|
|
74
|
+
* `fullscreen = false` indicates video exits fullscreen
|
|
75
|
+
*/
|
|
76
|
+
readonly onFullscreenChange?: (fullscreen: boolean) => void;
|
|
77
|
+
}
|
|
78
|
+
export interface CardProps extends SharedCardProps, CardEventProps {
|
|
79
|
+
readonly mediaClient: MediaClient;
|
|
80
|
+
readonly identifier: Identifier;
|
|
81
|
+
readonly isLazy?: boolean;
|
|
82
|
+
readonly useInlinePlayer?: boolean;
|
|
83
|
+
readonly shouldOpenMediaViewer?: boolean;
|
|
84
|
+
readonly mediaViewerItems?: Identifier[];
|
|
85
|
+
readonly contextId?: string;
|
|
86
|
+
readonly shouldEnableDownloadButton?: boolean;
|
|
87
|
+
readonly ssr?: SSR;
|
|
88
|
+
}
|
|
89
|
+
export interface CardState {
|
|
90
|
+
status: CardStatus;
|
|
91
|
+
isCardVisible: boolean;
|
|
92
|
+
shouldAutoplay?: boolean;
|
|
93
|
+
isPlayingFile: boolean;
|
|
94
|
+
mediaViewerSelectedItem?: Identifier;
|
|
95
|
+
fileState?: FileState;
|
|
96
|
+
progress?: number;
|
|
97
|
+
cardPreview?: CardPreview;
|
|
98
|
+
error?: MediaCardError;
|
|
99
|
+
cardRef: HTMLDivElement | null;
|
|
100
|
+
isBannedLocalPreview: boolean;
|
|
101
|
+
previewDidRender: boolean;
|
|
102
|
+
wasResolvedUpfrontPreview: boolean;
|
|
103
|
+
}
|