@atlaskit/media-card 79.16.23 → 80.1.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/cjs/card/card.js +4 -4
  3. package/dist/cjs/card/cardView.js +3 -3
  4. package/dist/cjs/card/fileCard.js +2 -2
  5. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  6. package/dist/cjs/card/ui/iconMessage/index.js +2 -2
  7. package/dist/cjs/card/ui/openMediaViewerButton/openMediaViewerButton.js +4 -4
  8. package/dist/cjs/card/ui/titleBox/failedTitleBox.js +2 -2
  9. package/dist/cjs/card/ui/titleBox/titleBox.js +2 -2
  10. package/dist/cjs/inline/loader.js +1 -1
  11. package/dist/cjs/inline/mediaInlineCard.js +50 -17
  12. package/dist/cjs/utils/ufoExperiences.js +1 -1
  13. package/dist/es2019/card/card.js +2 -2
  14. package/dist/es2019/card/cardView.js +1 -1
  15. package/dist/es2019/card/fileCard.js +1 -1
  16. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  17. package/dist/es2019/card/ui/iconMessage/index.js +1 -1
  18. package/dist/es2019/card/ui/openMediaViewerButton/openMediaViewerButton.js +1 -1
  19. package/dist/es2019/card/ui/titleBox/failedTitleBox.js +1 -1
  20. package/dist/es2019/card/ui/titleBox/titleBox.js +1 -1
  21. package/dist/es2019/inline/loader.js +1 -1
  22. package/dist/es2019/inline/mediaInlineCard.js +38 -15
  23. package/dist/es2019/utils/ufoExperiences.js +1 -1
  24. package/dist/esm/card/card.js +2 -2
  25. package/dist/esm/card/cardView.js +1 -1
  26. package/dist/esm/card/fileCard.js +1 -1
  27. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  28. package/dist/esm/card/ui/iconMessage/index.js +1 -1
  29. package/dist/esm/card/ui/openMediaViewerButton/openMediaViewerButton.js +1 -1
  30. package/dist/esm/card/ui/titleBox/failedTitleBox.js +1 -1
  31. package/dist/esm/card/ui/titleBox/titleBox.js +1 -1
  32. package/dist/esm/inline/loader.js +1 -1
  33. package/dist/esm/inline/mediaInlineCard.js +48 -15
  34. package/dist/esm/utils/ufoExperiences.js +1 -1
  35. package/dist/types/card/actions.d.ts +1 -1
  36. package/dist/types/card/card.d.ts +1 -1
  37. package/dist/types/card/cardView.d.ts +1 -1
  38. package/dist/types/card/ui/iconMessage/types.d.ts +1 -1
  39. package/dist/types/card/ui/openMediaViewerButton/openMediaViewerButton.d.ts +1 -1
  40. package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
  41. package/dist/types/card/ui/titleBox/titleBox.d.ts +1 -1
  42. package/dist/types/card/ui/titleBox/types.d.ts +1 -1
  43. package/dist/types/inline/mediaInlineCard.d.ts +7 -1
  44. package/dist/types-ts4.5/card/actions.d.ts +1 -1
  45. package/dist/types-ts4.5/card/card.d.ts +1 -1
  46. package/dist/types-ts4.5/card/cardView.d.ts +1 -1
  47. package/dist/types-ts4.5/card/ui/iconMessage/types.d.ts +1 -1
  48. package/dist/types-ts4.5/card/ui/openMediaViewerButton/openMediaViewerButton.d.ts +1 -1
  49. package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -1
  50. package/dist/types-ts4.5/card/ui/titleBox/titleBox.d.ts +1 -1
  51. package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +1 -1
  52. package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +7 -1
  53. package/package.json +12 -12
  54. package/report.api.md +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 80.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b6bb07e5d72ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6bb07e5d72ac) -
8
+ [ux] Fix for #hot-301450, add new media option for fallback media name fetcher to allow confluence
9
+ to use the attachment service instead of the media service to get filenames. After DC -> Cloud
10
+ migration filenames were not properly copied across to the media service causing inline media to
11
+ show an error.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 80.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - [`770f036c93884`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/770f036c93884) -
22
+ Removed `react-intl-next` alias and replaced all usages with `react-intl` directly.
23
+
24
+ What changed: The `react-intl-next` npm alias (which resolved to `react-intl@^5`) has been
25
+ removed. All imports now reference `react-intl` directly, and `peerDependencies` have been updated
26
+ to `"^5.25.1 || ^6.0.0 || ^7.0.0"`.
27
+
28
+ How consumer should update their code: Ensure `react-intl` is installed at a version satisfying
29
+ `^5.25.1 || ^6.0.0 || ^7.0.0`. If your application was using `react-intl-next` as an npm alias, it
30
+ can be safely removed. Replace any remaining `react-intl-next` imports with `react-intl`.
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 79.16.23
4
37
 
5
38
  ### Patch Changes
@@ -11,7 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _mediaClient = require("@atlaskit/media-client");
12
12
  var _mediaCommon = require("@atlaskit/media-common");
13
13
  var _react = _interopRequireWildcard(require("react"));
14
- var _reactIntlNext = require("react-intl-next");
14
+ var _reactIntl = require("react-intl");
15
15
  var _externalImageCard = require("./externalImageCard");
16
16
  var _fileCard = require("./fileCard");
17
17
  var _mediaPerformanceObserver = require("../utils/mediaPerformanceObserver/mediaPerformanceObserver");
@@ -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.16.22";
23
+ var packageVersion = "80.0.0";
24
24
  var CardBase = exports.CardBase = function CardBase(_ref) {
25
25
  var identifier = _ref.identifier,
26
26
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -35,7 +35,7 @@ var CardBase = exports.CardBase = function CardBase(_ref) {
35
35
  identifier: identifier,
36
36
  key: identifier.dataURI
37
37
  })));
38
- return otherProps.intl ? innerContent : /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
38
+ return otherProps.intl ? innerContent : /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
39
39
  locale: "en"
40
40
  }, innerContent);
41
41
  };
@@ -55,6 +55,6 @@ var Card = exports.Card = (0, _mediaCommon.withMediaAnalyticsContext)({
55
55
  packageName: packageName,
56
56
  componentName: 'mediaCard',
57
57
  component: 'mediaCard'
58
- })((0, _reactIntlNext.injectIntl)(CardWithPerformanceObserver, {
58
+ })((0, _reactIntl.injectIntl)(CardWithPerformanceObserver, {
59
59
  enforceContext: false
60
60
  }));
@@ -9,7 +9,7 @@ exports.CardViewBase = exports.CardView = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
- var _reactIntlNext = require("react-intl-next");
12
+ var _reactIntl = require("react-intl");
13
13
  var _mediaClient = require("@atlaskit/media-client");
14
14
  var _analyticsNext = require("@atlaskit/analytics-next");
15
15
  var _mimeTypeIcon = require("@atlaskit/media-ui/mime-type-icon");
@@ -40,7 +40,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
40
40
  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); }
