@atlaskit/media-card 79.15.8 → 79.16.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 (31) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/card/card.js +1 -1
  3. package/dist/cjs/card/fileCard.js +4 -2
  4. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  5. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionButton-compiled.js +4 -1
  6. package/dist/cjs/inline/loader.js +1 -1
  7. package/dist/cjs/utils/ufoExperiences.js +1 -1
  8. package/dist/es2019/card/card.js +1 -1
  9. package/dist/es2019/card/fileCard.js +4 -2
  10. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  11. package/dist/es2019/card/ui/actionsBar/cardActions/cardActionButton-compiled.js +4 -1
  12. package/dist/es2019/inline/loader.js +1 -1
  13. package/dist/es2019/utils/ufoExperiences.js +1 -1
  14. package/dist/esm/card/card.js +1 -1
  15. package/dist/esm/card/fileCard.js +4 -2
  16. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  17. package/dist/esm/card/ui/actionsBar/cardActions/cardActionButton-compiled.js +4 -1
  18. package/dist/esm/inline/loader.js +1 -1
  19. package/dist/esm/utils/ufoExperiences.js +1 -1
  20. package/dist/types/card/fileCard.d.ts +4 -2
  21. package/dist/types/types.d.ts +3 -1
  22. package/dist/types-ts4.5/card/fileCard.d.ts +4 -2
  23. package/dist/types-ts4.5/types.d.ts +3 -1
  24. package/example-helpers/svg-helpers/cardContainer.tsx +9 -3
  25. package/example-helpers/svg-helpers/controls.tsx +1 -1
  26. package/example-helpers/svg-helpers/dimensionPicker.tsx +2 -2
  27. package/example-helpers/svg-helpers/mediaApiTweaks.ts +6 -6
  28. package/example-helpers/svg-helpers/svgContainer.tsx +2 -2
  29. package/example-helpers/svg-helpers/toggle.tsx +1 -1
  30. package/example-helpers/svg-helpers/uploader.ts +8 -2
  31. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 79.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6e25e8bbb01c3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e25e8bbb01c3) -
8
+ [ux] Adds mediaViewerExtensions prop to media-viewer/src/header and threads it through parents.
9
+ Allows callers to pass in additional buttons to the image / video preview'
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 79.15.9
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 79.15.8
4
22
 
5
23
  ### 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 = "0.0.0-development";
23
+ var packageVersion = "79.15.9";
24
24
  var CardBase = exports.CardBase = function CardBase(_ref) {
25
25
  var identifier = _ref.identifier,
26
26
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -93,7 +93,8 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
93
93
  viewerOptions = _ref.viewerOptions,
94
94
  includeHashForDuplicateFiles = _ref.includeHashForDuplicateFiles,
95
95
  ssrItemDetails = _ref.ssrItemDetails,
96
- onError = _ref.onError;
96
+ onError = _ref.onError,
97
+ mediaViewerExtensions = _ref.mediaViewerExtensions;
97
98
  var _useIntl = (0, _reactIntlNext.useIntl)(),
98
99
  formatMessage = _useIntl.formatMessage;
99
100
  var _useState = (0, _react.useState)(false),
@@ -786,6 +787,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
786
787
  },
787
788
  contextId: contextId,
788
789
  featureFlags: featureFlags,
789
- viewerOptions: viewerOptions
790
+ viewerOptions: viewerOptions,
791
+ extensions: mediaViewerExtensions
790
792
  }) : null, getSsrScriptProps && /*#__PURE__*/_react.default.createElement("script", getSsrScriptProps()));
791
793
  };
@@ -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 = "0.0.0-development";
90
+ var packageVersion = "79.15.9";
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)({
@@ -13,6 +13,7 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _colors = require("@atlaskit/theme/colors");
17
18
  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); }
