@atlaskit/help 7.1.7 → 7.1.10
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.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/components/Article/HelpArticle/index.js +6 -2
- package/dist/cjs/components/ArticlesList/ArticlesList.js +19 -17
- package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +3 -19
- package/dist/cjs/components/ArticlesList/index.js +4 -25
- package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +4 -25
- package/dist/cjs/util/testing/mock.js +12 -6
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Article/HelpArticle/index.js +6 -2
- package/dist/es2019/components/ArticlesList/ArticlesList.js +21 -13
- package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +2 -16
- package/dist/es2019/components/ArticlesList/index.js +2 -19
- package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +2 -19
- package/dist/es2019/util/testing/mock.js +12 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Article/HelpArticle/index.js +6 -2
- package/dist/esm/components/ArticlesList/ArticlesList.js +21 -13
- package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +3 -16
- package/dist/esm/components/ArticlesList/index.js +2 -18
- package/dist/esm/components/RelatedArticles/index.js +1 -1
- package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +2 -18
- package/dist/esm/components/contexts/navigationContext.js +1 -1
- package/dist/esm/components/contexts/searchContext.js +1 -1
- package/dist/esm/components/contexts/whatsNewArticleContext.js +1 -1
- package/dist/esm/util/testing/mock.js +12 -6
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ArticlesList/ArticlesListItem/index.d.ts +1 -2
- package/dist/types/model/Article.d.ts +4 -2
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/help
|
|
2
2
|
|
|
3
|
+
## 7.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`cf6b2085c95`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf6b2085c95) - Use articles "routes" attribute instead of "routeName" and "routeGroup"
|
|
8
|
+
|
|
9
|
+
## 7.1.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4113699bb4d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4113699bb4d) - [ux] Cleanup item usage and minor refactoring in `@atlaskit/help`
|
|
14
|
+
|
|
15
|
+
## 7.1.8
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 7.1.7
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -102,6 +102,10 @@ var HelpArticle = function HelpArticle(_ref) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if (article) {
|
|
105
|
+
var _article$routes, _article$routes2;
|
|
106
|
+
|
|
107
|
+
var routeGroup = article.routes && ((_article$routes = article.routes) === null || _article$routes === void 0 ? void 0 : _article$routes.length) > 0 ? article.routes[0].routeGroup : '';
|
|
108
|
+
var routeName = article.routes && ((_article$routes2 = article.routes) === null || _article$routes2 === void 0 ? void 0 : _article$routes2.length) > 0 ? article.routes[0].routeGroup : '';
|
|
105
109
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_helpArticle.default, {
|
|
106
110
|
title: article.title,
|
|
107
111
|
body: article.body,
|
|
@@ -115,8 +119,8 @@ var HelpArticle = function HelpArticle(_ref) {
|
|
|
115
119
|
style: "secondary",
|
|
116
120
|
onRelatedArticlesListItemClick: handleOnRelatedArticlesListItemClick,
|
|
117
121
|
onGetRelatedArticles: onGetRelatedArticles,
|
|
118
|
-
routeGroup:
|
|
119
|
-
routeName:
|
|
122
|
+
routeGroup: routeGroup,
|
|
123
|
+
routeName: routeName,
|
|
120
124
|
onRelatedArticlesShowMoreClick: handleOnRelatedArticlesShowMoreClick
|
|
121
125
|
}));
|
|
122
126
|
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -13,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
11
|
|
|
14
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
17
15
|
|
|
18
16
|
var _tokens = require("@atlaskit/tokens");
|
|
19
17
|
|
|
@@ -23,9 +21,21 @@ var _ArticlesListItem = _interopRequireDefault(require("./ArticlesListItem"));
|
|
|
23
21
|
|
|
24
22
|
var _constants2 = require("./constants");
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
var getStyles = function getStyles(style) {
|
|
25
|
+
if (style === 'secondary') {
|
|
26
|
+
return {
|
|
27
|
+
border: "2px solid ".concat((0, _tokens.token)('color.border', _colors.N30)),
|
|
28
|
+
padding: "".concat((0, _constants.gridSize)() * 2, "px"),
|
|
29
|
+
marginBottom: "".concat((0, _constants.gridSize)() * 1.5, "px")
|
|
30
|
+
};
|
|
31
|
+
}
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
return {
|
|
34
|
+
border: 0,
|
|
35
|
+
padding: "".concat((0, _constants.gridSize)(), "px"),
|
|
36
|
+
marginBottom: 0
|
|
37
|
+
};
|
|
38
|
+
};
|
|
29
39
|
|
|
30
40
|
var articlesList = function articlesList(_ref) {
|
|
31
41
|
var _ref$style = _ref.style,
|
|
@@ -37,13 +47,9 @@ var articlesList = function articlesList(_ref) {
|
|
|
37
47
|
_ref$numberOfArticles = _ref.numberOfArticlesToDisplay,
|
|
38
48
|
numberOfArticlesToDisplay = _ref$numberOfArticles === void 0 ? _constants2.MIN_ITEMS_TO_DISPLAY : _ref$numberOfArticles,
|
|
39
49
|
onArticlesListItemClick = _ref.onArticlesListItemClick;
|
|
40
|
-
return articles && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, articles.slice(0, minItemsToDisplay).map(function (article
|
|
50
|
+
return articles && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, articles.slice(0, minItemsToDisplay).map(function (article) {
|
|
41
51
|
return /*#__PURE__*/_react.default.createElement(_ArticlesListItem.default, {
|
|
42
|
-
styles:
|
|
43
|
-
border: style === 'secondary' ? "2px solid ".concat((0, _tokens.token)('color.border', colors.N30)) : 0,
|
|
44
|
-
padding: style === 'secondary' ? "".concat((0, _constants.gridSize)(), "px ").concat((0, _constants.gridSize)() * 2, "px") : "".concat((0, _constants.gridSize)(), "px"),
|
|
45
|
-
marginBottom: style === 'secondary' ? "".concat((0, _constants.gridSize)() * 1.5, "px") : 0
|
|
46
|
-
},
|
|
52
|
+
styles: getStyles(style),
|
|
47
53
|
id: article.id,
|
|
48
54
|
onClick: function onClick(event, analyticsEvent) {
|
|
49
55
|
if (onArticlesListItemClick) {
|
|
@@ -59,13 +65,9 @@ var articlesList = function articlesList(_ref) {
|
|
|
59
65
|
duration: _constants2.ANIMATE_HEIGHT_TRANSITION_DURATION_MS,
|
|
60
66
|
easing: "linear",
|
|
61
67
|
height: numberOfArticlesToDisplay > minItemsToDisplay ? 'auto' : 0
|
|
62
|
-
}, articles.slice(minItemsToDisplay, articles.length).map(function (article
|
|
68
|
+
}, articles.slice(minItemsToDisplay, articles.length).map(function (article) {
|
|
63
69
|
return /*#__PURE__*/_react.default.createElement(_ArticlesListItem.default, {
|
|
64
|
-
styles:
|
|
65
|
-
border: style === 'secondary' ? "2px solid ".concat((0, _tokens.token)('color.border', colors.N30)) : 0,
|
|
66
|
-
padding: style === 'secondary' ? "".concat((0, _constants.gridSize)(), "px ").concat((0, _constants.gridSize)() * 2, "px") : "".concat((0, _constants.gridSize)(), "px"),
|
|
67
|
-
marginBottom: style === 'secondary' ? "".concat((0, _constants.gridSize)() * 1.5, "px") : 0
|
|
68
|
-
},
|
|
70
|
+
styles: getStyles(style),
|
|
69
71
|
id: article.id,
|
|
70
72
|
onClick: function onClick(event, analyticsEvent) {
|
|
71
73
|
if (onArticlesListItemClick) {
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.default = exports.ArticlesListItem = void 0;
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
@@ -29,39 +29,23 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
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; }
|
|
31
31
|
|
|
32
|
-
// import { messages } from '../../../messages';
|
|
33
32
|
var ANALYTICS_CONTEXT_DATA = {
|
|
34
33
|
componentName: 'ArticlesListItem',
|
|
35
34
|
packageName: _version.name,
|
|
36
35
|
packageVersion: _version.version
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
var getTypeTitle = function getTypeTitle(itemType) {
|
|
40
|
-
switch (itemType) {
|
|
41
|
-
// case ARTICLE_ITEM_TYPES.topicInProduct:
|
|
42
|
-
// return messages.help_article_list_item_type_help_article;
|
|
43
|
-
default:
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.getTypeTitle = getTypeTitle;
|
|
49
|
-
|
|
50
38
|
var ArticlesListItem = function ArticlesListItem(_ref) {
|
|
51
|
-
var
|
|
52
|
-
styles = _ref.styles,
|
|
39
|
+
var styles = _ref.styles,
|
|
53
40
|
title = _ref.title,
|
|
54
41
|
description = _ref.description,
|
|
55
42
|
_ref$href = _ref.href,
|
|
56
43
|
href = _ref$href === void 0 ? '' : _ref$href,
|
|
57
|
-
type = _ref.type,
|
|
58
44
|
onClick = _ref.onClick;
|
|
59
45
|
|
|
60
46
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
61
47
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
62
48
|
|
|
63
|
-
var typeTitle = getTypeTitle(type);
|
|
64
|
-
|
|
65
49
|
var handleOnClick = function handleOnClick(event) {
|
|
66
50
|
event.preventDefault();
|
|
67
51
|
|
|
@@ -80,7 +64,7 @@ var ArticlesListItem = function ArticlesListItem(_ref) {
|
|
|
80
64
|
role: "button",
|
|
81
65
|
href: href,
|
|
82
66
|
onClick: handleOnClick
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemContainer, null,
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemContainer, null, /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemTitleText, null, title), href && /*#__PURE__*/_react.default.createElement(_styled.ArticlesListItemLinkIcon, null, /*#__PURE__*/_react.default.createElement(_shortcut.default, {
|
|
84
68
|
size: "small",
|
|
85
69
|
label: "",
|
|
86
70
|
primaryColor: (0, _tokens.token)('color.icon.subtle', colors.N90),
|
|
@@ -9,41 +9,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
13
|
|
|
16
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
15
|
|
|
18
|
-
var _styledComponents = require("styled-components");
|
|
19
|
-
|
|
20
|
-
var _item = require("@atlaskit/item");
|
|
21
|
-
|
|
22
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
23
|
-
|
|
24
16
|
var _ArticlesList = _interopRequireDefault(require("./ArticlesList"));
|
|
25
17
|
|
|
26
18
|
var _ShowMoreButton = _interopRequireDefault(require("../ShowMoreButton"));
|
|
27
19
|
|
|
28
20
|
var _styled = require("./styled");
|
|
29
21
|
|
|
30
|
-
var
|
|
22
|
+
var _constants = require("./constants");
|
|
31
23
|
|
|
32
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); }
|
|
33
25
|
|
|
34
26
|
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; }
|
|
35
27
|
|
|
36
|
-
var ITEM_THEME = {
|
|
37
|
-
padding: {
|
|
38
|
-
default: {
|
|
39
|
-
bottom: (0, _constants.gridSize)(),
|
|
40
|
-
left: (0, _constants.gridSize)(),
|
|
41
|
-
top: (0, _constants.gridSize)(),
|
|
42
|
-
right: (0, _constants.gridSize)()
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
28
|
var ArticleList = function ArticleList(_ref) {
|
|
48
29
|
var style = _ref.style,
|
|
49
30
|
articles = _ref.articles,
|
|
@@ -58,7 +39,7 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
58
39
|
setShowMoreToggled = _useState2[1];
|
|
59
40
|
|
|
60
41
|
var getMinItemsToDisplay = function getMinItemsToDisplay() {
|
|
61
|
-
return minItemsToDisplay ? minItemsToDisplay :
|
|
42
|
+
return minItemsToDisplay ? minItemsToDisplay : _constants.MIN_ITEMS_TO_DISPLAY;
|
|
62
43
|
};
|
|
63
44
|
|
|
64
45
|
var getMaxItemsToDisplay = function getMaxItemsToDisplay() {
|
|
@@ -81,9 +62,7 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
81
62
|
}
|
|
82
63
|
};
|
|
83
64
|
|
|
84
|
-
return articles && articles.length > 0 ? /*#__PURE__*/_react.default.createElement(_styled.ArticlesListContainer, null, /*#__PURE__*/_react.default.createElement(
|
|
85
|
-
theme: (0, _defineProperty2.default)({}, _item.itemThemeNamespace, ITEM_THEME)
|
|
86
|
-
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ArticlesList.default, {
|
|
65
|
+
return articles && articles.length > 0 ? /*#__PURE__*/_react.default.createElement(_styled.ArticlesListContainer, null, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ArticlesList.default, {
|
|
87
66
|
style: style,
|
|
88
67
|
onArticlesListItemClick: onArticlesListItemClick,
|
|
89
68
|
articles: articles,
|
|
@@ -94,7 +73,7 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
94
73
|
showMoreToggeled: showMoreToggled,
|
|
95
74
|
onToggle: toggleArticlesList,
|
|
96
75
|
itemsType: "articles"
|
|
97
|
-
})))
|
|
76
|
+
}))) : null;
|
|
98
77
|
};
|
|
99
78
|
|
|
100
79
|
var _default = ArticleList;
|
|
@@ -9,23 +9,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
13
|
|
|
16
|
-
var _styledComponents = require("styled-components");
|
|
17
|
-
|
|
18
|
-
var _item = require("@atlaskit/item");
|
|
19
|
-
|
|
20
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
21
|
-
|
|
22
14
|
var _ShowMoreButton = _interopRequireDefault(require("../../../ShowMoreButton"));
|
|
23
15
|
|
|
24
16
|
var _navigationContext = require("../../../contexts/navigationContext");
|
|
25
17
|
|
|
26
18
|
var _Help = require("../../../../model/Help");
|
|
27
19
|
|
|
28
|
-
var
|
|
20
|
+
var _constants = require("../../../constants");
|
|
29
21
|
|
|
30
22
|
var _WhatsNewResultsList = _interopRequireDefault(require("./WhatsNewResultsList"));
|
|
31
23
|
|
|
@@ -35,17 +27,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
35
27
|
|
|
36
28
|
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; }
|
|
37
29
|
|
|
38
|
-
var ITEM_THEME = {
|
|
39
|
-
padding: {
|
|
40
|
-
default: {
|
|
41
|
-
bottom: (0, _constants.gridSize)(),
|
|
42
|
-
left: (0, _constants.gridSize)(),
|
|
43
|
-
top: (0, _constants.gridSize)(),
|
|
44
|
-
right: (0, _constants.gridSize)()
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
30
|
var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
|
|
50
31
|
var style = _ref.style,
|
|
51
32
|
whatsNewArticles = _ref.whatsNewArticles,
|
|
@@ -75,20 +56,18 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
|
|
|
75
56
|
onWhatsNewResultItemClick(event, analyticsEvent, articleData);
|
|
76
57
|
}
|
|
77
58
|
}, [onWhatsNewResultItemClick, openArticle]);
|
|
78
|
-
return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/_react.default.createElement(_styled.WhatsNewResultsListContainer, null, /*#__PURE__*/_react.default.createElement(
|
|
79
|
-
theme: (0, _defineProperty2.default)({}, _item.itemThemeNamespace, ITEM_THEME)
|
|
80
|
-
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WhatsNewResultsList.default, {
|
|
59
|
+
return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/_react.default.createElement(_styled.WhatsNewResultsListContainer, null, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WhatsNewResultsList.default, {
|
|
81
60
|
style: style,
|
|
82
61
|
onWhatsNewResultItemClick: handleOnWhatsNewResultItemClick,
|
|
83
62
|
whatsNewArticles: whatsNewArticles
|
|
84
63
|
}), nextPage && hasNextPage && /*#__PURE__*/_react.default.createElement(_ShowMoreButton.default, {
|
|
85
64
|
onToggle: handleShowMoreButtonClick,
|
|
86
65
|
minItemsToDisplay: 0,
|
|
87
|
-
maxItemsToDisplay:
|
|
66
|
+
maxItemsToDisplay: _constants.NUMBER_OF_WHATS_NEW_ITEMS_PER_PAGE,
|
|
88
67
|
showMoreToggeled: true,
|
|
89
68
|
itemsType: "changes",
|
|
90
69
|
loading: loadingMore
|
|
91
|
-
})))
|
|
70
|
+
}))) : null;
|
|
92
71
|
};
|
|
93
72
|
|
|
94
73
|
var _default = WhatsNewResultsList;
|
|
@@ -19,8 +19,10 @@ var getMockArticle = function getMockArticle(id) {
|
|
|
19
19
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
20
20
|
title: 'mockArticle title',
|
|
21
21
|
type: _Article.ARTICLE_ITEM_TYPES.topicInProduct,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
routes: [{
|
|
23
|
+
routeName: routeName,
|
|
24
|
+
routeGroup: routeGroup
|
|
25
|
+
}],
|
|
24
26
|
topicId: 'mock-topic',
|
|
25
27
|
productName: productName,
|
|
26
28
|
href: href,
|
|
@@ -42,8 +44,10 @@ var getMockArticleItem = function getMockArticleItem(id) {
|
|
|
42
44
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
43
45
|
title: 'mockArticle title',
|
|
44
46
|
type: _Article.ARTICLE_ITEM_TYPES.topicInProduct,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
routes: [{
|
|
48
|
+
routeName: routeName,
|
|
49
|
+
routeGroup: routeGroup
|
|
50
|
+
}],
|
|
47
51
|
topicId: 'mock-topic',
|
|
48
52
|
productName: productName,
|
|
49
53
|
href: href
|
|
@@ -76,8 +80,10 @@ var getMockWhatsNewArticle = function getMockWhatsNewArticle(id) {
|
|
|
76
80
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
77
81
|
title: 'mock article title',
|
|
78
82
|
type: _Article.ARTICLE_ITEM_TYPES.topicInProduct,
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
routes: [{
|
|
84
|
+
routeName: routeName,
|
|
85
|
+
routeGroup: routeGroup
|
|
86
|
+
}],
|
|
81
87
|
topicId: 'mock-topic',
|
|
82
88
|
productName: productName,
|
|
83
89
|
href: href,
|
package/dist/cjs/version.json
CHANGED
|
@@ -78,6 +78,10 @@ export const HelpArticle = ({
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (article) {
|
|
81
|
+
var _article$routes, _article$routes2;
|
|
82
|
+
|
|
83
|
+
const routeGroup = article.routes && ((_article$routes = article.routes) === null || _article$routes === void 0 ? void 0 : _article$routes.length) > 0 ? article.routes[0].routeGroup : '';
|
|
84
|
+
const routeName = article.routes && ((_article$routes2 = article.routes) === null || _article$routes2 === void 0 ? void 0 : _article$routes2.length) > 0 ? article.routes[0].routeGroup : '';
|
|
81
85
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HelpArticleContent, {
|
|
82
86
|
title: article.title,
|
|
83
87
|
body: article.body,
|
|
@@ -91,8 +95,8 @@ export const HelpArticle = ({
|
|
|
91
95
|
style: "secondary",
|
|
92
96
|
onRelatedArticlesListItemClick: handleOnRelatedArticlesListItemClick,
|
|
93
97
|
onGetRelatedArticles: onGetRelatedArticles,
|
|
94
|
-
routeGroup:
|
|
95
|
-
routeName:
|
|
98
|
+
routeGroup: routeGroup,
|
|
99
|
+
routeName: routeName,
|
|
96
100
|
onRelatedArticlesShowMoreClick: handleOnRelatedArticlesShowMoreClick
|
|
97
101
|
}));
|
|
98
102
|
}
|
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
import
|
|
3
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { token } from '@atlaskit/tokens';
|
|
5
5
|
import AnimateHeight from 'react-animate-height';
|
|
6
6
|
import ArticlesListItem from './ArticlesListItem';
|
|
7
7
|
import { MIN_ITEMS_TO_DISPLAY, ANIMATE_HEIGHT_TRANSITION_DURATION_MS } from './constants';
|
|
8
8
|
|
|
9
|
+
const getStyles = style => {
|
|
10
|
+
if (style === 'secondary') {
|
|
11
|
+
return {
|
|
12
|
+
border: `2px solid ${token('color.border', N30)}`,
|
|
13
|
+
padding: `${gridSize() * 2}px`,
|
|
14
|
+
marginBottom: `${gridSize() * 1.5}px`
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
border: 0,
|
|
20
|
+
padding: `${gridSize()}px`,
|
|
21
|
+
marginBottom: 0
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
9
25
|
const articlesList = ({
|
|
10
26
|
style = 'primary',
|
|
11
27
|
articles = [],
|
|
12
28
|
minItemsToDisplay = MIN_ITEMS_TO_DISPLAY,
|
|
13
29
|
numberOfArticlesToDisplay = MIN_ITEMS_TO_DISPLAY,
|
|
14
30
|
onArticlesListItemClick
|
|
15
|
-
}) => articles && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, articles.slice(0, minItemsToDisplay).map(
|
|
31
|
+
}) => articles && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, articles.slice(0, minItemsToDisplay).map(article => {
|
|
16
32
|
return /*#__PURE__*/React.createElement(ArticlesListItem, {
|
|
17
|
-
styles:
|
|
18
|
-
border: style === 'secondary' ? `2px solid ${token('color.border', colors.N30)}` : 0,
|
|
19
|
-
padding: style === 'secondary' ? `${gridSize()}px ${gridSize() * 2}px` : `${gridSize()}px`,
|
|
20
|
-
marginBottom: style === 'secondary' ? `${gridSize() * 1.5}px` : 0
|
|
21
|
-
},
|
|
33
|
+
styles: getStyles(style),
|
|
22
34
|
id: article.id,
|
|
23
35
|
onClick: (event, analyticsEvent) => {
|
|
24
36
|
if (onArticlesListItemClick) {
|
|
@@ -34,12 +46,8 @@ const articlesList = ({
|
|
|
34
46
|
duration: ANIMATE_HEIGHT_TRANSITION_DURATION_MS,
|
|
35
47
|
easing: "linear",
|
|
36
48
|
height: numberOfArticlesToDisplay > minItemsToDisplay ? 'auto' : 0
|
|
37
|
-
}, articles.slice(minItemsToDisplay, articles.length).map(
|
|
38
|
-
styles:
|
|
39
|
-
border: style === 'secondary' ? `2px solid ${token('color.border', colors.N30)}` : 0,
|
|
40
|
-
padding: style === 'secondary' ? `${gridSize()}px ${gridSize() * 2}px` : `${gridSize()}px`,
|
|
41
|
-
marginBottom: style === 'secondary' ? `${gridSize() * 1.5}px` : 0
|
|
42
|
-
},
|
|
49
|
+
}, articles.slice(minItemsToDisplay, articles.length).map(article => /*#__PURE__*/React.createElement(ArticlesListItem, {
|
|
50
|
+
styles: getStyles(style),
|
|
43
51
|
id: article.id,
|
|
44
52
|
onClick: (event, analyticsEvent) => {
|
|
45
53
|
if (onArticlesListItemClick) {
|
|
@@ -5,36 +5,22 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
|
5
5
|
import { token } from '@atlaskit/tokens';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { name as packageName, version as packageVersion } from '../../../version.json';
|
|
8
|
-
|
|
9
|
-
import { ArticlesListItemTypeTitle, ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon } from './styled';
|
|
8
|
+
import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon } from './styled';
|
|
10
9
|
const ANALYTICS_CONTEXT_DATA = {
|
|
11
10
|
componentName: 'ArticlesListItem',
|
|
12
11
|
packageName,
|
|
13
12
|
packageVersion
|
|
14
13
|
};
|
|
15
|
-
export const getTypeTitle = itemType => {
|
|
16
|
-
switch (itemType) {
|
|
17
|
-
// case ARTICLE_ITEM_TYPES.topicInProduct:
|
|
18
|
-
// return messages.help_article_list_item_type_help_article;
|
|
19
|
-
default:
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
14
|
export const ArticlesListItem = ({
|
|
24
|
-
intl: {
|
|
25
|
-
formatMessage
|
|
26
|
-
},
|
|
27
15
|
styles,
|
|
28
16
|
title,
|
|
29
17
|
description,
|
|
30
18
|
href = '',
|
|
31
|
-
type,
|
|
32
19
|
onClick
|
|
33
20
|
}) => {
|
|
34
21
|
const {
|
|
35
22
|
createAnalyticsEvent
|
|
36
23
|
} = useAnalyticsEvents();
|
|
37
|
-
const typeTitle = getTypeTitle(type);
|
|
38
24
|
|
|
39
25
|
const handleOnClick = event => {
|
|
40
26
|
event.preventDefault();
|
|
@@ -53,7 +39,7 @@ export const ArticlesListItem = ({
|
|
|
53
39
|
role: "button",
|
|
54
40
|
href: href,
|
|
55
41
|
onClick: handleOnClick
|
|
56
|
-
}, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null,
|
|
42
|
+
}, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title), href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
57
43
|
size: "small",
|
|
58
44
|
label: "",
|
|
59
45
|
primaryColor: token('color.icon.subtle', colors.N90),
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { ThemeProvider } from 'styled-components';
|
|
3
|
-
import { itemThemeNamespace } from '@atlaskit/item';
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
2
|
import ArticlesList from './ArticlesList';
|
|
6
3
|
import ShowMoreButton from '../ShowMoreButton';
|
|
7
4
|
import { ArticlesListContainer } from './styled';
|
|
8
5
|
import { MIN_ITEMS_TO_DISPLAY } from './constants';
|
|
9
|
-
const ITEM_THEME = {
|
|
10
|
-
padding: {
|
|
11
|
-
default: {
|
|
12
|
-
bottom: gridSize(),
|
|
13
|
-
left: gridSize(),
|
|
14
|
-
top: gridSize(),
|
|
15
|
-
right: gridSize()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
6
|
|
|
20
7
|
const ArticleList = ({
|
|
21
8
|
style,
|
|
@@ -51,11 +38,7 @@ const ArticleList = ({
|
|
|
51
38
|
}
|
|
52
39
|
};
|
|
53
40
|
|
|
54
|
-
return articles && articles.length > 0 ? /*#__PURE__*/React.createElement(ArticlesListContainer, null, /*#__PURE__*/React.createElement(
|
|
55
|
-
theme: {
|
|
56
|
-
[itemThemeNamespace]: ITEM_THEME
|
|
57
|
-
}
|
|
58
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
41
|
+
return articles && articles.length > 0 ? /*#__PURE__*/React.createElement(ArticlesListContainer, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
59
42
|
style: style,
|
|
60
43
|
onArticlesListItemClick: onArticlesListItemClick,
|
|
61
44
|
articles: articles,
|
|
@@ -66,7 +49,7 @@ const ArticleList = ({
|
|
|
66
49
|
showMoreToggeled: showMoreToggled,
|
|
67
50
|
onToggle: toggleArticlesList,
|
|
68
51
|
itemsType: "articles"
|
|
69
|
-
})))
|
|
52
|
+
}))) : null;
|
|
70
53
|
};
|
|
71
54
|
|
|
72
55
|
export default ArticleList;
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { ThemeProvider } from 'styled-components';
|
|
3
|
-
import { itemThemeNamespace } from '@atlaskit/item';
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
2
|
import ShowMoreButton from '../../../ShowMoreButton';
|
|
6
3
|
import { useNavigationContext } from '../../../contexts/navigationContext';
|
|
7
4
|
import { ARTICLE_TYPE } from '../../../../model/Help';
|
|
8
5
|
import { NUMBER_OF_WHATS_NEW_ITEMS_PER_PAGE } from '../../../constants';
|
|
9
6
|
import ArticlesList from './WhatsNewResultsList';
|
|
10
7
|
import { WhatsNewResultsListContainer } from './styled';
|
|
11
|
-
const ITEM_THEME = {
|
|
12
|
-
padding: {
|
|
13
|
-
default: {
|
|
14
|
-
bottom: gridSize(),
|
|
15
|
-
left: gridSize(),
|
|
16
|
-
top: gridSize(),
|
|
17
|
-
right: gridSize()
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
8
|
|
|
22
9
|
const WhatsNewResultsList = ({
|
|
23
10
|
style,
|
|
@@ -48,11 +35,7 @@ const WhatsNewResultsList = ({
|
|
|
48
35
|
onWhatsNewResultItemClick(event, analyticsEvent, articleData);
|
|
49
36
|
}
|
|
50
37
|
}, [onWhatsNewResultItemClick, openArticle]);
|
|
51
|
-
return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/React.createElement(WhatsNewResultsListContainer, null, /*#__PURE__*/React.createElement(
|
|
52
|
-
theme: {
|
|
53
|
-
[itemThemeNamespace]: ITEM_THEME
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
38
|
+
return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/React.createElement(WhatsNewResultsListContainer, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
56
39
|
style: style,
|
|
57
40
|
onWhatsNewResultItemClick: handleOnWhatsNewResultItemClick,
|
|
58
41
|
whatsNewArticles: whatsNewArticles
|
|
@@ -63,7 +46,7 @@ const WhatsNewResultsList = ({
|
|
|
63
46
|
showMoreToggeled: true,
|
|
64
47
|
itemsType: "changes",
|
|
65
48
|
loading: loadingMore
|
|
66
|
-
})))
|
|
49
|
+
}))) : null;
|
|
67
50
|
};
|
|
68
51
|
|
|
69
52
|
export default WhatsNewResultsList;
|
|
@@ -7,8 +7,10 @@ export const getMockArticle = (id, routeName = '', routeGroup = '', productName
|
|
|
7
7
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
8
8
|
title: 'mockArticle title',
|
|
9
9
|
type: ARTICLE_ITEM_TYPES.topicInProduct,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
routes: [{
|
|
11
|
+
routeName,
|
|
12
|
+
routeGroup
|
|
13
|
+
}],
|
|
12
14
|
topicId: 'mock-topic',
|
|
13
15
|
productName,
|
|
14
16
|
href,
|
|
@@ -23,8 +25,10 @@ export const getMockArticleItem = (id, routeName = '', routeGroup = '', productN
|
|
|
23
25
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
24
26
|
title: 'mockArticle title',
|
|
25
27
|
type: ARTICLE_ITEM_TYPES.topicInProduct,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
routes: [{
|
|
29
|
+
routeName,
|
|
30
|
+
routeGroup
|
|
31
|
+
}],
|
|
28
32
|
topicId: 'mock-topic',
|
|
29
33
|
productName,
|
|
30
34
|
href
|
|
@@ -47,8 +51,10 @@ export const getMockWhatsNewArticle = (id, routeName = '', routeGroup = '', prod
|
|
|
47
51
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
48
52
|
title: 'mock article title',
|
|
49
53
|
type: ARTICLE_ITEM_TYPES.topicInProduct,
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
routes: [{
|
|
55
|
+
routeName,
|
|
56
|
+
routeGroup
|
|
57
|
+
}],
|
|
52
58
|
topicId: 'mock-topic',
|
|
53
59
|
productName,
|
|
54
60
|
href,
|
package/dist/es2019/version.json
CHANGED
|
@@ -78,6 +78,10 @@ export var HelpArticle = function HelpArticle(_ref) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (article) {
|
|
81
|
+
var _article$routes, _article$routes2;
|
|
82
|
+
|
|
83
|
+
var routeGroup = article.routes && ((_article$routes = article.routes) === null || _article$routes === void 0 ? void 0 : _article$routes.length) > 0 ? article.routes[0].routeGroup : '';
|
|
84
|
+
var routeName = article.routes && ((_article$routes2 = article.routes) === null || _article$routes2 === void 0 ? void 0 : _article$routes2.length) > 0 ? article.routes[0].routeGroup : '';
|
|
81
85
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HelpArticleContent, {
|
|
82
86
|
title: article.title,
|
|
83
87
|
body: article.body,
|
|
@@ -91,8 +95,8 @@ export var HelpArticle = function HelpArticle(_ref) {
|
|
|
91
95
|
style: "secondary",
|
|
92
96
|
onRelatedArticlesListItemClick: handleOnRelatedArticlesListItemClick,
|
|
93
97
|
onGetRelatedArticles: onGetRelatedArticles,
|
|
94
|
-
routeGroup:
|
|
95
|
-
routeName:
|
|
98
|
+
routeGroup: routeGroup,
|
|
99
|
+
routeName: routeName,
|
|
96
100
|
onRelatedArticlesShowMoreClick: handleOnRelatedArticlesShowMoreClick
|
|
97
101
|
}));
|
|
98
102
|
}
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
import
|
|
3
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { token } from '@atlaskit/tokens';
|
|
5
5
|
import AnimateHeight from 'react-animate-height';
|
|
6
6
|
import ArticlesListItem from './ArticlesListItem';
|
|
7
7
|
import { MIN_ITEMS_TO_DISPLAY, ANIMATE_HEIGHT_TRANSITION_DURATION_MS } from './constants';
|
|
8
8
|
|
|
9
|
+
var getStyles = function getStyles(style) {
|
|
10
|
+
if (style === 'secondary') {
|
|
11
|
+
return {
|
|
12
|
+
border: "2px solid ".concat(token('color.border', N30)),
|
|
13
|
+
padding: "".concat(gridSize() * 2, "px"),
|
|
14
|
+
marginBottom: "".concat(gridSize() * 1.5, "px")
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
border: 0,
|
|
20
|
+
padding: "".concat(gridSize(), "px"),
|
|
21
|
+
marginBottom: 0
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
9
25
|
var articlesList = function articlesList(_ref) {
|
|
10
26
|
var _ref$style = _ref.style,
|
|
11
27
|
style = _ref$style === void 0 ? 'primary' : _ref$style,
|
|
@@ -16,13 +32,9 @@ var articlesList = function articlesList(_ref) {
|
|
|
16
32
|
_ref$numberOfArticles = _ref.numberOfArticlesToDisplay,
|
|
17
33
|
numberOfArticlesToDisplay = _ref$numberOfArticles === void 0 ? MIN_ITEMS_TO_DISPLAY : _ref$numberOfArticles,
|
|
18
34
|
onArticlesListItemClick = _ref.onArticlesListItemClick;
|
|
19
|
-
return articles && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, articles.slice(0, minItemsToDisplay).map(function (article
|
|
35
|
+
return articles && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, articles.slice(0, minItemsToDisplay).map(function (article) {
|
|
20
36
|
return /*#__PURE__*/React.createElement(ArticlesListItem, {
|
|
21
|
-
styles:
|
|
22
|
-
border: style === 'secondary' ? "2px solid ".concat(token('color.border', colors.N30)) : 0,
|
|
23
|
-
padding: style === 'secondary' ? "".concat(gridSize(), "px ").concat(gridSize() * 2, "px") : "".concat(gridSize(), "px"),
|
|
24
|
-
marginBottom: style === 'secondary' ? "".concat(gridSize() * 1.5, "px") : 0
|
|
25
|
-
},
|
|
37
|
+
styles: getStyles(style),
|
|
26
38
|
id: article.id,
|
|
27
39
|
onClick: function onClick(event, analyticsEvent) {
|
|
28
40
|
if (onArticlesListItemClick) {
|
|
@@ -38,13 +50,9 @@ var articlesList = function articlesList(_ref) {
|
|
|
38
50
|
duration: ANIMATE_HEIGHT_TRANSITION_DURATION_MS,
|
|
39
51
|
easing: "linear",
|
|
40
52
|
height: numberOfArticlesToDisplay > minItemsToDisplay ? 'auto' : 0
|
|
41
|
-
}, articles.slice(minItemsToDisplay, articles.length).map(function (article
|
|
53
|
+
}, articles.slice(minItemsToDisplay, articles.length).map(function (article) {
|
|
42
54
|
return /*#__PURE__*/React.createElement(ArticlesListItem, {
|
|
43
|
-
styles:
|
|
44
|
-
border: style === 'secondary' ? "2px solid ".concat(token('color.border', colors.N30)) : 0,
|
|
45
|
-
padding: style === 'secondary' ? "".concat(gridSize(), "px ").concat(gridSize() * 2, "px") : "".concat(gridSize(), "px"),
|
|
46
|
-
marginBottom: style === 'secondary' ? "".concat(gridSize() * 1.5, "px") : 0
|
|
47
|
-
},
|
|
55
|
+
styles: getStyles(style),
|
|
48
56
|
id: article.id,
|
|
49
57
|
onClick: function onClick(event, analyticsEvent) {
|
|
50
58
|
if (onArticlesListItemClick) {
|
|
@@ -5,36 +5,23 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
|
5
5
|
import { token } from '@atlaskit/tokens';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { name as packageName, version as packageVersion } from '../../../version.json';
|
|
8
|
-
|
|
9
|
-
import { ArticlesListItemTypeTitle, ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon } from './styled';
|
|
8
|
+
import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon } from './styled';
|
|
10
9
|
var ANALYTICS_CONTEXT_DATA = {
|
|
11
10
|
componentName: 'ArticlesListItem',
|
|
12
11
|
packageName: packageName,
|
|
13
12
|
packageVersion: packageVersion
|
|
14
13
|
};
|
|
15
|
-
export var getTypeTitle = function getTypeTitle(itemType) {
|
|
16
|
-
switch (itemType) {
|
|
17
|
-
// case ARTICLE_ITEM_TYPES.topicInProduct:
|
|
18
|
-
// return messages.help_article_list_item_type_help_article;
|
|
19
|
-
default:
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
14
|
export var ArticlesListItem = function ArticlesListItem(_ref) {
|
|
24
|
-
var
|
|
25
|
-
styles = _ref.styles,
|
|
15
|
+
var styles = _ref.styles,
|
|
26
16
|
title = _ref.title,
|
|
27
17
|
description = _ref.description,
|
|
28
18
|
_ref$href = _ref.href,
|
|
29
19
|
href = _ref$href === void 0 ? '' : _ref$href,
|
|
30
|
-
type = _ref.type,
|
|
31
20
|
onClick = _ref.onClick;
|
|
32
21
|
|
|
33
22
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
34
23
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
35
24
|
|
|
36
|
-
var typeTitle = getTypeTitle(type);
|
|
37
|
-
|
|
38
25
|
var handleOnClick = function handleOnClick(event) {
|
|
39
26
|
event.preventDefault();
|
|
40
27
|
|
|
@@ -53,7 +40,7 @@ export var ArticlesListItem = function ArticlesListItem(_ref) {
|
|
|
53
40
|
role: "button",
|
|
54
41
|
href: href,
|
|
55
42
|
onClick: handleOnClick
|
|
56
|
-
}, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null,
|
|
43
|
+
}, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title), href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
57
44
|
size: "small",
|
|
58
45
|
label: "",
|
|
59
46
|
primaryColor: token('color.icon.subtle', colors.N90),
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import React, { useState } from 'react';
|
|
4
|
-
import { ThemeProvider } from 'styled-components';
|
|
5
|
-
import { itemThemeNamespace } from '@atlaskit/item';
|
|
6
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
3
|
import ArticlesList from './ArticlesList';
|
|
8
4
|
import ShowMoreButton from '../ShowMoreButton';
|
|
9
5
|
import { ArticlesListContainer } from './styled';
|
|
10
6
|
import { MIN_ITEMS_TO_DISPLAY } from './constants';
|
|
11
|
-
var ITEM_THEME = {
|
|
12
|
-
padding: {
|
|
13
|
-
default: {
|
|
14
|
-
bottom: gridSize(),
|
|
15
|
-
left: gridSize(),
|
|
16
|
-
top: gridSize(),
|
|
17
|
-
right: gridSize()
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
7
|
|
|
22
8
|
var ArticleList = function ArticleList(_ref) {
|
|
23
9
|
var style = _ref.style,
|
|
@@ -56,9 +42,7 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
56
42
|
}
|
|
57
43
|
};
|
|
58
44
|
|
|
59
|
-
return articles && articles.length > 0 ? /*#__PURE__*/React.createElement(ArticlesListContainer, null, /*#__PURE__*/React.createElement(
|
|
60
|
-
theme: _defineProperty({}, itemThemeNamespace, ITEM_THEME)
|
|
61
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
45
|
+
return articles && articles.length > 0 ? /*#__PURE__*/React.createElement(ArticlesListContainer, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
62
46
|
style: style,
|
|
63
47
|
onArticlesListItemClick: onArticlesListItemClick,
|
|
64
48
|
articles: articles,
|
|
@@ -69,7 +53,7 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
69
53
|
showMoreToggeled: showMoreToggled,
|
|
70
54
|
onToggle: toggleArticlesList,
|
|
71
55
|
itemsType: "articles"
|
|
72
|
-
})))
|
|
56
|
+
}))) : null;
|
|
73
57
|
};
|
|
74
58
|
|
|
75
59
|
export default ArticleList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
5
5
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
6
6
|
import SectionMessage from '@atlaskit/section-message';
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import React, { useCallback } from 'react';
|
|
3
|
-
import { ThemeProvider } from 'styled-components';
|
|
4
|
-
import { itemThemeNamespace } from '@atlaskit/item';
|
|
5
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
2
|
import ShowMoreButton from '../../../ShowMoreButton';
|
|
7
3
|
import { useNavigationContext } from '../../../contexts/navigationContext';
|
|
8
4
|
import { ARTICLE_TYPE } from '../../../../model/Help';
|
|
9
5
|
import { NUMBER_OF_WHATS_NEW_ITEMS_PER_PAGE } from '../../../constants';
|
|
10
6
|
import ArticlesList from './WhatsNewResultsList';
|
|
11
7
|
import { WhatsNewResultsListContainer } from './styled';
|
|
12
|
-
var ITEM_THEME = {
|
|
13
|
-
padding: {
|
|
14
|
-
default: {
|
|
15
|
-
bottom: gridSize(),
|
|
16
|
-
left: gridSize(),
|
|
17
|
-
top: gridSize(),
|
|
18
|
-
right: gridSize()
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
8
|
|
|
23
9
|
var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
|
|
24
10
|
var style = _ref.style,
|
|
@@ -49,9 +35,7 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
|
|
|
49
35
|
onWhatsNewResultItemClick(event, analyticsEvent, articleData);
|
|
50
36
|
}
|
|
51
37
|
}, [onWhatsNewResultItemClick, openArticle]);
|
|
52
|
-
return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/React.createElement(WhatsNewResultsListContainer, null, /*#__PURE__*/React.createElement(
|
|
53
|
-
theme: _defineProperty({}, itemThemeNamespace, ITEM_THEME)
|
|
54
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
38
|
+
return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/React.createElement(WhatsNewResultsListContainer, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArticlesList, {
|
|
55
39
|
style: style,
|
|
56
40
|
onWhatsNewResultItemClick: handleOnWhatsNewResultItemClick,
|
|
57
41
|
whatsNewArticles: whatsNewArticles
|
|
@@ -62,7 +46,7 @@ var WhatsNewResultsList = function WhatsNewResultsList(_ref) {
|
|
|
62
46
|
showMoreToggeled: true,
|
|
63
47
|
itemsType: "changes",
|
|
64
48
|
loading: loadingMore
|
|
65
|
-
})))
|
|
49
|
+
}))) : null;
|
|
66
50
|
};
|
|
67
51
|
|
|
68
52
|
export default WhatsNewResultsList;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
@@ -6,6 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
6
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
7
6
|
var _excluded = ["body", "relatedArticles"],
|
|
8
7
|
_excluded2 = ["description"];
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
|
|
10
10
|
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; }
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React, { useState, useCallback } from 'react';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
6
|
import { REQUEST_STATE } from '../../model/Requests';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import React, { useState, useCallback } from 'react';
|
|
6
6
|
import { REQUEST_STATE } from '../../model/Requests';
|
|
7
7
|
import { createCtx } from '../../util/hooks/ctx';
|
|
@@ -11,8 +11,10 @@ export var getMockArticle = function getMockArticle(id) {
|
|
|
11
11
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
12
12
|
title: 'mockArticle title',
|
|
13
13
|
type: ARTICLE_ITEM_TYPES.topicInProduct,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
routes: [{
|
|
15
|
+
routeName: routeName,
|
|
16
|
+
routeGroup: routeGroup
|
|
17
|
+
}],
|
|
16
18
|
topicId: 'mock-topic',
|
|
17
19
|
productName: productName,
|
|
18
20
|
href: href,
|
|
@@ -31,8 +33,10 @@ export var getMockArticleItem = function getMockArticleItem(id) {
|
|
|
31
33
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
32
34
|
title: 'mockArticle title',
|
|
33
35
|
type: ARTICLE_ITEM_TYPES.topicInProduct,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
routes: [{
|
|
37
|
+
routeName: routeName,
|
|
38
|
+
routeGroup: routeGroup
|
|
39
|
+
}],
|
|
36
40
|
topicId: 'mock-topic',
|
|
37
41
|
productName: productName,
|
|
38
42
|
href: href
|
|
@@ -59,8 +63,10 @@ export var getMockWhatsNewArticle = function getMockWhatsNewArticle(id) {
|
|
|
59
63
|
lastPublished: '2020-04-29T06:05:02.426Z',
|
|
60
64
|
title: 'mock article title',
|
|
61
65
|
type: ARTICLE_ITEM_TYPES.topicInProduct,
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
routes: [{
|
|
67
|
+
routeName: routeName,
|
|
68
|
+
routeGroup: routeGroup
|
|
69
|
+
}],
|
|
64
70
|
topicId: 'mock-topic',
|
|
65
71
|
productName: productName,
|
|
66
72
|
href: href,
|
package/dist/esm/version.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { ArticleItem
|
|
4
|
+
import { ArticleItem } from '../../../model/Article';
|
|
5
5
|
interface Props {
|
|
6
6
|
styles?: {};
|
|
7
7
|
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const getTypeTitle: (itemType?: ARTICLE_ITEM_TYPES | undefined) => null;
|
|
10
9
|
export declare const ArticlesListItem: React.FC<Props & Partial<ArticleItem> & WrappedComponentProps>;
|
|
11
10
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & Partial<ArticleItem> & WrappedComponentProps<"intl">>> & {
|
|
12
11
|
WrappedComponent: React.ComponentType<Props & Partial<ArticleItem> & WrappedComponentProps<"intl">>;
|
|
@@ -14,8 +14,10 @@ export interface ArticleItem {
|
|
|
14
14
|
lastPublished: string;
|
|
15
15
|
title: string;
|
|
16
16
|
type: ARTICLE_ITEM_TYPES;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
routes?: {
|
|
18
|
+
routeName: string;
|
|
19
|
+
routeGroup: string;
|
|
20
|
+
}[];
|
|
19
21
|
topicId?: string;
|
|
20
22
|
productName?: string;
|
|
21
23
|
href?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/help",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.10",
|
|
4
4
|
"description": "A cross-product help component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@atlaskit/help-article": "^4.0.0",
|
|
35
35
|
"@atlaskit/help-layout": "^4.1.0",
|
|
36
36
|
"@atlaskit/icon": "^21.10.0",
|
|
37
|
-
"@atlaskit/item": "^12.0.0",
|
|
38
37
|
"@atlaskit/notification-indicator": "^9.0.0",
|
|
39
38
|
"@atlaskit/notification-log-client": "^6.0.0",
|
|
40
39
|
"@atlaskit/radio": "^5.3.0",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"@atlaskit/textarea": "^4.3.0",
|
|
45
44
|
"@atlaskit/textfield": "^5.1.0",
|
|
46
45
|
"@atlaskit/theme": "^12.1.0",
|
|
47
|
-
"@atlaskit/tokens": "^0.
|
|
46
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
48
47
|
"@atlaskit/tooltip": "^17.5.0",
|
|
49
48
|
"@babel/runtime": "^7.0.0",
|
|
50
49
|
"@emotion/core": "^10.0.9",
|