@atlaskit/media-card 78.10.0 → 78.10.2

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,21 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 78.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#156157](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156157)
8
+ [`8d23a2a1568fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d23a2a1568fe) -
9
+ fix React 18 strict mode issues
10
+
11
+ ## 78.10.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#158161](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/158161)
16
+ [`f092b9d2f949d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f092b9d2f949d) -
17
+ clean up LD Media CDN FFs
18
+
3
19
  ## 78.10.0
4
20
 
5
21
  ### Minor Changes
@@ -22,7 +22,7 @@ var _excluded = ["identifier"];
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
24
  var packageName = "@atlaskit/media-card";
25
- var packageVersion = "78.10.0";
25
+ var packageVersion = "78.10.2";
26
26
  var CardBase = exports.CardBase = function CardBase(_ref) {
27
27
  var identifier = _ref.identifier,
28
28
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -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 = "78.10.0";
93
+ var packageVersion = "78.10.2";
94
94
 
95
95
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
96
96
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
@@ -7,33 +7,16 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.CardActionsDropdownMenu = void 0;
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
16
- var _react = _interopRequireWildcard(require("react"));
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _analyticsNext = require("@atlaskit/analytics-next");
17
13
  var _showMoreHorizontalMore = _interopRequireDefault(require("@atlaskit/icon/core/migration/show-more-horizontal--more"));
18
14
  var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
19
- var _analyticsNext = require("@atlaskit/analytics-next");
20
15
  var _analytics = require("../../../../utils/analytics");
21
16
  var _cardActionButton = require("./cardActionButton");
22
- var _excluded = ["triggerRef"];
17
+ var _excluded = ["triggerRef", "isSelected", "testId", "onClick"];
23
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
26
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
27
- var CardActionButtonWithAnalytics = (0, _analyticsNext.withAnalyticsEvents)({
28
- onClick: (0, _analytics.createAndFireMediaCardEvent)({
29
- eventType: 'ui',
30
- action: 'clicked',
31
- actionSubject: 'button',
32
- actionSubjectId: 'mediaCardDropDownMenu',
33
- attributes: {}
34
- })
35
- // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
36
- })(_cardActionButton.CardActionButton);
37
20
  // Trick applied due to the lack of props type of DropdownItem
38
21
  var DropdownItemWithProps = function DropdownItemWithProps(props) {
39
22
  return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, (0, _extends2.default)({
@@ -59,51 +42,49 @@ var createDropdownItemWithAnalytics = function createDropdownItemWithAnalytics(a
59
42
  onClick: handler
60
43
  }, label);
61
44
  };
62
- var CardActionsDropdownMenu = exports.CardActionsDropdownMenu = /*#__PURE__*/function (_Component) {
63
- (0, _inherits2.default)(CardActionsDropdownMenu, _Component);
64
- var _super = _createSuper(CardActionsDropdownMenu);
65
- function CardActionsDropdownMenu() {
66
- (0, _classCallCheck2.default)(this, CardActionsDropdownMenu);
67
- return _super.apply(this, arguments);
68
- }
69
- (0, _createClass2.default)(CardActionsDropdownMenu, [{
70
- key: "render",
71
- value: function render() {
72
- var _this$props = this.props,
73
- actions = _this$props.actions,
74
- triggerColor = _this$props.triggerColor,
75
- onOpenChange = _this$props.onOpenChange,
76
- triggerVariant = _this$props.triggerVariant;
77
- if (actions.length > 0) {
78
- return /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
79
- testId: "media-card-actions-menu",
80
- onOpenChange: onOpenChange,
81
- trigger: function trigger(_ref) {
82
- var triggerRef = _ref.triggerRef,
83
- providedProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
84
- return (
85
- /*#__PURE__*/
86
- // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
87
- _react.default.createElement(CardActionButtonWithAnalytics, (0, _extends2.default)({
88
- variant: triggerVariant
89
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
90
- ,
91
- style: {
92
- color: triggerColor
93
- },
94
- ref: triggerRef
95
- }, providedProps), /*#__PURE__*/_react.default.createElement(_showMoreHorizontalMore.default, {
96
- color: "currentColor",
97
- spacing: "spacious",
98
- label: "more"
99
- }))
100
- );
45
+ var CardActionsDropdownMenu = exports.CardActionsDropdownMenu = function CardActionsDropdownMenu(_ref) {
46
+ var actions = _ref.actions,
47
+ triggerColor = _ref.triggerColor,
48
+ onOpenChange = _ref.onOpenChange,
49
+ triggerVariant = _ref.triggerVariant;
50
+ var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
51
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
52
+ if (actions.length > 0) {
53
+ return /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
54
+ testId: "media-card-actions-menu",
55
+ onOpenChange: onOpenChange,
56
+ trigger: function trigger(_ref2) {
57
+ var triggerRef = _ref2.triggerRef,
58
+ isSelected = _ref2.isSelected,
59
+ testId = _ref2.testId,
60
+ _onClick = _ref2.onClick,
61
+ providedProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
62
+ return /*#__PURE__*/_react.default.createElement(_cardActionButton.CardActionButton, (0, _extends2.default)({
63
+ variant: triggerVariant
64
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
65
+ ,
66
+ style: {
67
+ color: triggerColor
68
+ },
69
+ ref: triggerRef,
70
+ onClick: function onClick(e) {
71
+ (0, _analytics.fireMediaCardEvent)({
72
+ eventType: 'ui',
73
+ action: 'clicked',
74
+ actionSubject: 'button',
75
+ actionSubjectId: 'mediaCardDropDownMenu',
76
+ attributes: {}
77
+ }, createAnalyticsEvent);
78
+ _onClick === null || _onClick === void 0 || _onClick(e);
101
79
  }
102
- }, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
103
- } else {
104
- return null;
80
+ }, providedProps), /*#__PURE__*/_react.default.createElement(_showMoreHorizontalMore.default, {
81
+ color: "currentColor",
82
+ spacing: "spacious",
83
+ label: "more"
84
+ }));
105
85
  }
106
- }
107
- }]);
108
- return CardActionsDropdownMenu;
109
- }(_react.Component);
86
+ }, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
87
+ } else {
88
+ return null;
89
+ }
90
+ };
@@ -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: "78.10.0",
122
+ packageName: "78.10.2",
123
123
  componentName: 'mediaInlineCard',
124
124
  component: 'mediaInlineCard'
125
125
  };
@@ -39,7 +39,7 @@ var createAndGetResourceObserver = function createAndGetResourceObserver() {
39
39
  fileId: fileId,
40
40
  mediaClientId: clientId,
41
41
  featureFlags: {
42
- 'media-cdn-single-host': (0, _platformFeatureFlags.fg)('platform.media-cdn-single-host') || (0, _platformFeatureFlags.fg)('platform_media_cdn_single_host')
42
+ 'media-cdn-single-host': (0, _platformFeatureFlags.fg)('platform_media_cdn_single_host')
43
43
  }
44
44
  }, mediaDurationMetrics)
