@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.
- package/LICENSE +661 -0
- package/README.md +93 -0
- package/README.rst +193 -0
- package/dist/Avatar.js +43 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Header.js +130 -0
- package/dist/Header.js.map +1 -0
- package/dist/Header.messages.js +110 -0
- package/dist/Header.messages.js.map +1 -0
- package/dist/Header.test.jsx +104 -0
- package/dist/Icons.js +52 -0
- package/dist/Icons.js.map +1 -0
- package/dist/Logo.js +28 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Menu/Menu.js +321 -0
- package/dist/Menu/Menu.js.map +1 -0
- package/dist/Menu/index.js +3 -0
- package/dist/Menu/index.js.map +1 -0
- package/dist/Menu/menu.scss +45 -0
- package/dist/__snapshots__/Header.test.jsx.snap +445 -0
- package/dist/desktop-header/DesktopHeader.js +174 -0
- package/dist/desktop-header/DesktopHeader.js.map +1 -0
- package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js +51 -0
- package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js.map +1 -0
- package/dist/desktop-header/DesktopHeaderUserMenu.js +49 -0
- package/dist/desktop-header/DesktopHeaderUserMenu.js.map +1 -0
- package/dist/desktop-header/DesktopLoggedOutItems.js +22 -0
- package/dist/desktop-header/DesktopLoggedOutItems.js.map +1 -0
- package/dist/generic/messages.js +15 -0
- package/dist/generic/messages.js.map +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/images/omnikampus/artistanbul-logo.png +0 -0
- package/dist/images/omnikampus/omnikampus-just-logo.png +0 -0
- package/dist/images/omnikampus/omnikampus-logo.png +0 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/index.scss +248 -0
- package/dist/learning-header/AnonymousUserMenu.js +25 -0
- package/dist/learning-header/AnonymousUserMenu.js.map +1 -0
- package/dist/learning-header/AuthenticatedUserDropdown.js +57 -0
- package/dist/learning-header/AuthenticatedUserDropdown.js.map +1 -0
- package/dist/learning-header/LearningHeader.js +61 -0
- package/dist/learning-header/LearningHeader.js.map +1 -0
- package/dist/learning-header/LearningHeaderCourseInfo.js +24 -0
- package/dist/learning-header/LearningHeaderCourseInfo.js.map +1 -0
- package/dist/learning-header/LearningHeaderHelpLink.js +13 -0
- package/dist/learning-header/LearningHeaderHelpLink.js.map +1 -0
- package/dist/learning-header/LearningHeaderUserMenuItems.js +20 -0
- package/dist/learning-header/LearningHeaderUserMenuItems.js.map +1 -0
- package/dist/learning-header/LearningLoggedOutButtons.js +24 -0
- package/dist/learning-header/LearningLoggedOutButtons.js.map +1 -0
- package/dist/learning-header/messages.js +40 -0
- package/dist/learning-header/messages.js.map +1 -0
- package/dist/mobile-header/MobileHeader.js +192 -0
- package/dist/mobile-header/MobileHeader.js.map +1 -0
- package/dist/mobile-header/MobileHeaderMainMenu.js +46 -0
- package/dist/mobile-header/MobileHeaderMainMenu.js.map +1 -0
- package/dist/mobile-header/MobileHeaderUserMenu.js +38 -0
- package/dist/mobile-header/MobileHeaderUserMenu.js.map +1 -0
- package/dist/mobile-header/MobileLoggedOutItems.js +27 -0
- package/dist/mobile-header/MobileLoggedOutItems.js.map +1 -0
- package/dist/plugin-slots/CourseInfoSlot/README.md +125 -0
- package/dist/plugin-slots/CourseInfoSlot/images/add_custom_components_before_and_after_course_info.png +0 -0
- package/dist/plugin-slots/CourseInfoSlot/images/replace_course_info_with_custom_component.png +0 -0
- package/dist/plugin-slots/CourseInfoSlot/images/replace_course_title.png +0 -0
- package/dist/plugin-slots/CourseInfoSlot/index.js +31 -0
- package/dist/plugin-slots/CourseInfoSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopHeaderSlot/README.md +41 -0
- package/dist/plugin-slots/DesktopHeaderSlot/images/desktop_header_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopHeaderSlot/index.js +15 -0
- package/dist/plugin-slots/DesktopHeaderSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/README.md +134 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/README.md +134 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/README.md +129 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/README.md +141 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/LearningHelpSlot/README.md +41 -0
- package/dist/plugin-slots/LearningHelpSlot/images/learning_help_custom_component.png +0 -0
- package/dist/plugin-slots/LearningHelpSlot/index.js +10 -0
- package/dist/plugin-slots/LearningHelpSlot/index.js.map +1 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/README.md +132 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_component.png +0 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_modified_items.png +0 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js +17 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js.map +1 -0
- package/dist/plugin-slots/LearningUserMenuSlot/README.md +130 -0
- package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_component.png +0 -0
- package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_modified_items.png +0 -0
- package/dist/plugin-slots/LearningUserMenuSlot/index.js +17 -0
- package/dist/plugin-slots/LearningUserMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/LogoSlot/README.md +69 -0
- package/dist/plugin-slots/LogoSlot/index.js +26 -0
- package/dist/plugin-slots/LogoSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileHeaderSlot/README.md +41 -0
- package/dist/plugin-slots/MobileHeaderSlot/images/mobile_header_custom_component.png +0 -0
- package/dist/plugin-slots/MobileHeaderSlot/index.js +15 -0
- package/dist/plugin-slots/MobileHeaderSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/README.md +134 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_component.png +0 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_modify_items.png +0 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js +19 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileMainMenuSlot/README.md +134 -0
- package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_component.png +0 -0
- package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_modify_items.png +0 -0
- package/dist/plugin-slots/MobileMainMenuSlot/index.js +19 -0
- package/dist/plugin-slots/MobileMainMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileUserMenuSlot/README.md +142 -0
- package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_component.png +0 -0
- package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_modify_items.png +0 -0
- package/dist/plugin-slots/MobileUserMenuSlot/index.js +19 -0
- package/dist/plugin-slots/MobileUserMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/README.md +15 -0
- package/dist/setupTest.js +125 -0
- package/dist/studio-header/BrandNav.js +24 -0
- package/dist/studio-header/BrandNav.js.map +1 -0
- package/dist/studio-header/CourseLockUp.js +46 -0
- package/dist/studio-header/CourseLockUp.js.map +1 -0
- package/dist/studio-header/HeaderBody.js +143 -0
- package/dist/studio-header/HeaderBody.js.map +1 -0
- package/dist/studio-header/MobileHeader.js +79 -0
- package/dist/studio-header/MobileHeader.js.map +1 -0
- package/dist/studio-header/MobileMenu.js +46 -0
- package/dist/studio-header/MobileMenu.js.map +1 -0
- package/dist/studio-header/NavDropdownMenu.js +32 -0
- package/dist/studio-header/NavDropdownMenu.js.map +1 -0
- package/dist/studio-header/StudioHeader.js +79 -0
- package/dist/studio-header/StudioHeader.js.map +1 -0
- package/dist/studio-header/StudioHeader.scss +49 -0
- package/dist/studio-header/UserMenu.js +55 -0
- package/dist/studio-header/UserMenu.js.map +1 -0
- package/dist/studio-header/index.js +3 -0
- package/dist/studio-header/index.js.map +1 -0
- package/dist/studio-header/messages.js +55 -0
- package/dist/studio-header/messages.js.map +1 -0
- package/dist/studio-header/utils.js +26 -0
- package/dist/studio-header/utils.js.map +1 -0
- package/dist/test-utils.js +26 -0
- package/dist/test-utils.js.map +1 -0
- package/package.json +79 -0
@@ -0,0 +1,129 @@
|
|
1
|
+
# Desktop Secondary Menu Slot
|
2
|
+
|
3
|
+
### Slot ID: `desktop_secondary_menu_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the desktop secondary menu.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify Items
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the items in the desktop secondary menu.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifySecondaryMenu = ( widget ) => {
|
21
|
+
widget.content.menu = [
|
22
|
+
{
|
23
|
+
type: 'item',
|
24
|
+
href: 'https://www.youtube.com/c/openedx',
|
25
|
+
content: 'Open edX on YouTube',
|
26
|
+
},
|
27
|
+
{
|
28
|
+
type: 'item',
|
29
|
+
href: 'https://github.com/openedx/',
|
30
|
+
content: 'Open edX on GitHub',
|
31
|
+
}
|
32
|
+
];
|
33
|
+
return widget;
|
34
|
+
};
|
35
|
+
|
36
|
+
const config = {
|
37
|
+
pluginSlots: {
|
38
|
+
desktop_secondary_menu_slot: {
|
39
|
+
keepDefault: true,
|
40
|
+
plugins: [
|
41
|
+
{
|
42
|
+
op: PLUGIN_OPERATIONS.Modify,
|
43
|
+
widgetId: 'default_contents',
|
44
|
+
fn: modifySecondaryMenu,
|
45
|
+
},
|
46
|
+
]
|
47
|
+
},
|
48
|
+
},
|
49
|
+
}
|
50
|
+
|
51
|
+
export default config;
|
52
|
+
```
|
53
|
+
|
54
|
+
### Replace Menu with Custom Component
|
55
|
+
|
56
|
+
The following `env.config.jsx` will replace the desktop secondary menu entirely (in this case with a centered πΊοΈ `h1`)
|
57
|
+
|
58
|
+

|
59
|
+
|
60
|
+
```jsx
|
61
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
62
|
+
|
63
|
+
const config = {
|
64
|
+
pluginSlots: {
|
65
|
+
desktop_secondary_menu_slot: {
|
66
|
+
keepDefault: false,
|
67
|
+
plugins: [
|
68
|
+
{
|
69
|
+
op: PLUGIN_OPERATIONS.Insert,
|
70
|
+
widget: {
|
71
|
+
id: 'custom_secondary_menu_component',
|
72
|
+
type: DIRECT_PLUGIN,
|
73
|
+
RenderWidget: () => (
|
74
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
75
|
+
),
|
76
|
+
},
|
77
|
+
},
|
78
|
+
]
|
79
|
+
},
|
80
|
+
},
|
81
|
+
}
|
82
|
+
|
83
|
+
export default config;
|
84
|
+
```
|
85
|
+
|
86
|
+
### Add Custom Components before and after Menu
|
87
|
+
|
88
|
+
The following `env.config.jsx` will place custom components before and after the desktop secondary menu (in this case centered `h1`s with π and π).
|
89
|
+
|
90
|
+

|
91
|
+
|
92
|
+
```jsx
|
93
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
94
|
+
|
95
|
+
const config = {
|
96
|
+
pluginSlots: {
|
97
|
+
desktop_secondary_menu_slot: {
|
98
|
+
keepDefault: true,
|
99
|
+
plugins: [
|
100
|
+
{
|
101
|
+
op: PLUGIN_OPERATIONS.Insert,
|
102
|
+
widget: {
|
103
|
+
id: 'custom_before_secondary_menu_component',
|
104
|
+
type: DIRECT_PLUGIN,
|
105
|
+
priority: 10,
|
106
|
+
RenderWidget: () => (
|
107
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
108
|
+
),
|
109
|
+
},
|
110
|
+
},
|
111
|
+
{
|
112
|
+
op: PLUGIN_OPERATIONS.Insert,
|
113
|
+
widget: {
|
114
|
+
id: 'custom_after_secondary_menu_component',
|
115
|
+
type: DIRECT_PLUGIN,
|
116
|
+
priority: 90,
|
117
|
+
RenderWidget: () => (
|
118
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
119
|
+
),
|
120
|
+
},
|
121
|
+
},
|
122
|
+
]
|
123
|
+
},
|
124
|
+
},
|
125
|
+
}
|
126
|
+
|
127
|
+
export default config;
|
128
|
+
```
|
129
|
+
|
Binary file
|
Binary file
|
package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_modify_items.png
ADDED
Binary file
|
@@ -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 DesktopSecondaryMenuSlot = function DesktopSecondaryMenuSlot(_ref) {
|
5
|
+
var menu = _ref.menu;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "desktop_secondary_menu_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(DesktopHeaderMainOrSecondaryMenu, {
|
12
|
+
menu: menu
|
13
|
+
}));
|
14
|
+
};
|
15
|
+
DesktopSecondaryMenuSlot.propTypes = {
|
16
|
+
menu: desktopHeaderMainOrSecondaryMenuDataShape
|
17
|
+
};
|
18
|
+
export default DesktopSecondaryMenuSlot;
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","DesktopHeaderMainOrSecondaryMenu","desktopHeaderMainOrSecondaryMenuDataShape","DesktopSecondaryMenuSlot","_ref","menu","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/DesktopSecondaryMenuSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport DesktopHeaderMainOrSecondaryMenu, { desktopHeaderMainOrSecondaryMenuDataShape } from '../../desktop-header/DesktopHeaderMainOrSecondaryMenu';\n\nconst DesktopSecondaryMenuSlot = ({\n menu,\n}) => (\n <PluginSlot\n id=\"desktop_secondary_menu_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <DesktopHeaderMainOrSecondaryMenu menu={menu} />\n </PluginSlot>\n);\n\nDesktopSecondaryMenuSlot.propTypes = {\n menu: desktopHeaderMainOrSecondaryMenuDataShape,\n};\n\nexport default DesktopSecondaryMenuSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,gCAAgC,IAAIC,yCAAyC,QAAQ,uDAAuD;AAEnJ,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA;EAAA,IAC5BC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EAAA,oBAEJN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,6BAA6B;IAChCC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,gCAAgC;IAACI,IAAI,EAAEA;EAAK,CAAE,CACrC,CAAC;AAAA,CACd;AAEDF,wBAAwB,CAACO,SAAS,GAAG;EACnCL,IAAI,EAAEH;AACR,CAAC;AAED,eAAeC,wBAAwB","ignoreList":[]}
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# Desktop User Menu Slot
|
2
|
+
|
3
|
+
### Slot ID: `desktop_user_menu_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the desktop user menu.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify Items
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the items in the desktop user menu.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifyUserMenu = ( widget ) => {
|
21
|
+
widget.content.menu = [
|
22
|
+
{
|
23
|
+
items: [
|
24
|
+
{
|
25
|
+
type: 'item',
|
26
|
+
href: 'https://openedx.org/',
|
27
|
+
content: 'openedx.org',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'item',
|
31
|
+
href: 'https://docs.openedx.org/en/latest/',
|
32
|
+
content: 'Documentation',
|
33
|
+
},
|
34
|
+
]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
items: [
|
38
|
+
{
|
39
|
+
type: 'item',
|
40
|
+
href: 'https://discuss.openedx.org/',
|
41
|
+
content: 'Forums',
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
];
|
46
|
+
return widget;
|
47
|
+
};
|
48
|
+
|
49
|
+
const config = {
|
50
|
+
pluginSlots: {
|
51
|
+
desktop_user_menu_slot: {
|
52
|
+
keepDefault: true,
|
53
|
+
plugins: [
|
54
|
+
{
|
55
|
+
op: PLUGIN_OPERATIONS.Modify,
|
56
|
+
widgetId: 'default_contents',
|
57
|
+
fn: modifyUserMenu,
|
58
|
+
},
|
59
|
+
]
|
60
|
+
},
|
61
|
+
},
|
62
|
+
}
|
63
|
+
|
64
|
+
export default config;
|
65
|
+
```
|
66
|
+
|
67
|
+
### Replace Menu with Custom Component
|
68
|
+
|
69
|
+
The following `env.config.jsx` will replace the desktop user menu entirely (in this case with a centered πΊοΈ `h1`)
|
70
|
+
|
71
|
+

|
72
|
+
|
73
|
+
```jsx
|
74
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
75
|
+
|
76
|
+
const config = {
|
77
|
+
pluginSlots: {
|
78
|
+
desktop_user_menu_slot: {
|
79
|
+
keepDefault: false,
|
80
|
+
plugins: [
|
81
|
+
{
|
82
|
+
op: PLUGIN_OPERATIONS.Insert,
|
83
|
+
widget: {
|
84
|
+
id: 'custom_user_menu_component',
|
85
|
+
type: DIRECT_PLUGIN,
|
86
|
+
RenderWidget: () => (
|
87
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
88
|
+
),
|
89
|
+
},
|
90
|
+
},
|
91
|
+
]
|
92
|
+
},
|
93
|
+
},
|
94
|
+
}
|
95
|
+
|
96
|
+
export default config;
|
97
|
+
```
|
98
|
+
|
99
|
+
### Add Custom Components before and after Menu
|
100
|
+
|
101
|
+
The following `env.config.jsx` will place custom components before and after the desktop user menu (in this case centered `h1`s with π and π).
|
102
|
+
|
103
|
+

|
104
|
+
|
105
|
+
```jsx
|
106
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
107
|
+
|
108
|
+
const config = {
|
109
|
+
pluginSlots: {
|
110
|
+
desktop_user_menu_slot: {
|
111
|
+
keepDefault: true,
|
112
|
+
plugins: [
|
113
|
+
{
|
114
|
+
op: PLUGIN_OPERATIONS.Insert,
|
115
|
+
widget: {
|
116
|
+
id: 'custom_before_user_menu_component',
|
117
|
+
type: DIRECT_PLUGIN,
|
118
|
+
priority: 10,
|
119
|
+
RenderWidget: () => (
|
120
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
121
|
+
),
|
122
|
+
},
|
123
|
+
},
|
124
|
+
{
|
125
|
+
op: PLUGIN_OPERATIONS.Insert,
|
126
|
+
widget: {
|
127
|
+
id: 'custom_after_user_menu_component',
|
128
|
+
type: DIRECT_PLUGIN,
|
129
|
+
priority: 90,
|
130
|
+
RenderWidget: () => (
|
131
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
132
|
+
),
|
133
|
+
},
|
134
|
+
},
|
135
|
+
]
|
136
|
+
},
|
137
|
+
},
|
138
|
+
}
|
139
|
+
|
140
|
+
export default config;
|
141
|
+
```
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import DesktopHeaderUserMenu, { desktopUserMenuDataShape } from '../../desktop-header/DesktopHeaderUserMenu';
|
4
|
+
var DesktopUserMenuSlot = function DesktopUserMenuSlot(_ref) {
|
5
|
+
var menu = _ref.menu;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "desktop_user_menu_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(DesktopHeaderUserMenu, {
|
12
|
+
menu: menu
|
13
|
+
}));
|
14
|
+
};
|
15
|
+
DesktopUserMenuSlot.propTypes = {
|
16
|
+
menu: desktopUserMenuDataShape
|
17
|
+
};
|
18
|
+
export default DesktopUserMenuSlot;
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","DesktopHeaderUserMenu","desktopUserMenuDataShape","DesktopUserMenuSlot","_ref","menu","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/DesktopUserMenuSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport DesktopHeaderUserMenu, { desktopUserMenuDataShape } from '../../desktop-header/DesktopHeaderUserMenu';\n\nconst DesktopUserMenuSlot = ({\n menu,\n}) => (\n <PluginSlot\n id=\"desktop_user_menu_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <DesktopHeaderUserMenu menu={menu} />\n </PluginSlot>\n);\n\nDesktopUserMenuSlot.propTypes = {\n menu: desktopUserMenuDataShape,\n};\n\nexport default DesktopUserMenuSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,qBAAqB,IAAIC,wBAAwB,QAAQ,4CAA4C;AAE5G,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,qBAAqB;IAACI,IAAI,EAAEA;EAAK,CAAE,CAC1B,CAAC;AAAA,CACd;AAEDF,mBAAmB,CAACO,SAAS,GAAG;EAC9BL,IAAI,EAAEH;AACR,CAAC;AAED,eAAeC,mBAAmB","ignoreList":[]}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Learning Help Slot
|
2
|
+
|
3
|
+
### Slot ID: `learning_help_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the learning help link.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Custom Component
|
12
|
+
|
13
|
+
The following `env.config.jsx` will replace the help link entirely (in this case with a centered πΊοΈ `h1`)
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const config = {
|
21
|
+
pluginSlots: {
|
22
|
+
learning_help_slot: {
|
23
|
+
keepDefault: false,
|
24
|
+
plugins: [
|
25
|
+
{
|
26
|
+
op: PLUGIN_OPERATIONS.Insert,
|
27
|
+
widget: {
|
28
|
+
id: 'custom_learning_help_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
|
+
```
|
Binary file
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import LearningHeaderHelpLink from '../../learning-header/LearningHeaderHelpLink';
|
4
|
+
var LearningHelpSlot = function LearningHelpSlot() {
|
5
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
6
|
+
id: "learning_help_slot"
|
7
|
+
}, /*#__PURE__*/React.createElement(LearningHeaderHelpLink, null));
|
8
|
+
};
|
9
|
+
export default LearningHelpSlot;
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","LearningHeaderHelpLink","LearningHelpSlot","createElement","id"],"sources":["../../../src/plugin-slots/LearningHelpSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport LearningHeaderHelpLink from '../../learning-header/LearningHeaderHelpLink';\n\nconst LearningHelpSlot = () => (\n <PluginSlot id=\"learning_help_slot\">\n <LearningHeaderHelpLink />\n </PluginSlot>\n);\n\nexport default LearningHelpSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,sBAAsB,MAAM,8CAA8C;AAEjF,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAA;EAAA,oBACpBH,KAAA,CAAAI,aAAA,CAACH,UAAU;IAACI,EAAE,EAAC;EAAoB,gBACjCL,KAAA,CAAAI,aAAA,CAACF,sBAAsB,MAAE,CACf,CAAC;AAAA,CACd;AAED,eAAeC,gBAAgB","ignoreList":[]}
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# Learning Logged Out Items Slot
|
2
|
+
|
3
|
+
### Slot ID: `learning_logged_out_items_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the items shown on the learning header 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 the learning header when the user is logged out.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifyLoggedOutItems = ( widget ) => {
|
21
|
+
widget.content.buttonsInfo = [
|
22
|
+
{
|
23
|
+
href: 'https://docs.openedx.org/en/latest/',
|
24
|
+
message: 'Documentation',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
href: 'https://discuss.openedx.org/',
|
28
|
+
message: 'Forums',
|
29
|
+
},
|
30
|
+
{
|
31
|
+
href: 'https://openedx.org/',
|
32
|
+
message: 'openedx.org',
|
33
|
+
variant: 'primary',
|
34
|
+
},
|
35
|
+
];
|
36
|
+
return widget;
|
37
|
+
};
|
38
|
+
|
39
|
+
const config = {
|
40
|
+
pluginSlots: {
|
41
|
+
learning_logged_out_items_slot: {
|
42
|
+
keepDefault: true,
|
43
|
+
plugins: [
|
44
|
+
{
|
45
|
+
op: PLUGIN_OPERATIONS.Modify,
|
46
|
+
widgetId: 'default_contents',
|
47
|
+
fn: modifyLoggedOutItems,
|
48
|
+
},
|
49
|
+
]
|
50
|
+
},
|
51
|
+
},
|
52
|
+
}
|
53
|
+
|
54
|
+
export default config;
|
55
|
+
```
|
56
|
+
|
57
|
+
### Replace with Custom Component
|
58
|
+
|
59
|
+
The following `env.config.jsx` will replace the items shown in the learning header when the user is logged out entirely (in this case with a centered πΊοΈ `h1`)
|
60
|
+
|
61
|
+

|
62
|
+
|
63
|
+
```jsx
|
64
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
65
|
+
|
66
|
+
const config = {
|
67
|
+
pluginSlots: {
|
68
|
+
learning_logged_out_items_slot: {
|
69
|
+
keepDefault: false,
|
70
|
+
plugins: [
|
71
|
+
{
|
72
|
+
op: PLUGIN_OPERATIONS.Insert,
|
73
|
+
widget: {
|
74
|
+
id: 'custom_logged_out_items_component',
|
75
|
+
type: DIRECT_PLUGIN,
|
76
|
+
RenderWidget: () => (
|
77
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
78
|
+
),
|
79
|
+
},
|
80
|
+
},
|
81
|
+
]
|
82
|
+
},
|
83
|
+
},
|
84
|
+
}
|
85
|
+
|
86
|
+
export default config;
|
87
|
+
```
|
88
|
+
|
89
|
+
### Add Custom Components before and after
|
90
|
+
|
91
|
+
The following `env.config.jsx` will place custom components before and after the items shown in the learning header when the user is logged out (in this case centered `h1`s with π and π).
|
92
|
+
|
93
|
+

|
94
|
+
|
95
|
+
```jsx
|
96
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
97
|
+
|
98
|
+
const config = {
|
99
|
+
pluginSlots: {
|
100
|
+
learning_logged_out_items_slot: {
|
101
|
+
keepDefault: true,
|
102
|
+
plugins: [
|
103
|
+
{
|
104
|
+
op: PLUGIN_OPERATIONS.Insert,
|
105
|
+
widget: {
|
106
|
+
id: 'custom_before_logged_out_items_component',
|
107
|
+
type: DIRECT_PLUGIN,
|
108
|
+
priority: 10,
|
109
|
+
RenderWidget: () => (
|
110
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
111
|
+
),
|
112
|
+
},
|
113
|
+
},
|
114
|
+
{
|
115
|
+
op: PLUGIN_OPERATIONS.Insert,
|
116
|
+
widget: {
|
117
|
+
id: 'custom_after_logged_out_items_component',
|
118
|
+
type: DIRECT_PLUGIN,
|
119
|
+
priority: 90,
|
120
|
+
RenderWidget: () => (
|
121
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
122
|
+
),
|
123
|
+
},
|
124
|
+
},
|
125
|
+
]
|
126
|
+
},
|
127
|
+
},
|
128
|
+
}
|
129
|
+
|
130
|
+
export default config;
|
131
|
+
```
|
132
|
+
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import LearningLoggedOutButtons, { learningHeaderLoggedOutItemsDataShape } from '../../learning-header/LearningLoggedOutButtons';
|
4
|
+
var LearningLoggedOutItemsSlot = function LearningLoggedOutItemsSlot(_ref) {
|
5
|
+
var buttonsInfo = _ref.buttonsInfo;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "learning_logged_out_items_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(LearningLoggedOutButtons, {
|
12
|
+
buttonsInfo: buttonsInfo
|
13
|
+
}));
|
14
|
+
};
|
15
|
+
LearningLoggedOutItemsSlot.propTypes = learningHeaderLoggedOutItemsDataShape;
|
16
|
+
export default LearningLoggedOutItemsSlot;
|
17
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","LearningLoggedOutButtons","learningHeaderLoggedOutItemsDataShape","LearningLoggedOutItemsSlot","_ref","buttonsInfo","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/LearningLoggedOutItemsSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport LearningLoggedOutButtons, { learningHeaderLoggedOutItemsDataShape } from '../../learning-header/LearningLoggedOutButtons';\n\nconst LearningLoggedOutItemsSlot = ({\n buttonsInfo,\n}) => (\n <PluginSlot\n id=\"learning_logged_out_items_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <LearningLoggedOutButtons buttonsInfo={buttonsInfo} />\n </PluginSlot>\n);\n\nLearningLoggedOutItemsSlot.propTypes = learningHeaderLoggedOutItemsDataShape;\n\nexport default LearningLoggedOutItemsSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,wBAAwB,IAAIC,qCAAqC,QAAQ,gDAAgD;AAEhI,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAAC,IAAA;EAAA,IAC9BC,WAAW,GAAAD,IAAA,CAAXC,WAAW;EAAA,oBAEXN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,gCAAgC;IACnCC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,wBAAwB;IAACI,WAAW,EAAEA;EAAY,CAAE,CAC3C,CAAC;AAAA,CACd;AAEDF,0BAA0B,CAACO,SAAS,GAAGR,qCAAqC;AAE5E,eAAeC,0BAA0B","ignoreList":[]}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
# Learning User Menu Slot
|
2
|
+
|
3
|
+
### Slot ID: `learning_user_menu_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the learning user menu.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify Items
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the items in the learning user menu.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifyUserMenu = ( widget ) => {
|
21
|
+
widget.content.items = [
|
22
|
+
{
|
23
|
+
href: 'https://openedx.org/',
|
24
|
+
message: 'openedx.org',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
href: 'https://docs.openedx.org/en/latest/',
|
28
|
+
message: 'Documentation',
|
29
|
+
},
|
30
|
+
{
|
31
|
+
href: 'https://discuss.openedx.org/',
|
32
|
+
message: 'Forums',
|
33
|
+
}
|
34
|
+
];
|
35
|
+
return widget;
|
36
|
+
};
|
37
|
+
|
38
|
+
const config = {
|
39
|
+
pluginSlots: {
|
40
|
+
learning_user_menu_slot: {
|
41
|
+
keepDefault: true,
|
42
|
+
plugins: [
|
43
|
+
{
|
44
|
+
op: PLUGIN_OPERATIONS.Modify,
|
45
|
+
widgetId: 'default_contents',
|
46
|
+
fn: modifyUserMenu,
|
47
|
+
},
|
48
|
+
]
|
49
|
+
},
|
50
|
+
},
|
51
|
+
}
|
52
|
+
|
53
|
+
export default config;
|
54
|
+
```
|
55
|
+
|
56
|
+
### Replace Menu with Custom Component
|
57
|
+
|
58
|
+
The following `env.config.jsx` will replace the items in the learning user menu entirely (in this case with a centered πΊοΈ `h1`)
|
59
|
+
|
60
|
+

|
61
|
+
|
62
|
+
```jsx
|
63
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
64
|
+
|
65
|
+
const config = {
|
66
|
+
pluginSlots: {
|
67
|
+
learning_user_menu_slot: {
|
68
|
+
keepDefault: false,
|
69
|
+
plugins: [
|
70
|
+
{
|
71
|
+
op: PLUGIN_OPERATIONS.Insert,
|
72
|
+
widget: {
|
73
|
+
id: 'custom_user_menu_component',
|
74
|
+
type: DIRECT_PLUGIN,
|
75
|
+
RenderWidget: () => (
|
76
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
77
|
+
),
|
78
|
+
},
|
79
|
+
},
|
80
|
+
]
|
81
|
+
},
|
82
|
+
},
|
83
|
+
}
|
84
|
+
|
85
|
+
export default config;
|
86
|
+
```
|
87
|
+
|
88
|
+
### Add Custom Components before and after Menu
|
89
|
+
|
90
|
+
The following `env.config.jsx` will place custom components before and after the learning user menu (in this case centered `h1`s with π and π).
|
91
|
+
|
92
|
+

|
93
|
+
|
94
|
+
```jsx
|
95
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
96
|
+
|
97
|
+
const config = {
|
98
|
+
pluginSlots: {
|
99
|
+
learning_user_menu_slot: {
|
100
|
+
keepDefault: true,
|
101
|
+
plugins: [
|
102
|
+
{
|
103
|
+
op: PLUGIN_OPERATIONS.Insert,
|
104
|
+
widget: {
|
105
|
+
id: 'custom_before_user_menu_component',
|
106
|
+
type: DIRECT_PLUGIN,
|
107
|
+
priority: 10,
|
108
|
+
RenderWidget: () => (
|
109
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
110
|
+
),
|
111
|
+
},
|
112
|
+
},
|
113
|
+
{
|
114
|
+
op: PLUGIN_OPERATIONS.Insert,
|
115
|
+
widget: {
|
116
|
+
id: 'custom_after_user_menu_component',
|
117
|
+
type: DIRECT_PLUGIN,
|
118
|
+
priority: 90,
|
119
|
+
RenderWidget: () => (
|
120
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
121
|
+
),
|
122
|
+
},
|
123
|
+
},
|
124
|
+
]
|
125
|
+
},
|
126
|
+
},
|
127
|
+
}
|
128
|
+
|
129
|
+
export default config;
|
130
|
+
```
|