@atlaskit/media-card 77.10.1 → 77.10.3

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 (60) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/card/card.js +1 -1
  3. package/dist/cjs/card/cardView.js +1 -0
  4. package/dist/cjs/card/inlinePlayer.js +1 -0
  5. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  6. package/dist/cjs/card/ui/actionsBar/actionsBar.js +2 -0
  7. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionButton.js +5 -2
  8. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionIconButton.js +2 -0
  9. package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsView.js +2 -0
  10. package/dist/cjs/card/ui/actionsBar/cardActions/styles.js +1 -1
  11. package/dist/cjs/card/ui/openMediaViewerButton/openMediaViewerButton.js +10 -3
  12. package/dist/cjs/card/v2/cardV2.js +1 -1
  13. package/dist/cjs/card/v2/cardViewV2.js +1 -0
  14. package/dist/cjs/card/v2/cardviews/cardViewWrapper.js +1 -0
  15. package/dist/cjs/card/v2/inlinePlayerV2.js +1 -0
  16. package/dist/cjs/inline/loader.js +1 -1
  17. package/dist/cjs/utils/ufoExperiences.js +1 -1
  18. package/dist/es2019/card/card.js +1 -1
  19. package/dist/es2019/card/cardView.js +1 -0
  20. package/dist/es2019/card/inlinePlayer.js +1 -0
  21. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  22. package/dist/es2019/card/ui/actionsBar/actionsBar.js +2 -0
  23. package/dist/es2019/card/ui/actionsBar/cardActions/cardActionButton.js +4 -2
  24. package/dist/es2019/card/ui/actionsBar/cardActions/cardActionIconButton.js +2 -0
  25. package/dist/es2019/card/ui/actionsBar/cardActions/cardActionsView.js +2 -0
  26. package/dist/es2019/card/ui/actionsBar/cardActions/styles.js +2 -0
  27. package/dist/es2019/card/ui/openMediaViewerButton/openMediaViewerButton.js +10 -10
  28. package/dist/es2019/card/v2/cardV2.js +1 -1
  29. package/dist/es2019/card/v2/cardViewV2.js +1 -0
  30. package/dist/es2019/card/v2/cardviews/cardViewWrapper.js +1 -0
  31. package/dist/es2019/card/v2/inlinePlayerV2.js +1 -0
  32. package/dist/es2019/inline/loader.js +1 -1
  33. package/dist/es2019/utils/ufoExperiences.js +1 -1
  34. package/dist/esm/card/card.js +1 -1
  35. package/dist/esm/card/cardView.js +1 -0
  36. package/dist/esm/card/inlinePlayer.js +1 -0
  37. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  38. package/dist/esm/card/ui/actionsBar/actionsBar.js +2 -0
  39. package/dist/esm/card/ui/actionsBar/cardActions/cardActionButton.js +4 -2
  40. package/dist/esm/card/ui/actionsBar/cardActions/cardActionIconButton.js +2 -0
  41. package/dist/esm/card/ui/actionsBar/cardActions/cardActionsView.js +2 -0
  42. package/dist/esm/card/ui/actionsBar/cardActions/styles.js +1 -1
  43. package/dist/esm/card/ui/openMediaViewerButton/openMediaViewerButton.js +10 -3
  44. package/dist/esm/card/v2/cardV2.js +1 -1
  45. package/dist/esm/card/v2/cardViewV2.js +1 -0
  46. package/dist/esm/card/v2/cardviews/cardViewWrapper.js +1 -0
  47. package/dist/esm/card/v2/inlinePlayerV2.js +1 -0
  48. package/dist/esm/inline/loader.js +1 -1
  49. package/dist/esm/utils/ufoExperiences.js +1 -1
  50. package/dist/types/card/ui/actionsBar/cardActions/cardActionButton.d.ts +1 -1
  51. package/dist/types/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +2 -1
  52. package/dist/types/card/ui/actionsBar/cardActions/cardActionsView.d.ts +1 -0
  53. package/dist/types/card/ui/actionsBar/cardActions/styles.d.ts +4 -3
  54. package/dist/types/card/ui/actionsBar/types.d.ts +1 -0
  55. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionButton.d.ts +1 -1
  56. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +2 -1
  57. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsView.d.ts +1 -0
  58. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/styles.d.ts +4 -3
  59. package/dist/types-ts4.5/card/ui/actionsBar/types.d.ts +1 -0
  60. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 77.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#69454](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69454) [`41f49439d5da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/41f49439d5da) - [ux] ECA11Y-198: Add Shift + F10 shortcut to focus play/pause button when video is selected
8
+ - Updated dependencies
9
+
10
+ ## 77.10.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [#74855](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74855) [`60e3eb23093b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/60e3eb23093b) - Fixed accessiblity issue where passing label was not adding an accessible aria-label tag
15
+
3
16
  ## 77.10.1
