@atlaskit/media-card 70.11.0 → 73.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 +104 -0
- package/dist/cjs/errors.js +78 -5
- package/dist/cjs/files/cardImageView/cardOverlay/styled.js +1 -1
- package/dist/cjs/files/cardImageView/index.js +53 -104
- package/dist/cjs/files/cardImageView/styled.js +1 -1
- package/dist/cjs/files/index.js +0 -6
- package/dist/cjs/index.js +12 -6
- package/dist/cjs/root/card/cardAnalytics.js +11 -17
- package/dist/cjs/root/card/cardLoader.js +66 -124
- package/dist/cjs/root/card/cardState.js +50 -0
- package/dist/cjs/root/card/getCardPreview/cache.js +6 -1
- package/dist/cjs/root/card/getCardPreview/filePreviewStatus.js +53 -0
- package/dist/cjs/root/card/getCardPreview/helpers.js +14 -22
- package/dist/cjs/root/card/getCardPreview/index.js +176 -102
- package/dist/cjs/root/card/getCardStatus.js +7 -1
- package/dist/cjs/root/card/index.js +361 -281
- package/dist/cjs/root/cardView.js +109 -86
- package/dist/cjs/root/index.js +9 -1
- package/dist/cjs/root/inline/loader.js +22 -21
- package/dist/cjs/root/inline/{inlineMediaCard.js → mediaInlineCard.js} +84 -26
- package/dist/cjs/root/inlinePlayer.js +4 -3
- package/dist/cjs/root/styled.js +7 -3
- package/dist/cjs/root/ui/actionsBar/styled.js +1 -1
- package/dist/cjs/root/ui/blanket/styled.js +1 -1
- package/dist/cjs/root/ui/common.js +11 -5
- package/dist/cjs/root/ui/iconMessage/index.js +16 -7
- package/dist/cjs/root/ui/iconWrapper/styled.js +1 -1
- package/dist/cjs/root/ui/imageRenderer/imageRenderer.js +34 -124
- package/dist/cjs/root/ui/loadingRateLimited/loadingRateLimited.js +6 -4
- package/dist/cjs/root/ui/loadingRateLimited/styled.js +1 -1
- package/dist/cjs/root/ui/playButton/styled.js +1 -1
- package/dist/cjs/root/ui/progressBar/progressBar.js +2 -2
- package/dist/cjs/root/ui/progressBar/styled.js +2 -4
- package/dist/cjs/root/ui/styled.js +80 -17
- package/dist/cjs/root/ui/tickBox/styled.js +1 -1
- package/dist/cjs/root/ui/titleBox/failedTitleBox.js +9 -3
- package/dist/cjs/root/ui/titleBox/styled.js +2 -4
- package/dist/cjs/root/ui/titleBox/titleBox.js +2 -2
- package/dist/cjs/styles/index.js +25 -23
- package/dist/cjs/styles/mixins.js +1 -1
- package/dist/cjs/utils/analytics.js +21 -43
- package/dist/cjs/utils/breakpoint.js +1 -1
- package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +16 -9
- package/dist/cjs/utils/cardActions/index.js +10 -10
- package/dist/cjs/utils/cardActions/styled.js +1 -1
- package/dist/cjs/utils/cardDimensions.js +1 -1
- package/dist/cjs/utils/dimensionComparer.js +1 -1
- package/dist/cjs/utils/getErrorMessage.js +2 -2
- package/dist/cjs/utils/index.js +46 -46
- package/dist/cjs/utils/lightCards/styled.js +1 -1
- package/dist/cjs/utils/metadata.js +11 -3
- package/dist/cjs/utils/objectURLCache.js +7 -1
- package/dist/cjs/utils/shouldDisplayImageThumbnail.js +1 -1
- package/dist/cjs/utils/viewportDetector.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/errors.js +42 -2
- package/dist/es2019/files/cardImageView/index.js +8 -61
- package/dist/es2019/files/index.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/root/card/cardAnalytics.js +7 -15
- package/dist/es2019/root/card/cardLoader.js +47 -53
- package/dist/es2019/root/card/cardState.js +26 -0
- package/dist/es2019/root/card/getCardPreview/cache.js +5 -0
- package/dist/es2019/root/card/getCardPreview/filePreviewStatus.js +38 -0
- package/dist/es2019/root/card/getCardPreview/helpers.js +2 -12
- package/dist/es2019/root/card/getCardPreview/index.js +112 -79
- package/dist/es2019/root/card/getCardStatus.js +1 -0
- package/dist/es2019/root/card/index.js +285 -190
- package/dist/es2019/root/cardView.js +93 -68
- package/dist/es2019/root/index.js +2 -1
- package/dist/es2019/root/inline/loader.js +16 -15
- package/dist/es2019/root/inline/mediaInlineCard.js +143 -0
- package/dist/es2019/root/inlinePlayer.js +3 -2
- package/dist/es2019/root/styled.js +2 -1
- package/dist/es2019/root/ui/common.js +7 -1
- package/dist/es2019/root/ui/iconMessage/index.js +8 -5
- package/dist/es2019/root/ui/imageRenderer/imageRenderer.js +25 -88
- package/dist/es2019/root/ui/loadingRateLimited/loadingRateLimited.js +4 -3
- package/dist/es2019/root/ui/progressBar/progressBar.js +1 -1
- package/dist/es2019/root/ui/progressBar/styled.js +1 -2
- package/dist/es2019/root/ui/styled.js +64 -3
- package/dist/es2019/root/ui/titleBox/failedTitleBox.js +6 -3
- package/dist/es2019/root/ui/titleBox/styled.js +1 -2
- package/dist/es2019/root/ui/titleBox/titleBox.js +1 -1
- package/dist/es2019/utils/analytics.js +15 -34
- package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +8 -4
- package/dist/es2019/utils/dimensionComparer.js +1 -1
- package/dist/es2019/utils/getErrorMessage.js +1 -1
- package/dist/es2019/utils/metadata.js +12 -4
- package/dist/es2019/utils/objectURLCache.js +5 -0
- package/dist/es2019/utils/shouldDisplayImageThumbnail.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/errors.js +60 -1
- package/dist/esm/files/cardImageView/index.js +51 -102
- package/dist/esm/files/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/root/card/cardAnalytics.js +7 -16
- package/dist/esm/root/card/cardLoader.js +66 -126
- package/dist/esm/root/card/cardState.js +32 -0
- package/dist/esm/root/card/getCardPreview/cache.js +6 -0
- package/dist/esm/root/card/getCardPreview/filePreviewStatus.js +38 -0
- package/dist/esm/root/card/getCardPreview/helpers.js +13 -21
- package/dist/esm/root/card/getCardPreview/index.js +142 -95
- package/dist/esm/root/card/getCardStatus.js +3 -0
- package/dist/esm/root/card/index.js +370 -284
- package/dist/esm/root/cardView.js +109 -84
- package/dist/esm/root/index.js +2 -1
- package/dist/esm/root/inline/loader.js +23 -22
- package/dist/esm/root/inline/mediaInlineCard.js +156 -0
- package/dist/esm/root/inlinePlayer.js +3 -2
- package/dist/esm/root/styled.js +3 -2
- package/dist/esm/root/ui/common.js +7 -1
- package/dist/esm/root/ui/iconMessage/index.js +10 -5
- package/dist/esm/root/ui/imageRenderer/imageRenderer.js +27 -118
- package/dist/esm/root/ui/loadingRateLimited/loadingRateLimited.js +4 -3
- package/dist/esm/root/ui/progressBar/progressBar.js +1 -1
- package/dist/esm/root/ui/progressBar/styled.js +1 -2
- package/dist/esm/root/ui/styled.js +61 -13
- package/dist/esm/root/ui/titleBox/failedTitleBox.js +7 -3
- package/dist/esm/root/ui/titleBox/styled.js +1 -2
- package/dist/esm/root/ui/titleBox/titleBox.js +1 -1
- package/dist/esm/utils/analytics.js +16 -35
- package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +16 -9
- package/dist/esm/utils/dimensionComparer.js +1 -1
- package/dist/esm/utils/getErrorMessage.js +1 -1
- package/dist/esm/utils/metadata.js +12 -4
- package/dist/esm/utils/objectURLCache.js +6 -0
- package/dist/esm/utils/shouldDisplayImageThumbnail.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/errors.d.ts +15 -1
- package/dist/types/files/cardImageView/index.d.ts +4 -13
- package/dist/types/files/cardImageView/styled.d.ts +1 -1
- package/dist/types/files/index.d.ts +1 -1
- package/dist/types/index.d.ts +7 -5
- package/dist/types/root/card/cardAnalytics.d.ts +2 -6
- package/dist/types/root/card/cardLoader.d.ts +5 -19
- package/dist/types/root/card/cardState.d.ts +5 -0
- package/dist/types/root/card/getCardPreview/cache.d.ts +3 -1
- package/dist/types/root/card/getCardPreview/filePreviewStatus.d.ts +5 -0
- package/dist/types/root/card/getCardPreview/helpers.d.ts +3 -4
- package/dist/types/root/card/getCardPreview/index.d.ts +24 -14
- package/dist/types/root/card/getCardStatus.d.ts +1 -0
- package/dist/types/root/card/index.d.ts +19 -18
- package/dist/types/root/cardView.d.ts +13 -8
- package/dist/types/root/index.d.ts +1 -0
- package/dist/types/root/inline/loader.d.ts +8 -8
- package/dist/types/root/inline/{inlineMediaCard.d.ts → mediaInlineCard.d.ts} +4 -6
- package/dist/types/root/inlinePlayer.d.ts +1 -1
- package/dist/types/root/styled.d.ts +1 -0
- package/dist/types/root/ui/common.d.ts +4 -1
- package/dist/types/root/ui/iconMessage/index.d.ts +4 -3
- package/dist/types/root/ui/iconWrapper/styled.d.ts +1 -1
- package/dist/types/root/ui/imageRenderer/imageRenderer.d.ts +5 -15
- package/dist/types/root/ui/loadingRateLimited/loadingRateLimited.d.ts +2 -1
- package/dist/types/root/ui/loadingRateLimited/styled.d.ts +1 -1
- package/dist/types/root/ui/playButton/playButton.d.ts +1 -0
- package/dist/types/root/ui/progressBar/progressBar.d.ts +2 -1
- package/dist/types/root/ui/progressBar/styled.d.ts +1 -1
- package/dist/types/root/ui/styled.d.ts +10 -3
- package/dist/types/root/ui/tickBox/tickBox.d.ts +1 -0
- package/dist/types/root/ui/titleBox/failedTitleBox.d.ts +3 -1
- package/dist/types/root/ui/titleBox/styled.d.ts +1 -1
- package/dist/types/root/ui/titleBox/titleBox.d.ts +2 -10
- package/dist/types/styles/mixins.d.ts +1 -1
- package/dist/types/types.d.ts +7 -1
- package/dist/types/utils/analytics.d.ts +14 -15
- package/dist/types/utils/cardDimensions.d.ts +4 -4
- package/dist/types/utils/dimensionComparer.d.ts +1 -1
- package/dist/types/utils/getErrorMessage.d.ts +1 -0
- package/dist/types/utils/metadata.d.ts +2 -2
- package/dist/types/utils/objectURLCache.d.ts +2 -1
- package/example-helpers/developmentUseMessage.tsx +14 -0
- package/example-helpers/index.tsx +55 -4
- package/example-helpers/selectableCard.tsx +2 -1
- package/package.json +20 -16
- package/dist/cjs/root/card/cardSSRView.js +0 -99
- package/dist/cjs/root/card/getCardPreview/types.js +0 -5
- package/dist/cjs/root/ui/Breakpoint.js +0 -13
- package/dist/cjs/root/ui/styledSSR.js +0 -108
- package/dist/cjs/utils/fileAttributesContext.js +0 -40
- package/dist/es2019/root/card/cardSSRView.js +0 -79
- package/dist/es2019/root/card/getCardPreview/types.js +0 -1
- package/dist/es2019/root/inline/inlineMediaCard.js +0 -92
- package/dist/es2019/root/ui/Breakpoint.js +0 -6
- package/dist/es2019/root/ui/styledSSR.js +0 -93
- package/dist/es2019/utils/fileAttributesContext.js +0 -19
- package/dist/esm/root/card/cardSSRView.js +0 -78
- package/dist/esm/root/card/getCardPreview/types.js +0 -1
- package/dist/esm/root/inline/inlineMediaCard.js +0 -100
- package/dist/esm/root/ui/Breakpoint.js +0 -6
- package/dist/esm/root/ui/styledSSR.js +0 -76
- package/dist/esm/utils/fileAttributesContext.js +0 -18
- package/dist/types/root/card/cardSSRView.d.ts +0 -12
- package/dist/types/root/card/getCardPreview/types.d.ts +0 -5
- package/dist/types/root/ui/Breakpoint.d.ts +0 -4
- package/dist/types/root/ui/styledSSR.d.ts +0 -16
- package/dist/types/utils/fileAttributesContext.d.ts +0 -10
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { CardPreview } from '.';
|
|
2
|
+
export declare type MediaCardErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'error-file-state' | RemotePreviewPrimaryReason | LocalPreviewPrimaryReason | ImageLoadPrimaryReason | SsrPreviewPrimaryReason | 'preview-fetch';
|
|
3
|
+
export declare type ImageLoadPrimaryReason = 'cache-remote-uri' | 'cache-local-uri' | 'local-uri' | 'remote-uri' | 'external-uri' | 'unknown-uri';
|
|
2
4
|
export declare type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-not-ready';
|
|
3
5
|
export declare type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-unsupported' | 'local-preview-rejected' | 'local-preview-image' | 'local-preview-video';
|
|
6
|
+
export declare type SsrPreviewPrimaryReason = 'ssr-client-uri' | 'ssr-client-load' | 'ssr-server-uri' | 'ssr-server-load';
|
|
4
7
|
export declare class MediaCardError extends Error {
|
|
5
8
|
readonly primaryReason: MediaCardErrorPrimaryReason;
|
|
6
9
|
readonly secondaryError?: Error | undefined;
|
|
@@ -16,8 +19,19 @@ export declare class RemotePreviewError extends MediaCardError {
|
|
|
16
19
|
readonly secondaryError?: Error | undefined;
|
|
17
20
|
constructor(primaryReason: RemotePreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
18
21
|
}
|
|
22
|
+
export declare class SsrPreviewError extends MediaCardError {
|
|
23
|
+
readonly primaryReason: SsrPreviewPrimaryReason;
|
|
24
|
+
readonly secondaryError?: Error | undefined;
|
|
25
|
+
constructor(primaryReason: SsrPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
26
|
+
}
|
|
27
|
+
export declare const getImageLoadPrimaryReason: (source?: "local" | "remote" | "ssr-server" | "ssr-client" | "cache-local" | "cache-remote" | "cache-ssr-client" | "cache-ssr-server" | "external" | undefined) => ImageLoadPrimaryReason;
|
|
28
|
+
export declare class ImageLoadError extends MediaCardError {
|
|
29
|
+
constructor(source?: CardPreview['source']);
|
|
30
|
+
}
|
|
19
31
|
export declare function isMediaCardError(err: Error): err is MediaCardError;
|
|
20
32
|
export declare const isLocalPreviewError: (err: Error) => err is LocalPreviewError;
|
|
21
33
|
export declare const isRemotePreviewError: (err: Error) => err is LocalPreviewError;
|
|
22
34
|
export declare const isUnsupportedLocalPreviewError: (err: Error) => boolean;
|
|
35
|
+
export declare function isImageLoadError(err: Error): err is ImageLoadError;
|
|
23
36
|
export declare const ensureMediaCardError: (primaryReason: MediaCardErrorPrimaryReason, error: Error) => MediaCardError;
|
|
37
|
+
export declare const isUploadError: (error?: MediaCardError | undefined) => boolean | undefined;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Component, ReactNode } from 'react';
|
|
3
2
|
import { MediaItemType, MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
4
3
|
import { CardDimensions, CardStatus } from '../../index';
|
|
5
4
|
import { CardAction } from '../../actions';
|
|
6
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
7
|
-
import { RenderEventAction } from '../../utils/analytics';
|
|
8
|
-
import { WithFileAttributesProps } from '../../utils/fileAttributesContext';
|
|
9
5
|
export interface FileCardImageViewProps {
|
|
10
6
|
readonly mediaName?: string;
|
|
11
7
|
readonly mediaType?: MediaType;
|
|
@@ -25,15 +21,14 @@ export interface FileCardImageViewProps {
|
|
|
25
21
|
readonly actions?: CardAction[];
|
|
26
22
|
readonly onDisplayImage?: () => void;
|
|
27
23
|
readonly previewOrientation?: number;
|
|
28
|
-
readonly
|
|
24
|
+
readonly onImageError?: () => void;
|
|
25
|
+
readonly onImageLoad?: () => void;
|
|
29
26
|
}
|
|
30
27
|
export declare const fileCardImageViewSelector = "media-file-card-view";
|
|
31
28
|
export declare const fileCardImageViewSelectedSelector = "media-file-card-view-selected";
|
|
32
|
-
export declare
|
|
33
|
-
export declare class FileCardImageViewBase extends Component<FileCardImageViewBaseProps> {
|
|
29
|
+
export declare class FileCardImageView extends Component<FileCardImageViewProps> {
|
|
34
30
|
private wasThumbnailDisplayed;
|
|
35
|
-
|
|
36
|
-
static defaultProps: Partial<FileCardImageViewBaseProps>;
|
|
31
|
+
static defaultProps: Partial<FileCardImageViewProps>;
|
|
37
32
|
render(): JSX.Element;
|
|
38
33
|
private renderCardContents;
|
|
39
34
|
private renderLoadingContents;
|
|
@@ -41,10 +36,7 @@ export declare class FileCardImageViewBase extends Component<FileCardImageViewBa
|
|
|
41
36
|
private renderFailedContents;
|
|
42
37
|
private renderUploadingCardOverlay;
|
|
43
38
|
private renderPlayButton;
|
|
44
|
-
onImageLoad: () => void;
|
|
45
|
-
onImageError: () => void;
|
|
46
39
|
private renderMediaImage;
|
|
47
|
-
shouldFireEvent: (action: RenderEventAction) => boolean;
|
|
48
40
|
private renderProgressBar;
|
|
49
41
|
private renderSuccessCardContents;
|
|
50
42
|
private renderSuccessCardOverlay;
|
|
@@ -52,4 +44,3 @@ export declare class FileCardImageViewBase extends Component<FileCardImageViewBa
|
|
|
52
44
|
private get isCropped();
|
|
53
45
|
private get isStretched();
|
|
54
46
|
}
|
|
55
|
-
export declare const FileCardImageView: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<FileCardImageViewProps & WithAnalyticsEventsProps>, "progress" | "error" | "alt" | "dimensions" | "resizeMode" | "mediaType" | "mimeType" | "children" | "actions" | "mediaName" | "selectable" | "selected" | "disableOverlay" | "fileSize" | "dataURI" | "status" | "mediaItemType" | "onDisplayImage" | "previewOrientation" | "timeElapsedTillCommenced"> & React.RefAttributes<any>>;
|
|
@@ -6,7 +6,7 @@ export interface WrapperProps {
|
|
|
6
6
|
hasOnClick?: boolean;
|
|
7
7
|
mediaType?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const Wrapper: import("styled-components").StyledComponentClass<import("react").HTMLAttributes<{}> & WrapperProps, any, Pick<import("react").HTMLAttributes<{}>, "
|
|
9
|
+
export declare const Wrapper: import("styled-components").StyledComponentClass<import("react").HTMLAttributes<{}> & WrapperProps, any, Pick<import("react").HTMLAttributes<{}>, "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css"> & {
|
|
10
10
|
theme?: any;
|
|
11
11
|
} & WrapperProps>;
|
|
12
12
|
export declare const PlayIconWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FileCardImageView
|
|
1
|
+
export { FileCardImageView } from './cardImageView';
|
|
2
2
|
export type { FileCardImageViewProps } from './cardImageView';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { FileDetails, MediaClient, Identifier, ImageResizeMode, FileState } from '@atlaskit/media-client';
|
|
3
3
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
import { MediaFeatureFlags, NumericalCardDimensions } from '@atlaskit/media-common';
|
|
4
|
+
import { MediaFeatureFlags, NumericalCardDimensions, SSR } from '@atlaskit/media-common';
|
|
5
5
|
import { CardAction } from './actions';
|
|
6
6
|
import { MediaViewerDataSource } from '@atlaskit/media-viewer';
|
|
7
|
-
import { CardPreview } from './
|
|
8
|
-
import { CardStatus, CardAppearance } from './types';
|
|
7
|
+
import { CardPreview, CardStatus, CardAppearance } from './types';
|
|
9
8
|
import { MediaCardError } from './errors';
|
|
10
9
|
import { CardDimensions } from './utils';
|
|
11
10
|
export type { CardDimensions } from './utils';
|
|
12
11
|
export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
13
|
-
export { Card } from './root';
|
|
12
|
+
export { Card, MediaInlineCard } from './root';
|
|
14
13
|
export type { CardAction, CardEventHandler } from './actions';
|
|
15
|
-
export type { CardStatus, CardAppearance, CardDimensionValue } from './types';
|
|
14
|
+
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, } from './types';
|
|
16
15
|
export declare type TitleBoxIcon = 'LockFilledIcon';
|
|
17
16
|
export interface CardEvent {
|
|
18
17
|
event: MouseEvent<HTMLElement>;
|
|
@@ -49,6 +48,7 @@ export interface CardProps extends SharedCardProps, CardEventProps {
|
|
|
49
48
|
readonly mediaViewerDataSource?: MediaViewerDataSource;
|
|
50
49
|
readonly contextId?: string;
|
|
51
50
|
readonly shouldEnableDownloadButton?: boolean;
|
|
51
|
+
readonly ssr?: SSR;
|
|
52
52
|
}
|
|
53
53
|
export interface CardState {
|
|
54
54
|
status: CardStatus;
|
|
@@ -60,6 +60,8 @@ export interface CardState {
|
|
|
60
60
|
cardPreview?: CardPreview;
|
|
61
61
|
error?: MediaCardError;
|
|
62
62
|
cardRef: HTMLDivElement | null;
|
|
63
|
+
isBannedLocalPreview: boolean;
|
|
64
|
+
previewDidRender: boolean;
|
|
63
65
|
}
|
|
64
66
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
65
67
|
export { CardError } from './utils/lightCards/cardError';
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { FileAttributes, MediaFeatureFlags, PerformanceAttributes } from '@atlaskit/media-common';
|
|
2
2
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { CardStatus } from '../..';
|
|
4
|
-
import { CardPreview } from './getCardPreview';
|
|
5
4
|
import { MediaCardError } from './../../errors';
|
|
6
5
|
export declare const relevantFeatureFlagNames: Array<keyof MediaFeatureFlags>;
|
|
7
|
-
export declare
|
|
8
|
-
cardPreview?: CardPreview;
|
|
9
|
-
error?: MediaCardError;
|
|
10
|
-
};
|
|
11
|
-
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, { cardPreview, error }?: FireOperationalEventParams) => void;
|
|
6
|
+
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error?: MediaCardError | undefined) => void;
|
|
12
7
|
export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => void;
|
|
13
8
|
export declare const fireCopiedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileId: string, cardRef: HTMLDivElement) => void;
|
|
9
|
+
export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare type MediaCardErrorBoundaryComponent = React.ComponentType<MediaCardAnalyticsErrorBoundaryProps>;
|
|
8
|
-
export interface AsyncCardState {
|
|
9
|
-
Card?: CardWithMediaClientConfigComponent;
|
|
10
|
-
MediaCardErrorBoundary?: MediaCardErrorBoundaryComponent;
|
|
11
|
-
}
|
|
12
|
-
export default class CardLoader extends React.PureComponent<CardWithMediaClientConfigProps & AsyncCardState, AsyncCardState> {
|
|
13
|
-
static displayName: string;
|
|
14
|
-
static Card?: CardWithMediaClientConfigComponent;
|
|
15
|
-
static MediaCardErrorBoundary?: MediaCardErrorBoundaryComponent;
|
|
16
|
-
state: AsyncCardState;
|
|
17
|
-
componentDidMount(): Promise<void>;
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
2
|
+
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
+
import type { CardBaseProps } from '.';
|
|
4
|
+
export declare type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
5
|
+
declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
|
|
6
|
+
export default CardLoader;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FileState } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
+
import { CardState } from '../..';
|
|
4
|
+
export declare const createStateUpdater: (newState: Partial<CardState>) => (prevState: CardState) => Pick<CardState, keyof CardState>;
|
|
5
|
+
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags | undefined) => Partial<CardState>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ObjectURLCache } from '../../../utils/objectURLCache';
|
|
2
2
|
import { CardDimensions } from '../../../utils/cardDimensions';
|
|
3
|
-
import { CardPreview } from '
|
|
3
|
+
import { CardPreview } from '../../../types';
|
|
4
4
|
export declare const getCacheKey: (id: string, dimensions: CardDimensions) => string;
|
|
5
5
|
export interface CardPreviewCache {
|
|
6
6
|
get(id: string, dimensions: CardDimensions): CardPreview | undefined;
|
|
7
7
|
set(id: string, dimensions: CardDimensions, cardPreview: CardPreview): void;
|
|
8
|
+
remove(id: string, dimensions: CardDimensions): void;
|
|
8
9
|
}
|
|
9
10
|
export declare class CardPreviewCacheImpl implements CardPreviewCache {
|
|
10
11
|
private previewCache;
|
|
11
12
|
constructor(previewCache: ObjectURLCache);
|
|
12
13
|
get: (id: string, dimensions: CardDimensions) => CardPreview | undefined;
|
|
13
14
|
set: (id: string, dimensions: CardDimensions, cardPreview: CardPreview) => void;
|
|
15
|
+
remove: (id: string, dimensions: CardDimensions) => void;
|
|
14
16
|
}
|
|
15
17
|
declare const _default: CardPreviewCacheImpl;
|
|
16
18
|
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
2
|
+
import { CardStatus, FilePreviewStatus } from '../../../types';
|
|
3
|
+
import { FileState } from '@atlaskit/media-client';
|
|
4
|
+
export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags | undefined) => FilePreviewStatus;
|
|
5
|
+
export declare const isPreviewableStatus: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { MediaClient, FilePreview } from '@atlaskit/media-client';
|
|
2
|
-
import {
|
|
3
|
-
import { CardPreview } from './types';
|
|
1
|
+
import { MediaClient, FilePreview, MediaStoreGetFileImageParams } from '@atlaskit/media-client';
|
|
2
|
+
import { CardPreview } from '../../../types';
|
|
4
3
|
/**
|
|
5
4
|
* This method tells the support for the media
|
|
6
5
|
* types covered in getCardPreviewFromFilePreview
|
|
7
6
|
*/
|
|
8
7
|
export declare const isSupportedLocalPreview: (mediaType?: "audio" | "video" | "image" | "doc" | "archive" | "unknown" | undefined) => boolean;
|
|
9
8
|
export declare const getCardPreviewFromFilePreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<CardPreview>;
|
|
10
|
-
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string,
|
|
9
|
+
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams) => Promise<CardPreview>;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { MediaClient, FilePreview,
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { NumericalCardDimensions } from '../../..';
|
|
1
|
+
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
|
|
4
3
|
import { CardDimensions } from '../../../utils/cardDimensions';
|
|
5
|
-
import { CardPreview } from './types';
|
|
6
4
|
import { MediaCardError } from '../../../errors';
|
|
7
|
-
import { CardStatus,
|
|
8
|
-
export type { CardPreview } from './types';
|
|
5
|
+
import { CardStatus, CardPreview } from '../../../types';
|
|
9
6
|
export { getCardPreviewFromFilePreview, getCardPreviewFromBackend, isSupportedLocalPreview, } from './helpers';
|
|
10
|
-
export
|
|
11
|
-
export declare const shouldGetCardPreview: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
|
|
7
|
+
export { extractFilePreviewStatus } from './filePreviewStatus';
|
|
12
8
|
export declare const getCardPreviewFromCache: (id: string, dimensions: CardDimensions) => CardPreview | undefined;
|
|
9
|
+
export declare const removeCardPreviewFromCache: (id: string, dimensions: CardDimensions) => void;
|
|
13
10
|
/**
|
|
14
11
|
* Will return the preview if available and supported by the browser
|
|
15
12
|
* See extractFilePreviewStatus "hasLocalPreview" logic
|
|
@@ -18,14 +15,12 @@ export declare const getFilePreviewFromFileState: (fileState: FileState) => File
|
|
|
18
15
|
export declare type CardPreviewParams = {
|
|
19
16
|
mediaClient: MediaClient;
|
|
20
17
|
id: string;
|
|
21
|
-
collectionName?: string;
|
|
22
18
|
dimensions?: CardDimensions;
|
|
23
|
-
requestedDimensions: NumericalCardDimensions;
|
|
24
|
-
resizeMode?: ImageResizeMode;
|
|
25
|
-
isRemotePreviewReady: boolean;
|
|
26
19
|
filePreview?: FilePreview | Promise<FilePreview>;
|
|
27
|
-
addContextToDataURI: (dataURI: string) => string;
|
|
28
20
|
onLocalPreviewError?: (error: MediaCardError) => void;
|
|
21
|
+
isRemotePreviewReady: boolean;
|
|
22
|
+
imageUrlParams: MediaStoreGetFileImageParams;
|
|
23
|
+
mediaBlobUrlAttrs?: MediaBlobUrlAttrs;
|
|
29
24
|
};
|
|
30
25
|
/**
|
|
31
26
|
* This function will try to return a Card preview, either from cache, local preview or remote preview.
|
|
@@ -37,4 +32,19 @@ export declare type CardPreviewParams = {
|
|
|
37
32
|
* In that case, we still want to report the local preview error to the caller, for feature realiability track.
|
|
38
33
|
* hence the use of the optional callback onLocalPreviewError
|
|
39
34
|
*/
|
|
40
|
-
export declare const getCardPreview: ({ mediaClient, id,
|
|
35
|
+
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, }: CardPreviewParams) => Promise<CardPreview>;
|
|
36
|
+
export declare const shouldResolvePreview: ({ status, fileState, dimensions, prevDimensions, hasCardPreview, isBannedLocalPreview, featureFlags, }: {
|
|
37
|
+
status: CardStatus;
|
|
38
|
+
fileState: FileState;
|
|
39
|
+
dimensions?: CardDimensions | undefined;
|
|
40
|
+
prevDimensions?: CardDimensions | undefined;
|
|
41
|
+
hasCardPreview: boolean;
|
|
42
|
+
isBannedLocalPreview: boolean;
|
|
43
|
+
featureFlags?: MediaFeatureFlags | undefined;
|
|
44
|
+
}) => boolean;
|
|
45
|
+
export declare const getSSRCardPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined) => CardPreview;
|
|
46
|
+
export declare const isLocalPreview: (preview: CardPreview) => boolean;
|
|
47
|
+
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
48
|
+
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
49
|
+
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
50
|
+
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined) => Promise<CardPreview>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { FileStatus } from '@atlaskit/media-client';
|
|
2
2
|
import { CardStatus, FilePreviewStatus } from '../../types';
|
|
3
|
+
export declare const isFinalCardStatus: (status: CardStatus) => boolean;
|
|
3
4
|
export declare const getCardStatus: (fileStatus: FileStatus, { hasFilesize, isPreviewable, hasPreview }: FilePreviewStatus) => CardStatus;
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
/// <reference types="react-intl" />
|
|
2
1
|
import React, { Component } from 'react';
|
|
3
2
|
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
-
import { FileIdentifier
|
|
3
|
+
import { FileIdentifier } from '@atlaskit/media-client';
|
|
5
4
|
import { Subscription } from 'rxjs/Subscription';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
export declare type
|
|
9
|
-
export declare class CardBase extends Component<
|
|
5
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
6
|
+
import { CardAction, CardProps, CardState } from '../..';
|
|
7
|
+
export declare type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
|
|
8
|
+
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
10
9
|
private hasBeenMounted;
|
|
11
|
-
private lastFileState?;
|
|
12
|
-
private lastCardStatusUpdateTimestamp?;
|
|
13
10
|
private timeElapsedTillCommenced;
|
|
14
11
|
subscription?: Subscription;
|
|
15
12
|
static defaultProps: Partial<CardProps>;
|
|
16
|
-
|
|
17
|
-
intl: ReactIntl.IntlShape;
|
|
18
|
-
};
|
|
19
|
-
constructor(props: CardWithAnalyticsEventsProps);
|
|
13
|
+
constructor(props: CardBaseProps);
|
|
20
14
|
componentDidMount(): void;
|
|
21
15
|
componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
|
|
22
|
-
shouldRefetchImage: (current?: CardDimensions | undefined, next?: CardDimensions | undefined) => boolean;
|
|
23
16
|
componentWillUnmount(): void;
|
|
24
17
|
updateStateForIdentifier(identifier: FileIdentifier): void;
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
|
|
18
|
+
private getImageURLParams;
|
|
19
|
+
private getMediaBlobUrlAttrs;
|
|
20
|
+
private getCardPreviewParams;
|
|
21
|
+
private setCacheSSRPreview;
|
|
22
|
+
private resolveSSRPreview;
|
|
23
|
+
private resolvePreview;
|
|
29
24
|
subscribeInternalFile(identifier: FileIdentifier): void;
|
|
25
|
+
private get requestedDimensions();
|
|
30
26
|
private get metadata();
|
|
31
27
|
private get fileAttributes();
|
|
28
|
+
private getPerformanceAttributes;
|
|
29
|
+
private onImageError;
|
|
30
|
+
private onImageLoad;
|
|
32
31
|
private fireOperationalEvent;
|
|
33
32
|
private fireCommencedEvent;
|
|
34
33
|
private fireCopiedEvent;
|
|
34
|
+
private fireScreenEvent;
|
|
35
|
+
private fireLocalPreviewErrorEvent;
|
|
35
36
|
private safeSetState;
|
|
36
37
|
unsubscribe: () => void;
|
|
37
38
|
get actions(): CardAction[];
|
|
@@ -48,4 +49,4 @@ export declare class CardBase extends Component<CardWithAnalyticsEventsProps, Ca
|
|
|
48
49
|
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
|
49
50
|
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
50
51
|
}
|
|
51
|
-
export declare const Card: React.ComponentType<
|
|
52
|
+
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MouseEvent } from 'react';
|
|
1
|
+
import React, { MouseEvent } from 'react';
|
|
3
2
|
import { MediaItemType, FileDetails } from '@atlaskit/media-client';
|
|
4
3
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
4
|
import { SharedCardProps, CardStatus } from '../index';
|
|
5
|
+
import { MediaCardError } from '../errors';
|
|
6
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
6
7
|
export interface CardViewOwnProps extends SharedCardProps {
|
|
7
8
|
readonly status: CardStatus;
|
|
8
9
|
readonly mediaItemType: MediaItemType;
|
|
9
10
|
readonly metadata?: FileDetails;
|
|
10
|
-
readonly error?:
|
|
11
|
+
readonly error?: MediaCardError;
|
|
11
12
|
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
12
13
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
13
14
|
readonly onDisplayImage?: () => void;
|
|
@@ -15,12 +16,15 @@ export interface CardViewOwnProps extends SharedCardProps {
|
|
|
15
16
|
readonly progress?: number;
|
|
16
17
|
readonly previewOrientation?: number;
|
|
17
18
|
readonly innerRef?: (instance: HTMLDivElement | null) => void;
|
|
19
|
+
readonly onImageLoad: () => void;
|
|
20
|
+
readonly onImageError: () => void;
|
|
21
|
+
readonly nativeLazyLoad?: boolean;
|
|
22
|
+
readonly forceSyncDisplay?: boolean;
|
|
18
23
|
disableAnimation?: boolean;
|
|
19
|
-
timeElapsedTillCommenced?: number;
|
|
20
24
|
}
|
|
21
25
|
export interface CardViewState {
|
|
22
26
|
elementWidth?: number;
|
|
23
|
-
|
|
27
|
+
didImageRender: boolean;
|
|
24
28
|
}
|
|
25
29
|
export declare type CardViewProps = CardViewOwnProps & WithAnalyticsEventsProps;
|
|
26
30
|
export interface RenderConfigByStatus {
|
|
@@ -34,8 +38,8 @@ export interface RenderConfigByStatus {
|
|
|
34
38
|
renderProgressBar?: boolean;
|
|
35
39
|
renderSpinner?: boolean;
|
|
36
40
|
renderFailedTitleBox?: boolean;
|
|
37
|
-
renderLoadingRateLimited?: boolean;
|
|
38
41
|
renderTickBox?: boolean;
|
|
42
|
+
customTitleMessage?: MessageDescriptor;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
@@ -47,7 +51,8 @@ export declare class CardViewBase extends React.Component<CardViewProps, CardVie
|
|
|
47
51
|
static defaultProps: Partial<CardViewOwnProps>;
|
|
48
52
|
componentDidMount(): void;
|
|
49
53
|
componentDidUpdate({ dataURI: prevDataURI }: CardViewProps): void;
|
|
50
|
-
private
|
|
54
|
+
private onImageLoad;
|
|
55
|
+
private onImageError;
|
|
51
56
|
private get width();
|
|
52
57
|
private get breakpoint();
|
|
53
58
|
saveElementWidth: () => void;
|
|
@@ -68,4 +73,4 @@ export declare class CardViewBase extends React.Component<CardViewProps, CardVie
|
|
|
68
73
|
private getRenderConfigByStatus;
|
|
69
74
|
private renderNewExperienceCard;
|
|
70
75
|
}
|
|
71
|
-
export declare const CardView: React.ForwardRefExoticComponent<Pick<Pick<CardViewProps, "progress" | "
|
|
76
|
+
export declare const CardView: React.ForwardRefExoticComponent<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "error" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError" | "onImageLoad" | "forceSyncDisplay" | "nativeLazyLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">, never> & Partial<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "error" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError" | "onImageLoad" | "forceSyncDisplay" | "nativeLazyLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "error" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError" | "onImageLoad" | "forceSyncDisplay" | "nativeLazyLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">> & Partial<Pick<Partial<CardViewOwnProps>, never>> & React.RefAttributes<any>>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import {
|
|
4
|
-
export declare type
|
|
5
|
-
declare type
|
|
3
|
+
import { MediaInlineCardProps } from './mediaInlineCard';
|
|
4
|
+
export declare type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
5
|
+
declare type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
6
6
|
declare type ErrorBoundaryComponent = React.ComponentType<{
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
};
|
|
10
10
|
}>;
|
|
11
|
-
export interface
|
|
12
|
-
|
|
11
|
+
export interface MediaInlineCardLoaderState {
|
|
12
|
+
MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
13
13
|
ErrorBoundary?: ErrorBoundaryComponent;
|
|
14
14
|
}
|
|
15
|
-
export default class
|
|
15
|
+
export default class MediaInlineCardLoader extends React.PureComponent<MediaInlineCardWithMediaClientConfigProps & MediaInlineCardLoaderState, MediaInlineCardLoaderState> {
|
|
16
16
|
static displayName: string;
|
|
17
|
-
static
|
|
17
|
+
static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
18
18
|
static ErrorBoundary?: ErrorBoundaryComponent;
|
|
19
|
-
state:
|
|
19
|
+
state: MediaInlineCardLoaderState;
|
|
20
20
|
componentDidMount(): Promise<void>;
|
|
21
21
|
render(): JSX.Element;
|
|
22
22
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { FileIdentifier, MediaClient } from '@atlaskit/media-client';
|
|
3
|
-
import {
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { MediaViewerDataSource } from '@atlaskit/media-viewer';
|
|
5
|
-
export interface
|
|
5
|
+
export interface MediaInlineCardProps {
|
|
6
6
|
identifier: FileIdentifier;
|
|
7
7
|
mediaClient: MediaClient;
|
|
8
8
|
shouldOpenMediaViewer?: boolean;
|
|
@@ -10,7 +10,5 @@ export interface InlineMediaCardProps {
|
|
|
10
10
|
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
11
11
|
mediaViewerDataSource?: MediaViewerDataSource;
|
|
12
12
|
}
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
WrappedComponent: ReactIntl.ComponentConstructor<InlineMediaCardProps & InjectedIntlProps>;
|
|
16
|
-
};
|
|
13
|
+
export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
|
|
14
|
+
export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
|
|
@@ -40,4 +40,4 @@ export declare class InlinePlayerBase extends Component<InlinePlayerProps, Inlin
|
|
|
40
40
|
onFirstPlay: () => void;
|
|
41
41
|
render(): JSX.Element;
|
|
42
42
|
}
|
|
43
|
-
export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<InlinePlayerProps, "
|
|
43
|
+
export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<InlinePlayerProps, "onError" | "onClick" | "createAnalyticsEvent" | "testId" | "selected" | "dimensions" | "originalDimensions" | "mediaClient" | "identifier" | "forwardRef"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -12,4 +12,5 @@ declare type InlinePlayerWrapper = {
|
|
|
12
12
|
selected?: boolean;
|
|
13
13
|
};
|
|
14
14
|
export declare const InlinePlayerWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & InlinePlayerWrapper, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & InlinePlayerWrapper>;
|
|
15
|
+
export declare const FormattedMessageWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
15
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
3
3
|
export declare type InternalIconMessageProps = {
|
|
4
|
-
messageDescriptor:
|
|
4
|
+
messageDescriptor: MessageDescriptor;
|
|
5
5
|
animated?: boolean;
|
|
6
6
|
reducedFont?: boolean;
|
|
7
7
|
};
|
|
@@ -11,6 +11,7 @@ declare type CreatingPreviewProps = {
|
|
|
11
11
|
export declare const IconMessage: React.FC<InternalIconMessageProps>;
|
|
12
12
|
export declare const CreatingPreview: React.FC<CreatingPreviewProps>;
|
|
13
13
|
export declare const PreviewUnavailable: React.FC;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const FailedToLoad: React.FC;
|
|
15
|
+
export declare const FailedToUpload: React.FC;
|
|
15
16
|
export declare const PreviewCurrentlyUnavailable: React.FC;
|
|
16
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Breakpoint } from '../
|
|
2
|
+
import { Breakpoint } from '../common';
|
|
3
3
|
export declare function titleBoxHeight(hasTitleBox: boolean, breakpoint: Breakpoint): string;
|
|
4
4
|
export declare type IconWrapperProps = {
|
|
5
5
|
hasTitleBox: boolean;
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MediaType, ImageResizeMode
|
|
3
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
-
import { RenderEventAction } from '../../../utils/analytics';
|
|
5
|
-
import { WithFileAttributesProps } from '../../../utils/fileAttributesContext';
|
|
2
|
+
import { MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
6
3
|
export declare type ImageRendererProps = {
|
|
7
4
|
readonly dataURI: string;
|
|
8
5
|
readonly mediaType: MediaType;
|
|
9
|
-
readonly mediaItemType: MediaItemType;
|
|
10
6
|
readonly previewOrientation?: number;
|
|
11
7
|
readonly alt?: string;
|
|
12
8
|
readonly resizeMode?: ImageResizeMode;
|
|
13
9
|
readonly onDisplayImage?: () => void;
|
|
14
10
|
readonly onImageError?: () => void;
|
|
15
|
-
readonly
|
|
11
|
+
readonly onImageLoad?: () => void;
|
|
12
|
+
readonly nativeLazyLoad?: boolean;
|
|
13
|
+
readonly forceSyncDisplay?: boolean;
|
|
16
14
|
};
|
|
17
|
-
export declare
|
|
18
|
-
private lastAnalyticsAction?;
|
|
19
|
-
componentDidMount(): void;
|
|
20
|
-
onImageLoad: () => void;
|
|
21
|
-
onImageError: () => void;
|
|
22
|
-
shouldFireEvent: (action: RenderEventAction) => boolean;
|
|
23
|
-
render(): JSX.Element;
|
|
24
|
-
}
|
|
25
|
-
export declare const ImageRenderer: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<ImageRendererProps & WithAnalyticsEventsProps>, "alt" | "resizeMode" | "mediaType" | "children" | "dataURI" | "mediaItemType" | "onDisplayImage" | "previewOrientation" | "timeElapsedTillCommenced" | "onImageError"> & React.RefAttributes<any>>;
|
|
15
|
+
export declare const ImageRenderer: React.FC<ImageRendererProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Breakpoint } from '../common';
|
|
2
3
|
export declare const LoadingRateLimited: ({ breakpoint, positionBottom, }: {
|
|
3
4
|
breakpoint?: Breakpoint | undefined;
|
|
4
5
|
positionBottom?: boolean | undefined;
|