@atlaskit/help 9.2.1 → 9.2.3

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 (100) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/afm-cc/tsconfig.json +0 -3
  3. package/afm-jira/tsconfig.json +0 -3
  4. package/afm-products/tsconfig.json +0 -3
  5. package/dist/cjs/analytics.js +1 -1
  6. package/dist/cjs/assets/IconWrapper.js +0 -2
  7. package/dist/cjs/assets/WhatsNewIcoExperiment.js +0 -2
  8. package/dist/cjs/assets/WhatsNewIconFix.js +0 -2
  9. package/dist/cjs/assets/WhatsNewIconImprovement.js +0 -2
  10. package/dist/cjs/assets/WhatsNewIconNew.js +0 -2
  11. package/dist/cjs/assets/WhatsNewIconRemoved.js +0 -2
  12. package/dist/cjs/components/Article/ArticleLoadingFail/index.js +1 -1
  13. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  14. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  15. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +3 -3
  16. package/dist/cjs/components/Article/HelpArticle/index.js +1 -1
  17. package/dist/cjs/components/Article/WhatsNewArticle/index.js +4 -4
  18. package/dist/cjs/components/Article/WhatsNewArticle/styled.compiled.css +4 -13
  19. package/dist/cjs/components/Article/WhatsNewArticle/styled.js +8 -17
  20. package/dist/cjs/components/ArticlesList/ArticlesList.js +6 -2
  21. package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +18 -12
  22. package/dist/cjs/components/ArticlesList/ArticlesListItem/styled.js +5 -3
  23. package/dist/cjs/components/ArticlesList/index.js +22 -1
  24. package/dist/cjs/components/BackButton/index.js +2 -2
  25. package/dist/cjs/components/HelpContentButton/index.js +4 -4
  26. package/dist/cjs/components/NeedMoreHelp/index.js +1 -1
  27. package/dist/cjs/components/RelatedArticles/index.js +1 -1
  28. package/dist/cjs/components/Search/SearchInput/index.js +3 -3
  29. package/dist/cjs/components/Search/SearchResults/SearchExternalSite.js +2 -2
  30. package/dist/cjs/components/Search/SearchResults/SearchResultsEmpty.js +2 -2
  31. package/dist/cjs/components/WhatsNew/WhatsNewButton/index.js +2 -2
  32. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  33. package/dist/cjs/components/contexts/navigationContext.js +57 -25
  34. package/dist/es2019/analytics.js +1 -1
  35. package/dist/es2019/assets/IconWrapper.js +0 -2
  36. package/dist/es2019/assets/WhatsNewIcoExperiment.js +0 -2
  37. package/dist/es2019/assets/WhatsNewIconFix.js +0 -2
  38. package/dist/es2019/assets/WhatsNewIconImprovement.js +0 -2
  39. package/dist/es2019/assets/WhatsNewIconNew.js +0 -2
  40. package/dist/es2019/assets/WhatsNewIconRemoved.js +0 -2
  41. package/dist/es2019/components/Article/ArticleLoadingFail/index.js +1 -1
  42. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  43. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  44. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +2 -2
  45. package/dist/es2019/components/Article/HelpArticle/index.js +1 -1
  46. package/dist/es2019/components/Article/WhatsNewArticle/index.js +2 -2
  47. package/dist/es2019/components/Article/WhatsNewArticle/styled.compiled.css +4 -12
  48. package/dist/es2019/components/Article/WhatsNewArticle/styled.js +8 -12
  49. package/dist/es2019/components/ArticlesList/ArticlesList.js +6 -2
  50. package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +17 -11
  51. package/dist/es2019/components/ArticlesList/ArticlesListItem/styled.js +4 -3
  52. package/dist/es2019/components/ArticlesList/index.js +23 -2
  53. package/dist/es2019/components/BackButton/index.js +2 -2
  54. package/dist/es2019/components/HelpContentButton/index.js +3 -3
  55. package/dist/es2019/components/NeedMoreHelp/index.js +1 -1
  56. package/dist/es2019/components/RelatedArticles/index.js +1 -1
  57. package/dist/es2019/components/Search/SearchInput/index.js +2 -2
  58. package/dist/es2019/components/Search/SearchResults/SearchExternalSite.js +1 -1
  59. package/dist/es2019/components/Search/SearchResults/SearchResultsEmpty.js +1 -1
  60. package/dist/es2019/components/WhatsNew/WhatsNewButton/index.js +2 -2
  61. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  62. package/dist/es2019/components/contexts/navigationContext.js +33 -4
  63. package/dist/esm/analytics.js +1 -1
  64. package/dist/esm/assets/IconWrapper.js +0 -2
  65. package/dist/esm/assets/WhatsNewIcoExperiment.js +0 -2
  66. package/dist/esm/assets/WhatsNewIconFix.js +0 -2
  67. package/dist/esm/assets/WhatsNewIconImprovement.js +0 -2
  68. package/dist/esm/assets/WhatsNewIconNew.js +0 -2
  69. package/dist/esm/assets/WhatsNewIconRemoved.js +0 -2
  70. package/dist/esm/components/Article/ArticleLoadingFail/index.js +1 -1
  71. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  72. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  73. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +2 -2
  74. package/dist/esm/components/Article/HelpArticle/index.js +1 -1
  75. package/dist/esm/components/Article/WhatsNewArticle/index.js +2 -2
  76. package/dist/esm/components/Article/WhatsNewArticle/styled.compiled.css +4 -13
  77. package/dist/esm/components/Article/WhatsNewArticle/styled.js +8 -17
  78. package/dist/esm/components/ArticlesList/ArticlesList.js +6 -2
  79. package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +16 -10
  80. package/dist/esm/components/ArticlesList/ArticlesListItem/styled.js +5 -3
  81. package/dist/esm/components/ArticlesList/index.js +23 -2
  82. package/dist/esm/components/BackButton/index.js +2 -2
  83. package/dist/esm/components/HelpContentButton/index.js +3 -3
  84. package/dist/esm/components/NeedMoreHelp/index.js +1 -1
  85. package/dist/esm/components/RelatedArticles/index.js +1 -1
  86. package/dist/esm/components/Search/SearchInput/index.js +2 -2
  87. package/dist/esm/components/Search/SearchResults/SearchExternalSite.js +1 -1
  88. package/dist/esm/components/Search/SearchResults/SearchResultsEmpty.js +1 -1
  89. package/dist/esm/components/WhatsNew/WhatsNewButton/index.js +2 -2
  90. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  91. package/dist/esm/components/contexts/navigationContext.js +57 -25
  92. package/dist/types/assets/IconWrapper.d.ts +3 -4
  93. package/dist/types/components/ArticlesList/ArticlesList.d.ts +1 -0
  94. package/dist/types/components/ArticlesList/ArticlesListItem/index.d.ts +4 -4
  95. package/dist/types/components/ArticlesList/ArticlesListItem/styled.d.ts +2 -2
  96. package/dist/types-ts4.5/assets/IconWrapper.d.ts +3 -4
  97. package/dist/types-ts4.5/components/ArticlesList/ArticlesList.d.ts +1 -0
  98. package/dist/types-ts4.5/components/ArticlesList/ArticlesListItem/index.d.ts +4 -4
  99. package/dist/types-ts4.5/components/ArticlesList/ArticlesListItem/styled.d.ts +2 -2
  100. package/package.json +10 -11
