@atlaskit/help 7.1.26 → 7.2.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 (79) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/components/Article/ArticleLoadingFail/styled.js +1 -0
  3. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +0 -1
  4. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/styled.js +3 -3
  5. package/dist/cjs/components/Article/WhatsNewArticle/styled.js +7 -6
  6. package/dist/cjs/components/Article/styled.js +2 -2
  7. package/dist/cjs/components/ArticlesList/ArticlesListItem/styled.js +5 -4
  8. package/dist/cjs/components/ArticlesList/styled.js +2 -2
  9. package/dist/cjs/components/HelpContentButton/styled.js +5 -5
  10. package/dist/cjs/components/RelatedArticles/index.js +28 -30
  11. package/dist/cjs/components/RelatedArticles/styled.js +4 -3
  12. package/dist/cjs/components/Search/SearchInput/styled.js +3 -3
  13. package/dist/cjs/components/Search/SearchResults/styled.js +1 -0
  14. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +1 -0
  15. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +1 -0
  16. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +5 -4
  17. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -3
  18. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +4 -3
  19. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsLoading/styled.js +3 -3
  20. package/dist/cjs/components/WhatsNew/WhatsNewResults/styled.js +4 -3
  21. package/dist/cjs/components/constants.js +8 -8
  22. package/dist/cjs/components/contexts/navigationContext.js +122 -130
  23. package/dist/cjs/components/contexts/searchContext.js +28 -30
  24. package/dist/cjs/components/contexts/whatsNewArticleContext.js +51 -53
  25. package/dist/cjs/components/styled.js +3 -3
  26. package/dist/cjs/model/Article.js +4 -4
  27. package/dist/cjs/model/Help.js +4 -4
  28. package/dist/cjs/model/Requests.js +4 -4
  29. package/dist/cjs/model/WhatsNew.js +4 -4
  30. package/dist/cjs/util/styled.js +3 -2
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/styled.js +2 -3
  33. package/dist/es2019/components/Article/WhatsNewArticle/styled.js +8 -8
  34. package/dist/es2019/components/Article/styled.js +1 -2
  35. package/dist/es2019/components/ArticlesList/ArticlesListItem/styled.js +7 -7
  36. package/dist/es2019/components/ArticlesList/styled.js +1 -2
  37. package/dist/es2019/components/HelpContentButton/styled.js +6 -7
  38. package/dist/es2019/components/RelatedArticles/styled.js +5 -5
  39. package/dist/es2019/components/Search/SearchInput/styled.js +8 -9
  40. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +4 -5
  41. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -3
  42. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +5 -4
  43. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsLoading/styled.js +2 -4
  44. package/dist/es2019/components/WhatsNew/WhatsNewResults/styled.js +3 -3
  45. package/dist/es2019/components/constants.js +8 -8
  46. package/dist/es2019/components/styled.js +1 -2
  47. package/dist/es2019/model/Article.js +3 -3
  48. package/dist/es2019/model/Help.js +3 -3
  49. package/dist/es2019/model/Requests.js +3 -3
  50. package/dist/es2019/model/WhatsNew.js +3 -3
  51. package/dist/es2019/util/styled.js +4 -4
  52. package/dist/es2019/version.json +1 -1
  53. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/styled.js +2 -3
  54. package/dist/esm/components/Article/WhatsNewArticle/styled.js +7 -7
  55. package/dist/esm/components/Article/styled.js +1 -2
  56. package/dist/esm/components/ArticlesList/ArticlesListItem/styled.js +5 -5
  57. package/dist/esm/components/ArticlesList/styled.js +1 -2
  58. package/dist/esm/components/HelpContentButton/styled.js +4 -5
  59. package/dist/esm/components/RelatedArticles/index.js +28 -30
  60. package/dist/esm/components/RelatedArticles/styled.js +4 -4
  61. package/dist/esm/components/Search/SearchInput/styled.js +2 -3
  62. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +4 -5
  63. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -3
  64. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +4 -4
  65. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsLoading/styled.js +2 -4
  66. package/dist/esm/components/WhatsNew/WhatsNewResults/styled.js +3 -3
  67. package/dist/esm/components/constants.js +8 -8
  68. package/dist/esm/components/contexts/navigationContext.js +122 -130
  69. package/dist/esm/components/contexts/searchContext.js +28 -30
  70. package/dist/esm/components/contexts/whatsNewArticleContext.js +51 -53
  71. package/dist/esm/components/styled.js +2 -3
  72. package/dist/esm/model/Article.js +3 -3
  73. package/dist/esm/model/Help.js +3 -3
  74. package/dist/esm/model/Requests.js +3 -3
  75. package/dist/esm/model/WhatsNew.js +3 -3
  76. package/dist/esm/util/styled.js +2 -2
  77. package/dist/esm/version.json +1 -1
  78. package/package.json +21 -21
  79. package/tmp/api-report-tmp.d.ts +0 -300
