@atlaskit/smart-card 43.10.2 → 43.11.0

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,19 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c155b0b4aa96c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c155b0b4aa96c) -
8
+ [ux] Added a default anchor target for the Hover Card title link for Platform Apps (Home,
9
+ Projects, Goals, and Teams).
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d9471960330dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9471960330dd) -
14
+ Remove duplicated inert `aria-required` attribute from Field components.
15
+ - Updated dependencies
16
+
3
17
  ## 43.10.2
4
18
 
5
19
  ### Patch Changes
@@ -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: "0.0.0-development"
14
+ packageVersion: "43.10.2"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -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,
@@ -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 = {
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
22
22
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
23
23
  var PACKAGE_DATA = {
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "0.0.0-development",
25
+ packageVersion: "43.10.2",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
 
@@ -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: "0.0.0-development"
5
+ packageVersion: "43.10.2"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -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,
@@ -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;
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "0.0.0-development",
15
+ packageVersion: "43.10.2",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
 
@@ -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: "0.0.0-development"
7
+ packageVersion: "43.10.2"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -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,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 = {
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "0.0.0-development",
18
+ packageVersion: "43.10.2",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
 
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.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -70,7 +70,7 @@
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",
73
+ "@atlaskit/tmp-editor-statsig": "^13.43.0",
74
74
  "@atlaskit/tokens": "^8.3.0",
75
75
  "@atlaskit/tooltip": "^20.10.0",
76
76
  "@atlaskit/ufo": "^0.4.0",
@@ -235,6 +235,9 @@
235
235
  "navx-2479-sl-fix-inilne-card-show-connect-button": {
236
236
  "type": "boolean"
237
237
  },
238
+ "townsquare-same-tab-alignment-gcko-849": {
239
+ "type": "boolean"
240
+ },
238
241
  "hover-card-prop-should-render-to-parent": {
239
242
  "type": "boolean"
240
243
  },