41
41
  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; }
42
42
  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; }
43
- var i18n = (0, _reactIntlNext.defineMessages)({
43
+ var i18n = (0, _reactIntl.defineMessages)({
44
44
  traceIdTooltip: {
45
45
  id: 'fabric.media.trace_id_tooltip',
46
46
  defaultMessage: 'Use Trace ID {traceId} when reaching out to support.',
@@ -83,7 +83,7 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
83
83
  onSvgError = _ref.onSvgError,
84
84
  onSvgLoad = _ref.onSvgLoad,
85
85
  traceId = _ref.traceId;
86
- var intl = (0, _reactIntlNext.useIntl)();
86
+ var intl = (0, _reactIntl.useIntl)();
87
87
  var _useState = (0, _react.useState)(false),
88
88
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
89
89
  didSvgRender = _useState2[0],
@@ -37,7 +37,7 @@ var _mediaFilePreview = require("@atlaskit/media-file-preview");
37
37
  var _actions = require("./actions");
38
38
  var _performance = require("./performance");
39
39
  var _dateOverrideContext = require("../dateOverrideContext");
40
- var _reactIntlNext = require("react-intl-next");
40
+ var _reactIntl = require("react-intl");
41
41
  var _abuseModal = require("@atlaskit/media-ui/abuseModal");
42
42
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
43
43
  var _experienceTraceIdContext = require("@atlaskit/react-ufo/experience-trace-id-context");
@@ -95,7 +95,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
95
95
  ssrItemDetails = _ref.ssrItemDetails,
96
96
  onError = _ref.onError,
97
97
  mediaViewerExtensions = _ref.mediaViewerExtensions;
98
- var _useIntl = (0, _reactIntlNext.useIntl)(),
98
+ var _useIntl = (0, _reactIntl.useIntl)(),
99
99
  formatMessage = _useIntl.formatMessage;
100
100
  var _useState = (0, _react.useState)(false),
101
101
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -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.16.22";
90
+ var packageVersion = "80.0.0";
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)({
@@ -9,14 +9,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _iconMessageWrapper = require("./iconMessageWrapper");
11
11
  var _mediaUi = require("@atlaskit/media-ui");
12
- var _reactIntlNext = require("react-intl-next");
12
+ var _reactIntl = require("react-intl");
13
13
  var IconMessage = exports.IconMessage = function IconMessage(_ref) {
14
14
  var messageDescriptor = _ref.messageDescriptor,
15
15
  _ref$animated = _ref.animated,
16
16
  animated = _ref$animated === void 0 ? false : _ref$animated;
17
17
  return /*#__PURE__*/_react.default.createElement(_iconMessageWrapper.IconMessageWrapper, {
18
18
  animated: animated
19
- }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messageDescriptor)));
19
+ }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messageDescriptor)));
20
20
  };
21
21
  var CreatingPreview = exports.CreatingPreview = function CreatingPreview(_ref2) {
22
22
  var disableAnimation = _ref2.disableAnimation;
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
- var _reactIntlNext = require("react-intl-next");
11
+ var _reactIntl = require("react-intl");
12
12
  var _mediaUi = require("@atlaskit/media-ui");
13
13
  var _compiled = require("@atlaskit/primitives/compiled");
14
14
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
@@ -17,7 +17,7 @@ var OpenMediaViewerButton = function OpenMediaViewerButton(_ref) {
17
17
  var fileName = _ref.fileName,
18
18
  innerRef = _ref.innerRef,
19
19
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
- var intl = (0, _reactIntlNext.useIntl)();
20
+ var intl = (0, _reactIntl.useIntl)();
21
21
  return /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, /*#__PURE__*/_react.default.createElement(_compiled.Pressable, (0, _extends2.default)({
22
22
  ref: innerRef
23
23
  }, props), intl.formatMessage(_mediaUi.messages.open_file_in_viewer, {
@@ -25,11 +25,11 @@ var OpenMediaViewerButton = function OpenMediaViewerButton(_ref) {
25
25
  })));
26
26
  };
27
27
  var OpenMediaViewerButtonWrapper = function OpenMediaViewerButtonWrapper(props) {
28
- return props.intl ? /*#__PURE__*/_react.default.createElement(OpenMediaViewerButton, props) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
28
+ return props.intl ? /*#__PURE__*/_react.default.createElement(OpenMediaViewerButton, props) : /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
29
29
  locale: "en"
30
30
  }, /*#__PURE__*/_react.default.createElement(OpenMediaViewerButton, props));
31
31
  };
32
- var _default_1 = (0, _reactIntlNext.injectIntl)(OpenMediaViewerButtonWrapper, {
32
+ var _default_1 = (0, _reactIntl.injectIntl)(OpenMediaViewerButtonWrapper, {
33
33
  enforceContext: false
34
34
  });
35
35
  var _default = exports.default = _default_1;
@@ -9,7 +9,7 @@ exports.FailedTitleBox = void 0;
9
9
  require("./failedTitleBox.compiled.css");
10
10
  var _runtime = require("@compiled/react/runtime");
11
11
  var _react = _interopRequireDefault(require("react"));
12
- var _reactIntlNext = require("react-intl-next");
12
+ var _reactIntl = require("react-intl");
13
13
  var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
14
14
  var _mediaUi = require("@atlaskit/media-ui");
15
15
  var _titleBoxComponents = require("./titleBoxComponents");
@@ -26,5 +26,5 @@ var FailedTitleBox = exports.FailedTitleBox = function FailedTitleBox(_ref) {
26
26
  size: "small"
27
27
  }), /*#__PURE__*/_react.default.createElement("span", {
28
28
  className: (0, _runtime.ax)(["_s7n4nkob _18u01b66 _2hwx1b66"])
29
- }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, customMessage))));
29
+ }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, customMessage))));
30
30
  };
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.TitleBox = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _reactIntlNext = require("react-intl-next");
9
+ var _reactIntl = require("react-intl");
10
10
  var _lockLocked = _interopRequireDefault(require("@atlaskit/icon/core/lock-locked"));
11
11
  var _truncateText = require("@atlaskit/media-ui/truncateText");