@@ -52,37 +52,35 @@ export var RelatedArticles = function RelatedArticles(_ref) {
52
52
  var updateRelatedArticles = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
53
53
  var _relatedArticles;
54
54
  return _regeneratorRuntime.wrap(function _callee$(_context) {
55
- while (1) {
56
- switch (_context.prev = _context.next) {
57
- case 0:
58
- if (!onGetRelatedArticles) {
59
- _context.next = 15;
60
- break;
61
- }
62
- _context.prev = 1;
63
- _context.next = 4;
64
- return cancellablePromise(onGetRelatedArticles(routeGroup, routeName));
65
- case 4:
66
- _relatedArticles = _context.sent;
67
- setRelatedArticles(_relatedArticles);
68
- setIsLoading(false);
69
- setHasError(false);
70
- _context.next = 13;
55
+ while (1) switch (_context.prev = _context.next) {
56
+ case 0:
57
+ if (!onGetRelatedArticles) {
58
+ _context.next = 15;
71
59
  break;
72
- case 10:
73
- _context.prev = 10;
74
- _context.t0 = _context["catch"](1);
75
- setHasError(true);
76
- case 13:
77
- _context.next = 17;
78
- break;
79
- case 15:
80
- setIsLoading(false);
81
- setHasError(false);
82
- case 17:
83
- case "end":
84
- return _context.stop();
85
- }
60
+ }
61
+ _context.prev = 1;
62
+ _context.next = 4;
63
+ return cancellablePromise(onGetRelatedArticles(routeGroup, routeName));
64
+ case 4:
65
+ _relatedArticles = _context.sent;
66
+ setRelatedArticles(_relatedArticles);
67
+ setIsLoading(false);
68
+ setHasError(false);
69
+ _context.next = 13;
70
+ break;
71
+ case 10:
72
+ _context.prev = 10;
73
+ _context.t0 = _context["catch"](1);
74
+ setHasError(true);
75
+ case 13:
76
+ _context.next = 17;
77
+ break;
78
+ case 15:
79
+ setIsLoading(false);
80
+ setHasError(false);
81
+ case 17:
82
+ case "end":
83
+ return _context.stop();
86
84
  }
87
85
  }, _callee, null, [[1, 10]]);
88
86
  })), [cancellablePromise, onGetRelatedArticles, routeGroup, routeName]);
@@ -5,7 +5,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
5
5
  import { css } from '@emotion/core';
6
6
  import styled from '@emotion/styled';
7
7
  import * as colors from '@atlaskit/theme/colors';
8
- import { gridSize, fontSize } from '@atlaskit/theme/constants';
8
+ import { fontSize } from '@atlaskit/theme/constants';
9
9
  var baseHeading = function baseHeading(size, lineHeight) {
10
10
  return "\n font-size: ".concat(size / fontSize(), "em;\n font-style: inherit;\n line-height: ").concat(lineHeight / size, ";\n");
11
11
  };
@@ -13,11 +13,11 @@ export var truncate = function truncate() {
13
13
  var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
14
14
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: ", ";\n"])), width);
15
15
  };
