@atlaskit/smart-card 45.2.0 → 45.2.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.
Files changed (20) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +2 -1
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
  5. package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +10 -7
  6. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +1 -2
  7. package/dist/cjs/view/LinkUrl/index.js +1 -1
  8. package/dist/es2019/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +2 -1
  9. package/dist/es2019/utils/analytics/analytics.js +1 -1
  10. package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +4 -2
  11. package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +12 -9
  12. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +1 -2
  13. package/dist/es2019/view/LinkUrl/index.js +1 -1
  14. package/dist/esm/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +2 -1
  15. package/dist/esm/utils/analytics/analytics.js +1 -1
  16. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +4 -2
  17. package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +12 -9
  18. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +1 -2
  19. package/dist/esm/view/LinkUrl/index.js +1 -1
  20. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 45.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`89227a0cf30c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/89227a0cf30c4) -
8
+ Cleanup feature gate `navx-3698-flexible-card-a11y-fix`. Decorative icons in FlexibleCard actions
9
+ (copy link, preview) are now permanently hidden from screen readers via `aria-hidden="true"`.
10
+ Action buttons now have explicit `aria-label` attributes for accessible names, fixing a
11
+ `button-name` a11y violation that was previously masked by the gate.
12
+
13
+ ## 45.2.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [`f072d326571d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f072d326571d1) -
18
+ Fix SSR regression: skip XPC URL wrapping on server to avoid unnecessary window probes per
19
+ SmartCard
20
+ - Updated dependencies
21
+
3
22
  ## 45.2.0
4
23
 
5
24
  ### Minor Changes
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = require("react");
10
10
  var _useCrossProductUrlWrapper = require("@atlaskit/analytics-cross-product/useCrossProductUrlWrapper");
11
11
  var _linkProvider = require("@atlaskit/link-provider");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
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; }
@@ -42,7 +43,7 @@ var useSmartLinkCrossProductUrlWrapper = exports.useSmartLinkCrossProductUrlWrap
42
43
  subProduct: xpcSubProduct
43
44
  } : {}));
44
45
  return (0, _react.useCallback)(function (url) {
45
- if (!getIsFirstPartyLink(details) || !effectiveProduct) {
46
+ if (typeof window === 'undefined' && (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping_window_existed') || !getIsFirstPartyLink(details) || !effectiveProduct) {
46
47
  return url;
47
48
  }
48
49
  var parsedUrl;
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card" || '',
14
- packageVersion: "45.1.1" || ''
14
+ packageVersion: "45.2.1" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -30,6 +30,7 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
30
30
  var _context$actions;
31
31
  var onClickCallback = _ref.onClick,
32
32
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
33
+ var intl = (0, _reactIntl.useIntl)();
33
34
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
34
35
  var invoke = (0, _useInvokeClientAction.default)({});
35
36
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.CopyLinkAction];
@@ -67,10 +68,11 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
67
68
  }
68
69
  }, [data, invoke, onClickCallback]);
69
70
  return data ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
71
+ ariaLabel: intl.formatMessage(_messages.messages.copy_url_to_clipboard),
70
72
  content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.copy_url_to_clipboard),
71
73
  icon: /*#__PURE__*/_react.default.createElement(_link.default, (0, _extends2.default)({
72
74
  color: "currentColor",
73
- label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
75
+ label: "",
74
76
  spacing: "spacious"
75
77
  }, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
76
78
  size: props.iconSize
@@ -26,6 +26,7 @@ var PreviewAction = function PreviewAction(_ref) {
26
26
  var _context$actions;
27
27
  var onClickCallback = _ref.onClick,
28
28
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
+ var intl = (0, _reactIntl.useIntl)();
29
30
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
30
31
  var invoke = (0, _useInvokeClientAction.default)({});
31
32
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.PreviewAction];
@@ -45,7 +46,7 @@ var PreviewAction = function PreviewAction(_ref) {
45
46
  return /*#__PURE__*/_react.default.createElement(_panelRight.default, (0, _extends2.default)({
46
47
  color: "currentColor",
47
48
  spacing: "spacious",
48
- label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
49
+ label: ""
49
50
  }, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
50
51
  size: props.iconSize
51
52
  } : {}));
@@ -53,24 +54,26 @@ var PreviewAction = function PreviewAction(_ref) {
53
54
  return /*#__PURE__*/_react.default.createElement(_growDiagonal.default, (0, _extends2.default)({
54
55
  color: "currentColor",
55
56
  spacing: "spacious",
56
- label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
57
+ label: ""
57
58
  }, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
58
59
  size: props.iconSize
59
60
  } : {}));
60
61
  }, [hasPreviewPanel, props.iconSize, isRovoBlockCardExperimentEnabled]);
