@nauedu/frontend-component-header 14.0.0-semantically-released → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.rst +107 -33
  2. package/dist/Avatar.js +5 -7
  3. package/dist/Avatar.js.map +1 -1
  4. package/dist/DesktopHeader.js +88 -71
  5. package/dist/DesktopHeader.js.map +1 -1
  6. package/dist/Header.js +79 -39
  7. package/dist/Header.js.map +1 -1
  8. package/dist/Header.messages.js +15 -0
  9. package/dist/Header.messages.js.map +1 -1
  10. package/dist/Header.test.jsx +67 -90
  11. package/dist/Icons.js +1 -2
  12. package/dist/Icons.js.map +1 -1
  13. package/dist/Logo.js +11 -21
  14. package/dist/Logo.js.map +1 -1
  15. package/dist/Menu/Menu.js +42 -88
  16. package/dist/Menu/Menu.js.map +1 -1
  17. package/dist/Menu/index.js.map +1 -1
  18. package/dist/MobileHeader.js +80 -76
  19. package/dist/MobileHeader.js.map +1 -1
  20. package/dist/__snapshots__/Header.test.jsx.snap +8 -8
  21. package/dist/generic/messages.js.map +1 -1
  22. package/dist/i18n/index.js +1 -30
  23. package/dist/i18n/index.js.map +1 -1
  24. package/dist/index.js +2 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.scss +11 -1
  27. package/dist/learning-header/AnonymousUserMenu.js +3 -5
  28. package/dist/learning-header/AnonymousUserMenu.js.map +1 -1
  29. package/dist/learning-header/AuthenticatedUserDropdown.js +8 -10
  30. package/dist/learning-header/AuthenticatedUserDropdown.js.map +1 -1
  31. package/dist/learning-header/LearningHeader.js +22 -42
  32. package/dist/learning-header/LearningHeader.js.map +1 -1
  33. package/dist/learning-header/_header.scss +5 -2
  34. package/dist/learning-header/data/api.js +30 -42
  35. package/dist/learning-header/data/api.js.map +1 -1
  36. package/dist/learning-header/data/api.test.js +124 -175
  37. package/dist/learning-header/data/api.test.js.map +1 -1
  38. package/dist/learning-header/messages.js.map +1 -1
  39. package/dist/setupTest.js +9 -13
  40. package/dist/studio-header/BrandNav.js +21 -0
  41. package/dist/studio-header/BrandNav.js.map +1 -0
  42. package/dist/studio-header/CourseLockUp.js +45 -0
  43. package/dist/studio-header/CourseLockUp.js.map +1 -0
  44. package/dist/studio-header/HeaderBody.js +131 -0
  45. package/dist/studio-header/HeaderBody.js.map +1 -0
  46. package/dist/studio-header/MobileHeader.js +79 -0
  47. package/dist/studio-header/MobileHeader.js.map +1 -0
  48. package/dist/studio-header/MobileMenu.js +45 -0
  49. package/dist/studio-header/MobileMenu.js.map +1 -0
  50. package/dist/studio-header/NavDropdownMenu.js +30 -0
  51. package/dist/studio-header/NavDropdownMenu.js.map +1 -0
  52. package/dist/studio-header/StudioHeader.js +72 -0
  53. package/dist/studio-header/StudioHeader.js.map +1 -0
  54. package/dist/studio-header/StudioHeader.scss +49 -0
  55. package/dist/studio-header/UserMenu.js +55 -0
  56. package/dist/studio-header/UserMenu.js.map +1 -0
  57. package/dist/studio-header/index.js +3 -0
  58. package/dist/studio-header/index.js.map +1 -0
  59. package/dist/studio-header/messages.js +60 -0
  60. package/dist/studio-header/messages.js.map +1 -0
  61. package/dist/studio-header/utils.js +29 -0
  62. package/dist/studio-header/utils.js.map +1 -0
  63. package/dist/test-utils.js +26 -0
  64. package/dist/test-utils.js.map +1 -0
  65. package/package.json +33 -33
  66. package/dist/i18n/messages/ar.json +0 -30
  67. package/dist/i18n/messages/ca.json +0 -1
  68. package/dist/i18n/messages/es_419.json +0 -30
  69. package/dist/i18n/messages/fr.json +0 -30
  70. package/dist/i18n/messages/fr_CA.json +0 -30
  71. package/dist/i18n/messages/he.json +0 -1
  72. package/dist/i18n/messages/id.json +0 -1
  73. package/dist/i18n/messages/ko_KR.json +0 -2
  74. package/dist/i18n/messages/pl.json +0 -1
  75. package/dist/i18n/messages/pt_BR.json +0 -2
  76. package/dist/i18n/messages/ru.json +0 -1
  77. package/dist/i18n/messages/th.json +0 -1
  78. package/dist/i18n/messages/uk.json +0 -1
  79. package/dist/i18n/messages/zh_CN.json +0 -30
package/README.rst CHANGED
@@ -2,22 +2,42 @@
2
2
  frontend-component-header
3
3
  #########################
4
4
 
5
- |Build Status| |Codecov| |npm_version| |npm_downloads| |license| |semantic-release|
5
+ |license| |Build Status| |Codecov| |npm_version| |npm_downloads| |semantic-release|
6
6
 
7
7
  ********
8
- Overview
8
+ Purpose
9
9
  ********
10
10
 
11
11
  A generic header for Open edX micro-frontend applications.
12
12
 
13
13
  ************
14
- Requirements
14
+ Getting Started
15
15
  ************
16
16
 