18
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; }
@@ -24,7 +25,9 @@ var variantStyleMap = {
24
25
  var cardActionButtonStyles = null;
25
26
  var CardActionButton = exports.CardActionButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
26
27
  var _props$variant;
27
- return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({}, props, {
28
+ return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({}, props, (0, _platformFeatureFlags.fg)('platform_media_card_action_button_type_fix') ? {
29
+ type: 'button'
30
+ } : {}, {
28
31
  id: "cardActionButton",
29
32
  "data-testid": "media-card-primary-action",
30
33
  "aria-label": props.label,
@@ -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: "0.0.0-development",
119
+ packageName: "79.15.9",
120
120
  componentName: 'mediaInlineCard',
121
121
  component: 'mediaInlineCard'
122
122
  };
@@ -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 = "0.0.0-development";
22
+ var packageVersion = "79.15.9";
23
23
  var SAMPLE_RATE = 0.05;
24
24
 
25
25
  /**
@@ -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 = "0.0.0-development";
12
+ const packageVersion = "79.15.9";
13
13
  export const CardBase = ({
14
14
  identifier,
15
15
  ...otherProps
@@ -74,7 +74,8 @@ export const FileCard = ({
74
74
  viewerOptions,
75
75
  includeHashForDuplicateFiles,
76
76
  ssrItemDetails,
77
- onError
77
+ onError,
78
+ mediaViewerExtensions
78
79
  }) => {
79
80
  const {
80
81
  formatMessage
@@ -704,6 +705,7 @@ export const FileCard = ({
704
705
  },
705
706
  contextId: contextId,
706
707
  featureFlags: featureFlags,
707
- viewerOptions: viewerOptions
708
+ viewerOptions: viewerOptions,
709
+ extensions: mediaViewerExtensions
708
710
  }) : null, getSsrScriptProps && /*#__PURE__*/React.createElement("script", getSsrScriptProps()));
709
711
  };
@@ -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 = "0.0.0-development";
69
+ const packageVersion = "79.15.9";
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({
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import { forwardRef } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
 
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { N500 } from '@atlaskit/theme/colors';
10
11
  const variantStyleMap = {
11
12
  filled: "_bfhk1pja _irr3tl7t",
@@ -14,7 +15,9 @@ const variantStyleMap = {
14
15
  const cardActionButtonStyles = null;
15
16
  export const CardActionButton = /*#__PURE__*/forwardRef((props, ref) => {
16
17
  var _props$variant;
17
- return /*#__PURE__*/React.createElement("button", _extends({}, props, {
18
+ return /*#__PURE__*/React.createElement("button", _extends({}, props, fg('platform_media_card_action_button_type_fix') ? {
19
+ type: 'button'
20
+ } : {}, {
18
21
  id: "cardActionButton",
19
22
  "data-testid": "media-card-primary-action",
20
23
  "aria-label": props.label,
@@ -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: "0.0.0-development",
40
+ packageName: "79.15.9",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -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 = "0.0.0-development";
12
+ const packageVersion = "79.15.9";
13
13
  const SAMPLE_RATE = 0.05;
14
14
 
15
15
  /**
@@ -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 = "0.0.0-development";
14
+ var packageVersion = "79.15.9";
15
15
  export var CardBase = function CardBase(_ref) {
16
16
  var identifier = _ref.identifier,
17
17
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -85,7 +85,8 @@ export var FileCard = function FileCard(_ref) {
85
85
  viewerOptions = _ref.viewerOptions,
86
86
  includeHashForDuplicateFiles = _ref.includeHashForDuplicateFiles,
87
87
  ssrItemDetails = _ref.ssrItemDetails,
88
- onError = _ref.onError;
88
+ onError = _ref.onError,
89
+ mediaViewerExtensions = _ref.mediaViewerExtensions;
89
90
  var _useIntl = useIntl(),
90
91
  formatMessage = _useIntl.formatMessage;
91
92
  var _useState = useState(false),
@@ -778,6 +779,7 @@ export var FileCard = function FileCard(_ref) {
778
779
  },
779
780
  contextId: contextId,
780
781
  featureFlags: featureFlags,
781
- viewerOptions: viewerOptions
782
+ viewerOptions: viewerOptions,
783
+ extensions: mediaViewerExtensions
782
784
  }) : null, getSsrScriptProps && /*#__PURE__*/React.createElement("script", getSsrScriptProps()));
783
785
  };
@@ -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 = "0.0.0-development";
83
+ var packageVersion = "79.15.9";
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({
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
9
9
  import { forwardRef } from 'react';
10
10
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
11
 
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { N500 } from '@atlaskit/theme/colors';
13
14
  var variantStyleMap = {
14
15
  filled: "_bfhk1pja _irr3tl7t",
@@ -17,7 +18,9 @@ var variantStyleMap = {
17
18
  var cardActionButtonStyles = null;
18
19
  export var CardActionButton = /*#__PURE__*/forwardRef(function (props, ref) {
19
20
  var _props$variant;
20
- return /*#__PURE__*/React.createElement("button", _extends({}, props, {
21
+ return /*#__PURE__*/React.createElement("button", _extends({}, props, fg('platform_media_card_action_button_type_fix') ? {
22
+ type: 'button'
23
+ } : {}, {
21
24
  id: "cardActionButton",
22
25
  "data-testid": "media-card-primary-action",
23
26
  "aria-label": props.label,
@@ -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: "0.0.0-development",
104
+ packageName: "79.15.9",
105
105
  componentName: 'mediaInlineCard',
106
106
  component: 'mediaInlineCard'
107
107
  };
@@ -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 = "0.0.0-development";
16
+ var packageVersion = "79.15.9";
17
17
  var SAMPLE_RATE = 0.05;
18
18
 
19
19
  /**
@@ -1,6 +1,6 @@
1
1
  import { type FileIdentifier, type Identifier, type ImageResizeMode } from '@atlaskit/media-client';
2
2
  import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
3
- import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
3
+ import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
4
4
  import React from 'react';
5
5
  import { type MediaCardErrorPrimaryReason } from '../errors';
6
6
  import { type CardAppearance, type CardDimensions, type CardEventProps, type TitleBoxIcon } from '../types';
@@ -59,5 +59,7 @@ export interface FileCardProps extends CardEventProps {
59
59
  readonly ssrItemDetails?: SsrItemDetails;
60
60
  /** General Error handling include status errors and display errors*/
61
61
  readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
62
+ /** Extensions for the media viewer (e.g. comment button in header). */
63
+ readonly mediaViewerExtensions?: MediaViewerExtensions;
62
64
  }
63
- export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, }: FileCardProps) => React.JSX.Element;
65
+ export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
@@ -8,7 +8,7 @@ import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
8
8
  import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
9
9
  import { type CardAction } from './card/actions';
10
10
  import { type MediaCardError, type MediaCardErrorPrimaryReason } from './errors';
11
- import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
11
+ import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
12
12
  import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview';
13
13
  export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
14
14
  export type FilePreviewStatus = {
@@ -111,6 +111,8 @@ export interface CardProps extends SharedCardProps, CardEventProps {
111
111
  readonly mediaSettings?: MediaSettings;
112
112
  /** General Error handling include status errors and display errors*/
113
113
  readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
114
+ /** Extensions for the media viewer (e.g. comment button in header). */
115
+ readonly mediaViewerExtensions?: MediaViewerExtensions;
114
116
  }
115
117
  export interface CardState {
116
118
  status: CardStatus;
@@ -1,6 +1,6 @@
1
1
  import { type FileIdentifier, type Identifier, type ImageResizeMode } from '@atlaskit/media-client';
2
2
  import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
3
- import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
3
+ import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
4
4
  import React from 'react';
5
5
  import { type MediaCardErrorPrimaryReason } from '../errors';
6
6
  import { type CardAppearance, type CardDimensions, type CardEventProps, type TitleBoxIcon } from '../types';
@@ -59,5 +59,7 @@ export interface FileCardProps extends CardEventProps {
59
59
  readonly ssrItemDetails?: SsrItemDetails;
60
60
  /** General Error handling include status errors and display errors*/
61
61
  readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
62
+ /** Extensions for the media viewer (e.g. comment button in header). */
63
+ readonly mediaViewerExtensions?: MediaViewerExtensions;
62
64
  }
63
- export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, }: FileCardProps) => React.JSX.Element;
65
+ export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
@@ -8,7 +8,7 @@ import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
8
8
  import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
9
9
  import { type CardAction } from './card/actions';
10
10
  import { type MediaCardError, type MediaCardErrorPrimaryReason } from './errors';
11
- import { type ViewerOptionsProps } from '@atlaskit/media-viewer';
11
+ import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
12
12
  import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview';
13
13
  export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
14
14
  export type FilePreviewStatus = {
@@ -111,6 +111,8 @@ export interface CardProps extends SharedCardProps, CardEventProps {
111
111
  readonly mediaSettings?: MediaSettings;
112
112
  /** General Error handling include status errors and display errors*/
113
113
  readonly onError?: (reason: MediaFilePreviewErrorPrimaryReason | MediaCardErrorPrimaryReason) => void;
114
+ /** Extensions for the media viewer (e.g. comment button in header). */
115
+ readonly mediaViewerExtensions?: MediaViewerExtensions;
114
116
  }
115
117
  export interface CardState {
116
118
  status: CardStatus;
@@ -4,10 +4,16 @@
4
4
  */
5
5
  import React from 'react';
6
6
 
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766
8
8
  import { jsx } from '@emotion/react';
9
9
 
10
- export const CardBox = ({ title, children }: { title: string; children: React.ReactNode }) => (
10
+ export const CardBox = ({
11
+ title,
12
+ children,
13
+ }: {
14
+ title: string;
15
+ children: React.ReactNode;
16
+ }): jsx.JSX.Element => (
11
17
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
12
18
  <div style={{ marginBottom: '10px' }}>
13
19
  {/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/use-heading -- Ignored via go/DSP-18766 */}
@@ -16,7 +22,7 @@ export const CardBox = ({ title, children }: { title: string; children: React.Re
16
22
  </div>
17
23
  );
18
24
 
19
- export const CardRow = ({ children }: { children: React.ReactNode }) => (
25
+ export const CardRow = ({ children }: { children: React.ReactNode }): jsx.JSX.Element => (
20
26
  <div
21
27
  style={{
22
28
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -17,6 +17,6 @@ const controlsBoxStyles = xcss({
17
17
  },
18
18
  });
19
19
 
20
- export const ControlsBox = ({ children }: { children: ReactNode }) => (
20
+ export const ControlsBox = ({ children }: { children: ReactNode }): React.JSX.Element => (
21
21
  <Box xcss={controlsBoxStyles}>{children}</Box>
22
22
  );
@@ -29,7 +29,7 @@ export const DimensionPicker = ({
29
29
  targetName: string;
30
30
  dimensionName: string;
31
31
  onChange: OnValue;
32
- }) => {
32
+ }): React.JSX.Element => {
33
33
  const rangeId = `range-${targetName}-${dimensionName}`;
34
34
 
35
35
  const [isPercent, setIsPercent] = useState(initialUnit === '%');
@@ -83,7 +83,7 @@ export const DimensionsPicker = ({
83
83
  onContainerHeight: OnValue;
84
84
  onImageWidth: OnValue;
85
85
  onImageHeight: OnValue;
86
- }) => {
86
+ }): React.JSX.Element => {
87
87
  return (
88
88
  <Flex alignItems="stretch" direction="row" xcss={wrapperStyles}>
89
89
  <DimensionPicker
@@ -7,7 +7,7 @@ type Endpoints = Partial<Record<keyof MediaApi, number>>;
7
7
  export const delayApiResponses = (
8
8
  mediaApi: MediaApi,
9
9
  { getImage, getItems, getFileBinary }: Endpoints,
10
- ) => {
10
+ ): void => {
11
11
  const baseGetImage = mediaApi.getImage;
12
12
  mediaApi.getImage = async (...params) => {
13
13
  await sleep(getImage);
@@ -28,7 +28,7 @@ export const delayApiResponses = (
28
28
  };
29
29
 
30
30
  export const errorApiResponses = {
31
- getFileBinary: (mediaApi: MediaApi, error?: Error) => {
31
+ getFileBinary: (mediaApi: MediaApi, error?: Error): void => {
32
32
  mediaApi.getFileBinary = async () => {
33
33
  throw (
34
34
  error ||
@@ -39,7 +39,7 @@ export const errorApiResponses = {
39
39
  );
40
40
  };
41
41
  },
42
- getFileImage: (mediaApi: MediaApi, error?: Error) => {
42
+ getFileImage: (mediaApi: MediaApi, error?: Error): void => {
43
43
  mediaApi.getImage = async () => {
44
44
  throw (
45
45
  error ||
@@ -50,7 +50,7 @@ export const errorApiResponses = {
50
50
  );
51
51
  };
52
52
  },
53
- getArtifactBinary: (mediaApi: MediaApi, error?: Error) => {
53
+ getArtifactBinary: (mediaApi: MediaApi, error?: Error): void => {
54
54
  mediaApi.getArtifactBinary = async (...params) => {
55
55
  throw (
56
56
  error ||
@@ -61,7 +61,7 @@ export const errorApiResponses = {
61
61
  );
62
62
  };
63
63
  },
64
- uploadArtifact: (mediaApi: MediaApi, error?: Error) => {
64
+ uploadArtifact: (mediaApi: MediaApi, error?: Error): void => {
65
65
  mediaApi.uploadArtifact = async (...params) => {
66
66
  throw (
67
67
  error ||
@@ -72,7 +72,7 @@ export const errorApiResponses = {
72
72
  );
73
73
  };
74
74
  },
75
- deleteArtifact: (mediaApi: MediaApi, error?: Error) => {
75
+ deleteArtifact: (mediaApi: MediaApi, error?: Error): void => {
76
76
  mediaApi.deleteArtifact = async (...params) => {
77
77
  throw (
78
78
  error ||
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
 
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766
8
8
  import { jsx } from '@emotion/react';
9
9
 
10
10
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
@@ -28,7 +28,7 @@ export const SvgContainer = ({
28
28
  children: React.ReactNode;
29
29
  width?: string;
30
30
  height?: string;
31
- }) => {
31
+ }): jsx.JSX.Element => {
32
32
  return (
33
33
  <Box xcss={containerStyles} style={{ width, height }}>
34
34
  {children}
@@ -23,7 +23,7 @@ export const ToggleBox = ({
23
23
  }: Omit<React.ComponentProps<typeof Toggle>, 'onChange'> & {
24
24
  label: string;
25
25
  onChange: (val: boolean) => void;
26
- }) => {
26
+ }): React.JSX.Element => {
27
27
  const [id] = useState(makeid());
28
28
 
29
29
  return (
@@ -3,12 +3,18 @@ import { type SyntheticEvent, useState } from 'react';
3
3
  import { type FileIdentifier } from '@atlaskit/media-client';
4
4
  import { useMediaClient } from '@atlaskit/media-client-react';
5
5
 
6
- export const useSvgUploader = (collectionName?: string) => {
6
+ export const useSvgUploader = (
7
+ collectionName?: string,
8
+ ): {
9
+ status: string;
10
+ identifier: FileIdentifier | undefined;
11
+ uploadFn: (event: SyntheticEvent<HTMLInputElement>) => Promise<void>;
12
+ } => {
7
13
  const mediaClient = useMediaClient();
8
14
  const [identifier, setIdentifier] = useState<FileIdentifier>();
9
15
  const [status, setStatus] = useState<string>('');
10
16
 
11
- const uploadFn = async (event: SyntheticEvent<HTMLInputElement>) => {
17
+ const uploadFn = async (event: SyntheticEvent<HTMLInputElement>): Promise<void> => {
12
18
  if (!event.currentTarget.files || !event.currentTarget.files.length) {
13
19
  return;
14
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "79.15.8",
3
+ "version": "79.16.0",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,16 +40,17 @@
40
40
  "@atlaskit/media-client-react": "^5.0.0",
41
41
  "@atlaskit/media-common": "^13.0.0",
42
42
  "@atlaskit/media-file-preview": "^0.16.0",
43
+ "@atlaskit/media-state": "^2.0.0",
43
44
  "@atlaskit/media-svg": "^2.2.0",
44
45
  "@atlaskit/media-ui": "^28.7.0",
45
- "@atlaskit/media-viewer": "^52.8.0",
46
+ "@atlaskit/media-viewer": "^52.9.0",
46
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
48
  "@atlaskit/primitives": "^18.0.0",
48
49
  "@atlaskit/react-ufo": "^5.4.0",
49
50
  "@atlaskit/spinner": "^19.0.0",
50
51
  "@atlaskit/theme": "^22.0.0",
51
52
  "@atlaskit/tokens": "^11.1.0",
52
- "@atlaskit/tooltip": "^20.14.0",
53
+ "@atlaskit/tooltip": "^21.0.0",
53
54
  "@atlaskit/ufo": "^0.4.0",
54
55
  "@atlaskit/visually-hidden": "^3.0.0",
55
56
  "@babel/runtime": "^7.0.0",
@@ -75,7 +76,6 @@
75
76
  "@atlaskit/inline-message": "^15.6.0",
76
77
  "@atlaskit/media-core": "^37.0.0",
77
78
  "@atlaskit/media-picker": "^70.1.0",
78
- "@atlaskit/media-state": "^2.0.0",
79
79
  "@atlaskit/media-test-data": "^3.2.0",
80
80
  "@atlaskit/media-test-helpers": "^40.0.0",
81
81
  "@atlaskit/radio": "^8.4.0",
@@ -149,6 +149,9 @@
149
149
  },
150
150
  "dfo_attachments_late_render_fix": {
151
151
  "type": "boolean"
152
+ },
153
+ "platform_media_card_action_button_type_fix": {
154
+ "type": "boolean"
152
155
  }
153
156
  },
154
157
  "techstack": {