12
12
  var _formatDate = require("@atlaskit/media-ui/formatDate");
@@ -15,7 +15,7 @@ var placeholderText = ' ';
15
15
  var isValidTimestamp = function isValidTimestamp(timeStamp) {
16
16
  return new Date(timeStamp).getTime() > 0;
17
17
  };
18
- var TitleBox = exports.TitleBox = (0, _reactIntlNext.injectIntl)(function (_ref) {
18
+ var TitleBox = exports.TitleBox = (0, _reactIntl.injectIntl)(function (_ref) {
19
19
  var _intl$locale;
20
20
  var name = _ref.name,
21
21
  createdAt = _ref.createdAt,
@@ -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.16.22",
119
+ packageName: "80.0.0",
120
120
  componentName: 'mediaInlineCard',
121
121
  component: 'mediaInlineCard'
122
122
  };
@@ -16,12 +16,13 @@ var _mediaViewer = require("@atlaskit/media-viewer");
16
16
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
17
17
  var _react = _interopRequireWildcard(require("react"));
18
18
  var _reactDom = _interopRequireDefault(require("react-dom"));
19
- var _reactIntlNext = require("react-intl-next");
19
+ var _reactIntl = require("react-intl");
20
20
  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
24
  var _usePressTracing = _interopRequireDefault(require("@atlaskit/react-ufo/use-press-tracing"));
25
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
26
  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); }
26
27
  // UI component which renders an inline link in the appropiate state based on a media file
27
28
  var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
@@ -33,7 +34,8 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
33
34
  onClick = _ref.onClick,
34
35
  mediaViewerItems = _ref.mediaViewerItems,
35
36
  intl = _ref.intl,
36
- viewerOptions = _ref.viewerOptions;
37
+ viewerOptions = _ref.viewerOptions,
38
+ fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher;
37
39
  var _useState = (0, _react.useState)(),
38
40
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
39
41
  fileState = _useState2[0],
@@ -54,6 +56,15 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
54
56
  _useState0 = (0, _slicedToArray2.default)(_useState9, 2),
55
57
  isMediaViewerVisible = _useState0[0],
56
58
  setMediaViewerVisible = _useState0[1];
59
+ var _useState1 = (0, _react.useState)(),
60
+ _useState10 = (0, _slicedToArray2.default)(_useState1, 2),
61
+ fallbackMediaName = _useState10[0],
62
+ setFallbackMediaName = _useState10[1];
63
+ var _useState11 = (0, _react.useState)(false),
64
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
65
+ fallbackMediaNameFetchFailed = _useState12[0],
66
+ setFallbackMediaNameFetchFailed = _useState12[1];
67
+ var fallbackMediaNameFetchAttempted = (0, _react.useRef)(false);
57
68
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
58
69
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
59
70
  var pressTracing = (0, _usePressTracing.default)('click-media-inline-card');
@@ -108,11 +119,11 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
108
119
  return null;
109
120
  };
110
121
  var renderContent = function renderContent(children) {
111
- return intl ? children : /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
122
+ return intl ? children : /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
112
123
  locale: "en"
113
124
  }, children);
114
125
  };
115
- var defaultIntl = (0, _reactIntlNext.createIntl)({
126
+ var defaultIntl = (0, _reactIntl.createIntl)({
116
127
  locale: 'en'
117
128
  });
118
129
  (0, _react.useEffect)(function () {
@@ -131,6 +142,16 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
131
142
  subscription === null || subscription === void 0 || subscription.unsubscribe();
132
143
  };
133
144
  }, [identifier.collectionName, identifier.id, mediaClient.file]);
145
+ (0, _react.useEffect)(function () {
146
+ if (fileState && fileState.status !== 'error' && !fileState.name && fallbackMediaNameFetcher && !fallbackMediaNameFetchAttempted.current && (0, _expValEquals.expValEquals)('platform_editor_media_name_fallback', 'isEnabled', true)) {
147
+ fallbackMediaNameFetchAttempted.current = true;
148
+ fallbackMediaNameFetcher(fileState.id).then(function (name) {
149
+ return setFallbackMediaName(name);
150
+ }, function () {
151
+ return setFallbackMediaNameFetchFailed(true);
152
+ });
153
+ }
154
+ }, [fileState, fallbackMediaNameFetcher]);
134
155
  if (subscribeError) {
135
156
  var errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? _mediaUi.messages.failed_to_upload : _mediaUi.messages.couldnt_load_file;
136
157
  var errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
@@ -153,18 +174,29 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
153
174
  }), renderMediaViewer()));
154
175
  }
155
176
 
156
- // Empty file handling
177
+ // Empty file handling — try the fallback name fetcher first if available
157
178
  if (fileState && !fileState.name) {
158
- var _error = new _errors.MediaCardError('metadata-fetch', new _mediaClient.FileFetcherError('emptyFileName', {
159
- id: fileState.id
160
- }));
161
- fireFailedOperationalEvent(_error);
162
- return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
163
- innerRef: copyNodeRef,
164
- message: (intl || defaultIntl).formatMessage(_mediaUi.messages.couldnt_load_file),
165
- isSelected: isSelected,
166
- onClick: onMediaInlineCardClick
167
- }), renderMediaViewer()));
179
+ if (fallbackMediaNameFetcher && !fallbackMediaNameFetchFailed && !fallbackMediaName && (0, _expValEquals.expValEquals)('platform_editor_media_name_fallback', 'isEnabled', true)) {
180
+ // Fetch not yet attempted or in flight — show loading
181
+ return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardLoadingView, {
182
+ innerRef: copyNodeRef,
183
+ message: (intl || defaultIntl).formatMessage(_mediaUi.messages.loading_file),
184
+ isSelected: isSelected
185
+ });
186
+ }
187
+ if (!(0, _expValEquals.expValEquals)('platform_editor_media_name_fallback', 'isEnabled', true) || !fallbackMediaName) {
188
+ // No fetcher provided or fetch failed — show error
189
+ var _error = new _errors.MediaCardError('metadata-fetch', new _mediaClient.FileFetcherError('emptyFileName', {
190
+ id: fileState.id
191
+ }));
192
+ fireFailedOperationalEvent(_error);
193
+ return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
194
+ innerRef: copyNodeRef,
195
+ message: (intl || defaultIntl).formatMessage(_mediaUi.messages.couldnt_load_file),
196
+ isSelected: isSelected,
197
+ onClick: onMediaInlineCardClick
198
+ }), renderMediaViewer()));
199
+ }
168
200
  }
