@atlaskit/media-card 74.8.0 → 75.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/classnames/package.json +2 -2
- 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/actions.d.ts +1 -1
- package/dist/types/card/card.d.ts +4 -4
- package/dist/types/card/cardAnalytics.d.ts +2 -2
- package/dist/types/card/cardLoader.d.ts +1 -1
- package/dist/types/card/cardState.d.ts +1 -1
- package/dist/types/card/cardView.d.ts +1 -1
- package/dist/types/card/getCardPreview/cache.d.ts +1 -1
- package/dist/types/card/getCardPreview/filePreviewStatus.d.ts +1 -1
- package/dist/types/card/getCardPreview/helpers.d.ts +2 -2
- package/dist/types/card/getCardPreview/imageRefetchingAnalytics.d.ts +1 -1
- package/dist/types/card/getCardPreview/index.d.ts +3 -3
- package/dist/types/card/getCardStatus.d.ts +1 -1
- package/dist/types/card/inlinePlayer.d.ts +1 -1
- package/dist/types/card/media-card-analytics-error-boundary.d.ts +1 -1
- package/dist/types/card/styles/index.d.ts +0 -1
- package/dist/types/card/types.d.ts +1 -1
- package/dist/types/card/ui/actionsBar/styles.d.ts +1 -1
- package/dist/types/card/ui/actionsBar/types.d.ts +1 -1
- package/dist/types/card/ui/blanket/styles.d.ts +1 -1
- package/dist/types/card/ui/iconMessage/types.d.ts +4 -4
- package/dist/types/card/ui/iconWrapper/types.d.ts +1 -1
- package/dist/types/card/ui/imageRenderer/imageRenderer.d.ts +1 -1
- package/dist/types/card/ui/loadingRateLimited/styles.d.ts +1 -1
- package/dist/types/card/ui/progressBar/progressBar.d.ts +2 -2
- package/dist/types/card/ui/progressBar/types.d.ts +1 -1
- package/dist/types/card/ui/styles.d.ts +1 -1
- package/dist/types/card/ui/tickBox/styles.d.ts +2 -2
- package/dist/types/card/ui/tickBox/types.d.ts +1 -1
- package/dist/types/card/ui/titleBox/types.d.ts +7 -7
- package/dist/types/errors.d.ts +8 -8
- package/dist/types/inline/loader.d.ts +3 -3
- package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +1 -1
- package/dist/types/inline/mediaInlineCard.d.ts +0 -8
- package/dist/types/types.d.ts +6 -14
- package/dist/types/utils/analytics.d.ts +32 -32
- package/dist/types/utils/breakpoint.d.ts +2 -2
- package/dist/types/utils/cardActions/cardActionIconButton.d.ts +1 -1
- package/dist/types/utils/cardActions/cardActionsDropdownMenu.d.ts +1 -1
- package/dist/types/utils/cardActions/styles.d.ts +2 -2
- package/dist/types/utils/cardDimensions.d.ts +4 -4
- package/dist/types/utils/dimensionComparer.d.ts +2 -2
- package/dist/types/utils/getDataURIDimension.d.ts +1 -1
- package/dist/types/utils/getElementDimension.d.ts +1 -1
- package/dist/types/utils/getMediaCardCursor.d.ts +1 -1
- package/dist/types/utils/globalScope/globalScope.d.ts +3 -3
- package/dist/types/utils/globalScope/types.d.ts +2 -2
- package/dist/types/utils/metadata.d.ts +1 -1
- package/dist/types/utils/preventClickThrough.d.ts +2 -2
- package/dist/types/utils/shouldDisplayImageThumbnail.d.ts +1 -1
- package/dist/types/utils/videoIsPlayable.d.ts +1 -1
- package/dist/types/utils/viewportDetector.d.ts +1 -1
- 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 +15 -7
- package/report.api.md +0 -5
- package/types/package.json +2 -2
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { FileDetails, FileStatus, MediaClientErrorReason, RequestMetadata } from '@atlaskit/media-client';
|
|
2
|
+
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { MediaCardError, MediaCardErrorPrimaryReason } from '../errors';
|
|
5
|
+
import { CardPreviewSource, CardDimensions, CardStatus } from '../types';
|
|
6
|
+
export type CardPreviewAttributes = {
|
|
7
|
+
fileId: string;
|
|
8
|
+
prevDimensions: CardDimensions | undefined;
|
|
9
|
+
currentDimensions: CardDimensions | undefined;
|
|
10
|
+
dimensionsPercentageDiff?: CardDimensions | undefined;
|
|
11
|
+
source: CardPreviewSource;
|
|
12
|
+
};
|
|
13
|
+
type WithCardPreviewCacheAttributes = {
|
|
14
|
+
cardPreviewAttributes: CardPreviewAttributes;
|
|
15
|
+
};
|
|
16
|
+
export type FileUriFailReason = 'local-uri' | 'remote-uri' | `unknown-uri`;
|
|
17
|
+
export type FailedErrorFailReason = MediaCardErrorPrimaryReason | 'nativeError';
|
|
18
|
+
export type MediaCardErrorInfo = {
|
|
19
|
+
failReason: FailedErrorFailReason;
|
|
20
|
+
error: MediaClientErrorReason | 'nativeError';
|
|
21
|
+
errorDetail: string;
|
|
22
|
+
metadataTraceContext?: MediaTraceContext;
|
|
23
|
+
};
|
|
24
|
+
export type SSRStatusFail = MediaCardErrorInfo & {
|
|
25
|
+
status: 'fail';
|
|
26
|
+
};
|
|
27
|
+
type SSRStatusSuccess = SuccessAttributes;
|
|
28
|
+
type SSRStatusUnknown = {
|
|
29
|
+
status: 'unknown';
|
|
30
|
+
};
|
|
31
|
+
type SSRStatusAttributes = SSRStatusSuccess | SSRStatusFail | SSRStatusUnknown;
|
|
32
|
+
export type SSRStatus = {
|
|
33
|
+
server: SSRStatusAttributes;
|
|
34
|
+
client: SSRStatusAttributes;
|
|
35
|
+
};
|
|
36
|
+
export type WithSSRReliability = {
|
|
37
|
+
ssrReliability?: SSRStatus;
|
|
38
|
+
};
|
|
39
|
+
export type RenderFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
40
|
+
failReason: FailedErrorFailReason | 'failed-processing';
|
|
41
|
+
error?: MediaClientErrorReason | 'nativeError';
|
|
42
|
+
request?: RequestMetadata;
|
|
43
|
+
}, 'failed', 'mediaCardRender'>;
|
|
44
|
+
export type ErrorEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
45
|
+
cardStatus: CardStatus;
|
|
46
|
+
failReason: FailedErrorFailReason | 'failed-processing';
|
|
47
|
+
error?: MediaClientErrorReason | 'nativeError';
|
|
48
|
+
request?: RequestMetadata;
|
|
49
|
+
}, 'nonCriticalFail', 'mediaCardRender'>;
|
|
50
|
+
export type ErrorBoundaryErrorInfo = {
|
|
51
|
+
componentStack: string;
|
|
52
|
+
};
|
|
53
|
+
export type AnalyticsErrorBoundaryAttributes = {
|
|
54
|
+
error?: Error | string;
|
|
55
|
+
info?: ErrorBoundaryErrorInfo;
|
|
56
|
+
browserInfo: string;
|
|
57
|
+
failReason: string;
|
|
58
|
+
};
|
|
59
|
+
export type AnalyticsErrorBoundaryCardPayload = OperationalEventPayload<AnalyticsErrorBoundaryAttributes, 'failed', 'mediaCardRender'>;
|
|
60
|
+
export type AnalyticsErrorBoundaryInlinePayload = OperationalEventPayload<AnalyticsErrorBoundaryAttributes, 'failed', 'mediaInlineRender'>;
|
|
61
|
+
export type RenderSucceededEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & SuccessAttributes & WithTraceContext, 'succeeded', 'mediaCardRender'>;
|
|
62
|
+
export type RenderCommencedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithTraceContext, 'commenced', 'mediaCardRender'>;
|
|
63
|
+
export type CacheHitEventPayload = OperationalEventPayload<WithCardPreviewCacheAttributes, 'cache-hit', 'mediaCardCache'>;
|
|
64
|
+
export type RemoteSuccessEventPayload = OperationalEventPayload<WithCardPreviewCacheAttributes, 'Remote-success', 'mediaCardCache'>;
|
|
65
|
+
export type CopiedFileEventPayload = UIEventPayload<{}, 'copied', string>;
|
|
66
|
+
export type ClickedEventPayload = UIEventPayload<{
|
|
67
|
+
label?: string;
|
|
68
|
+
}, 'clicked', string>;
|
|
69
|
+
export type RenderScreenEventPayload = Omit<ScreenEventPayload<ScreenAttributes, 'mediaCardRenderScreen'>, 'attributes'> & {
|
|
70
|
+
attributes: {
|
|
71
|
+
type: string | undefined;
|
|
72
|
+
fileAttributes: FileAttributes;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export type MediaCardAnalyticsEventPayload = RenderCommencedEventPayload | RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | RenderScreenEventPayload | CacheHitEventPayload | RemoteSuccessEventPayload | ErrorEventPayload | AnalyticsErrorBoundaryCardPayload | AnalyticsErrorBoundaryInlinePayload;
|
|
76
|
+
export declare const getFileAttributes: (metadata: FileDetails, fileStatus?: FileStatus) => FileAttributes;
|
|
77
|
+
export declare const getRenderPreviewableCardPayload: (fileAttributes: FileAttributes) => RenderScreenEventPayload;
|
|
78
|
+
export declare const getRenderCommencedEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, traceContext: MediaTraceContext) => RenderCommencedEventPayload;
|
|
79
|
+
export declare const getRenderSucceededEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderSucceededEventPayload;
|
|
80
|
+
export declare const getCacheHitEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => CacheHitEventPayload;
|
|
81
|
+
export declare const getRemoteSuccessEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => RemoteSuccessEventPayload;
|
|
82
|
+
export declare const getRenderFailedExternalUriPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => RenderFailedEventPayload;
|
|
83
|
+
export declare const getRenderErrorFailReason: (error: MediaCardError) => FailedErrorFailReason;
|
|
84
|
+
export declare const getRenderErrorErrorReason: (error: MediaCardError) => MediaClientErrorReason | 'nativeError';
|
|
85
|
+
export declare const getRenderErrorErrorDetail: (error: MediaCardError) => string;
|
|
86
|
+
export declare const getErrorTraceContext: (error: MediaCardError) => MediaTraceContext | undefined;
|
|
87
|
+
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) => RequestMetadata | undefined;
|
|
88
|
+
export declare const extractErrorInfo: (error: MediaCardError, metadataTraceContext?: MediaTraceContext) => MediaCardErrorInfo;
|
|
89
|
+
export declare const getRenderErrorEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error: MediaCardError, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderFailedEventPayload;
|
|
90
|
+
export declare const getErrorEventPayload: (cardStatus: CardStatus, fileAttributes: FileAttributes, error: MediaCardError, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => ErrorEventPayload;
|
|
91
|
+
export declare const getRenderFailedFileStatusPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderFailedEventPayload;
|
|
92
|
+
export declare const getCopiedFilePayload: (fileId: string) => CopiedFileEventPayload;
|
|
93
|
+
export declare function fireMediaCardEvent(payload: MediaCardAnalyticsEventPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
94
|
+
export declare const createAndFireMediaCardEvent: (payload: MediaCardAnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CardDimensionValue } from '../types';
|
|
2
|
+
export type BreakpointSizeValue = 'small' | 'medium' | 'large' | 'xlarge';
|
|
3
|
+
export declare const breakpointSize: (width: CardDimensionValue, sizes?: any) => BreakpointSizeValue;
|
|
4
|
+
export interface BreakpointProps {
|
|
5
|
+
breakpointSize: BreakpointSizeValue;
|
|
6
|
+
}
|
|
7
|
+
export type CardBreakpoint = {
|
|
8
|
+
[P in BreakpointSizeValue]?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const cardBreakpointSizes: CardBreakpoint;
|
|
11
|
+
export declare const breakpointStyles: ({ breakpointSize }: BreakpointProps) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { CardAction } from '../../card/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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { CardAction } from '../../card/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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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';
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CardAppearance, CardDimensions } from '../types';
|
|
2
|
+
export declare const defaultSmallCardDimensions: {
|
|
3
|
+
width: string;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const defaultImageCardDimensions: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const defaultHorizontalCardDimensions: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const defaultSquareCardDimensions: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const minSmallCardDimensions: {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const minImageCardDimensions: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const minSquareCardDimensions: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
};
|
|
30
|
+
export declare const minHorizontalCardDimensions: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
export declare const maxImageCardDimensions: {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
export declare const maxHorizontalCardDimensions: {
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
};
|
|
42
|
+
export declare const maxSquareCardDimensions: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
export declare const getCardMaxHeight: (appearance?: CardAppearance) => number;
|
|
47
|
+
export declare const getCardMinWidth: (appearance?: CardAppearance) => number;
|
|
48
|
+
export declare const getCardMaxWidth: (appearance?: CardAppearance) => number;
|
|
49
|
+
export declare const getDefaultCardDimensions: (appearance?: CardAppearance) => Required<CardDimensions>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const containsPixelUnit: (value: string) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**@jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
export interface ErrorIconProps {
|
|
5
|
+
readonly size: 'small' | 'medium' | 'large' | 'xlarge';
|
|
6
|
+
}
|
|
7
|
+
export declare class ErrorIcon extends Component<ErrorIconProps, {}> {
|
|
8
|
+
static defaultProps: {
|
|
9
|
+
size: string;
|
|
10
|
+
};
|
|
11
|
+
render(): jsx.JSX.Element;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const errorIconWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**@jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
import { MediaType } from '@atlaskit/media-client';
|
|
5
|
+
export interface FileIconProps {
|
|
6
|
+
mediaType?: MediaType;
|
|
7
|
+
style?: any;
|
|
8
|
+
iconUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class FileIcon extends Component<FileIconProps, {}> {
|
|
11
|
+
render(): jsx.JSX.Element;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fileTypeIconStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateUniqueId: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCSSUnitValue(value: number | string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CardDimensions } from '../types';
|
|
2
|
+
import { ElementDimension } from './getElementDimension';
|
|
3
|
+
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
4
|
+
export type getDataURIDimensionOptions = {
|
|
5
|
+
element?: Element | null;
|
|
6
|
+
dimensions?: CardDimensions;
|
|
7
|
+
};
|
|
8
|
+
export declare const getDataURIDimension: (dimension: ElementDimension, options: getDataURIDimensionOptions) => number;
|
|
9
|
+
export declare const getRequestedDimensions: (options: getDataURIDimensionOptions) => NumericalCardDimensions;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MediaCardCursor } from '../types';
|
|
2
|
+
import { MediaType } from '@atlaskit/media-client';
|
|
3
|
+
/**
|
|
4
|
+
* When the returned value is undefined, we'd expect the media card to take the parent's cursor style.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getMediaCardCursor: (useInlinePlayer: boolean, useMediaViewer: boolean, isErrorStatus: boolean, hasCardPreview: boolean, mediaType?: MediaType) => MediaCardCursor | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FileIdentifier } from '@atlaskit/media-client';
|
|
3
|
+
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
4
|
+
import { MediaCardErrorInfo } from '../../utils/analytics';
|
|
5
|
+
import { MediaCardSsr } from './types';
|
|
6
|
+
export declare const GLOBAL_MEDIA_CARD_SSR = "mediaCardSsr";
|
|
7
|
+
export declare const GLOBAL_MEDIA_NAMESPACE = "__MEDIA_INTERNAL";
|
|
8
|
+
export type MediaGlobalScope = {
|
|
9
|
+
[GLOBAL_MEDIA_CARD_SSR]?: MediaCardSsr;
|
|
10
|
+
};
|
|
11
|
+
export declare function getMediaGlobalScope(globalScope?: any): MediaGlobalScope;
|
|
12
|
+
export declare function getMediaCardSSR(globalScope?: any): MediaCardSsr;
|
|
13
|
+
export declare const getKey: ({ id, collectionName, occurrenceKey }: FileIdentifier) => string;
|
|
14
|
+
export declare const storeDataURI: (key: string, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo, globalScope?: any) => void;
|
|
15
|
+
export type StoreSSRDataScriptProps = {
|
|
16
|
+
identifier: FileIdentifier;
|
|
17
|
+
dataURI?: string;
|
|
18
|
+
dimensions?: NumericalCardDimensions;
|
|
19
|
+
error?: MediaCardErrorInfo;
|
|
20
|
+
};
|
|
21
|
+
export declare const StoreSSRDataScript: React.FC<StoreSSRDataScriptProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { StoreSSRDataScript, GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, getKey, } from './globalScope';
|
|
2
|
+
export { getSSRData } from './getSSRData';
|
|
3
|
+
export type { MediaCardSsrData, MediaCardSsr } from './types';
|
|
4
|
+
export type { MediaGlobalScope } from './globalScope';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
2
|
+
import { MediaCardErrorInfo } from '../../utils/analytics';
|
|
3
|
+
export type MediaCardSsrData = {
|
|
4
|
+
dataURI?: string;
|
|
5
|
+
dimensions?: NumericalCardDimensions;
|
|
6
|
+
error?: MediaCardErrorInfo;
|
|
7
|
+
};
|
|
8
|
+
export type MediaCardSsr = Record<string, MediaCardSsrData>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ErrorIcon } from './errorIcon';
|
|
2
|
+
export type { ErrorIconProps } from './errorIcon';
|
|
3
|
+
export { FileIcon } from './fileIcon';
|
|
4
|
+
export type { FileIconProps } from './fileIcon';
|
|
5
|
+
export { CardActionIconButton, CardActionsDropdownMenu, CardActionsView, default, } from './cardActions';
|
|
6
|
+
export type { CardActionIconButtonProps, CardActionsDropdownMenuProps, CardActionsViewProps, } from './cardActions';
|
|
7
|
+
export { isRetina } from './isRetina';
|
|
8
|
+
export { defaultHorizontalCardDimensions, defaultImageCardDimensions, defaultSmallCardDimensions, defaultSquareCardDimensions, getCardMaxHeight, getCardMaxWidth, getCardMinWidth, getDefaultCardDimensions, maxHorizontalCardDimensions, maxImageCardDimensions, maxSquareCardDimensions, minHorizontalCardDimensions, minImageCardDimensions, minSmallCardDimensions, minSquareCardDimensions, } from './cardDimensions';
|
|
9
|
+
export { breakpointSize, breakpointStyles, cardBreakpointSizes, } from './breakpoint';
|
|
10
|
+
export type { BreakpointProps, BreakpointSizeValue, CardBreakpoint, } from './breakpoint';
|
|
11
|
+
export { isValidPercentageUnit } from './isValidPercentageUnit';
|
|
12
|
+
export { getElementDimension } from './getElementDimension';
|
|
13
|
+
export type { ElementDimension } from './getElementDimension';
|
|
14
|
+
export { containsPixelUnit } from './containsPixelUnit';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isRetina(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isValidPercentageUnit: (value: string | number) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { StaticCardProps } from './types';
|
|
3
|
+
export interface ErrorCardProps extends StaticCardProps {
|
|
4
|
+
readonly size: 'small' | 'medium' | 'large' | 'xlarge';
|
|
5
|
+
}
|
|
6
|
+
export declare class CardError extends Component<ErrorCardProps, {}> {
|
|
7
|
+
static defaultProps: {
|
|
8
|
+
size: string;
|
|
9
|
+
};
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
get icon(): JSX.Element;
|
|
12
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WrapperProps } from './types';
|
|
2
|
+
export declare const blinkLoadingAnimation: import("@emotion/serialize").Keyframes;
|
|
3
|
+
export declare const wrapperStyles: ({ dimensions, theme }: WrapperProps) => import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const animatedWrapperStyles: (props: WrapperProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CardDimensions } from '../../types';
|
|
3
|
+
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
4
|
+
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
5
|
+
export interface StaticCardProps {
|
|
6
|
+
dimensions?: CardDimensions;
|
|
7
|
+
testId?: string;
|
|
8
|
+
featureFlags?: MediaFeatureFlags;
|
|
9
|
+
}
|
|
10
|
+
export interface WrapperProps {
|
|
11
|
+
dimensions: CardDimensions;
|
|
12
|
+
testId?: string;
|
|
13
|
+
children?: JSX.Element;
|
|
14
|
+
theme?: GlobalThemeTokens;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CardPreview } from '../types';
|
|
2
|
+
export declare const PREVIEW_CACHE_LRU_SIZE = 50;
|
|
3
|
+
export declare class ObjectURLCache {
|
|
4
|
+
private readonly cache;
|
|
5
|
+
constructor(size: number);
|
|
6
|
+
has(key: string): boolean;
|
|
7
|
+
get(key: string): CardPreview | undefined;
|
|
8
|
+
set(key: string, value: CardPreview): void;
|
|
9
|
+
remove(key: string): void;
|
|
10
|
+
}
|
|
11
|
+
export declare const createObjectURLCache: () => ObjectURLCache;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type PreventClickThroughProps = {
|
|
4
|
+
readonly children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function PreventClickThrough({ children, }: PreventClickThroughProps): JSX.Element;
|
|
7
|
+
export type CreatePreventClickThrough = <T>(onClick: () => void) => (event: React.MouseEvent<T, MouseEvent>) => void;
|
|
8
|
+
export declare const createPreventClickThrough: CreatePreventClickThrough;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**@jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
export interface ProgressBarProps {
|
|
5
|
+
progress?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class ProgressBar extends Component<ProgressBarProps, {}> {
|
|
8
|
+
render(): jsx.JSX.Element | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const progressWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MediaItemType, MediaType } from '@atlaskit/media-client';
|
|
2
|
+
import { CardStatus } from '../types';
|
|
3
|
+
export declare const shouldDisplayImageThumbnail: (cardStatus: CardStatus, mediaItemType: MediaItemType, dataURI?: string, mediaType?: MediaType, mimeType?: string) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CardStatus } from '../types';
|
|
2
|
+
import { FileAttributes } from '@atlaskit/media-common';
|
|
3
|
+
import { SSRStatus } from './analytics';
|
|
4
|
+
import { MediaCardError } from '../errors';
|
|
5
|
+
import { FileStateFlags } from '../types';
|
|
6
|
+
export declare const startUfoExperience: (id: string) => void;
|
|
7
|
+
export declare const completeUfoExperience: (id: string, status: CardStatus, fileAttributes: FileAttributes, fileStateFlags: FileStateFlags, ssrReliability: SSRStatus, error?: MediaCardError) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const takeSnapshot: (blob: Blob) => Promise<string>;
|