@@ -10,7 +10,7 @@ var _react = _interopRequireDefault(require("react"));
10
10
  var _analyticsNext = require("@atlaskit/analytics-next");
11
11
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
12
12
  var _button = _interopRequireDefault(require("@atlaskit/button"));
13
- var _linkExternalShortcut = _interopRequireDefault(require("@atlaskit/icon/core/migration/link-external--shortcut"));
13
+ var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
14
14
  var _reactIntlNext = require("react-intl-next");
15
15
  var _compiled = require("@atlaskit/primitives/compiled");
16
16
  var _NotFoundImage = _interopRequireDefault(require("../../../assets/NotFoundImage"));
@@ -39,7 +39,7 @@ var SearchResultsEmpty = exports.SearchResultsEmpty = function SearchResultsEmpt
39
39
  }
40
40
  }, /*#__PURE__*/_react.default.createElement(_button.default, {
41
41
  appearance: "link",
42
- iconAfter: /*#__PURE__*/_react.default.createElement(_linkExternalShortcut.default, {
42
+ iconAfter: /*#__PURE__*/_react.default.createElement(_linkExternal.default, {
43
43
  LEGACY_size: "small",
44
44
  label: "",
45
45
  color: "var(--ds-icon-subtle, ".concat(colors.N90, ")"),
@@ -9,7 +9,7 @@ exports.default = exports.WhatsNewButton = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _analyticsNext = require("@atlaskit/analytics-next");
11
11
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
12
- var _lightbulb = _interopRequireDefault(require("@atlaskit/icon/core/migration/lightbulb"));
12
+ var _lightbulb = _interopRequireDefault(require("@atlaskit/icon/core/lightbulb"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
14
  var _whatsNewArticleContext = require("../../contexts/whatsNewArticleContext");
15
15
  var _navigationContext = require("../../contexts/navigationContext");
@@ -20,7 +20,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
20
20
  var ANALYTICS_CONTEXT_DATA = {
21
21
  componentName: 'WhatsNewButton',
22
22
  packageName: "@atlaskit/help",
23
- packageVersion: "9.2.0"
23
+ packageVersion: "0.0.0-development"
24
24
  };
25
25
  var WhatsNewButton = exports.WhatsNewButton = function WhatsNewButton(_ref) {
26
26
  var productName = _ref.productName,
@@ -15,7 +15,7 @@ var _styled2 = require("./styled");
15
15
  var ANALYTICS_CONTEXT_DATA = {
16
16
  componentName: 'ArticlesListItem',
17
17
  packageName: "@atlaskit/help",
18
- packageVersion: "9.2.0"
18
+ packageVersion: "0.0.0-development"
19
19
  };
20
20
  var WhatsNewResultListItem = exports.WhatsNewResultListItem = function WhatsNewResultListItem(_ref) {
21
21
  var formatMessage = _ref.intl.formatMessage,
@@ -101,14 +101,14 @@ var getCurrentArticleItemSlim = function getCurrentArticleItemSlim(history) {
101
101
  if (article) {
102
102
  if (type === _Help.ARTICLE_TYPE.HELP_ARTICLE) {
103
103
  var _ref = article,
104
- body = _ref.body,
105
- relatedArticles = _ref.relatedArticles,
104
+ _body = _ref.body,
105
+ _relatedArticles = _ref.relatedArticles,
106
106
  articleItemData = (0, _objectWithoutProperties2.default)(_ref, _excluded);
107
107
  var currentArticleSlimData = articleItemData;
108
108
  return currentArticleSlimData;
109
109
  } else if (type === _Help.ARTICLE_TYPE.WHATS_NEW) {
110
110
  var _ref2 = article,
111
- description = _ref2.description,
111
+ _description = _ref2.description,
112
112
  whatsNewArticleItemData = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
113
113
  var currentWhatsNewArticleSlimData = whatsNewArticleItemData;
114
114
  return currentWhatsNewArticleSlimData;
@@ -274,6 +274,9 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
274
274
  var onGetHelpArticleRef = (0, _react.useRef)(onGetHelpArticle);
275
275
  var onGetWhatsNewArticleRef = (0, _react.useRef)(onGetWhatsNewArticle);
276
276
 
277
+ // Ref to store triggering elements for focus restoration on navigate back
278
+ var triggerElementsRef = (0, _react.useRef)([]);
279
+
277
280
  // Update refs when functions change
278
281
  onGetHelpArticleRef.current = onGetHelpArticle;
279
282
  onGetWhatsNewArticleRef.current = onGetWhatsNewArticle;
@@ -376,7 +379,7 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
376
379
  };
377
380
  }(), []);
378
381
  var navigateBack = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
379
- var _searchResult$length;
382
+ var triggerElement, _searchResult$length, timeoutId;
380
383
  return _regenerator.default.wrap(function _callee3$(_context3) {
381
384
  while (1) switch (_context3.prev = _context3.next) {
382
385
  case 0:
@@ -397,31 +400,48 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
397
400
  });
398
401
  return _context3.abrupt("return");
399
402
  case 8:
400
- // if the history is not empty and ...
401
- if (currentHistory.length > 0) {
402
- // the history has more than one article, navigate back through the history
403
- if (currentHistory.length > 1) {
404
- // Remove last element
403
+ if (!(currentHistory.length > 0)) {
404
+ _context3.next = 14;
405
+ break;
406
+ }
407
+ // Pop the trigger element before navigating back
408
+ triggerElement = triggerElementsRef.current.pop(); // the history has more than one article, navigate back through the history
409
+ if (currentHistory.length > 1) {
410
+ // Remove last element
411
+ dispatchNavigationAction({
412
+ type: 'removeLastHistoryItem'
413
+ });
414
+ } else if (currentHistory.length === 1) {
415
+ // If the search value is not empty and search result is not empty, show the search results
416
+ if (searchValue !== '' && ((_searchResult$length = searchResult === null || searchResult === void 0 ? void 0 : searchResult.length) !== null && _searchResult$length !== void 0 ? _searchResult$length : 0) > 0 && onSearch !== undefined) {
417
+ dispatchNavigationAction({
418
+ type: 'updateView',
419
+ payload: _constants.VIEW.SEARCH
420
+ });
421
+ }
422
+ // If the search value is empty, show the default content
423
+ else {
405
424
  dispatchNavigationAction({
406
- type: 'removeLastHistoryItem'
425
+ type: 'removeAllHistoryItems'
407
426
  });
408
- } else if (currentHistory.length === 1) {
409
- // If the search value is not empty and search result is not empty, show the search results
410
- if (searchValue !== '' && ((_searchResult$length = searchResult === null || searchResult === void 0 ? void 0 : searchResult.length) !== null && _searchResult$length !== void 0 ? _searchResult$length : 0) > 0 && onSearch !== undefined) {
411
- dispatchNavigationAction({
412
- type: 'updateView',
413
- payload: _constants.VIEW.SEARCH
414
- });
415
- }
416
- // If the search value is empty, show the default content
417
- else {
418
- dispatchNavigationAction({
419
- type: 'removeAllHistoryItems'
420
- });
421
- }
422
427
  }
423
428
  }
424
- case 9:
429
+
430
+ // Restore focus to the element that triggered the navigation
431
+ if (!triggerElement) {
432
+ _context3.next = 14;
433
+ break;
434
+ }
435
+ // Wait for slide-out animation to complete (300ms) plus a buffer
436
+ timeoutId = setTimeout(function () {
437
+ if (document.body.contains(triggerElement)) {
438
+ triggerElement.focus();
439
+ }
440
+ }, 400); // Increased from 350ms to 400ms
441
+ return _context3.abrupt("return", function () {
442
+ return clearTimeout(timeoutId);
443
+ });
444
+ case 14:
425
445
  case "end":
426
446
  return _context3.stop();
427
447
  }
@@ -429,6 +449,8 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
429
449
  })), [currentView, searchValue, currentArticleId, currentHistory, onSearch, searchResult === null || searchResult === void 0 ? void 0 : searchResult.length]);
430
450
  var onClose = (0, _react.useCallback)(function (event, analyticsEvent) {
431
451
  if (onCloseButtonClick) {
452
+ // Clear trigger elements stack when closing
453
+ triggerElementsRef.current = [];
432
454
  dispatchNavigationAction({
433
455
  type: 'removeAllHistoryItems'
434
456
  });
@@ -436,6 +458,11 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
436
458
  }
437
459
  }, [onCloseButtonClick]);
438
460
  var onOpenArticle = (0, _react.useCallback)(function (newArticleId) {
461
+ // Capture the currently focused element before opening article
462
+ var triggerElement = document.activeElement;
463
+ if (triggerElement && triggerElement !== document.body) {
464
+ triggerElementsRef.current.push(triggerElement);
465
+ }
439
466
  dispatchNavigationAction({
440
467
  type: 'addNewHistoryItem',
441
468
  payload: newArticleId
@@ -475,7 +502,12 @@ var NavigationContextProvider = exports.NavigationContextProvider = function Nav
475
502
  } else {
476
503
  /**
477
504
  * Otherwise we need to add a new article
505
+ * Capture the focused element for focus restoration when navigating back
478
506
  */
507
+ var triggerElement = document.activeElement;
508
+ if (triggerElement && triggerElement !== document.body && propsArticleId.id !== '') {
509
+ triggerElementsRef.current.push(triggerElement);
510
+ }
479
511
  dispatchNavigationAction({
480
512
  type: 'newArticle',
481
513
  payload: propsArticleId
@@ -5,5 +5,5 @@ export const createAndFire = x.createAndFireEvent('atlaskit');
5
5
  export const defaultAnalyticsAttributes = {
6
6
  componentName: 'help',
7
7
  packageName: "@atlaskit/help",
8
- packageVersion: "9.2.0"
8
+ packageVersion: "0.0.0-development"
9
9
  };
@@ -4,14 +4,12 @@ import { IconTile } from '@atlaskit/icon';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
5
  export const IconWrapper = ({
6
6
  Icon,
7
- LegacyIcon,
8
7
  appearance
9
8
  }) => {
10
9
  return /*#__PURE__*/React.createElement(Flex, {
11
10
  alignItems: "center",
12
11
  justifyContent: "center"
13
12
  }, !fg('platform-visual-refresh-icons') ? /*#__PURE__*/React.createElement(Icon, {
14
- LEGACY_fallbackIcon: LegacyIcon,
15
13
  label: "",
16
14
  color: "var(--ds-icon-inverse, #FFFFFF)"
17
15
  }) :
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import LegacyFlaskIcon from '@atlaskit/legacy-custom-icons/flask-icon';
3
2
  import FlaskIcon from '@atlaskit/icon/core/flask';
4
3
  import { IconWrapper } from './IconWrapper';
5
4
  import { P500 } from '@atlaskit/theme/colors';
6
5
  export default function WhatsNewIcoExperiment() {
7
6
  return /*#__PURE__*/React.createElement(IconWrapper, {
8
7
  Icon: FlaskIcon,
9
- LegacyIcon: LegacyFlaskIcon,
10
8
  appearance: `var(--ds-icon-discovery, ${P500})`
11
9
  });
12
10
  }
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import LegacyBugIcon from '@atlaskit/legacy-custom-icons/bug-icon';
3
2
  import BugIcon from '@atlaskit/icon/core/bug';
4
3
  import { IconWrapper } from './IconWrapper';
5
4
  import { B500 } from '@atlaskit/theme/colors';
6
5
  export default function WhatsNewIconFix() {
7
6
  return /*#__PURE__*/React.createElement(IconWrapper, {
8
7
  Icon: BugIcon,
9
- LegacyIcon: LegacyBugIcon,
10
8
  appearance: `var(--ds-icon-information, ${B500})`
11
9
  });
12
10
  }
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import LegacyMegaphoneWithStarIcon from '@atlaskit/legacy-custom-icons/megaphone-star-icon';
3
2
  import MegaphoneIcon from '@atlaskit/icon/core/megaphone';
4
3
  import { IconWrapper } from './IconWrapper';
5
4
  import { Y200 } from '@atlaskit/theme/colors';
6
5
  export default function WhatsNewIconImprovement() {
7
6
  return /*#__PURE__*/React.createElement(IconWrapper, {
8
7
  Icon: MegaphoneIcon,
9
- LegacyIcon: LegacyMegaphoneWithStarIcon,
10
8
  appearance: `var(--ds-icon-warning, ${Y200})`
11
9
  });
12
10
  }
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import LegacyMegaphoneIcon from '@atlaskit/legacy-custom-icons/megaphone-icon';
3
2
  import MegaphoneIcon from '@atlaskit/icon/core/megaphone';
4
3
  import { IconWrapper } from './IconWrapper';
5
4
  import { N400 } from '@atlaskit/theme/colors';
6
5
  export default function WhatsNewIconNew() {
7
6
  return /*#__PURE__*/React.createElement(IconWrapper, {
8
7
  Icon: MegaphoneIcon,
9
- LegacyIcon: LegacyMegaphoneIcon,
10
8
  appearance: `var(--ds-icon, ${N400})`
11
9
  });
12
10
  }
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import LegacyDeleteIcon from '@atlaskit/legacy-custom-icons/delete-icon';
3
2
  import DeleteIcon from '@atlaskit/icon/core/delete';
4
3
  import { IconWrapper } from './IconWrapper';
5
4
  import { N700 } from '@atlaskit/theme/colors';
6
5
  export default function WhatsNewIconRemoved() {
7
6
  return /*#__PURE__*/React.createElement(IconWrapper, {
8
7
  Icon: DeleteIcon,
9
- LegacyIcon: LegacyDeleteIcon,
10
8
  appearance: `var(--ds-icon-disabled, ${N700})`
11
9
  });
12
10
  }
@@ -10,7 +10,7 @@ import { LoadingErrorMessage, LoadingErrorButtonContainer, LoadingErrorHeading }
10
10
  const ANALYTICS_CONTEXT_DATA = {
11
11
  componentName: 'ArticleLoadingFail',
12
12
  packageName: "@atlaskit/help",
13
- packageVersion: "9.2.0"
13
+ packageVersion: "0.0.0-development"
14
14
  };
15
15
  export const ArticleLoadingFail = ({
16
16
  onTryAgainButtonClick,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  const ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulNoButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "9.2.0"
9
+ packageVersion: "0.0.0-development"
10
10
  };
11
11
  export const ArticleWasHelpfulNoButton = ({
12
12
  isSelected = false,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  const ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulYesButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "9.2.0"
9
+ packageVersion: "0.0.0-development"
10
10
  };
11
11
  export const ArticleWasHelpfulYesButton = ({
12
12
  isSelected = false,
@@ -14,7 +14,7 @@ import Form, { Field, CheckboxField, FormFooter } from '@atlaskit/form';
14
14
  import { RadioGroup } from '@atlaskit/radio';
15
15
  import { Checkbox } from '@atlaskit/checkbox';
16
16
  import TextArea from '@atlaskit/textarea';
17
- import CheckCircleIcon from '@atlaskit/icon/core/migration/status-success--check-circle';
17
+ import CheckCircleIcon from '@atlaskit/icon/core/status-success';
18
18
  import { colors } from '@atlaskit/theme';
19
19
  import { Text } from '@atlaskit/primitives/compiled';
20
20
  import { messages } from '../../../../messages';
@@ -26,7 +26,7 @@ const FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
26
26
  const ANALYTICS_CONTEXT_DATA = {
27
27
  componentName: 'ArticleWasHelpfulForm',
28
28
  packageName: "@atlaskit/help",
29
- packageVersion: "9.2.0"
29
+ packageVersion: "0.0.0-development"
30
30
  };
31
31
  const buttonStyles = null;
32
32
  export const ArticleWasHelpfulForm = ({
@@ -60,7 +60,7 @@ export const HelpArticle = ({
60
60
  analyticsEvent.payload.attributes = {
61
61
  componentName: 'Article',
62
62
  packageName: "@atlaskit/help",
63
- packageVersion: "9.2.0"
63
+ packageVersion: "0.0.0-development"
64
64
  };
65
65
  if (onRelatedArticlesShowMoreClick) {
66
66
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { injectIntl } from 'react-intl-next';
3
3
  import { BODY_FORMAT_TYPES } from '@atlaskit/help-article';
4
4
  import HelpArticleContent from '@atlaskit/help-article';
5
- import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
5
+ import ShortcutIcon from '@atlaskit/icon/core/link-external';
6
6
  import { AnalyticsContext } from '@atlaskit/analytics-next';
7
7
  import Button from '@atlaskit/button';
8
8
  import { messages } from '../../../messages';
@@ -13,7 +13,7 @@ import { WhatsNewTypeTitle, WhatsNewTitleText, WhatsNewIconContainer, RelatedLin
13
13
  const analyticsContextData = {
14
14
  componentName: 'ArticlesListItem',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "9.2.0"
16
+ packageVersion: "0.0.0-development"
17
17
  };
18
18
  export const WhatsNewArticle = ({
19
19
  intl: {
@@ -1,15 +1,7 @@
1
- ._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
- ._19bv1b66{padding-left:var(--ds-space-050,4px)}
1
+
2
+ ._zulpu2gc{gap:var(--ds-space-100,8px)}._19bv1b66{padding-left:var(--ds-space-050,4px)}
3
3
  ._1e0c1o8l{display:inline-block}
4
- ._1e0c1ule{display:block}
5
- ._1hmsglyw{text-decoration-line:none}
6
- ._1reo15vq{overflow-x:hidden}
7
- ._4bfu1r31{text-decoration-color:currentColor}
8
- ._ajmmnqa1{text-decoration-style:solid}
9
- ._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
4
+ ._1e0c1txw{display:flex}
10
5
  ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
11
- ._o5724jg8{white-space:normal}
12
6
  ._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
13
- ._s7n4nkob{vertical-align:middle}
14
- ._syaz1fxt{color:var(--ds-text,#172b4d)}
15
- ._syaz1rc1{color:var(--ds-text-subtlest,#5e6c84)}
7
+ ._s7n4nkob{vertical-align:middle}
@@ -2,28 +2,24 @@
2
2
  import "./styled.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
- import { fontFallback } from '@atlaskit/theme/typography';
6
- import { N300, N800 } from '@atlaskit/theme/colors';
7
- const {
8
- body
9
- } = fontFallback;
10
- const whatsNewTypeTitleStyles = null;
5
+ import Heading from '@atlaskit/heading';
11
6
  export const WhatsNewTypeTitle = ({
12
7
  children
13
- }) => /*#__PURE__*/React.createElement("span", {
14
- className: ax(["_4bfu1r31 _1hmsglyw _ajmmnqa1 _11c82smr _syaz1rc1 _s7n4nkob _19bv1b66 _o5724jg8 _1reo15vq"])
8
+ }) => /*#__PURE__*/React.createElement(Heading, {
9
+ size: "xsmall",
10
+ as: "h3"
15
11
  }, children);
16
12
  const whatsNewIconContainerStyles = null;
17
13
  export const WhatsNewIconContainer = ({
18
14
  children
19
15
  }) => /*#__PURE__*/React.createElement("div", {
20
- className: ax(["_1e0c1ule _n3tdu2gc"])
16
+ className: ax(["_zulpu2gc _1e0c1txw _n3tdu2gc"])
21
17
  }, children);
22
- const whatsNewTitleText = null;
23
18
  export const WhatsNewTitleText = ({
24
19
  children
25
- }) => /*#__PURE__*/React.createElement("span", {
26
- className: ax(["_4bfu1r31 _1hmsglyw _ajmmnqa1 _11c82smr _syaz1fxt _k48p1pd9 _o5724jg8 _1reo15vq _n3tdu2gc _1e0c1ule"])
20
+ }) => /*#__PURE__*/React.createElement(Heading, {
21
+ size: "xsmall",
22
+ as: "h4"
27
23
  }, children);
28
24
  const relatedLinkContainerStyles = null;
29
25
  export const RelatedLinkContainer = ({
@@ -26,7 +26,8 @@ const articlesList = ({
26
26
  articles = [],
27
27
  minItemsToDisplay = MIN_ITEMS_TO_DISPLAY,
28
28
  numberOfArticlesToDisplay = MIN_ITEMS_TO_DISPLAY,
29
- onArticlesListItemClick
29
+ onArticlesListItemClick,
30
+ firstExpandedArticleRef
30
31
  }) => {
31
32
  const isExpanded = numberOfArticlesToDisplay > minItemsToDisplay;
32
33
  return articles ? /*#__PURE__*/React.createElement(Box, {
@@ -35,6 +36,8 @@ const articlesList = ({
35
36
  role: "list"
36
37
  }, articles.slice(0, numberOfArticlesToDisplay).map((article, index) => {
37
38
  const isVisible = index < minItemsToDisplay || isExpanded;
39
+ // The first expanded article is at index minItemsToDisplay
40
+ const isFirstExpandedArticle = index === minItemsToDisplay;
38
41
  return /*#__PURE__*/React.createElement(Box, {
39
42
  as: "li",
40
43
  xcss: listStyles,
@@ -55,7 +58,8 @@ const articlesList = ({
55
58
  href: article.href,
56
59
  trustFactors: article.trustFactors,
57
60
  source: article.source,
58
- lastPublished: article.lastPublished
61
+ lastPublished: article.lastPublished,
62
+ ref: isFirstExpandedArticle ? firstExpandedArticleRef : undefined
59
63
  }));
60
64
  })) : null;
61
65
  };
@@ -1,14 +1,15 @@
1
- import React from 'react';
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/migration/link-external--shortcut';
5
+ import ShortcutIcon from '@atlaskit/icon/core/link-external';
5
6
  import { injectIntl } from 'react-intl-next';
6
- import LikeIcon from '@atlaskit/icon/core/migration/thumbs-up--like';
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
  const ANALYTICS_CONTEXT_DATA = {
9
10
  componentName: 'ArticlesListItem',
10
11
  packageName: "@atlaskit/help",
11
- packageVersion: "9.2.0"
12
+ packageVersion: "0.0.0-development"
12
13
  };
13
14
  const highlightText = text => {
14
15
  if (!text) {
@@ -27,7 +28,7 @@ const highlightText = text => {
27
28
  });
28
29
  return sections;
29
30
  };
30
- export const ArticlesListItem = ({
31
+ export const ArticlesListItem = /*#__PURE__*/forwardRef(({
31
32
  styles,
32
33
  title,
33
34
  description,
@@ -36,7 +37,7 @@ export const ArticlesListItem = ({
36
37
  trustFactors,
37
38
  source,
38
39
  lastPublished
39
- }) => {
40
+ }, ref) => {
40
41
  const {
41
42
  createAnalyticsEvent
42
43
  } = useAnalyticsEvents();
@@ -58,6 +59,7 @@ export const ArticlesListItem = ({
58
59
  const isSourceVisible = source != null;
59
60
  const isLastPublishedVisible = lastPublished != null && lastPublished !== '';
60
61
  return /*#__PURE__*/React.createElement(ArticlesListItemWrapper, {
62
+ ref: ref,
61
63
  styles: styles,
62
64
  "aria-disabled": "false",
63
65
  role: "button",
@@ -80,11 +82,15 @@ export const ArticlesListItem = ({
80
82
  label: "Like",
81
83
  LEGACY_size: "small"
82
84
  }), trustFactors.helpfulCount)));
83
- };
84
- const ArticlesListItemWithContext = props => {
85
+ });
86
+ const ArticlesListItemWithContext = /*#__PURE__*/forwardRef((props, ref) => {
85
87
  return /*#__PURE__*/React.createElement(AnalyticsContext, {
86
88
  data: ANALYTICS_CONTEXT_DATA
87
- }, /*#__PURE__*/React.createElement(ArticlesListItem, props));
88
- };
89
- const _default_1 = injectIntl(ArticlesListItemWithContext);
89
+ }, /*#__PURE__*/React.createElement(ArticlesListItem, _extends({
90
+ ref: ref
91
+ }, props)));
92
+ });
93
+ const _default_1 = injectIntl(ArticlesListItemWithContext, {
94
+ forwardRef: true
95
+ });
90
96
  export default _default_1;
@@ -11,15 +11,16 @@ const {
11
11
  body
12
12
  } = fontFallback;
13
13
  const articlesListItemWrapperStyles = null;
14
- export const ArticlesListItemWrapper = ({
14
+ export const ArticlesListItemWrapper = /*#__PURE__*/React.forwardRef(({
15
15
  styles,
16
16
  children,
17
17
  ...rest
18
- }) => /*#__PURE__*/React.createElement("a", _extends({
18
+ }, ref) => /*#__PURE__*/React.createElement("a", _extends({
19
+ ref: ref,
19
20
  style: styles
20
21
  }, rest, {
21
22
  className: ax(["_4bfu1r31 _1hmsglyw _ajmmnqa1 _2rkofajl _kqswh2mm _vchhusvi _ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc _1e0c1ule _80omtlke _syaz1wmz _bfhkqtfy _7ehi1ssq _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 _irr314ae _1di61l7b"])
22
- }), children);
23
+ }), children));
23
24
  const articlesListItemContainerStyles = null;
24
25
  export const ArticlesListItemContainer = ({
25
26
  children
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useRef, useEffect, useCallback } from 'react';
2
2
  import ArticlesList from './ArticlesList';
3
3
  import ShowMoreButton from '../ShowMoreButton';
4
4
  import { ArticlesListContainer } from './styled';
@@ -12,6 +12,8 @@ const ArticleList = ({
12
12
  onToggleArticlesList
13
13
  }) => {
14
14
  const [showMoreToggled, setShowMoreToggled] = useState(true);
15
+ const firstExpandedArticleRef = useRef(null);
16
+ const isExpandingRef = useRef(false);
15
17
  const getMinItemsToDisplay = () => {
16
18
  return minItemsToDisplay ? minItemsToDisplay : MIN_ITEMS_TO_DISPLAY;
17
19
  };
@@ -24,7 +26,24 @@ const ArticleList = ({
24
26
  const getNumberOfArticlesToDisplay = showMoreToggeled => {
25
27
  return showMoreToggeled ? getMinItemsToDisplay() : getMaxItemsToDisplay();
26
28
  };
29
+
30
+ // Focus on the first newly revealed article after expansion
31
+ useEffect(() => {
32
+ if (isExpandingRef.current && !showMoreToggled) {
33
+ if (firstExpandedArticleRef.current) {
34
+ firstExpandedArticleRef.current.focus();
35
+ }
36
+ isExpandingRef.current = false;
37
+ }
38
+ }, [showMoreToggled]);
39
+ const setFirstExpandedArticleRef = useCallback(element => {
40
+ firstExpandedArticleRef.current = element;
41
+ }, []);
27
42
  const toggleArticlesList = (event, analyticsEvent) => {
43
+ // Track if we're expanding (going from collapsed to expanded)
44
+ if (showMoreToggled) {
45
+ isExpandingRef.current = true;
46
+ }
28
47
  setShowMoreToggled(!showMoreToggled);
29
48
  if (onToggleArticlesList) {
30
49
  onToggleArticlesList(event, analyticsEvent, !showMoreToggled);
@@ -36,7 +55,9 @@ const ArticleList = ({
36
55
  style: style,
37
56
  onArticlesListItemClick: onArticlesListItemClick,
38
57
  articles: articles,
39
- numberOfArticlesToDisplay: getNumberOfArticlesToDisplay(showMoreToggled)
58
+ numberOfArticlesToDisplay: getNumberOfArticlesToDisplay(showMoreToggled),
59
+ minItemsToDisplay: getMinItemsToDisplay(),
60
+ firstExpandedArticleRef: setFirstExpandedArticleRef
40
61
  }), articles.length > getMinItemsToDisplay() && /*#__PURE__*/React.createElement(ShowMoreButton, {
41
62
  minItemsToDisplay: getMinItemsToDisplay(),
42
63
  maxItemsToDisplay: getMaxItemsToDisplay(),
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { injectIntl } from 'react-intl-next';
3
3
  import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
4
4
  import { Transition } from 'react-transition-group';
5
- import ArrowleftIcon from '@atlaskit/icon/core/migration/arrow-left';
5
+ import ArrowleftIcon from '@atlaskit/icon/core/arrow-left';
6
6
  import Button from '@atlaskit/button/standard-button';
7
7
  import { messages } from '../../messages';
8
8
  import { BackButtonContainer, BACK_BUTTON_CONTAINER_TRANSITION_DURATION_MS } from '../styled';
@@ -50,7 +50,7 @@ const BackButtonWithContext = props => {
50
50
  data: {
51
51
  componentName: 'backButton',
52
52
  packageName: "@atlaskit/help",
53
- packageVersion: "9.2.0"
53
+ packageVersion: "0.0.0-development"
54
54
  }
55
55
  }, /*#__PURE__*/React.createElement(BackButton, props));
56
56
  };
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
- import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
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';
@@ -7,7 +7,7 @@ import { HelpContentButtonContainer, HelpContentButtonIcon, HelpContentButtonTex
7
7
  const analitycsContextData = {
8
8
  componentName: 'HelpContentButton',
9
9
  packageName: "@atlaskit/help",
10
- packageVersion: "9.2.0"
10
+ packageVersion: "0.0.0-development"
11
11
  };
12
12
  const HelpContentButton = ({
13
13
  id = '',
@@ -48,7 +48,7 @@ const HelpContentButton = ({
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
  const target = href ? openInSameTab ? '_self' : '_blank' : undefined;
54
54
  return /*#__PURE__*/React.createElement(AnalyticsContext, {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import LightbulbIcon from '@atlaskit/icon/core/migration/lightbulb';
2
+ import LightbulbIcon from '@atlaskit/icon/core/lightbulb';
3
3
  import { Inline } from '@atlaskit/primitives/compiled';
4
4
  import { useIntl } from 'react-intl-next';
5
5
  import { NeedMoreHelpContainer, NeedMoreHelpContent, HelpAskAI } from './styled';