@atlaskit/help 7.3.2 → 7.4.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/cjs/analytics.js +1 -1
  3. package/dist/cjs/components/Article/ArticleLoadingFail/index.js +1 -1
  4. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  5. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  6. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  7. package/dist/cjs/components/Article/HelpArticle/index.js +1 -1
  8. package/dist/cjs/components/Article/WhatsNewArticle/index.js +1 -1
  9. package/dist/cjs/components/ArticlesList/ArticlesList.js +8 -2
  10. package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +19 -4
  11. package/dist/cjs/components/ArticlesList/ArticlesListItem/styled.js +42 -8
  12. package/dist/cjs/components/HelpContentButton/index.js +1 -1
  13. package/dist/cjs/components/RelatedArticles/index.js +1 -1
  14. package/dist/cjs/components/Search/SearchInput/index.js +1 -1
  15. package/dist/cjs/components/WhatsNew/WhatsNewButton/index.js +1 -1
  16. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  17. package/dist/cjs/components/contexts/navigationContext.js +29 -10
  18. package/dist/cjs/components/contexts/searchContext.js +0 -3
  19. package/dist/es2019/analytics.js +1 -1
  20. package/dist/es2019/components/Article/ArticleLoadingFail/index.js +1 -1
  21. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  22. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  23. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  24. package/dist/es2019/components/Article/HelpArticle/index.js +1 -1
  25. package/dist/es2019/components/Article/WhatsNewArticle/index.js +1 -1
  26. package/dist/es2019/components/ArticlesList/ArticlesList.js +8 -2
  27. package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +20 -5
  28. package/dist/es2019/components/ArticlesList/ArticlesListItem/styled.js +41 -7
  29. package/dist/es2019/components/HelpContentButton/index.js +1 -1
  30. package/dist/es2019/components/RelatedArticles/index.js +1 -1
  31. package/dist/es2019/components/Search/SearchInput/index.js +1 -1
  32. package/dist/es2019/components/WhatsNew/WhatsNewButton/index.js +1 -1
  33. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  34. package/dist/es2019/components/contexts/navigationContext.js +29 -10
  35. package/dist/es2019/components/contexts/searchContext.js +0 -3
  36. package/dist/esm/analytics.js +1 -1
  37. package/dist/esm/components/Article/ArticleLoadingFail/index.js +1 -1
  38. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  39. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  40. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  41. package/dist/esm/components/Article/HelpArticle/index.js +1 -1
  42. package/dist/esm/components/Article/WhatsNewArticle/index.js +1 -1
  43. package/dist/esm/components/ArticlesList/ArticlesList.js +8 -2
  44. package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +20 -5
  45. package/dist/esm/components/ArticlesList/ArticlesListItem/styled.js +41 -7
  46. package/dist/esm/components/HelpContentButton/index.js +1 -1
  47. package/dist/esm/components/RelatedArticles/index.js +1 -1
  48. package/dist/esm/components/Search/SearchInput/index.js +1 -1
  49. package/dist/esm/components/WhatsNew/WhatsNewButton/index.js +1 -1
  50. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  51. package/dist/esm/components/contexts/navigationContext.js +29 -10
  52. package/dist/esm/components/contexts/searchContext.js +0 -3
  53. package/dist/types/components/ArticlesList/ArticlesList.d.ts +1 -1
  54. package/dist/types/components/ArticlesList/ArticlesListItem/index.d.ts +3 -3
  55. package/dist/types/components/ArticlesList/ArticlesListItem/styled.d.ts +25 -1
  56. package/dist/types/components/contexts/navigationContext.d.ts +5 -5
  57. package/dist/types/model/Article.d.ts +6 -1
  58. package/dist/types-ts4.5/components/ArticlesList/ArticlesList.d.ts +1 -1
  59. package/dist/types-ts4.5/components/ArticlesList/ArticlesListItem/index.d.ts +3 -3
  60. package/dist/types-ts4.5/components/ArticlesList/ArticlesListItem/styled.d.ts +25 -1
  61. package/dist/types-ts4.5/components/contexts/navigationContext.d.ts +5 -5
  62. package/dist/types-ts4.5/model/Article.d.ts +6 -1
  63. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @atlaskit/help
