@atlaskit/help 7.14.0 → 7.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +14 -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/Article/index.js +20 -2
  10. package/dist/cjs/components/Article/styled.js +20 -1
  11. package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +1 -1
  12. package/dist/cjs/components/BackButton/index.js +83 -0
  13. package/dist/cjs/components/Help.js +1 -1
  14. package/dist/cjs/components/HelpContent.js +30 -9
  15. package/dist/cjs/components/HelpContentButton/index.js +1 -1
  16. package/dist/cjs/components/RelatedArticles/index.js +1 -1
  17. package/dist/cjs/components/Search/SearchInput/index.js +40 -3
  18. package/dist/cjs/components/Search/SearchInput/styled.js +15 -1
  19. package/dist/cjs/components/Search/SearchResults/index.js +45 -2
  20. package/dist/cjs/components/Search/SearchResults/styled.js +17 -1
  21. package/dist/cjs/components/WhatsNew/WhatsNewButton/index.js +1 -1
  22. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  23. package/dist/cjs/components/constants.js +4 -2
  24. package/dist/cjs/components/contexts/navigationContext.js +5 -2
  25. package/dist/cjs/components/styled.js +34 -1
  26. package/dist/cjs/messages.js +5 -0
  27. package/dist/es2019/analytics.js +1 -1
  28. package/dist/es2019/components/Article/ArticleLoadingFail/index.js +1 -1
  29. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  30. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  31. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  32. package/dist/es2019/components/Article/HelpArticle/index.js +1 -1
  33. package/dist/es2019/components/Article/WhatsNewArticle/index.js +1 -1
  34. package/dist/es2019/components/Article/index.js +29 -3
  35. package/dist/es2019/components/Article/styled.js +19 -0
  36. package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +1 -1
  37. package/dist/es2019/components/BackButton/index.js +79 -0
  38. package/dist/es2019/components/Help.js +1 -1
  39. package/dist/es2019/components/HelpContent.js +31 -10
  40. package/dist/es2019/components/HelpContentButton/index.js +1 -1
  41. package/dist/es2019/components/RelatedArticles/index.js +1 -1
  42. package/dist/es2019/components/Search/SearchInput/index.js +41 -4
  43. package/dist/es2019/components/Search/SearchInput/styled.js +14 -0
  44. package/dist/es2019/components/Search/SearchResults/index.js +49 -3
  45. package/dist/es2019/components/Search/SearchResults/styled.js +16 -0
  46. package/dist/es2019/components/WhatsNew/WhatsNewButton/index.js +1 -1
  47. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  48. package/dist/es2019/components/constants.js +3 -1
  49. package/dist/es2019/components/contexts/navigationContext.js +6 -2
  50. package/dist/es2019/components/styled.js +31 -0
  51. package/dist/es2019/messages.js +5 -0
  52. package/dist/esm/analytics.js +1 -1
  53. package/dist/esm/components/Article/ArticleLoadingFail/index.js +1 -1
  54. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  55. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  56. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  57. package/dist/esm/components/Article/HelpArticle/index.js +1 -1
  58. package/dist/esm/components/Article/WhatsNewArticle/index.js +1 -1
  59. package/dist/esm/components/Article/index.js +21 -3
  60. package/dist/esm/components/Article/styled.js +19 -0
  61. package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +1 -1
  62. package/dist/esm/components/BackButton/index.js +76 -0
  63. package/dist/esm/components/Help.js +1 -1
  64. package/dist/esm/components/HelpContent.js +31 -10
  65. package/dist/esm/components/HelpContentButton/index.js +1 -1
  66. package/dist/esm/components/RelatedArticles/index.js +1 -1
  67. package/dist/esm/components/Search/SearchInput/index.js +41 -4
  68. package/dist/esm/components/Search/SearchInput/styled.js +14 -0
  69. package/dist/esm/components/Search/SearchResults/index.js +46 -3
  70. package/dist/esm/components/Search/SearchResults/styled.js +16 -0
  71. package/dist/esm/components/WhatsNew/WhatsNewButton/index.js +1 -1
  72. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  73. package/dist/esm/components/constants.js +3 -1
  74. package/dist/esm/components/contexts/navigationContext.js +5 -2
  75. package/dist/esm/components/styled.js +33 -0
  76. package/dist/esm/messages.js +5 -0
  77. package/dist/types/components/Article/index.d.ts +5 -2
  78. package/dist/types/components/Article/styled.d.ts +4 -0
  79. package/dist/types/components/BackButton/index.d.ts +12 -0
  80. package/dist/types/components/Search/SearchInput/index.d.ts +6 -3
  81. package/dist/types/components/Search/SearchInput/styled.d.ts +4 -0
  82. package/dist/types/components/Search/SearchResults/index.d.ts +5 -2
  83. package/dist/types/components/Search/SearchResults/styled.d.ts +4 -0
  84. package/dist/types/components/constants.d.ts +1 -0
  85. package/dist/types/components/styled.d.ts +12 -0
  86. package/dist/types/messages.d.ts +5 -0
  87. package/dist/types-ts4.5/components/Article/index.d.ts +5 -2
  88. package/dist/types-ts4.5/components/Article/styled.d.ts +4 -0
  89. package/dist/types-ts4.5/components/BackButton/index.d.ts +12 -0
  90. package/dist/types-ts4.5/components/Search/SearchInput/index.d.ts +6 -3
  91. package/dist/types-ts4.5/components/Search/SearchInput/styled.d.ts +4 -0
  92. package/dist/types-ts4.5/components/Search/SearchResults/index.d.ts +5 -2
  93. package/dist/types-ts4.5/components/Search/SearchResults/styled.d.ts +4 -0
  94. package/dist/types-ts4.5/components/constants.d.ts +1 -0
  95. package/dist/types-ts4.5/components/styled.d.ts +12 -0
  96. package/dist/types-ts4.5/messages.d.ts +5 -0
  97. package/package.json +3 -3
