@atlaskit/media-card 77.1.0 → 77.1.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
+ ## 77.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#41101](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41101) [`eeafdcc5924`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eeafdcc5924) - fix platform FF not working for mediaCardV2 in SSR
8
+
3
9
  ## 77.1.0
4
10
 
5
11
  ### Minor Changes
@@ -49,7 +49,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
49
49
  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); }; }
50
50
  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; } }
51
51
  var packageName = "@atlaskit/media-card";
52
- var packageVersion = "77.1.0";
52
+ var packageVersion = "77.1.1";
53
53
  var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
54
54
  (0, _inherits2.default)(CardBase, _Component);
55
55
  var _super = _createSuper(CardBase);
@@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
8
9
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
10
  var _cardLoader = _interopRequireDefault(require("./cardLoader"));
10
11
  var _cardV2Loader = _interopRequireDefault(require("./v2/cardV2Loader"));
11
- var _default = exports.default = (0, _platformFeatureFlags.getBooleanFF)('platform.media-experience.cardv2_7zann') ? _cardV2Loader.default : _cardLoader.default;
12
+ function CardSwitcher(props) {
13
+ return (0, _platformFeatureFlags.getBooleanFF)('platform.media-experience.cardv2_7zann') ? /*#__PURE__*/_react.default.createElement(_cardV2Loader.default, props) : /*#__PURE__*/_react.default.createElement(_cardLoader.default, props);
14
+ }
15
+ var _default = exports.default = CardSwitcher;
@@ -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.1.0";
93
+ var packageVersion = "77.1.1";
94
94
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
95
95
  packageVersion: packageVersion,
96
96
  packageName: packageName,
@@ -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.1.0";
53
+ var packageVersion = "77.1.1";
54
54
  var CardV2Base = exports.CardV2Base = /*#__PURE__*/function (_Component) {
55
55
  (0, _inherits2.default)(CardV2Base, _Component);
56
56
  var _super = _createSuper(CardV2Base);
@@ -694,7 +694,7 @@ var CardV2Base = exports.CardV2Base = /*#__PURE__*/function (_Component) {
694
694
  previewDidRender: false,
695
695
  error: _error,
696
696
  wasResolvedUpfrontPreview: false,
697
- shouldUpdateStateForIdentifier: false
697
+ shouldUpdateStateForIdentifier: _isCardVisible && (0, _mediaClient2.isFileIdentifier)(_identifier)
698
698
  };
699
699
  return _this;
700
700
  }
@@ -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.1.0",
122
+ packageName: "77.1.1",
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.1.0";
17
+ var packageVersion = "77.1.1";
18
18
  var concurrentExperience;