2
2
 
3
+ ## 7.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#101167](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101167)
8
+ [`52a888c912e8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52a888c912e8) -
9
+ [ux] Display 4 extra article details in Article search display
10
+
11
+ 1. Last published
12
+
13
+ 2. Content source
14
+
15
+ 3. Helpful count
16
+
17
+ 4. View count
18
+
19
+ All changes are backward compatible
20
+
21
+ ## 7.3.3
22
+
23
+ ### Patch Changes
24
+
25
+ - [#99831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99831)
26
+ [`9652182a0292`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9652182a0292) -
27
+ Fix issue where the back button used to lose context of the search results and takes back to the
28
+ default page. Now it takes back to the place where the user started from
29
+ - [#99831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99831)
30
+ [`e5fd89bc770c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e5fd89bc770c) -
31
+ Fix individual scroll bars appearing for titles when an external URL icon is present in safari
32
+
3
33
  ## 7.3.2
4
34
 
5
35
  ### Patch Changes
@@ -14,5 +14,5 @@ var createAndFire = exports.createAndFire = x.createAndFireEvent('atlaskit');
14
14
  var defaultAnalyticsAttributes = exports.defaultAnalyticsAttributes = {
15
15
  componentName: 'help',
16
16
  packageName: "@atlaskit/help",
17
- packageVersion: "7.3.2"
17
+ packageVersion: "7.4.0"
18
18
  };
@@ -15,7 +15,7 @@ var _styled = require("./styled");
15
15
  var ANALYTICS_CONTEXT_DATA = {
16
16
  componentName: 'ArticleLoadingFail',
17
17
  packageName: "@atlaskit/help",
18
- packageVersion: "7.3.2"
18
+ packageVersion: "7.4.0"
19
19
  };
20
20
  var ArticleLoadingFail = exports.ArticleLoadingFail = function ArticleLoadingFail(_ref) {
21
21
  var onTryAgainButtonClick = _ref.onTryAgainButtonClick,
@@ -13,7 +13,7 @@ var _messages = require("../../../../messages");
13
13
  var ANALYTICS_CONTEXT_DATA = {
14
14
  componentName: 'ArticleWasHelpfulNoButton',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.3.2"
16
+ packageVersion: "7.4.0"
17
17
  };
18
18
  var ArticleWasHelpfulNoButton = exports.ArticleWasHelpfulNoButton = function ArticleWasHelpfulNoButton(_ref) {
19
19
  var _ref$isSelected = _ref.isSelected,
@@ -13,7 +13,7 @@ var _messages = require("../../../../messages");
13
13
  var ANALYTICS_CONTEXT_DATA = {
14
14
  componentName: 'ArticleWasHelpfulYesButton',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.3.2"
16
+ packageVersion: "7.4.0"
17
17
  };
18
18
  var ArticleWasHelpfulYesButton = exports.ArticleWasHelpfulYesButton = function ArticleWasHelpfulYesButton(_ref) {
19
19
  var _ref$isSelected = _ref.isSelected,
@@ -37,7 +37,7 @@ var FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
37
37
  var ANALYTICS_CONTEXT_DATA = {
38
38
  componentName: 'ArticleWasHelpfulForm',
39
39
  packageName: "@atlaskit/help",
40
- packageVersion: "7.3.2"
40
+ packageVersion: "7.4.0"
41
41
  };
42
42
  var ArticleWasHelpfulForm = exports.ArticleWasHelpfulForm = function ArticleWasHelpfulForm(_ref) {
43
43
  var onWasHelpfulSubmit = _ref.onWasHelpfulSubmit,
@@ -64,7 +64,7 @@ var HelpArticle = exports.HelpArticle = function HelpArticle(_ref) {
64
64
  analyticsEvent.payload.attributes = {
65
65
  componentName: 'Article',
66
66
  packageName: "@atlaskit/help",
67
- packageVersion: "7.3.2"
67
+ packageVersion: "7.4.0"
68
68
  };
69
69
  if (onRelatedArticlesShowMoreClick) {
70
70
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -22,7 +22,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
22
22
  var analyticsContextData = {
23
23
  componentName: 'ArticlesListItem',
24
24
  packageName: "@atlaskit/help",
25
- packageVersion: "7.3.2"
25
+ packageVersion: "7.4.0"
26
26
  };
27
27
  var WhatsNewArticle = exports.WhatsNewArticle = function WhatsNewArticle(_ref) {
28
28
  var formatMessage = _ref.intl.formatMessage,
@@ -46,7 +46,10 @@ var articlesList = function articlesList(_ref) {
46
46
  title: article.title,
47
47
  description: article.description,
48
48
  key: article.id,
49
- href: article.href
49
+ href: article.href,
50
+ trustFactors: article.trustFactors,
51
+ source: article.source,
52
+ lastPublished: article.lastPublished
50
53
  });
51
54
  })), /*#__PURE__*/_react.default.createElement(_reactAnimateHeight.default, {
52
55
  duration: _constants.ANIMATE_HEIGHT_TRANSITION_DURATION_MS,
@@ -64,7 +67,10 @@ var articlesList = function articlesList(_ref) {
64
67
  title: article.title,
65
68
  description: article.description,
66
69
  key: article.id,
67
- href: article.href
70
+ href: article.href,
71
+ trustFactors: article.trustFactors,
72
+ source: article.source,
73
+ lastPublished: article.lastPublished
68
74
  });
69
75
  })));
