@atlaskit/media-card 77.5.2 → 77.6.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 +16 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardviews/cardViewWrapper.js +100 -0
- package/dist/cjs/card/v2/cardviews/errorCardView.js +87 -0
- package/dist/cjs/card/v2/cardviews/iconCardView.js +79 -0
- package/dist/cjs/card/v2/cardviews/imageCardView.js +89 -0
- package/dist/cjs/card/v2/cardviews/index.js +282 -0
- package/dist/cjs/card/v2/cardviews/loadingCardView.js +53 -0
- package/dist/cjs/card/v2/cardviews/processingCardView.js +65 -0
- package/dist/cjs/card/v2/cardviews/videoCardView.js +94 -0
- package/dist/cjs/card/v2/fileCard.js +4 -1
- package/dist/cjs/card/v2/useFilePreview/analytics.js +50 -0
- package/dist/cjs/card/v2/useFilePreview/errors.js +13 -2
- package/dist/cjs/card/v2/useFilePreview/helpers.js +1 -1
- package/dist/cjs/card/v2/useFilePreview/useFilePreview.js +1 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +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/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/cardviews/cardViewWrapper.js +92 -0
- package/dist/es2019/card/v2/cardviews/errorCardView.js +82 -0
- package/dist/es2019/card/v2/cardviews/iconCardView.js +70 -0
- package/dist/es2019/card/v2/cardviews/imageCardView.js +75 -0
- package/dist/es2019/card/v2/cardviews/index.js +268 -0
- package/dist/es2019/card/v2/cardviews/loadingCardView.js +48 -0
- package/dist/es2019/card/v2/cardviews/processingCardView.js +60 -0
- package/dist/es2019/card/v2/cardviews/videoCardView.js +80 -0
- package/dist/es2019/card/v2/fileCard.js +4 -1
- package/dist/es2019/card/v2/useFilePreview/analytics.js +44 -0
- package/dist/es2019/card/v2/useFilePreview/errors.js +10 -1
- package/dist/es2019/card/v2/useFilePreview/helpers.js +1 -1
- package/dist/es2019/card/v2/useFilePreview/useFilePreview.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +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/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/cardviews/cardViewWrapper.js +93 -0
- package/dist/esm/card/v2/cardviews/errorCardView.js +79 -0
- package/dist/esm/card/v2/cardviews/iconCardView.js +71 -0
- package/dist/esm/card/v2/cardviews/imageCardView.js +81 -0
- package/dist/esm/card/v2/cardviews/index.js +271 -0
- package/dist/esm/card/v2/cardviews/loadingCardView.js +45 -0
- package/dist/esm/card/v2/cardviews/processingCardView.js +57 -0
- package/dist/esm/card/v2/cardviews/videoCardView.js +86 -0
- package/dist/esm/card/v2/fileCard.js +4 -1
- package/dist/esm/card/v2/useFilePreview/analytics.js +44 -0
- package/dist/esm/card/v2/useFilePreview/errors.js +10 -1
- package/dist/esm/card/v2/useFilePreview/helpers.js +1 -1
- package/dist/esm/card/v2/useFilePreview/useFilePreview.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ui/wrapper/types.d.ts +2 -2
- package/dist/types/card/v2/cardviews/cardViewWrapper.d.ts +38 -0
- package/dist/types/card/v2/cardviews/errorCardView.d.ts +11 -0
- package/dist/types/card/v2/cardviews/iconCardView.d.ts +12 -0
- package/dist/types/card/v2/cardviews/imageCardView.d.ts +21 -0
- package/dist/types/card/v2/cardviews/index.d.ts +45 -0
- package/dist/types/card/v2/cardviews/loadingCardView.d.ts +10 -0
- package/dist/types/card/v2/cardviews/processingCardView.d.ts +8 -0
- package/dist/types/card/v2/cardviews/videoCardView.d.ts +21 -0
- package/dist/types/card/v2/useFilePreview/analytics.d.ts +28 -0
- package/dist/types/card/v2/useFilePreview/errors.d.ts +4 -0
- package/dist/types/card/v2/useFilePreview/helpers.d.ts +1 -1
- package/dist/types/card/v2/useFilePreview/useFilePreview.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/wrapper/types.d.ts +2 -2
- package/dist/types-ts4.5/card/v2/cardviews/cardViewWrapper.d.ts +38 -0
- package/dist/types-ts4.5/card/v2/cardviews/errorCardView.d.ts +11 -0
- package/dist/types-ts4.5/card/v2/cardviews/iconCardView.d.ts +12 -0
- package/dist/types-ts4.5/card/v2/cardviews/imageCardView.d.ts +21 -0
- package/dist/types-ts4.5/card/v2/cardviews/index.d.ts +45 -0
- package/dist/types-ts4.5/card/v2/cardviews/loadingCardView.d.ts +10 -0
- package/dist/types-ts4.5/card/v2/cardviews/processingCardView.d.ts +8 -0
- package/dist/types-ts4.5/card/v2/cardviews/videoCardView.d.ts +21 -0
- package/dist/types-ts4.5/card/v2/useFilePreview/analytics.d.ts +28 -0
- package/dist/types-ts4.5/card/v2/useFilePreview/errors.d.ts +4 -0
- package/dist/types-ts4.5/card/v2/useFilePreview/helpers.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/useFilePreview/useFilePreview.d.ts +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
6
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
+
import { createAndFireMediaCardEvent } from '../../../utils/analytics';
|
|
8
|
+
import { useBreakpoint } from '../../useBreakpoint';
|
|
9
|
+
import { ProcessingCardView } from './processingCardView';
|
|
10
|
+
import { ErrorCardView } from './errorCardView';
|
|
11
|
+
import { VideoCardView } from './videoCardView';
|
|
12
|
+
import { ImageCardView } from './imageCardView';
|
|
13
|
+
import { IconCardView } from './iconCardView';
|
|
14
|
+
import { LoadingCardView } from './loadingCardView';
|
|
15
|
+
export var CardViewsBase = function CardViewsBase(_ref) {
|
|
16
|
+
var innerRef = _ref.innerRef,
|
|
17
|
+
onImageLoad = _ref.onImageLoad,
|
|
18
|
+
onImageError = _ref.onImageError,
|
|
19
|
+
dimensions = _ref.dimensions,
|
|
20
|
+
_ref$appearance = _ref.appearance,
|
|
21
|
+
appearance = _ref$appearance === void 0 ? 'auto' : _ref$appearance,
|
|
22
|
+
onClick = _ref.onClick,
|
|
23
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
24
|
+
testId = _ref.testId,
|
|
25
|
+
metadata = _ref.metadata,
|
|
26
|
+
status = _ref.status,
|
|
27
|
+
selected = _ref.selected,
|
|
28
|
+
selectable = _ref.selectable,
|
|
29
|
+
cardPreview = _ref.cardPreview,
|
|
30
|
+
mediaCardCursor = _ref.mediaCardCursor,
|
|
31
|
+
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
32
|
+
progress = _ref.progress,
|
|
33
|
+
alt = _ref.alt,
|
|
34
|
+
resizeMode = _ref.resizeMode,
|
|
35
|
+
onDisplayImage = _ref.onDisplayImage,
|
|
36
|
+
nativeLazyLoad = _ref.nativeLazyLoad,
|
|
37
|
+
forceSyncDisplay = _ref.forceSyncDisplay,
|
|
38
|
+
actions = _ref.actions,
|
|
39
|
+
disableOverlay = _ref.disableOverlay,
|
|
40
|
+
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
41
|
+
titleBoxIcon = _ref.titleBoxIcon,
|
|
42
|
+
error = _ref.error,
|
|
43
|
+
disableAnimation = _ref.disableAnimation;
|
|
44
|
+
var _useState = useState(false),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
didImageRender = _useState2[0],
|
|
47
|
+
setDidImageRender = _useState2[1];
|
|
48
|
+
var divRef = useRef(null);
|
|
49
|
+
var prevCardPreviewRef = useRef();
|
|
50
|
+
var breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
innerRef && !!divRef.current && innerRef(divRef.current);
|
|
53
|
+
}, [innerRef]);
|
|
54
|
+
|
|
55
|
+
/* didImageRender movements */
|
|
56
|
+
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
// We should only switch didImageRender to false when cardPreview goes undefined, not when it is changed. as this method could be triggered after onImageLoad callback, falling on a race condition
|
|
59
|
+
if (prevCardPreviewRef.current && !cardPreview) {
|
|
60
|
+
setDidImageRender(false);
|
|
61
|
+
}
|
|
62
|
+
prevCardPreviewRef.current = cardPreview;
|
|
63
|
+
}, [cardPreview]);
|
|
64
|
+
var handleOnImageLoad = function handleOnImageLoad(prevCardPreview) {
|
|
65
|
+
if (prevCardPreview.dataURI !== (cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
setDidImageRender(true);
|
|
69
|
+
onImageLoad === null || onImageLoad === void 0 || onImageLoad(cardPreview);
|
|
70
|
+
};
|
|
71
|
+
var handleOnImageError = function handleOnImageError(prevCardPreview) {
|
|
72
|
+
if (prevCardPreview.dataURI !== (cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setDidImageRender(false);
|
|
76
|
+
onImageError === null || onImageError === void 0 || onImageError(cardPreview);
|
|
77
|
+
};
|
|
78
|
+
var getRenderConfigByStatus = function getRenderConfigByStatus() {
|
|
79
|
+
var _ref2 = metadata || {},
|
|
80
|
+
mediaType = _ref2.mediaType;
|
|
81
|
+
|
|
82
|
+
// TODO: figure out if data-test-progress for all the card views
|
|
83
|
+
|
|
84
|
+
var baseProps = {
|
|
85
|
+
testId: testId,
|
|
86
|
+
dimensions: dimensions,
|
|
87
|
+
appearance: appearance,
|
|
88
|
+
metadata: metadata,
|
|
89
|
+
selected: selected,
|
|
90
|
+
selectable: selectable,
|
|
91
|
+
actions: actions,
|
|
92
|
+
breakpoint: breakpoint,
|
|
93
|
+
disableOverlay: disableOverlay,
|
|
94
|
+
titleBoxBgColor: titleBoxBgColor,
|
|
95
|
+
titleBoxIcon: titleBoxIcon,
|
|
96
|
+
shouldHideTooltip: shouldHideTooltip,
|
|
97
|
+
onClick: onClick,
|
|
98
|
+
onMouseEnter: onMouseEnter,
|
|
99
|
+
mediaCardCursor: mediaCardCursor,
|
|
100
|
+
innerRef: innerRef
|
|
101
|
+
};
|
|
102
|
+
switch (status) {
|
|
103
|
+
case 'uploading':
|
|
104
|
+
if (cardPreview) {
|
|
105
|
+
return jsx(React.Fragment, null, jsx("div", {
|
|
106
|
+
style: {
|
|
107
|
+
display: !didImageRender ? 'none' : 'inline'
|
|
108
|
+
}
|
|
109
|
+
}, mediaType === 'video' ? jsx(VideoCardView, _extends({}, baseProps, {
|
|
110
|
+
status: status,
|
|
111
|
+
cardPreview: cardPreview,
|
|
112
|
+
alt: alt,
|
|
113
|
+
resizeMode: resizeMode,
|
|
114
|
+
onDisplayImage: onDisplayImage,
|
|
115
|
+
onImageLoad: handleOnImageLoad,
|
|
116
|
+
onImageError: handleOnImageError,
|
|
117
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
118
|
+
forceSyncDisplay: forceSyncDisplay,
|
|
119
|
+
progress: progress
|
|
120
|
+
})) : jsx(ImageCardView, _extends({}, baseProps, {
|
|
121
|
+
status: status,
|
|
122
|
+
cardPreview: cardPreview,
|
|
123
|
+
alt: alt,
|
|
124
|
+
resizeMode: resizeMode,
|
|
125
|
+
onDisplayImage: onDisplayImage,
|
|
126
|
+
onImageLoad: handleOnImageLoad,
|
|
127
|
+
onImageError: handleOnImageError,
|
|
128
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
129
|
+
forceSyncDisplay: forceSyncDisplay,
|
|
130
|
+
progress: progress
|
|
131
|
+
}))), jsx("div", {
|
|
132
|
+
style: {
|
|
133
|
+
display: didImageRender ? 'none' : 'inline'
|
|
134
|
+
}
|
|
135
|
+
}, jsx(IconCardView, _extends({
|
|
136
|
+
status: status,
|
|
137
|
+
progress: progress
|
|
138
|
+
}, baseProps))));
|
|
139
|
+
} else {
|
|
140
|
+
return jsx(IconCardView, _extends({
|
|
141
|
+
status: status,
|
|
142
|
+
progress: progress
|
|
143
|
+
}, baseProps));
|
|
144
|
+
}
|
|
145
|
+
case 'processing':
|
|
146
|
+
if (cardPreview) {
|
|
147
|
+
return jsx(React.Fragment, null, jsx("div", {
|
|
148
|
+
style: {
|
|
149
|
+
display: !didImageRender ? 'none' : 'inline'
|
|
150
|
+
}
|
|
151
|
+
}, mediaType === 'video' ? jsx(VideoCardView, _extends({}, baseProps, {
|
|
152
|
+
status: status,
|
|
153
|
+
cardPreview: cardPreview,
|
|
154
|
+
alt: alt,
|
|
155
|
+
resizeMode: resizeMode,
|
|
156
|
+
onDisplayImage: onDisplayImage,
|
|
157
|
+
onImageLoad: handleOnImageLoad,
|
|
158
|
+
onImageError: handleOnImageError,
|
|
159
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
160
|
+
forceSyncDisplay: forceSyncDisplay,
|
|
161
|
+
progress: progress
|
|
162
|
+
})) : jsx(ImageCardView, _extends({}, baseProps, {
|
|
163
|
+
status: status,
|
|
164
|
+
cardPreview: cardPreview,
|
|
165
|
+
alt: alt,
|
|
166
|
+
resizeMode: resizeMode,
|
|
167
|
+
onDisplayImage: onDisplayImage,
|
|
168
|
+
onImageLoad: handleOnImageLoad,
|
|
169
|
+
onImageError: handleOnImageError,
|
|
170
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
171
|
+
forceSyncDisplay: forceSyncDisplay,
|
|
172
|
+
progress: progress
|
|
173
|
+
}))), jsx("div", {
|
|
174
|
+
style: {
|
|
175
|
+
display: didImageRender ? 'none' : 'inline'
|
|
176
|
+
}
|
|
177
|
+
}, jsx(ProcessingCardView, _extends({
|
|
178
|
+
disableAnimation: disableAnimation
|
|
179
|
+
}, baseProps))));
|
|
180
|
+
} else {
|
|
181
|
+
return jsx(ProcessingCardView, _extends({
|
|
182
|
+
disableAnimation: disableAnimation
|
|
183
|
+
}, baseProps));
|
|
184
|
+
}
|
|
185
|
+
case 'complete':
|
|
186
|
+
if (cardPreview) {
|
|
187
|
+
return jsx(React.Fragment, null, jsx("div", {
|
|
188
|
+
style: {
|
|
189
|
+
display: !didImageRender ? 'none' : 'inline'
|
|
190
|
+
}
|
|
191
|
+
}, mediaType === 'video' ? jsx(VideoCardView, _extends({}, baseProps, {
|
|
192
|
+
status: status,
|
|
193
|
+
cardPreview: cardPreview,
|
|
194
|
+
alt: alt,
|
|
195
|
+
resizeMode: resizeMode,
|
|
196
|
+
onDisplayImage: onDisplayImage,
|
|
197
|
+
onImageLoad: handleOnImageLoad,
|
|
198
|
+
onImageError: handleOnImageError,
|
|
199
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
200
|
+
forceSyncDisplay: forceSyncDisplay
|
|
201
|
+
})) : jsx(ImageCardView, _extends({}, baseProps, {
|
|
202
|
+
status: status,
|
|
203
|
+
cardPreview: cardPreview,
|
|
204
|
+
alt: alt,
|
|
205
|
+
resizeMode: resizeMode,
|
|
206
|
+
onDisplayImage: onDisplayImage,
|
|
207
|
+
onImageLoad: handleOnImageLoad,
|
|
208
|
+
onImageError: handleOnImageError,
|
|
209
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
210
|
+
forceSyncDisplay: forceSyncDisplay
|
|
211
|
+
}))), jsx("div", {
|
|
212
|
+
style: {
|
|
213
|
+
display: didImageRender ? 'none' : 'inline'
|
|
214
|
+
}
|
|
215
|
+
}, jsx(IconCardView, _extends({
|
|
216
|
+
status: status
|
|
217
|
+
}, baseProps))));
|
|
218
|
+
} else {
|
|
219
|
+
return jsx(IconCardView, _extends({
|
|
220
|
+
status: status
|
|
221
|
+
}, baseProps));
|
|
222
|
+
}
|
|
223
|
+
case 'error':
|
|
224
|
+
case 'failed-processing':
|
|
225
|
+
return jsx(ErrorCardView, _extends({
|
|
226
|
+
disableAnimation: disableAnimation,
|
|
227
|
+
error: error
|
|
228
|
+
}, baseProps));
|
|
229
|
+
case 'loading-preview':
|
|
230
|
+
case 'loading':
|
|
231
|
+
default:
|
|
232
|
+
if (cardPreview) {
|
|
233
|
+
return jsx(React.Fragment, null, jsx("div", {
|
|
234
|
+
style: {
|
|
235
|
+
display: !didImageRender ? 'none' : 'inline'
|
|
236
|
+
}
|
|
237
|
+
}, jsx(ImageCardView, _extends({}, baseProps, {
|
|
238
|
+
status: status,
|
|
239
|
+
cardPreview: cardPreview,
|
|
240
|
+
alt: alt,
|
|
241
|
+
resizeMode: resizeMode,
|
|
242
|
+
onDisplayImage: onDisplayImage,
|
|
243
|
+
onImageLoad: handleOnImageLoad,
|
|
244
|
+
onImageError: handleOnImageError,
|
|
245
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
246
|
+
forceSyncDisplay: forceSyncDisplay,
|
|
247
|
+
progress: progress
|
|
248
|
+
}))), jsx("div", {
|
|
249
|
+
style: {
|
|
250
|
+
display: didImageRender ? 'none' : 'inline'
|
|
251
|
+
}
|
|
252
|
+
}, jsx(LoadingCardView, _extends({}, baseProps, {
|
|
253
|
+
disableAnimation: disableAnimation
|
|
254
|
+
}))));
|
|
255
|
+
} else {
|
|
256
|
+
return jsx(LoadingCardView, _extends({}, baseProps, {
|
|
257
|
+
disableAnimation: disableAnimation
|
|
258
|
+
}));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
return getRenderConfigByStatus();
|
|
263
|
+
};
|
|
264
|
+
export var CardViews = withAnalyticsEvents({
|
|
265
|
+
onClick: createAndFireMediaCardEvent({
|
|
266
|
+
eventType: 'ui',
|
|
267
|
+
action: 'clicked',
|
|
268
|
+
actionSubject: 'mediaCard',
|
|
269
|
+
attributes: {}
|
|
270
|
+
})
|
|
271
|
+
})(CardViewsBase);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { useEffect, useRef } from 'react';
|
|
5
|
+
import SpinnerIcon from '@atlaskit/spinner';
|
|
6
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
+
import { createAndFireMediaCardEvent } from '../../../utils/analytics';
|
|
8
|
+
import { IconWrapper } from '../../ui/iconWrapper/iconWrapper';
|
|
9
|
+
import { useBreakpoint } from '../../useBreakpoint';
|
|
10
|
+
import { CardViewWrapper } from './cardViewWrapper';
|
|
11
|
+
var LoadingCardViewBase = function LoadingCardViewBase(props) {
|
|
12
|
+
var dimensions = props.dimensions,
|
|
13
|
+
metadata = props.metadata,
|
|
14
|
+
disableOverlay = props.disableOverlay,
|
|
15
|
+
innerRef = props.innerRef;
|
|
16
|
+
var divRef = useRef(null);
|
|
17
|
+
var breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
innerRef && !!divRef.current && innerRef(divRef.current);
|
|
20
|
+
}, [innerRef]);
|
|
21
|
+
var _ref = metadata || {},
|
|
22
|
+
name = _ref.name;
|
|
23
|
+
var hasTitleBox = !disableOverlay && !!name;
|
|
24
|
+
return jsx(CardViewWrapper, _extends({}, props, {
|
|
25
|
+
metadata: metadata,
|
|
26
|
+
breakpoint: breakpoint,
|
|
27
|
+
ref: divRef
|
|
28
|
+
}), jsx(IconWrapper, {
|
|
29
|
+
breakpoint: breakpoint,
|
|
30
|
+
hasTitleBox: hasTitleBox
|
|
31
|
+
}, jsx(SpinnerIcon, {
|
|
32
|
+
testId: "media-card-loading"
|
|
33
|
+
})));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// TODO: check if analytics is correct
|
|
37
|
+
|
|
38
|
+
export var LoadingCardView = withAnalyticsEvents({
|
|
39
|
+
onClick: createAndFireMediaCardEvent({
|
|
40
|
+
eventType: 'ui',
|
|
41
|
+
action: 'clicked',
|
|
42
|
+
actionSubject: 'mediaCard',
|
|
43
|
+
attributes: {}
|
|
44
|
+
})
|
|
45
|
+
})(LoadingCardViewBase);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { useEffect, useRef } from 'react';
|
|
5
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
+
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
7
|
+
import { createAndFireMediaCardEvent } from '../../../utils/analytics';
|
|
8
|
+
import { IconWrapper } from '../../ui/iconWrapper/iconWrapper';
|
|
9
|
+
import { CreatingPreview } from '../../ui/iconMessage';
|
|
10
|
+
import { useBreakpoint } from '../../useBreakpoint';
|
|
11
|
+
import { CardViewWrapper } from './cardViewWrapper';
|
|
12
|
+
var ProcessingCardViewBase = function ProcessingCardViewBase(props) {
|
|
13
|
+
var disableAnimation = props.disableAnimation,
|
|
14
|
+
dimensions = props.dimensions,
|
|
15
|
+
metadata = props.metadata,
|
|
16
|
+
disableOverlay = props.disableOverlay,
|
|
17
|
+
innerRef = props.innerRef;
|
|
18
|
+
var divRef = useRef(null);
|
|
19
|
+
var breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
innerRef && !!divRef.current && innerRef(divRef.current);
|
|
22
|
+
}, [innerRef]);
|
|
23
|
+
var _ref = metadata || {},
|
|
24
|
+
name = _ref.name,
|
|
25
|
+
size = _ref.size,
|
|
26
|
+
mediaType = _ref.mediaType,
|
|
27
|
+
mimeType = _ref.mimeType;
|
|
28
|
+
var isZeroSize = size === 0;
|
|
29
|
+
var hasTitleBox = !disableOverlay && !!name;
|
|
30
|
+
return jsx(CardViewWrapper, _extends({}, props, {
|
|
31
|
+
metadata: metadata,
|
|
32
|
+
breakpoint: breakpoint,
|
|
33
|
+
"data-test-status": "processing",
|
|
34
|
+
ref: divRef
|
|
35
|
+
}), jsx(IconWrapper, {
|
|
36
|
+
breakpoint: breakpoint,
|
|
37
|
+
hasTitleBox: hasTitleBox
|
|
38
|
+
}, jsx(MimeTypeIcon, {
|
|
39
|
+
testId: "media-card-file-type-icon",
|
|
40
|
+
mediaType: mediaType,
|
|
41
|
+
mimeType: mimeType,
|
|
42
|
+
name: name
|
|
43
|
+
}), !isZeroSize && jsx(CreatingPreview, {
|
|
44
|
+
disableAnimation: disableAnimation
|
|
45
|
+
})));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// TODO: check if analytics is correct
|
|
49
|
+
|
|
50
|
+
export var ProcessingCardView = withAnalyticsEvents({
|
|
51
|
+
onClick: createAndFireMediaCardEvent({
|
|
52
|
+
eventType: 'ui',
|
|
53
|
+
action: 'clicked',
|
|
54
|
+
actionSubject: 'mediaCard',
|
|
55
|
+
attributes: {}
|
|
56
|
+
})
|
|
57
|
+
})(ProcessingCardViewBase);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { useEffect, useRef } from 'react';
|
|
5
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
+
import { createAndFireMediaCardEvent } from '../../../utils/analytics';
|
|
7
|
+
import { IconWrapper } from '../../ui/iconWrapper/iconWrapper';
|
|
8
|
+
import { PlayButton } from '../../ui/playButton/playButton';
|
|
9
|
+
import { ImageRenderer } from '../../ui/imageRenderer/imageRenderer';
|
|
10
|
+
import { useBreakpoint } from '../../useBreakpoint';
|
|
11
|
+
import { CardViewWrapper } from './cardViewWrapper';
|
|
12
|
+
import { ProgressBar } from '../../ui/progressBar/progressBar';
|
|
13
|
+
import { Blanket } from '../../ui/blanket/blanket';
|
|
14
|
+
var VideoCardViewBase = function VideoCardViewBase(props) {
|
|
15
|
+
var status = props.status,
|
|
16
|
+
dimensions = props.dimensions,
|
|
17
|
+
metadata = props.metadata,
|
|
18
|
+
disableOverlay = props.disableOverlay,
|
|
19
|
+
innerRef = props.innerRef,
|
|
20
|
+
progress = props.progress,
|
|
21
|
+
cardPreview = props.cardPreview,
|
|
22
|
+
alt = props.alt,
|
|
23
|
+
resizeMode = props.resizeMode,
|
|
24
|
+
onDisplayImage = props.onDisplayImage,
|
|
25
|
+
nativeLazyLoad = props.nativeLazyLoad,
|
|
26
|
+
forceSyncDisplay = props.forceSyncDisplay,
|
|
27
|
+
_onImageLoad = props.onImageLoad,
|
|
28
|
+
_onImageError = props.onImageError;
|
|
29
|
+
var divRef = useRef(null);
|
|
30
|
+
var breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
innerRef && !!divRef.current && innerRef(divRef.current);
|
|
33
|
+
}, [innerRef]);
|
|
34
|
+
var _ref = metadata || {},
|
|
35
|
+
name = _ref.name,
|
|
36
|
+
_ref$mediaType = _ref.mediaType,
|
|
37
|
+
mediaType = _ref$mediaType === void 0 ? 'unknown' : _ref$mediaType;
|
|
38
|
+
var hasTitleBox = !disableOverlay && !!name;
|
|
39
|
+
var isUploading = status === 'uploading';
|
|
40
|
+
return jsx(CardViewWrapper, _extends({}, props, {
|
|
41
|
+
breakpoint: breakpoint,
|
|
42
|
+
"data-test-status": status,
|
|
43
|
+
"data-test-progress": progress,
|
|
44
|
+
ref: divRef,
|
|
45
|
+
customBlanket: function customBlanket() {
|
|
46
|
+
return disableOverlay ? null : jsx(Blanket, {
|
|
47
|
+
isFixed: isUploading
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
progressBar: isUploading ? function () {
|
|
51
|
+
return jsx(ProgressBar, {
|
|
52
|
+
progress: progress,
|
|
53
|
+
breakpoint: breakpoint,
|
|
54
|
+
positionBottom: !hasTitleBox
|
|
55
|
+
});
|
|
56
|
+
} : undefined
|
|
57
|
+
}), jsx(ImageRenderer, {
|
|
58
|
+
cardPreview: cardPreview,
|
|
59
|
+
mediaType: mediaType,
|
|
60
|
+
alt: alt,
|
|
61
|
+
resizeMode: resizeMode,
|
|
62
|
+
onDisplayImage: onDisplayImage,
|
|
63
|
+
onImageLoad: function onImageLoad() {
|
|
64
|
+
return _onImageLoad === null || _onImageLoad === void 0 ? void 0 : _onImageLoad(cardPreview);
|
|
65
|
+
},
|
|
66
|
+
onImageError: function onImageError() {
|
|
67
|
+
return _onImageError === null || _onImageError === void 0 ? void 0 : _onImageError(cardPreview);
|
|
68
|
+
},
|
|
69
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
70
|
+
forceSyncDisplay: forceSyncDisplay
|
|
71
|
+
}), cardPreview && jsx(IconWrapper, {
|
|
72
|
+
breakpoint: breakpoint,
|
|
73
|
+
hasTitleBox: hasTitleBox
|
|
74
|
+
}, jsx(PlayButton, null)));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// TODO: check if analytics is correct
|
|
78
|
+
|
|
79
|
+
export var VideoCardView = withAnalyticsEvents({
|
|
80
|
+
onClick: createAndFireMediaCardEvent({
|
|
81
|
+
eventType: 'ui',
|
|
82
|
+
action: 'clicked',
|
|
83
|
+
actionSubject: 'mediaCard',
|
|
84
|
+
attributes: {}
|
|
85
|
+
})
|
|
86
|
+
})(VideoCardViewBase);
|
|
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
7
8
|
import { globalMediaEventEmitter, isImageRepresentationReady, RECENTS_COLLECTION } from '@atlaskit/media-client';
|
|
8
9
|
import { MediaFileStateError, useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
@@ -25,8 +26,10 @@ import { getDefaultCardDimensions } from '../../utils/cardDimensions';
|
|
|
25
26
|
import { fireCommencedEvent, fireCopiedEvent, fireNonCriticalErrorEvent, fireOperationalEvent, fireScreenEvent } from '../cardAnalytics';
|
|
26
27
|
import { isSSRPreview } from '../getCardPreview';
|
|
27
28
|
import { CardViewV2 } from './cardViewV2';
|
|
29
|
+
import { CardViews } from './cardviews';
|
|
28
30
|
import { InlinePlayerLazyV2 } from './inlinePlayerLazyV2';
|
|
29
31
|
import { useFilePreview } from './useFilePreview';
|
|
32
|
+
var LoadedCardView = getBooleanFF('platform.media-experience.card-views-refactor_b91lr') ? CardViews : CardViewV2;
|
|
30
33
|
export var FileCard = function FileCard(_ref) {
|
|
31
34
|
var _ref$appearance = _ref.appearance,
|
|
32
35
|
appearance = _ref$appearance === void 0 ? 'auto' : _ref$appearance,
|
|
@@ -509,7 +512,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
509
512
|
// Force Media Image to always display img for SSR
|
|
510
513
|
var forceSyncDisplay = !!ssr;
|
|
511
514
|
var mediaCardCursor = getMediaCardCursor(!!useInlinePlayer, !!shouldOpenMediaViewer, finalStatus === 'error' || finalStatus === 'failed-processing', !!cardPreview, metadata.mediaType);
|
|
512
|
-
var card = /*#__PURE__*/React.createElement(
|
|
515
|
+
var card = /*#__PURE__*/React.createElement(LoadedCardView, {
|
|
513
516
|
status: cardStatusOverride || finalStatus,
|
|
514
517
|
error: finalError,
|
|
515
518
|
mediaItemType: mediaItemType,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getMediaClientErrorReason, isRequestError } from '@atlaskit/media-client';
|
|
2
|
+
import { isMediaFilePreviewError, getFileStateErrorReason, isMediaFileStateError } from './errors';
|
|
3
|
+
export var getErrorTraceContext = function getErrorTraceContext(error) {
|
|
4
|
+
if (isMediaFilePreviewError(error) && !!error.secondaryError) {
|
|
5
|
+
if (isRequestError(error.secondaryError)) {
|
|
6
|
+
var _error$secondaryError;
|
|
7
|
+
return (_error$secondaryError = error.secondaryError.metadata) === null || _error$secondaryError === void 0 ? void 0 : _error$secondaryError.traceContext;
|
|
8
|
+
} else if (isMediaFileStateError(error.secondaryError)) {
|
|
9
|
+
var _error$secondaryError2;
|
|
10
|
+
return (_error$secondaryError2 = error.secondaryError.details) === null || _error$secondaryError2 === void 0 || (_error$secondaryError2 = _error$secondaryError2.metadata) === null || _error$secondaryError2 === void 0 ? void 0 : _error$secondaryError2.traceContext;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export var getRenderErrorFailReason = function getRenderErrorFailReason(error) {
|
|
15
|
+
if (isMediaFilePreviewError(error)) {
|
|
16
|
+
return error.primaryReason;
|
|
17
|
+
} else {
|
|
18
|
+
return 'nativeError';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export var getRenderErrorErrorReason = function getRenderErrorErrorReason(error) {
|
|
22
|
+
if (isMediaFilePreviewError(error) && error.secondaryError) {
|
|
23
|
+
var mediaClientReason = isMediaFileStateError(error.secondaryError) ? getFileStateErrorReason(error.secondaryError) : getMediaClientErrorReason(error.secondaryError);
|
|
24
|
+
if (mediaClientReason !== 'unknown') {
|
|
25
|
+
return mediaClientReason;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return 'nativeError';
|
|
29
|
+
};
|
|
30
|
+
export var getRenderErrorErrorDetail = function getRenderErrorErrorDetail(error) {
|
|
31
|
+
if (isMediaFilePreviewError(error) && error.secondaryError) {
|
|
32
|
+
return error.secondaryError.message;
|
|
33
|
+
} else {
|
|
34
|
+
return error.message;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export var extractErrorInfo = function extractErrorInfo(error, metadataTraceContext) {
|
|
38
|
+
return {
|
|
39
|
+
failReason: getRenderErrorFailReason(error),
|
|
40
|
+
error: getRenderErrorErrorReason(error),
|
|
41
|
+
errorDetail: getRenderErrorErrorDetail(error),
|
|
42
|
+
metadataTraceContext: metadataTraceContext !== null && metadataTraceContext !== void 0 ? metadataTraceContext : getErrorTraceContext(error)
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -7,6 +7,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
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; } }
|
|
10
|
+
import { MediaFileStateError } from '@atlaskit/media-client-react';
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* Primary reason is logged through Data Portal.
|
|
12
14
|
* Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
|
|
@@ -121,4 +123,11 @@ export var ensureMediaFilePreviewError = function ensureMediaFilePreviewError(pr
|
|
|
121
123
|
return error;
|
|
122
124
|
}
|
|
123
125
|
return new MediaFilePreviewError(primaryReason, error);
|
|
124
|
-
};
|
|
126
|
+
};
|
|
127
|
+
export function isMediaFileStateError(err) {
|
|
128
|
+
return err instanceof MediaFileStateError;
|
|
129
|
+
}
|
|
130
|
+
export function getFileStateErrorReason(err) {
|
|
131
|
+
var _err$details$reason, _err$details;
|
|
132
|
+
return (_err$details$reason = (_err$details = err.details) === null || _err$details === void 0 ? void 0 : _err$details.reason) !== null && _err$details$reason !== void 0 ? _err$details$reason : 'unknown';
|
|
133
|
+
}
|
|
@@ -42,7 +42,7 @@ export var createRequestDimensions = function createRequestDimensions(dimensions
|
|
|
42
42
|
return result;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
/** Stores the provided value in a
|
|
45
|
+
/** Stores the provided value in a ref object to avoid "component rerenders" when the value is used as a hook dependency */
|
|
46
46
|
export function useCurrentValueRef(value) {
|
|
47
47
|
var ref = useRef(value);
|
|
48
48
|
ref.current = value;
|
|
@@ -9,7 +9,7 @@ import { MediaFileStateError, useFileState, useMediaClient } from '@atlaskit/med
|
|
|
9
9
|
import { isMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
10
10
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
11
11
|
import { ensureMediaFilePreviewError, ImageLoadError, isLocalPreviewError, isUnsupportedLocalPreviewError, MediaFilePreviewError } from './errors';
|
|
12
|
-
import { extractErrorInfo } from '
|
|
12
|
+
import { extractErrorInfo } from './analytics';
|
|
13
13
|
import { isBigger, createRequestDimensions, useCurrentValueRef, usePrevious } from './helpers';
|
|
14
14
|
import { generateScriptProps, getSSRData } from './globalScope';
|
|
15
15
|
import { getAndCacheRemotePreview, getSSRCardPreview, isLocalPreview, isSSRClientPreview, isSSRDataPreview, isPreviewableStatus, extractFilePreviewStatus, mediaFilePreviewCache, getAndCacheLocalPreview } from './getPreview';
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.
|
|
106
|
+
packageName: "77.6.1",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -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 = "77.
|
|
10
|
+
var packageVersion = "77.6.1";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { MouseEvent
|
|
1
|
+
import React, { MouseEvent } from 'react';
|
|
2
2
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { CardDimensions, CardAppearance } from '../../../types';
|
|
4
4
|
import { Breakpoint } from '../common';
|
|
@@ -18,6 +18,6 @@ export interface WrapperProps {
|
|
|
18
18
|
isPlayButtonClickable: boolean;
|
|
19
19
|
isTickBoxSelectable: boolean;
|
|
20
20
|
shouldDisplayTooltip: boolean;
|
|
21
|
-
innerRef?:
|
|
21
|
+
innerRef?: React.Ref<HTMLDivElement>;
|
|
22
22
|
children?: JSX.Element;
|
|
23
23
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { FileDetails } from '@atlaskit/media-client';
|
|
3
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { CardAppearance, CardDimensions, MediaCardCursor, TitleBoxIcon } from '../../../types';
|
|
5
|
+
import { CardAction } from '../../actions';
|
|
6
|
+
import { Breakpoint } from '../../ui/common';
|
|
7
|
+
import { MediaFilePreview } from '../useFilePreview';
|
|
8
|
+
export type SharedCardViewProps = {
|
|
9
|
+
readonly cardPreview?: MediaFilePreview;
|
|
10
|
+
readonly testId?: string;
|
|
11
|
+
readonly dimensions?: CardDimensions;
|
|
12
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
13
|
+
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
14
|
+
readonly appearance?: CardAppearance;
|
|
15
|
+
readonly disableOverlay?: boolean;
|
|
16
|
+
readonly actions?: Array<CardAction>;
|
|
17
|
+
readonly selectable?: boolean;
|
|
18
|
+
readonly selected?: boolean;
|
|
19
|
+
readonly metadata?: FileDetails;
|
|
20
|
+
readonly titleBoxBgColor?: string;
|
|
21
|
+
readonly titleBoxIcon?: TitleBoxIcon;
|
|
22
|
+
readonly mediaCardCursor?: MediaCardCursor;
|
|
23
|
+
readonly shouldHideTooltip?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type CardViewWrapperProps = SharedCardViewProps & {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
readonly breakpoint: Breakpoint;
|
|
28
|
+
customBlanket?: () => ReactNode;
|
|
29
|
+
customTitleBox?: () => ReactNode;
|
|
30
|
+
progressBar?: () => ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export declare const CardViewWrapper: React.ForwardRefExoticComponent<SharedCardViewProps & {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
readonly breakpoint: Breakpoint;
|
|
35
|
+
customBlanket?: (() => ReactNode) | undefined;
|
|
36
|
+
customTitleBox?: (() => ReactNode) | undefined;
|
|
37
|
+
progressBar?: (() => ReactNode) | undefined;
|
|
38
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import { FileDetails } from '@atlaskit/media-client';
|
|
4
|
+
import { SharedCardViewProps } from './cardViewWrapper';
|
|
5
|
+
import { MediaCardError } from '../../../errors';
|
|
6
|
+
export type ErrorCardViewProps = SharedCardViewProps & WithAnalyticsEventsProps & {
|
|
7
|
+
metadata?: FileDetails;
|
|
8
|
+
disableAnimation?: boolean;
|
|
9
|
+
readonly error?: MediaCardError;
|
|
10
|
+
};
|
|
11
|
+
export declare const ErrorCardView: import("react").ForwardRefExoticComponent<Omit<ErrorCardViewProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
|