@atlaskit/help 9.2.0 → 9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/afm-cc/tsconfig.json +2 -4
- package/afm-jira/tsconfig.json +3 -5
- package/afm-products/tsconfig.json +2 -4
- package/dist/cjs/assets/IconWrapper.js +0 -2
- package/dist/cjs/assets/WhatsNewIcoExperiment.js +0 -2
- package/dist/cjs/assets/WhatsNewIconFix.js +0 -2
- package/dist/cjs/assets/WhatsNewIconImprovement.js +0 -2
- package/dist/cjs/assets/WhatsNewIconNew.js +0 -2
- package/dist/cjs/assets/WhatsNewIconRemoved.js +0 -2
- package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +5 -3
- package/dist/cjs/components/Article/WhatsNewArticle/index.js +3 -3
- package/dist/cjs/components/Article/WhatsNewArticle/styled.compiled.css +4 -13
- package/dist/cjs/components/Article/WhatsNewArticle/styled.js +8 -17
- package/dist/cjs/components/Article/index.compiled.css +4 -1
- package/dist/cjs/components/Article/index.js +7 -2
- package/dist/cjs/components/ArticlesList/ArticlesList.js +6 -2
- package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +23 -11
- package/dist/cjs/components/ArticlesList/ArticlesListItem/styled.js +6 -3
- package/dist/cjs/components/ArticlesList/index.js +22 -1
- package/dist/cjs/components/HelpContentButton/index.js +3 -3
- package/dist/cjs/components/Search/SearchInput/index.js +5 -3
- package/dist/cjs/components/Search/SearchResults/SearchExternalSite.js +2 -2
- package/dist/cjs/components/Search/SearchResults/SearchResultsEmpty.js +2 -2
- package/dist/es2019/assets/IconWrapper.js +0 -2
- package/dist/es2019/assets/WhatsNewIcoExperiment.js +0 -2
- package/dist/es2019/assets/WhatsNewIconFix.js +0 -2
- package/dist/es2019/assets/WhatsNewIconImprovement.js +0 -2
- package/dist/es2019/assets/WhatsNewIconNew.js +0 -2
- package/dist/es2019/assets/WhatsNewIconRemoved.js +0 -2
- package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +4 -2
- package/dist/es2019/components/Article/WhatsNewArticle/index.js +1 -1
- package/dist/es2019/components/Article/WhatsNewArticle/styled.compiled.css +4 -12
- package/dist/es2019/components/Article/WhatsNewArticle/styled.js +8 -12
- package/dist/es2019/components/Article/index.compiled.css +4 -1
- package/dist/es2019/components/Article/index.js +7 -2
- package/dist/es2019/components/ArticlesList/ArticlesList.js +6 -2
- package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +24 -12
- package/dist/es2019/components/ArticlesList/ArticlesListItem/styled.js +5 -3
- package/dist/es2019/components/ArticlesList/index.js +23 -2
- package/dist/es2019/components/HelpContentButton/index.js +2 -2
- package/dist/es2019/components/Search/SearchInput/index.js +4 -2
- package/dist/es2019/components/Search/SearchResults/SearchExternalSite.js +1 -1
- package/dist/es2019/components/Search/SearchResults/SearchResultsEmpty.js +1 -1
- package/dist/esm/assets/IconWrapper.js +0 -2
- package/dist/esm/assets/WhatsNewIcoExperiment.js +0 -2
- package/dist/esm/assets/WhatsNewIconFix.js +0 -2
- package/dist/esm/assets/WhatsNewIconImprovement.js +0 -2
- package/dist/esm/assets/WhatsNewIconNew.js +0 -2
- package/dist/esm/assets/WhatsNewIconRemoved.js +0 -2
- package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +4 -2
- package/dist/esm/components/Article/WhatsNewArticle/index.js +1 -1
- package/dist/esm/components/Article/WhatsNewArticle/styled.compiled.css +4 -13
- package/dist/esm/components/Article/WhatsNewArticle/styled.js +8 -17
- package/dist/esm/components/Article/index.compiled.css +4 -1
- package/dist/esm/components/Article/index.js +7 -2
- package/dist/esm/components/ArticlesList/ArticlesList.js +6 -2
- package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +23 -11
- package/dist/esm/components/ArticlesList/ArticlesListItem/styled.js +6 -3
- package/dist/esm/components/ArticlesList/index.js +23 -2
- package/dist/esm/components/HelpContentButton/index.js +2 -2
- package/dist/esm/components/Search/SearchInput/index.js +4 -2
- package/dist/esm/components/Search/SearchResults/SearchExternalSite.js +1 -1
- package/dist/esm/components/Search/SearchResults/SearchResultsEmpty.js +1 -1
- package/dist/types/assets/IconWrapper.d.ts +3 -4
- package/dist/types/components/ArticlesList/ArticlesList.d.ts +1 -0
- package/dist/types/components/ArticlesList/ArticlesListItem/index.d.ts +4 -4
- package/dist/types/components/ArticlesList/ArticlesListItem/styled.d.ts +2 -2
- package/dist/types-ts4.5/assets/IconWrapper.d.ts +3 -4
- package/dist/types-ts4.5/components/ArticlesList/ArticlesList.d.ts +1 -0
- package/dist/types-ts4.5/components/ArticlesList/ArticlesListItem/index.d.ts +4 -4
- package/dist/types-ts4.5/components/ArticlesList/ArticlesListItem/styled.d.ts +2 -2
- package/package.json +14 -15
|
@@ -2,35 +2,26 @@
|
|
|
2
2
|
import "./styled.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import
|
|
6
|
-
import { N300, N800 } from '@atlaskit/theme/colors';
|
|
7
|
-
var body = fontFallback.body;
|
|
8
|
-
var whatsNewTypeTitleStyles = null;
|
|
5
|
+
import Heading from '@atlaskit/heading';
|
|
9
6
|
export var WhatsNewTypeTitle = function WhatsNewTypeTitle(_ref) {
|
|
10
7
|
var children = _ref.children;
|
|
11
|
-
return /*#__PURE__*/React.createElement(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"--_1dzgjqk": ix("var(--ds-text-subtlest, ".concat(N300, ")")),
|
|
15
|
-
"--_bo9t81": ix("var(--ds-font-body, ".concat(body.medium, ")"))
|
|
16
|
-
}
|
|
8
|
+
return /*#__PURE__*/React.createElement(Heading, {
|
|
9
|
+
size: "xsmall",
|
|
10
|
+
as: "h3"
|
|
17
11
|
}, children);
|
|
18
12
|
};
|
|
19
13
|
var whatsNewIconContainerStyles = null;
|
|
20
14
|
export var WhatsNewIconContainer = function WhatsNewIconContainer(_ref2) {
|
|
21
15
|
var children = _ref2.children;
|
|
22
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: ax(["
|
|
17
|
+
className: ax(["_zulpu2gc _1e0c1txw _n3tdu2gc"])
|
|
24
18
|
}, children);
|
|
25
19
|
};
|
|
26
|
-
var whatsNewTitleText = null;
|
|
27
20
|
export var WhatsNewTitleText = function WhatsNewTitleText(_ref3) {
|
|
28
21
|
var children = _ref3.children;
|
|
29
|
-
return /*#__PURE__*/React.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"--_ggxzyp": ix("var(--ds-text, ".concat(N800, ")"))
|
|
33
|
-
}
|
|
22
|
+
return /*#__PURE__*/React.createElement(Heading, {
|
|
23
|
+
size: "xsmall",
|
|
24
|
+
as: "h4"
|
|
34
25
|
}, children);
|
|
35
26
|
};
|
|
36
27
|
var relatedLinkContainerStyles = null;
|
|
@@ -17,4 +17,7 @@
|
|
|
17
17
|
._kqswstnw{position:absolute}
|
|
18
18
|
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
19
19
|
._u5f31ejb{padding-right:var(--ds-space-300,24px)}
|
|
20
|
-
._vchhusvi{box-sizing:border-box}
|
|
20
|
+
._vchhusvi{box-sizing:border-box}
|
|
21
|
+
._1hvw1o36:focus{outline-width:medium}
|
|
22
|
+
._49pcglyw:focus{outline-style:none}
|
|
23
|
+
._nt751r31:focus{outline-color:currentColor}
|
|
@@ -63,12 +63,15 @@ export var Article = function Article(_ref) {
|
|
|
63
63
|
}, [history]);
|
|
64
64
|
var onArticleEntered = function onArticleEntered() {
|
|
65
65
|
onArticleEnteredTimeout.current = window.setTimeout(function () {
|
|
66
|
+
var _articleContainerRef$;
|
|
66
67
|
// if skipArticleSlideInAnimation is true, set to false after the
|
|
67
68
|
// first slide-in animation
|
|
68
69
|
// NOTE: skipArticleSlideInAnimation could be true only after the mounting
|
|
69
70
|
if (skipArticleSlideInAnimation) {
|
|
70
71
|
setSkipArticleSlideInAnimation(false);
|
|
71
72
|
}
|
|
73
|
+
// Move focus to the article container for accessibility
|
|
74
|
+
(_articleContainerRef$ = articleContainerRef.current) === null || _articleContainerRef$ === void 0 || _articleContainerRef$.focus();
|
|
72
75
|
}, SLIDEIN_OVERLAY_TRANSITION_DURATION_MS);
|
|
73
76
|
};
|
|
74
77
|
var onArticleExit = function onArticleExit() {
|
|
@@ -118,8 +121,9 @@ export var Article = function Article(_ref) {
|
|
|
118
121
|
}, function (state) {
|
|
119
122
|
return /*#__PURE__*/React.createElement("div", {
|
|
120
123
|
ref: articleContainerRef,
|
|
124
|
+
tabIndex: -1,
|
|
121
125
|
style: _objectSpread(_objectSpread({}, transitionStyles[state]), enableTransition[!skipArticleSlideInAnimation ? 'enabled' : 'disabled']),
|
|
122
|
-
className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _19bv1ejb _u5f31ejb _n3tdpxbi _kqswstnw _4t3i1kz6 _1bsb1osq _154i1eca _bfhkvuon _1ltv1osq _2lx21bp4 _vchhusvi _1reo15vq _18m91wug _1pbycs5v"])
|
|
126
|
+
className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _19bv1ejb _u5f31ejb _n3tdpxbi _kqswstnw _4t3i1kz6 _1bsb1osq _154i1eca _bfhkvuon _1ltv1osq _2lx21bp4 _vchhusvi _1reo15vq _18m91wug _1pbycs5v _nt751r31 _49pcglyw _1hvw1o36"])
|
|
123
127
|
}, /*#__PURE__*/React.createElement(ArticleContent, {
|
|
124
128
|
currentArticle: currentArticle,
|
|
125
129
|
onHelpArticleLoadingFailTryAgainButtonClick: reloadHelpArticle && handleOnHelpArticleLoadingFailTryAgainButtonClick,
|
|
@@ -136,8 +140,9 @@ export var Article = function Article(_ref) {
|
|
|
136
140
|
}, function (state) {
|
|
137
141
|
return /*#__PURE__*/React.createElement("div", {
|
|
138
142
|
ref: articleContainerRef,
|
|
143
|
+
tabIndex: -1,
|
|
139
144
|
style: _objectSpread(_objectSpread({}, transitionStyles[state]), enableTransition[!skipArticleSlideInAnimation ? 'enabled' : 'disabled']),
|
|
140
|
-
className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _ca0qpxbi _u5f31ejb _n3tdpxbi _19bv1ejb _kqswstnw _4t3i1osq _1bsb1osq _154iidpf _bfhkvuon _1ltv1osq _2lx21bp4 _vchhusvi _1reo15vq _18m91wug _1pbycs5v"])
|
|
145
|
+
className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _ca0qpxbi _u5f31ejb _n3tdpxbi _19bv1ejb _kqswstnw _4t3i1osq _1bsb1osq _154iidpf _bfhkvuon _1ltv1osq _2lx21bp4 _vchhusvi _1reo15vq _18m91wug _1pbycs5v _nt751r31 _49pcglyw _1hvw1o36"])
|
|
141
146
|
}, /*#__PURE__*/React.createElement(ArticleContent, {
|
|
142
147
|
currentArticle: currentArticle,
|
|
143
148
|
onHelpArticleLoadingFailTryAgainButtonClick: reloadHelpArticle && handleOnHelpArticleLoadingFailTryAgainButtonClick,
|
|
@@ -30,7 +30,8 @@ var articlesList = function articlesList(_ref) {
|
|
|
30
30
|
minItemsToDisplay = _ref$minItemsToDispla === void 0 ? MIN_ITEMS_TO_DISPLAY : _ref$minItemsToDispla,
|
|
31
31
|
_ref$numberOfArticles = _ref.numberOfArticlesToDisplay,
|
|
32
32
|
numberOfArticlesToDisplay = _ref$numberOfArticles === void 0 ? MIN_ITEMS_TO_DISPLAY : _ref$numberOfArticles,
|
|
33
|
-
onArticlesListItemClick = _ref.onArticlesListItemClick
|
|
33
|
+
onArticlesListItemClick = _ref.onArticlesListItemClick,
|
|
34
|
+
firstExpandedArticleRef = _ref.firstExpandedArticleRef;
|
|
34
35
|
var isExpanded = numberOfArticlesToDisplay > minItemsToDisplay;
|
|
35
36
|
return articles ? /*#__PURE__*/React.createElement(Box, {
|
|
36
37
|
as: "ul",
|
|
@@ -38,6 +39,8 @@ var articlesList = function articlesList(_ref) {
|
|
|
38
39
|
role: "list"
|
|
39
40
|
}, articles.slice(0, numberOfArticlesToDisplay).map(function (article, index) {
|
|
40
41
|
var isVisible = index < minItemsToDisplay || isExpanded;
|
|
42
|
+
// The first expanded article is at index minItemsToDisplay
|
|
43
|
+
var isFirstExpandedArticle = index === minItemsToDisplay;
|
|
41
44
|
return /*#__PURE__*/React.createElement(Box, {
|
|
42
45
|
as: "li",
|
|
43
46
|
xcss: listStyles,
|
|
@@ -58,7 +61,8 @@ var articlesList = function articlesList(_ref) {
|
|
|
58
61
|
href: article.href,
|
|
59
62
|
trustFactors: article.trustFactors,
|
|
60
63
|
source: article.source,
|
|
61
|
-
lastPublished: article.lastPublished
|
|
64
|
+
lastPublished: article.lastPublished,
|
|
65
|
+
ref: isFirstExpandedArticle ? firstExpandedArticleRef : undefined
|
|
62
66
|
}));
|
|
63
67
|
})) : null;
|
|
64
68
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
2
3
|
import * as colors from '@atlaskit/theme/colors';
|
|
3
4
|
import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
|
|
4
|
-
import ShortcutIcon from '@atlaskit/icon/core/
|
|
5
|
+
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
5
6
|
import { injectIntl } from 'react-intl-next';
|
|
6
|
-
import LikeIcon from '@atlaskit/icon/core/
|
|
7
|
+
import LikeIcon from '@atlaskit/icon/core/thumbs-up';
|
|
7
8
|
import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTitleText, ArticlesListItemDescription, ArticlesListItemLinkIcon, ArticlesListItemTrustFactor, ArticlesListItemViewCount, ArticlesListItemHelpfulCount, ArticlesListItemSource, ArticlesListItemLastModified, ArticlesListItemTitleSection, ArticlesListItemDescriptionHighlight } from './styled';
|
|
8
9
|
var ANALYTICS_CONTEXT_DATA = {
|
|
9
10
|
componentName: 'ArticlesListItem',
|
|
@@ -27,7 +28,7 @@ var highlightText = function highlightText(text) {
|
|
|
27
28
|
});
|
|
28
29
|
return sections;
|
|
29
30
|
};
|
|
30
|
-
export var ArticlesListItem = function
|
|
31
|
+
export var ArticlesListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
31
32
|
var styles = _ref.styles,
|
|
32
33
|
title = _ref.title,
|
|
33
34
|
description = _ref.description,
|
|
@@ -57,27 +58,38 @@ export var ArticlesListItem = function ArticlesListItem(_ref) {
|
|
|
57
58
|
var isSourceVisible = source != null;
|
|
58
59
|
var isLastPublishedVisible = lastPublished != null && lastPublished !== '';
|
|
59
60
|
return /*#__PURE__*/React.createElement(ArticlesListItemWrapper, {
|
|
61
|
+
ref: ref,
|
|
60
62
|
styles: styles,
|
|
61
63
|
"aria-disabled": "false",
|
|
62
64
|
role: "button",
|
|
63
65
|
href: href,
|
|
64
66
|
onClick: handleOnClick
|
|
65
|
-
}, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleSection, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title), isLastPublishedVisible &&
|
|
67
|
+
}, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleSection, null, /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title), isLastPublishedVisible &&
|
|
68
|
+
/*#__PURE__*/
|
|
69
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
70
|
+
React.createElement(ArticlesListItemLastModified, null, "Last modified: ", lastPublished)), href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
66
71
|
LEGACY_size: "small",
|
|
67
72
|
label: "Opens in a new window",
|
|
68
73
|
color: "var(--ds-icon-subtle, ".concat(colors.N90, ")"),
|
|
69
74
|
LEGACY_secondaryColor: "var(--ds-icon-subtle, ".concat(colors.N90, ")")
|
|
70
|
-
}))), /*#__PURE__*/React.createElement(ArticlesListItemDescription, null, highlightText(description)), isSourceVisible && /*#__PURE__*/React.createElement(ArticlesListItemSource, null, source), isTrustFactorVisible && /*#__PURE__*/React.createElement(ArticlesListItemTrustFactor, null, isNumViewsVisible &&
|
|
75
|
+
}))), /*#__PURE__*/React.createElement(ArticlesListItemDescription, null, highlightText(description)), isSourceVisible && /*#__PURE__*/React.createElement(ArticlesListItemSource, null, source), isTrustFactorVisible && /*#__PURE__*/React.createElement(ArticlesListItemTrustFactor, null, isNumViewsVisible &&
|
|
76
|
+
/*#__PURE__*/
|
|
77
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
78
|
+
React.createElement(ArticlesListItemViewCount, null, trustFactors.numViews, " views"), isHelpfulCountVisible && /*#__PURE__*/React.createElement(ArticlesListItemHelpfulCount, null, /*#__PURE__*/React.createElement(LikeIcon, {
|
|
71
79
|
LEGACY_margin: "0 -0.25px 0 0",
|
|
72
80
|
color: "currentColor",
|
|
73
81
|
label: "Like",
|
|
74
82
|
LEGACY_size: "small"
|
|
75
83
|
}), trustFactors.helpfulCount)));
|
|
76
|
-
};
|
|
77
|
-
var ArticlesListItemWithContext = function
|
|
84
|
+
});
|
|
85
|
+
var ArticlesListItemWithContext = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
78
86
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
79
87
|
data: ANALYTICS_CONTEXT_DATA
|
|
80
|
-
}, /*#__PURE__*/React.createElement(ArticlesListItem,
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
}, /*#__PURE__*/React.createElement(ArticlesListItem, _extends({
|
|
89
|
+
ref: ref
|
|
90
|
+
}, props)));
|
|
91
|
+
});
|
|
92
|
+
var _default_1 = injectIntl(ArticlesListItemWithContext, {
|
|
93
|
+
forwardRef: true
|
|
94
|
+
});
|
|
83
95
|
export default _default_1;
|
|
@@ -14,11 +14,13 @@ import { B100, B50, N200, N30, N400, N400A, N800, Y100 } from '@atlaskit/theme/c
|
|
|
14
14
|
var heading = fontFallback.heading,
|
|
15
15
|
body = fontFallback.body;
|
|
16
16
|
var articlesListItemWrapperStyles = null;
|
|
17
|
-
export var ArticlesListItemWrapper = function
|
|
17
|
+
export var ArticlesListItemWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
18
18
|
var styles = _ref.styles,
|
|
19
19
|
children = _ref.children,
|
|
20
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
return /*#__PURE__*/React.createElement("a", _extends({
|
|
21
|
+
return /*#__PURE__*/React.createElement("a", _extends({
|
|
22
|
+
ref: ref
|
|
23
|
+
}, rest, {
|
|
22
24
|
className: ax(["_4bfu1r31 _1hmsglyw _ajmmnqa1 _2rkofajl _kqswh2mm _vchhusvi _ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc _1e0c1ule _80omtlke _syazpsu8 _bfhkqtfy _7ehi13ga _1nrm1r31 _1a3b1r31 _9oik1r31 _1ydc1r31 _c2waglyw _4fprglyw _1bnxglyw _1x28glyw _1iohnqa1 _5goinqa1 _jf4cnqa1 _1726nqa1 _1q5t1r31 _nt751r31 _1dit1r31 _9nxe1r31 _1ohyglyw _49pcglyw _ksodglyw _tpgfglyw _1r9x1o36 _1hvw1o36 _4hz81o36 _12gr1o36 _13roglyw _1bg4glyw _1qb1glyw _1dnaglyw _irr32tgk _1di618xb"]),
|
|
23
25
|
style: _objectSpread(_objectSpread({}, styles), {}, {
|
|
24
26
|
"--_vrm7dk": ix("var(--ds-text-subtlest, ".concat(N200, ")")),
|
|
@@ -27,7 +29,7 @@ export var ArticlesListItemWrapper = function ArticlesListItemWrapper(_ref) {
|
|
|
27
29
|
"--_18th9fi": ix("var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")"))
|
|
28
30
|
})
|
|
29
31
|
}), children);
|
|
30
|
-
};
|
|
32
|
+
});
|
|
31
33
|
var articlesListItemContainerStyles = null;
|
|
32
34
|
export var ArticlesListItemContainer = function ArticlesListItemContainer(_ref2) {
|
|
33
35
|
var children = _ref2.children;
|
|
@@ -46,6 +48,7 @@ var articlesListItemLinkIconStyles = null;
|
|
|
46
48
|
export var ArticlesListItemLinkIcon = function ArticlesListItemLinkIcon(_ref4) {
|
|
47
49
|
var children = _ref4.children;
|
|
48
50
|
return /*#__PURE__*/React.createElement("span", {
|
|
51
|
+
"aria-label": "Opens in a new window",
|
|
49
52
|
className: ax(["_1wpz1wug _bozg1b66 _s7n4nkob"])
|
|
50
53
|
}, children);
|
|
51
54
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import ArticlesList from './ArticlesList';
|
|
4
4
|
import ShowMoreButton from '../ShowMoreButton';
|
|
5
5
|
import { ArticlesListContainer } from './styled';
|
|
@@ -15,6 +15,8 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
15
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
16
|
showMoreToggled = _useState2[0],
|
|
17
17
|
setShowMoreToggled = _useState2[1];
|
|
18
|
+
var firstExpandedArticleRef = useRef(null);
|
|
19
|
+
var isExpandingRef = useRef(false);
|
|
18
20
|
var getMinItemsToDisplay = function getMinItemsToDisplay() {
|
|
19
21
|
return minItemsToDisplay ? minItemsToDisplay : MIN_ITEMS_TO_DISPLAY;
|
|
20
22
|
};
|
|
@@ -27,7 +29,24 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
27
29
|
var getNumberOfArticlesToDisplay = function getNumberOfArticlesToDisplay(showMoreToggeled) {
|
|
28
30
|
return showMoreToggeled ? getMinItemsToDisplay() : getMaxItemsToDisplay();
|
|
29
31
|
};
|
|
32
|
+
|
|
33
|
+
// Focus on the first newly revealed article after expansion
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
if (isExpandingRef.current && !showMoreToggled) {
|
|
36
|
+
if (firstExpandedArticleRef.current) {
|
|
37
|
+
firstExpandedArticleRef.current.focus();
|
|
38
|
+
}
|
|
39
|
+
isExpandingRef.current = false;
|
|
40
|
+
}
|
|
41
|
+
}, [showMoreToggled]);
|
|
42
|
+
var setFirstExpandedArticleRef = useCallback(function (element) {
|
|
43
|
+
firstExpandedArticleRef.current = element;
|
|
44
|
+
}, []);
|
|
30
45
|
var toggleArticlesList = function toggleArticlesList(event, analyticsEvent) {
|
|
46
|
+
// Track if we're expanding (going from collapsed to expanded)
|
|
47
|
+
if (showMoreToggled) {
|
|
48
|
+
isExpandingRef.current = true;
|
|
49
|
+
}
|
|
31
50
|
setShowMoreToggled(!showMoreToggled);
|
|
32
51
|
if (onToggleArticlesList) {
|
|
33
52
|
onToggleArticlesList(event, analyticsEvent, !showMoreToggled);
|
|
@@ -39,7 +58,9 @@ var ArticleList = function ArticleList(_ref) {
|
|
|
39
58
|
style: style,
|
|
40
59
|
onArticlesListItemClick: onArticlesListItemClick,
|
|
41
60
|
articles: articles,
|
|
42
|
-
numberOfArticlesToDisplay: getNumberOfArticlesToDisplay(showMoreToggled)
|
|
61
|
+
numberOfArticlesToDisplay: getNumberOfArticlesToDisplay(showMoreToggled),
|
|
62
|
+
minItemsToDisplay: getMinItemsToDisplay(),
|
|
63
|
+
firstExpandedArticleRef: setFirstExpandedArticleRef
|
|
43
64
|
}), articles.length > getMinItemsToDisplay() && /*#__PURE__*/React.createElement(ShowMoreButton, {
|
|
44
65
|
minItemsToDisplay: getMinItemsToDisplay(),
|
|
45
66
|
maxItemsToDisplay: getMaxItemsToDisplay(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import ShortcutIcon from '@atlaskit/icon/core/
|
|
2
|
+
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
3
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
4
|
import { NotificationIndicator } from '@atlaskit/notification-indicator';
|
|
5
5
|
import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
|
|
@@ -48,7 +48,7 @@ var HelpContentButton = function HelpContentButton(_ref) {
|
|
|
48
48
|
}, /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
49
49
|
color: "currentColor",
|
|
50
50
|
LEGACY_size: "small",
|
|
51
|
-
label: ""
|
|
51
|
+
label: "Opens in a new window"
|
|
52
52
|
}))));
|
|
53
53
|
var target = href ? openInSameTab ? '_self' : '_blank' : undefined;
|
|
54
54
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
@@ -7,7 +7,7 @@ import Textfield from '@atlaskit/textfield';
|
|
|
7
7
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
8
8
|
import Spinner from '@atlaskit/spinner';
|
|
9
9
|
import SearchIcon from '@atlaskit/icon/core/migration/search';
|
|
10
|
-
import EditorCloseIcon from '@atlaskit/icon/core/
|
|
10
|
+
import EditorCloseIcon from '@atlaskit/icon/core/cross';
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { REQUEST_STATE } from '../../../model/Requests';
|
|
13
13
|
import { useSearchContext } from '../../contexts/searchContext';
|
|
@@ -93,7 +93,9 @@ export var SearchInput = function SearchInput(_ref) {
|
|
|
93
93
|
}), searchValue !== '' && /*#__PURE__*/React.createElement(Button, {
|
|
94
94
|
appearance: "subtle",
|
|
95
95
|
onClick: handleOnClearButtonClick,
|
|
96
|
-
spacing: "none"
|
|
96
|
+
spacing: "none"
|
|
97
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
98
|
+
,
|
|
97
99
|
"aria-label": "Clear",
|
|
98
100
|
className: ax(["_1bsb1tcg _4t3i1tcg"])
|
|
99
101
|
}, /*#__PURE__*/React.createElement(EditorCloseIcon, {
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
3
|
import * as colors from '@atlaskit/theme/colors';
|
|
4
4
|
import Button from '@atlaskit/button';
|
|
5
|
-
import ShortcutIcon from '@atlaskit/icon/core/
|
|
5
|
+
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import { messages } from '../../../messages';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
3
|
import * as colors from '@atlaskit/theme/colors';
|
|
4
4
|
import Button from '@atlaskit/button';
|
|
5
|
-
import ShortcutIcon from '@atlaskit/icon/core/
|
|
5
|
+
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import NotFoundImage from '../../../assets/NotFoundImage';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type NewCoreIconProps } from '@atlaskit/icon';
|
|
3
3
|
type IconWrapperProps = {
|
|
4
4
|
appearance: string;
|
|
5
|
-
Icon:
|
|
6
|
-
LegacyIcon: ({ label, primaryColor, secondaryColor, size, testId }: IconProps) => JSX.Element;
|
|
5
|
+
Icon: (props: NewCoreIconProps) => JSX.Element;
|
|
7
6
|
};
|
|
8
|
-
export declare const IconWrapper: ({ Icon,
|
|
7
|
+
export declare const IconWrapper: ({ Icon, appearance }: IconWrapperProps) => React.JSX.Element;
|
|
9
8
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ArticlesList as ArticlesListInterface } from './model/ArticlesListItem';
|
|
3
3
|
export interface Props {
|
|
4
|
+
firstExpandedArticleRef?: (element: HTMLAnchorElement | null) => void;
|
|
4
5
|
numberOfArticlesToDisplay?: number;
|
|
5
6
|
}
|
|
6
7
|
declare const articlesList: React.FC<Partial<ArticlesListInterface> & Props>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { type
|
|
3
|
+
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { type ArticleItem } from '../../../model/Article';
|
|
5
5
|
interface Props {
|
|
6
6
|
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
7
7
|
styles?: {};
|
|
8
8
|
}
|
|
9
|
-
export declare const ArticlesListItem: React.
|
|
10
|
-
declare const _default_1: React.
|
|
11
|
-
WrappedComponent: React.ComponentType<Props & Partial<ArticleItem> & WrappedComponentProps
|
|
9
|
+
export declare const ArticlesListItem: React.ForwardRefExoticComponent<Props & Partial<ArticleItem> & WrappedComponentProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const _default_1: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<Props & Partial<ArticleItem> & WrappedComponentProps & React.RefAttributes<HTMLAnchorElement>>>, "ref"> & React.RefAttributes<any>> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<Props & Partial<ArticleItem> & WrappedComponentProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
12
12
|
};
|
|
13
13
|
export default _default_1;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
export declare const ArticlesListItemWrapper:
|
|
6
|
+
export declare const ArticlesListItemWrapper: React.ForwardRefExoticComponent<Omit<{
|
|
7
7
|
[rest: string]: any;
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
styles?: React.CSSProperties;
|
|
10
|
-
}
|
|
10
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
11
|
export declare const ArticlesListItemContainer: ({ children, }: {
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
}) => JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type NewCoreIconProps } from '@atlaskit/icon';
|
|
3
3
|
type IconWrapperProps = {
|
|
4
4
|
appearance: string;
|
|
5
|
-
Icon:
|
|
6
|
-
LegacyIcon: ({ label, primaryColor, secondaryColor, size, testId }: IconProps) => JSX.Element;
|
|
5
|
+
Icon: (props: NewCoreIconProps) => JSX.Element;
|
|
7
6
|
};
|
|
8
|
-
export declare const IconWrapper: ({ Icon,
|
|
7
|
+
export declare const IconWrapper: ({ Icon, appearance }: IconWrapperProps) => React.JSX.Element;
|
|
9
8
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ArticlesList as ArticlesListInterface } from './model/ArticlesListItem';
|
|
3
3
|
export interface Props {
|
|
4
|
+
firstExpandedArticleRef?: (element: HTMLAnchorElement | null) => void;
|
|
4
5
|
numberOfArticlesToDisplay?: number;
|
|
5
6
|
}
|
|
6
7
|
declare const articlesList: React.FC<Partial<ArticlesListInterface> & Props>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { type
|
|
3
|
+
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { type ArticleItem } from '../../../model/Article';
|
|
5
5
|
interface Props {
|
|
6
6
|
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
7
7
|
styles?: {};
|
|
8
8
|
}
|
|
9
|
-
export declare const ArticlesListItem: React.
|
|
10
|
-
declare const _default_1: React.
|
|
11
|
-
WrappedComponent: React.ComponentType<Props & Partial<ArticleItem> & WrappedComponentProps
|
|
9
|
+
export declare const ArticlesListItem: React.ForwardRefExoticComponent<Props & Partial<ArticleItem> & WrappedComponentProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const _default_1: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<Props & Partial<ArticleItem> & WrappedComponentProps & React.RefAttributes<HTMLAnchorElement>>>, "ref"> & React.RefAttributes<any>> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<Props & Partial<ArticleItem> & WrappedComponentProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
12
12
|
};
|
|
13
13
|
export default _default_1;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
export declare const ArticlesListItemWrapper:
|
|
6
|
+
export declare const ArticlesListItemWrapper: React.ForwardRefExoticComponent<Omit<{
|
|
7
7
|
[rest: string]: any;
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
styles?: React.CSSProperties;
|
|
10
|
-
}
|
|
10
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
11
|
export declare const ArticlesListItemContainer: ({ children, }: {
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
}) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/help",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"description": "A cross-product help component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,27 +32,26 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
35
|
-
"@atlaskit/button": "^23.
|
|
36
|
-
"@atlaskit/checkbox": "^17.
|
|
37
|
-
"@atlaskit/form": "^
|
|
35
|
+
"@atlaskit/button": "^23.9.0",
|
|
36
|
+
"@atlaskit/checkbox": "^17.2.0",
|
|
37
|
+
"@atlaskit/form": "^15.1.0",
|
|
38
38
|
"@atlaskit/heading": "^5.2.0",
|
|
39
39
|
"@atlaskit/help-article": "^6.0.0",
|
|
40
40
|
"@atlaskit/help-layout": "^6.3.0",
|
|
41
|
-
"@atlaskit/icon": "^29.
|
|
42
|
-
"@atlaskit/legacy-custom-icons": "^0.22.0",
|
|
41
|
+
"@atlaskit/icon": "^29.3.0",
|
|
43
42
|
"@atlaskit/notification-indicator": "^10.0.0",
|
|
44
|
-
"@atlaskit/notification-log-client": "^6.
|
|
43
|
+
"@atlaskit/notification-log-client": "^6.4.0",
|
|
45
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
46
|
-
"@atlaskit/primitives": "^
|
|
45
|
+
"@atlaskit/primitives": "^17.0.0",
|
|
47
46
|
"@atlaskit/radio": "^8.3.0",
|
|
48
|
-
"@atlaskit/section-message": "^8.
|
|
49
|
-
"@atlaskit/select": "^21.
|
|
47
|
+
"@atlaskit/section-message": "^8.11.0",
|
|
48
|
+
"@atlaskit/select": "^21.6.0",
|
|
50
49
|
"@atlaskit/spinner": "^19.0.0",
|
|
51
|
-
"@atlaskit/textarea": "^8.
|
|
52
|
-
"@atlaskit/textfield": "^8.
|
|
50
|
+
"@atlaskit/textarea": "^8.2.0",
|
|
51
|
+
"@atlaskit/textfield": "^8.2.0",
|
|
53
52
|
"@atlaskit/theme": "^21.0.0",
|
|
54
|
-
"@atlaskit/tokens": "^
|
|
55
|
-
"@atlaskit/tooltip": "^20.
|
|
53
|
+
"@atlaskit/tokens": "^9.0.0",
|
|
54
|
+
"@atlaskit/tooltip": "^20.11.0",
|
|
56
55
|
"@babel/runtime": "^7.0.0",
|
|
57
56
|
"@compiled/react": "^0.18.6",
|
|
58
57
|
"date-fns": "^2.17.0",
|
|
@@ -66,7 +65,7 @@
|
|
|
66
65
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
67
66
|
},
|
|
68
67
|
"devDependencies": {
|
|
69
|
-
"@testing-library/react": "^
|
|
68
|
+
"@testing-library/react": "^16.3.0",
|
|
70
69
|
"@types/react-transition-group": "^2.0.6",
|
|
71
70
|
"algoliasearch": "^3.35.1",
|
|
72
71
|
"enzyme": "^3.10.0",
|