16
- export var RelatedArticlesTitle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n font-weight: 600;\n letter-spacing: -0.006em;\n padding: ", "px 0;\n"])), baseHeading(16, 20), "var(--ds-text, ".concat(colors.N800, ")"), gridSize() * 2);
16
+ export var RelatedArticlesTitle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n font-weight: 600;\n letter-spacing: -0.006em;\n padding: ", " 0;\n"])), baseHeading(16, 20), "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-200, 16px)");
17
17
 
18
18
  /**
19
19
  * Loading styled-components
20
20
  */
21
- export var LoadignRelatedArticleSection = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n"])), gridSize());
21
+ export var LoadignRelatedArticleSection = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", ";\n"])), "var(--ds-space-100, 8px)");
22
22
  export var LoadignRelatedArticleList = styled.ul(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n"])));
23
- export var LoadignRelatedArticleListItem = styled.li(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n padding: ", "px;\n margin-bottom: ", "px;\n box-sizing: border-box;\n"])), gridSize(), gridSize() * 2);
23
+ export var LoadignRelatedArticleListItem = styled.li(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n padding: ", ";\n margin-bottom: ", ";\n box-sizing: border-box;\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)");
@@ -2,7 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
  var _templateObject, _templateObject2, _templateObject3;
3
3
  /** @jsx jsx */
4
4
  import styled from '@emotion/styled';
5
- import { gridSize } from '@atlaskit/theme/constants';
6
5
  export var SearchInputContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n order: 0;\n flex: 0 1 auto;\n align-self: auto;\n width: 100%;\n box-sizing: border-box;\n"])));
7
- export var SearchIconContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n padding-left: ", "px;\n\n & > span {\n padding-left: ", "px;\n height: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n"])), gridSize() * 3, gridSize() * 3, gridSize() / 2, gridSize() / 2, gridSize() * 3, gridSize() * 3);
8
- export var CloseButtonAndSpinnerContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 0;\n padding-right: ", "px;\n position: relative;\n white-space: nowrap;\n\n & > span {\n padding-right: ", "px;\n }\n\n & > button,\n & > span {\n display: inline-block;\n vertical-align: middle;\n }\n"])), gridSize(), gridSize() / 2);
6
+ export var SearchIconContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n padding-left: ", ";\n\n & > span {\n padding-left: ", ";\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n }\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-050, 4px)", "var(--ds-space-050, 4px)", "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)");
7
+ export var CloseButtonAndSpinnerContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 0;\n padding-right: ", ";\n position: relative;\n white-space: nowrap;\n\n & > span {\n padding-right: ", ";\n }\n\n & > button,\n & > span {\n display: inline-block;\n vertical-align: middle;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)");
@@ -2,13 +2,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
  var _templateObject, _templateObject2, _templateObject3;
3
3
  /** @jsx jsx */
4
4
  import styled from '@emotion/styled';
5
- import { gridSize } from '@atlaskit/theme/constants';
6
5
  import { fontSize, fontSizeSmall } from '@atlaskit/theme/constants';
7
6
  import * as colors from '@atlaskit/theme/colors';
8
7
  export var WhatsNewResultListItemWrapper = styled.a({
9
8
  position: "relative",
10
9
  boxSizing: "border-box",
11
- padding: "".concat(gridSize(), "px"),
10
+ padding: "var(--ds-space-100, 8px)",
12
11
  display: "block",
13
12
  textDecoration: "none",
14
13
  cursor: "pointer",
@@ -32,6 +31,6 @@ export var WhatsNewResultListItemWrapper = styled.a({
32
31
  }, function (props) {
33
32
  return props.styles;
34
33
  });
35
- export var WhatsNewResultListItemTitleContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n white-space: nowrap;\n margin-bottom: ", "px;\n"])), gridSize() / 2);
36
- export var WhatsNewResultListItemTitleText = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", "px;\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n padding-left: ", "px;\n white-space: normal;\n overflow-x: hidden;\n"])), fontSizeSmall(), fontSize(), gridSize() / 2);
37
- export var WhatsNewResultListItemDescription = styled.p(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: block;\n line-height: ", "px;\n color: ", ";\n margin: 0;\n"])), gridSize() * 2.5, "var(--ds-text, ".concat(colors.N800, ")"));
34
+ export var WhatsNewResultListItemTitleContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n white-space: nowrap;\n margin-bottom: ", ";\n"])), "var(--ds-space-050, 4px)");
35
+ export var WhatsNewResultListItemTitleText = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", "px;\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n padding-left: ", ";\n white-space: normal;\n overflow-x: hidden;\n"])), fontSizeSmall(), fontSize(), "var(--ds-space-050, 4px)");
36
+ export var WhatsNewResultListItemDescription = styled.p(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: block;\n line-height: ", ";\n color: ", ";\n margin: 0;\n"])), "var(--ds-font-lineHeight-200, 20px)", "var(--ds-text, ".concat(colors.N800, ")"));
@@ -1,6 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useEffect, useState } from 'react';
3
- import { gridSize } from '@atlaskit/theme/constants';
4
3
  import * as colors from '@atlaskit/theme/colors';
5
4
  import toDate from 'date-fns/toDate';
6
5
  import isYesterday from 'date-fns/isYesterday';
@@ -44,8 +43,8 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
44
43
  return /*#__PURE__*/React.createElement(WhatsNewResultItem, {
45
44
  styles: {
46
45
  border: style === 'secondary' ? "2px solid ".concat("var(--ds-border, ".concat(colors.N30, ")")) : 0,
47
- padding: style === 'secondary' ? "".concat(gridSize(), "px ").concat(gridSize() * 2, "px") : "".concat(gridSize(), "px"),
48
- marginBottom: style === 'secondary' ? "".concat(gridSize() * 1.5, "px") : 0
46
+ padding: style === 'secondary' ? "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-200, 16px)") : "var(--ds-space-100, 8px)",
47
+ marginBottom: style === 'secondary' ? "var(--ds-space-150, 12px)" : 0
49
48
  },
50
49
  id: whatsNewArticle.id,
51
50
  onClick: function onClick(event, analyticsEvent) {
@@ -4,13 +4,13 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
4
4
 
5
5
  import { css } from '@emotion/core';
6
6
  import styled from '@emotion/styled';
7
- import { fontSizeSmall, gridSize } from '@atlaskit/theme/constants';
7
+ import { fontSizeSmall } from '@atlaskit/theme/constants';
8
8
  import * as colors from '@atlaskit/theme/colors';
9
9
  export var truncate = function truncate() {
10
10
  var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
11
11
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: ", ";\n"])), width);
12
12
  };
13
13
  export var WhatsNewResultsListContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n"])));
14
- export var WhatsNewResultsListGroupWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px 0 ", "px 0;\n"])), gridSize(), gridSize());
15
- export var WhatsNewResultsListGroupTitle = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", "px;\n font-weight: bold;\n padding: 0 ", "px ", "px ", "px;\n text-transform: uppercase;\n"])), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), fontSizeSmall(), gridSize(), gridSize(), gridSize());
16
- export var ToggleShowWhatsNewResultsContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: ", "px 0;\n span {\n margin: 0;\n }\n"])), gridSize());
14
+ export var WhatsNewResultsListGroupWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", " 0 ", " 0;\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
15
+ export var WhatsNewResultsListGroupTitle = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", "px;\n font-weight: bold;\n padding: 0 ", " ", "\n ", ";\n text-transform: uppercase;\n"])), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), fontSizeSmall(), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
16
+ export var ToggleShowWhatsNewResultsContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: ", " 0;\n span {\n margin: 0;\n }\n"])), "var(--ds-space-100, 8px)");
@@ -2,10 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
  var _templateObject, _templateObject2;
3
3
  /** @jsx jsx */
4
4
  import styled from '@emotion/styled';
5
- import { gridSize } from '@atlaskit/theme/constants';
6
-
7
5
  /**
8
6
  * Loading styled-components
9
7
  */
10
- export var LoadignWhatsNewResultsList = styled.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n margin-top: ", "px;\n"])), gridSize() * 2);
11
- export var LoadignWhatsNewResultsListItem = styled.li(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n padding: ", "px;\n margin: 0;\n box-sizing: border-box;\n"])), gridSize());
8
+ export var LoadignWhatsNewResultsList = styled.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n margin-top: ", ";\n"])), "var(--ds-space-200, 16px)");
9
+ export var LoadignWhatsNewResultsListItem = styled.li(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n padding: ", ";\n margin: 0;\n box-sizing: border-box;\n"])), "var(--ds-space-100, 8px)");
@@ -3,7 +3,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
3
  /** @jsx jsx */
4
4
  import styled from '@emotion/styled';
5
5
  import { gridSize } from '@atlaskit/theme/constants';
6
- export var WhatsNewResultsContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n background-color: ", ";\n flex: 1;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1;\n padding: ", "px;\n"])), "var(--ds-surface, #FFFFFF)", 2 * gridSize());
6
+ export var WhatsNewResultsContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n background-color: ", ";\n flex: 1;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1;\n padding: ", ";\n"])), "var(--ds-surface, #FFFFFF)", "var(--ds-space-200, 16px)");
7
7
  export var SelectContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n"])), 19 * gridSize());
8
- export var WhatsNewResultsListContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-top: ", "px;\n"])), gridSize());
9
- export var WhatsNewResultsListTitleContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px;\n"])), gridSize());
8
+ export var WhatsNewResultsListContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-top: ", ";\n"])), "var(--ds-space-100, 8px)");
9
+ export var WhatsNewResultsListTitleContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", ";\n"])), "var(--ds-space-100, 8px)");
@@ -1,24 +1,24 @@
1
1
  export var MIN_CHARACTERS_FOR_SEARCH = 3;
2
2
  export var LOADING_TIMEOUT = 1000;
3
3
  export var NUMBER_OF_WHATS_NEW_ITEMS_PER_PAGE = 10;
4
- export var VIEW;
5
-
6
- // Animation related consts
7
- (function (VIEW) {
4
+ export var VIEW = /*#__PURE__*/function (VIEW) {
8
5
  VIEW["DEFAULT_CONTENT"] = "DEFAULT_CONTENT";
9
6
  VIEW["SEARCH"] = "SEARCH";
10
7
  VIEW["ARTICLE"] = "ARTICLE";
11
8
  VIEW["WHATS_NEW"] = "WHATS_NEW";
12
9
  VIEW["WHATS_NEW_ARTICLE"] = "WHATS_NEW_ARTICLE";
13
- })(VIEW || (VIEW = {}));
10
+ return VIEW;
11
+ }({});
12
+
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
16
  export var HIDE_CONTENT_DELAY = FADEIN_OVERLAY_TRANSITION_DURATION_MS + 200;
17
- export var TRANSITION_STATUS;
18
- (function (TRANSITION_STATUS) {
17
+ export var TRANSITION_STATUS = /*#__PURE__*/function (TRANSITION_STATUS) {
19
18
  TRANSITION_STATUS["UNMOUNTED"] = "unmounted";
20
19
  TRANSITION_STATUS["EXITED"] = "exited";
21
20
  TRANSITION_STATUS["ENTERING"] = "entering";
22
21
  TRANSITION_STATUS["ENTERED"] = "entered";
23
22
  TRANSITION_STATUS["EXITING"] = "exiting";
24
- })(TRANSITION_STATUS || (TRANSITION_STATUS = {}));
23
+ return TRANSITION_STATUS;
24
+ }({});
@@ -256,67 +256,65 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
256
256
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(historyItem) {
257
257
  var article;
258
258
  return _regeneratorRuntime.wrap(function _callee$(_context) {
259
- while (1) {
260
- switch (_context.prev = _context.next) {
261
- case 0:
262
- _context.prev = 0;
263
- _context.t0 = historyItem.type;
264
- _context.next = _context.t0 === ARTICLE_TYPE.HELP_ARTICLE ? 4 : _context.t0 === ARTICLE_TYPE.WHATS_NEW ? 10 : 18;
259
+ while (1) switch (_context.prev = _context.next) {
260
+ case 0:
261
+ _context.prev = 0;
262
+ _context.t0 = historyItem.type;
263
+ _context.next = _context.t0 === ARTICLE_TYPE.HELP_ARTICLE ? 4 : _context.t0 === ARTICLE_TYPE.WHATS_NEW ? 10 : 18;
264
+ break;
265
+ case 4:
266
+ if (onGetHelpArticle) {
267
+ _context.next = 6;
265
268
  break;
266
- case 4:
267
- if (onGetHelpArticle) {
268
- _context.next = 6;
269
- break;
270
- }
271
- throw new Error('onGetHelpArticle prop not defined');
272
- case 6:
273
- _context.next = 8;
274
- return onGetHelpArticle({
275
- id: historyItem.id,
276
- type: historyItem.type
277
- });
278
- case 8:
279
- article = _context.sent;
280
- return _context.abrupt("break", 20);
281
- case 10:
282
- if (onGetWhatsNewArticle) {
283
- _context.next = 12;
284
- break;
285
- }
286
- throw new Error('onGetWhatsNewArticle prop not defined');
287
- case 12:
288
- if (!(historyItem.id === '')) {
289
- _context.next = 14;
290
- break;
291
- }
292
- return _context.abrupt("break", 20);
293
- case 14:
294
- _context.next = 16;
295
- return onGetWhatsNewArticle({
296
- id: historyItem.id,
297
- type: historyItem.type
298
- });
299
- case 16:
300
- article = _context.sent;
301
- return _context.abrupt("break", 20);
302
- case 18:
303
- throw new Error('onGetHelpArticle prop not defined');
304
- case 20:
305
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, historyItem), article && {
306
- article: article
307
- }), {}, {
308
- state: REQUEST_STATE.done
309
- }));
310
- case 23:
311
- _context.prev = 23;
312
- _context.t1 = _context["catch"](0);
313
- return _context.abrupt("return", _objectSpread(_objectSpread({}, historyItem), {}, {
314
- state: REQUEST_STATE.error
315
- }));
316
- case 26:
317
- case "end":
318
- return _context.stop();
319
- }
269
+ }
270
+ throw new Error('onGetHelpArticle prop not defined');
271
+ case 6:
272
+ _context.next = 8;
273
+ return onGetHelpArticle({
274
+ id: historyItem.id,
275
+ type: historyItem.type
276
+ });
277
+ case 8:
278
+ article = _context.sent;
279
+ return _context.abrupt("break", 20);
280
+ case 10:
281
+ if (onGetWhatsNewArticle) {
282
+ _context.next = 12;
283
+ break;
284
+ }
285
+ throw new Error('onGetWhatsNewArticle prop not defined');
286
+ case 12:
287
+ if (!(historyItem.id === '')) {
288
+ _context.next = 14;
289
+ break;
290
+ }
291
+ return _context.abrupt("break", 20);
292
+ case 14:
293
+ _context.next = 16;
294
+ return onGetWhatsNewArticle({
295
+ id: historyItem.id,
296
+ type: historyItem.type
297
+ });
298
+ case 16:
299
+ article = _context.sent;
300
+ return _context.abrupt("break", 20);
301
+ case 18:
302
+ throw new Error('onGetHelpArticle prop not defined');
303
+ case 20:
304
+ return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, historyItem), article && {
305
+ article: article
306
+ }), {}, {
307
+ state: REQUEST_STATE.done
308
+ }));
309
+ case 23:
310
+ _context.prev = 23;
311
+ _context.t1 = _context["catch"](0);
312
+ return _context.abrupt("return", _objectSpread(_objectSpread({}, historyItem), {}, {
313
+ state: REQUEST_STATE.error
314
+ }));
315
+ case 26:
316
+ case "end":
317
+ return _context.stop();
320
318
  }
321
319
  }, _callee, null, [[0, 23]]);
322
320
  }));
@@ -328,23 +326,21 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
328
326
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(historyItem) {
329
327
  var historyItemToReload;
330
328
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
331
- while (1) {
332
- switch (_context2.prev = _context2.next) {
333
- case 0:
334
- historyItemToReload = _objectSpread({}, historyItem);
335
- if (historyItem.type === ARTICLE_TYPE.HELP_ARTICLE || historyItem.type === ARTICLE_TYPE.WHATS_NEW) {
336
- historyItemToReload.state = REQUEST_STATE.loading;
337
- } else {
338
- historyItemToReload.state = REQUEST_STATE.error;
339
- }
340
- dispatchNavigationAction({
341
- type: 'updateHistoryItem',
342
- payload: historyItemToReload
343
- });
344
- case 3:
345
- case "end":
346
- return _context2.stop();
347
- }
329
+ while (1) switch (_context2.prev = _context2.next) {
330
+ case 0:
331
+ historyItemToReload = _objectSpread({}, historyItem);
332
+ if (historyItem.type === ARTICLE_TYPE.HELP_ARTICLE || historyItem.type === ARTICLE_TYPE.WHATS_NEW) {
333
+ historyItemToReload.state = REQUEST_STATE.loading;
334
+ } else {
335
+ historyItemToReload.state = REQUEST_STATE.error;
336
+ }
337
+ dispatchNavigationAction({
338
+ type: 'updateHistoryItem',
339
+ payload: historyItemToReload
340
+ });
341
+ case 3:
342
+ case "end":
343
+ return _context2.stop();
348
344
  }
349
345
  }, _callee2);
350
346
  }));