70
76
  };
@@ -11,13 +11,14 @@ var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
11
11
  var _analyticsNext = require("@atlaskit/analytics-next");
12
12
  var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
+ var _like = _interopRequireDefault(require("@atlaskit/icon/glyph/like"));
14
15
  var _styled = require("./styled");
15
16
  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); }
16
17
  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 && Object.prototype.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; }
17
18
  var ANALYTICS_CONTEXT_DATA = {
18
19
  componentName: 'ArticlesListItem',
19
20
  packageName: "@atlaskit/help",
20
- packageVersion: "7.3.2"
21
+ packageVersion: "7.4.0"
21
22
  };
22
23
  var ArticlesListItem = exports.ArticlesListItem = function ArticlesListItem(_ref) {
23
24
  var styles = _ref.styles,
@@ -25,7 +26,10 @@ var ArticlesListItem = exports.ArticlesListItem = function ArticlesListItem(_ref
25
26
  description = _ref.description,
26
27
  _ref$href = _ref.href,
27
28
  href = _ref$href === void 0 ? '' : _ref$href,
28
- onClick = _ref.onClick;
29
+ onClick = _ref.onClick,
30
+ trustFactors = _ref.trustFactors,
31
+ source = _ref.source,
32
+ lastPublished = _ref.lastPublished;
29
33
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
30
34
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
31
35
  var handleOnClick = function handleOnClick(event) {
@@ -37,18 +41,29 @@ var ArticlesListItem = exports.ArticlesListItem = function ArticlesListItem(_ref
37
41
  onClick(event, _analyticsEvent);
38
42
  }
39
43
  };
44
+
45
+ // Check if trust factors are available
46
+ var isNumViewsVisible = (trustFactors === null || trustFactors === void 0 ? void 0 : trustFactors.numViews) != null;
47
+ var isHelpfulCountVisible = (trustFactors === null || trustFactors === void 0 ? void 0 : trustFactors.helpfulCount) != null;
48
+ var isTrustFactorVisible = isNumViewsVisible || isHelpfulCountVisible;
49
+ // Check if source is available
50
+ var isSourceVisible = source != null;
51
+ var isLastPublishedVisible = lastPublished != null && lastPublished !== '';
40
52
  return /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemWrapper, {
41
53
  styles: styles,
42
54
  "aria-disabled": "false",
43
55
  role: "button",
44
56
  href: href,
45
57
  onClick: handleOnClick
46
- }, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemContainer, null, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemTitleText, null, title, href && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemLinkIcon, null, /*#__PURE__*/_react.default.createElement(_shortcut.default, {
58
+ }, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemContainer, null, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemTitleSection, null, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemTitleText, null, title), isLastPublishedVisible && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemLastModified, null, "Last modified: ", lastPublished)), href && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemLinkIcon, null, /*#__PURE__*/_react.default.createElement(_shortcut.default, {
47
59
  size: "small",
48
60
  label: "",
49
61
  primaryColor: "var(--ds-icon-subtle, ".concat(colors.N90, ")"),
50
62
  secondaryColor: "var(--ds-icon-subtle, ".concat(colors.N90, ")")
51
- })))), /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemDescription, null, description));
63
+ }))), /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemDescription, null, description), isSourceVisible && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemSource, null, source), isTrustFactorVisible && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemTrustFactor, null, isNumViewsVisible && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemViewCount, null, trustFactors.numViews, " views"), isHelpfulCountVisible && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemHelpfulCount, null, /*#__PURE__*/_react.default.createElement(_like.default, {
64
+ label: "Like",
65
+ size: "small"
66
+ }), trustFactors.helpfulCount)));
52
67
  };
