@atlaskit/media-card 81.8.4 → 81.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 81.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0643729dd349b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0643729dd349b) -
8
+ Make DownloadIcon decorative when parent button already has aria-label (WCAG 1.1.1). Gated behind
9
+ feature flag `platform-a11y-media-card-download-icon-decorative`.
10
+ - Updated dependencies
11
+
3
12
  ## 81.8.4
4
13
 
5
14
  ### Patch Changes
@@ -9,6 +9,7 @@ exports.createDownloadAction = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _download = _interopRequireDefault(require("@atlaskit/icon/core/download"));
12
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
12
13
  var _messages = require("@atlaskit/media-ui/messages");
13
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; }
14
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; }
@@ -34,7 +35,7 @@ var createDownloadAction = exports.createDownloadAction = function createDownloa
34
35
  icon: /*#__PURE__*/_react.default.createElement(_download.default, {
35
36
  color: isDisabled ? "var(--ds-icon-disabled, #080F214A)" : 'currentColor',
36
37
  spacing: "spacious",
37
- label: "Download"
38
+ label: (0, _fg.fg)('platform-a11y-media-card-download-icon-decorative') ? '' : 'Download'
38
39
  })
39
40
  });
40
41
  };
@@ -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 = "81.8.3";
23
+ var packageVersion = "81.8.4";
24
24
  var CardBase = exports.CardBase = function CardBase(_ref) {
25
25
  var identifier = _ref.identifier,
26
26
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -36,7 +36,7 @@ var _cardAnalytics = require("./cardAnalytics");
36
36
  var _analytics = require("../utils/analytics");
37
37
  var _cardView = require("./cardView");
38
38
  var _inlinePlayerLazy = require("./inlinePlayerLazy");
39
- var _mediaFilePreview = require("@atlaskit/media-file-preview");
39
+ var _useFilePreview2 = require("@atlaskit/media-file-preview/use-file-preview");
40
40
  var _actions = require("./actions");
41
41
  var _performance = require("./performance");
42
42
  var _dateOverrideContext = require("../dateOverrideContext");
@@ -242,7 +242,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
242
242
  alt: alt
243
243
  }) : undefined;
244
244
  }, [alt, previewDimensions, contextId, fileStateValue, identifier, originalDimensions]);
245
- var _useFilePreview = (0, _mediaFilePreview.useFilePreview)({
245
+ var _useFilePreview = (0, _useFilePreview2.useFilePreview)({
246
246
  initialFileState: initialFileState,
247
247
  useSrcSet: true,
248
248
  mediaBlobUrlAttrs: mediaBlobUrlAttrs,
@@ -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 = "81.8.3";
90
+ var packageVersion = "81.8.4";
91
91
 
92
92
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
93
93
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
@@ -116,7 +116,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
116
116
  ErrorBoundary = _this$state.ErrorBoundary;
117
117
  var analyticsContext = {
118
118
  packageVersion: "@atlaskit/media-card",
119
- packageName: "81.8.3",
119
+ packageName: "81.8.4",
120
120
  componentName: 'mediaInlineCard',
121
121
  component: 'mediaInlineCard'
122
122
  };
@@ -22,7 +22,7 @@ var _globalScope = require("./globalScope/globalScope");
22
22
  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; }
23
23
  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; }
24
24
  var packageName = "@atlaskit/media-card";
25
- var packageVersion = "81.8.3";
25
+ var packageVersion = "81.8.4";
26
26
  var SAMPLE_RATE = 0.05;
27
27
 
28
28
  /**
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import DownloadIcon from '@atlaskit/icon/core/download';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
4
  import { messages } from '@atlaskit/media-ui/messages';
4
5
  export function attachDetailsToActions(actions, details) {
5
6
  return actions.map(action => ({
@@ -25,7 +26,7 @@ export const createDownloadAction = (baseAction, formatMessage) => {
25
26
  icon: /*#__PURE__*/React.createElement(DownloadIcon, {
26
27
  color: isDisabled ? "var(--ds-icon-disabled, #080F214A)" : 'currentColor',
27
28
  spacing: "spacious",
28
- label: "Download"
29
+ label: fg('platform-a11y-media-card-download-icon-decorative') ? '' : 'Download'
29
30
  })
30
31
  };
31
32
  };
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
9
9
  import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
