@atlaskit/media-card 77.7.1 → 77.7.3
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 +14 -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/cardViewV2.js +2 -1
- package/dist/cjs/card/v2/fileCard.js +4 -12
- 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/cardViewV2.js +2 -1
- package/dist/es2019/card/v2/fileCard.js +5 -13
- 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/cardViewV2.js +2 -1
- package/dist/esm/card/v2/fileCard.js +5 -13
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#69372](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69372) [`c5868970426f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c5868970426f) - Simplified status set in Card v2
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 77.7.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#65817](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65817) [`3be0ec786219`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3be0ec786219) - Added data test preview source
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 77.7.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -50,7 +50,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
50
50
|
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); }; }
|
|
51
51
|
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; } }
|
|
52
52
|
var packageName = "@atlaskit/media-card";
|
|
53
|
-
var packageVersion = "77.7.
|
|
53
|
+
var packageVersion = "77.7.3";
|
|
54
54
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
55
55
|
(0, _inherits2.default)(CardBase, _Component);
|
|
56
56
|
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 = "77.7.
|
|
93
|
+
var packageVersion = "77.7.3";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -16,7 +16,7 @@ var _externalImageCard = require("./externalImageCard");
|
|
|
16
16
|
var _fileCard = require("./fileCard");
|
|
17
17
|
var _excluded = ["identifier"];
|
|
18
18
|
var packageName = "@atlaskit/media-card";
|
|
19
|
-
var packageVersion = "77.7.
|
|
19
|
+
var packageVersion = "77.7.3";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -212,7 +212,8 @@ var CardViewV2Base = exports.CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
212
212
|
"data-test-media-name": name,
|
|
213
213
|
"data-test-status": status,
|
|
214
214
|
"data-test-progress": progress,
|
|
215
|
-
"data-test-selected": selected
|
|
215
|
+
"data-test-selected": selected,
|
|
216
|
+
"data-test-source": cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
216
217
|
}, renderTypeIcon && (0, _react.jsx)(_iconWrapper.IconWrapper, {
|
|
217
218
|
breakpoint: breakpoint,
|
|
218
219
|
hasTitleBox: hasTitleBox
|
|
@@ -178,10 +178,10 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
178
178
|
ssr: ssr,
|
|
179
179
|
dimensions: previewDimensions,
|
|
180
180
|
traceContext: traceContext,
|
|
181
|
-
previewDidRender: previewDidRender,
|
|
182
181
|
skipRemote: !isCardVisible
|
|
183
182
|
}),
|
|
184
183
|
preview = _useFilePreview.preview,
|
|
184
|
+
previewStatus = _useFilePreview.status,
|
|
185
185
|
previewError = _useFilePreview.error,
|
|
186
186
|
nonCriticalError = _useFilePreview.nonCriticalError,
|
|
187
187
|
ssrReliabilityRef = _useFilePreview.ssrReliabilityRef,
|
|
@@ -459,15 +459,6 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
461
|
if (fileState.status !== 'error') {
|
|
462
|
-
var mediaType = 'mediaType' in fileState ? fileState.mediaType : undefined;
|
|
463
|
-
var isPreviewable = !!mediaType && ['audio', 'video', 'image', 'doc'].indexOf(mediaType) > -1;
|
|
464
|
-
var isPreviewableFileState = !!fileState.preview;
|
|
465
|
-
var isSupportedLocalPreview = mediaType === 'image' || mediaType === 'video';
|
|
466
|
-
var hasLocalPreview = isPreviewableFileState &&
|
|
467
|
-
// CXP-2723 TODO: isPreviewableFileState is most likely redundant
|
|
468
|
-
isSupportedLocalPreview && !!fileState.mimeType && (0, _mediaCommon.isMimeTypeSupportedByBrowser)(fileState.mimeType);
|
|
469
|
-
var hasRemotePreview = (0, _mediaClient.isImageRepresentationReady)(fileState);
|
|
470
|
-
var hasPreview = hasLocalPreview || hasRemotePreview;
|
|
471
462
|
var newStatus;
|
|
472
463
|
switch (fileState.status) {
|
|
473
464
|
case 'uploading':
|
|
@@ -476,7 +467,8 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
476
467
|
newStatus = fileState.status;
|
|
477
468
|
break;
|
|
478
469
|
case 'processed':
|
|
479
|
-
if
|
|
470
|
+
// Set complete if processing is done and there is no preview
|
|
471
|
+
if (!preview && previewStatus === 'complete') {
|
|
480
472
|
newStatus = 'complete';
|
|
481
473
|
break;
|
|
482
474
|
}
|
|
@@ -498,7 +490,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
498
490
|
});
|
|
499
491
|
(0, _react.useEffect)(function () {
|
|
500
492
|
updateFileStateRef.current();
|
|
501
|
-
}, [fileState, updateFileStateRef]);
|
|
493
|
+
}, [fileState, preview, previewStatus, updateFileStateRef]);
|
|
502
494
|
|
|
503
495
|
//----------------------------------------------------------------//
|
|
504
496
|
//---------------------- Render Card Function --------------------//
|
|
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
119
119
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
120
120
|
var analyticsContext = {
|
|
121
121
|
packageVersion: "@atlaskit/media-card",
|
|
122
|
-
packageName: "77.7.
|
|
122
|
+
packageName: "77.7.3",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
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; }
|
|
15
15
|
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) { (0, _defineProperty2.default)(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; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "77.7.
|
|
17
|
+
var packageVersion = "77.7.3";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
30
30
|
const packageName = "@atlaskit/media-card";
|
|
31
|
-
const packageVersion = "77.7.
|
|
31
|
+
const packageVersion = "77.7.3";
|
|
32
32
|
export class CardBase extends Component {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
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 = "77.7.
|
|
69
|
+
const packageVersion = "77.7.3";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -7,7 +7,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
7
7
|
import { ExternalImageCard } from './externalImageCard';
|
|
8
8
|
import { FileCard } from './fileCard';
|
|
9
9
|
const packageName = "@atlaskit/media-card";
|
|
10
|
-
const packageVersion = "77.7.
|
|
10
|
+
const packageVersion = "77.7.3";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
@@ -208,7 +208,8 @@ export const CardViewV2Base = ({
|
|
|
208
208
|
"data-test-media-name": name,
|
|
209
209
|
"data-test-status": status,
|
|
210
210
|
"data-test-progress": progress,
|
|
211
|
-
"data-test-selected": selected
|
|
211
|
+
"data-test-selected": selected,
|
|
212
|
+
"data-test-source": cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
212
213
|
}, renderTypeIcon && jsx(IconWrapper, {
|
|
213
214
|
breakpoint: breakpoint,
|
|
214
215
|
hasTitleBox: hasTitleBox
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
3
|
-
import { globalMediaEventEmitter,
|
|
3
|
+
import { globalMediaEventEmitter, RECENTS_COLLECTION, imageResizeModeToFileImageMode, isProcessedFileState } from '@atlaskit/media-client';
|
|
4
4
|
import { MediaFileStateError, useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
5
5
|
import { getRandomHex, isMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
6
6
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
@@ -132,6 +132,7 @@ export const FileCard = ({
|
|
|
132
132
|
}, [alt, previewDimensions, contextId, fileStateValue, identifier, originalDimensions]);
|
|
133
133
|
const {
|
|
134
134
|
preview,
|
|
135
|
+
status: previewStatus,
|
|
135
136
|
error: previewError,
|
|
136
137
|
nonCriticalError,
|
|
137
138
|
ssrReliabilityRef,
|
|
@@ -145,7 +146,6 @@ export const FileCard = ({
|
|
|
145
146
|
ssr,
|
|
146
147
|
dimensions: previewDimensions,
|
|
147
148
|
traceContext,
|
|
148
|
-
previewDidRender,
|
|
149
149
|
skipRemote: !isCardVisible
|
|
150
150
|
});
|
|
151
151
|
const [error, setError] = useState();
|
|
@@ -412,15 +412,6 @@ export const FileCard = ({
|
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
414
|
if (fileState.status !== 'error') {
|
|
415
|
-
const mediaType = 'mediaType' in fileState ? fileState.mediaType : undefined;
|
|
416
|
-
const isPreviewable = !!mediaType && ['audio', 'video', 'image', 'doc'].indexOf(mediaType) > -1;
|
|
417
|
-
const isPreviewableFileState = !!fileState.preview;
|
|
418
|
-
const isSupportedLocalPreview = mediaType === 'image' || mediaType === 'video';
|
|
419
|
-
const hasLocalPreview = isPreviewableFileState &&
|
|
420
|
-
// CXP-2723 TODO: isPreviewableFileState is most likely redundant
|
|
421
|
-
isSupportedLocalPreview && !!fileState.mimeType && isMimeTypeSupportedByBrowser(fileState.mimeType);
|
|
422
|
-
const hasRemotePreview = isImageRepresentationReady(fileState);
|
|
423
|
-
const hasPreview = hasLocalPreview || hasRemotePreview;
|
|
424
415
|
let newStatus;
|
|
425
416
|
switch (fileState.status) {
|
|
426
417
|
case 'uploading':
|
|
@@ -429,7 +420,8 @@ export const FileCard = ({
|
|
|
429
420
|
newStatus = fileState.status;
|
|
430
421
|
break;
|
|
431
422
|
case 'processed':
|
|
432
|
-
if
|
|
423
|
+
// Set complete if processing is done and there is no preview
|
|
424
|
+
if (!preview && previewStatus === 'complete') {
|
|
433
425
|
newStatus = 'complete';
|
|
434
426
|
break;
|
|
435
427
|
}
|
|
@@ -451,7 +443,7 @@ export const FileCard = ({
|
|
|
451
443
|
});
|
|
452
444
|
useEffect(() => {
|
|
453
445
|
updateFileStateRef.current();
|
|
454
|
-
}, [fileState, updateFileStateRef]);
|
|
446
|
+
}, [fileState, preview, previewStatus, updateFileStateRef]);
|
|
455
447
|
|
|
456
448
|
//----------------------------------------------------------------//
|
|
457
449
|
//---------------------- Render Card Function --------------------//
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "77.7.
|
|
40
|
+
packageName: "77.7.3",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -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 = "77.7.
|
|
7
|
+
const packageVersion = "77.7.3";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.7.
|
|
44
|
+
var packageVersion = "77.7.3";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
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 = "77.7.
|
|
86
|
+
var packageVersion = "77.7.3";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.7.
|
|
12
|
+
var packageVersion = "77.7.3";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -203,7 +203,8 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
203
203
|
"data-test-media-name": name,
|
|
204
204
|
"data-test-status": status,
|
|
205
205
|
"data-test-progress": progress,
|
|
206
|
-
"data-test-selected": selected
|
|
206
|
+
"data-test-selected": selected,
|
|
207
|
+
"data-test-source": cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
207
208
|
}, renderTypeIcon && jsx(IconWrapper, {
|
|
208
209
|
breakpoint: breakpoint,
|
|
209
210
|
hasTitleBox: hasTitleBox
|
|
@@ -5,7 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
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
6
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
8
|
-
import { globalMediaEventEmitter,
|
|
8
|
+
import { globalMediaEventEmitter, RECENTS_COLLECTION, imageResizeModeToFileImageMode, isProcessedFileState } from '@atlaskit/media-client';
|
|
9
9
|
import { MediaFileStateError, useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
10
10
|
import { getRandomHex, isMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
11
11
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
@@ -168,10 +168,10 @@ export var FileCard = function FileCard(_ref) {
|
|
|
168
168
|
ssr: ssr,
|
|
169
169
|
dimensions: previewDimensions,
|
|
170
170
|
traceContext: traceContext,
|
|
171
|
-
previewDidRender: previewDidRender,
|
|
172
171
|
skipRemote: !isCardVisible
|
|
173
172
|
}),
|
|
174
173
|
preview = _useFilePreview.preview,
|
|
174
|
+
previewStatus = _useFilePreview.status,
|
|
175
175
|
previewError = _useFilePreview.error,
|
|
176
176
|
nonCriticalError = _useFilePreview.nonCriticalError,
|
|
177
177
|
ssrReliabilityRef = _useFilePreview.ssrReliabilityRef,
|
|
@@ -449,15 +449,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
451
|
if (fileState.status !== 'error') {
|
|
452
|
-
var mediaType = 'mediaType' in fileState ? fileState.mediaType : undefined;
|
|
453
|
-
var isPreviewable = !!mediaType && ['audio', 'video', 'image', 'doc'].indexOf(mediaType) > -1;
|
|
454
|
-
var isPreviewableFileState = !!fileState.preview;
|
|
455
|
-
var isSupportedLocalPreview = mediaType === 'image' || mediaType === 'video';
|
|
456
|
-
var hasLocalPreview = isPreviewableFileState &&
|
|
457
|
-
// CXP-2723 TODO: isPreviewableFileState is most likely redundant
|
|
458
|
-
isSupportedLocalPreview && !!fileState.mimeType && isMimeTypeSupportedByBrowser(fileState.mimeType);
|
|
459
|
-
var hasRemotePreview = isImageRepresentationReady(fileState);
|
|
460
|
-
var hasPreview = hasLocalPreview || hasRemotePreview;
|
|
461
452
|
var newStatus;
|
|
462
453
|
switch (fileState.status) {
|
|
463
454
|
case 'uploading':
|
|
@@ -466,7 +457,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
466
457
|
newStatus = fileState.status;
|
|
467
458
|
break;
|
|
468
459
|
case 'processed':
|
|
469
|
-
if
|
|
460
|
+
// Set complete if processing is done and there is no preview
|
|
461
|
+
if (!preview && previewStatus === 'complete') {
|
|
470
462
|
newStatus = 'complete';
|
|
471
463
|
break;
|
|
472
464
|
}
|
|
@@ -488,7 +480,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
488
480
|
});
|
|
489
481
|
useEffect(function () {
|
|
490
482
|
updateFileStateRef.current();
|
|
491
|
-
}, [fileState, updateFileStateRef]);
|
|
483
|
+
}, [fileState, preview, previewStatus, updateFileStateRef]);
|
|
492
484
|
|
|
493
485
|
//----------------------------------------------------------------//
|
|
494
486
|
//---------------------- Render Card Function --------------------//
|
|
@@ -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.7.
|
|
106
|
+
packageName: "77.7.3",
|
|
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.7.
|
|
10
|
+
var packageVersion = "77.7.3";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.7.
|
|
3
|
+
"version": "77.7.3",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
40
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
40
|
+
"@atlaskit/dropdown-menu": "^12.2.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
42
42
|
"@atlaskit/icon": "^22.0.0",
|
|
43
43
|
"@atlaskit/media-client": "^26.1.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.0.0",
|
|
46
|
-
"@atlaskit/media-file-preview": "^0.
|
|
46
|
+
"@atlaskit/media-file-preview": "^0.2.0",
|
|
47
47
|
"@atlaskit/media-ui": "^25.0.0",
|
|
48
48
|
"@atlaskit/media-viewer": "^48.2.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
50
50
|
"@atlaskit/spinner": "^16.0.0",
|
|
51
51
|
"@atlaskit/theme": "^12.6.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.1.0",
|
|
54
54
|
"@atlaskit/ufo": "^0.2.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|