@atlaskit/smart-card 43.10.2 → 43.11.1

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 (21) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +4 -9
  3. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +0 -1
  4. package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +3 -10
  5. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +13 -3
  6. package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +2 -7
  7. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +0 -1
  8. package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +3 -10
  9. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +10 -2
  10. package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +4 -9
  11. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +0 -1
  12. package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +3 -10
  13. package/dist/esm/view/HoverCard/components/HoverCardContent.js +13 -3
  14. package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.d.ts +1 -1
  15. package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.d.ts +1 -1
  16. package/package.json +7 -7
  17. package/dist/cjs/view/common/ai-icon/index.js +0 -64
  18. package/dist/es2019/view/common/ai-icon/index.js +0 -54
  19. package/dist/esm/view/common/ai-icon/index.js +0 -57
  20. package/dist/types/view/common/ai-icon/index.d.ts +0 -11
  21. package/dist/types-ts4.5/view/common/ai-icon/index.d.ts +0 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`acac48d4ec892`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acac48d4ec892) -
8
+ Feature gate cleanup of AI icon
9
+
10
+ ## 43.11.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`c155b0b4aa96c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c155b0b4aa96c) -
15
+ [ux] Added a default anchor target for the Hover Card title link for Platform Apps (Home,
16
+ Projects, Goals, and Teams).
17
+
18
+ ### Patch Changes
19
+
20
+ - [`d9471960330dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9471960330dd) -
21
+ Remove duplicated inert `aria-required` attribute from Field components.
22
+ - Updated dependencies
23
+
3
24
  ## 43.10.2
4
25
 
5
26
  ### Patch Changes
@@ -11,17 +11,14 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _reactIntlNext = require("react-intl-next");
13
13
  var _atlassianIntelligence = _interopRequireDefault(require("@atlaskit/icon/core/atlassian-intelligence"));
14
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
16
15
  var _messages = require("../../../../../messages");
17
- var _aiIcon = _interopRequireDefault(require("../../../../common/ai-icon"));
18
16
  var _action = _interopRequireDefault(require("../action"));
19
17
  var _utils = require("./utils");
20
- var _excluded = ["url", "onClick", "onError", "testId", "status", "summariseUrl"];
18
+ var _excluded = ["onClick", "onError", "testId", "status", "summariseUrl"];
21
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); }
22
20
  function AISummariseAction(_ref) {
23
- var url = _ref.url,
24
- onClickCallback = _ref.onClick,
21
+ var onClickCallback = _ref.onClick,
25
22
  onErrorCallback = _ref.onError,
26
23
  testId = _ref.testId,
27
24
  status = _ref.status,
@@ -47,13 +44,11 @@ function AISummariseAction(_ref) {
47
44
  }, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
48
45
  return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
49
46
  content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action),
50
- icon: /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, (0, _extends2.default)({
47
+ icon: /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, {
51
48
  spacing: "spacious",
52
49
  color: "currentColor",
53
50
  label: "Summarise with AI"
54
- }, (0, _platformFeatureFlags.fg)('navx-1959-remove-custom-ai-icon') ? undefined : {
55
- LEGACY_fallbackIcon: _aiIcon.default
56
- })),
51
+ }),
57
52
  onClick: handleActionClick,
58
53
  testId: "".concat(testId, "-summarise-action"),
59
54
  isLoading: status === 'loading',
@@ -42,7 +42,6 @@ var NumberInputPrompt = function NumberInputPrompt(_ref) {
42
42
  };
43
43
  return /*#__PURE__*/_react.default.createElement(_form.Field, {
44
44
  key: variableName,
45
- "aria-required": required,
46
45
  name: variableName,
47
46
  label: displayName,
48
47
  defaultValue: defaultValue,
@@ -5,17 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.AIFooterMetadata = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _reactIntlNext = require("react-intl-next");
11
10
  var _reactMagneticDi = require("react-magnetic-di");
12
11
  var _atlassianIntelligence = _interopRequireDefault(require("@atlaskit/icon/core/atlassian-intelligence"));
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
12
  var _compiled = require("@atlaskit/primitives/compiled");
15
13
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
16
14
  var _messages = require("../../../../../../messages");
17
15
  var _useAiSummaryAction = _interopRequireDefault(require("../../../../../../state/hooks/use-ai-summary-action"));
18
- var _aiIcon = _interopRequireDefault(require("../../../../../common/ai-icon"));
19
16
  var _info = require("../icons/info");
20
17
  var AIFooterMetadata = exports.AIFooterMetadata = function AIFooterMetadata(_ref) {
21
18
  var testId = _ref.testId,
@@ -39,12 +36,8 @@ var AIFooterMetadata = exports.AIFooterMetadata = function AIFooterMetadata(_ref
39
36
  LEGACY_size: "small",
40
37
  color: "var(--ds-icon-subtle, #505258)"
41
38
  }));
42
- }), /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, (0, _extends2.default)({
43
- label: "AI"
44
- }, (0, _platformFeatureFlags.fg)('navx-1959-remove-custom-ai-icon') ? undefined : {
45
- LEGACY_fallbackIcon: _aiIcon.default,
46
- LEGACY_size: 'small'
47
- }, {
39
+ }), /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, {
40
+ label: "AI",
48
41
  color: "var(--ds-icon-subtle, #505258)"
49
- })));
42
+ }));
50
43
  };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.hoverCardClassName = exports.default = void 0;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
10
  var _react = _interopRequireWildcard(require("react"));
10
11
  var _analyticsNext = require("@atlaskit/analytics-next");
11
12
  var _linkProvider = require("@atlaskit/link-provider");
@@ -25,6 +26,8 @@ var _resolved = _interopRequireDefault(require("./views/resolved"));
25
26
  var _resolving = _interopRequireDefault(require("./views/resolving"));
26
27
  var _unauthorised = _interopRequireDefault(require("./views/unauthorised"));
27
28
  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); }
29
+ 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; }
30
+ 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; }
28
31
  var hoverCardClassName = exports.hoverCardClassName = 'smart-links-hover-preview';
29
32
  var HoverCardContent = function HoverCardContent(_ref) {
30
33
  var _linkState$status, _cardState$details;
@@ -52,7 +55,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
52
55
  return (0, _helpers.getDefinitionId)(cardState.details);
53
56
  }, [cardState.details]);
54
57
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
55
- isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
58
+ isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled,
59
+ product = _useSmartLinkContext.product;
56
60
  var isAISummaryEnabled = (0, _aiSummary.getIsAISummaryEnabled)(isAdminHubAIEnabled, cardState.details);
57
61
  var services = (0, _helpers.getServices)(linkState.details);
58
62
  var statusRef = (0, _react.useRef)(linkStatus);
@@ -109,12 +113,18 @@ var HoverCardContent = function HoverCardContent(_ref) {
109
113
  var _getMetadata = (0, _utils2.getMetadata)(extensionKey, data),
110
114
  subtitle = _getMetadata.subtitle;
111
115
  var titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
112
- var titleBlockProps = {
116
+
117
+ // Platform apps (Home, Goals, Projects, and Teams) should by default open in the same tab when the FF is enabled.
118
+ var isSameTabAlignmentEnabled = (0, _platformFeatureFlags.fg)('townsquare-same-tab-alignment-gcko-849');
119
+ var anchorTarget = product === 'ATLAS' && isSameTabAlignmentEnabled ? '_self' : undefined;
120
+ var titleBlockProps = _objectSpread({
113
121
  maxLines: titleMaxLines,
114
122
  size: _constants.SmartLinkSize.Large,
115
123
  position: _constants.SmartLinkPosition.Center,
116
124
  subtitle: subtitle
117
- };
125
+ }, isSameTabAlignmentEnabled ? {
126
+ anchorTarget: anchorTarget
127
+ } : undefined);
118
128
  var uiOptions = _styled.flexibleUiOptions;
119
129
  uiOptions.enableSnippetRenderer = true;
120
130
  var flexibleCardProps = {
@@ -2,14 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
4
  import AiIcon from '@atlaskit/icon/core/atlassian-intelligence';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
7
6
  import { messages } from '../../../../../messages';
8
- import LegacyAiIcon from '../../../../common/ai-icon';
9
7
  import Action from '../action';
10
8
  import { getErrorMessage } from './utils';
11
9
  export function AISummariseAction({
12
- url,
13
10
  onClick: onClickCallback,
14
11
  onError: onErrorCallback,
15
12
  testId,
@@ -38,13 +35,11 @@ export function AISummariseAction({
38
35
  }, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
39
36
  return /*#__PURE__*/React.createElement(Action, _extends({
40
37
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
41
- icon: /*#__PURE__*/React.createElement(AiIcon, _extends({
38
+ icon: /*#__PURE__*/React.createElement(AiIcon, {
42
39
  spacing: "spacious",
43
40
  color: "currentColor",
44
41
  label: "Summarise with AI"
45
- }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
46
- LEGACY_fallbackIcon: LegacyAiIcon
47
- })),
42
+ }),
48
43
  onClick: handleActionClick,
49
44
  testId: `${testId}-summarise-action`,
50
45
  isLoading: status === 'loading',
@@ -38,7 +38,6 @@ const NumberInputPrompt = ({
38
38
  };
39
39
  return /*#__PURE__*/React.createElement(Field, {
40
40
  key: variableName,
41
- "aria-required": required,
42
41
  name: variableName,
43
42
  label: displayName,
44
43
  defaultValue: defaultValue,
@@ -1,14 +1,11 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import React from 'react';
3
2
  import { FormattedMessage } from 'react-intl-next';
4
3
  import { di } from 'react-magnetic-di';
5
4
  import AIIcon from '@atlaskit/icon/core/atlassian-intelligence';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
5
  import { Box, Inline } from '@atlaskit/primitives/compiled';
8
6
  import Tooltip from '@atlaskit/tooltip';
9
7
  import { messages } from '../../../../../../messages';
10
8
  import useAISummaryAction from '../../../../../../state/hooks/use-ai-summary-action';
11
- import LegacyAIIcon from '../../../../../common/ai-icon';
12
9
  import { InfoIcon } from '../icons/info';
13
10
  export const AIFooterMetadata = ({
14
11
  testId,
@@ -34,12 +31,8 @@ export const AIFooterMetadata = ({
34
31
  label: "Information",
35
32
  LEGACY_size: "small",
36
33
  color: "var(--ds-icon-subtle, #505258)"
37
- }))), /*#__PURE__*/React.createElement(AIIcon, _extends({
38
- label: "AI"
39
- }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
40
- LEGACY_fallbackIcon: LegacyAIIcon,
41
- LEGACY_size: 'small'
42
- }, {
34
+ }))), /*#__PURE__*/React.createElement(AIIcon, {
35
+ label: "AI",
43
36
  color: "var(--ds-icon-subtle, #505258)"
44
- })));
37
+ }));
45
38
  };
@@ -41,7 +41,8 @@ const HoverCardContent = ({
41
41
  const linkStatus = (_linkState$status = linkState.status) !== null && _linkState$status !== void 0 ? _linkState$status : 'pending';
42
42
  const definitionId = useMemo(() => getDefinitionId(cardState.details), [cardState.details]);
43
43
  const {
44
- isAdminHubAIEnabled
44
+ isAdminHubAIEnabled,
45
+ product
45
46
  } = useSmartLinkContext();
46
47
  const isAISummaryEnabled = getIsAISummaryEnabled(isAdminHubAIEnabled, cardState.details);
47
48
  const services = getServices(linkState.details);
@@ -100,11 +101,18 @@ const HoverCardContent = ({
100
101
  subtitle
101
102
  } = getMetadata(extensionKey, data);
102
103
  const titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
104
+
105
+ // Platform apps (Home, Goals, Projects, and Teams) should by default open in the same tab when the FF is enabled.
106
+ const isSameTabAlignmentEnabled = fg('townsquare-same-tab-alignment-gcko-849');
107
+ const anchorTarget = product === 'ATLAS' && isSameTabAlignmentEnabled ? '_self' : undefined;
103
108
  const titleBlockProps = {
104
109
  maxLines: titleMaxLines,
105
110
  size: SmartLinkSize.Large,
106
111
  position: SmartLinkPosition.Center,
107
- subtitle: subtitle
112
+ subtitle: subtitle,
113
+ ...(isSameTabAlignmentEnabled ? {
114
+ anchorTarget
115
+ } : undefined)
108
116
  };
109
117
  const uiOptions = flexibleUiOptions;
110
118
  uiOptions.enableSnippetRenderer = true;
@@ -1,18 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["url", "onClick", "onError", "testId", "status", "summariseUrl"];
3
+ var _excluded = ["onClick", "onError", "testId", "status", "summariseUrl"];
4
4
  import React, { useCallback } from 'react';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import AiIcon from '@atlaskit/icon/core/atlassian-intelligence';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
9
8
  import { messages } from '../../../../../messages';
10
- import LegacyAiIcon from '../../../../common/ai-icon';
11
9
  import Action from '../action';
12
10
  import { getErrorMessage } from './utils';
13
11
  export function AISummariseAction(_ref) {
14
- var url = _ref.url,
15
- onClickCallback = _ref.onClick,
12
+ var onClickCallback = _ref.onClick,
16
13
  onErrorCallback = _ref.onError,
17
14
  testId = _ref.testId,
18
15
  status = _ref.status,
@@ -38,13 +35,11 @@ export function AISummariseAction(_ref) {
38
35
  }, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
39
36
  return /*#__PURE__*/React.createElement(Action, _extends({
40
37
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
41
- icon: /*#__PURE__*/React.createElement(AiIcon, _extends({
38
+ icon: /*#__PURE__*/React.createElement(AiIcon, {
42
39
  spacing: "spacious",
43
40
  color: "currentColor",
44
41
  label: "Summarise with AI"
45
- }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
46
- LEGACY_fallbackIcon: LegacyAiIcon
47
- })),
42
+ }),
48
43
  onClick: handleActionClick,
49
44
  testId: "".concat(testId, "-summarise-action"),
50
45
  isLoading: status === 'loading',
@@ -35,7 +35,6 @@ var NumberInputPrompt = function NumberInputPrompt(_ref) {
35
35
  };
36
36
  return /*#__PURE__*/React.createElement(Field, {
37
37
  key: variableName,
38
- "aria-required": required,
39
38
  name: variableName,
40
39
  label: displayName,
41
40
  defaultValue: defaultValue,
@@ -1,14 +1,11 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import React from 'react';
3
2
  import { FormattedMessage } from 'react-intl-next';
4
3
  import { di } from 'react-magnetic-di';
5
4
  import AIIcon from '@atlaskit/icon/core/atlassian-intelligence';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
5
  import { Box, Inline } from '@atlaskit/primitives/compiled';
8
6
  import Tooltip from '@atlaskit/tooltip';
9
7
  import { messages } from '../../../../../../messages';
10
8
  import useAISummaryAction from '../../../../../../state/hooks/use-ai-summary-action';
11
- import LegacyAIIcon from '../../../../../common/ai-icon';
12
9
  import { InfoIcon } from '../icons/info';
13
10
  export var AIFooterMetadata = function AIFooterMetadata(_ref) {
14
11
  var testId = _ref.testId,
@@ -32,12 +29,8 @@ export var AIFooterMetadata = function AIFooterMetadata(_ref) {
32
29
  LEGACY_size: "small",
33
30
  color: "var(--ds-icon-subtle, #505258)"
34
31
  }));
35
- }), /*#__PURE__*/React.createElement(AIIcon, _extends({
36
- label: "AI"
37
- }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
38
- LEGACY_fallbackIcon: LegacyAIIcon,
39
- LEGACY_size: 'small'
40
- }, {
32
+ }), /*#__PURE__*/React.createElement(AIIcon, {
33
+ label: "AI",
41
34
  color: "var(--ds-icon-subtle, #505258)"
42
- })));
35
+ }));
43
36
  };
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
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
+ 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; }
1
4
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
5
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
3
6
  import { useSmartLinkContext } from '@atlaskit/link-provider';
@@ -43,7 +46,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
43
46
  return getDefinitionId(cardState.details);
44
47
  }, [cardState.details]);
45
48
  var _useSmartLinkContext = useSmartLinkContext(),
46
- isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
49
+ isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled,
50
+ product = _useSmartLinkContext.product;
47
51
  var isAISummaryEnabled = getIsAISummaryEnabled(isAdminHubAIEnabled, cardState.details);
48
52
  var services = getServices(linkState.details);
49
53
  var statusRef = useRef(linkStatus);
@@ -100,12 +104,18 @@ var HoverCardContent = function HoverCardContent(_ref) {
100
104
  var _getMetadata = getMetadata(extensionKey, data),
101
105
  subtitle = _getMetadata.subtitle;
102
106
  var titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
103
- var titleBlockProps = {
107
+
108
+ // Platform apps (Home, Goals, Projects, and Teams) should by default open in the same tab when the FF is enabled.
109
+ var isSameTabAlignmentEnabled = fg('townsquare-same-tab-alignment-gcko-849');
110
+ var anchorTarget = product === 'ATLAS' && isSameTabAlignmentEnabled ? '_self' : undefined;
111
+ var titleBlockProps = _objectSpread({
104
112
  maxLines: titleMaxLines,
105
113
  size: SmartLinkSize.Large,
106
114
  position: SmartLinkPosition.Center,
107
115
  subtitle: subtitle
108
- };
116
+ }, isSameTabAlignmentEnabled ? {
117
+ anchorTarget: anchorTarget
118
+ } : undefined);
109
119
  var uiOptions = flexibleUiOptions;
110
120
  uiOptions.enableSnippetRenderer = true;
111
121
  var flexibleCardProps = {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
3
3
  import type { AISummaryState, AISummaryStatus } from '../../../../../state/hooks/use-ai-summary/ai-summary-service/types';
4
4
  import type { AISummaryActionProps } from './types';
5
- export declare function AISummariseAction({ url, onClick: onClickCallback, onError: onErrorCallback, testId, status, summariseUrl, ...props }: AISummaryActionProps & AISummaryActionData & {
5
+ export declare function AISummariseAction({ onClick: onClickCallback, onError: onErrorCallback, testId, status, summariseUrl, ...props }: AISummaryActionProps & AISummaryActionData & {
6
6
  status: AISummaryStatus;
7
7
  summariseUrl: () => Promise<AISummaryState> | undefined;
8
8
  }): React.JSX.Element;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
3
3
  import type { AISummaryState, AISummaryStatus } from '../../../../../state/hooks/use-ai-summary/ai-summary-service/types';
4
4
  import type { AISummaryActionProps } from './types';
5
- export declare function AISummariseAction({ url, onClick: onClickCallback, onError: onErrorCallback, testId, status, summariseUrl, ...props }: AISummaryActionProps & AISummaryActionData & {
5
+ export declare function AISummariseAction({ onClick: onClickCallback, onError: onErrorCallback, testId, status, summariseUrl, ...props }: AISummaryActionProps & AISummaryActionData & {
6
6
  status: AISummaryStatus;
7
7
  summariseUrl: () => Promise<AISummaryState> | undefined;
8
8
  }): React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.10.2",
3
+ "version": "43.11.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -63,15 +63,15 @@
63
63
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
64
64
  "@atlaskit/platform-feature-flags": "^1.1.0",
65
65
  "@atlaskit/popup": "^4.6.0",
66
- "@atlaskit/primitives": "^16.3.0",
66
+ "@atlaskit/primitives": "^16.4.0",
67
67
  "@atlaskit/section-message": "^8.9.0",
68
68
  "@atlaskit/select": "^21.4.0",
69
69
  "@atlaskit/spinner": "^19.0.0",
70
70
  "@atlaskit/textarea": "^8.1.0",
71
71
  "@atlaskit/textfield": "^8.1.0",
72
72
  "@atlaskit/theme": "^21.0.0",
73
- "@atlaskit/tmp-editor-statsig": "^13.42.0",
74
- "@atlaskit/tokens": "^8.3.0",
73
+ "@atlaskit/tmp-editor-statsig": "^13.44.0",
74
+ "@atlaskit/tokens": "^8.4.0",
75
75
  "@atlaskit/tooltip": "^20.10.0",
76
76
  "@atlaskit/ufo": "^0.4.0",
77
77
  "@babel/runtime": "^7.0.0",
@@ -104,7 +104,7 @@
104
104
  "@atlaskit/ssr": "workspace:^",
105
105
  "@atlassian/analytics-tooling": "workspace:^",
106
106
  "@atlassian/feature-flags-test-utils": "^1.0.0",
107
- "@atlassian/gemini": "^1.21.0",
107
+ "@atlassian/gemini": "^1.22.0",
108
108
  "@testing-library/dom": "^10.1.0",
109
109
  "@testing-library/jest-dom": "^6.4.5",
110
110
  "@testing-library/react": "^13.4.0",
@@ -229,10 +229,10 @@
229
229
  "expose-product-details-from-smart-card": {
230
230
  "type": "boolean"
231
231
  },
232
- "navx-1959-remove-custom-ai-icon": {
232
+ "navx-2479-sl-fix-inilne-card-show-connect-button": {
233
233
  "type": "boolean"
234
234
  },
235
- "navx-2479-sl-fix-inilne-card-show-connect-button": {
235
+ "townsquare-same-tab-alignment-gcko-849": {
236
236
  "type": "boolean"
237
237
  },
238
238
  "hover-card-prop-should-render-to-parent": {
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
10
- /**
11
- * The bulk of this file is originally from
12
- * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
13
- * with modifications
14
- * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
15
- * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
16
- */
17
- var AiIcon = function AiIcon(props) {
18
- return (
19
- /*#__PURE__*/
20
- // eslint-disable-next-line @atlaskit/design-system/no-custom-icons
21
- _react.default.createElement(_svg.default, props, /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("path", {
22
- fillRule: "evenodd",
23
- clipRule: "evenodd",
24
- d: "M17.17 12C17.17 11.4477 17.6177 11 18.17 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H18.17C17.6177 13 17.17 12.5523 17.17 12Z",
25
- fill: "var(--ds-icon, #44546F)"
26
- }), /*#__PURE__*/_react.default.createElement("path", {
27
- fillRule: "evenodd",
28
- clipRule: "evenodd",
29
- d: "M12 3C12.5523 3 13 3.44772 13 4V5.83C13 6.38228 12.5523 6.83 12 6.83C11.4477 6.83 11 6.38228 11 5.83V4C11 3.44772 11.4477 3 12 3Z",
30
- fill: "var(--ds-icon, #44546F)"
31
- }), /*#__PURE__*/_react.default.createElement("path", {
32
- fillRule: "evenodd",
33
- clipRule: "evenodd",
34
- d: "M3 12C3 11.4477 3.44772 11 4 11H5.83C6.38228 11 6.83 11.4477 6.83 12C6.83 12.5523 6.38228 13 5.83 13H4C3.44772 13 3 12.5523 3 12Z",
35
- fill: "var(--ds-icon, #44546F)"
36
- }), /*#__PURE__*/_react.default.createElement("path", {
37
- fillRule: "evenodd",
38
- clipRule: "evenodd",
39
- d: "M12 17.17C12.5523 17.17 13 17.6177 13 18.17V20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20V18.17C11 17.6177 11.4477 17.17 12 17.17Z",
40
- fill: "var(--ds-icon, #44546F)"
41
- }), /*#__PURE__*/_react.default.createElement("path", {
42
- fillRule: "evenodd",
43
- clipRule: "evenodd",
44
- d: "M14.2929 14.2929C14.6835 13.9024 15.3166 13.9024 15.7071 14.2929L19.7071 18.2929C20.0977 18.6834 20.0977 19.3166 19.7071 19.7071C19.3166 20.0976 18.6835 20.0976 18.2929 19.7071L14.2929 15.7071C13.9024 15.3166 13.9024 14.6834 14.2929 14.2929Z",
45
- fill: "var(--ds-icon, #44546F)"
46
- }), /*#__PURE__*/_react.default.createElement("path", {
47
- fillRule: "evenodd",
48
- clipRule: "evenodd",
49
- d: "M19.7071 4.29289C20.0977 4.68342 20.0977 5.31658 19.7071 5.70711L15.7071 9.70711C15.3166 10.0976 14.6835 10.0976 14.2929 9.70711C13.9024 9.31658 13.9024 8.68342 14.2929 8.29289L18.2929 4.29289C18.6835 3.90237 19.3166 3.90237 19.7071 4.29289Z",
50
- fill: "var(--ds-icon, #44546F)"
51
- }), /*#__PURE__*/_react.default.createElement("path", {
52
- fillRule: "evenodd",
53
- clipRule: "evenodd",
54
- d: "M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C10.0976 8.68342 10.0976 9.31658 9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z",
55
- fill: "var(--ds-icon, #44546F)"
56
- }), /*#__PURE__*/_react.default.createElement("path", {
57
- fillRule: "evenodd",
58
- clipRule: "evenodd",
59
- d: "M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",
60
- fill: "var(--ds-icon, #44546F)"
61
- })))
62
- );
63
- };
64
- var _default = exports.default = AiIcon;
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import SVG from '@atlaskit/icon/svg';
3
- /**
4
- * The bulk of this file is originally from
5
- * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
- * with modifications
7
- * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
- * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
9
- */
10
- const AiIcon = props =>
11
- /*#__PURE__*/
12
- // eslint-disable-next-line @atlaskit/design-system/no-custom-icons
13
- React.createElement(SVG, props, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
14
- fillRule: "evenodd",
15
- clipRule: "evenodd",
16
- d: "M17.17 12C17.17 11.4477 17.6177 11 18.17 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H18.17C17.6177 13 17.17 12.5523 17.17 12Z",
17
- fill: "var(--ds-icon, #44546F)"
18
- }), /*#__PURE__*/React.createElement("path", {
19
- fillRule: "evenodd",
20
- clipRule: "evenodd",
21
- d: "M12 3C12.5523 3 13 3.44772 13 4V5.83C13 6.38228 12.5523 6.83 12 6.83C11.4477 6.83 11 6.38228 11 5.83V4C11 3.44772 11.4477 3 12 3Z",
22
- fill: "var(--ds-icon, #44546F)"
23
- }), /*#__PURE__*/React.createElement("path", {
24
- fillRule: "evenodd",
25
- clipRule: "evenodd",
26
- d: "M3 12C3 11.4477 3.44772 11 4 11H5.83C6.38228 11 6.83 11.4477 6.83 12C6.83 12.5523 6.38228 13 5.83 13H4C3.44772 13 3 12.5523 3 12Z",
27
- fill: "var(--ds-icon, #44546F)"
28
- }), /*#__PURE__*/React.createElement("path", {
29
- fillRule: "evenodd",
30
- clipRule: "evenodd",
31
- d: "M12 17.17C12.5523 17.17 13 17.6177 13 18.17V20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20V18.17C11 17.6177 11.4477 17.17 12 17.17Z",
32
- fill: "var(--ds-icon, #44546F)"
33
- }), /*#__PURE__*/React.createElement("path", {
34
- fillRule: "evenodd",
35
- clipRule: "evenodd",
36
- d: "M14.2929 14.2929C14.6835 13.9024 15.3166 13.9024 15.7071 14.2929L19.7071 18.2929C20.0977 18.6834 20.0977 19.3166 19.7071 19.7071C19.3166 20.0976 18.6835 20.0976 18.2929 19.7071L14.2929 15.7071C13.9024 15.3166 13.9024 14.6834 14.2929 14.2929Z",
37
- fill: "var(--ds-icon, #44546F)"
38
- }), /*#__PURE__*/React.createElement("path", {
39
- fillRule: "evenodd",
40
- clipRule: "evenodd",
41
- d: "M19.7071 4.29289C20.0977 4.68342 20.0977 5.31658 19.7071 5.70711L15.7071 9.70711C15.3166 10.0976 14.6835 10.0976 14.2929 9.70711C13.9024 9.31658 13.9024 8.68342 14.2929 8.29289L18.2929 4.29289C18.6835 3.90237 19.3166 3.90237 19.7071 4.29289Z",
42
- fill: "var(--ds-icon, #44546F)"
43
- }), /*#__PURE__*/React.createElement("path", {
44
- fillRule: "evenodd",
45
- clipRule: "evenodd",
46
- d: "M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C10.0976 8.68342 10.0976 9.31658 9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z",
47
- fill: "var(--ds-icon, #44546F)"
48
- }), /*#__PURE__*/React.createElement("path", {
49
- fillRule: "evenodd",
50
- clipRule: "evenodd",
51
- d: "M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",
52
- fill: "var(--ds-icon, #44546F)"
53
- })));
54
- export default AiIcon;
@@ -1,57 +0,0 @@
1
- import React from 'react';
2
- import SVG from '@atlaskit/icon/svg';
3
- /**
4
- * The bulk of this file is originally from
5
- * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
- * with modifications
7
- * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
- * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
9
- */
10
- var AiIcon = function AiIcon(props) {
11
- return (
12
- /*#__PURE__*/
13
- // eslint-disable-next-line @atlaskit/design-system/no-custom-icons
14
- React.createElement(SVG, props, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
15
- fillRule: "evenodd",
16
- clipRule: "evenodd",
17
- d: "M17.17 12C17.17 11.4477 17.6177 11 18.17 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H18.17C17.6177 13 17.17 12.5523 17.17 12Z",
18
- fill: "var(--ds-icon, #44546F)"
19
- }), /*#__PURE__*/React.createElement("path", {
20
- fillRule: "evenodd",
21
- clipRule: "evenodd",
22
- d: "M12 3C12.5523 3 13 3.44772 13 4V5.83C13 6.38228 12.5523 6.83 12 6.83C11.4477 6.83 11 6.38228 11 5.83V4C11 3.44772 11.4477 3 12 3Z",
23
- fill: "var(--ds-icon, #44546F)"
24
- }), /*#__PURE__*/React.createElement("path", {
25
- fillRule: "evenodd",
26
- clipRule: "evenodd",
27
- d: "M3 12C3 11.4477 3.44772 11 4 11H5.83C6.38228 11 6.83 11.4477 6.83 12C6.83 12.5523 6.38228 13 5.83 13H4C3.44772 13 3 12.5523 3 12Z",
28
- fill: "var(--ds-icon, #44546F)"
29
- }), /*#__PURE__*/React.createElement("path", {
30
- fillRule: "evenodd",
31
- clipRule: "evenodd",
32
- d: "M12 17.17C12.5523 17.17 13 17.6177 13 18.17V20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20V18.17C11 17.6177 11.4477 17.17 12 17.17Z",
33
- fill: "var(--ds-icon, #44546F)"
34
- }), /*#__PURE__*/React.createElement("path", {
35
- fillRule: "evenodd",
36
- clipRule: "evenodd",
37
- d: "M14.2929 14.2929C14.6835 13.9024 15.3166 13.9024 15.7071 14.2929L19.7071 18.2929C20.0977 18.6834 20.0977 19.3166 19.7071 19.7071C19.3166 20.0976 18.6835 20.0976 18.2929 19.7071L14.2929 15.7071C13.9024 15.3166 13.9024 14.6834 14.2929 14.2929Z",
38
- fill: "var(--ds-icon, #44546F)"
39
- }), /*#__PURE__*/React.createElement("path", {
40
- fillRule: "evenodd",
41
- clipRule: "evenodd",
42
- d: "M19.7071 4.29289C20.0977 4.68342 20.0977 5.31658 19.7071 5.70711L15.7071 9.70711C15.3166 10.0976 14.6835 10.0976 14.2929 9.70711C13.9024 9.31658 13.9024 8.68342 14.2929 8.29289L18.2929 4.29289C18.6835 3.90237 19.3166 3.90237 19.7071 4.29289Z",
43
- fill: "var(--ds-icon, #44546F)"
44
- }), /*#__PURE__*/React.createElement("path", {
45
- fillRule: "evenodd",
46
- clipRule: "evenodd",
47
- d: "M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C10.0976 8.68342 10.0976 9.31658 9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z",
48
- fill: "var(--ds-icon, #44546F)"
49
- }), /*#__PURE__*/React.createElement("path", {
50
- fillRule: "evenodd",
51
- clipRule: "evenodd",
52
- d: "M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",
53
- fill: "var(--ds-icon, #44546F)"
54
- })))
55
- );
56
- };
57
- export default AiIcon;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { SVGProps } from '@atlaskit/icon/types';
3
- /**
4
- * The bulk of this file is originally from
5
- * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
- * with modifications
7
- * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
- * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
9
- */
10
- declare const AiIcon: (props: SVGProps) => React.JSX.Element;
11
- export default AiIcon;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { SVGProps } from '@atlaskit/icon/types';
3
- /**
4
- * The bulk of this file is originally from
5
- * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
- * with modifications
7
- * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
- * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
9
- */
10
- declare const AiIcon: (props: SVGProps) => React.JSX.Element;
11
- export default AiIcon;