@atlaskit/help 6.0.8 → 7.1.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 (95) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/assets/ErrorImage.js +1 -1
  3. package/dist/cjs/assets/NotFoundImage.js +1 -1
  4. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +3 -1
  5. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/styled.js +3 -1
  6. package/dist/cjs/components/Article/HelpArticle/index.js +6 -8
  7. package/dist/cjs/components/Article/WhatsNewArticle/styled.js +5 -3
  8. package/dist/cjs/components/Article/index.js +2 -2
  9. package/dist/cjs/components/Article/styled.js +3 -1
  10. package/dist/cjs/components/ArticlesList/ArticlesList.js +4 -2
  11. package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +4 -2
  12. package/dist/cjs/components/ArticlesList/ArticlesListItem/styled.js +10 -7
  13. package/dist/cjs/components/Help.js +3 -1
  14. package/dist/cjs/components/HelpContentButton/styled.js +3 -1
  15. package/dist/cjs/components/RelatedArticles/styled.js +3 -1
  16. package/dist/cjs/components/Search/SearchResults/SearchExternalSite.js +4 -2
  17. package/dist/cjs/components/Search/SearchResults/SearchResultsEmpty.js +4 -2
  18. package/dist/cjs/components/Search/SearchResults/index.js +8 -11
  19. package/dist/cjs/components/Search/SearchResults/styled.js +5 -3
  20. package/dist/cjs/components/WhatsNew/WhatsNewButton/index.js +9 -9
  21. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +3 -1
  22. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +3 -1
  23. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +8 -5
  24. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +3 -1
  25. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +6 -8
  26. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +3 -1
  27. package/dist/cjs/components/WhatsNew/WhatsNewResults/index.js +33 -6
  28. package/dist/cjs/components/WhatsNew/WhatsNewResults/styled.js +3 -1
  29. package/dist/cjs/components/contexts/navigationContext.js +111 -50
  30. package/dist/cjs/util/styled.js +11 -9
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/assets/ErrorImage.js +1 -1
  33. package/dist/es2019/assets/NotFoundImage.js +1 -1
  34. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +2 -1
  35. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/styled.js +2 -1
  36. package/dist/es2019/components/Article/HelpArticle/index.js +6 -8
  37. package/dist/es2019/components/Article/WhatsNewArticle/styled.js +4 -3
  38. package/dist/es2019/components/Article/styled.js +2 -1
  39. package/dist/es2019/components/ArticlesList/ArticlesList.js +3 -2
  40. package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +3 -2
  41. package/dist/es2019/components/ArticlesList/ArticlesListItem/styled.js +9 -7
  42. package/dist/es2019/components/HelpContentButton/styled.js +6 -5
  43. package/dist/es2019/components/RelatedArticles/styled.js +2 -1
  44. package/dist/es2019/components/Search/SearchResults/SearchExternalSite.js +3 -2
  45. package/dist/es2019/components/Search/SearchResults/SearchResultsEmpty.js +3 -2
  46. package/dist/es2019/components/Search/SearchResults/index.js +6 -9
  47. package/dist/es2019/components/Search/SearchResults/styled.js +4 -3
  48. package/dist/es2019/components/WhatsNew/WhatsNewButton/index.js +8 -9
  49. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +2 -1
  50. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +2 -1
  51. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +7 -5
  52. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -1
  53. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +6 -8
  54. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +2 -1
  55. package/dist/es2019/components/WhatsNew/WhatsNewResults/index.js +31 -5
  56. package/dist/es2019/components/WhatsNew/WhatsNewResults/styled.js +2 -1
  57. package/dist/es2019/components/contexts/navigationContext.js +99 -39
  58. package/dist/es2019/util/styled.js +16 -15
  59. package/dist/es2019/version.json +1 -1
  60. package/dist/esm/assets/ErrorImage.js +1 -1
  61. package/dist/esm/assets/NotFoundImage.js +1 -1
  62. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +2 -1
  63. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/styled.js +2 -1
  64. package/dist/esm/components/Article/HelpArticle/index.js +6 -8
  65. package/dist/esm/components/Article/WhatsNewArticle/styled.js +4 -3
  66. package/dist/esm/components/Article/index.js +2 -2
  67. package/dist/esm/components/Article/styled.js +2 -1
  68. package/dist/esm/components/ArticlesList/ArticlesList.js +3 -2
  69. package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +3 -2
  70. package/dist/esm/components/ArticlesList/ArticlesListItem/styled.js +9 -7
  71. package/dist/esm/components/Help.js +2 -1
  72. package/dist/esm/components/HelpContentButton/styled.js +2 -1
  73. package/dist/esm/components/RelatedArticles/styled.js +2 -1
  74. package/dist/esm/components/Search/SearchResults/SearchExternalSite.js +3 -2
  75. package/dist/esm/components/Search/SearchResults/SearchResultsEmpty.js +3 -2
  76. package/dist/esm/components/Search/SearchResults/index.js +8 -11
  77. package/dist/esm/components/Search/SearchResults/styled.js +4 -3
  78. package/dist/esm/components/WhatsNew/WhatsNewButton/index.js +8 -9
  79. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +2 -1
  80. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +2 -1
  81. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +7 -5
  82. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -1
  83. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +6 -8
  84. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +2 -1
  85. package/dist/esm/components/WhatsNew/WhatsNewResults/index.js +33 -7
  86. package/dist/esm/components/WhatsNew/WhatsNewResults/styled.js +2 -1
  87. package/dist/esm/components/contexts/navigationContext.js +108 -50
  88. package/dist/esm/util/styled.js +10 -9
  89. package/dist/esm/version.json +1 -1
  90. package/dist/types/assets/ErrorImage.d.ts +1 -1
  91. package/dist/types/assets/NotFoundImage.d.ts +1 -1
  92. package/dist/types/components/RelatedArticles/styled.d.ts +1 -1
  93. package/dist/types/components/contexts/navigationContext.d.ts +12 -7
  94. package/dist/types/model/Help.d.ts +8 -4
  95. package/package.json +10 -4