17
- This component uses ``@edx/frontend-platform`` services such as i18n, analytics, configuration, and the ``AppContext`` React component, and expects that it has been loaded into a micro-frontend that has been properly initialized via ``@edx/frontend-platform``'s ``initialize`` function. `Please visit the frontend template application to see an example. <https://github.com/edx/frontend-template-application/blob/master/src/index.jsx>`_
17
+ Prerequisites
18
+ =============
19
+
20
+ The `devstack`_ is currently recommended as a development environment for your
21
+ new MFE. If you start it with ``make dev.up.lms`` that should give you
22
+ everything you need as a companion to this frontend.
23
+
24
+ Note that it is also possible to use `Tutor`_ to develop an MFE. You can refer
25
+ to the `relevant tutor-mfe documentation`_ to get started using it.
26
+
27
+ .. _Devstack: https://github.com/openedx/devstack
28
+
29
+ .. _Tutor: https://github.com/overhangio/tutor
30
+
31
+ .. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe#mfe-development
32
+
33
+ Requirements
34
+ ============
35
+
36
+ This component uses ``@edx/frontend-platform`` services such as i18n, analytics, configuration, and the ``AppContext`` React component, and expects that it has been loaded into a micro-frontend that has been properly initialized via ``@edx/frontend-platform``'s ``initialize`` function. `Please visit the frontend template application to see an example. <https://github.com/openedx/frontend-template-application/blob/master/src/index.jsx>`_
37
+
18
38
 
19
39
  Environment Variables
20
- =====================
40
+ ====================
21
41
 
22
42
  * ``LMS_BASE_URL`` - The URL of the LMS of your Open edX instance.
23
43
  * ``LOGOUT_URL`` - The URL of the API endpoint which performs a user logout.
@@ -26,25 +46,48 @@ Environment Variables
26
46
  Defaults to "localhost" in development.
27
47
  * ``LOGO_URL`` - The URL of the site's logo. This logo is displayed in the header.
28
48
  * ``ORDER_HISTORY_URL`` - The URL of the order history page.
49
+ * ``ACCOUNT_PROFILE_URL`` - The URL of the account profile page.
50
+ * ``ACCOUNT_SETTINGS_URL`` - The URL of the account settings page.
29
51
  * ``AUTHN_MINIMAL_HEADER`` - A boolean flag which hides the main menu, user menu, and logged-out
30
52
  menu items when truthy. This is intended to be used in micro-frontends like
31
53
  frontend-app-authentication in which these menus are considered distractions from the user's task.
32
- * ``ENABLE_ORG_LOGO`` - A boolean flag to enable the display of the org logo on the center of the
33
- header nav bar. Defaults to **false**
34
54
 
35
- ************
36
55
  Installation
37
- ************
56
+ ============
38
57
 
39
58
  To install this header into your Open edX micro-frontend, run the following command in your MFE:
40
59
 
41
- ``npm i --save @nauedu/frontend-component-header``
60
+ ``npm i --save @edx/frontend-component-header``
42
61
 
43
62
  This will make the component available to be imported into your application.
44
63
 
45
- *****
64
+ Cloning and Startup
65
+ ===================
66
+
67
+ .. code-block::
68
+
69
+
70
+ 1. Clone your new repo:
71
+
72
+ ``git clone https://github.com/openedx/frontend-component-header.git``
73
+
74
+ 2. Use node v18.x.
75
+
76
+ The current version of the micro-frontend build scripts support node 18.
77
+ Using other major versions of node *may* work, but this is unsupported. For
78
+ convenience, this repository includes an .nvmrc file to help in setting the
79
+ correct node version via `nvm <https://github.com/nvm-sh/nvm>`_.
80
+
81
+ 3. Install npm dependencies:
82
+
83
+ ``cd frontend-component-header && npm ci``
84
+
85
+ 4. Start the dev server:
86
+
87
+ ``npm start``
88
+
46
89
  Usage
47
- *****
90
+ =====
48
91
 
49
92
  This library has the following exports:
50
93
 
@@ -55,17 +98,15 @@ This library has the following exports:
55
98
  Examples
56
99
  ========
57
100
 
58
- * `An example of component and messages usage. <https://github.com/edx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx#L21>`_
59
- * `An example of SCSS file usage. <https://github.com/edx/frontend-template-application/blob/3cd5485bf387b8c479baf6b02bf59e3061dc3465/src/index.scss#L8>`_
101
+ * `An example of component and messages usage. <https://github.com/openedx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx#L21>`_
102
+ * `An example of SCSS file usage. <https://github.com/openedx/frontend-template-application/blob/3cd5485bf387b8c479baf6b02bf59e3061dc3465/src/index.scss#L8>`_
60
103
 
61
-
62
- ***********
63
104
  Development
64
- ***********
105
+ ===========
65
106
 
66
107
  Install dependencies::
67
108
 
68
- npm i
109
+ npm ci
69
110
 
70
111
  Start the development server::
71
112
 
@@ -75,29 +116,62 @@ Build a production distribution::
75
116
 
76
117
  npm run build
77
118
 
78
- ***********
79
- Publishing to npmjs.com
80
- ***********
119
+ License
120
+ =======
121
+
122
+ The code in this repository is licensed under the AGPLv3 unless otherwise
123
+ noted.
124
+
125
+ Please see `LICENSE <LICENSE>`_ for details.
126
+
127
+ Contributing
128
+ ============
129
+
130
+ Contributions are very welcome. Please read `How To Contribute`_ for details.
131
+
132
+ .. _How To Contribute: https://openedx.org/r/how-to-contribute
133
+
134
+ This project is currently accepting all types of contributions, bug fixes,
135
+ security fixes, maintenance work, or new features. However, please make sure
136
+ to have a discussion about your new feature idea with the maintainers prior to
137
+ beginning development to maximize the chances of your change being accepted.
138
+ You can start a conversation by creating a new issue on this repo summarizing
139
+ your idea.
140
+
141
+ Getting Help
142
+ ===========
143
+
144
+ If you're having trouble, we have discussion forums at
145
+ https://discuss.openedx.org where you can connect with others in the community.
146
+
147
+ Our real-time conversations are on Slack. You can request a `Slack
148
+ invitation`_, then join our `community Slack workspace`_. Because this is a
149
+ frontend repository, the best place to discuss it would be in the `#wg-frontend
150
+ channel`_.
81
151
 
