@atlaskit/media-card 74.8.0 → 74.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/classnames/package.json +2 -2
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- 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/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/types.d.ts +6 -6
- 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/package.json +12 -4
- package/types/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/classnames/package.json
CHANGED
package/dist/cjs/card/card.js
CHANGED
|
@@ -48,7 +48,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
48
48
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
49
49
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
50
50
|
var packageName = "@atlaskit/media-card";
|
|
51
|
-
var packageVersion = "74.8.
|
|
51
|
+
var packageVersion = "74.8.1";
|
|
52
52
|
var CardBase = /*#__PURE__*/function (_Component) {
|
|
53
53
|
(0, _inherits2.default)(CardBase, _Component);
|
|
54
54
|
var _super = _createSuper(CardBase);
|
|
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
90
90
|
}(_react.default.Component);
|
|
91
91
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
92
92
|
var packageName = "@atlaskit/media-card";
|
|
93
|
-
var packageVersion = "74.8.
|
|
93
|
+
var packageVersion = "74.8.1";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -127,7 +127,7 @@ var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Com
|
|
|
127
127
|
}(_react.default.Component);
|
|
128
128
|
(0, _defineProperty2.default)(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
|
|
129
129
|
var packageName = "@atlaskit/media-card";
|
|
130
|
-
var packageVersion = "74.8.
|
|
130
|
+
var packageVersion = "74.8.1";
|
|
131
131
|
var MediaInlineAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
132
132
|
packageVersion: packageVersion,
|
|
133
133
|
packageName: packageName,
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "74.8.
|
|
17
|
+
var packageVersion = "74.8.1";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/card/card.js
CHANGED
|
@@ -27,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
27
27
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "74.8.
|
|
30
|
+
const packageVersion = "74.8.1";
|
|
31
31
|
export class CardBase extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "74.8.
|
|
69
|
+
const packageVersion = "74.8.1";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -107,7 +107,7 @@ class WrappedMediaInlineAnalyticsErrorBoundary extends React.Component {
|
|
|
107
107
|
}
|
|
108
108
|
_defineProperty(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
|
|
109
109
|
const packageName = "@atlaskit/media-card";
|
|
110
|
-
const packageVersion = "74.8.
|
|
110
|
+
const packageVersion = "74.8.1";
|
|
111
111
|
const MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
112
112
|
packageVersion,
|
|
113
113
|
packageName,
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "74.8.
|
|
7
|
+
const packageVersion = "74.8.1";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/card/card.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
40
40
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "74.8.
|
|
43
|
+
var packageVersion = "74.8.1";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "74.8.
|
|
86
|
+
var packageVersion = "74.8.1";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -120,7 +120,7 @@ var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Com
|
|
|
120
120
|
}(React.Component);
|
|
121
121
|
_defineProperty(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
|
|
122
122
|
var packageName = "@atlaskit/media-card";
|
|
123
|
-
var packageVersion = "74.8.
|
|
123
|
+
var packageVersion = "74.8.1";
|
|
124
124
|
var MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
125
125
|
packageVersion: packageVersion,
|
|
126
126
|
packageName: packageName,
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "74.8.
|
|
10
|
+
var packageVersion = "74.8.1";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
package/dist/esm/version.json
CHANGED
|
@@ -5,5 +5,5 @@ export interface CardAction {
|
|
|
5
5
|
handler: CardEventHandler;
|
|
6
6
|
icon?: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type CardEventHandler = (item?: FileItem, event?: Event) => void;
|
|
9
9
|
export declare function attachDetailsToActions(actions: Array<CardAction>, details: FileDetails): Array<CardAction>;
|
|
@@ -4,7 +4,7 @@ import { FileIdentifier, FileState, MediaSubscription } from '@atlaskit/media-cl
|
|
|
4
4
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import { CardAction } from './actions';
|
|
6
6
|
import { CardProps, CardState, CardStatus } from '../types';
|
|
7
|
-
export
|
|
7
|
+
export type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
|
|
8
8
|
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
9
9
|
private internalOccurrenceKey;
|
|
10
10
|
private hasBeenMounted;
|
|
@@ -46,18 +46,18 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
|
46
46
|
private safeSetState;
|
|
47
47
|
unsubscribe: () => void;
|
|
48
48
|
get actions(): CardAction[];
|
|
49
|
-
onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent
|
|
49
|
+
onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
50
50
|
onInlinePlayerError: () => void;
|
|
51
51
|
setRef: (cardRef: HTMLDivElement | null) => void;
|
|
52
52
|
renderInlinePlayer: () => JSX.Element;
|
|
53
53
|
onMediaViewerClose: () => void;
|
|
54
54
|
private onDisplayImage;
|
|
55
55
|
renderMediaViewer: () => React.ReactPortal | undefined;
|
|
56
|
-
renderCard: (withCallbacks?: boolean, cardStatusOverride?: CardStatus
|
|
56
|
+
renderCard: (withCallbacks?: boolean, cardStatusOverride?: CardStatus, izLazyOverride?: boolean) => JSX.Element;
|
|
57
57
|
private storeSSRData;
|
|
58
58
|
render(): JSX.Element;
|
|
59
59
|
private onCardInViewport;
|
|
60
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent
|
|
60
|
+
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
61
61
|
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
62
62
|
}
|
|
63
63
|
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -3,8 +3,8 @@ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import { SSRStatus } from '../utils/analytics';
|
|
4
4
|
import { CardStatus } from '../types';
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
|
-
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext
|
|
6
|
+
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
7
7
|
export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, traceContext: MediaTraceContext) => void;
|
|
8
8
|
export declare const fireCopiedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileId: string, cardRef: HTMLDivElement) => void;
|
|
9
9
|
export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
|
|
10
|
-
export declare const fireNonCriticalErrorEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, cardStatus: CardStatus, fileAttributes: FileAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext
|
|
10
|
+
export declare const fireNonCriticalErrorEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, cardStatus: CardStatus, fileAttributes: FileAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
3
|
import type { CardBaseProps } from './card';
|
|
4
|
-
export
|
|
4
|
+
export type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
5
5
|
declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
|
|
6
6
|
export default CardLoader;
|
|
@@ -7,4 +7,4 @@ import { MediaCardError } from '../errors';
|
|
|
7
7
|
* The output of the updater is shallowly merged with state."
|
|
8
8
|
*/
|
|
9
9
|
export declare const createStateUpdater: (newState: Partial<CardState>, fireErrorEvent: (error: MediaCardError) => void) => (prevState: CardState) => Partial<CardState>;
|
|
10
|
-
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags
|
|
10
|
+
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags) => Partial<CardState>;
|
|
@@ -30,7 +30,7 @@ export interface CardViewState {
|
|
|
30
30
|
elementWidth?: number;
|
|
31
31
|
didImageRender: boolean;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type CardViewProps = CardViewOwnProps & WithAnalyticsEventsProps;
|
|
34
34
|
export interface RenderConfigByStatus {
|
|
35
35
|
renderTypeIcon?: boolean;
|
|
36
36
|
iconMessage?: JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
2
2
|
import { ObjectURLCache } from '../../utils/objectURLCache';
|
|
3
3
|
import { CardPreview } from '../../types';
|
|
4
|
-
|
|
4
|
+
type Mode = ImageResizeMode | undefined;
|
|
5
5
|
export declare const getCacheKey: (id: string, mode: Mode) => string;
|
|
6
6
|
export interface CardPreviewCache {
|
|
7
7
|
get(id: string, mode: Mode): CardPreview | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
2
2
|
import { CardStatus, FilePreviewStatus } from '../../types';
|
|
3
3
|
import { FileState } from '@atlaskit/media-client';
|
|
4
|
-
export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags
|
|
4
|
+
export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags) => FilePreviewStatus;
|
|
5
5
|
export declare const isPreviewableStatus: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
|
|
@@ -5,6 +5,6 @@ import { CardPreview } from '../../types';
|
|
|
5
5
|
* This method tells the support for the media
|
|
6
6
|
* types covered in getCardPreviewFromFilePreview
|
|
7
7
|
*/
|
|
8
|
-
export declare const isSupportedLocalPreview: (mediaType?: MediaType
|
|
8
|
+
export declare const isSupportedLocalPreview: (mediaType?: MediaType) => boolean;
|
|
9
9
|
export declare const getCardPreviewFromFilePreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<CardPreview>;
|
|
10
|
-
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext
|
|
10
|
+
export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext) => Promise<CardPreview>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import { CardDimensions } from '../../types';
|
|
3
3
|
import { CardPreviewAttributes } from '../../utils/analytics';
|
|
4
|
-
|
|
4
|
+
type cardAction = 'cache-hit' | 'remote-success';
|
|
5
5
|
export declare const fireImageFetchingOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, action: cardAction, cardPreviewAttributes: CardPreviewAttributes) => void;
|
|
6
6
|
export declare const calculatePercentageDifference: (prevDimensions: CardDimensions | undefined, currentDimensions: CardDimensions | undefined) => {
|
|
7
7
|
width: string;
|
|
@@ -14,7 +14,7 @@ export declare const removeCardPreviewFromCache: (id: string, mode: ImageResizeM
|
|
|
14
14
|
* See extractFilePreviewStatus "hasLocalPreview" logic
|
|
15
15
|
*/
|
|
16
16
|
export declare const getFilePreviewFromFileState: (fileState: FileState) => FilePreview | Promise<FilePreview> | undefined;
|
|
17
|
-
export
|
|
17
|
+
export type CardPreviewParams = {
|
|
18
18
|
mediaClient: MediaClient;
|
|
19
19
|
id: string;
|
|
20
20
|
dimensions?: CardDimensions;
|
|
@@ -50,10 +50,10 @@ export declare const shouldResolvePreview: ({ status, fileState, prevDimensions,
|
|
|
50
50
|
featureFlags?: MediaFeatureFlags | undefined;
|
|
51
51
|
wasResolvedUpfrontPreview: boolean;
|
|
52
52
|
}) => boolean;
|
|
53
|
-
export declare const getSSRCardPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs
|
|
53
|
+
export declare const getSSRCardPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => CardPreview;
|
|
54
54
|
export declare const isLocalPreview: (preview: CardPreview) => boolean;
|
|
55
55
|
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
56
56
|
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
57
57
|
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
58
58
|
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
59
|
-
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs
|
|
59
|
+
export declare const fetchAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: CardDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs, traceContext?: MediaTraceContext) => Promise<CardPreview>;
|
|
@@ -2,4 +2,4 @@ import { FileStatus } from '@atlaskit/media-client';
|
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { CardStatus, FilePreviewStatus } from '../types';
|
|
4
4
|
export declare const isFinalCardStatus: (status: CardStatus) => boolean;
|
|
5
|
-
export declare const getCardStatus: (fileStatus: FileStatus, filePreviewStatus: FilePreviewStatus, featureFlags?: MediaFeatureFlags
|
|
5
|
+
export declare const getCardStatus: (fileStatus: FileStatus, filePreviewStatus: FilePreviewStatus, featureFlags?: MediaFeatureFlags) => CardStatus;
|
|
@@ -19,7 +19,7 @@ export interface InlinePlayerOwnProps {
|
|
|
19
19
|
readonly cardPreview?: CardPreview;
|
|
20
20
|
readonly forwardRef?: React.Ref<HTMLDivElement>;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type InlinePlayerProps = InlinePlayerOwnProps & WithAnalyticsEventsProps;
|
|
23
23
|
export interface InlinePlayerState {
|
|
24
24
|
fileSrc?: string;
|
|
25
25
|
isUploading?: boolean;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { CardDimensions, CardOnClickCallback } from '../types';
|
|
4
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
export
|
|
5
|
+
export type MediaCardAnalyticsErrorBoundaryProps = {
|
|
6
6
|
dimensions?: CardDimensions;
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
@@ -12,7 +12,7 @@ export interface WrapperProps {
|
|
|
12
12
|
innerRef?: RefObject<HTMLDivElement>;
|
|
13
13
|
children?: JSX.Element;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type InlinePlayerWrapperProps = {
|
|
16
16
|
testId?: string;
|
|
17
17
|
dimensions?: CardDimensions;
|
|
18
18
|
selected: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const actionsBarClassName = "media-card-actions-bar";
|
|
2
2
|
export declare const fixedActionBarStyles = "opacity: 1;";
|
|
3
3
|
export declare const wrapperStyles: {
|
|
4
|
-
(isFixed?: boolean
|
|
4
|
+
(isFixed?: boolean): import("@emotion/react").SerializedStyles;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const blanketClassName = "media-card-blanket";
|
|
2
2
|
export declare const fixedBlanketStyles: string;
|
|
3
3
|
export declare const blanketStyles: {
|
|
4
|
-
(isFixed?: boolean
|
|
4
|
+
(isFixed?: boolean): import("@emotion/react").SerializedStyles;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MessageDescriptor } from 'react-intl-next';
|
|
3
|
-
export
|
|
3
|
+
export type InternalIconMessageProps = {
|
|
4
4
|
messageDescriptor: MessageDescriptor;
|
|
5
5
|
animated?: boolean;
|
|
6
6
|
reducedFont?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type CreatingPreviewProps = {
|
|
9
9
|
disableAnimation?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type StyledTextProps = {
|
|
12
12
|
animated?: boolean;
|
|
13
13
|
reducedFont?: boolean;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type IconMessageWrapperProps = {
|
|
16
16
|
animated?: boolean;
|
|
17
17
|
reducedFont?: boolean;
|
|
18
18
|
children?: ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MediaType, ImageResizeMode } from '@atlaskit/media-client';
|
|
3
3
|
import { CardPreview } from '../../../types';
|
|
4
|
-
export
|
|
4
|
+
export type ImageRendererProps = {
|
|
5
5
|
readonly cardPreview: CardPreview;
|
|
6
6
|
readonly mediaType: MediaType;
|
|
7
7
|
readonly alt?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Breakpoint } from '../common';
|
|
2
2
|
export declare const loadingRateLimitedContainerStyles: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const warningIconWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
-
export
|
|
4
|
+
export type StyledTextProps = {
|
|
5
5
|
breakpoint: Breakpoint;
|
|
6
6
|
positionBottom: boolean;
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Breakpoint } from '../common';
|
|
3
|
-
export
|
|
3
|
+
export type ProgressBarProps = {
|
|
4
4
|
progress?: number;
|
|
5
5
|
breakpoint?: Breakpoint;
|
|
6
6
|
positionBottom?: boolean;
|
|
7
7
|
showOnTop?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare const getNormalizedProgress: (progress?: number
|
|
9
|
+
export declare const getNormalizedProgress: (progress?: number) => number;
|
|
10
10
|
export declare const ProgressBar: ({ progress, breakpoint, positionBottom, showOnTop, }: ProgressBarProps) => JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Breakpoint } from './common';
|
|
|
3
3
|
import { MediaCardCursor } from '../../types';
|
|
4
4
|
export declare const calcBreakpointSize: (wrapperWidth?: number) => Breakpoint;
|
|
5
5
|
export declare const generateResponsiveStyles: (breakpoint?: Breakpoint) => string;
|
|
6
|
-
export declare const getWrapperDimensions: (dimensions?: CardDimensions
|
|
6
|
+
export declare const getWrapperDimensions: (dimensions?: CardDimensions, appearance?: CardAppearance) => string;
|
|
7
7
|
export declare const getWrapperShadow: (disableOverlay: boolean, selected: boolean) => string;
|
|
8
8
|
export declare const getCursorStyle: (cursor: MediaCardCursor | undefined) => string;
|
|
9
9
|
export declare const getClickablePlayButtonStyles: (isPlayButtonClickable: boolean) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const tickBoxClassName = "media-card-tickbox";
|
|
2
2
|
export declare const tickboxFixedStyles: string;
|
|
3
|
-
export declare const getSelectedStyles: (selected?: boolean
|
|
3
|
+
export declare const getSelectedStyles: (selected?: boolean) => string;
|
|
4
4
|
export declare const wrapperStyles: {
|
|
5
|
-
(selected?: boolean
|
|
5
|
+
(selected?: boolean): import("@emotion/react").SerializedStyles;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -3,32 +3,32 @@ import { MessageDescriptor } from 'react-intl-next';
|
|
|
3
3
|
import { Breakpoint } from '../common';
|
|
4
4
|
import { TitleBoxIcon as TitleBoxIconType } from '../../../types';
|
|
5
5
|
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
6
|
-
export
|
|
6
|
+
export type TitleBoxProps = {
|
|
7
7
|
name: string;
|
|
8
8
|
breakpoint: Breakpoint;
|
|
9
9
|
createdAt?: number;
|
|
10
10
|
titleBoxBgColor?: string;
|
|
11
11
|
titleBoxIcon?: TitleBoxIconType;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type FormattedDateProps = {
|
|
14
14
|
timestamp: number;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type TitleBoxWrapperProps = {
|
|
17
17
|
breakpoint: Breakpoint;
|
|
18
18
|
titleBoxBgColor?: string;
|
|
19
19
|
children?: JSX.Element | JSX.Element[] | any;
|
|
20
20
|
theme?: GlobalThemeTokens;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type TitleBoxFooterProps = {
|
|
23
23
|
hasIconOverlap: boolean;
|
|
24
24
|
children?: JSX.Element;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type TitleBoxHeaderProps = {
|
|
27
27
|
hasIconOverlap: boolean;
|
|
28
28
|
children?: JSX.Element;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
31
|
-
export
|
|
30
|
+
export type OnRetryFunction = () => void;
|
|
31
|
+
export type FailedTitleBoxProps = {
|
|
32
32
|
breakpoint: Breakpoint;
|
|
33
33
|
customMessage?: MessageDescriptor;
|
|
34
34
|
};
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { CardPreview } from './types';
|
|
|
3
3
|
* Primary reason is logged through Data Portal.
|
|
4
4
|
* Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
6
|
+
export type MediaCardErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'error-file-state' | RemotePreviewPrimaryReason | LocalPreviewPrimaryReason | ImageLoadPrimaryReason | SsrPreviewPrimaryReason | 'missing-error-data' | 'preview-fetch';
|
|
7
|
+
export type ImageLoadPrimaryReason = 'cache-remote-uri' | 'cache-local-uri' | 'local-uri' | 'remote-uri' | 'external-uri' | 'unknown-uri';
|
|
8
|
+
export type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-not-ready' | 'remote-preview-fetch-ssr';
|
|
9
|
+
export type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-unsupported' | 'local-preview-rejected' | 'local-preview-image' | 'local-preview-video';
|
|
10
|
+
export type SsrPreviewPrimaryReason = 'ssr-client-uri' | 'ssr-client-load' | 'ssr-server-uri' | 'ssr-server-load';
|
|
11
11
|
export declare class MediaCardError extends Error {
|
|
12
12
|
readonly primaryReason: MediaCardErrorPrimaryReason;
|
|
13
13
|
readonly secondaryError?: Error | undefined;
|
|
@@ -28,7 +28,7 @@ export declare class SsrPreviewError extends MediaCardError {
|
|
|
28
28
|
readonly secondaryError?: Error | undefined;
|
|
29
29
|
constructor(primaryReason: SsrPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
30
30
|
}
|
|
31
|
-
export declare const getImageLoadPrimaryReason: (source?:
|
|
31
|
+
export declare const getImageLoadPrimaryReason: (source?: CardPreview['source']) => ImageLoadPrimaryReason;
|
|
32
32
|
export declare class ImageLoadError extends MediaCardError {
|
|
33
33
|
constructor(source?: CardPreview['source']);
|
|
34
34
|
}
|
|
@@ -37,5 +37,5 @@ export declare const isLocalPreviewError: (err: Error) => err is LocalPreviewErr
|
|
|
37
37
|
export declare const isRemotePreviewError: (err: Error) => err is LocalPreviewError;
|
|
38
38
|
export declare const isUnsupportedLocalPreviewError: (err: Error) => boolean;
|
|
39
39
|
export declare function isImageLoadError(err: Error): err is ImageLoadError;
|
|
40
|
-
export declare const ensureMediaCardError: (primaryReason: MediaCardErrorPrimaryReason, error: Error, updatePrimaryReason?: boolean
|
|
41
|
-
export declare const isUploadError: (error?: MediaCardError
|
|
40
|
+
export declare const ensureMediaCardError: (primaryReason: MediaCardErrorPrimaryReason, error: Error, updatePrimaryReason?: boolean) => MediaCardError;
|
|
41
|
+
export declare const isUploadError: (error?: MediaCardError) => boolean | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
3
|
import { MediaInlineCardProps } from './mediaInlineCard';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
|
|
5
|
+
type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
|
|
6
|
+
type ErrorBoundaryComponent = React.ComponentType<{
|
|
7
7
|
data?: {
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
-
export
|
|
4
|
+
export type MediaInlineAnalyticsErrorBoundaryProps = {
|
|
5
5
|
isSelected?: boolean;
|
|
6
6
|
data?: {
|
|
7
7
|
[k: string]: any;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,20 +9,20 @@ import { MediaFeatureFlags, NumericalCardDimensions, SSR } from '@atlaskit/media
|
|
|
9
9
|
import { CardAction } from './card/actions';
|
|
10
10
|
import { MediaViewerDataSource } from '@atlaskit/media-viewer';
|
|
11
11
|
import { MediaCardError } from './errors';
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
|
|
13
|
+
export type FilePreviewStatus = {
|
|
14
14
|
hasFilesize: boolean;
|
|
15
15
|
isPreviewable: boolean;
|
|
16
16
|
hasPreview: boolean;
|
|
17
17
|
isSupportedByBrowser: boolean;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type FileStateFlags = {
|
|
20
20
|
wasStatusProcessing: boolean;
|
|
21
21
|
wasStatusUploading: boolean;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
|
|
24
24
|
export declare type CardDimensionValue = number | string;
|
|
25
|
-
export
|
|
25
|
+
export type CardPreviewSource = 'local' | 'remote' | 'ssr-server' | 'ssr-client' | 'ssr-data' | 'cache-local' | 'cache-remote' | 'cache-ssr-client' | 'cache-ssr-server' | 'external';
|
|
26
26
|
export interface CardPreview {
|
|
27
27
|
dataURI: string;
|
|
28
28
|
orientation?: number;
|
|
@@ -37,7 +37,7 @@ export interface CardDimensions {
|
|
|
37
37
|
width?: CardDimensionValue;
|
|
38
38
|
height?: CardDimensionValue;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
40
|
+
export type TitleBoxIcon = 'LockFilledIcon';
|
|
41
41
|
export interface CardEvent {
|
|
42
42
|
event: MouseEvent<HTMLElement>;
|
|
43
43
|
mediaItemDetails?: FileDetails;
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { FileDetails, MediaClientErrorReason, RequestMetadata } from '@atlaskit/media-client';
|
|
1
|
+
import { FileDetails, FileStatus, MediaClientErrorReason, RequestMetadata } from '@atlaskit/media-client';
|
|
2
2
|
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
4
|
import { MediaCardError, MediaCardErrorPrimaryReason } from '../errors';
|
|
5
5
|
import { CardPreviewSource, CardDimensions, CardStatus } from '../types';
|
|
6
|
-
export
|
|
6
|
+
export type CardPreviewAttributes = {
|
|
7
7
|
fileId: string;
|
|
8
8
|
prevDimensions: CardDimensions | undefined;
|
|
9
9
|
currentDimensions: CardDimensions | undefined;
|
|
10
10
|
dimensionsPercentageDiff?: CardDimensions | undefined;
|
|
11
11
|
source: CardPreviewSource;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type WithCardPreviewCacheAttributes = {
|
|
14
14
|
cardPreviewAttributes: CardPreviewAttributes;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type FileUriFailReason = 'local-uri' | 'remote-uri' | `unknown-uri`;
|
|
17
|
+
export type FailedErrorFailReason = MediaCardErrorPrimaryReason | 'nativeError';
|
|
18
|
+
export type MediaCardErrorInfo = {
|
|
19
19
|
failReason: FailedErrorFailReason;
|
|
20
20
|
error: MediaClientErrorReason | 'nativeError';
|
|
21
21
|
errorDetail: string;
|
|
22
22
|
metadataTraceContext?: MediaTraceContext;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type SSRStatusFail = MediaCardErrorInfo & {
|
|
25
25
|
status: 'fail';
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
type SSRStatusSuccess = SuccessAttributes;
|
|
28
|
+
type SSRStatusUnknown = {
|
|
29
29
|
status: 'unknown';
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
export
|
|
31
|
+
type SSRStatusAttributes = SSRStatusSuccess | SSRStatusFail | SSRStatusUnknown;
|
|
32
|
+
export type SSRStatus = {
|
|
33
33
|
server: SSRStatusAttributes;
|
|
34
34
|
client: SSRStatusAttributes;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type WithSSRReliability = {
|
|
37
37
|
ssrReliability?: SSRStatus;
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type RenderFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
40
40
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
41
41
|
error?: MediaClientErrorReason | 'nativeError';
|
|
42
42
|
request?: RequestMetadata;
|
|
43
43
|
}, 'failed', 'mediaCardRender'>;
|
|
44
|
-
export
|
|
44
|
+
export type ErrorEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
45
45
|
cardStatus: CardStatus;
|
|
46
46
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
47
47
|
error?: MediaClientErrorReason | 'nativeError';
|
|
48
48
|
request?: RequestMetadata;
|
|
49
49
|
}, 'nonCriticalFail', 'mediaCardRender'>;
|
|
50
|
-
export
|
|
50
|
+
export type ErrorBoundaryErrorInfo = {
|
|
51
51
|
componentStack: string;
|
|
52
52
|
};
|
|
53
|
-
export
|
|
53
|
+
export type AnalyticsErrorBoundaryAttributes = {
|
|
54
54
|
error?: Error | string;
|
|
55
55
|
info?: ErrorBoundaryErrorInfo;
|
|
56
56
|
browserInfo: string;
|
|
57
57
|
failReason: string;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
60
|
-
export
|
|
61
|
-
export
|
|
62
|
-
export
|
|
63
|
-
export
|
|
64
|
-
export
|
|
65
|
-
export
|
|
66
|
-
export
|
|
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
67
|
label?: string;
|
|
68
68
|
}, 'clicked', string>;
|
|
69
|
-
export
|
|
69
|
+
export type RenderScreenEventPayload = Omit<ScreenEventPayload<ScreenAttributes, 'mediaCardRenderScreen'>, 'attributes'> & {
|
|
70
70
|
attributes: {
|
|
71
71
|
type: string | undefined;
|
|
72
72
|
fileAttributes: FileAttributes;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
-
export
|
|
76
|
-
export declare const getFileAttributes: (metadata: FileDetails, fileStatus?:
|
|
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
77
|
export declare const getRenderPreviewableCardPayload: (fileAttributes: FileAttributes) => RenderScreenEventPayload;
|
|
78
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
|
|
79
|
+
export declare const getRenderSucceededEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderSucceededEventPayload;
|
|
80
80
|
export declare const getCacheHitEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => CacheHitEventPayload;
|
|
81
81
|
export declare const getRemoteSuccessEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => RemoteSuccessEventPayload;
|
|
82
82
|
export declare const getRenderFailedExternalUriPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => RenderFailedEventPayload;
|
|
@@ -85,10 +85,10 @@ export declare const getRenderErrorErrorReason: (error: MediaCardError) => Media
|
|
|
85
85
|
export declare const getRenderErrorErrorDetail: (error: MediaCardError) => string;
|
|
86
86
|
export declare const getErrorTraceContext: (error: MediaCardError) => MediaTraceContext | undefined;
|
|
87
87
|
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) => RequestMetadata | undefined;
|
|
88
|
-
export declare const extractErrorInfo: (error: MediaCardError, metadataTraceContext?: MediaTraceContext
|
|
89
|
-
export declare const getRenderErrorEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error: MediaCardError, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext
|
|
90
|
-
export declare const getErrorEventPayload: (cardStatus: CardStatus, fileAttributes: FileAttributes, error: MediaCardError, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext
|
|
91
|
-
export declare const getRenderFailedFileStatusPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext
|
|
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
92
|
export declare const getCopiedFilePayload: (fileId: string) => CopiedFileEventPayload;
|
|
93
93
|
export declare function fireMediaCardEvent(payload: MediaCardAnalyticsEventPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
94
94
|
export declare const createAndFireMediaCardEvent: (payload: MediaCardAnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CardDimensionValue } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type BreakpointSizeValue = 'small' | 'medium' | 'large' | 'xlarge';
|
|
3
3
|
export declare const breakpointSize: (width: CardDimensionValue, sizes?: any) => BreakpointSizeValue;
|
|
4
4
|
export interface BreakpointProps {
|
|
5
5
|
breakpointSize: BreakpointSizeValue;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type CardBreakpoint = {
|
|
8
8
|
[P in BreakpointSizeValue]?: number;
|
|
9
9
|
};
|
|
10
10
|
export declare const cardBreakpointSizes: CardBreakpoint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, ReactNode, MouseEvent } from 'react';
|
|
2
2
|
import { CardActionIconButtonVariant } from './styles';
|
|
3
|
-
export
|
|
3
|
+
export type CardActionIconButtonProps = {
|
|
4
4
|
readonly icon: ReactNode;
|
|
5
5
|
readonly variant?: CardActionIconButtonVariant;
|
|
6
6
|
readonly triggerColor?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import { CardAction } from '../../card/actions';
|
|
3
3
|
import { CardActionIconButtonVariant } from './styles';
|
|
4
|
-
export
|
|
4
|
+
export type CardActionsDropdownMenuProps = {
|
|
5
5
|
readonly actions: CardAction[];
|
|
6
6
|
readonly triggerColor?: string;
|
|
7
7
|
readonly triggerVariant?: CardActionIconButtonVariant;
|
|
@@ -5,7 +5,7 @@ export declare enum CardActionIconButtonVariant {
|
|
|
5
5
|
default = "default",
|
|
6
6
|
filled = "filled"
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type CardActionButtonOwnProps = {
|
|
9
9
|
variant?: CardActionIconButtonVariant;
|
|
10
10
|
style?: {
|
|
11
11
|
color: string | undefined;
|
|
@@ -14,5 +14,5 @@ export declare type CardActionButtonOwnProps = {
|
|
|
14
14
|
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type CardActionButtonProps = CardActionButtonOwnProps & HTMLAttributes<HTMLDivElement>;
|
|
18
18
|
export declare const cardActionButtonStyles: ({ variant, }: CardActionButtonProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -43,7 +43,7 @@ export declare const maxSquareCardDimensions: {
|
|
|
43
43
|
width: number;
|
|
44
44
|
height: number;
|
|
45
45
|
};
|
|
46
|
-
export declare const getCardMaxHeight: (appearance?: CardAppearance
|
|
47
|
-
export declare const getCardMinWidth: (appearance?: CardAppearance
|
|
48
|
-
export declare const getCardMaxWidth: (appearance?: CardAppearance
|
|
49
|
-
export declare const getDefaultCardDimensions: (appearance?: CardAppearance
|
|
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>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CardDimensionValue, CardDimensions } from '../types';
|
|
2
|
-
export declare const canCompareDimension: (current?: CardDimensionValue
|
|
3
|
-
export declare const isBigger: (current?: CardDimensions
|
|
2
|
+
export declare const canCompareDimension: (current?: CardDimensionValue, next?: CardDimensionValue) => boolean;
|
|
3
|
+
export declare const isBigger: (current?: CardDimensions, next?: CardDimensions) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CardDimensions } from '../types';
|
|
2
2
|
import { ElementDimension } from './getElementDimension';
|
|
3
3
|
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
4
|
-
export
|
|
4
|
+
export type getDataURIDimensionOptions = {
|
|
5
5
|
element?: Element | null;
|
|
6
6
|
dimensions?: CardDimensions;
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ElementDimension = 'height' | 'width';
|
|
2
2
|
export declare const getElementDimension: (element: Element, dimension: ElementDimension) => number;
|
|
@@ -3,4 +3,4 @@ import { MediaType } from '@atlaskit/media-client';
|
|
|
3
3
|
/**
|
|
4
4
|
* When the returned value is undefined, we'd expect the media card to take the parent's cursor style.
|
|
5
5
|
*/
|
|
6
|
-
export declare const getMediaCardCursor: (useInlinePlayer: boolean, useMediaViewer: boolean, isErrorStatus: boolean, hasCardPreview: boolean, mediaType?: MediaType
|
|
6
|
+
export declare const getMediaCardCursor: (useInlinePlayer: boolean, useMediaViewer: boolean, isErrorStatus: boolean, hasCardPreview: boolean, mediaType?: MediaType) => MediaCardCursor | undefined;
|
|
@@ -5,14 +5,14 @@ import { MediaCardErrorInfo } from '../../utils/analytics';
|
|
|
5
5
|
import { MediaCardSsr } from './types';
|
|
6
6
|
export declare const GLOBAL_MEDIA_CARD_SSR = "mediaCardSsr";
|
|
7
7
|
export declare const GLOBAL_MEDIA_NAMESPACE = "__MEDIA_INTERNAL";
|
|
8
|
-
export
|
|
8
|
+
export type MediaGlobalScope = {
|
|
9
9
|
[GLOBAL_MEDIA_CARD_SSR]?: MediaCardSsr;
|
|
10
10
|
};
|
|
11
11
|
export declare function getMediaGlobalScope(globalScope?: any): MediaGlobalScope;
|
|
12
12
|
export declare function getMediaCardSSR(globalScope?: any): MediaCardSsr;
|
|
13
13
|
export declare const getKey: ({ id, collectionName, occurrenceKey }: FileIdentifier) => string;
|
|
14
|
-
export declare const storeDataURI: (key: string, dataURI?: string
|
|
15
|
-
export
|
|
14
|
+
export declare const storeDataURI: (key: string, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo, globalScope?: any) => void;
|
|
15
|
+
export type StoreSSRDataScriptProps = {
|
|
16
16
|
identifier: FileIdentifier;
|
|
17
17
|
dataURI?: string;
|
|
18
18
|
dimensions?: NumericalCardDimensions;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
2
2
|
import { MediaCardErrorInfo } from '../../utils/analytics';
|
|
3
|
-
export
|
|
3
|
+
export type MediaCardSsrData = {
|
|
4
4
|
dataURI?: string;
|
|
5
5
|
dimensions?: NumericalCardDimensions;
|
|
6
6
|
error?: MediaCardErrorInfo;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type MediaCardSsr = Record<string, MediaCardSsrData>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FileState, FileDetails, Identifier } from '@atlaskit/media-client';
|
|
2
|
-
export declare const getFileDetails: (identifier: Identifier, fileState?: FileState
|
|
2
|
+
export declare const getFileDetails: (identifier: Identifier, fileState?: FileState) => FileDetails;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type PreventClickThroughProps = {
|
|
4
4
|
readonly children?: ReactNode;
|
|
5
5
|
};
|
|
6
6
|
export declare function PreventClickThrough({ children, }: PreventClickThroughProps): JSX.Element;
|
|
7
|
-
export
|
|
7
|
+
export type CreatePreventClickThrough = <T>(onClick: () => void) => (event: React.MouseEvent<T, MouseEvent>) => void;
|
|
8
8
|
export declare const createPreventClickThrough: CreatePreventClickThrough;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MediaItemType, MediaType } from '@atlaskit/media-client';
|
|
2
2
|
import { CardStatus } from '../types';
|
|
3
|
-
export declare const shouldDisplayImageThumbnail: (cardStatus: CardStatus, mediaItemType: MediaItemType, dataURI?: string
|
|
3
|
+
export declare const shouldDisplayImageThumbnail: (cardStatus: CardStatus, mediaItemType: MediaItemType, dataURI?: string, mediaType?: MediaType, mimeType?: string) => boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
|
-
export declare const videoIsPlayable: (isBannedLocalPreview: boolean, fileState?: FileState
|
|
2
|
+
export declare const videoIsPlayable: (isBannedLocalPreview: boolean, fileState?: FileState, mimeType?: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "74.8.
|
|
3
|
+
"version": "74.8.1",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.ts",
|
|
17
25
|
"af:exports": {
|
|
@@ -38,7 +46,7 @@
|
|
|
38
46
|
"@atlaskit/media-viewer": "^47.6.0",
|
|
39
47
|
"@atlaskit/spinner": "^15.5.0",
|
|
40
48
|
"@atlaskit/theme": "^12.5.0",
|
|
41
|
-
"@atlaskit/tokens": "^1.
|
|
49
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
42
50
|
"@atlaskit/tooltip": "^17.8.0",
|
|
43
51
|
"@atlaskit/ufo": "^0.2.0",
|
|
44
52
|
"@babel/runtime": "^7.0.0",
|
|
@@ -57,7 +65,7 @@
|
|
|
57
65
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
58
66
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
59
67
|
"@atlaskit/button": "^16.7.0",
|
|
60
|
-
"@atlaskit/checkbox": "^12.
|
|
68
|
+
"@atlaskit/checkbox": "^12.6.0",
|
|
61
69
|
"@atlaskit/docs": "*",
|
|
62
70
|
"@atlaskit/inline-message": "^11.5.0",
|
|
63
71
|
"@atlaskit/media-core": "^34.1.0",
|
|
@@ -83,7 +91,7 @@
|
|
|
83
91
|
"react": "^16.8.0",
|
|
84
92
|
"react-dom": "^16.8.0",
|
|
85
93
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
86
|
-
"typescript": "4.
|
|
94
|
+
"typescript": "~4.9.5",
|
|
87
95
|
"uuid": "^3.1.0",
|
|
88
96
|
"wait-for-expect": "^1.2.0"
|
|
89
97
|
},
|