@@ -17,6 +17,8 @@ var _constants = require("@atlaskit/theme/constants");
17
17
 
18
18
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _templateObject, _templateObject2;
21
23
 
22
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -27,6 +29,6 @@ var SearchResultEmptyMessageImage = _styled.default.div(_templateObject || (_tem
27
29
 
28
30
  exports.SearchResultEmptyMessageImage = SearchResultEmptyMessageImage;
29
31
 
30
- var SearchResultEmptyMessageText = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px 0 ", "px;\n text-align: center;\n\n p {\n color: ", ";\n }\n"])), 3 * (0, _constants.gridSize)(), 3 * (0, _constants.gridSize)(), 3 * (0, _constants.gridSize)(), colors.N200);
32
+ var SearchResultEmptyMessageText = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px 0 ", "px;\n text-align: center;\n\n p {\n color: ", ";\n }\n"])), 3 * (0, _constants.gridSize)(), 3 * (0, _constants.gridSize)(), 3 * (0, _constants.gridSize)(), (0, _tokens.token)('color.text.subtlest', colors.N200));
31
33
 
32
34
  exports.SearchResultEmptyMessageText = SearchResultEmptyMessageText;
@@ -17,6 +17,8 @@ var _constants = require("@atlaskit/theme/constants");
17
17
 
18
18
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _templateObject, _templateObject2, _templateObject3;
21
23
 
22
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -30,7 +32,8 @@ var WhatsNewResultListItemWrapper = _styled.default.a({
30
32
  display: "block",
31
33
  textDecoration: "none",
32
34
  cursor: "pointer",
33
- color: "".concat(colors.N200),
35
+ color: "".concat((0, _tokens.token)('color.text.subtlest', colors.N200)),
36
+ backgroundColor: "".concat((0, _tokens.token)('color.background.neutral.subtle', colors.N0)),
34
37
  borderRadius: "3px",
35
38
  '&:hover, &:focus, &:visited, &:active': {
36
39
  textDecoration: "none",
@@ -38,13 +41,13 @@ var WhatsNewResultListItemWrapper = _styled.default.a({
38
41
  outlineOffset: "none"
39
42
  },
40
43
  '&:focus': {
41
- boxShadow: "".concat(colors.B100, " 0px 0px 0px 2px inset")
44
+ boxShadow: "".concat((0, _tokens.token)('color.border.focused', colors.B100), " 0px 0px 0px 2px inset")
42
45
  },
43
46
  '&:hover': {
44
- backgroundColor: "".concat(colors.N30)
47
+ backgroundColor: "".concat((0, _tokens.token)('color.background.neutral.subtle.hovered', colors.N30))
45
48
  },
46
49
  '&:active': {
47
- backgroundColor: "".concat(colors.B50)
50
+ backgroundColor: "".concat((0, _tokens.token)('color.background.neutral.subtle.pressed', colors.B50))
48
51
  }
49
52
  }, function (props) {
50
53
  return props.styles;
@@ -60,6 +63,6 @@ var WhatsNewResultListItemTitleText = _styled.default.span(_templateObject2 || (
60
63
 
61
64
  exports.WhatsNewResultListItemTitleText = WhatsNewResultListItemTitleText;
62
65
 
63
- var WhatsNewResultListItemDescription = _styled.default.p(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n line-height: ", "px;\n color: ", ";\n margin: 0;\n"])), (0, _constants.gridSize)() * 2.5, colors.N800);
66
+ var WhatsNewResultListItemDescription = _styled.default.p(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n line-height: ", "px;\n color: ", ";\n margin: 0;\n"])), (0, _constants.gridSize)() * 2.5, (0, _tokens.token)('color.text', colors.N800));
64
67
 
65
68
  exports.WhatsNewResultListItemDescription = WhatsNewResultListItemDescription;
@@ -17,6 +17,8 @@ var _constants = require("@atlaskit/theme/constants");
17
17
 
18
18
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _toDate = _interopRequireDefault(require("date-fns/toDate"));
21
23
 
22
24
  var _isYesterday = _interopRequireDefault(require("date-fns/isYesterday"));
@@ -72,7 +74,7 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
72
74
  }, /*#__PURE__*/_react.default.createElement(_styled.WhatsNewResultsListGroupTitle, null, whatsNewArticlesGroupedByDate[key].title), whatsNewArticlesGroupedByDate[key].items.map(function (whatsNewArticle, i) {
73
75
  return /*#__PURE__*/_react.default.createElement(_WhatsNewResultItem.default, {
74
76
  styles: {
75
- border: style === 'secondary' ? "2px solid ".concat(colors.N30) : 0,
77
+ border: style === 'secondary' ? "2px solid ".concat((0, _tokens.token)('color.border', colors.N30)) : 0,
76
78
  padding: style === 'secondary' ? "".concat((0, _constants.gridSize)(), "px ").concat((0, _constants.gridSize)() * 2, "px") : "".concat((0, _constants.gridSize)(), "px"),
77
79
  marginBottom: style === 'secondary' ? "".concat((0, _constants.gridSize)() * 1.5, "px") : 0
78
80
  },
@@ -57,7 +57,7 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
57
57
  onShowMoreButtonClick = _ref.onShowMoreButtonClick;
58
58
 
59
59
  var _useNavigationContext = (0, _navigationContext.useNavigationContext)(),
60
- setArticleId = _useNavigationContext.setArticleId;
60
+ openArticle = _useNavigationContext.openArticle;
61
61
 
62
62
  var handleShowMoreButtonClick = function handleShowMoreButtonClick(event, analyticsEvent) {
63
63
  if (onShowMoreButtonClick) {
@@ -66,17 +66,15 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
66
66
  };
67
67
 
68
68
  var handleOnWhatsNewResultItemClick = (0, _react.useCallback)(function (event, analyticsEvent, articleData) {
69
- if (setArticleId) {
70
- setArticleId({
71
- id: articleData.id,
72
- type: _Help.ARTICLE_TYPE.WHATS_NEW
73
- });
74
- }
69
+ openArticle({
70
+ id: articleData.id,
71
+ type: _Help.ARTICLE_TYPE.WHATS_NEW
72
+ });
75
73
 
76
74
  if (onWhatsNewResultItemClick) {
77
75
  onWhatsNewResultItemClick(event, analyticsEvent, articleData);
78
76
  }
79
- }, [onWhatsNewResultItemClick, setArticleId]);
77
+ }, [onWhatsNewResultItemClick, openArticle]);
80
78
  return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/_react.default.createElement(_styled.WhatsNewResultsListContainer, null, /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
81
79
  theme: (0, _defineProperty2.default)({}, _item.itemThemeNamespace, ITEM_THEME)
82
80
  }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WhatsNewResultsList.default, {
@@ -17,6 +17,8 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
17
17
 
18
18
  var _constants = require("@atlaskit/theme/constants");
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
21
23
 
22
24
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
@@ -40,7 +42,7 @@ var WhatsNewResultsListGroupWrapper = _styled.default.div(_templateObject3 || (_
40
42
 
41
43
  exports.WhatsNewResultsListGroupWrapper = WhatsNewResultsListGroupWrapper;
42
44
 
43
- var WhatsNewResultsListGroupTitle = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: ", "px;\n font-weight: bold;\n padding: 0 ", "px ", "px ", "px;\n text-transform: uppercase;\n"])), colors.N200, (0, _constants.fontSizeSmall)(), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _constants.gridSize)());
45
+ var WhatsNewResultsListGroupTitle = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: ", "px;\n font-weight: bold;\n padding: 0 ", "px ", "px ", "px;\n text-transform: uppercase;\n"])), (0, _tokens.token)('color.text.subtlest', colors.N200), (0, _constants.fontSizeSmall)(), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _constants.gridSize)());
44
46
 
45
47
  exports.WhatsNewResultsListGroupTitle = WhatsNewResultsListGroupTitle;
46
48
 
@@ -17,6 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _reactTransitionGroup = require("react-transition-group");
19
19
 
20
+ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
21
+
20
22
  var _select = _interopRequireDefault(require("@atlaskit/select"));
21
23
 
22
24
  var _reactIntlNext = require("react-intl-next");
@@ -47,9 +49,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
47
49
 
48
50
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
49
51
 
50
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
52
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
51
53
 
52
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
54
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
53
55
 
54
56
  var defaultStyle = {
55
57
  transition: "opacity ".concat(_constants.FADEIN_OVERLAY_TRANSITION_DURATION_MS, "ms"),
@@ -87,12 +89,18 @@ var WhatsNewResults = function WhatsNewResults(_ref) {
87
89
  searchWhatsNewArticlesState = _useWhatsNewArticleCo.searchWhatsNewArticlesState,
88
90
  onWhatsNewResultItemClick = _useWhatsNewArticleCo.onWhatsNewResultItemClick;
89
91
 
92
+ var containerRef = (0, _react.useRef)(null);
93
+ var containerScrollPosition = (0, _react.useRef)(0);
90
94
  var SELECT_DEFAULT_VALUE = {
91
95
  value: '',
92
96
  label: formatMessage(_messages.messages.help_whats_new_filter_select_option_all)
93
97
  };
98
+ var SELECT_EMPTY_VALUE = {
99
+ value: undefined,
100
+ label: ''
101
+ };
94
102
 
95
- var _useState = (0, _react.useState)(SELECT_DEFAULT_VALUE),
103
+ var _useState = (0, _react.useState)(SELECT_EMPTY_VALUE),
96
104
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
97
105
  selectedOption = _useState2[0],
98
106
  setSelectedOption = _useState2[1];
@@ -109,8 +117,25 @@ var WhatsNewResults = function WhatsNewResults(_ref) {
109
117
  }, [onSearchWhatsNewArticles, searchWhatsNewArticlesResult, selectedOption]);
110
118
 
111
119
  var handleOnEnter = function handleOnEnter() {
112
- setSelectedOption(SELECT_DEFAULT_VALUE);
113
- onSearchWhatsNewArticles && onSearchWhatsNewArticles();
120
+ setTimeout(function () {
121
+ if (containerRef.current) {
122
+ containerRef.current.scrollTop = containerScrollPosition.current;
123
+ }
124
+ }, 0);
125
+
126
+ if ((0, _isEqual.default)(selectedOption, SELECT_EMPTY_VALUE)) {
127
+ setSelectedOption(SELECT_DEFAULT_VALUE);
128
+ onSearchWhatsNewArticles && onSearchWhatsNewArticles();
129
+ }
130
+ };
131
+
132
+ var handleOnExit = function handleOnExit() {
133
+ if (helpContextView === _constants.VIEW.DEFAULT_CONTENT) {
134
+ setSelectedOption(SELECT_EMPTY_VALUE);
135
+ containerScrollPosition.current = 0;
136
+ } else {
137
+ containerScrollPosition.current = containerRef.current ? containerRef.current.scrollTop : 0;
138
+ }
114
139
  };
115
140
 
116
141
  var handleOnClearFilter = function handleOnClearFilter() {
@@ -126,9 +151,11 @@ var WhatsNewResults = function WhatsNewResults(_ref) {
126
151
  return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
127
152
  in: helpContextView === _constants.VIEW.WHATS_NEW,
128
153
  timeout: _constants.FADEIN_OVERLAY_TRANSITION_DURATION_MS,
129
- onEnter: handleOnEnter
154
+ onEnter: handleOnEnter,
155
+ onExit: handleOnExit
130
156
  }, function (state) {
131
157
  return /*#__PURE__*/_react.default.createElement(_styled.WhatsNewResultsContainer, {
158
+ ref: containerRef,
132
159
  style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
133
160
  }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, searchWhatsNewArticlesState === _Requests.REQUEST_STATE.loading && searchWhatsNewArticlesResult === null && state !== 'exited' && /*#__PURE__*/_react.default.createElement(_WhatsNewResultsLoading.default, null), (searchWhatsNewArticlesState === _Requests.REQUEST_STATE.done || searchWhatsNewArticlesState === _Requests.REQUEST_STATE.loading) && searchWhatsNewArticlesResult !== null && state !== 'exited' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styled.SelectContainer, null, /*#__PURE__*/_react.default.createElement(_select.default, {
134
161
  defaultValue: selectedOption,
@@ -13,9 +13,11 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
13
13
 
14
14
  var _constants = require("@atlaskit/theme/constants");
15
15
 
16
+ var _tokens = require("@atlaskit/tokens");
17
+
16
18
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
17
19
 
18
- var WhatsNewResultsContainer = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n background-color: #ffffff;\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"])), 2 * (0, _constants.gridSize)());
20
+ var WhatsNewResultsContainer = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _tokens.token)('elevation.surface', '#FFFFFF'), 2 * (0, _constants.gridSize)());
19
21
 
20
22
  exports.WhatsNewResultsContainer = WhatsNewResultsContainer;
21
23
 
@@ -23,6 +23,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
23
23
 
24
24
  var _react = _interopRequireWildcard(require("react"));
25
25
 
26
+ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
27
+
26
28
  var _Requests = require("../../model/Requests");
27
29
 
28
30
  var _Help = require("../../model/Help");
@@ -41,13 +43,21 @@ var _searchContext = require("./searchContext");
41
43
 
42
44
  var _headerContext = require("./headerContext");
43
45
 
46
+ var _excluded = ["body", "relatedArticles"],
47
+ _excluded2 = ["description"];
48
+
44
49
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
45
50
 
46
51
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
47
52
 
48
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
53
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
49
54
 
50
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
55
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
56
+
57
+ var DEFAULT_ARTICLE_ID = {
58
+ id: '',
59
+ type: _Help.ARTICLE_TYPE.HELP_ARTICLE
60
+ };
51
61
 
52
62
  var _createCtx = (0, _ctx.createCtx)(),
53
63
  _createCtx2 = (0, _slicedToArray2.default)(_createCtx, 2),
@@ -86,6 +96,21 @@ var getSimpleHistory = function getSimpleHistory(history) {
86
96
  };
87
97
  });
88
98
  };
99
+ /**
100
+ * Get history data (list of IDs and UID)
101
+ */
102
+
103
+
104
+ var getHistoryData = function getHistoryData(history) {
105
+ return history.map(function (historyItem) {
106
+ var id = historyItem.id,
107
+ uid = historyItem.uid;
108
+ return {
109
+ id: id,
110
+ uid: uid
111
+ };
112
+ });
113
+ };
89
114
  /**
90
115
  * Get the last article in the history
91
116
  */
@@ -109,13 +134,13 @@ var getCurrentArticleItemSlim = function getCurrentArticleItemSlim(history) {
109
134
  var _ref = article,
110
135
  body = _ref.body,
111
136
  relatedArticles = _ref.relatedArticles,
112
- articleItemData = (0, _objectWithoutProperties2.default)(_ref, ["body", "relatedArticles"]);
137
+ articleItemData = (0, _objectWithoutProperties2.default)(_ref, _excluded);
113
138
  var currentArticleSlimData = articleItemData;
114
139
  return currentArticleSlimData;
115
140
  } else if (type === _Help.ARTICLE_TYPE.WHATS_NEW) {
116
141
  var _ref2 = article,
117
142
  description = _ref2.description,
118
- whatsNewArticleItemData = (0, _objectWithoutProperties2.default)(_ref2, ["description"]);
143
+ whatsNewArticleItemData = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
119
144
  var currentWhatsNewArticleSlimData = whatsNewArticleItemData;
120
145
  return currentWhatsNewArticleSlimData;
121
146
  }
@@ -154,10 +179,26 @@ var navigationReducer = function navigationReducer(_ref3, action) {
154
179
 
155
180
  if (action.type === 'newArticle' && action.payload) {
156
181
  var newArticleId = action.payload;
182
+
183
+ if ((0, _isEqual.default)(newArticleId, DEFAULT_ARTICLE_ID)) {
184
+ newState = {
185
+ articleId: newArticleId,
186
+ history: [],
187
+ view: _constants.VIEW.DEFAULT_CONTENT
188
+ };
189
+ } else {
190
+ newState = {
191
+ articleId: newArticleId,
192
+ history: [].concat((0, _toConsumableArray2.default)(currentHistory), [getNewHistoryItem(newArticleId.id, newArticleId.type)]),
193
+ view: getViewForArticleId(newArticleId)
194
+ };
195
+ }
196
+ } else if (action.type === 'addNewHistoryItem' && action.payload) {
197
+ var _newArticleId = action.payload;
157
198
  newState = {
158
- articleId: newArticleId,
159
- history: [].concat((0, _toConsumableArray2.default)(currentHistory), [getNewHistoryItem(newArticleId.id, newArticleId.type)]),
160
- view: getViewForArticleId(newArticleId)
199
+ articleId: currentArticleId,
200
+ history: [].concat((0, _toConsumableArray2.default)(currentHistory), [getNewHistoryItem(_newArticleId.id, _newArticleId.type)]),
201
+ view: getViewForArticleId(currentArticleId)
161
202
  };
162
203
  } else if (action.type === 'updateHistoryItem' && action.payload) {
163
204
  var HistoryItemUpdate = action.payload;
@@ -194,11 +235,11 @@ var navigationReducer = function navigationReducer(_ref3, action) {
194
235
  view: _constants.VIEW.DEFAULT_CONTENT
195
236
  };
196
237
  } else if (action.type === 'updateArticleId' && action.payload) {
197
- var _newArticleId = action.payload;
238
+ var _newArticleId2 = action.payload;
198
239
  newState = {
199
- articleId: _newArticleId,
240
+ articleId: _newArticleId2,
200
241
  history: currentHistory,
201
- view: getViewForArticleId(_newArticleId)
242
+ view: getViewForArticleId(_newArticleId2)
202
243
  };
203
244
  } else if (action.type === 'updateView' && action.payload) {
204
245
  var newView = action.payload;
@@ -213,15 +254,12 @@ var navigationReducer = function navigationReducer(_ref3, action) {
213
254
  };
214
255
 
215
256
  var NavigationContextProvider = function NavigationContextProvider(_ref4) {
216
- var _ref4$articleId = _ref4.articleId,
217
- propsArticleId = _ref4$articleId === void 0 ? {
218
- id: '',
219
- type: _Help.ARTICLE_TYPE.HELP_ARTICLE
220
- } : _ref4$articleId,
221
- articleIdSetter = _ref4.articleIdSetter,
222
- _ref4$history = _ref4.history,
223
- propsHistory = _ref4$history === void 0 ? [] : _ref4$history,
224
- historySetter = _ref4.historySetter,
257
+ var _ref4$navigationData = _ref4.navigationData,
258
+ navigationData = _ref4$navigationData === void 0 ? {
259
+ articleId: DEFAULT_ARTICLE_ID,
260
+ history: []
261
+ } : _ref4$navigationData,
262
+ setNavigationData = _ref4.setNavigationData,
225
263
  children = _ref4.children;
226
264
 
227
265
  var _useHelpArticleContex = (0, _helpArticleContext.useHelpArticleContext)(),
@@ -242,9 +280,12 @@ var NavigationContextProvider = function NavigationContextProvider(_ref4) {
242
280
  var _useHeaderContext = (0, _headerContext.useHeaderContext)(),
243
281
  onCloseButtonClick = _useHeaderContext.onCloseButtonClick;
244
282
 
283
+ var propsArticleId = navigationData.articleId,
284
+ propsHistory = navigationData.history;
285
+
245
286
  var _useReducer = (0, _react.useReducer)(navigationReducer, {
246
287
  articleId: propsArticleId,
247
- history: propsHistory,
288
+ history: !(0, _isEqual.default)(propsArticleId, DEFAULT_ARTICLE_ID) && propsHistory.length === 0 ? [getNewHistoryItem(propsArticleId.id, propsArticleId.type)] : propsHistory,
248
289
  view: _constants.VIEW.DEFAULT_CONTENT
249
290
  }),
250
291
  _useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
@@ -264,8 +305,6 @@ var NavigationContextProvider = function NavigationContextProvider(_ref4) {
264
305
  /**
265
306
  * - If default content isn't defined and the history only has one article,
266
307
  * we should not display the back button
267
- * - If the prop.article.setArticleId is not defined, we should also hide the back
268
- * button because we are not able to navigate though the history without it
269
308
  */
270
309
  if (currentHistory.length === 1 && !isDefaultContentDefined || currentView === _constants.VIEW.WHATS_NEW && !isDefaultContentDefined) {
271
310
  return false;
@@ -453,6 +492,12 @@ var NavigationContextProvider = function NavigationContextProvider(_ref4) {
453
492
  onCloseButtonClick(event, analyticsEvent);
454
493
  }
455
494
  }, [onCloseButtonClick]);
495
+ var onOpenArticle = (0, _react.useCallback)(function (newArticleId) {
496
+ dispatchNavigationAction({
497
+ type: 'addNewHistoryItem',
498
+ payload: newArticleId
499
+ });
500
+ }, []);
456
501
  (0, _react.useEffect)(function () {
457
502
  if (isSearchResultVisible) {
458
503
  dispatchNavigationAction({
@@ -462,43 +507,59 @@ var NavigationContextProvider = function NavigationContextProvider(_ref4) {
462
507
  }
463
508
  }, [isSearchResultVisible]);
464
509
  (0, _react.useEffect)(function () {
465
- var simpleHistory = getSimpleHistory(currentHistory);
466
- historySetter && historySetter(simpleHistory);
467
- }, [historySetter, currentHistory]);
468
- (0, _react.useEffect)(function () {
510
+ var lastHistoryItem = currentHistory.length > 0 ? _getCurrentArticle2(currentHistory) : getNewHistoryItem(DEFAULT_ARTICLE_ID.id, DEFAULT_ARTICLE_ID.type);
469
511
  /**
470
512
  * If the propsArticleId.id (host articleId) is different from currentArticleId.id (internal articleId)
471
- * it means the host updated propsArticleId and we need to use this new value to load a new article.
472
513
  * */
473
- if ((propsArticleId === null || propsArticleId === void 0 ? void 0 : propsArticleId.id) !== currentArticleId.id || (propsArticleId === null || propsArticleId === void 0 ? void 0 : propsArticleId.type) !== currentArticleId.type) {
474
- dispatchNavigationAction({
475
- type: 'newArticle',
476
- payload: propsArticleId
477
- });
478
- } else {
514
+
515
+ if (!(0, _isEqual.default)(propsArticleId, currentArticleId)) {
479
516
  /**
480
- * If the propsArticleId.id (host articleId) is equal to currentArticleId.id (internal articleId)
481
- * and the id from the last history item is different from currentArticleId.id, it means the history
482
- * changed and we need to update the host articleId (propsArticleId) using 'articleIdSetter' and the local
483
- * history using the dispatchNavigationAction reducer
484
- * */
485
- var lastHistoryItem = currentHistory.length > 0 ? _getCurrentArticle2(currentHistory) : getNewHistoryItem('', _Help.ARTICLE_TYPE.HELP_ARTICLE);
486
-
487
- if (articleIdSetter && lastHistoryItem && (currentArticleId.id !== lastHistoryItem.id || currentArticleId.type !== lastHistoryItem.type)) {
517
+ * If propsArticleId and lastHistoryItem are the same, we just need to update the articleId
518
+ * because is out of sync
519
+ */
520
+ if (propsArticleId.id === lastHistoryItem.id && propsArticleId.type === lastHistoryItem.type) {
488
521
  dispatchNavigationAction({
489
522
  type: 'updateArticleId',
490
- payload: {
491
- id: lastHistoryItem.id,
492
- type: lastHistoryItem.type
493
- }
523
+ payload: propsArticleId
494
524
  });
495
- articleIdSetter({
496
- id: lastHistoryItem.id,
497
- type: lastHistoryItem.type
525
+ } else {
526
+ /**
527
+ * Otherwise we need to add a new article
528
+ */
529
+ dispatchNavigationAction({
530
+ type: 'newArticle',
531
+ payload: propsArticleId
498
532
  });
499
533
  }
534
+ } else {
535
+ // console.log('same articleId');
536
+ if (setNavigationData) {
537
+ var simpleHistory = getSimpleHistory(currentHistory);
538
+
539
+ if (currentArticleId.id !== lastHistoryItem.id || currentArticleId.type !== lastHistoryItem.type) {
540
+ /**
541
+ * If the propsArticleId.id (host articleId) is equal to currentArticleId.id (internal articleId)
542
+ * and the id from the last history item is different from currentArticleId.id, it means the history
543
+ * changed
544
+ * */
545
+ if (setNavigationData) {
546
+ setNavigationData({
547
+ articleId: {
548
+ id: lastHistoryItem.id,
549
+ type: lastHistoryItem.type
550
+ },
551
+ history: simpleHistory
552
+ });
553
+ }
554
+ } else if (!(0, _isEqual.default)(getHistoryData(propsHistory), getHistoryData(currentHistory))) {
555
+ setNavigationData({
556
+ articleId: propsArticleId,
557
+ history: simpleHistory
558
+ });
559
+ }
560
+ }
500
561
  }
501
- }, [currentArticleId, propsArticleId, currentHistory, articleIdSetter]);
562
+ }, [currentArticleId, propsArticleId, currentHistory, setNavigationData, propsHistory]);
502
563
  (0, _react.useEffect)(function () {
503
564
  var requestNewArticle = /*#__PURE__*/function () {
504
565
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(historyItem) {
@@ -544,7 +605,7 @@ var NavigationContextProvider = function NavigationContextProvider(_ref4) {
544
605
  value: {
545
606
  view: currentView,
546
607
  articleId: currentArticleId,
547
- setArticleId: articleIdSetter,
608
+ openArticle: onOpenArticle,
548
609
  history: currentHistory,
549
610
  getCurrentArticle: function getCurrentArticle() {
550
611
  return _getCurrentArticle2(currentHistory);
@@ -17,6 +17,8 @@ var _constants = require("@atlaskit/theme/constants");
17
17
 
18
18
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _core = require("@emotion/core");
21
23
 
22
24
  var _WhatsNew = require("../model/WhatsNew");
@@ -27,7 +29,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
29
 
28
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
31
 
30
- var DividerLine = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n height: 2px;\n width: 100%;\n padding: 0 ", "px;\n margin-top: ", "px;\n box-sizing: border-box;\n"])), colors.N30A, 2 * (0, _constants.gridSize)(), (0, _constants.gridSize)() * 2);
32
+ var DividerLine = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n height: 2px;\n width: 100%;\n padding: 0 ", "px;\n margin-top: ", "px;\n box-sizing: border-box;\n"])), (0, _tokens.token)('color.border', colors.N30A), 2 * (0, _constants.gridSize)(), (0, _constants.gridSize)() * 2);
31
33
  /**
32
34
  * Loading container
33
35
  */
@@ -42,7 +44,7 @@ var LoadingRectangle = _styled.default.div(_templateObject3 || (_templateObject3
42
44
  return props.marginTop ? props.marginTop : (0, _constants.gridSize)() + 'px';
43
45
  }, function (props) {
44
46
  return props.contentWidth ? props.contentWidth : '100%';
45
- }, shimmer, colors.N30, colors.N30, colors.N40, colors.N30);
47
+ }, shimmer, (0, _tokens.token)('color.background.neutral', colors.N30), (0, _tokens.token)('color.background.neutral.subtle', colors.N30), (0, _tokens.token)('color.background.neutral', colors.N40), (0, _tokens.token)('color.background.neutral.subtle', colors.N30));
46
48
  /**
47
49
  * Loading Circle
48
50
  */
@@ -56,7 +58,7 @@ var LoadingCircle = _styled.default.div(_templateObject4 || (_templateObject4 =
56
58
  return props.marginTop ? props.marginTop : '';
57
59
  }, function (props) {
58
60
  return props.radius ? props.radius : "".concat((0, _constants.gridSize)() * 4, "px");
59
- }, shimmer, colors.N30, colors.N30, colors.N40, colors.N30);
61
+ }, shimmer, (0, _tokens.token)('color.background.neutral', colors.N30), (0, _tokens.token)('color.background.neutral.subtle', colors.N30), (0, _tokens.token)('color.background.neutral', colors.N40), (0, _tokens.token)('color.background.neutral.subtle', colors.N30));
60
62
  /**
61
63
  * What's new icon
62
64
  */
@@ -69,22 +71,22 @@ var WhatsNewTypeIcon = _styled.default.div(_templateObject5 || (_templateObject5
69
71
 
70
72
  switch (type) {
71
73
  case _WhatsNew.WHATS_NEW_ITEM_TYPES.IMPROVEMENT:
72
- return colors.Y200;
74
+ return (0, _tokens.token)('color.icon.warning', colors.Y200);
73
75
 
74
76
  case _WhatsNew.WHATS_NEW_ITEM_TYPES.NEW_FEATURE:
75
- return colors.G300;
77
+ return (0, _tokens.token)('color.icon.success', colors.G300);
76
78
 
77
79
  case _WhatsNew.WHATS_NEW_ITEM_TYPES.FIX:
78
- return colors.B500;
80
+ return (0, _tokens.token)('color.icon.information', colors.B500);
79
81
 
80
82
  case _WhatsNew.WHATS_NEW_ITEM_TYPES.EXPERIMENT:
81
- return colors.P500;
83
+ return (0, _tokens.token)('color.icon.discovery', colors.P500);
82
84
 
83
85
  case _WhatsNew.WHATS_NEW_ITEM_TYPES.REMOVED:
84
- return colors.N700;
86
+ return (0, _tokens.token)('color.icon.disabled', colors.N700);
85
87
 
86
88
  default:
87
- return colors.N400;
89
+ return (0, _tokens.token)('color.icon', colors.N400);
88
90
  }
89
91
  }, (0, _constants.gridSize)() / 2, (0, _constants.gridSize)() / 2);
90
92
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/help",
3
- "version": "6.0.8",
3
+ "version": "7.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export const svg = `<?xml version="1.0" encoding="UTF-8"?>
3
3
  <svg width="90" height="116" viewBox="0 0 90 116" fill="none" xmlns="http://www.w3.org/2000/svg">
4
- <path d="M0 0H89.2308V116H0V0Z" fill="white"/>
4
+ <path d="M0 0H89.2308V116H0V0Z"/>
5
5
  <path fill-rule="evenodd" clip-rule="evenodd" d="M51.5691 40.9323L87.7184 103.605C89.1943 106.161 89.195 109.312 87.72 111.869C86.2451 114.426 83.519 116.001 80.5691 116H8.27039C5.3205 116.001 2.59431 114.426 1.11941 111.869C-0.355493 109.312 -0.354868 106.161 1.12105 103.605L37.2704 40.9323C38.7445 38.3748 41.47 36.7992 44.4197 36.7992C47.3695 36.7992 50.095 38.3748 51.5691 40.9323ZM47.4558 86.4337L49.0227 62.2806C49.113 60.9009 48.6284 59.5454 47.6841 58.5363C46.7399 57.5271 45.4202 56.9545 44.0389 56.9544C42.6575 56.9545 41.3379 57.5271 40.3936 58.5363C39.4493 59.5454 38.9647 60.9009 39.055 62.2806L40.622 86.4337C40.7395 88.2366 42.2338 89.6395 44.0389 89.6414C45.844 89.6395 47.3383 88.2366 47.4558 86.4337ZM40.5075 103.118C39.4304 102.124 38.8237 100.72 38.8374 99.2536C38.8071 96.3645 41.1146 93.994 44.0008 93.9492C46.8187 93.943 49.1423 96.158 49.2734 98.9756C49.4045 101.793 47.2968 104.215 44.4905 104.471C43.0314 104.603 41.5845 104.112 40.5075 103.118Z" fill="url(#paint0_linear)"/>
6
6
  <g opacity="0.6">
7
7
  <path d="M50.4387 15.3414L46.407 0.789686C46.3669 0.639179 46.2278 0.536726 46.0723 0.543265C45.9168 0.549803 45.7868 0.663577 45.7595 0.816916L43.224 14.4864L40.0683 13.8982C39.956 13.8774 39.8409 13.9157 39.7636 13.9998C39.6862 14.0839 39.6574 14.2018 39.6874 14.3121L43.7192 28.8639C43.7533 29.0153 43.8878 29.1229 44.0429 29.1229C44.198 29.1229 44.3324 29.0153 44.3666 28.8639L46.9021 15.1944L50.0578 15.7553C50.1701 15.7762 50.2852 15.7378 50.3625 15.6538C50.4399 15.5697 50.4687 15.4517 50.4387 15.3414Z" fill="#C1C7D0"/>
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export const svg = `<?xml version="1.0" encoding="UTF-8"?>
3
3
  <svg width="100" height="116" viewBox="0 0 100 116" fill="none" xmlns="http://www.w3.org/2000/svg">
4
- <path d="M0 0H100V116H0V0Z" fill="white"/>
4
+ <path d="M0 0H100V116H0V0Z"/>
5
5
  <g opacity="0.3">
6
6
  <path fill-rule="evenodd" clip-rule="evenodd" d="M14.4783 115.563H23.4169H23.4237C24.2045 115.563 24.8375 114.928 24.8375 114.144C24.8375 113.36 24.2045 112.725 23.4237 112.725H14.4783C13.6975 112.725 13.0645 113.36 13.0645 114.144C13.0645 114.928 13.6975 115.563 14.4783 115.563ZM40.6686 115.563H31.7301C30.9492 115.563 30.3162 114.928 30.3162 114.144C30.3162 113.36 30.9492 112.725 31.7301 112.725H40.6686C41.4495 112.725 42.0825 113.36 42.0825 114.144C42.0825 114.928 41.4495 115.563 40.6686 115.563ZM48.975 115.563H57.9204C58.7013 115.563 59.3343 114.928 59.3343 114.144C59.3343 113.36 58.7013 112.725 57.9204 112.725H48.975C48.1942 112.725 47.5612 113.36 47.5612 114.144C47.5612 114.928 48.1942 115.563 48.975 115.563ZM66.2268 115.563H75.1722C75.953 115.563 76.586 114.928 76.586 114.144C76.586 113.36 75.953 112.725 75.1722 112.725H66.2268C65.446 112.725 64.813 113.36 64.813 114.144C64.813 114.928 65.446 115.563 66.2268 115.563Z" fill="#B3BAC5"/>
7
7
  <path d="M6.17203 115.563H1.41386C0.633005 115.563 0 114.928 0 114.144V109.368C0 108.584 0.633005 107.948 1.41386 107.948C2.19471 107.948 2.82771 108.584 2.82771 109.368V112.725H6.17203C6.95288 112.725 7.58588 113.36 7.58588 114.144C7.58588 114.928 6.95288 115.563 6.17203 115.563Z" fill="#B3BAC5"/>
@@ -10,6 +10,7 @@ import { RadioGroup } from '@atlaskit/radio';
10
10
  import { Checkbox } from '@atlaskit/checkbox';
11
11
  import TextArea from '@atlaskit/textarea';
12
12
  import { gridSize } from '@atlaskit/theme/constants';
13
+ import { token } from '@atlaskit/tokens';
13
14
  import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle'; // AFP-2532 TODO: Fix automatic suppressions below
14
15
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
15
16
 
@@ -192,7 +193,7 @@ export const ArticleWasHelpfulForm = ({
192
193
  verticalAlign: 'middle'
193
194
  }
194
195
  }, /*#__PURE__*/React.createElement(CheckCircleIcon, {
195
- primaryColor: colors.G400,
196
+ primaryColor: token('color.icon.success', colors.G400),
196
197
  label: ""
197
198
  })), /*#__PURE__*/React.createElement(ArticleFeedbackText, null, formatMessage(messages.help_article_rating_form_Success)));
198
199
  }
@@ -2,13 +2,14 @@
2
2
  import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const ArticleFeedbackContainer = styled.div`
6
7
  position: relative;
7
8
  `;
8
9
  export const ArticleFeedbackText = styled.div`
9
10
  font-size: 0.75rem;
10
11
  font-weight: bold;
11
- color: ${colors.N200};
12
+ color: ${token('color.text.subtlest', colors.N200)};
12
13
  line-height: ${gridSize() * 4}px;
13
14
  position: relative;
14
15
  display: inline-block;