45
45
  });
@@ -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 = "78.10.0";
18
+ var packageVersion = "78.10.2";
19
19
  var concurrentExperience;
20
20
  var getExperience = function getExperience(id) {
21
21
  if (!concurrentExperience) {
@@ -10,7 +10,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
11
  import UFOLabel from '@atlaskit/react-ufo/label';
12
12
  const packageName = "@atlaskit/media-card";
13
- const packageVersion = "78.10.0";
13
+ const packageVersion = "78.10.2";
14
14
  export const CardBase = ({
15
15
  identifier,
16
16
  ...otherProps
@@ -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 = "78.10.0";
69
+ const packageVersion = "78.10.2";
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({
@@ -1,21 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { Component } from 'react';
3
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
4
4
  import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
5
5
  import DropdownMenu, { DropdownItemGroup, DropdownItem } from '@atlaskit/dropdown-menu';
6
6
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
7
- import { createAndFireMediaCardEvent } from '../../../../utils/analytics';
7
+ import { createAndFireMediaCardEvent, fireMediaCardEvent } from '../../../../utils/analytics';
8
8
  import { CardActionButton } from './cardActionButton';
9
- const CardActionButtonWithAnalytics = withAnalyticsEvents({
10
- onClick: createAndFireMediaCardEvent({
11
- eventType: 'ui',
12
- action: 'clicked',
13
- actionSubject: 'button',
14
- actionSubjectId: 'mediaCardDropDownMenu',
15
- attributes: {}
16
- })
17
- // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
18
- })(CardActionButton);
19
9
  // Trick applied due to the lack of props type of DropdownItem
20
10
  const DropdownItemWithProps = props => /*#__PURE__*/React.createElement(DropdownItem, _extends({
21
11
  testId: "media-card-actions-menu-item"
@@ -41,40 +31,50 @@ const createDropdownItemWithAnalytics = (action, index) => {
41
31
  onClick: handler
42
32
  }, label);
43
33
  };
44
- export class CardActionsDropdownMenu extends Component {
45
- render() {
46
- const {
47
- actions,
48
- triggerColor,
49
- onOpenChange,
50
- triggerVariant
51
- } = this.props;
52
- if (actions.length > 0) {
53
- return /*#__PURE__*/React.createElement(DropdownMenu, {
54
- testId: "media-card-actions-menu",
55
- onOpenChange: onOpenChange,
56
- trigger: ({
57
- triggerRef,
58
- ...providedProps
59
- }) =>
60
- /*#__PURE__*/
61
- // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
62
- React.createElement(CardActionButtonWithAnalytics, _extends({
63
- variant: triggerVariant
64
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
65
- ,
66
- style: {
67
- color: triggerColor
68
- },
69
- ref: triggerRef
70
- }, providedProps), /*#__PURE__*/React.createElement(MoreIcon, {
71
- color: "currentColor",
72
- spacing: "spacious",
73
- label: "more"
74
- }))
75
- }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
76
- } else {
77
- return null;
78
- }
34
+ export const CardActionsDropdownMenu = ({
35
+ actions,
36
+ triggerColor,
37
+ onOpenChange,
38
+ triggerVariant
39
+ }) => {
40
+ const {
41
+ createAnalyticsEvent
42
+ } = useAnalyticsEvents();
43
+ if (actions.length > 0) {
44
+ return /*#__PURE__*/React.createElement(DropdownMenu, {
45
+ testId: "media-card-actions-menu",
46
+ onOpenChange: onOpenChange,
47
+ trigger: ({
48
+ triggerRef,
49
+ isSelected,
50
+ testId,
51
+ onClick,
52
+ ...providedProps
53
+ }) => /*#__PURE__*/React.createElement(CardActionButton, _extends({
54
+ variant: triggerVariant
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
56
+ ,
57
+ style: {
58
+ color: triggerColor
59
+ },
60
+ ref: triggerRef,
61
+ onClick: e => {
62
+ fireMediaCardEvent({
63
+ eventType: 'ui',
64
+ action: 'clicked',
65
+ actionSubject: 'button',
66
+ actionSubjectId: 'mediaCardDropDownMenu',
67
+ attributes: {}
68
+ }, createAnalyticsEvent);
69
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
70
+ }
71
+ }, providedProps), /*#__PURE__*/React.createElement(MoreIcon, {
72
+ color: "currentColor",
73
+ spacing: "spacious",
74
+ label: "more"
75
+ }))
76
+ }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
77
+ } else {
78
+ return null;
79
79
  }
80
- }
80
+ };
@@ -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: "78.10.0",
40
+ packageName: "78.10.2",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -29,7 +29,7 @@ const createAndGetResourceObserver = () => {
29
29
  fileId: fileId,
30
30
  mediaClientId: clientId,
31
31
  featureFlags: {
32
- 'media-cdn-single-host': fg('platform.media-cdn-single-host') || fg('platform_media_cdn_single_host')
32
+ 'media-cdn-single-host': fg('platform_media_cdn_single_host')
33
33
  },
34
34
  ...mediaDurationMetrics
35
35
  }
@@ -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 = "78.10.0";
8
+ const packageVersion = "78.10.2";
9
9
  let concurrentExperience;
10
10
  const getExperience = id => {
11
11
  if (!concurrentExperience) {
@@ -12,7 +12,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import UFOLabel from '@atlaskit/react-ufo/label';
14
14
  var packageName = "@atlaskit/media-card";
15
- var packageVersion = "78.10.0";
15
+ var packageVersion = "78.10.2";
16
16
  export var CardBase = function CardBase(_ref) {
17
17
  var identifier = _ref.identifier,
18
18
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -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 = "78.10.0";
86
+ var packageVersion = "78.10.2";
87
87
 
88
88
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
89
89
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -1,30 +1,13 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
2
  import _extends from "@babel/runtime/helpers/extends";
8
- var _excluded = ["triggerRef"];
9
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
10
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3
+ var _excluded = ["triggerRef", "isSelected", "testId", "onClick"];
11
4
  import React from 'react';
12
- import { Component } from 'react';
5
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
13
6
  import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
14
7
  import DropdownMenu, { DropdownItemGroup, DropdownItem } from '@atlaskit/dropdown-menu';
15
8
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
16
- import { createAndFireMediaCardEvent } from '../../../../utils/analytics';
9
+ import { createAndFireMediaCardEvent, fireMediaCardEvent } from '../../../../utils/analytics';
17
10
  import { CardActionButton } from './cardActionButton';
18
- var CardActionButtonWithAnalytics = withAnalyticsEvents({
19
- onClick: createAndFireMediaCardEvent({
20
- eventType: 'ui',
21
- action: 'clicked',
22
- actionSubject: 'button',
23
- actionSubjectId: 'mediaCardDropDownMenu',
24
- attributes: {}
25
- })
26
- // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
27
- })(CardActionButton);
28
11
  // Trick applied due to the lack of props type of DropdownItem
29
12
  var DropdownItemWithProps = function DropdownItemWithProps(props) {
30
13
  return /*#__PURE__*/React.createElement(DropdownItem, _extends({
@@ -50,51 +33,49 @@ var createDropdownItemWithAnalytics = function createDropdownItemWithAnalytics(a
50
33
  onClick: handler
51
34
  }, label);
52
35
  };
53
- export var CardActionsDropdownMenu = /*#__PURE__*/function (_Component) {
54
- _inherits(CardActionsDropdownMenu, _Component);
55
- var _super = _createSuper(CardActionsDropdownMenu);
56
- function CardActionsDropdownMenu() {
57
- _classCallCheck(this, CardActionsDropdownMenu);
58
- return _super.apply(this, arguments);
59
- }
60
- _createClass(CardActionsDropdownMenu, [{
61
- key: "render",
62
- value: function render() {
63
- var _this$props = this.props,
64
- actions = _this$props.actions,
65
- triggerColor = _this$props.triggerColor,
66
- onOpenChange = _this$props.onOpenChange,
67
- triggerVariant = _this$props.triggerVariant;
68
- if (actions.length > 0) {
69
- return /*#__PURE__*/React.createElement(DropdownMenu, {
70
- testId: "media-card-actions-menu",
71
- onOpenChange: onOpenChange,
72
- trigger: function trigger(_ref) {
73
- var triggerRef = _ref.triggerRef,
74
- providedProps = _objectWithoutProperties(_ref, _excluded);
75
- return (
76
- /*#__PURE__*/
77
- // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
78
- React.createElement(CardActionButtonWithAnalytics, _extends({
79
- variant: triggerVariant
80
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
81
- ,
82
- style: {
83
- color: triggerColor
84
- },
85
- ref: triggerRef
86
- }, providedProps), /*#__PURE__*/React.createElement(MoreIcon, {
87
- color: "currentColor",
88
- spacing: "spacious",
89
- label: "more"
90
- }))
91
- );
36
+ export var CardActionsDropdownMenu = function CardActionsDropdownMenu(_ref) {
37
+ var actions = _ref.actions,
38
+ triggerColor = _ref.triggerColor,
39
+ onOpenChange = _ref.onOpenChange,
40
+ triggerVariant = _ref.triggerVariant;
41
+ var _useAnalyticsEvents = useAnalyticsEvents(),
42
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
43
+ if (actions.length > 0) {
44
+ return /*#__PURE__*/React.createElement(DropdownMenu, {
45
+ testId: "media-card-actions-menu",
46
+ onOpenChange: onOpenChange,
47
+ trigger: function trigger(_ref2) {
48
+ var triggerRef = _ref2.triggerRef,
49
+ isSelected = _ref2.isSelected,
50
+ testId = _ref2.testId,
51
+ _onClick = _ref2.onClick,
52
+ providedProps = _objectWithoutProperties(_ref2, _excluded);
53
+ return /*#__PURE__*/React.createElement(CardActionButton, _extends({
54
+ variant: triggerVariant
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
56
+ ,
57
+ style: {
58
+ color: triggerColor
59
+ },
60
+ ref: triggerRef,
61
+ onClick: function onClick(e) {
62
+ fireMediaCardEvent({
63
+ eventType: 'ui',
64
+ action: 'clicked',
65
+ actionSubject: 'button',
66
+ actionSubjectId: 'mediaCardDropDownMenu',
67
+ attributes: {}
68
+ }, createAnalyticsEvent);
69
+ _onClick === null || _onClick === void 0 || _onClick(e);
92
70
  }
93
- }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
94
- } else {
95
- return null;
71
+ }, providedProps), /*#__PURE__*/React.createElement(MoreIcon, {
72
+ color: "currentColor",
73
+ spacing: "spacious",
74
+ label: "more"
75
+ }));
96
76
  }
97
- }
98
- }]);
99
- return CardActionsDropdownMenu;
100
- }(Component);
77
+ }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
78
+ } else {
79
+ return null;
80
+ }
81
+ };
@@ -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: "78.10.0",
106
+ packageName: "78.10.2",
107
107
  componentName: 'mediaInlineCard',
108
108
  component: 'mediaInlineCard'
109
109
  };
@@ -32,7 +32,7 @@ var createAndGetResourceObserver = function createAndGetResourceObserver() {
32
32
  fileId: fileId,
33
33
  mediaClientId: clientId,
34
34
  featureFlags: {
35
- 'media-cdn-single-host': fg('platform.media-cdn-single-host') || fg('platform_media_cdn_single_host')
35
+ 'media-cdn-single-host': fg('platform_media_cdn_single_host')
36
36
  }
37
37
  }, mediaDurationMetrics)
38
38
  });
@@ -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 = "78.10.0";
11
+ var packageVersion = "78.10.2";
12
12
  var concurrentExperience;
13
13
  var getExperience = function getExperience(id) {
14
14
  if (!concurrentExperience) {
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ /// <reference types="react" />
2
2
  import { type CardAction } from '../../../actions';
3
3
  import { type CardActionIconButtonVariant } from './styles';
4
4
  export type CardActionsDropdownMenuProps = {
@@ -9,6 +9,4 @@ export type CardActionsDropdownMenuProps = {
9
9
  isOpen: boolean;
10
10
  }) => void;
11
11
  };
12
- export declare class CardActionsDropdownMenu extends Component<CardActionsDropdownMenuProps> {
13
- render(): JSX.Element | null;
14
- }
12
+ export declare const CardActionsDropdownMenu: ({ actions, triggerColor, onOpenChange, triggerVariant, }: CardActionsDropdownMenuProps) => JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ /// <reference types="react" />
2
2
  import { type CardAction } from '../../../actions';
3
3
  import { type CardActionIconButtonVariant } from './styles';
4
4
  export type CardActionsDropdownMenuProps = {
@@ -9,6 +9,4 @@ export type CardActionsDropdownMenuProps = {
9
9
  isOpen: boolean;
10
10
  }) => void;
11
11
  };
12
- export declare class CardActionsDropdownMenu extends Component<CardActionsDropdownMenuProps> {
13
- render(): JSX.Element | null;
14
- }
12
+ export declare const CardActionsDropdownMenu: ({ actions, triggerColor, onOpenChange, triggerVariant, }: CardActionsDropdownMenuProps) => JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "78.10.0",
3
+ "version": "78.10.2",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -106,9 +106,6 @@
106
106
  "platform.media-card-performance-observer_a803k": {
107
107
  "type": "boolean"
108
108
  },
109
- "platform.media-cdn-single-host": {
110
- "type": "boolean"
111
- },
112
109
  "platform-visual-refresh-icons": {
113
110
  "type": "boolean"
114
111
  },