@atlaskit/media-card 79.4.4 → 79.4.5

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
+ ## 79.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 79.4.4
4
10
 
5
11
  ### Patch Changes
@@ -20,7 +20,7 @@ var _label = _interopRequireDefault(require("@atlaskit/react-ufo/label"));
20
20
  var _excluded = ["identifier"];
21
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
22
  var packageName = "@atlaskit/media-card";
23
- var packageVersion = "79.4.3";
23
+ var packageVersion = "79.4.4";
24
24
  var CardBase = exports.CardBase = function CardBase(_ref) {
25
25
  var identifier = _ref.identifier,
26
26
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -433,9 +433,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
433
433
  }
434
434
 
435
435
  // Abort VC when click file card
436
- if ((0, _platformFeatureFlags.fg)('platform_abort_vc_click_file_card')) {
437
- pressTracing();
438
- }
436
+ pressTracing();
439
437
  };
440
438
 
441
439
  //----------------------------------------------------------------//
@@ -87,7 +87,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
87
87
  }(_react.default.Component);
88
88
  (0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
89
89
  var packageName = "@atlaskit/media-card";
90
- var packageVersion = "79.4.3";
90
+ var packageVersion = "79.4.4";
91
91
 
92
92
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
93
93
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
@@ -116,7 +116,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
116
116
  ErrorBoundary = _this$state.ErrorBoundary;
117
117
  var analyticsContext = {
118
118
  packageVersion: "@atlaskit/media-card",
119
- packageName: "79.4.3",
119
+ packageName: "79.4.4",
120
120
  componentName: 'mediaInlineCard',
121
121
  component: 'mediaInlineCard'
122
122
  };
@@ -21,7 +21,6 @@ var _errors = require("../errors");
21
21
  var _analytics = require("../utils/analytics");
22
22
  var _mediaInlineCardAnalytics = require("./mediaInlineCardAnalytics");
23
23
  var _mediaClientReact = require("@atlaskit/media-client-react");
24
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
24
  var _usePressTracing = _interopRequireDefault(require("@atlaskit/react-ufo/use-press-tracing"));
26
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
27
26
  // UI component which renders an inline link in the appropiate state based on a media file
@@ -61,6 +60,9 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
61
60
  var fireFailedOperationalEvent = function fireFailedOperationalEvent() {
62
61
  var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _errors.MediaCardError('missing-error-data');
63
62
  var failReason = arguments.length > 1 ? arguments[1] : undefined;
63
+ if (isFailedEventSent) {
64
+ return;
65
+ }
64
66
  var payload = failReason ? (0, _mediaInlineCardAnalytics.getFailedProcessingStatusPayload)(identifier.id, fileState) : (0, _mediaInlineCardAnalytics.getErrorStatusPayload)(identifier.id, error, fileState);
65
67
  setIsFailedEventSent(true);
66
68
  (0, _analytics.fireMediaCardEvent)(payload, createAnalyticsEvent);
@@ -87,9 +89,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
87
89
  }
88
90
 
89
91
  // Abort VC when click media inline card
90
- if ((0, _platformFeatureFlags.fg)('platform_abort_vc_click_file_card')) {
91
- pressTracing();
92
- }
92
+ pressTracing();
93
93
  };
94
94
  var onMediaViewerClose = function onMediaViewerClose() {
95
95
  return setMediaViewerVisible(false);
@@ -134,21 +134,23 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
134
134
  if (subscribeError) {
135
135
  var errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? _mediaUi.messages.failed_to_upload : _mediaUi.messages.couldnt_load_file;
136
136
  var errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
137
- !isFailedEventSent && fireFailedOperationalEvent(new _errors.MediaCardError(errorReason, subscribeError));
138
- return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
137
+ fireFailedOperationalEvent(new _errors.MediaCardError(errorReason, subscribeError));
138
+ return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
139
139
  innerRef: copyNodeRef,
140
140
  message: (intl || defaultIntl).formatMessage(errorMessage),
141
- isSelected: isSelected
142
- });
141
+ isSelected: isSelected,
142
+ onClick: onMediaInlineCardClick
143
+ }), renderMediaViewer()));
143
144
  }
144
145
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
145
146
  var error = new _errors.MediaCardError('error-file-state', (0, _mediaClient.toCommonMediaClientError)(fileState));
146
- !isFailedEventSent && fireFailedOperationalEvent(error);
147
- return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
147
+ fireFailedOperationalEvent(error);
148
+ return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
148
149
  innerRef: copyNodeRef,
