@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
@@ -29,31 +29,65 @@ export const ArticlesListItemWrapper = styled.a({
29
29
  }, props => props.styles);
30
30
  export const ArticlesListItemContainer = styled.div({
31
31
  width: '100%',
32
- whiteSpace: 'nowrap'
32
+ whiteSpace: 'nowrap',
33
+ display: 'flex'
34
+ });
35
+ export const ArticlesListItemTitleSection = styled.div({
36
+ display: 'flex',
37
+ flexDirection: 'column',
38
+ flexGrow: 1
33
39
  });
34
40
  export const ArticlesListItemTypeTitle = styled.div({
35
41
  font: `var(--ds-font-body-small, ${fontFallback.body.small})`,
36
42
  fontWeight: "var(--ds-font-weight-bold, bold)",
37
- color: `var(--ds-text-subtlest, ${colors.N200})`,
38
- paddingBottom: "var(--ds-space-050, 4px)"
43
+ color: `var(--ds-text-subtlest, ${colors.N200})`
39
44
  });
40
45
  export const ArticlesListItemLinkIcon = styled.span({
41
46
  alignSelf: 'auto',
42
47
  paddingInlineStart: "var(--ds-space-050, 4px)",
43
48
  verticalAlign: 'middle'
44
49
  });
45
- export const ArticlesListItemTitleText = styled.span({
50
+ export const ArticlesListItemTitleText = styled.p({
46
51
  textDecoration: 'none',
47
52
  color: `var(--ds-text, ${colors.N800})`,
48
53
  font: `var(--ds-font-heading-xsmall, ${fontFallback.heading.xsmall})`,
49
54
  display: 'inline-block',
50
55
  whiteSpace: 'normal',
51
- overflowX: 'hidden',
52
- marginBottom: "var(--ds-space-100, 8px)"
56
+ overflow: 'hidden',
57
+ marginBottom: "var(--ds-space-100, 4px)"
53
58
  });
54
59
  export const ArticlesListItemDescription = styled.p({
55
60
  display: 'block',
56
61
  lineHeight: '20px',
57
62
  color: `var(--ds-text-subtle, ${colors.N400})`,
58
- margin: 0
63
+ margin: 0,
64
+ paddingBottom: "var(--ds-space-025, 2px)"
65
+ });
66
+ export const ArticlesListItemSource = styled.div({
67
+ display: 'flex',
68
+ alignItems: 'center',
69
+ font: `var(--ds-font-heading-xxsmall, ${fontFallback.heading.xxsmall})`,
70
+ color: `var(--ds-surface-hovered, ${colors.N200})`,
71
+ padding: `${"var(--ds-space-050, 4px)"} 0`,
72
+ fontWeight: "var(--ds-font-weight-bold, bold)",
73
+ textTransform: 'uppercase'
74
+ });
75
+ export const ArticlesListItemTrustFactor = styled.div({
76
+ display: 'flex',
77
+ alignItems: 'center',
78
+ font: `var(--ds-font-body-small, ${fontFallback.body.small})`,
79
+ color: `var(--ds-background-accent-gray-subtlest-pressed, ${colors.N400})`,
80
+ paddingTop: "var(--ds-space-025, 2px)"
81
+ });
82
+ export const ArticlesListItemViewCount = styled.span({
83
+ paddingRight: "var(--ds-space-100, 8px)"
84
+ });
85
+ export const ArticlesListItemHelpfulCount = styled.span({
86
+ display: 'inline-flex',
87
+ paddingRight: "var(--ds-space-100, 8px)"
88
+ });
89
+ export const ArticlesListItemLastModified = styled.div({
90
+ font: `var(--ds-font-body-small, ${fontFallback.body.small})`,
91
+ color: `var(--ds-text-subtle, ${colors.N200})`,
92
+ padding: `${"var(--ds-space-050, 4px)"} 0`
59
93
  });
@@ -7,7 +7,7 @@ import { HelpContentButtonContainer, HelpContentButtonIcon, HelpContentButtonTex
7
7
  const analitycsContextData = {
8
8
  componentName: 'HelpContentButton',
9
9
  packageName: "@atlaskit/help",
10
- packageVersion: "7.3.2"
10
+ packageVersion: "7.4.0"
11
11
  };
12
12
  const HelpContentButton = ({
13
13
  id = '',
@@ -15,7 +15,7 @@ import useCancellablePromise from '../../util/hooks/cancellablePromise';
15
15
  import { usePrevious } from '../../util/hooks/previous';
16
16
  import { jsx } from '@emotion/react';
17
17
  const packageName = "@atlaskit/help";
18
- const packageVersion = "7.3.2";
18
+ const packageVersion = "7.4.0";
19
19
  export const RelatedArticles = ({
20
20
  style = 'primary',
21
21
  routeGroup,
@@ -17,7 +17,7 @@ import { SearchInputContainer, SearchIconContainer, CloseButtonAndSpinnerContain
17
17
  const ANALYTICS_CONTEXT_DATA = {
18
18
  componentName: 'searchInput',
19
19
  packageName: "@atlaskit/help",
20
- packageVersion: "7.3.2"
20
+ packageVersion: "7.4.0"
21
21
  };
22
22
  export const SearchInput = ({
23
23
  intl: {
@@ -11,7 +11,7 @@ import { ARTICLE_TYPE } from '../../../model/Help';
11
11
  const ANALYTICS_CONTEXT_DATA = {
12
12
  componentName: 'WhatsNewButton',
13
13
  packageName: "@atlaskit/help",
14
- packageVersion: "7.3.2"
14
+ packageVersion: "7.4.0"
15
15
  };
16
16
  export const WhatsNewButton = ({
17
17
  productName,
@@ -8,7 +8,7 @@ import { WhatsNewResultListItemWrapper, WhatsNewResultListItemTitleContainer, Wh
8
8
  const ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.3.2"
11
+ packageVersion: "7.4.0"
12
12
  };
13
13
  export const WhatsNewResultListItem = ({
14
14
  intl: {
@@ -182,7 +182,8 @@ const navigationReducer = ({
182
182
  newState = {
183
183
  articleId: newArticleId,
184
184
  history: currentHistory,
185
- view: getViewForArticleId(newArticleId)
185
+ // If the current view is the search view and the new article id is empty, keep the current view
186
+ view: currentView === VIEW.SEARCH && newArticleId.id === '' ? currentView : getViewForArticleId(newArticleId)
186
187
  };
187
188
  } else if (action.type === 'updateView' && action.payload) {
188
189
  const {
@@ -190,7 +191,7 @@ const navigationReducer = ({
190
191
  } = action;
191
192
  newState = {
192
193
  articleId: currentArticleId,
193
- history: currentHistory,
194
+ history: newView === VIEW.SEARCH ? [] : currentHistory,
194
195
  view: newView
195
196
  };
196
197
  }
@@ -217,7 +218,8 @@ export const NavigationContextProvider = ({
217
218
  const {
218
219
  onSearch,
219
220
  isSearchResultVisible,
220
- searchValue
221
+ searchValue,
222
+ searchResult
221
223
  } = useSearchContext();
222
224
  const {
223
225
  onCloseButtonClick
@@ -339,13 +341,23 @@ export const NavigationContextProvider = ({
339
341
  type: 'removeLastHistoryItem'
340
342
  });
341
343
  } else if (currentHistory.length === 1) {
342
- // but if the history only has one item, clear the history
343
- dispatchNavigationAction({
344
- type: 'removeAllHistoryItems'
345
- });
344
+ var _searchResult$length;
345
+ // If the search value is not empty and search result is not empty, show the search results
346
+ if (searchValue !== '' && ((_searchResult$length = searchResult === null || searchResult === void 0 ? void 0 : searchResult.length) !== null && _searchResult$length !== void 0 ? _searchResult$length : 0) > 0 && onSearch !== undefined) {
347
+ dispatchNavigationAction({
348
+ type: 'updateView',
349
+ payload: VIEW.SEARCH
350
+ });
351
+ }
352
+ // If the search value is empty, show the default content
353
+ else {
354
+ dispatchNavigationAction({
355
+ type: 'removeAllHistoryItems'
356
+ });
357
+ }
346
358
  }
347
359
  }
348
- }, [currentView, onSearch, currentHistory.length, searchValue, currentArticleId.type]);
360
+ }, [currentView, searchValue, currentArticleId, currentHistory, onSearch, searchResult === null || searchResult === void 0 ? void 0 : searchResult.length]);
349
361
  const onClose = useCallback((event, analyticsEvent) => {
350
362
  if (onCloseButtonClick) {
351
363
  dispatchNavigationAction({
@@ -361,13 +373,20 @@ export const NavigationContextProvider = ({
361
373
  });
362
374
  }, []);
363
375
  useEffect(() => {
364
- if (isSearchResultVisible) {
376
+ // If the search result is visible or the search value is not empty, show the search result
377
+ if (isSearchResultVisible || searchValue !== '') {
365
378
  dispatchNavigationAction({
366
379
  type: 'updateView',
367
380
  payload: VIEW.SEARCH
368
381
  });
382
+ // If the search result is not visible and the search value is empty, show the default content
383
+ } else if (!isSearchResultVisible && searchValue === '') {
384
+ dispatchNavigationAction({
385
+ type: 'updateView',
386
+ payload: VIEW.DEFAULT_CONTENT
387
+ });
369
388
  }
370
- }, [isSearchResultVisible]);
389
+ }, [isSearchResultVisible, searchValue]);
371
390
  useEffect(() => {
372
391
  const lastHistoryItem = currentHistory.length > 0 ? getCurrentArticle(currentHistory) : getNewHistoryItem(DEFAULT_ARTICLE_ID.id, DEFAULT_ARTICLE_ID.type);
373
392
 
@@ -62,9 +62,6 @@ export const SearchContextProvider = ({
62
62
  if (onSearchResultItemClick) {
63
63
  onSearchResultItemClick(event, analyticsEvent, articleData);
64
64
  }
65
- if (!openExternalSearchUrlInNewTab || articleData.href == null) {
66
- setSearchResultsVisible(false);
67
- }
68
65
  };
69
66
  return /*#__PURE__*/React.createElement(CtxProvider, {
70
67
  value: {
@@ -5,5 +5,5 @@ export var createAndFire = x.createAndFireEvent('atlaskit');
5
5
  export var 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
  var 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 var ArticleLoadingFail = function ArticleLoadingFail(_ref) {
14
14
  var onTryAgainButtonClick = _ref.onTryAgainButtonClick,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  var 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 var ArticleWasHelpfulNoButton = function ArticleWasHelpfulNoButton(_ref) {
12
12
  var _ref$isSelected = _ref.isSelected,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  var 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 var ArticleWasHelpfulYesButton = function ArticleWasHelpfulYesButton(_ref) {
12
12
  var _ref$isSelected = _ref.isSelected,
@@ -26,7 +26,7 @@ var FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
26
26
  var ANALYTICS_CONTEXT_DATA = {
27
27
  componentName: 'ArticleWasHelpfulForm',
28
28
  packageName: "@atlaskit/help",
29
- packageVersion: "7.3.2"
29
+ packageVersion: "7.4.0"
30
30
  };
31
31
  export var ArticleWasHelpfulForm = function ArticleWasHelpfulForm(_ref) {
32
32
  var onWasHelpfulSubmit = _ref.onWasHelpfulSubmit,
@@ -55,7 +55,7 @@ export var HelpArticle = function HelpArticle(_ref) {
55
55
  analyticsEvent.payload.attributes = {
56
56
  componentName: 'Article',
57
57
  packageName: "@atlaskit/help",
58
- packageVersion: "7.3.2"
58
+ packageVersion: "7.4.0"
59
59
  };
60
60
  if (onRelatedArticlesShowMoreClick) {
61
61
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -13,7 +13,7 @@ import { WhatsNewTypeTitle, WhatsNewTitleText, WhatsNewIconContainer, RelatedLin
13
13
  var 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 var WhatsNewArticle = function WhatsNewArticle(_ref) {
19
19
  var formatMessage = _ref.intl.formatMessage,
@@ -39,7 +39,10 @@ var articlesList = function articlesList(_ref) {
39
39
  title: article.title,
40
40
  description: article.description,
41
41
  key: article.id,
42
- href: article.href
42
+ href: article.href,
43
+ trustFactors: article.trustFactors,
44
+ source: article.source,
45
+ lastPublished: article.lastPublished
43
46
  });
44
47
  })), /*#__PURE__*/React.createElement(AnimateHeight, {
45
48
  duration: ANIMATE_HEIGHT_TRANSITION_DURATION_MS,
@@ -57,7 +60,10 @@ var articlesList = function articlesList(_ref) {
57
60
  title: article.title,
58
61
  description: article.description,
59
62
  key: article.id,
60
- href: article.href
63
+ href: article.href,
64
+ trustFactors: article.trustFactors,
65
+ source: article.source,
66
+ lastPublished: article.lastPublished
61
67
  });
62
68
  })));
63
69
  };
@@ -3,11 +3,12 @@ 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
  var 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 var ArticlesListItem = function ArticlesListItem(_ref) {
13
14
  var styles = _ref.styles,
@@ -15,7 +16,10 @@ export var ArticlesListItem = function ArticlesListItem(_ref) {
15
16
  description = _ref.description,
16
17
  _ref$href = _ref.href,
17
18
  href = _ref$href === void 0 ? '' : _ref$href,
18
- onClick = _ref.onClick;
19
+ onClick = _ref.onClick,
20
+ trustFactors = _ref.trustFactors,
21
+ source = _ref.source,
22
+ lastPublished = _ref.lastPublished;
19
23
  var _useAnalyticsEvents = useAnalyticsEvents(),
20
24
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
21
25
  var handleOnClick = function handleOnClick(event) {
@@ -27,18 +31,29 @@ export var ArticlesListItem = function ArticlesListItem(_ref) {
27
31
  onClick(event, _analyticsEvent);
28
32
  }
29
33
  };
34
+
35
+ // Check if trust factors are available
36
+ var isNumViewsVisible = (trustFactors === null || trustFactors === void 0 ? void 0 : trustFactors.numViews) != null;
37
+ var isHelpfulCountVisible = (trustFactors === null || trustFactors === void 0 ? void 0 : trustFactors.helpfulCount) != null;
38
+ var isTrustFactorVisible = isNumViewsVisible || isHelpfulCountVisible;
39
+ // Check if source is available
40
+ var isSourceVisible = source != null;
41
+ var isLastPublishedVisible = lastPublished != null && lastPublished !== '';
30
42
  return /*#__PURE__*/React.createElement(ArticlesListItemWrapper, {
31
43
  styles: styles,
32
44
  "aria-disabled": "false",
33
45
  role: "button",
34
46
  href: href,
35
47
  onClick: handleOnClick
36
- }, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title, href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
48
+ }, /*#__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, {
37
49
  size: "small",
38
50
  label: "",
39
51
  primaryColor: "var(--ds-icon-subtle, ".concat(colors.N90, ")"),
40
52
  secondaryColor: "var(--ds-icon-subtle, ".concat(colors.N90, ")")
41
- })))), /*#__PURE__*/React.createElement(ArticlesListItemDescription, null, description));
53
+ }))), /*#__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, {
54
+ label: "Like",
55
+ size: "small"
56
+ }), trustFactors.helpfulCount)));
42
57
  };
43
58
  var ArticlesListItemWithContext = function ArticlesListItemWithContext(props) {
44
59
  return /*#__PURE__*/React.createElement(AnalyticsContext, {
@@ -31,31 +31,65 @@ export var ArticlesListItemWrapper = styled.a({
31
31
  });
32
32
  export var ArticlesListItemContainer = styled.div({
33
33
  width: '100%',
34
- whiteSpace: 'nowrap'
34
+ whiteSpace: 'nowrap',
35
+ display: 'flex'
36
+ });
37
+ export var ArticlesListItemTitleSection = styled.div({
38
+ display: 'flex',
39
+ flexDirection: 'column',
40
+ flexGrow: 1
35
41
  });
36
42
  export var ArticlesListItemTypeTitle = styled.div({
37
43
  font: "var(--ds-font-body-small, ".concat(fontFallback.body.small, ")"),
38
44
  fontWeight: "var(--ds-font-weight-bold, bold)",
39
- color: "var(--ds-text-subtlest, ".concat(colors.N200, ")"),
40
- paddingBottom: "var(--ds-space-050, 4px)"
45
+ color: "var(--ds-text-subtlest, ".concat(colors.N200, ")")
41
46
  });
42
47
  export var ArticlesListItemLinkIcon = styled.span({
43
48
  alignSelf: 'auto',
44
49
  paddingInlineStart: "var(--ds-space-050, 4px)",
45
50
  verticalAlign: 'middle'
46
51
  });
47
- export var ArticlesListItemTitleText = styled.span({
52
+ export var ArticlesListItemTitleText = styled.p({
48
53
  textDecoration: 'none',
49
54
  color: "var(--ds-text, ".concat(colors.N800, ")"),
50
55
  font: "var(--ds-font-heading-xsmall, ".concat(fontFallback.heading.xsmall, ")"),
51
56
  display: 'inline-block',
52
57
  whiteSpace: 'normal',
53
- overflowX: 'hidden',
54
- marginBottom: "var(--ds-space-100, 8px)"
58
+ overflow: 'hidden',
59
+ marginBottom: "var(--ds-space-100, 4px)"
55
60
  });
56
61
  export var ArticlesListItemDescription = styled.p({
57
62
  display: 'block',
58
63
  lineHeight: '20px',
59
64
  color: "var(--ds-text-subtle, ".concat(colors.N400, ")"),
60
- margin: 0
65
+ margin: 0,
66
+ paddingBottom: "var(--ds-space-025, 2px)"
67
+ });
68
+ export var ArticlesListItemSource = styled.div({
69
+ display: 'flex',
70
+ alignItems: 'center',
71
+ font: "var(--ds-font-heading-xxsmall, ".concat(fontFallback.heading.xxsmall, ")"),
72
+ color: "var(--ds-surface-hovered, ".concat(colors.N200, ")"),
73
+ padding: "var(--ds-space-050, 4px)".concat(" 0"),
74
+ fontWeight: "var(--ds-font-weight-bold, bold)",
75
+ textTransform: 'uppercase'
76
+ });
77
+ export var ArticlesListItemTrustFactor = styled.div({
78
+ display: 'flex',
79
+ alignItems: 'center',
80
+ font: "var(--ds-font-body-small, ".concat(fontFallback.body.small, ")"),
81
+ color: "var(--ds-background-accent-gray-subtlest-pressed, ".concat(colors.N400, ")"),
82
+ paddingTop: "var(--ds-space-025, 2px)"
83
+ });
84
+ export var ArticlesListItemViewCount = styled.span({
85
+ paddingRight: "var(--ds-space-100, 8px)"
86
+ });
87
+ export var ArticlesListItemHelpfulCount = styled.span({
88
+ display: 'inline-flex',
89
+ paddingRight: "var(--ds-space-100, 8px)"
90
+ });
91
+ export var ArticlesListItemLastModified = styled.div({
92
+ font: "var(--ds-font-body-small, ".concat(fontFallback.body.small, ")"),
93
+ color: "var(--ds-text-subtle, ".concat(colors.N200, ")"),
94
+ padding: "var(--ds-space-050, 4px)".concat(" 0")
61
95
  });
@@ -7,7 +7,7 @@ import { HelpContentButtonContainer, HelpContentButtonIcon, HelpContentButtonTex
7
7
  var analitycsContextData = {
8
8
  componentName: 'HelpContentButton',
9
9
  packageName: "@atlaskit/help",
10
- packageVersion: "7.3.2"
10
+ packageVersion: "7.4.0"
11
11
  };
12
12
  var HelpContentButton = function HelpContentButton(_ref) {
13
13
  var _ref$id = _ref.id,
@@ -18,7 +18,7 @@ import useCancellablePromise from '../../util/hooks/cancellablePromise';
18
18
  import { usePrevious } from '../../util/hooks/previous';
19
19
  import { jsx } from '@emotion/react';
20
20
  var packageName = "@atlaskit/help";
21
- var packageVersion = "7.3.2";
21
+ var packageVersion = "7.4.0";
22
22
  export var RelatedArticles = function RelatedArticles(_ref) {
23
23
  var _ref$style = _ref.style,
24
24
  style = _ref$style === void 0 ? 'primary' : _ref$style,
@@ -17,7 +17,7 @@ import { SearchInputContainer, SearchIconContainer, CloseButtonAndSpinnerContain
17
17
  var ANALYTICS_CONTEXT_DATA = {
18
18
  componentName: 'searchInput',
19
19
  packageName: "@atlaskit/help",
20
- packageVersion: "7.3.2"
20
+ packageVersion: "7.4.0"
21
21
  };
22
22
  export var SearchInput = function SearchInput(_ref) {
23
23
  var formatMessage = _ref.intl.formatMessage;
@@ -11,7 +11,7 @@ import { ARTICLE_TYPE } from '../../../model/Help';
11
11
  var ANALYTICS_CONTEXT_DATA = {
12
12
  componentName: 'WhatsNewButton',
13
13
  packageName: "@atlaskit/help",
14
- packageVersion: "7.3.2"
14
+ packageVersion: "7.4.0"
15
15
  };
16
16
  export var WhatsNewButton = function WhatsNewButton(_ref) {
17
17
  var productName = _ref.productName,
@@ -8,7 +8,7 @@ import { WhatsNewResultListItemWrapper, WhatsNewResultListItemTitleContainer, Wh
8
8
  var ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.3.2"
11
+ packageVersion: "7.4.0"
12
12
  };
13
13
  export var WhatsNewResultListItem = function WhatsNewResultListItem(_ref) {
14
14
  var formatMessage = _ref.intl.formatMessage,
@@ -186,13 +186,14 @@ var navigationReducer = function navigationReducer(_ref3, action) {
186
186
  newState = {
187
187
  articleId: _newArticleId2,
188
188
  history: currentHistory,
189
- view: getViewForArticleId(_newArticleId2)
189
+ // If the current view is the search view and the new article id is empty, keep the current view
190
+ view: currentView === VIEW.SEARCH && _newArticleId2.id === '' ? currentView : getViewForArticleId(_newArticleId2)
190
191
  };
191
192
  } else if (action.type === 'updateView' && action.payload) {
192
193
  var newView = action.payload;
193
194
  newState = {
194
195
  articleId: currentArticleId,
195
- history: currentHistory,
196
+ history: newView === VIEW.SEARCH ? [] : currentHistory,
196
197
  view: newView
197
198
  };
198
199
  }
@@ -216,7 +217,8 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
216
217
  var _useSearchContext = useSearchContext(),
217
218
  onSearch = _useSearchContext.onSearch,
218
219
  isSearchResultVisible = _useSearchContext.isSearchResultVisible,
219
- searchValue = _useSearchContext.searchValue;
220
+ searchValue = _useSearchContext.searchValue,
221
+ searchResult = _useSearchContext.searchResult;
220
222
  var _useHeaderContext = useHeaderContext(),
221
223
  onCloseButtonClick = _useHeaderContext.onCloseButtonClick;
222
224
  var propsArticleId = navigationData.articleId,
@@ -349,6 +351,7 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
349
351
  };
350
352
  }(), []);
351
353
  var navigateBack = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
354
+ var _searchResult$length;
352
355
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
353
356
  while (1) switch (_context3.prev = _context3.next) {
354
357
  case 0:
@@ -378,10 +381,19 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
378
381
  type: 'removeLastHistoryItem'
379
382
  });
380
383
  } else if (currentHistory.length === 1) {
381
- // but if the history only has one item, clear the history
382
- dispatchNavigationAction({
383
- type: 'removeAllHistoryItems'
384
- });
384
+ // If the search value is not empty and search result is not empty, show the search results
385
+ if (searchValue !== '' && ((_searchResult$length = searchResult === null || searchResult === void 0 ? void 0 : searchResult.length) !== null && _searchResult$length !== void 0 ? _searchResult$length : 0) > 0 && onSearch !== undefined) {
386
+ dispatchNavigationAction({
387
+ type: 'updateView',
388
+ payload: VIEW.SEARCH
389
+ });
390
+ }
391
+ // If the search value is empty, show the default content
392
+ else {
393
+ dispatchNavigationAction({
394
+ type: 'removeAllHistoryItems'
395
+ });
396
+ }
385
397
  }
386
398
  }
387
399
  case 9:
@@ -389,7 +401,7 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
389
401
  return _context3.stop();
390
402
  }
391
403
  }, _callee3);
392
- })), [currentView, onSearch, currentHistory.length, searchValue, currentArticleId.type]);
404
+ })), [currentView, searchValue, currentArticleId, currentHistory, onSearch, searchResult === null || searchResult === void 0 ? void 0 : searchResult.length]);
393
405
  var onClose = useCallback(function (event, analyticsEvent) {
394
406
  if (onCloseButtonClick) {
395
407
  dispatchNavigationAction({
@@ -405,13 +417,20 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
405
417
  });
406
418
  }, []);
407
419
  useEffect(function () {
408
- if (isSearchResultVisible) {
420
+ // If the search result is visible or the search value is not empty, show the search result
421
+ if (isSearchResultVisible || searchValue !== '') {
409
422
  dispatchNavigationAction({
410
423
  type: 'updateView',
411
424
  payload: VIEW.SEARCH
412
425
  });
426
+ // If the search result is not visible and the search value is empty, show the default content
427
+ } else if (!isSearchResultVisible && searchValue === '') {
428
+ dispatchNavigationAction({
429
+ type: 'updateView',
430
+ payload: VIEW.DEFAULT_CONTENT
431
+ });
413
432
  }
414
- }, [isSearchResultVisible]);
433
+ }, [isSearchResultVisible, searchValue]);
415
434
  useEffect(function () {
416
435
  var lastHistoryItem = currentHistory.length > 0 ? _getCurrentArticle2(currentHistory) : getNewHistoryItem(DEFAULT_ARTICLE_ID.id, DEFAULT_ARTICLE_ID.type);
417
436
 
@@ -103,9 +103,6 @@ export var SearchContextProvider = function SearchContextProvider(_ref) {
103
103
  if (onSearchResultItemClick) {
104
104
  onSearchResultItemClick(event, analyticsEvent, articleData);
105
105
  }
106
- if (!openExternalSearchUrlInNewTab || articleData.href == null) {
107
- setSearchResultsVisible(false);
108
- }
109
106
  };
110
107
  return /*#__PURE__*/React.createElement(CtxProvider, {
111
108
  value: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ArticlesList as ArticlesListInterface } from './model/ArticlesListItem';
2
+ import { type ArticlesList as ArticlesListInterface } from './model/ArticlesListItem';
3
3
  export interface Props {
4
4
  numberOfArticlesToDisplay?: number;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import { WrappedComponentProps } from 'react-intl-next';
4
- import { ArticleItem } from '../../../model/Article';
2
+ import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import { type WrappedComponentProps } from 'react-intl-next';
4
+ import { type ArticleItem } from '../../../model/Article';
5
5
  interface Props {
6
6
  styles?: {};
7
7
  onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;