@@ -354,45 +350,43 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
354
350
  }(), []);
355
351
  var navigateBack = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
356
352
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
357
- while (1) {
358
- switch (_context3.prev = _context3.next) {
359
- case 0:
360
- if (!(currentView === VIEW.SEARCH && onSearch)) {
361
- _context3.next = 8;
362
- break;
363
- }
364
- if (!(searchValue !== '')) {
365
- _context3.next = 6;
366
- break;
367
- }
368
- onSearch('');
369
- return _context3.abrupt("return");
370
- case 6:
371
- dispatchNavigationAction({
372
- type: 'updateView',
373
- payload: currentArticleId.type
374
- });
375
- return _context3.abrupt("return");
376
- case 8:
377
- // if the history is not empty and ...
378
- if (currentHistory.length > 0) {
379
- // the history has more than one article, navigate back through the history
380
- if (currentHistory.length > 1) {
381
- // Remove last element
382
- dispatchNavigationAction({
383
- type: 'removeLastHistoryItem'
384
- });
385
- } else if (currentHistory.length === 1) {
386
- // but if the history only has one item, clear the history
387
- dispatchNavigationAction({
388
- type: 'removeAllHistoryItems'
389
- });
390
- }
353
+ while (1) switch (_context3.prev = _context3.next) {
354
+ case 0:
355
+ if (!(currentView === VIEW.SEARCH && onSearch)) {
356
+ _context3.next = 8;
357
+ break;
358
+ }
359
+ if (!(searchValue !== '')) {
360
+ _context3.next = 6;
361
+ break;
362
+ }
363
+ onSearch('');
364
+ return _context3.abrupt("return");
365
+ case 6:
366
+ dispatchNavigationAction({
367
+ type: 'updateView',
368
+ payload: currentArticleId.type
369
+ });
370
+ return _context3.abrupt("return");
371
+ case 8:
372
+ // if the history is not empty and ...
373
+ if (currentHistory.length > 0) {
374
+ // the history has more than one article, navigate back through the history
375
+ if (currentHistory.length > 1) {
376
+ // Remove last element
377
+ dispatchNavigationAction({
378
+ type: 'removeLastHistoryItem'
379
+ });
380
+ } else if (currentHistory.length === 1) {
381
+ // but if the history only has one item, clear the history
382
+ dispatchNavigationAction({
383
+ type: 'removeAllHistoryItems'
384
+ });
391
385
  }
392
- case 9:
393
- case "end":
394
- return _context3.stop();
395
- }
386
+ }
387
+ case 9:
388
+ case "end":
389
+ return _context3.stop();
396
390
  }
397
391
  }, _callee3);