82
- Any changes to this library have to be pushed to npmjs.com to be reflected on the build.
152
+ For anything non-trivial, the best path is to open an issue in this repository
153
+ with as many details about the issue you are facing as you can provide.
83
154
 
84
- Publish to npm::
155
+ https://github.com/openedx/frontend-component-header/issues
85
156
 
86
- npm publish
157
+ For more information about these options, see the `Getting Help`_ page.
87
158
 
159
+ .. _Slack invitation: https://openedx.org/slack
160
+ .. _community Slack workspace: https://openedx.slack.com/
161
+ .. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
162
+ .. _Getting Help: https://openedx.org/community/connect
88
163
 
89
- ***********
90
- Deploy in production
91
- ***********
92
- To replace the default edx header with the new one, use one of the following instructions:
164
+ The Open edX Code of Conduct
165
+ ============================
93
166
 
94
- Add the necessary settings to the mfe_brand plugin::
167
+ All community members are expected to follow the `Open edX Code of Conduct`_.
95
168
 
96
- RUN npm install '@edx/frontend-component-header@npm:@nauedu/frontend-component-header'
169
+ .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
97
170
 
98
- Alternatively, you can specify the version::
171
+ Reporting Security Issues
172
+ =========================
99
173
 
100
- RUN npm install '@edx/frontend-component-header@npm:@nauedu/frontend-component-header@1.0.0'
174
+ Please do not report security issues in public. Please email security@openedx.org.
101
175
 
102
176
  .. |Build Status| image:: https://api.travis-ci.com/edx/frontend-component-header.svg?branch=master
103
177
  :target: https://travis-ci.com/edx/frontend-component-header
@@ -110,4 +184,4 @@ Alternatively, you can specify the version::
110
184
  .. |license| image:: https://img.shields.io/npm/l/@edx/frontend-component-header.svg
111
185
  :target: @edx/frontend-component-header
112
186
  .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
113
- :target: https://github.com/semantic-release/semantic-release
187
+ :target: https://github.com/semantic-release/semantic-release
package/dist/Avatar.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { AvatarIcon } from './Icons';
4
-
5
- function Avatar(_ref) {
4
+ var Avatar = function Avatar(_ref) {
6
5
  var size = _ref.size,
7
- src = _ref.src,
8
- alt = _ref.alt,
9
- className = _ref.className;
6
+ src = _ref.src,
7
+ alt = _ref.alt,
8
+ className = _ref.className;
10
9
  var avatar = src ? /*#__PURE__*/React.createElement("img", {
11
10
  className: "d-block w-100 h-100",
12
11
  src: src,
@@ -27,8 +26,7 @@ function Avatar(_ref) {
27
26
  },
28
27
  className: "avatar overflow-hidden d-inline-flex rounded-circle ".concat(className)
29
28
  }, avatar);
30
- }
31
-
29
+ };
32
30
  Avatar.propTypes = {
33
31
  src: PropTypes.string,
34
32
  size: PropTypes.string,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Avatar.jsx"],"names":["React","PropTypes","AvatarIcon","Avatar","size","src","alt","className","avatar","width","height","propTypes","string","defaultProps"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAASC,UAAT,QAA2B,SAA3B;;AAEA,SAASC,MAAT,OAKG;AAAA,MAJDC,IAIC,QAJDA,IAIC;AAAA,MAHDC,GAGC,QAHDA,GAGC;AAAA,MAFDC,GAEC,QAFDA,GAEC;AAAA,MADDC,SACC,QADDA,SACC;AACD,MAAMC,MAAM,GAAGH,GAAG,gBAChB;AAAK,IAAA,SAAS,EAAC,qBAAf;AAAqC,IAAA,GAAG,EAAEA,GAA1C;AAA+C,IAAA,GAAG,EAAEC;AAApD,IADgB,gBAGhB,oBAAC,UAAD;AAAY,IAAA,KAAK,EAAE;AAAEG,MAAAA,KAAK,EAAEL,IAAT;AAAeM,MAAAA,MAAM,EAAEN;AAAvB,KAAnB;AAAkD,IAAA,IAAI,EAAC,KAAvD;AAA6D,uBAA7D;AAAyE,IAAA,SAAS,EAAC;AAAnF,IAHF;AAMA,sBACE;AACE,IAAA,KAAK,EAAE;AAAEM,MAAAA,MAAM,EAAEN,IAAV;AAAgBK,MAAAA,KAAK,EAAEL;AAAvB,KADT;AAEE,IAAA,SAAS,gEAAyDG,SAAzD;AAFX,KAIGC,MAJH,CADF;AAQD;;AAEDL,MAAM,CAACQ,SAAP,GAAmB;AACjBN,EAAAA,GAAG,EAAEJ,SAAS,CAACW,MADE;AAEjBR,EAAAA,IAAI,EAAEH,SAAS,CAACW,MAFC;AAGjBN,EAAAA,GAAG,EAAEL,SAAS,CAACW,MAHE;AAIjBL,EAAAA,SAAS,EAAEN,SAAS,CAACW;AAJJ,CAAnB;AAOAT,MAAM,CAACU,YAAP,GAAsB;AACpBR,EAAAA,GAAG,EAAE,IADe;AAEpBD,EAAAA,IAAI,EAAE,MAFc;AAGpBE,EAAAA,GAAG,EAAE,IAHe;AAIpBC,EAAAA,SAAS,EAAE;AAJS,CAAtB;AAOA,eAAeJ,MAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { AvatarIcon } from './Icons';\n\nfunction Avatar({\n size,\n src,\n alt,\n className,\n}) {\n const avatar = src ? (\n <img className=\"d-block w-100 h-100\" src={src} alt={alt} />\n ) : (\n <AvatarIcon style={{ width: size, height: size }} role=\"img\" aria-hidden focusable=\"false\" />\n );\n\n return (\n <span\n style={{ height: size, width: size }}\n className={`avatar overflow-hidden d-inline-flex rounded-circle ${className}`}\n >\n {avatar}\n </span>\n );\n}\n\nAvatar.propTypes = {\n src: PropTypes.string,\n size: PropTypes.string,\n alt: PropTypes.string,\n className: PropTypes.string,\n};\n\nAvatar.defaultProps = {\n src: null,\n size: '2rem',\n alt: null,\n className: null,\n};\n\nexport default Avatar;\n"],"file":"Avatar.js"}