4
17
 
5
18
  ### Patch Changes
@@ -50,7 +50,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
50
50
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
51
51
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
52
52
  var packageName = "@atlaskit/media-card";
53
- var packageVersion = "77.10.1";
53
+ var packageVersion = "77.10.3";
54
54
  var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
55
55
  (0, _inherits2.default)(CardBase, _Component);
56
56
  var _super = _createSuper(CardBase);
@@ -389,6 +389,7 @@ var CardViewBase = exports.CardViewBase = /*#__PURE__*/function (_React$Componen
389
389
  return null;
390
390
  }
391
391
  return (0, _react.jsx)(_actionsBar.ActionsBar, {
392
+ filename: metadata === null || metadata === void 0 ? void 0 : metadata.name,
392
393
  actions: actionsWithDetails
393
394
  });
394
395
  }
@@ -271,6 +271,7 @@ var InlinePlayerBase = exports.InlinePlayerBase = /*#__PURE__*/function (_Compon
271
271
  return /*#__PURE__*/_react.default.createElement(_mediaUi.CustomMediaPlayer, {
272
272
  type: "video",
273
273
  src: fileSrc,
274
+ isVideoSelected: selected,
274
275
  onFullscreenChange: onFullscreenChange,
275
276
  fileId: identifier.id,
276
277
  isAutoPlay: autoplay,
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
90
90
  }(_react.default.Component);
91
91
  (0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
92
92
  var packageName = "@atlaskit/media-card";
93
- var packageVersion = "77.10.1";
93
+ var packageVersion = "77.10.3";
94
94
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
95
95
  packageVersion: packageVersion,
96
96
  packageName: packageName,
@@ -27,6 +27,7 @@ var ActionsBar = exports.ActionsBar = /*#__PURE__*/function (_React$Component) {
27
27
  value: function render() {
28
28
  var _this$props = this.props,
29
29
  isFixed = _this$props.isFixed,
30
+ filename = _this$props.filename,
30
31
  actions = _this$props.actions;
31
32
  if (actions.length === 0) {
32
33
  return null;
@@ -34,6 +35,7 @@ var ActionsBar = exports.ActionsBar = /*#__PURE__*/function (_React$Component) {
34
35
  return /*#__PURE__*/_react.default.createElement(_actionsBarWrapper.ActionsBarWrapper, {
35
36
  isFixed: isFixed
36
37
  }, /*#__PURE__*/_react.default.createElement(_cardActions.CardActionsView, {
38
+ filename: filename,
37
39
  actions: actions,
38
40
  variant: _cardActions.CardActionIconButtonVariant.filled
39
41
  }));
@@ -1,22 +1,25 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.CardActionButton = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
9
  var _react = require("react");
8
10
  var _react2 = require("@emotion/react");
9
11
  var _styles = require("./styles");
10
12
  /**@jsx jsx */
11
13
 
12
14
  var CardActionButton = exports.CardActionButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
13
- return (0, _react2.jsx)("div", {
15
+ return (0, _react2.jsx)("button", (0, _extends2.default)({}, props, {
14
16
  id: "cardActionButton",
15
17
  "data-testid": "media-card-primary-action",
18
+ "aria-label": props.label,
16
19
  css: (0, _styles.cardActionButtonStyles)(props),
17
20
  style: props.style,
18
21
  onClick: props.onClick,
19
22
  onMouseDown: props.onMouseDown,
20
23
  ref: ref
21
- }, props.children);
24
+ }), props.children);
22
25
  });
@@ -41,6 +41,7 @@ var CardActionIconButton = exports.CardActionIconButton = /*#__PURE__*/function
41
41
  value: function render() {
42
42
  var _this$props = this.props,
43
43
  icon = _this$props.icon,
44
+ label = _this$props.label,
44
45
  triggerColor = _this$props.triggerColor,
45
46
  onClick = _this$props.onClick,
46
47
  variant = _this$props.variant;
@@ -50,6 +51,7 @@ var CardActionIconButton = exports.CardActionIconButton = /*#__PURE__*/function
50
51
  style: {
51
52
  color: triggerColor
52
53
  },
54
+ label: label,
53
55
  variant: variant
54
56
  }, icon);
55
57
  }
@@ -48,6 +48,7 @@ var CardActionsView = exports.CardActionsView = /*#__PURE__*/function (_Componen
48
48
  value: function renderActionIconButton(action, isPrimary) {
49
49
  var _this$props = this.props,
50
50
  triggerColor = _this$props.triggerColor,
51
+ filename = _this$props.filename,
51
52
  variant = _this$props.variant;
52
53
  var icon = action.icon,
53
54
  handler = action.handler,
@@ -66,6 +67,7 @@ var CardActionsView = exports.CardActionsView = /*#__PURE__*/function (_Componen
66
67
  })(CardActionIconButtonWithProps);
67
68
  return (0, _react.jsx)(CardActionIconButtonWithAnalytics, {
68
69
  icon: icon,
70
+ label: filename ? "".concat(filename, " \u2014 ").concat(label) : label,
69
71
  triggerColor: triggerColor,
70
72
  onClick: function onClick() {
71
73
  return handler();
@@ -26,5 +26,5 @@ var getVariantStyles = function getVariantStyles(variant) {
26
26
  };
27
27
  var cardActionButtonStyles = exports.cardActionButtonStyles = function cardActionButtonStyles(_ref) {
28
28
  var variant = _ref.variant;
29
- return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), _mediaUi.center, _mediaUi.borderRadius, (0, _mediaUi.size)(26), "var(--ds-icon, ".concat(_colors.N500, ")"), getVariantStyles(variant));
29
+ return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), _mediaUi.center, _mediaUi.borderRadius, (0, _mediaUi.size)(26), "var(--ds-icon, ".concat(_colors.N500, ")"), getVariantStyles(variant));
30
30
  };
@@ -7,15 +7,22 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.visuallyHiddenStyles = 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
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
10
  var _react = require("@emotion/react");
12
11
  var _react2 = _interopRequireDefault(require("react"));
13
12
  var _reactIntlNext = require("react-intl-next");
14
13
  var _mediaUi = require("@atlaskit/media-ui");
15
14
  var _excluded = ["fileName", "innerRef"];
16
- var _templateObject;
17
15
  /** @jsx jsx */
18
- var visuallyHiddenStyles = exports.visuallyHiddenStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 1px;\n height: 1px;\n padding: 0;\n position: fixed;\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n overflow: hidden;\n white-space: nowrap;\n"])));
16
+ var visuallyHiddenStyles = exports.visuallyHiddenStyles = (0, _react.css)({
17
+ width: '1px',
18
+ height: '1px',
19
+ padding: 0,
20
+ position: 'absolute',
21
+ border: 0,
22
+ clip: 'rect(1px, 1px, 1px, 1px)',
23
+ overflow: 'hidden',
24
+ whiteSpace: 'nowrap'
25
+ });
19
26
  var OpenMediaViewerButton = function OpenMediaViewerButton(_ref) {
20
27
  var fileName = _ref.fileName,
21
28
  innerRef = _ref.innerRef,
@@ -16,7 +16,7 @@ var _externalImageCard = require("./externalImageCard");
16
16
  var _fileCard = require("./fileCard");
17
17
  var _excluded = ["identifier"];
18
18
  var packageName = "@atlaskit/media-card";
19
- var packageVersion = "77.10.1";
19
+ var packageVersion = "77.10.3";
20
20
  var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
21
21
  var identifier = _ref.identifier,
22
22
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -262,6 +262,7 @@ var CardViewV2Base = exports.CardViewV2Base = function CardViewV2Base(_ref) {
262
262
  }), renderTickBox && (0, _react.jsx)(_tickBox.TickBox, {
263
263
  selected: selected
264
264
  })), disableOverlay || !actions || actions.length === 0 ? null : (0, _react.jsx)(_actionsBar.ActionsBar, {
265
+ filename: name,
265
266
  actions: actionsWithDetails
266
267
  }));
267
268
  return (0, _react.jsx)(_react2.default.Fragment, null, shouldOpenMediaViewer && (0, _react.jsx)(_openMediaViewerButton.default, {
@@ -69,6 +69,7 @@ var CardViewWrapper = exports.CardViewWrapper = /*#__PURE__*/_react2.default.for
69
69
  }, props), children, customBlanket ? customBlanket() : defaultBlanket, customTitleBox ? customTitleBox() : defaultTitleBox, !disableOverlay && !!selectable && (0, _react.jsx)(_tickBox.TickBox, {
70
70
  selected: selected
71
71
  }), progressBar && progressBar()), !disableOverlay && actions && actions.length !== 0 && (0, _react.jsx)(_actionsBar.ActionsBar, {
72
+ filename: name,
72
73
  actions: actionsWithDetails
73
74
  }));