149
150
  message: (intl || defaultIntl).formatMessage(_mediaUi.messages.couldnt_load_file),
150
- isSelected: isSelected
151
- });
151
+ isSelected: isSelected,
152
+ onClick: onMediaInlineCardClick
153
+ }), renderMediaViewer()));
152
154
  }
153
155
 
154
156
  // Empty file handling
@@ -156,12 +158,13 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
156
158
  var _error = new _errors.MediaCardError('metadata-fetch', new _mediaClient.FileFetcherError('emptyFileName', {
157
159
  id: fileState.id
158
160
  }));
159
- !isFailedEventSent && fireFailedOperationalEvent(_error);
160
- return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
161
+ fireFailedOperationalEvent(_error);
162
+ return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
161
163
  innerRef: copyNodeRef,
162
164
  message: (intl || defaultIntl).formatMessage(_mediaUi.messages.couldnt_load_file),
163
- isSelected: isSelected
164
- });
165
+ isSelected: isSelected,
166
+ onClick: onMediaInlineCardClick
167
+ }), renderMediaViewer()));
165
168
  }
166
169
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
167
170
  return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardLoadingView, {
@@ -180,7 +183,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
180
183
 
181
184
  // Failed to process should still display the loaded view and enable Media Client to download
182
185
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
183
- !isFailedEventSent && fireFailedOperationalEvent(undefined, 'failed-processing');
186
+ fireFailedOperationalEvent(undefined, 'failed-processing');
184
187
  }
185
188
  var mediaType = fileState.mediaType,
186
189
  name = fileState.name,
@@ -192,7 +195,6 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
192
195
  mimeType: mimeType,
193
196
  name: name
194
197
  });
195
- var mediaViewer = renderMediaViewer();
196
198
  var formattedDate;
197
199
  if (fileState.createdAt) {
198
200
  var _ref2 = intl || {
@@ -216,7 +218,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
216
218
  title: name,
217
219
  onClick: onMediaInlineCardClick,
218
220
  isSelected: isSelected
219
- })), mediaViewer));
221
+ })), renderMediaViewer()));
220
222
  } else {
221
223
  return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardLoadedView, {
222
224
  innerRef: copyNodeRef,
@@ -224,7 +226,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
224
226
  title: name,
225
227
  onClick: onMediaInlineCardClick,
226
228
  isSelected: isSelected
227
- }), mediaViewer));
229
+ }), renderMediaViewer()));
228
230
  }
229
231
  };
230
232
  var MediaInlineCard = exports.MediaInlineCard = (0, _reactIntlNext.injectIntl)(MediaInlineCardInternal, {
@@ -15,7 +15,7 @@ var _mediaClient = require("@atlaskit/media-client");
15
15
  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; }
16
16
  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; }
17
17
  var packageName = "@atlaskit/media-card";
18
- var packageVersion = "79.4.3";
18
+ var packageVersion = "79.4.4";
19
19
  var SAMPLE_RATE = 0.05;
20
20
  var concurrentExperience;