398
392
  })), [currentView, onSearch, currentHistory.length, searchValue, currentArticleId.type]);
@@ -475,21 +469,19 @@ export var NavigationContextProvider = function NavigationContextProvider(_ref4)
475
469
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(historyItem) {
476
470
  var historyItemUpdate;
477
471
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
478
- while (1) {
479
- switch (_context4.prev = _context4.next) {
480
- case 0:
481
- _context4.next = 2;
482
- return fetchArticleData(historyItem);
483
- case 2:
484
- historyItemUpdate = _context4.sent;
485
- dispatchNavigationAction({
486
- type: 'updateHistoryItem',
487
- payload: historyItemUpdate
488
- });
489
- case 4:
490
- case "end":
491
- return _context4.stop();
492
- }
472
+ while (1) switch (_context4.prev = _context4.next) {
473
+ case 0:
474
+ _context4.next = 2;
475
+ return fetchArticleData(historyItem);
476
+ case 2:
477
+ historyItemUpdate = _context4.sent;
478
+ dispatchNavigationAction({
479
+ type: 'updateHistoryItem',
480
+ payload: historyItemUpdate
481
+ });
482
+ case 4:
483
+ case "end":
484
+ return _context4.stop();
493
485
  }
494
486
  }, _callee4);
495
487
  }));
