@artistanbul/frontend-component-header-sumac 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +93 -0
  3. package/README.rst +193 -0
  4. package/dist/Avatar.js +43 -0
  5. package/dist/Avatar.js.map +1 -0
  6. package/dist/Header.js +130 -0
  7. package/dist/Header.js.map +1 -0
  8. package/dist/Header.messages.js +110 -0
  9. package/dist/Header.messages.js.map +1 -0
  10. package/dist/Header.test.jsx +104 -0
  11. package/dist/Icons.js +52 -0
  12. package/dist/Icons.js.map +1 -0
  13. package/dist/Logo.js +28 -0
  14. package/dist/Logo.js.map +1 -0
  15. package/dist/Menu/Menu.js +321 -0
  16. package/dist/Menu/Menu.js.map +1 -0
  17. package/dist/Menu/index.js +3 -0
  18. package/dist/Menu/index.js.map +1 -0
  19. package/dist/Menu/menu.scss +45 -0
  20. package/dist/__snapshots__/Header.test.jsx.snap +445 -0
  21. package/dist/desktop-header/DesktopHeader.js +174 -0
  22. package/dist/desktop-header/DesktopHeader.js.map +1 -0
  23. package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js +51 -0
  24. package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js.map +1 -0
  25. package/dist/desktop-header/DesktopHeaderUserMenu.js +49 -0
  26. package/dist/desktop-header/DesktopHeaderUserMenu.js.map +1 -0
  27. package/dist/desktop-header/DesktopLoggedOutItems.js +22 -0
  28. package/dist/desktop-header/DesktopLoggedOutItems.js.map +1 -0
  29. package/dist/generic/messages.js +15 -0
  30. package/dist/generic/messages.js.map +1 -0
  31. package/dist/i18n/index.js +2 -0
  32. package/dist/i18n/index.js.map +1 -0
  33. package/dist/images/omnikampus/artistanbul-logo.png +0 -0
  34. package/dist/images/omnikampus/omnikampus-just-logo.png +0 -0
  35. package/dist/images/omnikampus/omnikampus-logo.png +0 -0
  36. package/dist/index.js +73 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/index.scss +248 -0
  39. package/dist/learning-header/AnonymousUserMenu.js +25 -0
  40. package/dist/learning-header/AnonymousUserMenu.js.map +1 -0
  41. package/dist/learning-header/AuthenticatedUserDropdown.js +57 -0
  42. package/dist/learning-header/AuthenticatedUserDropdown.js.map +1 -0
  43. package/dist/learning-header/LearningHeader.js +61 -0
  44. package/dist/learning-header/LearningHeader.js.map +1 -0
  45. package/dist/learning-header/LearningHeaderCourseInfo.js +24 -0
  46. package/dist/learning-header/LearningHeaderCourseInfo.js.map +1 -0
  47. package/dist/learning-header/LearningHeaderHelpLink.js +13 -0
  48. package/dist/learning-header/LearningHeaderHelpLink.js.map +1 -0
  49. package/dist/learning-header/LearningHeaderUserMenuItems.js +20 -0
  50. package/dist/learning-header/LearningHeaderUserMenuItems.js.map +1 -0
  51. package/dist/learning-header/LearningLoggedOutButtons.js +24 -0
  52. package/dist/learning-header/LearningLoggedOutButtons.js.map +1 -0
  53. package/dist/learning-header/messages.js +40 -0
  54. package/dist/learning-header/messages.js.map +1 -0
  55. package/dist/mobile-header/MobileHeader.js +192 -0
  56. package/dist/mobile-header/MobileHeader.js.map +1 -0
  57. package/dist/mobile-header/MobileHeaderMainMenu.js +46 -0
  58. package/dist/mobile-header/MobileHeaderMainMenu.js.map +1 -0
  59. package/dist/mobile-header/MobileHeaderUserMenu.js +38 -0
  60. package/dist/mobile-header/MobileHeaderUserMenu.js.map +1 -0
  61. package/dist/mobile-header/MobileLoggedOutItems.js +27 -0
  62. package/dist/mobile-header/MobileLoggedOutItems.js.map +1 -0
  63. package/dist/plugin-slots/CourseInfoSlot/README.md +125 -0
  64. package/dist/plugin-slots/CourseInfoSlot/images/add_custom_components_before_and_after_course_info.png +0 -0
  65. package/dist/plugin-slots/CourseInfoSlot/images/replace_course_info_with_custom_component.png +0 -0
  66. package/dist/plugin-slots/CourseInfoSlot/images/replace_course_title.png +0 -0
  67. package/dist/plugin-slots/CourseInfoSlot/index.js +31 -0
  68. package/dist/plugin-slots/CourseInfoSlot/index.js.map +1 -0
  69. package/dist/plugin-slots/DesktopHeaderSlot/README.md +41 -0
  70. package/dist/plugin-slots/DesktopHeaderSlot/images/desktop_header_custom_component.png +0 -0
  71. package/dist/plugin-slots/DesktopHeaderSlot/index.js +15 -0
  72. package/dist/plugin-slots/DesktopHeaderSlot/index.js.map +1 -0
  73. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/README.md +134 -0
  74. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_component.png +0 -0
  75. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_components_before_after.png +0 -0
  76. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_modify_items.png +0 -0
  77. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js +19 -0
  78. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js.map +1 -0
  79. package/dist/plugin-slots/DesktopMainMenuSlot/README.md +134 -0
  80. package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_component.png +0 -0
  81. package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_components_before_after.png +0 -0
  82. package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_modify_items.png +0 -0
  83. package/dist/plugin-slots/DesktopMainMenuSlot/index.js +19 -0
  84. package/dist/plugin-slots/DesktopMainMenuSlot/index.js.map +1 -0
  85. package/dist/plugin-slots/DesktopSecondaryMenuSlot/README.md +129 -0
  86. package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_component.png +0 -0
  87. package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_components_before_after.png +0 -0
  88. package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_modify_items.png +0 -0
  89. package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js +19 -0
  90. package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js.map +1 -0
  91. package/dist/plugin-slots/DesktopUserMenuSlot/README.md +141 -0
  92. package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_component.png +0 -0
  93. package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_components_before_after.png +0 -0
  94. package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_modify_items.png +0 -0
  95. package/dist/plugin-slots/DesktopUserMenuSlot/index.js +19 -0
  96. package/dist/plugin-slots/DesktopUserMenuSlot/index.js.map +1 -0
  97. package/dist/plugin-slots/LearningHelpSlot/README.md +41 -0
  98. package/dist/plugin-slots/LearningHelpSlot/images/learning_help_custom_component.png +0 -0
  99. package/dist/plugin-slots/LearningHelpSlot/index.js +10 -0
  100. package/dist/plugin-slots/LearningHelpSlot/index.js.map +1 -0
  101. package/dist/plugin-slots/LearningLoggedOutItemsSlot/README.md +132 -0
  102. package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_component.png +0 -0
  103. package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_components_before_after.png +0 -0
  104. package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_modified_items.png +0 -0
  105. package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js +17 -0
  106. package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js.map +1 -0
  107. package/dist/plugin-slots/LearningUserMenuSlot/README.md +130 -0
  108. package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_component.png +0 -0
  109. package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_components_before_after.png +0 -0
  110. package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_modified_items.png +0 -0
  111. package/dist/plugin-slots/LearningUserMenuSlot/index.js +17 -0
  112. package/dist/plugin-slots/LearningUserMenuSlot/index.js.map +1 -0
  113. package/dist/plugin-slots/LogoSlot/README.md +69 -0
  114. package/dist/plugin-slots/LogoSlot/index.js +26 -0
  115. package/dist/plugin-slots/LogoSlot/index.js.map +1 -0
  116. package/dist/plugin-slots/MobileHeaderSlot/README.md +41 -0
  117. package/dist/plugin-slots/MobileHeaderSlot/images/mobile_header_custom_component.png +0 -0
  118. package/dist/plugin-slots/MobileHeaderSlot/index.js +15 -0
  119. package/dist/plugin-slots/MobileHeaderSlot/index.js.map +1 -0
  120. package/dist/plugin-slots/MobileLoggedOutItemsSlot/README.md +134 -0
  121. package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_component.png +0 -0
  122. package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_components_before_after.png +0 -0
  123. package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_modify_items.png +0 -0
  124. package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js +19 -0
  125. package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js.map +1 -0
  126. package/dist/plugin-slots/MobileMainMenuSlot/README.md +134 -0
  127. package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_component.png +0 -0
  128. package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_components_before_after.png +0 -0
  129. package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_modify_items.png +0 -0
  130. package/dist/plugin-slots/MobileMainMenuSlot/index.js +19 -0
  131. package/dist/plugin-slots/MobileMainMenuSlot/index.js.map +1 -0
  132. package/dist/plugin-slots/MobileUserMenuSlot/README.md +142 -0
  133. package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_component.png +0 -0
  134. package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_components_before_after.png +0 -0
  135. package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_modify_items.png +0 -0
  136. package/dist/plugin-slots/MobileUserMenuSlot/index.js +19 -0
  137. package/dist/plugin-slots/MobileUserMenuSlot/index.js.map +1 -0
  138. package/dist/plugin-slots/README.md +15 -0
  139. package/dist/setupTest.js +125 -0
  140. package/dist/studio-header/BrandNav.js +24 -0
  141. package/dist/studio-header/BrandNav.js.map +1 -0
  142. package/dist/studio-header/CourseLockUp.js +46 -0
  143. package/dist/studio-header/CourseLockUp.js.map +1 -0
  144. package/dist/studio-header/HeaderBody.js +143 -0
  145. package/dist/studio-header/HeaderBody.js.map +1 -0
  146. package/dist/studio-header/MobileHeader.js +79 -0
  147. package/dist/studio-header/MobileHeader.js.map +1 -0
  148. package/dist/studio-header/MobileMenu.js +46 -0
  149. package/dist/studio-header/MobileMenu.js.map +1 -0
  150. package/dist/studio-header/NavDropdownMenu.js +32 -0
  151. package/dist/studio-header/NavDropdownMenu.js.map +1 -0
  152. package/dist/studio-header/StudioHeader.js +79 -0
  153. package/dist/studio-header/StudioHeader.js.map +1 -0
  154. package/dist/studio-header/StudioHeader.scss +49 -0
  155. package/dist/studio-header/UserMenu.js +55 -0
  156. package/dist/studio-header/UserMenu.js.map +1 -0
  157. package/dist/studio-header/index.js +3 -0
  158. package/dist/studio-header/index.js.map +1 -0
  159. package/dist/studio-header/messages.js +55 -0
  160. package/dist/studio-header/messages.js.map +1 -0
  161. package/dist/studio-header/utils.js +26 -0
  162. package/dist/studio-header/utils.js.map +1 -0
  163. package/dist/test-utils.js +26 -0
  164. package/dist/test-utils.js.map +1 -0
  165. package/package.json +79 -0
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # MFE Header Sumac
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://gitlab.artistanbul.io/edx/omnikampus/Themes/ege/mfe-header-sumac.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ - [ ] [Set up project integrations](https://gitlab.artistanbul.io/edx/omnikampus/Themes/ege/mfe-header-sumac/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+
53
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
+
55
+ ## Name
56
+ Choose a self-explaining name for your project.
57
+
58
+ ## Description
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
+
64
+ ## Visuals
65
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
+
67
+ ## Installation
68
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
+
70
+ ## Usage
71
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
+
73
+ ## Support
74
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
+
76
+ ## Roadmap
77
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
78
+
79
+ ## Contributing
80
+ State if you are open to contributions and what your requirements are for accepting them.
81
+
82
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
+
84
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
+
86
+ ## Authors and acknowledgment
87
+ Show your appreciation to those who have contributed to the project.
88
+
89
+ ## License
90
+ For open source projects, say how it is licensed.
91
+
92
+ ## Project status
93
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
package/README.rst ADDED
@@ -0,0 +1,193 @@
1
+ #########################
2
+ frontend-component-header
3
+ #########################
4
+
5
+ |license| |Build Status| |Codecov| |npm_version| |npm_downloads| |semantic-release|
6
+
7
+ ********
8
+ Purpose
9
+ ********
10
+
11
+ A generic header for Open edX micro-frontend applications.
12
+
13
+ ************
14
+ Getting Started
15
+ ************
16
+
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
+
38
+
39
+ Environment Variables
40
+ ====================
41
+
42
+ * ``LMS_BASE_URL`` - The URL of the LMS of your Open edX instance.
43
+ * ``LOGOUT_URL`` - The URL of the API endpoint which performs a user logout.
44
+ * ``LOGIN_URL`` - The URL of the login page where a user can sign into their account.
45
+ * ``SITE_NAME`` - The user-facing name of the site, used as `alt` text on the logo in the header.
46
+ Defaults to "localhost" in development.
47
+ * ``LOGO_URL`` - The URL of the site's logo. This logo is displayed in the header.
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.
51
+ * ``AUTHN_MINIMAL_HEADER`` - A boolean flag which hides the main menu, user menu, and logged-out
52
+ menu items when truthy. This is intended to be used in micro-frontends like
53
+ frontend-app-authentication in which these menus are considered distractions from the user's task.
54
+
55
+ Installation
56
+ ============
57
+
58
+ To install this header into your Open edX micro-frontend, run the following command in your MFE:
59
+
60
+ ``npm i --save @edx/frontend-component-header``
61
+
62
+ This will make the component available to be imported into your application.
63
+
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
+
89
+ Usage
90
+ =====
91
+
92
+ This library has the following exports:
93
+
94
+ * ``(default)``: The header as a React component.
95
+ * ``messages``: Internationalization messages suitable for use with `@edx/frontend-platform/i18n <https://edx.github.io/frontend-platform/module-Internationalization.html>`_
96
+ * ``dist/index.scss``: A SASS file which contains style information for the component. It should be imported into the micro-frontend's own SCSS file.
97
+
98
+ Plugins
99
+ -------
100
+ This can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
101
+
102
+ The parts of this that can be customized in that manner are documented `here </src/plugin-slots>`_.
103
+
104
+ Examples
105
+ ========
106
+
107
+ * `An example of component and messages usage. <https://github.com/openedx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx#L21>`_
108
+ * `An example of SCSS file usage. <https://github.com/openedx/frontend-template-application/blob/3cd5485bf387b8c479baf6b02bf59e3061dc3465/src/index.scss#L8>`_
109
+
110
+ Development
111
+ ===========
112
+
113
+ Install dependencies::
114
+
115
+ npm ci
116
+
117
+ Start the development server::
118
+
119
+ npm start
120
+
121
+ Build a production distribution::
122
+
123
+ npm run build
124
+
125
+ License
126
+ =======
127
+
128
+ The code in this repository is licensed under the AGPLv3 unless otherwise
129
+ noted.
130
+
131
+ Please see `LICENSE <LICENSE>`_ for details.
132
+
133
+ Contributing
134
+ ============
135
+
136
+ Contributions are very welcome. Please read `How To Contribute`_ for details.
137
+
138
+ .. _How To Contribute: https://openedx.org/r/how-to-contribute
139
+
140
+ This project is currently accepting all types of contributions, bug fixes,
141
+ security fixes, maintenance work, or new features. However, please make sure
142
+ to have a discussion about your new feature idea with the maintainers prior to
143
+ beginning development to maximize the chances of your change being accepted.
144
+ You can start a conversation by creating a new issue on this repo summarizing
145
+ your idea.
146
+
147
+ Getting Help
148
+ ===========
149
+
150
+ If you're having trouble, we have discussion forums at
151
+ https://discuss.openedx.org where you can connect with others in the community.
152
+
153
+ Our real-time conversations are on Slack. You can request a `Slack
154
+ invitation`_, then join our `community Slack workspace`_. Because this is a
155
+ frontend repository, the best place to discuss it would be in the `#wg-frontend
156
+ channel`_.
157
+
158
+ For anything non-trivial, the best path is to open an issue in this repository
159
+ with as many details about the issue you are facing as you can provide.
160
+
161
+ https://github.com/openedx/frontend-component-header/issues
162
+
163
+ For more information about these options, see the `Getting Help`_ page.
164
+
165
+ .. _Slack invitation: https://openedx.org/slack
166
+ .. _community Slack workspace: https://openedx.slack.com/
167
+ .. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
168
+ .. _Getting Help: https://openedx.org/community/connect
169
+
170
+ The Open edX Code of Conduct
171
+ ============================
172
+
173
+ All community members are expected to follow the `Open edX Code of Conduct`_.
174
+
175
+ .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
176
+
177
+ Reporting Security Issues
178
+ =========================
179
+
180
+ Please do not report security issues in public. Please email security@openedx.org.
181
+
182
+ .. |Build Status| image:: https://api.travis-ci.com/edx/frontend-component-header.svg?branch=master
183
+ :target: https://travis-ci.com/edx/frontend-component-header
184
+ .. |Codecov| image:: https://img.shields.io/codecov/c/github/edx/frontend-component-header
185
+ :target: @edx/frontend-component-header
186
+ .. |npm_version| image:: https://img.shields.io/npm/v/@edx/frontend-component-header.svg
187
+ :target: @edx/frontend-component-header
188
+ .. |npm_downloads| image:: https://img.shields.io/npm/dt/@edx/frontend-component-header.svg
189
+ :target: @edx/frontend-component-header
190
+ .. |license| image:: https://img.shields.io/npm/l/@edx/frontend-component-header.svg
191
+ :target: @edx/frontend-component-header
192
+ .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
193
+ :target: https://github.com/semantic-release/semantic-release
package/dist/Avatar.js ADDED
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { AvatarIcon } from './Icons';
4
+ var Avatar = function Avatar(_ref) {
5
+ var size = _ref.size,
6
+ src = _ref.src,
7
+ alt = _ref.alt,
8
+ className = _ref.className;
9
+ var avatar = src ? /*#__PURE__*/React.createElement("img", {
10
+ className: "d-block w-100 h-100",
11
+ src: src,
12
+ alt: alt
13
+ }) : /*#__PURE__*/React.createElement(AvatarIcon, {
14
+ style: {
15
+ width: size,
16
+ height: size
17
+ },
18
+ role: "img",
19
+ "aria-hidden": true,
20
+ focusable: "false"
21
+ });
22
+ return /*#__PURE__*/React.createElement("span", {
23
+ style: {
24
+ height: size,
25
+ width: size
26
+ },
27
+ className: "avatar overflow-hidden d-inline-flex rounded-circle ".concat(className)
28
+ }, avatar);
29
+ };
30
+ Avatar.propTypes = {
31
+ src: PropTypes.string,
32
+ size: PropTypes.string,
33
+ alt: PropTypes.string,
34
+ className: PropTypes.string
35
+ };
36
+ Avatar.defaultProps = {
37
+ src: null,
38
+ size: '2rem',
39
+ alt: null,
40
+ className: null
41
+ };
42
+ export default Avatar;
43
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
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":[]}
package/dist/Header.js ADDED
@@ -0,0 +1,130 @@
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
5
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
6
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
+ import React, { useContext } from 'react';
8
+ import Responsive from 'react-responsive';
9
+ import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
10
+ import { AppContext } from '@edx/frontend-platform/react';
11
+ import { APP_CONFIG_INITIALIZED, ensureConfig, mergeConfig, getConfig, subscribe } from '@edx/frontend-platform';
12
+ import PropTypes from 'prop-types';
13
+ import DesktopHeaderSlot from './plugin-slots/DesktopHeaderSlot';
14
+ import MobileHeaderSlot from './plugin-slots/MobileHeaderSlot';
15
+ import "./index.scss";
16
+ import messages from './Header.messages';
17
+ ensureConfig(['LMS_BASE_URL', 'LOGOUT_URL', 'LOGIN_URL', 'SITE_NAME', 'LOGO_URL', 'ORDER_HISTORY_URL'], 'Header component');
18
+ subscribe(APP_CONFIG_INITIALIZED, function () {
19
+ mergeConfig({
20
+ AUTHN_MINIMAL_HEADER: !!process.env.AUTHN_MINIMAL_HEADER
21
+ }, 'Header additional config');
22
+ });
23
+
24
+ /**
25
+ * Header component for the application.
26
+ * Displays a header with the provided main menu, secondary menu, and user menu when the user is authenticated.
27
+ * If any of the props (mainMenuItems, secondaryMenuItems, userMenuItems) are not provided, default
28
+ * items are displayed.
29
+ * For more details on how to use this component, please refer to this document:
30
+ * https://github.com/openedx/frontend-component-header/blob/master/docs/using_custom_header.rst
31
+ *
32
+ * @param {list} mainMenuItems - The list of main menu items to display.
33
+ * See the documentation for the structure of main menu item.
34
+ * @param {list} secondaryMenuItems - The list of secondary menu items to display.
35
+ * See the documentation for the structure of secondary menu item.
36
+ * @param {list} userMenuItems - The list of user menu items to display.
37
+ * See the documentation for the structure of user menu item.
38
+ */
39
+ var Header = function Header(_ref) {
40
+ var intl = _ref.intl,
41
+ mainMenuItems = _ref.mainMenuItems,
42
+ secondaryMenuItems = _ref.secondaryMenuItems,
43
+ userMenuItems = _ref.userMenuItems;
44
+ var _useContext = useContext(AppContext),
45
+ authenticatedUser = _useContext.authenticatedUser,
46
+ config = _useContext.config;
47
+ var defaultMainMenu = [{
48
+ type: 'item',
49
+ href: "".concat(config.LMS_BASE_URL, "/dashboard"),
50
+ content: intl.formatMessage(messages['header.links.courses'])
51
+ }];
52
+ var defaultUserMenu = authenticatedUser === null ? [] : [{
53
+ heading: '',
54
+ items: [{
55
+ type: 'item',
56
+ href: "".concat(config.LMS_BASE_URL, "/dashboard"),
57
+ content: intl.formatMessage(messages['header.user.menu.dashboard'])
58
+ }, {
59
+ type: 'item',
60
+ href: "".concat(config.ACCOUNT_PROFILE_URL, "/u/").concat(authenticatedUser.username),
61
+ content: intl.formatMessage(messages['header.user.menu.profile'])
62
+ }, {
63
+ type: 'item',
64
+ href: config.ACCOUNT_SETTINGS_URL,
65
+ content: intl.formatMessage(messages['header.user.menu.account.settings'])
66
+ }].concat(_toConsumableArray(config.ORDER_HISTORY_URL ? [{
67
+ type: 'item',
68
+ href: config.ORDER_HISTORY_URL,
69
+ content: intl.formatMessage(messages['header.user.menu.order.history'])
70
+ }] : []), [{
71
+ type: 'item',
72
+ href: config.LOGOUT_URL,
73
+ content: intl.formatMessage(messages['header.user.menu.logout'])
74
+ }])
75
+ }];
76
+ var mainMenu = mainMenuItems || defaultMainMenu;
77
+ var secondaryMenu = secondaryMenuItems || [];
78
+ var userMenu = authenticatedUser === null ? [] : userMenuItems || defaultUserMenu;
79
+ var loggedOutItems = [{
80
+ type: 'item',
81
+ href: config.LOGIN_URL,
82
+ content: intl.formatMessage(messages['header.user.menu.login'])
83
+ }, {
84
+ type: 'item',
85
+ href: "".concat(config.LMS_BASE_URL, "/register"),
86
+ content: intl.formatMessage(messages['header.user.menu.register'])
87
+ }];
88
+ var props = {
89
+ logo: config.LOGO_URL,
90
+ logoAltText: config.SITE_NAME,
91
+ logoDestination: "".concat(config.LMS_BASE_URL, "/dashboard"),
92
+ loggedIn: authenticatedUser !== null,
93
+ username: authenticatedUser !== null ? authenticatedUser.username : null,
94
+ avatar: authenticatedUser !== null ? authenticatedUser.avatar : null,
95
+ mainMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : mainMenu,
96
+ secondaryMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : secondaryMenu,
97
+ userMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : userMenu,
98
+ loggedOutItems: getConfig().AUTHN_MINIMAL_HEADER ? [] : loggedOutItems
99
+ };
100
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Responsive, {
101
+ maxWidth: 769
102
+ }, /*#__PURE__*/React.createElement(MobileHeaderSlot, {
103
+ props: props
104
+ })), /*#__PURE__*/React.createElement(Responsive, {
105
+ minWidth: 769
106
+ }, /*#__PURE__*/React.createElement(DesktopHeaderSlot, {
107
+ props: props
108
+ })));
109
+ };
110
+ Header.defaultProps = {
111
+ mainMenuItems: null,
112
+ secondaryMenuItems: null,
113
+ userMenuItems: null
114
+ };
115
+ Header.propTypes = {
116
+ intl: intlShape.isRequired,
117
+ mainMenuItems: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
118
+ secondaryMenuItems: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
119
+ userMenuItems: PropTypes.arrayOf(PropTypes.shape({
120
+ heading: PropTypes.string,
121
+ items: PropTypes.arrayOf(PropTypes.shape({
122
+ type: PropTypes.oneOf(['item', 'menu']),
123
+ href: PropTypes.string,
124
+ content: PropTypes.string,
125
+ isActive: PropTypes.bool
126
+ }))
127
+ }))
128
+ };
129
+ export default injectIntl(Header);
130
+ //# sourceMappingURL=Header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.js","names":["React","useContext","Responsive","injectIntl","intlShape","AppContext","APP_CONFIG_INITIALIZED","ensureConfig","mergeConfig","getConfig","subscribe","PropTypes","DesktopHeaderSlot","MobileHeaderSlot","messages","AUTHN_MINIMAL_HEADER","process","env","Header","_ref","intl","mainMenuItems","secondaryMenuItems","userMenuItems","_useContext","authenticatedUser","config","defaultMainMenu","type","href","concat","LMS_BASE_URL","content","formatMessage","defaultUserMenu","heading","items","ACCOUNT_PROFILE_URL","username","ACCOUNT_SETTINGS_URL","_toConsumableArray","ORDER_HISTORY_URL","LOGOUT_URL","mainMenu","secondaryMenu","userMenu","loggedOutItems","LOGIN_URL","props","logo","LOGO_URL","logoAltText","SITE_NAME","logoDestination","loggedIn","avatar","createElement","Fragment","maxWidth","minWidth","defaultProps","propTypes","isRequired","oneOfType","node","array","arrayOf","shape","string","oneOf","isActive","bool"],"sources":["../src/Header.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport Responsive from 'react-responsive';\nimport { injectIntl, intlShape } from '@edx/frontend-platform/i18n';\nimport { AppContext } from '@edx/frontend-platform/react';\nimport {\n APP_CONFIG_INITIALIZED,\n ensureConfig,\n mergeConfig,\n getConfig,\n subscribe,\n} from '@edx/frontend-platform';\n\nimport PropTypes from 'prop-types';\nimport DesktopHeaderSlot from './plugin-slots/DesktopHeaderSlot';\nimport MobileHeaderSlot from './plugin-slots/MobileHeaderSlot';\n\nimport \"./index.scss\"\n\nimport messages from './Header.messages';\n\nensureConfig([\n 'LMS_BASE_URL',\n 'LOGOUT_URL',\n 'LOGIN_URL',\n 'SITE_NAME',\n 'LOGO_URL',\n 'ORDER_HISTORY_URL',\n], 'Header component');\n\nsubscribe(APP_CONFIG_INITIALIZED, () => {\n mergeConfig({\n AUTHN_MINIMAL_HEADER: !!process.env.AUTHN_MINIMAL_HEADER,\n }, 'Header additional config');\n});\n\n/**\n * Header component for the application.\n * Displays a header with the provided main menu, secondary menu, and user menu when the user is authenticated.\n * If any of the props (mainMenuItems, secondaryMenuItems, userMenuItems) are not provided, default\n * items are displayed.\n * For more details on how to use this component, please refer to this document:\n * https://github.com/openedx/frontend-component-header/blob/master/docs/using_custom_header.rst\n *\n * @param {list} mainMenuItems - The list of main menu items to display.\n * See the documentation for the structure of main menu item.\n * @param {list} secondaryMenuItems - The list of secondary menu items to display.\n * See the documentation for the structure of secondary menu item.\n * @param {list} userMenuItems - The list of user menu items to display.\n * See the documentation for the structure of user menu item.\n */\nconst Header = ({\n intl, mainMenuItems, secondaryMenuItems, userMenuItems,\n}) => {\n const { authenticatedUser, config } = useContext(AppContext);\n\n const defaultMainMenu = [\n {\n type: 'item',\n href: `${config.LMS_BASE_URL}/dashboard`,\n content: intl.formatMessage(messages['header.links.courses']),\n },\n ];\n const defaultUserMenu = authenticatedUser === null ? [] : [{\n heading: '',\n items: [\n {\n type: 'item',\n href: `${config.LMS_BASE_URL}/dashboard`,\n content: intl.formatMessage(messages['header.user.menu.dashboard']),\n },\n {\n type: 'item',\n href: `${config.ACCOUNT_PROFILE_URL}/u/${authenticatedUser.username}`,\n content: intl.formatMessage(messages['header.user.menu.profile']),\n },\n {\n type: 'item',\n href: config.ACCOUNT_SETTINGS_URL,\n content: intl.formatMessage(messages['header.user.menu.account.settings']),\n },\n // Users should only see Order History if have a ORDER_HISTORY_URL define in the environment.\n ...(config.ORDER_HISTORY_URL ? [{\n type: 'item',\n href: config.ORDER_HISTORY_URL,\n content: intl.formatMessage(messages['header.user.menu.order.history']),\n }] : []),\n {\n type: 'item',\n href: config.LOGOUT_URL,\n content: intl.formatMessage(messages['header.user.menu.logout']),\n },\n ],\n }];\n\n const mainMenu = mainMenuItems || defaultMainMenu;\n const secondaryMenu = secondaryMenuItems || [];\n const userMenu = authenticatedUser === null ? [] : userMenuItems || defaultUserMenu;\n\n const loggedOutItems = [\n {\n type: 'item',\n href: config.LOGIN_URL,\n content: intl.formatMessage(messages['header.user.menu.login']),\n },\n {\n type: 'item',\n href: `${config.LMS_BASE_URL}/register`,\n content: intl.formatMessage(messages['header.user.menu.register']),\n },\n ];\n\n const props = {\n logo: config.LOGO_URL,\n logoAltText: config.SITE_NAME,\n logoDestination: `${config.LMS_BASE_URL}/dashboard`,\n loggedIn: authenticatedUser !== null,\n username: authenticatedUser !== null ? authenticatedUser.username : null,\n avatar: authenticatedUser !== null ? authenticatedUser.avatar : null,\n mainMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : mainMenu,\n secondaryMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : secondaryMenu,\n userMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : userMenu,\n loggedOutItems: getConfig().AUTHN_MINIMAL_HEADER ? [] : loggedOutItems,\n };\n\n return (\n <>\n <Responsive maxWidth={769}>\n <MobileHeaderSlot props={props} />\n </Responsive>\n <Responsive minWidth={769}>\n <DesktopHeaderSlot props={props} />\n </Responsive>\n </>\n );\n};\n\nHeader.defaultProps = {\n mainMenuItems: null,\n secondaryMenuItems: null,\n userMenuItems: null,\n};\n\nHeader.propTypes = {\n intl: intlShape.isRequired,\n mainMenuItems: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.array,\n ]),\n secondaryMenuItems: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.array,\n ]),\n userMenuItems: 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};\n\nexport default injectIntl(Header);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,kBAAkB;AACzC,SAASC,UAAU,EAAEC,SAAS,QAAQ,6BAA6B;AACnE,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SACEC,sBAAsB,EACtBC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,SAAS,QACJ,wBAAwB;AAE/B,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAA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EAAEA;EAAM,CAAE,CACxB,CACZ,CAAC;AAEP,CAAC;AAED9B,MAAM,CAAC0C,YAAY,GAAG;EACpBvC,aAAa,EAAE,IAAI;EACnBC,kBAAkB,EAAE,IAAI;EACxBC,aAAa,EAAE;AACjB,CAAC;AAEDL,MAAM,CAAC2C,SAAS,GAAG;EACjBzC,IAAI,EAAEhB,SAAS,CAAC0D,UAAU;EAC1BzC,aAAa,EAAEV,SAAS,CAACoD,SAAS,CAAC,CACjCpD,SAAS,CAACqD,IAAI,EACdrD,SAAS,CAACsD,KAAK,CAChB,CAAC;EACF3C,kBAAkB,EAAEX,SAAS,CAACoD,SAAS,CAAC,CACtCpD,SAAS,CAACqD,IAAI,EACdrD,SAAS,CAACsD,KAAK,CAChB,CAAC;EACF1C,aAAa,EAAEZ,SAAS,CAACuD,OAAO,CAACvD,SAAS,CAACwD,KAAK,CAAC;IAC/ChC,OAAO,EAAExB,SAAS,CAACyD,MAAM;IACzBhC,KAAK,EAAEzB,SAAS,CAACuD,OAAO,CAACvD,SAAS,CAACwD,KAAK,CAAC;MACvCvC,IAAI,EAAEjB,SAAS,CAAC0D,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;MACvCxC,IAAI,EAAElB,SAAS,CAACyD,MAAM;MACtBpC,OAAO,EAAErB,SAAS,CAACyD,MAAM;MACzBE,QAAQ,EAAE3D,SAAS,CAAC4D;IACtB,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC;AAED,eAAepE,UAAU,CAACe,MAAM,CAAC","ignoreList":[]}
@@ -0,0 +1,110 @@
1
+ import { defineMessages } from '@edx/frontend-platform/i18n';
2
+ var messages = defineMessages({
3
+ 'header.links.courses': {
4
+ id: 'header.links.courses',
5
+ defaultMessage: 'Courses',
6
+ description: 'Link to the learner course dashboard'
7
+ },
8
+ 'header.links.programs': {
9
+ id: 'header.links.programs',
10
+ defaultMessage: 'Programs',
11
+ description: 'Link to the learner program dashboard'
12
+ },
13
+ 'header.links.content.search': {
14
+ id: 'header.links.content.search',
15
+ defaultMessage: 'Discover New',
16
+ description: 'Link to the content search page'
17
+ },
18
+ 'header.links.schools': {
19
+ id: 'header.links.schools',
20
+ defaultMessage: 'Schools & Partners',
21
+ description: 'Link to the schools and partners landing page'
22
+ },
23
+ 'header.user.menu.dashboard': {
24
+ id: 'header.user.menu.dashboard',
25
+ defaultMessage: 'Dashboard',
26
+ description: 'Link to the user dashboard'
27
+ },
28
+ 'header.user.menu.profile': {
29
+ id: 'header.user.menu.profile',
30
+ defaultMessage: 'Profile',
31
+ description: 'Link to the user profile'
32
+ },
33
+ 'header.user.menu.account.settings': {
34
+ id: 'header.user.menu.account.settings',
35
+ defaultMessage: 'Account',
36
+ description: 'Link to account settings'
37
+ },
38
+ 'header.user.menu.order.history': {
39
+ id: 'header.user.menu.order.history',
40
+ defaultMessage: 'Order History',
41
+ description: 'Link to order history'
42
+ },
43
+ 'header.user.menu.logout': {
44
+ id: 'header.user.menu.logout',
45
+ defaultMessage: 'Logout',
46
+ description: 'Logout link'
47
+ },
48
+ 'header.user.menu.login': {
49
+ id: 'header.user.menu.login',
50
+ defaultMessage: 'Login',
51
+ description: 'Login link'
52
+ },
53
+ 'header.user.menu.register': {
54
+ id: 'header.user.menu.register',
55
+ defaultMessage: 'Sign Up',
56
+ description: 'Link to registration'
57
+ },
58
+ 'header.user.menu.studio.home': {
59
+ id: 'header.user.menu.studio.home',
60
+ defaultMessage: 'Studio Home',
61
+ description: 'Link to the Studio Home'
62
+ },
63
+ 'header.label.account.nav': {
64
+ id: 'header.label.account.nav',
65
+ defaultMessage: 'Account',
66
+ description: 'The aria label for the account menu nav'
67
+ },
68
+ 'header.label.account.menu': {
69
+ id: 'header.label.account.menu',
70
+ defaultMessage: 'Account Menu',
71
+ description: 'The aria label for the account menu trigger'
72
+ },
73
+ 'header.label.account.menu.for': {
74
+ id: 'header.label.account.menu.for',
75
+ defaultMessage: 'Account menu for {username}',
76
+ description: 'The aria label for the account menu trigger when the username is displayed in it'
77
+ },
78
+ 'header.label.main.nav': {
79
+ id: 'header.label.main.nav',
80
+ defaultMessage: 'Main',
81
+ description: 'The aria label for the main menu nav'
82
+ },
83
+ 'header.label.main.menu': {
84
+ id: 'header.label.main.menu',
85
+ defaultMessage: 'Main Menu',
86
+ description: 'The aria label for the main menu trigger'
87
+ },
88
+ 'header.label.main.header': {
89
+ id: 'header.label.main.header',
90
+ defaultMessage: 'Main',
91
+ description: 'The aria label for the main header'
92
+ },
93
+ 'header.label.secondary.nav': {
94
+ id: 'header.label.secondary.nav',
95
+ defaultMessage: 'Secondary',
96
+ description: 'The aria label for the seconary nav'
97
+ },
98
+ 'header.label.skip.nav': {
99
+ id: 'header.label.skip.nav',
100
+ defaultMessage: 'Skip to main content',
101
+ description: 'A link used by screen readers to allow users to skip to the main content of the page.'
102
+ },
103
+ 'header.label.app.nav': {
104
+ id: 'header.label.app.nav',
105
+ defaultMessage: 'App',
106
+ description: 'The aria label for the app Nav'
107
+ }
108
+ });
109
+ export default messages;
110
+ //# sourceMappingURL=Header.messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.messages.js","names":["defineMessages","messages","id","defaultMessage","description"],"sources":["../src/Header.messages.jsx"],"sourcesContent":["import { defineMessages } from '@edx/frontend-platform/i18n';\n\nconst messages = defineMessages({\n 'header.links.courses': {\n id: 'header.links.courses',\n defaultMessage: 'Courses',\n description: 'Link to the learner course dashboard',\n },\n 'header.links.programs': {\n id: 'header.links.programs',\n defaultMessage: 'Programs',\n description: 'Link to the learner program dashboard',\n },\n 'header.links.content.search': {\n id: 'header.links.content.search',\n defaultMessage: 'Discover New',\n description: 'Link to the content search page',\n },\n 'header.links.schools': {\n id: 'header.links.schools',\n defaultMessage: 'Schools & Partners',\n description: 'Link to the schools and partners landing page',\n },\n 'header.user.menu.dashboard': {\n id: 'header.user.menu.dashboard',\n defaultMessage: 'Dashboard',\n description: 'Link to the user dashboard',\n },\n 'header.user.menu.profile': {\n id: 'header.user.menu.profile',\n defaultMessage: 'Profile',\n description: 'Link to the user profile',\n },\n 'header.user.menu.account.settings': {\n id: 'header.user.menu.account.settings',\n defaultMessage: 'Account',\n description: 'Link to account settings',\n },\n 'header.user.menu.order.history': {\n id: 'header.user.menu.order.history',\n defaultMessage: 'Order History',\n description: 'Link to order history',\n },\n 'header.user.menu.logout': {\n id: 'header.user.menu.logout',\n defaultMessage: 'Logout',\n description: 'Logout link',\n },\n 'header.user.menu.login': {\n id: 'header.user.menu.login',\n defaultMessage: 'Login',\n description: 'Login link',\n },\n 'header.user.menu.register': {\n id: 'header.user.menu.register',\n defaultMessage: 'Sign Up',\n description: 'Link to registration',\n },\n 'header.user.menu.studio.home': {\n id: 'header.user.menu.studio.home',\n defaultMessage: 'Studio Home',\n description: 'Link to the Studio Home',\n },\n 'header.label.account.nav': {\n id: 'header.label.account.nav',\n defaultMessage: 'Account',\n description: 'The aria label for the account menu nav',\n },\n 'header.label.account.menu': {\n id: 'header.label.account.menu',\n defaultMessage: 'Account Menu',\n description: 'The aria label for the account menu trigger',\n },\n 'header.label.account.menu.for': {\n id: 'header.label.account.menu.for',\n defaultMessage: 'Account menu for {username}',\n description: 'The aria label for the account menu trigger when the username is displayed in it',\n },\n 'header.label.main.nav': {\n id: 'header.label.main.nav',\n defaultMessage: 'Main',\n description: 'The aria label for the main menu nav',\n },\n 'header.label.main.menu': {\n id: 'header.label.main.menu',\n defaultMessage: 'Main Menu',\n description: 'The aria label for the main menu trigger',\n },\n 'header.label.main.header': {\n id: 'header.label.main.header',\n defaultMessage: 'Main',\n description: 'The aria label for the main header',\n },\n 'header.label.secondary.nav': {\n id: 'header.label.secondary.nav',\n defaultMessage: 'Secondary',\n description: 'The aria label for the seconary nav',\n },\n 'header.label.skip.nav': {\n id: 'header.label.skip.nav',\n defaultMessage: 'Skip to main content',\n description: 'A link used by screen readers to allow users to skip to the main content of the page.',\n },\n 'header.label.app.nav': {\n id: 'header.label.app.nav',\n defaultMessage: 'App',\n description: 'The aria label for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