21
21
  var getExperience = function getExperience(id) {
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
9
9
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
10
10
  import UFOLabel from '@atlaskit/react-ufo/label';
11
11
  const packageName = "@atlaskit/media-card";
12
- const packageVersion = "79.4.3";
12
+ const packageVersion = "79.4.4";
13
13
  export const CardBase = ({
14
14
  identifier,
15
15
  ...otherProps
@@ -356,9 +356,7 @@ export const FileCard = ({
356
356
  }
357
357
 
358
358
  // Abort VC when click file card
359
- if (fg('platform_abort_vc_click_file_card')) {
360
- pressTracing();
361
- }
359
+ pressTracing();
362
360
  };
363
361
 
364
362
  //----------------------------------------------------------------//
@@ -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 = "79.4.3";
69
+ const packageVersion = "79.4.4";
70
70
 
71
71
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
72
72
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -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: "79.4.3",
40
+ packageName: "79.4.4",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -12,7 +12,6 @@ import { MediaCardError } from '../errors';
12
12
  import { fireMediaCardEvent } from '../utils/analytics';
13
13
  import { getErrorStatusPayload, getFailedProcessingStatusPayload, getSucceededStatusPayload } from './mediaInlineCardAnalytics';
14
14
  import { useCopyIntent } from '@atlaskit/media-client-react';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
15
  import usePressTracing from '@atlaskit/react-ufo/use-press-tracing';
17
16
  // UI component which renders an inline link in the appropiate state based on a media file
18
17
  export const MediaInlineCardInternal = ({
@@ -36,6 +35,9 @@ export const MediaInlineCardInternal = ({
36
35
  } = useAnalyticsEvents();
37
36
  const pressTracing = usePressTracing('click-media-inline-card');
38
37
  const fireFailedOperationalEvent = (error = new MediaCardError('missing-error-data'), failReason) => {
38
+ if (isFailedEventSent) {
39
+ return;
40
+ }
39
41
  const payload = failReason ? getFailedProcessingStatusPayload(identifier.id, fileState) : getErrorStatusPayload(identifier.id, error, fileState);
40
42
  setIsFailedEventSent(true);
41
43
  fireMediaCardEvent(payload, createAnalyticsEvent);
@@ -63,9 +65,7 @@ export const MediaInlineCardInternal = ({
63
65
  }
64
66
 
65
67
  // Abort VC when click media inline card
66
- if (fg('platform_abort_vc_click_file_card')) {
67
- pressTracing();
68
- }
68
+ pressTracing();
69
69
  };
70
70
  const onMediaViewerClose = () => setMediaViewerVisible(false);
71
71
  const renderMediaViewer = () => {
@@ -108,21 +108,23 @@ export const MediaInlineCardInternal = ({
108
108
  if (subscribeError) {
109
109
  const errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
110
110
  const errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
111
- !isFailedEventSent && fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
112
- return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
111
+ fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
112
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
113
113
  innerRef: copyNodeRef,
114
114
  message: (intl || defaultIntl).formatMessage(errorMessage),
115
- isSelected: isSelected
116
- });
115
+ isSelected: isSelected,
116
+ onClick: onMediaInlineCardClick
117
+ }), renderMediaViewer()));
117
118
  }
118
119
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
119
120
  const error = new MediaCardError('error-file-state', toCommonMediaClientError(fileState));
120
- !isFailedEventSent && fireFailedOperationalEvent(error);
121
- return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
121
+ fireFailedOperationalEvent(error);
122
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
122
123
  innerRef: copyNodeRef,
123
124
  message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
124
- isSelected: isSelected
125
- });
125
+ isSelected: isSelected,
126
+ onClick: onMediaInlineCardClick
127
+ }), renderMediaViewer()));
126
128
  }
127
129
 
128
130
  // Empty file handling
@@ -130,12 +132,13 @@ export const MediaInlineCardInternal = ({
130
132
  const error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
131
133
  id: fileState.id
132
134
  }));
133
- !isFailedEventSent && fireFailedOperationalEvent(error);
134
- return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
135
+ fireFailedOperationalEvent(error);
136
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
135
137
  innerRef: copyNodeRef,
136
138
  message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
137
- isSelected: isSelected
138
- });
139
+ isSelected: isSelected,
140
+ onClick: onMediaInlineCardClick
141
+ }), renderMediaViewer()));
139
142
  }
140
143
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
141
144
  return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
@@ -154,7 +157,7 @@ export const MediaInlineCardInternal = ({
154
157
 
155
158
  // Failed to process should still display the loaded view and enable Media Client to download
156
159
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
157
- !isFailedEventSent && fireFailedOperationalEvent(undefined, 'failed-processing');
160
+ fireFailedOperationalEvent(undefined, 'failed-processing');
158
161
  }
159
162
  const {
160
163
  mediaType,
@@ -168,7 +171,6 @@ export const MediaInlineCardInternal = ({
168
171
  mimeType: mimeType,
169
172
  name: name
170
173
  });
171
- const mediaViewer = renderMediaViewer();
172
174
  let formattedDate;
173
175
  if (fileState.createdAt) {
174
176
  const {
@@ -192,7 +194,7 @@ export const MediaInlineCardInternal = ({
192
194
  title: name,
193
195
  onClick: onMediaInlineCardClick,
194
196
  isSelected: isSelected
195
- })), mediaViewer));
197
+ })), renderMediaViewer()));
196
198
  } else {
197
199
  return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardLoadedView, {
198
200
  innerRef: copyNodeRef,
@@ -200,7 +202,7 @@ export const MediaInlineCardInternal = ({
200
202
  title: name,
201
203
  onClick: onMediaInlineCardClick,
202
204
  isSelected: isSelected
203
- }), mediaViewer));
205
+ }), renderMediaViewer()));
204
206
  }
205
207
  };
