@atlaskit/media-card 79.11.2 → 79.11.4

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 (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/card/actions.js +1 -1
  3. package/dist/cjs/card/card.js +9 -2
  4. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  5. package/dist/cjs/card/svgView/svgViewV2.js +7 -4
  6. package/dist/cjs/card/ui/playButton/playButtonBackground.js +5 -2
  7. package/dist/cjs/inline/loader.js +1 -1
  8. package/dist/cjs/utils/lightCards/errorIcon/index.js +7 -5
  9. package/dist/cjs/utils/lightCards/lightCardWrappers.js +4 -2
  10. package/dist/cjs/utils/ufoExperiences.js +1 -1
  11. package/dist/es2019/card/actions.js +1 -1
  12. package/dist/es2019/card/card.js +7 -2
  13. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  14. package/dist/es2019/card/svgView/svgViewV2.js +1 -0
  15. package/dist/es2019/card/ui/playButton/playButtonBackground.js +1 -0
  16. package/dist/es2019/inline/loader.js +1 -1
  17. package/dist/es2019/utils/lightCards/errorIcon/index.js +1 -0
  18. package/dist/es2019/utils/lightCards/lightCardWrappers.js +1 -0
  19. package/dist/es2019/utils/ufoExperiences.js +1 -1
  20. package/dist/esm/card/actions.js +1 -1
  21. package/dist/esm/card/card.js +9 -2
  22. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  23. package/dist/esm/card/svgView/svgViewV2.js +1 -0
  24. package/dist/esm/card/ui/playButton/playButtonBackground.js +1 -0
  25. package/dist/esm/inline/loader.js +1 -1
  26. package/dist/esm/utils/lightCards/errorIcon/index.js +1 -0
  27. package/dist/esm/utils/lightCards/lightCardWrappers.js +1 -0
  28. package/dist/esm/utils/ufoExperiences.js +1 -1
  29. package/dist/types/card/svgView/svgViewV2.d.ts +2 -2
  30. package/dist/types/card/ui/playButton/playButtonBackground.d.ts +2 -2
  31. package/dist/types/utils/lightCards/errorIcon/index.d.ts +2 -2
  32. package/dist/types/utils/lightCards/lightCardWrappers.d.ts +2 -2
  33. package/dist/types-ts4.5/card/svgView/svgViewV2.d.ts +2 -2
  34. package/dist/types-ts4.5/card/ui/playButton/playButtonBackground.d.ts +2 -2
  35. package/dist/types-ts4.5/utils/lightCards/errorIcon/index.d.ts +2 -2
  36. package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +2 -2
  37. package/example-helpers/DelayedRender.tsx +1 -1
  38. package/example-helpers/cardViewWrapper.tsx +2 -1
  39. package/example-helpers/index.tsx +5 -5
  40. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 79.11.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9129ddcd87db4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9129ddcd87db4) -
8
+ Add 10% sampling to auth-provider-succeeded analytics events to reduce event volume while
9
+ maintaining visibility into auth provider failures.
10
+
11
+ ## 79.11.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`7b2a6c98563cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b2a6c98563cb) -
16
+ Icon entry point migration update
17
+ - Updated dependencies
18
+
3
19
  ## 79.11.2
4
20
 
5
21
  ### Patch Changes
@@ -8,7 +8,7 @@ exports.attachDetailsToActions = attachDetailsToActions;
8
8
  exports.createDownloadAction = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
- var _download = _interopRequireDefault(require("@atlaskit/icon/core/migration/download"));
11
+ var _download = _interopRequireDefault(require("@atlaskit/icon/core/download"));
12
12
  var _mediaUi = require("@atlaskit/media-ui");
13
13
  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
14
  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; }
@@ -22,7 +22,7 @@ var _label = _interopRequireDefault(require("@atlaskit/react-ufo/label"));
22
22
  var _excluded = ["identifier"];
23
23
  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); }
24
24
  var packageName = "@atlaskit/media-card";
