@atlaskit/media-card 74.6.1 → 74.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 74.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8a0a92b2885`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a0a92b2885) - MEX-2210 improve inconsistent behaviour on timestampOnVideo playback
8
+ - [`c3eba8c788d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c3eba8c788d) - Deprecation notice: Media Card and Inline Card no longer accept a collection name as a data source for Media Viewer. Integrators should pass the full list of files to browse through the new "mediaViewerItems" property.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 74.6.1
4
15
 
5
16
  ### Patch Changes
@@ -26,6 +26,7 @@ var _mediaViewer = require("@atlaskit/media-viewer");
26
26
  var _reactIntlNext = require("react-intl-next");
27
27
  var _cardView = require("./cardView");
28
28
  var _viewportDetector = require("../utils/viewportDetector");
29
+ var _videoIsPlayable = require("../utils/videoIsPlayable");
29
30
  var _getDataURIDimension = require("../utils/getDataURIDimension");
30
31
  var _getCardPreview = require("./getCardPreview");
31
32
  var _metadata = require("../utils/metadata");
@@ -47,7 +48,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
47
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); }; }
48
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; } }
49
50
  var packageName = "@atlaskit/media-card";
50
- var packageVersion = "74.6.1";
51
+ var packageVersion = "74.7.0";
51
52
  var CardBase = /*#__PURE__*/function (_Component) {
52
53
  (0, _inherits2.default)(CardBase, _Component);
53
54
  var _super = _createSuper(CardBase);
@@ -513,6 +514,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
513
514
  mediaClient = _this$props7.mediaClient,
514
515
  identifier = _this$props7.identifier,
515
516
  mediaViewerDataSource = _this$props7.mediaViewerDataSource,
517
+ mediaViewerItems = _this$props7.mediaViewerItems,
516
518
  contextId = _this$props7.contextId,
517
519
  featureFlags = _this$props7.featureFlags;
518
520
  if (!mediaViewerSelectedItem) {
@@ -525,6 +527,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
525
527
  return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
526
528
  collectionName: collectionName,
527
529
  dataSource: dataSource,
530
+ items: mediaViewerItems,
528
531
  mediaClientConfig: mediaClient.config,
529
532
  selectedItem: mediaViewerSelectedItem,
530
533
  onClose: _this.onMediaViewerClose,
@@ -860,8 +863,10 @@ var CardBase = /*#__PURE__*/function (_Component) {
860
863
  this.unsubscribe();
861
864
  }
862
865
  var isVideo = this.fileAttributes.fileMediatype === 'video';
863
- var videoAvailableToPlay = fileState && (0, _mediaClient2.isProcessedFileState)(fileState);
864
- if (isVideo && !isPlayingFile && disableOverlay && useInlinePlayer && videoAvailableToPlay && (0, _mediaCommon.getMediaFeatureFlag)('timestampOnVideo', this.props.featureFlags)) {
866
+ var _getFileDetails2 = (0, _metadata.getFileDetails)(identifier, fileState),
867
+ mimeType = _getFileDetails2.mimeType;
868
+ var isVideoPlayable = (0, _videoIsPlayable.videoIsPlayable)(isBannedLocalPreview, fileState, mimeType);
869
+ if (isVideo && !isPlayingFile && disableOverlay && useInlinePlayer && isVideoPlayable && (0, _mediaCommon.getMediaFeatureFlag)('timestampOnVideo', this.props.featureFlags)) {
865
870
  this.setState({
866
871
  isPlayingFile: true
867
872
  });
@@ -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.6.1";
93
+ var packageVersion = "74.7.0";
94
94
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
95
95
  packageVersion: packageVersion,
96
96
  packageName: packageName,
@@ -77,7 +77,7 @@ var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Com
77
77
  }(_react.default.Component);
78
78
  (0, _defineProperty2.default)(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
79
79
  var packageName = "@atlaskit/media-card";
80
- var packageVersion = "74.6.1";
80
+ var packageVersion = "74.7.0";
81
81
  var MediaInlineAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
82
82
  packageVersion: packageVersion,
83
83
  packageName: packageName,
@@ -25,6 +25,7 @@ var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
25
25
  isSelected = _ref.isSelected,
26
26
  onClick = _ref.onClick,
27
27
  mediaViewerDataSource = _ref.mediaViewerDataSource,
28
+ mediaViewerItems = _ref.mediaViewerItems,
28
29
  intl = _ref.intl;
29
30
  var _useState = (0, _react.useState)(),
30
31
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -57,6 +58,7 @@ var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
57
58
  return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
58
59
  collectionName: identifier.collectionName || '',
59
60
  dataSource: dataSource,
61
+ items: mediaViewerItems,
60
62
  mediaClientConfig: mediaClient.mediaClientConfig,
61
63
  selectedItem: identifier,
62
64
  onClose: onMediaViewerClose
@@ -13,7 +13,7 @@ var _mediaClient = require("@atlaskit/media-client");
13
13
  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; }
14
14
  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; }
15
15
  var packageName = "@atlaskit/media-card";
16
- var packageVersion = "74.6.1";
16
+ var packageVersion = "74.7.0";
17
17
  var concurrentExperience;
18
18
  var getExperience = function getExperience(id) {
19
19
  if (!concurrentExperience) {
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.videoIsPlayable = void 0;
7
+ var _mediaClient = require("@atlaskit/media-client");
8
+ var _mediaCommon = require("@atlaskit/media-common");
9
+ var videoIsPlayable = function videoIsPlayable(isBannedLocalPreview, fileState, mimeType) {
10
+ var localPreviewAvailable = mimeType && !isBannedLocalPreview && (0, _mediaCommon.isVideoMimeTypeSupportedByBrowser)(mimeType);
11
+ var videoProcessedByServer = fileState && (0, _mediaClient.isProcessedFileState)(fileState);
12
+ return !!(localPreviewAvailable || videoProcessedByServer);
13
+ };
14
+ exports.videoIsPlayable = videoIsPlayable;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.1",
3
+ "version": "74.7.0",
4
4
  "sideEffects": false
5
5
  }
@@ -5,11 +5,12 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
5
5
  import { withMediaAnalyticsContext } from '@atlaskit/media-common';
6
6
  import DownloadIcon from '@atlaskit/icon/glyph/download';
7
7
  import { getRandomHex } from '@atlaskit/media-common';
8
- import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECENTS_COLLECTION, isImageRepresentationReady, isExternalImageIdentifier, isProcessedFileState, imageResizeModeToFileImageMode } from '@atlaskit/media-client';
8
+ import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECENTS_COLLECTION, isImageRepresentationReady, isExternalImageIdentifier, imageResizeModeToFileImageMode } from '@atlaskit/media-client';
9
9
  import { MediaViewer } from '@atlaskit/media-viewer';
10
10
  import { injectIntl, IntlProvider } from 'react-intl-next';
11
11
  import { CardView } from './cardView';
12
12
  import { ViewportDetector } from '../utils/viewportDetector';
13
+ import { videoIsPlayable } from '../utils/videoIsPlayable';
13
14
  import { getRequestedDimensions } from '../utils/getDataURIDimension';
14
15
  import { getCardPreview, getCardPreviewFromCache, removeCardPreviewFromCache, getFilePreviewFromFileState, shouldResolvePreview, getSSRCardPreview, isLocalPreview, isSSRPreview, isSSRClientPreview, isSSRDataPreview, fetchAndCacheRemotePreview } from './getCardPreview';
15
16
  import { getFileDetails } from '../utils/metadata';
@@ -26,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
26
27
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
27
28
  import { generateUniqueId } from '../utils/generateUniqueId';
28
29
  const packageName = "@atlaskit/media-card";
29
- const packageVersion = "74.6.1";
30
+ const packageVersion = "74.7.0";
30
31
  export class CardBase extends Component {
31
32
  // An internalOccurrenceKey is a randomly generated value to differentiate various instances
32
33
  // of Cards regardless of whether it shares the same file (either internal or external)
@@ -464,6 +465,7 @@ export class CardBase extends Component {
464
465
  mediaClient,
465
466
  identifier,
466
467
  mediaViewerDataSource,
468
+ mediaViewerItems,
467
469
  contextId,
468
470
  featureFlags
469
471
  } = this.props;
@@ -477,6 +479,7 @@ export class CardBase extends Component {
477
479
  return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
478
480
  collectionName: collectionName,
479
481
  dataSource: dataSource,
482
+ items: mediaViewerItems,
480
483
  mediaClientConfig: mediaClient.config,
481
484
  selectedItem: mediaViewerSelectedItem,
482
485
  onClose: this.onMediaViewerClose,
@@ -834,8 +837,11 @@ export class CardBase extends Component {
834
837
  this.unsubscribe();
835
838
  }
836
839
  const isVideo = this.fileAttributes.fileMediatype === 'video';
837
- const videoAvailableToPlay = fileState && isProcessedFileState(fileState);
838
- if (isVideo && !isPlayingFile && disableOverlay && useInlinePlayer && videoAvailableToPlay && getMediaFeatureFlag('timestampOnVideo', this.props.featureFlags)) {
840
+ const {
841
+ mimeType
842
+ } = getFileDetails(identifier, fileState);
843
+ const isVideoPlayable = videoIsPlayable(isBannedLocalPreview, fileState, mimeType);
844
+ if (isVideo && !isPlayingFile && disableOverlay && useInlinePlayer && isVideoPlayable && getMediaFeatureFlag('timestampOnVideo', this.props.featureFlags)) {
839
845
  this.setState({
840
846
  isPlayingFile: true
841
847
  });
@@ -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.6.1";
69
+ const packageVersion = "74.7.0";
70
70
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
71
71
  packageVersion,
72
72
  packageName,
@@ -54,7 +54,7 @@ class WrappedMediaInlineAnalyticsErrorBoundary extends React.Component {
54
54
  }
55
55
  _defineProperty(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
56
56
  const packageName = "@atlaskit/media-card";
57
- const packageVersion = "74.6.1";
57
+ const packageVersion = "74.7.0";
58
58
  const MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
59
59
  packageVersion,
60
60
  packageName,
@@ -14,6 +14,7 @@ export const MediaInlineCardInternal = ({
14
14
  isSelected,
15
15
  onClick,
16
16
  mediaViewerDataSource,
17
+ mediaViewerItems,
17
18
  intl
18
19
  }) => {
19
20
  const [fileState, setFileState] = useState();
@@ -36,6 +37,7 @@ export const MediaInlineCardInternal = ({
36
37
  return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
37
38
  collectionName: identifier.collectionName || '',
38
39
  dataSource: dataSource,
40
+ items: mediaViewerItems,
39
41
  mediaClientConfig: mediaClient.mediaClientConfig,
40
42
  selectedItem: identifier,
41
43
  onClose: onMediaViewerClose
@@ -3,7 +3,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KE
3
3
  import { MediaCardError } from '../errors';
4
4
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
5
5
  const packageName = "@atlaskit/media-card";
6
- const packageVersion = "74.6.1";
6
+ const packageVersion = "74.7.0";
7
7
  let concurrentExperience;
8
8
  const getExperience = id => {
9
9
  if (!concurrentExperience) {
@@ -0,0 +1,7 @@
1
+ import { isProcessedFileState } from '@atlaskit/media-client';
2
+ import { isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
3
+ export const videoIsPlayable = (isBannedLocalPreview, fileState, mimeType) => {
4
+ const localPreviewAvailable = mimeType && !isBannedLocalPreview && isVideoMimeTypeSupportedByBrowser(mimeType);
5
+ const videoProcessedByServer = fileState && isProcessedFileState(fileState);
6
+ return !!(localPreviewAvailable || videoProcessedByServer);
7
+ };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.1",
3
+ "version": "74.7.0",
4
4
  "sideEffects": false
5
5
  }
@@ -18,11 +18,12 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
18
18
  import { withMediaAnalyticsContext } from '@atlaskit/media-common';
19
19
  import DownloadIcon from '@atlaskit/icon/glyph/download';
20
20
  import { getRandomHex } from '@atlaskit/media-common';
21
- import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECENTS_COLLECTION, isImageRepresentationReady, isExternalImageIdentifier, isProcessedFileState, imageResizeModeToFileImageMode } from '@atlaskit/media-client';
21
+ import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECENTS_COLLECTION, isImageRepresentationReady, isExternalImageIdentifier, imageResizeModeToFileImageMode } from '@atlaskit/media-client';
22
22
  import { MediaViewer } from '@atlaskit/media-viewer';
23
23
  import { injectIntl, IntlProvider } from 'react-intl-next';
24
24
  import { CardView } from './cardView';
25
25
  import { ViewportDetector } from '../utils/viewportDetector';
26
+ import { videoIsPlayable } from '../utils/videoIsPlayable';
26
27
  import { getRequestedDimensions } from '../utils/getDataURIDimension';
27
28
  import { getCardPreview, getCardPreviewFromCache, removeCardPreviewFromCache, getFilePreviewFromFileState, shouldResolvePreview, getSSRCardPreview, isLocalPreview, isSSRPreview, isSSRClientPreview, isSSRDataPreview, fetchAndCacheRemotePreview } from './getCardPreview';
28
29
  import { getFileDetails } from '../utils/metadata';
@@ -39,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
39
40
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
40
41
  import { generateUniqueId } from '../utils/generateUniqueId';
41
42
  var packageName = "@atlaskit/media-card";
42
- var packageVersion = "74.6.1";
43
+ var packageVersion = "74.7.0";
43
44
  export var CardBase = /*#__PURE__*/function (_Component) {
44
45
  _inherits(CardBase, _Component);
45
46
  var _super = _createSuper(CardBase);
@@ -505,6 +506,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
505
506
  mediaClient = _this$props7.mediaClient,
506
507
  identifier = _this$props7.identifier,
507
508
  mediaViewerDataSource = _this$props7.mediaViewerDataSource,
509
+ mediaViewerItems = _this$props7.mediaViewerItems,
508
510
  contextId = _this$props7.contextId,
509
511
  featureFlags = _this$props7.featureFlags;
510
512
  if (!mediaViewerSelectedItem) {
@@ -517,6 +519,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
517
519
  return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
518
520
  collectionName: collectionName,
519
521
  dataSource: dataSource,
522
+ items: mediaViewerItems,
520
523
  mediaClientConfig: mediaClient.config,
521
524
  selectedItem: mediaViewerSelectedItem,
522
525
  onClose: _this.onMediaViewerClose,
@@ -852,8 +855,10 @@ export var CardBase = /*#__PURE__*/function (_Component) {
852
855
  this.unsubscribe();
853
856
  }
854
857
  var isVideo = this.fileAttributes.fileMediatype === 'video';
855
- var videoAvailableToPlay = fileState && isProcessedFileState(fileState);
856
- if (isVideo && !isPlayingFile && disableOverlay && useInlinePlayer && videoAvailableToPlay && getMediaFeatureFlag('timestampOnVideo', this.props.featureFlags)) {
858
+ var _getFileDetails2 = getFileDetails(identifier, fileState),
859
+ mimeType = _getFileDetails2.mimeType;
860
+ var isVideoPlayable = videoIsPlayable(isBannedLocalPreview, fileState, mimeType);
861
+ if (isVideo && !isPlayingFile && disableOverlay && useInlinePlayer && isVideoPlayable && getMediaFeatureFlag('timestampOnVideo', this.props.featureFlags)) {
857
862
  this.setState({
858
863
  isPlayingFile: true
859
864
  });
@@ -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.6.1";
86
+ var packageVersion = "74.7.0";
87
87
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
88
88
  packageVersion: packageVersion,
89
89
  packageName: packageName,
@@ -70,7 +70,7 @@ var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Com
70
70
  }(React.Component);
71
71
  _defineProperty(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
72
72
  var packageName = "@atlaskit/media-card";
73
- var packageVersion = "74.6.1";
73
+ var packageVersion = "74.7.0";
74
74
  var MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
75
75
  packageVersion: packageVersion,
76
76
  packageName: packageName,
@@ -15,6 +15,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
15
15
  isSelected = _ref.isSelected,
16
16
  onClick = _ref.onClick,
17
17
  mediaViewerDataSource = _ref.mediaViewerDataSource,
18
+ mediaViewerItems = _ref.mediaViewerItems,
18
19
  intl = _ref.intl;
19
20
  var _useState = useState(),
20
21
  _useState2 = _slicedToArray(_useState, 2),
@@ -47,6 +48,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
47
48
  return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
48
49
  collectionName: identifier.collectionName || '',
49
50
  dataSource: dataSource,
51
+ items: mediaViewerItems,
50
52
  mediaClientConfig: mediaClient.mediaClientConfig,
51
53
  selectedItem: identifier,
52
54
  onClose: onMediaViewerClose
@@ -6,7 +6,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KE
6
6
  import { MediaCardError } from '../errors';
7
7
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
8
8
  var packageName = "@atlaskit/media-card";
9
- var packageVersion = "74.6.1";
9
+ var packageVersion = "74.7.0";
10
10
  var concurrentExperience;
11
11
  var getExperience = function getExperience(id) {
12
12
  if (!concurrentExperience) {
@@ -0,0 +1,7 @@
1
+ import { isProcessedFileState } from '@atlaskit/media-client';
2
+ import { isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
3
+ export var videoIsPlayable = function videoIsPlayable(isBannedLocalPreview, fileState, mimeType) {
4
+ var localPreviewAvailable = mimeType && !isBannedLocalPreview && isVideoMimeTypeSupportedByBrowser(mimeType);
5
+ var videoProcessedByServer = fileState && isProcessedFileState(fileState);
6
+ return !!(localPreviewAvailable || videoProcessedByServer);
7
+ };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.1",
3
+ "version": "74.7.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FileIdentifier, MediaClient } from '@atlaskit/media-client';
2
+ import { FileIdentifier, Identifier, MediaClient } from '@atlaskit/media-client';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
4
  import { MediaViewerDataSource } from '@atlaskit/media-viewer';
5
5
  export interface MediaInlineCardProps {
@@ -8,7 +8,14 @@ export interface MediaInlineCardProps {
8
8
  shouldOpenMediaViewer?: boolean;
9
9
  isSelected?: boolean;
10
10
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
11
+ /**
12
+ * Includes data source like collection name,
13
+ * media file list.
14
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-149 Internal documentation for deprecation (no external access)}}
15
+ * Use mediaViewerItems instead
16
+ */
11
17
  mediaViewerDataSource?: MediaViewerDataSource;
18
+ mediaViewerItems?: Identifier[];
12
19
  }
13
20
  export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
14
21
  export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
@@ -75,10 +75,14 @@ export interface CardProps extends SharedCardProps, CardEventProps {
75
75
  readonly isLazy?: boolean;
76
76
  readonly useInlinePlayer?: boolean;
77
77
  readonly shouldOpenMediaViewer?: boolean;
78
- /** Imported from MediaViewer. It includes data source like collection name,
79
- * media file list.
78
+ /**
79
+ * Includes data source like collection name,
80
+ * media file list.
81
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-149 Internal documentation for deprecation (no external access)}}
82
+ * Use mediaViewerItems instead
80
83
  */
81
84
  readonly mediaViewerDataSource?: MediaViewerDataSource;
85
+ readonly mediaViewerItems?: Identifier[];
82
86
  readonly contextId?: string;
83
87
  readonly shouldEnableDownloadButton?: boolean;
84
88
  readonly ssr?: SSR;
@@ -0,0 +1,2 @@
1
+ import { FileState } from '@atlaskit/media-client';
2
+ export declare const videoIsPlayable: (isBannedLocalPreview: boolean, fileState?: FileState | undefined, mimeType?: string | undefined) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.1",
3
+ "version": "74.7.0",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,17 +29,17 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/analytics-next": "^9.0.0",
32
- "@atlaskit/dropdown-menu": "^11.6.0",
32
+ "@atlaskit/dropdown-menu": "^11.7.0",
33
33
  "@atlaskit/editor-shared-styles": "^2.3.0",
34
34
  "@atlaskit/icon": "^21.11.0",
35
- "@atlaskit/media-client": "^20.0.0",
36
- "@atlaskit/media-common": "^2.19.0",
35
+ "@atlaskit/media-client": "^20.1.0",
36
+ "@atlaskit/media-common": "^3.0.0",
37
37
  "@atlaskit/media-ui": "^22.3.0",
38
- "@atlaskit/media-viewer": "^47.4.0",
39
- "@atlaskit/spinner": "^15.3.0",
38
+ "@atlaskit/media-viewer": "^47.5.0",
39
+ "@atlaskit/spinner": "^15.4.0",
40
40
  "@atlaskit/theme": "^12.2.0",
41
41
  "@atlaskit/tokens": "^1.2.0",
42
- "@atlaskit/tooltip": "^17.6.0",
42
+ "@atlaskit/tooltip": "^17.7.0",
43
43
  "@atlaskit/ufo": "^0.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "classnames": "^2.2.5",
package/report.api.md CHANGED
@@ -148,8 +148,11 @@ export interface CardProps extends SharedCardProps, CardEventProps {
148
148
  readonly isLazy?: boolean;
149
149
  // (undocumented)
150
150
  readonly mediaClient: MediaClient;
151
+ // @deprecated
151
152
  readonly mediaViewerDataSource?: MediaViewerDataSource;
152
153
  // (undocumented)
154
+ readonly mediaViewerItems?: Identifier[];
155
+ // (undocumented)
153
156
  readonly shouldEnableDownloadButton?: boolean;
154
157
  // (undocumented)
155
158
  readonly shouldOpenMediaViewer?: boolean;
@@ -311,9 +314,11 @@ interface MediaInlineCardProps {
311
314
  isSelected?: boolean;
312
315
  // (undocumented)
313
316
  mediaClient: MediaClient;
314
- // (undocumented)
317
+ // @deprecated
315
318
  mediaViewerDataSource?: MediaViewerDataSource;
316
319
  // (undocumented)
320
+ mediaViewerItems?: Identifier[];
321
+ // (undocumented)
317
322
  onClick?: React_2.EventHandler<React_2.KeyboardEvent | React_2.MouseEvent>;
318
323
  // (undocumented)
319
324
  shouldOpenMediaViewer?: boolean;