@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
@@ -0,0 +1,125 @@
1
+ # Course Info Slot
2
+
3
+ ### Slot ID: `course_info_slot`
4
+
5
+ ## Description
6
+
7
+ This slot is used to replace/modify/hide the course info.
8
+
9
+ ## Examples
10
+
11
+ ### Replace Course Title
12
+
13
+ The following `env.config.jsx` will replace the course title.
14
+
15
+ ![Screenshot of replaced course title](./images/replace_course_title.png)
16
+
17
+ ```jsx
18
+ import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
19
+
20
+ const replaceCourseTitle = ( widget ) => {
21
+ widget.content.courseTitle = "Custom Course Title";
22
+ return widget;
23
+ };
24
+
25
+ const config = {
26
+ pluginSlots: {
27
+ course_info_slot: {
28
+ keepDefault: true,
29
+ plugins: [
30
+ {
31
+ op: PLUGIN_OPERATIONS.Modify,
32
+ widgetId: 'default_contents',
33
+ fn: replaceCourseTitle,
34
+ },
35
+ ]
36
+ },
37
+ },
38
+ }
39
+
40
+ export default config;
41
+ ```
42
+
43
+ ### Replace Course Info with Custom Component
44
+
45
+ The following `env.config.jsx` will replace the course info entirely (in this case with a centered πŸ—ΊοΈ `h1`)
46
+
47
+ ![Screenshot of replaced course info with custom component](./images/replace_course_info_with_custom_component.png)
48
+
49
+ ```jsx
50
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
51
+
52
+ const config = {
53
+ pluginSlots: {
54
+ course_info_slot: {
55
+ keepDefault: false,
56
+ plugins: [
57
+ {
58
+ op: PLUGIN_OPERATIONS.Insert,
59
+ widget: {
60
+ id: 'custom_course_info_component',
61
+ type: DIRECT_PLUGIN,
62
+ RenderWidget: () => (
63
+ <h1 style={{textAlign: 'center'}}>πŸ—ΊοΈ</h1>
64
+ ),
65
+ },
66
+ },
67
+ ]
68
+ }
69
+ },
70
+ }
71
+
72
+ export default config;
73
+ ```
74
+
75
+ ### Add Custom Components before and after Course Info
76
+
77
+ The following `env.config.jsx` will place custom components before and after the course info (in this case centered `h1`s with 🌜 and πŸŒ›).
78
+
79
+ ![Screenshot of added custom components before and after course info](./images/add_custom_components_before_and_after_course_info.png)
80
+
81
+ ```jsx
82
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
83
+
84
+ const config = {
85
+ pluginSlots: {
86
+ course_info_slot: {
87
+ keepDefault: true,
88
+ plugins: [
89
+ {
90
+ op: PLUGIN_OPERATIONS.Insert,
91
+ widget: {
92
+ id: 'custom_before_course_info_component',
93
+ type: DIRECT_PLUGIN,
94
+ priority: 10,
95
+ RenderWidget: () => (
96
+ <h3 style={{
97
+ marginTop: 'auto',
98
+ marginBottom: 'auto',
99
+ marginRight: '0.5rem',
100
+ }}>🌜</h3>
101
+ ),
102
+ },
103
+ },
104
+ {
105
+ op: PLUGIN_OPERATIONS.Insert,
106
+ widget: {
107
+ id: 'custom_after_course_info_component',
108
+ type: DIRECT_PLUGIN,
109
+ priority: 90,
110
+ RenderWidget: () => (
111
+ <h3 style={{
112
+ marginTop: 'auto',
113
+ marginBottom: 'auto',
114
+ marginLeft: '0.5rem',
115
+ }}>πŸŒ›</h3>
116
+ ),
117
+ },
118
+ },
119
+ ]
120
+ },
121
+ },
122
+ }
123
+
124
+ export default config;
125
+ ```
@@ -0,0 +1,31 @@
1
+ var _excluded = ["courseOrg", "courseNumber", "courseTitle"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
5
+ import React from 'react';
6
+ import { PluginSlot } from '@openedx/frontend-plugin-framework';
7
+ import LearningHeaderCourseInfo, { courseInfoDataShape } from '../../learning-header/LearningHeaderCourseInfo';
8
+ var CourseInfoSlot = function CourseInfoSlot(_ref) {
9
+ var courseOrg = _ref.courseOrg,
10
+ courseNumber = _ref.courseNumber,
11
+ courseTitle = _ref.courseTitle,
12
+ attributes = _objectWithoutProperties(_ref, _excluded);
13
+ return /*#__PURE__*/React.createElement(PluginSlot, {
14
+ id: "course_info_slot",
15
+ slotOptions: {
16
+ mergeProps: true
17
+ },
18
+ pluginProps: {
19
+ courseOrg: courseOrg,
20
+ courseNumber: courseNumber,
21
+ courseTitle: courseTitle
22
+ }
23
+ }, /*#__PURE__*/React.createElement(LearningHeaderCourseInfo, _extends({
24
+ courseOrg: courseOrg,
25
+ courseNumber: courseNumber,
26
+ courseTitle: courseTitle
27
+ }, attributes)));
28
+ };
29
+ CourseInfoSlot.propTypes = courseInfoDataShape;
30
+ export default CourseInfoSlot;
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","PluginSlot","LearningHeaderCourseInfo","courseInfoDataShape","CourseInfoSlot","_ref","courseOrg","courseNumber","courseTitle","attributes","_objectWithoutProperties","_excluded","createElement","id","slotOptions","mergeProps","pluginProps","_extends","propTypes"],"sources":["../../../src/plugin-slots/CourseInfoSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport LearningHeaderCourseInfo, { courseInfoDataShape } from '../../learning-header/LearningHeaderCourseInfo';\n\nconst CourseInfoSlot = ({\n courseOrg,\n courseNumber,\n courseTitle,\n ...attributes\n}) => (\n <PluginSlot\n id=\"course_info_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n pluginProps={{\n courseOrg,\n courseNumber,\n courseTitle,\n }}\n >\n <LearningHeaderCourseInfo\n courseOrg={courseOrg}\n courseNumber={courseNumber}\n courseTitle={courseTitle}\n {...attributes}\n />\n </PluginSlot>\n);\n\nCourseInfoSlot.propTypes = courseInfoDataShape;\n\nexport default CourseInfoSlot;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,wBAAwB,IAAIC,mBAAmB,QAAQ,gDAAgD;AAE9G,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA;EAAA,IAClBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACRC,UAAU,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBAEbX,KAAA,CAAAY,aAAA,CAACX,UAAU;IACTY,EAAE,EAAC,kBAAkB;IACrBC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd,CAAE;IACFC,WAAW,EAAE;MACXV,SAAS,EAATA,SAAS;MACTC,YAAY,EAAZA,YAAY;MACZC,WAAW,EAAXA;IACF;EAAE,gBAEFR,KAAA,CAAAY,aAAA,CAACV,wBAAwB,EAAAe,QAAA;IACvBX,SAAS,EAAEA,SAAU;IACrBC,YAAY,EAAEA,YAAa;IAC3BC,WAAW,EAAEA;EAAY,GACrBC,UAAU,CACf,CACS,CAAC;AAAA,CACd;AAEDL,cAAc,CAACc,SAAS,GAAGf,mBAAmB;AAE9C,eAAeC,cAAc","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ # Desktop Header Slot
2
+
3
+ ### Slot ID: `desktop_header_slot`
4
+
5
+ ## Description
6
+
7
+ This slot is used to replace/modify/hide the entire desktop header.
8
+
9
+ ## Examples
10
+
11
+ ### Custom Component
12
+
13
+ The following `env.config.jsx` will replace the desktop header entirely (in this case with a centered πŸ—ΊοΈ `h1`)
14
+
15
+ ![Screenshot of custom component](./images/desktop_header_custom_component.png)
16
+
17
+ ```jsx
18
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
19
+
20
+ const config = {
21
+ pluginSlots: {
22
+ desktop_header_slot: {
23
+ keepDefault: false,
24
+ plugins: [
25
+ {
26
+ op: PLUGIN_OPERATIONS.Insert,
27
+ widget: {
28
+ id: 'custom_desktop_header_component',
29
+ type: DIRECT_PLUGIN,
30
+ RenderWidget: () => (
31
+ <h1 style={{textAlign: 'center'}}>πŸ—ΊοΈ</h1>
32
+ ),
33
+ },
34
+ },
35
+ ]
36
+ }
37
+ },
38
+ }
39
+
40
+ export default config;
41
+ ```
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { PluginSlot } from '@openedx/frontend-plugin-framework';
3
+ import DesktopHeader, { desktopHeaderDataShape } from '../../desktop-header/DesktopHeader';
4
+ var DesktopHeaderSlot = function DesktopHeaderSlot(_ref) {
5
+ var props = _ref.props;
6
+ return /*#__PURE__*/React.createElement(PluginSlot, {
7
+ id: "desktop_header_slot",
8
+ slotOptions: {
9
+ mergeProps: true
10
+ }
11
+ }, /*#__PURE__*/React.createElement(DesktopHeader, props));
12
+ };
13
+ DesktopHeaderSlot.propTypes = desktopHeaderDataShape;
14
+ export default DesktopHeaderSlot;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","PluginSlot","DesktopHeader","desktopHeaderDataShape","DesktopHeaderSlot","_ref","props","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/DesktopHeaderSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport DesktopHeader, { desktopHeaderDataShape } from '../../desktop-header/DesktopHeader';\n\nconst DesktopHeaderSlot = ({\n props,\n}) => (\n <PluginSlot\n id=\"desktop_header_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <DesktopHeader {...props} />\n </PluginSlot>\n);\n\nDesktopHeaderSlot.propTypes = desktopHeaderDataShape;\n\nexport default DesktopHeaderSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,aAAa,IAAIC,sBAAsB,QAAQ,oCAAoC;AAE1F,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA;EAAA,IACrBC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,oBAELN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,qBAAqB;IACxBC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,aAAa,EAAKI,KAAQ,CACjB,CAAC;AAAA,CACd;AAEDF,iBAAiB,CAACO,SAAS,GAAGR,sBAAsB;AAEpD,eAAeC,iBAAiB","ignoreList":[]}
@@ -0,0 +1,134 @@
1
+ # Desktop Logged Out Items Slot
2
+
3
+ ### Slot ID: `desktop_logged_out_items_slot`
4
+
5
+ ## Description
6
+
7
+ This slot is used to replace/modify/hide the items shown on desktop when the user is logged out.
8
+
9
+ ## Examples
10
+
11
+ ### Modify Items
12
+
13
+ The following `env.config.jsx` will modify the items shown on desktop when the user is logged out.
14
+
15
+ ![Screenshot of modified items](./images/desktop_logged_out_items_modify_items.png)
16
+
17
+ ```jsx
18
+ import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
19
+
20
+ const modifyLoggedOutItems = ( widget ) => {
21
+ widget.content.items = [
22
+ {
23
+ type: 'item',
24
+ href: 'https://openedx.org/',
25
+ content: 'openedx.org',
26
+ },
27
+ {
28
+ type: 'item',
29
+ href: 'https://docs.openedx.org/en/latest/',
30
+ content: 'Documentation',
31
+ },
32
+ {
33
+ type: 'item',
34
+ href: 'https://discuss.openedx.org/',
35
+ content: 'Forums',
36
+ }
37
+ ];
38
+ return widget;
39
+ };
40
+
41
+ const config = {
42
+ pluginSlots: {
43
+ desktop_logged_out_items_slot: {
44
+ keepDefault: true,
45
+ plugins: [
46
+ {
47
+ op: PLUGIN_OPERATIONS.Modify,
48
+ widgetId: 'default_contents',
49
+ fn: modifyLoggedOutItems,
50
+ },
51
+ ]
52
+ },
53
+ },
54
+ }
55
+
56
+ export default config;
57
+ ```
58
+
59
+ ### Replace with Custom Component
60
+
61
+ The following `env.config.jsx` will replace the items shown on desktop when the user is logged out entirely (in this case with a centered πŸ—ΊοΈ `h1`)
62
+
63
+ ![Screenshot of custom component](./images/desktop_logged_out_items_custom_component.png)
64
+
65
+ ```jsx
66
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
67
+
68
+ const config = {
69
+ pluginSlots: {
70
+ desktop_logged_out_items_slot: {
71
+ keepDefault: false,
72
+ plugins: [
73
+ {
74
+ op: PLUGIN_OPERATIONS.Insert,
75
+ widget: {
76
+ id: 'custom_logged_out_items_component',
77
+ type: DIRECT_PLUGIN,
78
+ RenderWidget: () => (
79
+ <h1 style={{textAlign: 'center'}}>πŸ—ΊοΈ</h1>
80
+ ),
81
+ },
82
+ },
83
+ ]
84
+ },
85
+ },
86
+ }
87
+
88
+ export default config;
89
+ ```
90
+
91
+ ### Add Custom Components before and after
92
+
93
+ The following `env.config.jsx` will place custom components before and after the items shown on desktop when the user is logged out (in this case centered `h1`s with 🌜 and πŸŒ›).
94
+
95
+ ![Screenshot of custom components before and after](./images/desktop_logged_out_items_custom_components_before_after.png)
96
+
97
+ ```jsx
98
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
99
+
100
+ const config = {
101
+ pluginSlots: {
102
+ desktop_logged_out_items_slot: {
103
+ keepDefault: true,
104
+ plugins: [
105
+ {
106
+ op: PLUGIN_OPERATIONS.Insert,
107
+ widget: {
108
+ id: 'custom_before_logged_out_items_component',
109
+ type: DIRECT_PLUGIN,
110
+ priority: 10,
111
+ RenderWidget: () => (
112
+ <h1 style={{textAlign: 'center'}}>🌜</h1>
113
+ ),
114
+ },
115
+ },
116
+ {
117
+ op: PLUGIN_OPERATIONS.Insert,
118
+ widget: {
119
+ id: 'custom_after_logged_out_items_component',
120
+ type: DIRECT_PLUGIN,
121
+ priority: 90,
122
+ RenderWidget: () => (
123
+ <h1 style={{textAlign: 'center'}}>πŸŒ›</h1>
124
+ ),
125
+ },
126
+ },
127
+ ]
128
+ },
129
+ },
130
+ }
131
+
132
+ export default config;
133
+ ```
134
+
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { PluginSlot } from '@openedx/frontend-plugin-framework';
3
+ import DesktopLoggedOutItems, { desktopLoggedOutItemsDataShape } from '../../desktop-header/DesktopLoggedOutItems';
4
+ var DesktopLoggedOutItemsSlot = function DesktopLoggedOutItemsSlot(_ref) {
5
+ var items = _ref.items;
6
+ return /*#__PURE__*/React.createElement(PluginSlot, {
7
+ id: "desktop_logged_out_items_slot",
8
+ slotOptions: {
9
+ mergeProps: true
10
+ }
11
+ }, /*#__PURE__*/React.createElement(DesktopLoggedOutItems, {
12
+ items: items
13
+ }));
14
+ };
15
+ DesktopLoggedOutItemsSlot.propTypes = {
16
+ items: desktopLoggedOutItemsDataShape
17
+ };
18
+ export default DesktopLoggedOutItemsSlot;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","PluginSlot","DesktopLoggedOutItems","desktopLoggedOutItemsDataShape","DesktopLoggedOutItemsSlot","_ref","items","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/DesktopLoggedOutItemsSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport DesktopLoggedOutItems, { desktopLoggedOutItemsDataShape } from '../../desktop-header/DesktopLoggedOutItems';\n\nconst DesktopLoggedOutItemsSlot = ({\n items,\n}) => (\n <PluginSlot\n id=\"desktop_logged_out_items_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <DesktopLoggedOutItems items={items} />\n </PluginSlot>\n);\n\nDesktopLoggedOutItemsSlot.propTypes = {\n items: desktopLoggedOutItemsDataShape,\n};\n\nexport default DesktopLoggedOutItemsSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,qBAAqB,IAAIC,8BAA8B,QAAQ,4CAA4C;AAElH,IAAMC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,IAAA;EAAA,IAC7BC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,oBAELN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,+BAA+B;IAClCC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,qBAAqB;IAACI,KAAK,EAAEA;EAAM,CAAE,CAC5B,CAAC;AAAA,CACd;AAEDF,yBAAyB,CAACO,SAAS,GAAG;EACpCL,KAAK,EAAEH;AACT,CAAC;AAED,eAAeC,yBAAyB","ignoreList":[]}
@@ -0,0 +1,134 @@
1
+ # Desktop Main Menu Slot
2
+
3
+ ### Slot ID: `desktop_main_menu_slot`
4
+
5
+ ## Description
6
+
7
+ This slot is used to replace/modify/hide the desktop main menu.
8
+
9
+ ## Examples
10
+
11
+ ### Modify Items
12
+
13
+ The following `env.config.jsx` will modify the items in the desktop main menu.
14
+
15
+ ![Screenshot of modified items](./images/desktop_main_menu_modify_items.png)
16
+
17
+ ```jsx
18
+ import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
19
+
20
+ const modifyMainMenu = ( widget ) => {
21
+ widget.content.menu = [
22
+ {
23
+ type: 'item',
24
+ href: 'https://openedx.org/',
25
+ content: 'openedx.org',
26
+ },
27
+ {
28
+ type: 'item',
29
+ href: 'https://docs.openedx.org/en/latest/',
30
+ content: 'Documentation',
31
+ },
32
+ {
33
+ type: 'item',
34
+ href: 'https://discuss.openedx.org/',
35
+ content: 'Forums',
36
+ }
37
+ ];
38
+ return widget;
39
+ };
40
+
41
+ const config = {
42
+ pluginSlots: {
43
+ desktop_main_menu_slot: {
44
+ keepDefault: true,
45
+ plugins: [
46
+ {
47
+ op: PLUGIN_OPERATIONS.Modify,
48
+ widgetId: 'default_contents',
49
+ fn: modifyMainMenu,
50
+ },
51
+ ]
52
+ },
53
+ },
54
+ }
55
+
56
+ export default config;
57
+ ```
58
+
59
+ ### Replace Menu with Custom Component
60
+
61
+ The following `env.config.jsx` will replace the desktop main menu entirely (in this case with a centered πŸ—ΊοΈ `h1`)
62
+
63
+ ![Screenshot of custom component](./images/desktop_main_menu_custom_component.png)
64
+
65
+ ```jsx
66
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
67
+
68
+ const config = {
69
+ pluginSlots: {
70
+ desktop_main_menu_slot: {
71
+ keepDefault: false,
72
+ plugins: [
73
+ {
74
+ op: PLUGIN_OPERATIONS.Insert,
75
+ widget: {
76
+ id: 'custom_main_menu_component',
77
+ type: DIRECT_PLUGIN,
78
+ RenderWidget: () => (
79
+ <h1 style={{textAlign: 'center'}}>πŸ—ΊοΈ</h1>
80
+ ),
81
+ },
82
+ },
83
+ ]
84
+ },
85
+ },
86
+ }
87
+
88
+ export default config;
89
+ ```
90
+
91
+ ### Add Custom Components before and after Menu
92
+
93
+ The following `env.config.jsx` will place custom components before and after the desktop main menu (in this case centered `h1`s with 🌜 and πŸŒ›).
94
+
95
+ ![Screenshot of custom components before and after](./images/desktop_main_menu_custom_components_before_after.png)
96
+
97
+ ```jsx
98
+ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
99
+
100
+ const config = {
101
+ pluginSlots: {
102
+ desktop_main_menu_slot: {
103
+ keepDefault: true,
104
+ plugins: [
105
+ {
106
+ op: PLUGIN_OPERATIONS.Insert,
107
+ widget: {
108
+ id: 'custom_before_main_menu_component',
109
+ type: DIRECT_PLUGIN,
110
+ priority: 10,
111
+ RenderWidget: () => (
112
+ <h1 style={{textAlign: 'center'}}>🌜</h1>
113
+ ),
114
+ },
115
+ },
116
+ {
117
+ op: PLUGIN_OPERATIONS.Insert,
118
+ widget: {
119
+ id: 'custom_after_main_menu_component',
120
+ type: DIRECT_PLUGIN,
121
+ priority: 90,
122
+ RenderWidget: () => (
123
+ <h1 style={{textAlign: 'center'}}>πŸŒ›</h1>
124
+ ),
125
+ },
126
+ },
127
+ ]
128
+ },
129
+ },
130
+ }
131
+
132
+ export default config;
133
+ ```
134
+
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { PluginSlot } from '@openedx/frontend-plugin-framework';
3
+ import DesktopHeaderMainOrSecondaryMenu, { desktopHeaderMainOrSecondaryMenuDataShape } from '../../desktop-header/DesktopHeaderMainOrSecondaryMenu';
4
+ var DesktopMainMenuSlot = function DesktopMainMenuSlot(_ref) {
5
+ var menu = _ref.menu;
6
+ return /*#__PURE__*/React.createElement(PluginSlot, {
7
+ id: "desktop_main_menu_slot",
8
+ slotOptions: {
9
+ mergeProps: true
10
+ }
11
+ }, /*#__PURE__*/React.createElement(DesktopHeaderMainOrSecondaryMenu, {
12
+ menu: menu
13
+ }));
14
+ };
15
+ DesktopMainMenuSlot.propTypes = {
16
+ menu: desktopHeaderMainOrSecondaryMenuDataShape
17
+ };
18
+ export default DesktopMainMenuSlot;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","PluginSlot","DesktopHeaderMainOrSecondaryMenu","desktopHeaderMainOrSecondaryMenuDataShape","DesktopMainMenuSlot","_ref","menu","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/DesktopMainMenuSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport DesktopHeaderMainOrSecondaryMenu, { desktopHeaderMainOrSecondaryMenuDataShape } from '../../desktop-header/DesktopHeaderMainOrSecondaryMenu';\n\nconst DesktopMainMenuSlot = ({\n menu,\n}) => (\n <PluginSlot\n id=\"desktop_main_menu_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <DesktopHeaderMainOrSecondaryMenu menu={menu} />\n </PluginSlot>\n);\n\nDesktopMainMenuSlot.propTypes = {\n menu: desktopHeaderMainOrSecondaryMenuDataShape,\n};\n\nexport default DesktopMainMenuSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,gCAAgC,IAAIC,yCAAyC,QAAQ,uDAAuD;AAEnJ,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAAC,IAAA;EAAA,IACvBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EAAA,oBAEJN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,wBAAwB;IAC3BC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,gCAAgC;IAACI,IAAI,EAAEA;EAAK,CAAE,CACrC,CAAC;AAAA,CACd;AAEDF,mBAAmB,CAACO,SAAS,GAAG;EAC9BL,IAAI,EAAEH;AACR,CAAC;AAED,eAAeC,mBAAmB","ignoreList":[]}