1
+ {"version":3,"file":"Avatar.js","names":["React","PropTypes","AvatarIcon","Avatar","_ref","size","src","alt","className","avatar","createElement","style","width","height","role","focusable","concat","propTypes","string","defaultProps"],"sources":["../src/Avatar.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { AvatarIcon } from './Icons';\n\nconst Avatar = ({\n size,\n src,\n alt,\n className,\n}) => {\n const avatar = src ? (\n <img className=\"d-block w-100 h-100\" src={src} alt={alt} />\n ) : (\n <AvatarIcon style={{ width: size, height: size }} role=\"img\" aria-hidden focusable=\"false\" />\n );\n\n return (\n <span\n style={{ height: size, width: size }}\n className={`avatar overflow-hidden d-inline-flex rounded-circle ${className}`}\n >\n {avatar}\n </span>\n );\n};\n\nAvatar.propTypes = {\n src: PropTypes.string,\n size: PropTypes.string,\n alt: PropTypes.string,\n className: PropTypes.string,\n};\n\nAvatar.defaultProps = {\n src: null,\n size: '2rem',\n alt: null,\n className: null,\n};\n\nexport default Avatar;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,UAAU,QAAQ,SAAS;AAEpC,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAKN;EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IACHC,SAAS,GAAAJ,IAAA,CAATI,SAAS;EAET,IAAMC,MAAM,GAAGH,GAAG,gBAChBN,KAAA,CAAAU,aAAA;IAAKF,SAAS,EAAC,qBAAqB;IAACF,GAAG,EAAEA,GAAI;IAACC,GAAG,EAAEA;EAAI,CAAE,CAAC,gBAE3DP,KAAA,CAAAU,aAAA,CAACR,UAAU;IAACS,KAAK,EAAE;MAAEC,KAAK,EAAEP,IAAI;MAAEQ,MAAM,EAAER;IAAK,CAAE;IAACS,IAAI,EAAC,KAAK;IAAC,mBAAW;IAACC,SAAS,EAAC;EAAO,CAAE,CAC7F;EAED,oBACEf,KAAA,CAAAU,aAAA;IACEC,KAAK,EAAE;MAAEE,MAAM,EAAER,IAAI;MAAEO,KAAK,EAAEP;IAAK,CAAE;IACrCG,SAAS,yDAAAQ,MAAA,CAAyDR,SAAS;EAAG,GAE7EC,MACG,CAAC;AAEX,CAAC;AAEDN,MAAM,CAACc,SAAS,GAAG;EACjBX,GAAG,EAAEL,SAAS,CAACiB,MAAM;EACrBb,IAAI,EAAEJ,SAAS,CAACiB,MAAM;EACtBX,GAAG,EAAEN,SAAS,CAACiB,MAAM;EACrBV,SAAS,EAAEP,SAAS,CAACiB;AACvB,CAAC;AAEDf,MAAM,CAACgB,YAAY,GAAG;EACpBb,GAAG,EAAE,IAAI;EACTD,IAAI,EAAE,MAAM;EACZE,GAAG,EAAE,IAAI;EACTC,SAAS,EAAE;AACb,CAAC;AAED,eAAeL,MAAM","ignoreList":[]}
@@ -1,75 +1,60 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
-
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
-
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
-
7
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8
-
4
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
-
11
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
-
13
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
-
15
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
-
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
17
9
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
-
19
10
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
20
-
21
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
-
23
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
-
11
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
13
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
15
  import React from 'react';
26
16
  import PropTypes from 'prop-types';
27
17
  import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
28
- import { getConfig } from '@edx/frontend-platform'; // Local Components
18
+ import { getConfig } from '@edx/frontend-platform';
29
19
 
20
+ // Local Components
30
21
  import { Menu, MenuTrigger, MenuContent } from './Menu';
31
22
  import Avatar from './Avatar';
32
- import { LinkedLogo, Logo } from './Logo'; // i18n
23
+ import { LinkedLogo, Logo } from './Logo';
33
24
 
34
- import messages from './Header.messages'; // Assets
25
+ // i18n
26
+ import messages from './Header.messages';
35
27
 
28
+ // Assets
36
29
  import { CaretIcon } from './Icons';
37
-
38
30
  var DesktopHeader = /*#__PURE__*/function (_React$Component) {
39
- _inherits(DesktopHeader, _React$Component);
40
-
41
- var _super = _createSuper(DesktopHeader);
42
-
43
31
  function DesktopHeader(props) {
44
32
  _classCallCheck(this, DesktopHeader);
45
-
46
33
  // eslint-disable-line no-useless-constructor
47
- return _super.call(this, props);
34
+ return _callSuper(this, DesktopHeader, [props]);
48
35
  }
49
-
50
- _createClass(DesktopHeader, [{
51
- key: "renderMainMenu",
52
- value: function renderMainMenu() {
53
- var mainMenu = this.props.mainMenu; // Nodes are accepted as a prop
54
-
55
- if (!Array.isArray(mainMenu)) {
56
- return mainMenu;
36
+ _inherits(DesktopHeader, _React$Component);
37
+ return _createClass(DesktopHeader, [{
38
+ key: "renderMenu",
39
+ value: function renderMenu(menu) {
40
+ // Nodes are accepted as a prop
41
+ if (!Array.isArray(menu)) {
42
+ return menu;
57
43
  }
58
-
59
- return mainMenu.map(function (menuItem) {
44
+ return menu.map(function (menuItem) {
60
45
  var type = menuItem.type,
61
- href = menuItem.href,
62
- content = menuItem.content,
63
- submenuContent = menuItem.submenuContent;
64
-
46
+ href = menuItem.href,
47
+ content = menuItem.content,
48
+ submenuContent = menuItem.submenuContent,
49
+ disabled = menuItem.disabled,
50
+ isActive = menuItem.isActive;
65
51
  if (type === 'item') {
66
52
  return /*#__PURE__*/React.createElement("a", {
67
53
  key: "".concat(type, "-").concat(content),
68
- className: "nav-link",
54
+ className: "nav-link".concat(disabled ? ' disabled' : '').concat(isActive ? ' active' : ''),
69
55
  href: href
70
56
  }, content);
71
57
  }
72
-
73
58
  return /*#__PURE__*/React.createElement(Menu, {
74
59
  key: "".concat(type, "-").concat(content),
75
60
  tag: "div",
@@ -88,14 +73,26 @@ var DesktopHeader = /*#__PURE__*/function (_React$Component) {
88
73
  }, submenuContent));
89
74
  });
90
75
  }
76
+ }, {
77
+ key: "renderMainMenu",
78
+ value: function renderMainMenu() {
79
+ var mainMenu = this.props.mainMenu;
80
+ return this.renderMenu(mainMenu);
81
+ }
82
+ }, {
83
+ key: "renderSecondaryMenu",
84
+ value: function renderSecondaryMenu() {
85
+ var secondaryMenu = this.props.secondaryMenu;
86
+ return this.renderMenu(secondaryMenu);
87
+ }
91
88
  }, {
92
89
  key: "renderUserMenu",
93
90
  value: function renderUserMenu() {
94
91
  var _this$props = this.props,
95
- userMenu = _this$props.userMenu,
96
- avatar = _this$props.avatar,
97
- username = _this$props.username,
98
- intl = _this$props.intl;
92
+ userMenu = _this$props.userMenu,
93
+ avatar = _this$props.avatar,
94
+ username = _this$props.username,
95
+ intl = _this$props.intl;
99
96
  return /*#__PURE__*/React.createElement(Menu, {
100
97
  transitionClassName: "menu-dropdown",
101
98
  transitionTimeout: 250
@@ -116,15 +113,32 @@ var DesktopHeader = /*#__PURE__*/function (_React$Component) {
116
113
  focusable: "false"
117
114
  })), /*#__PURE__*/React.createElement(MenuContent, {
118
115
  className: "mb-0 dropdown-menu show dropdown-menu-right pin-right shadow py-2"
119
- }, userMenu.map(function (_ref) {
120
- var type = _ref.type,
121
- href = _ref.href,
122
- content = _ref.content;
123
- return /*#__PURE__*/React.createElement("a", {
124
- className: "dropdown-".concat(type),
125
- key: "".concat(type, "-").concat(content),
126
- href: href
127
- }, content);
116
+ }, userMenu.map(function (group, index) {
117
+ return (
118
+ /*#__PURE__*/
119
+ // eslint-disable-next-line react/jsx-no-comment-textnodes,react/no-array-index-key
120
+ React.createElement(React.Fragment, {
121
+ key: index
122
+ }, group.heading && /*#__PURE__*/React.createElement("div", {
123
+ className: "dropdown-header",
124
+ role: "heading",
125
+ "aria-level": "1"
126
+ }, group.heading), group.items.map(function (_ref) {
127
+ var type = _ref.type,
128
+ content = _ref.content,
129
+ href = _ref.href,
130
+ disabled = _ref.disabled,
131
+ isActive = _ref.isActive;
132
+ return /*#__PURE__*/React.createElement("a", {
133
+ className: "dropdown-".concat(type).concat(isActive ? ' active' : '').concat(disabled ? ' disabled' : ''),
134
+ key: "".concat(type, "-").concat(content),
135
+ href: href
136
+ }, content);
137
+ }), index < userMenu.length - 1 && /*#__PURE__*/React.createElement("div", {
138
+ className: "dropdown-divider",
139
+ role: "separator"
140
+ }))
141
+ );
128
142
  })));
129
143
  }
130
144
  }, {
@@ -143,11 +157,11 @@ var DesktopHeader = /*#__PURE__*/function (_React$Component) {
143
157
  key: "render",
144
158
  value: function render() {
145
159
  var _this$props2 = this.props,
146
- logo = _this$props2.logo,
147
- logoAltText = _this$props2.logoAltText,
148
- logoDestination = _this$props2.logoDestination,
149
- loggedIn = _this$props2.loggedIn,
150
- intl = _this$props2.intl;
160
+ logo = _this$props2.logo,
161
+ logoAltText = _this$props2.logoAltText,
162
+ logoDestination = _this$props2.logoDestination,
163
+ loggedIn = _this$props2.loggedIn,
164
+ intl = _this$props2.intl;
151
165
  var logoProps = {
152
166
  src: logo,
153
167
  alt: logoAltText,
@@ -175,19 +189,21 @@ var DesktopHeader = /*#__PURE__*/function (_React$Component) {
175
189
  }, this.renderMainMenu()), /*#__PURE__*/React.createElement("nav", {
176
190
  "aria-label": intl.formatMessage(messages['header.label.secondary.nav']),
177
191
  className: "nav secondary-menu-container align-items-center ml-auto"
178
- }, loggedIn ? this.renderUserMenu() : this.renderLoggedOutItems()))));
192
+ }, loggedIn ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderSecondaryMenu(), this.renderUserMenu()) : this.renderLoggedOutItems()))));
179
193
  }
180
194
  }]);
181
-
182
- return DesktopHeader;
183
195
  }(React.Component);
