@atlaskit/media-card 74.6.0 → 74.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 74.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`489f7b32ff6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/489f7b32ff6) - Fixed broken SSR error handling logic when the preview url fails to load
8
+
3
9
  ## 74.6.0
4
10
 
5
11
  ### Minor Changes
@@ -47,7 +47,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
47
47
  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
48
  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
49
  var packageName = "@atlaskit/media-card";
50
- var packageVersion = "74.6.0";
50
+ var packageVersion = "74.6.1";
51
51
  var CardBase = /*#__PURE__*/function (_Component) {
52
52
  (0, _inherits2.default)(CardBase, _Component);
53
53
  var _super = _createSuper(CardBase);
@@ -767,7 +767,8 @@ var CardBase = /*#__PURE__*/function (_Component) {
767
767
  var prevMediaClient = prevProps.mediaClient,
768
768
  prevIdentifier = prevProps.identifier,
769
769
  prevDimensions = prevProps.dimensions;
770
- var prevIsCardVisible = prevState.isCardVisible;
770
+ var prevIsCardVisible = prevState.isCardVisible,
771
+ prevCardPreview = prevState.cardPreview;
771
772
  var _this$props12 = this.props,
772
773
  mediaClient = _this$props12.mediaClient,
773
774
  identifier = _this$props12.identifier,
@@ -775,7 +776,8 @@ var CardBase = /*#__PURE__*/function (_Component) {
775
776
  featureFlags = _this$props12.featureFlags,
776
777
  useInlinePlayer = _this$props12.useInlinePlayer,
777
778
  disableOverlay = _this$props12.disableOverlay,
778
- resizeMode = _this$props12.resizeMode;
779
+ resizeMode = _this$props12.resizeMode,
780
+ ssr = _this$props12.ssr;
779
781
  var _this$state4 = this.state,
780
782
  isCardVisible = _this$state4.isCardVisible,
781
783
  cardPreview = _this$state4.cardPreview,
@@ -799,6 +801,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
799
801
  * ----------------------------------------------------
800
802
  */
801
803
  var turnedVisible = !prevIsCardVisible && isCardVisible;
804
+ var hadSSRCardPreview = !!prevCardPreview && (0, _getCardPreview.isSSRClientPreview)(prevCardPreview) && !cardPreview;
802
805
  var isNewMediaClient = prevMediaClient !== mediaClient;
803
806
  var fileImageMode = (0, _mediaClient2.imageResizeModeToFileImageMode)(resizeMode);
804
807
  this.updateFileStateFlag(fileState);
@@ -824,8 +827,10 @@ var CardBase = /*#__PURE__*/function (_Component) {
824
827
  this.fireScreenEvent();
825
828
  }
826
829
  }
827
- if ((0, _mediaClient2.isFileIdentifier)(identifier) && turnedVisible && !cardPreview && !wasResolvedUpfrontPreview) {
828
- // This is a one-off call, only meant to happen when turnedVisible = true (only once in the component's lifecycle)
830
+ if ((0, _mediaClient2.isFileIdentifier)(identifier) && (turnedVisible || ssr === 'client' && hadSSRCardPreview) && !cardPreview && !wasResolvedUpfrontPreview) {
831
+ // This is a one-off call, only meant to happen once in the component's lifecycle. Mainly when either:
832
+ // - turnedVisible = true
833
+ // - ssr = client and has no preview (the dataURI failed to load in the previous state, most likely because of an initial auth issue)
829
834
  this.resolveUpfrontPreview(identifier);
830
835
  } else if ((0, _mediaClient2.isFileIdentifier)(identifier) && fileState && (0, _getCardPreview.shouldResolvePreview)({
831
836
  status: status,
@@ -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.0";
93
+ var packageVersion = "74.6.1";
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.0";
80
+ var packageVersion = "74.6.1";
81
81
  var MediaInlineAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
82
82
  packageVersion: packageVersion,
83
83
  packageName: packageName,
@@ -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.0";
16
+ var packageVersion = "74.6.1";
17
17
  var concurrentExperience;
18
18
  var getExperience = function getExperience(id) {
19
19
  if (!concurrentExperience) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.0",
3
+ "version": "74.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -26,7 +26,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
26
26
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
27
27
  import { generateUniqueId } from '../utils/generateUniqueId';
28
28
  const packageName = "@atlaskit/media-card";
29
- const packageVersion = "74.6.0";
29
+ const packageVersion = "74.6.1";
30
30
  export class CardBase extends Component {
31
31
  // An internalOccurrenceKey is a randomly generated value to differentiate various instances
32
32
  // of Cards regardless of whether it shares the same file (either internal or external)
@@ -736,7 +736,8 @@ export class CardBase extends Component {
736
736
  dimensions: prevDimensions
737
737
  } = prevProps;
738
738
  const {
739
- isCardVisible: prevIsCardVisible
739
+ isCardVisible: prevIsCardVisible,
740
+ cardPreview: prevCardPreview
740
741
  } = prevState;
741
742
  const {
742
743
  mediaClient,
@@ -745,7 +746,8 @@ export class CardBase extends Component {
745
746
  featureFlags,
746
747
  useInlinePlayer,
747
748
  disableOverlay,
748
- resizeMode
749
+ resizeMode,
750
+ ssr
749
751
  } = this.props;
750
752
  const {
751
753
  isCardVisible,
@@ -771,6 +773,7 @@ export class CardBase extends Component {
771
773
  * ----------------------------------------------------
772
774
  */
773
775
  const turnedVisible = !prevIsCardVisible && isCardVisible;
776
+ const hadSSRCardPreview = !!prevCardPreview && isSSRClientPreview(prevCardPreview) && !cardPreview;
774
777
  const isNewMediaClient = prevMediaClient !== mediaClient;
775
778
  const fileImageMode = imageResizeModeToFileImageMode(resizeMode);
776
779
  this.updateFileStateFlag(fileState);
@@ -798,8 +801,10 @@ export class CardBase extends Component {
798
801
  this.fireScreenEvent();
799
802
  }
800
803
  }
801
- if (isFileIdentifier(identifier) && turnedVisible && !cardPreview && !wasResolvedUpfrontPreview) {
802
- // This is a one-off call, only meant to happen when turnedVisible = true (only once in the component's lifecycle)
804
+ if (isFileIdentifier(identifier) && (turnedVisible || ssr === 'client' && hadSSRCardPreview) && !cardPreview && !wasResolvedUpfrontPreview) {
805
+ // This is a one-off call, only meant to happen once in the component's lifecycle. Mainly when either:
806
+ // - turnedVisible = true
807
+ // - ssr = client and has no preview (the dataURI failed to load in the previous state, most likely because of an initial auth issue)
803
808
  this.resolveUpfrontPreview(identifier);
804
809
  } else if (isFileIdentifier(identifier) && fileState && shouldResolvePreview({
805
810
  status,
@@ -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.0";
69
+ const packageVersion = "74.6.1";
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.0";
57
+ const packageVersion = "74.6.1";
58
58
  const MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
59
59
  packageVersion,
60
60
  packageName,
@@ -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.0";
6
+ const packageVersion = "74.6.1";
7
7
  let concurrentExperience;
8
8
  const getExperience = id => {
9
9
  if (!concurrentExperience) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.0",
3
+ "version": "74.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -39,7 +39,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
39
39
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
40
40
  import { generateUniqueId } from '../utils/generateUniqueId';
41
41
  var packageName = "@atlaskit/media-card";
42
- var packageVersion = "74.6.0";
42
+ var packageVersion = "74.6.1";
43
43
  export var CardBase = /*#__PURE__*/function (_Component) {
44
44
  _inherits(CardBase, _Component);
45
45
  var _super = _createSuper(CardBase);
@@ -759,7 +759,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
759
759
  var prevMediaClient = prevProps.mediaClient,
760
760
  prevIdentifier = prevProps.identifier,
761
761
  prevDimensions = prevProps.dimensions;
762
- var prevIsCardVisible = prevState.isCardVisible;
762
+ var prevIsCardVisible = prevState.isCardVisible,
763
+ prevCardPreview = prevState.cardPreview;
763
764
  var _this$props12 = this.props,
764
765
  mediaClient = _this$props12.mediaClient,
765
766
  identifier = _this$props12.identifier,
@@ -767,7 +768,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
767
768
  featureFlags = _this$props12.featureFlags,
768
769
  useInlinePlayer = _this$props12.useInlinePlayer,
769
770
  disableOverlay = _this$props12.disableOverlay,
770
- resizeMode = _this$props12.resizeMode;
771
+ resizeMode = _this$props12.resizeMode,
772
+ ssr = _this$props12.ssr;
771
773
  var _this$state4 = this.state,
772
774
  isCardVisible = _this$state4.isCardVisible,
773
775
  cardPreview = _this$state4.cardPreview,
@@ -791,6 +793,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
791
793
  * ----------------------------------------------------
792
794
  */
793
795
  var turnedVisible = !prevIsCardVisible && isCardVisible;
796
+ var hadSSRCardPreview = !!prevCardPreview && isSSRClientPreview(prevCardPreview) && !cardPreview;
794
797
  var isNewMediaClient = prevMediaClient !== mediaClient;
795
798
  var fileImageMode = imageResizeModeToFileImageMode(resizeMode);
796
799
  this.updateFileStateFlag(fileState);
@@ -816,8 +819,10 @@ export var CardBase = /*#__PURE__*/function (_Component) {
816
819
  this.fireScreenEvent();
817
820
  }
818
821
  }
819
- if (isFileIdentifier(identifier) && turnedVisible && !cardPreview && !wasResolvedUpfrontPreview) {
820
- // This is a one-off call, only meant to happen when turnedVisible = true (only once in the component's lifecycle)
822
+ if (isFileIdentifier(identifier) && (turnedVisible || ssr === 'client' && hadSSRCardPreview) && !cardPreview && !wasResolvedUpfrontPreview) {
823
+ // This is a one-off call, only meant to happen once in the component's lifecycle. Mainly when either:
824
+ // - turnedVisible = true
825
+ // - ssr = client and has no preview (the dataURI failed to load in the previous state, most likely because of an initial auth issue)
821
826
  this.resolveUpfrontPreview(identifier);
822
827
  } else if (isFileIdentifier(identifier) && fileState && shouldResolvePreview({
823
828
  status: status,
@@ -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.0";
86
+ var packageVersion = "74.6.1";
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.0";
73
+ var packageVersion = "74.6.1";
74
74
  var MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
75
75
  packageVersion: packageVersion,
76
76
  packageName: packageName,
@@ -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.0";
9
+ var packageVersion = "74.6.1";
10
10
  var concurrentExperience;
11
11
  var getExperience = function getExperience(id) {
12
12
  if (!concurrentExperience) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.0",
3
+ "version": "74.6.1",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.6.0",
3
+ "version": "74.6.1",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/analytics-next": "^9.0.0",
32
- "@atlaskit/dropdown-menu": "^11.5.0",
32
+ "@atlaskit/dropdown-menu": "^11.6.0",
33
33
  "@atlaskit/editor-shared-styles": "^2.3.0",
34
34
  "@atlaskit/icon": "^21.11.0",
35
35
  "@atlaskit/media-client": "^20.0.0",