@@ -41,37 +41,35 @@ export var SearchContextProvider = function SearchContextProvider(_ref) {
41
41
  results,
42
42
  _args = arguments;
43
43
  return _regeneratorRuntime.wrap(function _callee$(_context) {
44
- while (1) {
45
- switch (_context.prev = _context.next) {
46
- case 0:
47
- value = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
48
- if (!onSearch) {
49
- _context.next = 16;
50
- break;
51
- }
52
- _context.prev = 2;
53
- _context.next = 5;
54
- return onSearch(value);
55
- case 5:
56
- results = _context.sent;
57
- setSearchResult(results);
58
- setSearchState(REQUEST_STATE.done);
59
- _context.next = 14;
44
+ while (1) switch (_context.prev = _context.next) {
45
+ case 0:
46
+ value = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
47
+ if (!onSearch) {
48
+ _context.next = 16;
60
49
  break;
61
- case 10:
62
- _context.prev = 10;
63
- _context.t0 = _context["catch"](2);
64
- setSearchResult([]);
65
- setSearchState(REQUEST_STATE.error);
66
- case 14:
67
- _context.next = 17;
68
- break;
69
- case 16:
70
- setSearchState(REQUEST_STATE.error);
71
- case 17:
72
- case "end":
73
- return _context.stop();
74
- }
50
+ }
51
+ _context.prev = 2;
52
+ _context.next = 5;
53
+ return onSearch(value);
54
+ case 5:
55
+ results = _context.sent;
56
+ setSearchResult(results);
57
+ setSearchState(REQUEST_STATE.done);
58
+ _context.next = 14;
59
+ break;
60
+ case 10:
61
+ _context.prev = 10;
62
+ _context.t0 = _context["catch"](2);
63
+ setSearchResult([]);
64
+ setSearchState(REQUEST_STATE.error);
65
+ case 14:
66
+ _context.next = 17;
67
+ break;
68
+ case 16:
69
+ setSearchState(REQUEST_STATE.error);
70
+ case 17:
71
+ case "end":
72
+ return _context.stop();
75
73
  }
76
74
  }, _callee, null, [[2, 10]]);
77
75
  })), [onSearch]);