169
201
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
170
202
  return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardLoadingView, {
@@ -186,8 +218,9 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
186
218
  fireFailedOperationalEvent(undefined, 'failed-processing');
187
219
  }
188
220
  var mediaType = fileState.mediaType,
189
- name = fileState.name,
221
+ fileStateName = fileState.name,
190
222
  mimeType = fileState.mimeType;
223
+ var name = (0, _expValEquals.expValEquals)('platform_editor_media_name_fallback', 'isEnabled', true) ? fileStateName || fallbackMediaName : fileStateName;
191
224
  var linkIcon = /*#__PURE__*/_react.default.createElement(_mimeTypeIcon.MimeTypeIcon, {
192
225
  testId: 'media-inline-card-file-type-icon',
193
226
  size: "small",
@@ -229,6 +262,6 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
229
262
  }), renderMediaViewer()));
230
263
  }
231
264
  };
232
- var MediaInlineCard = exports.MediaInlineCard = (0, _reactIntlNext.injectIntl)(MediaInlineCardInternal, {
265
+ var MediaInlineCard = exports.MediaInlineCard = (0, _reactIntl.injectIntl)(MediaInlineCardInternal, {
233
266
  enforceContext: false
234
267
  });
@@ -19,7 +19,7 @@ var _globalScope = require("./globalScope/globalScope");
19
19
  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; }
20
20
  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; }
21
21
  var packageName = "@atlaskit/media-card";
22
- var packageVersion = "79.16.22";
22
+ var packageVersion = "80.0.0";
23
23
  var SAMPLE_RATE = 0.05;
24
24
 