19
19
  var getExperience = function getExperience(id) {
20
20
  if (!concurrentExperience) {
@@ -27,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
27
27
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
28
28
  import { generateUniqueId } from '../utils/generateUniqueId';
29
29
  const packageName = "@atlaskit/media-card";
30
- const packageVersion = "77.1.0";
30
+ const packageVersion = "77.1.1";
31
31
  export class CardBase extends Component {
32
32
  constructor(props) {
33
33
  super(props);
@@ -1,4 +1,8 @@
1
+ import React from 'react';
1
2
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
3
  import CardLoader from './cardLoader';
3
4
  import CardV2Loader from './v2/cardV2Loader';
4
- export default getBooleanFF('platform.media-experience.cardv2_7zann') ? CardV2Loader : CardLoader;
5
+ function CardSwitcher(props) {
6
+ return getBooleanFF('platform.media-experience.cardv2_7zann') ? /*#__PURE__*/React.createElement(CardV2Loader, props) : /*#__PURE__*/React.createElement(CardLoader, props);
7
+ }
8
+ export default CardSwitcher;
@@ -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.1.0";
69
+ const packageVersion = "77.1.1";
70
70
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
71
71
  packageVersion,
72
72
  packageName,
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience } from '../../utils/ufoExperi
28
28
  import { generateUniqueId } from '../../utils/generateUniqueId';
29
29
  import { useFileState } from '@atlaskit/media-client-react';
30
30
  const packageName = "@atlaskit/media-card";
31
- const packageVersion = "77.1.0";
31
+ const packageVersion = "77.1.1";
32
32
  export class CardV2Base extends Component {
33
33
  constructor(props) {
34
34
  super(props);
@@ -672,7 +672,7 @@ export class CardV2Base extends Component {
672
672
  previewDidRender: false,
673
673
  error: _error,
674
674
  wasResolvedUpfrontPreview: false,
675
- shouldUpdateStateForIdentifier: false
675
+ shouldUpdateStateForIdentifier: _isCardVisible && isFileIdentifier(_identifier)
676
676
  };
677
677
  }
678
678
  getSSRPreview(ssr, identifier, mediaClient) {
@@ -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.1.0",
40
+ packageName: "77.1.1",
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.1.0";
7
+ const packageVersion = "77.1.1";
8
8
  let concurrentExperience;
9
9
  const getExperience = id => {
10
10
  if (!concurrentExperience) {
@@ -40,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
40
40
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
41
41
  import { generateUniqueId } from '../utils/generateUniqueId';
42
42
  var packageName = "@atlaskit/media-card";
43
- var packageVersion = "77.1.0";
43
+ var packageVersion = "77.1.1";
44
44
  export var CardBase = /*#__PURE__*/function (_Component) {
45
45
  _inherits(CardBase, _Component);
46
46
  var _super = _createSuper(CardBase);
@@ -1,4 +1,8 @@
1
+ import React from 'react';
1
2
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
3
  import CardLoader from './cardLoader';
3
4
  import CardV2Loader from './v2/cardV2Loader';
4
- export default getBooleanFF('platform.media-experience.cardv2_7zann') ? CardV2Loader : CardLoader;
5
+ function CardSwitcher(props) {
6
+ return getBooleanFF('platform.media-experience.cardv2_7zann') ? /*#__PURE__*/React.createElement(CardV2Loader, props) : /*#__PURE__*/React.createElement(CardLoader, props);
7
+ }
8
+ export default CardSwitcher;
@@ -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.1.0";
86
+ var packageVersion = "77.1.1";
87
87
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
88
88
  packageVersion: packageVersion,
89
89
  packageName: packageName,
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience } from '../../utils/ufoExperi
41
41
  import { generateUniqueId } from '../../utils/generateUniqueId';
42
42
  import { useFileState } from '@atlaskit/media-client-react';
43
43
  var packageName = "@atlaskit/media-card";
44
- var packageVersion = "77.1.0";
44
+ var packageVersion = "77.1.1";
45
45
  export var CardV2Base = /*#__PURE__*/function (_Component) {
46
46
  _inherits(CardV2Base, _Component);
47
47
  var _super = _createSuper(CardV2Base);
@@ -685,7 +685,7 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
685
685
  previewDidRender: false,
686
686
  error: _error,
687
687
  wasResolvedUpfrontPreview: false,
688
- shouldUpdateStateForIdentifier: false
688
+ shouldUpdateStateForIdentifier: _isCardVisible && isFileIdentifier(_identifier)
689
689
  };
690
690
  return _this;
691
691
  }
@@ -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.1.0",
106
+ packageName: "77.1.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.1.0";
10
+ var packageVersion = "77.1.1";
11
11
  var concurrentExperience;
12
12
  var getExperience = function getExperience(id) {
13
13
  if (!concurrentExperience) {
@@ -1,3 +1,4 @@
1
1
  /// <reference types="react" />
2
- declare const _default: import("react").FC<import("./cardLoader").CardWithMediaClientConfigProps>;
3
- export default _default;
2
+ import { CardWithMediaClientConfigProps } from './cardLoader';
3
+ declare function CardSwitcher(props: CardWithMediaClientConfigProps): JSX.Element;
4
+ export default CardSwitcher;
@@ -1,3 +1,4 @@
1
1
  /// <reference types="react" />
2
- declare const _default: import("react").FC<import("./cardLoader").CardWithMediaClientConfigProps>;
3
- export default _default;
2
+ import { CardWithMediaClientConfigProps } from './cardLoader';
3
+ declare function CardSwitcher(props: CardWithMediaClientConfigProps): JSX.Element;
4
+ export default CardSwitcher;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "77.1.0",
3
+ "version": "77.1.1",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -18,7 +18,6 @@
18
18
  /// <reference types="react" />
19
19
 
20
20
  import { Component } from 'react';
21
- import { FC } from 'react';
22
21
  import { FileDetails } from '@atlaskit/media-client';
23
22
  import { FileIdentifier } from '@atlaskit/media-client';
24
23
  import { FileItem } from '@atlaskit/media-client';
@@ -38,7 +37,7 @@ import { WithMediaClientConfigProps } from '@atlaskit/media-client';
38
37
  import { WrappedComponentProps } from 'react-intl-next';
39
38
 
40
39
  // @public (undocumented)
41
- export const Card: FC<CardWithMediaClientConfigProps>;
40
+ export function Card(props: CardWithMediaClientConfigProps): JSX.Element;
42
41
 
43
42
  // @public (undocumented)
44
43
  export interface CardAction {
@@ -7,7 +7,6 @@
7
7
  /// <reference types="react" />
8
8
 
9
9
  import { Component } from 'react';
10
- import { FC } from 'react';
11
10
  import { FileDetails } from '@atlaskit/media-client';
12
11
  import { FileIdentifier } from '@atlaskit/media-client';
13
12
  import { FileItem } from '@atlaskit/media-client';
@@ -27,7 +26,7 @@ import { WithMediaClientConfigProps } from '@atlaskit/media-client';
27
26
  import { WrappedComponentProps } from 'react-intl-next';
28
27
 
29
28
  // @public (undocumented)
30
- export const Card: FC<CardWithMediaClientConfigProps>;
29
+ export function Card(props: CardWithMediaClientConfigProps): JSX.Element;
31
30
 
32
31
  // @public (undocumented)
33
32
  export interface CardAction {