53
68
  var ArticlesListItemWithContext = function ArticlesListItemWithContext(props) {
54
69
  return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.ArticlesListItemWrapper = exports.ArticlesListItemTypeTitle = exports.ArticlesListItemTitleText = exports.ArticlesListItemLinkIcon = exports.ArticlesListItemDescription = exports.ArticlesListItemContainer = void 0;
8
+ exports.ArticlesListItemWrapper = exports.ArticlesListItemViewCount = exports.ArticlesListItemTypeTitle = exports.ArticlesListItemTrustFactor = exports.ArticlesListItemTitleText = exports.ArticlesListItemTitleSection = exports.ArticlesListItemSource = exports.ArticlesListItemLinkIcon = exports.ArticlesListItemLastModified = exports.ArticlesListItemHelpfulCount = exports.ArticlesListItemDescription = exports.ArticlesListItemContainer = void 0;
9
9
  var _styled = _interopRequireDefault(require("@emotion/styled"));
10
10
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
11
11
  var _typography = require("@atlaskit/theme/typography");
@@ -42,31 +42,65 @@ var ArticlesListItemWrapper = exports.ArticlesListItemWrapper = _styled.default.
42
42
  });
43
43
  var ArticlesListItemContainer = exports.ArticlesListItemContainer = _styled.default.div({
44
44
  width: '100%',
45
- whiteSpace: 'nowrap'
45
+ whiteSpace: 'nowrap',
46
+ display: 'flex'
47
+ });
48
+ var ArticlesListItemTitleSection = exports.ArticlesListItemTitleSection = _styled.default.div({
49
+ display: 'flex',
50
+ flexDirection: 'column',
51
+ flexGrow: 1
46
52
  });
47
53
  var ArticlesListItemTypeTitle = exports.ArticlesListItemTypeTitle = _styled.default.div({
48
54
  font: "var(--ds-font-body-small, ".concat(_typography.fontFallback.body.small, ")"),
49
55
  fontWeight: "var(--ds-font-weight-bold, bold)",
50
- color: "var(--ds-text-subtlest, ".concat(colors.N200, ")"),
51
- paddingBottom: "var(--ds-space-050, 4px)"
56
+ color: "var(--ds-text-subtlest, ".concat(colors.N200, ")")
52
57
  });
53
58
  var ArticlesListItemLinkIcon = exports.ArticlesListItemLinkIcon = _styled.default.span({
54
59
  alignSelf: 'auto',
55
60
  paddingInlineStart: "var(--ds-space-050, 4px)",
56
61
  verticalAlign: 'middle'
57
62
  });