10
10
  import UFOLabel from '@atlaskit/react-ufo/label';
11
11
  const packageName = "@atlaskit/media-card";
12
- const packageVersion = "81.8.3";
12
+ const packageVersion = "81.8.4";
13
13
  export const CardBase = ({
14
14
  identifier,
15
15
  ...otherProps
@@ -23,7 +23,7 @@ import { fireNonCriticalErrorEvent, fireOperationalEvent, fireDownloadSucceededE
23
23
  import { fireMediaCardEvent, getAuthProviderSucceededPayload, getAuthProviderFailedPayload } from '../utils/analytics';
24
24
  import { CardView } from './cardView';
25
25
  import { InlinePlayerLazy } from './inlinePlayerLazy';
26
- import { useFilePreview } from '@atlaskit/media-file-preview';
26
+ import { useFilePreview } from '@atlaskit/media-file-preview/use-file-preview';
27
27
  import { createDownloadAction } from './actions';
28
28
  import { performanceNow } from './performance';
29
29
  import { useContext } from 'react';
@@ -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 = "81.8.3";
69
+ const packageVersion = "81.8.4";
70
70
 
71
71
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
72
72
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
37
37
  } = this.state;
38
38
  const analyticsContext = {
39
39
  packageVersion: "@atlaskit/media-card",
40
- packageName: "81.8.3",
40
+ packageName: "81.8.4",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -11,7 +11,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
11
11
  import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
12
12
  import { getMediaGlobalScope } from './globalScope/globalScope';
13
13
  const packageName = "@atlaskit/media-card";
14
- const packageVersion = "81.8.3";
14
+ const packageVersion = "81.8.4";
15
15
  const SAMPLE_RATE = 0.05;
16
16
 
17
17
  /**
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import React from 'react';
5
5
  import DownloadIcon from '@atlaskit/icon/core/download';
6
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
7
  import { messages } from '@atlaskit/media-ui/messages';
7
8
  export function attachDetailsToActions(actions, details) {
8
9
  return actions.map(function (action) {
@@ -26,7 +27,7 @@ export var createDownloadAction = function createDownloadAction(baseAction, form
26
27
  icon: /*#__PURE__*/React.createElement(DownloadIcon, {
27
28
  color: isDisabled ? "var(--ds-icon-disabled, #080F214A)" : 'currentColor',
28
29
  spacing: "spacious",
29
- label: "Download"
30
+ label: fg('platform-a11y-media-card-download-icon-decorative') ? '' : 'Download'
30
31
  })
31
32
  });
32
33
  };
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
11
11
  import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
12
12
  import UFOLabel from '@atlaskit/react-ufo/label';
13
13
  var packageName = "@atlaskit/media-card";