74
75
  var shouldRenderPlayButton = function shouldRenderPlayButton() {
@@ -188,6 +188,7 @@ var InlinePlayerBaseV2 = exports.InlinePlayerBaseV2 = function InlinePlayerBaseV
188
188
  fileId: id,
189
189
  isAutoPlay: autoplay,
190
190
  isHDAvailable: false,
191
+ isVideoSelected: selected,
191
192
  onDownloadClick: function onDownloadClick() {
192
193
  mediaClient.file.downloadBinary(id, undefined, collectionName);
193
194
  },
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
119
119
  ErrorBoundary = _this$state.ErrorBoundary;
120
120
  var analyticsContext = {
121
121
  packageVersion: "@atlaskit/media-card",
122
- packageName: "77.10.1",
122
+ packageName: "77.10.3",
123
123
  componentName: 'mediaInlineCard',
124
124
  component: 'mediaInlineCard'
125
125
  };
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
16
  var packageName = "@atlaskit/media-card";
17
- var packageVersion = "77.10.1";
17
+ var packageVersion = "77.10.3";
18
18
  var concurrentExperience;
19
19
  var getExperience = function getExperience(id) {
20
20
  if (!concurrentExperience) {
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
28
28
  import { generateUniqueId } from '../utils/generateUniqueId';
29
29
  import { DateOverrideContext } from '../dateOverrideContext';
30
30
  const packageName = "@atlaskit/media-card";
31
- const packageVersion = "77.10.1";
31
+ const packageVersion = "77.10.3";
32
32
  export class CardBase extends Component {
33
33
  constructor(props) {
34
34
  super(props);
@@ -376,6 +376,7 @@ export class CardViewBase extends React.Component {
376
376
  return null;
377
377
  }
378
378
  return jsx(ActionsBar, {
379
+ filename: metadata === null || metadata === void 0 ? void 0 : metadata.name,
379
380
  actions: actionsWithDetails
380
381
  });
381
382
  }
@@ -214,6 +214,7 @@ export class InlinePlayerBase extends Component {
214
214
  }, /*#__PURE__*/React.createElement(InactivityDetector, null, checkMouseMovement => /*#__PURE__*/React.createElement(CustomMediaPlayer, {
215
215
  type: "video",
216
216
  src: fileSrc,
217
+ isVideoSelected: selected,
217
218
  onFullscreenChange: onFullscreenChange,
218
219
  fileId: identifier.id,
219
220
  isAutoPlay: autoplay,
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
66
66
  }
67
67
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
68
68
  const packageName = "@atlaskit/media-card";
69
- const packageVersion = "77.10.1";
69
+ const packageVersion = "77.10.3";
70
70
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
71
71
  packageVersion,
72
72
  packageName,
@@ -5,6 +5,7 @@ export class ActionsBar extends React.Component {
5
5
  render() {
6
6
  const {
7
7
  isFixed,
8
+ filename,
8
9
  actions
9
10
  } = this.props;
10
11
  if (actions.length === 0) {
@@ -13,6 +14,7 @@ export class ActionsBar extends React.Component {
13
14
  return /*#__PURE__*/React.createElement(ActionsBarWrapper, {
14
15
  isFixed: isFixed
15
16
  }, /*#__PURE__*/React.createElement(CardActionsView, {
17
+ filename: filename,
16
18
  actions: actions,
17
19
  variant: CardActionIconButtonVariant.filled
18
20
  }));
@@ -1,15 +1,17 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /**@jsx jsx */
2
3
  import { forwardRef } from 'react';
3
4
  import { jsx } from '@emotion/react';
4
5
  import { cardActionButtonStyles } from './styles';
5
6
  export const CardActionButton = /*#__PURE__*/forwardRef((props, ref) => {
6
- return jsx("div", {
7
+ return jsx("button", _extends({}, props, {
7
8
  id: "cardActionButton",
8
9
  "data-testid": "media-card-primary-action",
10
+ "aria-label": props.label,
9
11
  css: cardActionButtonStyles(props),
10
12
  style: props.style,
11
13
  onClick: props.onClick,
12
14
  onMouseDown: props.onMouseDown,
13
15
  ref: ref
14
- }, props.children);
16
+ }), props.children);
15
17
  });
@@ -14,6 +14,7 @@ export class CardActionIconButton extends Component {
14
14
  render() {
15
15
  const {
16
16
  icon,
17
+ label,
17
18
  triggerColor,
18
19
  onClick,
19
20
  variant
@@ -24,6 +25,7 @@ export class CardActionIconButton extends Component {
24
25
  style: {
25
26
  color: triggerColor
26
27
  },
28
+ label: label,
27
29
  variant: variant
28
30
  }, icon);
29
31
  }
@@ -25,6 +25,7 @@ export class CardActionsView extends Component {
25
25
  renderActionIconButton(action, isPrimary) {
26
26
  const {
27
27
  triggerColor,
28
+ filename,
28
29
  variant
29
30
  } = this.props;
30
31
  const {
@@ -46,6 +47,7 @@ export class CardActionsView extends Component {
46
47
  })(CardActionIconButtonWithProps);
47
48
  return jsx(CardActionIconButtonWithAnalytics, {
48
49
  icon: icon,
50
+ label: filename ? `${filename} — ${label}` : label,
49
51
  triggerColor: triggerColor,
50
52
  onClick: () => handler(),
51
53
  variant: variant
@@ -43,6 +43,8 @@ const getVariantStyles = variant => {
43
43
  export const cardActionButtonStyles = ({
44
44
  variant
45
45
  }) => css`
46
+ appearance: none;
47
+ border: none;
46
48
  ${center}
47
49
  ${borderRadius}
48
50
  ${size(26)}
@@ -4,16 +4,16 @@ import { jsx, css } from '@emotion/react';
4
4
  import React from 'react';
5
5
  import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
6
6
  import { messages } from '@atlaskit/media-ui';
7
- export const visuallyHiddenStyles = css`
8
- width: 1px;
9
- height: 1px;
10
- padding: 0;
11
- position: fixed;
12
- border: 0;
13
- clip: rect(1px, 1px, 1px, 1px);
14
- overflow: hidden;
15
- white-space: nowrap;
16
- `;
7
+ export const visuallyHiddenStyles = css({
8
+ width: '1px',
9
+ height: '1px',
10
+ padding: 0,
11
+ position: 'absolute',
12
+ border: 0,
13
+ clip: 'rect(1px, 1px, 1px, 1px)',
14
+ overflow: 'hidden',
15
+ whiteSpace: 'nowrap'
16
+ });
17
17
  const OpenMediaViewerButton = ({
18
18
  fileName,
19
19
  innerRef,
@@ -7,7 +7,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
7
7
  import { ExternalImageCard } from './externalImageCard';
8
8
  import { FileCard } from './fileCard';
9
9
  const packageName = "@atlaskit/media-card";
10
- const packageVersion = "77.10.1";
10
+ const packageVersion = "77.10.3";
11
11
  export const CardV2Base = ({
12
12
  identifier,
13
13
  ...otherProps
@@ -257,6 +257,7 @@ export const CardViewV2Base = ({
257
257
  }), renderTickBox && jsx(TickBox, {
258
258
  selected: selected
259
259
  })), disableOverlay || !actions || actions.length === 0 ? null : jsx(ActionsBar, {
260
+ filename: name,
260
261
  actions: actionsWithDetails
261
262
  }));
262
263
  return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
@@ -60,6 +60,7 @@ export const CardViewWrapper = /*#__PURE__*/React.forwardRef(({
60
60
  }, props), children, customBlanket ? customBlanket() : defaultBlanket, customTitleBox ? customTitleBox() : defaultTitleBox, !disableOverlay && !!selectable && jsx(TickBox, {
61
61
  selected: selected
62
62
  }), progressBar && progressBar()), !disableOverlay && actions && actions.length !== 0 && jsx(ActionsBar, {
63
+ filename: name,
63
64
  actions: actionsWithDetails
64
65
  }));
65
66
  const shouldRenderPlayButton = () => {
@@ -131,6 +131,7 @@ export const InlinePlayerBaseV2 = ({
131
131
  fileId: id,
132
132
  isAutoPlay: autoplay,
133
133
  isHDAvailable: false,
134
+ isVideoSelected: selected,
134
135
  onDownloadClick: () => {
135
136
  mediaClient.file.downloadBinary(id, undefined, collectionName);
136
137
  },
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
37
37
  } = this.state;
38
38
  const analyticsContext = {
39
39
  packageVersion: "@atlaskit/media-card",
40
- packageName: "77.10.1",
40
+ packageName: "77.10.3",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
4
4
  import { MediaCardError } from '../errors';
5
5
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
6
6
  const packageName = "@atlaskit/media-card";
7
- const packageVersion = "77.10.1";
7
+ const packageVersion = "77.10.3";
8
8
  let concurrentExperience;
9
9
  const getExperience = id => {
10
10
  if (!concurrentExperience) {
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
41
41
  import { generateUniqueId } from '../utils/generateUniqueId';
42
42
  import { DateOverrideContext } from '../dateOverrideContext';
43
43
  var packageName = "@atlaskit/media-card";
44
- var packageVersion = "77.10.1";
44
+ var packageVersion = "77.10.3";
45
45
  export var CardBase = /*#__PURE__*/function (_Component) {
46
46
  _inherits(CardBase, _Component);
47
47
  var _super = _createSuper(CardBase);
@@ -383,6 +383,7 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
383
383
  return null;
384
384
  }
385
385
  return jsx(ActionsBar, {
386
+ filename: metadata === null || metadata === void 0 ? void 0 : metadata.name,
386
387
  actions: actionsWithDetails
387
388
  });
388
389
  }
@@ -262,6 +262,7 @@ export var InlinePlayerBase = /*#__PURE__*/function (_Component) {
262
262
  return /*#__PURE__*/React.createElement(CustomMediaPlayer, {
263
263
  type: "video",
264
264
  src: fileSrc,
265
+ isVideoSelected: selected,
265
266
  onFullscreenChange: onFullscreenChange,
266
267
  fileId: identifier.id,
267
268
  isAutoPlay: autoplay,
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
83
83
  }(React.Component);
84
84
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
85
85
  var packageName = "@atlaskit/media-card";
86
- var packageVersion = "77.10.1";
86
+ var packageVersion = "77.10.3";
87
87
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
88
88
  packageVersion: packageVersion,
89
89
  packageName: packageName,
@@ -20,6 +20,7 @@ export var ActionsBar = /*#__PURE__*/function (_React$Component) {
20
20
  value: function render() {
21
21
  var _this$props = this.props,
22
22
  isFixed = _this$props.isFixed,
23
+ filename = _this$props.filename,
23
24
  actions = _this$props.actions;
24
25
  if (actions.length === 0) {
25
26
  return null;
@@ -27,6 +28,7 @@ export var ActionsBar = /*#__PURE__*/function (_React$Component) {
27
28
  return /*#__PURE__*/React.createElement(ActionsBarWrapper, {
28
29
  isFixed: isFixed
29
30
  }, /*#__PURE__*/React.createElement(CardActionsView, {
31
+ filename: filename,
30
32
  actions: actions,
31
33
  variant: CardActionIconButtonVariant.filled
32
34
  }));
@@ -1,15 +1,17 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /**@jsx jsx */
2
3
  import { forwardRef } from 'react';
3
4
  import { jsx } from '@emotion/react';
4
5
  import { cardActionButtonStyles } from './styles';
5
6
  export var CardActionButton = /*#__PURE__*/forwardRef(function (props, ref) {
6
- return jsx("div", {
7
+ return jsx("button", _extends({}, props, {
7
8
  id: "cardActionButton",
8
9
  "data-testid": "media-card-primary-action",
10
+ "aria-label": props.label,
9
11
  css: cardActionButtonStyles(props),
10
12
  style: props.style,
11
13
  onClick: props.onClick,
12
14
  onMouseDown: props.onMouseDown,
13
15
  ref: ref
14
- }, props.children);
16
+ }), props.children);
15
17
  });
@@ -32,6 +32,7 @@ export var CardActionIconButton = /*#__PURE__*/function (_Component) {
32
32
  value: function render() {
33
33
  var _this$props = this.props,
34
34
  icon = _this$props.icon,
35
+ label = _this$props.label,
35
36
  triggerColor = _this$props.triggerColor,
36
37
  onClick = _this$props.onClick,
37
38
  variant = _this$props.variant;
@@ -41,6 +42,7 @@ export var CardActionIconButton = /*#__PURE__*/function (_Component) {
41
42
  style: {
42
43
  color: triggerColor
43
44
  },
45
+ label: label,
44
46
  variant: variant
45
47
  }, icon);
46
48
  }
@@ -42,6 +42,7 @@ export var CardActionsView = /*#__PURE__*/function (_Component) {
42
42
  value: function renderActionIconButton(action, isPrimary) {
43
43
  var _this$props = this.props,
44
44
  triggerColor = _this$props.triggerColor,
45
+ filename = _this$props.filename,
45
46
  variant = _this$props.variant;
46
47
  var icon = action.icon,
47
48
  handler = action.handler,
@@ -60,6 +61,7 @@ export var CardActionsView = /*#__PURE__*/function (_Component) {
60
61
  })(CardActionIconButtonWithProps);
61
62
  return jsx(CardActionIconButtonWithAnalytics, {
62
63
  icon: icon,
64
+ label: filename ? "".concat(filename, " \u2014 ").concat(label) : label,
63
65
  triggerColor: triggerColor,
64
66
  onClick: function onClick() {
65
67
  return handler();
@@ -19,5 +19,5 @@ var getVariantStyles = function getVariantStyles(variant) {
19
19
  };
20
20
  export var cardActionButtonStyles = function cardActionButtonStyles(_ref) {
21
21
  var variant = _ref.variant;
22
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), center, borderRadius, size(26), "var(--ds-icon, ".concat(N500, ")"), getVariantStyles(variant));
22
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n appearance: none;\n border: none;\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), center, borderRadius, size(26), "var(--ds-icon, ".concat(N500, ")"), getVariantStyles(variant));
23
23
  };
@@ -1,14 +1,21 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
3
  var _excluded = ["fileName", "innerRef"];
5
- var _templateObject;
6
4
  /** @jsx jsx */
7
5
  import { jsx, css } from '@emotion/react';
8
6
  import React from 'react';
9
7
  import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
10
8
  import { messages } from '@atlaskit/media-ui';
11
- export var visuallyHiddenStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 1px;\n height: 1px;\n padding: 0;\n position: fixed;\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n overflow: hidden;\n white-space: nowrap;\n"])));
9
+ export var visuallyHiddenStyles = css({
10
+ width: '1px',
11
+ height: '1px',
12
+ padding: 0,
13
+ position: 'absolute',
14
+ border: 0,
15
+ clip: 'rect(1px, 1px, 1px, 1px)',
16
+ overflow: 'hidden',
17
+ whiteSpace: 'nowrap'
18
+ });
12
19
  var OpenMediaViewerButton = function OpenMediaViewerButton(_ref) {
13
20
  var fileName = _ref.fileName,
14
21
  innerRef = _ref.innerRef,
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
9
9
  import { ExternalImageCard } from './externalImageCard';
10
10
  import { FileCard } from './fileCard';
11
11
  var packageName = "@atlaskit/media-card";
12
- var packageVersion = "77.10.1";
12
+ var packageVersion = "77.10.3";
13
13
  export var CardV2Base = function CardV2Base(_ref) {
14
14
  var identifier = _ref.identifier,
15
15
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -253,6 +253,7 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
253
253
  }), renderTickBox && jsx(TickBox, {
254
254
  selected: selected
255
255
  })), disableOverlay || !actions || actions.length === 0 ? null : jsx(ActionsBar, {
256
+ filename: name,
256
257
  actions: actionsWithDetails
257
258
  }));
258
259
  return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
@@ -62,6 +62,7 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
62
62
  }, props), children, customBlanket ? customBlanket() : defaultBlanket, customTitleBox ? customTitleBox() : defaultTitleBox, !disableOverlay && !!selectable && jsx(TickBox, {
63
63
  selected: selected
64
64
  }), progressBar && progressBar()), !disableOverlay && actions && actions.length !== 0 && jsx(ActionsBar, {
65
+ filename: name,
65
66
  actions: actionsWithDetails
66
67
  }));
67
68
  var shouldRenderPlayButton = function shouldRenderPlayButton() {
@@ -178,6 +178,7 @@ export var InlinePlayerBaseV2 = function InlinePlayerBaseV2(_ref) {
178
178
  fileId: id,
179
179
  isAutoPlay: autoplay,
180
180
  isHDAvailable: false,
181
+ isVideoSelected: selected,
181
182
  onDownloadClick: function onDownloadClick() {
182
183
  mediaClient.file.downloadBinary(id, undefined, collectionName);
183
184
  },
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
103
103
  ErrorBoundary = _this$state.ErrorBoundary;
104
104
  var analyticsContext = {
105
105
  packageVersion: "@atlaskit/media-card",
106
- packageName: "77.10.1",
106
+ packageName: "77.10.3",
107
107
  componentName: 'mediaInlineCard',
108
108
  component: 'mediaInlineCard'
109
109
  };
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
7
7
  import { MediaCardError } from '../errors';
8
8
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
9
9
  var packageName = "@atlaskit/media-card";
10
- var packageVersion = "77.10.1";
10
+ var packageVersion = "77.10.3";
11
11
  var concurrentExperience;
12
12
  var getExperience = function getExperience(id) {
13
13
  if (!concurrentExperience) {
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { CardActionButtonOwnProps } from './styles';
3
- export declare const CardActionButton: import("react").ForwardRefExoticComponent<CardActionButtonOwnProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const CardActionButton: import("react").ForwardRefExoticComponent<CardActionButtonOwnProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -2,9 +2,10 @@ import { Component, ReactNode, MouseEvent } from 'react';
2
2
  import { CardActionIconButtonVariant } from './styles';
3
3
  export type CardActionIconButtonProps = {
4
4
  readonly icon: ReactNode;
5
+ readonly label?: string;
5
6
  readonly variant?: CardActionIconButtonVariant;
6
7
  readonly triggerColor?: string;
7
- readonly onClick?: (event: MouseEvent<HTMLDivElement>) => void;
8
+ readonly onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
8
9
  };
9
10
  export declare class CardActionIconButton extends Component<CardActionIconButtonProps> {
10
11
  render(): JSX.Element;
@@ -3,6 +3,7 @@ import { CardAction } from '../../../actions';
3
3
  import { CardActionIconButtonVariant } from './styles';
4
4
  export interface CardActionsViewProps {
5
5
  readonly actions: CardAction[];
6
+ readonly filename?: string;
6
7
  readonly onToggle?: (attrs: {
7
8
  isOpen: boolean;
8
9
  }) => void;
@@ -7,12 +7,13 @@ export declare enum CardActionIconButtonVariant {
7
7
  }
8
8
  export type CardActionButtonOwnProps = {
9
9
  variant?: CardActionIconButtonVariant;
10
+ label?: string;
10
11
  style?: {
11
12
  color: string | undefined;
12
13
  };
13
- onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
14
- onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
14
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
15
+ onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
15
16
  children?: React.ReactNode;
16
17
  };
17
- export type CardActionButtonProps = CardActionButtonOwnProps & HTMLAttributes<HTMLDivElement>;
18
+ export type CardActionButtonProps = CardActionButtonOwnProps & HTMLAttributes<HTMLButtonElement>;
18
19
  export declare const cardActionButtonStyles: ({ variant, }: CardActionButtonProps) => import("@emotion/react").SerializedStyles;
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { CardAction } from '../../actions';
3
3
  export interface ActionsBarProps {
4
4
  actions: Array<CardAction>;
5
+ filename?: string;
5
6
  isFixed?: boolean;
6
7
  }
7
8
  export type ActionBarWrapperProps = {
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { CardActionButtonOwnProps } from './styles';
3
- export declare const CardActionButton: import("react").ForwardRefExoticComponent<CardActionButtonOwnProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const CardActionButton: import("react").ForwardRefExoticComponent<CardActionButtonOwnProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -2,9 +2,10 @@ import { Component, ReactNode, MouseEvent } from 'react';
2
2
  import { CardActionIconButtonVariant } from './styles';
3
3
  export type CardActionIconButtonProps = {
4
4
  readonly icon: ReactNode;
5
+ readonly label?: string;
5
6
  readonly variant?: CardActionIconButtonVariant;
6
7
  readonly triggerColor?: string;
7
- readonly onClick?: (event: MouseEvent<HTMLDivElement>) => void;
8
+ readonly onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
8
9
  };
9
10
  export declare class CardActionIconButton extends Component<CardActionIconButtonProps> {
10
11
  render(): JSX.Element;
@@ -3,6 +3,7 @@ import { CardAction } from '../../../actions';
3
3
  import { CardActionIconButtonVariant } from './styles';
4
4
  export interface CardActionsViewProps {
5
5
  readonly actions: CardAction[];
6
+ readonly filename?: string;
6
7
  readonly onToggle?: (attrs: {
7
8
  isOpen: boolean;
8
9
  }) => void;
@@ -7,12 +7,13 @@ export declare enum CardActionIconButtonVariant {
7
7
  }
8
8
  export type CardActionButtonOwnProps = {
9
9
  variant?: CardActionIconButtonVariant;
10
+ label?: string;
10
11
  style?: {
11
12
  color: string | undefined;
12
13
  };
13
- onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
14
- onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
14
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
15
+ onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
15
16
  children?: React.ReactNode;
16
17
  };
17
- export type CardActionButtonProps = CardActionButtonOwnProps & HTMLAttributes<HTMLDivElement>;
18
+ export type CardActionButtonProps = CardActionButtonOwnProps & HTMLAttributes<HTMLButtonElement>;
18
19
  export declare const cardActionButtonStyles: ({ variant, }: CardActionButtonProps) => import("@emotion/react").SerializedStyles;
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { CardAction } from '../../actions';
3
3
  export interface ActionsBarProps {
4
4
  actions: Array<CardAction>;
5
+ filename?: string;
5
6
  isFixed?: boolean;
6
7
  }
7
8
  export type ActionBarWrapperProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "77.10.1",
3
+ "version": "77.10.3",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,17 +39,17 @@
39
39
  "@atlaskit/analytics-next": "^9.2.0",
40
40
  "@atlaskit/dropdown-menu": "^12.5.0",
41
41
  "@atlaskit/editor-shared-styles": "^2.9.0",
42
- "@atlaskit/icon": "^22.0.0",
42
+ "@atlaskit/icon": "^22.1.0",
43
43
  "@atlaskit/media-client": "^26.2.0",
44
44
  "@atlaskit/media-client-react": "^2.0.0",
45
45
  "@atlaskit/media-common": "^11.0.0",
46
46
  "@atlaskit/media-file-preview": "^0.5.0",
47
- "@atlaskit/media-ui": "^25.1.0",
47
+ "@atlaskit/media-ui": "^25.2.0",
48
48
  "@atlaskit/media-viewer": "^48.2.0",
49
49
  "@atlaskit/platform-feature-flags": "^0.2.2",
50
50
  "@atlaskit/spinner": "^16.0.0",
51
51
  "@atlaskit/theme": "^12.6.0",
52
- "@atlaskit/tokens": "^1.37.0",
52
+ "@atlaskit/tokens": "^1.38.0",
53
53
  "@atlaskit/tooltip": "^18.1.0",
54
54
  "@atlaskit/ufo": "^0.2.0",
55
55
  "@babel/runtime": "^7.0.0",