184
-
185
196
  DesktopHeader.propTypes = {
186
197
  mainMenu: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
198
+ secondaryMenu: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
187
199
  userMenu: PropTypes.arrayOf(PropTypes.shape({
188
- type: PropTypes.oneOf(['item', 'menu']),
189
- href: PropTypes.string,
190
- content: PropTypes.string
200
+ heading: PropTypes.string,
201
+ items: PropTypes.arrayOf(PropTypes.shape({
202
+ type: PropTypes.oneOf(['item', 'menu']),
203
+ href: PropTypes.string,
204
+ content: PropTypes.string,
205
+ isActive: PropTypes.bool
206
+ }))
191
207
  })),
192
208
  loggedOutItems: PropTypes.arrayOf(PropTypes.shape({
193
209
  type: PropTypes.oneOf(['item', 'menu']),
@@ -205,6 +221,7 @@ DesktopHeader.propTypes = {
205
221
  };
206
222
  DesktopHeader.defaultProps = {
207
223
  mainMenu: [],
224
+ secondaryMenu: [],
208
225
  userMenu: [],
209
226
  loggedOutItems: [],
210
227
  logo: null,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/DesktopHeader.jsx"],"names":["React","PropTypes","injectIntl","intlShape","getConfig","Menu","MenuTrigger","MenuContent","Avatar","LinkedLogo","Logo","messages","CaretIcon","DesktopHeader","props","mainMenu","Array","isArray","map","menuItem","type","href","content","submenuContent","userMenu","avatar","username","intl","formatMessage","loggedOutItems","item","i","arr","length","logo","logoAltText","logoDestination","loggedIn","logoProps","src","alt","logoClasses","AUTHN_MINIMAL_HEADER","renderMainMenu","renderUserMenu","renderLoggedOutItems","Component","propTypes","oneOfType","node","array","arrayOf","shape","oneOf","string","bool","isRequired","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,UAAT,EAAqBC,SAArB,QAAsC,6BAAtC;AACA,SAASC,SAAT,QAA0B,wBAA1B,C,CAEA;;AACA,SAASC,IAAT,EAAeC,WAAf,EAA4BC,WAA5B,QAA+C,QAA/C;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,QAAjC,C,CAEA;;AACA,OAAOC,QAAP,MAAqB,mBAArB,C,CAEA;;AACA,SAASC,SAAT,QAA0B,SAA1B;;IA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,CAACqD,MAjBH;AAkBxB7B,EAAAA,MAAM,EAAExB,SAAS,CAACqD,MAlBM;AAmBxB5B,EAAAA,QAAQ,EAAEzB,SAAS,CAACqD,MAnBI;AAoBxBjB,EAAAA,QAAQ,EAAEpC,SAAS,CAACsD,IApBI;AAsBxB;AACA5B,EAAAA,IAAI,EAAExB,SAAS,CAACqD;AAvBQ,CAA1B;AA0BA3C,aAAa,CAAC4C,YAAd,GAA6B;AAC3B1C,EAAAA,QAAQ,EAAE,EADiB;AAE3BS,EAAAA,QAAQ,EAAE,EAFiB;AAG3BK,EAAAA,cAAc,EAAE,EAHW;AAI3BK,EAAAA,IAAI,EAAE,IAJqB;AAK3BC,EAAAA,WAAW,EAAE,IALc;AAM3BC,EAAAA,eAAe,EAAE,IANU;AAO3BX,EAAAA,MAAM,EAAE,IAPmB;AAQ3BC,EAAAA,QAAQ,EAAE,IARiB;AAS3BW,EAAAA,QAAQ,EAAE;AATiB,CAA7B;AAYA,eAAenC,UAAU,CAACW,aAAD,CAAzB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl, intlShape } from '@edx/frontend-platform/i18n';\nimport { getConfig } from '@edx/frontend-platform';\n\n// Local Components\nimport { Menu, MenuTrigger, MenuContent } from './Menu';\nimport Avatar from './Avatar';\nimport { LinkedLogo, Logo } from './Logo';\n\n// i18n\nimport messages from './Header.messages';\n\n// Assets\nimport { CaretIcon } from './Icons';\n\nclass DesktopHeader extends React.Component {\n constructor(props) { // eslint-disable-line no-useless-constructor\n super(props);\n }\n\n renderMainMenu() {\n const { mainMenu } = this.props;\n\n // Nodes are accepted as a prop\n if (!Array.isArray(mainMenu)) {\n return mainMenu;\n }\n\n return mainMenu.map((menuItem) => {\n const {\n type,\n href,\n content,\n submenuContent,\n } = menuItem;\n\n if (type === 'item') {\n return (\n <a key={`${type}-${content}`} className=\"nav-link\" href={href}>{content}</a>\n );\n }\n\n return (\n <Menu key={`${type}-${content}`} tag=\"div\" className=\"nav-item\" respondToPointerEvents>\n <MenuTrigger tag=\"a\" className=\"nav-link d-inline-flex align-items-center\" href={href}>\n {content} <CaretIcon role=\"img\" aria-hidden focusable=\"false\" />\n </MenuTrigger>\n <MenuContent className=\"pin-left pin-right shadow py-2\">\n {submenuContent}\n </MenuContent>\n </Menu>\n );\n });\n }\n\n renderUserMenu() {\n const {\n userMenu,\n avatar,\n username,\n intl,\n } = this.props;\n\n return (\n <Menu transitionClassName=\"menu-dropdown\" transitionTimeout={250}>\n <MenuTrigger\n tag=\"button\"\n aria-label={intl.formatMessage(messages['header.label.account.menu.for'], { username })}\n className=\"btn btn-outline-primary d-inline-flex align-items-center pl-2 pr-3\"\n >\n <Avatar size=\"1.5em\" src={avatar} alt=\"\" className=\"mr-2\" />\n {username} <CaretIcon role=\"img\" aria-hidden focusable=\"false\" />\n </MenuTrigger>\n <MenuContent className=\"mb-0 dropdown-menu show dropdown-menu-right pin-right shadow py-2\">\n {userMenu.map(({ type, href, content }) => (\n <a className={`dropdown-${type}`} key={`${type}-${content}`} href={href}>{content}</a>\n ))}\n </MenuContent>\n </Menu>\n );\n }\n\n renderLoggedOutItems() {\n const { loggedOutItems } = this.props;\n\n return loggedOutItems.map((item, i, arr) => (\n <a\n key={`${item.type}-${item.content}`}\n className={i < arr.length - 1 ? 'btn mr-2 btn-link' : 'btn mr-2 btn-outline-primary'}\n href={item.href}\n >\n {item.content}\n </a>\n ));\n }\n\n render() {\n const {\n logo,\n logoAltText,\n logoDestination,\n loggedIn,\n intl,\n } = this.props;\n const logoProps = { src: logo, alt: logoAltText, href: logoDestination };\n const logoClasses = getConfig().AUTHN_MINIMAL_HEADER ? 'mw-100' : null;\n\n return (\n <header className=\"site-header-desktop\">\n <a className=\"nav-skip sr-only sr-only-focusable\" href=\"#main\">{intl.formatMessage(messages['header.label.skip.nav'])}</a>\n <div className={`container-fluid ${logoClasses}`}>\n <div className=\"nav-container position-relative d-flex align-items-center\">\n {logoDestination === null ? <Logo className=\"logo\" src={logo} alt={logoAltText} /> : <LinkedLogo className=\"logo\" {...logoProps} />}\n <nav\n aria-label={intl.formatMessage(messages['header.label.main.nav'])}\n className=\"nav main-nav\"\n >\n {this.renderMainMenu()}\n </nav>\n <nav\n aria-label={intl.formatMessage(messages['header.label.secondary.nav'])}\n className=\"nav secondary-menu-container align-items-center ml-auto\"\n >\n {loggedIn ? this.renderUserMenu() : this.renderLoggedOutItems()}\n </nav>\n </div>\n </div>\n </header>\n );\n }\n}\n\nDesktopHeader.propTypes = {\n mainMenu: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.array,\n ]),\n userMenu: PropTypes.arrayOf(PropTypes.shape({\n type: PropTypes.oneOf(['item', 'menu']),\n href: PropTypes.string,\n content: PropTypes.string,\n })),\n loggedOutItems: PropTypes.arrayOf(PropTypes.shape({\n type: PropTypes.oneOf(['item', 'menu']),\n href: PropTypes.string,\n content: PropTypes.string,\n })),\n logo: PropTypes.string,\n logoAltText: PropTypes.string,\n logoDestination: PropTypes.string,\n avatar: PropTypes.string,\n username: PropTypes.string,\n loggedIn: PropTypes.bool,\n\n // i18n\n intl: intlShape.isRequired,\n};\n\nDesktopHeader.defaultProps = {\n mainMenu: [],\n userMenu: [],\n loggedOutItems: [],\n logo: null,\n logoAltText: null,\n logoDestination: null,\n avatar: null,\n username: null,\n loggedIn: false,\n};\n\nexport default injectIntl(DesktopHeader);\n"],"file":"DesktopHeader.js"}
1
+ {"version":3,"file":"DesktopHeader.js","names":["React","PropTypes","injectIntl","intlShape","getConfig","Menu","MenuTrigger","MenuContent","Avatar","LinkedLogo","Logo","messages","CaretIcon","DesktopHeader","_React$Component","props","_classCallCheck","_callSuper","_inherits","_createClass","key","value","renderMenu","menu","Array","isArray","map","menuItem","type","href","content","submenuContent","disabled","isActive","createElement","concat","className","tag","respondToPointerEvents","role","focusable","renderMainMenu","mainMenu","renderSecondaryMenu","secondaryMenu","renderUserMenu","_this$props","userMenu","avatar","username","intl","transitionClassName","transitionTimeout","formatMessage","size","src","alt","group","index","Fragment","heading","items","_ref","length","renderLoggedOutItems","loggedOutItems","item","i","arr","render","_this$props2","logo","logoAltText","logoDestination","loggedIn","logoProps","logoClasses","AUTHN_MINIMAL_HEADER","_extends","Component","propTypes","oneOfType","node","array","arrayOf","shape","string","oneOf","bool","isRequired","defaultProps"],"sources":["../src/DesktopHeader.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl, intlShape } from '@edx/frontend-platform/i18n';\nimport { getConfig } from '@edx/frontend-platform';\n\n// Local Components\nimport { Menu, MenuTrigger, MenuContent } from './Menu';\nimport Avatar from './Avatar';\nimport { LinkedLogo, Logo } from './Logo';\n\n// i18n\nimport messages from './Header.messages';\n\n// Assets\nimport { CaretIcon } from './Icons';\n\nclass DesktopHeader extends React.Component {\n constructor(props) { // eslint-disable-line no-useless-constructor\n super(props);\n }\n\n renderMenu(menu) {\n // Nodes are accepted as a prop\n if (!Array.isArray(menu)) {\n return menu;\n }\n\n return menu.map((menuItem) => {\n const {\n type,\n href,\n content,\n submenuContent,\n disabled,\n isActive,\n } = menuItem;\n\n if (type === 'item') {\n return (\n <a\n key={`${type}-${content}`}\n className={`nav-link${disabled ? ' disabled' : ''}${isActive ? ' active' : ''}`}\n href={href}\n >\n {content}\n </a>\n );\n }\n\n return (\n <Menu key={`${type}-${content}`} tag=\"div\" className=\"nav-item\" respondToPointerEvents>\n <MenuTrigger tag=\"a\" className=\"nav-link d-inline-flex align-items-center\" href={href}>\n {content} <CaretIcon role=\"img\" aria-hidden focusable=\"false\" />\n </MenuTrigger>\n <MenuContent className=\"pin-left pin-right shadow py-2\">\n {submenuContent}\n </MenuContent>\n </Menu>\n );\n });\n }\n\n renderMainMenu() {\n const { mainMenu } = this.props;\n return this.renderMenu(mainMenu);\n }\n\n renderSecondaryMenu() {\n const { secondaryMenu } = this.props;\n return this.renderMenu(secondaryMenu);\n }\n\n renderUserMenu() {\n const {\n userMenu,\n avatar,\n username,\n intl,\n } = this.props;\n\n return (\n <Menu transitionClassName=\"menu-dropdown\" transitionTimeout={250}>\n <MenuTrigger\n tag=\"button\"\n aria-label={intl.formatMessage(messages['header.label.account.menu.for'], { username })}\n className=\"btn btn-outline-primary d-inline-flex align-items-center pl-2 pr-3\"\n >\n <Avatar size=\"1.5em\" src={avatar} alt=\"\" className=\"mr-2\" />\n {username} <CaretIcon role=\"img\" aria-hidden focusable=\"false\" />\n </MenuTrigger>\n <MenuContent className=\"mb-0 dropdown-menu show dropdown-menu-right pin-right shadow py-2\">\n {userMenu.map((group, index) => (\n // eslint-disable-next-line react/jsx-no-comment-textnodes,react/no-array-index-key\n <React.Fragment key={index}>\n {group.heading && <div className=\"dropdown-header\" role=\"heading\" aria-level=\"1\">{group.heading}</div>}\n {group.items.map(({\n type, content, href, disabled, isActive,\n }) => (\n <a\n className={`dropdown-${type}${isActive ? ' active' : ''}${disabled ? ' disabled' : ''}`}\n key={`${type}-${content}`}\n href={href}\n >\n {content}\n </a>\n ))}\n {index < userMenu.length - 1 && <div className=\"dropdown-divider\" role=\"separator\" />}\n </React.Fragment>\n ))}\n </MenuContent>\n </Menu>\n );\n }\n\n renderLoggedOutItems() {\n const { loggedOutItems } = this.props;\n\n return loggedOutItems.map((item, i, arr) => (\n <a\n key={`${item.type}-${item.content}`}\n className={i < arr.length - 1 ? 'btn mr-2 btn-link' : 'btn mr-2 btn-outline-primary'}\n href={item.href}\n >\n {item.content}\n </a>\n ));\n }\n\n render() {\n const {\n logo,\n logoAltText,\n logoDestination,\n loggedIn,\n intl,\n } = this.props;\n const logoProps = { src: logo, alt: logoAltText, href: logoDestination };\n const logoClasses = getConfig().AUTHN_MINIMAL_HEADER ? 'mw-100' : null;\n\n return (\n <header className=\"site-header-desktop\">\n <a className=\"nav-skip sr-only sr-only-focusable\" href=\"#main\">{intl.formatMessage(messages['header.label.skip.nav'])}</a>\n <div className={`container-fluid ${logoClasses}`}>\n <div className=\"nav-container position-relative d-flex align-items-center\">\n {logoDestination === null ? <Logo className=\"logo\" src={logo} alt={logoAltText} /> : <LinkedLogo className=\"logo\" {...logoProps} />}\n <nav\n aria-label={intl.formatMessage(messages['header.label.main.nav'])}\n className=\"nav main-nav\"\n >\n {this.renderMainMenu()}\n </nav>\n <nav\n aria-label={intl.formatMessage(messages['header.label.secondary.nav'])}\n className=\"nav secondary-menu-container align-items-center ml-auto\"\n >\n {loggedIn\n ? (\n <>\n {this.renderSecondaryMenu()}\n {this.renderUserMenu()}\n </>\n ) : this.renderLoggedOutItems()}\n </nav>\n </div>\n </div>\n </header>\n );\n }\n}\n\nDesktopHeader.propTypes = {\n mainMenu: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.array,\n ]),\n secondaryMenu: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.array,\n ]),\n userMenu: PropTypes.arrayOf(PropTypes.shape({\n heading: PropTypes.string,\n items: PropTypes.arrayOf(PropTypes.shape({\n type: PropTypes.oneOf(['item', 'menu']),\n href: PropTypes.string,\n content: PropTypes.string,\n isActive: PropTypes.bool,\n })),\n })),\n loggedOutItems: PropTypes.arrayOf(PropTypes.shape({\n type: PropTypes.oneOf(['item', 'menu']),\n href: PropTypes.string,\n content: PropTypes.string,\n })),\n logo: PropTypes.string,\n logoAltText: PropTypes.string,\n logoDestination: PropTypes.string,\n avatar: PropTypes.string,\n username: PropTypes.string,\n loggedIn: PropTypes.bool,\n\n // i18n\n intl: intlShape.isRequired,\n};\n\nDesktopHeader.defaultProps = {\n mainMenu: [],\n secondaryMenu: [],\n userMenu: [],\n loggedOutItems: [],\n logo: null,\n logoAltText: null,\n logoDestination: null,\n avatar: null,\n username: null,\n loggedIn: false,\n};\n\nexport default injectIntl(DesktopHeader);\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,EAAEC,SAAS,QAAQ,6BAA6B;AACnE,SAASC,SAAS,QAAQ,wBAAwB;;AAElD;AACA,SAASC,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