206
208
  export const MediaInlineCard = injectIntl(MediaInlineCardInternal, {
@@ -5,7 +5,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
5
5
  import { MediaCardError } from '../errors';
6
6
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
7
7
  const packageName = "@atlaskit/media-card";
8
- const packageVersion = "79.4.3";
8
+ const packageVersion = "79.4.4";
9
9
  const SAMPLE_RATE = 0.05;
10
10
  let concurrentExperience;
11
11
  const getExperience = id => {
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
11
11
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
12
12
  import UFOLabel from '@atlaskit/react-ufo/label';
13
13
  var packageName = "@atlaskit/media-card";
14
- var packageVersion = "79.4.3";
14
+ var packageVersion = "79.4.4";
15
15
  export var CardBase = function CardBase(_ref) {
16
16
  var identifier = _ref.identifier,
17
17
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -425,9 +425,7 @@ export var FileCard = function FileCard(_ref) {
425
425
  }
426
426
 
427
427
  // Abort VC when click file card
428
- if (fg('platform_abort_vc_click_file_card')) {
429
- pressTracing();
430
- }
428
+ pressTracing();
431
429
  };
432
430
 
433
431
  //----------------------------------------------------------------//
@@ -80,7 +80,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
80
80
  }(React.Component);
81
81
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
82
82
  var packageName = "@atlaskit/media-card";
83
- var packageVersion = "79.4.3";
83
+ var packageVersion = "79.4.4";
84
84
 
85
85
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
86
86
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
101
101
  ErrorBoundary = _this$state.ErrorBoundary;
102
102
  var analyticsContext = {
103
103
  packageVersion: "@atlaskit/media-card",
104
- packageName: "79.4.3",
104
+ packageName: "79.4.4",
105
105
  componentName: 'mediaInlineCard',
106
106
  component: 'mediaInlineCard'
107
107
  };
@@ -13,7 +13,6 @@ import { MediaCardError } from '../errors';
13
13
  import { fireMediaCardEvent } from '../utils/analytics';
14
14
  import { getErrorStatusPayload, getFailedProcessingStatusPayload, getSucceededStatusPayload } from './mediaInlineCardAnalytics';
15
15
  import { useCopyIntent } from '@atlaskit/media-client-react';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import usePressTracing from '@atlaskit/react-ufo/use-press-tracing';
18
17
  // UI component which renders an inline link in the appropiate state based on a media file
19
18
  export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
@@ -52,6 +51,9 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
52
51
  var fireFailedOperationalEvent = function fireFailedOperationalEvent() {
53
52
  var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new MediaCardError('missing-error-data');
54
53
  var failReason = arguments.length > 1 ? arguments[1] : undefined;
54
+ if (isFailedEventSent) {
55
+ return;
56
+ }
55
57
  var payload = failReason ? getFailedProcessingStatusPayload(identifier.id, fileState) : getErrorStatusPayload(identifier.id, error, fileState);
56
58
  setIsFailedEventSent(true);
57
59
  fireMediaCardEvent(payload, createAnalyticsEvent);
@@ -78,9 +80,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
78
80
  }
79
81
 
80
82
  // Abort VC when click media inline card
81
- if (fg('platform_abort_vc_click_file_card')) {
82
- pressTracing();
83
- }
83
+ pressTracing();
84
84
  };
85
85
  var onMediaViewerClose = function onMediaViewerClose() {
86
86
  return setMediaViewerVisible(false);
@@ -125,21 +125,23 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
125
125
  if (subscribeError) {
126
126
  var errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
127
127
  var errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
128
- !isFailedEventSent && fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
129
- return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
128
+ fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
129
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
130
130
  innerRef: copyNodeRef,
131
131
  message: (intl || defaultIntl).formatMessage(errorMessage),
132
- isSelected: isSelected
133
- });
132
+ isSelected: isSelected,
133
+ onClick: onMediaInlineCardClick
134
+ }), renderMediaViewer()));
134
135
  }
135
136
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
136
137
  var error = new MediaCardError('error-file-state', toCommonMediaClientError(fileState));
137
- !isFailedEventSent && fireFailedOperationalEvent(error);
138
- return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
138
+ fireFailedOperationalEvent(error);
139
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
139
140
  innerRef: copyNodeRef,
140
141
  message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
141
- isSelected: isSelected
142
- });
142
+ isSelected: isSelected,
143
+ onClick: onMediaInlineCardClick
144
+ }), renderMediaViewer()));
143
145
  }
144
146
 
145
147
  // Empty file handling
@@ -147,12 +149,13 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
147
149
  var _error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
148
150
  id: fileState.id
149
151
  }));
150
- !isFailedEventSent && fireFailedOperationalEvent(_error);
151
- return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
152
+ fireFailedOperationalEvent(_error);
153
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
152
154
  innerRef: copyNodeRef,