25
- var packageVersion = "0.0.0-development";
25
+ var packageVersion = "79.11.3";
26
26
  var CardBase = exports.CardBase = function CardBase(_ref) {
27
27
  var identifier = _ref.identifier,
28
28
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -56,8 +56,15 @@ var CardWithPerformanceObserver = exports.CardWithPerformanceObserver = function
56
56
  if (!(0, _platformFeatureFlags.fg)('platform_media_auth_provider_analytics')) {
57
57
  return;
58
58
  }
59
+
60
+ // Sample auth-provider-succeeded events at 10%
61
+ var shouldSampleAuthProviderSucceeded = function shouldSampleAuthProviderSucceeded() {
62
+ return Math.random() < 0.1;
63
+ };
59
64
  var onAuthSuccess = function onAuthSuccess(payload) {
60
- (0, _analytics.fireMediaCardEvent)((0, _analytics.getAuthProviderSucceededPayload)(payload.durationMs, payload.timeoutMs, payload.authContext), createAnalyticsEvent);
65
+ if (shouldSampleAuthProviderSucceeded()) {
66
+ (0, _analytics.fireMediaCardEvent)((0, _analytics.getAuthProviderSucceededPayload)(payload.durationMs, payload.timeoutMs, payload.authContext), createAnalyticsEvent);
67
+ }
61
68
  };
62
69
  var onAuthFailed = function onAuthFailed(payload) {
63
70
  (0, _analytics.fireMediaCardEvent)((0, _analytics.getAuthProviderFailedPayload)(payload.durationMs, payload.timeoutMs, payload.error, payload.authContext), createAnalyticsEvent);
@@ -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.11.3";
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)({
@@ -1,18 +1,21 @@
1
1
  "use strict";
2
2
 
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.SvgView = void 0;
7
- var _react = require("@emotion/react");
8
- var _react2 = require("react");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _react2 = require("@emotion/react");
9
10
  var _errors = require("../../errors");
10
11
  var _mediaSvg = require("@atlaskit/media-svg");
11
12
  var _imageRendererV = require("../ui/imageRenderer/imageRendererV2");
13
+ 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); }
12
14
  /**
13
15
  * @jsxRuntime classic
14
16
  * @jsx jsx
15
17
  */
18
+
16
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
20
 
18
21
  var getErrorReason = function getErrorReason(svgReason) {
@@ -41,13 +44,13 @@ var SvgView = exports.SvgView = function SvgView(_ref) {
41
44
  var _useResolveSvg = (0, _mediaSvg.useResolveSvg)(identifier, onSvgError),
42
45
  svgUrl = _useResolveSvg.svgUrl,
43
46
  source = _useResolveSvg.source;
44
- var cardPreview = (0, _react2.useMemo)(function () {
47
+ var cardPreview = (0, _react.useMemo)(function () {
45
48
  return svgUrl && source ? {
46
49
  dataURI: svgUrl,
47
50
  source: source
48
51
  } : undefined;
49
52
  }, [svgUrl, source]);
50
- return cardPreview ? (0, _react.jsx)(_imageRendererV.ImageRenderer, {
53
+ return cardPreview ? (0, _react2.jsx)(_imageRendererV.ImageRenderer, {
51
54
  testId: "media-card-svg",
52
55
  identifier: identifier,
53
56
  cardPreview: cardPreview,
@@ -1,20 +1,23 @@
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.PlayButtonBackground = void 0;
7
- var _react = require("@emotion/react");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _react2 = require("@emotion/react");
8
10
  var _styles = require("./styles");
9
11
  /**
10
12
  * @jsxRuntime classic
11
13
  * @jsx jsx
12
14
  */
15
+
13
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
17
 
15
18
  var PlayButtonBackground = exports.PlayButtonBackground = function PlayButtonBackground() {
16
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
17
- return (0, _react.jsx)("div", {
20
+ return (0, _react2.jsx)("div", {
18
21
  css: _styles.backgroundStyles,
19
22
  className: _styles.bkgClassName
20
23
  });
@@ -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.11.3",
120
120
  componentName: 'mediaInlineCard',
121
121
  component: 'mediaInlineCard'
122
122
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -11,10 +12,11 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
11
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
13
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
- var _react = require("@emotion/react");
15
- var _react2 = require("react");
15
+ var _react = _interopRequireWildcard(require("react"));
16
+ var _react2 = require("@emotion/react");
16
17
  var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
17
18
  var _styles = require("./styles");
19
+ 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
20
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
19
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
20
22
  * @jsxRuntime classic
@@ -32,9 +34,9 @@ var ErrorIcon = exports.ErrorIcon = /*#__PURE__*/function (_Component) {
32
34
  var size = this.props.size;
33
35
  return (
34
36
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
35
- (0, _react.jsx)("div", {
37
+ (0, _react2.jsx)("div", {
36
38
  css: _styles.errorIconWrapperStyles
37
- }, (0, _react.jsx)(_statusWarning.default, {
39
+ }, (0, _react2.jsx)(_statusWarning.default, {
38
40
  color: "currentColor",
39
41
  label: "Error",
40
42
  LEGACY_size: size
@@ -42,7 +44,7 @@ var ErrorIcon = exports.ErrorIcon = /*#__PURE__*/function (_Component) {
42
44
  );
43
45
  }
44
46
  }]);
45
- }(_react2.Component);
47
+ }(_react.Component);
46
48
  (0, _defineProperty2.default)(ErrorIcon, "defaultProps", {
47
49
  size: 'small'
48
50
  });
@@ -6,18 +6,20 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.Wrapper = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = require("@emotion/react");
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _react2 = require("@emotion/react");
10
11
  var _styles = require("./styles");
11
12
  /**
12
13
  * @jsxRuntime classic
13
14
  * @jsx jsx
14
15
  */
16
+
15
17
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
18
 
17
19
  var Wrapper = exports.Wrapper = function Wrapper(props) {
18
20
  return (
19
21
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
20
- (0, _react.jsx)("div", (0, _extends2.default)({
22
+ (0, _react2.jsx)("div", (0, _extends2.default)({
21
23
  css: (0, _styles.wrapperStyles)({
22
24
  dimensions: props.dimensions
23
25
  })
@@ -15,7 +15,7 @@ var _mediaClient = require("@atlaskit/media-client");
15
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
16
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
17
  var packageName = "@atlaskit/media-card";
18
- var packageVersion = "0.0.0-development";
18
+ var packageVersion = "79.11.3";
19
19
  var SAMPLE_RATE = 0.05;
20
20
  var concurrentExperience;
21
21
  var getExperience = function getExperience(id) {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import DownloadIcon from '@atlaskit/icon/core/migration/download';
2
+ import DownloadIcon from '@atlaskit/icon/core/download';
3
3
  import { messages } from '@atlaskit/media-ui';
4
4
  export function attachDetailsToActions(actions, details) {
5
5
  return actions.map(action => ({
@@ -11,7 +11,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import UFOLabel from '@atlaskit/react-ufo/label';
13
13
  const packageName = "@atlaskit/media-card";
14
- const packageVersion = "0.0.0-development";
14
+ const packageVersion = "79.11.3";
15
15
  export const CardBase = ({
16
16
  identifier,
17
17
  ...otherProps
@@ -47,8 +47,13 @@ export const CardWithPerformanceObserver = props => {
47
47
  if (!fg('platform_media_auth_provider_analytics')) {
48
48
  return;
49
49
  }
50
+
51
+ // Sample auth-provider-succeeded events at 10%
52
+ const shouldSampleAuthProviderSucceeded = () => Math.random() < 0.1;
50
53
  const onAuthSuccess = payload => {
51
- fireMediaCardEvent(getAuthProviderSucceededPayload(payload.durationMs, payload.timeoutMs, payload.authContext), createAnalyticsEvent);
54
+ if (shouldSampleAuthProviderSucceeded()) {
55
+ fireMediaCardEvent(getAuthProviderSucceededPayload(payload.durationMs, payload.timeoutMs, payload.authContext), createAnalyticsEvent);
56
+ }
52
57
  };
53
58
  const onAuthFailed = payload => {
54
59
  fireMediaCardEvent(getAuthProviderFailedPayload(payload.durationMs, payload.timeoutMs, payload.error, payload.authContext), createAnalyticsEvent);
@@ -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.11.3";
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,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+ import React from 'react';
5
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
7
  import { jsx } from '@emotion/react';
7
8
  import { useMemo } from 'react';
@@ -2,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+ import React from 'react';
5
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
7
  import { jsx } from '@emotion/react';
7
8
  import { backgroundStyles, bkgClassName } from './styles';
@@ -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.11.3",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
+ import React from 'react';
6
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
8
  import { jsx } from '@emotion/react';
8
9
  import { Component } from 'react';
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
+ import React from 'react';
6
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
8
  import { jsx } from '@emotion/react';
8
9
  import { wrapperStyles } from './styles';
@@ -5,7 +5,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
5
5
  import { MediaCardError } from '../errors';
6
6
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
7
7
  const packageName = "@atlaskit/media-card";
8
- const packageVersion = "0.0.0-development";
8
+ const packageVersion = "79.11.3";
9
9
  const SAMPLE_RATE = 0.05;
10
10
  let concurrentExperience;
11
11
  const getExperience = id => {
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
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
- import DownloadIcon from '@atlaskit/icon/core/migration/download';
5
+ import DownloadIcon from '@atlaskit/icon/core/download';
6
6
  import { messages } from '@atlaskit/media-ui';
7
7
  export function attachDetailsToActions(actions, details) {
8
8
  return actions.map(function (action) {
@@ -13,7 +13,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import UFOLabel from '@atlaskit/react-ufo/label';
15
15
  var packageName = "@atlaskit/media-card";
16
- var packageVersion = "0.0.0-development";
16
+ var packageVersion = "79.11.3";
17
17
  export var CardBase = function CardBase(_ref) {
18
18
  var identifier = _ref.identifier,
19
19
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -47,8 +47,15 @@ export var CardWithPerformanceObserver = function CardWithPerformanceObserver(pr
47
47
  if (!fg('platform_media_auth_provider_analytics')) {
48
48
  return;
49
49
  }
50
+
51
+ // Sample auth-provider-succeeded events at 10%
52
+ var shouldSampleAuthProviderSucceeded = function shouldSampleAuthProviderSucceeded() {
53
+ return Math.random() < 0.1;
54
+ };
50
55
  var onAuthSuccess = function onAuthSuccess(payload) {
51
- fireMediaCardEvent(getAuthProviderSucceededPayload(payload.durationMs, payload.timeoutMs, payload.authContext), createAnalyticsEvent);
56
+ if (shouldSampleAuthProviderSucceeded()) {
57
+ fireMediaCardEvent(getAuthProviderSucceededPayload(payload.durationMs, payload.timeoutMs, payload.authContext), createAnalyticsEvent);
58
+ }
52
59
  };
53
60
  var onAuthFailed = function onAuthFailed(payload) {
54
61
  fireMediaCardEvent(getAuthProviderFailedPayload(payload.durationMs, payload.timeoutMs, payload.error, payload.authContext), createAnalyticsEvent);
@@ -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.11.3";
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,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+ import React from 'react';
5
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
7
  import { jsx } from '@emotion/react';
7
8
  import { useMemo } from 'react';
@@ -2,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+ import React from 'react';
5
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
7
  import { jsx } from '@emotion/react';
7
8
  import { backgroundStyles, bkgClassName } from './styles';
@@ -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.11.3",
105
105
  componentName: 'mediaInlineCard',
106
106
  component: 'mediaInlineCard'
107
107
  };
@@ -10,6 +10,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
10
10
  * @jsxRuntime classic
11
11
  * @jsx jsx
12
12
  */
13
+ import React from 'react';
13
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
15
  import { jsx } from '@emotion/react';
15
16
  import { Component } from 'react';
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
+ import React from 'react';
6
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
8
  import { jsx } from '@emotion/react';
8
9
  import { wrapperStyles } from './styles';
@@ -8,7 +8,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
8
8
  import { MediaCardError } from '../errors';
9
9
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
10
10
  var packageName = "@atlaskit/media-card";
11
- var packageVersion = "0.0.0-development";
11
+ var packageVersion = "79.11.3";
12
12
  var SAMPLE_RATE = 0.05;
13
13
  var concurrentExperience;
14
14
  var getExperience = function getExperience(id) {
@@ -2,6 +2,6 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import type { SvgViewProps } from './types';
7
- export declare const SvgView: ({ identifier, resizeMode, onLoad, onError, wrapperRef, alt, }: SvgViewProps) => jsx.JSX.Element | null;
7
+ export declare const SvgView: ({ identifier, resizeMode, onLoad, onError, wrapperRef, alt, }: SvgViewProps) => React.JSX.Element | null;
@@ -2,5 +2,5 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
6
- export declare const PlayButtonBackground: () => jsx.JSX.Element;
5
+ import React from 'react';
6
+ export declare const PlayButtonBackground: () => React.JSX.Element;
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import { Component } from 'react';
7
7
  export interface ErrorIconProps {
8
8
  readonly size: 'small' | 'medium' | 'large' | 'xlarge';
@@ -11,5 +11,5 @@ export declare class ErrorIcon extends Component<ErrorIconProps, {}> {
11
11
  static defaultProps: {
12
12
  size: string;
13
13
  };
14
- render(): jsx.JSX.Element;
14
+ render(): React.JSX.Element;
15
15
  }
@@ -2,6 +2,6 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import { type WrapperProps } from './types';
7
- export declare const Wrapper: (props: WrapperProps) => jsx.JSX.Element;
7
+ export declare const Wrapper: (props: WrapperProps) => React.JSX.Element;
@@ -2,6 +2,6 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import type { SvgViewProps } from './types';
7
- export declare const SvgView: ({ identifier, resizeMode, onLoad, onError, wrapperRef, alt, }: SvgViewProps) => jsx.JSX.Element | null;
7
+ export declare const SvgView: ({ identifier, resizeMode, onLoad, onError, wrapperRef, alt, }: SvgViewProps) => React.JSX.Element | null;
@@ -2,5 +2,5 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
6
- export declare const PlayButtonBackground: () => jsx.JSX.Element;
5
+ import React from 'react';
6
+ export declare const PlayButtonBackground: () => React.JSX.Element;
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import { Component } from 'react';
7
7
  export interface ErrorIconProps {
8
8
  readonly size: 'small' | 'medium' | 'large' | 'xlarge';
@@ -11,5 +11,5 @@ export declare class ErrorIcon extends Component<ErrorIconProps, {}> {
11
11
  static defaultProps: {
12
12
  size: string;
13
13
  };
14
- render(): jsx.JSX.Element;
14
+ render(): React.JSX.Element;
15
15
  }
@@ -2,6 +2,6 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import { type WrapperProps } from './types';
7
- export declare const Wrapper: (props: WrapperProps) => jsx.JSX.Element;
7
+ export declare const Wrapper: (props: WrapperProps) => React.JSX.Element;
@@ -15,7 +15,7 @@ export class DelayedRender extends Component<Props, State> {
15
15
  hidden: true,
16
16
  };
17
17
 
18
- componentDidMount() {
18
+ componentDidMount(): void {
19
19
  window.setTimeout(() => {
20
20
  this.setState({ hidden: false });
21
21
  }, this.props.timeout);
@@ -2,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+ import React from 'react';
5
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
7
  import { jsx } from '@emotion/react';
7
8
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
@@ -37,7 +38,7 @@ const cardWrapperStyles = ({ small, displayInline }: CardViewWrapperProps) =>
37
38
  marginInline: 'space.250',
38
39
  });
39
40
 
40
- export const CardViewWrapper = (props: CardViewWrapperProps) => {
41
+ export const CardViewWrapper = (props: CardViewWrapperProps): React.JSX.Element => {
41
42
  if (props.small) {
42
43
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
43
44
  return <Box xcss={[cardWrapperStyles(props), smallStyles]}>{props.children}</Box>;
@@ -11,7 +11,7 @@ import {
11
11
  createPollingMaxAttemptsError,
12
12
  createRateLimitedError,
13
13
  } from '@atlaskit/media-client/test-helpers';
14
- import CrossIcon from '@atlaskit/icon/core/migration/cross';
14
+ import CrossIcon from '@atlaskit/icon/core/cross';
15
15
  import FabricAnalyticsListeners, { type AnalyticsWebClient } from '@atlaskit/analytics-listeners';
16
16
  import { payloadPublisher } from '@atlassian/ufo';
17
17
 
@@ -23,12 +23,12 @@ import DevelopmentUseMessage from './developmentUseMessage';
23
23
 
24
24
  const mediaClientConfig = createStorybookMediaClientConfig();
25
25
 
26
- export const clickHandler = (result: CardEvent) => {
26
+ export const clickHandler = (result: CardEvent): void => {
27
27
  result.event.preventDefault();
28
28
  console.log('click', result.mediaItemDetails);
29
29
  };
30
30
 
31
- export const mouseEnterHandler = (result: CardEvent) => {
31
+ export const mouseEnterHandler = (result: CardEvent): void => {
32
32
  result.event.preventDefault();
33
33
  console.log('mouseEnter', result.mediaItemDetails);
34
34
  };
@@ -70,13 +70,13 @@ export const createApiCards = (
70
70
 
71
71
  export const openAction = {
72
72
  label: 'Open',
73
- handler: () => {
73
+ handler: (): void => {
74
74
  console.log('open');
75
75
  },
76
76
  };
77
77
  export const closeAction = {
78
78
  label: 'Close',
79
- handler: () => {
79
+ handler: (): void => {
80
80
  console.log('close');
81
81
  },
82
82
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "79.11.2",
3
+ "version": "79.11.4",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@af/integration-testing": "workspace:^",
72
- "@atlaskit/analytics-listeners": "^9.1.0",
72
+ "@atlaskit/analytics-listeners": "^9.2.0",
73
73
  "@atlaskit/analytics-namespaced-context": "^7.2.0",
74
74
  "@atlaskit/form": "^15.2.0",
75
75
  "@atlaskit/inline-message": "^15.5.0",