@atlaskit/media-card 72.1.0 → 73.2.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 +89 -0
- package/dist/cjs/actions.js +2 -2
- package/dist/cjs/errors.js +11 -7
- package/dist/cjs/files/cardImageView/cardOverlay/styled.js +1 -1
- package/dist/cjs/files/cardImageView/index.js +52 -42
- package/dist/cjs/files/cardImageView/styled.js +1 -1
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/root/card/cardAnalytics.js +2 -2
- package/dist/cjs/root/card/cardState.js +2 -2
- package/dist/cjs/root/card/getCardPreview/cache.js +5 -5
- package/dist/cjs/root/card/getCardPreview/filePreviewStatus.js +4 -1
- package/dist/cjs/root/card/getCardPreview/helpers.js +1 -1
- package/dist/cjs/root/card/getCardPreview/index.js +18 -9
- package/dist/cjs/root/card/getCardStatus.js +1 -1
- package/dist/cjs/root/card/index.js +279 -159
- package/dist/cjs/root/cardView.js +130 -118
- package/dist/cjs/root/inline/loader.js +45 -14
- package/dist/cjs/root/inline/mediaInlineCard.js +24 -9
- package/dist/cjs/root/inlinePlayer.js +80 -25
- 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 +1 -1
- package/dist/cjs/root/ui/iconMessage/index.js +5 -3
- package/dist/cjs/root/ui/iconWrapper/styled.js +1 -1
- package/dist/cjs/root/ui/imageRenderer/imageRenderer.js +14 -6
- package/dist/cjs/root/ui/loadingRateLimited/loadingRateLimited.js +4 -2
- package/dist/cjs/root/ui/loadingRateLimited/styled.js +2 -2
- package/dist/cjs/root/ui/playButton/styled.js +1 -1
- package/dist/cjs/root/ui/progressBar/progressBar.js +5 -2
- package/dist/cjs/root/ui/progressBar/styled.js +7 -6
- package/dist/cjs/root/ui/styled.js +6 -6
- package/dist/cjs/root/ui/tickBox/styled.js +1 -1
- package/dist/cjs/root/ui/titleBox/failedTitleBox.js +4 -2
- package/dist/cjs/root/ui/titleBox/styled.js +1 -1
- 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/types.js +10 -1
- package/dist/cjs/utils/analytics.js +24 -7
- package/dist/cjs/utils/breakpoint.js +1 -1
- package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +3 -1
- 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 +7 -13
- package/dist/cjs/utils/getErrorMessage.js +2 -2
- package/dist/cjs/utils/getMediaCardCursor.js +29 -0
- package/dist/cjs/utils/globalScope/getSSRData.js +20 -0
- package/dist/cjs/utils/globalScope/globalScope.js +94 -0
- package/dist/cjs/utils/globalScope/index.js +39 -0
- package/dist/cjs/utils/globalScope/types.js +5 -0
- package/dist/cjs/utils/index.js +46 -46
- package/dist/cjs/utils/lightCards/styled.js +1 -1
- package/dist/cjs/utils/objectURLCache.js +1 -1
- package/dist/cjs/utils/printScript.js +44 -0
- package/dist/cjs/utils/viewportDetector.js +49 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/files/cardImageView/index.js +19 -5
- package/dist/es2019/root/card/cardAnalytics.js +1 -1
- package/dist/es2019/root/card/getCardPreview/filePreviewStatus.js +4 -1
- package/dist/es2019/root/card/getCardPreview/index.js +1 -0
- package/dist/es2019/root/card/index.js +150 -49
- package/dist/es2019/root/cardView.js +40 -30
- package/dist/es2019/root/inline/loader.js +15 -4
- package/dist/es2019/root/inline/mediaInlineCard.js +23 -8
- package/dist/es2019/root/inlinePlayer.js +59 -5
- package/dist/es2019/root/styled.js +2 -1
- package/dist/es2019/root/ui/iconMessage/index.js +3 -2
- package/dist/es2019/root/ui/imageRenderer/imageRenderer.js +14 -6
- package/dist/es2019/root/ui/loadingRateLimited/loadingRateLimited.js +3 -2
- package/dist/es2019/root/ui/loadingRateLimited/styled.js +1 -1
- package/dist/es2019/root/ui/progressBar/progressBar.js +4 -2
- package/dist/es2019/root/ui/progressBar/styled.js +6 -4
- package/dist/es2019/root/ui/styled.js +5 -5
- package/dist/es2019/root/ui/titleBox/failedTitleBox.js +3 -2
- package/dist/es2019/root/ui/titleBox/titleBox.js +1 -1
- package/dist/es2019/types.js +7 -1
- package/dist/es2019/utils/analytics.js +8 -3
- package/dist/es2019/utils/dimensionComparer.js +6 -13
- package/dist/es2019/utils/getErrorMessage.js +1 -1
- package/dist/es2019/utils/getMediaCardCursor.js +19 -0
- package/dist/es2019/utils/globalScope/getSSRData.js +10 -0
- package/dist/es2019/utils/globalScope/globalScope.js +62 -0
- package/dist/es2019/utils/globalScope/index.js +2 -0
- package/dist/es2019/utils/globalScope/types.js +1 -0
- package/dist/es2019/utils/printScript.js +19 -0
- package/dist/es2019/utils/viewportDetector.js +48 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions.js +2 -2
- package/dist/esm/errors.js +6 -5
- package/dist/esm/files/cardImageView/index.js +53 -41
- package/dist/esm/root/card/cardAnalytics.js +1 -1
- package/dist/esm/root/card/cardState.js +2 -2
- package/dist/esm/root/card/getCardPreview/cache.js +3 -2
- package/dist/esm/root/card/getCardPreview/filePreviewStatus.js +4 -1
- package/dist/esm/root/card/getCardPreview/index.js +5 -2
- package/dist/esm/root/card/index.js +266 -145
- package/dist/esm/root/cardView.js +128 -117
- package/dist/esm/root/inline/loader.js +46 -14
- package/dist/esm/root/inline/mediaInlineCard.js +23 -8
- package/dist/esm/root/inlinePlayer.js +77 -24
- package/dist/esm/root/styled.js +3 -2
- package/dist/esm/root/ui/iconMessage/index.js +3 -2
- package/dist/esm/root/ui/imageRenderer/imageRenderer.js +14 -6
- package/dist/esm/root/ui/loadingRateLimited/loadingRateLimited.js +3 -2
- package/dist/esm/root/ui/loadingRateLimited/styled.js +1 -1
- package/dist/esm/root/ui/progressBar/progressBar.js +5 -2
- package/dist/esm/root/ui/progressBar/styled.js +6 -5
- package/dist/esm/root/ui/styled.js +5 -5
- package/dist/esm/root/ui/titleBox/failedTitleBox.js +3 -2
- package/dist/esm/root/ui/titleBox/titleBox.js +1 -1
- package/dist/esm/types.js +7 -1
- package/dist/esm/utils/analytics.js +17 -6
- package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +2 -1
- package/dist/esm/utils/dimensionComparer.js +8 -13
- package/dist/esm/utils/getErrorMessage.js +1 -1
- package/dist/esm/utils/getMediaCardCursor.js +19 -0
- package/dist/esm/utils/globalScope/getSSRData.js +10 -0
- package/dist/esm/utils/globalScope/globalScope.js +69 -0
- package/dist/esm/utils/globalScope/index.js +2 -0
- package/dist/esm/utils/globalScope/types.js +1 -0
- package/dist/esm/utils/printScript.js +30 -0
- package/dist/esm/utils/viewportDetector.js +48 -21
- package/dist/esm/version.json +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/files/cardImageView/index.d.ts +6 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/root/card/cardLoader.d.ts +2 -2
- package/dist/types/root/card/getCardPreview/index.d.ts +1 -0
- package/dist/types/root/card/index.d.ts +10 -9
- package/dist/types/root/cardView.d.ts +10 -8
- package/dist/types/root/inline/loader.d.ts +2 -0
- package/dist/types/root/inline/mediaInlineCard.d.ts +3 -5
- package/dist/types/root/inlinePlayer.d.ts +10 -1
- package/dist/types/root/styled.d.ts +1 -0
- package/dist/types/root/ui/iconMessage/index.d.ts +2 -2
- package/dist/types/root/ui/imageRenderer/imageRenderer.d.ts +4 -4
- package/dist/types/root/ui/loadingRateLimited/loadingRateLimited.d.ts +1 -0
- package/dist/types/root/ui/playButton/playButton.d.ts +1 -0
- package/dist/types/root/ui/progressBar/progressBar.d.ts +3 -1
- package/dist/types/root/ui/progressBar/styled.d.ts +2 -1
- package/dist/types/root/ui/styled.d.ts +2 -1
- package/dist/types/root/ui/tickBox/tickBox.d.ts +1 -0
- package/dist/types/root/ui/titleBox/failedTitleBox.d.ts +2 -2
- package/dist/types/root/ui/titleBox/titleBox.d.ts +1 -9
- package/dist/types/types.d.ts +6 -1
- package/dist/types/utils/analytics.d.ts +6 -0
- package/dist/types/utils/getErrorMessage.d.ts +1 -0
- package/dist/types/utils/getMediaCardCursor.d.ts +2 -0
- package/dist/types/utils/globalScope/getSSRData.d.ts +3 -0
- package/dist/types/utils/globalScope/globalScope.d.ts +21 -0
- package/dist/types/utils/globalScope/index.d.ts +4 -0
- package/dist/types/utils/globalScope/types.d.ts +8 -0
- package/dist/types/utils/printScript.d.ts +2 -0
- package/dist/types/utils/viewportDetector.d.ts +13 -5
- package/package.json +14 -16
- package/dist/cjs/utils/lazyContent/index.js +0 -56
- package/dist/cjs/utils/lazyContent/styled.js +0 -23
- package/dist/es2019/utils/lazyContent/index.js +0 -18
- package/dist/es2019/utils/lazyContent/styled.js +0 -12
- package/dist/esm/utils/lazyContent/index.js +0 -41
- package/dist/esm/utils/lazyContent/styled.js +0 -14
- package/dist/types/utils/lazyContent/index.d.ts +0 -11
- package/dist/types/utils/lazyContent/styled.d.ts +0 -5
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
|
|
3
|
+
var printParam = function printParam(param) {
|
|
4
|
+
if (typeof param === 'string') {
|
|
5
|
+
return "'".concat(param, "'");
|
|
6
|
+
} else if (_typeof(param) === 'object') {
|
|
7
|
+
return JSON.stringify(param);
|
|
8
|
+
} else if (param === undefined) {
|
|
9
|
+
return 'undefined';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return param;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var printParams = function printParams(args) {
|
|
16
|
+
return args.map(function (arg) {
|
|
17
|
+
return printParam(arg);
|
|
18
|
+
}).join(',');
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export var printFunctionCall = function printFunctionCall(fn) {
|
|
22
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
23
|
+
args[_key - 1] = arguments[_key];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return "(".concat(fn.toString(), ")(").concat(printParams(args), ");");
|
|
27
|
+
};
|
|
28
|
+
export var printScript = function printScript(statements) {
|
|
29
|
+
return "(function(){\n ".concat(statements.join(';'), "\n})();\n");
|
|
30
|
+
};
|
|
@@ -4,8 +4,28 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
|
|
5
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
6
6
|
|
|
7
|
-
import React, { useEffect } from 'react';
|
|
8
|
-
|
|
7
|
+
import React, { useEffect, forwardRef } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* As IntersectionObserver::rootMargin doesn't work within IFrames, we use an empty div + dynamic offsetTop to eagerly detect cards entering viewport.
|
|
10
|
+
* Using this approach, we can lazy load cards ABS_VIEWPORT_ANCHOR_OFFSET_TOP px before they enter viewport.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export var ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
|
|
14
|
+
|
|
15
|
+
export var ViewportAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
16
|
+
if (typeof IntersectionObserver === 'undefined') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: "media-card-viewport-anchor",
|
|
23
|
+
style: {
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
top: "".concat(props.offsetTop, "px")
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
9
29
|
|
|
10
30
|
var createIntersectionObserverCallback = function createIntersectionObserverCallback(onVisible) {
|
|
11
31
|
return function (entries, observer) {
|
|
@@ -30,33 +50,40 @@ var createIntersectionObserverCallback = function createIntersectionObserverCall
|
|
|
30
50
|
};
|
|
31
51
|
};
|
|
32
52
|
|
|
33
|
-
var
|
|
53
|
+
var ViewportObserver = function ViewportObserver(_ref) {
|
|
34
54
|
var onVisible = _ref.onVisible,
|
|
55
|
+
cardEl = _ref.cardEl,
|
|
35
56
|
children = _ref.children,
|
|
36
|
-
|
|
57
|
+
preAnchorRef = _ref.preAnchorRef,
|
|
58
|
+
postAnchorRef = _ref.postAnchorRef;
|
|
37
59
|
useEffect(function () {
|
|
38
60
|
// IntersectionObserver uses root and target elements to detect intersections, defaulting root to the viewport
|
|
39
61
|
var intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisible));
|
|
40
|
-
|
|
62
|
+
(preAnchorRef === null || preAnchorRef === void 0 ? void 0 : preAnchorRef.current) && intersectionObserver.observe(preAnchorRef.current);
|
|
63
|
+
(postAnchorRef === null || postAnchorRef === void 0 ? void 0 : postAnchorRef.current) && intersectionObserver.observe(postAnchorRef.current);
|
|
64
|
+
cardEl && intersectionObserver.observe(cardEl);
|
|
41
65
|
return function () {
|
|
42
66
|
intersectionObserver.disconnect();
|
|
43
67
|
};
|
|
44
|
-
}, [
|
|
68
|
+
}, [cardEl, preAnchorRef, postAnchorRef, onVisible]);
|
|
45
69
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
46
70
|
};
|
|
47
71
|
|
|
48
|
-
export var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
export var ViewportDetector = function ViewportDetector(_ref2) {
|
|
73
|
+
var cardEl = _ref2.cardEl,
|
|
74
|
+
preAnchorRef = _ref2.preAnchorRef,
|
|
75
|
+
postAnchorRef = _ref2.postAnchorRef,
|
|
76
|
+
onVisible = _ref2.onVisible,
|
|
77
|
+
children = _ref2.children;
|
|
78
|
+
|
|
79
|
+
if (typeof IntersectionObserver === 'undefined') {
|
|
80
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return /*#__PURE__*/React.createElement(ViewportObserver, {
|
|
84
|
+
cardEl: cardEl,
|
|
85
|
+
preAnchorRef: preAnchorRef,
|
|
86
|
+
postAnchorRef: postAnchorRef,
|
|
87
|
+
onVisible: onVisible
|
|
88
|
+
}, children);
|
|
89
|
+
};
|
package/dist/esm/version.json
CHANGED
package/dist/types/errors.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare class SsrPreviewError extends MediaCardError {
|
|
|
24
24
|
readonly secondaryError?: Error | undefined;
|
|
25
25
|
constructor(primaryReason: SsrPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
26
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;
|
|
27
|
+
export declare const getImageLoadPrimaryReason: (source?: "local" | "remote" | "ssr-server" | "ssr-client" | "ssr-data" | "cache-local" | "cache-remote" | "cache-ssr-client" | "cache-ssr-server" | "external" | undefined) => ImageLoadPrimaryReason;
|
|
28
28
|
export declare class ImageLoadError extends MediaCardError {
|
|
29
29
|
constructor(source?: CardPreview['source']);
|
|
30
30
|
}
|
|
@@ -2,6 +2,7 @@ import { Component, ReactNode } from 'react';
|
|
|
2
2
|
import { MediaItemType, MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
3
3
|
import { CardDimensions, CardStatus } from '../../index';
|
|
4
4
|
import { CardAction } from '../../actions';
|
|
5
|
+
import { CardPreview } from '../..';
|
|
5
6
|
export interface FileCardImageViewProps {
|
|
6
7
|
readonly mediaName?: string;
|
|
7
8
|
readonly mediaType?: MediaType;
|
|
@@ -21,8 +22,9 @@ export interface FileCardImageViewProps {
|
|
|
21
22
|
readonly actions?: CardAction[];
|
|
22
23
|
readonly onDisplayImage?: () => void;
|
|
23
24
|
readonly previewOrientation?: number;
|
|
24
|
-
readonly onImageError?: () => void;
|
|
25
|
-
readonly onImageLoad?: () => void;
|
|
25
|
+
readonly onImageError?: (cardPreview: CardPreview) => void;
|
|
26
|
+
readonly onImageLoad?: (cardPreview: CardPreview) => void;
|
|
27
|
+
readonly cardPreview: CardPreview;
|
|
26
28
|
}
|
|
27
29
|
export declare const fileCardImageViewSelector = "media-file-card-view";
|
|
28
30
|
export declare const fileCardImageViewSelectedSelector = "media-file-card-view-selected";
|
|
@@ -36,6 +38,8 @@ export declare class FileCardImageView extends Component<FileCardImageViewProps>
|
|
|
36
38
|
private renderFailedContents;
|
|
37
39
|
private renderUploadingCardOverlay;
|
|
38
40
|
private renderPlayButton;
|
|
41
|
+
onImageLoad: () => void;
|
|
42
|
+
onImageError: () => void;
|
|
39
43
|
private renderMediaImage;
|
|
40
44
|
private renderProgressBar;
|
|
41
45
|
private renderSuccessCardContents;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export interface CardProps extends SharedCardProps, CardEventProps {
|
|
|
53
53
|
export interface CardState {
|
|
54
54
|
status: CardStatus;
|
|
55
55
|
isCardVisible: boolean;
|
|
56
|
+
shouldAutoplay?: boolean;
|
|
56
57
|
isPlayingFile: boolean;
|
|
57
58
|
mediaViewerSelectedItem?: Identifier;
|
|
58
59
|
fileState?: FileState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import type {
|
|
4
|
-
export declare type CardWithMediaClientConfigProps = WithMediaClientConfigProps<
|
|
3
|
+
import type { CardBaseProps } from '.';
|
|
4
|
+
export declare type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
5
5
|
declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
|
|
6
6
|
export default CardLoader;
|
|
@@ -47,4 +47,5 @@ export declare const isLocalPreview: (preview: CardPreview) => boolean;
|
|
|
47
47
|
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
48
48
|
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
49
49
|
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
50
|
+
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
50
51
|
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs | undefined) => Promise<CardPreview>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/// <reference types="react-intl" />
|
|
2
1
|
import React, { Component } from 'react';
|
|
3
2
|
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
3
|
import { FileIdentifier } from '@atlaskit/media-client';
|
|
5
4
|
import { Subscription } from 'rxjs/Subscription';
|
|
5
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
6
6
|
import { CardAction, CardProps, CardState } from '../..';
|
|
7
|
-
export declare type
|
|
8
|
-
export declare class CardBase extends Component<
|
|
7
|
+
export declare type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
|
|
8
|
+
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
9
9
|
private hasBeenMounted;
|
|
10
|
+
private viewportPreAnchorRef;
|
|
11
|
+
private viewportPostAnchorRef;
|
|
10
12
|
private timeElapsedTillCommenced;
|
|
11
13
|
subscription?: Subscription;
|
|
14
|
+
private ssrData?;
|
|
12
15
|
static defaultProps: Partial<CardProps>;
|
|
13
|
-
|
|
14
|
-
intl: ReactIntl.IntlShape;
|
|
15
|
-
};
|
|
16
|
-
constructor(props: CardWithAnalyticsEventsProps);
|
|
16
|
+
constructor(props: CardBaseProps);
|
|
17
17
|
componentDidMount(): void;
|
|
18
18
|
componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
|
|
19
19
|
componentWillUnmount(): void;
|
|
@@ -22,7 +22,7 @@ export declare class CardBase extends Component<CardWithAnalyticsEventsProps, Ca
|
|
|
22
22
|
private getMediaBlobUrlAttrs;
|
|
23
23
|
private getCardPreviewParams;
|
|
24
24
|
private setCacheSSRPreview;
|
|
25
|
-
private
|
|
25
|
+
private refetchSSRPreview;
|
|
26
26
|
private resolvePreview;
|
|
27
27
|
subscribeInternalFile(identifier: FileIdentifier): void;
|
|
28
28
|
private get requestedDimensions();
|
|
@@ -47,9 +47,10 @@ export declare class CardBase extends Component<CardWithAnalyticsEventsProps, Ca
|
|
|
47
47
|
private onDisplayImage;
|
|
48
48
|
renderMediaViewer: () => React.ReactPortal | undefined;
|
|
49
49
|
renderCard: () => JSX.Element;
|
|
50
|
+
private storeSSRData;
|
|
50
51
|
render(): JSX.Element;
|
|
51
52
|
private onCardInViewport;
|
|
52
53
|
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
|
53
54
|
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
54
55
|
}
|
|
55
|
-
export declare const Card: React.ComponentType<
|
|
56
|
+
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import React, { MouseEvent } from 'react';
|
|
2
|
-
import { FormattedMessage } from 'react-intl';
|
|
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';
|
|
6
5
|
import { MediaCardError } from '../errors';
|
|
6
|
+
import { CardPreview } from '..';
|
|
7
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
8
|
+
import { MediaCardCursor } from '../types';
|
|
7
9
|
export interface CardViewOwnProps extends SharedCardProps {
|
|
8
10
|
readonly status: CardStatus;
|
|
9
11
|
readonly mediaItemType: MediaItemType;
|
|
12
|
+
readonly mediaCardCursor: MediaCardCursor;
|
|
10
13
|
readonly metadata?: FileDetails;
|
|
11
14
|
readonly error?: MediaCardError;
|
|
12
15
|
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
13
16
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
14
17
|
readonly onDisplayImage?: () => void;
|
|
15
|
-
readonly
|
|
18
|
+
readonly cardPreview?: CardPreview;
|
|
16
19
|
readonly progress?: number;
|
|
17
|
-
readonly previewOrientation?: number;
|
|
18
20
|
readonly innerRef?: (instance: HTMLDivElement | null) => void;
|
|
19
|
-
readonly onImageLoad: () => void;
|
|
20
|
-
readonly onImageError: () => void;
|
|
21
|
+
readonly onImageLoad: (cardPreview: CardPreview) => void;
|
|
22
|
+
readonly onImageError: (cardPreview: CardPreview) => void;
|
|
21
23
|
readonly nativeLazyLoad?: boolean;
|
|
22
24
|
readonly forceSyncDisplay?: boolean;
|
|
23
25
|
disableAnimation?: boolean;
|
|
@@ -39,7 +41,7 @@ export interface RenderConfigByStatus {
|
|
|
39
41
|
renderSpinner?: boolean;
|
|
40
42
|
renderFailedTitleBox?: boolean;
|
|
41
43
|
renderTickBox?: boolean;
|
|
42
|
-
customTitleMessage?:
|
|
44
|
+
customTitleMessage?: MessageDescriptor;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
@@ -50,7 +52,7 @@ export declare class CardViewBase extends React.Component<CardViewProps, CardVie
|
|
|
50
52
|
divRef: React.RefObject<HTMLDivElement>;
|
|
51
53
|
static defaultProps: Partial<CardViewOwnProps>;
|
|
52
54
|
componentDidMount(): void;
|
|
53
|
-
componentDidUpdate({
|
|
55
|
+
componentDidUpdate({ cardPreview: prevCardPreview }: CardViewProps): void;
|
|
54
56
|
private onImageLoad;
|
|
55
57
|
private onImageError;
|
|
56
58
|
private get width();
|
|
@@ -73,4 +75,4 @@ export declare class CardViewBase extends React.Component<CardViewProps, CardVie
|
|
|
73
75
|
private getRenderConfigByStatus;
|
|
74
76
|
private renderNewExperienceCard;
|
|
75
77
|
}
|
|
76
|
-
export declare const CardView: React.ForwardRefExoticComponent<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "
|
|
78
|
+
export declare const CardView: React.ForwardRefExoticComponent<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "testId" | "appearance" | "error" | "actions" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "onImageError" | "onImageLoad" | "cardPreview" | "forceSyncDisplay" | "mediaCardCursor" | "nativeLazyLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">, never> & Partial<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "testId" | "appearance" | "error" | "actions" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "onImageError" | "onImageLoad" | "cardPreview" | "forceSyncDisplay" | "mediaCardCursor" | "nativeLazyLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "testId" | "appearance" | "error" | "actions" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "onImageError" | "onImageLoad" | "cardPreview" | "forceSyncDisplay" | "mediaCardCursor" | "nativeLazyLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">> & Partial<Pick<Partial<CardViewOwnProps>, never>> & React.RefAttributes<any>>;
|
|
@@ -16,8 +16,10 @@ export default class MediaInlineCardLoader extends React.PureComponent<MediaInli
|
|
|
16
16
|
static displayName: string;
|
|
17
17
|
static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
18
18
|
static ErrorBoundary?: ErrorBoundaryComponent;
|
|
19
|
+
isMounted: boolean;
|
|
19
20
|
state: MediaInlineCardLoaderState;
|
|
20
21
|
componentDidMount(): Promise<void>;
|
|
22
|
+
componentWillUnmount(): Promise<void>;
|
|
21
23
|
render(): JSX.Element;
|
|
22
24
|
}
|
|
23
25
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
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
5
|
export interface MediaInlineCardProps {
|
|
6
6
|
identifier: FileIdentifier;
|
|
@@ -10,7 +10,5 @@ export interface MediaInlineCardProps {
|
|
|
10
10
|
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
11
11
|
mediaViewerDataSource?: MediaViewerDataSource;
|
|
12
12
|
}
|
|
13
|
-
export declare const MediaInlineCardInternal: FC<MediaInlineCardProps &
|
|
14
|
-
export declare const MediaInlineCard: React.
|
|
15
|
-
WrappedComponent: ReactIntl.ComponentConstructor<MediaInlineCardProps & InjectedIntlProps>;
|
|
16
|
-
};
|
|
13
|
+
export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
|
|
14
|
+
export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
|
|
@@ -4,26 +4,33 @@ import { MediaClient, FileIdentifier, FileState, MediaFileArtifacts } from '@atl
|
|
|
4
4
|
import { Subscription } from 'rxjs/Subscription';
|
|
5
5
|
import { CardDimensions, NumericalCardDimensions } from '..';
|
|
6
6
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
+
import type { CardPreview } from '..';
|
|
7
8
|
export declare const inlinePlayerClassName = "media-card-inline-player";
|
|
8
9
|
export interface InlinePlayerOwnProps {
|
|
9
10
|
identifier: FileIdentifier;
|
|
10
11
|
mediaClient: MediaClient;
|
|
11
12
|
dimensions?: CardDimensions;
|
|
12
13
|
originalDimensions?: NumericalCardDimensions;
|
|
14
|
+
autoplay: boolean;
|
|
13
15
|
selected?: boolean;
|
|
14
16
|
onError?: (error: Error) => void;
|
|
15
17
|
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
16
18
|
testId?: string;
|
|
19
|
+
readonly cardPreview?: CardPreview;
|
|
17
20
|
readonly forwardRef?: React.Ref<HTMLDivElement>;
|
|
18
21
|
}
|
|
19
22
|
export declare type InlinePlayerProps = InlinePlayerOwnProps & WithAnalyticsEventsProps;
|
|
20
23
|
export interface InlinePlayerState {
|
|
21
24
|
fileSrc?: string;
|
|
25
|
+
isUploading?: boolean;
|
|
26
|
+
progress?: number;
|
|
27
|
+
elementWidth?: number;
|
|
22
28
|
}
|
|
23
29
|
export declare const getPreferredVideoArtifact: (fileState: FileState) => keyof MediaFileArtifacts | undefined;
|
|
24
30
|
export declare class InlinePlayerBase extends Component<InlinePlayerProps, InlinePlayerState> {
|
|
25
31
|
subscription?: Subscription;
|
|
26
32
|
state: InlinePlayerState;
|
|
33
|
+
divRef: React.RefObject<HTMLDivElement>;
|
|
27
34
|
static defaultProps: {
|
|
28
35
|
dimensions: {
|
|
29
36
|
width: number;
|
|
@@ -38,6 +45,8 @@ export declare class InlinePlayerBase extends Component<InlinePlayerProps, Inlin
|
|
|
38
45
|
componentWillUnmount(): void;
|
|
39
46
|
onDownloadClick: () => void;
|
|
40
47
|
onFirstPlay: () => void;
|
|
48
|
+
private get breakpoint();
|
|
49
|
+
saveElementWidth: () => void;
|
|
41
50
|
render(): JSX.Element;
|
|
42
51
|
}
|
|
43
|
-
export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<InlinePlayerProps, "onError" | "onClick" | "
|
|
52
|
+
export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<InlinePlayerProps, "onError" | "onClick" | "testId" | "createAnalyticsEvent" | "selected" | "dimensions" | "cardPreview" | "originalDimensions" | "mediaClient" | "identifier" | "autoplay" | "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
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
3
|
+
import { CardPreview } from '../../..';
|
|
3
4
|
export declare type ImageRendererProps = {
|
|
4
|
-
readonly
|
|
5
|
+
readonly cardPreview: CardPreview;
|
|
5
6
|
readonly mediaType: MediaType;
|
|
6
|
-
readonly previewOrientation?: number;
|
|
7
7
|
readonly alt?: string;
|
|
8
8
|
readonly resizeMode?: ImageResizeMode;
|
|
9
9
|
readonly onDisplayImage?: () => void;
|
|
10
|
-
readonly onImageError?: () => void;
|
|
11
|
-
readonly onImageLoad?: () => void;
|
|
10
|
+
readonly onImageError?: (cardPreview: CardPreview) => void;
|
|
11
|
+
readonly onImageLoad?: (cardPreview: CardPreview) => void;
|
|
12
12
|
readonly nativeLazyLoad?: boolean;
|
|
13
13
|
readonly forceSyncDisplay?: boolean;
|
|
14
14
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Breakpoint } from '../common';
|
|
2
3
|
export declare type ProgressBarProps = {
|
|
3
4
|
progress?: number;
|
|
4
5
|
breakpoint?: Breakpoint;
|
|
5
6
|
positionBottom?: boolean;
|
|
7
|
+
showOnTop?: boolean;
|
|
6
8
|
};
|
|
7
|
-
export declare const ProgressBar: ({ progress, breakpoint, positionBottom, }: ProgressBarProps) => JSX.Element;
|
|
9
|
+
export declare const ProgressBar: ({ progress, breakpoint, positionBottom, showOnTop, }: ProgressBarProps) => JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Breakpoint } from '../common';
|
|
3
|
-
export declare function generateResponsiveStyles(breakpoint: Breakpoint, positionBottom: boolean, multiplier?: number): string;
|
|
3
|
+
export declare function generateResponsiveStyles(breakpoint: Breakpoint, positionBottom: boolean, showOnTop: boolean, multiplier?: number): string;
|
|
4
4
|
export declare type StyledBarProps = {
|
|
5
5
|
progress: number;
|
|
6
6
|
breakpoint: Breakpoint;
|
|
7
7
|
positionBottom: boolean;
|
|
8
|
+
showOnTop: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare const StyledBar: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyledBarProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyledBarProps>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardDimensions, CardAppearance } from '../..';
|
|
3
3
|
import { Breakpoint } from './common';
|
|
4
|
+
import { MediaCardCursor } from '../../types';
|
|
4
5
|
export declare const calcBreakpointSize: (wrapperWidth?: number) => Breakpoint;
|
|
5
6
|
export interface NewFileExperienceWrapperProps {
|
|
6
7
|
breakpoint: Breakpoint;
|
|
7
8
|
dimensions?: CardDimensions;
|
|
8
9
|
appearance?: CardAppearance;
|
|
9
10
|
mediaType?: string;
|
|
10
|
-
shouldUsePointerCursor: boolean;
|
|
11
11
|
disableOverlay: boolean;
|
|
12
12
|
displayBackground: boolean;
|
|
13
13
|
selected: boolean;
|
|
14
14
|
isPlayButtonClickable: boolean;
|
|
15
15
|
isTickBoxSelectable: boolean;
|
|
16
16
|
shouldDisplayTooltip: boolean;
|
|
17
|
+
mediaCardCursor: MediaCardCursor;
|
|
17
18
|
}
|
|
18
19
|
export declare const NewFileExperienceWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & NewFileExperienceWrapperProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & NewFileExperienceWrapperProps>;
|
|
19
20
|
export declare const CardImageContainer: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Breakpoint } from '../common';
|
|
3
|
-
import {
|
|
3
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
4
4
|
export declare type OnRetryFunction = () => void;
|
|
5
5
|
export declare type FailedTitleBoxProps = {
|
|
6
6
|
breakpoint: Breakpoint;
|
|
7
|
-
customMessage?:
|
|
7
|
+
customMessage?: MessageDescriptor;
|
|
8
8
|
};
|
|
9
9
|
export declare const FailedTitleBox: React.FC<FailedTitleBoxProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react-intl" />
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { TitleBoxIcon as TitleBoxIconType } from '../../../index';
|
|
4
3
|
import { Breakpoint } from '../common';
|
|
@@ -12,13 +11,6 @@ export declare type TitleBoxProps = {
|
|
|
12
11
|
declare type FormattedDateProps = {
|
|
13
12
|
timestamp: number;
|
|
14
13
|
};
|
|
15
|
-
declare
|
|
16
|
-
intl?: {
|
|
17
|
-
locale?: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const FormattedDate: React.ComponentClass<FormattedDateProps & WithIntlProps, any> & {
|
|
21
|
-
WrappedComponent: ReactIntl.ComponentConstructor<FormattedDateProps & WithIntlProps & ReactIntl.InjectedIntlProps>;
|
|
22
|
-
};
|
|
14
|
+
export declare const FormattedDate: React.ComponentType<FormattedDateProps>;
|
|
23
15
|
export declare const TitleBox: ({ name, createdAt, breakpoint, titleBoxBgColor, titleBoxIcon, }: TitleBoxProps) => JSX.Element;
|
|
24
16
|
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -7,9 +7,14 @@ export declare type FilePreviewStatus = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
|
|
9
9
|
export declare type CardDimensionValue = number | string;
|
|
10
|
-
export declare type CardPreviewSource = 'local' | 'remote' | 'ssr-server' | 'ssr-client' | 'cache-local' | 'cache-remote' | 'cache-ssr-client' | 'cache-ssr-server' | 'external';
|
|
10
|
+
export declare type CardPreviewSource = 'local' | 'remote' | 'ssr-server' | 'ssr-client' | 'ssr-data' | 'cache-local' | 'cache-remote' | 'cache-ssr-client' | 'cache-ssr-server' | 'external';
|
|
11
11
|
export interface CardPreview {
|
|
12
12
|
dataURI: string;
|
|
13
13
|
orientation?: number;
|
|
14
14
|
source: CardPreviewSource;
|
|
15
15
|
}
|
|
16
|
+
export declare enum MediaCardCursor {
|
|
17
|
+
Action = "pointer",
|
|
18
|
+
NoAction = "default",
|
|
19
|
+
NotReady = "wait"
|
|
20
|
+
}
|
|
@@ -4,6 +4,11 @@ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
4
4
|
import { MediaCardError, MediaCardErrorPrimaryReason } from '../errors';
|
|
5
5
|
export declare type FileUriFailReason = 'local-uri' | 'remote-uri' | `unknown-uri`;
|
|
6
6
|
export declare type FailedErrorFailReason = MediaCardErrorPrimaryReason | 'nativeError';
|
|
7
|
+
export declare type MediaCardErrorInfo = {
|
|
8
|
+
failReason: FailedErrorFailReason;
|
|
9
|
+
error: MediaClientErrorReason | 'nativeError';
|
|
10
|
+
errorDetail: string;
|
|
11
|
+
};
|
|
7
12
|
export declare type RenderFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & FailureAttributes & {
|
|
8
13
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
9
14
|
error?: MediaClientErrorReason | 'nativeError';
|
|
@@ -31,6 +36,7 @@ export declare const getRenderErrorFailReason: (error: MediaCardError) => Failed
|
|
|
31
36
|
export declare const getRenderErrorErrorReason: (error: MediaCardError) => MediaClientErrorReason | 'nativeError';
|
|
32
37
|
export declare const getRenderErrorErrorDetail: (error: MediaCardError) => string;
|
|
33
38
|
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) => RequestMetadata | undefined;
|
|
39
|
+
export declare const extractErrorInfo: (error: MediaCardError) => MediaCardErrorInfo;
|
|
34
40
|
export declare const getRenderErrorEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error: MediaCardError) => RenderFailedEventPayload;
|
|
35
41
|
export declare const getRenderFailedFileStatusPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => RenderFailedEventPayload;
|
|
36
42
|
export declare const getCopiedFilePayload: (fileId: string) => CopiedFileEventPayload;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { MediaCardCursor } from '../types';
|
|
2
|
+
export declare const getMediaCardCursor: (useInlinePlayer: boolean, useMediaViewer: boolean, isErrorStatus: boolean, hasCardPreview: boolean, mediaType?: "audio" | "video" | "image" | "doc" | "archive" | "unknown" | undefined) => MediaCardCursor;
|
|
@@ -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 declare 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 | undefined, dimensions?: NumericalCardDimensions | undefined, error?: MediaCardErrorInfo | undefined, globalScope?: any) => void;
|
|
15
|
+
export declare 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 declare type MediaCardSsrData = {
|
|
4
|
+
dataURI?: string;
|
|
5
|
+
dimensions?: NumericalCardDimensions;
|
|
6
|
+
error?: MediaCardErrorInfo;
|
|
7
|
+
};
|
|
8
|
+
export declare type MediaCardSsr = Record<string, MediaCardSsrData>;
|