153
155
  message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
154
- isSelected: isSelected
155
- });
156
+ isSelected: isSelected,
157
+ onClick: onMediaInlineCardClick
158
+ }), renderMediaViewer()));
156
159
  }
157
160
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
158
161
  return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
@@ -171,7 +174,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
171
174
 
172
175
  // Failed to process should still display the loaded view and enable Media Client to download
173
176
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
174
- !isFailedEventSent && fireFailedOperationalEvent(undefined, 'failed-processing');
177
+ fireFailedOperationalEvent(undefined, 'failed-processing');
175
178
  }
176
179
  var mediaType = fileState.mediaType,
177
180
  name = fileState.name,
@@ -183,7 +186,6 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
183
186
  mimeType: mimeType,
184
187
  name: name
185
188
  });
186
- var mediaViewer = renderMediaViewer();
187
189
  var formattedDate;
188
190
  if (fileState.createdAt) {
189
191
  var _ref2 = intl || {
@@ -207,7 +209,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
207
209
  title: name,
208
210
  onClick: onMediaInlineCardClick,
209
211
  isSelected: isSelected
210
- })), mediaViewer));
212
+ })), renderMediaViewer()));
211
213
  } else {
212
214
  return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardLoadedView, {
213
215
  innerRef: copyNodeRef,
@@ -215,7 +217,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
215
217
  title: name,
216
218
  onClick: onMediaInlineCardClick,
217
219
  isSelected: isSelected
218
- }), mediaViewer));
220
+ }), renderMediaViewer()));
219
221
  }
220
222
  };
221
223
  export var MediaInlineCard = injectIntl(MediaInlineCardInternal, {
@@ -8,7 +8,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
8
8
  import { MediaCardError } from '../errors';
9
9
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
10
10
  var packageName = "@atlaskit/media-card";
11
- var packageVersion = "79.4.3";
11
+ var packageVersion = "79.4.4";
12
12
  var SAMPLE_RATE = 0.05;
13
13
  var concurrentExperience;
14
14
  var getExperience = function getExperience(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "79.4.4",
3
+ "version": "79.4.5",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@atlaskit/analytics-next": "^11.1.0",
40
- "@atlaskit/dropdown-menu": "^16.2.0",
40
+ "@atlaskit/dropdown-menu": "^16.3.0",
41
41
  "@atlaskit/editor-shared-styles": "^3.5.0",
42
- "@atlaskit/icon": "^27.5.0",
42
+ "@atlaskit/icon": "^27.7.0",
43
43
  "@atlaskit/link": "^3.2.0",
44
- "@atlaskit/media-client": "^35.1.0",
44
+ "@atlaskit/media-client": "^35.2.0",
45
45
  "@atlaskit/media-client-react": "^4.1.0",
46
46
  "@atlaskit/media-common": "^12.3.0",
47
47
  "@atlaskit/media-file-preview": "^0.11.0",
@@ -51,10 +51,10 @@
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/primitives": "^14.10.0",
53
53
  "@atlaskit/react-ufo": "^4.1.0",
54
- "@atlaskit/spinner": "^18.0.0",
54
+ "@atlaskit/spinner": "^19.0.0",
55
55
  "@atlaskit/theme": "^19.0.0",
56
56
  "@atlaskit/tokens": "^5.6.0",
57
- "@atlaskit/tooltip": "^20.3.0",
57
+ "@atlaskit/tooltip": "^20.4.0",
58
58
  "@atlaskit/ufo": "^0.4.0",
59
59
  "@atlaskit/visually-hidden": "^3.0.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -86,7 +86,7 @@
86
86
  "@atlaskit/radio": "^8.1.0",
87
87
  "@atlaskit/range": "^9.1.0",
88
88
  "@atlaskit/ssr": "workspace:^",
89
- "@atlaskit/toggle": "^15.0.0",
89
+ "@atlaskit/toggle": "^15.1.0",
90
90
  "@atlaskit/visual-regression": "workspace:^",
91
91
  "@atlassian/feature-flags-test-utils": "^0.3.0",
92
92
  "@atlassian/ufo": "^0.7.0",
@@ -142,9 +142,6 @@
142
142
  "platform_media_resume_video_on_token_expiry": {
143
143
  "type": "boolean"
144
144
  },
145
- "platform_abort_vc_click_file_card": {
146
- "type": "boolean"
147
- },
148
145
  "platfrom_close_blindspot_for_img": {
149
146
  "type": "boolean"
150
147
  }