25
25
  /**
@@ -2,14 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import { isFileIdentifier } from '@atlaskit/media-client';
3
3
  import { withMediaAnalyticsContext } from '@atlaskit/media-common';
4
4
  import React, { useEffect } from 'react';
5
- import { IntlProvider, injectIntl } from 'react-intl-next';
5
+ import { IntlProvider, injectIntl } from 'react-intl';
6
6
  import { ExternalImageCard } from './externalImageCard';
7
7
  import { FileCard } from './fileCard';
8
8
  import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerformanceObserver/mediaPerformanceObserver';
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.16.22";
12
+ const packageVersion = "80.0.0";
13
13
  export const CardBase = ({
14
14
  identifier,
15
15
  ...otherProps
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState, useRef, useMemo } from 'react';
2
- import { defineMessages, useIntl } from 'react-intl-next';
2
+ import { defineMessages, useIntl } from 'react-intl';
3
3
  import { isFileIdentifier } from '@atlaskit/media-client';
4
4
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
5
5
  import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
@@ -25,7 +25,7 @@ import { createDownloadAction } from './actions';
25
25
  import { performanceNow } from './performance';
26
26
  import { useContext } from 'react';
27
27
  import { DateOverrideContext } from '../dateOverrideContext';
28
- import { useIntl } from 'react-intl-next';
28
+ import { useIntl } from 'react-intl';
29
29
  import { AbuseModal } from '@atlaskit/media-ui/abuseModal';
30
30
  import { fg } from '@atlaskit/platform-feature-flags';
31
31
  import { getActiveTrace } from '@atlaskit/react-ufo/experience-trace-id-context';
@@ -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.16.22";
69
+ const packageVersion = "80.0.0";
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({
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { IconMessageWrapper } from './iconMessageWrapper';
4
4
  import { messages } from '@atlaskit/media-ui';
5
- import { FormattedMessage } from 'react-intl-next';
5
+ import { FormattedMessage } from 'react-intl';
6
6
  export const IconMessage = ({
7
7
  messageDescriptor,
8
8
  animated = false
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
3
+ import { injectIntl, IntlProvider, useIntl } from 'react-intl';
4
4
  import { messages } from '@atlaskit/media-ui';
5
5
  import { Pressable } from '@atlaskit/primitives/compiled';
6
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
@@ -2,7 +2,7 @@
2
2
  import "./failedTitleBox.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
- import { FormattedMessage } from 'react-intl-next';
5
+ import { FormattedMessage } from 'react-intl';
6
6
  import EditorWarningIcon from '@atlaskit/icon/core/status-warning';
7
7
  import { messages } from '@atlaskit/media-ui';
8
8
  import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { injectIntl } from 'react-intl-next';
2
+ import { injectIntl } from 'react-intl';
3
3
  import LockFilledIcon from '@atlaskit/icon/core/lock-locked';
4
4
  import { Truncate } from '@atlaskit/media-ui/truncateText';
5
5
  import { formatDate } from '@atlaskit/media-ui/formatDate';
@@ -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.16.22",
40
+ packageName: "80.0.0",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -5,14 +5,15 @@ import { formatDate } from '@atlaskit/media-ui/formatDate';
5
5
  import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
6
6
  import { MediaViewer } from '@atlaskit/media-viewer';
7
7
  import Tooltip from '@atlaskit/tooltip';
8
- import React, { useEffect, useState } from 'react';
8
+ import React, { useEffect, useRef, useState } from 'react';
9
9
  import ReactDOM from 'react-dom';
10
- import { createIntl, injectIntl, IntlProvider } from 'react-intl-next';
10
+ import { createIntl, injectIntl, IntlProvider } from 'react-intl';
11
11
  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
15
  import usePressTracing from '@atlaskit/react-ufo/use-press-tracing';
16
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
17
  // UI component which renders an inline link in the appropiate state based on a media file
17
18
  export const MediaInlineCardInternal = ({
18
19
  mediaClient,
@@ -23,13 +24,17 @@ export const MediaInlineCardInternal = ({
23
24
  onClick,
24
25
  mediaViewerItems,
25
26
  intl,
26
- viewerOptions
27
+ viewerOptions,
28
+ fallbackMediaNameFetcher
27
29
  }) => {
28
30
  const [fileState, setFileState] = useState();
29
31
  const [subscribeError, setSubscribeError] = useState();
30
32
  const [isSucceededEventSent, setIsSucceededEventSent] = useState(false);
31
33
  const [isFailedEventSent, setIsFailedEventSent] = useState(false);
32
34
  const [isMediaViewerVisible, setMediaViewerVisible] = useState(false);
35
+ const [fallbackMediaName, setFallbackMediaName] = useState();
36
+ const [fallbackMediaNameFetchFailed, setFallbackMediaNameFetchFailed] = useState(false);
37
+ const fallbackMediaNameFetchAttempted = useRef(false);
33
38
  const {
34
39
  createAnalyticsEvent
35
40
  } = useAnalyticsEvents();
@@ -105,6 +110,12 @@ export const MediaInlineCardInternal = ({
105
110
  subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
106
111
  };
107
112
  }, [identifier.collectionName, identifier.id, mediaClient.file]);
113
+ useEffect(() => {
114
+ if (fileState && fileState.status !== 'error' && !fileState.name && fallbackMediaNameFetcher && !fallbackMediaNameFetchAttempted.current && expValEquals('platform_editor_media_name_fallback', 'isEnabled', true)) {
115
+ fallbackMediaNameFetchAttempted.current = true;
116
+ fallbackMediaNameFetcher(fileState.id).then(name => setFallbackMediaName(name), () => setFallbackMediaNameFetchFailed(true));
117
+ }
118
+ }, [fileState, fallbackMediaNameFetcher]);
108
119
  if (subscribeError) {
109
120
  const errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
110
121
  const errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
@@ -127,18 +138,29 @@ export const MediaInlineCardInternal = ({
127
138
  }), renderMediaViewer()));
128
139
  }
129
140
 
130
- // Empty file handling
141
+ // Empty file handling — try the fallback name fetcher first if available
131
142
  if (fileState && !fileState.name) {
132
- const error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
133
- id: fileState.id
134
- }));
135
- fireFailedOperationalEvent(error);
136
- return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
137
- innerRef: copyNodeRef,
138
- message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
139
- isSelected: isSelected,
140
- onClick: onMediaInlineCardClick
141
- }), renderMediaViewer()));
143
+ if (fallbackMediaNameFetcher && !fallbackMediaNameFetchFailed && !fallbackMediaName && expValEquals('platform_editor_media_name_fallback', 'isEnabled', true)) {
144
+ // Fetch not yet attempted or in flight — show loading
145
+ return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
146
+ innerRef: copyNodeRef,
147
+ message: (intl || defaultIntl).formatMessage(messages.loading_file),
148
+ isSelected: isSelected
149
+ });
150
+ }
151
+ if (!expValEquals('platform_editor_media_name_fallback', 'isEnabled', true) || !fallbackMediaName) {
152
+ // No fetcher provided or fetch failed — show error
153
+ const error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
154
+ id: fileState.id
155
+ }));
156
+ fireFailedOperationalEvent(error);
157
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
158
+ innerRef: copyNodeRef,
159
+ message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
160
+ isSelected: isSelected,
161
+ onClick: onMediaInlineCardClick
162
+ }), renderMediaViewer()));
163
+ }
142
164
  }
143
165
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
144
166
  return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
@@ -161,9 +183,10 @@ export const MediaInlineCardInternal = ({
161
183
  }
162
184
  const {
163
185
  mediaType,
164
- name,
186
+ name: fileStateName,
165
187
  mimeType
166
188
  } = fileState;
189
+ const name = expValEquals('platform_editor_media_name_fallback', 'isEnabled', true) ? fileStateName || fallbackMediaName : fileStateName;
167
190
  const linkIcon = /*#__PURE__*/React.createElement(MimeTypeIcon, {
168
191
  testId: 'media-inline-card-file-type-icon',
169
192
  size: "small",
@@ -9,7 +9,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
9
9
  import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
10
10
  import { getMediaGlobalScope } from './globalScope/globalScope';
11
11
  const packageName = "@atlaskit/media-card";
12
- const packageVersion = "79.16.22";
12
+ const packageVersion = "80.0.0";
13
13
  const SAMPLE_RATE = 0.05;
14
14
 
15
15
  /**
@@ -4,14 +4,14 @@ var _excluded = ["identifier"];
4
4
  import { isFileIdentifier } from '@atlaskit/media-client';
5
5
  import { withMediaAnalyticsContext } from '@atlaskit/media-common';
6
6
  import React, { useEffect } from 'react';
7
- import { IntlProvider, injectIntl } from 'react-intl-next';
7
+ import { IntlProvider, injectIntl } from 'react-intl';
8
8
  import { ExternalImageCard } from './externalImageCard';
9
9
  import { FileCard } from './fileCard';
10
10
  import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerformanceObserver/mediaPerformanceObserver';
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.16.22";
14
+ var packageVersion = "80.0.0";
15
15
  export var CardBase = function CardBase(_ref) {
16
16
  var identifier = _ref.identifier,
17
17
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  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; }
4
4
  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; }
5
5
  import React, { useEffect, useState, useRef, useMemo } from 'react';
6
- import { defineMessages, useIntl } from 'react-intl-next';
6
+ import { defineMessages, useIntl } from 'react-intl';
7
7
  import { isFileIdentifier } from '@atlaskit/media-client';
8
8
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
9
9
  import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
@@ -32,7 +32,7 @@ import { createDownloadAction } from './actions';
32
32
  import { performanceNow } from './performance';
33
33
  import { useContext } from 'react';
34
34
  import { DateOverrideContext } from '../dateOverrideContext';
35
- import { useIntl } from 'react-intl-next';
35
+ import { useIntl } from 'react-intl';
36
36
  import { AbuseModal } from '@atlaskit/media-ui/abuseModal';
37
37
  import { fg } from '@atlaskit/platform-feature-flags';
38
38
  import { getActiveTrace } from '@atlaskit/react-ufo/experience-trace-id-context';
@@ -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.16.22";
83
+ var packageVersion = "80.0.0";
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({
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { IconMessageWrapper } from './iconMessageWrapper';
4
4
  import { messages } from '@atlaskit/media-ui';
5
- import { FormattedMessage } from 'react-intl-next';
5
+ import { FormattedMessage } from 'react-intl';
6
6
  export var IconMessage = function IconMessage(_ref) {
7
7
  var messageDescriptor = _ref.messageDescriptor,
8
8
  _ref$animated = _ref.animated,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["fileName", "innerRef"];
4
4
  import React from 'react';
5
- import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
5
+ import { injectIntl, IntlProvider, useIntl } from 'react-intl';
6
6
  import { messages } from '@atlaskit/media-ui';
7
7
  import { Pressable } from '@atlaskit/primitives/compiled';
8
8
  import VisuallyHidden from '@atlaskit/visually-hidden';
@@ -2,7 +2,7 @@
2
2
  import "./failedTitleBox.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
- import { FormattedMessage } from 'react-intl-next';
5
+ import { FormattedMessage } from 'react-intl';
6
6
  import EditorWarningIcon from '@atlaskit/icon/core/status-warning';
7
7
  import { messages } from '@atlaskit/media-ui';
8
8
  import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { injectIntl } from 'react-intl-next';
2
+ import { injectIntl } from 'react-intl';
3
3
  import LockFilledIcon from '@atlaskit/icon/core/lock-locked';
4
4
  import { Truncate } from '@atlaskit/media-ui/truncateText';
5
5
  import { formatDate } from '@atlaskit/media-ui/formatDate';
@@ -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.16.22",
104
+ packageName: "80.0.0",
105
105
  componentName: 'mediaInlineCard',
106
106
  component: 'mediaInlineCard'
107
107
  };
@@ -6,14 +6,15 @@ import { formatDate } from '@atlaskit/media-ui/formatDate';
6
6
  import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
7
7
  import { MediaViewer } from '@atlaskit/media-viewer';
8
8
  import Tooltip from '@atlaskit/tooltip';
9
- import React, { useEffect, useState } from 'react';
9
+ import React, { useEffect, useRef, useState } from 'react';
10
10
  import ReactDOM from 'react-dom';
11
- import { createIntl, injectIntl, IntlProvider } from 'react-intl-next';
11
+ import { createIntl, injectIntl, IntlProvider } from 'react-intl';
12
12
  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
16
  import usePressTracing from '@atlaskit/react-ufo/use-press-tracing';
17
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
18
  // UI component which renders an inline link in the appropiate state based on a media file
18
19
  export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
19
20
  var mediaClient = _ref.mediaClient,
@@ -24,7 +25,8 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
24
25
  onClick = _ref.onClick,
25
26
  mediaViewerItems = _ref.mediaViewerItems,
26
27
  intl = _ref.intl,
27
- viewerOptions = _ref.viewerOptions;
28
+ viewerOptions = _ref.viewerOptions,
29
+ fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher;
28
30
  var _useState = useState(),
29
31
  _useState2 = _slicedToArray(_useState, 2),
30
32
  fileState = _useState2[0],
@@ -45,6 +47,15 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
45
47
  _useState0 = _slicedToArray(_useState9, 2),
46
48
  isMediaViewerVisible = _useState0[0],
47
49
  setMediaViewerVisible = _useState0[1];
50
+ var _useState1 = useState(),
51
+ _useState10 = _slicedToArray(_useState1, 2),
52
+ fallbackMediaName = _useState10[0],
53
+ setFallbackMediaName = _useState10[1];
54
+ var _useState11 = useState(false),
55
+ _useState12 = _slicedToArray(_useState11, 2),
56
+ fallbackMediaNameFetchFailed = _useState12[0],
57
+ setFallbackMediaNameFetchFailed = _useState12[1];
58
+ var fallbackMediaNameFetchAttempted = useRef(false);
48
59
  var _useAnalyticsEvents = useAnalyticsEvents(),
49
60
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
50
61
  var pressTracing = usePressTracing('click-media-inline-card');
@@ -122,6 +133,16 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
122
133
  subscription === null || subscription === void 0 || subscription.unsubscribe();
123
134
  };
124
135
  }, [identifier.collectionName, identifier.id, mediaClient.file]);
136
+ useEffect(function () {
137
+ if (fileState && fileState.status !== 'error' && !fileState.name && fallbackMediaNameFetcher && !fallbackMediaNameFetchAttempted.current && expValEquals('platform_editor_media_name_fallback', 'isEnabled', true)) {
138
+ fallbackMediaNameFetchAttempted.current = true;
139
+ fallbackMediaNameFetcher(fileState.id).then(function (name) {
140
+ return setFallbackMediaName(name);
141
+ }, function () {
142
+ return setFallbackMediaNameFetchFailed(true);
143
+ });
144
+ }
145
+ }, [fileState, fallbackMediaNameFetcher]);
125
146
  if (subscribeError) {
126
147
  var errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
127
148
  var errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
@@ -144,18 +165,29 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
144
165
  }), renderMediaViewer()));
145
166
  }
146
167
 
147
- // Empty file handling
168
+ // Empty file handling — try the fallback name fetcher first if available
148
169
  if (fileState && !fileState.name) {
149
- var _error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
150
- id: fileState.id
151
- }));
152
- fireFailedOperationalEvent(_error);
153
- return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
154
- innerRef: copyNodeRef,
155
- message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
156
- isSelected: isSelected,
157
- onClick: onMediaInlineCardClick
158
- }), renderMediaViewer()));
170
+ if (fallbackMediaNameFetcher && !fallbackMediaNameFetchFailed && !fallbackMediaName && expValEquals('platform_editor_media_name_fallback', 'isEnabled', true)) {
171
+ // Fetch not yet attempted or in flight — show loading
172
+ return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
173
+ innerRef: copyNodeRef,
174
+ message: (intl || defaultIntl).formatMessage(messages.loading_file),
175
+ isSelected: isSelected
176
+ });
177
+ }
178
+ if (!expValEquals('platform_editor_media_name_fallback', 'isEnabled', true) || !fallbackMediaName) {
179
+ // No fetcher provided or fetch failed — show error
180
+ var _error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
181
+ id: fileState.id
182
+ }));
183
+ fireFailedOperationalEvent(_error);
184
+ return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
185
+ innerRef: copyNodeRef,
186
+ message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
187
+ isSelected: isSelected,
188
+ onClick: onMediaInlineCardClick
189
+ }), renderMediaViewer()));
190
+ }
159
191
  }
160
192
  if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
161
193
  return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
@@ -177,8 +209,9 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
177
209
  fireFailedOperationalEvent(undefined, 'failed-processing');
178
210
  }
179
211
  var mediaType = fileState.mediaType,
180
- name = fileState.name,
212
+ fileStateName = fileState.name,
181
213
  mimeType = fileState.mimeType;
214
+ var name = expValEquals('platform_editor_media_name_fallback', 'isEnabled', true) ? fileStateName || fallbackMediaName : fileStateName;
182
215
  var linkIcon = /*#__PURE__*/React.createElement(MimeTypeIcon, {
183
216
  testId: 'media-inline-card-file-type-icon',
184
217
  size: "small",
@@ -13,7 +13,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
13
13
  import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
14
14
  import { getMediaGlobalScope } from './globalScope/globalScope';
15
15
  var packageName = "@atlaskit/media-card";
16
- var packageVersion = "79.16.22";
16
+ var packageVersion = "80.0.0";
17
17
  var SAMPLE_RATE = 0.05;
18
18
 
19
19
  /**
@@ -1,6 +1,6 @@
1
1
  import { type FileItem, type FileDetails } from '@atlaskit/media-client';
2
2
  import { type ReactNode } from 'react';
3
- import { type MessageDescriptor } from 'react-intl-next';
3
+ import { type MessageDescriptor } from 'react-intl';
4
4
  export interface CardAction {
5
5
  label?: string;
6
6
  handler: CardEventHandler;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type WrappedComponentProps } from 'react-intl-next';
2
+ import { type WrappedComponentProps } from 'react-intl';
3
3
  import { type CardProps } from '../types';
4
4
  export type CardBaseProps = CardProps & Partial<WrappedComponentProps>;
5
5
  export declare const CardBase: ({ identifier, ...otherProps }: CardBaseProps & WrappedComponentProps) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React, { type MouseEvent } from 'react';
2
- import { type MessageDescriptor } from 'react-intl-next';
2
+ import { type MessageDescriptor } from 'react-intl';
3
3
  import { type MediaItemType, type FileDetails, type ImageResizeMode, type Identifier } from '@atlaskit/media-client';
4
4
  import { type WithAnalyticsEventsProps, type UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  import { type CardStatus, type MediaCardCursor, type CardDimensions, type TitleBoxIcon } from '../types';
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type MessageDescriptor } from 'react-intl-next';
2
+ import { type MessageDescriptor } from 'react-intl';
3
3
  export type InternalIconMessageProps = {
4
4
  messageDescriptor: MessageDescriptor;
5
5
  animated?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type WithIntlProps, type WrappedComponentProps } from 'react-intl-next';
2
+ import { type WithIntlProps, type WrappedComponentProps } from 'react-intl';
3
3
  declare const _default_1: React.FC<WithIntlProps<{
4
4
  fileName: string;
5
5
  innerRef: React.Ref<HTMLButtonElement>;
@@ -7,7 +7,7 @@ type TitleBoxWrapperStyleArgs = {
7
7
  display?: 'none' | 'flex';
8
8
  };
9
9
  export declare const titleBoxWrapperStyles: {
10
- ({ breakpoint, display, }: TitleBoxWrapperStyleArgs): SerializedStyles;
10
+ ({ breakpoint, display }: TitleBoxWrapperStyleArgs): SerializedStyles;
11
11
  displayName: string;
12
12
  };
13
13
  export declare const titleBoxHeaderStyles: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type WithIntlProps, type WrappedComponentProps } from 'react-intl-next';
2
+ import { type WithIntlProps, type WrappedComponentProps } from 'react-intl';
3
3
  import { type TitleBoxProps } from './types';
4
4
  export declare const TitleBox: React.FC<WithIntlProps<TitleBoxProps & WrappedComponentProps>> & {
5
5
  WrappedComponent: React.ComponentType<TitleBoxProps & WrappedComponentProps>;
@@ -1,4 +1,4 @@
1
- import { type MessageDescriptor } from 'react-intl-next';
1
+ import { type MessageDescriptor } from 'react-intl';
2
2
  import { type Breakpoint } from '../common';
3
3
  import { type TitleBoxIcon as TitleBoxIconType } from '../../../types';
4
4
  export type TitleBoxProps = {
@@ -1,7 +1,7 @@
1
1
  import { type FileIdentifier, type Identifier, type MediaClient } from '@atlaskit/media-client';
2
2
  import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
3
3
  import React, { type FC } from 'react';
4
- import { type WrappedComponentProps } from 'react-intl-next';
4
+ import { type WrappedComponentProps } from 'react-intl';
5
5
  import { type InlineCardOnClickCallback } from '../types';
6
6
  export interface MediaInlineCardProps {
7
7
  identifier: FileIdentifier;
@@ -12,6 +12,12 @@ export interface MediaInlineCardProps {
12
12
  onClick?: InlineCardOnClickCallback;
13
13
  mediaViewerItems?: Identifier[];
14
14
  viewerOptions?: ViewerOptionsProps;
15
+ /**
16
+ * Optional fallback fetcher to retrieve the media filename from another service
17
+ * Workaround for #hot-301450 where media service is missing filenames for DC -> Cloud migrated media
18
+ * Receives the file ID and should resolve to the filename string.
19
+ */
20
+ fallbackMediaNameFetcher?: (id: string) => Promise<string>;
15
21
  }
16
22
  export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
17
23
  export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
@@ -1,6 +1,6 @@
1
1
  import { type FileItem, type FileDetails } from '@atlaskit/media-client';
2
2
  import { type ReactNode } from 'react';
3
- import { type MessageDescriptor } from 'react-intl-next';
3
+ import { type MessageDescriptor } from 'react-intl';
4
4
  export interface CardAction {
5
5
  label?: string;
6
6
  handler: CardEventHandler;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type WrappedComponentProps } from 'react-intl-next';
2
+ import { type WrappedComponentProps } from 'react-intl';
3
3
  import { type CardProps } from '../types';
4
4
  export type CardBaseProps = CardProps & Partial<WrappedComponentProps>;
5
5
  export declare const CardBase: ({ identifier, ...otherProps }: CardBaseProps & WrappedComponentProps) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React, { type MouseEvent } from 'react';
2
- import { type MessageDescriptor } from 'react-intl-next';
2
+ import { type MessageDescriptor } from 'react-intl';
3
3
  import { type MediaItemType, type FileDetails, type ImageResizeMode, type Identifier } from '@atlaskit/media-client';
4
4
  import { type WithAnalyticsEventsProps, type UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  import { type CardStatus, type MediaCardCursor, type CardDimensions, type TitleBoxIcon } from '../types';
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type MessageDescriptor } from 'react-intl-next';
2
+ import { type MessageDescriptor } from 'react-intl';
3
3
  export type InternalIconMessageProps = {
4
4
  messageDescriptor: MessageDescriptor;
5
5
  animated?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type WithIntlProps, type WrappedComponentProps } from 'react-intl-next';
2
+ import { type WithIntlProps, type WrappedComponentProps } from 'react-intl';
3
3
  declare const _default_1: React.FC<WithIntlProps<{
4
4
  fileName: string;
5
5
  innerRef: React.Ref<HTMLButtonElement>;
@@ -7,7 +7,7 @@ type TitleBoxWrapperStyleArgs = {
7
7
  display?: 'none' | 'flex';
8
8
  };
9
9
  export declare const titleBoxWrapperStyles: {
10
- ({ breakpoint, display, }: TitleBoxWrapperStyleArgs): SerializedStyles;
10
+ ({ breakpoint, display }: TitleBoxWrapperStyleArgs): SerializedStyles;
11
11
  displayName: string;
12
12
  };
13
13
  export declare const titleBoxHeaderStyles: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type WithIntlProps, type WrappedComponentProps } from 'react-intl-next';
2
+ import { type WithIntlProps, type WrappedComponentProps } from 'react-intl';
3
3
  import { type TitleBoxProps } from './types';
4
4
  export declare const TitleBox: React.FC<WithIntlProps<TitleBoxProps & WrappedComponentProps>> & {
5
5
  WrappedComponent: React.ComponentType<TitleBoxProps & WrappedComponentProps>;
@@ -1,4 +1,4 @@
1
- import { type MessageDescriptor } from 'react-intl-next';
1
+ import { type MessageDescriptor } from 'react-intl';
2
2
  import { type Breakpoint } from '../common';
3
3
  import { type TitleBoxIcon as TitleBoxIconType } from '../../../types';
4
4
  export type TitleBoxProps = {
@@ -1,7 +1,7 @@
1
1
  import { type FileIdentifier, type Identifier, type MediaClient } from '@atlaskit/media-client';
2
2
  import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
3
3
  import React, { type FC } from 'react';
4
- import { type WrappedComponentProps } from 'react-intl-next';
4
+ import { type WrappedComponentProps } from 'react-intl';
5
5
  import { type InlineCardOnClickCallback } from '../types';
6
6
  export interface MediaInlineCardProps {
7
7
  identifier: FileIdentifier;
@@ -12,6 +12,12 @@ export interface MediaInlineCardProps {
12
12
  onClick?: InlineCardOnClickCallback;
13
13
  mediaViewerItems?: Identifier[];
14
14
  viewerOptions?: ViewerOptionsProps;
15
+ /**
16
+ * Optional fallback fetcher to retrieve the media filename from another service
17
+ * Workaround for #hot-301450 where media service is missing filenames for DC -> Cloud migrated media
18
+ * Receives the file ID and should resolve to the filename string.
19
+ */
20
+ fallbackMediaNameFetcher?: (id: string) => Promise<string>;
15
21
  }
16
22
  export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & WrappedComponentProps>;
17
23
  export declare const MediaInlineCard: React.FC<MediaInlineCardProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "79.16.23",
3
+ "version": "80.1.0",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/analytics-next": "^11.2.0",
35
35
  "@atlaskit/dropdown-menu": "^16.8.0",
36
36
  "@atlaskit/editor-shared-styles": "^3.10.0",
37
- "@atlaskit/icon": "^34.1.0",
37
+ "@atlaskit/icon": "^34.2.0",
38
38
  "@atlaskit/link": "^3.4.0",
39
39
  "@atlaskit/media-client": "^36.0.0",
40
40
  "@atlaskit/media-client-react": "^5.0.0",
@@ -42,14 +42,14 @@
42
42
  "@atlaskit/media-file-preview": "^0.16.0",
43
43
  "@atlaskit/media-state": "^2.0.0",
44
44
  "@atlaskit/media-svg": "^2.2.0",
45
- "@atlaskit/media-ui": "^28.7.0",
46
- "@atlaskit/media-viewer": "^52.9.0",
45
+ "@atlaskit/media-ui": "^29.0.0",
46
+ "@atlaskit/media-viewer": "^53.0.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/primitives": "^19.0.0",
49
- "@atlaskit/react-ufo": "^5.13.0",
49
+ "@atlaskit/react-ufo": "^5.14.0",
50
50
  "@atlaskit/spinner": "^19.1.0",
51
- "@atlaskit/theme": "^23.0.0",
52
- "@atlaskit/tmp-editor-statsig": "^62.0.0",
51
+ "@atlaskit/theme": "^23.1.0",
52
+ "@atlaskit/tmp-editor-statsig": "^62.8.0",
53
53
  "@atlaskit/tokens": "^13.0.0",
54
54
  "@atlaskit/tooltip": "^21.1.0",
55
55
  "@atlaskit/ufo": "^0.4.0",
@@ -67,7 +67,7 @@
67
67
  "@emotion/react": "^11.7.1",
68
68
  "react": "^18.2.0",
69
69
  "react-dom": "^18.2.0",
70
- "react-intl-next": "npm:react-intl@^5.18.1"
70
+ "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@af/integration-testing": "workspace:^",
@@ -76,13 +76,13 @@
76
76
  "@atlaskit/form": "^15.5.0",
77
77
  "@atlaskit/inline-message": "^15.6.0",
78
78
  "@atlaskit/media-core": "^37.0.0",
79
- "@atlaskit/media-picker": "^70.1.0",
79
+ "@atlaskit/media-picker": "^71.0.0",
80
80
  "@atlaskit/media-test-data": "^3.2.0",
81
- "@atlaskit/media-test-helpers": "^40.0.0",
81
+ "@atlaskit/media-test-helpers": "^41.0.0",
82
82
  "@atlaskit/radio": "^8.5.0",
83
83
  "@atlaskit/range": "^10.0.0",
84
84
  "@atlaskit/ssr": "workspace:^",
85
- "@atlaskit/toggle": "^15.5.0",
85
+ "@atlaskit/toggle": "^15.6.0",
86
86
  "@atlassian/a11y-jest-testing": "^0.11.0",
87
87
  "@atlassian/feature-flags-test-utils": "^1.0.0",
88
88
  "@atlassian/testing-library": "^0.5.0",
@@ -96,7 +96,7 @@
96
96
  "exenv": "^1.2.2",
97
97
  "react": "^18.2.0",
98
98
  "react-dom": "^18.2.0",
99
- "react-intl-next": "npm:react-intl@^5.18.1",
99
+ "react-intl": "^6.6.2",
100
100
  "uuid": "^3.1.0",
101
101
  "wait-for-expect": "^1.2.0"
102
102
  },
package/report.api.md CHANGED
@@ -35,7 +35,7 @@ import { SSR } from '@atlaskit/media-common';
35
35
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
36
36
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
37
37
  import { WithMediaClientConfigProps } from '@atlaskit/media-client-react';
38
- import { WrappedComponentProps } from 'react-intl-next';
38
+ import { WrappedComponentProps } from 'react-intl';
39
39
 
40
40
  // @public (undocumented)
41
41
  export function Card(props: CardWithMediaClientConfigProps): JSX.Element;
@@ -414,7 +414,7 @@ export type TitleBoxIcon = 'LockFilledIcon';
414
414
  "@emotion/react": "^11.7.1",
415
415
  "react": "^16.8.0",
416
416
  "react-dom": "^16.8.0",
417
- "react-intl-next": "npm:react-intl@^5.18.1"
417
+ "react-intl": "npm:react-intl@^5.18.1"
418
418
  }
419
419
  ```
420
420