@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,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
|
+

|
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
|
+

|
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
|
+

|
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
|
+
```
|
Binary file
|
Binary file
|
Binary file
|
@@ -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
|
+

|
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
|
+
```
|
Binary file
|
@@ -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
|
+

|
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
|
+

|
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
|
+

|
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
|
+
|
Binary file
|
Binary file
|
package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_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 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
|
+

|
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
|
+

|
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
|
+

|
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
|
+
|
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 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":[]}
|