14
- var packageVersion = "81.8.3";
14
+ var packageVersion = "81.8.4";
15
15
  export var CardBase = function CardBase(_ref) {
16
16
  var identifier = _ref.identifier,
17
17
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -30,7 +30,7 @@ import { fireNonCriticalErrorEvent, fireOperationalEvent, fireDownloadSucceededE
30
30
  import { fireMediaCardEvent, getAuthProviderSucceededPayload, getAuthProviderFailedPayload } from '../utils/analytics';
31
31
  import { CardView } from './cardView';
32
32
  import { InlinePlayerLazy } from './inlinePlayerLazy';
33
- import { useFilePreview } from '@atlaskit/media-file-preview';
33
+ import { useFilePreview } from '@atlaskit/media-file-preview/use-file-preview';
34
34
  import { createDownloadAction } from './actions';
35
35
  import { performanceNow } from './performance';
36
36
  import { useContext } from 'react';
@@ -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 = "81.8.3";
83
+ var packageVersion = "81.8.4";
84
84
 
85
85
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
86
86
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
101
101
  ErrorBoundary = _this$state.ErrorBoundary;
102
102
  var analyticsContext = {
103
103
  packageVersion: "@atlaskit/media-card",
104
- packageName: "81.8.3",
104
+ packageName: "81.8.4",
105
105
  componentName: 'mediaInlineCard',
106
106
  component: 'mediaInlineCard'
107
107
  };
@@ -15,7 +15,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
15
15
  import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
16
16
  import { getMediaGlobalScope } from './globalScope/globalScope';
17
17
  var packageName = "@atlaskit/media-card";
18
- var packageVersion = "81.8.3";
18
+ var packageVersion = "81.8.4";
19
19
  var SAMPLE_RATE = 0.05;
20
20
 
21
21
  /**
@@ -4,7 +4,7 @@ import { type MediaItemType, type FileDetails, type ImageResizeMode, type Identi
4
4
  import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
5
5
  import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
6
6
  import { type CardStatus, type MediaCardCursor, type CardDimensions, type TitleBoxIcon } from '../types';
7
- import { type MediaFilePreview } from '@atlaskit/media-file-preview';
7
+ import type { MediaFilePreview } from '@atlaskit/media-file-preview/types';
8
8
  import { type CardAction } from './actions';
9
9
  import { type MediaCardError } from '../errors';
10
10
  export interface CardViewProps {
@@ -4,7 +4,7 @@ import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/m
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';
7
- import { type MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview';
7
+ import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview/media-file-preview-error';
8
8
  import { type CardAction } from './actions';
9
9
  import type { SsrItemDetails } from './types';
10
10
  export interface FileCardProps extends CardEventProps {
@@ -9,7 +9,7 @@ import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '
9
9
  import { type CardAction } from './card/actions';
10
10
  import { type MediaCardError, type MediaCardErrorPrimaryReason } from './errors';
11
11
  import { type ViewerOptionsProps, type MediaViewerExtensions } from '@atlaskit/media-viewer';
12
- import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview';
12
+ import type { MediaFilePreviewErrorPrimaryReason } from '@atlaskit/media-file-preview/media-file-preview-error';
13
13
  export type CardStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
14
14
  export type FilePreviewStatus = {
15
15
  hasFilesize: boolean;
@@ -14,7 +14,7 @@ import {
14
14
  import CrossIcon from '@atlaskit/icon/core/cross';
15
15
  import FabricAnalyticsListeners from '@atlaskit/analytics-listeners/FabricAnalyticsListeners';
16
16
  import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners/types';
17
- import { payloadPublisher } from '@atlassian/ufo';
17
+ import { payloadPublisher } from '@atlassian/ufo/publisher';
18
18
 
19
19
  import AnnotateIcon from '@atlaskit/icon/core/edit';
20
20
  import { SelectableCard } from './selectableCard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "81.8.4",
3
+ "version": "81.8.5",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,8 +42,8 @@
42
42
  "@atlaskit/media-file-preview": "^1.3.0",
43
43
  "@atlaskit/media-state": "^3.1.0",
44
44
  "@atlaskit/media-svg": "^3.2.0",
45
- "@atlaskit/media-ui": "^30.13.0",
46
- "@atlaskit/media-viewer": "^54.6.0",
45
+ "@atlaskit/media-ui": "^30.14.0",
46
+ "@atlaskit/media-viewer": "^54.7.0",
47
47
  "@atlaskit/platform-feature-flags": "^2.1.0",
48
48
  "@atlaskit/primitives": "^22.4.0",
49
49
  "@atlaskit/progress-bar": "^5.2.0",
@@ -174,6 +174,9 @@
174
174
  "platform_create_work_item_modernization": {
175
175
  "referenceOnly": true,
176
176
  "type": "boolean"
177
+ },
178
+ "platform-a11y-media-card-download-icon-decorative": {
179
+ "type": "boolean"
177
180
  }
178
181
  },
179
182
  "techstack": {