58
- var ArticlesListItemTitleText = exports.ArticlesListItemTitleText = _styled.default.span({
63
+ var ArticlesListItemTitleText = exports.ArticlesListItemTitleText = _styled.default.p({
59
64
  textDecoration: 'none',
60
65
  color: "var(--ds-text, ".concat(colors.N800, ")"),
61
66
  font: "var(--ds-font-heading-xsmall, ".concat(_typography.fontFallback.heading.xsmall, ")"),
62
67
  display: 'inline-block',
63
68
  whiteSpace: 'normal',
64
- overflowX: 'hidden',
65
- marginBottom: "var(--ds-space-100, 8px)"
69
+ overflow: 'hidden',
70
+ marginBottom: "var(--ds-space-100, 4px)"
66
71
  });
67
72
  var ArticlesListItemDescription = exports.ArticlesListItemDescription = _styled.default.p({
68
73
  display: 'block',
69
74
  lineHeight: '20px',
70
75
  color: "var(--ds-text-subtle, ".concat(colors.N400, ")"),
71
- margin: 0
76
+ margin: 0,
77
+ paddingBottom: "var(--ds-space-025, 2px)"
78
+ });
79
+ var ArticlesListItemSource = exports.ArticlesListItemSource = _styled.default.div({
80
+ display: 'flex',
81
+ alignItems: 'center',
82
+ font: "var(--ds-font-heading-xxsmall, ".concat(_typography.fontFallback.heading.xxsmall, ")"),
83
+ color: "var(--ds-surface-hovered, ".concat(colors.N200, ")"),
84
+ padding: "var(--ds-space-050, 4px)".concat(" 0"),
85
+ fontWeight: "var(--ds-font-weight-bold, bold)",
86
+ textTransform: 'uppercase'
87
+ });
88
+ var ArticlesListItemTrustFactor = exports.ArticlesListItemTrustFactor = _styled.default.div({
89
+ display: 'flex',
90
+ alignItems: 'center',
91
+ font: "var(--ds-font-body-small, ".concat(_typography.fontFallback.body.small, ")"),
92
+ color: "var(--ds-background-accent-gray-subtlest-pressed, ".concat(colors.N400, ")"),
93
+ paddingTop: "var(--ds-space-025, 2px)"
94
+ });
95
+ var ArticlesListItemViewCount = exports.ArticlesListItemViewCount = _styled.default.span({
96
+ paddingRight: "var(--ds-space-100, 8px)"
97
+ });
98
+ var ArticlesListItemHelpfulCount = exports.ArticlesListItemHelpfulCount = _styled.default.span({
99
+ display: 'inline-flex',
100
+ paddingRight: "var(--ds-space-100, 8px)"
101
+ });
102
+ var ArticlesListItemLastModified = exports.ArticlesListItemLastModified = _styled.default.div({
103
+ font: "var(--ds-font-body-small, ".concat(_typography.fontFallback.body.small, ")"),
104
+ color: "var(--ds-text-subtle, ".concat(colors.N200, ")"),
105
+ padding: "var(--ds-space-050, 4px)".concat(" 0")
72
106
  });
@@ -17,7 +17,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
17
17
  var analitycsContextData = {
18
18
  componentName: 'HelpContentButton',
19
19
  packageName: "@atlaskit/help",
20
- packageVersion: "7.3.2"
20
+ packageVersion: "7.4.0"
21
21
  };
22
22
  var HelpContentButton = function HelpContentButton(_ref) {
23
23
  var _ref$id = _ref.id,
@@ -28,7 +28,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
28
28
  /** @jsxFrag */
29
29
 
30
30
  var packageName = "@atlaskit/help";
31
- var packageVersion = "7.3.2";
31
+ var packageVersion = "7.4.0";
32
32
  var RelatedArticles = exports.RelatedArticles = function RelatedArticles(_ref) {
33
33
  var _ref$style = _ref.style,
34
34
  style = _ref$style === void 0 ? 'primary' : _ref$style,
@@ -27,7 +27,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
27
27
  var ANALYTICS_CONTEXT_DATA = {
28
28
  componentName: 'searchInput',
29
29
  packageName: "@atlaskit/help",
30
- packageVersion: "7.3.2"
30
+ packageVersion: "7.4.0"
31
31
  };
32
32
  var SearchInput = exports.SearchInput = function SearchInput(_ref) {
33
33
  var formatMessage = _ref.intl.formatMessage;
@@ -21,7 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
21
21
  var ANALYTICS_CONTEXT_DATA = {
22
22
  componentName: 'WhatsNewButton',
23
23
  packageName: "@atlaskit/help",
24
- packageVersion: "7.3.2"
24
+ packageVersion: "7.4.0"
25
25
  };
26
26
  var WhatsNewButton = exports.WhatsNewButton = function WhatsNewButton(_ref) {
27
27
  var productName = _ref.productName,
@@ -15,7 +15,7 @@ var _styled2 = require("./styled");
15
15
  var ANALYTICS_CONTEXT_DATA = {
16
16
  componentName: 'ArticlesListItem',
17
17
  packageName: "@atlaskit/help",
18
- packageVersion: "7.3.2"
18
+ packageVersion: "7.4.0"
19
19
  };
20
20
  var WhatsNewResultListItem = exports.WhatsNewResultListItem = function WhatsNewResultListItem(_ref) {
21
21
  var formatMessage = _ref.intl.formatMessage,
@@ -195,13 +195,14 @@ var navigationReducer = function navigationReducer(_ref3, action) {
195
195
  newState = {
196
196
  articleId: _newArticleId2,
197
197
  history: currentHistory,
198
- view: getViewForArticleId(_newArticleId2)
198
+ // If the current view is the search view and the new article id is empty, keep the current view
199
+ view: currentView === _constants.VIEW.SEARCH && _newArticleId2.id === '' ? currentView : getViewForArticleId(_newArticleId2)
199
200
  };
200
201
  } else if (action.type === 'updateView' && action.payload) {
201
202
  var newView = action.payload;
202
203
  newState = {
203
204
  articleId: currentArticleId,
204
- history: currentHistory,
205
+ history: newView === _constants.VIEW.SEARCH ? [] : currentHistory,
205
206
  view: newView
206
207
  };
207
208
  }
@@ -225,7 +226,8 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
225
226
  var _useSearchContext = (0, _searchContext.useSearchContext)(),
226
227
  onSearch = _useSearchContext.onSearch,
227
228
  isSearchResultVisible = _useSearchContext.isSearchResultVisible,
228
- searchValue = _useSearchContext.searchValue;
229
+ searchValue = _useSearchContext.searchValue,
230
+ searchResult = _useSearchContext.searchResult;
229
231
  var _useHeaderContext = (0, _headerContext.useHeaderContext)(),
230
232
  onCloseButtonClick = _useHeaderContext.onCloseButtonClick;
231
233
  var propsArticleId = navigationData.articleId,
@@ -358,6 +360,7 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
358
360
  };
359
361
  }(), []);
360
362
  var navigateBack = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
363
+ var _searchResult$length;
361
364
  return _regenerator.default.wrap(function _callee3$(_context3) {
362
365
  while (1) switch (_context3.prev = _context3.next) {
363
366
  case 0:
@@ -387,10 +390,19 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
387
390
  type: 'removeLastHistoryItem'
388
391
  });
389
392
  } else if (currentHistory.length === 1) {
390
- // but if the history only has one item, clear the history
391
- dispatchNavigationAction({
392
- type: 'removeAllHistoryItems'
393
- });
393
+ // If the search value is not empty and search result is not empty, show the search results
394
+ if (searchValue !== '' && ((_searchResult$length = searchResult === null || searchResult === void 0 ? void 0 : searchResult.length) !== null && _searchResult$length !== void 0 ? _searchResult$length : 0) > 0 && onSearch !== undefined) {
395
+ dispatchNavigationAction({
396
+ type: 'updateView',
397
+ payload: _constants.VIEW.SEARCH
398
+ });
399
+ }
400
+ // If the search value is empty, show the default content
401
+ else {
402
+ dispatchNavigationAction({
403
+ type: 'removeAllHistoryItems'
404
+ });
405
+ }
394
406
  }
395
407
  }
396
408
  case 9:
@@ -398,7 +410,7 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
398
410
  return _context3.stop();
399
411
  }
400
412
  }, _callee3);