61
- var actionLabel = (0, _react.useCallback)(function () {
62
+ var actionLabel = (0, _react.useMemo)(function () {
62
63
  // Only use panel message if experiment is enabled and hasPreviewPanel is true
63
64
  if ((0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') && hasPreviewPanel) {
64
- return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.preview_panel);
65
+ return _messages.messages.preview_panel;
65
66
  }
66
67
  // Fall back to modal message if experiment is enabled, otherwise use original preview message
67
68
  if ((0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test')) {
68
- return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.preview_modal);
69
+ return _messages.messages.preview_modal;
69
70
  }
70
- return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.preview_improved);
71
+ return _messages.messages.preview_improved;
71
72
  }, [hasPreviewPanel]);
73
+ var actionMessage = intl.formatMessage(actionLabel);
72
74
  return data ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
73
- content: actionLabel(),
75
+ ariaLabel: actionMessage,
76
+ content: actionMessage,
74
77
  icon: actionIcon(),
75
78
  onClick: onClick,
76
79
  testId: "smart-action-preview-action",
@@ -7,13 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _clock = _interopRequireDefault(require("@atlaskit/icon/core/clock"));
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var RelatedLinksActionIcon = function RelatedLinksActionIcon(_ref) {
12
11
  var iconSize = _ref.iconSize;
13
12
  return /*#__PURE__*/_react.default.createElement(_clock.default, {
14
13
  color: "currentColor",
15
14
  spacing: "spacious",
16
- label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'View related links...',
15
+ label: '',
17
16
  size: iconSize
18
17
  });
19
18
  };
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "45.1.1",
22
+ packageVersion: "45.2.1",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,6 +1,7 @@
1
1
  import { useCallback } from 'react';
2
2
  import { useCrossProductUrlWrapper } from '@atlaskit/analytics-cross-product/useCrossProductUrlWrapper';
3
3
  import { useSmartLinkContext } from '@atlaskit/link-provider';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { functionWithFG } from '@atlaskit/platform-feature-flags-react';
5
6
  const SMART_LINKS_XPC_BRIDGE = 'smartLinks';
6
7
  const XPC_QUERY_PARAM = 'xpis';
@@ -31,7 +32,7 @@ export const useSmartLinkCrossProductUrlWrapper = ({
31
32
  } : {})
32
33
  });