@@ -9,6 +9,7 @@ import { useWhatsNewArticleContext } from './whatsNewArticleContext';
9
9
  import { useHomeContext } from './homeContext';
10
10
  import { useSearchContext } from './searchContext';
11
11
  import { useHeaderContext } from './headerContext';
12
+ import { useAiContext } from './aiAgentContext';
12
13
  const DEFAULT_ARTICLE_ID = {
13
14
  id: '',
14
15
  type: ARTICLE_TYPE.HELP_ARTICLE
@@ -229,6 +230,9 @@ export const NavigationContextProvider = ({
229
230
  articleId: propsArticleId,
230
231
  history: propsHistory
231
232
  } = navigationData;
233
+ const {
234
+ isAiEnabled
235
+ } = useAiContext();
232
236
  const [{
233
237
  articleId: currentArticleId,
234
238
  history: currentHistory,
@@ -249,7 +253,7 @@ export const NavigationContextProvider = ({
249
253
  * - If default content isn't defined and the history only has one article,
250
254
  * we should not display the back button
251
255
  */
252
- if (currentHistory.length === 1 && !isDefaultContentDefined || currentView === VIEW.WHATS_NEW && !isDefaultContentDefined) {
256
+ if (currentHistory.length === 1 && !isDefaultContentDefined || currentView === VIEW.WHATS_NEW && !isDefaultContentDefined || isAiEnabled && currentView === VIEW.SEARCH) {
253
257
  return false;
254
258
  }
255
259
 
@@ -257,7 +261,7 @@ export const NavigationContextProvider = ({
257
261
  * if an overlay is visible return true to display the back buton
258
262
  */
259
263
  return isOverlayVisible;
260
- }, [currentHistory.length, isDefaultContentDefined, isOverlayVisible, currentView]);
264
+ }, [currentHistory.length, isDefaultContentDefined, isOverlayVisible, currentView, isAiEnabled]);
261
265
  const fetchArticleData = useCallback(async historyItem => {
262
266
  try {
263
267
  let article;
@@ -32,6 +32,16 @@ export const HelpBody = styled.div({
32
32
  overflowX: 'hidden',
33
33
  overflowY: 'auto'
34
34
  });
35
+
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
37
+ export const HelpBodyAi = styled.div({
38
+ width: '100%',
39
+ boxSizing: 'border-box',
40
+ order: 0,
41
+ flex: '1 1 auto',
42
+ alignSelf: 'auto',
43
+ position: 'relative'
44
+ });
35
45
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
36
46
  export const Home = styled.div(props => ({
37
47
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -43,6 +53,19 @@ export const Home = styled.div(props => ({
43
53
  boxSizing: 'border-box'
44
54
  }));
45
55
 
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
57
+ export const HomeAi = styled.div(props => ({
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
59
+ display: props.isOverlayFullyVisible ? 'none' : 'block',
60
+ // height: `calc(100% - ${token('space.800', '60px')})`,
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
62
+ overflow: props.isOverlayVisible ? 'hidden' : 'auto',
63
+ paddingLeft: "var(--ds-space-200, 16px)",
64
+ paddingRight: "var(--ds-space-200, 16px)",
65
+ paddingBottom: "var(--ds-space-200, 16px)",
66
+ boxSizing: 'border-box'
67
+ }));
68
+
46
69
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
47
70
  export const HelpFooter = styled.div({
48
71
  padding: `${"var(--ds-space-100, 8px)"} 0`,
@@ -53,4 +76,12 @@ export const HelpFooter = styled.div({
53
76
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
77
  borderTop: `${"var(--ds-space-025, 2px)"} solid ${`var(--ds-border, ${colors.N30})`}`,
55
78
  justifyContent: 'space-between'
79
+ });
80
+
81
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
82
+ export const BackButtonContainer = styled.div({
83
+ position: 'absolute',
84
+ marginTop: "var(--ds-space-200, 14px)",
85
+ left: "var(--ds-space-100, 8px)",
86
+ height: "var(--ds-space-400, 32px)"
56
87
  });
@@ -259,5 +259,10 @@ export const messages = defineMessages({
259
259
  id: 'help.show_more_button.label_less',
260
260
  defaultMessage: 'Show less',
261
261
  description: '"Show less" text'
262
+ },
263
+ help_panel_search_back: {
264
+ id: 'helpPanel.search.back',
265
+ defaultMessage: 'Back',
266
+ description: ''
262
267
  }
263
268
  });
@@ -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.14.0"
8
+ packageVersion: "7.14.2"
9
9
  };
@@ -10,7 +10,7 @@ import { LoadingErrorMessage, LoadingErrorButtonContainer, LoadingErrorHeading }
10
10
  var ANALYTICS_CONTEXT_DATA = {
11
11
  componentName: 'ArticleLoadingFail',
12
12
  packageName: "@atlaskit/help",
13
- packageVersion: "7.14.0"
13
+ packageVersion: "7.14.2"
14
14
  };
15
15
  export var ArticleLoadingFail = function ArticleLoadingFail(_ref) {
16
16
  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.14.0"
9
+ packageVersion: "7.14.2"
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.14.0"
9
+ packageVersion: "7.14.2"
10
10
  };
11
11
  export var ArticleWasHelpfulYesButton = function ArticleWasHelpfulYesButton(_ref) {
12
12
  var _ref$isSelected = _ref.isSelected,
@@ -31,7 +31,7 @@ var FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
31
31
  var ANALYTICS_CONTEXT_DATA = {
32
32
  componentName: 'ArticleWasHelpfulForm',
33
33
  packageName: "@atlaskit/help",
34
- packageVersion: "7.14.0"
34
+ packageVersion: "7.14.2"
35
35
  };
36
36
  var buttonStyles = css({
37
37
  padding: '0',
@@ -56,7 +56,7 @@ export var HelpArticle = function HelpArticle(_ref) {
56
56
  analyticsEvent.payload.attributes = {
57
57
  componentName: 'Article',
58
58
  packageName: "@atlaskit/help",
59
- packageVersion: "7.14.0"
59
+ packageVersion: "7.14.2"
60
60
  };
61
61
  if (onRelatedArticlesShowMoreClick) {
62
62
  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.14.0"
16
+ packageVersion: "7.14.2"
17
17
  };
18
18
  export var WhatsNewArticle = function WhatsNewArticle(_ref) {
19
19
  var formatMessage = _ref.intl.formatMessage,
@@ -7,7 +7,7 @@ import { Transition } from 'react-transition-group';
7
7
  import { useNavigationContext } from '../contexts/navigationContext';
8
8
  import { useHelpArticleContext } from '../contexts/helpArticleContext';
9
9
  import { SLIDEIN_OVERLAY_TRANSITION_DURATION_MS, VIEW } from '../constants';
10
- import { ArticleContainer } from './styled';
10
+ import { ArticleContainer, ArticleContainerAi } from './styled';
11
11
  import ArticleContent from './ArticleContent';
12
12
  // Animation
13
13
  var defaultStyle = {
@@ -26,8 +26,9 @@ var transitionStyles = {
26
26
  left: '100%'
27
27
  }
28
28
  };
29
- export var Article = function Article() {
29
+ export var Article = function Article(_ref) {
30
30
  var _history$length;
31
+ var isAiEnabled = _ref.isAiEnabled;
31
32
  var _useNavigationContext = useNavigationContext(),
32
33
  view = _useNavigationContext.view,
33
34
  articleId = _useNavigationContext.articleId,
@@ -104,7 +105,24 @@ export var Article = function Article() {
104
105
  setShowArticle(view === VIEW.ARTICLE || view === VIEW.WHATS_NEW_ARTICLE);
105
106
  }
106
107
  }, [view, showArticle]);
107
- return /*#__PURE__*/React.createElement(Transition, {
108
+ return isAiEnabled ? /*#__PURE__*/React.createElement(Transition, {
109
+ in: showArticle,
110
+ timeout: SLIDEIN_OVERLAY_TRANSITION_DURATION_MS,
111
+ enter: !skipArticleSlideInAnimation,
112
+ onEntered: onArticleEntered,
113
+ onExit: onArticleExit,
114
+ unmountOnExit: true,
115
+ mountOnEnter: true
116
+ }, function (state) {
117
+ return /*#__PURE__*/React.createElement(ArticleContainerAi, {
118
+ ref: articleContainerRef,
119
+ style: _objectSpread(_objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state]), enableTransition[!skipArticleSlideInAnimation ? 'enabled' : 'disabled'])
120
+ }, /*#__PURE__*/React.createElement(ArticleContent, {
121
+ currentArticle: currentArticle,
122
+ onHelpArticleLoadingFailTryAgainButtonClick: reloadHelpArticle && handleOnHelpArticleLoadingFailTryAgainButtonClick,
123
+ onWhatsNewArticleLoadingFailTryAgainButtonClick: reloadWhatsNewArticle && handleOnWhatsNewArticleLoadingFailTryAgainButtonClick
124
+ }));
125
+ }) : /*#__PURE__*/React.createElement(Transition, {
108
126
  in: showArticle,
109
127
  timeout: SLIDEIN_OVERLAY_TRANSITION_DURATION_MS,
110
128
  enter: !skipArticleSlideInAnimation,
@@ -20,4 +20,23 @@ export var ArticleContainer = styled.div({
20
20
  overflowX: 'hidden',
21
21
  overflowY: 'auto',
22
22
  zIndex: 2
23
+ });
24
+
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
26
+ export var ArticleContainerAi = styled.div({
27
+ paddingLeft: "var(--ds-space-300, 24px)",
28
+ paddingRight: "var(--ds-space-300, 24px)",
29
+ paddingBottom: "var(--ds-space-200, 16px)",
30
+ position: 'absolute',
31
+ height: "calc(100% - ".concat("var(--ds-space-800, 60px)", ")"),
32
+ width: '100%',
33
+ top: "var(--ds-space-800, 60px)",
34
+ backgroundColor: "var(--ds-surface, #FFFFFF)",
35
+ left: '100%',
36
+ flex: 1,
37
+ flexDirection: 'column',
38
+ boxSizing: 'border-box',
39
+ overflowX: 'hidden',
40
+ overflowY: 'auto',
41
+ zIndex: 2
23
42
  });
@@ -8,7 +8,7 @@ import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTit
8
8
  var ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.14.0"
11
+ packageVersion: "7.14.2"
12
12
  };
13
13
  var highlightText = function highlightText(text) {
14
14
  if (!text) {
@@ -0,0 +1,76 @@
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; }
4
+ import React from 'react';
5
+ import { injectIntl } from 'react-intl-next';
6
+ import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
7
+ import { Transition } from 'react-transition-group';
8
+ import ArrowleftIcon from '@atlaskit/icon/core/migration/arrow-left';
9
+ import Button from '@atlaskit/button/standard-button';
10
+ import { messages } from '../../messages';
11
+ import { BackButtonContainer } from '../styled';
12
+ import { TRANSITION_DURATION_MS } from '../constants';
13
+ // Animation
14
+ var defaultStyle = {
15
+ transition: "left ".concat(TRANSITION_DURATION_MS, "ms, opacity ").concat(TRANSITION_DURATION_MS, "ms"),
16
+ left: "var(--ds-space-300, 24px)",
17
+ opacity: 0
18
+ };
19
+ var transitionStyles = {
20
+ entered: {
21
+ left: "var(--ds-space-100, 8px)",
22
+ opacity: 1
23
+ },
24
+ exited: {
25
+ left: "var(--ds-space-100, 8px)",
26
+ opacity: 0
27
+ }
28
+ };
29
+ export var BackButton = function BackButton(_ref) {
30
+ var onClick = _ref.onClick,
31
+ _ref$isVisible = _ref.isVisible,
32
+ isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible,
33
+ formatMessage = _ref.intl.formatMessage;
34
+ var _useAnalyticsEvents = useAnalyticsEvents(),
35
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
36
+ var handleOnClick = function handleOnClick(event) {
37
+ if (onClick) {
38
+ var _analyticsEvent = createAnalyticsEvent({
39
+ action: 'clicked'
40
+ });
41
+ onClick(event, _analyticsEvent);
42
+ }
43
+ };
44
+ return /*#__PURE__*/React.createElement(Transition, {
45
+ in: isVisible,
46
+ timeout: TRANSITION_DURATION_MS,
47
+ mountOnEnter: true,
48
+ unmountOnExit: true
49
+ }, function (state) {
50
+ return /*#__PURE__*/React.createElement(BackButtonContainer, {
51
+ style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
52
+ }, /*#__PURE__*/React.createElement(Button, {
53
+ onClick: function onClick(event) {
54
+ if (state === 'entered') {
55
+ handleOnClick(event);
56
+ }
57
+ },
58
+ appearance: "subtle",
59
+ iconBefore: /*#__PURE__*/React.createElement(ArrowleftIcon, {
60
+ color: "currentColor",
61
+ label: "",
62
+ LEGACY_size: "medium"
63
+ })
64
+ }, formatMessage(messages.help_panel_search_back)));
65
+ });
66
+ };
67
+ var BackButtonWithContext = function BackButtonWithContext(props) {
68
+ return /*#__PURE__*/React.createElement(AnalyticsContext, {
69
+ data: {
70
+ componentName: 'backButton',
71
+ packageName: "@atlaskit/help",
72
+ packageVersion: "7.14.2"
73
+ }
74
+ }, /*#__PURE__*/React.createElement(BackButton, props));
75
+ };
76
+ export default injectIntl(BackButtonWithContext);
@@ -45,7 +45,7 @@ export var Help = /*#__PURE__*/function (_React$PureComponent) {
45
45
  rest = _objectWithoutProperties(_this$props, _excluded);
46
46
  return /*#__PURE__*/React.createElement(LocaleIntlProvider, null, /*#__PURE__*/React.createElement(HeaderContextProvider, rest.header, /*#__PURE__*/React.createElement(HomeContextProvider, _extends({}, rest.home, {
47
47
  homeContent: children
48
- }), /*#__PURE__*/React.createElement(HelpArticleContextProvider, rest.helpArticle, /*#__PURE__*/React.createElement(RelatedArticlesContextProvider, rest.relatedArticles, /*#__PURE__*/React.createElement(SearchContextProvider, rest.search, /*#__PURE__*/React.createElement(WhatsNewArticleProvider, rest.whatsNew, /*#__PURE__*/React.createElement(NavigationContextProvider, rest.navigation, /*#__PURE__*/React.createElement(AiContextProvider, rest.ai, /*#__PURE__*/React.createElement(HelpContent, {
48
+ }), /*#__PURE__*/React.createElement(HelpArticleContextProvider, rest.helpArticle, /*#__PURE__*/React.createElement(RelatedArticlesContextProvider, rest.relatedArticles, /*#__PURE__*/React.createElement(SearchContextProvider, rest.search, /*#__PURE__*/React.createElement(WhatsNewArticleProvider, rest.whatsNew, /*#__PURE__*/React.createElement(AiContextProvider, rest.ai, /*#__PURE__*/React.createElement(NavigationContextProvider, rest.navigation, /*#__PURE__*/React.createElement(HelpContent, {
49
49
  footer: footer
50
50
  }))))))))));
51
51
  }
@@ -15,7 +15,8 @@ import ArticleComponent from './Article';
15
15
  import WhatsNewButton from './WhatsNew/WhatsNewButton';
16
16
  import WhatsNewResults from './WhatsNew/WhatsNewResults';
17
17
  import HelpContentButton from './HelpContentButton';
18
- import { HelpBodyContainer, HelpBody, Home } from './styled';
18
+ import BackButton from './BackButton';
19
+ import { HelpBodyContainer, HelpBody, Home, HomeAi, HelpBodyAi } from './styled';
19
20
  import { HelpFooter } from './styled';
20
21
  export var HelpContent = function HelpContent(_ref) {
21
22
  var footer = _ref.footer;
@@ -52,7 +53,7 @@ export var HelpContent = function HelpContent(_ref) {
52
53
  }, [navigateBack, onBackButtonClick]);
53
54
  useEffect(function () {
54
55
  var handler;
55
- if (isOverlayVisible) {
56
+ if (isOverlayVisible && !isAiEnabled) {
56
57
  handler = setTimeout(function () {
57
58
  setIsOverlayFullyVisible(isOverlayVisible);
58
59
  }, HIDE_CONTENT_DELAY);
@@ -64,14 +65,36 @@ export var HelpContent = function HelpContent(_ref) {
64
65
  clearTimeout(handler);
65
66
  }
66
67
  };
67
- }, [isOverlayVisible]);
68
- return /*#__PURE__*/React.createElement(HelpLayout, {
68
+ }, [isOverlayVisible, isAiEnabled]);
69
+ return isAiEnabled ? /*#__PURE__*/React.createElement(HelpLayout, {
70
+ onCloseButtonClick: onClose,
71
+ isAiEnabled: true
72
+ }, /*#__PURE__*/React.createElement(HelpBodyContainer, null, /*#__PURE__*/React.createElement(HelpBodyAi, null, /*#__PURE__*/React.createElement(BackButton, {
73
+ onClick: handleOnBackButtonClick,
74
+ isVisible: canNavigateBack
75
+ }), onSearch && /*#__PURE__*/React.createElement(SearchInput, {
76
+ isAiEnabled: true
77
+ }), /*#__PURE__*/React.createElement(SearchResults, {
78
+ isAiEnabled: true
79
+ }), /*#__PURE__*/React.createElement(ArticleComponent, {
80
+ isAiEnabled: true
81
+ }), /*#__PURE__*/React.createElement(HomeAi, {
82
+ isOverlayFullyVisible: isOverlayFullyVisible,
83
+ isOverlayVisible: isOverlayVisible
84
+ }, homeContent, onSearchWhatsNewArticles && onGetWhatsNewArticle && /*#__PURE__*/React.createElement(WhatsNewButton, {
85
+ productName: productName
86
+ }), homeOptions && homeOptions.map(function (defaultOption) {
87
+ return /*#__PURE__*/React.createElement(HelpContentButton, _extends({
88
+ key: defaultOption.id
89
+ }, defaultOption));
90
+ }))), /*#__PURE__*/React.createElement(WhatsNewResults, null), footer && /*#__PURE__*/React.createElement(HelpFooter, {
91
+ "data-testid": "inside-footer"
92
+ }, footer))) : /*#__PURE__*/React.createElement(HelpLayout, {
69
93
  onBackButtonClick: handleOnBackButtonClick,
70
94
  onCloseButtonClick: onClose,
71
95
  isBackbuttonVisible: canNavigateBack,
72
- footer: !isAiEnabled ? footer : undefined,
73
- headerContent: onSearch && /*#__PURE__*/React.createElement(SearchInput, null),
74
- isAiEnabled: isAiEnabled
96
+ footer: footer,
97
+ headerContent: onSearch && /*#__PURE__*/React.createElement(SearchInput, null)
75
98
  }, /*#__PURE__*/React.createElement(HelpBodyContainer, null, /*#__PURE__*/React.createElement(HelpBody, null, /*#__PURE__*/React.createElement(SearchResults, null), /*#__PURE__*/React.createElement(ArticleComponent, null), /*#__PURE__*/React.createElement(Home, {
76
99
  isOverlayFullyVisible: isOverlayFullyVisible,
77
100
  isOverlayVisible: isOverlayVisible
@@ -81,8 +104,6 @@ export var HelpContent = function HelpContent(_ref) {
81
104
  return /*#__PURE__*/React.createElement(HelpContentButton, _extends({
82
105
  key: defaultOption.id
83
106
  }, defaultOption));
84
- }))), /*#__PURE__*/React.createElement(WhatsNewResults, null), isAiEnabled && footer && /*#__PURE__*/React.createElement(HelpFooter, {
85
- "data-testid": "inside-footer"
86
- }, footer)));
107
+ }))), /*#__PURE__*/React.createElement(WhatsNewResults, null)));
87
108
  };
88
109
  export default HelpContent;
@@ -7,7 +7,7 @@ import { HelpContentButtonContainer, HelpContentButtonIcon, HelpContentButtonTex
7
7
  var analitycsContextData = {
8
8
  componentName: 'HelpContentButton',
9
9
  packageName: "@atlaskit/help",
10
- packageVersion: "7.14.0"
10
+ packageVersion: "7.14.2"
11
11
  };
12
12
  var HelpContentButton = function HelpContentButton(_ref) {
13
13
  var _ref$id = _ref.id,
@@ -24,7 +24,7 @@ import { Text } from '@atlaskit/primitives';
24
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  import { css, jsx } from '@emotion/react';
26
26
  var packageName = "@atlaskit/help";
27
- var packageVersion = "7.14.0";
27
+ var packageVersion = "7.14.2";
28
28
  var buttonStyles = css({
29
29
  padding: '0',
30
30
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
@@ -17,11 +17,13 @@ import { injectIntl } from 'react-intl-next';
17
17
  import { REQUEST_STATE } from '../../../model/Requests';
18
18
  import { useSearchContext } from '../../contexts/searchContext';
19
19
  import { messages } from '../../../messages';
20
- import { SearchInputContainer, SearchIconContainer, CloseButtonAndSpinnerContainer } from './styled';
20
+ import { VIEW } from '../../constants';
21
+ import { SearchInputContainer, SearchInputContainerAi, SearchIconContainer, CloseButtonAndSpinnerContainer } from './styled';
22
+ import { useNavigationContext } from '../../contexts/navigationContext';
21
23
  var ANALYTICS_CONTEXT_DATA = {
22
24
  componentName: 'searchInput',
23
25
  packageName: "@atlaskit/help",
24
- packageVersion: "7.14.0"
26
+ packageVersion: "7.14.2"
25
27
  };
26
28
  var buttonStyles = css({
27
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -30,7 +32,11 @@ var buttonStyles = css({
30
32
  height: "".concat(gridSize() * 3, "px")
31
33
  });
32
34
  export var SearchInput = function SearchInput(_ref) {
33
- var formatMessage = _ref.intl.formatMessage;
35
+ var formatMessage = _ref.intl.formatMessage,
36
+ _ref$isAiEnabled = _ref.isAiEnabled,
37
+ isAiEnabled = _ref$isAiEnabled === void 0 ? false : _ref$isAiEnabled;
38
+ var _useNavigationContext = useNavigationContext(),
39
+ view = _useNavigationContext.view;
34
40
  var _useSearchContext = useSearchContext(),
35
41
  searchValue = _useSearchContext.searchValue,
36
42
  searchState = _useSearchContext.searchState,
@@ -77,7 +83,38 @@ export var SearchInput = function SearchInput(_ref) {
77
83
  if (inputRef && inputRef.current) {
78
84
  inputRef.current.value = searchValue;
79
85
  }
80
- return jsx(SearchInputContainer, null, jsx(Textfield, {
86
+ if (view === VIEW.ARTICLE || view === VIEW.WHATS_NEW_ARTICLE) {
87
+ return null;
88
+ }
89
+ return isAiEnabled ? jsx(SearchInputContainerAi, null, jsx(Textfield, {
90
+ title: "Help articles search input",
91
+ autoComplete: "off",
92
+ ref: inputRef,
93
+ name: "help-search-input",
94
+ elemBeforeInput: jsx(SearchIconContainer, null, jsx(SearchIcon, {
95
+ LEGACY_margin: "0 2px",
96
+ color: "currentColor",
97
+ spacing: "spacious",
98
+ label: ""
99
+ })),
100
+ elemAfterInput: jsx(CloseButtonAndSpinnerContainer, null, searchState === REQUEST_STATE.loading && jsx(Spinner, {
101
+ size: "small"
102
+ }), searchValue !== '' && jsx(Button, {
103
+ css: buttonStyles,
104
+ appearance: "subtle",
105
+ onClick: handleOnClearButtonClick,
106
+ spacing: "none",
107
+ "aria-label": "Clear field"
108
+ }, jsx(EditorCloseIcon, {
109
+ color: "currentColor",
110
+ spacing: "spacious",
111
+ label: ""
112
+ }))),
113
+ placeholder: formatMessage(messages.help_search_placeholder),
114
+ onChange: handleOnInputChange,
115
+ onKeyPress: handleOnKeyPress,
116
+ value: searchValue
117
+ })) : jsx(SearchInputContainer, null, jsx(Textfield, {
81
118
  title: "Help articles search input",
82
119
  autoComplete: "off",
83
120
  ref: inputRef,
@@ -13,6 +13,20 @@ export var SearchInputContainer = styled.div({
13
13
  boxSizing: 'border-box'
14
14
  });
15
15
 
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
17
+ export var SearchInputContainerAi = styled.div({
18
+ width: "calc(100% - ".concat("var(--ds-space-300, 24px)", " - ", "var(--ds-space-300, 24px)", ")"),
19
+ height: "var(--ds-space-400, 32px)",
20
+ marginLeft: "var(--ds-space-300, 24px)",
21
+ marginRight: "var(--ds-space-300, 24px)",
22
+ marginTop: "var(--ds-space-200, 14px)",
23
+ marginBottom: "var(--ds-space-200, 14px)",
24
+ order: 0,
25
+ flex: '0 1 auto',
26
+ alignSelf: 'auto',
27
+ boxSizing: 'border-box'
28
+ });
29
+
16
30
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
17
31
  export var SearchIconContainer = styled.div({
18
32
  width: "var(--ds-space-300, 24px)",
@@ -13,7 +13,7 @@ import SearchResultsList from './SearchResults';
13
13
  import SearchExternalSite from './SearchExternalSite';
14
14
  import SearchResultsEmpty from './SearchResultsEmpty';
15
15
  import SearchResultsError from './SearchResultsError';
16
- import { SearchResultsContainer } from './styled';
16
+ import { SearchResultsContainer, SearchResultsContainerAi } from './styled';
17
17
  var defaultStyle = {
18
18
  transition: "opacity ".concat(FADEIN_OVERLAY_TRANSITION_DURATION_MS, "ms"),
19
19
  opacity: 0,
@@ -37,7 +37,9 @@ var transitionStyles = {
37
37
  visibility: 'hidden'
38
38
  }
39
39
  };
40
- export var SearchResults = function SearchResults() {
40
+ export var SearchResults = function SearchResults(_ref) {
41
+ var _ref$isAiEnabled = _ref.isAiEnabled,
42
+ isAiEnabled = _ref$isAiEnabled === void 0 ? false : _ref$isAiEnabled;
41
43
  var _useSearchContext = useSearchContext(),
42
44
  searchState = _useSearchContext.searchState,
43
45
  searchResult = _useSearchContext.searchResult,
@@ -74,7 +76,48 @@ export var SearchResults = function SearchResults() {
74
76
  setSuggestionsCount(0);
75
77
  }
76
78
  }, [searchResult]);
77
- return /*#__PURE__*/React.createElement(Transition, {
79
+ return isAiEnabled ? /*#__PURE__*/React.createElement(Transition, {
80
+ in: view === VIEW.SEARCH && isSearchResultVisible,
81
+ timeout: FADEIN_OVERLAY_TRANSITION_DURATION_MS
82
+ }, function (state) {
83
+ return /*#__PURE__*/React.createElement(SearchResultsContainerAi, {
84
+ style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
85
+ }, /*#__PURE__*/React.createElement("div", {
86
+ ref: liveRegionRef,
87
+ "aria-live": "polite",
88
+ "aria-atomic": "true",
89
+ style: {
90
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
91
+ position: 'absolute',
92
+ // hidden visually, but accessible
93
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
94
+ width: 1,
95
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
96
+ height: 1,
97
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
98
+ margin: -1,
99
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
100
+ border: 0,
101
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
102
+ padding: 0,
103
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
104
+ clip: 'rect(0 0 0 0)',
105
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
106
+ overflow: 'hidden'
107
+ }
108
+ }, suggestionsCount > 0 && "".concat(suggestionsCount, " suggestion").concat(suggestionsCount !== 1 ? 's' : '', " available for typed text."), suggestionsCount === 0 && 'No suggestions available.'), searchState !== REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchResultsList, {
109
+ searchResult: searchResult,
110
+ onSearchResultItemClick: handleOnSearchResultItemClick
111
+ }), /*#__PURE__*/React.createElement(SearchExternalSite, {
112
+ searchExternalUrl: searchExternalUrl,
113
+ onSearchExternalUrlClick: onSearchExternalUrlClick
114
+ })), searchState !== REQUEST_STATE.error && searchResult !== null && searchResult.length === 0 && /*#__PURE__*/React.createElement(SearchResultsEmpty, {
115
+ searchExternalUrl: searchExternalUrl,
116
+ onSearchExternalUrlClick: onSearchExternalUrlClick
117
+ }), searchState === REQUEST_STATE.error && /*#__PURE__*/React.createElement(SearchResultsError, {
118
+ onSearch: onSearch
119
+ }));
120
+ }) : /*#__PURE__*/React.createElement(Transition, {
78
121
  in: view === VIEW.SEARCH && isSearchResultVisible,
79
122
  timeout: FADEIN_OVERLAY_TRANSITION_DURATION_MS
80
123
  }, function (state) {
@@ -21,6 +21,22 @@ export var SearchResultsContainer = styled.div({
21
21
  padding: "0 ".concat("var(--ds-space-200, 16px)")
22
22
  });
23
23
 
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
25
+ export var SearchResultsContainerAi = styled.div({
26
+ position: 'absolute',
27
+ height: "calc(100% - ".concat("var(--ds-space-800, 60px)", ")"),
28
+ width: '100%',
29
+ top: "var(--ds-space-800, 60px)",
30
+ backgroundColor: "var(--ds-surface, #FFFFFF)",
31
+ flex: 1,
32
+ flexDirection: 'column',
33
+ boxSizing: 'border-box',
34
+ overflowX: 'hidden',
35
+ overflowY: 'auto',
36
+ zIndex: 10,
37
+ padding: "0 ".concat("var(--ds-space-200, 16px)")
38
+ });
39
+
24
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
25
41
  export var SearchResultsList = styled.div({
26
42
  paddingTop: "var(--ds-space-300, 24px)",
@@ -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.14.0"
14
+ packageVersion: "7.14.2"
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.14.0"
11
+ packageVersion: "7.14.2"
12
12
  };
13
13
  export var WhatsNewResultListItem = function WhatsNewResultListItem(_ref) {
14
14
  var formatMessage = _ref.intl.formatMessage,
@@ -13,4 +13,6 @@ export var VIEW = /*#__PURE__*/function (VIEW) {
13
13
  // Animation related consts
14
14
  export var SLIDEIN_OVERLAY_TRANSITION_DURATION_MS = 300;
15
15
  export var FADEIN_OVERLAY_TRANSITION_DURATION_MS = 440;
16
- export var HIDE_CONTENT_DELAY = FADEIN_OVERLAY_TRANSITION_DURATION_MS + 200;
16
+ export var HIDE_CONTENT_DELAY = FADEIN_OVERLAY_TRANSITION_DURATION_MS + 200;
17
+ // Animation related consts
18
+ export var TRANSITION_DURATION_MS = 220;