401
- })), [currentView, onSearch, currentHistory.length, searchValue, currentArticleId.type]);
413
+ })), [currentView, searchValue, currentArticleId, currentHistory, onSearch, searchResult === null || searchResult === void 0 ? void 0 : searchResult.length]);
402
414
  var onClose = (0, _react.useCallback)(function (event, analyticsEvent) {
403
415
  if (onCloseButtonClick) {
404
416
  dispatchNavigationAction({
@@ -414,13 +426,20 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
414
426
  });
415
427
  }, []);
416
428
  (0, _react.useEffect)(function () {
417
- if (isSearchResultVisible) {
429
+ // If the search result is visible or the search value is not empty, show the search result
430
+ if (isSearchResultVisible || searchValue !== '') {
418
431
  dispatchNavigationAction({
419
432
  type: 'updateView',
420
433
  payload: _constants.VIEW.SEARCH
421
434
  });
435
+ // If the search result is not visible and the search value is empty, show the default content
436
+ } else if (!isSearchResultVisible && searchValue === '') {
437
+ dispatchNavigationAction({
438
+ type: 'updateView',
439
+ payload: _constants.VIEW.DEFAULT_CONTENT
440
+ });
422
441
  }
423
- }, [isSearchResultVisible]);
442
+ }, [isSearchResultVisible, searchValue]);
424
443
  (0, _react.useEffect)(function () {
425
444
  var lastHistoryItem = currentHistory.length > 0 ? _getCurrentArticle2(currentHistory) : getNewHistoryItem(DEFAULT_ARTICLE_ID.id, DEFAULT_ARTICLE_ID.type);
426
445
 
@@ -112,9 +112,6 @@ var SearchContextProvider = exports.SearchContextProvider = function SearchConte
112
112
  if (onSearchResultItemClick) {
113
113
  onSearchResultItemClick(event, analyticsEvent, articleData);
114
114
  }
115
- if (!openExternalSearchUrlInNewTab || articleData.href == null) {
116
- setSearchResultsVisible(false);
117
- }
118
115
  };
119
116
  return /*#__PURE__*/_react.default.createElement(CtxProvider, {
120
117
  value: {
@@ -5,5 +5,5 @@ export const createAndFire = x.createAndFireEvent('atlaskit');
5
5
  export const defaultAnalyticsAttributes = {
6
6
  componentName: 'help',
7
7
  packageName: "@atlaskit/help",
8
- packageVersion: "7.3.2"
8
+ packageVersion: "7.4.0"
9
9
  };
@@ -8,7 +8,7 @@ import { LoadingErrorMessage, LoadingErrorButtonContainer } from './styled';
8
8
  const ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticleLoadingFail',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.3.2"
11
+ packageVersion: "7.4.0"
12
12
  };
13
13
  export const ArticleLoadingFail = ({
14
14
  onTryAgainButtonClick,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  const ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulNoButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "7.3.2"
9
+ packageVersion: "7.4.0"
10
10
  };
11
11
  export const ArticleWasHelpfulNoButton = ({
12
12
  isSelected = false,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  const ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulYesButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "7.3.2"
9
+ packageVersion: "7.4.0"
10
10
  };
11
11
  export const ArticleWasHelpfulYesButton = ({
12
12
  isSelected = false,
@@ -25,7 +25,7 @@ const FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
25
25
  const ANALYTICS_CONTEXT_DATA = {
26
26
  componentName: 'ArticleWasHelpfulForm',
27
27
  packageName: "@atlaskit/help",
28
- packageVersion: "7.3.2"
28
+ packageVersion: "7.4.0"
29
29
  };
30
30
  export const ArticleWasHelpfulForm = ({
31
31
  onWasHelpfulSubmit,
@@ -59,7 +59,7 @@ export const HelpArticle = ({
59
59
  analyticsEvent.payload.attributes = {
60
60
  componentName: 'Article',
61
61
  packageName: "@atlaskit/help",
62
- packageVersion: "7.3.2"
62
+ packageVersion: "7.4.0"
63
63
  };
64
64
  if (onRelatedArticlesShowMoreClick) {
65
65
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -13,7 +13,7 @@ import { WhatsNewTypeTitle, WhatsNewTitleText, WhatsNewIconContainer, RelatedLin
13
13
  const analyticsContextData = {
14
14
  componentName: 'ArticlesListItem',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.3.2"
16
+ packageVersion: "7.4.0"
17
17
  };
18
18
  export const WhatsNewArticle = ({
19
19
  intl: {
@@ -35,7 +35,10 @@ const articlesList = ({
35
35
  title: article.title,
36
36
  description: article.description,
37
37
  key: article.id,
38
- href: article.href
38
+ href: article.href,
39
+ trustFactors: article.trustFactors,
40
+ source: article.source,
41
+ lastPublished: article.lastPublished
39
42
  });
40
43
  })), /*#__PURE__*/React.createElement(AnimateHeight, {
41
44
  duration: ANIMATE_HEIGHT_TRANSITION_DURATION_MS,
@@ -52,6 +55,9 @@ const articlesList = ({
52
55
  title: article.title,
53
56
  description: article.description,
54
57
  key: article.id,
55
- href: article.href
58
+ href: article.href,
59
+ trustFactors: article.trustFactors,
60
+ source: article.source,
61
+ lastPublished: article.lastPublished
56
62
  }))));
57
63
  export default articlesList;
@@ -3,18 +3,22 @@ import * as colors from '@atlaskit/theme/colors';
3
3
  import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
4
4
  import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
5
5
  import { injectIntl } from 'react-intl-next';
6
- import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon } from './styled';
6
+ import LikeIcon from '@atlaskit/icon/glyph/like';
7
+ import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon, ArticlesListItemTrustFactor, ArticlesListItemViewCount, ArticlesListItemHelpfulCount, ArticlesListItemSource, ArticlesListItemLastModified, ArticlesListItemTitleSection } from './styled';
7
8
  const ANALYTICS_CONTEXT_DATA = {
8
9
  componentName: 'ArticlesListItem',
9
10
  packageName: "@atlaskit/help",
10
- packageVersion: "7.3.2"
11
+ packageVersion: "7.4.0"
11
12
  };
12
13
  export const ArticlesListItem = ({
13
14
  styles,
14
15
  title,
15
16
  description,
16
17
  href = '',
17
- onClick
18
+ onClick,
19
+ trustFactors,
20
+ source,
21
+ lastPublished
18
22
  }) => {
19
23
  const {
20
24
  createAnalyticsEvent
@@ -28,18 +32,29 @@ export const ArticlesListItem = ({
28
32
  onClick(event, analyticsEvent);
29
33
  }
30
34
  };
35
+
36
+ // Check if trust factors are available
37
+ const isNumViewsVisible = (trustFactors === null || trustFactors === void 0 ? void 0 : trustFactors.numViews) != null;
38
+ const isHelpfulCountVisible = (trustFactors === null || trustFactors === void 0 ? void 0 : trustFactors.helpfulCount) != null;
39
+ const isTrustFactorVisible = isNumViewsVisible || isHelpfulCountVisible;
40
+ // Check if source is available
41
+ const isSourceVisible = source != null;
42
+ const isLastPublishedVisible = lastPublished != null && lastPublished !== '';
31
43
  return /*#__PURE__*/React.createElement(ArticlesListItemWrapper, {
32
44
  styles: styles,
33
45
  "aria-disabled": "false",
34
46
  role: "button",
35
47
  href: href,
36
48
  onClick: handleOnClick
37
- }, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title, href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
49
+ }, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleSection, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title), isLastPublishedVisible && /*#__PURE__*/React.createElement(ArticlesListItemLastModified, null, "Last modified: ", lastPublished)), href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
38
50
  size: "small",
39
51
  label: "",
40
52
  primaryColor: `var(--ds-icon-subtle, ${colors.N90})`,
41
53
  secondaryColor: `var(--ds-icon-subtle, ${colors.N90})`
42
- })))), /*#__PURE__*/React.createElement(ArticlesListItemDescription, null, description));
54
+ }))), /*#__PURE__*/React.createElement(ArticlesListItemDescription, null, description), isSourceVisible && /*#__PURE__*/React.createElement(ArticlesListItemSource, null, source), isTrustFactorVisible && /*#__PURE__*/React.createElement(ArticlesListItemTrustFactor, null, isNumViewsVisible && /*#__PURE__*/React.createElement(ArticlesListItemViewCount, null, trustFactors.numViews, " views"), isHelpfulCountVisible && /*#__PURE__*/React.createElement(ArticlesListItemHelpfulCount, null, /*#__PURE__*/React.createElement(LikeIcon, {
55
+ label: "Like",
56
+ size: "small"
57
+ }), trustFactors.helpfulCount)));
43
58
  };
44
59
  const ArticlesListItemWithContext = props => {
45
60
  return /*#__PURE__*/React.createElement(AnalyticsContext, {