33
34
  return useCallback(url => {
34
- if (!getIsFirstPartyLink(details) || !effectiveProduct) {
35
+ if (typeof window === 'undefined' && fg('platform_smartlink_xpc_url_wrapping_window_existed') || !getIsFirstPartyLink(details) || !effectiveProduct) {
35
36
  return url;
36
37
  }
37
38
  let parsedUrl;
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card" || '',
5
- packageVersion: "45.1.1" || ''
5
+ packageVersion: "45.2.1" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useState } from 'react';
3
- import { FormattedMessage } from 'react-intl';
3
+ import { FormattedMessage, useIntl } from 'react-intl';
4
4
  import LinkIcon from '@atlaskit/icon/core/link';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { ActionName } from '../../../../../constants';
@@ -14,6 +14,7 @@ const CopyLinkAction = ({
14
14
  ...props
15
15
  }) => {
16
16
  var _context$actions;
17
+ const intl = useIntl();
17
18
  const context = useFlexibleUiContext();
18
19
  const invoke = useInvokeClientAction({});
19
20
  const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
@@ -33,10 +34,11 @@ const CopyLinkAction = ({
33
34
  }
34
35
  }, [data, invoke, onClickCallback]);
35
36
  return data ? /*#__PURE__*/React.createElement(Action, _extends({
37
+ ariaLabel: intl.formatMessage(messages.copy_url_to_clipboard),
36
38
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_url_to_clipboard),
37
39
  icon: /*#__PURE__*/React.createElement(LinkIcon, _extends({
38
40
  color: "currentColor",
39
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
41
+ label: "",
40
42
  spacing: "spacious"
41
43
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
42
44
  size: props.iconSize
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useCallback } from 'react';
3
- import { FormattedMessage } from 'react-intl';
2
+ import React, { useCallback, useMemo } from 'react';
3
+ import { FormattedMessage, useIntl } from 'react-intl';
4
4
  import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
5
5
  import PanelRightIcon from '@atlaskit/icon/core/panel-right';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -16,6 +16,7 @@ const PreviewAction = ({
16
16
  ...props
17
17
  }) => {
18
18
  var _context$actions;
19
+ const intl = useIntl();
19
20
  const context = useFlexibleUiContext();
20
21
  const invoke = useInvokeClientAction({});
21
22
  const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.PreviewAction];
@@ -35,7 +36,7 @@ const PreviewAction = ({
35
36
  return /*#__PURE__*/React.createElement(PanelRightIcon, _extends({
36
37
  color: "currentColor",
37
38
  spacing: "spacious",
38
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
39
+ label: ""
39
40
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
40
41
  size: props.iconSize
41
42
  } : {}));
@@ -43,24 +44,26 @@ const PreviewAction = ({
43
44
  return /*#__PURE__*/React.createElement(MediaServicesActualSizeIcon, _extends({
44
45
  color: "currentColor",
45
46
  spacing: "spacious",
46
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
47
+ label: ""
47
48
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
48
49
  size: props.iconSize
49
50
  } : {}));
50
51
  }, [hasPreviewPanel, props.iconSize, isRovoBlockCardExperimentEnabled]);
51
- const actionLabel = useCallback(() => {
52
+ const actionLabel = useMemo(() => {
52
53
  // Only use panel message if experiment is enabled and hasPreviewPanel is true
53
54
  if (expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && hasPreviewPanel) {
54
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_panel);
55
+ return messages.preview_panel;
55
56
  }
56
57
  // Fall back to modal message if experiment is enabled, otherwise use original preview message
57
58
  if (expValEquals('platform_hover_card_preview_panel', 'cohort', 'test')) {
58
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_modal);
59
+ return messages.preview_modal;
59
60
  }
60
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved);
61
+ return messages.preview_improved;
61
62
  }, [hasPreviewPanel]);
63
+ const actionMessage = intl.formatMessage(actionLabel);
62
64
  return data ? /*#__PURE__*/React.createElement(Action, _extends({
63
- content: actionLabel(),
65
+ ariaLabel: actionMessage,
66
+ content: actionMessage,
64
67
  icon: actionIcon(),
65
68
  onClick: onClick,
66
69
  testId: "smart-action-preview-action",
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import ClockIcon from '@atlaskit/icon/core/clock';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  const RelatedLinksActionIcon = ({
5
4
  iconSize
6
5
  }) => /*#__PURE__*/React.createElement(ClockIcon, {
7
6
  color: "currentColor",
8
7
  spacing: "spacious",
9
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'View related links...',
8
+ label: '',
10
9
  size: iconSize
11
10
  });
12
11
  export default RelatedLinksActionIcon;
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "45.1.1",
12
+ packageVersion: "45.2.1",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { useCallback } from 'react';
5
5
  import { useCrossProductUrlWrapper } from '@atlaskit/analytics-cross-product/useCrossProductUrlWrapper';
6
6
  import { useSmartLinkContext } from '@atlaskit/link-provider';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { functionWithFG } from '@atlaskit/platform-feature-flags-react';
8
9
  var SMART_LINKS_XPC_BRIDGE = 'smartLinks';
9
10
  var XPC_QUERY_PARAM = 'xpis';
@@ -35,7 +36,7 @@ export var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProduc
35
36
  subProduct: xpcSubProduct
36
37
  } : {}));
37
38
  return useCallback(function (url) {
38
- if (!getIsFirstPartyLink(details) || !effectiveProduct) {
39
+ if (typeof window === 'undefined' && fg('platform_smartlink_xpc_url_wrapping_window_existed') || !getIsFirstPartyLink(details) || !effectiveProduct) {
39
40
  return url;
40
41
  }
41
42
  var parsedUrl;
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "45.1.1" || ''
7
+ packageVersion: "45.2.1" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -8,7 +8,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
8
8
  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; }
9
9
  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; }
10
10
  import React, { useCallback, useState } from 'react';
11
- import { FormattedMessage } from 'react-intl';
11
+ import { FormattedMessage, useIntl } from 'react-intl';
12
12
  import LinkIcon from '@atlaskit/icon/core/link';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import { ActionName } from '../../../../../constants';
@@ -21,6 +21,7 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
21
21
  var _context$actions;
22
22
  var onClickCallback = _ref.onClick,
23
23
  props = _objectWithoutProperties(_ref, _excluded);
24
+ var intl = useIntl();
24
25
  var context = useFlexibleUiContext();
25
26
  var invoke = useInvokeClientAction({});
26
27
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
@@ -58,10 +59,11 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
58
59
  }
59
60
  }, [data, invoke, onClickCallback]);
60
61
  return data ? /*#__PURE__*/React.createElement(Action, _extends({
62
+ ariaLabel: intl.formatMessage(messages.copy_url_to_clipboard),
61
63
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_url_to_clipboard),
62
64
  icon: /*#__PURE__*/React.createElement(LinkIcon, _extends({
63
65
  color: "currentColor",
64
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
66
+ label: "",
65
67
  spacing: "spacious"
66
68
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
67
69
  size: props.iconSize
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["onClick"];
4
- import React, { useCallback } from 'react';
5
- import { FormattedMessage } from 'react-intl';
4
+ import React, { useCallback, useMemo } from 'react';
5
+ import { FormattedMessage, useIntl } from 'react-intl';
6
6
  import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
7
7
  import PanelRightIcon from '@atlaskit/icon/core/panel-right';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -17,6 +17,7 @@ var PreviewAction = function PreviewAction(_ref) {
17
17
  var _context$actions;
18
18
  var onClickCallback = _ref.onClick,
19
19
  props = _objectWithoutProperties(_ref, _excluded);
20
+ var intl = useIntl();
20
21
  var context = useFlexibleUiContext();
21
22
  var invoke = useInvokeClientAction({});
22
23
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.PreviewAction];
@@ -36,7 +37,7 @@ var PreviewAction = function PreviewAction(_ref) {
36
37
  return /*#__PURE__*/React.createElement(PanelRightIcon, _extends({
37
38
  color: "currentColor",
38
39
  spacing: "spacious",
39
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
40
+ label: ""
40
41
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
41
42
  size: props.iconSize
42
43
  } : {}));
@@ -44,24 +45,26 @@ var PreviewAction = function PreviewAction(_ref) {
44
45
  return /*#__PURE__*/React.createElement(MediaServicesActualSizeIcon, _extends({
45
46
  color: "currentColor",
46
47
  spacing: "spacious",
47
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
48
+ label: ""
48
49
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
49
50
  size: props.iconSize
50
51
  } : {}));
51
52
  }, [hasPreviewPanel, props.iconSize, isRovoBlockCardExperimentEnabled]);
52
- var actionLabel = useCallback(function () {
53
+ var actionLabel = useMemo(function () {
53
54
  // Only use panel message if experiment is enabled and hasPreviewPanel is true
54
55
  if (expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && hasPreviewPanel) {
55
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_panel);
56
+ return messages.preview_panel;
56
57
  }
57
58
  // Fall back to modal message if experiment is enabled, otherwise use original preview message
58
59
  if (expValEquals('platform_hover_card_preview_panel', 'cohort', 'test')) {
59
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_modal);
60
+ return messages.preview_modal;
60
61
  }
61
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved);
62
+ return messages.preview_improved;
62
63
  }, [hasPreviewPanel]);
64
+ var actionMessage = intl.formatMessage(actionLabel);
63
65
  return data ? /*#__PURE__*/React.createElement(Action, _extends({
64
- content: actionLabel(),
66
+ ariaLabel: actionMessage,
67
+ content: actionMessage,
65
68
  icon: actionIcon(),
66
69
  onClick: onClick,
67
70
  testId: "smart-action-preview-action",
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import ClockIcon from '@atlaskit/icon/core/clock';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  var RelatedLinksActionIcon = function RelatedLinksActionIcon(_ref) {
5
4
  var iconSize = _ref.iconSize;
6
5
  return /*#__PURE__*/React.createElement(ClockIcon, {
7
6
  color: "currentColor",
8
7
  spacing: "spacious",
9
- label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'View related links...',
8
+ label: '',
10
9
  size: iconSize
11
10
  });
12
11
  };
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "45.1.1",
15
+ packageVersion: "45.2.1",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "45.2.0",
3
+ "version": "45.2.2",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/avatar-group": "^13.0.0",
45
45
  "@atlaskit/badge": "^19.0.0",
46
46
  "@atlaskit/browser-apis": "^1.0.0",
47
- "@atlaskit/button": "^24.0.0",
47
+ "@atlaskit/button": "^24.1.0",
48
48
  "@atlaskit/checkbox": "^18.0.0",
49
49
  "@atlaskit/css": "^1.0.0",
50
50
  "@atlaskit/dropdown-menu": "^17.0.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/link-test-helpers": "^11.0.0",
67
67
  "@atlaskit/linking-common": "^10.0.0",
68
68
  "@atlaskit/linking-types": "^15.0.0",
69
- "@atlaskit/logo": "^21.0.0",
69
+ "@atlaskit/logo": "^21.1.0",
70
70
  "@atlaskit/lozenge": "^14.0.0",
71
71
  "@atlaskit/menu": "^9.0.0",
72
72
  "@atlaskit/modal-dialog": "^16.0.0",
@@ -78,7 +78,7 @@
78
78
  "@atlaskit/popup": "^5.0.0",
79
79
  "@atlaskit/primitives": "^20.0.0",
80
80
  "@atlaskit/react-ufo": "^7.1.0",
81
- "@atlaskit/rovo-triggers": "^9.1.0",
81
+ "@atlaskit/rovo-triggers": "^9.2.0",
82
82
  "@atlaskit/section-message": "^9.0.0",
83
83
  "@atlaskit/select": "^22.0.0",
84
84
  "@atlaskit/spinner": "^20.0.0",
@@ -87,7 +87,7 @@
87
87
  "@atlaskit/textfield": "^9.0.0",
88
88
  "@atlaskit/theme": "^26.0.0",
89
89
  "@atlaskit/tile": "^2.0.0",
90
- "@atlaskit/tmp-editor-statsig": "^108.2.0",
90
+ "@atlaskit/tmp-editor-statsig": "^109.0.0",
91
91
  "@atlaskit/tokens": "^14.0.0",
92
92
  "@atlaskit/tooltip": "^23.0.0",
93
93
  "@atlaskit/ufo": "^1.0.0",
@@ -122,7 +122,7 @@
122
122
  "@atlassian/a11y-jest-testing": "^0.12.0",
123
123
  "@atlassian/analytics-tooling": "workspace:^",
124
124
  "@atlassian/feature-flags-test-utils": "^1.1.0",
125
- "@atlassian/gemini": "^1.46.0",
125
+ "@atlassian/gemini": "^1.47.0",
126
126
  "@atlassian/react-compiler-gating": "workspace:^",
127
127
  "@atlassian/structured-docs-types": "workspace:^",
128
128
  "@atlassian/testing-library": "^0.6.0",
@@ -200,10 +200,10 @@
200
200
  "platform_smartlink_xpc_url_wrapping": {
201
201
  "type": "boolean"
202
202
  },
203
- "navx-1895-new-logo-design": {
203
+ "platform_smartlink_xpc_url_wrapping_window_existed": {
204
204
  "type": "boolean"
205
205
  },
206
- "navx-3698-flexible-card-a11y-fix": {
206
+ "navx-1895-new-logo-design": {
207
207
  "type": "boolean"
208
208
  },
209
209
  "jfp-magma-platform-lozenge-jump-fix": {